MediaWiki mediawikiwiki https://www.mediawiki.org/wiki/MediaWiki MediaWiki 1.46.0-wmf.26 first-letter Media Special Talk User User talk Project Project talk File File talk MediaWiki MediaWiki talk Template Template talk Help Help talk Category Category talk Thread Thread talk Summary Summary talk Manual Manual talk Extension Extension talk API API talk Skin Skin talk TimedText TimedText talk Module Module talk Translations Translations talk Event Event talk Topic Newsletter Newsletter talk Manual:$wgNamespacesWithSubpages 100 2952 8364486 8345966 2026-05-03T16:04:45Z Nerun 899342 Default value in v1.39+ 8364486 wikitext text/x-wiki <languages /> {{SettingSummary |name=NamespacesWithSubpages |version_min=pre 1.1.0 |section=Namespaces |range=''<translate><!--T:1--> see below</translate>'' |default=''<translate><!--T:2--> see below</translate>'' |summary=<translate><!--T:3--> Which namespaces should support subpages?</translate> }} <translate> == Details == <!--T:4--> </translate> <translate><!--T:5--> The variable holds an array indicating which namespaces allow sub-pages.</translate> <translate><!--T:6--> The array is indexed by the numeric namespace ID, and each array value is either <tvar name=1>{{phpi|false}}</tvar> (no sub-pages) or <tvar name=2>{{phpi|true}}</tvar> (sub-pages allowed).</translate> <translate><!--T:7--> A categoryspace (namespace 14) subpage will work like any other category.</translate> <translate> <!--T:8--> See <tvar name=1>{{ll|Help:Subpages}}</tvar>. == Enabling for a namespace == <!--T:9--> </translate> : <translate><!--T:10--> See also <tvar name=1>{{ll|Manual:Namespace constants}}</tvar> for a list of the <tvar name=ns><code>NS_...</code></tvar> codes.</translate> <translate> <!--T:11--> The normal way to enable subpages for a given namespace is to edit the <tvar name=LocalSettings><code>{{ll|Manual:LocalSettings.php|LocalSettings.php}}</code></tvar> and insert the following: </translate> <syntaxhighlight lang="php"> # <translate nowrap><!--T:12--> Enable subpages in the main namespace</translate> $wgNamespacesWithSubpages[NS_MAIN] = true; # <translate nowrap><!--T:13--> Enable subpages in the template namespace</translate> $wgNamespacesWithSubpages[NS_TEMPLATE] = true; # <translate nowrap><!--T:14--> etc.</translate> </syntaxhighlight> <translate> == Disabling for a namespace == <!--T:15--> </translate> <translate><!--T:16--> Disable subpages in a namespace (where it is enabled by default).</translate> <translate><!--T:17--> For example <tvar name=talk><code>NS_TALK</code></tvar> has subpages enabled by default in MediaWiki.</translate> <translate><!--T:18--> To disable them, set <tvar name=false><code>false</code></tvar>:</translate> <syntaxhighlight lang="php"> $wgNamespacesWithSubpages[NS_TALK] = false; </syntaxhighlight> <translate> == Default value == <!--T:26--> </translate> {{Note|1=<translate><!--T:27--> The default of this setting has changed over the years.</translate> <translate><!--T:28--> To be sure which one applies to your wiki check this setting in <tvar name=1><code>DefaultSettings.php</code></tvar>.</translate>}} {{Note|1=<translate><code>DefaultSettings.php</code> is deprecated since version 1.39. Instead run <code>php maintenance/run.php getConfiguration.php --settings wgNamespacesWithSubpages</code>. Namespaces (<code>i:</code>) will be listed by number. A <code>b:1</code> after a namespace means <code>true</code>.</translate>}} {{MW 1.39|+}} <syntaxhighlight lang="json" highlight="10"> a:1:{s:24:"wgNamespacesWithSubpages";a:15:{i:1;b:1;i:2;b:1;i:3;b:1;i:4;b:1;i:5;b:1;i:7;b:1;i:8;b:1;i:9;b:1;i:10;b:1;i:11;b:1;i:12;b:1;i:13;b:1;i:15;b:1;i:828;b:1;i:829;b:1;}} </syntaxhighlight> {{MW 1.29|+}} <syntaxhighlight lang="php" highlight="10"> $wgNamespacesWithSubpages = [ NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT => true, NS_PROJECT_TALK => true, NS_FILE_TALK => true, NS_MEDIAWIKI => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE => true, NS_TEMPLATE_TALK => true, NS_HELP => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ]; </syntaxhighlight> {{MW version|version=1.21|version2=1.28}} <syntaxhighlight lang="php" highlight="5,11"> $wgNamespacesWithSubpages = [ NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT => true, NS_PROJECT_TALK => true, NS_FILE_TALK => true, NS_MEDIAWIKI => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE_TALK => true, NS_HELP => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ]; </syntaxhighlight> {{MW version|version=1.16|version2=1.20}} <syntaxhighlight lang="php" highlight="7"> $wgNamespacesWithSubpages = array( NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT_TALK => true, NS_FILE_TALK => true, NS_MEDIAWIKI => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE_TALK => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ); </syntaxhighlight> {{MW version|version=1.14|version2=1.15}} <syntaxhighlight lang="php" highlight="6"> $wgNamespacesWithSubpages = array( NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT_TALK => true, NS_FILE_TALK => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE_TALK => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ); </syntaxhighlight> {{MW version|version=1.5|version2=1.13}} <syntaxhighlight lang="php"> $wgNamespacesWithSubpages = array( NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT_TALK => true, NS_IMAGE_TALK => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE_TALK => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ); </syntaxhighlight> <translate> == See also == <!--T:29--> </translate> {{OnWikimedia|1=<translate><!--T:30--> View the values of this configuration setting on the Wikimedia wikis in <tvar name=1>[https://noc.wikimedia.org/conf/highlight.php?file=core-Namespaces.php core-Namespaces.php]</tvar>.</translate>}} * {{ll|Help:Subpages}} * {{ll|Manual:Namespace}} * {{ll|Manual:Namespace constants}} * {{ll|Manual:$wgMaximumMovedPages}} * {{ll|Manual:Hooks/SkinSubPageSubtitle}} [[Category:Namespace variables{{#translation:}}]] [[Category:Subpage variables{{#translation:}}]] 8nun5c90nguht5v5zdkisrh8tvduc1d 8364487 8364486 2026-05-03T16:07:32Z Nerun 899342 namespace number link 8364487 wikitext text/x-wiki <languages /> {{SettingSummary |name=NamespacesWithSubpages |version_min=pre 1.1.0 |section=Namespaces |range=''<translate><!--T:1--> see below</translate>'' |default=''<translate><!--T:2--> see below</translate>'' |summary=<translate><!--T:3--> Which namespaces should support subpages?</translate> }} <translate> == Details == <!--T:4--> </translate> <translate><!--T:5--> The variable holds an array indicating which namespaces allow sub-pages.</translate> <translate><!--T:6--> The array is indexed by the numeric namespace ID, and each array value is either <tvar name=1>{{phpi|false}}</tvar> (no sub-pages) or <tvar name=2>{{phpi|true}}</tvar> (sub-pages allowed).</translate> <translate><!--T:7--> A categoryspace (namespace 14) subpage will work like any other category.</translate> <translate> <!--T:8--> See <tvar name=1>{{ll|Help:Subpages}}</tvar>. == Enabling for a namespace == <!--T:9--> </translate> : <translate><!--T:10--> See also <tvar name=1>{{ll|Manual:Namespace constants}}</tvar> for a list of the <tvar name=ns><code>NS_...</code></tvar> codes.</translate> <translate> <!--T:11--> The normal way to enable subpages for a given namespace is to edit the <tvar name=LocalSettings><code>{{ll|Manual:LocalSettings.php|LocalSettings.php}}</code></tvar> and insert the following: </translate> <syntaxhighlight lang="php"> # <translate nowrap><!--T:12--> Enable subpages in the main namespace</translate> $wgNamespacesWithSubpages[NS_MAIN] = true; # <translate nowrap><!--T:13--> Enable subpages in the template namespace</translate> $wgNamespacesWithSubpages[NS_TEMPLATE] = true; # <translate nowrap><!--T:14--> etc.</translate> </syntaxhighlight> <translate> == Disabling for a namespace == <!--T:15--> </translate> <translate><!--T:16--> Disable subpages in a namespace (where it is enabled by default).</translate> <translate><!--T:17--> For example <tvar name=talk><code>NS_TALK</code></tvar> has subpages enabled by default in MediaWiki.</translate> <translate><!--T:18--> To disable them, set <tvar name=false><code>false</code></tvar>:</translate> <syntaxhighlight lang="php"> $wgNamespacesWithSubpages[NS_TALK] = false; </syntaxhighlight> <translate> == Default value == <!--T:26--> </translate> {{Note|1=<translate><!--T:27--> The default of this setting has changed over the years.</translate> <translate><!--T:28--> To be sure which one applies to your wiki check this setting in <tvar name=1><code>DefaultSettings.php</code></tvar>.</translate>}} {{Note|1=<translate><code>DefaultSettings.php</code> is deprecated since version 1.39. Instead run <code>php maintenance/run.php getConfiguration.php --settings wgNamespacesWithSubpages</code>. Namespaces (<code>i:</code>) will be listed by number (see [[Help:Namespaces#Localisation|Namespace numbers]]). A <code>b:1</code> after a namespace means <code>true</code>.</translate>}} {{MW 1.39|+}} <syntaxhighlight lang="json" highlight="10"> a:1:{s:24:"wgNamespacesWithSubpages";a:15:{i:1;b:1;i:2;b:1;i:3;b:1;i:4;b:1;i:5;b:1;i:7;b:1;i:8;b:1;i:9;b:1;i:10;b:1;i:11;b:1;i:12;b:1;i:13;b:1;i:15;b:1;i:828;b:1;i:829;b:1;}} </syntaxhighlight> {{MW 1.29|+}} <syntaxhighlight lang="php" highlight="10"> $wgNamespacesWithSubpages = [ NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT => true, NS_PROJECT_TALK => true, NS_FILE_TALK => true, NS_MEDIAWIKI => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE => true, NS_TEMPLATE_TALK => true, NS_HELP => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ]; </syntaxhighlight> {{MW version|version=1.21|version2=1.28}} <syntaxhighlight lang="php" highlight="5,11"> $wgNamespacesWithSubpages = [ NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT => true, NS_PROJECT_TALK => true, NS_FILE_TALK => true, NS_MEDIAWIKI => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE_TALK => true, NS_HELP => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ]; </syntaxhighlight> {{MW version|version=1.16|version2=1.20}} <syntaxhighlight lang="php" highlight="7"> $wgNamespacesWithSubpages = array( NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT_TALK => true, NS_FILE_TALK => true, NS_MEDIAWIKI => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE_TALK => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ); </syntaxhighlight> {{MW version|version=1.14|version2=1.15}} <syntaxhighlight lang="php" highlight="6"> $wgNamespacesWithSubpages = array( NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT_TALK => true, NS_FILE_TALK => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE_TALK => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ); </syntaxhighlight> {{MW version|version=1.5|version2=1.13}} <syntaxhighlight lang="php"> $wgNamespacesWithSubpages = array( NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT_TALK => true, NS_IMAGE_TALK => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE_TALK => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ); </syntaxhighlight> <translate> == See also == <!--T:29--> </translate> {{OnWikimedia|1=<translate><!--T:30--> View the values of this configuration setting on the Wikimedia wikis in <tvar name=1>[https://noc.wikimedia.org/conf/highlight.php?file=core-Namespaces.php core-Namespaces.php]</tvar>.</translate>}} * {{ll|Help:Subpages}} * {{ll|Manual:Namespace}} * {{ll|Manual:Namespace constants}} * {{ll|Manual:$wgMaximumMovedPages}} * {{ll|Manual:Hooks/SkinSubPageSubtitle}} [[Category:Namespace variables{{#translation:}}]] [[Category:Subpage variables{{#translation:}}]] 8cqz21t211xe9cqt6j73yxnkz620k3q 8364758 8364487 2026-05-03T22:45:09Z Shirayuki 472859 8364758 wikitext text/x-wiki <languages /> {{SettingSummary |name=NamespacesWithSubpages |version_min=pre 1.1.0 |section=Namespaces |range=''<translate><!--T:1--> see below</translate>'' |default=''<translate><!--T:2--> see below</translate>'' |summary=<translate><!--T:3--> Which namespaces should support subpages?</translate> }} <translate> == Details == <!--T:4--> </translate> <translate><!--T:5--> The variable holds an array indicating which namespaces allow sub-pages.</translate> <translate><!--T:6--> The array is indexed by the numeric namespace ID, and each array value is either <tvar name=1>{{phpi|false}}</tvar> (no sub-pages) or <tvar name=2>{{phpi|true}}</tvar> (sub-pages allowed).</translate> <translate><!--T:7--> A categoryspace (namespace 14) subpage will work like any other category.</translate> <translate> <!--T:8--> See <tvar name=1>{{ll|Help:Subpages}}</tvar>. == Enabling for a namespace == <!--T:9--> </translate> : <translate><!--T:10--> See also <tvar name=1>{{ll|Manual:Namespace constants}}</tvar> for a list of the <tvar name=ns><code>NS_...</code></tvar> codes.</translate> <translate> <!--T:11--> The normal way to enable subpages for a given namespace is to edit the <tvar name=LocalSettings><code>{{ll|Manual:LocalSettings.php|LocalSettings.php}}</code></tvar> and insert the following: </translate> <syntaxhighlight lang="php"> # <translate nowrap><!--T:12--> Enable subpages in the main namespace</translate> $wgNamespacesWithSubpages[NS_MAIN] = true; # <translate nowrap><!--T:13--> Enable subpages in the template namespace</translate> $wgNamespacesWithSubpages[NS_TEMPLATE] = true; # <translate nowrap><!--T:14--> etc.</translate> </syntaxhighlight> <translate> == Disabling for a namespace == <!--T:15--> </translate> <translate><!--T:16--> Disable subpages in a namespace (where it is enabled by default).</translate> <translate><!--T:17--> For example <tvar name=talk><code>NS_TALK</code></tvar> has subpages enabled by default in MediaWiki.</translate> <translate><!--T:18--> To disable them, set <tvar name=false><code>false</code></tvar>:</translate> <syntaxhighlight lang="php"> $wgNamespacesWithSubpages[NS_TALK] = false; </syntaxhighlight> <translate> == Default value == <!--T:26--> </translate> {{Note|1=<translate><!--T:27--> The default of this setting has changed over the years.</translate> <translate><!--T:28--> To be sure which one applies to your wiki check this setting in <tvar name=1><code>DefaultSettings.php</code></tvar>.</translate>}} {{Note|1=<code>DefaultSettings.php</code> is deprecated since version 1.39. Instead run <code>php maintenance/run.php getConfiguration.php --settings wgNamespacesWithSubpages</code>. Namespaces (<code>i:</code>) will be listed by number (see [[Help:Namespaces#Localisation|Namespace numbers]]). A <code>b:1</code> after a namespace means <code>true</code>.}} {{MW 1.39|+}} <syntaxhighlight lang="json" highlight="10"> a:1:{s:24:"wgNamespacesWithSubpages";a:15:{i:1;b:1;i:2;b:1;i:3;b:1;i:4;b:1;i:5;b:1;i:7;b:1;i:8;b:1;i:9;b:1;i:10;b:1;i:11;b:1;i:12;b:1;i:13;b:1;i:15;b:1;i:828;b:1;i:829;b:1;}} </syntaxhighlight> {{MW 1.29|+}} <syntaxhighlight lang="php" highlight="10"> $wgNamespacesWithSubpages = [ NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT => true, NS_PROJECT_TALK => true, NS_FILE_TALK => true, NS_MEDIAWIKI => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE => true, NS_TEMPLATE_TALK => true, NS_HELP => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ]; </syntaxhighlight> {{MW version|version=1.21|version2=1.28}} <syntaxhighlight lang="php" highlight="5,11"> $wgNamespacesWithSubpages = [ NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT => true, NS_PROJECT_TALK => true, NS_FILE_TALK => true, NS_MEDIAWIKI => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE_TALK => true, NS_HELP => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ]; </syntaxhighlight> {{MW version|version=1.16|version2=1.20}} <syntaxhighlight lang="php" highlight="7"> $wgNamespacesWithSubpages = array( NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT_TALK => true, NS_FILE_TALK => true, NS_MEDIAWIKI => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE_TALK => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ); </syntaxhighlight> {{MW version|version=1.14|version2=1.15}} <syntaxhighlight lang="php" highlight="6"> $wgNamespacesWithSubpages = array( NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT_TALK => true, NS_FILE_TALK => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE_TALK => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ); </syntaxhighlight> {{MW version|version=1.5|version2=1.13}} <syntaxhighlight lang="php"> $wgNamespacesWithSubpages = array( NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT_TALK => true, NS_IMAGE_TALK => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE_TALK => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ); </syntaxhighlight> <translate> == See also == <!--T:29--> </translate> {{OnWikimedia|1=<translate><!--T:30--> View the values of this configuration setting on the Wikimedia wikis in <tvar name=1>[https://noc.wikimedia.org/conf/highlight.php?file=core-Namespaces.php core-Namespaces.php]</tvar>.</translate>}} * {{ll|Help:Subpages}} * {{ll|Manual:Namespace}} * {{ll|Manual:Namespace constants}} * {{ll|Manual:$wgMaximumMovedPages}} * {{ll|Manual:Hooks/SkinSubPageSubtitle}} [[Category:Namespace variables{{#translation:}}]] [[Category:Subpage variables{{#translation:}}]] jihk8omqnqowgzxaivfo0cf2e36r22v 8364759 8364758 2026-05-03T22:53:56Z Shirayuki 472859 false information; see [[phab:source/mediawiki/browse/master/docs/config-schema.yaml#L4030]] 8364759 wikitext text/x-wiki <languages /> {{SettingSummary |name=NamespacesWithSubpages |version_min=pre 1.1.0 |section=Namespaces |range=''<translate><!--T:1--> see below</translate>'' |default=''<translate><!--T:2--> see below</translate>'' |summary=<translate><!--T:3--> Which namespaces should support subpages?</translate> }} <translate> == Details == <!--T:4--> </translate> <translate><!--T:5--> The variable holds an array indicating which namespaces allow sub-pages.</translate> <translate><!--T:6--> The array is indexed by the numeric namespace ID, and each array value is either <tvar name=1>{{phpi|false}}</tvar> (no sub-pages) or <tvar name=2>{{phpi|true}}</tvar> (sub-pages allowed).</translate> <translate><!--T:7--> A categoryspace (namespace 14) subpage will work like any other category.</translate> <translate> <!--T:8--> See <tvar name=1>{{ll|Help:Subpages}}</tvar>. == Enabling for a namespace == <!--T:9--> </translate> : <translate><!--T:10--> See also <tvar name=1>{{ll|Manual:Namespace constants}}</tvar> for a list of the <tvar name=ns><code>NS_...</code></tvar> codes.</translate> <translate> <!--T:11--> The normal way to enable subpages for a given namespace is to edit the <tvar name=LocalSettings><code>{{ll|Manual:LocalSettings.php|LocalSettings.php}}</code></tvar> and insert the following: </translate> <syntaxhighlight lang="php"> # <translate nowrap><!--T:12--> Enable subpages in the main namespace</translate> $wgNamespacesWithSubpages[NS_MAIN] = true; # <translate nowrap><!--T:13--> Enable subpages in the template namespace</translate> $wgNamespacesWithSubpages[NS_TEMPLATE] = true; # <translate nowrap><!--T:14--> etc.</translate> </syntaxhighlight> <translate> == Disabling for a namespace == <!--T:15--> </translate> <translate><!--T:16--> Disable subpages in a namespace (where it is enabled by default).</translate> <translate><!--T:17--> For example <tvar name=talk><code>NS_TALK</code></tvar> has subpages enabled by default in MediaWiki.</translate> <translate><!--T:18--> To disable them, set <tvar name=false><code>false</code></tvar>:</translate> <syntaxhighlight lang="php"> $wgNamespacesWithSubpages[NS_TALK] = false; </syntaxhighlight> <translate> == Default value == <!--T:26--> </translate> {{Note|1=<translate><!--T:27--> The default of this setting has changed over the years.</translate> <translate><!--T:28--> To be sure which one applies to your wiki check this setting in <tvar name=1><code>DefaultSettings.php</code></tvar>.</translate>}} {{MW 1.29|+}} <syntaxhighlight lang="php" highlight="10"> $wgNamespacesWithSubpages = [ NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT => true, NS_PROJECT_TALK => true, NS_FILE_TALK => true, NS_MEDIAWIKI => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE => true, NS_TEMPLATE_TALK => true, NS_HELP => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ]; </syntaxhighlight> {{MW version|version=1.21|version2=1.28}} <syntaxhighlight lang="php" highlight="5,11"> $wgNamespacesWithSubpages = [ NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT => true, NS_PROJECT_TALK => true, NS_FILE_TALK => true, NS_MEDIAWIKI => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE_TALK => true, NS_HELP => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ]; </syntaxhighlight> {{MW version|version=1.16|version2=1.20}} <syntaxhighlight lang="php" highlight="7"> $wgNamespacesWithSubpages = array( NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT_TALK => true, NS_FILE_TALK => true, NS_MEDIAWIKI => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE_TALK => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ); </syntaxhighlight> {{MW version|version=1.14|version2=1.15}} <syntaxhighlight lang="php" highlight="6"> $wgNamespacesWithSubpages = array( NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT_TALK => true, NS_FILE_TALK => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE_TALK => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ); </syntaxhighlight> {{MW version|version=1.5|version2=1.13}} <syntaxhighlight lang="php"> $wgNamespacesWithSubpages = array( NS_TALK => true, NS_USER => true, NS_USER_TALK => true, NS_PROJECT_TALK => true, NS_IMAGE_TALK => true, NS_MEDIAWIKI_TALK => true, NS_TEMPLATE_TALK => true, NS_HELP_TALK => true, NS_CATEGORY_TALK => true ); </syntaxhighlight> <translate> == See also == <!--T:29--> </translate> {{OnWikimedia|1=<translate><!--T:30--> View the values of this configuration setting on the Wikimedia wikis in <tvar name=1>[https://noc.wikimedia.org/conf/highlight.php?file=core-Namespaces.php core-Namespaces.php]</tvar>.</translate>}} * {{ll|Help:Subpages}} * {{ll|Manual:Namespace}} * {{ll|Manual:Namespace constants}} * {{ll|Manual:$wgMaximumMovedPages}} * {{ll|Manual:Hooks/SkinSubPageSubtitle}} [[Category:Namespace variables{{#translation:}}]] [[Category:Subpage variables{{#translation:}}]] qbyh96q3iwezbucq7qetactdwlmufvp Talk:Sites using MediaWiki/en 1 6873 8365129 8301691 2026-05-04T11:12:30Z MovieEntertainmentstudio 18368249 /* old-computer wiki */ Reply 8365129 wikitext text/x-wiki ==?== I have removed the Aircrack site as they are apparently now using DokuWiki. [[User:Ab8uu|Edward]] 19:32, 19 July 2006 (UTC) When I tried to add a new wiki to the page and clicked save, I got the following error: The page you wanted to save was blocked by the spam filter. This is probably caused by a link to an external site. The following text is what triggered our spam filter: http ://tearstar.sytes.net. I added in the space after http, because it wouldn't let me save this page either. --[[User:67.161.0.111|67.161.0.111]] 03:36, 17 August 2006 (UTC) When I tried to add my entry, I got 2 notifications of Spam from: http:// nehq.servebeer.com http:// ani.myftp.biz I removed those entries--[[User:Ripthesystem|Ripthesystem]] 23:49, 21 September 2006 (UTC) == old-computer wiki == ;Old-Computer Wiki - [http://compact-mac.110mb.com/wiki] :Wiki about old computers and stuff (we haved moved to a new host!) we had moved, so i added us back. the old articles were not recovered, as the old host randomly deleted our account - for no reason. :The link is dead now. If it gets fixed soon leave the entry otherwise... – [[User:Allen4names|Allen4names]] 07:33, 13 November 2010 (UTC) :@[[User:Allen4names|Allen4names]] [[User:MovieEntertainmentstudio|MovieEntertainmentstudio]] ([[User talk:MovieEntertainmentstudio|talk]]) 11:12, 4 May 2026 (UTC) ==Ancestornotes wiki== I got a double 404 error at this site [http://www.ancestornotes.com/main/index.php?title=Main_Page] [[User:Gible|Gible]] 04:25, 14 January 2007 (UTC) ==Nofollow== All of these pages are rel=nofollow, which seems like a bad idea. --[[User:89.234.99.92|89.234.99.92]] 12:36, 11 March 2007 (UTC) ==List big impressive companies?== Just stumbled upon [http://developer.novell.com/wiki/ Novell's mediawiki installation], and it got me thinking... How could we build a list similar to this, but with only big impressive companies. I'm talking about 'Fortune 500' companies. Companies which people have heard of. That would good MediaWiki promotional material. -- [[User:Harry Wood|Harry Wood]] 10:48, 11 July 2007 (UTC) == Format too wordy == This is too wordy and using a semicolon (;) for bold doesn't work with the "simple" skin: <pre>;Title - [http://www.example.org/ example.org] :Short description</pre> Instead, I propose the simpler, shorter, and more compatible: <pre>'''[http://domain.com/ Title]''' :Description</pre> —[[User:Eep|Eep²]] 20:46, 16 August 2007 (UTC) Semicolon isn't shorthand for "bold", it's shorthand for "list entry". (And colon isn't shorthand for "indent", it's shorthand for "list entry description".) It's logical markup, not physical markup - it's supposed to be displayed according to the definitions in the skin. --[[User:Robkelk|Robkelk]] ([[User talk:Robkelk|talk]]) 22:19, 25 December 2015 (UTC) == MDC ? == [http://developers.mozilla.org/ Mozilla Developer Center] is a multilingual wiki (11 languages, including English, listed at [[Sites using MediaWiki/multilingual]]). Does it belong here too? &#8212; [[User:Tonymec|Tonymec]] 14:17, 2 August 2008 (UTC) == BMWwiki and BoyWiki are down == [http://bmwwiki.org/ BMWwiki] - is experiencing technical difficulties and [http://www.boywiki.org/ BoyWiki] - has been down for maintenance since 15 December 2007 Should they be removed? --[[User:Cnovak|Cnovak]] 06:39, 14 January 2009 (UTC) :Yes, done. —[[User:Emufarmers|Emufarmers]]<sup>([[User talk:Emufarmers|T]]|[[Special:Contributions/Emufarmers|C]])</sup> 06:50, 14 January 2009 (UTC) == Clean Up == The list needs to be cleaned up. I made the start. Please help! --[[User:Aff123a|Aff123a]] 19:33, 27 March 2009 (UTC) Both spongebob square pants wikis cease to exist. (spongewiki and spongywiki) == Encyclopedia Dramatica == Is not on this list and uses MediaWiki. [[Special:Contributions/78.151.100.162|78.151.100.162]] 07:58, 7 May 2010 (UTC) == MapleStory == I propose that the following website should be removed from the list as the domain was not registered: ;MapleStory - [http://wiki.brandonfrohs.com/ BrandonFrohs.com] :Wiki to help players of the MMORPG MapleStory. Thanks. == website == ;Devil Dogs, USA- [http://wiki.devildog.tk/ Devil Dogs, USA] :a website for gamers. i am hoping this is where i would add my site to the list. if not sorry. 11:14, 3 December 2011‎ 173.81.42.237 edited the link. sorry about that i didnt understand what link was to be added. [[User:Deathwish|Deathwish]] 19:00, 4 December 2011 (UTC) :The link should go directly to your main wiki page. P.S. you forgot to sign so please replace "173.81.42.237" with "<nowiki>~~~</nowiki>" to finish your signature, and use "<nowiki>~~~~</nowiki>" for future posts. [[User:Allen4names|Allen4names]] 17:29, 3 December 2011 (UTC) :::{{Done}} in the [[Sites using MediaWiki/en#D|D]] section. Regards. [[User:Allen4names|Allen4names]] 15:49, 5 December 2011 (UTC) We need to change the url to wiki.devildog.tk. --[[User:Deathwish|Deathwish]] 15:08, 10 December 2011 (UTC) :{{Done}} at [[Sites using MediaWiki/en#D]]. [[User:Allen4names|Allen4names]] 15:39, 10 December 2011 (UTC) == Cleaned up # and A sections. == I cleaned up the # and A sections. Here is a list of the sites I removed and why. *www.800areacodes.com/reverse-phone-lookup/Main_Page '''(404)''' *www.aboutus.org/ '''(Does not use MediaWiki.)''' *wiki.libagar.org/ '''(Does not use MediaWiki.)''' *www.aiononlinewiki.com/index.php?title=Main_Page '''(404)''' *alfretonwiki.co.uk/ '''(404)''' *www.answers.com/topic/wiki '''(Does not use MediaWiki.)''' *huntergeophysics.eb2a.com/anzarc/index.php/Main_Page '''(Does not use MediaWiki.)''' *gangadevipalli.in/wiki/index.php/Main_Page '''(404)''' *www.starcadia.sasoriza.us/wiki/ '''(404)''' *asianbusinessroundtable.com/wiki/index.php/Main_Page '''(404)''' *fatalfitness.com/athlepedia '''(Does not use MediaWiki.)''' *www.atcollectionagency.com/ '''(Dead end.)''' *wiki.atleticomadrid.de/en/ '''(Dead end.)''' *www.avlis.org/wiki '''(404)''' *www.awardannals.com '''(Does not use MediaWiki.)''' *www.ax25.org '''(Does not use MediaWiki.)''' I hope this helps, and I encourage you guys to clean up some of the other sections. --[[User:Craig131|Craig131]] ([[User talk:Craig131|talk]]) 05:48, 8 October 2012 (UTC) == Can't change the link to my wiki == I'm the admin of the Poser and Daz Studio Free Resources wiki, and I'm trying to update the link to that wiki from orain.org to miraheze.org. This wiki won't let me - the Anti-Spam rule is kicking in. How do I fix the link to my wiki? :Never mind - I found I can make the update using the "Edit Source" link instead of the "Edit" link. == replace with table == a table would be useful, so we could show other stats such as "number of contributions" or "number of monthly active users" or something which could be sortable {{unsigned|2605:6000:1522:4f0a:5cc9:72b:f551:ca66}} : I'd suggest removing this (and related pages) entirely and point to [[wikiapiary:]], which has such tables already and a big list of sites. --[[User:Ciencia Al Poder|Ciencia Al Poder]] ([[User talk:Ciencia Al Poder|talk]]) 10:28, 9 January 2019 (UTC) ::{{re|Ciencia Al Poder}} I think that's a great idea. This will never stay up to date. —[[User:Samwilson|Sam]] [[User_talk:Samwilson|Wilson]] 00:39, 14 April 2019 (UTC) :::@[[User:Ciencia Al Poder|Ciencia Al Poder]] @[[User:Samwilson|Samwilson]] Does wikiapiary work though? I can't reach it at all (timeout) and the most recent snapshot at the Wayback Machine is from last December. In the last few years I could reach it exactly once and that was a long time ago. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 22:41, 16 May 2025 (UTC) ::::Wikiapiary is dead, sadly. [[User:Ciencia Al Poder|Ciencia Al Poder]] ([[User talk:Ciencia Al Poder|talk]]) 20:28, 21 May 2025 (UTC) :::::Hopefully not. I want to believe that the fact that a barebones version exists at wmcloud means it will recover, even if it takes some time. Like you pointed out, it would be far more useful than these lists. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 23:27, 21 May 2025 (UTC) == Can't add my wiki to this list == I've tried to add this line <pre>;bluevies - [http://en.bluevies.com/ en.bluevies.com] :Pornography and erotica wiki</pre> to this list, but when I try to publish changes I keep this getting error: Welcome to MediaWiki. It seems that you're trying to add an external link to a page. Please note that this site (MediaWiki.org) is not Wikipedia. MediaWiki.org exists solely for the documentation of the MediaWiki software and that off-topic material is not accepted here. If you're interested in working on Wikipedia, the free encyclopedia, check it out directly. If you believe that you received this message in error or have a legitimate need for the link, please file a request here. Can someone help me out? What am I doing wrong? --[[User:Gil Borlin|Gil Borlin]] ([[User talk:Gil Borlin|talk]]) 16:05, 22 November 2019 (UTC) :{{re|Gil Borlin}} Added. In the future, if you encounter problems like this again, please file a request at [[Project:Current_issues]]. --<span style="text-shadow:0 1px 5px #99FFFF">[[User:94rain|<span style="color:#6495ED">94rain</span>]] [[User_talk:94rain|<sup style="color:gold">'''Talk'''</sup>]] </span> 10:50, 23 November 2019 (UTC) ::{{re|94rain}} Thanks. I will. --[[User:Gil Borlin|Gil Borlin]] ([[User talk:Gil Borlin|talk]]) 15:17, 25 November 2019 (UTC) == Can someone add this == http://mk7.tock.eu/index.php?title=Main_Page --[[Special:Contributions/90.145.57.18|90.145.57.18]] 11:34, 18 June 2021 (UTC) == Can somebody please add this wiki? == [https://motorwayservices.uk/ Motorway Services Online | motorway services & motorway service stations] [[User:Nevervisiting|Nevervisiting]] ([[User talk:Nevervisiting|talk]]) 21:33, 31 May 2024 (UTC) b282rgnmhnrhqi2t66t4mxd7i03y998 8365130 8365129 2026-05-04T11:20:43Z Clump 81610 Reverted edits by [[Special:Contribs/MovieEntertainmentstudio|MovieEntertainmentstudio]] ([[User talk:MovieEntertainmentstudio|talk]]) to last version by Clump 7646103 wikitext text/x-wiki ==?== I have removed the Aircrack site as they are apparently now using DokuWiki. [[User:Ab8uu|Edward]] 19:32, 19 July 2006 (UTC) When I tried to add a new wiki to the page and clicked save, I got the following error: The page you wanted to save was blocked by the spam filter. This is probably caused by a link to an external site. The following text is what triggered our spam filter: http ://tearstar.sytes.net. I added in the space after http, because it wouldn't let me save this page either. --[[User:67.161.0.111|67.161.0.111]] 03:36, 17 August 2006 (UTC) When I tried to add my entry, I got 2 notifications of Spam from: http:// nehq.servebeer.com http:// ani.myftp.biz I removed those entries--[[User:Ripthesystem|Ripthesystem]] 23:49, 21 September 2006 (UTC) == old-computer wiki == ;Old-Computer Wiki - [http://compact-mac.110mb.com/wiki] :Wiki about old computers and stuff (we haved moved to a new host!) we had moved, so i added us back. the old articles were not recovered, as the old host randomly deleted our account - for no reason. :The link is dead now. If it gets fixed soon leave the entry otherwise... – [[User:Allen4names|Allen4names]] 07:33, 13 November 2010 (UTC) ==Ancestornotes wiki== I got a double 404 error at this site [http://www.ancestornotes.com/main/index.php?title=Main_Page] [[User:Gible|Gible]] 04:25, 14 January 2007 (UTC) ==Nofollow== All of these pages are rel=nofollow, which seems like a bad idea. --[[User:89.234.99.92|89.234.99.92]] 12:36, 11 March 2007 (UTC) ==List big impressive companies?== Just stumbled upon [http://developer.novell.com/wiki/ Novell's mediawiki installation], and it got me thinking... How could we build a list similar to this, but with only big impressive companies. I'm talking about 'Fortune 500' companies. Companies which people have heard of. That would good MediaWiki promotional material. -- [[User:Harry Wood|Harry Wood]] 10:48, 11 July 2007 (UTC) == Format too wordy == This is too wordy and using a semicolon (;) for bold doesn't work with the "simple" skin: <pre>;Title - [http://www.example.org/ example.org] :Short description</pre> Instead, I propose the simpler, shorter, and more compatible: <pre>'''[http://domain.com/ Title]''' :Description</pre> —[[User:Eep|Eep²]] 20:46, 16 August 2007 (UTC) Semicolon isn't shorthand for "bold", it's shorthand for "list entry". (And colon isn't shorthand for "indent", it's shorthand for "list entry description".) It's logical markup, not physical markup - it's supposed to be displayed according to the definitions in the skin. --[[User:Robkelk|Robkelk]] ([[User talk:Robkelk|talk]]) 22:19, 25 December 2015 (UTC) == MDC ? == [http://developers.mozilla.org/ Mozilla Developer Center] is a multilingual wiki (11 languages, including English, listed at [[Sites using MediaWiki/multilingual]]). Does it belong here too? &#8212; [[User:Tonymec|Tonymec]] 14:17, 2 August 2008 (UTC) == BMWwiki and BoyWiki are down == [http://bmwwiki.org/ BMWwiki] - is experiencing technical difficulties and [http://www.boywiki.org/ BoyWiki] - has been down for maintenance since 15 December 2007 Should they be removed? --[[User:Cnovak|Cnovak]] 06:39, 14 January 2009 (UTC) :Yes, done. —[[User:Emufarmers|Emufarmers]]<sup>([[User talk:Emufarmers|T]]|[[Special:Contributions/Emufarmers|C]])</sup> 06:50, 14 January 2009 (UTC) == Clean Up == The list needs to be cleaned up. I made the start. Please help! --[[User:Aff123a|Aff123a]] 19:33, 27 March 2009 (UTC) Both spongebob square pants wikis cease to exist. (spongewiki and spongywiki) == Encyclopedia Dramatica == Is not on this list and uses MediaWiki. [[Special:Contributions/78.151.100.162|78.151.100.162]] 07:58, 7 May 2010 (UTC) == MapleStory == I propose that the following website should be removed from the list as the domain was not registered: ;MapleStory - [http://wiki.brandonfrohs.com/ BrandonFrohs.com] :Wiki to help players of the MMORPG MapleStory. Thanks. == website == ;Devil Dogs, USA- [http://wiki.devildog.tk/ Devil Dogs, USA] :a website for gamers. i am hoping this is where i would add my site to the list. if not sorry. 11:14, 3 December 2011‎ 173.81.42.237 edited the link. sorry about that i didnt understand what link was to be added. [[User:Deathwish|Deathwish]] 19:00, 4 December 2011 (UTC) :The link should go directly to your main wiki page. P.S. you forgot to sign so please replace "173.81.42.237" with "<nowiki>~~~</nowiki>" to finish your signature, and use "<nowiki>~~~~</nowiki>" for future posts. [[User:Allen4names|Allen4names]] 17:29, 3 December 2011 (UTC) :::{{Done}} in the [[Sites using MediaWiki/en#D|D]] section. Regards. [[User:Allen4names|Allen4names]] 15:49, 5 December 2011 (UTC) We need to change the url to wiki.devildog.tk. --[[User:Deathwish|Deathwish]] 15:08, 10 December 2011 (UTC) :{{Done}} at [[Sites using MediaWiki/en#D]]. [[User:Allen4names|Allen4names]] 15:39, 10 December 2011 (UTC) == Cleaned up # and A sections. == I cleaned up the # and A sections. Here is a list of the sites I removed and why. *www.800areacodes.com/reverse-phone-lookup/Main_Page '''(404)''' *www.aboutus.org/ '''(Does not use MediaWiki.)''' *wiki.libagar.org/ '''(Does not use MediaWiki.)''' *www.aiononlinewiki.com/index.php?title=Main_Page '''(404)''' *alfretonwiki.co.uk/ '''(404)''' *www.answers.com/topic/wiki '''(Does not use MediaWiki.)''' *huntergeophysics.eb2a.com/anzarc/index.php/Main_Page '''(Does not use MediaWiki.)''' *gangadevipalli.in/wiki/index.php/Main_Page '''(404)''' *www.starcadia.sasoriza.us/wiki/ '''(404)''' *asianbusinessroundtable.com/wiki/index.php/Main_Page '''(404)''' *fatalfitness.com/athlepedia '''(Does not use MediaWiki.)''' *www.atcollectionagency.com/ '''(Dead end.)''' *wiki.atleticomadrid.de/en/ '''(Dead end.)''' *www.avlis.org/wiki '''(404)''' *www.awardannals.com '''(Does not use MediaWiki.)''' *www.ax25.org '''(Does not use MediaWiki.)''' I hope this helps, and I encourage you guys to clean up some of the other sections. --[[User:Craig131|Craig131]] ([[User talk:Craig131|talk]]) 05:48, 8 October 2012 (UTC) == Can't change the link to my wiki == I'm the admin of the Poser and Daz Studio Free Resources wiki, and I'm trying to update the link to that wiki from orain.org to miraheze.org. This wiki won't let me - the Anti-Spam rule is kicking in. How do I fix the link to my wiki? :Never mind - I found I can make the update using the "Edit Source" link instead of the "Edit" link. == replace with table == a table would be useful, so we could show other stats such as "number of contributions" or "number of monthly active users" or something which could be sortable {{unsigned|2605:6000:1522:4f0a:5cc9:72b:f551:ca66}} : I'd suggest removing this (and related pages) entirely and point to [[wikiapiary:]], which has such tables already and a big list of sites. --[[User:Ciencia Al Poder|Ciencia Al Poder]] ([[User talk:Ciencia Al Poder|talk]]) 10:28, 9 January 2019 (UTC) ::{{re|Ciencia Al Poder}} I think that's a great idea. This will never stay up to date. —[[User:Samwilson|Sam]] [[User_talk:Samwilson|Wilson]] 00:39, 14 April 2019 (UTC) :::@[[User:Ciencia Al Poder|Ciencia Al Poder]] @[[User:Samwilson|Samwilson]] Does wikiapiary work though? I can't reach it at all (timeout) and the most recent snapshot at the Wayback Machine is from last December. In the last few years I could reach it exactly once and that was a long time ago. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 22:41, 16 May 2025 (UTC) ::::Wikiapiary is dead, sadly. [[User:Ciencia Al Poder|Ciencia Al Poder]] ([[User talk:Ciencia Al Poder|talk]]) 20:28, 21 May 2025 (UTC) :::::Hopefully not. I want to believe that the fact that a barebones version exists at wmcloud means it will recover, even if it takes some time. Like you pointed out, it would be far more useful than these lists. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 23:27, 21 May 2025 (UTC) == Can't add my wiki to this list == I've tried to add this line <pre>;bluevies - [http://en.bluevies.com/ en.bluevies.com] :Pornography and erotica wiki</pre> to this list, but when I try to publish changes I keep this getting error: Welcome to MediaWiki. It seems that you're trying to add an external link to a page. Please note that this site (MediaWiki.org) is not Wikipedia. MediaWiki.org exists solely for the documentation of the MediaWiki software and that off-topic material is not accepted here. If you're interested in working on Wikipedia, the free encyclopedia, check it out directly. If you believe that you received this message in error or have a legitimate need for the link, please file a request here. Can someone help me out? What am I doing wrong? --[[User:Gil Borlin|Gil Borlin]] ([[User talk:Gil Borlin|talk]]) 16:05, 22 November 2019 (UTC) :{{re|Gil Borlin}} Added. In the future, if you encounter problems like this again, please file a request at [[Project:Current_issues]]. --<span style="text-shadow:0 1px 5px #99FFFF">[[User:94rain|<span style="color:#6495ED">94rain</span>]] [[User_talk:94rain|<sup style="color:gold">'''Talk'''</sup>]] </span> 10:50, 23 November 2019 (UTC) ::{{re|94rain}} Thanks. I will. --[[User:Gil Borlin|Gil Borlin]] ([[User talk:Gil Borlin|talk]]) 15:17, 25 November 2019 (UTC) == Can someone add this == http://mk7.tock.eu/index.php?title=Main_Page --[[Special:Contributions/90.145.57.18|90.145.57.18]] 11:34, 18 June 2021 (UTC) == Can somebody please add this wiki? == [https://motorwayservices.uk/ Motorway Services Online | motorway services & motorway service stations] [[User:Nevervisiting|Nevervisiting]] ([[User talk:Nevervisiting|talk]]) 21:33, 31 May 2024 (UTC) bdd32h40p68e6yi8anhe9fnge2waftr Template:Update 10 10566 8364313 8364200 2026-05-03T12:46:30Z Shirayuki 472859 Reverted edits by [[Special:Contribs/Waldyrious|Waldyrious]] ([[User talk:Waldyrious|talk]]) to last version by Pppery 7865092 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |<translate><!--T:9--> The '''factual accuracy''' of parts of this page (those related to <tvar name=2>{{{part|{{{1|}}}}}}</tvar>) '''may be compromised due to out-of-date information'''.</translate> |<translate><!--T:10--> Parts of this page (those related to <tvar name=2>{{{part|{{{1|}}}}}}</tvar>) are '''outdated'''.</translate>}} |{{#if:{{{inaccurate|}}} |<translate><!--T:11--> The '''factual accuracy''' of this page '''may be compromised due to out-of-date information'''.</translate> |<translate><!--T:12--> This page is '''outdated'''.</translate>}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|<translate><!--T:13--> It was written for an older version of MediaWiki and may not apply to the most recent version.</translate>}} <translate><!--T:20--> If you have checked or updated this page and found the content to be suitable, please remove this notice.</translate> {{#ifexist: {{TALKPAGENAME}} |&#32;<translate><!--T:14--> See the [[<tvar name=1>{{TALKPAGENAME}}</tvar>|talk page]] for a possible discussion on this.</translate> }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small><translate><!--T:15--> Last update:</translate> {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= <translate> <!--T:18--> Aliases of this template: </translate> * {{tlx|outdated}} <translate> == Examples == <!--T:21--> </translate> <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <translate> == See also == <!--T:19--> </translate> * {{tl|historical}} <translate> == TemplateData == <!--T:22--> </translate> {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> o01iktywj151yer91p9tfemhj0vbi7d Help:Contents/it 12 17957 8364454 8360028 2026-05-03T15:44:59Z ~2026-26781-45 18367723 Created page with "Vedere $1." 8364454 wikitext text/x-wiki <languages /> {{PD Help Page}} ''[[Special:MyLanguage/Communication|Poni una domanda in merito al software MediaWiki.]]'' <span id="Welcome_to_MediaWiki.org_help_pages"></span> == Benvenuto alle pagine di aiuto di Mediawiki.org == {{ambox |type=notice |image=[[File:Codex icon help notice-blue.svg|45px|alt=|link=]] |text= '''Queste pagine di aiuto sono solamente per il software wiki di MediaWiki.''' <span class="mw-translate-fuzzy">Molte wiki basate su MediaWiki dispongono di un collegamento di aiuto che porta a questa pagina.</span> <span class="mw-translate-fuzzy">Se sei arrivato qui da un'altra wiki cercando aiuto non relativo al software MediaWiki, queste informazioni non saranno utili.</span> Vedere {{ll|differences between Wikipedia, Wikimedia, MediaWiki, and wiki}}. }} {{ContentGrid |content = <!-- nowiki markers are added so the first bullet in the list are rendered correctly! please don't remove those markers, thank you --> {{InfoCard |heading = [[File:OOjs_UI_icon_article-ltr.svg|class=skin-invert|20px|link=]] Lettura |content = <nowiki /> * {{ll|Help:Searching|nsp=0}} ** {{ll|Help:Go button|nsp=0}} * {{ll|Help:Namespaces|nsp=0}} * {{ll|Help:Navigation|nsp=0}} * {{ll|Help:Printing|nsp=0}} * {{ll|Help:History|nsp=0}} * {{ll|Help:Diff|nsp=0}} * {{ll|Help:Keyboard shortcuts|nsp=0}} }} {{InfoCard |heading = [[File:OOjs_UI_icon_edit-ltr.svg|class=skin-invert|20px|link=]] Modifica |content = <nowiki /> * {{ll|Help:Logging in|nsp=0}} * {{ll|Help:Editing pages|nsp=0}} ** {{ll|Help:Editing FAQ|nsp=0}} * {{ll|Help:Preview|nsp=0}} * {{ll|Help:Reverting|nsp=0}} * {{ll|Help:Edit summary|nsp=0}} * {{ll|Help:Starting a new page|nsp=0}} * {{ll|Help:Formatting|nsp=0}} * {{ll|Help:Links|nsp=0}} * {{ll|Help:User page|nsp=0}} * {{ll|Help:Talk pages|nsp=0}} * {{ll|Help:Signatures|nsp=0}} * {{ll|Help:Section|nsp=0}} * {{ll|Help:VisualEditor/User guide|2=VisualEditor}} * {{ll|Help:Tracking changes|nsp=0}} ** {{ll|Help:Recent changes|nsp=0}} ** {{ll|Help:New filters for edit review|2=Cambi recenti migliorati}} ** {{ll|Help:Related changes|nsp=0}} ** {{ll|Help:User contributions|nsp=0}} * {{ll|Help:Minor edit|nsp=0}} * {{ll|Help:Watchlist|nsp=0}} * {{ll|Help:Reference card|nsp=0}} }} {{InfoCard |heading = [[File:OOjs_UI_icon_academic.svg|class=skin-invert|30px|link=]]Modifica avanzata |content = <nowiki /> * {{ll|Help:Advanced editing|nsp=0}} - Fornisce una visione generale di muchas delle caratteristiche a continuazione * {{ll|Help:Edit conflict|nsp=0}} * {{ll|Help:Images|nsp=0}} * {{ll|Help:Lists|nsp=0}} * {{ll|Help:URL|nsp=0}} * {{ll|Help:Extension:Cite|2=Note a piè di pagina}} * {{ll|Help:Tables|nsp=0}} ** {{ll|Help:Sortable tables|nsp=0}} * {{ll|Help:Categories|nsp=0}} * {{ll|Help:Subpages|nsp=0}} * {{ll|Help:Managing files|nsp=0}} * {{ll|Help:Moving a page|2=Spostare (rinominare) una pagina}} * {{ll|Help:Redirects|nsp=0}} * {{ll|Help:Protected pages|nsp=0}} * {{ll|Help:Templates|nsp=0}} ** {{ll|Help:Transclusion|nsp=0}} ** {{ll|Help:Substitution|nsp=0}} * {{ll|Help:System message|nsp=0}} * {{ll|Help:Magic words|nsp=0}} * {{ll|Help:Namespaces|nsp=0}} * {{ll|Help:Cite|2=Fonti}} * {{ll|Help:Special pages|nsp=0}} * {{ll|Help:External searches|nsp=0}} * {{ll|Help:HTML in wikitext|nsp=0}} ** {{ll|Help:Text color|nsp=0}} * {{ll|Help:Pre-save transform|nsp=0}} * {{ll|Help:Export|nsp=0}} * {{ll|Help:Bots|nsp=0}} * {{ll|Help:Page size|nsp=0}} * {{ll|Help:Special characters|nsp=0}} * {{ll|Help:Wikitext examples|nsp=0}} }} {{InfoCard |heading = [[File:OOjs_UI_icon_speechBubbles-ltr.svg|class=skin-invert|20px|link=]] Collaborazione |content = <nowiki /> * {{ll|Help:Notifications|nsp=0}} }} {{InfoCard |heading = [[File:OOjs UI icon advanced.svg|class=skin-invert|20px|link=]] Personalizzazione |content = <nowiki /> * {{ll|Help:Preferences|nsp=0}} * {{ll|Help:Skins|nsp=0}} }} {{InfoCard |heading = [[File:OOjs UI icon desktop.svg|class=skin-invert|20px|link=]] Amministrazione di wiki |content = <nowiki /> * {{ll|Help:Sysops and permissions|nsp=0}} Le seguenti funzionalità richiedono permessi aggiuntivi che normalmente non sono concessi a tutti gli utenti wiki. * {{ll|Help:Protecting and unprotecting pages|nsp=0}} * {{ll|Help:Deletion and undeletion|nsp=0}} * {{ll|Help:Patrolled edits|nsp=0}} * {{ll|Help:Blocking users|nsp=0}} * {{ll|Help:Range blocks|2=Bloccare gruppi di indirizzi IP}} * {{ll|Help:User rights and groups|nsp=0}} * {{ll|Help:Import|nsp=0}} }} }} [[Category:Help{{#translation:}}| ]] __NOTOC__ 9zjika9k4icfih9sy8v4hfnxk4drapr 8364459 8364454 2026-05-03T15:45:45Z ~2026-26781-45 18367723 8364459 wikitext text/x-wiki <languages /> {{PD Help Page}} ''[[Special:MyLanguage/Communication|Poni una domanda in merito al software MediaWiki.]]'' <span id="Welcome_to_MediaWiki.org_help_pages"></span> == Benvenuto alle pagine di aiuto di Mediawiki.org == {{ambox |type=notice |image=[[File:Codex icon help notice-blue.svg|45px|alt=|link=]] |text= '''Queste pagine di aiuto sono solamente per il software wiki di MediaWiki.''' <span class="mw-translate-fuzzy">Molte wiki basate su MediaWiki rimandano a questa pagina per la documentazione tecnica.</span> <span class="mw-translate-fuzzy">Se sei arrivato qui da un'altra wiki cercando aiuto non relativo al software MediaWiki, queste informazioni non saranno utili.</span> Vedere {{ll|differences between Wikipedia, Wikimedia, MediaWiki, and wiki}}. }} {{ContentGrid |content = <!-- nowiki markers are added so the first bullet in the list are rendered correctly! please don't remove those markers, thank you --> {{InfoCard |heading = [[File:OOjs_UI_icon_article-ltr.svg|class=skin-invert|20px|link=]] Lettura |content = <nowiki /> * {{ll|Help:Searching|nsp=0}} ** {{ll|Help:Go button|nsp=0}} * {{ll|Help:Namespaces|nsp=0}} * {{ll|Help:Navigation|nsp=0}} * {{ll|Help:Printing|nsp=0}} * {{ll|Help:History|nsp=0}} * {{ll|Help:Diff|nsp=0}} * {{ll|Help:Keyboard shortcuts|nsp=0}} }} {{InfoCard |heading = [[File:OOjs_UI_icon_edit-ltr.svg|class=skin-invert|20px|link=]] Modifica |content = <nowiki /> * {{ll|Help:Logging in|nsp=0}} * {{ll|Help:Editing pages|nsp=0}} ** {{ll|Help:Editing FAQ|nsp=0}} * {{ll|Help:Preview|nsp=0}} * {{ll|Help:Reverting|nsp=0}} * {{ll|Help:Edit summary|nsp=0}} * {{ll|Help:Starting a new page|nsp=0}} * {{ll|Help:Formatting|nsp=0}} * {{ll|Help:Links|nsp=0}} * {{ll|Help:User page|nsp=0}} * {{ll|Help:Talk pages|nsp=0}} * {{ll|Help:Signatures|nsp=0}} * {{ll|Help:Section|nsp=0}} * {{ll|Help:VisualEditor/User guide|2=VisualEditor}} * {{ll|Help:Tracking changes|nsp=0}} ** {{ll|Help:Recent changes|nsp=0}} ** {{ll|Help:New filters for edit review|2=Cambi recenti migliorati}} ** {{ll|Help:Related changes|nsp=0}} ** {{ll|Help:User contributions|nsp=0}} * {{ll|Help:Minor edit|nsp=0}} * {{ll|Help:Watchlist|nsp=0}} * {{ll|Help:Reference card|nsp=0}} }} {{InfoCard |heading = [[File:OOjs_UI_icon_academic.svg|class=skin-invert|30px|link=]]Modifica avanzata |content = <nowiki /> * {{ll|Help:Advanced editing|nsp=0}} - Fornisce una visione generale di muchas delle caratteristiche a continuazione * {{ll|Help:Edit conflict|nsp=0}} * {{ll|Help:Images|nsp=0}} * {{ll|Help:Lists|nsp=0}} * {{ll|Help:URL|nsp=0}} * {{ll|Help:Extension:Cite|2=Note a piè di pagina}} * {{ll|Help:Tables|nsp=0}} ** {{ll|Help:Sortable tables|nsp=0}} * {{ll|Help:Categories|nsp=0}} * {{ll|Help:Subpages|nsp=0}} * {{ll|Help:Managing files|nsp=0}} * {{ll|Help:Moving a page|2=Spostare (rinominare) una pagina}} * {{ll|Help:Redirects|nsp=0}} * {{ll|Help:Protected pages|nsp=0}} * {{ll|Help:Templates|nsp=0}} ** {{ll|Help:Transclusion|nsp=0}} ** {{ll|Help:Substitution|nsp=0}} * {{ll|Help:System message|nsp=0}} * {{ll|Help:Magic words|nsp=0}} * {{ll|Help:Namespaces|nsp=0}} * {{ll|Help:Cite|2=Fonti}} * {{ll|Help:Special pages|nsp=0}} * {{ll|Help:External searches|nsp=0}} * {{ll|Help:HTML in wikitext|nsp=0}} ** {{ll|Help:Text color|nsp=0}} * {{ll|Help:Pre-save transform|nsp=0}} * {{ll|Help:Export|nsp=0}} * {{ll|Help:Bots|nsp=0}} * {{ll|Help:Page size|nsp=0}} * {{ll|Help:Special characters|nsp=0}} * {{ll|Help:Wikitext examples|nsp=0}} }} {{InfoCard |heading = [[File:OOjs_UI_icon_speechBubbles-ltr.svg|class=skin-invert|20px|link=]] Collaborazione |content = <nowiki /> * {{ll|Help:Notifications|nsp=0}} }} {{InfoCard |heading = [[File:OOjs UI icon advanced.svg|class=skin-invert|20px|link=]] Personalizzazione |content = <nowiki /> * {{ll|Help:Preferences|nsp=0}} * {{ll|Help:Skins|nsp=0}} }} {{InfoCard |heading = [[File:OOjs UI icon desktop.svg|class=skin-invert|20px|link=]] Amministrazione di wiki |content = <nowiki /> * {{ll|Help:Sysops and permissions|nsp=0}} Le seguenti funzionalità richiedono permessi aggiuntivi che normalmente non sono concessi a tutti gli utenti wiki. * {{ll|Help:Protecting and unprotecting pages|nsp=0}} * {{ll|Help:Deletion and undeletion|nsp=0}} * {{ll|Help:Patrolled edits|nsp=0}} * {{ll|Help:Blocking users|nsp=0}} * {{ll|Help:Range blocks|2=Bloccare gruppi di indirizzi IP}} * {{ll|Help:User rights and groups|nsp=0}} * {{ll|Help:Import|nsp=0}} }} }} [[Category:Help{{#translation:}}| ]] __NOTOC__ 32xea9pq5ig1mvsz8n9dre8on3neork 8364462 8364459 2026-05-03T15:46:13Z ~2026-26781-45 18367723 8364462 wikitext text/x-wiki <languages /> {{PD Help Page}} ''[[Special:MyLanguage/Communication|Poni una domanda in merito al software MediaWiki.]]'' <span id="Welcome_to_MediaWiki.org_help_pages"></span> == Benvenuto alle pagine di aiuto di Mediawiki.org == {{ambox |type=notice |image=[[File:Codex icon help notice-blue.svg|45px|alt=|link=]] |text= '''Queste pagine di aiuto sono solamente per il software wiki di MediaWiki.''' <span class="mw-translate-fuzzy">Molte wiki basate su MediaWiki rimandano a questa pagina per la documentazione tecnica.</span> <span class="mw-translate-fuzzy">Se sei arrivato qui da un'altra wiki e stai cercando aiuto riguardo ai contenuti o alla comunità di quella wiki, questa pagina potrebbe non essere quella che ti serve.</span> Vedere {{ll|differences between Wikipedia, Wikimedia, MediaWiki, and wiki}}. }} {{ContentGrid |content = <!-- nowiki markers are added so the first bullet in the list are rendered correctly! please don't remove those markers, thank you --> {{InfoCard |heading = [[File:OOjs_UI_icon_article-ltr.svg|class=skin-invert|20px|link=]] Lettura |content = <nowiki /> * {{ll|Help:Searching|nsp=0}} ** {{ll|Help:Go button|nsp=0}} * {{ll|Help:Namespaces|nsp=0}} * {{ll|Help:Navigation|nsp=0}} * {{ll|Help:Printing|nsp=0}} * {{ll|Help:History|nsp=0}} * {{ll|Help:Diff|nsp=0}} * {{ll|Help:Keyboard shortcuts|nsp=0}} }} {{InfoCard |heading = [[File:OOjs_UI_icon_edit-ltr.svg|class=skin-invert|20px|link=]] Modifica |content = <nowiki /> * {{ll|Help:Logging in|nsp=0}} * {{ll|Help:Editing pages|nsp=0}} ** {{ll|Help:Editing FAQ|nsp=0}} * {{ll|Help:Preview|nsp=0}} * {{ll|Help:Reverting|nsp=0}} * {{ll|Help:Edit summary|nsp=0}} * {{ll|Help:Starting a new page|nsp=0}} * {{ll|Help:Formatting|nsp=0}} * {{ll|Help:Links|nsp=0}} * {{ll|Help:User page|nsp=0}} * {{ll|Help:Talk pages|nsp=0}} * {{ll|Help:Signatures|nsp=0}} * {{ll|Help:Section|nsp=0}} * {{ll|Help:VisualEditor/User guide|2=VisualEditor}} * {{ll|Help:Tracking changes|nsp=0}} ** {{ll|Help:Recent changes|nsp=0}} ** {{ll|Help:New filters for edit review|2=Cambi recenti migliorati}} ** {{ll|Help:Related changes|nsp=0}} ** {{ll|Help:User contributions|nsp=0}} * {{ll|Help:Minor edit|nsp=0}} * {{ll|Help:Watchlist|nsp=0}} * {{ll|Help:Reference card|nsp=0}} }} {{InfoCard |heading = [[File:OOjs_UI_icon_academic.svg|class=skin-invert|30px|link=]]Modifica avanzata |content = <nowiki /> * {{ll|Help:Advanced editing|nsp=0}} - Fornisce una visione generale di muchas delle caratteristiche a continuazione * {{ll|Help:Edit conflict|nsp=0}} * {{ll|Help:Images|nsp=0}} * {{ll|Help:Lists|nsp=0}} * {{ll|Help:URL|nsp=0}} * {{ll|Help:Extension:Cite|2=Note a piè di pagina}} * {{ll|Help:Tables|nsp=0}} ** {{ll|Help:Sortable tables|nsp=0}} * {{ll|Help:Categories|nsp=0}} * {{ll|Help:Subpages|nsp=0}} * {{ll|Help:Managing files|nsp=0}} * {{ll|Help:Moving a page|2=Spostare (rinominare) una pagina}} * {{ll|Help:Redirects|nsp=0}} * {{ll|Help:Protected pages|nsp=0}} * {{ll|Help:Templates|nsp=0}} ** {{ll|Help:Transclusion|nsp=0}} ** {{ll|Help:Substitution|nsp=0}} * {{ll|Help:System message|nsp=0}} * {{ll|Help:Magic words|nsp=0}} * {{ll|Help:Namespaces|nsp=0}} * {{ll|Help:Cite|2=Fonti}} * {{ll|Help:Special pages|nsp=0}} * {{ll|Help:External searches|nsp=0}} * {{ll|Help:HTML in wikitext|nsp=0}} ** {{ll|Help:Text color|nsp=0}} * {{ll|Help:Pre-save transform|nsp=0}} * {{ll|Help:Export|nsp=0}} * {{ll|Help:Bots|nsp=0}} * {{ll|Help:Page size|nsp=0}} * {{ll|Help:Special characters|nsp=0}} * {{ll|Help:Wikitext examples|nsp=0}} }} {{InfoCard |heading = [[File:OOjs_UI_icon_speechBubbles-ltr.svg|class=skin-invert|20px|link=]] Collaborazione |content = <nowiki /> * {{ll|Help:Notifications|nsp=0}} }} {{InfoCard |heading = [[File:OOjs UI icon advanced.svg|class=skin-invert|20px|link=]] Personalizzazione |content = <nowiki /> * {{ll|Help:Preferences|nsp=0}} * {{ll|Help:Skins|nsp=0}} }} {{InfoCard |heading = [[File:OOjs UI icon desktop.svg|class=skin-invert|20px|link=]] Amministrazione di wiki |content = <nowiki /> * {{ll|Help:Sysops and permissions|nsp=0}} Le seguenti funzionalità richiedono permessi aggiuntivi che normalmente non sono concessi a tutti gli utenti wiki. * {{ll|Help:Protecting and unprotecting pages|nsp=0}} * {{ll|Help:Deletion and undeletion|nsp=0}} * {{ll|Help:Patrolled edits|nsp=0}} * {{ll|Help:Blocking users|nsp=0}} * {{ll|Help:Range blocks|2=Bloccare gruppi di indirizzi IP}} * {{ll|Help:User rights and groups|nsp=0}} * {{ll|Help:Import|nsp=0}} }} }} [[Category:Help{{#translation:}}| ]] __NOTOC__ 6v63g19bhl6vf5425vsarhv8ub5o62b Help:Formatting/cs 12 19143 8364651 8354993 2026-05-03T17:19:26Z Rebulka 17532855 8364651 wikitext text/x-wiki <languages/> {{PD Help Page}} {{See also|Help:Advanced editing}}<!-- To editors: Please NOTE that {{#tag: are required to make language conversion/language converter work, especially for /zh translation pages. -->Zobrazení vašeho textu můžete ovlivnit pomocí wiki značek. Ty se tvoří pomocí standardních znaků jako je např. hvězdička, apostrof nebo znak rovnítka, které mají ve wiki speciální význam, v závislosti na tom kde a v jakém počtu jsou použity. Například chcete-li v textu zvýraznit slovo ''kurzívou'' (italic), stačí, když ho uzavřete mezi dva páry apostrofů, jako například <code><nowiki>''zde''</nowiki></code>. <span id="Text_formatting_markup"></span> == Značky pro formátování textu == {| class="wikitable" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se |- ! colspan="3" style="color: var(--color-base, #202122); background: var(--background-color-progressive-subtle--active, #b6d4fb)" | {{anchor|Character formatting}}Značkování v textu (inline) – ''lze používat všude'' |- | Text v kurzívě | {{#tag:syntaxhighlight| ''kurzíva'' |lang=wikitext}} | ''kurzíva'' |- | Tučný text | {{#tag:syntaxhighlight| '''tučně''' |lang=wikitext}} | '''tučně''' |- | Tučný text v kurzívě | {{#tag:syntaxhighlight| '''''tučná kurzíva''''' |lang=wikitext}} | '''''tučná kurzíva''''' {{Table-AnchorRow|colspan=3|nowiki|&lt;nowiki&gt;|.3Cnowiki.3E}} |- | Zobrazení bez interpretace wiki značek | {{#tag:syntaxhighlight| <!-- This can't use <syntaxhighlight><nowiki>, as that breaks the <translate> tag --> {{^(}}nowiki{{)^}}ignoruji [[wiki]] ''značky''{{^(}}/nowiki{{)^}} |lang=wikitext}} | <nowiki>ignoruji [[wiki]] ''značky''</nowiki> |- ! colspan="3" style="color: var(--color-base, #202122); background: var(--background-color-progressive-subtle--active, #b6d4fb)" | {{anchor|Section formatting}}Sekce (oddíly) – ''jejich zápis začíná vždy na počátku řádky'' |- | Úrovně sekcí (oddílů) a interpretace jejich nadpisů (záhlaví) | {{anchor|headings}}{{#tag:syntaxhighlight| == Úroveň 2 == === Úroveň 3 === ==== Úroveň 4 ==== ===== Úroveň 5 ===== ====== Úroveň 6 ====== |lang=wikitext}} ---- {{note|1=<nowiki/> * [[Help talk:Formatting#Level_1|Úroveň 1]], jedná se o úroveň názvu stránky. * Nezadávejte na řádek žádný text za koncová znaménka 'rovná se'. * Článek se čtyřmi a více nadpisy vytvoří automaticky [[wikipedia:Help:Section#Table of contents (TOC)|tabulku s obsahem]] umístěnou v úvodu stránky. Pokud nenastavíte kouzelné slovo <code><nowiki>__NOTOC__</nowiki></code>. }} | {{Fake heading|level=2|1=Úroveň 2}} {{Fake heading|level=3|1=<span class="mw-translate-fuzzy"><h3>Úroveň 3</h3></span>}} {{Fake heading|level=4|1=<span class="mw-translate-fuzzy"><h4>Úroveň 4</h4></span>}} {{Fake heading|level=5|1=<span class="mw-translate-fuzzy"><h5>Úroveň 5</h5></span>}} {{Fake heading|level=6|1=<span class="mw-translate-fuzzy"><h6>Úroveň 6</h6></span>}} |- | Horizontální čára | {{#tag:syntaxhighlight| Předcházející text ---- Následující text |lang=wikitext}} | Předcházející text ---- Následující text |- | Seznam s odrážkami | {{anchor|bulleted-lists}} {{#tag:syntaxhighlight| * Začněte každý řádek * [[Wikipedia:hvězdička|hvězdičkou]] (*). ** Více hvězdiček znamená hlubší *** a hlubší úrovně. * Konce řádků <br>nepřerušují úrovně. *** Ale skákání úrovní vytváří prázdný prostor. Jakýkoli jiný začátek seznam končí. * seznam s odrážkami můžete kombinovat ** s odsazením ::- odsazení ** vytvoří místo odrážky odpovídají mezeru * kombinace seznamu odrážek ** s definicí *:- definice ** bez mezer * seznam odrážek :- definice :* sublist, který nevytváří prázdné :* mezery za definicí |lang=wikitext}} | * Začněte každý řádek * [[Wikipedia:hvězdička|hvězdičkou]] (*). ** Více hvězdiček znamená hlubší *** a hlubší úrovně. * Konce řádků <br>nepřerušují úrovně. *** Ale skákání úrovní vytváří prázdný prostor. Jakýkoli jiný začátek seznam končí. * seznam s odrážkami můžete kombinovat ** s odsazením ::- odsazení ** vytvoří místo odrážky odpovídají mezeru * kombinace seznamu odrážek ** s definicí *:- definice ** bez mezer * seznam odrážek :- definice :* sublist, který nevytváří prázdné :* mezery za definicí |- | Číslovaný seznam | {{anchor|numbered-list}} {{#tag:syntaxhighlight| # Začněte každý řádek # se znakem [[Wikipedia:Number_sign|číslo]] (#). ## Více číselných znaků dává hlubší ### a hlouběji ### úrovně. # Konce řádků <br>nepřerušují úrovně. ### Ale skákání úrovní vytváří prázdný prostor. # Prázdné řádky # po ukončení seznamu může začít nový seznam. Každý start nového seznamu ukončí původní seznam. {{^(}}nowiki{{)^}}#{{^(}}/nowiki{{)^}} použijete-li značky "nowiki", zobrazí se na začátku řádku přímo znak mřížky (#), aniž by jej systém chápal jako číslovaný seznam. |lang=wikitext}} | # Začněte každý řádek # se znakem [[Wikipedia:Number_sign|číslo]] (#). ## Více číselných znaků dává hlubší ### a hlouběji ### úrovně. # Konce řádků <br>nepřerušují úrovně. ### Ale skákání úrovní vytváří prázdný prostor. # Prázdné řádky # po ukončení seznamu může začít nový seznam. Každý start nového seznamu ukončí původní seznam. <nowiki>#</nowiki> použijete-li značky "nowiki", zobrazí se na začátku řádku přímo znak mřížky (#), aniž by jej systém chápal jako číslovaný seznam. {{Table-AnchorRow|colspan=3|Definition list}} |- | Seznam definic | {{#tag:syntaxhighlight| ;položka 1 : definice 1 ;položka 2 : definice 2-1 : definice 2-2 |lang=wikitext}} {{note|1=Žádné vložené dvojtečky (:) se nebudou zobrazovat, pokud řádek začíná středníkem (;). Pokud chcete, aby se dvojtečka zobrazila, napište <code>&amp;#58;</code>.}} | ;položka 1 : definice 1 ;položka 2 : definice 2-1 : definice 2-2 |- | Podrobnosti popisu bez popisných výrazů | {{#tag:syntaxhighlight| : Podrobnosti popisu :: Vnořené podrobnosti popisu ::::: Hluboce vnořené detaily popisu |lang=wikitext}} ---- {{Note|1=Toto se často používá jako alternativní řešení pro odsazení řádku, ale poškodí to přístupnost a způsobí neplatný HTML výstup. Použití CSS pro vizuální odsazení je mnohem vhodnější přístup (např. {{tl|indent}}).}} | : Podrobnosti popisu :: Vnořené podrobnosti popisu ::::: Hluboce vnořené detaily popisu |- | Různé typy seznamů | {{#tag:syntaxhighlight| # První # Druhá #* druhá odrážka jedna #* druhá odrážka dva # Třetí #; třetí následující řádek tučně #: třetí definice odrážky jedna # Čtvrtá #: čtvrtá definice odrážky jedna #: vypadá to jako pokračování odstavce #: a často se používá #: místo <br> z <nowiki><br></nowiki> # Pátá ## pátá odstavec 1 ### pátá odstavec 1 pododstavec 1 ## pátá odstavec 2 |lang=wikitext}} ---- {{note|1=Použití <code>#:</code> a <code>*:</code> pro přerušení řádku je stejně problematické jako použití jediné <code>:</code>.}} | # První # Druhá #* druhá odrážka jedna #* druhá odrážka dva # Třetí #; třetí následující řádek tučně #: třetí definice odrážky jedna # Čtvrtá #: čtvrtá definice odrážky jedna #: vypadá to jako pokračování odstavce #: a často se používá #: místo <br> z <nowiki><br></nowiki> # Pátá ## pátá odstavec 1 ### pátá odstavec 1 pododstavec 1 ## pátá odstavec 2 |- | {{anchor|Preformatted text}}Formátování textu | {{#tag:syntaxhighlight| Začněte každý řádek mezerou. Text je '''formátovaný''' a '''''lze''''' vkládat ''značky''. |lang=wikitext}} ---- {{note|1=Tento způsob předformátování platí pouze pro [[#Section formatting|formátování sekcí]]. Značky [[#Character formatting|formátování znaků]] jsou stále platné.}} | Začněte každý řádek mezerou. Text je '''formátovaný''' a '''''lze''''' vkládat ''značky''. |- | Formátování textových bloků | {{#tag:syntaxhighlight| {{^(}}nowiki{{)^}}Začněte mezerou v prvním sloupci, (před {{^(}}nowiki{{)^}}). Pak bude váš formát bloku      udržován. To je dobré pro kopírování bloků při programování: def function(): """dokumentační řetězec""" if True: print True else: print False{{^(}}/nowiki{{)^}} |lang=wikitext}} | {{#tag:nowiki|Začněte mezerou v prvním sloupci, (před &lt;nowiki&gt;). Pak bude váš formát bloku      udržován. To je dobré pro kopírování bloků při programování: def function(): """dokumentační řetězec""" if True: print True else: print False }} |} {{anchor|&lt;p&gt;|.3Cp.3E}} <span id="Paragraphs"></span> == Odstavce == {{anchor|&lt;br&gt;|.3Cbr.3E}} MediaWiki ignoruje jednotlivé konce řádků. Pokud chcete začít nový odstavec, nechte prázdný řádek. Pomocí značky HTML {{tag|br|single}} můžete vynutit zalomení řádku v odstavci. <span id="HTML_tags"></span> == HTML značky (tags) == {{anchor|&lt;div&gt;|.3Cdiv.3E|&lt;span&gt;|.3Cspan.3E}} Na MediaWiki jsou povoleny některé značky [[wikipedia:HTML|HTML]], například {{tag|code|open}}, [[w:Div and span|{{tag|div|open}} a {{tag|span|open}}]]. Platí kdekoli, kam je vložíte. {| class="wikitable" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se {{Table-AnchorRow|colspan=3|&lt;ins&gt;|.3Cins.3E|&lt;u&gt;|.3Cu.3E}} |- | Vloženo <br>(Ve většině prohlížečů se zobrazí jako podtržené) | {{#tag:syntaxhighlight| <ins>Vloženo</ins> nebo <u>Zdůraznit</u> |lang=wikitext}} | <ins>Vloženo</ins> nebo <u>Zdůraznit</u> {{Table-AnchorRow|colspan=3|&lt;del&gt;|.3Cdel.3E|&lt;s&gt;|.3Cs.3E}} |- | Smazáno <br>(Ve většině prohlížečů se zobrazí jako přeškrtnuté) | {{#tag:syntaxhighlight| <s>Prorazit</s> nebo <del>Vymazáno</del> |lang=wikitext}} | <s>Prorazit</s> nebo <del>Vymazáno</del> {{Table-AnchorRow|colspan=3|&lt;code&gt;|.3Ccode.3E}} |- | Text s pevnou šířkou | <syntaxhighlight lang=html><code>Zdrojový kód</code></syntaxhighlight> | <code>Zdrojový kód</code> {{Table-AnchorRow|colspan=3|&lt;blockquote&gt;|.3Cblockquote.3E}} |- | Bloková citace | {{#tag:syntaxhighlight| Předcházející text <blockquote>Bloková citace</blockquote> Následující text |lang=wikitext}} {{Note|1=Pokud citace obsahuje více odstavců, musí být značky, aby se správně zobrazily, na samostatných řádcích, tj.: {{#tag:syntaxhighlight| <blockquote> První odstavec. Druhý odstavec. </blockquote> |lang=wikitext}} {{Tracked|T309778|float=none}} }} | Předcházející text <blockquote>Bloková citace</blockquote> Následující text {{Table-AnchorRow|colspan=3|&lt;q&gt;|.3Cq.3E}} |- | Citáty | {{#tag:syntaxhighlight| <q>Toto je citát</q> |lang=wikitext}} {{Note|1=Prvek q nesmí být použit místo uvozovek, které nepředstavují uvozovky. Například není vhodné používat prvek q k označení sarkastických výrazů. <ref>[https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-q-element HTML Living Standard - prvek &lt;'''q'''&gt;]</ref>}} | <q>Toto je citát</q> |- | Komentář | {{#tag:syntaxhighlight| <!-- Toto je komentář --> Komentáře jsou viditelné pouze v editační zóně. |lang=wikitext}} | <!-- Toto je komentář --> Komentáře jsou viditelné pouze v editační zóně. {{Table-AnchorRow|colspan=3|&lt;pre&gt;|.3Cpre.3E}} |- | Zcela předformátovaný text | {{#tag:syntaxhighlight| {{^(}}pre{{)^}} Text je '''předformátován''' a '''''nelze''''' jej označit ''značkami''. {{^(}}/pre{{)^}} |lang=wikitext}} ---- {{note|1=Chcete-li označit předformátovaný text, zaškrtněte položku "Předformátovaný text" (Preformatted text) na konci předchozí tabulky.}} | {{#tag:pre| Text je '''předformátován''' a '''''nelze''''' jej označit ''značkami''. }} |- | Úpravy předformátovaného textu | {{#tag:syntaxhighlight| {{^(}}pre style="color: red"{{)^}} Text je '''předformátován''' spolu se stylem a '''''nelze''''' jej označit ''značkami'' {{^(}}/pre{{)^}} |lang=wikitext}} ---- {{note|1=Styl CSS lze pojmenovat v atributu <code>style</code>.}} | {{#tag:pre| Text je '''předformátován''' spolu se stylem a '''''nelze''''' jej označit ''značkami'' |style=color: red}} |} pokračování: {| class="wikitable" | style="table-layout: fixed; width: 100%" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se |- | '''Výchozí''' předformátovaný text pro zalomení textu podle dostupné šířky má atribut CSS (<code>white-space: pre-wrap;</code>). | {{#tag:syntaxhighlight| {{^(}}pre{{)^}} Tato dlouhá věta se používá k demonstraci zalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. {{^(}}/pre{{)^}} |lang=wikitext}} | {{#tag:pre| Tato dlouhá věta se používá k demonstraci zalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. |}} |- | '''Přizpůsobený''' předem naformátovaný text se '''zakázaným''' zalomením textu | {{#tag:syntaxhighlight| {{^(}}pre style="white-space: pre;"{{)^}} Tato dlouhá věta se používá k demonstraci nezalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. {{^(}}/pre{{)^}} |lang=wikitext}} | {{#tag:pre| Tato dlouhá věta se používá k demonstraci nezalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. |style=white-space: pre;}} |} Úplný seznam rozpoznaných značek je uveden na stránce {{ll|Help:HTML in wikitext}}. <span id="Inserting_symbols"></span> == Vkládání symbolů == Symboly a další speciální znaky, které nejsou dostupné na vaší klávesnici, lze vkládat mnoha způsoby. [http://www.howtogeek.com/210824/how-to-quickly-type-special-characters-on-any-computer-smartphone-or-tablet/ Mnoho operačních systémů a prohlížečů umožňuje vkládat speciální znaky] prostřednictvím možnosti nabídky nebo panelu operačního systému. Navíc můžete použít WikiEditor nebo [[Special:MyLanguage/VisualEditor/Special characters|VisualEditor]] k jejich vložení na obrazovku úprav. Jako poslední možnost můžete použít speciální sekvenci znaků. Tyto sekvence se nazývají [https://developer.mozilla.org/docs/Glossary/Character_reference odkazy na znaky HTML]. Například: * [[w:Arrow (symbol)|Symbol šipky]] doprava (<code>&rarr;</code>) lze zobrazit pomocí sekvence <code>&amp;rarr;</code> * [[w:Dash#Em pomlčka|Em pomlčku]] (<code>&mdash;</code>) lze zobrazit pomocí <code>&amp;mdash;</code>. ---- {{note|1=Umístěním kurzoru nad libovolný symbol zjistíte znaky, které jej vytváří. Některé symboly, které nejsou k dispozici v aktuálním písmu, se zobrazí jako prázdné čtverečky.}} {| class="wikitable" style="width:100%; text-align:center; font-weight:bold;" |+ Symbolové entity HTML |- | <span title="&amp;Aacute;">&Aacute;</span> | <span title="&amp;aacute;">&aacute;</span> | <span title="&amp;Acirc;">&Acirc;</span> | <span title="&amp;acirc;">&acirc;</span> | <span title="&amp;acute;">&acute;</span> | <span title="&amp;AElig;">&AElig;</span> | <span title="&amp;aelig;">&aelig;</span> | <span title="&amp;Agrave;">&Agrave;</span> | <span title="&amp;agrave;">&agrave;</span> | <span title="&amp;alefsym;">&alefsym;</span> | <span title="&amp;Alpha;">&Alpha;</span> | <span title="&amp;alpha;">&alpha;</span> | <span title="&amp;amp;">&amp;</span> | <span title="&amp;and;">&and;</span> | <span title="&amp;ang;">&ang;</span> | <span title="&amp;Aring;">&Aring;</span> | <span title="&amp;aring;">&aring;</span> | <span title="&amp;asymp;">&asymp;</span> | <span title="&amp;Atilde;">&Atilde;</span> | <span title="&amp;atilde;">&atilde;</span> | <span title="&amp;Auml;">&Auml;</span> | <span title="&amp;auml;">&auml;</span> | <span title="&amp;bdquo;">&bdquo;</span> | <span title="&amp;Beta;">&Beta;</span> | <span title="&amp;beta;">&beta;</span> | <span title="&amp;brvbar;">&brvbar;</span> | <span title="&amp;bull;">&bull;</span> | <span title="&amp;cap;">&cap;</span> | <span title="&amp;Ccedil;">&Ccedil;</span> | <span title="&amp;ccedil;">&ccedil;</span> | <span title="&amp;cedil;">&cedil;</span> | <span title="&amp;cent;">&cent;</span> |- | <span title="&amp;Chi;">&Chi;</span> | <span title="&amp;chi;">&chi;</span> | <span title="&amp;circ;">&circ;</span> | <span title="&amp;clubs;">&clubs;</span> | <span title="&amp;cong;">&cong;</span> | <span title="&amp;copy;">&copy;</span> | <span title="&amp;crarr;">&crarr;</span> | <span title="&amp;cup;">&cup;</span> | <span title="&amp;curren;">&curren;</span> | <span title="&amp;dagger;">&dagger;</span> | <span title="&amp;Dagger;">&Dagger;</span> | <span title="&amp;darr;">&darr;</span> | <span title="&amp;dArr;">&dArr;</span> | <span title="&amp;deg;">&deg;</span> | <span title="&amp;Delta;">&Delta;</span> | <span title="&amp;delta;">&delta;</span> | <span title="&amp;diams;">&diams;</span> | <span title="&amp;divide;">&divide;</span> | <span title="&amp;Eacute;">&Eacute;</span> | <span title="&amp;eacute;">&eacute;</span> | <span title="&amp;Ecirc;">&Ecirc;</span> | <span title="&amp;ecirc;">&ecirc;</span> | <span title="&amp;Egrave;">&Egrave;</span> | <span title="&amp;egrave;">&egrave;</span> | <span title="&amp;empty;">&empty;</span> | <span title="&amp;emsp;">&emsp;</span> | <span title="&amp;ensp;">&ensp;</span> | <span title="&amp;Epsilon;">&Epsilon;</span> | <span title="&amp;epsilon;">&epsilon;</span> | <span title="&amp;equiv;">&equiv;</span> | <span title="&amp;Eta;">&Eta;</span> | <span title="&amp;eta;">&eta;</span> |- | <span title="&amp;ETH;">&ETH;</span> | <span title="&amp;eth;">&eth;</span> | <span title="&amp;Euml;">&Euml;</span> | <span title="&amp;euml;">&euml;</span> | <span title="&amp;euro;">&euro;</span> | <span title="&amp;exist;">&exist;</span> | <span title="&amp;fnof;">&fnof;</span> | <span title="&amp;forall;">&forall;</span> | <span title="&amp;frac12;">&frac12;</span> | <span title="&amp;frac14;">&frac14;</span> | <span title="&amp;frac34;">&frac34;</span> | <span title="&amp;frasl;">&frasl;</span> | <span title="&amp;Gamma;">&Gamma;</span> | <span title="&amp;gamma;">&gamma;</span> | <span title="&amp;ge;">&ge;</span> | <span title="&amp;gt;">&gt;</span> | <span title="&amp;harr;">&harr;</span> | <span title="&amp;hArr;">&hArr;</span> | <span title="&amp;hearts;">&hearts;</span> | <span title="&amp;hellip;">&hellip;</span> | <span title="&amp;Iacute;">&Iacute;</span> | <span title="&amp;iacute;">&iacute;</span> | <span title="&amp;Icirc;">&Icirc;</span> | <span title="&amp;icirc;">&icirc;</span> | <span title="&amp;iexcl;">&iexcl;</span> | <span title="&amp;Igrave;">&Igrave;</span> | <span title="&amp;igrave;">&igrave;</span> | <span title="&amp;image;">&image;</span> | <span title="&amp;infin;">&infin;</span> | <span title="&amp;int;">&int;</span> | <span title="&amp;Iota;">&Iota;</span> | <span title="&amp;iota;">&iota;</span> |- | <span title="&amp;iquest;">&iquest;</span> | <span title="&amp;isin;">&isin;</span> | <span title="&amp;Iuml;">&Iuml;</span> | <span title="&amp;iuml;">&iuml;</span> | <span title="&amp;Kappa;">&Kappa;</span> | <span title="&amp;kappa;">&kappa;</span> | <span title="&amp;Lambda;">&Lambda;</span> | <span title="&amp;lambda;">&lambda;</span> | <span title="&amp;lang;">&lang;</span> | <span title="&amp;laquo;">&laquo;</span> | <span title="&amp;larr;">&larr;</span> | <span title="&amp;lArr;">&lArr;</span> | <span title="&amp;lceil;">&lceil;</span> | <span title="&amp;ldquo;">&ldquo;</span> | <span title="&amp;le;">&le;</span> | <span title="&amp;lfloor;">&lfloor;</span> | <span title="&amp;lowast;">&lowast;</span> | <span title="&amp;loz;">&loz;</span> | <span title="&amp;lrm;">&lrm;</span> | <span title="&amp;lsaquo;">&lsaquo;</span> | <span title="&amp;lsquo;">&lsquo;</span> | <span title="&amp;lt;">&lt;</span> | <span title="&amp;macr;">&macr;</span> | <span title="&amp;mdash;">&mdash;</span> | <span title="&amp;micro;">&micro;</span> | <span title="&amp;middot;">&middot;</span> | <span title="&amp;minus;">&minus;</span> | <span title="&amp;Mu;">&Mu;</span> | <span title="&amp;mu;">&mu;</span> | <span title="&amp;nabla;">&nabla;</span> | <span title="&amp;nbsp;">&nbsp;</span> | <span title="&amp;ndash;">&ndash;</span> |- | <span title="&amp;ne;">&ne;</span> | <span title="&amp;ni;">&ni;</span> | <span title="&amp;not;">&not;</span> | <span title="&amp;notin;">&notin;</span> | <span title="&amp;nsub;">&nsub;</span> | <span title="&amp;Ntilde;">&Ntilde;</span> | <span title="&amp;ntilde;">&ntilde;</span> | <span title="&amp;Nu;">&Nu;</span> | <span title="&amp;nu;">&nu;</span> | <span title="&amp;Oacute;">&Oacute;</span> | <span title="&amp;oacute;">&oacute;</span> | <span title="&amp;Ocirc;">&Ocirc;</span> | <span title="&amp;ocirc;">&ocirc;</span> | <span title="&amp;OElig;">&OElig;</span> | <span title="&amp;oelig;">&oelig;</span> | <span title="&amp;Ograve;">&Ograve;</span> | <span title="&amp;ograve;">&ograve;</span> | <span title="&amp;oline;">&oline;</span> | <span title="&amp;Omega;">&Omega;</span> | <span title="&amp;omega;">&omega;</span> | <span title="&amp;Omicron;">&Omicron;</span> | <span title="&amp;omicron;">&omicron;</span> | <span title="&amp;oplus;">&oplus;</span> | <span title="&amp;or;">&or;</span> | <span title="&amp;ordf;">&ordf;</span> | <span title="&amp;ordm;">&ordm;</span> | <span title="&amp;Oslash;">&Oslash;</span> | <span title="&amp;oslash;">&oslash;</span> | <span title="&amp;Otilde;">&Otilde;</span> | <span title="&amp;otilde;">&otilde;</span> | <span title="&amp;otimes;">&otimes;</span> | <span title="&amp;Ouml;">&Ouml;</span> |- | <span title="&amp;ouml;">&ouml;</span> | <span title="&amp;para;">&para;</span> | <span title="&amp;part;">&part;</span> | <span title="&amp;permil;">&permil;</span> | <span title="&amp;perp;">&perp;</span> | <span title="&amp;Phi;">&Phi;</span> | <span title="&amp;phi;">&phi;</span> | <span title="&amp;Pi;">&Pi;</span> | <span title="&amp;pi;">&pi;</span> | <span title="&amp;piv;">&piv;</span> | <span title="&amp;plusmn;">&plusmn;</span> | <span title="&amp;pound;">&pound;</span> | <span title="&amp;prime;">&prime;</span> | <span title="&amp;Prime;">&Prime;</span> | <span title="&amp;prod;">&prod;</span> | <span title="&amp;prop;">&prop;</span> | <span title="&amp;Psi;">&Psi;</span> | <span title="&amp;psi;">&psi;</span> | <span title="&amp;quot;">&quot;</span> | <span title="&amp;radic;">&radic;</span> | <span title="&amp;rang;">&rang;</span> | <span title="&amp;raquo;">&raquo;</span> | <span title="&amp;rarr;">&rarr;</span> | <span title="&amp;rArr;">&rArr;</span> | <span title="&amp;rceil;">&rceil;</span> | <span title="&amp;rdquo;">&rdquo;</span> | <span title="&amp;real;">&real;</span> | <span title="&amp;reg;">&reg;</span> | <span title="&amp;rfloor;">&rfloor;</span> | <span title="&amp;Rho;">&Rho;</span> | <span title="&amp;rho;">&rho;</span> | <span title="&amp;rlm;">&rlm;</span> |- | <span title="&amp;rsaquo;">&rsaquo;</span> | <span title="&amp;rsquo;">&rsquo;</span> | <span title="&amp;sbquo;">&sbquo;</span> | <span title="&amp;Scaron;">&Scaron;</span> | <span title="&amp;scaron;">&scaron;</span> | <span title="&amp;sdot;">&sdot;</span> | <span title="&amp;sect;">&sect;</span> | <span title="&amp;shy;">&shy;</span> | <span title="&amp;Sigma;">&Sigma;</span> | <span title="&amp;sigma;">&sigma;</span> | <span title="&amp;sigmaf;">&sigmaf;</span> | <span title="&amp;sim;">&sim;</span> | <span title="&amp;spades;">&spades;</span> | <span title="&amp;sub;">&sub;</span> | <span title="&amp;sube;">&sube;</span> | <span title="&amp;sum;">&sum;</span> | <span title="&amp;sup;">&sup;</span> | <span title="&amp;sup1;">&sup1;</span> | <span title="&amp;sup2;">&sup2;</span> | <span title="&amp;sup3;">&sup3;</span> | <span title="&amp;supe;">&supe;</span> | <span title="&amp;szlig;">&szlig;</span> | <span title="&amp;Tau;">&Tau;</span> | <span title="&amp;tau;">&tau;</span> | <span title="&amp;there4;">&there4;</span> | <span title="&amp;Theta;">&Theta;</span> | <span title="&amp;theta;">&theta;</span> | <span title="&amp;thetasym;">&thetasym;</span> | <span title="&amp;thinsp;">&thinsp;</span> | <span title="&amp;THORN;">&THORN;</span> | <span title="&amp;thorn;">&thorn;</span> | <span title="&amp;tilde;">&tilde;</span> |- | <span title="&amp;times;">&times;</span> | <span title="&amp;trade;">&trade;</span> | <span title="&amp;Uacute;">&Uacute;</span> | <span title="&amp;uacute;">&uacute;</span> | <span title="&amp;uarr;">&uarr;</span> | <span title="&amp;uArr;">&uArr;</span> | <span title="&amp;Ucirc;">&Ucirc;</span> | <span title="&amp;ucirc;">&ucirc;</span> | <span title="&amp;Ugrave;">&Ugrave;</span> | <span title="&amp;ugrave;">&ugrave;</span> | <span title="&amp;uml;">&uml;</span> | <span title="&amp;upsih;">&upsih;</span> | <span title="&amp;Upsilon;">&Upsilon;</span> | <span title="&amp;upsilon;">&upsilon;</span> | <span title="&amp;Uuml;">&Uuml;</span> | <span title="&amp;uuml;">&uuml;</span> | <span title="&amp;weierp;">&weierp;</span> | <span title="&amp;Xi;">&Xi;</span> | <span title="&amp;xi;">&xi;</span> | <span title="&amp;Yacute;">&Yacute;</span> | <span title="&amp;yacute;">&yacute;</span> | <span title="&amp;yen;">&yen;</span> | <span title="&amp;yuml;">&yuml;</span> | <span title="&amp;Yuml;">&Yuml;</span> | <span title="&amp;Zeta;">&Zeta;</span> | <span title="&amp;zeta;">&zeta;</span> | <span title="&amp;zwj;">&zwj;</span> | <span title="&amp;zwnj;">&zwnj;</span> |} {| class="wikitable" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se |- | Symbol autorských práv |class=mw-code| &amp;copy; | :::'''&copy;''' |- | Symbol řeckého písmene delta |class=mw-code|&amp;delta; | :::'''&delta;''' |- | Symbol měny euro |class=mw-code|&amp;euro; | :::'''&euro;''' |} Podívejte se na seznam všech HTML entit v článku Wikipedie [[wikipedia:List of HTML entities|Seznam entit HTML]]. Kromě toho MediaWiki podporuje dvě nestandardní referenční entity: <code>&amp;רלמ;</code> a <code>&amp;رلم;</code>, které jsou považovány za ekvivalentní s <code>&amp;rlm;</code>, což je [[wikipedia:Right-to-left mark|značka zprava doleva]]. (Používá se při kombinaci jazyků zprava doleva s jazyky zleva doprava na stejné stránce.) <span id="HTML_tags_and_symbol_entities_displayed_themselves_(with_and_without_interpreting_them)"></span> == HTML tagy a entity symbolů se zobrazují samy (s a bez interpretace) == : <syntaxhighlight lang=html inline>&amp;euro;</syntaxhighlight> &nbsp;&rarr; '''&amp;euro;''' : {{#tag:syntaxhighlight|<span style="color: red; text-decoration: line-through;">Oprava překlepu</span>|lang=wikitext|inline=}} <!-- -->&nbsp;&rarr; '''<span style="color: red; text-decoration: line-through;">Oprava překlepu</span>''' : {{#tag:syntaxhighlight|&lt;span style="color: red; text-decoration: line-through;">Oprava překlepu</span>|lang=wikitext|inline=}} <!-- -->&nbsp;&rarr; '''&lt;span style="color: red; text-decoration: line-through;">Oprava překlepu&lt;/span>''' <span id="Nowiki_for_HTML"></span> === Nowiki pro HTML === {{tag|nowiki|s}} může zakázat (HTML) značky: * <nowiki><<</nowiki>nowiki/>pre> &nbsp;&rarr; <<nowiki/>pre> Symbol ''ne'' &amp; ale uniká: * &<<nowiki/>nowiki/>amp; &nbsp;&rarr; &<nowiki/>amp; Chcete-li obejít symbol &amp; jako text, použijte znak "<syntaxhighlight inline lang="html">&amp;</syntaxhighlight>". Po nahrazení znaku "&" (např. typ "<syntaxhighlight inline lang="html">&amp;nbsp;</syntaxhighlight>"), jehož výsledkem bude "<syntaxhighlight inline lang="html">&nbsp;</syntaxhighlight>". <span id="Other_formatting"></span> == Ostatní formáty == Kromě výše uvedeného značení formátování textu jsou zde i další odkazy na formátování: * {{ll|Help:Links}} * {{ll|Help:Lists}} * {{ll|Help:Images}} * Značení LanguageConverter - viz {{ll|Writing systems/Syntax}} * Reference - viz {{ll|Extension:Cite}} * [[Special:MyLanguage/Help:Tables|Tabulky]] * {{ll|Manual:Collapsible_elements}} Další reference najdete na {{ll|Help:Contents}}. <span id="References"></span> == Poznámky pod čarou == <references/> [[Category:Help{{#translation:}}|Formatting]] k88tyhtcsrh83q9utq2sbv5ff8y3pi8 8364653 8364651 2026-05-03T17:19:38Z Rebulka 17532855 8364653 wikitext text/x-wiki <languages/> {{PD Help Page}} {{See also|Help:Advanced editing}}<!-- To editors: Please NOTE that {{#tag: are required to make language conversion/language converter work, especially for /zh translation pages. -->Zobrazení vašeho textu můžete ovlivnit pomocí wiki značek. Ty se tvoří pomocí standardních znaků jako je např. hvězdička, apostrof nebo znak rovnítka, které mají ve wiki speciální význam, v závislosti na tom kde a v jakém počtu jsou použity. Například chcete-li v textu zvýraznit slovo ''kurzívou'' (italic), stačí, když ho uzavřete mezi dva páry apostrofů, jako například <code><nowiki>''zde''</nowiki></code>. <span id="Text_formatting_markup"></span> == Značky pro formátování textu == {| class="wikitable" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se |- ! colspan="3" style="color: var(--color-base, #202122); background: var(--background-color-progressive-subtle--active, #b6d4fb)" | {{anchor|Character formatting}}Značkování v textu (inline) – ''lze používat všude'' |- | Text v kurzívě | {{#tag:syntaxhighlight| ''kurzíva'' |lang=wikitext}} | ''kurzíva'' |- | Tučný text | {{#tag:syntaxhighlight| '''tučně''' |lang=wikitext}} | '''tučně''' |- | Tučný text v kurzívě | {{#tag:syntaxhighlight| '''''tučná kurzíva''''' |lang=wikitext}} | '''''tučná kurzíva''''' {{Table-AnchorRow|colspan=3|nowiki|&lt;nowiki&gt;|.3Cnowiki.3E}} |- | Zobrazení bez interpretace wiki značek | {{#tag:syntaxhighlight| <!-- This can't use <syntaxhighlight><nowiki>, as that breaks the <translate> tag --> {{^(}}nowiki{{)^}}ignoruji [[wiki]] ''značky''{{^(}}/nowiki{{)^}} |lang=wikitext}} | <nowiki>ignoruji [[wiki]] ''značky''</nowiki> |- ! colspan="3" style="color: var(--color-base, #202122); background: var(--background-color-progressive-subtle--active, #b6d4fb)" | {{anchor|Section formatting}}Sekce (oddíly) – ''jejich zápis začíná vždy na počátku řádky'' |- | Úrovně sekcí (oddílů) a interpretace jejich nadpisů (záhlaví) | {{anchor|headings}}{{#tag:syntaxhighlight| == Úroveň 2 == === Úroveň 3 === ==== Úroveň 4 ==== ===== Úroveň 5 ===== ====== Úroveň 6 ====== |lang=wikitext}} ---- {{note|1=<nowiki/> * [[Help talk:Formatting#Level_1|Úroveň 1]], jedná se o úroveň názvu stránky. * Nezadávejte na řádek žádný text za koncová znaménka 'rovná se'. * Článek se čtyřmi a více nadpisy vytvoří automaticky [[wikipedia:Help:Section#Table of contents (TOC)|tabulku s obsahem]] umístěnou v úvodu stránky. Pokud nenastavíte kouzelné slovo <code><nowiki>__NOTOC__</nowiki></code>. }} | {{Fake heading|level=2|1=Úroveň 2}} {{Fake heading|level=3|1=Úroveň 3}} {{Fake heading|level=4|1=<span class="mw-translate-fuzzy"><h4>Úroveň 4</h4></span>}} {{Fake heading|level=5|1=<span class="mw-translate-fuzzy"><h5>Úroveň 5</h5></span>}} {{Fake heading|level=6|1=<span class="mw-translate-fuzzy"><h6>Úroveň 6</h6></span>}} |- | Horizontální čára | {{#tag:syntaxhighlight| Předcházející text ---- Následující text |lang=wikitext}} | Předcházející text ---- Následující text |- | Seznam s odrážkami | {{anchor|bulleted-lists}} {{#tag:syntaxhighlight| * Začněte každý řádek * [[Wikipedia:hvězdička|hvězdičkou]] (*). ** Více hvězdiček znamená hlubší *** a hlubší úrovně. * Konce řádků <br>nepřerušují úrovně. *** Ale skákání úrovní vytváří prázdný prostor. Jakýkoli jiný začátek seznam končí. * seznam s odrážkami můžete kombinovat ** s odsazením ::- odsazení ** vytvoří místo odrážky odpovídají mezeru * kombinace seznamu odrážek ** s definicí *:- definice ** bez mezer * seznam odrážek :- definice :* sublist, který nevytváří prázdné :* mezery za definicí |lang=wikitext}} | * Začněte každý řádek * [[Wikipedia:hvězdička|hvězdičkou]] (*). ** Více hvězdiček znamená hlubší *** a hlubší úrovně. * Konce řádků <br>nepřerušují úrovně. *** Ale skákání úrovní vytváří prázdný prostor. Jakýkoli jiný začátek seznam končí. * seznam s odrážkami můžete kombinovat ** s odsazením ::- odsazení ** vytvoří místo odrážky odpovídají mezeru * kombinace seznamu odrážek ** s definicí *:- definice ** bez mezer * seznam odrážek :- definice :* sublist, který nevytváří prázdné :* mezery za definicí |- | Číslovaný seznam | {{anchor|numbered-list}} {{#tag:syntaxhighlight| # Začněte každý řádek # se znakem [[Wikipedia:Number_sign|číslo]] (#). ## Více číselných znaků dává hlubší ### a hlouběji ### úrovně. # Konce řádků <br>nepřerušují úrovně. ### Ale skákání úrovní vytváří prázdný prostor. # Prázdné řádky # po ukončení seznamu může začít nový seznam. Každý start nového seznamu ukončí původní seznam. {{^(}}nowiki{{)^}}#{{^(}}/nowiki{{)^}} použijete-li značky "nowiki", zobrazí se na začátku řádku přímo znak mřížky (#), aniž by jej systém chápal jako číslovaný seznam. |lang=wikitext}} | # Začněte každý řádek # se znakem [[Wikipedia:Number_sign|číslo]] (#). ## Více číselných znaků dává hlubší ### a hlouběji ### úrovně. # Konce řádků <br>nepřerušují úrovně. ### Ale skákání úrovní vytváří prázdný prostor. # Prázdné řádky # po ukončení seznamu může začít nový seznam. Každý start nového seznamu ukončí původní seznam. <nowiki>#</nowiki> použijete-li značky "nowiki", zobrazí se na začátku řádku přímo znak mřížky (#), aniž by jej systém chápal jako číslovaný seznam. {{Table-AnchorRow|colspan=3|Definition list}} |- | Seznam definic | {{#tag:syntaxhighlight| ;položka 1 : definice 1 ;položka 2 : definice 2-1 : definice 2-2 |lang=wikitext}} {{note|1=Žádné vložené dvojtečky (:) se nebudou zobrazovat, pokud řádek začíná středníkem (;). Pokud chcete, aby se dvojtečka zobrazila, napište <code>&amp;#58;</code>.}} | ;položka 1 : definice 1 ;položka 2 : definice 2-1 : definice 2-2 |- | Podrobnosti popisu bez popisných výrazů | {{#tag:syntaxhighlight| : Podrobnosti popisu :: Vnořené podrobnosti popisu ::::: Hluboce vnořené detaily popisu |lang=wikitext}} ---- {{Note|1=Toto se často používá jako alternativní řešení pro odsazení řádku, ale poškodí to přístupnost a způsobí neplatný HTML výstup. Použití CSS pro vizuální odsazení je mnohem vhodnější přístup (např. {{tl|indent}}).}} | : Podrobnosti popisu :: Vnořené podrobnosti popisu ::::: Hluboce vnořené detaily popisu |- | Různé typy seznamů | {{#tag:syntaxhighlight| # První # Druhá #* druhá odrážka jedna #* druhá odrážka dva # Třetí #; třetí následující řádek tučně #: třetí definice odrážky jedna # Čtvrtá #: čtvrtá definice odrážky jedna #: vypadá to jako pokračování odstavce #: a často se používá #: místo <br> z <nowiki><br></nowiki> # Pátá ## pátá odstavec 1 ### pátá odstavec 1 pododstavec 1 ## pátá odstavec 2 |lang=wikitext}} ---- {{note|1=Použití <code>#:</code> a <code>*:</code> pro přerušení řádku je stejně problematické jako použití jediné <code>:</code>.}} | # První # Druhá #* druhá odrážka jedna #* druhá odrážka dva # Třetí #; třetí následující řádek tučně #: třetí definice odrážky jedna # Čtvrtá #: čtvrtá definice odrážky jedna #: vypadá to jako pokračování odstavce #: a často se používá #: místo <br> z <nowiki><br></nowiki> # Pátá ## pátá odstavec 1 ### pátá odstavec 1 pododstavec 1 ## pátá odstavec 2 |- | {{anchor|Preformatted text}}Formátování textu | {{#tag:syntaxhighlight| Začněte každý řádek mezerou. Text je '''formátovaný''' a '''''lze''''' vkládat ''značky''. |lang=wikitext}} ---- {{note|1=Tento způsob předformátování platí pouze pro [[#Section formatting|formátování sekcí]]. Značky [[#Character formatting|formátování znaků]] jsou stále platné.}} | Začněte každý řádek mezerou. Text je '''formátovaný''' a '''''lze''''' vkládat ''značky''. |- | Formátování textových bloků | {{#tag:syntaxhighlight| {{^(}}nowiki{{)^}}Začněte mezerou v prvním sloupci, (před {{^(}}nowiki{{)^}}). Pak bude váš formát bloku      udržován. To je dobré pro kopírování bloků při programování: def function(): """dokumentační řetězec""" if True: print True else: print False{{^(}}/nowiki{{)^}} |lang=wikitext}} | {{#tag:nowiki|Začněte mezerou v prvním sloupci, (před &lt;nowiki&gt;). Pak bude váš formát bloku      udržován. To je dobré pro kopírování bloků při programování: def function(): """dokumentační řetězec""" if True: print True else: print False }} |} {{anchor|&lt;p&gt;|.3Cp.3E}} <span id="Paragraphs"></span> == Odstavce == {{anchor|&lt;br&gt;|.3Cbr.3E}} MediaWiki ignoruje jednotlivé konce řádků. Pokud chcete začít nový odstavec, nechte prázdný řádek. Pomocí značky HTML {{tag|br|single}} můžete vynutit zalomení řádku v odstavci. <span id="HTML_tags"></span> == HTML značky (tags) == {{anchor|&lt;div&gt;|.3Cdiv.3E|&lt;span&gt;|.3Cspan.3E}} Na MediaWiki jsou povoleny některé značky [[wikipedia:HTML|HTML]], například {{tag|code|open}}, [[w:Div and span|{{tag|div|open}} a {{tag|span|open}}]]. Platí kdekoli, kam je vložíte. {| class="wikitable" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se {{Table-AnchorRow|colspan=3|&lt;ins&gt;|.3Cins.3E|&lt;u&gt;|.3Cu.3E}} |- | Vloženo <br>(Ve většině prohlížečů se zobrazí jako podtržené) | {{#tag:syntaxhighlight| <ins>Vloženo</ins> nebo <u>Zdůraznit</u> |lang=wikitext}} | <ins>Vloženo</ins> nebo <u>Zdůraznit</u> {{Table-AnchorRow|colspan=3|&lt;del&gt;|.3Cdel.3E|&lt;s&gt;|.3Cs.3E}} |- | Smazáno <br>(Ve většině prohlížečů se zobrazí jako přeškrtnuté) | {{#tag:syntaxhighlight| <s>Prorazit</s> nebo <del>Vymazáno</del> |lang=wikitext}} | <s>Prorazit</s> nebo <del>Vymazáno</del> {{Table-AnchorRow|colspan=3|&lt;code&gt;|.3Ccode.3E}} |- | Text s pevnou šířkou | <syntaxhighlight lang=html><code>Zdrojový kód</code></syntaxhighlight> | <code>Zdrojový kód</code> {{Table-AnchorRow|colspan=3|&lt;blockquote&gt;|.3Cblockquote.3E}} |- | Bloková citace | {{#tag:syntaxhighlight| Předcházející text <blockquote>Bloková citace</blockquote> Následující text |lang=wikitext}} {{Note|1=Pokud citace obsahuje více odstavců, musí být značky, aby se správně zobrazily, na samostatných řádcích, tj.: {{#tag:syntaxhighlight| <blockquote> První odstavec. Druhý odstavec. </blockquote> |lang=wikitext}} {{Tracked|T309778|float=none}} }} | Předcházející text <blockquote>Bloková citace</blockquote> Následující text {{Table-AnchorRow|colspan=3|&lt;q&gt;|.3Cq.3E}} |- | Citáty | {{#tag:syntaxhighlight| <q>Toto je citát</q> |lang=wikitext}} {{Note|1=Prvek q nesmí být použit místo uvozovek, které nepředstavují uvozovky. Například není vhodné používat prvek q k označení sarkastických výrazů. <ref>[https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-q-element HTML Living Standard - prvek &lt;'''q'''&gt;]</ref>}} | <q>Toto je citát</q> |- | Komentář | {{#tag:syntaxhighlight| <!-- Toto je komentář --> Komentáře jsou viditelné pouze v editační zóně. |lang=wikitext}} | <!-- Toto je komentář --> Komentáře jsou viditelné pouze v editační zóně. {{Table-AnchorRow|colspan=3|&lt;pre&gt;|.3Cpre.3E}} |- | Zcela předformátovaný text | {{#tag:syntaxhighlight| {{^(}}pre{{)^}} Text je '''předformátován''' a '''''nelze''''' jej označit ''značkami''. {{^(}}/pre{{)^}} |lang=wikitext}} ---- {{note|1=Chcete-li označit předformátovaný text, zaškrtněte položku "Předformátovaný text" (Preformatted text) na konci předchozí tabulky.}} | {{#tag:pre| Text je '''předformátován''' a '''''nelze''''' jej označit ''značkami''. }} |- | Úpravy předformátovaného textu | {{#tag:syntaxhighlight| {{^(}}pre style="color: red"{{)^}} Text je '''předformátován''' spolu se stylem a '''''nelze''''' jej označit ''značkami'' {{^(}}/pre{{)^}} |lang=wikitext}} ---- {{note|1=Styl CSS lze pojmenovat v atributu <code>style</code>.}} | {{#tag:pre| Text je '''předformátován''' spolu se stylem a '''''nelze''''' jej označit ''značkami'' |style=color: red}} |} pokračování: {| class="wikitable" | style="table-layout: fixed; width: 100%" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se |- | '''Výchozí''' předformátovaný text pro zalomení textu podle dostupné šířky má atribut CSS (<code>white-space: pre-wrap;</code>). | {{#tag:syntaxhighlight| {{^(}}pre{{)^}} Tato dlouhá věta se používá k demonstraci zalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. {{^(}}/pre{{)^}} |lang=wikitext}} | {{#tag:pre| Tato dlouhá věta se používá k demonstraci zalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. |}} |- | '''Přizpůsobený''' předem naformátovaný text se '''zakázaným''' zalomením textu | {{#tag:syntaxhighlight| {{^(}}pre style="white-space: pre;"{{)^}} Tato dlouhá věta se používá k demonstraci nezalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. {{^(}}/pre{{)^}} |lang=wikitext}} | {{#tag:pre| Tato dlouhá věta se používá k demonstraci nezalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. |style=white-space: pre;}} |} Úplný seznam rozpoznaných značek je uveden na stránce {{ll|Help:HTML in wikitext}}. <span id="Inserting_symbols"></span> == Vkládání symbolů == Symboly a další speciální znaky, které nejsou dostupné na vaší klávesnici, lze vkládat mnoha způsoby. [http://www.howtogeek.com/210824/how-to-quickly-type-special-characters-on-any-computer-smartphone-or-tablet/ Mnoho operačních systémů a prohlížečů umožňuje vkládat speciální znaky] prostřednictvím možnosti nabídky nebo panelu operačního systému. Navíc můžete použít WikiEditor nebo [[Special:MyLanguage/VisualEditor/Special characters|VisualEditor]] k jejich vložení na obrazovku úprav. Jako poslední možnost můžete použít speciální sekvenci znaků. Tyto sekvence se nazývají [https://developer.mozilla.org/docs/Glossary/Character_reference odkazy na znaky HTML]. Například: * [[w:Arrow (symbol)|Symbol šipky]] doprava (<code>&rarr;</code>) lze zobrazit pomocí sekvence <code>&amp;rarr;</code> * [[w:Dash#Em pomlčka|Em pomlčku]] (<code>&mdash;</code>) lze zobrazit pomocí <code>&amp;mdash;</code>. ---- {{note|1=Umístěním kurzoru nad libovolný symbol zjistíte znaky, které jej vytváří. Některé symboly, které nejsou k dispozici v aktuálním písmu, se zobrazí jako prázdné čtverečky.}} {| class="wikitable" style="width:100%; text-align:center; font-weight:bold;" |+ Symbolové entity HTML |- | <span title="&amp;Aacute;">&Aacute;</span> | <span title="&amp;aacute;">&aacute;</span> | <span title="&amp;Acirc;">&Acirc;</span> | <span title="&amp;acirc;">&acirc;</span> | <span title="&amp;acute;">&acute;</span> | <span title="&amp;AElig;">&AElig;</span> | <span title="&amp;aelig;">&aelig;</span> | <span title="&amp;Agrave;">&Agrave;</span> | <span title="&amp;agrave;">&agrave;</span> | <span title="&amp;alefsym;">&alefsym;</span> | <span title="&amp;Alpha;">&Alpha;</span> | <span title="&amp;alpha;">&alpha;</span> | <span title="&amp;amp;">&amp;</span> | <span title="&amp;and;">&and;</span> | <span title="&amp;ang;">&ang;</span> | <span title="&amp;Aring;">&Aring;</span> | <span title="&amp;aring;">&aring;</span> | <span title="&amp;asymp;">&asymp;</span> | <span title="&amp;Atilde;">&Atilde;</span> | <span title="&amp;atilde;">&atilde;</span> | <span title="&amp;Auml;">&Auml;</span> | <span title="&amp;auml;">&auml;</span> | <span title="&amp;bdquo;">&bdquo;</span> | <span title="&amp;Beta;">&Beta;</span> | <span title="&amp;beta;">&beta;</span> | <span title="&amp;brvbar;">&brvbar;</span> | <span title="&amp;bull;">&bull;</span> | <span title="&amp;cap;">&cap;</span> | <span title="&amp;Ccedil;">&Ccedil;</span> | <span title="&amp;ccedil;">&ccedil;</span> | <span title="&amp;cedil;">&cedil;</span> | <span title="&amp;cent;">&cent;</span> |- | <span title="&amp;Chi;">&Chi;</span> | <span title="&amp;chi;">&chi;</span> | <span title="&amp;circ;">&circ;</span> | <span title="&amp;clubs;">&clubs;</span> | <span title="&amp;cong;">&cong;</span> | <span title="&amp;copy;">&copy;</span> | <span title="&amp;crarr;">&crarr;</span> | <span title="&amp;cup;">&cup;</span> | <span title="&amp;curren;">&curren;</span> | <span title="&amp;dagger;">&dagger;</span> | <span title="&amp;Dagger;">&Dagger;</span> | <span title="&amp;darr;">&darr;</span> | <span title="&amp;dArr;">&dArr;</span> | <span title="&amp;deg;">&deg;</span> | <span title="&amp;Delta;">&Delta;</span> | <span title="&amp;delta;">&delta;</span> | <span title="&amp;diams;">&diams;</span> | <span title="&amp;divide;">&divide;</span> | <span title="&amp;Eacute;">&Eacute;</span> | <span title="&amp;eacute;">&eacute;</span> | <span title="&amp;Ecirc;">&Ecirc;</span> | <span title="&amp;ecirc;">&ecirc;</span> | <span title="&amp;Egrave;">&Egrave;</span> | <span title="&amp;egrave;">&egrave;</span> | <span title="&amp;empty;">&empty;</span> | <span title="&amp;emsp;">&emsp;</span> | <span title="&amp;ensp;">&ensp;</span> | <span title="&amp;Epsilon;">&Epsilon;</span> | <span title="&amp;epsilon;">&epsilon;</span> | <span title="&amp;equiv;">&equiv;</span> | <span title="&amp;Eta;">&Eta;</span> | <span title="&amp;eta;">&eta;</span> |- | <span title="&amp;ETH;">&ETH;</span> | <span title="&amp;eth;">&eth;</span> | <span title="&amp;Euml;">&Euml;</span> | <span title="&amp;euml;">&euml;</span> | <span title="&amp;euro;">&euro;</span> | <span title="&amp;exist;">&exist;</span> | <span title="&amp;fnof;">&fnof;</span> | <span title="&amp;forall;">&forall;</span> | <span title="&amp;frac12;">&frac12;</span> | <span title="&amp;frac14;">&frac14;</span> | <span title="&amp;frac34;">&frac34;</span> | <span title="&amp;frasl;">&frasl;</span> | <span title="&amp;Gamma;">&Gamma;</span> | <span title="&amp;gamma;">&gamma;</span> | <span title="&amp;ge;">&ge;</span> | <span title="&amp;gt;">&gt;</span> | <span title="&amp;harr;">&harr;</span> | <span title="&amp;hArr;">&hArr;</span> | <span title="&amp;hearts;">&hearts;</span> | <span title="&amp;hellip;">&hellip;</span> | <span title="&amp;Iacute;">&Iacute;</span> | <span title="&amp;iacute;">&iacute;</span> | <span title="&amp;Icirc;">&Icirc;</span> | <span title="&amp;icirc;">&icirc;</span> | <span title="&amp;iexcl;">&iexcl;</span> | <span title="&amp;Igrave;">&Igrave;</span> | <span title="&amp;igrave;">&igrave;</span> | <span title="&amp;image;">&image;</span> | <span title="&amp;infin;">&infin;</span> | <span title="&amp;int;">&int;</span> | <span title="&amp;Iota;">&Iota;</span> | <span title="&amp;iota;">&iota;</span> |- | <span title="&amp;iquest;">&iquest;</span> | <span title="&amp;isin;">&isin;</span> | <span title="&amp;Iuml;">&Iuml;</span> | <span title="&amp;iuml;">&iuml;</span> | <span title="&amp;Kappa;">&Kappa;</span> | <span title="&amp;kappa;">&kappa;</span> | <span title="&amp;Lambda;">&Lambda;</span> | <span title="&amp;lambda;">&lambda;</span> | <span title="&amp;lang;">&lang;</span> | <span title="&amp;laquo;">&laquo;</span> | <span title="&amp;larr;">&larr;</span> | <span title="&amp;lArr;">&lArr;</span> | <span title="&amp;lceil;">&lceil;</span> | <span title="&amp;ldquo;">&ldquo;</span> | <span title="&amp;le;">&le;</span> | <span title="&amp;lfloor;">&lfloor;</span> | <span title="&amp;lowast;">&lowast;</span> | <span title="&amp;loz;">&loz;</span> | <span title="&amp;lrm;">&lrm;</span> | <span title="&amp;lsaquo;">&lsaquo;</span> | <span title="&amp;lsquo;">&lsquo;</span> | <span title="&amp;lt;">&lt;</span> | <span title="&amp;macr;">&macr;</span> | <span title="&amp;mdash;">&mdash;</span> | <span title="&amp;micro;">&micro;</span> | <span title="&amp;middot;">&middot;</span> | <span title="&amp;minus;">&minus;</span> | <span title="&amp;Mu;">&Mu;</span> | <span title="&amp;mu;">&mu;</span> | <span title="&amp;nabla;">&nabla;</span> | <span title="&amp;nbsp;">&nbsp;</span> | <span title="&amp;ndash;">&ndash;</span> |- | <span title="&amp;ne;">&ne;</span> | <span title="&amp;ni;">&ni;</span> | <span title="&amp;not;">&not;</span> | <span title="&amp;notin;">&notin;</span> | <span title="&amp;nsub;">&nsub;</span> | <span title="&amp;Ntilde;">&Ntilde;</span> | <span title="&amp;ntilde;">&ntilde;</span> | <span title="&amp;Nu;">&Nu;</span> | <span title="&amp;nu;">&nu;</span> | <span title="&amp;Oacute;">&Oacute;</span> | <span title="&amp;oacute;">&oacute;</span> | <span title="&amp;Ocirc;">&Ocirc;</span> | <span title="&amp;ocirc;">&ocirc;</span> | <span title="&amp;OElig;">&OElig;</span> | <span title="&amp;oelig;">&oelig;</span> | <span title="&amp;Ograve;">&Ograve;</span> | <span title="&amp;ograve;">&ograve;</span> | <span title="&amp;oline;">&oline;</span> | <span title="&amp;Omega;">&Omega;</span> | <span title="&amp;omega;">&omega;</span> | <span title="&amp;Omicron;">&Omicron;</span> | <span title="&amp;omicron;">&omicron;</span> | <span title="&amp;oplus;">&oplus;</span> | <span title="&amp;or;">&or;</span> | <span title="&amp;ordf;">&ordf;</span> | <span title="&amp;ordm;">&ordm;</span> | <span title="&amp;Oslash;">&Oslash;</span> | <span title="&amp;oslash;">&oslash;</span> | <span title="&amp;Otilde;">&Otilde;</span> | <span title="&amp;otilde;">&otilde;</span> | <span title="&amp;otimes;">&otimes;</span> | <span title="&amp;Ouml;">&Ouml;</span> |- | <span title="&amp;ouml;">&ouml;</span> | <span title="&amp;para;">&para;</span> | <span title="&amp;part;">&part;</span> | <span title="&amp;permil;">&permil;</span> | <span title="&amp;perp;">&perp;</span> | <span title="&amp;Phi;">&Phi;</span> | <span title="&amp;phi;">&phi;</span> | <span title="&amp;Pi;">&Pi;</span> | <span title="&amp;pi;">&pi;</span> | <span title="&amp;piv;">&piv;</span> | <span title="&amp;plusmn;">&plusmn;</span> | <span title="&amp;pound;">&pound;</span> | <span title="&amp;prime;">&prime;</span> | <span title="&amp;Prime;">&Prime;</span> | <span title="&amp;prod;">&prod;</span> | <span title="&amp;prop;">&prop;</span> | <span title="&amp;Psi;">&Psi;</span> | <span title="&amp;psi;">&psi;</span> | <span title="&amp;quot;">&quot;</span> | <span title="&amp;radic;">&radic;</span> | <span title="&amp;rang;">&rang;</span> | <span title="&amp;raquo;">&raquo;</span> | <span title="&amp;rarr;">&rarr;</span> | <span title="&amp;rArr;">&rArr;</span> | <span title="&amp;rceil;">&rceil;</span> | <span title="&amp;rdquo;">&rdquo;</span> | <span title="&amp;real;">&real;</span> | <span title="&amp;reg;">&reg;</span> | <span title="&amp;rfloor;">&rfloor;</span> | <span title="&amp;Rho;">&Rho;</span> | <span title="&amp;rho;">&rho;</span> | <span title="&amp;rlm;">&rlm;</span> |- | <span title="&amp;rsaquo;">&rsaquo;</span> | <span title="&amp;rsquo;">&rsquo;</span> | <span title="&amp;sbquo;">&sbquo;</span> | <span title="&amp;Scaron;">&Scaron;</span> | <span title="&amp;scaron;">&scaron;</span> | <span title="&amp;sdot;">&sdot;</span> | <span title="&amp;sect;">&sect;</span> | <span title="&amp;shy;">&shy;</span> | <span title="&amp;Sigma;">&Sigma;</span> | <span title="&amp;sigma;">&sigma;</span> | <span title="&amp;sigmaf;">&sigmaf;</span> | <span title="&amp;sim;">&sim;</span> | <span title="&amp;spades;">&spades;</span> | <span title="&amp;sub;">&sub;</span> | <span title="&amp;sube;">&sube;</span> | <span title="&amp;sum;">&sum;</span> | <span title="&amp;sup;">&sup;</span> | <span title="&amp;sup1;">&sup1;</span> | <span title="&amp;sup2;">&sup2;</span> | <span title="&amp;sup3;">&sup3;</span> | <span title="&amp;supe;">&supe;</span> | <span title="&amp;szlig;">&szlig;</span> | <span title="&amp;Tau;">&Tau;</span> | <span title="&amp;tau;">&tau;</span> | <span title="&amp;there4;">&there4;</span> | <span title="&amp;Theta;">&Theta;</span> | <span title="&amp;theta;">&theta;</span> | <span title="&amp;thetasym;">&thetasym;</span> | <span title="&amp;thinsp;">&thinsp;</span> | <span title="&amp;THORN;">&THORN;</span> | <span title="&amp;thorn;">&thorn;</span> | <span title="&amp;tilde;">&tilde;</span> |- | <span title="&amp;times;">&times;</span> | <span title="&amp;trade;">&trade;</span> | <span title="&amp;Uacute;">&Uacute;</span> | <span title="&amp;uacute;">&uacute;</span> | <span title="&amp;uarr;">&uarr;</span> | <span title="&amp;uArr;">&uArr;</span> | <span title="&amp;Ucirc;">&Ucirc;</span> | <span title="&amp;ucirc;">&ucirc;</span> | <span title="&amp;Ugrave;">&Ugrave;</span> | <span title="&amp;ugrave;">&ugrave;</span> | <span title="&amp;uml;">&uml;</span> | <span title="&amp;upsih;">&upsih;</span> | <span title="&amp;Upsilon;">&Upsilon;</span> | <span title="&amp;upsilon;">&upsilon;</span> | <span title="&amp;Uuml;">&Uuml;</span> | <span title="&amp;uuml;">&uuml;</span> | <span title="&amp;weierp;">&weierp;</span> | <span title="&amp;Xi;">&Xi;</span> | <span title="&amp;xi;">&xi;</span> | <span title="&amp;Yacute;">&Yacute;</span> | <span title="&amp;yacute;">&yacute;</span> | <span title="&amp;yen;">&yen;</span> | <span title="&amp;yuml;">&yuml;</span> | <span title="&amp;Yuml;">&Yuml;</span> | <span title="&amp;Zeta;">&Zeta;</span> | <span title="&amp;zeta;">&zeta;</span> | <span title="&amp;zwj;">&zwj;</span> | <span title="&amp;zwnj;">&zwnj;</span> |} {| class="wikitable" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se |- | Symbol autorských práv |class=mw-code| &amp;copy; | :::'''&copy;''' |- | Symbol řeckého písmene delta |class=mw-code|&amp;delta; | :::'''&delta;''' |- | Symbol měny euro |class=mw-code|&amp;euro; | :::'''&euro;''' |} Podívejte se na seznam všech HTML entit v článku Wikipedie [[wikipedia:List of HTML entities|Seznam entit HTML]]. Kromě toho MediaWiki podporuje dvě nestandardní referenční entity: <code>&amp;רלמ;</code> a <code>&amp;رلم;</code>, které jsou považovány za ekvivalentní s <code>&amp;rlm;</code>, což je [[wikipedia:Right-to-left mark|značka zprava doleva]]. (Používá se při kombinaci jazyků zprava doleva s jazyky zleva doprava na stejné stránce.) <span id="HTML_tags_and_symbol_entities_displayed_themselves_(with_and_without_interpreting_them)"></span> == HTML tagy a entity symbolů se zobrazují samy (s a bez interpretace) == : <syntaxhighlight lang=html inline>&amp;euro;</syntaxhighlight> &nbsp;&rarr; '''&amp;euro;''' : {{#tag:syntaxhighlight|<span style="color: red; text-decoration: line-through;">Oprava překlepu</span>|lang=wikitext|inline=}} <!-- -->&nbsp;&rarr; '''<span style="color: red; text-decoration: line-through;">Oprava překlepu</span>''' : {{#tag:syntaxhighlight|&lt;span style="color: red; text-decoration: line-through;">Oprava překlepu</span>|lang=wikitext|inline=}} <!-- -->&nbsp;&rarr; '''&lt;span style="color: red; text-decoration: line-through;">Oprava překlepu&lt;/span>''' <span id="Nowiki_for_HTML"></span> === Nowiki pro HTML === {{tag|nowiki|s}} může zakázat (HTML) značky: * <nowiki><<</nowiki>nowiki/>pre> &nbsp;&rarr; <<nowiki/>pre> Symbol ''ne'' &amp; ale uniká: * &<<nowiki/>nowiki/>amp; &nbsp;&rarr; &<nowiki/>amp; Chcete-li obejít symbol &amp; jako text, použijte znak "<syntaxhighlight inline lang="html">&amp;</syntaxhighlight>". Po nahrazení znaku "&" (např. typ "<syntaxhighlight inline lang="html">&amp;nbsp;</syntaxhighlight>"), jehož výsledkem bude "<syntaxhighlight inline lang="html">&nbsp;</syntaxhighlight>". <span id="Other_formatting"></span> == Ostatní formáty == Kromě výše uvedeného značení formátování textu jsou zde i další odkazy na formátování: * {{ll|Help:Links}} * {{ll|Help:Lists}} * {{ll|Help:Images}} * Značení LanguageConverter - viz {{ll|Writing systems/Syntax}} * Reference - viz {{ll|Extension:Cite}} * [[Special:MyLanguage/Help:Tables|Tabulky]] * {{ll|Manual:Collapsible_elements}} Další reference najdete na {{ll|Help:Contents}}. <span id="References"></span> == Poznámky pod čarou == <references/> [[Category:Help{{#translation:}}|Formatting]] liaw4encavy63o9zdj4i8mfyq2q9mvc 8364655 8364653 2026-05-03T17:19:49Z Rebulka 17532855 8364655 wikitext text/x-wiki <languages/> {{PD Help Page}} {{See also|Help:Advanced editing}}<!-- To editors: Please NOTE that {{#tag: are required to make language conversion/language converter work, especially for /zh translation pages. -->Zobrazení vašeho textu můžete ovlivnit pomocí wiki značek. Ty se tvoří pomocí standardních znaků jako je např. hvězdička, apostrof nebo znak rovnítka, které mají ve wiki speciální význam, v závislosti na tom kde a v jakém počtu jsou použity. Například chcete-li v textu zvýraznit slovo ''kurzívou'' (italic), stačí, když ho uzavřete mezi dva páry apostrofů, jako například <code><nowiki>''zde''</nowiki></code>. <span id="Text_formatting_markup"></span> == Značky pro formátování textu == {| class="wikitable" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se |- ! colspan="3" style="color: var(--color-base, #202122); background: var(--background-color-progressive-subtle--active, #b6d4fb)" | {{anchor|Character formatting}}Značkování v textu (inline) – ''lze používat všude'' |- | Text v kurzívě | {{#tag:syntaxhighlight| ''kurzíva'' |lang=wikitext}} | ''kurzíva'' |- | Tučný text | {{#tag:syntaxhighlight| '''tučně''' |lang=wikitext}} | '''tučně''' |- | Tučný text v kurzívě | {{#tag:syntaxhighlight| '''''tučná kurzíva''''' |lang=wikitext}} | '''''tučná kurzíva''''' {{Table-AnchorRow|colspan=3|nowiki|&lt;nowiki&gt;|.3Cnowiki.3E}} |- | Zobrazení bez interpretace wiki značek | {{#tag:syntaxhighlight| <!-- This can't use <syntaxhighlight><nowiki>, as that breaks the <translate> tag --> {{^(}}nowiki{{)^}}ignoruji [[wiki]] ''značky''{{^(}}/nowiki{{)^}} |lang=wikitext}} | <nowiki>ignoruji [[wiki]] ''značky''</nowiki> |- ! colspan="3" style="color: var(--color-base, #202122); background: var(--background-color-progressive-subtle--active, #b6d4fb)" | {{anchor|Section formatting}}Sekce (oddíly) – ''jejich zápis začíná vždy na počátku řádky'' |- | Úrovně sekcí (oddílů) a interpretace jejich nadpisů (záhlaví) | {{anchor|headings}}{{#tag:syntaxhighlight| == Úroveň 2 == === Úroveň 3 === ==== Úroveň 4 ==== ===== Úroveň 5 ===== ====== Úroveň 6 ====== |lang=wikitext}} ---- {{note|1=<nowiki/> * [[Help talk:Formatting#Level_1|Úroveň 1]], jedná se o úroveň názvu stránky. * Nezadávejte na řádek žádný text za koncová znaménka 'rovná se'. * Článek se čtyřmi a více nadpisy vytvoří automaticky [[wikipedia:Help:Section#Table of contents (TOC)|tabulku s obsahem]] umístěnou v úvodu stránky. Pokud nenastavíte kouzelné slovo <code><nowiki>__NOTOC__</nowiki></code>. }} | {{Fake heading|level=2|1=Úroveň 2}} {{Fake heading|level=3|1=Úroveň 3}} {{Fake heading|level=4|1=Úroveň 4}} {{Fake heading|level=5|1=<span class="mw-translate-fuzzy"><h5>Úroveň 5</h5></span>}} {{Fake heading|level=6|1=<span class="mw-translate-fuzzy"><h6>Úroveň 6</h6></span>}} |- | Horizontální čára | {{#tag:syntaxhighlight| Předcházející text ---- Následující text |lang=wikitext}} | Předcházející text ---- Následující text |- | Seznam s odrážkami | {{anchor|bulleted-lists}} {{#tag:syntaxhighlight| * Začněte každý řádek * [[Wikipedia:hvězdička|hvězdičkou]] (*). ** Více hvězdiček znamená hlubší *** a hlubší úrovně. * Konce řádků <br>nepřerušují úrovně. *** Ale skákání úrovní vytváří prázdný prostor. Jakýkoli jiný začátek seznam končí. * seznam s odrážkami můžete kombinovat ** s odsazením ::- odsazení ** vytvoří místo odrážky odpovídají mezeru * kombinace seznamu odrážek ** s definicí *:- definice ** bez mezer * seznam odrážek :- definice :* sublist, který nevytváří prázdné :* mezery za definicí |lang=wikitext}} | * Začněte každý řádek * [[Wikipedia:hvězdička|hvězdičkou]] (*). ** Více hvězdiček znamená hlubší *** a hlubší úrovně. * Konce řádků <br>nepřerušují úrovně. *** Ale skákání úrovní vytváří prázdný prostor. Jakýkoli jiný začátek seznam končí. * seznam s odrážkami můžete kombinovat ** s odsazením ::- odsazení ** vytvoří místo odrážky odpovídají mezeru * kombinace seznamu odrážek ** s definicí *:- definice ** bez mezer * seznam odrážek :- definice :* sublist, který nevytváří prázdné :* mezery za definicí |- | Číslovaný seznam | {{anchor|numbered-list}} {{#tag:syntaxhighlight| # Začněte každý řádek # se znakem [[Wikipedia:Number_sign|číslo]] (#). ## Více číselných znaků dává hlubší ### a hlouběji ### úrovně. # Konce řádků <br>nepřerušují úrovně. ### Ale skákání úrovní vytváří prázdný prostor. # Prázdné řádky # po ukončení seznamu může začít nový seznam. Každý start nového seznamu ukončí původní seznam. {{^(}}nowiki{{)^}}#{{^(}}/nowiki{{)^}} použijete-li značky "nowiki", zobrazí se na začátku řádku přímo znak mřížky (#), aniž by jej systém chápal jako číslovaný seznam. |lang=wikitext}} | # Začněte každý řádek # se znakem [[Wikipedia:Number_sign|číslo]] (#). ## Více číselných znaků dává hlubší ### a hlouběji ### úrovně. # Konce řádků <br>nepřerušují úrovně. ### Ale skákání úrovní vytváří prázdný prostor. # Prázdné řádky # po ukončení seznamu může začít nový seznam. Každý start nového seznamu ukončí původní seznam. <nowiki>#</nowiki> použijete-li značky "nowiki", zobrazí se na začátku řádku přímo znak mřížky (#), aniž by jej systém chápal jako číslovaný seznam. {{Table-AnchorRow|colspan=3|Definition list}} |- | Seznam definic | {{#tag:syntaxhighlight| ;položka 1 : definice 1 ;položka 2 : definice 2-1 : definice 2-2 |lang=wikitext}} {{note|1=Žádné vložené dvojtečky (:) se nebudou zobrazovat, pokud řádek začíná středníkem (;). Pokud chcete, aby se dvojtečka zobrazila, napište <code>&amp;#58;</code>.}} | ;položka 1 : definice 1 ;položka 2 : definice 2-1 : definice 2-2 |- | Podrobnosti popisu bez popisných výrazů | {{#tag:syntaxhighlight| : Podrobnosti popisu :: Vnořené podrobnosti popisu ::::: Hluboce vnořené detaily popisu |lang=wikitext}} ---- {{Note|1=Toto se často používá jako alternativní řešení pro odsazení řádku, ale poškodí to přístupnost a způsobí neplatný HTML výstup. Použití CSS pro vizuální odsazení je mnohem vhodnější přístup (např. {{tl|indent}}).}} | : Podrobnosti popisu :: Vnořené podrobnosti popisu ::::: Hluboce vnořené detaily popisu |- | Různé typy seznamů | {{#tag:syntaxhighlight| # První # Druhá #* druhá odrážka jedna #* druhá odrážka dva # Třetí #; třetí následující řádek tučně #: třetí definice odrážky jedna # Čtvrtá #: čtvrtá definice odrážky jedna #: vypadá to jako pokračování odstavce #: a často se používá #: místo <br> z <nowiki><br></nowiki> # Pátá ## pátá odstavec 1 ### pátá odstavec 1 pododstavec 1 ## pátá odstavec 2 |lang=wikitext}} ---- {{note|1=Použití <code>#:</code> a <code>*:</code> pro přerušení řádku je stejně problematické jako použití jediné <code>:</code>.}} | # První # Druhá #* druhá odrážka jedna #* druhá odrážka dva # Třetí #; třetí následující řádek tučně #: třetí definice odrážky jedna # Čtvrtá #: čtvrtá definice odrážky jedna #: vypadá to jako pokračování odstavce #: a často se používá #: místo <br> z <nowiki><br></nowiki> # Pátá ## pátá odstavec 1 ### pátá odstavec 1 pododstavec 1 ## pátá odstavec 2 |- | {{anchor|Preformatted text}}Formátování textu | {{#tag:syntaxhighlight| Začněte každý řádek mezerou. Text je '''formátovaný''' a '''''lze''''' vkládat ''značky''. |lang=wikitext}} ---- {{note|1=Tento způsob předformátování platí pouze pro [[#Section formatting|formátování sekcí]]. Značky [[#Character formatting|formátování znaků]] jsou stále platné.}} | Začněte každý řádek mezerou. Text je '''formátovaný''' a '''''lze''''' vkládat ''značky''. |- | Formátování textových bloků | {{#tag:syntaxhighlight| {{^(}}nowiki{{)^}}Začněte mezerou v prvním sloupci, (před {{^(}}nowiki{{)^}}). Pak bude váš formát bloku      udržován. To je dobré pro kopírování bloků při programování: def function(): """dokumentační řetězec""" if True: print True else: print False{{^(}}/nowiki{{)^}} |lang=wikitext}} | {{#tag:nowiki|Začněte mezerou v prvním sloupci, (před &lt;nowiki&gt;). Pak bude váš formát bloku      udržován. To je dobré pro kopírování bloků při programování: def function(): """dokumentační řetězec""" if True: print True else: print False }} |} {{anchor|&lt;p&gt;|.3Cp.3E}} <span id="Paragraphs"></span> == Odstavce == {{anchor|&lt;br&gt;|.3Cbr.3E}} MediaWiki ignoruje jednotlivé konce řádků. Pokud chcete začít nový odstavec, nechte prázdný řádek. Pomocí značky HTML {{tag|br|single}} můžete vynutit zalomení řádku v odstavci. <span id="HTML_tags"></span> == HTML značky (tags) == {{anchor|&lt;div&gt;|.3Cdiv.3E|&lt;span&gt;|.3Cspan.3E}} Na MediaWiki jsou povoleny některé značky [[wikipedia:HTML|HTML]], například {{tag|code|open}}, [[w:Div and span|{{tag|div|open}} a {{tag|span|open}}]]. Platí kdekoli, kam je vložíte. {| class="wikitable" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se {{Table-AnchorRow|colspan=3|&lt;ins&gt;|.3Cins.3E|&lt;u&gt;|.3Cu.3E}} |- | Vloženo <br>(Ve většině prohlížečů se zobrazí jako podtržené) | {{#tag:syntaxhighlight| <ins>Vloženo</ins> nebo <u>Zdůraznit</u> |lang=wikitext}} | <ins>Vloženo</ins> nebo <u>Zdůraznit</u> {{Table-AnchorRow|colspan=3|&lt;del&gt;|.3Cdel.3E|&lt;s&gt;|.3Cs.3E}} |- | Smazáno <br>(Ve většině prohlížečů se zobrazí jako přeškrtnuté) | {{#tag:syntaxhighlight| <s>Prorazit</s> nebo <del>Vymazáno</del> |lang=wikitext}} | <s>Prorazit</s> nebo <del>Vymazáno</del> {{Table-AnchorRow|colspan=3|&lt;code&gt;|.3Ccode.3E}} |- | Text s pevnou šířkou | <syntaxhighlight lang=html><code>Zdrojový kód</code></syntaxhighlight> | <code>Zdrojový kód</code> {{Table-AnchorRow|colspan=3|&lt;blockquote&gt;|.3Cblockquote.3E}} |- | Bloková citace | {{#tag:syntaxhighlight| Předcházející text <blockquote>Bloková citace</blockquote> Následující text |lang=wikitext}} {{Note|1=Pokud citace obsahuje více odstavců, musí být značky, aby se správně zobrazily, na samostatných řádcích, tj.: {{#tag:syntaxhighlight| <blockquote> První odstavec. Druhý odstavec. </blockquote> |lang=wikitext}} {{Tracked|T309778|float=none}} }} | Předcházející text <blockquote>Bloková citace</blockquote> Následující text {{Table-AnchorRow|colspan=3|&lt;q&gt;|.3Cq.3E}} |- | Citáty | {{#tag:syntaxhighlight| <q>Toto je citát</q> |lang=wikitext}} {{Note|1=Prvek q nesmí být použit místo uvozovek, které nepředstavují uvozovky. Například není vhodné používat prvek q k označení sarkastických výrazů. <ref>[https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-q-element HTML Living Standard - prvek &lt;'''q'''&gt;]</ref>}} | <q>Toto je citát</q> |- | Komentář | {{#tag:syntaxhighlight| <!-- Toto je komentář --> Komentáře jsou viditelné pouze v editační zóně. |lang=wikitext}} | <!-- Toto je komentář --> Komentáře jsou viditelné pouze v editační zóně. {{Table-AnchorRow|colspan=3|&lt;pre&gt;|.3Cpre.3E}} |- | Zcela předformátovaný text | {{#tag:syntaxhighlight| {{^(}}pre{{)^}} Text je '''předformátován''' a '''''nelze''''' jej označit ''značkami''. {{^(}}/pre{{)^}} |lang=wikitext}} ---- {{note|1=Chcete-li označit předformátovaný text, zaškrtněte položku "Předformátovaný text" (Preformatted text) na konci předchozí tabulky.}} | {{#tag:pre| Text je '''předformátován''' a '''''nelze''''' jej označit ''značkami''. }} |- | Úpravy předformátovaného textu | {{#tag:syntaxhighlight| {{^(}}pre style="color: red"{{)^}} Text je '''předformátován''' spolu se stylem a '''''nelze''''' jej označit ''značkami'' {{^(}}/pre{{)^}} |lang=wikitext}} ---- {{note|1=Styl CSS lze pojmenovat v atributu <code>style</code>.}} | {{#tag:pre| Text je '''předformátován''' spolu se stylem a '''''nelze''''' jej označit ''značkami'' |style=color: red}} |} pokračování: {| class="wikitable" | style="table-layout: fixed; width: 100%" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se |- | '''Výchozí''' předformátovaný text pro zalomení textu podle dostupné šířky má atribut CSS (<code>white-space: pre-wrap;</code>). | {{#tag:syntaxhighlight| {{^(}}pre{{)^}} Tato dlouhá věta se používá k demonstraci zalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. {{^(}}/pre{{)^}} |lang=wikitext}} | {{#tag:pre| Tato dlouhá věta se používá k demonstraci zalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. |}} |- | '''Přizpůsobený''' předem naformátovaný text se '''zakázaným''' zalomením textu | {{#tag:syntaxhighlight| {{^(}}pre style="white-space: pre;"{{)^}} Tato dlouhá věta se používá k demonstraci nezalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. {{^(}}/pre{{)^}} |lang=wikitext}} | {{#tag:pre| Tato dlouhá věta se používá k demonstraci nezalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. |style=white-space: pre;}} |} Úplný seznam rozpoznaných značek je uveden na stránce {{ll|Help:HTML in wikitext}}. <span id="Inserting_symbols"></span> == Vkládání symbolů == Symboly a další speciální znaky, které nejsou dostupné na vaší klávesnici, lze vkládat mnoha způsoby. [http://www.howtogeek.com/210824/how-to-quickly-type-special-characters-on-any-computer-smartphone-or-tablet/ Mnoho operačních systémů a prohlížečů umožňuje vkládat speciální znaky] prostřednictvím možnosti nabídky nebo panelu operačního systému. Navíc můžete použít WikiEditor nebo [[Special:MyLanguage/VisualEditor/Special characters|VisualEditor]] k jejich vložení na obrazovku úprav. Jako poslední možnost můžete použít speciální sekvenci znaků. Tyto sekvence se nazývají [https://developer.mozilla.org/docs/Glossary/Character_reference odkazy na znaky HTML]. Například: * [[w:Arrow (symbol)|Symbol šipky]] doprava (<code>&rarr;</code>) lze zobrazit pomocí sekvence <code>&amp;rarr;</code> * [[w:Dash#Em pomlčka|Em pomlčku]] (<code>&mdash;</code>) lze zobrazit pomocí <code>&amp;mdash;</code>. ---- {{note|1=Umístěním kurzoru nad libovolný symbol zjistíte znaky, které jej vytváří. Některé symboly, které nejsou k dispozici v aktuálním písmu, se zobrazí jako prázdné čtverečky.}} {| class="wikitable" style="width:100%; text-align:center; font-weight:bold;" |+ Symbolové entity HTML |- | <span title="&amp;Aacute;">&Aacute;</span> | <span title="&amp;aacute;">&aacute;</span> | <span title="&amp;Acirc;">&Acirc;</span> | <span title="&amp;acirc;">&acirc;</span> | <span title="&amp;acute;">&acute;</span> | <span title="&amp;AElig;">&AElig;</span> | <span title="&amp;aelig;">&aelig;</span> | <span title="&amp;Agrave;">&Agrave;</span> | <span title="&amp;agrave;">&agrave;</span> | <span title="&amp;alefsym;">&alefsym;</span> | <span title="&amp;Alpha;">&Alpha;</span> | <span title="&amp;alpha;">&alpha;</span> | <span title="&amp;amp;">&amp;</span> | <span title="&amp;and;">&and;</span> | <span title="&amp;ang;">&ang;</span> | <span title="&amp;Aring;">&Aring;</span> | <span title="&amp;aring;">&aring;</span> | <span title="&amp;asymp;">&asymp;</span> | <span title="&amp;Atilde;">&Atilde;</span> | <span title="&amp;atilde;">&atilde;</span> | <span title="&amp;Auml;">&Auml;</span> | <span title="&amp;auml;">&auml;</span> | <span title="&amp;bdquo;">&bdquo;</span> | <span title="&amp;Beta;">&Beta;</span> | <span title="&amp;beta;">&beta;</span> | <span title="&amp;brvbar;">&brvbar;</span> | <span title="&amp;bull;">&bull;</span> | <span title="&amp;cap;">&cap;</span> | <span title="&amp;Ccedil;">&Ccedil;</span> | <span title="&amp;ccedil;">&ccedil;</span> | <span title="&amp;cedil;">&cedil;</span> | <span title="&amp;cent;">&cent;</span> |- | <span title="&amp;Chi;">&Chi;</span> | <span title="&amp;chi;">&chi;</span> | <span title="&amp;circ;">&circ;</span> | <span title="&amp;clubs;">&clubs;</span> | <span title="&amp;cong;">&cong;</span> | <span title="&amp;copy;">&copy;</span> | <span title="&amp;crarr;">&crarr;</span> | <span title="&amp;cup;">&cup;</span> | <span title="&amp;curren;">&curren;</span> | <span title="&amp;dagger;">&dagger;</span> | <span title="&amp;Dagger;">&Dagger;</span> | <span title="&amp;darr;">&darr;</span> | <span title="&amp;dArr;">&dArr;</span> | <span title="&amp;deg;">&deg;</span> | <span title="&amp;Delta;">&Delta;</span> | <span title="&amp;delta;">&delta;</span> | <span title="&amp;diams;">&diams;</span> | <span title="&amp;divide;">&divide;</span> | <span title="&amp;Eacute;">&Eacute;</span> | <span title="&amp;eacute;">&eacute;</span> | <span title="&amp;Ecirc;">&Ecirc;</span> | <span title="&amp;ecirc;">&ecirc;</span> | <span title="&amp;Egrave;">&Egrave;</span> | <span title="&amp;egrave;">&egrave;</span> | <span title="&amp;empty;">&empty;</span> | <span title="&amp;emsp;">&emsp;</span> | <span title="&amp;ensp;">&ensp;</span> | <span title="&amp;Epsilon;">&Epsilon;</span> | <span title="&amp;epsilon;">&epsilon;</span> | <span title="&amp;equiv;">&equiv;</span> | <span title="&amp;Eta;">&Eta;</span> | <span title="&amp;eta;">&eta;</span> |- | <span title="&amp;ETH;">&ETH;</span> | <span title="&amp;eth;">&eth;</span> | <span title="&amp;Euml;">&Euml;</span> | <span title="&amp;euml;">&euml;</span> | <span title="&amp;euro;">&euro;</span> | <span title="&amp;exist;">&exist;</span> | <span title="&amp;fnof;">&fnof;</span> | <span title="&amp;forall;">&forall;</span> | <span title="&amp;frac12;">&frac12;</span> | <span title="&amp;frac14;">&frac14;</span> | <span title="&amp;frac34;">&frac34;</span> | <span title="&amp;frasl;">&frasl;</span> | <span title="&amp;Gamma;">&Gamma;</span> | <span title="&amp;gamma;">&gamma;</span> | <span title="&amp;ge;">&ge;</span> | <span title="&amp;gt;">&gt;</span> | <span title="&amp;harr;">&harr;</span> | <span title="&amp;hArr;">&hArr;</span> | <span title="&amp;hearts;">&hearts;</span> | <span title="&amp;hellip;">&hellip;</span> | <span title="&amp;Iacute;">&Iacute;</span> | <span title="&amp;iacute;">&iacute;</span> | <span title="&amp;Icirc;">&Icirc;</span> | <span title="&amp;icirc;">&icirc;</span> | <span title="&amp;iexcl;">&iexcl;</span> | <span title="&amp;Igrave;">&Igrave;</span> | <span title="&amp;igrave;">&igrave;</span> | <span title="&amp;image;">&image;</span> | <span title="&amp;infin;">&infin;</span> | <span title="&amp;int;">&int;</span> | <span title="&amp;Iota;">&Iota;</span> | <span title="&amp;iota;">&iota;</span> |- | <span title="&amp;iquest;">&iquest;</span> | <span title="&amp;isin;">&isin;</span> | <span title="&amp;Iuml;">&Iuml;</span> | <span title="&amp;iuml;">&iuml;</span> | <span title="&amp;Kappa;">&Kappa;</span> | <span title="&amp;kappa;">&kappa;</span> | <span title="&amp;Lambda;">&Lambda;</span> | <span title="&amp;lambda;">&lambda;</span> | <span title="&amp;lang;">&lang;</span> | <span title="&amp;laquo;">&laquo;</span> | <span title="&amp;larr;">&larr;</span> | <span title="&amp;lArr;">&lArr;</span> | <span title="&amp;lceil;">&lceil;</span> | <span title="&amp;ldquo;">&ldquo;</span> | <span title="&amp;le;">&le;</span> | <span title="&amp;lfloor;">&lfloor;</span> | <span title="&amp;lowast;">&lowast;</span> | <span title="&amp;loz;">&loz;</span> | <span title="&amp;lrm;">&lrm;</span> | <span title="&amp;lsaquo;">&lsaquo;</span> | <span title="&amp;lsquo;">&lsquo;</span> | <span title="&amp;lt;">&lt;</span> | <span title="&amp;macr;">&macr;</span> | <span title="&amp;mdash;">&mdash;</span> | <span title="&amp;micro;">&micro;</span> | <span title="&amp;middot;">&middot;</span> | <span title="&amp;minus;">&minus;</span> | <span title="&amp;Mu;">&Mu;</span> | <span title="&amp;mu;">&mu;</span> | <span title="&amp;nabla;">&nabla;</span> | <span title="&amp;nbsp;">&nbsp;</span> | <span title="&amp;ndash;">&ndash;</span> |- | <span title="&amp;ne;">&ne;</span> | <span title="&amp;ni;">&ni;</span> | <span title="&amp;not;">&not;</span> | <span title="&amp;notin;">&notin;</span> | <span title="&amp;nsub;">&nsub;</span> | <span title="&amp;Ntilde;">&Ntilde;</span> | <span title="&amp;ntilde;">&ntilde;</span> | <span title="&amp;Nu;">&Nu;</span> | <span title="&amp;nu;">&nu;</span> | <span title="&amp;Oacute;">&Oacute;</span> | <span title="&amp;oacute;">&oacute;</span> | <span title="&amp;Ocirc;">&Ocirc;</span> | <span title="&amp;ocirc;">&ocirc;</span> | <span title="&amp;OElig;">&OElig;</span> | <span title="&amp;oelig;">&oelig;</span> | <span title="&amp;Ograve;">&Ograve;</span> | <span title="&amp;ograve;">&ograve;</span> | <span title="&amp;oline;">&oline;</span> | <span title="&amp;Omega;">&Omega;</span> | <span title="&amp;omega;">&omega;</span> | <span title="&amp;Omicron;">&Omicron;</span> | <span title="&amp;omicron;">&omicron;</span> | <span title="&amp;oplus;">&oplus;</span> | <span title="&amp;or;">&or;</span> | <span title="&amp;ordf;">&ordf;</span> | <span title="&amp;ordm;">&ordm;</span> | <span title="&amp;Oslash;">&Oslash;</span> | <span title="&amp;oslash;">&oslash;</span> | <span title="&amp;Otilde;">&Otilde;</span> | <span title="&amp;otilde;">&otilde;</span> | <span title="&amp;otimes;">&otimes;</span> | <span title="&amp;Ouml;">&Ouml;</span> |- | <span title="&amp;ouml;">&ouml;</span> | <span title="&amp;para;">&para;</span> | <span title="&amp;part;">&part;</span> | <span title="&amp;permil;">&permil;</span> | <span title="&amp;perp;">&perp;</span> | <span title="&amp;Phi;">&Phi;</span> | <span title="&amp;phi;">&phi;</span> | <span title="&amp;Pi;">&Pi;</span> | <span title="&amp;pi;">&pi;</span> | <span title="&amp;piv;">&piv;</span> | <span title="&amp;plusmn;">&plusmn;</span> | <span title="&amp;pound;">&pound;</span> | <span title="&amp;prime;">&prime;</span> | <span title="&amp;Prime;">&Prime;</span> | <span title="&amp;prod;">&prod;</span> | <span title="&amp;prop;">&prop;</span> | <span title="&amp;Psi;">&Psi;</span> | <span title="&amp;psi;">&psi;</span> | <span title="&amp;quot;">&quot;</span> | <span title="&amp;radic;">&radic;</span> | <span title="&amp;rang;">&rang;</span> | <span title="&amp;raquo;">&raquo;</span> | <span title="&amp;rarr;">&rarr;</span> | <span title="&amp;rArr;">&rArr;</span> | <span title="&amp;rceil;">&rceil;</span> | <span title="&amp;rdquo;">&rdquo;</span> | <span title="&amp;real;">&real;</span> | <span title="&amp;reg;">&reg;</span> | <span title="&amp;rfloor;">&rfloor;</span> | <span title="&amp;Rho;">&Rho;</span> | <span title="&amp;rho;">&rho;</span> | <span title="&amp;rlm;">&rlm;</span> |- | <span title="&amp;rsaquo;">&rsaquo;</span> | <span title="&amp;rsquo;">&rsquo;</span> | <span title="&amp;sbquo;">&sbquo;</span> | <span title="&amp;Scaron;">&Scaron;</span> | <span title="&amp;scaron;">&scaron;</span> | <span title="&amp;sdot;">&sdot;</span> | <span title="&amp;sect;">&sect;</span> | <span title="&amp;shy;">&shy;</span> | <span title="&amp;Sigma;">&Sigma;</span> | <span title="&amp;sigma;">&sigma;</span> | <span title="&amp;sigmaf;">&sigmaf;</span> | <span title="&amp;sim;">&sim;</span> | <span title="&amp;spades;">&spades;</span> | <span title="&amp;sub;">&sub;</span> | <span title="&amp;sube;">&sube;</span> | <span title="&amp;sum;">&sum;</span> | <span title="&amp;sup;">&sup;</span> | <span title="&amp;sup1;">&sup1;</span> | <span title="&amp;sup2;">&sup2;</span> | <span title="&amp;sup3;">&sup3;</span> | <span title="&amp;supe;">&supe;</span> | <span title="&amp;szlig;">&szlig;</span> | <span title="&amp;Tau;">&Tau;</span> | <span title="&amp;tau;">&tau;</span> | <span title="&amp;there4;">&there4;</span> | <span title="&amp;Theta;">&Theta;</span> | <span title="&amp;theta;">&theta;</span> | <span title="&amp;thetasym;">&thetasym;</span> | <span title="&amp;thinsp;">&thinsp;</span> | <span title="&amp;THORN;">&THORN;</span> | <span title="&amp;thorn;">&thorn;</span> | <span title="&amp;tilde;">&tilde;</span> |- | <span title="&amp;times;">&times;</span> | <span title="&amp;trade;">&trade;</span> | <span title="&amp;Uacute;">&Uacute;</span> | <span title="&amp;uacute;">&uacute;</span> | <span title="&amp;uarr;">&uarr;</span> | <span title="&amp;uArr;">&uArr;</span> | <span title="&amp;Ucirc;">&Ucirc;</span> | <span title="&amp;ucirc;">&ucirc;</span> | <span title="&amp;Ugrave;">&Ugrave;</span> | <span title="&amp;ugrave;">&ugrave;</span> | <span title="&amp;uml;">&uml;</span> | <span title="&amp;upsih;">&upsih;</span> | <span title="&amp;Upsilon;">&Upsilon;</span> | <span title="&amp;upsilon;">&upsilon;</span> | <span title="&amp;Uuml;">&Uuml;</span> | <span title="&amp;uuml;">&uuml;</span> | <span title="&amp;weierp;">&weierp;</span> | <span title="&amp;Xi;">&Xi;</span> | <span title="&amp;xi;">&xi;</span> | <span title="&amp;Yacute;">&Yacute;</span> | <span title="&amp;yacute;">&yacute;</span> | <span title="&amp;yen;">&yen;</span> | <span title="&amp;yuml;">&yuml;</span> | <span title="&amp;Yuml;">&Yuml;</span> | <span title="&amp;Zeta;">&Zeta;</span> | <span title="&amp;zeta;">&zeta;</span> | <span title="&amp;zwj;">&zwj;</span> | <span title="&amp;zwnj;">&zwnj;</span> |} {| class="wikitable" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se |- | Symbol autorských práv |class=mw-code| &amp;copy; | :::'''&copy;''' |- | Symbol řeckého písmene delta |class=mw-code|&amp;delta; | :::'''&delta;''' |- | Symbol měny euro |class=mw-code|&amp;euro; | :::'''&euro;''' |} Podívejte se na seznam všech HTML entit v článku Wikipedie [[wikipedia:List of HTML entities|Seznam entit HTML]]. Kromě toho MediaWiki podporuje dvě nestandardní referenční entity: <code>&amp;רלמ;</code> a <code>&amp;رلم;</code>, které jsou považovány za ekvivalentní s <code>&amp;rlm;</code>, což je [[wikipedia:Right-to-left mark|značka zprava doleva]]. (Používá se při kombinaci jazyků zprava doleva s jazyky zleva doprava na stejné stránce.) <span id="HTML_tags_and_symbol_entities_displayed_themselves_(with_and_without_interpreting_them)"></span> == HTML tagy a entity symbolů se zobrazují samy (s a bez interpretace) == : <syntaxhighlight lang=html inline>&amp;euro;</syntaxhighlight> &nbsp;&rarr; '''&amp;euro;''' : {{#tag:syntaxhighlight|<span style="color: red; text-decoration: line-through;">Oprava překlepu</span>|lang=wikitext|inline=}} <!-- -->&nbsp;&rarr; '''<span style="color: red; text-decoration: line-through;">Oprava překlepu</span>''' : {{#tag:syntaxhighlight|&lt;span style="color: red; text-decoration: line-through;">Oprava překlepu</span>|lang=wikitext|inline=}} <!-- -->&nbsp;&rarr; '''&lt;span style="color: red; text-decoration: line-through;">Oprava překlepu&lt;/span>''' <span id="Nowiki_for_HTML"></span> === Nowiki pro HTML === {{tag|nowiki|s}} může zakázat (HTML) značky: * <nowiki><<</nowiki>nowiki/>pre> &nbsp;&rarr; <<nowiki/>pre> Symbol ''ne'' &amp; ale uniká: * &<<nowiki/>nowiki/>amp; &nbsp;&rarr; &<nowiki/>amp; Chcete-li obejít symbol &amp; jako text, použijte znak "<syntaxhighlight inline lang="html">&amp;</syntaxhighlight>". Po nahrazení znaku "&" (např. typ "<syntaxhighlight inline lang="html">&amp;nbsp;</syntaxhighlight>"), jehož výsledkem bude "<syntaxhighlight inline lang="html">&nbsp;</syntaxhighlight>". <span id="Other_formatting"></span> == Ostatní formáty == Kromě výše uvedeného značení formátování textu jsou zde i další odkazy na formátování: * {{ll|Help:Links}} * {{ll|Help:Lists}} * {{ll|Help:Images}} * Značení LanguageConverter - viz {{ll|Writing systems/Syntax}} * Reference - viz {{ll|Extension:Cite}} * [[Special:MyLanguage/Help:Tables|Tabulky]] * {{ll|Manual:Collapsible_elements}} Další reference najdete na {{ll|Help:Contents}}. <span id="References"></span> == Poznámky pod čarou == <references/> [[Category:Help{{#translation:}}|Formatting]] enury52lhmcq66gojjwy1x40iydfuxv 8364657 8364655 2026-05-03T17:19:58Z Rebulka 17532855 8364657 wikitext text/x-wiki <languages/> {{PD Help Page}} {{See also|Help:Advanced editing}}<!-- To editors: Please NOTE that {{#tag: are required to make language conversion/language converter work, especially for /zh translation pages. -->Zobrazení vašeho textu můžete ovlivnit pomocí wiki značek. Ty se tvoří pomocí standardních znaků jako je např. hvězdička, apostrof nebo znak rovnítka, které mají ve wiki speciální význam, v závislosti na tom kde a v jakém počtu jsou použity. Například chcete-li v textu zvýraznit slovo ''kurzívou'' (italic), stačí, když ho uzavřete mezi dva páry apostrofů, jako například <code><nowiki>''zde''</nowiki></code>. <span id="Text_formatting_markup"></span> == Značky pro formátování textu == {| class="wikitable" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se |- ! colspan="3" style="color: var(--color-base, #202122); background: var(--background-color-progressive-subtle--active, #b6d4fb)" | {{anchor|Character formatting}}Značkování v textu (inline) – ''lze používat všude'' |- | Text v kurzívě | {{#tag:syntaxhighlight| ''kurzíva'' |lang=wikitext}} | ''kurzíva'' |- | Tučný text | {{#tag:syntaxhighlight| '''tučně''' |lang=wikitext}} | '''tučně''' |- | Tučný text v kurzívě | {{#tag:syntaxhighlight| '''''tučná kurzíva''''' |lang=wikitext}} | '''''tučná kurzíva''''' {{Table-AnchorRow|colspan=3|nowiki|&lt;nowiki&gt;|.3Cnowiki.3E}} |- | Zobrazení bez interpretace wiki značek | {{#tag:syntaxhighlight| <!-- This can't use <syntaxhighlight><nowiki>, as that breaks the <translate> tag --> {{^(}}nowiki{{)^}}ignoruji [[wiki]] ''značky''{{^(}}/nowiki{{)^}} |lang=wikitext}} | <nowiki>ignoruji [[wiki]] ''značky''</nowiki> |- ! colspan="3" style="color: var(--color-base, #202122); background: var(--background-color-progressive-subtle--active, #b6d4fb)" | {{anchor|Section formatting}}Sekce (oddíly) – ''jejich zápis začíná vždy na počátku řádky'' |- | Úrovně sekcí (oddílů) a interpretace jejich nadpisů (záhlaví) | {{anchor|headings}}{{#tag:syntaxhighlight| == Úroveň 2 == === Úroveň 3 === ==== Úroveň 4 ==== ===== Úroveň 5 ===== ====== Úroveň 6 ====== |lang=wikitext}} ---- {{note|1=<nowiki/> * [[Help talk:Formatting#Level_1|Úroveň 1]], jedná se o úroveň názvu stránky. * Nezadávejte na řádek žádný text za koncová znaménka 'rovná se'. * Článek se čtyřmi a více nadpisy vytvoří automaticky [[wikipedia:Help:Section#Table of contents (TOC)|tabulku s obsahem]] umístěnou v úvodu stránky. Pokud nenastavíte kouzelné slovo <code><nowiki>__NOTOC__</nowiki></code>. }} | {{Fake heading|level=2|1=Úroveň 2}} {{Fake heading|level=3|1=Úroveň 3}} {{Fake heading|level=4|1=Úroveň 4}} {{Fake heading|level=5|1=Úroveň 5}} {{Fake heading|level=6|1=<span class="mw-translate-fuzzy"><h6>Úroveň 6</h6></span>}} |- | Horizontální čára | {{#tag:syntaxhighlight| Předcházející text ---- Následující text |lang=wikitext}} | Předcházející text ---- Následující text |- | Seznam s odrážkami | {{anchor|bulleted-lists}} {{#tag:syntaxhighlight| * Začněte každý řádek * [[Wikipedia:hvězdička|hvězdičkou]] (*). ** Více hvězdiček znamená hlubší *** a hlubší úrovně. * Konce řádků <br>nepřerušují úrovně. *** Ale skákání úrovní vytváří prázdný prostor. Jakýkoli jiný začátek seznam končí. * seznam s odrážkami můžete kombinovat ** s odsazením ::- odsazení ** vytvoří místo odrážky odpovídají mezeru * kombinace seznamu odrážek ** s definicí *:- definice ** bez mezer * seznam odrážek :- definice :* sublist, který nevytváří prázdné :* mezery za definicí |lang=wikitext}} | * Začněte každý řádek * [[Wikipedia:hvězdička|hvězdičkou]] (*). ** Více hvězdiček znamená hlubší *** a hlubší úrovně. * Konce řádků <br>nepřerušují úrovně. *** Ale skákání úrovní vytváří prázdný prostor. Jakýkoli jiný začátek seznam končí. * seznam s odrážkami můžete kombinovat ** s odsazením ::- odsazení ** vytvoří místo odrážky odpovídají mezeru * kombinace seznamu odrážek ** s definicí *:- definice ** bez mezer * seznam odrážek :- definice :* sublist, který nevytváří prázdné :* mezery za definicí |- | Číslovaný seznam | {{anchor|numbered-list}} {{#tag:syntaxhighlight| # Začněte každý řádek # se znakem [[Wikipedia:Number_sign|číslo]] (#). ## Více číselných znaků dává hlubší ### a hlouběji ### úrovně. # Konce řádků <br>nepřerušují úrovně. ### Ale skákání úrovní vytváří prázdný prostor. # Prázdné řádky # po ukončení seznamu může začít nový seznam. Každý start nového seznamu ukončí původní seznam. {{^(}}nowiki{{)^}}#{{^(}}/nowiki{{)^}} použijete-li značky "nowiki", zobrazí se na začátku řádku přímo znak mřížky (#), aniž by jej systém chápal jako číslovaný seznam. |lang=wikitext}} | # Začněte každý řádek # se znakem [[Wikipedia:Number_sign|číslo]] (#). ## Více číselných znaků dává hlubší ### a hlouběji ### úrovně. # Konce řádků <br>nepřerušují úrovně. ### Ale skákání úrovní vytváří prázdný prostor. # Prázdné řádky # po ukončení seznamu může začít nový seznam. Každý start nového seznamu ukončí původní seznam. <nowiki>#</nowiki> použijete-li značky "nowiki", zobrazí se na začátku řádku přímo znak mřížky (#), aniž by jej systém chápal jako číslovaný seznam. {{Table-AnchorRow|colspan=3|Definition list}} |- | Seznam definic | {{#tag:syntaxhighlight| ;položka 1 : definice 1 ;položka 2 : definice 2-1 : definice 2-2 |lang=wikitext}} {{note|1=Žádné vložené dvojtečky (:) se nebudou zobrazovat, pokud řádek začíná středníkem (;). Pokud chcete, aby se dvojtečka zobrazila, napište <code>&amp;#58;</code>.}} | ;položka 1 : definice 1 ;položka 2 : definice 2-1 : definice 2-2 |- | Podrobnosti popisu bez popisných výrazů | {{#tag:syntaxhighlight| : Podrobnosti popisu :: Vnořené podrobnosti popisu ::::: Hluboce vnořené detaily popisu |lang=wikitext}} ---- {{Note|1=Toto se často používá jako alternativní řešení pro odsazení řádku, ale poškodí to přístupnost a způsobí neplatný HTML výstup. Použití CSS pro vizuální odsazení je mnohem vhodnější přístup (např. {{tl|indent}}).}} | : Podrobnosti popisu :: Vnořené podrobnosti popisu ::::: Hluboce vnořené detaily popisu |- | Různé typy seznamů | {{#tag:syntaxhighlight| # První # Druhá #* druhá odrážka jedna #* druhá odrážka dva # Třetí #; třetí následující řádek tučně #: třetí definice odrážky jedna # Čtvrtá #: čtvrtá definice odrážky jedna #: vypadá to jako pokračování odstavce #: a často se používá #: místo <br> z <nowiki><br></nowiki> # Pátá ## pátá odstavec 1 ### pátá odstavec 1 pododstavec 1 ## pátá odstavec 2 |lang=wikitext}} ---- {{note|1=Použití <code>#:</code> a <code>*:</code> pro přerušení řádku je stejně problematické jako použití jediné <code>:</code>.}} | # První # Druhá #* druhá odrážka jedna #* druhá odrážka dva # Třetí #; třetí následující řádek tučně #: třetí definice odrážky jedna # Čtvrtá #: čtvrtá definice odrážky jedna #: vypadá to jako pokračování odstavce #: a často se používá #: místo <br> z <nowiki><br></nowiki> # Pátá ## pátá odstavec 1 ### pátá odstavec 1 pododstavec 1 ## pátá odstavec 2 |- | {{anchor|Preformatted text}}Formátování textu | {{#tag:syntaxhighlight| Začněte každý řádek mezerou. Text je '''formátovaný''' a '''''lze''''' vkládat ''značky''. |lang=wikitext}} ---- {{note|1=Tento způsob předformátování platí pouze pro [[#Section formatting|formátování sekcí]]. Značky [[#Character formatting|formátování znaků]] jsou stále platné.}} | Začněte každý řádek mezerou. Text je '''formátovaný''' a '''''lze''''' vkládat ''značky''. |- | Formátování textových bloků | {{#tag:syntaxhighlight| {{^(}}nowiki{{)^}}Začněte mezerou v prvním sloupci, (před {{^(}}nowiki{{)^}}). Pak bude váš formát bloku      udržován. To je dobré pro kopírování bloků při programování: def function(): """dokumentační řetězec""" if True: print True else: print False{{^(}}/nowiki{{)^}} |lang=wikitext}} | {{#tag:nowiki|Začněte mezerou v prvním sloupci, (před &lt;nowiki&gt;). Pak bude váš formát bloku      udržován. To je dobré pro kopírování bloků při programování: def function(): """dokumentační řetězec""" if True: print True else: print False }} |} {{anchor|&lt;p&gt;|.3Cp.3E}} <span id="Paragraphs"></span> == Odstavce == {{anchor|&lt;br&gt;|.3Cbr.3E}} MediaWiki ignoruje jednotlivé konce řádků. Pokud chcete začít nový odstavec, nechte prázdný řádek. Pomocí značky HTML {{tag|br|single}} můžete vynutit zalomení řádku v odstavci. <span id="HTML_tags"></span> == HTML značky (tags) == {{anchor|&lt;div&gt;|.3Cdiv.3E|&lt;span&gt;|.3Cspan.3E}} Na MediaWiki jsou povoleny některé značky [[wikipedia:HTML|HTML]], například {{tag|code|open}}, [[w:Div and span|{{tag|div|open}} a {{tag|span|open}}]]. Platí kdekoli, kam je vložíte. {| class="wikitable" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se {{Table-AnchorRow|colspan=3|&lt;ins&gt;|.3Cins.3E|&lt;u&gt;|.3Cu.3E}} |- | Vloženo <br>(Ve většině prohlížečů se zobrazí jako podtržené) | {{#tag:syntaxhighlight| <ins>Vloženo</ins> nebo <u>Zdůraznit</u> |lang=wikitext}} | <ins>Vloženo</ins> nebo <u>Zdůraznit</u> {{Table-AnchorRow|colspan=3|&lt;del&gt;|.3Cdel.3E|&lt;s&gt;|.3Cs.3E}} |- | Smazáno <br>(Ve většině prohlížečů se zobrazí jako přeškrtnuté) | {{#tag:syntaxhighlight| <s>Prorazit</s> nebo <del>Vymazáno</del> |lang=wikitext}} | <s>Prorazit</s> nebo <del>Vymazáno</del> {{Table-AnchorRow|colspan=3|&lt;code&gt;|.3Ccode.3E}} |- | Text s pevnou šířkou | <syntaxhighlight lang=html><code>Zdrojový kód</code></syntaxhighlight> | <code>Zdrojový kód</code> {{Table-AnchorRow|colspan=3|&lt;blockquote&gt;|.3Cblockquote.3E}} |- | Bloková citace | {{#tag:syntaxhighlight| Předcházející text <blockquote>Bloková citace</blockquote> Následující text |lang=wikitext}} {{Note|1=Pokud citace obsahuje více odstavců, musí být značky, aby se správně zobrazily, na samostatných řádcích, tj.: {{#tag:syntaxhighlight| <blockquote> První odstavec. Druhý odstavec. </blockquote> |lang=wikitext}} {{Tracked|T309778|float=none}} }} | Předcházející text <blockquote>Bloková citace</blockquote> Následující text {{Table-AnchorRow|colspan=3|&lt;q&gt;|.3Cq.3E}} |- | Citáty | {{#tag:syntaxhighlight| <q>Toto je citát</q> |lang=wikitext}} {{Note|1=Prvek q nesmí být použit místo uvozovek, které nepředstavují uvozovky. Například není vhodné používat prvek q k označení sarkastických výrazů. <ref>[https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-q-element HTML Living Standard - prvek &lt;'''q'''&gt;]</ref>}} | <q>Toto je citát</q> |- | Komentář | {{#tag:syntaxhighlight| <!-- Toto je komentář --> Komentáře jsou viditelné pouze v editační zóně. |lang=wikitext}} | <!-- Toto je komentář --> Komentáře jsou viditelné pouze v editační zóně. {{Table-AnchorRow|colspan=3|&lt;pre&gt;|.3Cpre.3E}} |- | Zcela předformátovaný text | {{#tag:syntaxhighlight| {{^(}}pre{{)^}} Text je '''předformátován''' a '''''nelze''''' jej označit ''značkami''. {{^(}}/pre{{)^}} |lang=wikitext}} ---- {{note|1=Chcete-li označit předformátovaný text, zaškrtněte položku "Předformátovaný text" (Preformatted text) na konci předchozí tabulky.}} | {{#tag:pre| Text je '''předformátován''' a '''''nelze''''' jej označit ''značkami''. }} |- | Úpravy předformátovaného textu | {{#tag:syntaxhighlight| {{^(}}pre style="color: red"{{)^}} Text je '''předformátován''' spolu se stylem a '''''nelze''''' jej označit ''značkami'' {{^(}}/pre{{)^}} |lang=wikitext}} ---- {{note|1=Styl CSS lze pojmenovat v atributu <code>style</code>.}} | {{#tag:pre| Text je '''předformátován''' spolu se stylem a '''''nelze''''' jej označit ''značkami'' |style=color: red}} |} pokračování: {| class="wikitable" | style="table-layout: fixed; width: 100%" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se |- | '''Výchozí''' předformátovaný text pro zalomení textu podle dostupné šířky má atribut CSS (<code>white-space: pre-wrap;</code>). | {{#tag:syntaxhighlight| {{^(}}pre{{)^}} Tato dlouhá věta se používá k demonstraci zalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. {{^(}}/pre{{)^}} |lang=wikitext}} | {{#tag:pre| Tato dlouhá věta se používá k demonstraci zalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. |}} |- | '''Přizpůsobený''' předem naformátovaný text se '''zakázaným''' zalomením textu | {{#tag:syntaxhighlight| {{^(}}pre style="white-space: pre;"{{)^}} Tato dlouhá věta se používá k demonstraci nezalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. {{^(}}/pre{{)^}} |lang=wikitext}} | {{#tag:pre| Tato dlouhá věta se používá k demonstraci nezalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. |style=white-space: pre;}} |} Úplný seznam rozpoznaných značek je uveden na stránce {{ll|Help:HTML in wikitext}}. <span id="Inserting_symbols"></span> == Vkládání symbolů == Symboly a další speciální znaky, které nejsou dostupné na vaší klávesnici, lze vkládat mnoha způsoby. [http://www.howtogeek.com/210824/how-to-quickly-type-special-characters-on-any-computer-smartphone-or-tablet/ Mnoho operačních systémů a prohlížečů umožňuje vkládat speciální znaky] prostřednictvím možnosti nabídky nebo panelu operačního systému. Navíc můžete použít WikiEditor nebo [[Special:MyLanguage/VisualEditor/Special characters|VisualEditor]] k jejich vložení na obrazovku úprav. Jako poslední možnost můžete použít speciální sekvenci znaků. Tyto sekvence se nazývají [https://developer.mozilla.org/docs/Glossary/Character_reference odkazy na znaky HTML]. Například: * [[w:Arrow (symbol)|Symbol šipky]] doprava (<code>&rarr;</code>) lze zobrazit pomocí sekvence <code>&amp;rarr;</code> * [[w:Dash#Em pomlčka|Em pomlčku]] (<code>&mdash;</code>) lze zobrazit pomocí <code>&amp;mdash;</code>. ---- {{note|1=Umístěním kurzoru nad libovolný symbol zjistíte znaky, které jej vytváří. Některé symboly, které nejsou k dispozici v aktuálním písmu, se zobrazí jako prázdné čtverečky.}} {| class="wikitable" style="width:100%; text-align:center; font-weight:bold;" |+ Symbolové entity HTML |- | <span title="&amp;Aacute;">&Aacute;</span> | <span title="&amp;aacute;">&aacute;</span> | <span title="&amp;Acirc;">&Acirc;</span> | <span title="&amp;acirc;">&acirc;</span> | <span title="&amp;acute;">&acute;</span> | <span title="&amp;AElig;">&AElig;</span> | <span title="&amp;aelig;">&aelig;</span> | <span title="&amp;Agrave;">&Agrave;</span> | <span title="&amp;agrave;">&agrave;</span> | <span title="&amp;alefsym;">&alefsym;</span> | <span title="&amp;Alpha;">&Alpha;</span> | <span title="&amp;alpha;">&alpha;</span> | <span title="&amp;amp;">&amp;</span> | <span title="&amp;and;">&and;</span> | <span title="&amp;ang;">&ang;</span> | <span title="&amp;Aring;">&Aring;</span> | <span title="&amp;aring;">&aring;</span> | <span title="&amp;asymp;">&asymp;</span> | <span title="&amp;Atilde;">&Atilde;</span> | <span title="&amp;atilde;">&atilde;</span> | <span title="&amp;Auml;">&Auml;</span> | <span title="&amp;auml;">&auml;</span> | <span title="&amp;bdquo;">&bdquo;</span> | <span title="&amp;Beta;">&Beta;</span> | <span title="&amp;beta;">&beta;</span> | <span title="&amp;brvbar;">&brvbar;</span> | <span title="&amp;bull;">&bull;</span> | <span title="&amp;cap;">&cap;</span> | <span title="&amp;Ccedil;">&Ccedil;</span> | <span title="&amp;ccedil;">&ccedil;</span> | <span title="&amp;cedil;">&cedil;</span> | <span title="&amp;cent;">&cent;</span> |- | <span title="&amp;Chi;">&Chi;</span> | <span title="&amp;chi;">&chi;</span> | <span title="&amp;circ;">&circ;</span> | <span title="&amp;clubs;">&clubs;</span> | <span title="&amp;cong;">&cong;</span> | <span title="&amp;copy;">&copy;</span> | <span title="&amp;crarr;">&crarr;</span> | <span title="&amp;cup;">&cup;</span> | <span title="&amp;curren;">&curren;</span> | <span title="&amp;dagger;">&dagger;</span> | <span title="&amp;Dagger;">&Dagger;</span> | <span title="&amp;darr;">&darr;</span> | <span title="&amp;dArr;">&dArr;</span> | <span title="&amp;deg;">&deg;</span> | <span title="&amp;Delta;">&Delta;</span> | <span title="&amp;delta;">&delta;</span> | <span title="&amp;diams;">&diams;</span> | <span title="&amp;divide;">&divide;</span> | <span title="&amp;Eacute;">&Eacute;</span> | <span title="&amp;eacute;">&eacute;</span> | <span title="&amp;Ecirc;">&Ecirc;</span> | <span title="&amp;ecirc;">&ecirc;</span> | <span title="&amp;Egrave;">&Egrave;</span> | <span title="&amp;egrave;">&egrave;</span> | <span title="&amp;empty;">&empty;</span> | <span title="&amp;emsp;">&emsp;</span> | <span title="&amp;ensp;">&ensp;</span> | <span title="&amp;Epsilon;">&Epsilon;</span> | <span title="&amp;epsilon;">&epsilon;</span> | <span title="&amp;equiv;">&equiv;</span> | <span title="&amp;Eta;">&Eta;</span> | <span title="&amp;eta;">&eta;</span> |- | <span title="&amp;ETH;">&ETH;</span> | <span title="&amp;eth;">&eth;</span> | <span title="&amp;Euml;">&Euml;</span> | <span title="&amp;euml;">&euml;</span> | <span title="&amp;euro;">&euro;</span> | <span title="&amp;exist;">&exist;</span> | <span title="&amp;fnof;">&fnof;</span> | <span title="&amp;forall;">&forall;</span> | <span title="&amp;frac12;">&frac12;</span> | <span title="&amp;frac14;">&frac14;</span> | <span title="&amp;frac34;">&frac34;</span> | <span title="&amp;frasl;">&frasl;</span> | <span title="&amp;Gamma;">&Gamma;</span> | <span title="&amp;gamma;">&gamma;</span> | <span title="&amp;ge;">&ge;</span> | <span title="&amp;gt;">&gt;</span> | <span title="&amp;harr;">&harr;</span> | <span title="&amp;hArr;">&hArr;</span> | <span title="&amp;hearts;">&hearts;</span> | <span title="&amp;hellip;">&hellip;</span> | <span title="&amp;Iacute;">&Iacute;</span> | <span title="&amp;iacute;">&iacute;</span> | <span title="&amp;Icirc;">&Icirc;</span> | <span title="&amp;icirc;">&icirc;</span> | <span title="&amp;iexcl;">&iexcl;</span> | <span title="&amp;Igrave;">&Igrave;</span> | <span title="&amp;igrave;">&igrave;</span> | <span title="&amp;image;">&image;</span> | <span title="&amp;infin;">&infin;</span> | <span title="&amp;int;">&int;</span> | <span title="&amp;Iota;">&Iota;</span> | <span title="&amp;iota;">&iota;</span> |- | <span title="&amp;iquest;">&iquest;</span> | <span title="&amp;isin;">&isin;</span> | <span title="&amp;Iuml;">&Iuml;</span> | <span title="&amp;iuml;">&iuml;</span> | <span title="&amp;Kappa;">&Kappa;</span> | <span title="&amp;kappa;">&kappa;</span> | <span title="&amp;Lambda;">&Lambda;</span> | <span title="&amp;lambda;">&lambda;</span> | <span title="&amp;lang;">&lang;</span> | <span title="&amp;laquo;">&laquo;</span> | <span title="&amp;larr;">&larr;</span> | <span title="&amp;lArr;">&lArr;</span> | <span title="&amp;lceil;">&lceil;</span> | <span title="&amp;ldquo;">&ldquo;</span> | <span title="&amp;le;">&le;</span> | <span title="&amp;lfloor;">&lfloor;</span> | <span title="&amp;lowast;">&lowast;</span> | <span title="&amp;loz;">&loz;</span> | <span title="&amp;lrm;">&lrm;</span> | <span title="&amp;lsaquo;">&lsaquo;</span> | <span title="&amp;lsquo;">&lsquo;</span> | <span title="&amp;lt;">&lt;</span> | <span title="&amp;macr;">&macr;</span> | <span title="&amp;mdash;">&mdash;</span> | <span title="&amp;micro;">&micro;</span> | <span title="&amp;middot;">&middot;</span> | <span title="&amp;minus;">&minus;</span> | <span title="&amp;Mu;">&Mu;</span> | <span title="&amp;mu;">&mu;</span> | <span title="&amp;nabla;">&nabla;</span> | <span title="&amp;nbsp;">&nbsp;</span> | <span title="&amp;ndash;">&ndash;</span> |- | <span title="&amp;ne;">&ne;</span> | <span title="&amp;ni;">&ni;</span> | <span title="&amp;not;">&not;</span> | <span title="&amp;notin;">&notin;</span> | <span title="&amp;nsub;">&nsub;</span> | <span title="&amp;Ntilde;">&Ntilde;</span> | <span title="&amp;ntilde;">&ntilde;</span> | <span title="&amp;Nu;">&Nu;</span> | <span title="&amp;nu;">&nu;</span> | <span title="&amp;Oacute;">&Oacute;</span> | <span title="&amp;oacute;">&oacute;</span> | <span title="&amp;Ocirc;">&Ocirc;</span> | <span title="&amp;ocirc;">&ocirc;</span> | <span title="&amp;OElig;">&OElig;</span> | <span title="&amp;oelig;">&oelig;</span> | <span title="&amp;Ograve;">&Ograve;</span> | <span title="&amp;ograve;">&ograve;</span> | <span title="&amp;oline;">&oline;</span> | <span title="&amp;Omega;">&Omega;</span> | <span title="&amp;omega;">&omega;</span> | <span title="&amp;Omicron;">&Omicron;</span> | <span title="&amp;omicron;">&omicron;</span> | <span title="&amp;oplus;">&oplus;</span> | <span title="&amp;or;">&or;</span> | <span title="&amp;ordf;">&ordf;</span> | <span title="&amp;ordm;">&ordm;</span> | <span title="&amp;Oslash;">&Oslash;</span> | <span title="&amp;oslash;">&oslash;</span> | <span title="&amp;Otilde;">&Otilde;</span> | <span title="&amp;otilde;">&otilde;</span> | <span title="&amp;otimes;">&otimes;</span> | <span title="&amp;Ouml;">&Ouml;</span> |- | <span title="&amp;ouml;">&ouml;</span> | <span title="&amp;para;">&para;</span> | <span title="&amp;part;">&part;</span> | <span title="&amp;permil;">&permil;</span> | <span title="&amp;perp;">&perp;</span> | <span title="&amp;Phi;">&Phi;</span> | <span title="&amp;phi;">&phi;</span> | <span title="&amp;Pi;">&Pi;</span> | <span title="&amp;pi;">&pi;</span> | <span title="&amp;piv;">&piv;</span> | <span title="&amp;plusmn;">&plusmn;</span> | <span title="&amp;pound;">&pound;</span> | <span title="&amp;prime;">&prime;</span> | <span title="&amp;Prime;">&Prime;</span> | <span title="&amp;prod;">&prod;</span> | <span title="&amp;prop;">&prop;</span> | <span title="&amp;Psi;">&Psi;</span> | <span title="&amp;psi;">&psi;</span> | <span title="&amp;quot;">&quot;</span> | <span title="&amp;radic;">&radic;</span> | <span title="&amp;rang;">&rang;</span> | <span title="&amp;raquo;">&raquo;</span> | <span title="&amp;rarr;">&rarr;</span> | <span title="&amp;rArr;">&rArr;</span> | <span title="&amp;rceil;">&rceil;</span> | <span title="&amp;rdquo;">&rdquo;</span> | <span title="&amp;real;">&real;</span> | <span title="&amp;reg;">&reg;</span> | <span title="&amp;rfloor;">&rfloor;</span> | <span title="&amp;Rho;">&Rho;</span> | <span title="&amp;rho;">&rho;</span> | <span title="&amp;rlm;">&rlm;</span> |- | <span title="&amp;rsaquo;">&rsaquo;</span> | <span title="&amp;rsquo;">&rsquo;</span> | <span title="&amp;sbquo;">&sbquo;</span> | <span title="&amp;Scaron;">&Scaron;</span> | <span title="&amp;scaron;">&scaron;</span> | <span title="&amp;sdot;">&sdot;</span> | <span title="&amp;sect;">&sect;</span> | <span title="&amp;shy;">&shy;</span> | <span title="&amp;Sigma;">&Sigma;</span> | <span title="&amp;sigma;">&sigma;</span> | <span title="&amp;sigmaf;">&sigmaf;</span> | <span title="&amp;sim;">&sim;</span> | <span title="&amp;spades;">&spades;</span> | <span title="&amp;sub;">&sub;</span> | <span title="&amp;sube;">&sube;</span> | <span title="&amp;sum;">&sum;</span> | <span title="&amp;sup;">&sup;</span> | <span title="&amp;sup1;">&sup1;</span> | <span title="&amp;sup2;">&sup2;</span> | <span title="&amp;sup3;">&sup3;</span> | <span title="&amp;supe;">&supe;</span> | <span title="&amp;szlig;">&szlig;</span> | <span title="&amp;Tau;">&Tau;</span> | <span title="&amp;tau;">&tau;</span> | <span title="&amp;there4;">&there4;</span> | <span title="&amp;Theta;">&Theta;</span> | <span title="&amp;theta;">&theta;</span> | <span title="&amp;thetasym;">&thetasym;</span> | <span title="&amp;thinsp;">&thinsp;</span> | <span title="&amp;THORN;">&THORN;</span> | <span title="&amp;thorn;">&thorn;</span> | <span title="&amp;tilde;">&tilde;</span> |- | <span title="&amp;times;">&times;</span> | <span title="&amp;trade;">&trade;</span> | <span title="&amp;Uacute;">&Uacute;</span> | <span title="&amp;uacute;">&uacute;</span> | <span title="&amp;uarr;">&uarr;</span> | <span title="&amp;uArr;">&uArr;</span> | <span title="&amp;Ucirc;">&Ucirc;</span> | <span title="&amp;ucirc;">&ucirc;</span> | <span title="&amp;Ugrave;">&Ugrave;</span> | <span title="&amp;ugrave;">&ugrave;</span> | <span title="&amp;uml;">&uml;</span> | <span title="&amp;upsih;">&upsih;</span> | <span title="&amp;Upsilon;">&Upsilon;</span> | <span title="&amp;upsilon;">&upsilon;</span> | <span title="&amp;Uuml;">&Uuml;</span> | <span title="&amp;uuml;">&uuml;</span> | <span title="&amp;weierp;">&weierp;</span> | <span title="&amp;Xi;">&Xi;</span> | <span title="&amp;xi;">&xi;</span> | <span title="&amp;Yacute;">&Yacute;</span> | <span title="&amp;yacute;">&yacute;</span> | <span title="&amp;yen;">&yen;</span> | <span title="&amp;yuml;">&yuml;</span> | <span title="&amp;Yuml;">&Yuml;</span> | <span title="&amp;Zeta;">&Zeta;</span> | <span title="&amp;zeta;">&zeta;</span> | <span title="&amp;zwj;">&zwj;</span> | <span title="&amp;zwnj;">&zwnj;</span> |} {| class="wikitable" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se |- | Symbol autorských práv |class=mw-code| &amp;copy; | :::'''&copy;''' |- | Symbol řeckého písmene delta |class=mw-code|&amp;delta; | :::'''&delta;''' |- | Symbol měny euro |class=mw-code|&amp;euro; | :::'''&euro;''' |} Podívejte se na seznam všech HTML entit v článku Wikipedie [[wikipedia:List of HTML entities|Seznam entit HTML]]. Kromě toho MediaWiki podporuje dvě nestandardní referenční entity: <code>&amp;רלמ;</code> a <code>&amp;رلم;</code>, které jsou považovány za ekvivalentní s <code>&amp;rlm;</code>, což je [[wikipedia:Right-to-left mark|značka zprava doleva]]. (Používá se při kombinaci jazyků zprava doleva s jazyky zleva doprava na stejné stránce.) <span id="HTML_tags_and_symbol_entities_displayed_themselves_(with_and_without_interpreting_them)"></span> == HTML tagy a entity symbolů se zobrazují samy (s a bez interpretace) == : <syntaxhighlight lang=html inline>&amp;euro;</syntaxhighlight> &nbsp;&rarr; '''&amp;euro;''' : {{#tag:syntaxhighlight|<span style="color: red; text-decoration: line-through;">Oprava překlepu</span>|lang=wikitext|inline=}} <!-- -->&nbsp;&rarr; '''<span style="color: red; text-decoration: line-through;">Oprava překlepu</span>''' : {{#tag:syntaxhighlight|&lt;span style="color: red; text-decoration: line-through;">Oprava překlepu</span>|lang=wikitext|inline=}} <!-- -->&nbsp;&rarr; '''&lt;span style="color: red; text-decoration: line-through;">Oprava překlepu&lt;/span>''' <span id="Nowiki_for_HTML"></span> === Nowiki pro HTML === {{tag|nowiki|s}} může zakázat (HTML) značky: * <nowiki><<</nowiki>nowiki/>pre> &nbsp;&rarr; <<nowiki/>pre> Symbol ''ne'' &amp; ale uniká: * &<<nowiki/>nowiki/>amp; &nbsp;&rarr; &<nowiki/>amp; Chcete-li obejít symbol &amp; jako text, použijte znak "<syntaxhighlight inline lang="html">&amp;</syntaxhighlight>". Po nahrazení znaku "&" (např. typ "<syntaxhighlight inline lang="html">&amp;nbsp;</syntaxhighlight>"), jehož výsledkem bude "<syntaxhighlight inline lang="html">&nbsp;</syntaxhighlight>". <span id="Other_formatting"></span> == Ostatní formáty == Kromě výše uvedeného značení formátování textu jsou zde i další odkazy na formátování: * {{ll|Help:Links}} * {{ll|Help:Lists}} * {{ll|Help:Images}} * Značení LanguageConverter - viz {{ll|Writing systems/Syntax}} * Reference - viz {{ll|Extension:Cite}} * [[Special:MyLanguage/Help:Tables|Tabulky]] * {{ll|Manual:Collapsible_elements}} Další reference najdete na {{ll|Help:Contents}}. <span id="References"></span> == Poznámky pod čarou == <references/> [[Category:Help{{#translation:}}|Formatting]] se8wr7k0u7ei1k8p0yamyubk33mrpkp 8364659 8364657 2026-05-03T17:20:09Z Rebulka 17532855 8364659 wikitext text/x-wiki <languages/> {{PD Help Page}} {{See also|Help:Advanced editing}}<!-- To editors: Please NOTE that {{#tag: are required to make language conversion/language converter work, especially for /zh translation pages. -->Zobrazení vašeho textu můžete ovlivnit pomocí wiki značek. Ty se tvoří pomocí standardních znaků jako je např. hvězdička, apostrof nebo znak rovnítka, které mají ve wiki speciální význam, v závislosti na tom kde a v jakém počtu jsou použity. Například chcete-li v textu zvýraznit slovo ''kurzívou'' (italic), stačí, když ho uzavřete mezi dva páry apostrofů, jako například <code><nowiki>''zde''</nowiki></code>. <span id="Text_formatting_markup"></span> == Značky pro formátování textu == {| class="wikitable" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se |- ! colspan="3" style="color: var(--color-base, #202122); background: var(--background-color-progressive-subtle--active, #b6d4fb)" | {{anchor|Character formatting}}Značkování v textu (inline) – ''lze používat všude'' |- | Text v kurzívě | {{#tag:syntaxhighlight| ''kurzíva'' |lang=wikitext}} | ''kurzíva'' |- | Tučný text | {{#tag:syntaxhighlight| '''tučně''' |lang=wikitext}} | '''tučně''' |- | Tučný text v kurzívě | {{#tag:syntaxhighlight| '''''tučná kurzíva''''' |lang=wikitext}} | '''''tučná kurzíva''''' {{Table-AnchorRow|colspan=3|nowiki|&lt;nowiki&gt;|.3Cnowiki.3E}} |- | Zobrazení bez interpretace wiki značek | {{#tag:syntaxhighlight| <!-- This can't use <syntaxhighlight><nowiki>, as that breaks the <translate> tag --> {{^(}}nowiki{{)^}}ignoruji [[wiki]] ''značky''{{^(}}/nowiki{{)^}} |lang=wikitext}} | <nowiki>ignoruji [[wiki]] ''značky''</nowiki> |- ! colspan="3" style="color: var(--color-base, #202122); background: var(--background-color-progressive-subtle--active, #b6d4fb)" | {{anchor|Section formatting}}Sekce (oddíly) – ''jejich zápis začíná vždy na počátku řádky'' |- | Úrovně sekcí (oddílů) a interpretace jejich nadpisů (záhlaví) | {{anchor|headings}}{{#tag:syntaxhighlight| == Úroveň 2 == === Úroveň 3 === ==== Úroveň 4 ==== ===== Úroveň 5 ===== ====== Úroveň 6 ====== |lang=wikitext}} ---- {{note|1=<nowiki/> * [[Help talk:Formatting#Level_1|Úroveň 1]], jedná se o úroveň názvu stránky. * Nezadávejte na řádek žádný text za koncová znaménka 'rovná se'. * Článek se čtyřmi a více nadpisy vytvoří automaticky [[wikipedia:Help:Section#Table of contents (TOC)|tabulku s obsahem]] umístěnou v úvodu stránky. Pokud nenastavíte kouzelné slovo <code><nowiki>__NOTOC__</nowiki></code>. }} | {{Fake heading|level=2|1=Úroveň 2}} {{Fake heading|level=3|1=Úroveň 3}} {{Fake heading|level=4|1=Úroveň 4}} {{Fake heading|level=5|1=Úroveň 5}} {{Fake heading|level=6|1=Úroveň 6}} |- | Horizontální čára | {{#tag:syntaxhighlight| Předcházející text ---- Následující text |lang=wikitext}} | Předcházející text ---- Následující text |- | Seznam s odrážkami | {{anchor|bulleted-lists}} {{#tag:syntaxhighlight| * Začněte každý řádek * [[Wikipedia:hvězdička|hvězdičkou]] (*). ** Více hvězdiček znamená hlubší *** a hlubší úrovně. * Konce řádků <br>nepřerušují úrovně. *** Ale skákání úrovní vytváří prázdný prostor. Jakýkoli jiný začátek seznam končí. * seznam s odrážkami můžete kombinovat ** s odsazením ::- odsazení ** vytvoří místo odrážky odpovídají mezeru * kombinace seznamu odrážek ** s definicí *:- definice ** bez mezer * seznam odrážek :- definice :* sublist, který nevytváří prázdné :* mezery za definicí |lang=wikitext}} | * Začněte každý řádek * [[Wikipedia:hvězdička|hvězdičkou]] (*). ** Více hvězdiček znamená hlubší *** a hlubší úrovně. * Konce řádků <br>nepřerušují úrovně. *** Ale skákání úrovní vytváří prázdný prostor. Jakýkoli jiný začátek seznam končí. * seznam s odrážkami můžete kombinovat ** s odsazením ::- odsazení ** vytvoří místo odrážky odpovídají mezeru * kombinace seznamu odrážek ** s definicí *:- definice ** bez mezer * seznam odrážek :- definice :* sublist, který nevytváří prázdné :* mezery za definicí |- | Číslovaný seznam | {{anchor|numbered-list}} {{#tag:syntaxhighlight| # Začněte každý řádek # se znakem [[Wikipedia:Number_sign|číslo]] (#). ## Více číselných znaků dává hlubší ### a hlouběji ### úrovně. # Konce řádků <br>nepřerušují úrovně. ### Ale skákání úrovní vytváří prázdný prostor. # Prázdné řádky # po ukončení seznamu může začít nový seznam. Každý start nového seznamu ukončí původní seznam. {{^(}}nowiki{{)^}}#{{^(}}/nowiki{{)^}} použijete-li značky "nowiki", zobrazí se na začátku řádku přímo znak mřížky (#), aniž by jej systém chápal jako číslovaný seznam. |lang=wikitext}} | # Začněte každý řádek # se znakem [[Wikipedia:Number_sign|číslo]] (#). ## Více číselných znaků dává hlubší ### a hlouběji ### úrovně. # Konce řádků <br>nepřerušují úrovně. ### Ale skákání úrovní vytváří prázdný prostor. # Prázdné řádky # po ukončení seznamu může začít nový seznam. Každý start nového seznamu ukončí původní seznam. <nowiki>#</nowiki> použijete-li značky "nowiki", zobrazí se na začátku řádku přímo znak mřížky (#), aniž by jej systém chápal jako číslovaný seznam. {{Table-AnchorRow|colspan=3|Definition list}} |- | Seznam definic | {{#tag:syntaxhighlight| ;položka 1 : definice 1 ;položka 2 : definice 2-1 : definice 2-2 |lang=wikitext}} {{note|1=Žádné vložené dvojtečky (:) se nebudou zobrazovat, pokud řádek začíná středníkem (;). Pokud chcete, aby se dvojtečka zobrazila, napište <code>&amp;#58;</code>.}} | ;položka 1 : definice 1 ;položka 2 : definice 2-1 : definice 2-2 |- | Podrobnosti popisu bez popisných výrazů | {{#tag:syntaxhighlight| : Podrobnosti popisu :: Vnořené podrobnosti popisu ::::: Hluboce vnořené detaily popisu |lang=wikitext}} ---- {{Note|1=Toto se často používá jako alternativní řešení pro odsazení řádku, ale poškodí to přístupnost a způsobí neplatný HTML výstup. Použití CSS pro vizuální odsazení je mnohem vhodnější přístup (např. {{tl|indent}}).}} | : Podrobnosti popisu :: Vnořené podrobnosti popisu ::::: Hluboce vnořené detaily popisu |- | Různé typy seznamů | {{#tag:syntaxhighlight| # První # Druhá #* druhá odrážka jedna #* druhá odrážka dva # Třetí #; třetí následující řádek tučně #: třetí definice odrážky jedna # Čtvrtá #: čtvrtá definice odrážky jedna #: vypadá to jako pokračování odstavce #: a často se používá #: místo <br> z <nowiki><br></nowiki> # Pátá ## pátá odstavec 1 ### pátá odstavec 1 pododstavec 1 ## pátá odstavec 2 |lang=wikitext}} ---- {{note|1=Použití <code>#:</code> a <code>*:</code> pro přerušení řádku je stejně problematické jako použití jediné <code>:</code>.}} | # První # Druhá #* druhá odrážka jedna #* druhá odrážka dva # Třetí #; třetí následující řádek tučně #: třetí definice odrážky jedna # Čtvrtá #: čtvrtá definice odrážky jedna #: vypadá to jako pokračování odstavce #: a často se používá #: místo <br> z <nowiki><br></nowiki> # Pátá ## pátá odstavec 1 ### pátá odstavec 1 pododstavec 1 ## pátá odstavec 2 |- | {{anchor|Preformatted text}}Formátování textu | {{#tag:syntaxhighlight| Začněte každý řádek mezerou. Text je '''formátovaný''' a '''''lze''''' vkládat ''značky''. |lang=wikitext}} ---- {{note|1=Tento způsob předformátování platí pouze pro [[#Section formatting|formátování sekcí]]. Značky [[#Character formatting|formátování znaků]] jsou stále platné.}} | Začněte každý řádek mezerou. Text je '''formátovaný''' a '''''lze''''' vkládat ''značky''. |- | Formátování textových bloků | {{#tag:syntaxhighlight| {{^(}}nowiki{{)^}}Začněte mezerou v prvním sloupci, (před {{^(}}nowiki{{)^}}). Pak bude váš formát bloku      udržován. To je dobré pro kopírování bloků při programování: def function(): """dokumentační řetězec""" if True: print True else: print False{{^(}}/nowiki{{)^}} |lang=wikitext}} | {{#tag:nowiki|Začněte mezerou v prvním sloupci, (před &lt;nowiki&gt;). Pak bude váš formát bloku      udržován. To je dobré pro kopírování bloků při programování: def function(): """dokumentační řetězec""" if True: print True else: print False }} |} {{anchor|&lt;p&gt;|.3Cp.3E}} <span id="Paragraphs"></span> == Odstavce == {{anchor|&lt;br&gt;|.3Cbr.3E}} MediaWiki ignoruje jednotlivé konce řádků. Pokud chcete začít nový odstavec, nechte prázdný řádek. Pomocí značky HTML {{tag|br|single}} můžete vynutit zalomení řádku v odstavci. <span id="HTML_tags"></span> == HTML značky (tags) == {{anchor|&lt;div&gt;|.3Cdiv.3E|&lt;span&gt;|.3Cspan.3E}} Na MediaWiki jsou povoleny některé značky [[wikipedia:HTML|HTML]], například {{tag|code|open}}, [[w:Div and span|{{tag|div|open}} a {{tag|span|open}}]]. Platí kdekoli, kam je vložíte. {| class="wikitable" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se {{Table-AnchorRow|colspan=3|&lt;ins&gt;|.3Cins.3E|&lt;u&gt;|.3Cu.3E}} |- | Vloženo <br>(Ve většině prohlížečů se zobrazí jako podtržené) | {{#tag:syntaxhighlight| <ins>Vloženo</ins> nebo <u>Zdůraznit</u> |lang=wikitext}} | <ins>Vloženo</ins> nebo <u>Zdůraznit</u> {{Table-AnchorRow|colspan=3|&lt;del&gt;|.3Cdel.3E|&lt;s&gt;|.3Cs.3E}} |- | Smazáno <br>(Ve většině prohlížečů se zobrazí jako přeškrtnuté) | {{#tag:syntaxhighlight| <s>Prorazit</s> nebo <del>Vymazáno</del> |lang=wikitext}} | <s>Prorazit</s> nebo <del>Vymazáno</del> {{Table-AnchorRow|colspan=3|&lt;code&gt;|.3Ccode.3E}} |- | Text s pevnou šířkou | <syntaxhighlight lang=html><code>Zdrojový kód</code></syntaxhighlight> | <code>Zdrojový kód</code> {{Table-AnchorRow|colspan=3|&lt;blockquote&gt;|.3Cblockquote.3E}} |- | Bloková citace | {{#tag:syntaxhighlight| Předcházející text <blockquote>Bloková citace</blockquote> Následující text |lang=wikitext}} {{Note|1=Pokud citace obsahuje více odstavců, musí být značky, aby se správně zobrazily, na samostatných řádcích, tj.: {{#tag:syntaxhighlight| <blockquote> První odstavec. Druhý odstavec. </blockquote> |lang=wikitext}} {{Tracked|T309778|float=none}} }} | Předcházející text <blockquote>Bloková citace</blockquote> Následující text {{Table-AnchorRow|colspan=3|&lt;q&gt;|.3Cq.3E}} |- | Citáty | {{#tag:syntaxhighlight| <q>Toto je citát</q> |lang=wikitext}} {{Note|1=Prvek q nesmí být použit místo uvozovek, které nepředstavují uvozovky. Například není vhodné používat prvek q k označení sarkastických výrazů. <ref>[https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-q-element HTML Living Standard - prvek &lt;'''q'''&gt;]</ref>}} | <q>Toto je citát</q> |- | Komentář | {{#tag:syntaxhighlight| <!-- Toto je komentář --> Komentáře jsou viditelné pouze v editační zóně. |lang=wikitext}} | <!-- Toto je komentář --> Komentáře jsou viditelné pouze v editační zóně. {{Table-AnchorRow|colspan=3|&lt;pre&gt;|.3Cpre.3E}} |- | Zcela předformátovaný text | {{#tag:syntaxhighlight| {{^(}}pre{{)^}} Text je '''předformátován''' a '''''nelze''''' jej označit ''značkami''. {{^(}}/pre{{)^}} |lang=wikitext}} ---- {{note|1=Chcete-li označit předformátovaný text, zaškrtněte položku "Předformátovaný text" (Preformatted text) na konci předchozí tabulky.}} | {{#tag:pre| Text je '''předformátován''' a '''''nelze''''' jej označit ''značkami''. }} |- | Úpravy předformátovaného textu | {{#tag:syntaxhighlight| {{^(}}pre style="color: red"{{)^}} Text je '''předformátován''' spolu se stylem a '''''nelze''''' jej označit ''značkami'' {{^(}}/pre{{)^}} |lang=wikitext}} ---- {{note|1=Styl CSS lze pojmenovat v atributu <code>style</code>.}} | {{#tag:pre| Text je '''předformátován''' spolu se stylem a '''''nelze''''' jej označit ''značkami'' |style=color: red}} |} pokračování: {| class="wikitable" | style="table-layout: fixed; width: 100%" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se |- | '''Výchozí''' předformátovaný text pro zalomení textu podle dostupné šířky má atribut CSS (<code>white-space: pre-wrap;</code>). | {{#tag:syntaxhighlight| {{^(}}pre{{)^}} Tato dlouhá věta se používá k demonstraci zalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. {{^(}}/pre{{)^}} |lang=wikitext}} | {{#tag:pre| Tato dlouhá věta se používá k demonstraci zalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. |}} |- | '''Přizpůsobený''' předem naformátovaný text se '''zakázaným''' zalomením textu | {{#tag:syntaxhighlight| {{^(}}pre style="white-space: pre;"{{)^}} Tato dlouhá věta se používá k demonstraci nezalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. {{^(}}/pre{{)^}} |lang=wikitext}} | {{#tag:pre| Tato dlouhá věta se používá k demonstraci nezalomení textu. Díky této další větě je text ještě delší. Díky této další větě je text ještě delší. |style=white-space: pre;}} |} Úplný seznam rozpoznaných značek je uveden na stránce {{ll|Help:HTML in wikitext}}. <span id="Inserting_symbols"></span> == Vkládání symbolů == Symboly a další speciální znaky, které nejsou dostupné na vaší klávesnici, lze vkládat mnoha způsoby. [http://www.howtogeek.com/210824/how-to-quickly-type-special-characters-on-any-computer-smartphone-or-tablet/ Mnoho operačních systémů a prohlížečů umožňuje vkládat speciální znaky] prostřednictvím možnosti nabídky nebo panelu operačního systému. Navíc můžete použít WikiEditor nebo [[Special:MyLanguage/VisualEditor/Special characters|VisualEditor]] k jejich vložení na obrazovku úprav. Jako poslední možnost můžete použít speciální sekvenci znaků. Tyto sekvence se nazývají [https://developer.mozilla.org/docs/Glossary/Character_reference odkazy na znaky HTML]. Například: * [[w:Arrow (symbol)|Symbol šipky]] doprava (<code>&rarr;</code>) lze zobrazit pomocí sekvence <code>&amp;rarr;</code> * [[w:Dash#Em pomlčka|Em pomlčku]] (<code>&mdash;</code>) lze zobrazit pomocí <code>&amp;mdash;</code>. ---- {{note|1=Umístěním kurzoru nad libovolný symbol zjistíte znaky, které jej vytváří. Některé symboly, které nejsou k dispozici v aktuálním písmu, se zobrazí jako prázdné čtverečky.}} {| class="wikitable" style="width:100%; text-align:center; font-weight:bold;" |+ Symbolové entity HTML |- | <span title="&amp;Aacute;">&Aacute;</span> | <span title="&amp;aacute;">&aacute;</span> | <span title="&amp;Acirc;">&Acirc;</span> | <span title="&amp;acirc;">&acirc;</span> | <span title="&amp;acute;">&acute;</span> | <span title="&amp;AElig;">&AElig;</span> | <span title="&amp;aelig;">&aelig;</span> | <span title="&amp;Agrave;">&Agrave;</span> | <span title="&amp;agrave;">&agrave;</span> | <span title="&amp;alefsym;">&alefsym;</span> | <span title="&amp;Alpha;">&Alpha;</span> | <span title="&amp;alpha;">&alpha;</span> | <span title="&amp;amp;">&amp;</span> | <span title="&amp;and;">&and;</span> | <span title="&amp;ang;">&ang;</span> | <span title="&amp;Aring;">&Aring;</span> | <span title="&amp;aring;">&aring;</span> | <span title="&amp;asymp;">&asymp;</span> | <span title="&amp;Atilde;">&Atilde;</span> | <span title="&amp;atilde;">&atilde;</span> | <span title="&amp;Auml;">&Auml;</span> | <span title="&amp;auml;">&auml;</span> | <span title="&amp;bdquo;">&bdquo;</span> | <span title="&amp;Beta;">&Beta;</span> | <span title="&amp;beta;">&beta;</span> | <span title="&amp;brvbar;">&brvbar;</span> | <span title="&amp;bull;">&bull;</span> | <span title="&amp;cap;">&cap;</span> | <span title="&amp;Ccedil;">&Ccedil;</span> | <span title="&amp;ccedil;">&ccedil;</span> | <span title="&amp;cedil;">&cedil;</span> | <span title="&amp;cent;">&cent;</span> |- | <span title="&amp;Chi;">&Chi;</span> | <span title="&amp;chi;">&chi;</span> | <span title="&amp;circ;">&circ;</span> | <span title="&amp;clubs;">&clubs;</span> | <span title="&amp;cong;">&cong;</span> | <span title="&amp;copy;">&copy;</span> | <span title="&amp;crarr;">&crarr;</span> | <span title="&amp;cup;">&cup;</span> | <span title="&amp;curren;">&curren;</span> | <span title="&amp;dagger;">&dagger;</span> | <span title="&amp;Dagger;">&Dagger;</span> | <span title="&amp;darr;">&darr;</span> | <span title="&amp;dArr;">&dArr;</span> | <span title="&amp;deg;">&deg;</span> | <span title="&amp;Delta;">&Delta;</span> | <span title="&amp;delta;">&delta;</span> | <span title="&amp;diams;">&diams;</span> | <span title="&amp;divide;">&divide;</span> | <span title="&amp;Eacute;">&Eacute;</span> | <span title="&amp;eacute;">&eacute;</span> | <span title="&amp;Ecirc;">&Ecirc;</span> | <span title="&amp;ecirc;">&ecirc;</span> | <span title="&amp;Egrave;">&Egrave;</span> | <span title="&amp;egrave;">&egrave;</span> | <span title="&amp;empty;">&empty;</span> | <span title="&amp;emsp;">&emsp;</span> | <span title="&amp;ensp;">&ensp;</span> | <span title="&amp;Epsilon;">&Epsilon;</span> | <span title="&amp;epsilon;">&epsilon;</span> | <span title="&amp;equiv;">&equiv;</span> | <span title="&amp;Eta;">&Eta;</span> | <span title="&amp;eta;">&eta;</span> |- | <span title="&amp;ETH;">&ETH;</span> | <span title="&amp;eth;">&eth;</span> | <span title="&amp;Euml;">&Euml;</span> | <span title="&amp;euml;">&euml;</span> | <span title="&amp;euro;">&euro;</span> | <span title="&amp;exist;">&exist;</span> | <span title="&amp;fnof;">&fnof;</span> | <span title="&amp;forall;">&forall;</span> | <span title="&amp;frac12;">&frac12;</span> | <span title="&amp;frac14;">&frac14;</span> | <span title="&amp;frac34;">&frac34;</span> | <span title="&amp;frasl;">&frasl;</span> | <span title="&amp;Gamma;">&Gamma;</span> | <span title="&amp;gamma;">&gamma;</span> | <span title="&amp;ge;">&ge;</span> | <span title="&amp;gt;">&gt;</span> | <span title="&amp;harr;">&harr;</span> | <span title="&amp;hArr;">&hArr;</span> | <span title="&amp;hearts;">&hearts;</span> | <span title="&amp;hellip;">&hellip;</span> | <span title="&amp;Iacute;">&Iacute;</span> | <span title="&amp;iacute;">&iacute;</span> | <span title="&amp;Icirc;">&Icirc;</span> | <span title="&amp;icirc;">&icirc;</span> | <span title="&amp;iexcl;">&iexcl;</span> | <span title="&amp;Igrave;">&Igrave;</span> | <span title="&amp;igrave;">&igrave;</span> | <span title="&amp;image;">&image;</span> | <span title="&amp;infin;">&infin;</span> | <span title="&amp;int;">&int;</span> | <span title="&amp;Iota;">&Iota;</span> | <span title="&amp;iota;">&iota;</span> |- | <span title="&amp;iquest;">&iquest;</span> | <span title="&amp;isin;">&isin;</span> | <span title="&amp;Iuml;">&Iuml;</span> | <span title="&amp;iuml;">&iuml;</span> | <span title="&amp;Kappa;">&Kappa;</span> | <span title="&amp;kappa;">&kappa;</span> | <span title="&amp;Lambda;">&Lambda;</span> | <span title="&amp;lambda;">&lambda;</span> | <span title="&amp;lang;">&lang;</span> | <span title="&amp;laquo;">&laquo;</span> | <span title="&amp;larr;">&larr;</span> | <span title="&amp;lArr;">&lArr;</span> | <span title="&amp;lceil;">&lceil;</span> | <span title="&amp;ldquo;">&ldquo;</span> | <span title="&amp;le;">&le;</span> | <span title="&amp;lfloor;">&lfloor;</span> | <span title="&amp;lowast;">&lowast;</span> | <span title="&amp;loz;">&loz;</span> | <span title="&amp;lrm;">&lrm;</span> | <span title="&amp;lsaquo;">&lsaquo;</span> | <span title="&amp;lsquo;">&lsquo;</span> | <span title="&amp;lt;">&lt;</span> | <span title="&amp;macr;">&macr;</span> | <span title="&amp;mdash;">&mdash;</span> | <span title="&amp;micro;">&micro;</span> | <span title="&amp;middot;">&middot;</span> | <span title="&amp;minus;">&minus;</span> | <span title="&amp;Mu;">&Mu;</span> | <span title="&amp;mu;">&mu;</span> | <span title="&amp;nabla;">&nabla;</span> | <span title="&amp;nbsp;">&nbsp;</span> | <span title="&amp;ndash;">&ndash;</span> |- | <span title="&amp;ne;">&ne;</span> | <span title="&amp;ni;">&ni;</span> | <span title="&amp;not;">&not;</span> | <span title="&amp;notin;">&notin;</span> | <span title="&amp;nsub;">&nsub;</span> | <span title="&amp;Ntilde;">&Ntilde;</span> | <span title="&amp;ntilde;">&ntilde;</span> | <span title="&amp;Nu;">&Nu;</span> | <span title="&amp;nu;">&nu;</span> | <span title="&amp;Oacute;">&Oacute;</span> | <span title="&amp;oacute;">&oacute;</span> | <span title="&amp;Ocirc;">&Ocirc;</span> | <span title="&amp;ocirc;">&ocirc;</span> | <span title="&amp;OElig;">&OElig;</span> | <span title="&amp;oelig;">&oelig;</span> | <span title="&amp;Ograve;">&Ograve;</span> | <span title="&amp;ograve;">&ograve;</span> | <span title="&amp;oline;">&oline;</span> | <span title="&amp;Omega;">&Omega;</span> | <span title="&amp;omega;">&omega;</span> | <span title="&amp;Omicron;">&Omicron;</span> | <span title="&amp;omicron;">&omicron;</span> | <span title="&amp;oplus;">&oplus;</span> | <span title="&amp;or;">&or;</span> | <span title="&amp;ordf;">&ordf;</span> | <span title="&amp;ordm;">&ordm;</span> | <span title="&amp;Oslash;">&Oslash;</span> | <span title="&amp;oslash;">&oslash;</span> | <span title="&amp;Otilde;">&Otilde;</span> | <span title="&amp;otilde;">&otilde;</span> | <span title="&amp;otimes;">&otimes;</span> | <span title="&amp;Ouml;">&Ouml;</span> |- | <span title="&amp;ouml;">&ouml;</span> | <span title="&amp;para;">&para;</span> | <span title="&amp;part;">&part;</span> | <span title="&amp;permil;">&permil;</span> | <span title="&amp;perp;">&perp;</span> | <span title="&amp;Phi;">&Phi;</span> | <span title="&amp;phi;">&phi;</span> | <span title="&amp;Pi;">&Pi;</span> | <span title="&amp;pi;">&pi;</span> | <span title="&amp;piv;">&piv;</span> | <span title="&amp;plusmn;">&plusmn;</span> | <span title="&amp;pound;">&pound;</span> | <span title="&amp;prime;">&prime;</span> | <span title="&amp;Prime;">&Prime;</span> | <span title="&amp;prod;">&prod;</span> | <span title="&amp;prop;">&prop;</span> | <span title="&amp;Psi;">&Psi;</span> | <span title="&amp;psi;">&psi;</span> | <span title="&amp;quot;">&quot;</span> | <span title="&amp;radic;">&radic;</span> | <span title="&amp;rang;">&rang;</span> | <span title="&amp;raquo;">&raquo;</span> | <span title="&amp;rarr;">&rarr;</span> | <span title="&amp;rArr;">&rArr;</span> | <span title="&amp;rceil;">&rceil;</span> | <span title="&amp;rdquo;">&rdquo;</span> | <span title="&amp;real;">&real;</span> | <span title="&amp;reg;">&reg;</span> | <span title="&amp;rfloor;">&rfloor;</span> | <span title="&amp;Rho;">&Rho;</span> | <span title="&amp;rho;">&rho;</span> | <span title="&amp;rlm;">&rlm;</span> |- | <span title="&amp;rsaquo;">&rsaquo;</span> | <span title="&amp;rsquo;">&rsquo;</span> | <span title="&amp;sbquo;">&sbquo;</span> | <span title="&amp;Scaron;">&Scaron;</span> | <span title="&amp;scaron;">&scaron;</span> | <span title="&amp;sdot;">&sdot;</span> | <span title="&amp;sect;">&sect;</span> | <span title="&amp;shy;">&shy;</span> | <span title="&amp;Sigma;">&Sigma;</span> | <span title="&amp;sigma;">&sigma;</span> | <span title="&amp;sigmaf;">&sigmaf;</span> | <span title="&amp;sim;">&sim;</span> | <span title="&amp;spades;">&spades;</span> | <span title="&amp;sub;">&sub;</span> | <span title="&amp;sube;">&sube;</span> | <span title="&amp;sum;">&sum;</span> | <span title="&amp;sup;">&sup;</span> | <span title="&amp;sup1;">&sup1;</span> | <span title="&amp;sup2;">&sup2;</span> | <span title="&amp;sup3;">&sup3;</span> | <span title="&amp;supe;">&supe;</span> | <span title="&amp;szlig;">&szlig;</span> | <span title="&amp;Tau;">&Tau;</span> | <span title="&amp;tau;">&tau;</span> | <span title="&amp;there4;">&there4;</span> | <span title="&amp;Theta;">&Theta;</span> | <span title="&amp;theta;">&theta;</span> | <span title="&amp;thetasym;">&thetasym;</span> | <span title="&amp;thinsp;">&thinsp;</span> | <span title="&amp;THORN;">&THORN;</span> | <span title="&amp;thorn;">&thorn;</span> | <span title="&amp;tilde;">&tilde;</span> |- | <span title="&amp;times;">&times;</span> | <span title="&amp;trade;">&trade;</span> | <span title="&amp;Uacute;">&Uacute;</span> | <span title="&amp;uacute;">&uacute;</span> | <span title="&amp;uarr;">&uarr;</span> | <span title="&amp;uArr;">&uArr;</span> | <span title="&amp;Ucirc;">&Ucirc;</span> | <span title="&amp;ucirc;">&ucirc;</span> | <span title="&amp;Ugrave;">&Ugrave;</span> | <span title="&amp;ugrave;">&ugrave;</span> | <span title="&amp;uml;">&uml;</span> | <span title="&amp;upsih;">&upsih;</span> | <span title="&amp;Upsilon;">&Upsilon;</span> | <span title="&amp;upsilon;">&upsilon;</span> | <span title="&amp;Uuml;">&Uuml;</span> | <span title="&amp;uuml;">&uuml;</span> | <span title="&amp;weierp;">&weierp;</span> | <span title="&amp;Xi;">&Xi;</span> | <span title="&amp;xi;">&xi;</span> | <span title="&amp;Yacute;">&Yacute;</span> | <span title="&amp;yacute;">&yacute;</span> | <span title="&amp;yen;">&yen;</span> | <span title="&amp;yuml;">&yuml;</span> | <span title="&amp;Yuml;">&Yuml;</span> | <span title="&amp;Zeta;">&Zeta;</span> | <span title="&amp;zeta;">&zeta;</span> | <span title="&amp;zwj;">&zwj;</span> | <span title="&amp;zwnj;">&zwnj;</span> |} {| class="wikitable" ! Popis ! style="width: 40%;" | Napíšete ! style="width: 40%;" | Zobrazí se |- | Symbol autorských práv |class=mw-code| &amp;copy; | :::'''&copy;''' |- | Symbol řeckého písmene delta |class=mw-code|&amp;delta; | :::'''&delta;''' |- | Symbol měny euro |class=mw-code|&amp;euro; | :::'''&euro;''' |} Podívejte se na seznam všech HTML entit v článku Wikipedie [[wikipedia:List of HTML entities|Seznam entit HTML]]. Kromě toho MediaWiki podporuje dvě nestandardní referenční entity: <code>&amp;רלמ;</code> a <code>&amp;رلم;</code>, které jsou považovány za ekvivalentní s <code>&amp;rlm;</code>, což je [[wikipedia:Right-to-left mark|značka zprava doleva]]. (Používá se při kombinaci jazyků zprava doleva s jazyky zleva doprava na stejné stránce.) <span id="HTML_tags_and_symbol_entities_displayed_themselves_(with_and_without_interpreting_them)"></span> == HTML tagy a entity symbolů se zobrazují samy (s a bez interpretace) == : <syntaxhighlight lang=html inline>&amp;euro;</syntaxhighlight> &nbsp;&rarr; '''&amp;euro;''' : {{#tag:syntaxhighlight|<span style="color: red; text-decoration: line-through;">Oprava překlepu</span>|lang=wikitext|inline=}} <!-- -->&nbsp;&rarr; '''<span style="color: red; text-decoration: line-through;">Oprava překlepu</span>''' : {{#tag:syntaxhighlight|&lt;span style="color: red; text-decoration: line-through;">Oprava překlepu</span>|lang=wikitext|inline=}} <!-- -->&nbsp;&rarr; '''&lt;span style="color: red; text-decoration: line-through;">Oprava překlepu&lt;/span>''' <span id="Nowiki_for_HTML"></span> === Nowiki pro HTML === {{tag|nowiki|s}} může zakázat (HTML) značky: * <nowiki><<</nowiki>nowiki/>pre> &nbsp;&rarr; <<nowiki/>pre> Symbol ''ne'' &amp; ale uniká: * &<<nowiki/>nowiki/>amp; &nbsp;&rarr; &<nowiki/>amp; Chcete-li obejít symbol &amp; jako text, použijte znak "<syntaxhighlight inline lang="html">&amp;</syntaxhighlight>". Po nahrazení znaku "&" (např. typ "<syntaxhighlight inline lang="html">&amp;nbsp;</syntaxhighlight>"), jehož výsledkem bude "<syntaxhighlight inline lang="html">&nbsp;</syntaxhighlight>". <span id="Other_formatting"></span> == Ostatní formáty == Kromě výše uvedeného značení formátování textu jsou zde i další odkazy na formátování: * {{ll|Help:Links}} * {{ll|Help:Lists}} * {{ll|Help:Images}} * Značení LanguageConverter - viz {{ll|Writing systems/Syntax}} * Reference - viz {{ll|Extension:Cite}} * [[Special:MyLanguage/Help:Tables|Tabulky]] * {{ll|Manual:Collapsible_elements}} Další reference najdete na {{ll|Help:Contents}}. <span id="References"></span> == Poznámky pod čarou == <references/> [[Category:Help{{#translation:}}|Formatting]] sh73ne0dqkzsg2u0m9ysgoq51yt3brx Extension:WhoIsWatching 102 19817 8364347 6771223 2026-05-03T13:11:06Z SomeRandomDeveloper 18020465 Update MW requirement and remove redundant PHP requirement 8364347 wikitext text/x-wiki <languages/> {{Extension |name = Who Is Watching |status = stable |type1 = special |type2 = database |type3 = parser function |author = * [[User:Gri6507|Paul Grinberg]], * [[User:Siebrand|Siebrand Mazeland]], * [[User:MarkAHershberger|Mark Hershberger]] |image = |license = GPL-2.0-only |version = 0.13.0 |update = 2019-08-04 |mediawiki = 1.43+ |download = {{WikimediaDownload}} |readme = [https://github.com/wikimedia/mediawiki-extensions-WhoIsWatching/blob/master/README.mediawiki README.mediawiki] |changelog = |compatibility policy = master |description = Find out who is watching a particular page, and add others to watchlist for that page. |parameters= * $whoiswatching_nametype * $whoiswatching_allowaddingpeople * $whoiswatching_showifzero * $whoiswatching_showwatchingusers * $whoiswatching_maxPicklistUsers |rights = * addpagetoanywatchlist * seepagewatchers |example = [http://ec.europa.eu/eurostat/statistics-explained/index.php?title=Special:WhoIsWatching&ns=&page=Transport_accident_statistics http://ec.europa.eu/eurostat/] |phabricator = MediaWiki-extensions-WhoIsWatching }} <translate><!--T:1--> The <tvar name=1>'''WhoIsWatching'''</tvar> extension allows to find out who is watching a particular page, and add others to watchlist for that page.</translate> <translate> == Rationale == <!--T:6--> </translate> <translate><!--T:7--> Even though this notion goes against Wikipedia and Wikimedia [[w:Wikipedia:Watchlist#Privacy of watchlists|privacy policy]], some wikis may actually like to see which of its users are watching particular pages.</translate> <translate><!--T:8--> This extension provides just such an interface at the bottom of every page.</translate> <translate><!--T:9--> Additionally, this extension has an option to allow any user to add any page to any other user's watch list.</translate> <translate> == Installation == <!--T:2--> <!--T:10--> Make sure that <tvar name=1>{{ll|Extension:Echo}}</tvar> is installed as it is a prerequisite for this extension to work. </translate> {{ExtensionInstall |registration=required |localsettings = # $whoiswatching_nametype = "RealName"; # $whoiswatching_allowaddingpeople = false; # $whoiswatching_showifzero = true; # $whoiswatching_showwatchingusers = false; # $whoiswatching_maxPicklistUsers = 10; # $wgGroupPermissions['sysop']['addpagetoanywatchlist'] = true; # $wgGroupPermissions['sysop']['seepagewatchers'] = true; }} <translate> == Configuration == <!--T:3--> </translate> <translate><!--T:11--> You can simply start using the extension without changing anything else.</translate> <translate><!--T:12--> The only additional configuration that is currently possible for the extension defines how to display the names of the users watching the pages.</translate> <translate><!--T:16--> In <tvar name=1><code>SpecialWhoIsWatching.php</code></tvar>, there is</translate> <syntaxhighlight lang="php"> # Set the following to either 'UserName' or 'RealName' to change how watching users are displayed. $whoiswatching_nametype = 'RealName'; </syntaxhighlight> <translate><!--T:13--> As the comment implies, depending on the value of this variable, you can display either the real names of the watching users or their wiki usernames.</translate> <translate><!--T:17--> The reason some wiki's may want to switch over to the <tvar name=1>'UserName'</tvar> mode is if they do not require their members to have a valid real name.</translate> <translate><!--T:14--> Another configurable option in the extension is the ability to switch on/off the option to allow any user to add any page to any other user's watch list.</translate> <translate><!--T:15--> This is done in <tvar name=1><code>SpecialWhoIsWatching.php</code></tvar>, where there is</translate> <syntaxhighlight lang="php"> # Set true if you don't want to use permissions and users are allowed to add to other user's watchlists. $whoiswatching_allowaddingpeople = true; </syntaxhighlight> <translate><!--T:18--> It is also possible to only display the count of watching people if the count is greater than zero.</translate> <translate><!--T:19--> This is done in <tvar name=1><code>SpecialWhoIsWatching.php</code></tvar>, where there is</translate> <syntaxhighlight lang="php"> # Set to true if you want people with permission to see 0 if no one is watching the page. $whoiswatching_showifzero = true; </syntaxhighlight> <translate><!--T:20--> Finally, newer versions of this extension, while we attempt to be backward compatible, allow you to use permissions instead of global variables.</translate> <syntaxhighlight lang="php"> # Set to true if you don't want to use permissions. $whoiswatching_showwatchingusers = true; </syntaxhighlight> <translate><!--T:21--> By default, users in the sysop group have permission to see page watchers and add pages to anyone's watchlist.</translate> <translate><!--T:22--> You can grant these permissions to logged in users, too, or any group you think needs it.</translate> <syntaxhighlight lang="php"> # Give all logged in users full access. $wgGroupPermissions['user']['addpagetoanywatchlist'] = true; $wgGroupPermissions['user']['seepagewatchers'] = true; </syntaxhighlight> <translate> == Usage == <!--T:4--> </translate> {{tmpl|0=<translate><!--T:23--> This extension also provides the <tvar name=1><code>{{#whoiswatching:$1}}</code></tvar> parser function showing the number of watching users of <tvar name=2><code>$1</code></tvar> plus providing a link to <tvar name=3><code>Special:WhoIsWatching/$1</code></tvar>.</translate> |1=<translate><!--T:24--> Some Page</translate> }} <translate><!--T:25--> This can be used with skins not supporting footer links or to create the WhoIsWatching link somewhere in a wiki page.</translate> <translate> == Known issues == <!--T:5--> </translate> <translate><!--T:26--> The first time after a you submit a request to remove a page from the users watchlist, the user is still shown on the form.</translate> <translate><!--T:27--> To get around this it is disabled and displayed with a red strikethrough.</translate> {{Used by}} [[Category:Notification extensions{{#translation:}}]] [[Category:WatchArticle extensions{{#translation:}}]] [[Category:Watchlist extensions{{#translation:}}]] jrbmaq8mq02slclvpk19gunuh96y17r Extension:LookupUser 102 21280 8364790 6706965 2026-05-03T23:37:22Z SomeRandomDeveloper 18020465 Update MW requirement 8364790 wikitext text/x-wiki <languages/> {{Warning |1=<translate><!--T:1--> This extension may pose serious security and/or privacy risks!</translate> <translate><!--T:2--> Users with access to this extension can view the preferences of any other user, which is usually considered private information.</translate> <translate><!--T:3--> While this extension does not give access to account passwords, it does give access to private data such as real names, email addresses, and other information that could be easily abused.</translate> <translate><!--T:4--> Therefore, do NOT grant access to any user unless they are 100% trustworthy.</translate> <translate><!--T:5--> It is recommended that access be restricted to bureaucrats or higher groups.</translate> <translate><!--T:6--> We are not responsible for any security or privacy leaks.</translate> }} {{Extension |status=stable |image=LookupUser.png |type1=special |description=<translate><!--T:7--> Allows to retrieve information about a user such as email address and ID</translate> |username=Tim Starling |license = GPL-2.0-or-later |mediawiki=1.46+ |version=1.5.2 |update=2018-07-14 |download={{WikimediaDownload|LookupUser|phab=ELOU}} |needs-updatephp =No |hook1=ContributionsToolLinks |rights=lookupuser |phabricator=LookupUser }} <translate> <!--T:8--> The <tvar name=1>'''LookupUser'''</tvar> extension allows to retrieve information about a user such as email address, user ID and the user preferences, i.e. everything that the user has specified in their [[<tvar name=2>Special:MyLanguage/Help:Preferences</tvar>|preferences]]. </translate> <translate><!--T:9--> This extension also displays the last time a user either made a login, or any edit, which it lists as the "User record last touched:" time and date element of its log.</translate> <translate><!--T:10--> (This will be displayed as UTC even if you've set a custom time zone/the server's time zone is different.)</translate> <translate> == Installation == <!--T:11--> </translate> {{ExtensionInstall |registration=required |localsettings= // <translate nowrap><!--T:12--> Who can use <tvar name=1>Special:LookupUser</tvar>?</translate> // <translate nowrap><!--T:13--> If you want that sysops can use it:</translate> #$wgGroupPermissions['*']['lookupuser'] = false; #$wgGroupPermissions['sysop']['lookupuser'] = true; // <translate nowrap><!--T:14--> Or, do you want a new user group for this.</translate> // <translate nowrap><!--T:15--> (users with the 'userrights' right can add users to this group only bureaucrats by default)</translate> $wgGroupPermissions['*']['lookupuser'] = false; $wgGroupPermissions['lookupuser']['lookupuser'] = true; }} <translate> == Usage == <!--T:16--> <!--T:17--> The extension is accessed via the "<tvar name=1>Special:LookupUser</tvar>" page. </translate> {{Used by}} r27tu3ajgo5lwoez7w6oxhzl0ojec78 8364799 8364790 2026-05-04T00:10:16Z Shirayuki 472859 8364799 wikitext text/x-wiki <languages/> {{Warning |1=<translate><!--T:1--> This extension may pose serious security and/or privacy risks!</translate> <translate><!--T:2--> Users with access to this extension can view the preferences of any other user, which is usually considered private information.</translate> <translate><!--T:3--> While this extension does not give access to account passwords, it does give access to private data such as real names, email addresses, and other information that could be easily abused.</translate> <translate><!--T:4--> Therefore, do NOT grant access to any user unless they are 100% trustworthy.</translate> <translate><!--T:5--> It is recommended that access be restricted to bureaucrats or higher groups.</translate> <translate><!--T:6--> We are not responsible for any security or privacy leaks.</translate> }} {{Extension |status=stable |image=LookupUser.png |type1=special |description=<translate><!--T:7--> Allows to retrieve information about a user such as email address and ID</translate> |username=Tim Starling |license = GPL-2.0-or-later |mediawiki=1.46+ ([[phab:T416793]]) |version=1.5.2 |update=2018-07-14 |download={{WikimediaDownload|LookupUser|phab=ELOU}} |needs-updatephp =No |hook1=ContributionsToolLinks |rights=lookupuser |phabricator=LookupUser }} <translate> <!--T:8--> The <tvar name=1>'''LookupUser'''</tvar> extension allows to retrieve information about a user such as email address, user ID and the user preferences, i.e. everything that the user has specified in their [[<tvar name=2>Special:MyLanguage/Help:Preferences</tvar>|preferences]]. </translate> <translate><!--T:9--> This extension also displays the last time a user either made a login, or any edit, which it lists as the "User record last touched:" time and date element of its log.</translate> <translate><!--T:10--> (This will be displayed as UTC even if you've set a custom time zone/the server's time zone is different.)</translate> <translate> == Installation == <!--T:11--> </translate> {{ExtensionInstall |registration=required |localsettings= // <translate nowrap><!--T:12--> Who can use <tvar name=1>Special:LookupUser</tvar>?</translate> // <translate nowrap><!--T:13--> If you want that sysops can use it:</translate> #$wgGroupPermissions['*']['lookupuser'] = false; #$wgGroupPermissions['sysop']['lookupuser'] = true; // <translate nowrap><!--T:14--> Or, do you want a new user group for this.</translate> // <translate nowrap><!--T:15--> (users with the 'userrights' right can add users to this group only bureaucrats by default)</translate> $wgGroupPermissions['*']['lookupuser'] = false; $wgGroupPermissions['lookupuser']['lookupuser'] = true; }} <translate> == Usage == <!--T:16--> <!--T:17--> The extension is accessed via the "<tvar name=1>Special:LookupUser</tvar>" page. </translate> {{Used by}} 7uzup2k3gk6kmj93n6ofratsgevko0f Sites using MediaWiki/ar 0 24142 8364798 8339937 2026-05-04T00:00:11Z ~2026-26806-10 18367997 8364798 wikitext text/x-wiki <div dir="rtl"> <big>sexy xn</big> ''This is a list of sites that are using MediaWiki and that are written or provided in '''Arabic language'''. For wikis in more than one language (including Arabic) see the [[Sites using MediaWiki/multilingual|multilingual list]].'' ---- __NOTOC__ * Feel free to add your site to the list, but please stay close to the given format: * Please keep the description short and free of advertisement. You don't have to state that your site is "a wiki about ..."; ''all'' listed sites are wikis. * New entries will be checked. Unreachable sites or sites that don't use MediaWiki will be removed. * Last complete check: 2025-12-21 == Wikimedia Wikis == Due to the large number of Wikimedia foundation wiki's (Wikipedia, Wikiquote, Wiktionary, Wikiversity, etc), they are not included on this list. For a list of projects, see [[Sites using MediaWiki/Wikimedia]]. For the complete list with all languages, see [[Special:Sitematrix|this page]]. == ميدياويكي فى العربية == * المعرفة [https://www.marefa.org/ marefa.org] - المعرفة مشروع لجمع وخلق المحتوى العربي، لإنشاء موسوعة دقيقة، متكاملة، متنوعة، مفتوحة، محايدة ومجانية، يستطيع الجميع المساهمة في تحريرها، بالكتابة أو بالاقتباس من مصادر مرخـِصة بالنقل. بدأ المعرفة في 16 فبراير 2007 *ويكي الجندر - [https://genderiyya.xyz/wiki/%D8%A7%D9%84%D8%B5%D9%81%D8%AD%D8%A9_%D8%A7%D9%84%D8%B1%D8%A6%D9%8A%D8%B3%D9%8A%D8%A9 genderiyya.xyz] * الموسوعة التاريخية الرسمية لجماعة الإخوان المسلمين - [https://www.ikhwan.wiki/ www.ikhwan.wiki] * ويكي شيعة - [https://ar.wikishia.net/ ar.wikishia.net] [[Category:MediaWiki References|ar]] 30y9kgy9fht7i28set81ej8n9ml3xuj 8365126 8364798 2026-05-04T10:55:29Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-26806-10|~2026-26806-10]] ([[User talk:~2026-26806-10|talk]]) to last version by PieWriter 8339937 wikitext text/x-wiki <div dir="rtl">{{MediaWiki Sites/ar}} ''This is a list of sites that are using MediaWiki and that are written or provided in '''Arabic language'''. For wikis in more than one language (including Arabic) see the [[Sites using MediaWiki/multilingual|multilingual list]].'' ---- __NOTOC__ * Feel free to add your site to the list, but please stay close to the given format: * Please keep the description short and free of advertisement. You don't have to state that your site is "a wiki about ..."; ''all'' listed sites are wikis. * New entries will be checked. Unreachable sites or sites that don't use MediaWiki will be removed. * Last complete check: 2025-12-21 == Wikimedia Wikis == Due to the large number of Wikimedia foundation wiki's (Wikipedia, Wikiquote, Wiktionary, Wikiversity, etc), they are not included on this list. For a list of projects, see [[Sites using MediaWiki/Wikimedia]]. For the complete list with all languages, see [[Special:Sitematrix|this page]]. == ميدياويكي فى العربية == * المعرفة [https://www.marefa.org/ marefa.org] - المعرفة مشروع لجمع وخلق المحتوى العربي، لإنشاء موسوعة دقيقة، متكاملة، متنوعة، مفتوحة، محايدة ومجانية، يستطيع الجميع المساهمة في تحريرها، بالكتابة أو بالاقتباس من مصادر مرخـِصة بالنقل. بدأ المعرفة في 16 فبراير 2007 *ويكي الجندر - [https://genderiyya.xyz/wiki/%D8%A7%D9%84%D8%B5%D9%81%D8%AD%D8%A9_%D8%A7%D9%84%D8%B1%D8%A6%D9%8A%D8%B3%D9%8A%D8%A9 genderiyya.xyz] * الموسوعة التاريخية الرسمية لجماعة الإخوان المسلمين - [https://www.ikhwan.wiki/ www.ikhwan.wiki] * ويكي شيعة - [https://ar.wikishia.net/ ar.wikishia.net] [[Category:MediaWiki References|ar]] 2mx6uxddkx4x1dvdlbc0gm9rxw5l4rn Extension:Jmol 102 26711 8364489 8363955 2026-05-03T16:17:04Z Gota de agua 16623159 Undid revision [[Special:Diff/8363955|8363955]] by [[Special:Contributions/Gota de agua|Gota de agua]] ([[User talk:Gota de agua|talk]]) 8364489 wikitext text/x-wiki {{Extension |status = stable |type1 = tag |hook1 = ParserFirstCallInit |hook2 = BeforePageDisplay |hook3 = GetPreferences |author = [[User:NicoV|NicoV]], [[User:Jaime_Prilusky|Jaime Prilusky]], [[User:AngelHerraez|AngelHerraez]] |description = Displaying molecular models in interactive 3D (using [[:en:Jmol|JSmol HTML5 objects]]) |image = J(S)mol logo 2013.svg |imagesize = 280 |version = 6.0 |update = 2024-01-15 |mediawiki = 1.39+ |php = |license = GPL-2.0+ |download = {{SourceForgeDownload|jmol}} |readme = |changelog = |parameters = <nowiki/> * $wgJmolAuthorizeJmolFileTag * $wgJmolAuthorizeJmolPdbTag * $wgJmolAuthorizeJmolMolTag * $wgJmolAuthorizeJmolSmilesTag * $wgJmolAuthorizeJmolTag |tags = <nowiki/> * {{tag|jmol|open}} * {{tag|jmolFile|open}} * {{tag|jmolPdb|open}} * {{tag|jmolMol|open}} * {{tag|jmolSmiles|open}} |rights = |example = [http://wiki.jmol.org/index.php/MediaWiki/Extension Examples alongside the instructions] |compatibility = }} The '''Jmol''' extension allows for displaying molecular models in interactive 3D inside wiki pages using [[:en:Jmol|JSmol HTML5 objects]]. Documentation on its installation and use can be found at [https://sf.net/p/jmol/wiki/MW%20Extension/ the Jmol project pages], as well as at [https://wiki.jmol.org/index.php/MediaWiki Jmol Wiki], with full details and demonstration examples. == Usage == The Jmol extension can be used as a "custom tag" to display a 3D interactive view of a molecule or structure in a wiki page, either: * in a popup window, upon user action * in-line, inserted in the page as the page is loaded * in-line, inserted in the page upon user action === {{tag|jmolFile|open}} tag === The {{tag|jmolFile|open}} tag can be used to display in 3D a molecule or structure file that has been previously uploaded into a Wiki. :This tag may be disabled by administrators in the configuration file of the wiki, using <code>$wgJmolAuthorizeJmolFileTag = false</code> A few examples: * <syntaxhighlight lang=html inline><jmolFile>Chair.cml</jmolFile></syntaxhighlight> will put in the article a <u>''Chair.cml''</u> link. When users click on it, a popup window will display the 3D structure specified in <code>File:Chair.cml</code> * <syntaxhighlight lang=html inline><jmolFile text="chair conformation">Chair.cml</jmolFile></syntaxhighlight> will put in the article a <u>''chair conformation''</u> link. When this link is clicked on, a popup window will display the 3D structure specified in <code>File:Chair.cml</code> === {{tag|jmolSmiles|open}} tag === The {{tag|jmolSmiles|open}} tag can be used to display in 3D a molecule file using its [[:en:SMILES|SMILES]] notation. :This tag may be disabled by administrators in the configuration file of the wiki, using <code>$wgJmolAuthorizeJmolSmilesTag = false</code> A few examples: * <syntaxhighlight lang=html inline><jmolSmiles>CCCNC</jmolSmiles></syntaxhighlight> will put in the article a <u>''CCCNC''</u> link. When users click on it, a popup window will display the 3D structure that matches the SMILES string ''CCCNC'' * <syntaxhighlight lang=html inline><jmolSmiles text="smiles notation">CCCNC</jmolSmiles></syntaxhighlight> will put in the article a <u>''smiles notation''</u> link. When users click on it, a popup window will display the 3D structure that matches the SMILES string ''CCCNC'' === {{tag|jmolMol|open}} tag === The {{tag|jmolMol|open}} tag can be used to display in 3D a molecule file using its name or ID; the structure is retrieved from the [https://cactus.nci.nih.gov/chemical/structure NCI CACTUS server], or from another server defined by the wiki administrator. The contents of the tag must be some ID understood by the server. :This tag may be disabled by administrators in the configuration file of the wiki, using <code>$wgJmolAuthorizeJmolSmilesTag = false</code> A few examples: * <syntaxhighlight lang=html inline><jmolMol>isopropanol</jmolMol></syntaxhighlight> will put in the article an <u>''isopropanol''</u> link. When users click on it, a popup window will display the 3D structure of this compound. * <syntaxhighlight lang=html inline><jmolMol text="Tris base">2-Amino-2-(hydroxymethyl)propane-1,3-diol</jmolMol></syntaxhighlight> will put in the article a <u>''Tris base''</u> link. When users click on it, a popup window will display the 3D structure of the compound with IUPAC name ''2-Amino-2-(hydroxymethyl)propane-1,3-diol'' * <syntaxhighlight lang=html inline><jmolMol text="Tris base">77-86-1</jmolMol></syntaxhighlight> will put in the article a <u>''Tris base''</u> link. When users click on it, a popup window will display the 3D structure of the compound with Chemical Abstracts registry number ''77-86-1'' * <syntaxhighlight lang=html inline><jmolMol text="isopropanol">KFZMGEQAYNKOFK-UHFFFAOYSA-N</jmolMol></syntaxhighlight> will put in the article an <u>''isopropanol''</u> link. When users click on it, a popup window will display the 3D structure of the compound that matches the [https://www.inchi-trust.org/ InChIKey] ''KFZMGEQAYNKOFK-UHFFFAOYSA-N'' === {{tag|jmolPdb|open}} tag === The {{tag|jmolPdb|open}} tag can be used to display in 3D a molecule file using its [[:en:Protein Data Bank|PDB]] code. :This tag may be disabled by administrators in the configuration file of the wiki, using <code>$wgJmolAuthorizeJmolPdbTag = false</code> A few examples: * <syntaxhighlight lang=html inline><jmolPdb>1ALE</jmolPdb></syntaxhighlight> will put in the article a <u>''1ALE''</u> link. When users click on it, a popup window will display the 3D structure matching the PDB code ''1ALE''. * <syntaxhighlight lang=html inline><jmolPdb text="Partial structure of Apo-C-I">1ALE</jmolPdb></syntaxhighlight> will put in the article a <u>''Partial structure of Apo-C-I''</u> link. When this link is clicked on, a popup window will display the 3D structure matching the PDB code ''1ALE''. === {{tag|jmol|open}} tag === The {{tag|jmol|open}} tag can be used to display in 3D a molecule or structure file in several situations. Its use is more complex than the other tags, but also more flexible. It takes embedded sub-tags (2nd and 3rd level). Documentation is available in [https://sf.net/p/jmol/wiki/MW%20Extension/ the Jmol project pages] or in [http://wiki.jmol.org/index.php/MediaWiki/Extension the Extension page at the Jmol Wiki]. Briefly, these subtags are available, to either * insert a JSmol panel in the page: {{tag|jmolApplet|open}} * insert a user control that, when user acts on it, will insert the JSmol panel in place or in a pop-up window: {{tag|jmolAppletInlineButton|open}}, {{tag|jmolAppletInlineLink|open}}, {{tag|jmolAppletButton|open}}, {{tag|jmolAppletLink|open}} * insert a user control that, when user acts on it, will send Jmol commands to an existing JSmol panel: {{tag|jmolButton|open}}, {{tag|jmolLink|open}}, {{tag|jmolCheckbox|open}}, {{tag|jmolMenu|open}}, {{tag|jmolRadioGroup|open}} :This tag may be disabled by administrators in the configuration file of the wiki, using <code>$wgJmolAuthorizeJmolTag = false</code> == Installing Jmol extension == '''Note:''' Version 6 of the Jmol Extension has been tested against MediaWiki 1.39-1.43. For older installations of MediaWiki you may use previous versions of the Extension. To install the Jmol extension in your wiki, follow instructions at [https://sf.net/p/jmol/wiki/MW%20Extension/ the Jmol project pages] == Wikis using the Jmol extension == If you know a wiki using the Jmol extension, please add it to the list of [http://wiki.jmol.org/index.php/Wikis_Using_Jmol Wikis using Jmol] or report it at [https://sf.net/p/jmol/mailman/jmol-users/ the Jmol-users e-mail list]. == Troubleshooting == Please address any queries to [https://sf.net/p/jmol/mailman/jmol-developers/ the Jmol-developers e-mail list] == Weblinks == * [http://jmol.sf.net Jmol official web site] * [http://wiki.jmol.org Jmol official Wiki] * [https://sf.net/p/jmol/ Jmol project site] * [https://sf.net/p/jmol/code/HEAD/tree/trunk/Jmol-extensions/wiki/MediaWiki/ Browse extension source code] * [https://proteopedia.org/wiki/index.php/Special:Version Special:Version at Proteopedia], a MediaWiki site dedicated to display of proteins and molecules, using the Jmol Extension. [[Category:3D extensions{{#translation:}}]] ho4lz04i8iefk45b6qh51o1tyhs854n Help:Extension:ParserFunctions 12 33533 8364910 8353747 2026-05-04T05:12:56Z RogueScholar 14671222 Fix broken wikilink anchor name in lede (Reminder to all that the parser can't cover for errors in capitalizing HTML anchors like it can for page names, so don't be lazy; edit histories are forever, after all. 😛) 8364910 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <translate><!--T:1--> The <tvar name=1>{{ll|Extension:ParserFunctions|nsp=0}}</tvar> extension provides additional [[<tvar name=3>Special:MyLanguage/Parser functions</tvar>|parser functions]] to supplement those already present in MediaWiki core.</translate> <translate><!--T:2769--> (See <tvar name=1>{{ll|Help:Magic words#Parser functions}}</tvar>.)</translate> <translate><!--T:2447--> (It ''may'' be configured to provide additional parser functions for string handling; these are only available to non-Wikimedia Foundation wikis hence these string functions are documented {{<tvar name=ext-sf>ll|Extension:ParserFunctions/String functions</tvar>|elsewhere}}.)</translate> <translate><!--T:2448--> All the parser functions provided by this extension take the form:</translate> :<code><nowiki>{{</nowiki><translate><!--T:2--> '''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ... </translate><nowiki>}}</nowiki></code> == #expr == {{for|1=<translate><!--T:2711--> a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</translate>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | <translate><!--T:3--> Type</translate> ! {{hl1}} | <translate><!--T:4--> Operators</translate> |- | {{hl2}} | <translate><!--T:5--> Grouping (parentheses)</translate> | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | <translate><!--T:6--> Numbers</translate> | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | <translate><!--T:7--> binary operator</translate> <code>'''e'''</code> &nbsp; <translate><!--T:8--> unary</translate> <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | <translate><!--T:9--> Unary</translate> | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | <translate><!--T:10--> Binary</translate> | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | <translate><!--T:11--> Round</translate> | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | <translate><!--T:12--> Logic</translate> | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} <translate><!--T:13--> This function evaluates a mathematical expression and returns the calculated value.</translate> <translate><!--T:2418--> This function is also available in <tvar name=1>{{ll|Extension:Scribunto|nsp=0}}</tvar> via the <tvar name=expr><code>mw.ext.ParserFunctions.expr</code></tvar> function.</translate> :<code><nowiki>{{#expr:</nowiki> ''<translate><!--T:14--> expression</translate>'' <nowiki>}}</nowiki></code> <translate><!--T:2747--> Basic example</translate> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <translate><!--T:15--> The available operators are listed to the right, in order of precedence. See <tvar name=1>{{ll|Manual:Expr parser function syntax}}</tvar> for more details of the function of each operator.</translate> <translate><!--T:2710--> The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</translate> <translate> <!--T:16--> When evaluating using [[w:boolean algebra|boolean algebra]], zero evaluates to <tvar name=1>{{phpi|false}}</tvar>, and any nonzero value, positive or negative, evaluates to <tvar name=2>{{phpi|true}}</tvar>: </translate> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' <translate> <!--T:17--> An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <tvar name=iferror><code>[[##iferror|#iferror]]</code></tvar> function: </translate> :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <translate> <!--T:18--> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </translate> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <translate><!--T:19--> Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</translate> <translate><!--T:2674--> For example, <tvar name=1><nowiki>{{NUMBEROFUSERS}}</nowiki></tvar> results in <tvar name=2>{{NUMBEROFUSERS}}</tvar>, where we want <tvar name=3>{{formatnum:{{NUMBEROFUSERS}}|R}}</tvar>, which can be obtained using <tvar name=4><code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code></tvar>.</translate> <translate><!--T:2675--> This is especially important in some languages, where numerals are translated.</translate> <translate><!--T:2676--> For example, in Bengali, <tvar name=1><nowiki>{{NUMBEROFUSERS}}</nowiki></tvar> produces <tvar name=bengali>৩০,০৬১</tvar>.</translate> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<translate><!--T:20--> The operator <tvar name=mod><code>mod</code></tvar> gives wrong results for some values of the second argument:</translate> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <translate><!--T:21--> (produces an empty string; should be 123)</translate><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<translate><!--T:84--> If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <tvar name=time><nowiki>{{#time: xNU }}</nowiki></tvar>, then you can simply add and subtract dates as numbers.</translate>}} <translate> === Rounding === <!--T:22--> <!--T:23--> [<tvar name=php>https://php.net/function.round</tvar> Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. <!--T:24--> To round up or down use unary <tvar name=ceil><code>ceil</code></tvar> or <tvar name=floor><code>floor</code></tvar> respectively. </translate> {| class="wikitable" ! {{hl1}} | <translate><!--T:25--> Test case</translate> ! {{hl1}} | <translate><!--T:26--> Result</translate> ! {{hl1}} | <translate><!--T:27--> Method of rounding</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || <translate><!--T:28--> Final digit is < 5, so no apparent rounding occurs</translate> (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <translate><!--T:29--> Final digit is ≥ 5, so it is rounded up</translate> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <translate><!--T:30--> Again, the result is rounded up on the last digit, which results in additional rounding</translate> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <translate><!--T:31--> Rounded to nearest 100 because negative values round to the left of the decimal point</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <translate><!--T:32--> Rounded to nearest 100th because positive values round to the right of the decimal point</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <translate><!--T:33--> Decimals in the rounding index make no difference in the rounded result</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <translate><!--T:34--> Decimal portion truncated (chopped off)</translate> |- ! colspan=3 {{hl2}} | <translate><!--T:35--> Rounding to the nearest integer</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <translate><!--T:36--> Down to the ''nearest'' integer, which is zero</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <translate><!--T:37--> Up to the nearest integer, which is one</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <translate><!--T:38--> Up to the nearest integer, which is one</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <translate><!--T:39--> Up to the nearest integer, which is zero</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <translate><!--T:41--> Down to the nearest integer, which is negative one</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <translate><!--T:42--> Down to the nearest integer, which is negative one</translate> |- ! colspan=3 {{hl2}} | <translate><!--T:43--> Rounding up or down with ''ceil'' and ''floor''</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <translate><!--T:44--> Up to the next ''larger'' integer, which is one</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <translate><!--T:45--> Down to the next ''smaller'' integer, which is zero</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <translate><!--T:46--> Up to the next larger integer, which is zero</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <translate><!--T:48--> Down to the next smaller integer, which is negative one</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <translate><!--T:49--> Not rounded, since 1 already is an integer</translate><br />{{Warning|1=<translate><!--T:50--> Interpreted as <tvar name=ceil1>'''(ceil''' 1''')'''/3</tvar>, not <tvar name=ceil2>'''ceil('''1/3''')'''</tvar>, as you might expect</translate>}} |- ! colspan=3 {{hl2}} | <translate><!--T:2770--> Rounding large numbers</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <translate><!--T:2739--> Rounding to a very large number leads to infinity.</translate> <translate><!--T:2740--> Hence, the original value without the infinity is given as the answer.</translate> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <translate><!--T:2741--> Same as above.</translate> |} <translate> === Strings === <!--T:2419--> <!--T:2420--> Expressions only work with number-like values, they cannot compare strings or characters. <tvar name=ifeq>[[#ifeq]]</tvar> can be used instead. </translate> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <translate> <!--T:51--> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </translate> :<syntaxhighlight lang="wikitext" inline>{{#if: <translate nowrap><!--T:52--> test string</translate> | <translate nowrap><!--T:53--> value if test string is not empty</translate> | <translate nowrap><!--T:54--> value if test string is empty (or only white space)</translate>}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: <translate nowrap><!--T:55--> first parameter</translate> | <translate nowrap><!--T:56--> second parameter</translate> | <translate nowrap><!--T:57--> third parameter</translate> }}</syntaxhighlight> <translate> <!--T:58--> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </translate> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <translate> <!--T:59--> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see <tvar name=1>[[##ifexpr|#ifexpr]]</tvar> for that): </translate> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <translate> <!--T:60--> The last parameter (false) may be omitted: </translate> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <translate><!--T:61--> The function may be nested. To do so, nest the inner <tvar name=1><code>#if</code></tvar> function in its full form in place of a parameter of the enclosing <tvar name=1><code>#if</code></tvar> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</translate> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:<translate nowrap><!--T:2661--> test string</translate> | <translate nowrap><!--T:2662--> value if test string is not empty</translate> |{{#if:<translate nowrap><!--T:2689--> test string</translate> |<translate nowrap><!--T:2690--> value if test string is not empty</translate> |<translate nowrap><!--T:2663--> value if test string is empty (or only white space)</translate> }} }} </syntaxhighlight> <translate><!--T:2373--> You can also use a parameter as the test string in your <tvar name=2><code>#if</code></tvar> statement.</translate> <translate><!--T:2775--> You need to ensure you add the <tvar name=1><code>|</code></tvar> (pipe symbol) after the name of the variable.</translate> <translate><!--T:2463--> (So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<tvar name=1><code><nowiki>{{{1}}}</nowiki></code></tvar>".)</translate> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<translate><!--T:2374--> You entered text in variable 1</translate> |2=<translate><!--T:2655--> There is no text in variable 1</translate> }} <translate> <!--T:62--> See <tvar name=1>{{ll|Help:Parser functions in templates}}</tvar> for more examples of this parser function. </translate> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <translate><!--T:63--> This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</translate> <translate><!--T:2558--> If more comparisons and output strings are required, consider using <tvar name=switch><code>#switch</code></tvar>.</translate> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <translate> <!--T:64--> If both strings are valid numerical values, the strings are compared numerically: </translate> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <translate> <!--T:65--> Otherwise, the comparison is made as text; this comparison is case-sensitive: </translate> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<translate><!--T:66--> (compare to similar example above, without the quotes)</translate>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<translate><!--T:67--> (compare to similar example above, with <tvar name=expr><code>[[##expr|#expr]]</code></tvar> returning a valid number first)</translate>'' <translate><!--T:68--> As a practical example, consider an existing {{<tvar name=help-templates>ll|Help:Templates</tvar>|template}} <tvar name=1><code>Template:Timer</code></tvar> using the parser to choose between two standard times, short and long.</translate> <translate><!--T:2559--> It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</translate> <translate><!--T:2560--> The template code is defined as:</translate> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <translate> <!--T:69--> the following ensue: </translate> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<translate><!--T:73--> When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{<tvar name=1>ll|Strip marker</tvar>|a unique code}}. This affects comparisons:</translate> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <translate> <!--T:74--> If the strings to be compared are given as equal calls to the same {{<tvar name=templates>ll|Help:Templates</tvar>|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false.</translate> }} {{Warning|1=<translate><!--T:2413--> Literal comparisons to {{<tvar name=magic>ll|Help:Magic words#Page names</tvar>|page-name magic words}} may fail depending on site configuration.</translate> <translate><!--T:2421--> For example, <tvar name=fullpagename><nowiki>{{FULLPAGENAME}}</nowiki></tvar>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</translate> <translate> <!--T:2572--> To work around this, apply the magic word to both parameters: </translate> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <translate> <!--T:75--> This function takes an input string and returns one of two results; the function evaluates to <tvar name=true><code>true</code></tvar> if the input string contains an HTML object with <tvar name=error><code>class="error"</code></tvar>, as generated by other parser functions such as <tvar name=expr><code>[[##expr|#expr]]</code></tvar>, <tvar name=time><code>[[##time|#time]]</code></tvar> and <tvar name=rel2abs><code>[[##rel2abs|#rel2abs]]</code></tvar>, [[<tvar name=templates>Special:MyLanguage/Help:Templates</tvar>|template]] errors such as loops and recursions, and other "failsoft" parser errors. </translate> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <translate><!--T:76--> One or both of the return strings can be omitted.</translate> <translate><!--T:2771--> If the <tvar name=1><code>correct</code></tvar> string is omitted, the <tvar name=2><code>test string</code></tvar> is returned if it is not erroneous.</translate> <translate><!--T:2772--> If the <tvar name=3><code>error</code></tvar> string is also omitted, an empty string is returned on an error:</translate> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <translate><!--T:2682--> Some errors may cause a tracking category to be added, using <tvar name=1><code><nowiki>{{#iferror:}}</nowiki></code></tvar> will not suppress the addition of the category.</translate> == #ifexpr == <translate> <!--T:77--> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </translate> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <translate> <!--T:78--> The <tvar name=1><code>expression</code></tvar> input is evaluated exactly as for <tvar name=expr><code>[[##expr|#expr]]</code></tvar> above, with the same operators being available. The output is then evaluated as a boolean expression. <!--T:79--> An empty input expression evaluates to <tvar name=false>{{phpi|false}}</tvar>: </translate> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <translate> <!--T:80--> As mentioned above, zero evaluates to <tvar name=false>{{phpi|false}}</tvar> and any nonzero value evaluates to <tvar name=true>{{phpi|true}}</tvar>, so this function is equivalent to one using <tvar name=ifeq><code>[[##ifeq|#ifeq]]</code></tvar> and <tvar name=expr><code>[[##expr|#expr]]</code></tvar> only: </translate> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <translate> <!--T:81--> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <tvar name=1><code>value if true</code></tvar>). </translate> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <translate> <!--T:82--> comparing </translate> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <translate> <!--T:83--> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </translate> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <translate><!--T:2683--> Boolean operators of equality or inequality operators are supported.</translate> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<translate><!--T:70--> The results of numerical comparisons with <tvar name=expr><code>[[##ifexpr|#ifexpr]]</code></tvar> do not always match those of <tvar name=ifeq><code>[[##ifeq|#ifeq]]</code></tvar> and <tvar name=switch><code>[[##switch|#switch]]</code></tvar>.</translate> <translate><!--T:2561--> These latter two are more accurate than <tvar name=expr><code>[[##ifexpr|#ifexpr]]</code></tvar>, and so may not return equivalent results.</translate> <translate><!--T:2562--> Consider these comparisons with the final digit changed:</translate> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <translate><!--T:71--> Because PHP used in <tvar name=ifeq><code>[[##ifeq|#ifeq]]</code></tvar> and <tvar name=switch><code>[[##switch|#switch]]</code></tvar> compares two numbers of type integer, it returns the expected result correctly.</translate> <translate><!--T:2563--> Whereas with <tvar name=expr><code>[[##ifexpr|#ifexpr]]</code></tvar> and the same numbers:</translate> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <translate><!--T:2564--> With the different digit, the result of equal is actually incorrect.</translate> <translate><!--T:72--> This behaviour in <tvar name=expr><code>[[##ifexpr|#ifexpr]]</code></tvar> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</translate><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<translate><!--T:2712--> See [[<tvar name=1>Manual:Checking for page existence</tvar>|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</translate>}} <translate> <!--T:85--> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </translate> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <translate><!--T:86--> The function evaluates to <tvar name=1>{{phpi|true}}</tvar> if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{<tvar name=help-magic>ll|Help:Magic words</tvar>|magic words}}, but no visible content), is blank, or is a {{<tvar name=help-redirects>ll|Help:Redirects</tvar>|redirect}}.</translate> <translate><!--T:2773--> Only pages that are redlinked evaluate to <tvar name=2>{{phpi|false}}</tvar>, including if the page used to exist but has been deleted.</translate> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <translate> <!--T:87--> The function evaluates to <tvar name=1>{{phpi|true}}</tvar> for {{<tvar name=system>ll|Help:System message</tvar>|system messages}} that have been customized, and for {{<tvar name=special>ll|Help:Special pages</tvar>|special pages}} that are defined by the software. </translate> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <translate><!--T:88--> (because the <tvar name=1>{{ll|Extension:Checkuser|nsp=0}}</tvar> extension is installed on this wiki)</translate> | '''doesn't exist''' <translate><!--T:89--> (because the <tvar name=1>{{ll|Extension:Checkuser|nsp=0}}</tvar> extension is not installed on this wiki)</translate> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <translate><!--T:90--> (because [[{{ns:8}}:Copyright]] has been customized)</translate> | '''doesn't exist''' <translate><!--T:91--> (because [[{{ns:8}}:Copyright]] has not been customized)</translate> }} <translate><!--T:92--> Prior to MediaWiki 1.45 if a page checks a target using <tvar name=ifexist><code>#ifexist:</code></tvar>, then that page will appear in the <tvar name=spec-wth>[[{{#special:WhatLinksHere}}]]</tvar> list for the target page.</translate> <translate><!--T:2768--> So if the code <tvar name=code1><code><nowiki>{{#ifexist</tvar>:Foo <tvar name=code2>}}</nowiki></code></tvar> were included live on this page (<tvar name=fullpagename1>{{FULLPAGENAME}}</tvar>), [[<tvar name=wth>{{#special:WhatLinksHere}}</tvar>/Foo]] will list <tvar name=fullpagename2>{{FULLPAGENAME}}</tvar>.</translate> <translate> <!--T:93--> On wikis using a shared media repository, <tvar name=ifexist><code>#ifexist:</code></tvar> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </translate> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <translate> <!--T:94--> If a local description page has been created for the file, the result is '''exists''' for all of the above. <!--T:95--> <tvar name=ifexist><code>#ifexist:</code></tvar> does not work with interwiki links. === ifexist limits === <!--T:96--> </translate> <translate><!--T:263--> <tvar name=1><code>#ifexist:</code></tvar> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</translate> <translate><!--T:2668--> When this limit is exceeded, any further <tvar name=1><code>#ifexist:</code></tvar> functions automatically return false, whether the target page exists or not, and the page is categorized into <tvar name=2>[[:Category:{{MediaWiki:expensive-parserfunction-category}}]]</tvar>.</translate> <translate><!--T:2669--> The name of the {{<tvar name=1>ll|Help:Tracking categories</tvar>|tracking category}} may vary depending on the content language of your wiki.</translate> <translate><!--T:97--> For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <tvar name=1><code>a.new</code></tvar> (to select links to nonexistent pages) or <tvar name=2><code>a:not(.new)</code></tvar> (to select links to existing pages).</translate> <translate><!--T:2670--> Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <tvar name=1><code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code></tvar>, one can also increase the limit in <tvar name=2>LocalSettings.php</tvar> if needed.</translate> <translate> === ifexist and wanted pages === <!--T:2455--> </translate> <translate><!--T:2456--> Prior to MediaWiki 1.45, a page that does not exist and is tested for using <tvar name=1>#ifexist</tvar> will end up on the [[<tvar name=2>Special:MyLanguage/Manual:WantedPages</tvar>|Wanted Pages]].</translate> <translate><!--T:2648--> See <tvar name=1>{{phab|T14019}}</tvar> for the reason, and [[w:Template:Linkless exists]] for a workaround.</translate> == #rel2abs == <translate> <!--T:98--> This function converts a relative file path into an absolute filepath. </translate> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <translate> <!--T:99--> Within the <tvar name=1><code>path</code></tvar> input, the following syntax is valid: </translate> *<code>.</code> → <translate><!--T:2565--> the current level</translate> *<code>..</code> → <translate><!--T:2566--> go up one level</translate> *<code>/foo</code> → <translate><!--T:2567--> go down one level into the subdirectory <tvar name=1>/foo</tvar></translate> <translate> <!--T:100--> If the <tvar name=1><code>base path</code></tvar> is not specified, the full page name of the page will be used instead: </translate> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <translate><!--T:101--> Invalid syntax, such as <tvar name=code1><code>/.</code></tvar> or <tvar name=code2><code>/./</code></tvar>, is ignored.</translate> <translate><!--T:2462--> Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</translate> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <translate><!--T:2672--> For a similar group of functions see also [[<tvar name=1>Special:MyLanguage/Help:Magic words#URL data</tvar>|Help:Magic words#URL data]].</translate> <translate><!--T:2673--> Built-in parser functions include: <tvar name=1>'localurl:', 'fullurl:', 'anchorencode:'</tvar> etc.</translate> == #switch == ''<translate><!--T:2649--> See also:</translate> [[w:Help:Switch parser function]]'' <translate> <!--T:102--> This function compares one input value against several test cases, returning an associated string if a match is found. </translate> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} <translate> <!--T:103--> Examples: </translate> :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <translate> <!--T:104--> <tvar name=1><nowiki>#</nowiki>switch</tvar> with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. === Default === <!--T:318--> <!--T:105--> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </translate> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <translate><!--T:106--> In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <tvar name=1><code><nowiki>{{}}</nowiki></code></tvar>).</translate> <translate><!--T:2464--> If it does, it will be treated as a case comparison, and no text will display if no cases match.</translate> <translate><!--T:2465--> This is because the default value has not been defined (is empty).</translate> <translate><!--T:2466--> If a case matches however, its associated string will be returned.</translate> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <translate> <!--T:107--> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </translate> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <translate> <!--T:108--> Default results declared in this way may be placed anywhere within the function: </translate> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <translate> <!--T:109--> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </translate> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <translate> === Grouping results === <!--T:319--> <!--T:110--> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </translate> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <translate><!--T:111--> Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</translate> <translate><!--T:2467--> The "<tvar name=1><code>#default = </code></tvar>" in the last parameter may be omitted in the above case.</translate> <translate> === Use with parameters === <!--T:2476--> </translate> <translate><!--T:2477--> The function may be used with parameters as the test string.</translate> <translate><!--T:2478--> In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<tvar name=1><code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code></tvar>".</translate> (<translate><!--T:2479--> This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</translate> <translate><!--T:2480--> See <tvar name=1>{{ll|Help:Parser functions in templates}}</tvar>.</translate>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <translate><!--T:2481--> In the above case, if <tvar name=1><code><nowiki>{{{1}}}</nowiki></code></tvar> equals <tvar name=2><code>foo</code></tvar>, the function will return <tvar name=3><code>Foo</code></tvar>.</translate> <translate><!--T:2482--> If it equals <tvar name=1><code>baz</code></tvar>, the function will return <tvar name=2><code>Baz</code></tvar>.</translate> <translate><!--T:2483--> If the parameter is empty or does not exist, the function will return <tvar name=1><code>Bar</code></tvar>.</translate> <translate> <!--T:2484--> As in the section above, cases can be combined to give a single result. </translate> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <translate><!--T:2505--> Here, if <tvar name=1><code><nowiki>{{{1}}}</nowiki></code></tvar> equals <tvar name=2><code>foo</code></tvar>, <tvar name=3><code>zoo</code></tvar> or <tvar name=4><code>roo</code></tvar>, the function will return <tvar name=5><code>Foo</code></tvar>.</translate> <translate><!--T:2506--> If it equals <tvar name=1><code>baz</code></tvar>, the function will return <tvar name=2><code>Baz</code></tvar>.</translate> <translate><!--T:2507--> If the parameter is empty or does not exist, the function will return <tvar name=1><code>Bar</code></tvar>.</translate> <translate> <!--T:2508--> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </translate> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <translate> <!--T:2568--> In this case, the function returns an empty string unless <tvar name=1><code><nowiki>{{{1}}}</nowiki></code></tvar> exists and equals <tvar name=2><code>foo</code></tvar> or <tvar name=3><code>bar</code></tvar>, in which case it returns <tvar name=4><code>Foo</code></tvar> or <tvar name=5><code>Bar</code></tvar>, respectively. <!--T:2569--> This has the same effect as declaring the default result as empty. </translate> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <translate><!--T:2570--> If you decide to set a case as "<tvar name=1><code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code></tvar>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</translate> <translate><!--T:2571--> The parameter would have to exist and have a value other than the string "<tvar name=1><code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code></tvar>" to return the function's default result.</translate> :<translate><!--T:2624--> (when <tvar name=1><code><nowiki>{{{1}}}</nowiki></code></tvar> doesn't exist or is empty):</translate> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<translate><!--T:2625--> (when <tvar name=1><code><nowiki>{{{1}}}</nowiki></code></tvar> has the value "<tvar name=2><code>test</code></tvar>"):</translate> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<translate><!--T:2626--> (when <tvar name=1><code><nowiki>{{{1}}}</nowiki></code></tvar> has the value "<tvar name=2><code><nowiki>{{{1}}}</nowiki></code></tvar>"):</translate> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <translate> <!--T:2627--> In this hypothetical case, you would need to add the pipe to the parameter (<tvar name=1><code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code></tvar>). === Comparison behavior === <!--T:320--> <!--T:112--> As with <tvar name=ifeq><code>[[##ifeq|#ifeq]]</code></tvar>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </translate> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <translate> <!--T:113--> A <code>''case''</code> string may be empty: </translate> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <translate> <!--T:114--> Once a match is found, subsequent <code>''cases''</code> are ignored: </translate> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <translate> <!--T:115--> Numerical comparisons with <tvar name=switch><code>[[##switch|#switch]]</code></tvar> and <tvar name=ifeq><code>[[##ifeq|#ifeq]]</code></tvar> are not equivalent to comparisons in expressions (see also above): </translate> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <translate> === Raw equal signs === <!--T:116--> <!--T:265--> "Case" strings cannot contain raw equals signs. To work around this, use the <tvar name=1>[[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]]</tvar> magic word, or replace equals sign with HTML code <tvar name=code2><code><nowiki>&amp;#61;</nowiki></code></tvar>. <!--T:117--> Example: </translate> {| class="wikitable" ! <translate><!--T:2658--> You type</translate> ! <translate><!--T:2659--> You get</translate> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<translate><!--T:118--> For a simple real life example of the use of this function, check [<tvar name=url>https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646</tvar> Template:NBA color]. Two complex examples can be found at <tvar name=2>{{ll|Template:Extension}}</tvar> and <tvar name=1>[[w:Template:BOTREQ]]</tvar>.</translate> }} <translate> === Replacing #ifeq === <!--T:119--> <!--T:266--> <tvar name=1><code>#switch</code></tvar> can be used to reduce [[<tvar name=help>Special:MyLanguage/Help:Expansion depth</tvar>|expansion depth]]. <!--T:120--> For example: </translate> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <translate> <!--T:121--> is equivalent to </translate> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <translate> <!--T:2458--> i.e. deep nesting, linear: </translate> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <translate> <!--T:2459--> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </translate> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <translate><!--T:122--> Code</translate> ! {{hl1}} | <translate><!--T:123--> Description</translate> ! {{hl1}} | <translate><!--T:124--> Current output <br /><small class="noprint">([<tvar name=fullurl>{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}}</tvar> Purge this page's cache] to update)</small></translate> |- ! {{hl2}} colspan="3"| <translate><!--T:125--> Year</translate> |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | <translate><!--T:126--> 4-digit year.</translate> | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | <translate><!--T:127--> 2-digit year.</translate> | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <translate><!--T:128--> 1 if it's a leap year, 0 if not.</translate> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<translate><!--T:130--> Requires PHP 5.1.0 and newer and [[rev:45208]].</translate>|group=note}} | <translate><!--T:129--> ISO-8601 year of the specified week.</translate>{{#tag:ref|<translate><!--T:131--> This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</translate>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<translate><!--T:132--> Will output literal ''o'' if note 1 not fulfilled.</translate>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| <translate><!--T:133--> Month</translate> |- | style="text-align: center;" | <code>n</code> | <translate><!--T:134--> Month index, not zero-padded.</translate> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <translate><!--T:135--> Month index, zero-padded.</translate> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <translate><!--T:136--> An abbreviation of the month name, in the site language.</translate> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <translate><!--T:137--> The full month name in the site language.</translate> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <translate><!--T:138--> Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</translate> | style="line-height: 1.6;" | <translate><!--T:139--> For Polish:</translate><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><translate><!--T:140--> (nominative)</translate><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><translate><!--T:141--> (genitive)</translate> |- ! {{hl2}} colspan="3"| <translate><!--T:144--> Day of the month or the year</translate> |- | style="text-align: center;" | <code>j</code> | <translate><!--T:145--> Day of the month, not zero-padded.</translate> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <translate><!--T:146--> Day of the month, zero-padded.</translate> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <translate><!--T:147--> Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</translate> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <translate><!--T:142--> Week and day of the week</translate> |- | style="text-align: center;" | <code>W</code> | <translate><!--T:143--> ISO 8601 week number, zero-padded.</translate> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <translate><!--T:150--> ISO 8601 day of the week (Monday = 1, Sunday = 7).</translate> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <translate><!--T:151--> Number of the day of the week (Sunday = 0, Saturday = 6).</translate> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <translate><!--T:148--> An abbreviation for the day of the week. Rarely internationalized.</translate> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <translate><!--T:149--> The full weekday name. Rarely internationalized.</translate> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| <translate><!--T:152--> Hour</translate> |- | style="text-align: center;" | <code>a</code> | <translate><!--T:153--> "am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</translate> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <translate><!--T:154--> Uppercase version of <tvar name=1><code>a</code></tvar> above.</translate> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <translate><!--T:155--> Hour in 12-hour format, not zero-padded.</translate> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <translate><!--T:156--> Hour in 12-hour format, zero-padded.</translate> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <translate><!--T:157--> Hour in 24-hour format, not zero-padded.</translate> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <translate><!--T:158--> Hour in 24-hour format, zero-padded.</translate> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| <translate><!--T:159--> Minutes and seconds</translate> |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <translate><!--T:160--> Minutes past the hour, zero-padded.</translate> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <translate><!--T:161--> Seconds past the minute, zero-padded.</translate> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <translate><!--T:2422--> [[w:Unix time|Unix time]].</translate> <translate><!--T:162--> Seconds since January 1 1970 00:00:00 GMT.</translate> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <translate><!--T:163--> Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</translate> |- | style="text-align: center;" | <code>e</code> | <translate><!--T:164--> Timezone identifier.</translate> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <translate><!--T:165--> Whether or not the date is in daylight savings time.</translate> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <translate><!--T:166--> Difference to Greenwich time (GMT)</translate> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <translate><!--T:167--> Difference to Greenwich time (GMT), with colon</translate> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <translate><!--T:168--> Timezone abbreviation.</translate> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <translate><!--T:169--> Timezone offset in seconds.</translate> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <translate><!--T:170--> Miscellaneous</translate> |- | style="text-align: center;" | <code>t</code> | <translate><!--T:171--> Number of days in the current month.</translate> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <translate><!--T:172--> ISO 8601 formatted date, equivalent to <tvar name=iso8601><code>Y-m-d"T"H:i:s+00:00</code></tvar>.</translate> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <translate><!--T:173--> [[rfc:5322|RFC 5322]] formatted date, equivalent to <tvar name=rfc5322><code>D, j M Y H:i:s +0000</code></tvar>, with weekday name and month name not internationalized.</translate> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <translate><!--T:174--> Non-Gregorian calendars</translate> |- ! {{hl3}} colspan="3" | <translate><!--T:175--> Islamic</translate> |- | style="text-align: center;" | <code>xmj</code> | <translate><!--T:176--> Day of the month.</translate> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <translate><!--T:177--> Full month name.</translate> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <translate><!--T:178--> Month index.</translate> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <translate><!--T:179--> Full year.</translate> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <translate><!--T:180--> Iranian (Jalaly)</translate> |- | style="text-align: center;" | <code>xit</code> | <translate><!--T:2423--> Number of days in the month.</translate> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <translate><!--T:2424--> Day of the year.</translate> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <translate><!--T:181--> Day of the month.</translate> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <translate><!--T:182--> Full month name.</translate> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <translate><!--T:183--> Month index.</translate> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <translate><!--T:184--> Full year.</translate> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <translate><!--T:185--> 2-digit year.</translate> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <translate><!--T:186--> Hebrew</translate> |- | style="text-align: center;" | <code>xjj</code> | <translate><!--T:187--> Day of the month.</translate> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <translate><!--T:188--> Full month name.</translate> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <translate><!--T:261--> Number of days in month.</translate> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <translate><!--T:189--> Genitive form of the month name.</translate> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <translate><!--T:190--> Month number.</translate> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <translate><!--T:191--> Full year.</translate> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <translate><!--T:192--> Thai solar</translate> |- | style="text-align: center;" | <code>xkY</code> | <translate><!--T:193--> Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</translate> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <translate><!--T:194--> Minguo/Juche year</translate> |- | style="text-align: center;" | <code>xoY</code> | <translate><!--T:195--> Full year.</translate> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <translate><!--T:196--> Japanese nengo</translate> |- | style="text-align: center;" | <code>xtY</code> | <translate><!--T:197--> Full year.</translate> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <translate><!--T:198--> Flags</translate> |- | style="text-align: center;" | <code>xn</code> | <translate><!--T:199--> Format the next numeric code as a raw ASCII number.</translate> | <translate><!--T:200--> In the Hindi language, <tvar name=time><syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight></tvar> produces <tvar name=hindi>०६, 06</tvar>.</translate> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <translate><!--T:201--> Like <tvar name=1><code>xn</code></tvar>, but as a toggled flag, which endures until the end of the string or until the next appearance of <tvar name=2><code>xN</code></tvar> in the string.</translate> |- | style="text-align: center;" | <code>xr</code> | <translate><!--T:202--> Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</translate> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <translate><!--T:203--> Format the next number as a Hebrew numeral.</translate> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <translate> <!--T:204--> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[<tvar name=magic>Special:MyLanguage/Help:Magic words#Date and time</tvar>|magic word]] <tvar name=currenttimestamp><syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight></tvar> &ndash; that is, the time the page was last rendered into HTML. </translate> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <translate><!--T:205--> The list of accepted formatting codes is given in the table to the right.</translate> <translate><!--T:2677--> Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</translate> <translate><!--T:2709--> If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</translate> <translate><!--T:2678--> There are also two ways to escape characters within the formatting string:</translate> # <translate><!--T:2679--> A backslash followed by a formatting character is interpreted as a single literal character</translate> # <translate><!--T:2680--> Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</translate> <translate> <!--T:2681--> In addition, the digraph <tvar name=1><code>xx</code></tvar> is interpreted as a single literal "<tvar name=2>x</tvar>". <!--T:2650--> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </translate> <translate><!--T:2651--> Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</translate> <translate><!--T:2652--> So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</translate> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <translate><!--T:206--> The <code>''date/time object''</code> can be in any format accepted by PHP's <tvar name=strtotime>[https://php.net/function.strtotime strtotime()]</tvar> function.</translate> <translate><!--T:2660--> Absolute (e.g. <tvar name=1><code>20 December 2000</code></tvar>), relative (e.g. <tvar name=2><code>+20 hours</code></tvar>), and combined times (e.g. <tvar name=3><code>30 July +1 year</code></tvar>) are accepted.</translate> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <translate> <!--T:207--> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </translate> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <translate> <!--T:2449--> The <tvar name=1><code>''local''</code></tvar> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. <!--T:2450--> This is a boolean parameters: its value is determined by casting the value of the argument (see the [<tvar name=url>https://php.net/language.types.boolean#language.types.boolean.casting</tvar> official PHP documentation] for details on how string are cast to boolean values). </translate> {{note|2=reminder|1=<translate><!--T:2451--> Please note that, if the variable <tvar name=1>{{phpi|$wgLocaltimezone}}</tvar> is set to <tvar name=2><code>UTC</code></tvar>, there is no difference in the output when <tvar name=3><code>local</code></tvar> is set to <tvar name=4><code>true</code></tvar> or <tvar name=5><code>false</code></tvar>.</translate>}} <translate> <!--T:2452--> See the following examples for details: </translate> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <translate> <!--T:208--> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <tvar name=1><code>@</code></tvar> symbol. </translate> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <translate> <!--T:2435--> Without the <tvar name=1><code>@</code></tvar> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </translate> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <translate><!--T:2436--> (correct)</translate> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <translate><!--T:2437--> (unsupported year format)</translate> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <translate><!--T:2438--> (correct)</translate> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <translate><!--T:2439--> (interpreted as a year with current month and day of the month)</translate> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <translate><!--T:2440--> (correct)</translate> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <translate><!--T:2441--> (interpreted as a year with current month and day of the month)</translate> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <translate><!--T:2442--> (correct)</translate> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <translate><!--T:2443--> (unsupported year format)</translate> }} {{Warning|1= <translate> <!--T:209--> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </translate> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <translate><!--T:210--> (correct, no leap year), but</translate> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <translate><!--T:211--> (wrong, even if 100 is interpreted as 2000, because that is a leap year)</translate> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <translate> <!--T:212--> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </translate> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <translate> <!--T:213--> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </translate> }} <translate> <!--T:214--> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </translate> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <translate> <!--T:215--> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </translate> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <translate><!--T:216--> Gives the start of the day, but the current day of the month and the current year.</translate> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <translate><!--T:217--> Gives the start of the day, but the current day of the year.</translate> <translate> <!--T:2646--> There's exception case of the filled day: </translate> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <translate><!--T:2647--> Gives the start of the day and the start of the month.</translate> }} <translate> <!--T:218--> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to <tvar name=1>{{rev|86805}}</tvar> in 2011 this was not the case.</ref> </translate> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <translate> <!--T:219--> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </translate> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <translate><!--T:220--> Input is treated as a time rather than a year+month code.</translate> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <translate><!--T:221--> Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</translate> <translate> <!--T:222--> The function performs a certain amount of date mathematics: </translate> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <translate><!--T:223--> The total length of the format strings of the calls of <tvar name=1><code>#time</code></tvar> is limited to 6000 characters.</translate><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <translate> ==== Time Zone issue ==== <!--T:224--> <!--T:267--> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </translate> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <translate> <!--T:225--> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </translate> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <translate> <!--T:226--> To workaround this issue, simply convert the time into minutes or seconds, like this: </translate> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <translate> <!--T:227--> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) ==== <tvar name=1>#time</tvar> format like in signatures ==== <!--T:2721--> </translate> <translate><!--T:2722--> Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[<tvar name=1>Special:MyLanguage/Help:Signatures</tvar>|signatures]] in discussions on talk pages.</translate> <translate><!--T:2723--> On an English-language wiki, it can be created with:</translate> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <translate> <!--T:228--> This function is identical to <tvar name=time><code><nowiki>{{#time: ... }}</nowiki></code></tvar> with the <tvar name=2><code>local</code></tvar> parameter set to <tvar name=3>{{phpi|true}}</tvar>, so it always uses the local time of the wiki (as set in <tvar name=1>{{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}</tvar>). <!--T:2453--> Syntax of the function is: </translate> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<translate><!--T:2454--> Please note that, if the variable <tvar name=1>{{phpi|$wgLocaltimezone}}</tvar> is set to <tvar name=2><code>UTC</code></tvar>, there is no difference in the output when <tvar name=3><code>local</code></tvar> is set to <tvar name=4>{{phpi|true}}</tvar> or <tvar name=5>{{phpi|false}}</tvar></translate>}} [[File:Time-Timel.png|thumb|<translate><!--T:2628--> Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</translate>]] <translate> <!--T:2557--> For instance, see the following examples: </translate> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<translate><!--T:2425--> Warning Example from <tvar name=no-wp>https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</tvar></translate>]] {{Warning|1= <translate> <!--T:2426--> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </translate> :<code>U</code> <translate><!--T:2427--> Unix time. Seconds since January 1 1970 00:00:00 GMT.</translate> :<code>Z</code> <translate><!--T:2428--> Timezone offset in seconds.</translate> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <translate><!--T:2748--> This function formats a date using a standard format for the selected language, as defined in <tvar name=1><code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code></tvar> (see <tvar name=2>{{Phab|T223772}}</tvar>).</translate> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<translate><!--T:2754--> ''date/time object''</translate> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<translate><!--T:2755--> ''date/time object''</translate> |2=<translate><!--T:2756--> ''format type''</translate> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<translate><!--T:2757--> ''date/time object''</translate> |2=<translate><!--T:2758--> ''format type''</translate> |3=<translate><!--T:2759--> ''language code''</translate> }} <translate> <!--T:2749--> The format of the ''date/time object'' is the same as for <tvar name=1>[[#time|#time]]</tvar>. If it is empty, the time when the page was rendered is used. <!--T:2750--> The ''format type'' may be one of: </translate> ; <code>time</code> : <translate><!--T:2751--> Only the time is shown.</translate> ; <code>date</code> : <translate><!--T:2752--> Only the date is shown.</translate> ; <code>both</code> : <translate><!--T:2753--> Both the time and date are shown.</translate> ; <code>pretty</code> : <translate><!--T:2760--> Only the date is shown, using an abbreviated format which does not include the year.</translate> <translate><!--T:2761--> Not all languages support this; if it is not supported, the "date" format is used.</translate> <translate> <!--T:2762--> If the ''format type'' is not specified, both the time and date will be show, as if <tvar name=1><code>both</code></tvar> were specified. <!--T:2763--> If the ''language code'' is not specified, the page's content language is used. <!--T:2764--> Using <tvar name=1><code>#timef</code></tvar> instead of <tvar name=2><code>#time</code></tvar> allows templates to more easily support multiple languages, since different languages have different ways to format dates. <!--T:2765--> In English, the order of the day and month is controlled by <tvar name=1>{{wg|AmericanDates}}</tvar>. <!--T:2766--> Examples: </translate> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <translate><!--T:2767--> This function is the same as <tvar name=1>[[#timef|#timef]]</tvar> except that it uses the local timezone of the wiki as configured in <tvar name=2>{{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}</tvar>.</translate> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <translate> <!--T:229--> This function separates a page title into segments based on slashes, then returns some of those segments as output. </translate> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<translate><!--T:2375--> pagename</translate> |2=<translate><!--T:2656--> number of segments to return</translate> |3=<translate><!--T:2657--> segment to start at</translate> }} <translate> <!--T:230--> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </translate> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <translate><!--T:2708--> See also <tvar name=1><nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki></tvar>.</translate> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <translate> <!--T:231--> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </translate> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <translate><!--T:232--> Strips one segment from the end of the string.</translate> <translate><!--T:2460--> See also <tvar name=1>{{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}</tvar>.</translate> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <translate><!--T:233--> Strips all 4 segments from the end of the string</translate> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <translate><!--T:234--> Strips 5 segments from the end of the string (more than exist)</translate> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <translate><!--T:235--> Returns last segment.</translate> <translate><!--T:2461--> See also <tvar name=1>{{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}</tvar>.</translate> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <translate><!--T:236--> Strips one segment from the end of the string, then returns the second segment and beyond</translate> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <translate><!--T:237--> Start copying at the second last element; strip one segment from the end of the string</translate> <translate> <!--T:2376--> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </translate> : <translate><!--T:2377--> For example, any occurrence of <tvar name=q1><code>&amp;quot;</code></tvar>, <tvar name=q2><code>&amp;#34;</code></tvar>, or <tvar name=q3><code>&amp;#x22;</code></tvar> in ''pagename'' will be replaced by <tvar name=q><code>"</code></tvar>.</translate> : <translate><!--T:2378--> No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</translate> {{tip| 1= <translate> <!--T:2379--> Some magic keywords or parser functions of MediaWiki (such as <tvar name=PAGENAME><code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code></tvar> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: <!--T:2380--> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <tvar name=PAGESINCAT><code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code></tvar>) but which are still not working properly with HTML-encoded input strings. </translate> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <translate> <!--T:2381--> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </translate> * <translate><!--T:2382--> <tvar name=code1><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight></tvar>, and <tvar name=code2><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight></tvar> are both returning <tvar name=actual><code>1</code></tvar>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</translate> * <translate><!--T:2383--> <tvar name=code1><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight></tvar>, and <tvar name=code2><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight></tvar> are both returning <tvar name=actual><code>1</code></tvar>; (the #switch parser function does perform the HTML-decoding of its input parameters).</translate> * <translate><!--T:2384--> <tvar name=code0><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight></tvar>, <tvar name=code1><syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight></tvar>, or even <tvar name=code2><syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight></tvar> will all return <tvar name=actual><code>1</code></tvar> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</translate> * <translate><!--T:2385--> <tvar name=code1><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight></tvar> will return a non-zero number, if that category contains pages or subcategories, '''but''':</translate> * <translate><!--T:2386--> <tvar name=code0><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight></tvar>, may still '''unconditionally''' return 0, just like:</translate> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <translate> <!--T:2389--> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </translate> * <translate><!--T:2390--> <tvar name=code0><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight></tvar>, or even <tvar name=code1><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight></tvar> ''may'' return the actually HTML-encoded string <tvar name=actual><code>Category:Côte-d&apos;Or</code></tvar> and not the expected <tvar name=expected><code>Category:Côte-d'Or</code></tvar>, and that:</translate> * <translate><!--T:2391--> <tvar name=code1><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight></tvar> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</translate> <translate> <!--T:2392--> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </translate> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <translate><!--T:2395--> <tvar name=code0><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight></tvar>, that all return the actual number of pages in the same category.</translate> }} <translate> <!--T:2396--> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </translate> # <translate><!--T:2371--> All underscores are automatically replaced with spaces:</translate> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <translate><!--T:2372--> Not <tvar name=1>bah_boo</tvar>, despite the underscore in the original.</translate> # <translate><!--T:238--> The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</translate> <translate><!--T:2671--> The string is also limited to 255 characters, as it is treated as a [[<tvar name=1>Special:MyLanguage/Manual:Page table#Schema summary</tvar>|page title]]:</translate> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <translate><!--T:239--> If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</translate> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <translate><!--T:2398--> Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</translate> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <translate> <!--T:240--> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </translate> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <translate> <!--T:241--> If lower case is needed, use lc: function to control output: </translate> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <translate> <!--T:242--> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <tvar name=2><code>2</code></tvar> instead of <tvar name=p1><code>1</code></tvar> for ''first segment to return'': </translate> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <translate><!--T:243--> Certain characters that are {{<tvar name=1>ll|Manual:Page title#Naming restrictions</tvar>|illegal in a page title}} will cause #titleparts to not parse the string:</translate> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <translate><!--T:244--> Does not produce the expected:</translate> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <translate><!--T:2399--> Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</translate> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <translate><!--T:2410--> Does not work because "#" is also illegal in page titles.</translate> }} {{Warning|1= <translate> <!--T:2429--> If any part of the title is just "<tvar name=1><code>.</code></tvar>" or "<tvar name=2><code>..</code></tvar>", #titleparts will not parse the string: </translate> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <translate><!--T:2430--> The whole string is returned. It does not produce the expected:</translate> '''one''' }} {{Warning|1= <translate><!--T:245--> This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</translate> }} <translate> == String functions == <!--T:2468--> </translate> {{Main|Extension:ParserFunctions/String functions}} <translate><!--T:2696--> The ParserFunctions extension optionally defines various string functions if <tvar name=2><code>$wgPFEnableStringFunctions</code></tvar> is set to <tvar name=3>{{phpi|true}}</tvar>:</translate> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <translate><!--T:2702--> See the dedicated subpage for documentation, and <tvar name=2>{{ll|Manual:Performing string operations with parser functions}}</tvar> for examples.</translate> {{Warning |1=<translate><!--T:2697--> In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see <tvar name=1>[[phab:T8455]]</tvar> for some history).</translate> '''<translate><!--T:2698--> These functions do <strong>NOT</strong> work on Wikimedia wikis!</translate>'''<br/><br/><translate><!--T:2699--> If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses <tvar name=1>{{ll|Extension:Scribunto|Lua}}</tvar>.</translate> <translate><!--T:2700--> For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</translate> <translate><!--T:2701--> There are also individual [[w:Template:String-handling templates|String-handling templates]].</translate> }} <translate><!--T:2703--> Here is a short overview of <tvar name=1>[[Module:String]]</tvar> functions:</translate> * [[w:Module:String#len|&#35;len]] <translate><!--T:2704--> (length of string)</translate>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <translate><!--T:2705--> (substring)</translate>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <translate><!--T:2706--> (position of target)</translate>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <translate><!--T:2707--> (repeat)</translate>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <translate> == General points == <!--T:269--> === Substitution === <!--T:270--> <!--T:271--> Parser functions can be [[<tvar name=help>Special:MyLanguage/Help:Substitution</tvar>|substituted]] by prefixing the hash character with <tvar name=subst><code>'''subst:'''</code></tvar>: </translate> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <translate><!--T:247--> the code <tvar name=1>'''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>'''</tvar> will be inserted in the wikitext since the page <tvar name=2>{{FULLPAGENAME}}</tvar> exists.</translate> {{Warning|1= <translate> <!--T:248--> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{<tvar name=magic>ll|Help:Magic words#Variables</tvar>|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]].</translate>}} <translate> <!--T:2411--> Substitution does not work within <tvar name=code1>{{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}</tvar>; you can use <tvar name=code2><code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code></tvar> for this purpose. === Redirects === <!--T:262--> <!--T:272--> Especially <tvar name=time>[[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]]</tvar> could be handy in {{<tvar name=redirects>ll|Help:Redirects</tvar>|redirects}} to pages including dates, but this does not work. === Escaping pipe characters === <!--T:249--> ==== In tables ==== <!--T:2742--> </translate> <translate><!--T:250--> Parser functions will mangle {{<tvar name=help-tables>ll|Help:Tables</tvar>|wikitable}} syntax and pipe characters (<tvar name=pipe><code><nowiki>|</nowiki></code></tvar>), treating all the raw pipe characters as parameter dividers.</translate> <translate><!--T:2664--> To avoid this, most wikis used a template <tvar name=template>[[{{ns:10}}:!]]</tvar> with its contents only a raw pipe character (<tvar name=pipe><code><nowiki>|</nowiki></code></tvar>), since MW 1.24 a {{<tvar name=help-magic>ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code></tvar> magic word}} replaced this kludge.</translate> <translate><!--T:2665--> This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</translate> <translate><!--T:2666--> It will then be interpreted as a table row or column separator.</translate> <translate><!--T:2667--> Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</translate> <translate> <!--T:251--> You can also escape the pipe character <tvar name=1>&vert;</tvar> for display as a plain, uninterpreted character using an HTML entity: <tvar name=entity><code>&amp;#124;</code></tvar> or <tvar name=2><code>&amp;vert;</code></tvar> . </translate> {| class="wikitable" ! <translate><!--T:252--> Description</translate> ! <translate><!--T:253--> You type</translate> ! <translate><!--T:254--> You get</translate> |- | <translate><!--T:255--> Escaping pipe character as table row/column separator</translate> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <translate><!--T:256--> Escaping pipe character as a plain character</translate> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <translate> ==== In template calls ==== <!--T:2743--> <!--T:2744--> The same pipe protection applies as for the following example: </translate> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <translate> <!--T:2745--> We observe that <tvar name=1>''text after''</tvar> is not displayed when the pipe <tvar name=2>|</tvar> just before <tvar name=3>''sandbox name=''</tvar> is present since <tvar name=4>''|sandbox name=''</tvar> is considered erroneously to be a parameter of template <tvar name=5>''Documentation''</tvar> at the same level as <tvar name=6>''|content=''</tvar> is. === Stripping whitespace === <!--T:257--> <!--T:258--> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </translate> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <translate><!--T:259--> To prevent the trimming of then and else parts, see <tvar name=1>[[m:Template:If]]</tvar>.</translate> <translate><!--T:2774--> Some people achieve this by using <tvar name=2><nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki></tvar> instead of spaces.</translate> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <translate> <!--T:313--> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </translate> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <translate> <!--T:315--> In this example, the <tvar name=1><code>white-space: pre</code></tvar> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. <!--T:316--> It is possible to workaround this behavior replacing whitespaces with <tvar name=1><code>&amp;#32;</code></tvar> (''breakable space'') or <tvar name=2><code>&amp;nbsp;</code></tvar> (''non-breakable space''), since they are not modified by the software: </translate> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <translate><!--T:2684--> Beware that not all parameters are created equal.</translate> <translate><!--T:2685--> In ParserFunctions, whitespace at the beginning and end is always stripped.</translate> <translate><!--T:2686--> In {{<tvar name=1>ll|Help:Templates</tvar>|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</translate> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <translate> == Other parser functions == <!--T:2724--> === Case conversion functions === <!--T:2725--> </translate> * <translate><!--T:2726--> '''Lowercase:'''</translate> {{xpdoc|lc: AbC|}} * <translate><!--T:2727--> '''Uppercase:'''</translate> {{xpdoc|uc: AbC|}} * <translate><!--T:2728--> '''Lowercase first character:'''</translate> {{xpdoc|lcfirst: AbC}} * <translate><!--T:2729--> '''Uppercase first character:'''</translate> {{xpdoc|ucfirst: abc}} <translate> === Encoding functions === <!--T:2730--> </translate> * <translate><!--T:2731--> '''URL encoding:'''</translate> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <translate><!--T:2732--> renders as</translate> ---- "{{urlencode: AbC dEf ghi}}" ---- <translate> <!--T:2733--> So inner new lines convert into %0A, and inner spaces convert into +. === Anchor encoding === <!--T:2734--> </translate> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <translate><!--T:2735--> renders as</translate> ---- {{anchorencode: AbC dEf ghi}} ---- <translate> == See also == <!--T:260--> </translate> * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <translate><!--T:2687--> an (incomplete) list of parser functions added by core and extensions.</translate> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <translate><!--T:2746--> in particular for number formatting and padding</translate> * {{ll|Manual:Template limits#Expensive parser function calls}} <translate> <!--T:2412--> * <tvar name=1>[[Module:String]]</tvar> obsoleting <tvar name=2>{{ll|Extension:StringFunctions}}</tvar> </translate> * <translate><!--T:2688--> Parser functions for Wikibase (the extensions that enables Wikidata):</translate> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<translate><!--T:2738--> How to use data on Wikimedia projects#Parser function</translate>]] <translate> == References == <!--T:2431--> </translate> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] de4y8mq2atn09xeovjm710l23lljj3r Help:Extension:ParserFunctions/fr 12 34857 8365014 8353929 2026-05-04T06:20:26Z FuzzyBot 451990 Updating to match new version of source page 8365014 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} L'extension {{ll|Extension:ParserFunctions|nsp=0}} fournit plusieurs [[Special:MyLanguage/Parser functions|fonctions d'analyse syntaxique]] qui viennent en complément de celles déjà intégrées dans MediaWiki. (Voir {{ll|Help:Magic words#Parser functions}}.) (Elle ''peut'' être configurée pour fournir des fonctions d'analyse supplémentaires pour la gestion des chaînes de caractères ; ces fonctions sur les chaînes sont documentées {{ll|Extension:ParserFunctions/String functions|ici}}.) Toutes les fonctions d'analyse fournies par cette extension ont la syntaxe suivante : :<code><nowiki>{{</nowiki>'''#nom_de_la_fonction''': ''argument 1'' | ''argument 2'' | ''argument 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=un manuel plus détaillé sur les points plus précis du fonctionnement de l'évaluateur d'expression, y compris certains opérateurs supplémentaires non couverts par le présent document|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Type ! {{hl1}} | Opérateurs |- | {{hl2}} | Regroupement (parenthèses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Nombres | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | Opérateur binaire <code>'''e'''</code> &nbsp; Opérateurs unaires <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unaires | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binaires | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arrondi | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Logiques | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Cette fonction évalue une expression mathématique, et renvoie la valeur calculée. Cette fonction est également disponible dans {{ll|Extension:Scribunto|nsp=0}} au travers de la fonction <code>mw.ext.ParserFunctions.expr</code> . :<code><nowiki>{{#expr:</nowiki> ''expression'' <nowiki>}}</nowiki></code> Exemple de base :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Les opérateurs disponibles sont listés à droite, par ordre de priorité. Voir {{ll|Manual:Expr parser function syntax}} pour plus de détails sur la fonction de chaque opérateur. La précision et le format du résultat renvoyé varient en fonction du système d'exploitation du serveur qui exécute le wiki et du format des nombres dans la langue du site. Lors de l'évaluation utilisant [[w:fr:Algèbre de Boole (logique)|l'algèbre de Boole]], zéro équivaut à {{phpi|false}} et toute autre valeur différente de zéro (positive ou négative) équivaut à {{phpi|true}} : :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' S'il n'y a aucune expression en entrée (ou une expression vide), la fonction renverra une chaîne vide. Toute expression invalide causera le renvoi du message d'erreur correspondant, que l'on peut capturer avec la fonction <code>[[##iferror|#iferror]]</code> : :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' L'ordre des opérandes d'additions et soustractions avant ou après un nombre est important, un signe mal placé peut ne pas être considéré comme une erreur mais comme l'indicateur que le nombre est positif ou négatif : :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Notez que si vous utilisez la sortie de mots magiques, vous devez les formater en brut afin de supprimer les virgules et de traduire les chiffres. Par exemple, <nowiki>{{NUMBEROFUSERS}}</nowiki> donne {{NUMBEROFUSERS}}, où nous voulons {{formatnum:{{NUMBEROFUSERS}}|R}}, qui peut être obtenu en utilisant <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Ceci est particulièrement important dans certaines langues, où les chiffres sont traduits. Par exemple, en Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produit ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=L'opérateur <code>mod</code> donne de mauvais résultats pour certaines valeurs du deuxième argument : <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produit une chaîne vide ; devrait être 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Si vous voulez faire des calculs basés sur les dates (p. ex. tester si la date actuelle est postérieure à une date déterminée), convertissez en premier lieu la date et l'heure en nombre de secondes depuis le 1er janvier 1970 (UTC) en utilisant <nowiki>{{#time: xNU }}</nowiki> ; ensuite vous pourrez simplement ajouter et soustraire des dates comme des nombres.}} <span id="Rounding"></span> === Arrondir === [https://php.net/function.round Rounds] arrondit le nombre à sa gauche en un multiple d'une puissance de 1/10, l'exposant étant égal à la valeur tronquée du nombre donné à sa droite. Pour arrondir au supérieur ou à l'inférieur, utilisez respectivement les opérateurs unaires <code>ceil</code> et <code>floor</code>. {| class="wikitable" ! {{hl1}} | Exemple de test ! {{hl1}} | Résultat ! {{hl1}} | Méthode d'arrondi |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || Le chiffre final est < 5, pas d'arrondi apparent (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || Le chiffre final est >= 5, arrondi vers le haut (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || De nouveau, le résultat est arrondi vers le haut sur le dernier chiffre, ce qui se traduit par un arrondi supplémentaire (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arrondi aux 100 les plus proches car les valeurs négatives de l'exposant appliquent l'arrondi à la gauche de la virgule décimale |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arrondi aux 1/100 les plus proches car les valeurs positives de l'exposant appliquent l'arrondi à la droite de la virgule décimale |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Des décimales dans l'ordre d'arrondi ne donnent aucune différence dans le résultat |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Partie décimale tronquée |- ! colspan=3 {{hl2}} | Arrondi à l'entier le plus proche |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Arrondi vers le bas à l'entier ''le plus proche'', qui est zéro |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Arrondi vers le haut à l'entier le plus proche, qui est un |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Arrondi vers le haut à l'entier le plus proche, qui est un |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Arrondi vers le haut à l'entier le plus proche, qui est zéro |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Arrondi vers le bas à l'entier le plus proche, qui est moins un |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Arrondi vers le bas à l'entier le plus proche, qui est moins un |- ! colspan=3 {{hl2}} | Arrondi vers le haut ou le bas par ''ceil'' et ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Arrondi vers le ''haut'' à l'entier le plus proche, qui est un |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Arrondi vers le ''bas'' à l'entier le plus proche, qui est zéro |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Arrondi vers le haut à l'entier le plus proche, qui est zéro |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Arrondi vers le bas à l'entier le plus proche, qui est moins un |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Pas arrondi, car 1 est déjà un entier<br />{{Warning|1=Interprété comme '''(ceil''' 1''')'''/3, pas '''ceil('''1/3''')''', comme vous auriez pu le penser}} |- ! colspan=3 {{hl2}} | Arrondir des grands nombres |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | En arrondissant à un nombre très grand on arrive à l'infini. Par conséquent, la valeur initiale sans l'infini est donnée comme réponse. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Idem que ci-dessus. |} <span id="Strings"></span> === Chaînes === Les expressions ne fonctionnent qu'avec des valeurs numériques, elles ne peuvent pas comparer des chaînes ou des caractères. [[#ifeq]] doit être utilisé dans ce cas. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Cette fonction évalue une chaîne de test et détermine si elle est vide ou non. Une chaîne de test contenant seulement des espaces est considérée comme vide. :<syntaxhighlight lang="wikitext" inline>{{#if: chaîne de test | valeur si la chaîne test n'est pas vide | valeur si la chaîne test est vide (ou contient seulement des espaces)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: premier paramètre | deuxième paramètre | troisième paramètre }}</syntaxhighlight> Cette fonction teste d'abord si le premier paramètre n'est pas vide. S'il n'est pas vide, la fonction affiche le deuxième paramètre. Si le premier paramètre est vide ou ne contient que des caractères d'espacement (espaces, retour à la ligne, etc...), elle affiche le troisième paramètre. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' La chaîne test est toujours interprétée comme du texte pur, ainsi les expressions mathématiques ne sont pas évaluées (voir [[##ifexpr|#ifexpr]] pour cela) : :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' Le dernier paramètre (false) peut être omis :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' La fonction peut être imbriquée. Pour cela, écrivez la fonction <code>#if</code> interne avec son code à la place d'un paramètre de la fonction <code>#if</code> englobante. Jusqu'à sept niveaux d'imbrication sont possibles, bien que cela puisse dépendre du wiki ou d'une limite de la mémoire. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:chaîne de test | valeur si la chaîne de test n'est pas vide |{{#if:chaîne de test |valeur si la chaîne de test n'est pas vide |valeur si la chaîne de test est vide (ou contient seulement des espaces) }} }} </syntaxhighlight> <span class="mw-translate-fuzzy">Vous pouvez également utiliser un paramètre qui serait une chaîne testée dans un <code>#if</code>. Vous devez vous assurer d'ajouter le symbole $1 (barre verticale) après le nom de la variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> (De sorte que, si le paramètre n'a pas de valeur, l'évaluation rende une chaîne vide au lieu de la chaîne « <code><nowiki>{{{1}}}</nowiki></code> »). :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Vous avez saisi du texte dans la variable 1 |2=Il n'y a pas de texte dans la variable 1 }} Voir {{ll|Help:Parser functions in templates}} pour plus d'exemples de cette fonction d'analyse. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Cette fonction d’analyse compare deux chaînes d'entrée, détermine si elles sont identiques et renvoie l'une de deux chaînes en fonction du résultat. Si plus de comparaisons ou de chaînes de sortie sont nécessaires, envisagez d'utiliser <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Si les deux chaînes sont des valeurs numériques valides, les chaînes sont comparées numériquement : :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Sinon la comparaison s'effectue comme du texte ; cette comparaison est sensible à la casse : :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparer à l'exemple similaire ci-dessus, sans les guillemets (" ") )'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparer à l'exemple similaire ci-dessus, avec <code>[[##expr|#expr]]</code> renvoyant en premier un nombre valide)'' Comme exemple concret, prenons le {{ll|Help:Templates|modèle}} existant <code>Template:Timer</code> qui utilise l'analyseur pour choisir entre deux formats de temps, un format court et un format long. Il compare le premier paramètre à la chaîne « courte » (il n'y a pas de convention pour l'ordre, mais c'est plus simple à lire si le paramètre est en premier). Voici le code du modèle : :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> il en résulte ce qui suit : :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Lorsqu'elles sont utilisées à l'intérieur d'une fonction d'analyse, les balises d'analyseur et autres fonctions d'analyseur doivent être temporairement remplacées par {{ll|Strip marker|un code unique}}. Cela affecte les comparaisons : :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Si les chaînes à comparer sont données comme des appels égaux au même {{ll|Help:Templates|modèle}} contenant de telles balises, alors la condition est vraie ; mais dans le cas de deux modèles avec un contenu identique et contenant de telles balises, la condition est fausse. }} {{Warning|1=La comparaison littérale avec des {{ll|Help:Magic words#Page names|mots magiques de nom de page}} peut échouer en fonction de la configuration du site. Par exemple, <nowiki>{{FULLPAGENAME}}</nowiki>, en fonction du wiki, peut mettre la première lettre en majuscule, et remplacer tous les caractères '_' par des espaces. Pour contourner ce problème, utilisez les mots magiques pour les deux paramètres : :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Cette fonction prend une chaîne en entrée et renvoie un des deux résultats : la fonction s'évalue à <code>true</code> si la chaîne d'entrée contient un objet HTML avec <code>class="error"</code>, tel que généré par d'autres fonctions du parseur comme <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> et <code>[[##rel2abs|#rel2abs]]</code>, des erreurs de [[Special:MyLanguage/Help:Templates|modèles]] comme des boucles ou les récursions, et d'autres erreurs "douces" du parseur. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">L'une ou les deux chaînes de retour peuvent être omises. Si la chaîne $1 est omise, la chaîne $2 est renvoyée si elle n'est pas erronée. Si la chaîne $3 est aussi omise, une chaîne vide est renvoyée sur une erreur :</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Certaines erreurs peuvent entraîner l'ajout d'une catégorie de suivi, l'utilisation de <code><nowiki>{{#iferror:}}</nowiki></code> ne supprimera pas l'ajout de cette catégorie. == #ifexpr == Cette fonction évalue une expression mathématique, et renvoie une des deux chaînes selon la valeur booléenne du résultat : :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> L'entrée <code>expression</code> est évaluée exactement comme pour <code>[[##expr|#expr]]</code> plus haut, avec les mêmes opérateurs disponibles. Le résultat est alors évalué comme une expression booléenne. Une expression vide en entrée s'évalue à {{phpi|false}} : :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Comme mentionné plus haut, zéro équivaut à {{phpi|false}} et toute autre valeur est évaluée à {{phpi|true}}, ainsi cette fonction est équivalente à une autre utilisant seulement <code>[[##ifeq|#ifeq]]</code> et <code>[[##expr|#expr]]</code> : :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> sauf pour une expression d'entrée vide ou erronée (un message d'erreur est traité comme une chaîne vide ; il n'est pas égal à zéro, donc on obtient <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' à comparer à : :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' L'une, l'autre ou les deux valeurs de retour peuvent être omises ; on n'a aucune sortie quand la branche appropriée est laissée vide : :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' Les opérateurs booléens d'égalité ou les opérateurs d'inégalité sont pris en charge. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Le résultat de la comparaison numérique avec <code>[[##ifexpr|#ifexpr]]</code> ne correspond pas toujours à celui de <code>[[##ifeq|#ifeq]]</code> et <code>[[##switch|#switch]]</code>. Ces deux derniers sont plus précis que <code>[[##ifexpr|#ifexpr]]</code>, et ne renvoient pas forcément les mêmes résultats. Soit les comparaisons suivantes, où seul le dernier chiffre est différent : :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Parce que PHP, utilisé dans <code>[[##ifeq|#ifeq]]</code> et <code>[[##switch|#switch]]</code>, compare deux nombres de type entier, il renvoie le bon résultat correctement. Mais avec <code>[[##ifexpr|#ifexpr]]</code> et les mêmes nombres : :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Puisqu’un chiffre diffère, le résultat qui indique une égalité se révèle incorrect. Ce comportement de <code>[[##ifexpr|#ifexpr]]</code> vient du fait que Mediawiki convertit les nombres littéraux en type flottant, ce qui pour des entiers très grands comme ceux-ci, implique un arrondi.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=Voir [[Manual:Checking for page existence|Tester l'existence d'une page]] pour les autres méthodes permettant de savoir si une page existe avec différentes limitations}} Cette fonction prend une chaîne en entrée, l'interprète comme un titre de page, et renvoie une des deux valeurs selon que la page existe ou non sur le wiki local. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">La fonction rend {{phpi|true}} si la page existe, qu'elle ait un contenu, ou qu'elle soit visiblement vide (mais contenant des méta-données telles que des liens vers les catégories ou des {{ll|Help:Magic words|mots magiques}}, mais aucun contenu visible), ou qu'elle soit complètement vide, ou qu'il s'agisse d'une {{ll|Help:Redirects|redirection}}. Seules les pages qui ont un lien en rouge sont évaluées à $2, même si la page a existé autrefois et a été ensuite supprimée.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' La fonction s'évalue à {{phpi|true}} pour les {{ll|Help:System message|messages système}} qui ont été personnalisés, et pour les {{ll|Help:Special pages|pages spéciales}} définies par le logiciel. :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (car l'extension {{ll|Extension:Checkuser|nsp=0}} est installée sur ce wiki) | '''doesn't exist''' (car l'extension {{ll|Extension:Checkuser|nsp=0}} n'est pas installée sur ce wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (car le [[{{ns:8}}:Copyright]] a été personnalisé) | '''doesn't exist''' (car le [[{{ns:8}}:Copyright]] n'a pas été personnalisé) }} Avant MediaWiki 1.45, si une page vérifie une page cible par <code>#ifexist:</code>, alors cette page apparaîtra dans la liste [[{{#special:WhatLinksHere}}]] de la page cible. Ainsi, si les codes <code><nowiki>{{#ifexist:Foo }}</nowiki></code> ont été inclus dynamiquement dans cette page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] listera {{FULLPAGENAME}}. Sur les wikis utilisant un espace référentiel partagé de médias, <code>#ifexist:</code> peut être utilisé pour vérifier si un fichier a été téléversé dans cet espace, mais pas sur le wiki lui-même : :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' Si en local une page de description a été créée pour le fichier (média), le résultat est '''exists''' pour tous les cas ci-dessus. <code>#ifexist:</code> ne fonctionne pas avec des liens interwiki. <span id="ifexist_limits"></span> === limitations de ifexist === <code>#ifexist:</code> est considéré comme une "fonction d'analyse coûteuse" ; on ne peut en inclure qu'un nombre limité sur chaque page (en comptant les fonctions internes aux modèles transclus). Quand cette limite est dépassée, toutes les fonctions <code>#ifexist:</code> surnuméraires renverront automatiquement <code>false</code>, que la page cible existe ou non, et la page sera catégorisée dans [[:Category:{{MediaWiki:expensive-parserfunction-category}}]]. Le nom de la {{ll|Help:Tracking categories|catégorie de suivi}} peut varier en fonction de la langue du contenu de votre wiki. Pour certains cas d'utilisatiion, il est possible de reproduire l'effet de la fonction ''ifexist'' sous css, avec les sélecteurs <code>a.new</code> (pour sélectionner les liens vers les pages inexistantes) ou <code>a:not(.new)</code> (pour sélectionner les liens vers les pages existantes). De plus, puisque le nombre de fonctions coûteuses du parseur utilisables sur une page est contrôlé par <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, on peut aussi augmenter la limite dans LocalSettings.php si besoin. <span id="ifexist_and_wanted_pages"></span> === ifexist et les pages désirées === Avant MediaWiki 1.45, un lien vers une page inexistante et qui est testée par #ifexist atterrira sur les [[Special:MyLanguage/Manual:WantedPages|Pages demandées]]. Voir {{phab|T14019}} pour les raisons, et [[w:Template:Linkless exists]] pour une alternative. == #rel2abs == Cette fonction convertit un chemin relatif de fichier en chemin absolu. :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> Dans le paramètre <code>path</code>, la syntaxe suivante est valide : *<code>.</code> → le niveau courant *<code>..</code> → remonter d’un niveau *<code>/foo</code> → descendre d’un niveau dans le sous-répertoire /foo Si <code>base path</code> n'est pas renseigné, le nom complet de la page sera utilisé à la place : :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' Une syntaxe invalide, telle que <code>/.</code> ou <code>/./</code>, sera ignorée. Étant donné que seuls deux ''full stops'' consécutifs sont autorisés, les séquences de ce type peuvent être utilisées pour séparer les éléments successifs : :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' Pour un groupe similaire de fonctions, voir aussi les [[Special:MyLanguage/Help:Magic words#URL data|Données d'URL]]. Les fonctions d'analyse embarquées comprennent : 'localurl:', 'fullurl:', 'anchorencode:' etc. == #switch == ''Voir aussi : [[w:Help:Switch parser function]]'' Cette fonction compare une valeur d'entrée parmi plusieurs cas de test, et renvoie la chaîne associée si une correspondance est trouvée. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemples : :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <nowiki>#</nowiki>switch avec des balises de transclusion partielle peuvent perturber un fichier de configuration qui autorise un éditeur qui n'est pas familier avec le codage des modèles à visualiser et éditer les éléments configurables. <span id="Default"></span> === Valeurs par défaut === Le résultat par défaut (<code>''default result''</code>) est renvoyé si aucune des chaînes (<code>''case''</code>) ne correspond à la donnée à comparer (<code>''comparison string''</code>) : :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' Dans cette syntaxe, le résultat par défaut doit être le dernier paramètre et ne doit pas contenir de signe égal brut (un signe égal sans <code><nowiki>{{}}</nowiki></code>). S'il en contient un, cela sera considéré comme un cas de comparaison, et aucun texte ne sera affiché si aucun cas ne correspond. Cela vient du fait que la valeur par défaut n’a pas été définie ou qu'elle est vide. Cependant si un cas correspond, la chaîne qui lui est associée sera renvoyée. :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> Par ailleurs, la valeur par défaut peut aussi être explicitement déclarée avec une chaîne de <code>''case''</code> valant "<code>#default</code>". {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Les valeurs par défaut déclarées de cette manière peuvent être placées n'importe où dans la fonction : :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' Si le paramètre <code>''default''</code> est omis et qu'aucune valeur ne correspond à la donnée entrée, la fonction ne renvoie pas de <code>''result''</code> : :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Regrouper les résultats === Il est possible d’avoir des valeurs « communes », où plusieurs chaînes <code>''case''</code> renvoient la même chaîne <code>''résultat''</code>. Cela minimise les doublons. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Ici les valeurs <code>case2</code>, <code>case3</code> et <code>case4</code> renvoient toutes <code>''result234''</code> ; <code>case6</code> et <code>case7</code> renvoient toutes <code>''result67''</code>. Le « <code>#default = </code> » du dernier paramètre peut être omis dans l’exemple ci-dessus. <span id="Use_with_parameters"></span> === Utiliser les paramètres === La fonction peut être utilisée avec des paramètres comme chaîne de test. Dans ce cas il n'est pas nécessaire de mettre la barre verticale '|' après le nom du paramètre car il est très rare que vous choisissiez d'initialiser un cas avec la chaîne « <code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code> » . (C'est la valeur qui sera affectée par défaut au paramètre si la barre verticale '|' est absente et que le paramètre n'existe pas ou qu'il n'a pas une valeur. Voir {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> Dans le cas ci-dessus, si <code><nowiki>{{{1}}}</nowiki></code> vaut <code>foo</code>, la fonction renverra <code>Foo</code>. S'il vaut <code>baz</code>, la fonction renverra <code>Baz</code>. Si le paramètre est vide ou s'il n'existe pas, la fonction renverra <code>Bar</code>. Comme dans la section ci-dessus, les cas peuvent être combinés pour donner un seul résultat. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> Ici, si <code><nowiki>{{{1}}}</nowiki></code> vaut <code>foo</code>, <code>zoo</code> ou <code>roo</code>, la fonction renverra <code>Foo</code>. S'il vaut <code>baz</code>, la fonction renverra <code>Baz</code>. Si le paramètre est vide ou s'il n'existe pas, la fonction renverra <code>Bar</code>. De plus, le résultat par défaut peut être omis si vous ne souhaitez pas renvoyer quelque chose lorsque la valeur du paramètre à tester ne correspond à aucun des cas. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> Dans ce cas, la fonction renvoie une chaîne vide à moins que <code><nowiki>{{{1}}}</nowiki></code> existe et qu'il vaut <code>foo</code> ou <code>bar</code>, auquel cas elle renvoie respectivement <code>Foo</code> ou <code>Bar</code>. Ceci a le même effet que si on déclarait vide le résultat par défaut. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> Si pour quelque raison vous décidez d'initialiser un cas comme « <code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code> », la fonction va renvoyer le résultat de ce cas quand le paramètre n'existe pas, ou bien s'il n'a pas de valeur. Le paramètre devrait exister et avoir une valeur autre que la chaîne « <code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code> » pour renvoyer le résultat par défaut de la fonction. :(si <code><nowiki>{{{1}}}</nowiki></code> n'existe pas ou est vide) : ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(si <code><nowiki>{{{1}}}</nowiki></code> a la valeur "<code>test</code>") : ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(si <code><nowiki>{{{1}}}</nowiki></code> a la valeur "<code><nowiki>{{{1}}}</nowiki></code>") : ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' Dans cet hypothétique cas, il faudrait ajouter une barre verticale au paramètre (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). <span id="Comparison_behavior"></span> === Comportement de comparaison === Comme pour <code>[[##ifeq|#ifeq]]</code>, la comparaison est numérique si la chaîne à comparer et la chaîne du case à tester sont toutes deux numériques ; sinon c'est une comparaison de chaine sensible à la casse : :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' Une chaîne <code>''case''</code> peut être vide : :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' Une fois qu'une correspondance est trouvée avec la donnée à comparer, les <code>''valeurs''</code> suivantes sont ignorées : :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= Les comparaisons numériques avec <code>[[##switch|#switch]]</code> et <code>[[##ifeq|#ifeq]]</code> ne sont pas équivalentes aux comparaisons dans les expressions (voir aussi ci-dessus) : :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <span id="Raw_equal_signs"></span> === Signes ''égal'' bruts === Les chaînes de caractères des ''Case'' ne peuvent pas contenir de signes '=' bruts. Pour contourner ce comportement utilisez le mot magique [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]], ou remplacez les signes '=' par le code html <code><nowiki>&amp;#61;</nowiki></code>. Exemple : {| class="wikitable" ! Vous entrez ! Vous obtenez |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=Pour une utilisation simple de cette fonction en conditions réelles, regardez [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA Color]. Deux exemples complexes peuvent être trouvés sur {{ll|Template:Extension}} et [[w:Template:BOTREQ]]. }} <span id="Replacing_#ifeq"></span> === Remplacement de #ifeq === <code>#switch</code> peut être utilisé pour réduire la [[Special:MyLanguage/Help:Expansion depth|profondeur d’expansion]]. Par exemple : * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> est équivalent à : * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> c'est à dire imbriquer, en linéaire : <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> D'un autre côté, le remplacement du sélecteur pourrait être compliqué ou pas pratique pour les ''if'' imbriqués dans les deux branches (affichés avec les alternatives d'indentation, indentés de chaque côté), rendant l'arbre complètement symétrique : <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Code ! {{hl1}} | Description ! {{hl1}} | Valeur actuelle <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purger le cache de cette page] pour mettre à jour)</small> |- ! {{hl2}} colspan="3"| Année |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | année sur 4 chiffres | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | année sur 2 chiffres | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1 si c'est une année bissextile, 0 sinon. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|Nécessite PHP 5.1.0 ou plus récent et [[rev:45208]].|group=note}} | Année ISO-8601 de la semaine indiquée.{{#tag:ref|C'est la même valeur que année (Y) sauf dans le cas ou le numéro ISO de la semaine (W) fait partie de l'année précédente ou suivante, c'est cette année qui est alors utilisée.|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|Ceci affichera la lettre littérale ''o'' si la condition de la note 1 n’est pas remplie.|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mois |- | style="text-align: center;" | <code>n</code> | Numéro du mois (entre 1 et 12), sans zéro initial. | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | Numéro du mois sur deux chiffres, avec zéro initial si nécessaire (entre 01 et 12). | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | Abréviation du nom du mois, dans la langue du site. | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | Nom complet du mois, dans la langue du site. | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | Renvoie le nom complet du mois sous la forme du [[w:fr:Génitif|génitif]] pour les langues de site distinguant les formes génitif et [[w:fr:Nominatif|nominatif]]. Cette option est utile pour beaucoup de [[w:fr:Langues slaves|langues slaves]] comme le polonais, le russe, le biélorusse, le tchèque, le slovaque, le slovène, l'ukrainien, etc. | style="line-height: 1.6;" | En polonais :<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominatif)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(génitif) |- ! {{hl2}} colspan="3"| Jour du mois ou de l'année |- | style="text-align: center;" | <code>j</code> | Numéro du jour du mois, sur 1 ou 2 chiffres, entre 1 et 31, sans zéro initial. | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | Numéro du jour du mois sur 2 chiffres, entre 01 et 31, avec un zéro initial éventuel. | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | Jour de l'année entre 0 (le 1er janvier) et 365.<br />{{note}} Pour avoir le jour ISO dans l'année, ajoutez 1. | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semaine et jour de la semaine |- | style="text-align: center;" | <code>W</code> | Numéro de la semaine ISO 8601 justifié avec zéro. | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | Numéro du jour dans la semaine ISO 8601, de 1 (le lundi) à 7 (le dimanche). | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | Numéro du jour dans la semaine (de 0 pour dimanche à 6 pour samedi). | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | Une abréviation du nom du jour de la semaine. Rarement internationalisé. | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | Nom complet du jour de la semaine. Rarement internationalisé. | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Heure |- | style="text-align: center;" | <code>a</code> | « am » le matin (entre minuit et 11h 59min 59s), sinon « pm » (entre midi et 23h 59min 59s). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Version en majuscule de <code>a</code> (voir plus haut). | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Heure en format 12h, sans zéro initial. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Heure en format 12h, avec un zéro initial si inférieur à dix. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Heure en format 24h, sans zéro initial. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Heure en format 24h, avec un zéro initial si inférieur à dix. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutes et secondes |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | Minutes après l'heure, avec un zéro initial. | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | Secondes après la minute, avec un zéro initial. | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[:fr:Heure Unix|Heure Unix]]. Secondes depuis le 1<sup>er</sup> janvier 1970 à minuit (UTC). | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Zone horaire (selon [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identifiant de la zone horaire. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | Si la date est ou n'est pas à l’heure d’été. | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Différence avec l'heure de Greenwich (UTC). | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Différence avec l'heure de Greenwich (UTC), avec les deux-points | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abréviation de la zone horaire. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | Décalage du fuseau horaire en secondes. | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Divers |- | style="text-align: center;" | <code>t</code> | Nombre de jours dans le mois actuel. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | Date au format ISO 8601, équivalent à <code>Y-m-d"T"H:i:s+00:00</code>. | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | Date selon la norme [[rfc:5322|RFC 5322]], équivalent à <code>D, j M Y H:i:s +0000</code>, avec les noms du jour et du mois non internationalisés. | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendriers non-grégoriens |- ! {{hl3}} colspan="3" | Islamique |- | style="text-align: center;" | <code>xmj</code> | Numéro du jour du mois. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nom complet du mois. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Numéro du mois. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Année. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iranien (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Nombre de jours dans le mois. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Nombre de jours écoulés depuis le début de l'année. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Numéro du jour du mois. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nom complet du mois. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Numéro du mois. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Année. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Année sur deux chiffres. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hébraïque |- | style="text-align: center;" | <code>xjj</code> | Numéro du jour du mois. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nom complet du mois. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Nombre de jours dans le mois. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forme du nom de mois au génitif. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Numéro du mois. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Année complète. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Thaïlandais solaire |- | style="text-align: center;" | <code>xkY</code> | Année complète selon le [[:fr:Calendrier solaire thaïlandais|calendrier solaire thaïlandais]]. <br />{{note}} Pour les années avant 1941 les dates de l'intervalle Janvier Mars ne sont pas bien [[w:Thai_solar_calendar#New_year|calculées]]. | {{#time:xkY}} |- ! {{hl3}} colspan="3" | année Minguo/Juche |- | style="text-align: center;" | <code>xoY</code> | Année complète. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | Japonais nengo |- | style="text-align: center;" | <code>xtY</code> | Année complète. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | Drapeaux |- | style="text-align: center;" | <code>xn</code> | Formate le code numérique suivant en nombre brut ASCII. | En hindi, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produit ०६, 06. |- | style="text-align: center;" | <code>xN</code> | colspan="2" | Similaire à <code>xn</code>, mais fonctionne comme une bascule conservant son état jusqu’à la fin de chaîne de format ou jusqu’à la prochaine occurrence de <code>xN</code> dans la chaîne. |- | style="text-align: center;" | <code>xr</code> | Formate le nombre suivant comme numéral en chiffres romains. Ne fonctionne que pour les entiers positifs inférieurs à 10&nbsp;000<br /><small>(inférieurs à 3&nbsp;000 avant Mediawiki 1.20)</small>. | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | Formate le nombre suivant comme un numéral hébreu. | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} Cette fonction prend une date ou une heure (selon le calendrier grégorien) et la formate selon la syntaxe donnée. Un objet date et/ou heure peut être spécifié ; par défaut, la valeur du [[Special:MyLanguage/Help:Magic words#Date and time|mot magique]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> est utilisée &ndash; c'est-à-dire, le moment auquel la page a été transformée en HTML pour la dernière fois. :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> La liste des codes de formatage acceptés figure dans la table à droite. Tout caractère de la chaîne du format, qui n'est pas reconnu, est passé tel quel sans modification; ceci s'applique également aux espaces (pas utiles pour le système pour interpréter les codes). Si aucun caractère n'est reconnu dans la chaîne de format et que l'objet date / heure est sans erreur, alors la chaîne de format est renvoyée en sortie. Il existe également deux manières d'échapper les caractères à partir de la chaîne du format : # <span class="mw-translate-fuzzy"># Un antislash suivi d'un caractère de formatage est interprété comme une caractère littéral unique</span> # <span class="mw-translate-fuzzy"># Les caractères entre guillemets sont considérés comme des caractères littéraux et les guillemets sont supprimés.</span> De plus, le digraphe <code>xx</code> est interprété comme le littéral unique ''x''. La liste des codes de formatage continuant à évoluer (avec le support de nouveaux calendrier, ou de nouveaux champs de date calculés et formatés différemment), vous devez échapper tous les caractères littéraux (et pas seulement les lettres ASCII utilisées actuellement par les codes de formatage) devant être transmis sans être modifiés. Malheureusement, à ce jour, le caractère ASCII ''apostrophe'' n'est toujours pas reconnu comme alternative simple au caractère ASCII reconnu ''guillemet droit'' pour marquer du texte littéral (par exemple, les guillemets sont requis pour d'autres usages tels que la délimitation de valeurs de type ''string'' en JSON, C, C++... ) et caractère d'échappement <code>\</code> (qui doit être échappé dans les constantes de type string utilisées dans beaucoup de langages, notamment JSON, C, C++, PHP, JavaScript, Lua). Aussi vous ne pouvez pas mettre des guillemets sans les échapper (<code>\"</code>) (ou vous pouvez utiliser des guillemets courbes, angulaires, carrés à la place). :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' L’<code>''objet date/time''</code> peut être dans tout format accepté par la fonction [https://php.net/function.strtotime strtotime()] de PHP. Les dates absolues (ex : <code>20 December 2000</code>), relatives (ex : <code>+20 hours</code>), et combinées (ex : <code>30 July +1 year</code>) sont acceptées. :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' Le <code>''code de langue''</code> de la norme [[w:en:ISO 639-3|ISO 639-3]] (?) permet à la chaîne d’être affichée dans la langue choisie :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' Le paramètre <code>''local''</code> spécifie si l' ''objet date/heure'' référence le fuseau horaire local ou l'UTC. C'est un paramètre booléen : sa valeur est définie par un cast sur la valeur de l'argument (voir la [https://php.net/language.types.boolean#language.types.boolean.casting documentation officielle PHP] pour les détails sur la façon dont le cast est fait sur les chaînes de caractères pour en faire des valeurs booléennes). {{note|2=reminder|1=Veuillez noter que, si la variable {{phpi|$wgLocaltimezone}} est mise à <code>UTC</code>, il n'y a pas de différence dans la sortie quand <code>local</code> vaut <code>true</code> ou <code>false</code>.}} Voir les exemples suivants pour les détails : :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' Si vous avez calculé un horodatage Unix, vous pouvez l’utiliser dans les calculs de date en le préfixant avec le symbole <code>@</code>. :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= Sans le préfixe <code>@</code> avant la valeur numérique de l'horodatage, le résultat sera probablement une erreur ou une valeur inattendue. :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correct) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (format d'année non reconnu) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correct) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' (interprété comme une année, avec le mois actuel et le jour du mois) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correct) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' (interprété comme une année, avec le mois et le jour actuel) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correct) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (format d'année non reconnu) }} {{Warning|1= L’étendue des entrées acceptables est du 1er janvier 0111 au 31 décembre 9999. Le résultat est inconsistant pour les années 100 à 110; Y et les années bissextiles sont comme les années 100-110; r, D, I et U semblent interpréter ces années de la même façon que les années 2000 à 2010. :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> (correct, année non bissextile), mais :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' (faux, même si 100 est interprété comme 2000, car c’était bien une année bissextile) :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' Les années 0 à 99 sont interprétées comme 2000 à 2069 et 1970 à 1999, sauf lorsqu’elles sont écrites dans un format à 4 chiffres avec des zéros initiaux : :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) Le jour de la semaine est correctement fourni pour les années 100 à 110 et à partir de 1753; mais pour les années 111 à 1752, le format de sortie <code>r</code> produit <code>Unknown</code> et le format <code>l</code> produit <code>&lt;&gt;</code>. Par conséquent, le format de sortie <code>r</code> n'est pas accepté en entrée pour ces années. }} Des dates absolues complètes ou partielles peuvent être spécifiées ; la fonction va "remplir" les parties de la date qui ne sont pas spécifiées en utilisant les valeurs "actuelles" : :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= La fonction de remplissage n'est pas cohérente ; certaines parties sont remplies à l'aide des valeurs actuelles, d'autres ne le sont pas : :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' Donne le début du jour pour le jour actuel du mois et de l’année courante. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' Donne le début du jour pour le jour actuel de l’année. Il y a une exception pour la complétion du jour : :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' Donne le début du jour et le début du mois. }} Un nombre à quatre chiffres est toujours interprété comme une année, jamais comme des heures et des minutes :<ref>Avant {{rev|86805}} en 2011 ce n'était pas le cas.</ref> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' Un nombre à six chiffres est interprété comme heures, minutes et secondes dans la mesure du possible, sinon comme erreur (non, par exemple, comme année et mois) : :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' L'entrée est traitée comme un code de temps plutôt qu'un code d'année+mois. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' Bien que 19:60:09 ne soit pas une heure valide, 196009 n'est pas interprété comme septembre 1960. La fonction exécute un certain nombre de calculs de dates : :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' La longueur totale des chaînes de format des appels de <code>#time</code> est limitée à {{formatnum:6000}} caractères.<ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problème du fuseau horaire ==== Il y a un bogue dans cette fonction #time d'analyse de la date (plus particulièrement dans ''PHP DateTime'') qui ne permet pas de passer des nombres ''non-entiers'' pour le décalage relatif des fuseaux horaires. Ce problème n'apparait pas quand le fuseau est aligné sur une heure entière, comme EDT. Par exemple : * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} Néanmoins l'Inde a un décalage de +5,5 heures sur l'UTC, ainsi en utilisant son décalage on ne pourra pas normalement calculer correctement le décalage horaire. Voici ce qui se passe : * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} Pour contourner ce problème, convertissez simplement le temps en minutes ou en secondes comme ceci : * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} (Tim Starling, le développeur de cette fonction, a fourni la syntaxe exacte pour cette solution). <span id="#time_format_like_in_signatures"></span> ==== Format de #time comme dans les signatures ==== Il est quelques fois pratique de construire un horodatage qui ressemble à l'horodatage automatique généré par les [[Special:MyLanguage/Help:Signatures|signatures]] des commentaires sur les pages de discussion. Avec un wiki en anglais, il peut être créé avec : * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == Cette fonction est un raccouci syntaxique qui fonctionne de la même manière que <code><nowiki>{{#time: ... }}</nowiki></code> lorsque le paramètre <code>local</code> vaut {{phpi|true}}, ainsi elle utilise toujours l'heure préférée de l'utilisateur ou l'heure locale du wiki (comme défini dans {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). Le syntaxe de la fonction est la suivante : :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=Veuillez noter que, si la variable {{phpi|$wgLocaltimezone}} est mise à <code>UTC</code>, il n'y a pas de différence dans la sortie quand <code>local</code> vaut {{phpi|true}} ou {{phpi|false}}}} [[File:Time-Timel.png|thumb|Exemple d’utilisation des fonctions d’analyse #time et #timel depuis un serveur situé sur un autre fuseau horaire que UTC.]] Par exemple voir les cas suivants : :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|Exemple d'avertissement de https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid]] {{Warning|1= Remarquez que U, à la fois pour time et timel renvoie le même nombre de secondes depuis le 1er janvier 1970 00:00:00 UTC sur les Wikipedias avec des fuseaux horaires différents de UTC (anciennement connu sous le nom GMT) :<code>U</code> Temps Unix. Secondes depuis le 1er janvier 1970 00:00:00 GMT. :<code>Z</code> Décalage horaire en secondes. :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == Cette fonction formate une date en utilisant un format standard de la langue sélectionnée, tel que défini dans <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (voir {{Phab|T223772}}). : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=''objet date / temps'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=''objet date / temps'' |2=''type de format'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=''objet date / temps'' |2=''type de format'' |3=''code de langue'' }} Le format de l'''objet date/time'' est le même que pour [[#time|#time]]. S'il est vide, l'horodatage de la génération de la page est utilisé. Le ''type de format'' peut être l'un des suivants : ; <code>time</code> : Seule l'heure est affichée. ; <code>date</code> : Seule la date est affichée. ; <code>both</code> : L'heure et la date sont affichées simultanément. ; <code>pretty</code> : Seule la date est affichée, en utilisant un format abrégé qui n'inclut pas l'année. Toutes les langues ne prennent pas çela en charge ; si c'est votre cas, le format ''date'' sera utilisé. Si le ''type de format'' n'est pas spécifié, l'heure et la date seront affichées simultanément, comme si <code>both</code> était fourni. Si le ''code de la langue'' n'est pas précisé, on utilise la langue du contenu de la page. En utilisant <code>#timef</code> à la place de <code>#time</code> vous permettez aux modèles de prendre en charge plus facilement des langues différentes, car chaque langue a sa manière de formater les dates. En anglais l'ordre du jour et du mois est contrôlé par {{wg|AmericanDates}}. Exemples : :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == Cette fonction est la même que [[#timef|#timef]] sauf qu'elle utilise le fuseau horaire local du wiki tel qu'il a été configuré dans {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}. :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == Cette fonction sépare le titre d'une page en segments basés sur les barres inclinées, puis renvoie en sortie, certains de ces segments. : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nom de page |2=nombre de segments à renvoyer |3=segment où commencer }} Si le paramètre ''nombre de segments à renvoyer'' n'est pas spécifié, il vaut "0" par défaut, ce qui fait renvoyer tous les segments à partir du ''segment de début'' jusqu'au dernier (inclus). Si le paramètre ''segment initial'' n'est pas spécifié ou vaut "0", sa valeur par défaut est mise à "1" : : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Voir aussi <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' Les valeurs négatives sont acceptées pour les deux valeurs. Les valeurs négatives pour le paramètre ''nombre de segments à renvoyer'' vont effectivement 'supprimer' des segments à partir de la fin de la chaîne. Les valeurs négatives pour le ''premier segment à renvoyer'' sont traduites en "commencer avec ce segment en comptant à partir de la droite" : : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' Enlève un segment à la fin de la chaîne. Voir aussi {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' Enlève l'ensemble des quatre segments de la fin de la chaîne : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' Enlève cinq segments de la fin de la chaîne (plus qu'il n'en existe) : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' Renvoie le dernier segment. Voir aussi {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' Enlève un segment de la fin de la chaîne, puis renvoie le second segment et les suivants : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' Commence la copie au second élément en partant de la fin ; enlève un segment de la fin de la chaîne Avant traitement, le paramètre ''pagename'' est décodé au niveau HTML: s'il contient des entités caractères HTML standards, elles seront converties en caractères simples (codés en interne en UTF-8, c'est à dire avec le même encodage que les pages source de MediaWiki qui utilisent cette fonction d'analyseur). : Par exemple, toute occurence de <code>&amp;quot;</code>, <code>&amp;#34;</code>, ou <code>&amp;#x22;</code> de ''pagename'' sera remplacée par <code>"</code>. : Aucune autre conversion de HTML en texte à plat n'est réalisée, donc les balises HTML sont laissées intactes à cette étape initiale même si elles sont invalides dans le titre des pages. {{tip| 1= Certains mots-clés magiques ou fonctions d'analyseur de MediaWiki (telles que <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> et similaires) sont connues pour renvoyer des chaînes qui sont inutilement encodées HTML, même si leur propre paramètre d'entrée n'était pas encodé HTML : La fonction d'analyse des composants des titres peut alors être utilisée comme palliatif, pour convertir ces chaînes renvoyées pour qu'elles puissent être traitées correctement par d'autres fonctions d'analyse qui prennent aussi un nom de page en paramètre (comme <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) mais qui ne fonctionnent pas encore correctement avec les chaînes de caractères encodées HTML en entrée. This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. Par exemple, si la page actuelle est [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], alors : * <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, et <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> renvoient tous deux <code>1</code> ; (la fonction analyseur #ifeq réalise bien le décodage HTML de ses paramètres d'entrée). * <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, et <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> renvoient tous deux <code>1</code> ; (la fonction d'analyse #switch réalise effectivement le décodage HTML de ses paramètres d'entrée). * <syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, ou même <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> vont tous renvoyer <code>1</code> si cette page de catégorie existe (la fonction analyseur #ifexist réalise effectivement le décodage HTML de ses paramètres d'entrée) ; * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> va renvoyer un nombre différent de zéro, si cette catégorie contient des pages ou des sous-catégories, '''mais''' : * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, peut encore '''inconditionnellement''' renvoyer 0, tout comme : * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> La raison de ce comportement inattendu est que, avec les versions actuelles de MediaWiki, il existe deux mises en garde : * <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight> ou même <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''peuvent'' renvoyer la chaîne encodée en entités HTML <code>Category:Côte-d&apos;Or</code> et pas celle attendue <code>Category:Côte-d'Or</code> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> renvoie 0 '''inconditionnellement''' (le mot-clé magique PAGESINCAT ne réalise aucun décodage HTML de son paramètre d'entrée). Le palliatif simple utilisant des parties de titre (qui continuera à fonctionner si les deux mises en garde sont corrigées dans une version ultérieure de MediaWiki) est : * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, que tous renvoient le nombre actuel de pages dans la même catégorie. }} Ensuite le nom de page décodé est mis sous forme canonique dans un titre de page standard supporté par MediaWiki, au tant que possible : # Tous les soulignés sont automatiquement remplacés par des espaces : #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' Pas bah_boo, malgré le souligné figurant dans l'original. # La chaîne est divisée au maximum 25 fois ; les autres barres obliques sont ignorées et le 25<sup>ième</sup> élément va contenir le reste de la chaîne. La chaîne est aussi limitée à 255 caractères, parce qu'elle est traitée comme un [[Special:MyLanguage/Manual:Page table#Schema summary|titre de page]] : #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: Si pour une raison quelconque vous avez besoin de pousser cette fonction à ses limites, ce qui est très improbable, il est possible de dépasser la limite des 25 découpages en imbriquant les appels de fonction : #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # Finalement la première sous-chaîne est capitalisée conformément aux règles des majuscules du wiki local (si cette sous-chaîne commence aussi par un nom de l'espace de noms local, ce nom d'espace de noms est aussi normalisé). #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= Vous pouvez utiliser #titleparts comme un petit "analyseur de chaînes et convertisseur", mais prenez en compte qu'il renvoie la première sous-chaîne capitalisée : : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' S'il faut des minuscules, utilisez la fonction lc: pour contrôler la sortie : : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' Vous pouvez préfixer avec une barre inclinée 'vide' le début de la chaîne pour obtenir correctement la capitalisation de la première sous-chaîne (en majuscules ou en minuscules). Utilisez <code>2</code> au lieu de <code>1</code> pour le ''premier segment à renvoyer'': : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= Certains caractères qui sont {{ll|Manual:Page title#Naming restrictions|illégaux dans un titre de page}} feront que ''#titleparts'' n'analysera pas la chaîne : : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Ne produit pas ce qui est attendu : '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. Ne fonctionne pas parce que les accolades '{}' sont illégales dans les titres de page et que cette fonction d'analyse ne supporte pas les liens imbriqués dans ses paramètres d'entrée ''pagename'', même s'ils utilisent la syntaxe MediaWiki, ou tout autre balise HTML ou MediaWiki. : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". Ne fonctionne pas car "#" est aussi illégal dans les titres de page. }} {{Warning|1= Si une partie quelconque du titre est juste "<code>.</code>" ou "<code>..</code>", #titleparts n'analysera pas la chaîne : : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. La chaîne complète est renvoyée. Cela ne produit pas ce qui est attendu : '''one''' }} {{Warning|1= Cette fonction ne se dégrade pas correctement si l'entrée dépasse 255 octets en UTF-8. Si la chaîne d'entrée fait 256 octets ou plus, la chaîne entière est renvoyée. }} <span id="String_functions"></span> == Extension StringFunctions == {{Main|Extension:ParserFunctions/String functions}} L'extension ParserFunctions définit facultativement différentes fonctions sur les chaînes de caractères quand <code>$wgPFEnableStringFunctions</code> vaut {{phpi|true}} : * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Voir les sous-pages pour la documentation et {{ll|Manual:Performing string operations with parser functions}} pour les exemples. {{Warning |1=En 2013, il a été décidé que '''ces fonctions ''ne seront jamais'' activées sur aucun wiki Wikimedia''', car elles sont inefficaces si elles sont utilisées à grande échelle (voir [[phab:T8455]] pour l'historique). '''Ces fonctions ne sont pas opérationnelles sur les wikis Wikimedia !'''<br/><br/>Si vous êtes ici pour écrire quelque chose sur un projet Wikimedia, vous cherchez autre chose : si votre wiki d'accueil a des fonctions de chaîne de caractères, il utilise probablement {{ll|Extension:Scribunto|Lua}}. Par exemple, la Wikipedia anglaise utilise [[w:Module:String|Module:String]], qui réalise partiellement des fonctions similaires mais avec une syntaxe très différente. Il existe aussi des [[w:Template:String-handling templates|modèles de traitement de chaines de caractères]] individuels. }} Voici un bref aperçu des fonctions [[Module:String]] : * [[w:Module:String#len|&#35;len]] (longueur de la chaîne): <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] (sous-chaîne): <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] (position de la cible): <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] (répéter): <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Points généraux == === Substitution === Les fonctions d'analyseur peuvent être [[Special:MyLanguage/Help:Substitution|substituées]] en préfixant le caractère de hachage par <code>'''subst:'''</code> : :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → le code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' sera inséré dans le texte wiki car la page {{FULLPAGENAME}} existe. {{Warning|1= Les résultats des fonctions substituées d'analyse sont non-définis si les expressions contiennent du code volatile ''non''substitué tel que {{ll|Help:Magic words#Variables|variables}} ou d'autres fonctions d'analyse. Pour avoir des résultats cohérents, tout le code volatile des expressions à évaluer doit avoir été substitué. Voir [[w:Help:Substitution|Help:Substitution]].}} La substitution ne fonctionne pas à l'intérieur de {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}, vous pouvez utiliser <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> dans ce but. <span id="Redirects"></span> === Redirections === Particulièrement [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] serait pratique pour les {{ll|Help:Redirects|redirections}} vers les pages contenant des dates, mais cela ne fonctionne pas. <span id="Escaping_pipe_characters"></span> === Protection des caractères '|' (pipe) === <span id="In_tables"></span> ==== Dans les tableaux ==== Les fonction d'analyseur vont casser la syntaxe des {{ll|Help:Tables|tableaux wiki}} et des caractères pipe (<code><nowiki>|</nowiki></code>), en traitant l'ensemble des caractères pipe de la ligne comme des séparateurs de paramètres. Pour éviter cela, la plupart des wikis utilisaient un modèle [[{{ns:10}}:!]] dont le contenu n'était qu'un caractère pipe (<code><nowiki>|</nowiki></code>), depuis MW 1.24 un {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> mot magique}} a remplacé cette astuce. Ceci 'cache' le pipe à l'analyseur MediaWiki, en assurant qu'il n'est pas pris en compte tant que tous les modèles et les variables d'une page n'ont pas été expansés. Après seulement, il sera interprété comme un séparateur de rangée ou de colonne de tableau. Alternativement, la syntaxe des lignes de tableau HTML peut être utilisée, bien qu'elle reste moins intuitive et plus sujette à faire des erreurs. Vous pouvez aussi échapper le caractère &vert; pour être affiché directement, comme un caractère non interprété, en utilisant une entité HTML : <code>&amp;#124;</code> ou <code>&amp;vert;</code> . {| class="wikitable" ! Description ! Vous entrez ! Vous obtenez |- | Protection du caractère pipe en tant que séparateur de ligne/colonne de tableau | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | Protection du caractère pipe comme simple caractère | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Dans l'appel des modèles ==== La même protection du pipe s'applique à l'exemple suivant : <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> Nous observons que ''text after'' n'est pas affiché lorsque le pipe | juste avant ''sandbox name='' est présent puisque ''|sandbox name='' est à tord considéré comme un paramètre du modèle ''Documentation'' au même niveau que ''|content=''. <span id="Stripping_whitespace"></span> === Enlever les espaces === Les blancs, incluant les nouvelles lignes, les tabulations, et les espaces, sont supprimés au début et à la fin de tous les paramètres de ces fonctions d'analyse. Si cela n'est pas souhaité, la comparaison des chaînes peut être faite en les entourant avec des apostrophes. :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span class="mw-translate-fuzzy">Pour éviter le rognage des parties ''then'' et ''else'', voir [[m:Template:If]]. Certaines personnes y parviennent en utilisant $2 au lieu d'espaces.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' Cependant, cette méthode peut être utilisée pour restituer un caractère espace '''unique''', car l'analyseur remplace plusieurs caractères espace consécutifs d'une ligne par un seul. :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} Dans cet exemple, le style <code>white-space: pre</code> est utilisé pour forcer à préserver les blancs par le navigateur, mais même avec cela, les espaces ne sont pas affichées. Ceci arrive parce que les espaces sont supprimées par le logiciel, avant qu'elles ne soient envoyées au navigateur. Il est possible de contourner ce comportement en remplaçant les blancs par <code>&amp;#32;</code> (''espace sécable'') ou <code>&amp;nbsp;</code> (''espace non sécable''), parce qu'ils ne sont pas modifiés par le logiciel : :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' Attention à ne pas créer tous les paramètres avec la même valeur. Dans ParserFunctions, l'espace figurant au début et à la fin est toujours supprimé. Dans {{ll|Help:Templates|templates}}, les espaces de début et de fin sont supprimées pour les paramètres nommés et les paramètres numérotés mais ''pas'' pour les paramètres non nommés : :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Autres fonctions d'analyse == <span id="Case_conversion_functions"></span> === Fonction de conversion de la casse === * '''Mise en minuscules :''' {{xpdoc|lc: AbC|}} * '''Mise en majuscules :''' {{xpdoc|uc: AbC|}} * '''Premier caractère en minuscules :''' {{xpdoc|lcfirst: AbC}} * '''Premier caractère en majuscule :''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Fonctions d'encodage === * '''Encodage d'URL :''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> Rendu : ---- "{{urlencode: AbC dEf ghi}}" ---- Ainsi, les sauts de ligne internes sont convertis en %0A, et les espaces internes sont convertis en +. <span id="Anchor_encoding"></span> === Encodage des ancres === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> Rendu : ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Voir aussi == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – une liste (incomplète) de fonctions d'analyse ajoutées par le noyau et les extensions. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – en particulier pour le formatage des nombres et le remplissage * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] rend obsolète {{ll|Extension:StringFunctions}} * Fonctions d'analyse pour Wikibase (extensions qui activent Wikidata) : [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|Comment utiliser les données avec les fonctions d'analyse syntaxique dans les projets Wikimedia]] <span id="References"></span> ==Références== <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] 013y4xbe9barj6v4yqybex2lurpjgzt Help:Extension:ParserFunctions/es 12 37498 8365010 8353926 2026-05-04T06:20:18Z FuzzyBot 451990 Updating to match new version of source page 8365010 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} La extensión {{ll|Extension:ParserFunctions|nsp=0}} proporciona [[Special:MyLanguage/Parser functions|funciones de análisis]] adicionales para complementar las "{{$2|palabras mágicas}}", que ya están presentes en MediaWiki. (Ver {{ll|Help:Magic words#Parser functions}}.) (Es ''posible'' que sea configurado para proporcionar funciones de analizador adicionales para el manejo de cadenas; estas funciones de cadena están documentadas {{ll|Extension:ParserFunctions/String functions|elsewhere}}.) Todas las ''parser functions'' proporcionadas por esta extensión tienen la forma: :<code><nowiki>{{</nowiki>'''#functionname''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=un manual más detallado sobre los aspectos más precisos de la forma en que funciona el evaluador de expresiones, incluidos algunos operadores adicionales no incluidos en este manual|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupadores (paréntesis) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binario <code>'''e'''</code> &nbsp; unario <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unario | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binarios | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Redondeo | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta función, evalúa una expresión matemática, y devuelve el resultado. Esta función está también disponible en {{ll|Extension:Scribunto|nsp=0}} por medio de la función <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expresión'' <nowiki>}}</nowiki></code> Ejemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Los operadores disponibles están listados a continuación, en orden de preferencia. Para más información sobre la sintaxis y uso de cada operador, se puede consultar la documentación (en inglés) [[{{ll|Manual:Expr parser function syntax}}|Help:Calculation]]. La exactitud y el formato del resultado devuelto, depende del sistema operativo del servidor que ejecuta la wiki, y el formáto numérico que use el servidor La exactitud y el formato del resultado devuelto variarán dependiendo del sistema operativo del servidor que ejecuta la wiki y el formato de número del idioma del sitio. Cuando se evalúa usando [[:es:Álgebra de Boole|algebra booleana]], el cero evalúa a {{phpi|false}}, y cualquier valor diferente de cero, positivo o negativo, evalúa a {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Una expresión de entrada vacía regresa una cuerda vacía. Las expresiones nulas regresan algún mensaje de error entre muchos, los cuales pueden ser detectados utilizando el <code>[[##iferror|#iferror]]</code> función: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' El orden de los operandos de adición y de sustracción antes o después de un número es significativo y puede ser tratado como valor positivo o negativo en vez de un operando con una entrada errónea: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Tenga en cuenta que si utiliza la salida de palabras mágicas, debe formatearlas sin procesar para eliminar las comas y traducer los números. Por ejemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> da como resultado {{NUMBEROFUSERS}}, donde queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que se puede obtener usando <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Esto es especialmente importante en algunos idiomas, donde se traducen los números. Por ejemplo, en Bengalí, <nowiki>{{NUMBEROFUSERS}}</nowiki> produce ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=El operador <code>mod</code> da resultados incorrectos para algunos valores del segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (Produce una cuerda vacía; debería ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Si quieres hacer los cálculos basaron en fechas (por ej., prueba si la fecha y hora actuales están después de alguna otra fecha y hora), primero convierte el tiempo a segundos después del 1 de enero de 1970 (UTC), utilizando $tiempo, entonces sencillamente puedes añadir y restar fechas como números.}} <span id="Rounding"></span> === Redondeo === [https://php.net/function.round Rounds] del número a la izquierda a un múltiplo de 1/10 elevado a una potencia, con el exponente igual al valor truncado del número dado a la derecha. Para redondear hacia arriba o hacia abajo, use la unaria <code>ceil</code> o $piso respectivamente. {| class="wikitable" ! {{hl1}} | Caso de prueba ! {{hl1}} | Resultado ! {{hl1}} | Método de redondeo |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || El dígito final es <5, por lo que no se produce redondeo aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || El dígito final es ≥ 5, por lo que se redondea (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Nuevamente, el resultado se redondea en el último dígito, lo que resulta en un redondeo adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Redondeado a 100 aproximadamente porque los valores negativos se redondean a la izquierda del punto decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Redondeado a la centésima aproximada porque los valores positivos se redondean a la derecha del punto decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Los decimales en el índice de redondeo no hacen ninguna diferencia en el resultado redondeado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Porción decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Redondeo al entero aproximado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Abajo al entero ''aproximado'', que es cero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Hasta el entero aproximado, que es uno |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Hasta el entero aproximado, que es uno |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Hasta el entero aproximado, que es cero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Abajo al entero aproximado, que es negativo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Abajo al entero aproximado, que es negativo |- ! colspan=3 {{hl2}} | Redondeando hacia arriba o hacia abajo con ''ceil'' y ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Hasta el siguiente entero ''máximo'', que es uno |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Abajo al siguiente entero ''mínimo'', que es cero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Hasta el siguiente entero máximo, que es cero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Abajo al siguiente entero mínimo, que es negativo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || No redondeado, ya que 1 ya es un entero<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, no como '''ceil('''1/3''')''', como es de esperar}} |- ! colspan=3 {{hl2}} | Redondeo de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Redondear a un número muy grande conduce al infinito. Por lo tanto, se da como respuesta el valor original sin el infinito. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual que arriba. |} <span id="Strings"></span> === Cadenas === Las expresiones solo funcionan con valores numéricos, no pueden comparar cadenas o caracteres. [[#ifeq]] puede ser usado en su lugar. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta función evalúa una cadena de prueba y determina si está vacía o no. Una cadena de prueba que contiene solo espacios en blanco se considera vacía. :<syntaxhighlight lang="wikitext" inline>{{#if: cadena de prueba | evaluar si la cadena de prueba no está vacía | evaluar si la cadena de prueba está vacía (o solo espacio en blanco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primer parámetro | segundo parámetro | tercer parámetro }}</syntaxhighlight> Esta función primero prueba si el primer parámetro no está vacío. Si el primer parámetro no está vacío, la función muestra el segundo argumento. Si el primer parámetro está vacío o contiene solo caracteres de espacios en blanco (espacios, nuevas líneas, etc.), se muestra el tercer argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' La cadena de prueba siempre se interpreta como texto puro, por lo que las expresiones matemáticas no se evalúan (véase [[##ifexpr|#ifexpr]]): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' El último parámetro (falso) se puede omitir: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' La función puede ser insertada. Para hacerlo, anide la función #if interna en su forma completa en lugar de un parámetro de la función #if adjunta. Es posible hasta siete niveles de anidamiento, aunque eso puede depender de la wiki o del límite de memoria. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:cadena de prueba | evaluar si la cadena de prueba no está vacía |{{#if:cadena de prueba |evaluar si la cadena de prueba no está vacía |evaluar si la cadena de prueba está vacía (o solo espacio en blanco) }} }} </syntaxhighlight> También puede utilizar un parámetro como cadena de prueba en su instrucción <code>#if</code>. Debes asegurarte de añadir el símbolo <code>|</code> (barra vertical) después del nombre de la variable. (De modo que si el parámetro no tiene un valor, se evalúa como una cadena vacía en lugar de la cadena "<code><nowiki>{{{1}}}</nowiki></code>"). :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Ingresó texto en la variable 1 |2=No hay texto en la variable 1 }} Veasé {{ll|Help:Parser functions in templates}} para más ejemplos de esta función. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta función de analizador compara dos cadenas de entrada, determina si son idénticas y devuelve una de las dos cadenas según el resultado. Si se requieren más comparaciones y cadenas de salida, considere usar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Si ambas cadenas son valores numéricos válidos, las cadenas se comparan numéricamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' De lo contrario, la comparación se hace como texto; esta comparación es sensible a mayúsculas y minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(compare con el ejemplo similar anterior, sin las comillas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(compárese con el ejemplo similar anterior, con <code>[[##expr|#expr]]</code> devolviendo un número válido primero)'' Como ejemplo práctico, considere una {{ll|Help:Templates|template}} existente <code>Template:Timer</code> usando el analizador para elegir entre dos tiempos estándar, corto y largo. Toma el parámetro como la primera entrada para compararlo con la cadena "short": no existe una convención para el orden, pero es más fácil de leer si el parámetro va primero. El código de la plantilla se define como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> se produce lo siguiente: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Cuando se usan dentro de una función de analizador, cualquier etiqueta de analizador y otras funciones de analizador deben reemplazarse temporalmente con {{ll|Strip marker|un código único}}. Esto afecta a las comparaciones: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Si las cadenas que se comparan se dan como llamadas iguales a la misma {{ll|Help:Templates|plantilla}} que contiene dichas etiquetas, entonces la condición es verdadera, pero en el caso de dos plantillas con contenido idéntico que contienen dichas etiquetas, es falsa. }} {{Warning|1=Las comparaciones literales con {{ll|Help:Magic words#Page names|magic words de nombre de página}} pueden fallar según la configuración del sitio. Por ejemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependiendo de la wiki, puede usar mayúsculas en la primera letra y reemplazará todos los guiones bajos con espacios. Para evitar esto, aplique la palabra mágica a ambos parámetros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta función toma una cadena de entrada y devuelve uno de los dos resultados; la función se evalúa como <code>true</code> si la cadena de entrada contiene un objeto HTML con <code>class="error"</code>, como lo generan otras funciones del analizador como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> y <code>[[##rel2abs|#rel2abs]]</code>, errores [[Special:MyLanguage/Help:Templates|template]] como bucles y recursiones, y otros errores del analizador "failoft". :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">Se pueden omitir una o ambas cadenas de retorno. Si se omite la cadena $1, se devuelve la $2 si no es errónea. Si la cadena $3 también se omite, se devuelve una cadena vacía en caso de error:</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Algunos errores pueden causar que se añada una categoría de seguimiento, el uso de <code><nowiki>{{#iferror:}}</nowiki></code> no suprimirá la adición de la categoría. == #ifexpr == Esta función evalúa una expresión matemática y devuelve una de dos cadenas dependiendo del valor booleano del resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> La entrada <code>expression</code> se evalúa exactamente como para <code>[[##expr|#expr]]</code> arriba, con los mismos operadores disponibles. La salida se evalúa como una expresión booleana. Una expresión de entrada vacía evalúa {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como se mencionó anteriormente, cero se evalúa como {{phpi|false}} y cualquier valor distinto de cero se evalúa como {{phpi|true}}, por lo que esta función es equivalente a una que usa <code>[[##ifeq|#ifeq]]</code> y <code>[[##expr|#expr]]</code> solamente: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> excepto para una expresión de entrada vacía o incorrecta (un mensaje de error se trata como una cadena vacía; no es igual a cero, por lo que obtenemos <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparando :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Cualquiera o ambos valores de retorno pueden omitirse; no se da salida cuando la rama apropiada se deja vacía: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<code>[[##ifexpr|#ifexpr]]</code> no informa comparaciones numéricas equivalentes con los analizadores <code>[[##ifeq|#ifeq]]</code> y <code>[[##switch|#switch]]</code>. Estos dos últimos son más precisos que <code>[[##ifexpr|#ifexpr]]</code>, y no devuelven resultados equivalentes. Considere estas comparaciones con el último dígito modificado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Debido a que PHP usado en <code>[[##ifeq|#ifeq]]</code> y <code>[[##switch|#switch]]</code> compara dos números de tipo entero, devuelve el resultado esperado correctamente. Mientras que con <code>[[##ifexpr|#ifexpr]]</code> y los mismos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Con el dígito diferente, el resultado de igual es realmente incorrecto. Este comportamiento en <code>[[##ifexpr|#ifexpr]]</code> se debe a que MediaWiki convierte números literales en expresiones a tipo flotante, lo que, para enteros grandes como estos, implica redondeo.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} Esta función toma una cadena de entrada, la interpreta como el título de una página y devuelve uno de los dos valores dependiendo de si la página existe o no en el wiki local. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">La función se evalúa como {{phpi|true}} si la página existe, si contiene contenido, está visiblemente en blanco (contiene metadatos como enlaces de categoría o {{ll|Help:Magic words|palabras mágicas}}, pero no visible content), está en blanco o es {{ll|Help:Redirects|redirect}}. Solo las páginas que tienen enlaces rojos se evalúan como $2, incluso si la página existía pero se eliminó.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' La función se evalúa como {{phpi|true}} para {{ll|Help:System message|mensajes del sistema}} que se han personalizado y para {{ll|Help:Special pages|páginas especiales}} que están definidas por el software. :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque la extensión {{ll|Extension:Checkuser|nsp=0}} está instalada en esta Wiki) | '''doesn't exist''' (porque la extensión {{ll|Extension:Checkuser|nsp=0}} no está instalada en esta Wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] se ha personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] no se ha personalizado) }} <span class="mw-translate-fuzzy">Si una página verifica un destino usando <code>#ifexist:</code>, esa página aparecerá en la lista [[{{#special:WhatLinksHere}}]] para la página de destino. Entonces, si el código $code1:Foo $code2 se incluyera en vivo en esta página ($fullpagename1), [[$wth/Foo]] mostrará $fullpagename2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> En wikis que usan un repositorio de medios compartidos, <code>#ifexist:</code> se puede usar para verificar si un archivo se cargó en el repositorio pero no en la propia wiki: :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' Si se ha creado una página de descripción local para el archivo, el resultado es '''existe''' para todo lo anterior. <code>#ifexist:</code> no funciona con enlaces interwiki. <span id="ifexist_limits"></span> === Límites de ifexist === <code>#ifexist:</code> se considera una "función de analizador costosa"; solo se puede incluir un número limitado en cualquier página (incluidas las funciones dentro de las plantillas transcluidas). Cuando se excede este límite, cualquier otra función de <code>#ifexist:</code> devuelve automáticamente falso, ya sea que la página de destino exista o no, y la página se clasifica en [[:Category:{{MediaWiki:expensive-parserfunction-category}}]]. El nombre de la {{ll|Help:Tracking categories|categoría de seguimiento}} puede variar según el idioma del contenido de su wiki. Para algunos casos de uso, es posible emular el efecto ifexist con css, usando los selectores <code>a.new</code> (para seleccionar enlaces a páginas inexistentes) o <code>a:not(.new)</code> (para seleccionar enlaces a páginas existentes). Además, dado que la cantidad de costosas funciones de analizador que se pueden usar en una sola página está controlada por <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, también se puede aumentar el límite en LocalSettings.php si es necesario. <span id="ifexist_and_wanted_pages"></span> === ifexist y páginas requeridas === <span class="mw-translate-fuzzy">Una página que no existe y se prueba para usar #ifexist terminará en las [[Special:MyLanguage/Manual:WantedPages|Páginas Requeridas]].</span> Véase {{phab|T14019}} por la razón, y [[es:Plantilla:Linkless exists]] para una solución. == #rel2abs == Esta función convierte una ruta de archivo relativa en una ruta de archivo absoluta :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> Con la entrada <code>path</code>, la siguiente sintaxis es válida: *<code>.</code> → el nivel actual *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Véase también: [[w:Help:Switch parser function]]'' Esta función compara un valor de entrada con varios casos de prueba y devuelve una cadena asociada si se encuentra una coincidencia. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Ejemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <nowiki>#</nowiki>switch con etiquetas de transclusión parcial puede afectar a un archivo de configuración que permite a un editor que no esté familiarizado con la codificación de plantillas ver y editar elementos configurables. <span id="Default"></span> === Predeterminado === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' En esta sintaxis, el resultado predeterminado debe ser el último parámetro y no debe contener un signo de igual sin formato (un signo de igual sin <code><nowiki>{{}}</nowiki></code>). Si es así, se tratará como una comparación de casos y no se mostrará ningún texto si no hay coincidencias entre casos. Esto se da porque el valor por defecto no ha sido definido (está vacío). Sin embargo, en el caso que coincida se devolverá su cadena de texto asociada. :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> De manera alternativa, el resultado predeterminado puede declararse explícitamente con una cadena <code>''case''</code> de "<code>#default</code>". {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Los resultados predeterminados declarados de esta manera pueden colocarse en cualquier lugar dentro de la función: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' Si se omite el parámetro <code>''default''</code> y no se encuentra ninguna coincidencia, no se devuelve <code>''result''</code>: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupando resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Aquí, todos los casos 2, 3 y 4 devolverán <code>''result234''</code>; mientras que los casos 6 y 7 devolverán <code>''result67''</code>. El "<code>#default = </code>" del último parámetros puede ser omitido en el caso anterior. <span id="Use_with_parameters"></span> === Usar con parámetros === La función puede ser usada con parámetros como una cadena de texto de prueba. <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Véase {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> En el caso anterior, si <code><nowiki>{{{1}}}</nowiki></code> es igual a <code>foo</code>, la función devolverá <code>Foo</code>. Si es igual a <code>baz</code>, la función devolverá <code>Baz</code>. Si el parámetro está vacío o no existe, la función devolverá <code>Bar</code>. <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> Aquí, si <code><nowiki>{{{1}}}</nowiki></code> es igual a <code>foo</code>, <code>zoo</code> o <code>roo</code>, la función va a devolver <code>Foo</code>. Si iguala a <code>baz</code>, la función devolverá <code>Baz</code>. Si el parámetro está vacío o no existe, la función va a devolver $!. Adicionalmente, el resultado por defecto puede ser omitido si no esperas que devuelva algo en caso de que el parámetro de prueba no coincida con ninguno de los casos. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> En este caso, la función devuelve una cadena de texto vacía salvo que <code><nowiki>{{{1}}}</nowiki></code> exista e iguale <code>foo</code> o <code>bar</code>. En tal caso, devolverá <code>Foo</code> o <code>Bar</code> respectivamente. Esto posee el mismo efecto de declarar el resultado por defecto como vacío. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> Si por alguna razón deseas establecer un caso como "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", la función devolverá su resultado correspondiente cuando el parámetro no exista o no tenga un valor. El parámetro tendrá que existir y tener un valor distinto al de la cadena de texto "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" para que devuelva el resultado por defecto de la función. :(donde <code><nowiki>{{{1}}}</nowiki></code> no existe o está vacío): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(donde <code><nowiki>{{{1}}}</nowiki></code> tiene el valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(donde <code><nowiki>{{{1}}}</nowiki></code> posee el valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= Las comparaciones numéricas con <code>[[##switch|#switch]]</code> y <code>[[##ifeq|#ifeq]]</code> no son equivalentes con las comparaciones en las expresiones (véase también arriba): :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Ejemplo: {| class="wikitable" ! Escribes ! Obtienes |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por ejemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> es equivalente a: * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descripción ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Año |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Año de 4 dígitos | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Año de 2 dígitos | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1 si es año bisiesto, 0 si no lo es. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mes |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Día del mes o del año |- | style="text-align: center;" | <code>j</code> | Día del mes, sin cero. | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | Día del mes, comenzando por cero. | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana y día de la semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante la mañana (00:00:00 → 11:59:59), "pm" si no (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos y segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Zona horaria (a partir de [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de la zona horaria. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura de la zona horaria. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Miscelánea |- | style="text-align: center;" | <code>t</code> | Número de días en el mes actual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | Islámico |- | style="text-align: center;" | <code>xmj</code> | Día del mes. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nombre completo del mes. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mes. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Año completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraní (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de días en el mes. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Fecha. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Día del mes. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nombre completo del mes. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mes. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Año completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Año de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreo |- | style="text-align: center;" | <code>xjj</code> | Día del mes. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nombre completo del mes. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de días en el mes. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genitiva del nombre del mes. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número del mes. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Año completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Año completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Año completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <span id="Substitution"></span> === Substitución === <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <span id="Redirects"></span> === Redirecciones === <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descripción ! Escribes ! Obtienes |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Véase también == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|Cómo utilizar los datos en los proyectos Wikimedia#Función Parser]] <span id="References"></span> == Referencias == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] gr4wjgommtmwg2j9qtbp6ue8fs7lm7k Help:Extension:ParserFunctions/sv 12 40033 8365033 8353950 2026-05-04T06:21:26Z FuzzyBot 451990 Updating to match new version of source page 8365033 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span class="mw-translate-fuzzy">Tillägget {{ll|Extension:ParserFunctions|nsp=0}} ger elva extra [[Special:MyLanguage/Parser functions|parserfunktioner]] som kompletterar de ''{{$2|magiska orden}}'' som följer med i MediaWiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> (Det ''kan'' vara konfigurerat för att tillhandahålla ytterligare parserfunktioner för stränghantering, dessa strängfunktioner är dokumenterade {{ll|Extension:ParserFunctions/String functions|annorstädes}}.) Grundsyntaxen på alla perserfunktionerna på den här sidan ser ut som följer: :<code><nowiki>{{</nowiki>'''#funktionens-namn''': ''argument 1'' | ''argument 2'' | ''argument 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Typ ! {{hl1}} | Operator |- | {{hl2}} | Gruppering (parenteser) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Siffror | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | binär operatör <code>'''e'''</code> &nbsp; unär <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unär | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binär | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Avrundning | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Logisk | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Denna funktion utvärderar ett matematiskt uttryck och returnerar det beräknade värdet. Den här funktionen finns också i {{ll|Extension:Scribunto|nsp=0}} via funktionen <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''uttryck'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span class="mw-translate-fuzzy">Alla tillgängliga operatorer finns i tabellen till höger. Se [[{{ll|Manual:Expr parser function syntax}}|Help:Calculation]] för mer detaljerad information om varje operator. Noggrannheten och formatet på resultatet beror på operativsystemet och språkinställningarna i MediaWiki-installationen.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div class="mw-translate-fuzzy"> När man använder [[:sv:boolesk algebra|boolesk algebra]], ersätts noll med <code>false</code>, och alla nollskilda värden, positiva och negativa, ersätts med <code>true</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Ett tomt input-uttryck returnerar en tom sträng. Ogiltiga uttryck returnerar en av följande felmeddelanden, som kan fångas med <code>[[##iferror|#iferror]]</code>-funktionen: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' Den här funktionen testar om en sträng är tom eller inte. Den svarar med ''false'' om strängen är tom eller bara innehåller mellanslag och radbrytningar. :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=Operatorn <code>mod</code> ger felaktiga resultat för en del värden i det andra argumentet: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (producerar en tom sträng; borde vara 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <span id="Rounding"></span> === Avrundning === <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | Testfall ! {{hl1}} | Resultat ! {{hl1}} | Avrundningsmetod |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || Den sista siffran än < 5, så ingen avrundning görs (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || Den sista siffran än >= 5, så den avrundas uppåt (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | Avrundar till det närmaste heltalet |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Ned till det "närmaste" heltalet, som är noll |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Upp till det närmaste heltalet, som är ett |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Upp till det närmaste heltalet, som är ett |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Upp till det närmaste heltalet, som är noll |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Ned till det närmaste heltalet, som är minus ett |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Ned till det närmaste heltalet, som är minus ett |- ! colspan=3 {{hl2}} | Avrundar upp eller ned med ''ceil'' och ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Upp till nästa ''större'' heltal, som är ett |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Ned till nästa ''mindre'' heltal, som är noll |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Upp till nästa större heltal, som är noll |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Ned till det närmaste mindre heltalet, som är minus noll |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Inte avrundad eftersom 1 redan är ett heltal<br />{{Warning|1=Tolkas som '''(ceil''' 1''')'''/3, inte '''ceil('''1/3''')''' som du kanske förväntade dig}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <span id="Strings"></span> === Strängar === <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Den här funktionen värderar en teststräng och bedömer om den är tom eller inte. En teststräng som bara innehåller mellanrum anses vara tom. :<syntaxhighlight lang="wikitext" inline>{{#if: teststräng | värde om teststrängen inte är tom | värde om teststrängen är tom (eller endast ett mellanslag)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: första parametern | andra parametern | tredje parametern }}</syntaxhighlight> Funktionen testar först om den första parametern inte är tom. Om den första parametern inte är tom visar funktionen det andra argumentet. Om den första parametern är tom eller bara innehåller tomma tecken (mellanslag, nya rader, osv.) visar den det tredje argumentet. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div class="mw-translate-fuzzy"> Teststrängen tolkas alltid som ren text, så matematiska uttryck värderas inte: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' Den sista parametern (false) kan uteslutas: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' jämför med :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' (eftersom tillägget {{ll|Extension:Checkuser|nsp=0}} inte är installerat på denna wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (eftersom [[{{ns:8}}:Copyright]] har anpassats) | '''doesn't exist''' (eftersom [[{{ns:8}}:Copyright]] inte har anpassats) }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <code>#ifexist:</code> fungerar inte med interwikilänkar. <span id="ifexist_limits"></span> === Begränsningar av ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exempel: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Standard === <code>''Standardresultatet''</code> returneras om ingen <code>''målsträng''</code> överensstämmer med <code>''jämförelsesträngen''</code>: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Se {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <span id="Raw_equal_signs"></span> === Råa likamedtecken === <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exempel: {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Till exempel: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> är likadant som * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Kod ! {{hl1}} | Beskrivning ! {{hl1}} | Aktuell utmatning <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Rensa denna sidas cache] för att uppdatera)</small> |- ! {{hl2}} colspan="3"| År |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Fyrsiffrigt årtal. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Tvåsiffrigt årtal. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1 om det är en skottår, annars 0. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|Kräver PHP 5.1.0 och nyare samt [[rev:45208]].|group=note}} | Den valda veckans år i formatet ISO-8601{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Månad |- | style="text-align: center;" | <code>n</code> | Månadsindex, utan en nolla. | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | Månadsindex, med en nolla. | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | En förkortning av månadens namn på webbplatsens språk. | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | Månadens fullständiga namn på webbplatsens språk. | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | För polska:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | Månadens dag, utan en nolla. | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | Månadens dag, med en nolla. | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | Veckans nummer i formatet ISO 8601 med en nolla. | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | Veckans dag i formatet ISO 8601 (Måndag = 1, söndag = 7). | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | En förkortning för veckans dag. Översätts sällan. | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | Veckodagens fullständiga namn. Översätts sällan. | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Timme |- | style="text-align: center;" | <code>a</code> | "am" under morgonen (00:00:00 → 11:59:59), annars "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span class="mw-translate-fuzzy">Versal version av <code>a</code> ovan.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Timme i 12-timmarsformat, utan en nolla. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Timme i 12-timmarsformat, med en nolla. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Timme i 24-timmarsformat, utan en nolla. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Timme i 24-timmarsformat, med en nolla. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minuter och sekunder |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> Sekunder sedan 1 januari 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Tidzon (från och med [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Tidzonsidentiferare. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Övrigt |- | style="text-align: center;" | <code>t</code> | Antal dagar i den aktuella månaden. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Icke-gregorianska kalendrar |- ! {{hl3}} colspan="3" | Islamisk |- | style="text-align: center;" | <code>xmj</code> | Månadens dag. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Månadens fullständiga namn. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Månadsindex. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Fullständigt år. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Månadens dag. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Månadens fullständiga namn. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Månadsindex. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Fullständigt år. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Tvåsiffrigt årtal. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreisk |- | style="text-align: center;" | <code>xjj</code> | Månadens dag. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Månadens fullständiga namn. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Antal dagar i månaden. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Månadens nummer. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Fullständigt år. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Thailändsk kalender |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Fullständigt år. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | Japanska perioder |- | style="text-align: center;" | <code>xtY</code> | Fullständigt år. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | Flaggor |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | På hindi kommer <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> visas som ०६, 06. |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Tidszonsproblem ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <span id="Redirects"></span> === Omdirigeringar === Speciellt [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] skulle vara behändigt i {{ll|Help:Redirects|omdirigeringar}} till sidor som inkluderar datum, men detta fungerar inte. <span id="Escaping_pipe_characters"></span> <div class="mw-translate-fuzzy"> === Vertikalstreck i tabeller === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Beskrivning ! Inmatning ! Resultat |- | Vertikalstreck som rad-/kolumnavskiljare i tabeller | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | Vertikalstreck som ett vanligt tecken | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Blankstegsignorering === Blanksteg, inklusive radbrytningar, tabbavstånd och mellanrum ignoreras från början och slutet på alla parametrar för dessa tolkningsfunktioner. Om detta inte önskas kan man jämföra strängar genom att omfatta dem med citationstecken. :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Se även == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] 2pk7gfpbflbzey2bxi58macvsfdm4tm Help:Extension:ParserFunctions/mr 12 40367 8365024 8353940 2026-05-04T06:20:58Z FuzzyBot 451990 Updating to match new version of source page 8365024 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span lang="en" dir="ltr" class="mw-content-ltr">The {{ll|Extension:ParserFunctions|nsp=0}} extension provides additional [[Special:MyLanguage/Parser functions|parser functions]] to supplement those already present in MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">(It ''may'' be configured to provide additional parser functions for string handling; these are only available to non-Wikimedia Foundation wikis hence these string functions are documented {{ll|Extension:ParserFunctions/String functions|elsewhere}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">All the parser functions provided by this extension take the form:</span> :<code><nowiki>{{</nowiki><span lang="en" dir="ltr" class="mw-content-ltr">'''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ...</span> <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Operators</span> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Grouping (parentheses)</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Numbers</span> | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | <span lang="en" dir="ltr" class="mw-content-ltr">binary operator</span> <code>'''e'''</code> &nbsp; <span lang="en" dir="ltr" class="mw-content-ltr">unary</span> <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Unary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Binary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Round</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Logic</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} <span lang="en" dir="ltr" class="mw-content-ltr">This function evaluates a mathematical expression and returns the calculated value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This function is also available in {{ll|Extension:Scribunto|nsp=0}} via the <code>mw.ext.ParserFunctions.expr</code> function.</span> :<code><nowiki>{{#expr:</nowiki> ''<span lang="en" dir="ltr" class="mw-content-ltr">expression</span>'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The available operators are listed to the right, in order of precedence. See {{ll|Manual:Expr parser function syntax}} for more details of the function of each operator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> When evaluating using [[w:boolean algebra|boolean algebra]], zero evaluates to {{phpi|false}}, and any nonzero value, positive or negative, evaluates to {{phpi|true}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code>[[##iferror|#iferror]]</code> function: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Rounding === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Test case</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Result</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Method of rounding</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is < 5, so no apparent rounding occurs</span> (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is ≥ 5, so it is rounded up</span> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to the nearest integer</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the ''nearest'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding up or down with ''ceil'' and ''floor''</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next ''larger'' integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next ''smaller'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next larger integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next smaller integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Not rounded, since 1 already is an integer</span><br />{{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect</span>}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Strings === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: test string | value if test string is not empty | value if test string is empty (or only white space)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: first parameter | second parameter | third parameter }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Example: </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Year</span> |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">4-digit year.</span> | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Month</span> |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour</span> |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Minutes and seconds</span> |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> <div class="mw-translate-fuzzy"> == हे सुद्धा पहा == </div> * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] kbv5rth6n2rjms2wou5yjx0qvikyu0w Help:Extension:ParserFunctions/th 12 41500 8365035 8353951 2026-05-04T06:21:33Z FuzzyBot 451990 Updating to match new version of source page 8365035 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span class="mw-translate-fuzzy">ส่วนขยาย {{ll|Extension:ParserFunctions|nsp=0}} จะเพิ่มฟังก์ชันตัวแยกวิเคราะห์สำหรับรองรับ "{{$2|เมจิกเวิร์ด}}" ซึ่งมีอยู่ในมีเดียวิกิอยู่แล้ว</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> (''อาจ''ตั้งค่าเพื่อให้มีฟังก์ชันตัวแยกวิเคราะห์สำหรับการจัดการกับสตริงเพิ่มเติม แต่การบ่งชี้การใช้ระบุไว้{{ll|Extension:ParserFunctions/String functions|ที่อื่น}}) ตัวแยกวิเคราะห์ทั้งหมดที่มาจากส่วนขยายนี้จะอยู่ในรูปแบบดังนี้: :<code><nowiki>{{</nowiki>'''#''ชื่อฟังก์ชัน''''': ''อาร์กิวเมนต์ ก'' | ''อาร์กิวเมนต์ ข'' | ''อาร์กิวเมนต์ ค'' | … <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | ชนิด ! {{hl1}} | ตัวดำเนินการ |- | {{hl2}} | ตัวจับกลุ่ม (parentheses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | ตัวเลข | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | ตัวดำเนินการไบนารี <code>'''e'''</code> &nbsp; การดำเนินการเอกภาค <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | ตัวดำเนินการเอกภาค | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | ไบนารี | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | การปัดเศษ | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | ตรรกะ | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} ฟังก์ชันนี้จะดำเนินการทางคณิตศาสตร์และส่งค่าที่ผ่านการคำนวณแล้วส่งค่าที่ได้กลับ ฟังก์ชันนี้ยังมีอยู่ใน {{ll|Extension:Scribunto|nsp=0}} ผ่านฟังก์ชัน <code>mw.ext.ParserFunctions.expr</code> :<code><nowiki>{{#expr:</nowiki> ''นิพจน์'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span class="mw-translate-fuzzy">ตัวดำเนินการที่สามารถใช้งานได้จะรายการอยู่ทางขวามือ เรียงลำดับตามลำดับการดำเนินการตรรกศาสตร์ ดู[[{{ll|Manual:Expr parser function syntax}}|วิธีใช้:การคำนวณ]]สำหรับรายละเอียดเพิ่มเติมของแต่ละตัวดำเนินการ ความถูกต้องและรูปแบบจะขึ้นอยู่กับระบบปฏิบัติการของเซิร์ฟเวอร์ที่ดำเนินการวิกิและรูปแบบตัวเลขที่ระบุโดยแต่ละภาษา</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> เมื่อมีการเรียกใช้งานโดยใช้[[w:th:พีชคณิตแบบบูล|พีชคณิตแบบบูล]] ศูนย์จะหมายถึง <code>false</code> (เท็จ) และจำนวนเต็มบวก เต็มลบ และทศนิยมอื่น ๆ ทั้งหมดที่ไม่ใช่ศูนย์ จะหมายถึง <code>true</code> (จริง): :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' การส่งค่านิพจน์ว่างจะส่งกลับสตริงว่าง นิพจน์ที่ไม่ถูกต้องจะส่งกลับหนึ่งในหลายสารแสดงข้อผิดพลาด ซึ่งสามารถตรวจจับได้โดยใช้ฟังก์ชัน <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' การใส่ตัวดำเนินการบวกและการลบทั้งก่อนหรือหลังตัวเลขนั้นมีนัย และอาจถือเป็นจำนวนบวกหรือจำนวนลบ แทนการส่งกลับข้อผิดพลาดว่าเป็นการใช้งานผิดพลาด: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' หมายเหตุ หากคุณกำลังจะใช้งานค่าส่งกลับจากเมจิกเวิร์ดเหล่านี้ คุณต้องทำให้อยู่ในรูปตัวเลขดิบเพื่อลบคอมมาและการแปลงตัวเลขออก ตัวอย่างเช่น $numberofusers จะแสดงผลเป็น $nou-result แต่เราต้องการค่าแบบ $nou-result-raw ซึ่งสามารถทำได้โดยใช้ $numberofusers2 ซึ่งบางครั้งมักจำเป็นต้องใช้ในบางภาษาที่ตัวเลขถูกแปลง เช่นในภาษาเบงกาลี $numberofusers3 จะได้ค่าเป็น $bengali <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=ตัวดำเนินการ <code>mod</code> จะส่งกลับค่าที่ผิดพลาดในบางค่าของอาร์กิวเมนต์ที่สอง <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (ส่งกลับค่าว่าง ซึ่งแท้จริงควรเป็น 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span class="mw-translate-fuzzy">หากคุณต้องการคำนวณค่าวัน เวลาหรือวันที่ (เช่นทดสอบว่าวันที่ที่ระบุคือก่อนหรือหลังอีกวันที่ที่ระบุ) ให้แปลงเวลาเป็นจำนวนวินาทีหลังจาก 1 มกราคม 1970 (2513) เสียก่อนโดยใช้ <nowiki>{{#time: xNU }}</nowiki> แล้วจึงคำนวณผ่านเลขเหล่านี้</span>}} <span id="Rounding"></span> === การปัดเศษ === [https://php.net/function.round ปัดเศษ]ทศนิยมทางซ้ายมือตัวดำเนินการเพื่อให้เหลือจำนวนเท่ากับตัวเลขทางขวามือตัวดำเนินการ สำหรับการปัดขึ้นหรือปัดลง ใช้การดำเนินการเอกภาค <code>ceil</code> หรือ <code>floor</code> ตามลำดับ {| class="wikitable" ! {{hl1}} | ชุดทดสอบ ! {{hl1}} | ผลลัพธ์ ! {{hl1}} | รูปแบบการปัดเศษ |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || ตัวเลขหลักสุดท้าย < 5 ดังนั้นจึงไม่มีการปัดเศษ (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || เลขหลักสุดท้าย ≥ 5 จึงมีการปัดขึ้น (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || เช่นเคย มีการปัดเศษที่เลขหลักสุดท้าย และทำให้เกิดการปัดเศษต่อไปเรื่อย ๆ เพิ่มเติม (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || ปัดไปยังจำนวนในหลักร้อยที่ใกล้ที่สุด เนื่องจากจำนวนลบจะปัดตัวเลขที่อยู่ทางซ้ายจุดทศนิยม |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || ปัดเศษไปยังทศนิยมหลักที่สองที่ใกล้ที่สุด เนื่องจากจำนวนบวกจะปัดเศษที่อยู่ทางขวามือจุดทศนิยม |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || จุดทศนิยมในดัชนีปัดเศษไม่มีผลใด ๆ ในผลลัพธ์ |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || ปัดเศษทิ้ง (ตัดออก) |- ! colspan=3 {{hl2}} | ปัดเศษไปที่จำนวนเต็มที่ใกล้ที่สุด |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || ปัดเศษลงไปที่จำนวนเต็มที่''ใกล้ที่สุด'' ซึ่งในที่นี้คือศูนย์ |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || ปัดเศษขึ้นจำนวนเต็มที่ใกล้ที่สุด ซึ่งคือหนึ่ง |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || ปัดขึ้นไปที่จำนวนเต็มที่ใกล้ที่สุด ซึ่งคือหนึ่ง |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || ปัดเศษขึ้นจำนวนเต็มที่ใกล้ที่สุด ซึ่งคือศูนย์ |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || ปัดเศษลงไปจำนวนเต็มที่ใกล้ที่สุด ซึ่งคือลบหนึ่ง |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || ปัดเศษลงไปที่จำนวนเต็มที่ใกล้ที่สุด ซึ่งคือลบหนึ่ง |- ! colspan=3 {{hl2}} | ปัดเศษขึ้นหรือลงด้วย ''ceil'' และ ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || ปัดเศษขึ้นไปยังจำนวนเต็มที่''มากกว่า''ลำดับถัดไป ในที่นี้คือหนึ่ง |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || ปัดเศษลงไปจำนวนเต็มที่''น้อยกว่า''ถัดไป ซึ่งคือศูนย์ |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || ปัดเศษขึ้นไปยังจำนวนเต็มที่มากกว่ากว่าถัดไป ซึ่งคือศูนย์ |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || ปัดเศษลงไปที่จำนวนเต็มที่น้อยกว่า ซึ่งคือลบหนึ่ง |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || ไม่ปัดเศษ เนื่องจาก 1 เป็นจำนวนเต็มอยู่แล้ว<br />{{Warning|1=ฟังก์ชันตีความว่าเป็น '''(ceil''' 1''')'''/3 ไม่ใช่ '''ceil('''1/3''')''' อย่างที่คุณอาจคาดหวัง}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <span id="Strings"></span> === สตริง === นิพจน์จะทำงานเฉพาะกับค่าที่คล้ายเป็นตัวเลขเท่านั้น โดยไม่สามารถใช้เปรียบเทียบสตริงหรืออักขระได้ กรณีนั้นควรใช้ [[#ifeq]] แทน :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == ฟังก์ชันนี้ใช้กระเมินสตริงที่ทดสอบว่าเป็นค่าว่างหรือไม่ หากสตริงที่ทดสอบมีเพียงไวต์สเปซจะถือว่าเป็นค่าว่างเช่นกัน :<syntaxhighlight lang="wikitext" inline>{{#if: สตริงทดสอบ | ค่าหากสตริงที่ทดสอบไม่ใช่ค่าว่าง | ค่าหากสตริงทดสอบเป็นค่าว่าง (หรือมีเฉพาะไวต์สเปซ)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: พารามิเตอร์แรก | พารามิเตอร์ที่สอง | พารามิเตอร์ที่สาม }}</syntaxhighlight> ฟังก์ชันนี้จะทดสอบว่าพารามิเตอร์แรกจะไม่ใช่ค่าว่าง หากพารามิเตอร์แรกไม่ใช่ค่าว่าง จะแสดงผลพารามิเตอร์ที่สอง หากพารามิเตอร์แรกเป็นค่าว่างหรือมีแค่ไวต์สเปซ จะแสดงพารามิเตอร์ที่สาม :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div class="mw-translate-fuzzy"> สตริงทดสอบจะถูกตีความว่าเป็นข้อความดิบ ดังนั้นนิพจน์ทางคณิตศาสตร์จะไม่ถูกดำเนินการใด ๆ: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' พารามิเตอร์สุดท้าย (เท็จ) ไม่จำเป็น อาจนำออกก็ได้: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' ฟังก์ชันอาจซ้อนกันได้ ในการทำเช่นนั้น ซ้อน #if ด้านในในรูปแบบเต็มในจุดที่พารามิเตอร์ปิดฟังก์ชัน #if สามารถซ้อนกันได้สูงสุด 7 ระดับ ซึ่งในหลายกรณีจะขึ้นอยู่กับตัววิกิหรือขีดจำกัดหน่วยความจำของวิกิ <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:สตริงทดสอบ | ค่าหากสตริงที่ทดสอบไม่ใช่ค่าว่าง |{{#if:test string |value if test string is not empty |ค่าหากสตริงทดสอบเป็นค่าว่าง (หรือมีเฉพาะไวต์สเปซ) }} }} </syntaxhighlight> <span class="mw-translate-fuzzy">ใน <code>#if</code> คุณยังสามารถใช้พารามิเตอร์เป็นสตริงทดสอบได้ด้วย แต่ต้องใส่ $1 (ไปป์) หลังชื่อพารามิเตอร์เสมอ</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> (ดังนั้น หากพารามิเตอร์ไม่ได้ระบุค่า พารามิเตอร์จะส่งค่าว่างแทนสตริง "<code><nowiki>{{{1}}}</nowiki></code>") :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=คุณใส่ค่าข้อความในตัวแปร 1 |2=ตัวแปร 1 ไม่มีข้อความใด ๆ }} ดูที่ {{ll|Help:Parser functions in templates}} สำหรับตัวอย่างเพิ่มเติมเกี่ยวกับฟังก์ชันตัวแยกวิเคราะห์นี้ {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == ฟังก์ชันตัวแยกวิเคราะห์นี้จะเทียบเคียงสองสตริงที่ป้อนเข้า มาตรวจสอบว่าตรงกันหรือไม่ แล้วส่งกลับหนึ่งในสองสตริงตามผลลัพธ์ที่ได้ หากต้องใช้การเปรียบเทียบจำนวนมากและส่งกลับค่าตามการเทียบ พิจารณาใช้ <code>#switch</code> แทน :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> หากสตริงทั้งคู่เป็นค่าตัวเลขที่ถูกต้อง สตริงนั้นจะถูกเปรียบเทียบในเชิงคณิตศาสตร์แทน :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' แต่หากไม่ใช่จะถือว่าเป็นข้อความ และการเปรียบเทียบจะไวต่ออักษรเล็กใหญ่ :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(เปรียบเทียบกับตัวอย่างที่คล้ายกันด้านบนโดยไม่ใส่อัญประกาศ)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(เทียบกับตัวอย่างที่คล้ายกันด้านบน กับ <code>[[##expr|#expr]]</code> จะส่งกลับค่าตัวเลขที่ถูกต้องก่อน)'' <span class="mw-translate-fuzzy">เพื่อให้เห็นภาพ ลองพิจารณา{{ll|Help:Templates|แม่แบบ}} <code>แม่แบบ:Timer</code> โดยจะใช้ตัวแยกวิเคราะห์เพื่อเลือกระหว่างเวลามาตรฐานสองอัน เวลาชั่วครู่สั้น และเวลาที่นานกว่า</span> โดยจะใช้พารามิเตอร์ 1 เป็นตัวป้อนค่าในอาร์กิวเมนต์แรก หากไม่ตรงกับสตริง "short" หมายเหตุว่าลำดับไม่มีผล อาจสลับกันได้ แต่จะสะดวกกว่าหากใช้พารามิเตอร์เป็นอาร์กิวเมนต์แรก โค้ดแม่แบบจะเป็น: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> จะได้ผลลัพธ์: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=เมื่อใช้งานในฟังก์ชันตัวแยกวิเคราห์ แท็กฟังก์ชันตัวแยกวิเคราะห์ใด ๆ และตัวแยกวิเคราะห์จะถูกแทนที่ด้วย{{ll|Strip marker|รหัสเฉพาะ}}เป็นการชั่วคราว ซึ่งจะส่งผลกระทบกับการเทียบเช่นนี้: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' หากสตริงที่จะนำมาเปรียบเทียบนั้นมีการเรียกใช้{{ll|Help:Templates|แม่แบบ}}เดียวกันที่ในแม่แบบนั้นมีการเรียกใช้แท็กเดียวกัน เงื่อนไขจะเป็นจริง แต่ในกรณีที่สองแม่แบบแม้มีเนื้อหาของแม่แบบเหมือนกันแต่จะเป็นเท็จ }} {{Warning|1=การใช้งานการเปรียบเทียบแบบตรงกับ{{ll|Help:Magic words#Page names|คำพิเศษที่เกี่ยวข้องกับชื่อหน้า}}อาจเกิดข้อผิดพลาดได้ ซึ่งขึ้นอยู่กับการปรับตั้งค่าของไซต์ ตัวอย่างเช่น <nowiki>{{FULLPAGENAME}}</nowiki> จะขึ้นอยู่กับแต่ละวิกิ บางครั้งมีการใช้ตัวพิมพ์ใหญ่ขึ้นต้นชื่อหน้าเสมอ บางครั้งแทนที่อันเดอร์สกอร์ทั้งหมดด้วยช่องว่าง เพื่อหลีกเลี่ยงปัญหานี้ ใช้งานคำพิเศษในทั้งสองพารามิเตอร์: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == ฟังก์ชันนี้จะรับค่าสตริงเข้าแล้วส่งค่ากลับหนึ่งในสองความเป็นไปได้ ฟังก์ชันจะส่งกลับค่า <code>true</code> หากสตริงนำเช้ามีอ็อบเจค HTML ที่มี <code>class="error"</code> ซึ่งถูกสร้างโดยฟังก์ชันแยกวิเคราะห์อื่น ๆ เช่น <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> และ <code>[[##rel2abs|#rel2abs]]</code>, ข้อผิดพลาดแ่แบบ[[Special:MyLanguage/Help:Templates|แม่แบบ]] เช่นวังวนแม่แบบและแม่แบบซ้อน และข้อผิดพลาดตัวแยกวิเคราะห์อื่น ๆ ที่เป็น "failsoft" :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">หนึ่งหรือสองค่าที่ส่งกลับสามารถละเว้นได้ หากละเว้นการใส่สตริง <code>''correct''</code> <code>''test string''</code> จะส่งกลับหากไม่ใช่ค่าที่เป็นข้อผิดพลาด และหากละเว้นการใส่สตริง <code>''error''</code> เมื่อเกิดข้อผิดพลาดจะส่งกลับค่าว่างออกมา:</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == ฟังก์ชันนี้มีการประเมินนิพจน์ทางคณิตศาสตร์และส่งกลับสตริงหนึ่งในสองค่าขึ้นอยู่กับค่าความจริงของผลลัพธ์: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div class="mw-translate-fuzzy"> <code>''expression''</code> ที่ป้อนเข้าจะถูกประเมินโดยใช้ <code>[[##expr|#expr]]</code> ด้านบน พร้อมด้วยตัวดำเนินการบางตัวเพิ่มเติม ค่าที่ส่งกลับจะถือว่าเป็นนิพจน์บูลีน </div> หากป้อนค่าว่าง จะถูกประเมินเป็น {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' ดังที่ได้กล่าวถึงข้างต้น ค่าศูนย์จะถือว่าเป็น {{phpi|false}} และค่าอื่น ๆ ทั้งหมดจะเป็น {{phpi|true}} ดังนั้นฟังก์ชันนี้เทียบเท่ากับการใช้เพียง <code>[[##ifeq|#ifeq]]</code> และ <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div class="mw-translate-fuzzy"> เว้นเสียแต่เป็นค่าว่างหรือนิพจน์ที่ป้อนเข้ามีความผิดพลาด (สารแสดงความผิพลาดขะถือว่าเป็นค่าว่าง ซึ่งไม่เท่ากับค่าศูนย์ เราจึงได้ <code>''value if true''</code>) </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' เปรียบเทียบ :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' ค่าที่ต้องส่งออกค่าใดค่าหนึ่งหรือทั้งสองค่าสามารถละเว้นได้ จะไม่ส่งกลับค่าใด ๆ หากช่องที่ต้องส่งออกเป็นค่าว่าง :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span class="mw-translate-fuzzy"><code>[[##ifexpr|#ifexpr]]</code> ไม่มีการเปรียบเทียบเชิงตัวเลขที่เทียบเท่ากับตัวแยกวิเคราะห์ <code>[[##ifeq|#ifeq]]</code> และ <code>[[##switch|#switch]]</code></span> สองอย่างหลังนี้มีความแม่นยำมากกว่า <code>[[##ifexpr|#ifexpr]]</code> และไม่ส่งคืนผลลัพธ์ที่เทียบเท่ากัน พิจารณาการเปรียบเทียบเหล่านี้กับการเปลี่ยนเลขหลักสุดท้าย: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' เนื่องจากการใช้ PHP เปรียบเทียบใน <code>[[##ifeq|#ifeq]]</code> และ <code>[[##switch|#switch]]</code> ระหว่างตัวเลขจำนวนเต็ม 2 ตัว จะส่งค่าที่คาดหวังได้อย่างถูกต้อง ในขณะที่ใช้กับ <code>[[##ifexpr|#ifexpr]]</code> และตัวเลขเดียวกัน: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' ด้วยตัวเลขที่แตกต่างกัน ผลลัพธ์ของการเท่ากันจะไม่ถูกต้องเลย พฤติกรรมนี้ใน <code>[[##ifexpr|#ifexpr]]</code> เกิดจากการที่มีเดียวิกิแปลงเลขจริงในนิพจน์ให้เป็นทศนิยม และทำให้จำนวนเต็มมาก ๆ เช่นนี้ถูกทำให้มีการปัดเศษ<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} ฟังก์ชันนี้รับค่าสตริง ตีความว่าได้รับค่าหน้า แล้วส่งค่ากลับหนึ่งในสองค่า ขึ้นอยู่กับว่าหน้าที่ได้รับนั้นมีอยู่หรือไม่ในวิกิท้องถิ่น :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">ฟังก์ชันจะเป็น <code>''จริง''</code> เมื่อหน้ามีอยู่ ไม่ว่าจะมีเนื้อหาหรือไม่ หรือไม่แสดงผล (เช่นลิงก์หมวดหมู่หรือ{{ll|Help:Magic words|คำพิเศษ}} แต่ไม่มีเนื้อหาที่มองเห็นได้) หรือเป็น{{ll|Help:Redirects|หน้าเปลี่ยนทาง}} เฉพาะหน้าที่เมื่อเขียนลิงก์แล้วเป็นลิงก์แดงเท่านั้นที่จะเป็น <code>''เท็จ''</code> รวมถึงหน้าที่เคยมีอยู่แต่บังเอิญเพิ่งถูกลบเช่นกัน</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Example: </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Year</span> |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">4-digit year.</span> | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Month</span> |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour</span> |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Minutes and seconds</span> |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] tnh8y4q8e1nuf1hqcw5257h1vqtfblj Help:Extension:ParserFunctions/pt 12 43996 8364916 8353944 2026-05-04T05:18:32Z RogueScholar 14671222 8364916 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|help:magic words#parser functions}}.) (a extensão ''pode'' ser configurada para fornecer funções adicionais para o tratamento de texto; estas funções de texto estão documentadas {{ll|Extension:ParserFunctions/String functions|noutra página}}). Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">Podem ser omitidos um ou ambos os textos a devolver. Se o texto para $1 for omitido, é devolvido $2 se este não estiver errado. Se o texto $3 também for omitido, será devolvido um texto vazio em caso de erro:</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] nxbhaby1vf5051vtzrim2x2ajebd6zt 8364937 8364916 2026-05-04T05:24:44Z RogueScholar 14671222 8364937 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|help:magic words#parser functions}}.) (a extensão ''pode'' ser configurada para fornecer funções adicionais para o tratamento de texto; estas funções de texto estão documentadas {{ll|Extension:ParserFunctions/String functions|noutra página}}). Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] tbm8g13vp34rafcd81vdllzjcnaccbt 8364943 8364937 2026-05-04T05:26:23Z RogueScholar 14671222 Created page with "Arredondamento de números grandes" 8364943 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|help:magic words#parser functions}}.) (a extensão ''pode'' ser configurada para fornecer funções adicionais para o tratamento de texto; estas funções de texto estão documentadas {{ll|Extension:ParserFunctions/String functions|noutra página}}). Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | Arredondamento de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] 5hlnn6uhx4riixljjt2jixbfvbsvokk 8364949 8364943 2026-05-04T05:30:16Z RogueScholar 14671222 Created page with "Você deve adicionar o símbolo $1 (barra vertical) depois do nome da variável." 8364949 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|help:magic words#parser functions}}.) (a extensão ''pode'' ser configurada para fornecer funções adicionais para o tratamento de texto; estas funções de texto estão documentadas {{ll|Extension:ParserFunctions/String functions|noutra página}}). Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | Arredondamento de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. Você deve adicionar o símbolo <code>|</code> (barra vertical) depois do nome da variável. (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] bhxokqrls0uswyl4npq6qrfavio285x 8364957 8364949 2026-05-04T05:35:03Z RogueScholar 14671222 Created page with "Se a cadeia de texto $1 for omitida, o valor $2 é devolvido, se não contenha erros." 8364957 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|help:magic words#parser functions}}.) (a extensão ''pode'' ser configurada para fornecer funções adicionais para o tratamento de texto; estas funções de texto estão documentadas {{ll|Extension:ParserFunctions/String functions|noutra página}}). Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | Arredondamento de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. Você deve adicionar o símbolo <code>|</code> (barra vertical) depois do nome da variável. (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. Se a cadeia de texto <code>correct</code> for omitida, o valor <code>test string</code> é devolvido, se não contenha erros. <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] bufvv849pt1yri099069y3di8clrx8n 8364963 8364957 2026-05-04T05:37:49Z RogueScholar 14671222 Created page with "Se a cadeia de texto $3 também for omitida, é devolvida uma cadeia vazia em caso de erro:" 8364963 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|help:magic words#parser functions}}.) (a extensão ''pode'' ser configurada para fornecer funções adicionais para o tratamento de texto; estas funções de texto estão documentadas {{ll|Extension:ParserFunctions/String functions|noutra página}}). Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | Arredondamento de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. Você deve adicionar o símbolo <code>|</code> (barra vertical) depois do nome da variável. (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. Se a cadeia de texto <code>correct</code> for omitida, o valor <code>test string</code> é devolvido, se não contenha erros. Se a cadeia de texto <code>error</code> também for omitida, é devolvida uma cadeia vazia em caso de erro: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] by3pbl32gusnedy0vax04kqybklnco5 8364967 8364963 2026-05-04T05:40:58Z RogueScholar 14671222 Created page with "exceto por uma expressão de entrada vazia ou inválida (uma mensagem de erro é tratada como uma cadeia vazia; não é igual a zero, pelo que obtemos $1)." 8364967 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|help:magic words#parser functions}}.) (a extensão ''pode'' ser configurada para fornecer funções adicionais para o tratamento de texto; estas funções de texto estão documentadas {{ll|Extension:ParserFunctions/String functions|noutra página}}). Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | Arredondamento de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. Você deve adicionar o símbolo <code>|</code> (barra vertical) depois do nome da variável. (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. Se a cadeia de texto <code>correct</code> for omitida, o valor <code>test string</code> é devolvido, se não contenha erros. Se a cadeia de texto <code>error</code> também for omitida, é devolvida uma cadeia vazia em caso de erro: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> exceto por uma expressão de entrada vazia ou inválida (uma mensagem de erro é tratada como uma cadeia vazia; não é igual a zero, pelo que obtemos <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] bxj3hs1asajhnn60lt6beahm7zitkte 8364995 8364967 2026-05-04T06:07:34Z RogueScholar 14671222 Created page with "Podem ser omitidos um ou ambos os valores devolvidos; se o ramo correspondente é deixado vazio, não há saída:" 8364995 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|help:magic words#parser functions}}.) (a extensão ''pode'' ser configurada para fornecer funções adicionais para o tratamento de texto; estas funções de texto estão documentadas {{ll|Extension:ParserFunctions/String functions|noutra página}}). Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | Arredondamento de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. Você deve adicionar o símbolo <code>|</code> (barra vertical) depois do nome da variável. (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. Se a cadeia de texto <code>correct</code> for omitida, o valor <code>test string</code> é devolvido, se não contenha erros. Se a cadeia de texto <code>error</code> também for omitida, é devolvida uma cadeia vazia em caso de erro: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> exceto por uma expressão de entrada vazia ou inválida (uma mensagem de erro é tratada como uma cadeia vazia; não é igual a zero, pelo que obtemos <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Podem ser omitidos um ou ambos os valores devolvidos; se o ramo correspondente é deixado vazio, não há saída: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] 2bujjcuxldi2j9m7mwxbsk6v1nc87xi 8364997 8364995 2026-05-04T06:09:02Z RogueScholar 14671222 Created page with "Operadores booleanos de igualdade ou desigualdade são suportados." 8364997 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|help:magic words#parser functions}}.) (a extensão ''pode'' ser configurada para fornecer funções adicionais para o tratamento de texto; estas funções de texto estão documentadas {{ll|Extension:ParserFunctions/String functions|noutra página}}). Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | Arredondamento de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. Você deve adicionar o símbolo <code>|</code> (barra vertical) depois do nome da variável. (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. Se a cadeia de texto <code>correct</code> for omitida, o valor <code>test string</code> é devolvido, se não contenha erros. Se a cadeia de texto <code>error</code> também for omitida, é devolvida uma cadeia vazia em caso de erro: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> exceto por uma expressão de entrada vazia ou inválida (uma mensagem de erro é tratada como uma cadeia vazia; não é igual a zero, pelo que obtemos <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Podem ser omitidos um ou ambos os valores devolvidos; se o ramo correspondente é deixado vazio, não há saída: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' Operadores booleanos de igualdade ou desigualdade são suportados. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] rzgf3m6mayd3lvf7e2fcszjwxf2i5jd 8365000 8364997 2026-05-04T06:14:01Z RogueScholar 14671222 Created page with "Consulte o [[$1|Manual:Verificar a existência de uma página]] para conhecer outros métodos de verificação da existência de uma página com diferentes limitações" 8365000 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|help:magic words#parser functions}}.) (a extensão ''pode'' ser configurada para fornecer funções adicionais para o tratamento de texto; estas funções de texto estão documentadas {{ll|Extension:ParserFunctions/String functions|noutra página}}). Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | Arredondamento de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. Você deve adicionar o símbolo <code>|</code> (barra vertical) depois do nome da variável. (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. Se a cadeia de texto <code>correct</code> for omitida, o valor <code>test string</code> é devolvido, se não contenha erros. Se a cadeia de texto <code>error</code> também for omitida, é devolvida uma cadeia vazia em caso de erro: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> exceto por uma expressão de entrada vazia ou inválida (uma mensagem de erro é tratada como uma cadeia vazia; não é igual a zero, pelo que obtemos <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Podem ser omitidos um ou ambos os valores devolvidos; se o ramo correspondente é deixado vazio, não há saída: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' Operadores booleanos de igualdade ou desigualdade são suportados. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=Consulte o [[Manual:Checking for page existence|Manual:Verificar a existência de uma página]] para conhecer outros métodos de verificação da existência de uma página com diferentes limitações}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] pg1ufojoql7o8e16qbozk5dcfapj5dx 8365028 8365000 2026-05-04T06:21:09Z FuzzyBot 451990 Updating to match new version of source page 8365028 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|Help:Magic words#Parser functions}}.) (a extensão ''pode'' ser configurada para fornecer funções adicionais para o tratamento de texto; estas funções de texto estão documentadas {{ll|Extension:ParserFunctions/String functions|noutra página}}). Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | Arredondamento de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. Você deve adicionar o símbolo <code>|</code> (barra vertical) depois do nome da variável. (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. Se a cadeia de texto <code>correct</code> for omitida, o valor <code>test string</code> é devolvido, se não contenha erros. Se a cadeia de texto <code>error</code> também for omitida, é devolvida uma cadeia vazia em caso de erro: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> exceto por uma expressão de entrada vazia ou inválida (uma mensagem de erro é tratada como uma cadeia vazia; não é igual a zero, pelo que obtemos <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Podem ser omitidos um ou ambos os valores devolvidos; se o ramo correspondente é deixado vazio, não há saída: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' Operadores booleanos de igualdade ou desigualdade são suportados. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=Consulte o [[Manual:Checking for page existence|Manual:Verificar a existência de uma página]] para conhecer outros métodos de verificação da existência de uma página com diferentes limitações}} Esta função recebe uma cadeia de texto de entrada, interpreta-a como um título de página e devolve um de dois valores, dependendo se a página existe ou não no wiki local. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] tbez97z8cm52dwo1h3qsvkbvjep3sl1 8365042 8365028 2026-05-04T06:33:01Z RogueScholar 14671222 Created page with "A função avalia como $1 se a página existe, independente de conter conteúdo, estar visivelmente em branco (conter metadados, como ligações de categorias ou {{$help-magic|palavras mágicas}}, mas sem conteúdo visível), estar em branco ou ser {{$help-redirects|redirecionada}}." 8365042 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|Help:Magic words#Parser functions}}.) (a extensão ''pode'' ser configurada para fornecer funções adicionais para o tratamento de texto; estas funções de texto estão documentadas {{ll|Extension:ParserFunctions/String functions|noutra página}}). Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | Arredondamento de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. Você deve adicionar o símbolo <code>|</code> (barra vertical) depois do nome da variável. (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. Se a cadeia de texto <code>correct</code> for omitida, o valor <code>test string</code> é devolvido, se não contenha erros. Se a cadeia de texto <code>error</code> também for omitida, é devolvida uma cadeia vazia em caso de erro: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> exceto por uma expressão de entrada vazia ou inválida (uma mensagem de erro é tratada como uma cadeia vazia; não é igual a zero, pelo que obtemos <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Podem ser omitidos um ou ambos os valores devolvidos; se o ramo correspondente é deixado vazio, não há saída: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' Operadores booleanos de igualdade ou desigualdade são suportados. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=Consulte o [[Manual:Checking for page existence|Manual:Verificar a existência de uma página]] para conhecer outros métodos de verificação da existência de uma página com diferentes limitações}} Esta função recebe uma cadeia de texto de entrada, interpreta-a como um título de página e devolve um de dois valores, dependendo se a página existe ou não no wiki local. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> A função avalia como {{phpi|true}} se a página existe, independente de conter conteúdo, estar visivelmente em branco (conter metadados, como ligações de categorias ou {{ll|Help:Magic words|palavras mágicas}}, mas sem conteúdo visível), estar em branco ou ser {{ll|Help:Redirects|redirecionada}}. <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] 2i9g1n0076p06l6xpy552z7x96fjmps 8365046 8365042 2026-05-04T06:54:31Z RogueScholar 14671222 Created page with "Apenas as páginas ligadas a vermelho são avaliadas como $2, até se a página já existisse, mas foi eliminada." 8365046 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|Help:Magic words#Parser functions}}.) (a extensão ''pode'' ser configurada para fornecer funções adicionais para o tratamento de texto; estas funções de texto estão documentadas {{ll|Extension:ParserFunctions/String functions|noutra página}}). Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | Arredondamento de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. Você deve adicionar o símbolo <code>|</code> (barra vertical) depois do nome da variável. (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. Se a cadeia de texto <code>correct</code> for omitida, o valor <code>test string</code> é devolvido, se não contenha erros. Se a cadeia de texto <code>error</code> também for omitida, é devolvida uma cadeia vazia em caso de erro: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> exceto por uma expressão de entrada vazia ou inválida (uma mensagem de erro é tratada como uma cadeia vazia; não é igual a zero, pelo que obtemos <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Podem ser omitidos um ou ambos os valores devolvidos; se o ramo correspondente é deixado vazio, não há saída: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' Operadores booleanos de igualdade ou desigualdade são suportados. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=Consulte o [[Manual:Checking for page existence|Manual:Verificar a existência de uma página]] para conhecer outros métodos de verificação da existência de uma página com diferentes limitações}} Esta função recebe uma cadeia de texto de entrada, interpreta-a como um título de página e devolve um de dois valores, dependendo se a página existe ou não no wiki local. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> A função avalia como {{phpi|true}} se a página existe, independente de conter conteúdo, estar visivelmente em branco (conter metadados, como ligações de categorias ou {{ll|Help:Magic words|palavras mágicas}}, mas sem conteúdo visível), estar em branco ou ser {{ll|Help:Redirects|redirecionada}}. Apenas as páginas ligadas a vermelho são avaliadas como {{phpi|false}}, até se a página já existisse, mas foi eliminada. :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] hhbkp4ahmag0q7w3bbk8lb3tcwu9wln 8365049 8365046 2026-05-04T06:57:54Z RogueScholar 14671222 Created page with "A função é avaliada como $1 para {{$system|mensagens do sistema}} que foram personalizadas e para {{$special|páginas especiais}} que são definidas pelo software." 8365049 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|Help:Magic words#Parser functions}}.) (a extensão ''pode'' ser configurada para fornecer funções adicionais para o tratamento de texto; estas funções de texto estão documentadas {{ll|Extension:ParserFunctions/String functions|noutra página}}). Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | Arredondamento de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. Você deve adicionar o símbolo <code>|</code> (barra vertical) depois do nome da variável. (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. Se a cadeia de texto <code>correct</code> for omitida, o valor <code>test string</code> é devolvido, se não contenha erros. Se a cadeia de texto <code>error</code> também for omitida, é devolvida uma cadeia vazia em caso de erro: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> exceto por uma expressão de entrada vazia ou inválida (uma mensagem de erro é tratada como uma cadeia vazia; não é igual a zero, pelo que obtemos <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Podem ser omitidos um ou ambos os valores devolvidos; se o ramo correspondente é deixado vazio, não há saída: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' Operadores booleanos de igualdade ou desigualdade são suportados. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=Consulte o [[Manual:Checking for page existence|Manual:Verificar a existência de uma página]] para conhecer outros métodos de verificação da existência de uma página com diferentes limitações}} Esta função recebe uma cadeia de texto de entrada, interpreta-a como um título de página e devolve um de dois valores, dependendo se a página existe ou não no wiki local. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> A função avalia como {{phpi|true}} se a página existe, independente de conter conteúdo, estar visivelmente em branco (conter metadados, como ligações de categorias ou {{ll|Help:Magic words|palavras mágicas}}, mas sem conteúdo visível), estar em branco ou ser {{ll|Help:Redirects|redirecionada}}. Apenas as páginas ligadas a vermelho são avaliadas como {{phpi|false}}, até se a página já existisse, mas foi eliminada. :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' A função é avaliada como {{phpi|true}} para {{ll|Help:System message|mensagens do sistema}} que foram personalizadas e para {{ll|Help:Special pages|páginas especiais}} que são definidas pelo software. :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] cemiuj36wlv4sfl9352ru7anhtwl5a4 8365052 8365049 2026-05-04T07:00:09Z RogueScholar 14671222 Created page with "Antes do MediaWiki 1.45, se uma página verificar um destino usando $ifexist, essa página aparecerá na lista $spec-wth da página de destino." 8365052 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|Help:Magic words#Parser functions}}.) (a extensão ''pode'' ser configurada para fornecer funções adicionais para o tratamento de texto; estas funções de texto estão documentadas {{ll|Extension:ParserFunctions/String functions|noutra página}}). Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | Arredondamento de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. Você deve adicionar o símbolo <code>|</code> (barra vertical) depois do nome da variável. (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. Se a cadeia de texto <code>correct</code> for omitida, o valor <code>test string</code> é devolvido, se não contenha erros. Se a cadeia de texto <code>error</code> também for omitida, é devolvida uma cadeia vazia em caso de erro: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> exceto por uma expressão de entrada vazia ou inválida (uma mensagem de erro é tratada como uma cadeia vazia; não é igual a zero, pelo que obtemos <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Podem ser omitidos um ou ambos os valores devolvidos; se o ramo correspondente é deixado vazio, não há saída: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' Operadores booleanos de igualdade ou desigualdade são suportados. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=Consulte o [[Manual:Checking for page existence|Manual:Verificar a existência de uma página]] para conhecer outros métodos de verificação da existência de uma página com diferentes limitações}} Esta função recebe uma cadeia de texto de entrada, interpreta-a como um título de página e devolve um de dois valores, dependendo se a página existe ou não no wiki local. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> A função avalia como {{phpi|true}} se a página existe, independente de conter conteúdo, estar visivelmente em branco (conter metadados, como ligações de categorias ou {{ll|Help:Magic words|palavras mágicas}}, mas sem conteúdo visível), estar em branco ou ser {{ll|Help:Redirects|redirecionada}}. Apenas as páginas ligadas a vermelho são avaliadas como {{phpi|false}}, até se a página já existisse, mas foi eliminada. :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' A função é avaliada como {{phpi|true}} para {{ll|Help:System message|mensagens do sistema}} que foram personalizadas e para {{ll|Help:Special pages|páginas especiais}} que são definidas pelo software. :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} Antes do MediaWiki 1.45, se uma página verificar um destino usando <code>#ifexist:</code>, essa página aparecerá na lista [[{{#special:WhatLinksHere}}]] da página de destino. <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] kto8e0evzhchvhb96pm55azcy65j9wl 8365054 8365052 2026-05-04T07:02:56Z RogueScholar 14671222 Created page with "Portanto, se o código $code1:Foo $code2 for incluído diretamente nesta página ($fullpagename1), [[$wth/Foo]] listará $fullpagename2." 8365054 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|Help:Magic words#Parser functions}}.) (a extensão ''pode'' ser configurada para fornecer funções adicionais para o tratamento de texto; estas funções de texto estão documentadas {{ll|Extension:ParserFunctions/String functions|noutra página}}). Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | Arredondamento de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. Você deve adicionar o símbolo <code>|</code> (barra vertical) depois do nome da variável. (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. Se a cadeia de texto <code>correct</code> for omitida, o valor <code>test string</code> é devolvido, se não contenha erros. Se a cadeia de texto <code>error</code> também for omitida, é devolvida uma cadeia vazia em caso de erro: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> exceto por uma expressão de entrada vazia ou inválida (uma mensagem de erro é tratada como uma cadeia vazia; não é igual a zero, pelo que obtemos <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Podem ser omitidos um ou ambos os valores devolvidos; se o ramo correspondente é deixado vazio, não há saída: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' Operadores booleanos de igualdade ou desigualdade são suportados. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=Consulte o [[Manual:Checking for page existence|Manual:Verificar a existência de uma página]] para conhecer outros métodos de verificação da existência de uma página com diferentes limitações}} Esta função recebe uma cadeia de texto de entrada, interpreta-a como um título de página e devolve um de dois valores, dependendo se a página existe ou não no wiki local. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> A função avalia como {{phpi|true}} se a página existe, independente de conter conteúdo, estar visivelmente em branco (conter metadados, como ligações de categorias ou {{ll|Help:Magic words|palavras mágicas}}, mas sem conteúdo visível), estar em branco ou ser {{ll|Help:Redirects|redirecionada}}. Apenas as páginas ligadas a vermelho são avaliadas como {{phpi|false}}, até se a página já existisse, mas foi eliminada. :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' A função é avaliada como {{phpi|true}} para {{ll|Help:System message|mensagens do sistema}} que foram personalizadas e para {{ll|Help:Special pages|páginas especiais}} que são definidas pelo software. :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} Antes do MediaWiki 1.45, se uma página verificar um destino usando <code>#ifexist:</code>, essa página aparecerá na lista [[{{#special:WhatLinksHere}}]] da página de destino. Portanto, se o código <code><nowiki>{{#ifexist:Foo }}</nowiki></code> for incluído diretamente nesta página ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] listará {{FULLPAGENAME}}. <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] asgxp32w7zuqca55598bx7kj7nm0m02 8365057 8365054 2026-05-04T07:22:23Z RogueScholar 14671222 8365057 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|Help:Magic words#Parser functions}}.) (''Pode'' ser configurado para fornecer funções adicionais do analisador para o tratamento de cadeias de texto; elas só estão disponíveis para wikis que não pertencem à Fundação Wikimedia, portanto, estão documentadas {{ll|Extension:ParserFunctions/String functions|em outros lugares}}.) Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:boolean algebra (logic)|álgebra de booliano]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | Arredondamento de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. Você deve adicionar o símbolo <code>|</code> (barra vertical) depois do nome da variável. (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. Se a cadeia de texto <code>correct</code> for omitida, o valor <code>test string</code> é devolvido, se não contenha erros. Se a cadeia de texto <code>error</code> também for omitida, é devolvida uma cadeia vazia em caso de erro: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> exceto por uma expressão de entrada vazia ou inválida (uma mensagem de erro é tratada como uma cadeia vazia; não é igual a zero, pelo que obtemos <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Podem ser omitidos um ou ambos os valores devolvidos; se o ramo correspondente é deixado vazio, não há saída: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' Operadores booleanos de igualdade ou desigualdade são suportados. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=Consulte o [[Manual:Checking for page existence|Manual:Verificar a existência de uma página]] para conhecer outros métodos de verificação da existência de uma página com diferentes limitações}} Esta função recebe uma cadeia de texto de entrada, interpreta-a como um título de página e devolve um de dois valores, dependendo se a página existe ou não no wiki local. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> A função avalia como {{phpi|true}} se a página existe, independente de conter conteúdo, estar visivelmente em branco (conter metadados, como ligações de categorias ou {{ll|Help:Magic words|palavras mágicas}}, mas sem conteúdo visível), estar em branco ou ser {{ll|Help:Redirects|redirecionada}}. Apenas as páginas ligadas a vermelho são avaliadas como {{phpi|false}}, até se a página já existisse, mas foi eliminada. :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' A função é avaliada como {{phpi|true}} para {{ll|Help:System message|mensagens do sistema}} que foram personalizadas e para {{ll|Help:Special pages|páginas especiais}} que são definidas pelo software. :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} Antes do MediaWiki 1.45, se uma página verificar um destino usando <code>#ifexist:</code>, essa página aparecerá na lista [[{{#special:WhatLinksHere}}]] da página de destino. Portanto, se o código <code><nowiki>{{#ifexist:Foo }}</nowiki></code> for incluído diretamente nesta página ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] listará {{FULLPAGENAME}}. <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] dobxktw20ykrsnxombvyfapgy6b7z1z 8365059 8365057 2026-05-04T07:29:46Z RogueScholar 14671222 8365059 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de analisador]] adicionais para complementar aquelas que já estão presentes no núcleo da MediaWiki. (Consulte {{ll|Help:Magic words#Parser functions}}.) (''Pode'' ser configurado para fornecer funções adicionais do analisador para o tratamento de cadeias de texto; elas só estão disponíveis para wikis que não pertencem à Fundação Wikimedia, portanto, estão documentadas {{ll|Extension:ParserFunctions/String functions|em outros lugares}}.) Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#nome da função''': ''argumento 1'' | ''argumento 2'' | ''argumento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=um '''manual mais aprofundado''' sobre os pontos mais delicados de como funciona o avaliador de expressão, incluindo alguns operadores adicionais não abordados aqui|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unários | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binários | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e devolve o valor calculado. A função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados à direita, por ordem de precedência. Consulte {{ll|Manual:Expr parser function syntax}} para mais detalhes sobre a função de cada operador. A exatidão e o formato do resultado devolvido dependem do sistema operativo do servidor que está a executar a wiki e do formato numérico do idioma do ''site''. Quando avaliar utilizando a [[w:pt:Álgebra booliana|álgebra booliana]], o número zero assume {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Uma expressão de entrada vazia devolve uma cadeia de carateres vazia. As expressões inválidas devolvem uma das várias mensagens de erro, que podem ser apanhadas utilizando a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração antes ou depois de um número é significativa, e pode ser tratada como um valor positivo ou negativo em vez de como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note que, se utilizar o resultado das palavras mágicas, tem de formatá-las para remover vírgulas e traduzir os números. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde nós queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido por <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os números são traduzidos. Por exemplo, no idioma Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> produz resultados incorretos para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de carateres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se pretende efetuar cálculos com base em datas (por exemplo, determinar se a data e a hora atuais são posteriores a outra data e hora), primeiro converta a hora para o número de segundos depois de 1 de janeiro de 1970 utilizando <nowiki>{{#time: xNU }}</nowiki>, e depois pode simplesmente somar e subtrair as datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número à sua esquerda para um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número à direita. Para arredondar por excesso ou por defeito, use os operadores unários <code>ceil</code> ou <code>floor</code> respetivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || O algarismo final é < 5, não ocorre nenhum arredondamento aparente (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || O algarismo final é ≥ 5, portanto é arredondado por excesso (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Novamente, o resultado é arredondado por excesso no último algarismo, o que resulta num arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima porque valores negativos arredondam à esquerda da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para a centésima mais próxima porque valores positivos arredondam à direita da vírgula decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o número inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Até o número inteiro "mais próximo", que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Por excesso para o inteiro mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Por excesso para o inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Até ao número inteiro mais próximo, que é menos um |- ! colspan=3 {{hl2}} | Arredondamento por excesso ou defeito com ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Até ao número inteiro "maior" mais próximo, que é um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Por defeito para o inteiro mais próximo ''menor'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Por excesso para o inteiro mais próximo maior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Por defeito para o inteiro mais próximo menor, que é o menos um |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como seria de esperar}} |- ! colspan=3 {{hl2}} | Arredondamento de números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondamento para um número muito grande leva ao infinito. Assim, o valor original sem o infinito é dado como resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual ao de cima. |} === Strings === As expressões só funcionam com valores semelhantes a números, não podem comparar textos (''strings'') nem caracteres. Em alternativa, pode usar-se [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função determina se um texto de teste tem conteúdo ou está vazio. Um texto de teste que só contém caracteres em branco (espaços, linhas novas, etc.) é considerado vazio. :<syntaxhighlight lang="wikitext" inline>{{#if: texto de teste | valor se o texto de teste não está vazio | valor se o texto de teste está vazio (ou só contém caracteres em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio a função apresenta o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas caracteres em branco (espaços, linhas novas, etc.) ela apresenta o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' O texto de teste é sempre interpretado como texto puro, portanto as expressões matemáticas não são avaliadas (consulte [[##ifexpr|#ifexpr]] para isso): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (falso) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser intercalada. Para fazê-lo, coloque a função #if interior na sua forma integral, no lugar de um parâmetro da função #if exterior. É possível intercalar até uma profundidade de sete níveis, embora isto possa depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:texto de teste | valor se o texto de teste não está vazio |{{#if:texto de teste |valor se o texto de teste não está vazio |valor se o texto de teste está vazio (ou só contém caracteres em branco) }} }} </syntaxhighlight> Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração <code>#if</code>. Você deve adicionar o símbolo <code>|</code> (barra vertical) depois do nome da variável. (Assim, se o parâmetro não tiver um valor, ele será avaliado como um texto vazio em vez do texto "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Colocou texto na variável 1 |2=Não há texto na variável 1 }} Consulte {{ll|Help:Parser functions in templates}} para mais exemplos desta função. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta função do analisador compara dois textos, determina se são ou não idênticos, e devolve um dos dois textos com base no resultado. Se mais comparações e sequências de saída forem necessárias, considere utilizar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os textos são valores numéricos válidos, os textos são comparados numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é sensível ao uso de maiúsculas e minúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(comparar com o exemplo semelhante acima, com <code>[[##expr|#expr]]</code> a devolver primeiro um número válido)'' Como um exemplo prático, considere um {{ll|Help:Templates|modelo}} <code>Template:Timer</code> existente utilizado o analisador para escolher dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usadas dentro de uma função do analisador sintático, quaisquer etiquetas do analisador e as outras funções do analisador sintático têm de ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isto afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os dois textos que são comparados forem chamadas idênticas para uma mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas, então o resultado é verdadeiro, mas se forem chamadas para duas predefinições distintas com conteúdo idêntico que contenham essas etiquetas, o resultado é falso. }} {{Warning|1=As comparações literais com {{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}} podem falhar dependendo da configuração do ''site''. Por exemplo, <nowiki>{{FULLPAGENAME}}</nowiki>, dependendo da wiki, pode converter a primeira letra para maiúsculas, e irá substituir todos os espaços sublinhados com espaços. Para contornar isto, aplique a palavra mágica a ambos os parâmteros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe um texto de entrada e devolve um de dois resultados; resulta no valor <code>true</code> se o texto de entrada contém um objeto HTML com <code>class="error"</code>, tal como é gerado por outras funções do analisador sintático como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros nos [[Special:MyLanguage/Help:Templates|modelos]] como ciclos e recursividade, e outros erros do analisador ''failsoft''. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Podem ser omitidas uma ou ambas as cadeias de texto a devolver. Se a cadeia de texto <code>correct</code> for omitida, o valor <code>test string</code> é devolvido, se não contenha erros. Se a cadeia de texto <code>error</code> também for omitida, é devolvida uma cadeia vazia em caso de erro: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento seja adicionada, utilizar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e devolve um de dois textos, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como para <code>[[##expr|#expr]]</code> acima, estando disponíveis os mesmos operadores. A saída é então avaliada como uma expressão booliana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, portanto esta função é equivalente a uma que use apenas <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> exceto por uma expressão de entrada vazia ou inválida (uma mensagem de erro é tratada como uma cadeia vazia; não é igual a zero, pelo que obtemos <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Podem ser omitidos um ou ambos os valores devolvidos; se o ramo correspondente é deixado vazio, não há saída: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' Operadores booleanos de igualdade ou desigualdade são suportados. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados de comparações numéricas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre são compatíveis com <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code>, e não devolvem resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Porque PHP utilizado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, este devolve o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado de igual está realmente incorreto. Este comportamento no <code>[[##ifexpr|#ifexpr]]</code> é causado porque o MediaWiki converte números literais em expressões no tipo ''float'' que, para os números inteiros grandes como estes, envolve arredondamentos.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=Consulte o [[Manual:Checking for page existence|Manual:Verificar a existência de uma página]] para conhecer outros métodos de verificação da existência de uma página com diferentes limitações}} Esta função recebe uma cadeia de texto de entrada, interpreta-a como um título de página e devolve um de dois valores, dependendo se a página existe ou não no wiki local. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> A função avalia como {{phpi|true}} se a página existe, independente de conter conteúdo, estar visivelmente em branco (conter metadados, como ligações de categorias ou {{ll|Help:Magic words|palavras mágicas}}, mas sem conteúdo visível), estar em branco ou ser {{ll|Help:Redirects|redirecionada}}. Apenas as páginas ligadas a vermelho são avaliadas como {{phpi|false}}, até se a página já existisse, mas foi eliminada. :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' A função é avaliada como {{phpi|true}} para {{ll|Help:System message|mensagens do sistema}} que foram personalizadas e para {{ll|Help:Special pages|páginas especiais}} que são definidas pelo software. :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] não foi personalizado) }} Antes do MediaWiki 1.45, se uma página verificar um destino usando <code>#ifexist:</code>, essa página aparecerá na lista [[{{#special:WhatLinksHere}}]] da página de destino. Portanto, se o código <code><nowiki>{{#ifexist:Foo }}</nowiki></code> for incluído diretamente nesta página ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] listará {{FULLPAGENAME}}. <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === limites de ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <span id="ifexist_and_wanted_pages"></span> === páginas de ifexist e desejadas === <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → o nível atual *<code>..</code> → ir para cima um nível *<code>/foo</code> → ir para baixo um nível na subdiretoria /foo <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Consulte também: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Predefinição === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupar resultados === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Utilizar com parâmetros === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Consulte {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparação === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! O seu tipo ! Obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituir #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano de 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano de 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana e dia da semana |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a manhã (00:00:00 → 11:59:59), caso contrário, "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão em maiúsculas de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zero à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 12 horas, sem zero à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zero à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Hora Unix]]. Segundos desde 1 de janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso Horário (desde [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferença para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferença para a hora de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias no mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não gregorianos |- ! {{hl3}} colspan="3" | Islâmico |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice de mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias no mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice de mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano de 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genetiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema do Fuso Horário ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Consulte também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Consulte também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <span id="String_functions"></span> == Funções de ''string'' == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de ''string'' se <code>$wgPFEnableStringFunctions</code> está definido para {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para a documentação, e {{ll|Manual:Performing string operations with parser functions}} para exemplos. {{Warning |1=Em 2013, foi decidido que '''estas funções "nunca" serão ativadas em qualquer wiki da Wikimédia''', porque elas são ineficientes quando utilizadas em larga escala (consulte [[phab:T8455]] para algum histórico). '''Estas funções 'NÃO' funcionam nas wikis da Wikimédia!'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === As funções do analisador podem ser [[Special:MyLanguage/Help:Substitution|substituídas]] colocando o prefixo <code>'''subst:'''</code> antes do caráter cardinal: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserido no texto wiki se a página {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contêm código volátil '''não''' substituído, como as {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para resultados consistentes, deve-se substituir todo o código volátil na expressão sob avaliação. Consulte [[w:Help:Substitution|Ajuda: Substituição]].}} A substituição não funciona entre {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; pode utilizar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para esta finalidade. <span id="Redirects"></span> == Redireciona == <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <span id="In_tables"></span> ==== Nas tabelas ==== <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrição ! Digita ! Obtém |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Nas chamadas de modelo ==== <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão do tipo de caráter === * '''Minúscula:''' {{xpdoc|lc: AbC|}} * '''Maiúscula:''' {{xpdoc|uc: AbC|}} * '''Primeiro caráter minúsculo:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caráter maiúsculo:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> resulta em ---- "{{urlencode: AbC dEf ghi}}" ---- Assim as novas linhas interiores são convertidas em %0A, e os espaços interiores convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> resulta em ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Consulte também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções de analisador adicionadas pelo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – em particular para a formatação de número e ''padding'' * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] ravz1khgcxyt20h2akbatsbh2pjty3g Help:Extension:ParserFunctions/tr 12 48912 8365036 8353952 2026-05-04T06:21:35Z FuzzyBot 451990 Updating to match new version of source page 8365036 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span class="mw-translate-fuzzy">{{ll|Extension:ParserFunctions|nsp=0}} uzantısı, MediaWiki'de zaten mevcut olan "{{$2|sihirli kelimeleri}}" tamamlamak için on bir ek [[Special:MyLanguage/Parser functions|ayrıştırıcı işlevi]] sağlar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> (Dize işleme için ek ayrıştırıcı işlevleri sağlamak üzere ''yapılandırılabilir''; bu dize işlevleri {{ll|Extension:ParserFunctions/String functions|başka yere}} belgelenmiştir.) Bu uzantı tarafından sağlanan tüm ayrıştırıcı işlevleri şu şekildedir: :<code><nowiki>{{</nowiki>'''#işlevadı''': ''değişken 1'' | ''değişken 2'' | ''değişken 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tür ! {{hl1}} | Operatörler |- | {{hl2}} | Gruplama (parantezler) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Sayılar | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | ikili operatör <code>'''e'''</code> &nbsp; tekli <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Tekli | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | İkili | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Yuvarlama | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Mantık | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Bu işlev, matematiksel bir ifadeyi değerlendirir ve hesaplanan değeri döndürür. Bu işlev, <code>mw.ext.ParserFunctions.expr</code> işlevi aracılığıyla {{ll|Extension:Scribunto|nsp=0}} olarak da kullanılabilir. :<code><nowiki>{{#expr:</nowiki> ''ifade'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span class="mw-translate-fuzzy">Kullanılabilir operatörler, öncelik sırasına göre sağda listelenir. Her operatörün işleviyle ilgili daha fazla ayrıntı için [[{{ll|Manual:Expr parser function syntax}}|Help:Hesaplama]] sayfasına bakın. Döndürülen sonucun doğruluğu ve biçimi, vikiyi çalıştıran sunucunun işletim sistemine ve site dilinin sayı biçimine bağlı olarak değişecektir.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div class="mw-translate-fuzzy"> [[:tr:Boole cebiri|Boole cebri]] kullanılarak değerlendirme yapılırken, sıfır <code>false</code> olarak değerlendirilir ve pozitif veya negatif herhangi bir sıfır olmayan değer <code>true</code> olarak değerlendirilir: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Boş bir giriş ifadesi boş bir dize döndürür. Geçersiz ifadeler, <code>[[##iferror|#iferror]]</code> işlevi kullanılarak yakalanabilecek birkaç hata mesajından birini döndürür: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' Bir sayıdan önce veya sonra toplama ve çıkarma işlenenlerinin sırası anlamlıdır ve hatalı girdi içeren bir işlenen yerine pozitif veya negatif bir değer olarak kabul edilebilir: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span class="mw-translate-fuzzy">Sihirli kelimelerin çıkışını kullanıyorsanız, virgülleri kaldırmak ve sayıları çevirmek için bunları ham formatlamanız gerektiğini unutmayın. Örneğin, $numberofusers, $numberofusers2 kullanılarak elde edilebilecek $nou-result-raw ile istediğimiz yerde $nou-result ile sonuçlanır. Bu, özellikle sayıların çevrildiği bazı dillerde önemlidir. Örneğin, Bengalce'de $numberofusers3, $bengali üretir.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<code>mod</code> operatörü, ikinci bağımsız değişkenin bazı değerleri için yanlış sonuçlar veriyor: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (boş bir dize üretir; 123 olmalı)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span class="mw-translate-fuzzy">Tarihlere dayalı hesaplamalar yapmak istiyorsanız (örneğin, geçerli tarih ve saatin başka bir tarih ve saatten sonra olup olmadığını test edin), önce <nowiki>{{#time: xNU }}</nowiki> kullanarak zamanı 1 Ocak 1970'den sonraki saniye sayısına dönüştürün, ardından basitçe ekleyebilir ve tarihleri sayı olarak çıkarın.</span>}} <span id="Rounding"></span> === Yuvarlama === [https://php.net/function.round Yuvarlaklar] soldaki sayıyı bir kuvvete yükseltilmiş 1/10'un katına çıkarır, üs sağda verilen sayının kesik değerine eşittir. Yukarı veya aşağı yuvarlamak için sırasıyla tekli <code>ceil</code> veya <code>floor</code> kullanın. {| class="wikitable" ! {{hl1}} | Test durumu ! {{hl1}} | Sonuç ! {{hl1}} | Yuvarlama yöntemi |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || Son rakam < 5 olduğundan belirgin bir yuvarlama oluşmaz (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || Son rakam ≥ 5 olduğundan yuvarlanır (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Yine, sonuç son basamağa yuvarlanır, bu da ek yuvarlama ile sonuçlanır (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Negatif değerler ondalık noktanın soluna yuvarlandığından en yakın 100'e yuvarlanır |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Pozitif değerler ondalık noktanın sağına yuvarlandığından en yakın 100'e yuvarlanır |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Yuvarlama dizinindeki ondalık sayılar, yuvarlanan sonuçta hiçbir fark yaratmaz |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Ondalık kısım kesildi (doğranmış) |- ! colspan=3 {{hl2}} | En yakın tam sayıya yuvarlama |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Sıfır olan ''en yakın'' tamsayıya kadar |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Bir olan en yakın tamsayıya kadar |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Bir olan en yakın tamsayıya kadar |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Sıfır olan en yakın tamsayıya kadar |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Negatif olan en yakın tam sayıya kadar |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Negatif olan en yakın tam sayıya kadar |- ! colspan=3 {{hl2}} | ''tavan'' ve ''zemin'' ile yukarı veya aşağı yuvarlama |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Bir sonraki ''daha büyük'' tam sayıya kadar |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Sıfır olan bir sonraki ''daha küçük'' tam sayıya kadar |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Sıfır olan bir sonraki daha büyük tam sayıya kadar |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Negatif olan bir sonraki daha küçük tam sayıya kadar |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || 1 zaten bir tam sayı olduğundan yuvarlanmaz<br />{{Warning|1=Tahmin edebileceğiniz gibi '''ceil('''1/3''')''' olarak değil, '''(ceil''' 1''')'''/3 olarak yorumlandı}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <span id="Strings"></span> === Dizeler === İfadeler yalnızca sayı benzeri değerlerle çalışır, dizeleri veya karakterleri karşılaştıramazlar. Bunun yerine [[#ifeq]] kullanılabilir. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Bu işlev, bir test dizesini değerlendirir ve boş olup olmadığını belirler. Yalnızca boşluk içeren bir test dizisi boş olarak kabul edilir. :<syntaxhighlight lang="wikitext" inline>{{#if: test dizesi | test dizisi boş değilse değer | test dizisi boşsa (veya yalnızca beyaz boşluk) değer}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: ilk parametre | ikinci parametre | üçüncü parametre }}</syntaxhighlight> Bu işlev, ilk olarak ilk parametrenin boş olup olmadığını test eder. İlk parametre boş değilse, işlev ikinci bağımsız değişkeni görüntüler. İlk parametre boşsa veya yalnızca boşluk karakterleri (boşluklar, yeni satırlar vb.) içeriyorsa, üçüncü bağımsız değişkeni görüntüler. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' Test dizesi her zaman saf metin olarak yorumlanır, bu nedenle matematiksel ifadeler değerlendirilmez (bunun için [[##ifexpr|#ifexpr]] sayfasına bakın): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' Son parametre (false) atlanabilir: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' İşlev iç içe olabilir. Bunu yapmak için, #if işlevinin bir parametresi yerine iç #if işlevini tam biçiminde yuvalayın. Yedi seviyeye kadar iç içe yerleştirme mümkündür, ancak bu vikiye veya bir bellek sınırına bağlı olabilir. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test dizesi | test dizisi boş değilse değer |{{#if:test string |value if test string is not empty |test dizisi boşsa (veya yalnızca beyaz boşluk) değer }} }} </syntaxhighlight> <span class="mw-translate-fuzzy"><code>#if</code> ifadenizde test dizesi olarak bir parametre de kullanabilirsiniz. Değişken adından sonra $1 (boru sembolü) eklediğinizden emin olmanız gerekir.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> (Böylece parametrenin bir değeri yoksa, "<code><nowiki>{{{1}}}</nowiki></code>" dizesi yerine boş bir dize olarak değerlendirilir.) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=1 değişkeninde metin girdiniz |2=1 değişkeninde metin yok }} Bu ayrıştırıcı işlevine ilişkin daha fazla örnek için {{ll|Help:Parser functions in templates}} sayfasına bakın. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Bu ayrıştırıcı işlevi, iki giriş dizesini karşılaştırır, özdeş olup olmadıklarını belirler ve sonuca göre iki dizeden birini döndürür. Daha fazla karşılaştırma ve çıkış dizisi gerekiyorsa, <code>#switch</code> kullanmayı düşünün. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Her iki dizi de geçerli sayısal değerlerse, diziler sayısal olarak karşılaştırılır: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Aksi hâlde karşılaştırma metin olarak yapılır; bu karşılaştırma büyük/küçük harf duyarlıdır: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(yukarıdaki benzer örnekle tırnak işaretleri olmadan karşılaştırın)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(yukarıdaki benzer örnekle karşılaştırın, önce <code>[[##expr|#expr]]</code> geçerli bir sayı döndürür)'' <span class="mw-translate-fuzzy">Pratik bir örnek olarak, kısa ve uzun olmak üzere iki standart zaman arasında seçim yapmak için ayrıştırıcıyı kullanan mevcut bir <code>Template:Timer</code> {{ll|Help:Templates|şablonu}} düşünün.</span> "short" dizesiyle karşılaştırılacak ilk giriş olarak parametreyi alır. Sıralama için bir konvansiyon yoktur, ancak parametre önce giderse okunması daha kolaydır. Şablon kodu şu şekilde tanımlanır: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> aşağıdakiler ortaya çıkar: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Bir ayrıştırıcı işlevi içinde kullanıldığında, tüm ayrıştırıcı etiketleri ve diğer ayrıştırıcı işlevleri geçici olarak {{ll|Strip marker|benzersiz bir kod}} ile değiştirilmelidir. Bu, karşılaştırmaları etkiler: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Karşılaştırılacak dizeler, bu etiketleri içeren aynı {{ll|Help:Templates|şablon}} için eşit çağrılar olarak verilirse, koşul doğrudur, ancak bu tür etiketleri içeren aynı içeriğe sahip iki şablon olması durumunda yanlıştır. }} {{Warning|1=Site yapılandırmasına bağlı olarak {{ll|Help:Magic words#Page names|sayfa-adı sihirli kelimeler}} ile birebir karşılaştırmalar başarısız olabilir. Örneğin, vikiye bağlı olarak <nowiki>{{FULLPAGENAME}}</nowiki>, ilk harfi büyük yazabilir ve tüm alt çizgileri boşluklarla değiştirir. Bu sorunu çözmek için sihirli kelimesini her iki parametreye de uygulayın: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Bu işlev bir giriş dizesi alır ve iki sonuçtan birini döndürür; giriş dizesi, <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> ve <code>[[##rel2abs|#rel2abs]]</code> gibi diğer ayrıştırıcı işlevler tarafından oluşturulan $hatalı bir HTML nesnesi içeriyorsa, döngüler ve özyinelemeler gibi [[Special:MyLanguage/Help:Templates|şablon]] hataları varsa, işlev <code>true</code> olarak değerlendirilir, ve diğer "failsoft" ayrıştırıcı hataları. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">Dönüş dizelerinden biri veya her ikisi atlanabilir. <code>''correct''</code> dizesi atlanırsa, hatalı değilse <code>''test string''</code> döndürülür. <code>''error''</code> dizesi de atlanırsa, bir hata durumunda boş bir dize döndürülür:</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == Bu işlev, matematiksel bir ifadeyi değerlendirir ve sonucun boole değerine bağlı olarak iki dizeden birini döndürür: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div class="mw-translate-fuzzy"> <code>''expression''</code> girişi tam olarak yukarıdaki <code>[[##expr|#expr]]</code> için olduğu gibi değerlendirilir ve aynı operatörler kullanılabilir. Çıkış daha sonra bir boole ifadesi olarak değerlendirilir. </div> Boş bir giriş ifadesi {{phpi|false}} olarak değerlendirilir: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Yukarıda bahsedildiği gibi, sıfır {{phpi|false}} olarak değerlendirilir ve sıfır olmayan herhangi bir değer {{phpi|true}} olarak değerlendirilir, bu nedenle bu işlev yalnızca <code>[[##ifeq|#ifeq]]</code> ve <code>[[##expr|#expr]]</code> kullanan bir işleve eşdeğerdir: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div class="mw-translate-fuzzy"> boş veya yanlış bir giriş ifadesi dışında (bir hata mesajı boş bir dize olarak değerlendirilir; sıfıra eşit değildir, bu nedenle <code>''value if true''</code> alırız). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' karşılama :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Dönüş değerlerinden biri veya her ikisi atlanabilir; uygun dal boş bırakıldığında çıkış verilmez: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<code>[[##ifexpr|#ifexpr]]</code> ile sayısal karşılaştırmaların sonuçları her zaman <code>[[##ifeq|#ifeq]]</code> ve <code>[[##switch|#switch]]</code> sonuçlarıyla eşleşmez. Bu son ikisi <code>[[##ifexpr|#ifexpr]]</code> değerden daha doğrudur ve eşdeğer sonuçlar döndürmez. Değiştirilen son rakamla bu karşılaştırmayı düşünün: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <code>[[##ifeq|#ifeq]]</code> ve <code>[[##switch|#switch]]</code> içinde kullanılan PHP, tamsayı türünde iki sayıyı karşılaştırdığından, beklenen sonucu doğru şekilde döndürür. <code>[[##ifexpr|#ifexpr]]</code> ve aynı sayılarla: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Farklı rakamla, eşittir sonucu aslında yanlıştır. <code>[[##ifexpr|#ifexpr]]</code> değerindeki bu davranış, MediaWiki'nin ifadelerdeki değişmez sayıları, bunun gibi büyük tamsayılar için yuvarlamayı içeren float türüne dönüştürmesinden kaynaklanır.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} Bu işlev bir giriş dizesi alır, onu sayfa başlığı olarak yorumlar ve sayfanın yerel vikide bulunup bulunmadığına bağlı olarak iki değerden birini döndürür. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">Sayfa mevcutsa, içerik barındırıyorsa, görünür şekilde boşsa (kategori bağlantıları veya {{ll|Help:Magic words|sihirli kelimeler}} gibi meta veriler içeriyorsa, ancak görünür bir içerik sayfası yoksa işlev <code>true</code> olarak değerlendirir.), boş veya bir {{ll|Help:Redirects|yönlendirme}} değerlendirilir. Sayfanın önceden var olduğu ancak silindiği de dahil olmak üzere, yalnızca kırmızı bağlantı verilen sayfalar <code>false</code> olarak değerlendirilir.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div class="mw-translate-fuzzy"> İşlev, özelleştirilmiş {{ll|Help:System message|sistem mesajları}} ve yazılım tarafından tanımlanan {{ll|Help:Special pages|özel sayfalar}} için <code>true</code> olarak değerlendirilir. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (çünkü bu vikide {{ll|Extension:Checkuser|nsp=0}} uzantısı yüklüdür) | '''doesn't exist''' (çünkü {{ll|Extension:Checkuser|nsp=0}} uzantısı bu vikide yüklü değil) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (çünkü [[{{ns:8}}:Copyright]] özelleştirildi) | '''doesn't exist''' (çünkü [[{{ns:8}}:Copyright]] özelleştirilmedi) }} <span class="mw-translate-fuzzy">Bir sayfa <code>#ifexist:</code> kullanarak bir hedefi kontrol ederse, o sayfa hedef sayfanın [[{{#special:WhatLinksHere}}]] listesinde görünür. Dolayısıyla, $code1:Foo $code2 kodu bu sayfaya ($fullpagename1) canlı olarak dahil edildiyse, [[$wth/Foo]] $fullpagename2 sayfasını listeleyecektir.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> Paylaşılan bir medya deposu kullanan wikilerde, bir dosyanın depoya yüklenip yüklenmediğini kontrol etmek için <code>#ifexist:</code> kullanılabilir, ancak vikinin kendisine yüklenmez: :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' Dosya için yerel bir açıklama sayfası oluşturulmuşsa, yukarıdakilerin tümü için sonuç '''var''' olur. <code>#ifexist:</code> vikiarası bağlantıları ile çalışmaz. <span id="ifexist_limits"></span> === ifexist sınırları === <code>#ifexist:</code>, "zengin bir ayrıştırıcı işlevi" olarak kabul edilir; herhangi bir sayfaya yalnızca sınırlı sayıda dahil edilebilir (yansıtılmış şablonların içindeki işlevler dahil). Bu sınır aşıldığında, hedef sayfanın var olup olmadığına bakılmaksızın diğer <code>#ifexist:</code> işlevleri otomatik olarak false döndürür ve sayfa [[:Category:{{MediaWiki:expensive-parserfunction-category}}]] olarak sınıflandırılır. {{ll|Help:Tracking categories|İzleme kategorisi}} adı vikinizin içerik diline göre değişebilir. <span class="mw-translate-fuzzy">Bazı kullanım durumlarında, <code>a.new</code> (var olmayan sayfalara bağlantılar seçmek için) veya <code>a:not(.new)</code> (mevcut sayfalara bağlantı seçmek için) seçicilerini kullanarak CSS ile ifexist efektini taklit etmek mümkündür.</span> <span class="mw-translate-fuzzy">Ayrıca, tek bir sayfada kullanılabilecek pahalı ayrıştırıcı işlevlerin sayısı <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code> ile kontrol edildiğinden, gerekirse LocalSettings.php içindeki sınırı da arttırılabilir.</span> <span id="ifexist_and_wanted_pages"></span> === ifexist ve istenen sayfalar === <span class="mw-translate-fuzzy">Mevcut olmayan ve #ifexist kullanımı için test edilen bir sayfa [[Special:MyLanguage/Manual:WantedPages|İstenen Sayfalar]]'da yer alacaktır.</span> Nedeni için {{phab|T14019}} ve bir geçici çözüm için [[w:Template:Linkless exists]] sayfasına bakın. == #rel2abs == Bu işlev, göreli bir dosya yolunu mutlak bir dosya yoluna dönüştürür. :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <code>path</code> girişi içinde aşağıdaki sözdizimi geçerlidir: *<code>.</code> → mevcut düzey *<code>..</code> → bir düzey yukarı çıkın *<code>/foo</code> → /foo alt dizinine bir düzey aşağı inin <code>base path</code> belirtilmezse, bunun yerine sayfanın tam sayfa adı kullanılacaktır: :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <code>/.</code> veya <code>/./</code> gibi geçersiz sözdizimi yoksayılır. İkiden fazla ardışık nokta izin verilmediğinden, ardışık ifadeleri ayırmak için aşağıdaki gibi diziler kullanılabilir: :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Ayrıca bakınız: [[w:Help:Switch parser function]]'' Bu işlev, bir giriş değerini birkaç test durumuyla karşılaştırır ve bir eşleşme bulunursa ilişkili bir dize döndürür. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Örnekler: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' Kısmi yansıtma etiketli <nowiki>#</nowiki>switch, şablon kodlamasına aşina olmayan bir düzenleyicinin yapılandırılabilir ögeleri görüntülemesini ve düzenlemesini sağlayan bir yapılandırma dosyasını etkileyebilir. <span id="Default"></span> === Varsayılan === <code>''case''</code> dizesi <code>''karşılaştırma dizesi''</code> ile eşleşmezse, <code>''varsayılan sonuç''</code> döndürülür: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' Bu sözdiziminde, varsayılan sonuç son parametre olmalı ve ham eşittir işareti içermemelidir (<code><nowiki>{{}}</nowiki></code> olmadan bir eşittir işareti). Varsa, büyük/küçük harf karşılaştırması olarak kabul edilecek ve hiçbir vaka eşleşmediyse hiçbir metin görüntülenmeyecektir. Bunun nedeni, varsayılan değerin tanımlanmamış olmasıdır (boş). Ancak bir durum eşleşirse, ilişkili dizesi döndürülür. :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> Alternatif olarak, varsayılan sonuç, bir <code>''case''</code> "<code>#default</code>" dizesiyle açıkça bildirilebilir. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Bu şekilde bildirilen varsayılan sonuçlar, işlev içinde herhangi bir yere yerleştirilebilir: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <code>''default''</code> parametresi atlanırsa ve eşleşme olmazsa, hiçbir <code>''sonuç''</code> döndürülmez: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Gruplandırma sonuçları === Birkaç <code>''case''</code> dizgisinin aynı <code>''sonuç''</code> dizgisini döndürdüğü 'geçiş' değerlerine sahip olmak mümkündür. Bu, çoğaltmayı en aza indirir. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Burada 2, 3 ve 4 numaralı durumların tümü <code>''result234''</code> döndürür; durum 6 ve 7'nin her ikisi de <code>''result67''</code> döndürür. Yukarıdaki durumda son parametredeki "<code>#default = </code>" atlanabilir. <span id="Use_with_parameters"></span> === Parametrelerle kullanın === İşlev, test dizesi olarak parametrelerle birlikte kullanılabilir. Bu durumda, boruyu parametre adından sonra yerleştirmek gerekli değildir, çünkü "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" dizesi olarak bir büyük/küçük harf ayarlamayı seçmeniz pek olası değildir. (Bu, boru yoksa ve parametre yoksa veya bir değere sahipse parametrenin varsayılan olarak alacağı değerdir. {{ll|Help:Parser functions in templates}} sayfasına bakın.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> Yukarıdaki durumda, <code><nowiki>{{{1}}}</nowiki></code>, <code>foo</code> ile eşitse, işlev <code>Foo</code> döndürür. <code>baz</code> ile eşitse, işlev <code>Baz</code> döndürür. Parametre boşsa veya mevcut değilse, işlev <code>Bar</code> döndürür. Yukarıdaki bölümde olduğu gibi, durumlar tek bir sonuç verecek şekilde birleştirilebilir. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> Burada <code><nowiki>{{{1}}}</nowiki></code>, <code>foo</code>, <code>zoo</code> veya <code>roo</code> ile eşitse, işlev <code>Foo</code> döndürür. <code>baz</code> ile eşitse, işlev <code>Baz</code> döndürür. Parametre boşsa veya mevcut değilse, işlev <code>Bar</code> döndürür. Ek olarak, test parametre değeri herhangi bir durumla eşleşmezse hiçbir şey döndürmek istemiyorsanız varsayılan sonuç atlanabilir. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> Bu durumda, işlev, <code><nowiki>{{{1}}}</nowiki></code> mevcut olmadığı ve <code>foo</code> veya <code>bar</code> ile eşit olmadığı sürece boş bir dize döndürür; bu durumda sırasıyla <code>Foo</code> veya <code>Bar</code> döndürür. Bu, varsayılan sonucu boş olarak bildirmekle aynı etkiye sahiptir. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> Herhangi bir nedenle bir durumu "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" olarak ayarlamaya karar verirseniz, parametre olmadığında veya bir değeri olmadığında işlev bu durumun sonucunu döndürür. İşlevin varsayılan sonucunu döndürmek için parametrenin var olması ve "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" dizesinden başka bir değere sahip olması gerekir. :(<code><nowiki>{{{1}}}</nowiki></code> olmadığında veya boş olduğunda): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span class="mw-translate-fuzzy">(<code><nowiki>{{{1}}}</nowiki></code> "<code>test</code>" değerine sahip olduğunda):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(<code><nowiki>{{{1}}}</nowiki></code>, "<code><nowiki>{{{1}}}</nowiki></code>" değerine sahip olduğunda): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' Bu varsayımsal durumda, boruyu (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>) parametresine eklemeniz gerekir. <span id="Comparison_behavior"></span> === Karşılaştırma davranışı === <code>[[##ifeq|#ifeq]]</code> ile olduğu gibi, karşılaştırma dizesi ve test edilen durum dizisinin her ikisi de sayısal ise karşılaştırma sayısal olarak yapılır; veya aksi takdirde büyük/küçük harfe duyarlı bir dize olarak: :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' Bir <code>''case''</code> dizesi boş olabilir: :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' Bir eşleşme bulunduğunda, sonraki <code>''cases''</code> yoksayılır: :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <code>[[##switch|#switch]]</code> ve <code>[[##ifeq|#ifeq]]</code> ile yapılan sayısal karşılaştırmalar, ifadelerdeki karşılaştırmalara eşdeğer değildir (yukarıya da bakın): :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <span id="Raw_equal_signs"></span> === Ham eşittir işaretleri === <div class="mw-translate-fuzzy"> "Case" dizeleri ham eşittir işaretleri içeremez. Bu sorunu çözmek için, tek bir eşittir işareti içeren bir $tpl şablonu oluşturun: $code1 veya eşittir işaretini HTML kodu <code><nowiki>&amp;#61;</nowiki></code> ile değiştirin. </div> Örnek: {| class="wikitable" ! Yazdığın ! Yaptığın |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span class="mw-translate-fuzzy">Bu işlevin kullanımının basit bir gerçek yaşam örneği için [$enwp-nba-color Template:NBA color] sayfasını kontrol edin. $tpl-ext ve [[w:Template:BOTREQ]] altında iki karmaşık örnek bulunabilir.</span> }} <span id="Replacing_#ifeq"></span> === #ifeq değiştirme === <div class="mw-translate-fuzzy"> <code>#switch</code>, [[Special:MyLanguage/Help:Expansion depth|genişleme derinliğini]] azaltmak için kullanılabilir. </div> Örneğin: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> eşdeğerdir * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> yani derin yuvalama, doğrusal: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> Öte yandan, anahtarın değiştirilmesi, her iki dalda iç içe geçmiş IF'ler için karmaşık/pratik olabilir (girinti alternatifleriyle gösterilir, her iki tarafta girintili), tam simetrik ağaç yapar: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Kod ! {{hl1}} | Açıklama ! {{hl1}} | Mevcut çıkış<br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Güncellemek için bu sayfanın önbelleğini temizleyin])</small> |- ! {{hl2}} colspan="3"| Yıl |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | 4 haneli yıl. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | 2 haneli yıl. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | Artık yıl ise 1, değilse 0. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|PHP 5.1.0 ve daha yenisini ve [[rev:45208]] gerektirir.|group=note}} | Belirtilen haftanın ISO-8601 yılı.{{#tag:ref|Bu, Y ile aynı değere sahiptir, ancak ISO hafta numarası (W) önceki veya sonraki yıla aitse, bunun yerine o yıl kullanılır.|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|Not 1 yerine getirilmezse, değişmez ''o'' çıkışını alır.|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Ay |- | style="text-align: center;" | <code>n</code> | Ay indeksi, sıfır dolgulu değil. | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | Ay indeksi, sıfır dolgulu. | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | Site dilinde ay adının kısaltması. | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | Site dilinde tam ay adı. | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | Tam ay adını [[:tr:Genitif|genitif]] formunda, tam ve [[w:Nominative case|yalın]] formları arasında ayrım yapan site dilleri için çıkış alın. Bu seçenek, Lehçe, Rusça, Beyaz Rusça, Çekçe, Slovakça, Slovence, Ukraynaca vb. gibi birçok [[:tr:Slav dilleri|Slav dilleri]] için kullanışlıdır. | style="line-height: 1.6;" | Lehçe için:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(yalın)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitif) |- ! {{hl2}} colspan="3"| Ayın veya yılın günü |- | style="text-align: center;" | <code>j</code> | Ayın günü, sıfır dolgulu değil. | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | Ayın günü, sıfır dolgulu. | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | Yılın günü (Ocak&nbsp;1 = 0).<br />{{note}} Yılın ISO gününü almak için 1 ekleyin. | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Hafta ve haftanın günü |- | style="text-align: center;" | <code>W</code> | ISO 8601 hafta numarası, sıfır dolgulu. | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | ISO 8601 haftanın günü (Pazartesi = 1, Pazar = 7). | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | Haftanın gün sayısı (Pazar = 0, Cumartesi = 6). | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | Haftanın gününün kısaltması. Nadiren uluslararasılaştırılmış. | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | Tam hafta içi adı. Nadiren uluslararasılaştırılmış. | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Saat |- | style="text-align: center;" | <code>a</code> | sabahları "am" (00:00:00 → 11:59:59), aksi takdirde "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span class="mw-translate-fuzzy">Yukarıdaki <code>a</code> ifadesinin büyük harfli versiyonu.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | 12 saat biçiminde saat, sıfır dolgulu değil. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | 12 saat biçiminde saat, sıfır dolgulu. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | 24 saat biçiminde saat, sıfır dolgulu değil. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| 24 saat biçiminde saat, sıfır dolgulu. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Dakika ve saniye |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | Dakikalar geçti, sıfır dolgulu. | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | Dakikayı saniyeler geçti, sıfır dolgulu. | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[:tr:Unix zaman|Unix zaman]]. 1 Ocak 1970 00:00:00 GMT'den bu yana saniyeler. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Saat dilimi ([[MediaWiki_1.22/Roadmap|1.22wmf2]] itibarıyla) |- | style="text-align: center;" | <code>e</code> | Saat dilimi tanımlayıcısı. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | Tarihin gün ışığından yararlanma saatinde olup olmadığı. | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Greenwich saati (GMT) farkı | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | İki nokta üst üste ile Greenwich saatine (GMT) göre fark | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Saat dilimi kısaltması. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | Saniye cinsinden zaman dilimi farkı. | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Çeşitli |- | style="text-align: center;" | <code>t</code> | Geçerli aydaki gün sayısı. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span class="mw-translate-fuzzy">ISO 8601 formatlı tarih, <code>Y-m-d"T"H:i:s+00:00</code> ile eşdeğer.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span class="mw-translate-fuzzy">[[rfc:5322|RFC 5322]] biçimlendirilmiş tarih, <code>D, j M Y H:i:s +0000</code> ile eşdeğer, hafta içi gün adı ve ay adı uluslararasılaştırılmamış.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Gregoryen olmayan takvimler |- ! {{hl3}} colspan="3" | İslami |- | style="text-align: center;" | <code>xmj</code> | Ayın günü. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Tam ay adı. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Ay indeksi. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Tam yıl. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | İran (Celili) |- | style="text-align: center;" | <code>xit</code> | Aydaki gün sayısı. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Yılın günü. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Ayın günü. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Tam ay adı. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Ay indeksi. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Tam yıl. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | 2 haneli yıl. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | İbrani |- | style="text-align: center;" | <code>xjj</code> | Ayın günü. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Tam ay adı. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Aydaki gün sayısı. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Ay adının genel biçimi. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Ay numarası. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Tam yıl. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Tay güneşi |- | style="text-align: center;" | <code>xkY</code> | [[:tr:Tayland güneş takvimi|Tayland güneş takviminde]] tam yıl. <br />{{note}} 1941'den önceki yıllar için, Ocak-Mart aralığındaki tarihler doğru şekilde [[:tr:Tayland güneş takvimi#Yeni yıl|hesaplanmamış]]. | {{#time:xkY}} |- ! {{hl3}} colspan="3" | Minguo/Juche yılı |- | style="text-align: center;" | <code>xoY</code> | Tam yıl. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | Japon nengosu |- | style="text-align: center;" | <code>xtY</code> | Tam yıl. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | İşaretler |- | style="text-align: center;" | <code>xn</code> | Sonraki sayısal kodu ham ASCII numarası olarak biçimlendirin. | Hintçe dilinde <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight>, ०६, 06 üretir. |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span class="mw-translate-fuzzy"><code>xn</code> gibi, ancak dizenin sonuna veya dizede <code>xN</code> ögesinin bir sonraki görünümüne kadar süren, geçişli bir işaret olarak.</span> |- | style="text-align: center;" | <code>xr</code> | Sonraki sayıyı romen rakamı olarak biçimlendirin. Yalnızca 10.000'e kadar olan sayılar için çalışır<br /><small>(MediaWiki 1.20 öncesi sürümde 3.000'e kadar)</small>. | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | Sonraki numarayı bir İbrani rakamı olarak biçimlendirin. | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} Bu ayrıştırıcı işlevi bir tarih ve/veya saat (Miladi takvimde) alır ve verilen sözdizimine göre biçimlendirir. Bir tarih/saat nesnesi belirtilebilir; varsayılan değer [[Special:MyLanguage/Help:Magic words#Date and time|sihirli kelime]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; diğer bir deyişle, sayfanın en son HTML'ye dönüştürüldüğü zaman. :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> Kabul edilen biçimlendirme kodlarının listesi sağdaki tabloda verilmiştir. Biçimlendirme dizesindeki tanınmayan herhangi bir karakter değiştirilmeden geçirilir; bu aynı zamanda boşluklar için de geçerlidir (sistemin kodları yorumlamak için bunlara ihtiyacı yoktur). <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> Biçimlendirme dizesindeki karakterlerden kaçmanın da iki yolu vardır: # <span class="mw-translate-fuzzy"># Bir biçimlendirme karakterinin ardından gelen bir ters eğik çizgi, tek bir değişmez karakter olarak yorumlanır</span> # <span class="mw-translate-fuzzy"># Çift tırnak içine alınmış karakterler, değişmez karakterler olarak kabul edilir ve tırnak işaretleri kaldırılır.</span> Ek olarak, <code>xx</code> digrafı tek bir değişmez "x" olarak yorumlanır. Biçimlendirme kodları listesi gelişmeye devam ettikçe (yeni takvimlerin veya farklı şekilde hesaplanan ve biçimlendirilen yeni tarih alanlarının desteğiyle), iletilmesi gereken tüm değişmez karakterlerden (yalnızca şu anda biçimlendirme kodlarında kullanılan ASCII harflerini değil) kaçınmalısınız. Ne yazık ki, şimdilik, ASCII tek tırnak işareti, hâlihazırda desteklenen ASCII çift tırnak işaretine değişmez metni işaretlemek için basit bir alternatif olarak ve ters eğik çizgiler (JSON, C, C++, PHP, JavaScript, Lua dahil olmak üzere birçok dil tarafından kullanılan dize sabitlerinde de kaçılması gerekir) tanınmamaktadır (örneğin, JSON, C, C++... içinde dize değerlerinin sınırlandırılması gibi diğer kullanımlar için çift tırnak zorunludur). Dolayısıyla, herhangi bir çifte alıntıyı ters eğik çizgi ile çıkarmadan gömemezsiniz (veya bunun yerine başka kıvırcık, açısal veya kare tırnak işaretleri kullanabilirsiniz). :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <code>''tarih/zaman nesnesi''</code> PHP'nin [https://php.net/function.strtotime strtotime()] işlevi tarafından kabul edilen herhangi bir biçimde olabilir. Mutlak (ör. <code>20 December 2000</code>), göreli (ör. <code>+20 hours</code>) ve birleşik zamanlar (ör. <code>30 July +1 year</code>) kabul edilir. :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' [[w:ISO 639-3|ISO 639-3]] (?) içindeki <code>''dil kodu''</code>, dizenin seçilen dilde görüntülenmesini sağlar :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <code>''local''</code> parametresi, ''tarih/saat nesnesinin'' yerel saat dilimine mi yoksa UTC'ye mi atıfta bulunduğunu belirtir. Bu bir boole parametresidir: değeri, bağımsız değişkenin değeri kullanılarak belirlenir (dizenin boole değerlerine nasıl dönüştürüldüğüne ilişkin ayrıntılar için [https://php.net/language.types.boolean#language.types.boolean.casting resmi PHP belgelerine] bakın). {{note|2=reminder|1=Lütfen, {{phpi|$wgLocaltimezone}} değişkeni <code>UTC</code> olarak ayarlanırsa, <code>local</code>, <code>true</code> veya <code>false</code> olarak ayarlandığında çıktıda hiçbir fark olmadığını unutmayın.}} Ayrıntılar için aşağıdaki örneklere bakın: :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div class="mw-translate-fuzzy"> Bir Unix zaman damgası hesapladıysanız, onu önceden bir <code>@</code> sembolü ekleyerek tarih hesaplamalarında kullanabilirsiniz. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div class="mw-translate-fuzzy"> Sayısal zaman damgası değerlerinden önce <code>@</code> öneki olmadan, sonuç çoğu zaman bir hatadır veya beklenmeyen bir değerdir: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (doğru) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (desteklenmeyen yıl biçimi) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (doğru) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' (geçerli ay ve ayın günü ile bir yıl olarak yorumlanır) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (doğru) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' (geçerli ay ve ayın günü ile bir yıl olarak yorumlanır) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (doğru) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (desteklenmeyen yıl biçimi) }} {{Warning|1= Kabul edilebilir giriş aralığı 1 Ocak 0111 → 31 Aralık 9999'dur. 100 ile 110 yılları için çıktı tutarsızdır, Y ve artık yıllar 100-110 yılları gibidir, r, D, l ve U bu yılları şu şekilde 2000-2010 yorumlamak gibidir. :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> (doğru, artık yıl yok), ancak :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' (yanlış, 100, 2000 olarak yorumlansa bile, çünkü o artık bir yıldır) :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' 0-99 arasındaki yıl sayıları 2000-2069 ve 1970-1999 olarak yorumlanır, ancak başta sıfırlar ile 4 basamaklı biçimde yazıldığında: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) Hafta içi, 100-110 yılları için sağlanır ve 1753'ten itibaren 111-1752 yılları için r-çıkışı "Bilinmeyen" ve l-çıkışı "<>" gösterir. Sonuç olarak, r-çıkışı bu yıllar için giriş olarak kabul edilmemektedir. }} Tam veya kısmi mutlak tarihler belirtilebilir; işlev, ''geçerli'' değerler kullanılarak belirtilmeyen tarihin bölümlerini "doldurur": :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= Doldurma özelliği tutarlı değil; bazı kısımlar mevcut değerler kullanılarak doldurulur, diğerleri doldurulmaz: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' Günün başlangıcını, ancak ayın geçerli gününü ve geçerli yılı verir. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' Günün başlangıcını, ancak yılın geçerli gününü verir. Doldurulan günün istisna durumu var: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' Günün başlangıcını ve ayın başlangıcını verir. }} Dört basamaklı bir sayı her zaman bir yıl olarak yorumlanır, asla saat ve dakika olarak yorumlanmaz:<ref>2011'de {{rev|86805}} önce durum böyle değildi.</ref> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' Altı basamaklı bir sayı, mümkünse saat, dakika ve saniye olarak yorumlanır, ancak aksi takdirde bir hata olarak yorumlanır (örneğin, bir yıl ve ay değil): :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' Giriş, yıl+ay kodu yerine zaman olarak değerlendirilir. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' 19:60:09 geçerli bir zaman olmasa da 196009, Eylül 1960 olarak yorumlanmaz. İşlev, belirli bir miktarda tarih matematiği gerçekleştirir: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span class="mw-translate-fuzzy">$time çağrılarının biçim dizelerinin toplam uzunluğu 6000 karakterle sınırlıdır.<ref>[https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$9 ParserFunctions.php] phabricator.wikimedia.org adresinde</ref></span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Saat Dilimi sorunu ==== Bu #time ayrıştırıcı işlevinde (daha özel olarak ''PHP DateTime'' içinde), göreli zaman dilimi ofsetleri olarak ''tamsayı olmayan'' ögelerin iletilmesine izin vermeyen bir hata var. Bu sorun, EDT gibi bir saat dilimi kullanıldığında geçerli değildir. Örneğin: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} Ancak Hindistan, UTC'den +5.5 saatlik bir zaman farkı üzerindedir ve bu nedenle kendi saat dilimini kullanmak, normal olarak göreli bir zaman dilimi farkının doğru hesaplanmasına izin vermez. İşte olanlar: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} Bu soruna geçici bir çözüm bulmak için, zamanı şu şekilde dakikalara veya saniyelere dönüştürmeniz yeterlidir: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} (Bu işlevin geliştiricisi Tim Starling, bu çözüm için tam sözdizimini sağladı.) <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == Bu işlev, <code>local</code> parametresi {{phpi|true}} olarak ayarlandığında <code><nowiki>{{#time: ... }}</nowiki></code> ile aynıdır, bu nedenle her zaman vikinin yerel saatini kullanır ({{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}} içinde ayarlandığı gibi). İşlevin sözdizimi şöyledir: :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=Lütfen, {{phpi|$wgLocaltimezone}} değişkeni <code>UTC</code> olarak ayarlanırsa, <code>local</code>, {{phpi|true}} veya {{phpi|false}} olarak ayarlandığında çıktıda hiçbir fark olmadığını unutmayın}} [[File:Time-Timel.png|thumb|Saat diliminin UTC olmadığı bir sunucudan #time ve #timel ayrıştırıcı işlevlerinin kullanımına örnek]] Örneğin, aşağıdaki örneklere bakın: :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid üzerinden uyarı örneği]] {{Warning|1= U'nun hem zaman hem de zaman dilimi için 1970-01-01 00:00:00 UTC'den farklı zaman dilimlerine sahip Vikipedi'lerde UTC'den (önceden GMT olarak biliniyordu) aynı sayıda saniye döndüreceğini unutmayın. :<code>U</code> Unix zamanı. 1 Ocak 1970 00:00:00 GMT'den bu yana saniyeler. :<code>Z</code> Saniye cinsinden zaman dilimi farkı. :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == Bu işlev, bir sayfa başlığını eğik çizgilere göre bölümlere ayırır ve ardından bu bölümlerden bazılarını çıkış olarak döndürür. : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=sayfa adı |2=döndürülecek segment sayısı |3=geri dönen ilk segment }} Döndürülecek segment sayısı parametresi belirtilmemişse, varsayılan olarak "0" olur ve ''döndürülecek ilk segment'' üzerinden (dahil) tüm segmentleri döndürür. ''döndürülecek ilk segment'' parametresi belirtilmemişse veya "0" ise varsayılan olarak "1" olur: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' Her iki değer için de negatif değerler kabul edilir. ''döndürülecek segment sayısı'' parametresi için negatif değerler, dizenin sonundaki segmentleri etkin bir şekilde şerit eder. ''döndürülecek ilk segment'' için negatif değerler "bu segment sağdan sayılarak başla" anlamına gelir: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' Dizenin sonundan bir segment çıkarır. Ayrıca bakınız {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' Dizenin sonundan 4 parçayı da çıkarır : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' Dizenin sonundan 5 parça çıkarır (var olandan fazla) : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' Son segmenti döndürür. Ayrıca bakınız {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' Dizenin sonundan bir segmenti çıkarır, ardından ikinci segmenti ve ötesini döndürür : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' İkinci son öğeden kopyalamaya başlayın; dizenin sonundan bir segmenti çıkarın İşlemeden önce, ''sayfa adı'' parametresinin kodu HTML ile çözülür: eğer bazı standart HTML karakter varlıkları içeriyorsa, bunlar düz karakterlere dönüştürüleceklerdir (UTF-8 ile dahili olarak kodlanmıştır, yani bu ayrıştırıcı işlevini kullanan MediaWiki kaynak sayfasındakiyle aynı kodlama). : Örneğin, ''sayfa adı'' içindeki herhangi bir <code>&amp;quot;</code>, <code>&amp;#34;</code> veya <code>&amp;#x22;</code> oluşumu <code>"</code> ile değiştirilecektir. : HTML'den düz metne başka bir dönüşüm gerçekleştirilmez, bu nedenle HTML etiketleri, sayfa başlıklarında geçersiz olsalar bile bu ilk adımda olduğu gibi bırakılır. {{tip| 1= MediaWiki'nin (<code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> ve benzeri gibi) bazı sihirli anahtar kelimeleri veya ayrıştırıcı işlevlerinin, kendi giriş parametreleri HTML olarak kodlanmamış olsa bile, gereksiz yere HTML kodlu dizeler döndürdüğü bilinmektedir: titleparts ayrıştırıcı işlevi daha sonra, bu döndürülen dizeleri, parametrede bir sayfa adı alan (<code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code> gibi ancak hâlâ HTML-kodlanmış giriş dizeleri ile düzgün çalışmayan) diğer bazı ayrıştırıcı işlevler tarafından doğru şekilde işlenebilmeleri için dönüştürmek için bir geçici çözüm olarak kullanılabilir. This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. Örneğin, geçerli sayfa [[commons:Category:Côte-d'Or|Category:Côte-d'Or]] ise, o zaman: * <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight> ve <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> kodunun her ikisi de <code>1</code>; (#ifeq ayrıştırıcı işlevi, giriş parametrelerinin HTML kodunu çözme işlemini gerçekleştirir). * <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight> ve <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight>'nin her ikisi de <code>1</code>; (#switch ayrıştırıcı işlevi, giriş parametrelerinin HTML kodunu çözme işlemini gerçekleştirir). * <syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight> ve hatta <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight>, eğer o kategori sayfası varsa, <code>1</code> değerini döndürür (#ifexist ayrıştırıcı işlevi, giriş parametrelerinin HTML kodunu çözme işlemini gerçekleştirir); * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> sıfır olmayan bir sayı döndürür, eğer o kategori sayfalar veya alt kategoriler içeriyorsa '''ancak''': * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, tıpkı aşağıdaki gibi '''koşulsuz''' olarak 0 döndürebilir: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> Bu beklenmedik davranışın nedeni, MediaWiki'nin güncel sürümlerinde iki uyarı olmasıdır: * <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, hatta <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> bile, beklenen <code>Category:Côte-d'Or</code> değil, gerçekte HTML kodlu <code>Category:Côte-d&apos;Or</code> dizesini ''döndürebilir'' ve: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''koşulsuz şekilde''' 0 döndürür (PAGESINCAT sihirli anahtar kelimesi, giriş parametresinin HTML kodunu çözmez). titleparts kullanan basit geçici çözüm (ki bu, MediaWiki'nin sonraki bir sürümünde iki uyarı düzeltilirse çalışmaya devam edecektir): * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, hepsi aynı kategorideki gerçek sayfa sayısını döndürür. }} Ardından, kodu çözülen ''sayfa adı'' mümkün olduğunca MediaWiki tarafından desteklenen standart bir sayfa başlığına standart hâle getirilir: # Tüm alt çizgiler otomatik olarak boşluklarla değiştirilir: #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span class="mw-translate-fuzzy">Orijinaldeki alt çizgiye rağmen bah_boo değil.</span> # Dize en fazla 25 kez bölünür; daha fazla eğik çizgi yok sayılır ve 25. öğe dizenin geri kalanını içerecektir. Dize ayrıca [[Special:MyLanguage/Manual:Page table#Schema summary|sayfa başlığı]] olarak kabul edildiğinden 255 karakterle sınırlıdır: #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: Herhangi bir nedenle bu işlevi sınırına kadar zorlamanız gerekiyorsa, pek olası olmasa da, işlev çağrılarını iç içe geçirerek 25 bölme sınırını atlamak mümkündür: #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # Son olarak, ilk alt dize yerel vikinin büyük harf kullanımı ayarlarına göre büyük harfle yazılır (bu alt dize de yerel bir ad alanı adıyla başlıyorsa, bu ad alanı adı da normalleştirilir). #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= #titleparts ile küçük bir "dize ayrıştırıcı ve dönüştürücü" olarak kullanabilirsiniz, ancak bunun büyük harfli ilk alt dizeyi döndürdüğünü düşünün: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' Küçük harf gerekiyorsa, çıkışı kontrol etmek için lc: işlevini kullanın: : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' Doğru ilk alt dize büyük harf kullanımını (büyük harf veya küçük harf) elde etmek için dizenin başına bir sahte eğik çizgi ekleyebilirsiniz. ''döndürülecek ilk segment'' için <code>1</code> yerine <code>2</code> kullanın: : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span class="mw-translate-fuzzy">Bir sayfa başlığında geçersiz olan belirli karakterler, #titleparts ögesinin dizeyi ayrıştırmamasına neden olur:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Beklenen üretmez: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. Sayfa başlıklarında köşeli parantezler geçersiz olduğundan ve bu ayrıştırıcı işlevi, MediaWiki sözdizimini veya diğer HTML veya MediaWiki etiketlerini kullansalar bile, giriş ''sayfa adı'' parametresine gömülü bağlantıları işlemediği için çalışmaz. : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". Sayfa başlıklarında "#" da yasa dışı olduğu için çalışmıyor. }} {{Warning|1= <div class="mw-translate-fuzzy"> Başlığın herhangi bir kısmı yalnızca "<code>.</code>" veya "<code>..</code>" ise, #titleparts dizeyi ayrıştırmaz: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. Tüm dize döndürülür. Bekleneni üretmiyor: '''one''' }} {{Warning|1= Giriş UTF-8'de 255 baytı aşarsa bu işlev düzgün bir şekilde bozulmaz. Giriş dizesi 256 bayt veya daha fazlaysa, tüm dize döndürülür. }} <span id="String_functions"></span> == StringFunctions == {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Genel noktalar == <span id="Substitution"></span> === Yerine koyma === Ayrıştırıcı işlevleri, karma karakterinin önüne <code>'''subst:'''</code> eklenerek [[Special:MyLanguage/Help:Substitution|yerine koyabilir]]: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' kodu, {{FULLPAGENAME}} var olduğu sayfasından itibaren vikimetne eklenecektir. {{Warning|1= Yerine koyan ayrıştırıcı işlevlerinin sonuçları, ifadeler {{ll|Help:Magic words#Variables|değişikenler}} veya diğer ayrıştırıcı işlevleri gibi yerine koyulmuş (koyulmamış) geçici kod içeriyorsa tanımsızdır. Tutarlı sonuçlar için, değerlendirilecek ifadedeki tüm uçucu kod değiştirilmelidir. [[w:Help:Substitution|Yardım:Yerine koyma]] sayfasına bakın.}} Yerine koyma {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }} içinde çalışmaz; bu amaçla <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> kullanabilirsiniz. <span id="Redirects"></span> === Yönlendirmeler === Özellikle [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]], tarihler içeren sayfalara {{ll|Help:Redirects|yönlendirmeler}} için kullanışlı olabilir, ancak bu işe yaramaz. <span id="Escaping_pipe_characters"></span> <div class="mw-translate-fuzzy"> === Tablolarda kaçan boru karakterleri === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> Ayrıştırıcı işlevleri, {{ll|Help:Tables|vikitablo}} sözdizimini ve düz çizgi karakterlerini (<code><nowiki>|</nowiki></code>) yönetecek ve tüm ham boru karakterlerini parametre bölücüler olarak değerlendirecektir. Bunu önlemek için çoğu viki, içeriği yalnızca ham boru karakteri (<code><nowiki>|</nowiki></code>) olan bir şablon [[{{ns:10}}:!]] kullandı, çünkü MW 1.24 bir {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> sihirli kelime}} bu çamurun yerini aldı. Bu, boruyu MediaWiki ayrıştırıcısından 'gizler' ve bir sayfadaki tüm şablonlar ve değişkenler genişletilene kadar dikkate alınmamasını sağlar. Daha sonra bir tablo satırı veya sütun ayırıcısı olarak yorumlanacaktır. Alternatif olarak, daha az sezgisel ve hataya daha açık olmasına rağmen ham HTML tablosu sözdizimi kullanılabilir. <div class="mw-translate-fuzzy"> Ayrıca, bir HTML varlığı kullanarak düz, yorumlanmamış bir karakter olarak görüntülemek için boru karakterinden de çıkabilirsiniz: <code>&amp;#124;</code>. </div> {| class="wikitable" ! Açıklama ! Yazdığın ! Yaptığın |- | Tablo satırı/sütun ayırıcısı olarak çıkış borusu karakteri | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | Düz karakter olarak çıkış borusu karakteri | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Boşlukları çıkarma === Yeni satırlar, sekmeler ve boşluklar dahil olmak üzere boşluk, bu ayrıştırıcı işlevlerinin tüm parametrelerinin başından ve sonundan çıkarılır. Bu istenmiyorsa, dizeler tırnak içine alındıktan sonra karşılaştırma yapılabilir. :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span class="mw-translate-fuzzy">then ve else bölümlerinin kırpılmasını önlemek için, $meta-tpl-if sayfasına bakın. Then ve else bölümlerinin kırpılmasını önlemek için, bkz. $meta-tpl-if. Bazı insanlar bunu boşluklar yerine <nowiki>&lt;</nowiki>{{$markup-nw|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> kullanarak başarır.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' Ancak, ayrıştırıcı bir satırdaki birden çok boşluk karakterini tek bir karaktere sıkıştırdığından, bu yöntem yalnızca '''tek''' bir boşluk karakteri oluşturmak için kullanılabilir. :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div class="mw-translate-fuzzy"> Bu örnekte, boşlukları tarayıcı tarafından korunmaya zorlamak için <code>white-space: pre</code> stili kullanılır, ancak bununla bile boşluklar gösterilmez. Bunun nedeni, tarayıcıya gönderilmeden önce boşlukların yazılım tarafından çıkarılmasıdır. </div> <div class="mw-translate-fuzzy"> Boşlukları <code>&amp;#32;</code> (''kırılabilir boşluk'') veya <code>&amp;nbsp;</code> yazılım tarafından değiştirilmediği için (''kırılmaz boşluk'') ile değiştirerek bu davranışa geçici bir çözüm bulmak mümkündür: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Ayrıca bakınız == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]], {{ll|Extension:StringFunctions}} eskiliyor * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Kaynakça == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] 1q5bakqm8g00be2omuxz95l4zlcqtt3 Extension:NoTOC 102 51614 8365082 5910906 2026-05-04T08:19:50Z Gota de agua 16623159 8365082 wikitext text/x-wiki <languages /> {{Unmaintained extension|alternative={{ll|Extension:NoTOCModern}} {{Extension code in wiki}} {{Extension |status = unmaintained |type1 = parser |type2 = |hook1 = ParserClearState |hook2 = |username = Frantik |author = Andrew Fitzgerald |description = <translate><!--T:1--> Turns off Table of Contents by default on all pages</translate> |image = |imagesize = |version = 0.1.1 |update = 2013-12-11 |mediawiki = |php = |license = GPL-2.0-or-later |download = <translate><!--T:2--> See the [[<tvar|code>#Code</>|code section]]</translate> |needs-updatephp = No |readme = |changelog = |parameters = |tags = |rights = |example = |compatibility = }} <translate><!--T:3--> The '''NoTOC''' extension hides the table of contents by default.</translate> <translate><!--T:4--> The magic word <tvar|TOC><nowiki>__TOC__</nowiki></> can still be used normally.</translate> <translate> ==Installation== <!--T:5--> </translate> {{ExtensionInstall |download-link=[[#Code|<translate><!--T:6--> Copy the code into files</translate>]] }} <translate> ==Code== <!--T:7--> </translate> ;NoTOC.php <syntaxhighlight lang="php"> <?php /** * NoTOC extension - Turns off the Table of Contents (TOC) by default on all pages * @version 0.1.1 - 2013/12/11 * * @link https://www.mediawiki.org/wiki/Extension:NoTOC Documentation * @link https://www.mediawiki.org/wiki/Extension_talk:NoTOC Support * * @ingroup Extensions * @package MediaWiki * @author Andrew Fitzgerald (Frantik) * @author Karsten Hoffmeyer (Kghbln) * @copyright (C) 2010 Andrew Fitzgerald * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ // check the call if ( !defined( 'MEDIAWIKI' ) ) { die( 'This file is a MediaWiki extension and thus not a valid entry point.' ); } // provide information $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'NoTOC', 'author' => array( 'Andrew Fitzgerald', '...' ), 'url' => 'https://www.mediawiki.org/wiki/Extension:NoTOC', 'descriptionmsg' => 'notoc-desc', 'version' => '0.1.1' ); // show way to files $wgExtensionMessagesFiles['NoTOC'] = dirname( __FILE__ ) . '/NoTOC.i18n.php'; // register hooks $wgHooks['ParserClearState'][] = 'efMWNoTOC'; // perform purpose function efMWNoTOC($parser) { $parser->mShowToc = false; return true; } </syntaxhighlight> ;NoTOC.i18n.php <syntaxhighlight lang="php"> <?php /** * Internationalization file for the NoTOC extension. * * @licence GNU GPL v2+ * @author Karsten Hoffmeyer (Kghbln) */ $messages = array(); /** English * @author Frantik * @author Kghbln */ $messages['en'] = array( 'notoc-desc' => 'Turns off the Table of Contents (TOC) by default on all pages', ); /** Message documentation (Message documentation) * @author Kghbln */ $messages['qqq'] = array( 'notoc-desc' => '{{desc|name=NoTOC|url=https://www.mediawiki.org/wiki/Extension:NoTOC}}', ); /** German (Deutsch) * @author Kghbln */ $messages['de'] = array( 'notoc-desc' => 'Unterdrückt die automatische Generierung des Inhaltsverzeichnisses', ); </syntaxhighlight> <translate> ==See also== <!--T:8--> </translate> * {{ll|Extension:ForceTocOnEveryPage}} * {{ll|Extension:DeToc}} - <translate><!--T:9--> This can be used to extract TOC HTML and to remove it or put it in some other section of the page.</translate> [[Category:TOC extensions{{#translation:}}]] e3j7nwnhpbg05dg21881qqdc7bugaw7 8365083 8365082 2026-05-04T08:20:05Z Gota de agua 16623159 8365083 wikitext text/x-wiki <languages /> {{Unmaintained extension|alternative={{ll|Extension:NoTOCModern}}}} {{Extension code in wiki}} {{Extension |status = unmaintained |type1 = parser |type2 = |hook1 = ParserClearState |hook2 = |username = Frantik |author = Andrew Fitzgerald |description = <translate><!--T:1--> Turns off Table of Contents by default on all pages</translate> |image = |imagesize = |version = 0.1.1 |update = 2013-12-11 |mediawiki = |php = |license = GPL-2.0-or-later |download = <translate><!--T:2--> See the [[<tvar|code>#Code</>|code section]]</translate> |needs-updatephp = No |readme = |changelog = |parameters = |tags = |rights = |example = |compatibility = }} <translate><!--T:3--> The '''NoTOC''' extension hides the table of contents by default.</translate> <translate><!--T:4--> The magic word <tvar|TOC><nowiki>__TOC__</nowiki></> can still be used normally.</translate> <translate> ==Installation== <!--T:5--> </translate> {{ExtensionInstall |download-link=[[#Code|<translate><!--T:6--> Copy the code into files</translate>]] }} <translate> ==Code== <!--T:7--> </translate> ;NoTOC.php <syntaxhighlight lang="php"> <?php /** * NoTOC extension - Turns off the Table of Contents (TOC) by default on all pages * @version 0.1.1 - 2013/12/11 * * @link https://www.mediawiki.org/wiki/Extension:NoTOC Documentation * @link https://www.mediawiki.org/wiki/Extension_talk:NoTOC Support * * @ingroup Extensions * @package MediaWiki * @author Andrew Fitzgerald (Frantik) * @author Karsten Hoffmeyer (Kghbln) * @copyright (C) 2010 Andrew Fitzgerald * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ // check the call if ( !defined( 'MEDIAWIKI' ) ) { die( 'This file is a MediaWiki extension and thus not a valid entry point.' ); } // provide information $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'NoTOC', 'author' => array( 'Andrew Fitzgerald', '...' ), 'url' => 'https://www.mediawiki.org/wiki/Extension:NoTOC', 'descriptionmsg' => 'notoc-desc', 'version' => '0.1.1' ); // show way to files $wgExtensionMessagesFiles['NoTOC'] = dirname( __FILE__ ) . '/NoTOC.i18n.php'; // register hooks $wgHooks['ParserClearState'][] = 'efMWNoTOC'; // perform purpose function efMWNoTOC($parser) { $parser->mShowToc = false; return true; } </syntaxhighlight> ;NoTOC.i18n.php <syntaxhighlight lang="php"> <?php /** * Internationalization file for the NoTOC extension. * * @licence GNU GPL v2+ * @author Karsten Hoffmeyer (Kghbln) */ $messages = array(); /** English * @author Frantik * @author Kghbln */ $messages['en'] = array( 'notoc-desc' => 'Turns off the Table of Contents (TOC) by default on all pages', ); /** Message documentation (Message documentation) * @author Kghbln */ $messages['qqq'] = array( 'notoc-desc' => '{{desc|name=NoTOC|url=https://www.mediawiki.org/wiki/Extension:NoTOC}}', ); /** German (Deutsch) * @author Kghbln */ $messages['de'] = array( 'notoc-desc' => 'Unterdrückt die automatische Generierung des Inhaltsverzeichnisses', ); </syntaxhighlight> <translate> ==See also== <!--T:8--> </translate> * {{ll|Extension:ForceTocOnEveryPage}} * {{ll|Extension:DeToc}} - <translate><!--T:9--> This can be used to extract TOC HTML and to remove it or put it in some other section of the page.</translate> [[Category:TOC extensions{{#translation:}}]] fbmdu5ql1eo7usio2g3xrr9pm4lbswq Help:Talk pages/id 12 52662 8364341 8327689 2026-05-03T12:59:55Z ~2026-26810-06 18367607 Xavier 8364341 wikitext text/x-wiki <languages /> {{PD Help Page}} {{Special page}} <span class="mw-translate-fuzzy">Setiap laman wiki memiliki laman pembicaraan terkait yang dapat digunakan untuk berdiskusi dan berkomunikasi dengan pengguna lain. Laman pembicaraan dapat diakses dengan mengeklik [[Special:MyLanguage/Help:Navigation#Page Tabs|tab]] “{{lcfirst:{{int|talk}}}}” di bagian atas suatu laman. Cukup sunting laman seperti biasa untuk menambahkan komentar Anda.finance YourDomain</span> Halaman pembicaraan sebenarnya tidak jauh berbeda dengan halaman wiki lainnya, tetapi letaknya di ruang nama "{{ns:1}}", untuk memisahkannya dari artikel di ruang nama "<code>{{int|blanknamespace}}</code>" (lihat {{ll|Help:Namespaces}}). Sebagaimana halaman wiki lainnya, Anda bisa menyuntingnya, menautnya, dan membaca riwayat penyuntingannya. Bagi pengguna baru, halaman pembicaraan mungkin membingungkan. Untungnya, beberapa ekstensi telah digunakan untuk memperbaiki halaman pembicaraan. Ekstensi {{ll|Extension:DiscussionTools|nsp=0}} mempermudah pembuatan dan pembalasan pesan halaman pembicaraan, dan secara otomatis menandatangani komentar Anda. <span id="Editing_conventions_on_talk_pages"></span> == Konvensi penyuntingan pada laman pembicaraan == <div lang="en" dir="ltr" class="mw-content-ltr"> === Default configuration for Wikimedia wikis === </div> [[File:Reply tool version 2b screenshot.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Screenshot of the default talk pages experience</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">Wikimedia wikis use {{ll|Help:DiscussionTools|discussion tools}} as a default feature for talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This tool allows users to start a topic and respond to comments in both visual and wikitext editing modes.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Pages in the '''main''' namespace have the prefix <code>Talk:</code> added at the beginning of its talk page title.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, [[Talk:Download]], [[Talk:Hosting services]], etc.</span> <span lang="en" dir="ltr" class="mw-content-ltr">While pages in other namespaces start with the name of the namespace, then <code>Talk:</code>, before the pages title name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, [[User:Network-charles]] becomes [[User talk:Network-charles]], [[Project:Sandbox]] becomes [[Project talk:Sandbox]], etc.</span> Tambahkan topik baru dengan pergi ke halaman diskusi dan klik kotak yang mengatakan <code>{{int|flow-newtopic-start-placeholder}}</code>. <span lang="en" dir="ltr" class="mw-content-ltr">If the talk page is empty, an <code>{{int|flow-newtopic-save}}</code> button at the top right corner of the page is used to create a topic.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Reply to a comment by clicking on <code>{{int|discussiontools-replybutton}}</code> after the comment. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> When adding a new topic, or responding to a given message, you can switch between "visual" and "wikitext" modes. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This tool automatically signs your messages. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also edit the wikitext of the page, as described below. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === When using wikitext on talk pages === </div> Melakukan diskusi di sebuah halaman wiki berstruktur bebas memang awalnya terlihat aneh. Akan lebih mudah apabila semuanya mengikuti beberapa konvensi penyuntingan sederhana: * Selalu tanda tangani nama Anda setelah komentar Anda. Gunakan sintaks wiki empat tilda "<code><nowiki>~~~~</nowiki></code>" (atau tombol tanda tangan [[File:Insert-signature2.svg|Tombol tanda tangan]] di bilah perkakas di atas kotak teks penyuntingan). Untuk informasi lebih lanjut lihat {{ll|Help:Signatures}}. <div class="mw-translate-fuzzy"> * Buatlah diskusi baru dengan membuat sebuah <code><nowiki>==judul bagian tingkat 2==</nowiki></code> di bawah halaman (atau gunakan tab "<code>{{int|flow-newtopic-save}}</code>"). </div> * ''Indent'' balasan menggunakan tanda titik dua (<code>:</code>) di awal baris. <span id="Example"></span> === Contoh === Berikut adalah sebuah contoh diskusi, mengikuti konvensi halaman pembicaraan: {| class="wikitable" !style="width:50%"| Teks wiki !style="width:50%"| Halaman pembicaraan yang ditampilkan |- | <syntaxhighlight lang="moin"> == Sup == Bagaimana supnya? --[[User:Contoh|Bob]] 18:07, 26 Agustus 1991 (UTC) : Rasanya enak sekali!! --[[User:Contoh|Simon]] 11:21, 28 Agustus 1991 (UTC) :: Aku membuatnya sendiri! -- [[User:Contoh|Bob]] 14:11, 3 September 1991 (UTC) Aku rasa diskusi mengenai sup sebaiknya dipindahkan ke [[Talk:Soup]].. -- [[User:Contoh|Lisa]] 21:55, 3 September 1991 (UTC) </syntaxhighlight> | <div style="border-bottom:1px solid rgb(162,169,177)"><!-- --><span style="font-family:&quot;Noto Sans Meetei Mayek&quot;; font-size:1.5em; margin-top:1em">Sup</span><!-- --><span class="mw-editsection"><span class="mw-editsection-bracket">[</span>[[#Example|{{int:editsection}}]]<span class="mw-editsection-bracket">]</span></span><!-- --></div> Bagaimana supnya? --[[User:Contoh|Bob]] 18:07, 26 Agustus 1991 (UTC) : Rasanya enak sekali!! --[[User:Contoh|Simon]] 11:21, 28 Agustus 1991 (UTC) :: Aku membuatnya sendiri! -- [[User:Contoh|Bob]] 14:11, 3 September 1991 (UTC) Aku rasa diskusi mengenai sup sebaiknya dipindahkan ke [[Talk:Soup]]. -- [[User:Contoh|Lisa]] 21:55, 3 September 1991 (UTC) |} <div lang="en" dir="ltr" class="mw-content-ltr"> === When using talk pages === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">On a talk page, when contributors are discussing and mention "this page", they usually mean the main page it's connected to.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If they mean the talk page itself, they'll say "this talk page" instead.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Always refer to the current page name when debating its title or discussing merging it with another page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This prevents ambiguity when the page is renamed (moved), as references to "this page name" would otherwise be unclear.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Spamming, which involves sending lots of similar messages to multiple users' talk pages to ask for something is not recommended.</span> <span id="Alternate_conventions"></span> === Konvensi alternatif === {{Tracked|T230683}} Kami tahu bahwa konvensi paling umum ini punya banyak masalah: * Konvensi ini menghasilkan struktur HTML yang tidak valid melalui penggunaan sintaksis daftar definisi; * Konvensi ini lemah apabila dimasukkan tabel; * Tidak ada paragraf sungguhan. Beberapa wiki diketahui menggunakan <code>*</code> untuk menyelesaikan masalah yang pertama. Ikuti aturan lokal Anda. Untuk mencegah rusaknya pemformatan rumit ketika membalas, salin apa yang komentar di atas Anda gunakan untuk menambah indentasi, lalu tambahkan satu <code>:</code> atau <code>*</code> lagi di ujungnya. <span id="Editing_discussions"></span> == Menyunting pembicaraan == Melakukan diskusi dalam halaman wiki yang berstruktur bebas awalnya terasa aneh. Cara ini punya kelebihan dibandingkan dengan format forum ketat yang konvensional, tetapi cara ini bisa menjadi sedikit berantakan. Sebagaimana dengan halaman wiki lainnya, semua orang bisa membantu merapikan diskusi, agar sesuai dengan konvensi penyuntingan, misalnya, menambahkan tanda tangan dan judul bagian apabila tidak ada. Terlihat jelas bahwa kita juga bisa menyunting komentar orang lain. Umumnya mengubah perkataan orang lain dianggap sebagai etiket yang buruk. (Lebih baik tambahkan komentar Anda sendiri beserta koreksi Anda.) Tetapi bisa jadi diperbolehkan untuk ... ;Mengubah judul diksusi :Mengubah atau menambah kata-kata dalam judul diskusi, untuk membuat topik diskusi lebih jelas. Perhatikan bahwa judul deskriptif yang bagus menjadi penting ketika halaman mulai diisi dengan banyak diskusi. ;Memindahkan diskusi ke halaman lain :Jika diskusi diletakkan di tempat yang salah dalam wiki, dan lebih baik diletakkan di halaman pembicaraan lain, maka Anda bisa memindahkan diskusinya dengan cara potong & tempel. Ini bisa menimbulkan kebingungan, bagi orang-orang yang melakukan diskusi, tetapi ini penting untuk menjaga wiki tetap rapi. Anda bisa membiarkan diskusinya berada di tempat yang salah selama beberapa hari/pekan sebelum merapikannya. Anda juga bisa meninggalkan pranala yang menjelaskan bahwa diskusinya telah dipindahkan, atau apabila tidak, Anda sebaiknya memberikan pranala di dalam ringkasan suntingan. ;Menghapus diskusi yang tidak terpakai lagi :Diskusi kadang dibiarkan tertinggal di halaman pembicaraan lama setelah masalah yang dibicarakan tidak lagi relevan. Biasanya lebih baik untuk membalas "Aku rasa ini sudah diselesaikan", tetapi cepat atau lambat akan ada waktu untuk membuang diskusi-diskusi lama (mereka tentu saja disimpan di riwayat suntingan). ;Membagi sebuah post menjadi beberapa diskusi :Bisa jadi tepat untuk melakukan ini apabila seseorang telah mengajukan beberapa hal yang perlu dijawab secara terpisah. Akan tetapi, Anda harus selalu menghormati kata-kata orang lain. Apa post mereka masih masuk akal jika Anda membaginya? <span id="Building_articles_-_Discussing_articles"></span> == Pembuatan artikel - Membicarakan artikel == Sebaiknya berfokuslah pada membuat artikel wiki dan menggunakan halaman pembicaraan hanya untuk mendukung proses ini. Topik pembicaraan sebaiknya membahas mengenai apa yang diperlukan untuk membuat artikel yang berkaitan menjadi lebih baik. Ingatlah bahwa menyunting artikel kadang merupakan cara berkomunikasi yang lebih efektif. Bisa jadi lebih sulit, karena mengharuskan Anda menyeimbangkan pandangan Anda dengan pandangan orang lain, tetapi bisa juga lebih bermanfaat. Inilah cara komunitas penyunting wiki menemukan kemajuan. Biasanya terasa lebih wajar untuk memulai debat di halaman pembicaraan (atau tempat komunikasi lainnya) padahal artikel wiki itu sendiri bisa menjadi cara mencapai titik tengah. Pikirkan bagaimana cara menggambarkan kedua sisi di artikel (misalnya, mendaftarkan kelebihan dan kekurangan) dan debatnya mungkin berakhir. <span id="User_talk_pages"></span> == Halaman pembicaraan pengguna == "Halaman {{ns:3}}" adalah halaman pembicaraan yang berkaitan dengan "halaman {{ns:2}}" seseorang (Lihat {{ll|Help:User page}}.) Halaman ini merupakan tempat untuk meninggalkan pesan bagi seorang pengguna wiki tertentu. Ini bisa difungsikan sebagai sejenis sistem pesan. Pengguna akan menerima pemberitahuan berikut ketika pesan baru dituliskan di halaman pembicaraannya. <div class="usermessage plainlinks">{{int|1=New-messages |2=[[{{ns:3}}:User|<span style="color:#36c">{{int|new-messages-link-plural|1}}</span>]] |3=[{{fullurl:{{ns:3}}:User|diff=cur}} <span style="color:#36c">{{int|new-messages-diff-link-plural}}</span>] }}</div> Pesan ini akan terus ditampilkan di semua halaman yang dikunjungi pengguna tersebut sampai dia mengunjungi halaman pembicaraan mereka. Pengguna juga bisa diberitahu melalui surel, tetapi ini tidak bisa selalu diandalkan (karena fitur pemberitahuan surel harus diaktifkan dengan memasukkan alamat surel, lalu menekan pranala konfirmasi). Jika pesan halaman pembicaraan Anda tidak dibalas, coba cari detail kontak lainnya yang mungkin mereka beritahukan di halaman pengguna mereka. Perhatikan bahwa pesan di halaman pembicaraan tidak bersifat pribadi, dan orang-orang lain bisa bergabung dalam percakapannya. <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> *[[MeatBall:MessageBox|MessageBox]] <span lang="en" dir="ltr" class="mw-content-ltr">on Meatball Wiki</span> [[Category:Help{{#translation:}}|{{PAGENAME}}]] 3devqhx0rakhv3einqpp293g1d1saw3 8364383 8364341 2026-05-03T13:50:50Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-26810-06|~2026-26810-06]] ([[User talk:~2026-26810-06|talk]]) to last version by Clump 8364383 wikitext text/x-wiki <languages /> {{PD Help Page}} {{Special page}} <span class="mw-translate-fuzzy">Setiap laman wiki memiliki laman pembicaraan terkait yang dapat digunakan untuk berdiskusi dan berkomunikasi dengan pengguna lain. Laman pembicaraan dapat diakses dengan mengeklik [[Special:MyLanguage/Help:Navigation#Page Tabs|tab]] “{{lcfirst:{{int|talk}}}}” di bagian atas suatu laman. Cukup sunting laman seperti biasa untuk menambahkan komentar Anda.</span> Halaman pembicaraan sebenarnya tidak jauh berbeda dengan halaman wiki lainnya, tetapi letaknya di ruang nama "{{ns:1}}", untuk memisahkannya dari artikel di ruang nama "<code>{{int|blanknamespace}}</code>" (lihat {{ll|Help:Namespaces}}). Sebagaimana halaman wiki lainnya, Anda bisa menyuntingnya, menautnya, dan membaca riwayat penyuntingannya. Bagi pengguna baru, halaman pembicaraan mungkin membingungkan. Untungnya, beberapa ekstensi telah digunakan untuk memperbaiki halaman pembicaraan. Ekstensi {{ll|Extension:DiscussionTools|nsp=0}} mempermudah pembuatan dan pembalasan pesan halaman pembicaraan, dan secara otomatis menandatangani komentar Anda. <span id="Editing_conventions_on_talk_pages"></span> == Konvensi penyuntingan pada laman pembicaraan == <div lang="en" dir="ltr" class="mw-content-ltr"> === Default configuration for Wikimedia wikis === </div> [[File:Reply tool version 2b screenshot.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Screenshot of the default talk pages experience</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">Wikimedia wikis use {{ll|Help:DiscussionTools|discussion tools}} as a default feature for talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This tool allows users to start a topic and respond to comments in both visual and wikitext editing modes.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Pages in the '''main''' namespace have the prefix <code>Talk:</code> added at the beginning of its talk page title.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, [[Talk:Download]], [[Talk:Hosting services]], etc.</span> <span lang="en" dir="ltr" class="mw-content-ltr">While pages in other namespaces start with the name of the namespace, then <code>Talk:</code>, before the pages title name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, [[User:Network-charles]] becomes [[User talk:Network-charles]], [[Project:Sandbox]] becomes [[Project talk:Sandbox]], etc.</span> Tambahkan topik baru dengan pergi ke halaman diskusi dan klik kotak yang mengatakan <code>{{int|flow-newtopic-start-placeholder}}</code>. <span lang="en" dir="ltr" class="mw-content-ltr">If the talk page is empty, an <code>{{int|flow-newtopic-save}}</code> button at the top right corner of the page is used to create a topic.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Reply to a comment by clicking on <code>{{int|discussiontools-replybutton}}</code> after the comment. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> When adding a new topic, or responding to a given message, you can switch between "visual" and "wikitext" modes. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This tool automatically signs your messages. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also edit the wikitext of the page, as described below. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === When using wikitext on talk pages === </div> Melakukan diskusi di sebuah halaman wiki berstruktur bebas memang awalnya terlihat aneh. Akan lebih mudah apabila semuanya mengikuti beberapa konvensi penyuntingan sederhana: * Selalu tanda tangani nama Anda setelah komentar Anda. Gunakan sintaks wiki empat tilda "<code><nowiki>~~~~</nowiki></code>" (atau tombol tanda tangan [[File:Insert-signature2.svg|Tombol tanda tangan]] di bilah perkakas di atas kotak teks penyuntingan). Untuk informasi lebih lanjut lihat {{ll|Help:Signatures}}. <div class="mw-translate-fuzzy"> * Buatlah diskusi baru dengan membuat sebuah <code><nowiki>==judul bagian tingkat 2==</nowiki></code> di bawah halaman (atau gunakan tab "<code>{{int|flow-newtopic-save}}</code>"). </div> * ''Indent'' balasan menggunakan tanda titik dua (<code>:</code>) di awal baris. <span id="Example"></span> === Contoh === Berikut adalah sebuah contoh diskusi, mengikuti konvensi halaman pembicaraan: {| class="wikitable" !style="width:50%"| Teks wiki !style="width:50%"| Halaman pembicaraan yang ditampilkan |- | <syntaxhighlight lang="moin"> == Sup == Bagaimana supnya? --[[User:Contoh|Bob]] 18:07, 26 Agustus 1991 (UTC) : Rasanya enak sekali!! --[[User:Contoh|Simon]] 11:21, 28 Agustus 1991 (UTC) :: Aku membuatnya sendiri! -- [[User:Contoh|Bob]] 14:11, 3 September 1991 (UTC) Aku rasa diskusi mengenai sup sebaiknya dipindahkan ke [[Talk:Soup]].. -- [[User:Contoh|Lisa]] 21:55, 3 September 1991 (UTC) </syntaxhighlight> | <div style="border-bottom:1px solid rgb(162,169,177)"><!-- --><span style="font-family:&quot;Noto Sans Meetei Mayek&quot;; font-size:1.5em; margin-top:1em">Sup</span><!-- --><span class="mw-editsection"><span class="mw-editsection-bracket">[</span>[[#Example|{{int:editsection}}]]<span class="mw-editsection-bracket">]</span></span><!-- --></div> Bagaimana supnya? --[[User:Contoh|Bob]] 18:07, 26 Agustus 1991 (UTC) : Rasanya enak sekali!! --[[User:Contoh|Simon]] 11:21, 28 Agustus 1991 (UTC) :: Aku membuatnya sendiri! -- [[User:Contoh|Bob]] 14:11, 3 September 1991 (UTC) Aku rasa diskusi mengenai sup sebaiknya dipindahkan ke [[Talk:Soup]]. -- [[User:Contoh|Lisa]] 21:55, 3 September 1991 (UTC) |} <div lang="en" dir="ltr" class="mw-content-ltr"> === When using talk pages === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">On a talk page, when contributors are discussing and mention "this page", they usually mean the main page it's connected to.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If they mean the talk page itself, they'll say "this talk page" instead.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Always refer to the current page name when debating its title or discussing merging it with another page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This prevents ambiguity when the page is renamed (moved), as references to "this page name" would otherwise be unclear.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Spamming, which involves sending lots of similar messages to multiple users' talk pages to ask for something is not recommended.</span> <span id="Alternate_conventions"></span> === Konvensi alternatif === {{Tracked|T230683}} Kami tahu bahwa konvensi paling umum ini punya banyak masalah: * Konvensi ini menghasilkan struktur HTML yang tidak valid melalui penggunaan sintaksis daftar definisi; * Konvensi ini lemah apabila dimasukkan tabel; * Tidak ada paragraf sungguhan. Beberapa wiki diketahui menggunakan <code>*</code> untuk menyelesaikan masalah yang pertama. Ikuti aturan lokal Anda. Untuk mencegah rusaknya pemformatan rumit ketika membalas, salin apa yang komentar di atas Anda gunakan untuk menambah indentasi, lalu tambahkan satu <code>:</code> atau <code>*</code> lagi di ujungnya. <span id="Editing_discussions"></span> == Menyunting pembicaraan == Melakukan diskusi dalam halaman wiki yang berstruktur bebas awalnya terasa aneh. Cara ini punya kelebihan dibandingkan dengan format forum ketat yang konvensional, tetapi cara ini bisa menjadi sedikit berantakan. Sebagaimana dengan halaman wiki lainnya, semua orang bisa membantu merapikan diskusi, agar sesuai dengan konvensi penyuntingan, misalnya, menambahkan tanda tangan dan judul bagian apabila tidak ada. Terlihat jelas bahwa kita juga bisa menyunting komentar orang lain. Umumnya mengubah perkataan orang lain dianggap sebagai etiket yang buruk. (Lebih baik tambahkan komentar Anda sendiri beserta koreksi Anda.) Tetapi bisa jadi diperbolehkan untuk ... ;Mengubah judul diksusi :Mengubah atau menambah kata-kata dalam judul diskusi, untuk membuat topik diskusi lebih jelas. Perhatikan bahwa judul deskriptif yang bagus menjadi penting ketika halaman mulai diisi dengan banyak diskusi. ;Memindahkan diskusi ke halaman lain :Jika diskusi diletakkan di tempat yang salah dalam wiki, dan lebih baik diletakkan di halaman pembicaraan lain, maka Anda bisa memindahkan diskusinya dengan cara potong & tempel. Ini bisa menimbulkan kebingungan, bagi orang-orang yang melakukan diskusi, tetapi ini penting untuk menjaga wiki tetap rapi. Anda bisa membiarkan diskusinya berada di tempat yang salah selama beberapa hari/pekan sebelum merapikannya. Anda juga bisa meninggalkan pranala yang menjelaskan bahwa diskusinya telah dipindahkan, atau apabila tidak, Anda sebaiknya memberikan pranala di dalam ringkasan suntingan. ;Menghapus diskusi yang tidak terpakai lagi :Diskusi kadang dibiarkan tertinggal di halaman pembicaraan lama setelah masalah yang dibicarakan tidak lagi relevan. Biasanya lebih baik untuk membalas "Aku rasa ini sudah diselesaikan", tetapi cepat atau lambat akan ada waktu untuk membuang diskusi-diskusi lama (mereka tentu saja disimpan di riwayat suntingan). ;Membagi sebuah post menjadi beberapa diskusi :Bisa jadi tepat untuk melakukan ini apabila seseorang telah mengajukan beberapa hal yang perlu dijawab secara terpisah. Akan tetapi, Anda harus selalu menghormati kata-kata orang lain. Apa post mereka masih masuk akal jika Anda membaginya? <span id="Building_articles_-_Discussing_articles"></span> == Pembuatan artikel - Membicarakan artikel == Sebaiknya berfokuslah pada membuat artikel wiki dan menggunakan halaman pembicaraan hanya untuk mendukung proses ini. Topik pembicaraan sebaiknya membahas mengenai apa yang diperlukan untuk membuat artikel yang berkaitan menjadi lebih baik. Ingatlah bahwa menyunting artikel kadang merupakan cara berkomunikasi yang lebih efektif. Bisa jadi lebih sulit, karena mengharuskan Anda menyeimbangkan pandangan Anda dengan pandangan orang lain, tetapi bisa juga lebih bermanfaat. Inilah cara komunitas penyunting wiki menemukan kemajuan. Biasanya terasa lebih wajar untuk memulai debat di halaman pembicaraan (atau tempat komunikasi lainnya) padahal artikel wiki itu sendiri bisa menjadi cara mencapai titik tengah. Pikirkan bagaimana cara menggambarkan kedua sisi di artikel (misalnya, mendaftarkan kelebihan dan kekurangan) dan debatnya mungkin berakhir. <span id="User_talk_pages"></span> == Halaman pembicaraan pengguna == "Halaman {{ns:3}}" adalah halaman pembicaraan yang berkaitan dengan "halaman {{ns:2}}" seseorang (Lihat {{ll|Help:User page}}.) Halaman ini merupakan tempat untuk meninggalkan pesan bagi seorang pengguna wiki tertentu. Ini bisa difungsikan sebagai sejenis sistem pesan. Pengguna akan menerima pemberitahuan berikut ketika pesan baru dituliskan di halaman pembicaraannya. <div class="usermessage plainlinks">{{int|1=New-messages |2=[[{{ns:3}}:User|<span style="color:#36c">{{int|new-messages-link-plural|1}}</span>]] |3=[{{fullurl:{{ns:3}}:User|diff=cur}} <span style="color:#36c">{{int|new-messages-diff-link-plural}}</span>] }}</div> Pesan ini akan terus ditampilkan di semua halaman yang dikunjungi pengguna tersebut sampai dia mengunjungi halaman pembicaraan mereka. Pengguna juga bisa diberitahu melalui surel, tetapi ini tidak bisa selalu diandalkan (karena fitur pemberitahuan surel harus diaktifkan dengan memasukkan alamat surel, lalu menekan pranala konfirmasi). Jika pesan halaman pembicaraan Anda tidak dibalas, coba cari detail kontak lainnya yang mungkin mereka beritahukan di halaman pengguna mereka. Perhatikan bahwa pesan di halaman pembicaraan tidak bersifat pribadi, dan orang-orang lain bisa bergabung dalam percakapannya. <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> *[[MeatBall:MessageBox|MessageBox]] <span lang="en" dir="ltr" class="mw-content-ltr">on Meatball Wiki</span> [[Category:Help{{#translation:}}|{{PAGENAME}}]] bb6r5gj21u6izzgis3mrcq6b5feguoq Help:Extension:ParserFunctions/de 12 57316 8365007 8353924 2026-05-04T06:20:09Z FuzzyBot 451990 Updating to match new version of source page 8365007 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} Die Erweiterung {{ll|Extension:ParserFunctions|nsp=0}} bietet zusätzliche [[Special:MyLanguage/Parser functions|Parserfunktionen]], zur Ergänzung der in MediaWiki bereits vorhandenen Funktionen. (Siehe {{ll|Help:Magic words#Parser functions}}.) (Sie ''kann'' konfiguriert werden, um zusätzliche Parser-Funktionen zur Verarbeitung von Zeichenketten (Strings) zur Verfügung zu stellen; diese sind nur für Wikis außerhalb der Wikimedia Foundation verfügbar, daher sind diese Zeichenfolgenfunktionen {{ll|Extension:ParserFunctions/String functions|andernorts}} dokumentiert.) Alle Funktionen, die diese Erweiterung unterstützt, haben folgende Form: :<code><nowiki>{{</nowiki>'''#Funktionsname''': ''Parameter 1'' | ''Parameter 2'' | ''Parameter 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=eine '''ausführliche Anleitung''' zu den Feinheiten der Arbeitsweise der Ausdrucksauswertung, darunter einige zusätzliche, hier nicht behandelte Operatoren,|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Art ! {{hl1}} | Operatoren |- | {{hl2}} | Gruppieren (Klammern) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Zahlen | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | Binärer Operator <code>'''e'''</code> &nbsp; unäre <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unäre Operatoren | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binäre Operatoren | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Runden | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Logische Operatoren | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Diese Funktion berechnet einen mathematischen Ausdruck und gibt den errechneten Wert aus. Diese Funktion steht über die <code>mw.ext.ParserFunctions.expr</code>-Funktion auch in {{ll|Extension:Scribunto|nsp=0}} zur Verfügung. :<code><nowiki>{{#expr:</nowiki> ''Ausdruck'' <nowiki>}}</nowiki></code> Einfaches Beispiel: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Die verfügbaren Operatoren sind rechts aufgelistet, in der Reihenfolge ihrer Anwendung. Siehe [[{{ll|Manual:Expr parser function syntax}}|Help:Calculation]] (englisch) für nähere Details über die Funktion der einzelnen Operatoren. Genauigkeit und Format des ausgegebenen Resultats kann je nach Betriebssystem des Servers, auf dem das Wiki läuft, und dem Zahlenformat der Sprache der Umgebung abweichen. Bei Nutzung der [[:de:Boolesche Algebra|Booleschen Algebra]] ergibt 0 immer {{phpi|false}} und jeder andere Wert, ob positiv oder negativ, immer {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Ein leerer eingegebener Ausdruck erzeugt eine leere Ausgabe. Ungültige Ausdrücke erzeugen eine von mehreren möglichen Fehlermeldungen, die durch Nutzung der Funktion <code>[[##iferror|#iferror]]</code> abgefangen werden können: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' Die Reihenfolge der Additions- und Subtraktionsoperanden vor oder nach einer Zahl ist bedeutend und kann als positiver oder negativer Wert eingesetzt werden anstelle eines Operanden mit fehlerhafter Eingabe: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Beachten Sie, dass Sie bei Verwendung der Ausgabe von magischen Wörtern diese im Rohformat formatieren müssen, um Kommas zu entfernen und die Ziffern zu übersetzen. Beispielsweise führt <nowiki>{{NUMBEROFUSERS}}</nowiki> zu {{NUMBEROFUSERS}}, wobei wir {{formatnum:{{NUMBEROFUSERS}}|R}} wollen, das mit <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code> abgerufen werden kann. Dies ist besonders wichtig in einigen Sprachen, in denen Ziffern übersetzt werden. Beispielsweise erzeugt <nowiki>{{NUMBEROFUSERS}}</nowiki> in Bengali ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=Der Operator <code>mod</code> ergibt bei einigen Werten des zweiten Parameters falsche Ergebnisse: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (erzeugt einen leeren String; sollte eigentlich 123 ergeben)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Sollen Berechnungen auf Basis von Datumsangaben angestellt werden (z.B. um zu testen, ob das aktuelle Datum und die Zeit nach einem anderen Datum und einer Zeit liegen), sollte die Zeit zuerst in die Anzahl der Sekunden nach 1. Januar 1970 mit <nowiki>{{#time: xNU }}</nowiki> umgerechnet werden, dann können Daten einfach als Zahlen addiert und subtrahiert werden.}} <span id="Rounding"></span> === Runden === [https://php.net/function.round Rundet] die Zahl links auf ein Vielfaches von 1/10 hoch den gekürzten Wert der Zahl rechts. Um auf- oder abzurunden benutze <code>ceil</code> bzw. <code>floor</code>. {| class="wikitable" ! {{hl1}} | Testfall ! {{hl1}} | Resultat ! {{hl1}} | Rundungsmethode |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || Die endgültige Zahl ist <5, deshalb erscheint keine sichtbare Rundung (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || Die endgültige Zahl ist >=5, deshalb wird sie aufgerundet (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Das Ergebnis wird noch einmal in der letzten Ziffer aufgerundet, was zusätzliche Rundung ergibt (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Gerundet auf die nächsten 100, da negative Werte links vom Dezimalkomma (hier Punkt) runden |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Gerundet auf die nächsten 100, da positive Werte rechts vom Dezimalkomma (hier Punkt) runden |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Dezimalstellen in der Rundungsangabe ergeben keinen Unterschied im gerundeten Ergebnis |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Dezimalstellen abgeschnitten |- ! colspan=3 {{hl2}} | Auf die nächste Ganzzahl (integer) runden |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Abrunden auf die ''nächste'' Ganzzahl, hier Null |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Aufrunden auf die nächste Ganzzahl, hier Eins |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Aufrunden auf die nächste Ganzzahl, hier Eins |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Aufrunden auf die nächste Ganzzahl, hier Null |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Abrunden auf die nächste Ganzzahl, hier -1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Abrunden auf die nächste Ganzzahl, hier -1 |- ! colspan=3 {{hl2}} | Auf- oder Ab-Runden mit ''ceil'' und ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Aufrunden auf die nächste ''größere'' Ganzzahl, hier 1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Abrunden auf die nächste ''kleinere'' Ganzzahl, hier Null |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Aufrunden auf die nächstgrößere Ganzzahl, hier Null |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Abrunden auf die nächst kleinere Ganzzahl, hier -1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Nicht gerundet, da 1 schon eine Ganzzahl ist<br />{{Warning|1=Wird interpretiert als '''(ceil''' 1''')'''/3, nicht '''ceil('''1/3''')''', wie man erwarten würde}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Runden auf eine sehr große Stellenzahl ergibt unendlich. Daher wird der Ausgangswert ohne unendlich zurückgegeben. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Genau wie oben. |} === Strings === Die Ausdrücke funktionieren nur mit zahlenähnlichen Werten, denn sie können nicht Funktionen oder Zeichen vergleichen. [[#ifeq]] kann stattdessen verwendet werden. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Diese Funktion wertet einen Teststring aus und stellt fest, ob er leer ist oder nicht. Ein Teststring, der nur Leerzeichen enthält, wird als leer betrachtet. :<syntaxhighlight lang="wikitext" inline>{{#if: Teststring | Wert, wenn der Teststring nicht leer ist | Wert, wenn der Teststring leer ist (oder nur aus Leerzeichen besteht)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: erster Parameter | zweiter Parameter | dritter Parameter }}</syntaxhighlight> Diese Funktion testet zuerst, ob der erste Parameter nicht leer ist. Wenn der erste Parameter nicht leer ist, zeigt die Funktion den zweiten Parameter. Wenn der erste Parameter leer ist oder nur Weißraumzeichen enthält (Leerzeichen, neue Zeilen etc.), wird der dritte Parameter ausgegeben. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' Der Testausdruck wird immer als reiner Text interpretiert, also werden mathematische Ausdrücke nicht evaluiert: :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' Der letzte Parameter (false) kann weggelassen werden: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' Die Funktion kann verschachtelt sein. Verschachteln Sie dazu die innere <code>#if</code>-Funktion in ihrer vollständigen Form anstelle eines Parameters der einschließenden <code>#if</code>-Funktion. Bis zu sieben Verschachtelungsebenen sind möglich, obwohl dies vom Wiki oder einem Speicherlimit abhängen kann. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:Teststring | Wert, wenn der Teststring nicht leer ist |{{#if:Teststring |Wert, wenn der Teststring nicht leer ist |Wert, wenn der Teststring leer ist (oder nur aus Leerzeichen besteht) }} }} </syntaxhighlight> <span class="mw-translate-fuzzy">Du kannst auch einen Parameter als Teststring in deiner <code>#if</code>-Anweisung verwenden. Du musst sicherstellen, dass du das $1 (Pipe-Symbol) nach dem Namen der Variablen hinzufügst.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> (Wenn der Parameter also keinen Wert hat, wird er zu einer leeren Zeichenfolge anstelle der Zeichenfolge „<code><nowiki>{{{1}}}</nowiki></code>“ ausgewertet.) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Du hast Text in der Variable 1 eingegeben |2=Es gibt keinen Text in der Variable 1 }} Siehe {{ll|Help:Parser functions in templates}} für weitere Beispiele zu dieser Parserfunktion. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Diese Parserfunktion vergleicht zwei Eingabezeichenfolgen, bestimmt, ob sie identisch sind, und gibt basierend auf dem Ergebnis eine von zwei Zeichenfolgen zurück. Wenn mehr Vergleiche und Ausgabestrings erforderlich sind, ziehen Sie die Verwendung von <code>#switch</code> in Betracht. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Wenn beide Ausdrücke gültige numerische Werte sind, werden die Ausdrücke zahlenmäßig verglichen: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Andernfalls wird der Vergleich textmäßig vollzogen, dieser Vergleich beachtet die Groß- und Kleinschreibung: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(vergleiche mit dem ähnlichen Beispiel oben, aber ohne Anführungszeichen)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(vergleiche mit dem ähnlichen Beispiel oben, wo <code>[[##expr|#expr]]</code> eine gültige erste Zahl anzeigt)'' Betrachte als praktisches Beispiel ein vorhandenes {{ll|Help:Templates|template}} <code>Template:Timer</code>, das den Parser verwendet, um zwischen zwei Standardzeiten zu wählen, kurz und lang. Es nimmt den Parameter als erste Eingabe, um ihn mit der Zeichenfolge „short“ zu vergleichen &ndash; es gibt keine Konvention für die Reihenfolge, aber es ist einfacher zu lesen, wenn der Parameter an erster Stelle steht. Der Vorlagenquelltext sieht so aus: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> folgendes ergibt sich: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Bei Verwendung innerhalb einer Parser-Funktion müssen alle Parser-Tags und andere Parser-Funktionen vorübergehend durch {{ll|Strip marker|einen eindeutigen Code}} ersetzt werden. Dies wirkt sich auf Vergleiche aus: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Wenn die zu vergleichenden Strings als gleiche Aufrufe derselben {{ll|Help:Templates|Vorlage}} übergeben werden, die solche Tags enthält, dann ist die Bedingung wahr, aber im Fall von zwei Vorlagen mit identischem Inhalt, die solche Tags enthalten, ist sie falsch. }} {{Warning|1=Wörtliche Vergleiche mit {{ll|Help:Magic words#Page names|page-name magic words}} können je nach Site-Konfiguration fehlschlagen. Zum Beispiel kann <nowiki>{{FULLPAGENAME}}</nowiki>, je nach Wiki, den ersten Buchstaben großschreiben und alle Unterstriche durch Leerzeichen ersetzen. Um dies zu umgehen, wende das Magische Wort auf beide Parameter an: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Diese Funktion überprüft, ob der eingegebene Ausdruck einen Fehler erzeugt. Die Funktion gibt <code>true</code> aus, wenn der Ausdruck ein HTML-Objekt mit <code>class="error"</code> enthält, wie es z. B. von den Funktionen <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> und <code>[[##rel2abs|#rel2abs]]</code> bei Fehlern ausgegeben wird. Auch [[Special:MyLanguage/Help:Templates|Vorlagen]]fehler wie Rekursionsschleifen werden erkannt. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">Eine oder beide Rückgabezeichenfolgen können weggelassen werden. Wenn die Zeichenfolge $1 weggelassen wird, wird $2 ausgegeben, sofern sie nicht fehlerhaft ist. Wenn auch die Zeichenfolge $3 weggelassen wird, wird bei einem Fehler eine leere Zeichenfolge zurückgegeben:</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Manche Fehler können die Zuweisung einer Kategorie zur Fehlerverfolgung verursachen. Die Verwendung von <code><nowiki>{{#iferror:}}</nowiki></code> kann dies nicht unterdrücken. == #ifexpr == Diese Funktion berechnet einen mathematischen Ausdruck und gibt &ndash; abhängig vom Wahrheitswert des Ergebnisses &ndash; einen von zwei Werten aus. :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> Für den Ausdruck <code>expression</code> gelten dabei dieselben Regeln wie bei <code>[[##expr|#expr]]</code>. Nach der Berechnung überprüft die Funktion, ob das Ergebnis ungleich Null ist (Boolesch: ''true = 1/false = 0''). Eine leere Eingabe führt zur Ausgabe {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Wie oben erwähnt, bewertet Null zu {{phpi|false}} und jeder nicht-Null-Wert zu {{phpi|true}}, sodass diese Funktion gleichwertig ist mit einer, die nur <code>[[##ifeq|#ifeq]]</code> und <code>[[##expr|#expr]]</code> verwendet: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> außer für einen leeren oder falsch eingegebenen Ausdruck (eine Fehlermeldung wird wie ein leerer Ausdruck behandelt; es ist nicht gleich null, also bekommen wir <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' vergleichend :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Beide Parameter können auch weggelassen werden, in diesem Fall wird jeweils nichts ausgegeben: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' Boolesche Operatoren von Gleichheits- oder Ungleichheitsoperatoren werden unterstützt. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Die Ergebnisse von numerischen Vergleichen mit <code>[[##ifexpr|#ifexpr]]</code> stimmen nicht immer mit denen von <code>[[##ifeq|#ifeq]]</code> und <code>[[##switch|#switch]]</code> überein. Die beiden letzteren sind genauer als <code>[[##ifexpr|#ifexpr]]</code> und liefern daher möglicherweise nicht die gleichen Ergebnisse. Betrachte diese Vergleiche mit geänderter Endziffer: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Da PHP, das in <code>[[##ifeq|#ifeq]]</code> und <code>[[##switch|#switch]]</code> verwendet wird, zwei Zahlen vom Typ Integer vergleicht, gibt es das erwartete Ergebnis korrekt zurück. Wohingegen mit <code>[[##ifexpr|#ifexpr]]</code> und den gleichen Zahlen: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Mit der anderen Ziffer ist das Ergebnis von gleich eigentlich falsch. Dieses Verhalten in <code>[[##ifexpr|#ifexpr]]</code> wird verursacht, weil MediaWiki Literalzahlen in Ausdrücken in den Typ Float umwandelt, was für große Ganzzahlen wie diese eine Rundung beinhaltet.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=Siehe Manual:Checking for page existence für weitere Methoden mit anderen Einschränkungen, um das Vorhandensein einer Seite zu prüfen.}} Diese Funktion überprüft, ob eine bestimmte Seite im Wiki existiert, und gibt je nachdem einen von zwei Parametern aus. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">Die Funktion ergibt {{phpi|true}}, wenn die Seite existiert, ob sie Inhalt enthält, sichtbar leer ist (enthält Metadaten wie Kategorienlinks oder {{ll|Help:Magic words|Magische Wörter}}, aber nicht sichtbar Inhalt), ist leer oder ist eine {{ll|Help:Redirects|Weiterleitung}}. Nur Seiten, die mit einem Rotlink versehen sind, werden als $2 ausgewertet, auch wenn die Seite früher existierte, aber gelöscht wurde.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' Die Funktion ergibt {{phpi|true}} für {{ll|Help:System message|Systemnachrichten}}, die angepasst wurden, und für {{ll|Help:Special pages|Spezialseiten}}, die von der Software definiert wurden. :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (weil die Erweiterung {{ll|Extension:Checkuser|nsp=0}} in diesem Wiki installiert ist) | '''doesn't exist''' (weil die Erweiterung {{ll|Extension:Checkuser|nsp=0}} in diesem Wiki nicht installiert ist) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (da [[{{ns:8}}:Copyright]] angepasst wurde) | '''doesn't exist''' (da [[{{ns:8}}:Copyright]] noch nicht angepasst wurde) }} Vor MediaWiki 1.45 erscheint eine Seite, die von einer anderen Seite mit <code>#ifexist:</code> überprüft wurde, in der [[{{#special:WhatLinksHere}}]]-Liste. Wenn also der Code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> aktuell auf dieser Seite ({{FULLPAGENAME}}) enthalten wäre, dann würde [[{{#special:WhatLinksHere}}/Foo]] die Seite {{FULLPAGENAME}} aufführen. In Wikis, die eine gemeinschaftliche Bilddatenbank nutzen (z. B. Wikimedia Commons), kann <code>#ifexist:</code> benutzt werden, um zu überprüfen, ob Dateien im lokalen Wiki oder in der externen Bilddatenbank hochgeladen wurden. :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' Wenn die lokale Bildbeschreibungsseite angelegt wurde, ist das Resultat für all diese Tests '''existiert'''. <code>#ifexist:</code> funktioniert nicht bei Interwiki-Links. <span id="ifexist_limits"></span> === Grenzen von ifexist === <code>#ifexist:</code> wird als „aufwendige Parserfunktion“ eingestuft; nur eine bestimmte Anzahl von ihnen kann auf einer bestimmten Seite eingebunden werden (Funktionen in eingebundenen Vorlagen eingeschlossen). Wenn dieses Limit überschritten wird, geben weitere <code>#ifexist:</code>-Funktionen automatisch falsch zurück, unabhängig davon, ob die Zielseite existiert oder nicht, und die Seite wird in [[:Category:{{MediaWiki:expensive-parserfunction-category}}]] eingeordnet. Der Name der {{ll|Help:Tracking categories|Wartungskategorie}} kann von der Inhaltssprache deines Wikis abhängen. Für einige Anwendungsfälle ist es möglich, den Ifexist-Effekt mit CSS zu emulieren, indem die Selektoren <code>a.new</code> (um Links zu nicht existierenden Seiten auszuwählen) oder <code>a:not(.new)</code> (um Links zu bestehenden Seiten auszuwählen) verwendet werden. Da außerdem die Anzahl der teuren Parser-Funktionen, die auf einer einzelnen Seite verwendet werden können, durch <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code> gesteuert wird, kann man das Limit bei Bedarf auch in LocalSettings.php erhöhen. <span id="ifexist_and_wanted_pages"></span> === ifexist und gesuchte Seiten === Vor MediaWiki 1.45 erschien eine Seite, die nicht existiert und auf die Verwendung von #ifexist geprüft wurde, auf den [[Special:MyLanguage/Manual:WantedPages|Gewünschten Seiten]]. Siehe {{phab|T14019}} für den Grund und [[w:Template:Linkless existiert]] für eine Problemumgehung. == #rel2abs == Diese Funktion wandelt einen relativen Dateipfad in einen absoluten Dateipfad um. :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> Innerhalb der <code>path</code>-Eingabe gilt die folgende Syntax: *<code>.</code> → aktuelle Ebene *<code>..</code> → Eine Ebene höher *<code>/foo</code> → Eine Ebene tiefer in die Unterseite /foo Wenn <code>base path</code> nicht angegeben ist, wird stattdessen der vollständige Seitenname der Seite verwendet: :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' Ungültige Syntax wie <code>/.</code> oder <code>/./</code> wird ignoriert. Da nicht mehr als zwei aufeinanderfolgende Punkte erlaubt sind, können Sequenzen wie diese verwendet werden, um aufeinanderfolgende Anweisungen zu trennen: :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' Für eine vergleichbare Gruppe an Funktionen siehe auch [[Special:MyLanguage/Help:Magic words#URL data|Hilfe:Magische Wörter#URL-Daten]]. Eingebildete Parserfunktionen sind: 'localurl:', 'fullurl:', 'anchorencode:' usw. == #switch == ''Siehe auch: [[w:Help:Switch parser function]]'' Diese Funktion vergleicht einen Eingabewert mit mehreren Testfällen und gibt eine zugehörige Zeichenfolge zurück, wenn eine Übereinstimmung gefunden wird. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Beispiele: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <nowiki>#</nowiki>switch mit partiellen Transklusions-Tags kann sich auf eine Konfigurationsdatei auswirken, die es einem Editor, der mit Template-Codierung nicht vertraut ist, ermöglicht, konfigurierbare Elemente anzuzeigen und zu bearbeiten. <span id="Default"></span> === Standard === Das <code>''default result''</code> wird zurückgegeben, wenn kein <code>''case''</code>-String mit dem <code>''comparison string''</code> übereinstimmt: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' In dieser Syntax muss das Standardergebnis der letzte Parameter sein und darf kein rohes Gleichheitszeichen (ein Gleichheitszeichen ohne <code><nowiki>{{}}</nowiki></code>) enthalten. Wenn dies der Fall ist, wird dies als Fallvergleich behandelt, und es wird kein Text angezeigt, wenn keine Fälle übereinstimmen. Dies liegt daran, dass der Standardwert nicht definiert wurde (weil er leer ist). Im Falle einer Übereinstimmung jedoch wird der zugehörige String zurückgegeben. :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> Alternativ kann das Standardergebnis explizit mit einer <code>''case''</code>-Zeichenfolge von "<code>#default</code>" deklariert werden. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Auf diese Weise deklarierte Standardergebnisse können an beliebiger Stelle innerhalb der Funktion platziert werden: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' Wenn der Parameter <code>''default''</code> weggelassen wird und keine Übereinstimmung gefunden wird, wird kein <code>''result''</code> zurückgegeben: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Ergebnisse gruppieren === Es ist möglich, dass Werte durchfallen, bei denen mehrere <code>''case''</code>-Strings denselben <code>''result''</code>-String zurückgeben. Dadurch wird Doppelarbeit minimiert. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Hier geben die Fälle 2, 3 und 4 alle <code>''result234''</code> zurück; Fall 6 und 7 geben beide <code>''result67''</code> zurück. Das "<code>#default = </code>" im letzten Parameter kann im obigen Fall weggelassen werden. <span id="Use_with_parameters"></span> === Verwendung mit Parametern === Die Funktion kann mit Parametern als Teststring verwendet werden. In diesem Fall ist es nicht erforderlich, die Pipe nach dem Parameternamen zu platzieren, da es sehr unwahrscheinlich ist, dass Sie die Zeichenfolge „<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>“ als Groß-/Kleinschreibung festlegen. (Dies ist der Wert, auf den der Parameter standardmäßig gesetzt wird, wenn die Pipe nicht vorhanden ist und der Parameter nicht vorhanden ist oder keinen Wert hat. Siehe {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> Wenn im obigen Fall <code><nowiki>{{{1}}}</nowiki></code> gleich <code>foo</code> ist, gibt die Funktion <code>Foo</code> zurück. Wenn es gleich <code>baz</code> ist, gibt die Funktion <code>Baz</code> zurück. Wenn der Parameter leer ist oder nicht existiert, gibt die Funktion <code>Bar</code> zurück. Wie im obigen Abschnitt können Fälle kombiniert werden, um ein einziges Ergebnis zu erhalten. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> Wenn hier <code><nowiki>{{{1}}}</nowiki></code> gleich <code>foo</code>, <code>zoo</code> oder <code>roo</code> ist, gibt die Funktion <code>Foo</code> zurück. Wenn es gleich <code>baz</code> ist, gibt die Funktion <code>Baz</code> zurück. Wenn der Parameter leer ist oder nicht existiert, gibt die Funktion <code>Bar</code> zurück. Außerdem kann das Standardergebnis weggelassen werden, wenn Sie nichts zurückgeben möchten, wenn der Testparameterwert keinem der Fälle entspricht. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> In diesem Fall gibt die Funktion eine leere Zeichenfolge zurück, es sei denn, <code><nowiki>{{{1}}}</nowiki></code> existiert und ist gleich <code>foo</code> oder <code>bar</code>, in diesem Fall gibt sie <code>Foo</code> bzw. <code>Bar</code> zurück. Dies hat den gleichen Effekt wie das Deklarieren des Standardergebnisses als leer. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> Wenn Sie aus irgendeinem Grund entscheiden, einen Fall als "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" festzulegen, gibt die Funktion das Ergebnis dieses Falls zurück, wenn der Parameter nicht existiert oder keinen Wert hat. Der Parameter müsste vorhanden sein und einen anderen Wert als die Zeichenfolge "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" haben, um das Standardergebnis der Funktion zurückzugeben. :(wenn <code><nowiki>{{{1}}}</nowiki></code> nicht existiert oder leer ist): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(wenn <code><nowiki>{{{1}}}</nowiki></code> den Wert "<code>test</code>" hat): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(wenn <code><nowiki>{{{1}}}</nowiki></code> den Wert "<code><nowiki>{{{1}}}</nowiki></code>" hat): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' In diesem hypothetischen Fall müssten Sie die Pipe zum Parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>) hinzufügen. <span id="Comparison_behavior"></span> === Vergleiche === Wie bei <code>[[##ifeq|#ifeq]]</code> wird der Vergleich numerisch durchgeführt, wenn sowohl die Vergleichszeichenfolge als auch die zu testende Fallzeichenfolge numerisch sind; oder als case-sensitive Zeichenfolge ansonsten: :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' Ein <code>''case''</code>-String kann leer sein: :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' Sobald eine Übereinstimmung gefunden wurde, werden nachfolgende <code>''cases''</code> ignoriert: :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= Numerische Vergleiche mit <code>[[##switch|#switch]]</code> und <code>[[##ifeq|#ifeq]]</code> sind nicht gleichbedeutend mit Vergleichen in Ausdrücken (siehe auch oben): :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <span id="Raw_equal_signs"></span> === Ist-Gleich-Zeichen === "Case"-Strings dürfen keine rohen Gleichheitszeichen enthalten. Um dies zu umgehen, verwenden Sie das magische Wort [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]], oder ersetzen Sie das Gleichheitszeichen durch den HTML-Code <code><nowiki>&amp;#61;</nowiki></code>. Beispiel: {| class="wikitable" ! Sie schreiben ! Sie erhalten |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=Ein einfaches reales Beispiel für die Verwendung dieser Funktion finden Sie unter [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Zwei komplexe Beispiele finden sich unter {{ll|Template:Extension}} und [[w:Template:BOTREQ]]. }} <span id="Replacing_#ifeq"></span> === #ifeq ersetzen === <code>#switch</code> kann verwendet werden, um die [[Special:MyLanguage/Help:Expansion depth|Expansionstiefe]] zu reduzieren. Zum Beispiel: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> ist gleichbedeutend mit * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> d.h. tief verschachtelt, linear: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> Andererseits könnte der Switch-Ersatz kompliziert/unpraktisch für IFs sein, die in beiden Zweigen verschachtelt sind (gezeigt mit Einrückungsalternativen, auf beiden Seiten eingerückt), wodurch ein vollständig symmetrischer Baum entsteht: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Code ! {{hl1}} | Beschreibung ! {{hl1}} | Aktuelle Ausgabe <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small> |- ! {{hl2}} colspan="3"| Jahr |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Jahreszahl mit 4 Stellen | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Jahreszahl mit 2 Stellen | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1 für ein Schaltjahr, 0 für andere Jahre. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|Erfordert PHP 5.1.0 oder neuer und [[rev:45208]].|group=note}} | ISO-8601-Jahr für die angegebene Woche.{{#tag:ref|Dies hat denselben Wert wie Y, außer wenn die ISO Wochennummer (W) zum letzten oder nächsten Jahr gehört, dann wird dieses Jahr stattdessen verwendet.|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|Gibt buchstäblich ''o'' aus, wenn Anmerkung 1 nicht erfüllt ist.|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Monat |- | style="text-align: center;" | <code>n</code> | Monatszahl ohne führende Null. | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | Monatszahl mit führender Null. | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | Abkürzung des Monatsnamens in der Seitensprache. | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | Vollständiger Monatsname in der Seitensprache. | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | Gibt den vollständigen Monatsnamen in der [[w:de:Genitiv|Genitiv]]-Form der Seitensprache aus, der zwischen Genitiv- und [[w:de:Nominativ|Nominativ]]-Formen unterscheidet. Diese Option ist für viele [[w:de:Slawische Sprachen|slawische Sprachen]] wie Polnisch, Russisch, Weißrussisch, Tschechisch, Slowakisch, Slowenisch, Ukrainisch usw. nützlich. | style="line-height: 1.6;" | Für Polnisch:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(Nominativ)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(Genitiv) |- ! {{hl2}} colspan="3"| Tag oder Monat des Jahres |- | style="text-align: center;" | <code>j</code> | Tag des Monats ohne führende Null. | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | Tag des Monats mit führender Null. | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | Tag des Jahres (Januar&nbsp;1 = 0).<br />{{note}} Um den ISO-Tag des Jahres zu erhalten, muss 1 addiert werden. | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Woche und Wochentag |- | style="text-align: center;" | <code>W</code> | ISO-8601-Wochennummer mit führender Null. | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | ISO-8601-Wochentag (Montag = 1, Sonntag = 7). | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | Ziffer des Wochentags (Sonntag = 0, Samstag = 6). | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | Abkürzung für den Wochentag. Selten internationalisiert. | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | Vollständiger Wochentagsname. Selten internationalisiert. | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Stunde |- | style="text-align: center;" | <code>a</code> | "am" am Morgen (00:00:00 → 11:59:59), "pm" ab Mittag (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Schreibweise in Großbuchstaben von <code>a</code> oben. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Stunde im 12-Stunden-Format ohne führende Null. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Stunde im 12-Stunden-Format mit führender Null. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Stunde im 24-Stunden-Format ohne führende Null. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Stunde im 24-Stunden-Format mit führender Null. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minuten und Sekunden |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | Minuten nach der Stunde mit führender Null. | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | Sekunden nach der Minute mit führender Null. | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unixzeit|Unixzeit]]. Sekunden seit 1. Januar 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Zeitzone (nach [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Zeitzonen-Identifikator. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | Ob das Datum sich in der Sommerzeit (Zeitumstellung) befindet. | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Unterschied zur Greenwich-Zeit (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Unterschied zur Greenwich Zeit (GMT), mit Doppelpunkt | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Zeitzonen-Abkürzung. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | Zeitzonen-Abweichung in Sekunden. | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Sonstiges |- | style="text-align: center;" | <code>t</code> | Anzahl der Tage im aktuellen Monat. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | ISO-8601-formatiertes Datum, entspricht <code>Y-m-d"T"H:i:s+00:00</code>. | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | [[rfc:5322|RFC 5322]]-formatiertes Datum, entspricht <code>D, j M Y H:i:s +0000</code>, mit nicht internationalisierten Wochentags- und Monatsnamen. | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Nicht-Gregorianische Kalender |- ! {{hl3}} colspan="3" | Islamisch |- | style="text-align: center;" | <code>xmj</code> | Tag des Monats. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Vollständiger Monatsname. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Monatszahl. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Vollständiges Jahr. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iranisch (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Anzahl der Tage im Monat. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Tag des Jahres. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Tag des Monats. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Vollständiger Monatsname. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Monatszahl. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Vollständiges Jahr. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Jahreszahl mit 2 Stellen. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebräisch |- | style="text-align: center;" | <code>xjj</code> | Tag des Monats. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Vollständiger Monatsname. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Anzahl der Tage im Monat. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Genitivform des Monatsnamen. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Monatszahl. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Vollständiges Jahr. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Thai solar |- | style="text-align: center;" | <code>xkY</code> | Vollständiges Jahr im [[w:Suriyakati-Kalender|Suriyakati-Kalender]].<br />{{note}} Für Jahre vor 1941 werden Datumsangaben zwischen Januar und März nicht korrekt umgerechnet. | {{#time:xkY}} |- ! {{hl3}} colspan="3" | Jahr nach dem Minguo-/Juche-Kalender |- | style="text-align: center;" | <code>xoY</code> | Vollständiges Jahr. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | Japanisches "nengo" |- | style="text-align: center;" | <code>xtY</code> | Vollständiges Jahr. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | Flags |- | style="text-align: center;" | <code>xn</code> | Formatieren Sie den nächsten numerischen Code als reine ASCII-Zahl. | In Hindi erzeugt <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> ०६, 06. |- | style="text-align: center;" | <code>xN</code> | colspan="2" | Wie <code>xn</code>, aber als umgeschaltetes Flag, das bis zum Ende des Strings oder bis zum nächsten Auftreten von <code>xN</code> im String bestehen bleibt. |- | style="text-align: center;" | <code>xr</code> | Formatieren Sie die nächste Zahl als römische Zahl. Funktioniert nur für Zahlen bis zu 10.000<br /><small>(bis zu 3.000 vor MediaWiki 1.20)</small>. | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | Formatieren Sie die nächste Zahl als hebräische Ziffer. | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} Dies Parserfunktion nimmt ein Datum und/oder eine Zeit (im Gregorianischen Kalender) und formatiert es gemäß der gegebenen Syntax. Eine Datum/Zeit-Einheit kann bestimmt werden, der Standardwert ist der Wert des [[Special:MyLanguage/Help:Magic words#Date and time|magischen Worts]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; d.h. die Zeit, als die Seite zuletzt in HTML übersetzt wurde. :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> Die Liste der gültigen Formate ist der Tabelle rechts zu entnehmen. Jedes Zeichen im formatierten String, das nicht erkannt wird, wird unverändert ausgegeben; dies betrifft auch Leerzeichen (das System braucht diese nicht für das Interpretieren des Codes). Wenn im formatierten String kein Zeichen erkannt wird und das Datums-/Uhrzeitobjekt fehlerfrei ist, wird die formatierte String als Ausgabe zurückgegeben. Es gibt zwei Wege, Zeichen innerhalb des Formatierungs-Strings zu umgehen: # <span class="mw-translate-fuzzy">#Ein linksseitiger Schrägstrich (Backslash) wird als einzelnes buchstäbliches Zeichen interpretiert.</span> # <span class="mw-translate-fuzzy">#Zeichen innerhalb doppelten Anführungszeichen werden als buchstäbliche Zeichen interpretiert und die Anführungszeichen entfernt.</span> Zusätzlich wird der Digraph <code>xx</code> als einzelnes buchstäbliches "x" interpretiert. Da sich die Liste der Formatierungscodes weiter entwickelt (mit Unterstützung neuer Kalender oder neuer Datumsfelder, die anders berechnet und formatiert werden), sollten Sie alle Literalzeichen (nicht nur ASCII-Buchstaben, die derzeit von Formatierungscodes verwendet werden) mit Escapezeichen versehen, die übergeben werden müssen unverändert durch. Leider wird das einfache ASCII-Anführungszeichen derzeit noch nicht als einfache Alternative zum Markieren von wörtlichem Text zu den derzeit unterstützten doppelten ASCII-Anführungszeichen erkannt (z , C++...) und Backslashes (die auch in String-Konstanten maskiert werden müssen, die von vielen Sprachen verwendet werden, darunter JSON, C, C++, PHP, JavaScript, Lua). Sie können also immer noch kein wörtliches doppeltes Anführungszeichen einbetten, ohne es mit einem Backslash zu umgehen (oder Sie können stattdessen andere geschweifte, eckige oder quadratische Anführungszeichen verwenden). :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' Die <code>''Datum/Zeit-Einheit''</code> kann in jedem von der PHP-Funktion [https://php.net/function.strtotime strtotime()] akzeptierten Format sein. Absolute (z. B. 1 $), relative (z. B. 2 $) und kombinierte Zeiten (z. B. 3 $) werden akzeptiert. :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' Der <code>''Sprachcode''</code> in [[w:ISO 639-3|ISO 639-3]] (?) ermöglicht die Anzeige des Strings in der gewählten Sprache :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' Der Parameter <code>''local''</code> gibt an, ob sich das ''date/time object'' auf die lokale Zeitzone oder auf UTC bezieht. Dies ist ein boolescher Parameter: Sein Wert wird bestimmt, indem der Wert des Arguments umgewandelt wird (siehe die [https://php.net/language.types.boolean#language.types.boolean.casting offizielle PHP-Dokumentation] für Details darüber, wie Strings in boolesche Werte umgewandelt werden). {{note|2=reminder|1=Bitte beachten Sie, dass es keinen Unterschied in der Ausgabe gibt, wenn die Variable {{phpi|$wgLocaltimezone}} auf <code>UTC</code> gesetzt ist, wenn <code>local</code> auf <code>true</code> oder <code>false</code> gesetzt ist.}} Vergleiche mit den folgenden Beispielen: :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' Unix Zeitstempel können in Datumsrechnungen verwendet werden, indem ein <code>@</code> Symbol vorangestellt wird. :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= Ohne das Präfix <code>@</code> vor numerischen Zeitstempelwerten ist das Ergebnis meistens ein Fehler oder ein unerwarteter Wert: :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (korrekt) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (nicht unterstütztes Datumsformat) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (korrekt) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' (Ausgabe als Jahr mit aktuellem Monat und dem Tag des jeweiligen Monats) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (korrekt) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' (Ausgabe als Jahr mit dem aktuellen Monat und dem Tag des Monats) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (korrekt) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (nicht unterstütztes Jahresformat) }} {{Warning|1= Die gültige Zeitspanne umfasst 1. Januar 0111 → 31. Dezember 9999. Für die Jahre 100 bis 110 ist die Ausgabe inkonsitent und Schaltjahre werden wie die Jahre 100–110: r, D, l und U interpretieren diese Jahre als 2000-2010. :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> (korrekt, kein Schaltjahr), aber :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' (falsch, auch wenn 100 als 2000 interpretiert wird, da dies ein Schaltjahr ist) :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' Jahreszahlen 0-99 werden als 2000-2069 und 1970-1999 interpretiert, außer sie werden im 4-Ziffernformat mit führender Null geschrieben: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) Der Wochentag wird ausgegeben für die Jahre 100-110 und ab 1753, für die Jahre 111-1752 zeigt die r-Ausgabe "Unbekannt" und die l-Ausgabe "<>". Als Folge davon wird die r-Ausgabe für diese Jahre nicht als Eingabe akzeptiert. }} Es können vollständige oder Teile von absoluten Datumsangaben angegeben werden, die Funktion "füllt" die fehlenden Datumsteile mit den ''aktuellen'' Werten: :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= Diese Ausfüllfunktion ist inkonsistent, manche Teile werden mit aktuellen Werten gefüllt, andere nicht: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' Zeigt den Tagesbeginn, aber den aktuellen Tag des Monats und das aktuelle Jahr. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' Zeigt den Tagesbeginn, aber den aktuellen Tag des Jahres. Es gibt einen Ausnahmefall des eingefüllten Tages: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' Gibt den Beginn des Tages und den Beginn des Monats an. }} Eine vierstellige Zahl wird immer als Jahr interpretiert, niemals als Stunden und Minuten: <ref>Vor {{rev|86805}} im Jahr 2011 war dies nicht der Fall.</ref> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' Eine sechsstellige Zahl wird wenn möglich als Stunden, Minuten und Sekunden interpretiert, aber andernfalls als Fehler (nicht z.B. als Jahr und Monat): :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' Die Eingabe wird als Zeit behandelt statt Jahr- & Monats-Code. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' Obwohl 19:60:09 keine gültige Zeitangabe ist, wird 196009 nicht als September 1960 interpretiert. Die Funktion führt eine gewisse Menge an Datums-Rechnungen durch: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' Die Gesamtlänge der Formatstrings der Aufrufe von <code>#time</code> ist auf 6000 Zeichen begrenzt.<ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Zeitzonenprobleme ==== Es gibt einen Fehler in dieser #time-Parser-Funktion (genauer gesagt in „PHP DateTime“), der die Übergabe von „Nicht-Ganzzahlen“ als relative Zeitzonen-Offsets nicht zulässt. Dieses Problem tritt nicht auf, wenn eine stündliche Zeitzone wie EDT verwendet wird. Zum Beispiel: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} Indien hat jedoch einen Zeitversatz von +5,5 Stunden von UTC, und daher ermöglicht die Verwendung seiner Zeitzone normalerweise nicht die korrekte Berechnung eines relativen Zeitzonenversatzes. Folgendes passiert: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} Um dieses Problem zu umgehen, wandeln Sie einfach die Zeit wie folgt in Minuten oder Sekunden um: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} (Tim Starling, der Entwickler dieser Funktion, hat die genaue Syntax für diese Lösung bereitgestellt.) <span id="#time_format_like_in_signatures"></span> ==== #time-Format wie in Unterschriften ==== Manchmal ist es nützlich, einen Zeitstempel herzustellen, der wie der automatische Zeitstempel aussieht, den [[Special:MyLanguage/Help:Signatures|Unterschriften]] in Beiträgen auf Diskussionsseiten erzeugen. In einem englischsprachigen Wiki kann sie generiert werden mit: * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == Diese Funktion ist eine Kurzform und somit identisch mit <code><nowiki>{{#time: ... }}</nowiki></code>, wenn der Parameter <code>local</code> auf {{phpi|true}} gesetzt ist, also verwendet sie immer die Ortszeit des Wikis (wie in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}} eingestellt). Der Quelltext dieser Funktion sieht folgendermaßen aus: :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=Bitte beachten Sie, dass es keinen Unterschied in der Ausgabe gibt, wenn die Variable {{phpi|$wgLocaltimezone}} auf <code>UTC</code> gesetzt ist, wenn <code>local</code> auf {{phpi|true}} oder {{phpi|false}} gesetzt ist}} [[File:Time-Timel.png|thumb|Beispiel für die Verwendung der #time- und #timel-Parserfunktionen von einem Server, dessen Zeitzone nicht UTC ist]] Siehe zum Beispiel die folgenden Beispiele: :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|Beispiel für eine Warnung von https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid]] {{Warning|1= Beachten Sie, dass U für time und timel die gleiche Anzahl von Sekunden seit dem 01.01.1970 00:00:00 UTC zurückgibt. :<code>U</code> Unix-Zeit. Sekunden seit dem 1. Januar 1970 00:00:00 GMT. :<code>Z</code> Zeitzonen-Offset in Sekunden. :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == Diese Funktion formatiert ein Datum gemäß dem Standardformat der ausgewählten Sprache, wie es in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> definiert ist (siehe {{Phab|T223772}}). : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=''Datum/Zeit-Objekt'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=''Datum/Zeit-Objekt'' |2=''Formattyp'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=''Datum/Zeit-Objekt'' |2=''Formattyp'' |3=''Sprachcode'' }} Das Format des ''Datum/Zeit-Objekts'' ist dasselbe wie bei [[#time|#time]]. Wenn es leer ist, wird die Zeit verwendet, zu der die Seite erstellt worden ist. Der ''Formattyp'' kann sein: ; <code>time</code> : Nur die Zeit wird angezeigt. ; <code>date</code> : Nur das Datum wird angezeigt. ; <code>both</code> : Sowohl Zeit als auch Datum werden angezeigt. ; <code>pretty</code> : Nur das Datum wird angezeigt, in abgekürzter Form und ohne das Jahr. Dies wird nicht in allen Sprachen unterstützt; wird es nicht unterstützt, dann wird das Format „time“ verwendet. Wenn der ''Formattyp'' nicht festgelegt wird, werden sowohl Zeit als auch Datum angezeigt, als ob <code>both</code> festgelegt wäre. Wenn der ''Sprachcode'' nicht festgelegt wird, wird die Inhaltssprache der Seite verwendet. Wird <code>#timef</code> statt <code>#time</code> verwendet, ermöglicht dies Vorlagen die leichtere Unterstützung mehrfacher Sprachen, da Datumsangaben in verschiedenen Sprachen auf verschiedene Weise formatiert werden. Im Englischen wird die Reihenfolge von Tag und Monat durch {{wg|AmericanDates}} bestimmt. Beispiele: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == Diese Funktion ist die gleiche wie [[#timef|#timef]], nur wird die lokale Zeitzone des Wikis verwendet, die in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}} eingestellt wird. :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == Diese Funktion trennt einen Seitentitel basierend auf Schrägstrichen in Segmente und gibt dann einige dieser Segmente als Ausgabe zurück. : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=Seitentitel |2=Anzahl der wiederkehrenden Segmente |3=Erstes wiederkehrendes Segment }} Wenn der Parameter ''Anzahl der zurückzugebenden Segmente'' nicht angegeben ist, wird standardmäßig „0“ verwendet, wodurch alle Segmente ab dem ''ersten zurückzugebenden Segment'' (einschließlich) zurückgegeben werden. Wenn der Parameter ''first segment to return'' nicht angegeben ist oder „0“ ist, ist er standardmäßig „1“: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Siehe auch <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' Negative Werte werden für beide Werte akzeptiert. Negative Werte für den Parameter ''Anzahl der zurückzugebenden Segmente'' entfernen effektiv Segmente vom Ende der Zeichenfolge. Negative Werte für das ''erste zurückzugebende Segment'' bedeuten „beginne mit diesem Segment, zähle von rechts“: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' Entfernt ein Segment vom Ende der Zeichenfolge. Siehe auch {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' Entfernt alle 4 Segmente vom Ende der Zeichenfolge : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' Entfernt 5 Segmente vom Ende der Zeichenfolge (mehr als vorhanden) : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' Lässt das letzte Segment wiederkehren. Siehe auch {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' Entfernt ein Segment vom Ende der Zeichenfolge und gibt dann das zweite Segment und darüber hinaus zurück : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' Beginnen Sie mit dem Kopieren beim vorletzten Element; Streifen Sie ein Segment vom Ende der Zeichenfolge Vor der Verarbeitung wird der Parameter ''pagename'' HTML-dekodiert: Wenn er einige Standard-HTML-Zeicheneinheiten enthält, werden sie in einfache Zeichen konvertiert (intern kodiert mit UTF-8, d. h. die gleiche Kodierung wie in der MediaWiki-Quellseite mit diese Parser-Funktion). : Beispielsweise wird jedes Vorkommen von <code>&amp;quot;</code>, <code>&amp;#34;</code> oder <code>&amp;#x22;</code> in „Seitenname“ durch <code>"</code> ersetzt. : Es wird keine weitere Konvertierung von HTML in reinen Text durchgeführt, sodass HTML-Tags in diesem ersten Schritt intakt bleiben, selbst wenn sie in Seitentiteln ungültig sind. {{tip| 1= Einige magische Schlüsselwörter oder Parser-Funktionen von MediaWiki (wie <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> und ähnliche) sind dafür bekannt, Zeichenfolgen zurückzugeben, die unnötigerweise HTML-kodiert sind, selbst wenn ihr eigener Eingabeparameter nicht HTML-kodiert war: Die Parser-Funktion titleparts kann dann als Problemumgehung verwendet werden, um diese zurückgegebenen Zeichenfolgen so zu konvertieren, dass sie von einigen anderen Parser-Funktionen korrekt verarbeitet werden können, die ebenfalls einen Seitennamen im Parameter verwenden (z. B. <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>, die aber immer noch nicht richtig mit HTML-codierten Eingabezeichenfolgen funktionieren. This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. Wenn die aktuelle Seite beispielsweise [[commons:Category:Côte-d'Or|Category:Côte-d'Or]] lautet, dann: * <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight> und <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> geben beide <code>1</code> zurück; (Die #ifeq-Parserfunktion führt die HTML-Decodierung ihrer Eingabeparameter durch). * <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight> und <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> geben beide <code>1</code> zurück; (Die Parser-Funktion #switch führt die HTML-Decodierung ihrer Eingabeparameter durch). * <syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight> oder sogar <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> geben alle <code>1</code> zurück, wenn diese Kategorieseite existiert (die #ifexist-Parser-Funktion führt die HTML-Decodierung ihrer Eingabeparameter durch); * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> gibt eine Zahl ungleich Null zurück, wenn diese Kategorie Seiten oder Unterkategorien enthält, '''aber''': * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, kann immer noch '''unbedingt''' 0 zurückgeben, genau wie: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> Der Grund für dieses unerwartete Verhalten ist, dass es bei den aktuellen Versionen von MediaWiki zwei Vorbehalte gibt: * <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight> oder sogar <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''können'' den tatsächlich HTML-codierten String <code>Category:Côte-d&apos;Or</code> zurückgeben und nicht den erwarteten <code>Category:Côte-d'Or</code>, und das: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''bedingungslos''' gibt 0 zurück (das magische Schlüsselwort PAGESINCAT führt keine HTML-Decodierung seines Eingabeparameters durch). Die einfache Problemumgehung mit Titelteilen (die weiterhin funktionieren, wenn die beiden Vorbehalte in einer späteren Version von MediaWiki behoben werden) ist: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, die alle die tatsächliche Anzahl der Seiten in derselben Kategorie zurückgeben. }} Dann wird der decodierte ''Seitenname'' in einen von MediaWiki unterstützten Standard-Seitentitel kanonisiert, so weit wie möglich: # Alle Unterstriche werden automatisch durch Leerzeichen ersetzt: #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' Nicht bah_boo, sondern ohne den Unterstrich im Original. # Die Saite wird maximal 25 Mal geteilt; weitere Schrägstriche werden ignoriert und das 25. Element enthält den Rest der Zeichenfolge. Der String ist außerdem auf 255 Zeichen begrenzt, da er als [[Special:MyLanguage/Manual:Page table#Schema summary|Seitentitel]] behandelt wird: #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: Wenn Sie diese Funktion aus irgendeinem Grund an ihre Grenzen bringen mussten, obwohl dies sehr unwahrscheinlich ist, ist es möglich, die 25-Split-Grenze durch Verschachteln von Funktionsaufrufen zu umgehen: #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # Schließlich wird der erste Teilstring gemäß den Großschreibungseinstellungen des lokalen Wikis groß geschrieben (wenn dieser Teilstring auch mit einem lokalen Namespace-Namen beginnt, wird dieser Namespace-Name ebenfalls normalisiert). #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= Sie können #titleparts als kleinen "String-Parser und -Konverter" verwenden, aber bedenken Sie, dass er den ersten Teilstring groß geschrieben zurückgibt: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' Wenn Kleinschreibung erforderlich ist, verwenden Sie die Funktion lc:, um die Ausgabe zu steuern: : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' Sie können am Anfang der Zeichenfolge einen 'Dummy'-Schrägstrich voranstellen, um die korrekte Groß- oder Kleinschreibung der ersten Teilzeichenfolge zu erhalten. Verwenden Sie <code>2</code> anstelle von <code>1</code> für ''erstes zurückzugebendes Segment'': : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= Bestimmte Zeichen, die in einem Seitentitel {{ll|Manual:Page title#Naming restrictions|nicht zulässig sind}}, führen dazu, dass #titleparts die Zeichenfolge nicht auswertet: : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Führt nicht zum erwarteten: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. Funktioniert nicht, weil Klammern in Seitentiteln nicht erwünscht sind und diese Parser-Funktion keine Links verarbeitet, die in ihren Eingabeparameter ''Seitenname'' eingebettet sind, selbst wenn sie die MediaWiki-Syntax oder andere HTML- oder MediaWiki-Tags verwenden. : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". Dies funktioniert nicht weil "#" auch in Seitentiteln nicht verwendet werden kann. }} {{Warning|1= Wenn ein Teil des Titels nur „<code>.</code>“ oder „<code>..</code>“ ist, wird #titleparts die Zeichenfolge nicht analysieren: : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. Der gesamte String wird zurückgegeben. Es produziert nicht das Erwartete: '''one''' }} {{Warning|1= Diese Funktion wird nicht ordnungsgemäß herabgesetzt, wenn die Eingabe 255 Byte in UTF-8 überschreitet. Wenn die Eingabezeichenfolge 256 Bytes oder mehr umfasst, wird die gesamte Zeichenfolge zurückgegeben. }} <span id="String_functions"></span> == String-Funktionen == {{Main|Extension:ParserFunctions/String functions}} Die Erweiterung ParserFunctions definiert optional verschiedene String-Funktionen wenn <code>$wgPFEnableStringFunctions</code> auf {{phpi|true}} gesetzt ist. * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Weiterführende Informationen finden Sie auf der Unterseite, Beispiele auf {{ll|Manual:Performing string operations with parser functions}}. {{Warning |1=Im Jahr 2013 wurde entschieden, dass '''diese Funktionen ''niemals'' in einem Wikimedia-Wiki aktiviert werden''', da sie bei großflächiger Nutzung ineffizient sind (siehe [[phab:T8455]] für einen Überblick über die Geschichte). '''Diese Funktionen funktionieren NICHT auf Wikis von Wikimedia!'''<br/><br/>Wenn Sie hier sind, um etwas über ein Wikimedia-Projekt zu schreiben, suchen Sie nach etwas anderem: Wenn Ihr Home-Wiki über String-Funktionen verfügt, verwendet es wahrscheinlich {{ll|Extension:Scribunto|Lua}}. Beispielsweise verwendet die englische Wikipedia [[w:Module:String|Module:String]], was einige der gleichen Dinge mit völlig unterschiedlicher Syntax bewirkt. Es gibt auch individuelle [[w:Template:String-handling-templates|String-Handling-Vorlagen]] }} Hier ein kleiner Überblick über die [[Module:String]] Funktionen: * [[w:Module:String#len|&#35;len]] (Länge des Strings): <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] (Unterstring): <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] (Position des Wertes): <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] (Wiederholung): <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Allgemeines == === Substitution === Parser-Funktionen können [[Special:MyLanguage/Help:Substitution|substituiert]] werden, indem dem Hash-Zeichen <code>'''subst:'''</code> vorangestellt wird: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → der Code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' wird in den Wikitext eingefügt, da die Seite {{FULLPAGENAME}} existiert. {{Warning|1= Die Ergebnisse von ersetzten Parser-Funktionen sind undefiniert, wenn die Ausdrücke ''nicht'' ersetzten flüchtigen Code wie {{ll|Help:Magic words#Variables|variables}} oder andere Parser-Funktionen enthalten. Für konsistente Ergebnisse muss der gesamte flüchtige Code im auszuwertenden Ausdruck ersetzt werden. Siehe [[w:Help:Substitution|Help:Substitution]].}} Substitution funktioniert nicht innerhalb von {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; Sie können zu diesem Zweck <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> verwenden. <span id="Redirects"></span> === Weiterleitungen === Besonders [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] könnte in {{ll|Help:Redirects|redirects}} zu Seiten mit Daten praktisch sein, aber das funktioniert nicht. <span id="Escaping_pipe_characters"></span> === Umgehen des Pipe-Zeichens („senkrechter Strich“) === <span id="In_tables"></span> ==== In Tabellen ==== Parser-Funktionen werden die {{ll|Help:Tables|wikitable}}-Syntax und Pipe-Zeichen (<code><nowiki>|</nowiki></code>) verstümmeln und alle rohen Pipe-Zeichen als Parameterteiler behandeln. Um dies zu vermeiden, verwendeten die meisten Wikis ein Template [[{{ns:10}}:!]], dessen Inhalt nur ein Pipe-Rohzeichen (<code><nowiki>|</nowiki></code>) war, seit MW 1.24 ersetzte ein {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> word}} diesen Humbug. Dies „versteckt“ die Pipe vor dem MediaWiki-Parser und stellt sicher, dass sie nicht berücksichtigt wird, bis alle Vorlagen und Variablen auf einer Seite erweitert wurden. Es wird dann als Tabellenzeilen- oder Spaltentrenner interpretiert. Alternativ kann eine rohe HTML-Tabellensyntax verwendet werden, obwohl dies weniger intuitiv und fehleranfälliger ist. Sie können bei der Anzeige das Pipe-Zeichen &vert; als einfaches, unverarbeitetes Zeichen umgehen, indem sie ein HTML-Sonderzeichen verwenden: <code>&amp;#124;</code> oder <code>&amp;vert;</code>. {| class="wikitable" ! Beschreibung ! Man tippt ! Man erhält |- | Umgehung des Pipe-Zeichens als Trennzeichen für Tabellenzeilen/Spalten | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | Umgehung des Pipe-Zeichen als einfaches Zeichen | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Bei Vorlagenaufrufen ==== Derselbe Pipe-Schutz gilt in folgendem Beispiel: <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> Wir stellen fest, dass ''text after'' nicht angezeigt wird, wenn vor ''sandbox name='' die Pipe | steht, da ''|sandbox name='' fälschlicherweise als Parameter der Vorlage ''Documentation'' betrachtet wird, der auf einer Stufe mit ''|content='' steht. <span id="Stripping_whitespace"></span> === Streichung von Leerzeichen === Leerzeichen, einschließlich Zeilenumbrüche, Tabulatoren und Leerzeichen, werden am Anfang und am Ende aller Parameter dieser Parser-Funktionen entfernt. Wenn dies nicht erwünscht ist, können Zeichenfolgen verglichen werden, nachdem sie in Anführungszeichen gesetzt wurden. :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span class="mw-translate-fuzzy">Um das Trimmen von then und anderen Teilen zu verhindern, siehe [[m:Template:If]]. Einige Leute erreichen dies, indem sie $2 statt Leerzeichen verwenden.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' Diese Methode kann jedoch nur verwendet werden, um ein '''einzelnes''' Whitespace-Zeichen zu rendern, da der Parser mehrere Whitespace-Zeichen hintereinander zu einem komprimiert. :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} In diesem Beispiel wird der Stil <code>white-space: pre</code> verwendet, um zu erzwingen, dass die Leerzeichen vom Browser beibehalten werden, aber selbst damit werden die Leerzeichen nicht angezeigt. Dies geschieht, weil die Leerzeichen von der Software entfernt werden, bevor sie an den Browser gesendet werden. Es ist möglich, dieses Verhalten zu umgehen, indem Leerzeichen durch <code>&amp;#32;</code> (''breakable space'') oder <code>&amp;nbsp;</code> (''non-breakable space'') ersetzt werden, da sie von der Software nicht modifiziert werden: :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' Zu beachten ist, dass nicht alle Parameter identisch erzeugt werden. In ParserFunctions werden Leerzeichen am Anfang und Ende immer entfernt. In {{ll|Help:Templates|templates}} werden Leerzeichen am Anfang und Ende von benannten und benannten unbenannten Parametern entfernt, nicht jedoch von unbenannten Parametern: :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Andere Parserfunktionen == <span id="Case_conversion_functions"></span> === Funktionen zur Umwandlung von Groß-/Kleinschreibung === * '''Kleinschreibung:''' {{xpdoc|lc: AbC|}} * '''Großschreibung:''' {{xpdoc|uc: AbC|}} * '''Erster Buchstabe klein:''' {{xpdoc|lcfirst: AbC}} * '''Erster Buchstabe groß:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Codierungsfunktionen === * '''URL-Codierung:''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> wird ausgegeben als ---- "{{urlencode: AbC dEf ghi}}" ---- Das heißt, dass ein neuer Zeilenbeginn innerhalb der Zeichenkette in %0A und dazwischenliegende Leerzeichen in + umgewandelt werden. <span id="Anchor_encoding"></span> === Anchor-Codierung === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> wird ausgegeben als ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Siehe auch == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – Eine (unvollständige) Liste der Parser-Funktionen, hinzugefügt durch "Core" sowie Erweiterungen. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – insbesondere zu Formatierung und Füllzeichen * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] löst {{ll|Extension:StringFunctions}} ab * Parser-Funktionen für ''Wikibase'' (die Erweiterung, die ''Wikidata'' bereitstellt): [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|Wie man Daten in Wikimedia-Projekten nutzt#Parserfunktion]] <span id="References"></span> == Anmerkungen == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] 8k06pd1dugx0csythmrxhh065d80it3 Extension:PageTriage 102 70055 8364865 8157881 2026-05-04T03:57:18Z Novem Linguae 12311063 fix PHP notice 8364865 wikitext text/x-wiki <languages /> {{Extension |templatemode = |status = stable |type1 = special |type2 = interface |newhook1 = |newhook2 = |username = |author = [[User:Kaldari|Ryan Kaldari]], [[User:Bsitu|Benny Situ]] |description = <translate><!--T:1--> Facilitates reviewing and approving new pages</translate> |image = Extension-PageTriage Special-NewPagesFeed Screenshot.png |imagesize = 300 |version = |update = |version preview = |update preview = |compatibility policy = rel |mediawiki = |php = |composer = |table1 = pagetriage_page |table2 = pagetriage_page_tags |table3 = pagetriage_tags |download = {{WikimediaDownload|phab=EPTR}} |readme = |changelog = |example = [[wikipedia:Special:NewPagesFeed | Special:NewPagesFeed on the English Wikipedia]] |namespace = |tags = |compatibility = |bugzilla = |phabricator = PageTriage |vagrant-role = }} <translate><!--T:3--> '''PageTriage''' is an extension that aims to provide a feature-rich interface for triaging newly-created articles.</translate> <translate><!--T:4--> It is intended to replace the ''new page patrol'' core function while adding additional functionality for reviewing, tagging, and improving new articles.</translate> <translate><!--T:13--> It adds a Special:NewPagesFeed page, and a page curation toolbar to new pages for those with the 'patrol' permission.</translate> <translate><!--T:5--> It was developed by the Wikimedia Foundation's [[<tvar name=engineering>Wikimedia_Features_engineering</tvar>|Features Engineering team]].</translate> <translate><!--T:6--> For additional details see ''[[<tvar name=curation>Page Curation</tvar>|Page Curation]]''.</translate> <translate><!--T:7--> An important note is that some of the configuration and code is specific to the English-language Wikipedia's workflows and as it's constructed now the extension is pretty much impossible to internationalise.</translate> <translate><!--T:8--> (See <tvar name=bugzilla>[[Phabricator:T50552]]</tvar>.)</translate> [[File:Page-Curation-Video.ogv|thumb|An overview of the page curation feature. The interface in the video is outdated but the content remains useful.]] <translate> == Installation == <!--T:10--> </translate> [[File:PageTriage-ListView-Whole.png|thumb|Screenshot of Special:NewPagesFeed as it appeared in 2012]] {{ExtensionInstall |db-update=yes |registration=required |localsettings= }} == Checking for successful install == <translate> <!--T:14--> To actually see the extension working: <!--T:15--> * Create a new page containing just a few sentences of text as an anonymous user.</translate> <translate> <!--T:16--> * Visit Special:NewPagesFeed </translate> <translate><!--T:17--> The new page should appear, flagged as "<tvar name=cat1>{{int|pagetriage-no-categories}}</tvar>", "<tvar name=cat2>{{int|pagetriage-orphan}}</tvar>", etc.</translate> <translate><!--T:18--> To see the page curation toolbar:</translate> <translate> <!--T:19--> * Login as a user with the 'sysop' permission, or add a group with the "[[<tvar name=help>Special:MyLanguage/Help:Patrolled_edits</tvar>|patrol]]" permission, and add some user to that group, and login as that user.</translate> <translate> <!--T:20--> * Visit Special:NewPagesFeed</translate> <translate> <!--T:21--> * Now you should see a "<tvar name=triage>{{int|pagetriage-triage}}</tvar>" button next to the new page.</translate> <translate> <!--T:22--> * Click this and you should see the page curation toolbar on the new page. == Advanced installation == <!--T:83--> === Additional extensions === <!--T:84--> <!--T:80--> For full functionality, you'll also need to install some additional extensions, although PageTriage works without them. </translate> * {{ll|Extension:Echo|Echo}} - Allows users to receive notifications for things like when an article they created has been marked as reviewed. * {{ll|Extension:ORES|ORES}} - In Special:NewPagesFeed, allows filtering by "predicted class" (<code>articlequality</code>: stub, start, c-class, b-class, good, featured) and "potential issues" (<code>draftquality</code>: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because <code>draftquality</code> needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's [[git:mediawiki/extensions/ORES/+/8bd39f26548d58fa8bf6765e1c23f5e3086f1cd4/extension.json#225|extension.json file]]. * {{ll|Extension:WikiLove|WikiLove}} - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily. === Enabling draft namespace === By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php <syntaxhighlight lang="php" copy> // These three settings are optional, and will enable the Articles-for-Creation mode. $wgPageTriageDraftNamespaceId = 118; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft'; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk'; </syntaxhighlight> When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed. By default pages edited in the draft namespace will be "unsubmitted". Articles in the draft namespace can be submitted for review by adding <nowiki>[[Category:Pending_AfC_submissions]]</nowiki> to the draft page. At which point they will show up under "awaiting review". Note the toolbar controlled by the configuration variable '''$wgPageTriageEnableCurationToolbar''' does not show up in the draft namespace. === Cron jobs === To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: <code>cron/updatePageTriageQueue.php</code> == Manual testing == === Special:NewPagesFeed -> Articles for Creation === * Enable draftspace by following the directions above in the section [[#Enabling draft namespace]]. * In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories: ** Unsubmitted: (no category) ** Awaiting review: Category:Pending AfC submissions ** Under review: Category:Pending AfC submissions being reviewed now ** Declined: Category:Declined AfC submissions Note: The Page Curation toolbar does not display for drafts. === ORES === Enwiki has the [[Extension:ORES|ORES extension]] installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure: * Clone Extension:ORES and add <code>wfLoadExtension( 'ORES' );</code> in <code>LocalSettings.php</code> * Add this to <code>LocalSettings.php</code> <syntaxhighlight lang="php" copy> $wgPageTriageEnableOresFilters = true; $wgOresWikiId = 'enwiki'; $wgOresModels = [ 'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ], 'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'sources' => [ 1 ] ] ]; </syntaxhighlight> * Run <code>php maintenance/run.php ./extensions/ORES/maintenance/BackfillPageTriageQueue.php</code> == Determining if a page is reviewed == === Status codes === There are status codes used to track whether a page is reviewed or not. These are the values given when you query <code>patrol_status</code>, <code>ptrp_reviewed</code>, and <code>ptrl_reviewed</code>: * Unreviewed ** 0 - unreviewed * Reviewed ** 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar) ** 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page) ** 3 - autopatrolled (someone with the <code>autopatrol</code> user right created the page, or moved the page from a non-tracked namespace to a tracked namespace) ** no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job) === Via the API === To check the review status of pages using an API query, you can use <code>api.php?action=query&prop=isreviewed</code>. Sample JavaScript code:<syntaxhighlight lang="js" copy> /** * @param {number} pageID The page ID number. A positive number with no commas. */ async isReviewed(pageID) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', pageids: pageID, } ); return response.query.pages[0].isreviewed; } /** * @param {string} title One title. Can include namespace. Example: User:Test */ async function isReviewed(title) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', titles: title, } ); return response.query.pages[0].isreviewed; } </syntaxhighlight> === Via SQL === To check the review status of pages using an SQL query, you need to query the <code>{{ll|Extension:PageTriage/pagetriage page table|pagetriage_page}}</code> table and the <code>ptrp_reviewed</code> field. Follow the directions in [[#Status codes]] to interpret the values of this field. <syntaxhighlight lang="sql" copy> /* By page_id */ SELECT ptrp_reviewed FROM pagetriage_page WHERE ptrp_page_id = 71318376 /* By page_title and page_namespace */ SELECT ptrp_reviewed FROM pagetriage_page JOIN page ON page_id = ptrp_page_id WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces AND page_namespace = 0 </syntaxhighlight> == SQL == === SQL tables === {| class="wikitable" |+ !Name !Prefix !Description !Old entry deletion strategy !Service classes (when refactoring, SQL queries should be moved to here) !Data classes |- |[[Extension:PageTriage/pagetriage page table|pagetriage_page]] |ptrp_ |The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query <code>ptrp_reviewed > 0</code> in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. |All articles deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. |QueueManager, QueueLookup |QueueRecord |- |[[Extension:PageTriage/pagetriage page tags table|pagetriage_page_tags]] |ptrpt_ |Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the <code>pagetriage_tags</code> table. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. |All article metadata deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status. | | |- |[[Extension:PageTriage/pagetriage tags table|pagetriage_tags]] |ptrt_ |A dictionary of page_tags, and their corresponding ID number. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. | | | |} === pagetriage_page_tags === <code>pagetriage_page_tags</code> data is updated by calling <code>ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata()</code>. This is called in the following hooks: * <code>onPageMoveComplete()</code> - runs when moving a page * <code>onLinksUpdateComplete()</code> - runs when saving an edit * <code>onMarkPatrolledComplete()</code> - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user. ==== List of tags ==== The <code>pagetriage_page_tags</code> are as follows: * Author information ** user_id ** user_name - there's a filter where you can type in their username ** user_editcount ** user_creation_date ** user_autoconfirmed ** user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with <code>MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()</code> ** user_bot ** user_block_status * Deletion tags - will display a black trash can icon if marked for deletion ** afd_status ** blp_prod_status ** csd_status ** prod_status * Special:NewPagesFeed red warning text ** category_count - No categories ** linkcount - Orphan ** reference - No citations ** recreated - Previously deleted ** user_block_status - Blocked * Page information ** page_len - size of article, in bytes ** rev_count - number of edits to the article ** snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article * afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined * copyvio - latest revision ID that has been tagged as a likely copyright violation, if any == PHP == <translate> === Extension configuration === <!--T:28--> </translate> <translate><!--T:25--> The extension is based on the 'patrol' right.</translate> <translate><!--T:26--> For more information about configuring patrolling, see <tvar name=patrolling>{{ll|Manual:Patrolling}}</tvar>.</translate> <translate> <!--T:29--> The following configuration variables can be set from your <tvar name=1>LocalSettings.php</tvar> file: </translate> {| class="wikitable" |+ ! <translate><!--T:90--> Variable</translate> ! <translate><!--T:91--> Default</translate> ! <translate><!--T:92--> Description</translate> |- | {{phpi|$wgPageTriageEnableCurationToolbar}} | {{phpi|true}} | <translate><!--T:30--> Set to false to disable the [[<tvar name="1">Special:MyLanguage/Page Curation#User Experience: Curation Toolbar</tvar>|curation toolbar]]</translate> |- | {{phpi|$wgPageTriageInfiniteScrolling}} | {{phpi|true}} | <translate><!--T:31--> Whether or not to use infinite scrolling in the new pages feed</translate> |- | {{phpi|$wgPageTriageMaxAge}} |90 | The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true). |- | {{phpi|$wgPageTriageNamespaces}} |NS_MAIN | The namespaces that PageTriage is active in. |- | {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} | {{phpi|false}} | <translate><!--T:32--> Set this to true if new, unreviewed articles should be set to noindex.</translate> <translate><!--T:33--> In other words, if they should not be indexed by search engines until they are reviewed.</translate> |} <translate> <!--T:34--> See <tvar name=1>[[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/extension.json#698|extension.json]]</tvar> for the full list of config variables. === API === <!--T:50--> <!--T:51--> PageTriage adds the following API endpoints which can be used: </translate> {| class="wikitable" |+ ! <translate><!--T:93--> API</translate> ! <translate><!--T:94--> Description</translate> ! <translate><!--T:95--> Type</translate> ! <translate><!--T:96--> Triggering action</translate> |- |pagetriageaction | <translate><!--T:75--> Mark a page as reviewed or unreviewed, and logs the action in <tvar name=1>Special:Log</tvar>.</translate> |Write | * Using the Page Curation toolbar to mark a page as reviewed * Using the Page Curation toolbar to mark a page as unreviewed |- |pagetriagelist | <translate><!--T:74--> Retrieves the list of pages in the queue, and each page's metadata, including their reviewed status.</translate> To retrieve one page, you must provide the <code>page_id</code>. To provide multiple pages, you must select one of <code>showreviewed</code>/<code>showunreviewed</code>, and one of <code>showredirs</code>/<code>showdeleted</code>/<code>showothers</code>, or no pages will be returned. |Read | * Loading the Page Curation toolbar (automatically loaded if you have the <code>patrol</code> userright and view a page that is unpatrolled or recently patrolled) * Viewing Special:NewPagesFeed (provides the list of articles) |- |pagetriagestats | <translate><!--T:52--> Retrieves stats about the number of pages in the queue for use in the header of Special:NewPagesFeed.</translate> |Read | * Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer) |- |pagetriagetagcopyvio |Mark an article as a potential copyright violation, and logs the action in Special:Log. |Write | * Marking as a copyright violation by a bot with the <code>copyviobot</code> userright |- |pagetriagetagging | <translate><!--T:76--> Add clean-up tags or deletion templates to a page, and logs the action in <tvar name=1>Special:Log</tvar>.</translate> |Write | * Using the Page Curation toolbar to place a maintenance tag on an article * Using the Page Curation toolbar to place a deletion tag on an article |} === Special:Log === The following logs are created by the extension: {| class="wikitable" |+ !Special:Log !<code>log_type</code> !<code>log_action</code> !Description !Notes |- |Page curation log |pagetriage-curation |delete, enqueue, reviewed, tag, unreviewed |Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed | |- |Potential copyright violation log |pagetriage-copyvio |insert |Allows a bot to log potential copyright violations |Doesn't display unless you set {{phpi|$wgPageTriageEnableCopyvio}} to true |} <translate> === Entry points === <!--T:85--> <!--T:86--> The extension's features can be triggered by various actions: </translate> {| class="wikitable" |+ !Entry point type !File location !Notes |- |5 APIs |includes/Api/* | |- |1 special page |includes/SpecialNewPagesFeed.php | |- |20 hooks | * includes/Hooks.php * includes/HookHandlers/UndeleteHookHandler.php * includes/HookHandlers/Schema.php | |- |1 cron job |cron/updatePageTriageQueue.php |runs every 48 hours |- |7 maintenance scripts |maintenance/* |need to be run manually |} Here is a list of some actions and the corresponding entry points they trigger: {| class="wikitable" |+ !Action !Entry points used |- |View Main page | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() |- |Save an edit to the Main page | * Hooks.php -> onRevisionFromEditComplete() * Hooks.php -> onPageSaveComplete() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onLinksUpdateComplete() |- |Type in search box, triggering search suggestions | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onApiMain__moduleManager() |- |View Special:NewPagesFeed | * Hooks.php -> onBeforeCreateEchoEvent() * SpecialNewPagesFeed * ApiPageTriageStats * ApiPageTriageList |- |View an unreviewed article while logged in and having the <code>patrol</code> permission. | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onResourceLoaderGetConfigVars() * Hooks.php -> onDefinedTags() * Hooks.php -> onApiMain__moduleManager() * ApiPageTriageList (by <code>page_id</code>) |} ==== Hooks ==== {| class="wikitable" |+ !File !Group !Hook !Actions it performs |- | rowspan="18" |Hooks.php |Move page |[[Manual:Hooks/PageMoveComplete|onPageMoveComplete]] |Changes patrolled status, updates cache, updates metadata in <code>pagetriage_page_tags</code> table. |- | rowspan="3" |Edit page |[[Manual:Hooks/RevisionFromEditComplete|onRevisionFromEditComplete]] |Handles marking '''redirects that flip to articles''' as unreviewed. [[Deferred updates|DeferredUpdate]]. |- |[[Manual:Hooks/PageSaveComplete|onPageSaveComplete]] |Add '''new articles''' to the New Pages Feed and <code>pagetriage_page</code> table. |- |[[Manual:Hooks/LinksUpdateComplete|onLinksUpdateComplete]] |[[Deferred updates|DeferredUpdate]] of metadata / <code>pagetriage_page_tags</code> table. |- |Every page load |[[Manual:Hooks/ArticleViewFooter|onArticleViewFooter]] | * Turn on '''noindex''' for new, unreviewed articles. * Determine whether to load a '''link for autopatrolled users to unpatrol''' their article * Displays the '''Page Curation toolbar''' on recently created pages. * Create '''"Add to New Pages Feed" toolbox link''' for old articles. |- |[[Help:Patrolled edits]] |[[Manual:Hooks/MarkPatrolledComplete|onMarkPatrolledComplete]] |Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage. |- | rowspan="2" |Blocking and unblocking |[[Manual:Hooks/BlockIpComplete|onBlockIpComplete]] | rowspan="2" |Update article metadata / <code>pagetriage_page_tags</code> when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users. |- |[[Manual:Hooks/UnblockUserComplete|onUnblockUserComplete]] |- | |[[Manual:Hooks/ResourceLoaderGetConfigVars|onResourceLoaderGetConfigVars]] |Adjusts some config vars related to draft namespace ID. |- | rowspan="3" |[[Extension:Echo]] |[[Manual:Hooks/BeforeCreateEchoEvent|onBeforeCreateEchoEvent]] | rowspan="3" |Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed. |- |[[Manual:Hooks/EchoGetDefaultNotifiedUsers|onEchoGetDefaultNotifiedUsers]] |- |[[Manual:Hooks/LocalUserCreated|onLocalUserCreated]] |- |[[Extension:ORES]] |[[Manual:Hooks/ORESCheckModels|onORESCheckModels]] |Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio. |- | rowspan="3" |[[Help:Tags]] |[[Manual:Hooks/ListDefinedTags|onListDefinedTags]] | rowspan="3" |Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage". |- |[[Manual:Hooks/ChangeTagsAllowedAdd|onChangeTagsAllowedAdd]] |- |[[Manual:Hooks/ChangeTagsListActive|onChangeTagsListActive]] |- |API |[[Manual:Hooks/ApiMain::moduleManager|onApiMain__moduleManager]] |Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings. |- | rowspan="2" |Delete or undelete page |[[Manual:Hooks/PageDeleteComplete|onPageDeleteComplete]] |If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache. |- |HookHandlers/ UndeleteHookHandler.php |[[Manual:Hooks/ArticleUndelete|onArticleUndelete]] |If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed. |- |HookHandlers/ Schema.php |SQL |[[Manual:Hooks/LoadExtensionSchemaUpdates|onLoadExtensionSchemaUpdates]] | * The code that installs PageTriage's 4 SQL tables when you run <code>php maintenance/run.php update</code>. * Will also alter schemas from previous versions to match the latest schema. * This is also where all the '''pagetriage_tags''' are hard-coded. |} ==== Cron jobs and maintenance scripts ==== {| class="wikitable" |+ !File !What it does !Why run it? When is it useful? ![[phab:T341431|Safe to delete maintenance script?]] |- |cron/updatePageTriageQueue.php |Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". |Keeps the SQL tables from getting too big. | |- |maintenance/cleanupPageTriage.php |Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. |Fix a bug? [[phab:T321982|T321982]] | |- |maintenance/cleanupPageTriageLog.php |Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log |One time conversion of old log entries to modern format? Logs are now always written in the new format. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/6d9105c020c62d648a4ef6be957297bbc8a6d7d2]. |Probably |- |maintenance/cleanupPageTriagePageTags.php |Remove page from <code>pagetriage_page_tags</code> if they are not in <code>pagetriage_page</code> |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/00a752368e00e0d8b29a4908bfc3bab3096268dd]. |Probably |- |maintenance/DeleteAfcStates.php |Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ab2d8d4a2f9d0f4ff981afaee35a85f33edb5e99]. [[phab:T203184#4592953|T203184#4592953]]. |Probably |- |maintenance/FixNominatedForDeletion.php |Set <code>pagetriage_page.ptrp_deleted</code> if the page is has any <code>pagetriage_page_tags</code> related to deletion (e.g. prod_status, blp_prod_status, etc.) |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ff0c433226300aeba692089b5389435d47feef1e]. [[phab:T202582|T202582]]. |Probably |- |maintenance/populateDraftQueue.php |Add missing Draft namespace pages to the AfC triage queue. |Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/59e1fedffcdafc46722d7231011aee194db9ee08]. | |- |maintenance/updateUserMetadata.php |Former cron job. Update expired user metadata in the <code>pagetriage_page_tags</code> table |[https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/92a675a5f1f2e07cee532ec90fc57eee7f2cd49b]. [[phab:T341432|T341432]]. | |} === NOINDEX === NOINDEX refers to the HTML code <code>&lt;meta name="robots" content="noindex"></code>, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode <code><nowiki>__NOINDEX__</nowiki></code>. When {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in <code>includes/Hooks.php</code>, in the <code>onArticleViewFooter()</code> method. ==== First check ==== * First check: Noindex the page if ALL of the following are true: ** {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is turned on ** Page age is less than {{phpi|$wgPageTriageMaxAge}} (set to 90 days on enwiki) ** Page is in <code>pagetriage_page</code> table<ref>Checked by <code>isPageUnreviewed()</code></ref> ** Page is marked as unpatrolled (ptrp_status = 0) ==== Second check ==== * Second check: If the wikitext has the <code><nowiki>__NOINDEX__</nowiki></code> magic word, noindex the page if ALL of the following are true: ** Page age is less than {{phpi|$wgPageTriageMaxNoIndexAge}} (set to 90 days on enwiki) ** If {{phpi|$wgPageTriageMaxNoIndexAge}} is not null, page is in <code>pagetriage_page</code> table<ref>Checked by <code>isNewEnoughToNoIndex()</code>, if it doesn't exit early due to <code>$wgPageTriageMaxNoIndexAge</code> being <code>null</code>.</ref> The main use case for the <nowiki>__NOINDEX__</nowiki> magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See [https://en.wikipedia.org/w/index.php?search=NOINDEX&title=Special:Search&profile=advanced&fulltext=1&ns10=1 this search]. ==== Is the page in the <code>pagetriage_page</code> table? ==== In regards to the requirement "Page is in <code>pagetriage_page</code> table", there are several ways a for a page to get into this table: * Not been deleted by a PageTriage cron job ** One cron job deletes redirects older than {{phpi|$wgPageTriageRedirectAutoreviewAge}} days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them. ** Another cron job deletes reviewed pages after 30 days of being reviewed * In a namespace that PageTriage is configured to patrol * Isn't an article that is so old it predates the installation of PageTriage == JavaScript == === Directory structure === * /modules/ ** ext.pageTriage.article - related to marking an article as reviewed ** ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar ** ext.pageTriage.init - creates a mw.pageTriage object ** ext.pageTriage.newPagesFeed - Special:NewPagesFeed ** ext.pageTriage.sidebarLink - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates ** ext.pageTriage.toolbar - Page Curation toolbar <!--** ext.pageTriage.toolbar - Page Curation toolbar (Vue version)--> ** ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code ** ext.pageTriage.util - Backbone.js models (article, revision, stats) ** external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore <translate> === Toolbar === <!--T:78--> </translate> The toolbar has three states: <code>maximized</code>, <code>minimized</code>, and <code>hidden</code>. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu. === External libraries === * front end ** old (moving away from) *** [[w:Backbone.js|Backbone.js]] *** [[w:jQuery|jQuery]] *** jQuery Badge *** jQuery Waypoints *** [[w:jQuery UI|jQuery UI]] *** [[w:Mustache (template system)|Mustache (template system)]] *** [[OOUI]] - used in modules/ext.PageTriage.enqueue ([https://codesearch.wmcloud.org/deployed/?q=oojs&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FPageTriage codesearch]) *** [[w:Underscore.js|Underscore.js]] ** new (moving towards) *** Codex *** [[w:Moment.js|Moment.js]] *** Vue Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, [[phab:T208256|we are interested in replacing these front end libraries]], to make the extension easier to maintain. <translate> === Client-side hooks === <!--T:54--> </translate> ==== mw.hook ==== * <code>ext.pageTriage.toolbar.ready</code> ==== mw.pageTriage.actionQueue ==== <translate><!--T:55--> PageTriage provides a specialised action queue system to allow other scripts and gadgets to integrate with it.</translate> <translate><!--T:87--> This is similar to <tvar name=1><code>mw.hook</code></tvar> except that it uses promises.</translate> <translate><!--T:88--> This is done using the <tvar name=1><code>mw.pageTriage.actionQueue</code></tvar> module.</translate> <translate><!--T:89--> See the comments in the {{<tvar name=1>tmpl|0={{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=$1}}</tvar>|source code}} for documentation on how the system works.</translate> {{tmpl|0=<translate><!--T:97--> It is [<tvar name=url>$1</tvar> not currently used by any scripts or gadgets on enwiki], but it is used internally by PageTriage.</translate> |1=https://en.wikipedia.org/w/index.php?search=%22actionQueue%22&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1&ns2300=1&ns2301=1&ns2302=1&ns2303=1 }} <translate><!--T:60--> The actionQueue module is available after the mw.hook <code>ext.pageTriage.toolbar.ready</code> fires.</translate> <translate><!--T:56--> PageTriage will give the action queue handler an Object with the following data, in addition to other data as noted below:</translate> * <code>pageid</code> — <translate><!--T:61--> ID of the page being reviewed.</translate> * <code>title</code> — <translate><!--T:62--> Title of the page, including namespace.</translate> * <code>reviewer</code> — <translate><!--T:63--> Username of who is using PageTriage.</translate> * <code>creator</code> — <translate><!--T:64--> Username of the creator of the page.</translate> * <code>reviewed</code> — <translate><!--T:65--> Whether or not the page is currently or will be marked as reviewed.</translate> <translate> ===== Available actions ===== <!--T:59--> </translate> * <code>delete</code> — <translate><!--T:66--> Fired when the reviewer tags a page for deletion. The data given to the handler also includes:</translate> ** <code>tags</code> — <translate><!--T:67--> An object of all the templates added to the page. The keys are the template title, and the values are an object of metadata, including things like the speedy deletion code.</translate> * <code>mark</code> — <translate><!--T:68--> Fired when the review status of a page is changed. Also includes:</translate> ** <code>note</code> — <translate><!--T:69--> The personal message the reviewer added for the creator of the page. This may be blank.</translate> * <code>tags</code> — <translate><!--T:70--> Fired when maintenance tags are added to the page. Also includes:</translate> ** <code>tags</code> — <translate><!--T:71--> An array of the titles of all templates that were added to the page.</translate> ** <code>note</code> — <translate><!--T:72--> The personal message the reviewer added for the creator of the page. This may be blank.</translate> <translate> ===== Example ===== <!--T:58--> <!--T:73--> To use the action queue, register a function to be ran when an aforementioned action is fired. PageTriage will wait for any asynchronous code to complete before doing anything else, such as refreshing the page. For example, to edit [[Sandbox]] after a page has been marked as reviewed, you could use: </translate> <syntaxhighlight lang="javascript"> $( function () { // You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time. mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) { // Listen for the 'mark' action. queue.add( 'mark', function ( data ) { return new mw.Api().edit( 'Sandbox', function ( revision ) { // Replace 'foo' with the note the reviewer left. return revision.content.replace( 'foo', data.note ); } ); } ); } ); } ); </syntaxhighlight> === Where are preferences stored? === Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is <code>userjs-NewPagesFeedFilterOptions</code>. It is set using <code>mw.Api().saveOption()</code> and read using <code>mw.user.options.get()</code>. This data ends up in the SQL <code>user_properties</code> table. Temporary accounts (IP masking) will not be able to store their preferences. == Installation on WMF wikis == This extension was designed for English Wikipedia. There is interest in changing its code and making it more useful to other wikis ([[phab:T50552]]), however this is challenging from a technical perspective and progress is slow. For now, the following are true: * PageTriage is allowed to be installed on other wikis<ref>https://meta.wikimedia.org/w/index.php?title=Limits_to_configuration_changes&diff=prev&oldid=26121135</ref> (although as of 2024 this hasn't happened yet). * The setting <code>$wgPageTriageEnableExtendedFeatures</code> can be set to <code>false</code> to turn off English Wikipedia-specific features such as maintenance tags and deletion tags in the Page Curation toolbar. * There are concerns that the noindex features (controlled by <code>$wgPageTriageNoIndexUnreviewedNewArticles</code> and <code>$wgPageTriageMaxNoIndexAge</code>) create search engine optimization problems, and these noindex features should not be enabled on new wikis without first discussing it with product manager [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]. * Like most other WMF-deployed extensions, PageTriage supports internationalization, and has its interface [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/i18n/|translated into many other languages]]. <translate> == See also == <!--T:11--> </translate> * [[commons:Category:PageTriage extension]] * [[Help:New pages feed]] * [[w:Wikipedia:Page Curation/Help]] == Notes == <references /> {{OnWikimedia}} {{Used by}} [[Category:API extensions{{#translation:}}]] 7l7wweb2y79vfp8ou16bnh6g0afnb5h Extension:NoTOC/pl 102 75947 8365104 5910913 2026-05-04T10:21:20Z FuzzyBot 451990 Updating to match new version of source page 8365104 wikitext text/x-wiki <languages /> {{Unmaintained extension|alternative={{ll|Extension:NoTOCModern}}}} {{Extension code in wiki}} {{Extension |status = unmaintained |type1 = parser |type2 = |hook1 = ParserClearState |hook2 = |username = Frantik |author = Andrew Fitzgerald |description = To rozszerzenie wyłącza domyślnie spis treści na wszystkich stronach. |image = |imagesize = |version = 0.1.1 |update = 2013-12-11 |mediawiki = |php = |license = GPL-2.0-or-later |download = Zobacz w sekcji [[#Code|kod]] |needs-updatephp = No |readme = |changelog = |parameters = |tags = |rights = |example = |compatibility = }} Rozszerzenie '''NoTOC''' służy do domyślnego ukrywania spisu treści. Funkcja <nowiki>__TOC__</nowiki> może być nadal używana w celu wymuszenia pokazania spisu treści mimo ogólnego wyłączenia. <span id="Installation"></span> ==Instalacja== {{ExtensionInstall |download-link=[[#Code|dodaj poniższy kod do pliku]] }} <span id="Code"></span> ==Kod== ;NoTOC.php <syntaxhighlight lang="php"> <?php /** * NoTOC extension - Turns off the Table of Contents (TOC) by default on all pages * @version 0.1.1 - 2013/12/11 * * @link https://www.mediawiki.org/wiki/Extension:NoTOC Documentation * @link https://www.mediawiki.org/wiki/Extension_talk:NoTOC Support * * @ingroup Extensions * @package MediaWiki * @author Andrew Fitzgerald (Frantik) * @author Karsten Hoffmeyer (Kghbln) * @copyright (C) 2010 Andrew Fitzgerald * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ // check the call if ( !defined( 'MEDIAWIKI' ) ) { die( 'This file is a MediaWiki extension and thus not a valid entry point.' ); } // provide information $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'NoTOC', 'author' => array( 'Andrew Fitzgerald', '...' ), 'url' => 'https://www.mediawiki.org/wiki/Extension:NoTOC', 'descriptionmsg' => 'notoc-desc', 'version' => '0.1.1' ); // show way to files $wgExtensionMessagesFiles['NoTOC'] = dirname( __FILE__ ) . '/NoTOC.i18n.php'; // register hooks $wgHooks['ParserClearState'][] = 'efMWNoTOC'; // perform purpose function efMWNoTOC($parser) { $parser->mShowToc = false; return true; } </syntaxhighlight> ;NoTOC.i18n.php <syntaxhighlight lang="php"> <?php /** * Internationalization file for the NoTOC extension. * * @licence GNU GPL v2+ * @author Karsten Hoffmeyer (Kghbln) */ $messages = array(); /** English * @author Frantik * @author Kghbln */ $messages['en'] = array( 'notoc-desc' => 'Turns off the Table of Contents (TOC) by default on all pages', ); /** Message documentation (Message documentation) * @author Kghbln */ $messages['qqq'] = array( 'notoc-desc' => '{{desc|name=NoTOC|url=https://www.mediawiki.org/wiki/Extension:NoTOC}}', ); /** German (Deutsch) * @author Kghbln */ $messages['de'] = array( 'notoc-desc' => 'Unterdrückt die automatische Generierung des Inhaltsverzeichnisses', ); </syntaxhighlight> <span id="See_also"></span> == Zobacz też == * {{ll|Extension:ForceTocOnEveryPage}} * {{ll|Extension:DeToc}} - <span lang="en" dir="ltr" class="mw-content-ltr">This can be used to extract TOC HTML and to remove it or put it in some other section of the page.</span> [[Category:TOC extensions{{#translation:}}]] 5yg9bb44jy8nlor2n2dt58l2ceva3zl Help:Extension:ParserFunctions/pt-br 12 75986 8365029 8353945 2026-05-04T06:21:15Z FuzzyBot 451990 Updating to match new version of source page 8365029 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A extensão {{ll|Extension:ParserFunctions|nsp=0}} fornece [[Special:MyLanguage/Parser functions|funções de análise]] adicionais para complementar as quais já integram o MediaWiki. (Veja {{ll|Help:Magic words#Parser functions}}.) (Ele ''pode'' ser configurado para fornecer funções adicionais de analisador para manipulação de strings; elas estão disponíveis apenas para wikis que não sejam da Wikimedia Foundation, portanto, essas funções de strings estão documentadas {{ll|Extension:ParserFunctions/String functions|em outro lugar}}) Todas as funções fornecidas pela extensão têm a forma: :<code><nowiki>{{</nowiki>'''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' … <nowiki>}}</nowiki></code> == #expr == {{for|1=um manual dedicado a esclarecer pontos mais delicados sobre como o analisador de expressões funciona, incluindo operadores extras|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupamento (uso de parênteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binário <code>'''e'''</code> &nbsp; unário <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unário | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binário | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lógicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta função calcula uma expressão matemática e retorna o resultado. Essa função também está disponível no {{ll|Extension:Scribunto|nsp=0}} através da função <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressão'' <nowiki>}}</nowiki></code> Exemplo básico :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Os operadores disponíveis estão listados na tabela da direita, por ordem de precedência. Para mais detalhes sobre a função de cada operador, consulte {{ll|Manual:Expr parser function syntax}}. A exatidão e o formato do resultado retornado dependem do sistema operacional do servidor executor da wiki e do formato numérico do idioma do website. No cálculo de [[w:pt:Álgebra booleana|álgebra booleana]], o número zero assume o valor {{phpi|false}}, e qualquer valor diferente de zero, positivo ou negativo, assume o valor {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Um parâmetro de entrada vazio retorna um texto vazio. Expressões inválidas retornam uma das várias mensagens de erro, as quais podem ser obtidas com a função <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A ordem dos operandos de adição e subtração, antes ou depois de um número, é significativa, e pode ser tratada como um valor positivo ou negativo, ao invés de ser tratado como um operando com uma entrada errada: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Observe que, se estiver usando a saída de palavras mágicas, você deverá formatá-las para remover vírgulas e traduzir os numerais. Por exemplo, <nowiki>{{NUMBEROFUSERS}}</nowiki> resulta em {{NUMBEROFUSERS}}, onde queremos {{formatnum:{{NUMBEROFUSERS}}|R}}, que pode ser obtido usando <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Isto é especialmente importante em alguns idiomas, onde os numerais são traduzidos. Por exemplo, em bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produz ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> retorna resultados errados para alguns valores do segundo argumento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produz uma cadeia de caracteres vazia; deveria ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se você quiser fazer cálculos com base em datas (por exemplo, testar se a data e hora atuais são posteriores a alguma outra data e hora), primeiro converta o tempo em número de segundos após 1º de janeiro de 1970 (UTC) usando <nowiki>{{#time: xNU }}</nowiki>, e então poderá simplesmente adicionar e subtrair datas como números.}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Arredonda] o número do lado esquerdo a um múltiplo de 1/10 elevado a uma potência, com o expoente igual ao valor truncado do número do lado direito. Para arredondar para cima ou para baixo, use os operadores unários <code>ceil</code> ou <code>floor</code> respectivamente. {| class="wikitable" ! {{hl1}} | Caso de teste ! {{hl1}} | Resultado ! {{hl1}} | Método de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || Com o dígito final menor que 5, o arredondamento aparente não é realizado (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || Com o dígito final maior ou igual a 5, ocorre o arredondamento para cima (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Mais uma vez, o resultado é arredondado para cima no último dígito, o que resulta no arredondamento adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arredondado para a centena mais próxima por causa dos valores negativos, pois os negativos são arredondados para a esquerda do ponto decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arredondado para o centésimo mais próximo, pois os valores positivos são arredondados para a direita do ponto decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimais no índice de arredondamento não fazem diferença no resultado arredondado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Arredondamento para o inteiro mais próximo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Para baixo no inteiro ''mais próximo'', que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Para cima no inteiro mais próximo, que é 1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Para cima no inteiro mais próximo, que é 1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Para cima no inteiro mais próximo, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Para baixo no inteiro mais próximo, que é 1 negativo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Para baixo no inteiro mais próximo, que é 1 negativo |- ! colspan=3 {{hl2}} | Arredondamento para cima ou para baixo com ''ceil'' (teto) e ''floor'' (piso) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Para cima no próximo inteiro, que é 1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Para baixo no inteiro anterior, que é zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Para cima no próximo inteiro, que é 0 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Para baixo no inteiro anterior, que é 1 negativo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Não arredondado, uma vez que 1 já é um inteiro<br />{{Warning|1=Interpretado como '''(ceil''' 1''')'''/3, e não '''ceil('''1/3''')''', como se poderia esperar}} |- ! colspan=3 {{hl2}} | Arredondar números grandes |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arredondar um número muito alto leva ao infinito. Por conta disso, o valor original é retornado, sem o infinito. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Idem acima. |} <span id="Strings"></span> === Cadeias de caracteres === Expressões somente funcionam com valores numéricos; não fazem comparação entre textos ou caracteres. Nesse caso, a [[#ifeq]] pode ser usada. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta função avalia uma cadeia de caracteres e determina se é ou não é vazia. Uma cadeia de caracteres que contenha apenas espaços em branco é considerada vazia. :<syntaxhighlight lang="wikitext" inline>{{#if: cadeia de caracteres de teste | valor se a cadeia de caracteres não estiver vazia | valor se a cadeia de caracteres estiver vazia (ou repleta de espaços em branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parâmetro | segundo parâmetro | terceiro parâmetro }}</syntaxhighlight> Esta função primeiramente testa se o primeiro parâmetro não está vazio. Se o primeiro parâmetro não estiver vazio, a função exibe o segundo argumento. Se o primeiro parâmetro estiver vazio ou contiver apenas espaços em branco (espaços, quebras de linha, etc.), é exibido o terceiro argumento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' A cadeia de caracteres fornecida é sempre interpretada como texto puro, então expressões matemáticas não serão avaliadas (consulte [[##ifexpr|#ifexpr]] para esse fim): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parâmetro (<code>false</code>) pode ser omitido: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A função pode ser encaixada dentro de outras funções. Para isso, coloque a função <code>#if</code> (filha) em sua forma integral no lugar de um parâmetro da função <code>#if</code> (mãe). A profundidade de até sete níveis de encaixe (''nesting'') é possível, apesar de que pode depender da wiki ou de um limite de memória. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:cadeia de caracteres de teste | valor se a cadeia de caracteres não estiver vazia |{{#if:cadeia de caracteres de teste |valor se a cadeia de caracteres não estiver vazia |valor se a cadeia de caracteres estiver vazia (ou repleta de espaços em branco) }} }} </syntaxhighlight> <span class="mw-translate-fuzzy">Também é possível passar um parâmetro no lugar da cadeia de caracteres em sua declaração <code>#if</code>. Certifique-se de que o $1 (símbolo de ''pipe'') foi adicionado após o nome da variável.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> (Assim, se o parâmetro não tiver um valor, ele será avaliado como uma cadeia de caracteres vazia em vez de “<code><nowiki>{{{1}}}</nowiki></code>”.) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Você digitou texto na variável 1 |2=Não há texto na variável 1 }} Para mais exemplos dessa função analisadora, consulte {{ll|Help:Parser functions in templates}}. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Essa função do analisador compara duas strings, determina se são idênticas e retorna uma das duas strings com base no resultado. Se forem necessárias mais comparações e strings de saída, considere usar <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambas as strings são valores numéricos válidos, as strings são comparadas numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Caso contrário, a comparação é feita como texto; esta comparação é case sensitive: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(comparar a exemplo semelhante anteriormente, sem as aspas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(compara com o exemplo acima, com <code>[[##expr|#expr]]</code> retorna o primeiro número válido)'' Como exemplo prático, considere uma {{ll|Help:Templates|predefinição}} <code>Template:Timer</code> existente usando o analisador para escolher entre dois tempos padrão, curto e longo. Este utiliza o parâmetro como a primeira entrada para comparar com o texto "curto", não há convenção para a ordem, mas é mais simples ler se o parâmetro for o primeiro. O código do modelo é definido como: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> acontecerá o seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quando usado dentro de uma função de analisador, quaisquer tags de analisador e outras funções de analisador devem ser temporariamente substituídas por {{ll|Strip marker|um código único}}. Isso afeta as comparações: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se os textos comparados (tipo strings) forem chamadas para a mesma {{ll|Help:Templates|predefinição}} que contenha essas etiquetas/tags, então o resultado é verdadeira, mas, se forem chamadas para predefinições diferentes com conteúdo idêntico, o resultado é falso. }} {{Warning|1=As comparações literais com "{{ll|Help:Magic words#Page names|palavras mágicas sobre nomes de páginas}}" podem falhar dependendo da configuração da página/site. Por exemplo: dependendo do wiki, o <nowiki>{{FULLPAGENAME}}</nowiki> pode capitalizar a primeira letra e substituir todos os sublinhados por espaços. Para contornar isso, aplique a palavra mágica a ambos os parâmetros: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta função recebe uma string de entrada e retorna um de dois resultados; a função avalia a <code>true</code> se a string de entrada contém um objeto HTML com <code>class="error"</code>, como gerada por outras funções do analisador, tais como <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros de [[Special:MyLanguage/Help:Templates|predefinições]], tais como loops e recursões, e outros erros do analisador do tipo [[w:failsoft|failsoft]]. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">Uma ou ambas as sequências de retorno podem ser omitidas. Se a sequência $1 for omitida, $2 será retornada se não estiver errada. Se a sequência $3 também for omitida, uma sequência vazia será retornada em caso de erro:</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns erros podem fazer com que uma categoria de rastreamento/manutenção seja adicionada. Usar <code><nowiki>{{#iferror:}}</nowiki></code> não suprimirá a adição da categoria. == #ifexpr == Esta função avalia uma expressão matemática e retorna uma de duas strings, dependendo do valor booleano do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> A entrada <code>expression</code> é avaliada exatamente como <code>[[##expr|#expr]]</code> acima, com os mesmos operadores disponíveis. A saída é então avaliada como uma expressão booleana. Uma expressão de entrada vazia é avaliada como {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado acima, zero é avaliado como {{phpi|false}} e qualquer valor diferente de zero é avaliado como {{phpi|true}}, então esta função é equivalente a uma utilização de <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code> apenas: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> exceto por uma expressão de entrada vazia ou errada (uma mensagem de erro é tratada como uma sequência vazia; não é igual a zero, então obtemos <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparação :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Um ou outro ou ambos os valores de retorno podem ser omitidos; nenhuma saída é dada quando o pacote apropriado é deixado vazio: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' Operadores booleanos de igualdade ou desigualdade são suportados. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Os resultados das comparações numéricas feitas com <code>[[##ifexpr|#ifexpr]]</code> nem sempre equivalem àqueles feitos por <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>. Estes dois últimos são mais precisos que <code>[[##ifexpr|#ifexpr]]</code> e, portanto, podem não retornar resultados equivalentes. Considere estas comparações com o dígito final alterado: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Como o PHP usado em <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dois números do tipo inteiro, ele retorna o resultado esperado corretamente. Considerando que com <code>[[##ifexpr|#ifexpr]]</code> e os mesmos números: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Com o dígito diferente, o resultado igual é, na verdade, incorreto. Com o dígito diferente na <code>[[##ifexpr|#ifexpr]]</code> o resultado será incorreto. Pois o MediaWiki converte números das expressões literais em real (tipo float), que para grandes números inteiros é necessário arredondamento.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=Consulte [[Manual:Checking for page existence|Manual:Checking for page existence]] para conhecer outros métodos de verificação da existência de uma página com diferentes limitações}} Esta função recebe uma string de entrada, interpreta-a como um título da página, e retorna um dos dois valores, dependendo ou não se a página existe no wiki local. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">A função avalia como {{phpi|true}} se a página existe, se contém conteúdo, está visivelmente em branco (contém metadados como links de categorias ou {{ll|Help:Magic words|palavras mágicas}}, mas nenhum conteúdo visível), está em branco, ou é um {{ll|Help:Redirects|redirecionamento}}. Somente páginas com ligações vermelhas são avaliadas como $2, inclusive se a página já existia, mas foi excluída.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' A função é avaliada como {{phpi|true}} para {{ll|Help:System message|mensagens do sistema}} que foram customizadas e para {{ll|Help:Special pages|páginas especiais}} que são definidas pelo ''software''. :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (pois a extensão {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (pois a extensão {{ll|Extension:Checkuser|nsp=0}} não está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (pois [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (pois [[{{ns:8}}:Copyright]] não foi personalizado) }} Antes do MediaWiki 1.45, se uma página verificar um destino usando <code>#ifexist:</code>, essa página aparecerá na lista [[{{#special:WhatLinksHere}}]] da página de destino. Portanto, se o código <code><nowiki>{{#ifexist:Foo }}</nowiki></code> for incluído ao vivo nesta página ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] listará {{FULLPAGENAME}}. Nas wikis que usam um repositório de mídia compartilhada, <code>#ifexist:</code> pode ser usado para verificar se um arquivo foi enviado para o repositório, mas não para a própria wiki: :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' Se uma página de descrição do local, foi criado para o arquivo, o resultado é '''existe''' para todos os itens acima. <code>#ifexist:</code> não funciona com links interwiki. <span id="ifexist_limits"></span> === limites de ifexist === <code>#ifexist:</code> é considerada uma "função dispendiosa"; assim, apenas um número limitado pode ser usado em uma página (incluindo funções em predefinições [[transcluída]]s). Quando esse limite é excedido, quaisquer outras funções <code>#ifexist:</code> retornam automaticamente falso, independentemente de a página de destino existir ou não, e a página é categorizada em [[:Category:{{MediaWiki:expensive-parserfunction-category}}]]. O nome da {{ll|Help:Tracking categories|tracking}} pode variar dependendo do idioma da wiki. Para alguns casos de uso é possível emular o efeito de ''ifexist'' com ''css'', usando os seletores <code>a.new</code> (para selecionar ''links'' para páginas inexistentes) ou <code>a:not(.new)</code> (para selecionar ''links'' para páginas existentes). Além disso, como o número de funções caras do analisador que podem ser usadas em uma única página é controlado por <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, também é possível aumentar o limite em LocalSettings.php, se necessário. <span id="ifexist_and_wanted_pages"></span> === ifexist e páginas procuradas === Antes do MediaWiki 1.45, uma página que não existia e que foi testada usando #ifexist acabará na seção [[Special:MyLanguage/Manual:WantedPages|Páginas pedidas]]. Consulte {{phab|T14019}} para saber o motivo e [[w:Template:Linkless exists]] para obter uma solução alternativa. == #rel2abs == Essa função converte um caminho de arquivo relativo em um caminho absoluto. :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> Na entrada <code>path</code>, a seguinte sintaxe é válida: *<code>.</code> → o nível atual *<code>..</code> → suba um nível *<code>/foo</code> → desça um nível na subdiretoria /foo Se o <code>base path</code> não for especificado, o nome completo da página será usado em vez disso: :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' Sintaxe inválida, como <code>/.</code> ou <code>/./</code>, é ignorada. Desde são permitidos no máximo dois pontos finais consecutivos, sequências como essas podem ser usadas para separar as declarações sucessivas: :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' Para um grupo semelhante de funções, veja também [[Special:MyLanguage/Help:Magic words#URL data|Ajuda:Palavras mágicas#Dados do ''U.R.L.'']]. As funções integradas do analisador incluem: 'localurl:', 'fullurl:', 'anchorencode:' etc. == #switch == ''Ver também: [[w:Help:Switch parser function]]'' Essa função compara um valor de entrada contra vários casos de teste, retornando uma string associada, se for encontrada uma correspondência. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <nowiki>#</nowiki>switch com marcações de transclusão parcial pode afetar um arquivo de configuração que permite que um editor que não é familiarizado com a codificação de predefinições visualize e edite elementos configuráveis. <span id="Default"></span> === Padrão === O <code>''resultado padrão''</code> é retornado se nenhuma string <code>''case''</code> corresponder à <code>''string de comparação''</code>: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' Nesta sintaxe, o resultado padrão deve ser o último parâmetro e não deve conter um sinal de igual bruto (um sinal de igual sem <code><nowiki>{{}}</nowiki></code>). Se isso acontecer, será tratado como uma comparação de casos e nenhum texto será mostrado se nenhum caso corresponder. Isso ocorre porque o valor padrão não foi definido (está vazio). Entretanto, se um caso corresponder, sua sequência (''string'') associada será retornada. :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> Alternativamente, o resultado padrão pode ser declarado explicitamente com uma string <code>''case''</code> de "<code>#default</code>". {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Resultados padrão declarados desta forma podem ser colocados em qualquer lugar dentro da função: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' Se o parâmetro "padrão" for omitido e nenhuma correspondência for feita, nenhum ''resultado'' é retornado: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupamento de resultados === É possível ter queda por meio de valores, onde vários strings <code>''case''</code> retornam a mesma string <code>''result''</code>. Isso minimiza a duplicação. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Aqui, os casos 2, 3 e 4 retornam <code>''result234''</code>; os casos 6 e 7 retornam <code>''result67''</code>. O "<code>#default = </code>" no último parâmetro pode ser omitido no caso acima. <span id="Use_with_parameters"></span> === Uso com parâmetros === A função pode ser usada com parâmetros como a sequência (''string'') de teste. Neste caso, não é necessário colocar a barra vertical após o nome do parâmetro, pois é muito improvável que você opte por definir um caso como a sequência (''string'') "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>". (Este é o valor padrão do parâmetro se a barra vertical estiver ausente e o parâmetro não existir ou não tiver um valor. Veja {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> No caso acima, se <code><nowiki>{{{1}}}</nowiki></code> for igual a <code>foo</code>, a função retornará <code>Foo</code>. Se for igual a <code>baz</code>, a função retornará <code>Baz</code>. Se o parâmetro estiver vazio ou não existir, a função retornará <code>Bar</code>. Como na seção acima, os casos podem ser combinados para fornecer um único resultado. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> Aqui, se <code><nowiki>{{{1}}}</nowiki></code> for igual a <code>foo</code>, <code>zoo</code> ou <code>roo</code>, a função retornará <code>Foo</code>. Se for igual a <code>baz</code>, a função retornará <code>Baz</code>. Se o parâmetro estiver vazio ou não existir, a função retornará <code>Bar</code>. Além disso, o resultado padrão pode ser omitido se você não desejar retornar nada se o valor do parâmetro de teste não corresponder a nenhum dos casos. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> Neste caso, a função retorna uma sequência (''string'') vazia, a menos que <code><nowiki>{{{1}}}</nowiki></code> exista e seja igual a <code>foo</code> ou <code>bar</code>, caso em que retorna <code>Foo</code> ou <code>Bar</code>, respectivamente. Isto tem o mesmo efeito que declarar o resultado padrão como vazio. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> Se por algum motivo você decidir definir um caso como "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", a função retornará o resultado desse caso quando o parâmetro não existir ou não tiver valor. O parâmetro teria que existir e ter um valor diferente da sequência (''string'') "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" para retornar o resultado padrão da função. :(quando <code><nowiki>{{{1}}}</nowiki></code> não existe ou está vazio): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quando <code><nowiki>{{{1}}}</nowiki></code> tem o valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' Neste caso hipotético, você precisaria adicionar a barra vertical ao parâmetro (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). <span id="Comparison_behavior"></span> === Comportamento de comparação === Tal como acontece com <code>[[##ifeq|#ifeq]]</code>, a comparação é feita numericamente se tanto a string de comparação e a string case forem números; ou como uma string case-sensitive de outra forma: :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' Uma string <code>''case''</code> pode estar vazia: :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' Uma vez que a correspondência for encontrada, <code>''cases''</code> subsequentes são ignorados: :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= Comparações numéricas com <code>[[##switch|#switch]]</code> e <code>[[##ifeq|#ifeq]]</code> não são equivalentes com comparações em expressões (ver também acima): :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <span id="Raw_equal_signs"></span> === Sinais de igual brutos === Sequências (''strings'') de "case" não podem conter sinais de igual brutos. Para contornar isso, use a palavra mágica [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] ou substitua o sinal de igual pelo código ''HTML'' <code><nowiki>&amp;#61;</nowiki></code>. Exemplo: {| class="wikitable" ! Você digita ! Você obtém |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=Para um exemplo simples da vida real do uso desta função, verifique [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Dois exemplos complexos podem ser encontrados em {{ll|Template:Extension}} e [[w:Template:BOTREQ]]. }} <span id="Replacing_#ifeq"></span> === Substituição de #ifeq === <code>#switch</code> pode ser usado para reduzir a [[Special:MyLanguage/Help:Expansion depth|profundidade de expansão]]. Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> ou seja, aninhamento profundo, linear: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> Por outro lado, a substituição do switch pode ser complicada/impraticável para IFs aninhados em ambos os ramos (mostrados com alternativas de recuo, recuados em ambos os lados), formando uma árvore totalmente simétrica: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrição ! {{hl1}} | Saída atual <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Limpe a cache desta página] para atualizar)</small> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano com 4 dígitos. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano com 2 dígitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1 se for ano bissexto, 0 se não for. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|Requer o PHP 5.1.0 e mais recente e a revisão [[rev:45208]].|group=note}} | Código do ano ISO-8601 da semana especificada.{{#tag:ref|Isto tem o mesmo valor que Y, exceto que se o número ISO da semana (W) pertence ao ano anterior ou o próximo, esse ano é usado em vez disso.|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|Sairá literalmente ''o'' se a nota 1 não for cumprida.|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mês |- | style="text-align: center;" | <code>n</code> | Índice do mês sem zeros à esquerda. | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | Índice do mês com zeros à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | Uma abreviação do nome do mês, no idioma do site. | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | O nome completo do mês no idioma do site. | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | Retorna o nome completo do mês na forma [[w:Genitive case|genitiva]] para idiomas de sites que distinguem entre formas genitivas e [[w:Nominative case|nominativas]]. Esta opção é útil para muitas [[w:Slavic languages|línguas eslavas]] como polonês, russo, bielo-russo, tcheco, eslovaco, esloveno, ucraniano, etc. | style="line-height: 1.6;" | Para o polonês:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| Dia do mês ou o ano |- | style="text-align: center;" | <code>j</code> | Dia do mês, sem zeros à esquerda. | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | Dia do mês, com zeros à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | Dia do ano (Janeiro&nbsp;1 = 0).<br />{{note/pt-br}} Para obter o dia ISO do ano, adicione 1. | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Semana ou dia da semana |- | style="text-align: center;" | <code>W</code> | Número da semana ISO 8601, com zeros à esquerda. | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | Dia da semana ISO 8601 (Segunda-feira = 1, Domingo = 7). | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | Número do dia da semana (Domingo = 0, Sábado = 6). | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | Uma abreviação do dia da semana. Raramente internacionalizado. | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | Nome completo do dia. Raramente internacionalizado. | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" antes do meio-dia (00:00:00 → 11:59:59), "pm" depois do meio-dia (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versão maiúscula de <code>a</code> acima. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sem zeros à esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, com zeros à esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 24 horas, sem zeros à esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, com zeros à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | Minutos depois da hora, com zeros à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | Segundos após o minuto, com zeros à esquerda. | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|hora do Unix]]. Segundos desde 1º de Janeiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso horário (a partir de [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horário. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | Se desejar que a data esteja ou não no horário de verão. | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diference para o horário de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diference para o horário de Greenwich (GMT), com dois pontos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviação do fuso horário. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | Deslocamento em segundos do fuso horário. | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Número de dias do mês atual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | Data formatada em ''ISO'' 8601, equivalente a <code>Y-m-d"T"H:i:s+00:00</code>. | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | Data formatada em [[rfc:5322|''RFC'' 5322]], equivalente a <code>D, j M Y H:i:s +0000</code>, com o nome do dia da semana e o nome do mês não internacionalizados. | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendários não-Gregorianos |- ! {{hl3}} colspan="3" | Islâmicos |- | style="text-align: center;" | <code>xmj</code> | Dia do mês. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mês. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índice do mês. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Número de dias do mês. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dias do ano. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia do mês. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mês. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índice do mês. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano com 2 dígitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebraico |- | style="text-align: center;" | <code>xjj</code> | Dia do mês. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mês. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de dias no mês. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genitiva do nome do mês. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mês. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendário solar tailandês |- | style="text-align: center;" | <code>xkY</code> | Ano completo no [[w:Calendário solar tailandês]]. <br />{{note}} Para anos anteriores a 1941 as datas na faixa de Janeiro a Março não são adequadamente [[w:Thai_solar_calendar#New_year|calculadas]]. | {{#time:xkY}} |- ! {{hl3}} colspan="3" | Ano Minguo/Juche |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | Calendário de eras do Japão (nengo) |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | Flags |- | style="text-align: center;" | <code>xn</code> | Formata o próximo código numérico como número ASCII bruto. | No idioma Hundi, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produz ०६, 06. |- | style="text-align: center;" | <code>xN</code> | colspan="2" | Como <code>xn</code>, mas como um sinalizador alternado, que dura até o final da sequência (''string'') ou até a próxima aparição de <code>xN</code> na sequência (''string''). |- | style="text-align: center;" | <code>xr</code> | Formata o próximo número como um número romano. Só funciona para números até 10.000<br /><small>(até 3.000 no pré MediaWiki 1.20)</small>. | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | Formata o próximo número como um numeral em hebraico. | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} Esta parser function pega uma data e/ou uma hora (no calendário Gregoriano) e formata-o de acordo com a sintaxe fornecida. Um objeto de data/hora pode ser especificado; o padrão é o valor da [[Special:MyLanguage/Help:Magic words#Date and time|palavra mágica]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; isto é, a hora em que a página foi renderizada dentro do HTML. :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> A lista de códigos de formatação aceitos é fornecida na tabela à direita. Qualquer caractere na sequência de formatação que não seja reconhecido será passado inalterado; isto também se aplica a espaços em branco (o sistema não necessita deles para interpretar os códigos). Se nenhum caractere for reconhecido na sequência (''string'') de formatação e o objeto de data/hora não tiver erros, a sequência (''string'') de formatação será retornada como saída. Existem também duas maneiras de escapar caracteres na sequência de formatação: # Uma barra invertida seguida por um caractere de formatação é interpretada como um único caractere literal # Os caracteres entre aspas duplas são considerados caracteres literais e as aspas são removidas. Além disso, o dígrafo <code>xx</code> é interpretado como um único literal "x". À medida que a lista de códigos de formatação continua a evoluir (com o suporte de novos calendários ou de novos campos de data calculados e formatados de forma diferente), você deve escapar todos os caracteres literais (não apenas as letras ASCII usadas atualmente pelos códigos de formatação) que precisam ser passados através inalterado. Infelizmente, por enquanto, as aspas simples ASCII ainda não são reconhecidas como uma alternativa simples para marcar texto literal às aspas duplas ASCII atualmente suportadas (por exemplo, aspas duplas são obrigatórias para outros usos, como a delimitação de valores de sequências em JSON, C, C++...) e barras invertidas (que também precisam ser escapadas em constantes de sequências usadas por muitas linguagens, incluindo JSON, C, C++, PHP, JavaScript, Lua). Portanto, você ainda não pode incorporar aspas duplas literais sem escapar com uma barra invertida (ou pode usar outras aspas curvas, angulares ou quadradas). :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' O <code>objeto data/hora</code> pode ser em qualquer formato aceito na função [https://php.net/function.strtotime strtotime()] do PHP. Tempos absolutos (por exemplo, <code>20 December 2000</code>), relativos (por exemplo, <code>+20 hours</code>) e combinados (por exemplo, <code>30 July +1 year</code>) são aceitos. :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' O <code>''código de idioma''</code> em [[w:ISO 639-3|ISO 639-3]] (?) permite que a string seja exibida no idioma escolhido :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' O parâmetro <code>''local''</code> especifica se o ''objeto data/hora'' se refere ao fuso horário local ou ao UTC. Este é um parâmetro booleano: seu valor é determinado pela conversão do valor do argumento (veja a [documentação oficial do PHP https://php.net/language.types.boolean#language.types.boolean.casting] para detalhes sobre como sequências são convertidas em valores booleanos). {{note|2=reminder|1=Por favor observe que, se a variável {{phpi|$wgLocaltimezone}} for definida como <code>UTC</code>, não haverá diferença na saída quando <code>local</code> for definido como <code>true</code> ou <code>false</code>.}} Consulte os exemplos a seguir para obter detalhes: :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' Se você calculou um carimbo de data/hora Unix, poderá usá-lo em cálculos de data pré-pendendo um símbolo de <code>@</code>. :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= Sem o prefixo <code>@</code> antes dos valores numéricos de carimbo de data/hora, o resultado é um erro na maioria das vezes ou é um valor inesperado: :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (formato de ano não suportado) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' (interpretado como um ano com mês e dia do mês atuais) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' (interpretado como um ano com mês e dia do mês atuais) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (formato de ano não suportado) }} {{Warning|1= O intervalo de entrada aceitável é de 1º de Janeiro de 0111 → 31 de Dezembro de 9999. Para os anos de 100 a 110, a saída é inconsistente, Y e os anos bissextos são como os anos 100-110, r, D, l e U são como interpretar esses anos como 2000-2010. :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> (correto, sem ano bissexto), porém :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' (errado, mesmo que 100 seja interpretado como 2000, porque esse é um ano bissexto) :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' Os números de ano 0-99 são interpretados como 2000-2069 e 1970-1999, exceto quando escrito em formato de 4 dígitos com zeros à frente: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) O dia da semana é fornecido para os anos 100-110 e a partir de 1753, para os anos 111-1752 a saída à direita exibe "Unknown" e a saída à esquerda "<>". Como consequencia, a saída à direita não é aceita como entrada para esses anos. }} Datas absolutas totais ou parciais podem ser especificadas; a função irá "preencher" as partes da data que não forem especificadas usando os valores '''atuais'': :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= O recurso de preenchimento não é consistente; algumas partes são preenchidas com os valores atuais, outras não: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' Fornece o início do dia, porém o dia atual do mês e do ano em curso. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' Fornece o início do dia, mas o dia atual do ano. Há exceção do dia preenchido: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' Dá o início do dia e o início do mês. }} Um número de quatro dígitos é sempre interpretado como um ano, nunca como horas e minutos:<ref>Antes de {{rev|86805}} em 2011, esse não era o caso.</ref> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' Um número de seis dígitos é interpretado como horas, minutos e segundos, se possível, mas de outra forma, como um erro (não, por exemplo, um ano e mês): :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' A entrada é tratada como uma hora em vez de um código de ano + mês. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' Embora 19:60:09 não é uma hora válida, 196009 não é interpretado como setembro de 1960. A função executa uma certa quantidade de matemática de data: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' O comprimento total das strings de formato das chamadas de $time se limita a 6000 caracteres<ref>[https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions_body.php] em phabricator.wikimedia.org</ref>.<ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Questão do fuso horário ==== Existe um bug nesta parser function #time (mais especificamente em ''PHP DateTime'') que não permite a passagem de não-inteiros como deslocamentos de fuso horário relativos. Este problema não se aplica quando se usa um fuso horário exato, como EDT. Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} Entretanto, a Índia está a +5,5 horas do UTC, e, assim, usar seu fuso horário não permitirá normalmente o cálculo correto de um deslocamento de fuso horário relativo. Veja o que acontece: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} Para contornar este problema, basta converter o tempo em minutos ou segundos, assim: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} (Tim Starling, o desenvolvedor desta função, forneceu a sintaxe exata para esta solução.) <span id="#time_format_like_in_signatures"></span> ==== #time formato como em assinaturas ==== Às vezes, é útil construir um carimbo de data/hora, que se parece com o carimbo de data/hora automático gerado por [[Special:MyLanguage/Help:Signatures|signatures]] em discussões em páginas de discussão. Em um wiki em inglês, ele pode ser criado com: * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == Esta função é um atalho sintático que opera de forma idêntica a <code><nowiki>{{#time: ... }}</nowiki></code> com o parâmetro <code>local</code> definido como {{phpi|true}}, portanto sempre usa o fuso horário preferido do usuário ou o fuso horário configurado da wiki (conforme definido em {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}) A sintaxe da função é: :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=Por favor observe que, se a variável {{phpi|$wgLocaltimezone}} for definida como <code>UTC</code>, não haverá diferença na saída quando <code>local</code> for definido como {{phpi|true}} ou {{phpi|false}}}} [[File:Time-Timel.png|thumb|Exemplo de uso das funções, #time e #timel, do analisador a partir de um servidor onde o fuso horário não é UTC]] Por exemplo, veja os seguintes exemplos: :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|Exemplo de aviso a partir de https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid]] {{Warning|1= Esteja ciente de que "U" para ambas, "time" e "timel", retornará o mesmo número de segundos desde 01/01/1970 00:00:00 UTC em Wikipédias com fusos horários diferentes do UTC (anteriormente conhecido como GMT) :<code>U</code> Hora Unix. Segundos desde 1º de janeiro de 1970 00:00:00 GMT. :<code>Z</code> Deslocamento em segundos do fuso horário. :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == Essa função formata uma data usando um formato padrão para o idioma selecionado, conforme definido em <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (consulte {{Phab|T223772}}). : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=''objeto de data/hora'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=''objeto de data/hora'' |2=''tipo de formato'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=''objeto de data/hora'' |2=''tipo de formato'' |3=''código do idioma'' }} O formato do objeto ''date/time'' é o mesmo de [[#time|#time]]. Se estiver vazio, será usada a hora em que a página foi renderizada. O ''tipo de formato'' pode ser um dos seguintes: ; <code>time</code> : Somente a hora é mostrada. ; <code>date</code> : Somente a data é mostrada. ; <code>both</code> : A hora e a data são exibidas. ; <code>pretty</code> : Apenas a data é mostrada, usando um formato abreviado que não inclui o ano. Nem todos os idiomas suportam esse formato; se não for suportado, será usado o formato "date". Se o "tipo de formato" não for especificado, a hora e a data serão exibidas, como se <code>both</code> tivesse sido especificado. Se o "código de idioma" não for especificado, será usado o idioma do conteúdo da página. O uso de <code>#timef</code> em vez de <code>#time</code> permite que os modelos ofereçam suporte a vários idiomas com mais facilidade, já que idiomas diferentes têm maneiras diferentes de formatar datas. Em inglês, a ordem do dia e do mês é controlada por {{wg|AmericanDates}}. Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == Essa função é igual a [[#timef|#timef]], exceto pelo fato de usar o fuso horário local do wiki, conforme configurado em {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}. :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == Esta função separa um título de página em segmentos baseados em barras, em seguida, retorna alguns desses segmentos como saída. : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nome da página |2=número de segmentos no resultado |3=primeiro segmento do resultado }} Se o parâmetro número de segmentos não for especificado, o padrão é "0", que retorna ''todos'' os segmentos do ''primeiro segmento'' (incluído). Se o parâmetro primeiro segmento não for especificado ou for "0", o padrão é "1": : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Ver também <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' Valores negativos são aceitos para ambos os valores. Valores negativos para o parâmetro ''número de segmentos para retornar'' efetivamente "removem" segmentos do final da string. Valores negativos para o ''primeiro segmento para retornar'' traduz-se para "começar com este segmento contando da direita": : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' Retira um segmento a partir do final da string. Ver também {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' Retira todos os quatro segmentos a partir do final da string : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' Retira 5 segmentos a partir do final da string (mais do que existe) : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' Retorna o último segmento. Ver também {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' Retira um segmento a partir do final da string, em seguida, retorna o segundo segmento e mais além : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' Inicia a cópia no penúltimo elemento; retira um segmento a partir do final da string Antes do processamento, o parâmetro ''pagename'' é decodificado em HTML: se contiver algumas entidades de caracteres HTML padrão, elas serão convertidas em caracteres simples (codificados internamente com UTF-8, ou seja, a mesma codificação da página fonte do MediaWiki usando esta função de analisador). : Por exemplo, todas as ocorrência de <code>&amp;quot;</code>, <code>&amp;#34;</code>, ou <code>&amp;#x22;</code> no "nome da página" serão substituida por <code>"</code>. : Nenhuma outra conversão a partir da HTML para texto simples é realizada, portanto as marcações da HTML são deixadas intactas nesta etapa inicial, mesmo que sejam inválidas nos títulos das páginas. {{tip| 1= Algumas palavras-chave mágicas ou funções de analisador de MediaWiki (como <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> e similares) são conhecidas por retornar sequências que são desnecessariamente codificadas em HTML, mesmo que seu próprio parâmetro de entrada não tenha sido codificado em HTML: A função, "titleparts", do analisador pode então ser usada como uma solução alternativa, para converter estas sequências retornadas para que possam ser processadas corretamente por algumas outras funções do analisador que também têm um nome de página no parâmetro (tal como <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code> mas que ainda não estão funcionando corretamente com sequências de entrada codificadas em HTML. This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. Por exemplo, se a página atual for [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], então: * <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight> e <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> estão retornando <code>1</code>; (a função, "#ifeq", do analisador executa a decodificação da HTML de seus parâmetros de entrada). * <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight> e <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> estão retornando <code>1</code>; (a função, "#switch", do analisador executa a decodificação da HTML de seus parâmetros de entrada). * <syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight> ou mesmo <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> retornarão <code>1</code> se essa página de categoria existir (a função, "#ifexist", do analisador executa a decodificação da HTML de seus parâmetros de entrada); * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> retornará um número diferente de zero, se essa categoria contiver páginas ou subcategorias, '''mas''': * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, ainda pode '''incondicionalmente''' retornar 0, assim como: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> A razão deste comportamento inesperado é que, com as versões atuais do MediaWiki, existem duas advertências: * <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, ou mesmo <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''pode'' retornar a sequência realmente codificada em HTML <code>Category:Côte-d&apos;Or</code> e não a <code>Category:Côte-d'Or</code> esperada, e que: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''incondicionalmente''' retorna 0 (a palavra-chave mágica "PAGESINCAT" não executa nenhuma decodificação da HTML de seu parâmetro de entrada). A solução simples usando "titleparts" (que continuará a funcionar se as duas advertências forem corrigidas em uma versão posterior do MediaWiki) é: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, que retornam o número real de páginas na mesma categoria. }} Em seguida, o ''nome da página'' decodificado é canonizado em um título de página padrão suportado pelo MediaWiki, tanto quanto possível: # Todos os sublinhados são automaticamente substituídos por espaços: #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' Não bah_boo, apesar do sublinhado no original. # A string é dividida em um máximo de 25 vezes; outras barras são ignoradas e o elemento 25 irá conter o resto da string. A string é também limitada a 255 caracteres, então ela é tratada como um [[Special:MyLanguage/Manual:Page table#Schema summary|título de página]]: #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: Se por qualquer motivo você precisava empurrar esta função ao seu limite, embora muito improvável, é possível contornar o limite de divisão de 25 pela chamada da função de aninhamento: #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # Finalmente, a primeira subsequência é capitalizada de acordo com as configurações de capitalização da wiki local (se essa subsequência também começar com um nome de espaço nomeado local, esse nome de espaço nomeado também será normalizado). #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= Você pode usar #titleparts como um simples "analisador e conversor de strings", mas saiba que ela retorna a primeira substring capitalizada: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' Se forem necessárias minúsculas, use lc: função para controlar a saída: : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' *Você pode preceder uma barra 'simulada' no início da string para obter a capitalização correta da primeira substring (maiúscula ou minúscula). Use <code>2</code> em vez de <code>1</code> para retorno do ''primeiro segmento'': : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= Certos caracteres que são {{ll|Manual:Page title#Naming restrictions|ilegal em um título de página}} farão com que o #titleparts não analise a string: : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Não produz o esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. Não funciona porque colchetes são ilegais em títulos de páginas e esta função do analisador não processa ligações incorporadas em seu parâmetro de entrada de ''nome da página'', mesmo quando elas usam a sintaxe MediaWiki ou qualquer outra marcação de HTML ou MediaWiki. : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". Não funciona porque "#" também é ilegal em títulos de páginas. }} {{Warning|1= Se qualquer parte do título for apenas "<code>.</code>" ou "<code>..</code>", #titleparts não analisará a sequência (''string''): : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. A sequência inteira é retornada. Não produz o esperado: '''one''' }} {{Warning|1= Esta função não é degradada normalmente se a entrada exceder 255 bytes em UTF-8. Se a string de entrada tiver 256 bytes ou mais, toda a string será retornada. }} <span id="String_functions"></span> == StringFunctions == {{Main|Extension:ParserFunctions/String functions}} A extensão ParserFunctions define opcionalmente várias funções de sequência (''string'') se <code>$wgPFEnableStringFunctions</code> estiver definido como {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Consulte a subpágina dedicada para obter a documentação e {{ll|Manual:Performing string operations with parser functions}} para obter exemplos. {{Warning |1=Em 2013, foi decidido que '''essas funções ''nunca'' serão habilitadas em qualquer wiki da Wikimedia''', porque são ineficientes quando usadas em larga escala (ver [[phab:T8455]] para ver um pouco da história). '''Estas funções NÃO funcionam nas wikis da Wikimedia!'''<br/><br/>Se você está aqui para escrever algo sobre um projeto da Wikimedia, você está procurando outra coisa: se a sua wiki inicial tiver funções de sequência (''string''), provavelmente usará {{ll|Extension:Scribunto|Lua}}. Por exemplo, a Wikipédia em inglês usa [[w:Module:String|Module:String]], que faz algumas das mesmas coisas com uma sintaxe totalmente diferente. Existem também [[w:Template:String-handling templates|Predefinições de manipulação de sequências (''strings'')]]. }} Aqui está uma breve visão geral das funções [[Module:String]]: * [[w:Module:String#len|&#35;len]] (comprimento da sequência): <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] (subsequência): <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] (posição do alvo): <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] (repetição): <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Pontos gerais == <span id="Substitution"></span> === Substituição === Funções do analisador podem ser [[m:Help:Substitution|substituídas]] prefixando o caractere hash (#) com <code>'''subst:'''</code>: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será inserida no wikitexto desde que a página {{FULLPAGENAME}} exista. {{Warning|1= Os resultados das funções do analisador substituídas são indefinidos se as expressões contiverem código volátil ''não'' substituído como {{ll|Help:Magic words#Variables|variáveis}} ou outras funções do analisador. Para obter resultados consistentes, todo o código volátil na expressão a ser avaliada deve ser substituído. Consulte [[w:Help:Substitution|Help:Substitution]].}} A substituição não funciona em {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; você pode usar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> para essa finalidade. <span id="Redirects"></span> === Redirecionamentos === Especialmente [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] poderia ser útil em {{ll|Help:Redirects|redirecionamentos}} para páginas incluindo datas, mas isso não funciona. <span id="Escaping_pipe_characters"></span> === Escapando caracteres de pipe === <span id="In_tables"></span> ==== Em tabelas ==== As funções do analisador irão alterar a sintaxe de {{ll|Help:Tables|tabela wiki}} e os caracteres de barra vertical (<code><nowiki>|</nowiki></code>), tratando todos os caracteres de barra vertical brutos como divisores de parâmetros. Para evitar isso, a maioria das wikis usava uma predefinição [[{{ns:10}}:!]] com apenas um caractere de barra vertical bruto (<code><nowiki>|</nowiki></code>) em seu conteúdo, já que em MW 1.24 uma {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} substituiu este ''kludge''. Isto "oculta" a barra vertical do analisador MediaWiki, garantindo que ela não seja considerada até que todos as predefinições e variáveis em uma página tenham sido expandidas. Ela será então interpretada como um separador de linha ou coluna da tabela. Alternativamente, a sintaxe de tabela HTML bruta pode ser usada, embora seja menos intuitiva e mais propensa a erros. Você também pode escapar a barra vertical &vert; para exibição como um caractere simples e não interpretado usando uma entidade HTML: <code>&amp;#124;</code> ou <code>&amp;vert;</code>. {| class="wikitable" ! Descrição ! Você digita ! Você obtém |- | Escapando o caractere de barra vertical como separador de linha/coluna da tabela | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | Escapando o caractere de barra vertical como um caractere simples | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Em chamadas de modelo ==== Aplica-se a mesma proteção de tubulação do exemplo a seguir: <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> Observamos que ''text after'' não é exibido quando o pipe | logo antes de ''sandbox name='' está presente, pois ''|sandbox name='' é considerado erroneamente como um parâmetro do modelo ''Documentation'' no mesmo nível que ''|content=''. <span id="Stripping_whitespace"></span> === Remoção de espaço vazio === Os espaços em branco, incluindo novas linhas, tabulações e espaços, são removidos do início e do final de todos os parâmetros dessas funções do analisador. Se isso não for desejável, a comparação das sequências (''strings'') pode ser feita após colocá-las entre aspas. :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span class="mw-translate-fuzzy">Para evitar o corte das peças then e else, consulte [[m:Template:If]]. Algumas pessoas conseguem isso usando $2 em vez de espaços.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' No entanto, este método pode ser usado para renderizar apenas um caractere de espaço em branco '''único''', já que o analisador comprime vários caracteres de espaço em branco seguidos em um. :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} Neste exemplo, o estilo <code>white-space: pre</code> é usado para forçar que os espaços em branco sejam preservados pelo navegador, mas mesmo assim os espaços não são mostrados. Isso acontece porque os espaços são retirados pelo ''software'', antes de serem enviados ao navegador. É possível contornar esse comportamento substituindo os espaços em branco por <code>&amp;#32;</code> (''espaço quebrável'') ou <code>&amp;nbsp;</code> (''espaço inquebrável''), já que eles não são modificados pelo ''software'': :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' Esteja ciente de que nem todos os parâmetros são criados iguais. Em ParserFunctions, os espaços em branco no início e no final são sempre eliminados. Em {{ll|Help:Templates|predefinições}}, os espaços em branco no início e no final são removidos para parâmetros nomeados e parâmetros nomeados sem nome, mas ''não'' para parâmetros sem nome: :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Outras funções do analisador == <span id="Case_conversion_functions"></span> === Funções de conversão de casos === * '''Minúsculas:''' {{xpdoc|lc: AbC|}} * '''Maiúsculas:''' {{xpdoc|uc: AbC|}} * '''Primeiro caractere em minúsculas:''' {{xpdoc|lcfirst: AbC}} * '''Primeiro caractere em maiúsculas:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funções de codificação === * '''Codificação de URL:''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> é renderizado como ---- "{{urlencode: AbC dEf ghi}}" ---- Portanto, as novas linhas internas são convertidas em %0A e os espaços internos são convertidos em +. <span id="Anchor_encoding"></span> === Codificação de âncora === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> é renderizado como ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Ver também == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – uma lista (incompleta) de funções do analisador adicionadas prlo núcleo e extensões. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – especialmente para formatação e preenchimento de números * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleto {{ll|Extension:StringFunctions}} * Funções do analisador para Wikibase (as extensões que habilitam a Wikidata): [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|Como usar dados em projetos da Wikimedia#Função do analisador]] <span id="References"></span> == Referências == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] r75ohnagpqru7ld4c8ufqzdp8z8rj8o Help:Subpages/pt-br 12 77181 8364517 8179793 2026-05-03T16:47:48Z Nerun 899342 Created page with "Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível." 8364517 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|<span lang="en" dir="ltr" class="mw-content-ltr">child 1</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo <span class="mw-translate-fuzzy">Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, subpáginas tendem a ter um nome longo que é difícil de lembrar, por isso pode ser mais amigável utilizá-los o mínimo possível. Você também pode organizar as páginas com o recurso de [[$help-cat|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações.</span> Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. <span lang="en" dir="ltr" class="mw-content-ltr">You can also organize pages with the [[Special:MyLanguage/Help:Category|category]] feature, which is more suitable for creating a hierarchical network of information.</span> <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. <span class="mw-translate-fuzzy">Você pode passar parâmetros para isso, por exemplo <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code></span> <div class="mw-translate-fuzzy"> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}}, permitem a você personalizar a exibição de subpáginas. </div> <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == <span class="mw-translate-fuzzy">Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. barras invertidas ($backslash) são tratados como caracteres normais em de subpágina nomenclatura e pode ser utilizada em lugar de barras. Além disso, como um hack bruto, um caractere semelhante à barra pode ser usado em vez disso, como o "[[wikt:⧸|big solidus]]" ($u1), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a [[wikt:⁄|solidus]] ($u2), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (para além da diferença visual de uma barra real), surgem deste hack:</span> <span lang="en" dir="ltr" class="mw-content-ltr">Back slashes (<code>\</code>) are treated as normal characters in subpage naming and can be used in place of forward slashes.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally, as a crude hack, a character similar to the [[wikt:/|forward slash]] or solidus (U+002F) can be used instead, such as the "[[wikt:⧸|big solidus]]" (U+29F8), which results in Foo⧸bar (cf. a real slash: Foo/bar), or the [[wikt:⁄|fraction slash]] (U+2044), which results in Foo⁄bar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Three possible technical disadvantages (apart from the visual difference from a real slash) arise from this hack:</span> # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # <span class="mw-translate-fuzzy">As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas são desativadas no espaço nominal principal da Wikipédia, então, embora a página de discussão não funcione a menos que o caractere solidus seja usado para evitar que sejam marcadas como subpáginas, a página correspondente no espaço nominal principal pode acidentalmente manter uma barra real.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, subpages are disabled in the main namespace in Wikipedia, so while the talk page won't work unless the solidus character is used to prevent having them marked as subpages, the corresponding page in the main namespace could accidentally keep an actual slash.</span> O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] 1kp6z6carfw1s3i5yg383661knsosuw 8364519 8364517 2026-05-03T16:51:42Z Nerun 899342 Created page with "Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano." 8364519 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|<span lang="en" dir="ltr" class="mw-content-ltr">child 1</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo <span class="mw-translate-fuzzy">Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, subpáginas tendem a ter um nome longo que é difícil de lembrar, por isso pode ser mais amigável utilizá-los o mínimo possível. Você também pode organizar as páginas com o recurso de [[$help-cat|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações.</span> Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. <span lang="en" dir="ltr" class="mw-content-ltr">You can also organize pages with the [[Special:MyLanguage/Help:Category|category]] feature, which is more suitable for creating a hierarchical network of information.</span> <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. <span class="mw-translate-fuzzy">Você pode passar parâmetros para isso, por exemplo <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code></span> <div class="mw-translate-fuzzy"> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}}, permitem a você personalizar a exibição de subpáginas. </div> <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == <span class="mw-translate-fuzzy">Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. barras invertidas ($backslash) são tratados como caracteres normais em de subpágina nomenclatura e pode ser utilizada em lugar de barras. Além disso, como um hack bruto, um caractere semelhante à barra pode ser usado em vez disso, como o "[[wikt:⧸|big solidus]]" ($u1), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a [[wikt:⁄|solidus]] ($u2), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (para além da diferença visual de uma barra real), surgem deste hack:</span> <span lang="en" dir="ltr" class="mw-content-ltr">Back slashes (<code>\</code>) are treated as normal characters in subpage naming and can be used in place of forward slashes.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally, as a crude hack, a character similar to the [[wikt:/|forward slash]] or solidus (U+002F) can be used instead, such as the "[[wikt:⧸|big solidus]]" (U+29F8), which results in Foo⧸bar (cf. a real slash: Foo/bar), or the [[wikt:⁄|fraction slash]] (U+2044), which results in Foo⁄bar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Three possible technical disadvantages (apart from the visual difference from a real slash) arise from this hack:</span> # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # <span class="mw-translate-fuzzy">As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas são desativadas no espaço nominal principal da Wikipédia, então, embora a página de discussão não funcione a menos que o caractere solidus seja usado para evitar que sejam marcadas como subpáginas, a página correspondente no espaço nominal principal pode acidentalmente manter uma barra real.</span> Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] ojlx2mk1hfhdrh7rk43me3ip4n47qjc 8364521 8364519 2026-05-03T16:52:39Z Nerun 899342 8364521 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|<span lang="en" dir="ltr" class="mw-content-ltr">child 1</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo <span class="mw-translate-fuzzy">Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, subpáginas tendem a ter um nome longo que é difícil de lembrar, por isso pode ser mais amigável utilizá-los o mínimo possível. Você também pode organizar as páginas com o recurso de [[$help-cat|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações.</span> Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. <span lang="en" dir="ltr" class="mw-content-ltr">You can also organize pages with the [[Special:MyLanguage/Help:Category|category]] feature, which is more suitable for creating a hierarchical network of information.</span> <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. <span class="mw-translate-fuzzy">Você pode passar parâmetros para isso, por exemplo <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code></span> <div class="mw-translate-fuzzy"> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}}, permitem a você personalizar a exibição de subpáginas. </div> <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == <span class="mw-translate-fuzzy">Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. barras invertidas ($backslash) são tratados como caracteres normais em de subpágina nomenclatura e pode ser utilizada em lugar de barras. Além disso, como um hack bruto, um caractere semelhante à barra pode ser usado em vez disso, como o "[[wikt:⧸|big solidus]]" ($u1), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a [[wikt:⁄|solidus]] ($u2), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (para além da diferença visual de uma barra real), surgem deste hack:</span> <span lang="en" dir="ltr" class="mw-content-ltr">Back slashes (<code>\</code>) are treated as normal characters in subpage naming and can be used in place of forward slashes.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally, as a crude hack, a character similar to the [[wikt:/|forward slash]] or solidus (U+002F) can be used instead, such as the "[[wikt:⧸|big solidus]]" (U+29F8), which results in Foo⧸bar (cf. a real slash: Foo/bar), or the [[wikt:⁄|fraction slash]] (U+2044), which results in Foo⁄bar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Three possible technical disadvantages (apart from the visual difference from a real slash) arise from this hack:</span> # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] 2uouwi8s7tuq74jpfg1r3uah4pifm0q 8364523 8364521 2026-05-03T16:53:50Z Nerun 899342 8364523 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|<span lang="en" dir="ltr" class="mw-content-ltr">child 1</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo <span class="mw-translate-fuzzy">Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, subpáginas tendem a ter um nome longo que é difícil de lembrar, por isso pode ser mais amigável utilizá-los o mínimo possível. Você também pode organizar as páginas com o recurso de [[$help-cat|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações.</span> Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. <span lang="en" dir="ltr" class="mw-content-ltr">You can also organize pages with the [[Special:MyLanguage/Help:Category|category]] feature, which is more suitable for creating a hierarchical network of information.</span> <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. <span class="mw-translate-fuzzy">Você pode passar parâmetros para isso, por exemplo <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code></span> <div class="mw-translate-fuzzy"> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}}, permitem a você personalizar a exibição de subpáginas. </div> <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. <span lang="en" dir="ltr" class="mw-content-ltr">Back slashes (<code>\</code>) are treated as normal characters in subpage naming and can be used in place of forward slashes.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally, as a crude hack, a character similar to the [[wikt:/|forward slash]] or solidus (U+002F) can be used instead, such as the "[[wikt:⧸|big solidus]]" (U+29F8), which results in Foo⧸bar (cf. a real slash: Foo/bar), or the [[wikt:⁄|fraction slash]] (U+2044), which results in Foo⁄bar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Three possible technical disadvantages (apart from the visual difference from a real slash) arise from this hack:</span> # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] 0vk9tzaieddl5yytpof5sx71f9wohjl 8364525 8364523 2026-05-03T16:54:32Z Nerun 899342 Created page with "A barra invertida ($backslash) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/)." 8364525 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|<span lang="en" dir="ltr" class="mw-content-ltr">child 1</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo <span class="mw-translate-fuzzy">Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, subpáginas tendem a ter um nome longo que é difícil de lembrar, por isso pode ser mais amigável utilizá-los o mínimo possível. Você também pode organizar as páginas com o recurso de [[$help-cat|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações.</span> Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. <span lang="en" dir="ltr" class="mw-content-ltr">You can also organize pages with the [[Special:MyLanguage/Help:Category|category]] feature, which is more suitable for creating a hierarchical network of information.</span> <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. <span class="mw-translate-fuzzy">Você pode passar parâmetros para isso, por exemplo <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code></span> <div class="mw-translate-fuzzy"> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}}, permitem a você personalizar a exibição de subpáginas. </div> <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). <span lang="en" dir="ltr" class="mw-content-ltr">Additionally, as a crude hack, a character similar to the [[wikt:/|forward slash]] or solidus (U+002F) can be used instead, such as the "[[wikt:⧸|big solidus]]" (U+29F8), which results in Foo⧸bar (cf. a real slash: Foo/bar), or the [[wikt:⁄|fraction slash]] (U+2044), which results in Foo⁄bar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Three possible technical disadvantages (apart from the visual difference from a real slash) arise from this hack:</span> # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] l4p5bvvmnjjtsbi3c0atoyz25h0xw25 8364527 8364525 2026-05-03T16:55:53Z Nerun 899342 Created page with "Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[$1|forward slash]] ou barra invertida ($2) pode ser usado em vez disso, como a barra invertida "[[$3|big solidus]]" ($u1), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[$4|fraction slash]] ($u2), que resulta em Foo⁄bar." 8364527 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|<span lang="en" dir="ltr" class="mw-content-ltr">child 1</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo <span class="mw-translate-fuzzy">Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, subpáginas tendem a ter um nome longo que é difícil de lembrar, por isso pode ser mais amigável utilizá-los o mínimo possível. Você também pode organizar as páginas com o recurso de [[$help-cat|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações.</span> Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. <span lang="en" dir="ltr" class="mw-content-ltr">You can also organize pages with the [[Special:MyLanguage/Help:Category|category]] feature, which is more suitable for creating a hierarchical network of information.</span> <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. <span class="mw-translate-fuzzy">Você pode passar parâmetros para isso, por exemplo <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code></span> <div class="mw-translate-fuzzy"> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}}, permitem a você personalizar a exibição de subpáginas. </div> <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|forward slash]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|big solidus]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|fraction slash]] (U+2044), que resulta em Foo⁄bar. <span lang="en" dir="ltr" class="mw-content-ltr">Three possible technical disadvantages (apart from the visual difference from a real slash) arise from this hack:</span> # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] qjuqo8jlwhk3jx10r4ovthgdq3y6zbk 8364529 8364527 2026-05-03T16:57:21Z Nerun 899342 8364529 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|<span lang="en" dir="ltr" class="mw-content-ltr">child 1</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo <span class="mw-translate-fuzzy">Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, subpáginas tendem a ter um nome longo que é difícil de lembrar, por isso pode ser mais amigável utilizá-los o mínimo possível. Você também pode organizar as páginas com o recurso de [[$help-cat|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações.</span> Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. <span lang="en" dir="ltr" class="mw-content-ltr">You can also organize pages with the [[Special:MyLanguage/Help:Category|category]] feature, which is more suitable for creating a hierarchical network of information.</span> <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. <span class="mw-translate-fuzzy">Você pode passar parâmetros para isso, por exemplo <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code></span> <div class="mw-translate-fuzzy"> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}}, permitem a você personalizar a exibição de subpáginas. </div> <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. <span lang="en" dir="ltr" class="mw-content-ltr">Three possible technical disadvantages (apart from the visual difference from a real slash) arise from this hack:</span> # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] a7ss4rp8jjy452wdmkccot0fn8y36tr 8364531 8364529 2026-05-03T16:57:40Z Nerun 899342 Created page with "Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque:" 8364531 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|<span lang="en" dir="ltr" class="mw-content-ltr">child 1</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo <span class="mw-translate-fuzzy">Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, subpáginas tendem a ter um nome longo que é difícil de lembrar, por isso pode ser mais amigável utilizá-los o mínimo possível. Você também pode organizar as páginas com o recurso de [[$help-cat|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações.</span> Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. <span lang="en" dir="ltr" class="mw-content-ltr">You can also organize pages with the [[Special:MyLanguage/Help:Category|category]] feature, which is more suitable for creating a hierarchical network of information.</span> <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. <span class="mw-translate-fuzzy">Você pode passar parâmetros para isso, por exemplo <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code></span> <div class="mw-translate-fuzzy"> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}}, permitem a você personalizar a exibição de subpáginas. </div> <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] hwilv06w6fnpr4tpox1gy4szxhawb5d 8364533 8364531 2026-05-03T16:58:47Z Nerun 899342 8364533 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|<span lang="en" dir="ltr" class="mw-content-ltr">child 1</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo <span class="mw-translate-fuzzy">Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, subpáginas tendem a ter um nome longo que é difícil de lembrar, por isso pode ser mais amigável utilizá-los o mínimo possível. Você também pode organizar as páginas com o recurso de [[$help-cat|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações.</span> Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. <span lang="en" dir="ltr" class="mw-content-ltr">You can also organize pages with the [[Special:MyLanguage/Help:Category|category]] feature, which is more suitable for creating a hierarchical network of information.</span> <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. <span class="mw-translate-fuzzy">Você pode passar parâmetros para isso, por exemplo <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code></span> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] hk18tlk2pse62857i8ra7woiqnflmc3 8364535 8364533 2026-05-03T16:59:15Z Nerun 899342 8364535 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|<span lang="en" dir="ltr" class="mw-content-ltr">child 1</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo <span class="mw-translate-fuzzy">Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, subpáginas tendem a ter um nome longo que é difícil de lembrar, por isso pode ser mais amigável utilizá-los o mínimo possível. Você também pode organizar as páginas com o recurso de [[$help-cat|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações.</span> Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. <span lang="en" dir="ltr" class="mw-content-ltr">You can also organize pages with the [[Special:MyLanguage/Help:Category|category]] feature, which is more suitable for creating a hierarchical network of information.</span> <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] c64k6461bpjj94l2anlu1m1o9tf795c 8364537 8364535 2026-05-03T16:59:43Z Nerun 899342 Created page with "Você também pode organizar as páginas com o recurso [[$help-cat|categoria]], que é mais adequado para criar uma rede hierárquica de informações." 8364537 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|<span lang="en" dir="ltr" class="mw-content-ltr">child 1</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo <span class="mw-translate-fuzzy">Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, subpáginas tendem a ter um nome longo que é difícil de lembrar, por isso pode ser mais amigável utilizá-los o mínimo possível. Você também pode organizar as páginas com o recurso de [[$help-cat|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações.</span> Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso [[Special:MyLanguage/Help:Category|categoria]], que é mais adequado para criar uma rede hierárquica de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] j5kg7p2ibosiigfjvdbdx6e8azg8nzk 8364539 8364537 2026-05-03T17:00:28Z Nerun 899342 8364539 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|<span lang="en" dir="ltr" class="mw-content-ltr">child 1</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso [[Special:MyLanguage/Help:Category|categoria]], que é mais adequado para criar uma rede hierárquica de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] rm5kh9ftzt6ngple5x7ii4ljk9thipw 8364541 8364539 2026-05-03T17:01:35Z Nerun 899342 8364541 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|<span lang="en" dir="ltr" class="mw-content-ltr">child 1</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] 47dov4y6wvb4265l3de4r7q4kmjgz8o 8364543 8364541 2026-05-03T17:02:17Z Nerun 899342 Created page with "pai" 8364543 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|<span lang="en" dir="ltr" class="mw-content-ltr">child 1</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] op9yyxnifkia3cyiby93i3ugoybf9zg 8364545 8364543 2026-05-03T17:02:42Z Nerun 899342 Created page with "'''PÁGINA ATUAL'''" 8364545 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|<span lang="en" dir="ltr" class="mw-content-ltr">child 1</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] 2qc1ez5wf4ficmhmf2rrmfqx0f5u51y 8364547 8364545 2026-05-03T17:02:54Z Nerun 899342 Created page with "filha 1" 8364547 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] lnpd2awolu3rljna4uqgdvptmdk3jud 8364549 8364547 2026-05-03T17:03:03Z Nerun 899342 Created page with "neta" 8364549 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] 3kutcvtjgjho8ivjp55imagkin3u4ed 8364551 8364549 2026-05-03T17:03:15Z Nerun 899342 Created page with "bisneta" 8364551 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|<span lang="en" dir="ltr" class="mw-content-ltr">child 2</span>]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] 9fo4a98yv6bieei05nuwo6dp9kjlcer 8364553 8364551 2026-05-03T17:03:20Z Nerun 899342 Created page with "filha 2" 8364553 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] isii9fbxttzhunpgiemtxdzbho1fj2y 8364555 8364553 2026-05-03T17:03:24Z Nerun 899342 Created page with "neta" 8364555 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] gbbiy7jurtzm4g9f03svnyj2i99ryc1 8364557 8364555 2026-05-03T17:03:29Z Nerun 899342 Created page with "bisneta" 8364557 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] dfmld8gusthh9vxvc08ji1z5ljo8r89 8364559 8364557 2026-05-03T17:03:37Z Nerun 899342 Created page with "avó" 8364559 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] dqj6t6ji07kxvt8otrywq67f56omz74 8364561 8364559 2026-05-03T17:03:40Z Nerun 899342 Created page with "mãe" 8364561 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] td0fntn8kohykz00c7pilpawt7nmnay 8364563 8364561 2026-05-03T17:03:49Z Nerun 899342 Created page with "'''PÁGINA ATUAL'''" 8364563 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] neuajaojm220fwiewlbhzz7aak3dn6d 8364565 8364563 2026-05-03T17:03:52Z Nerun 899342 Created page with "filha" 8364565 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] 8kz5prvqduo4oi1srg5njqiftl1ikpt 8364567 8364565 2026-05-03T17:03:56Z Nerun 899342 Created page with "neta" 8364567 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] q7kqhp1tl0fbrqmrf8su6zj1q040p4h 8364569 8364567 2026-05-03T17:04:00Z Nerun 899342 Created page with "bisneta" 8364569 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || <span lang="en" dir="ltr" class="mw-content-ltr">grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] p238kq2txxqlknup4zg8dtft7rg6emi 8364571 8364569 2026-05-03T17:04:05Z Nerun 899342 Created page with "avó" 8364571 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] ott7my9u5riyo3f06b0ptzdf0sryaqk 8364573 8364571 2026-05-03T17:04:09Z Nerun 899342 Created page with "mãe" 8364573 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] 775q95i1ygnjwq1b6suwdezl263hgrl 8364575 8364573 2026-05-03T17:04:21Z Nerun 899342 Created page with "'''PÁGINA ATUAL'''" 8364575 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] f9ho2wiiun1wm8abk0iucte1ejnsi1b 8364577 8364575 2026-05-03T17:04:28Z Nerun 899342 Created page with "filha" 8364577 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | <span lang="en" dir="ltr" class="mw-content-ltr">great great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] heagsu572i48lfkjirnb5l0be1qxwku 8364579 8364577 2026-05-03T17:04:36Z Nerun 899342 Created page with "tataraneta" 8364579 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || <span lang="en" dir="ltr" class="mw-content-ltr">great grandparent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] e8450jqxt4t2vdipmqh3fni3rbpolyx 8364581 8364579 2026-05-03T17:04:40Z Nerun 899342 Created page with "bisneta" 8364581 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || bisneta || <span lang="en" dir="ltr" class="mw-content-ltr">grand-parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] f9kahjz3wxzc6sv0cklnbbfc6eoyrow 8364583 8364581 2026-05-03T17:04:47Z Nerun 899342 Created page with "avó" 8364583 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || bisneta || avó || <span lang="en" dir="ltr" class="mw-content-ltr">parent</span> || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] suxma0dc06djh31a8dzsvif7brh26uf 8364585 8364583 2026-05-03T17:04:54Z Nerun 899342 Created page with "mãe" 8364585 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || bisneta || avó || mãe || <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] m3db0cdad95uq8bhq1ii902hrw0tkct 8364587 8364585 2026-05-03T17:04:57Z Nerun 899342 Created page with "'''PÁGINA ATUAL'''" 8364587 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | pai || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || bisneta || avó || mãe || '''PÁGINA ATUAL''' |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] jn7zxz65zqrov0mrm0pjn54702cayrb 8364589 8364587 2026-05-03T17:05:13Z Nerun 899342 8364589 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">child page</span> * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | mãe || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || bisneta || avó || mãe || '''PÁGINA ATUAL''' |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] 48a6w7vw4e5t3n56bv6qlaa854pjka6 8364591 8364589 2026-05-03T17:05:39Z Nerun 899342 Created page with "filha" 8364591 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – filha * [[Help:Subpages/subpage/sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | mãe || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || bisneta || avó || mãe || '''PÁGINA ATUAL''' |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] 42rg77svmouwbs6034ese6byqvxw29t 8364593 8364591 2026-05-03T17:05:48Z Nerun 899342 Created page with "página neta" 8364593 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – filha * [[Help:Subpages/subpage/sub-subpage]] – página neta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | mãe || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || bisneta || avó || mãe || '''PÁGINA ATUAL''' |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] 4f3q1lzwt08esab42fkvvh2tmzswbpy 8364595 8364593 2026-05-03T17:05:58Z Nerun 899342 8364595 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – página filha * [[Help:Subpages/subpage/sub-subpage]] – página neta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild page</span> * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | mãe || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || bisneta || avó || mãe || '''PÁGINA ATUAL''' |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] 7c2y9w6idqoyh69z24fch13j2p4rndg 8364597 8364595 2026-05-03T17:06:10Z Nerun 899342 Created page with "página bisneta" 8364597 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – página filha * [[Help:Subpages/subpage/sub-subpage]] – página neta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – página bisneta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild page</span> {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | mãe || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || bisneta || avó || mãe || '''PÁGINA ATUAL''' |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] flge7ywesvvj5n8e1noxxxoo2a67dkz 8364599 8364597 2026-05-03T17:06:17Z Nerun 899342 Created page with "página tataraneta" 8364599 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – página filha * [[Help:Subpages/subpage/sub-subpage]] – página neta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – página bisneta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – página tataraneta {| class="wikitable" |+ <span lang="en" dir="ltr" class="mw-content-ltr">Page relationships</span> |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | mãe || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || bisneta || avó || mãe || '''PÁGINA ATUAL''' |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] 4fqu2ts9irx6rg7xdezwsx6l7satkd1 8364601 8364599 2026-05-03T17:06:27Z Nerun 899342 Created page with "Relações entre páginas" 8364601 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – página filha * [[Help:Subpages/subpage/sub-subpage]] – página neta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – página bisneta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – página tataraneta {| class="wikitable" |+ Relações entre páginas |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''CURRENT PAGE'''</span> || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | mãe || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || bisneta || avó || mãe || '''PÁGINA ATUAL''' |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] ndyjmoeazxm3fpay2awi5knbicoxlsf 8364603 8364601 2026-05-03T17:06:30Z Nerun 899342 Created page with "'''PÁGINA ATUAL'''" 8364603 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – página filha * [[Help:Subpages/subpage/sub-subpage]] – página neta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – página bisneta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – página tataraneta {| class="wikitable" |+ Relações entre páginas |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | '''PÁGINA ATUAL''' || <span lang="en" dir="ltr" class="mw-content-ltr">child</span> || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | mãe || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || bisneta || avó || mãe || '''PÁGINA ATUAL''' |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] fzlki706usg25qdsodux2m88r4dp93m 8364605 8364603 2026-05-03T17:06:34Z Nerun 899342 Created page with "filha" 8364605 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – página filha * [[Help:Subpages/subpage/sub-subpage]] – página neta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – página bisneta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – página tataraneta {| class="wikitable" |+ Relações entre páginas |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | '''PÁGINA ATUAL''' || filha || <span lang="en" dir="ltr" class="mw-content-ltr">grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | mãe || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || bisneta || avó || mãe || '''PÁGINA ATUAL''' |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] 2h7iti2vtwa7fq612lioajuyr0yh5wm 8364607 8364605 2026-05-03T17:06:37Z Nerun 899342 Created page with "neta" 8364607 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – página filha * [[Help:Subpages/subpage/sub-subpage]] – página neta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – página bisneta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – página tataraneta {| class="wikitable" |+ Relações entre páginas |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | '''PÁGINA ATUAL''' || filha || neta || <span lang="en" dir="ltr" class="mw-content-ltr">great grandchild</span> || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | mãe || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || bisneta || avó || mãe || '''PÁGINA ATUAL''' |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] gxas9022ikya4b2e0r8uzehgvagqar4 8364609 8364607 2026-05-03T17:06:41Z Nerun 899342 Created page with "bisneta" 8364609 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – página filha * [[Help:Subpages/subpage/sub-subpage]] – página neta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – página bisneta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – página tataraneta {| class="wikitable" |+ Relações entre páginas |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | '''PÁGINA ATUAL''' || filha || neta || bisneta || <span lang="en" dir="ltr" class="mw-content-ltr">great great grandchild</span> |- | mãe || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || bisneta || avó || mãe || '''PÁGINA ATUAL''' |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] af5tbqsn3lnfu31niug5c2nhtfc1j7d 8364611 8364609 2026-05-03T17:06:45Z Nerun 899342 Created page with "tataraneta" 8364611 wikitext text/x-wiki <languages/> {{PD Help Page}} '''Subpáginas''' introduzem alguma organização hierárquica em páginas wiki, com os níveis da hierarquia separados por barras (<code>/</code>). <span id="Where_it_works"></span> == Onde funcionam == Por padrão, o recurso de subpágina do MediaWiki está desligado no espaço nominal principal, mas pode ser usado em [[Special:MyLanguage/Help:Talk pages|páginas de discussão]] e em [[Special:MyLanguage/Help:User page|páginas de usuário]]. Veja {{ll|Help:Namespaces}} para uma descrição dos espaços nominais e [[Special:MyLanguage/Manual:$wgNamespacesWithSubpages#Enabling-for-a-namespace|$wgNamespacesWithSubpages]] para aprender como modificar esse comportamento padrão. Nos espaços nominais onde o recurso está desligado, quaisquer barras (<code>/</code>) dentro de um nome de página são simplesmente parte do nome da página e não fazem nada especial. Quando subpáginas estão ativadas em um espaço nominal, uma barra no título de uma página sempre faz com que a página seja uma subpágina. Se isso não for desejado, [[#Bypass subpages using alternative characters|ignore subpáginas usando caracteres alternativos]]. <span id="How_it_works"></span> == Como funcionam == Usar barras (/) dentro do nome de uma página quebra-a em página raiz e subpáginas de forma recursiva, p. ex.: * [[Help:Subpages]] – esta página * [[Help:Subpages/subpage]] – página filha * [[Help:Subpages/subpage/sub-subpage]] – página neta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage]] – página bisneta * [[Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage]] – página tataraneta {| class="wikitable" |+ Relações entre páginas |- ! [[Special:MyLanguage/Help:Subpages|Help:Subpages]] || [[Special:MyLanguage/Help:Subpages/subpage|/sub]] || /sub/sub<sub>i</sub> || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage|/sub/sub<sub>1</sub>/sub]] || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage/sub-sub-subpage/sub-sub-sub-subpage|/sub/sub<sub>1</sub>/sub/sub]] |- | '''PÁGINA ATUAL''' || filha || neta || bisneta || tataraneta |- | mãe || '''PÁGINA ATUAL''' || [[Special:MyLanguage/Help:Subpages/subpage/sub-subpage|filha 1]] || neta || bisneta |- | || || [[Special:MyLanguage/Help:Subpages/subpage2|filha 2]] || neta || bisneta |- | avó || mãe || '''PÁGINA ATUAL''' || filha || neta |- | bisneta || avó || mãe || '''PÁGINA ATUAL''' || filha |- | tataraneta || bisneta || avó || mãe || '''PÁGINA ATUAL''' |} É possível criar ligações diretamente para a subpágina de qualquer página usando a notação de ''colchetes duplos'' normal, fornecendo o nome completo — incluindo a(s) barra(s) e o(s) nome(s) individual(is) da(s) subpágina(s). Também há como criar ligações de uma página para uma das ''suas próprias'' subpáginas usando certos atalhos, os quais estão descritos em [[Special:MyLanguage/Help:Links#Internal|Ajuda:Ligações]]. Existem [[Special:MyLanguage/Help:Magic words#Page names|palavras mágicas]] dividir o nome de uma subpágina, tais como <code><nowiki>{{BASEPAGENAME}}</nowiki></code> e <code><nowiki>{{SUBPAGENAME}}</nowiki></code>, e a parser function <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> para um controle mais preciso. Note que a parte de nomes de página depois de uma barra diferencia maiúsculas de minúsculas, '''incluindo a primeira letra'''. Os [[:pt:Navegação estrutural|links breadcrumb]] aparecerá automaticamente no topo da subpágina, com links para cada página-raiz que existe. Esses links não aparecem, no entanto, se as páginas-raiz ainda não foram criadas ou se o recurso subpágina está desligado. Como esses links de navegação automática não estão no conteúdo da página, eles não colocam páginas-raiz nas seções [[Special:MyLanguage/Help:What links here|''Afluentes'']] e [[Special:MyLanguage/Help:Related changes|''Alterações relacionadas'']]. Se você [[Special:MyLanguage/Help:Moving a page|mover (renomear)]] uma página pai, será exibida uma lista das subpáginas e usuários com o [[Special:MyLanguage/Help:User rights|direito do usuário]] ''move-subpages'' terá a opção de mover automaticamente as subpáginas (até 100). <span id="Use_of_subpages"></span> == Uso de subpáginas == Existem vários usos para o recurso de subpáginas. Alguns dos usos típicos de subpáginas são: * criar arquivos das discussões antigas em uma [[Special:MyLanguage/Help:Talk pages|página de discussão]], * criar espaços de edição de anotações em uma [[Special:MyLanguage/Help:User page|página de usuário]], * criar outras versões linguísticas de um documento em wikis multilíngues. * para criar subpáginas de uma predefinição para sua documentação, para sua sandbox de código, para seus casos de teste e para qualquer código de submodelo Subpáginas são úteis para organizar informações de forma hierárquica. Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. Você também pode organizar as páginas com o recurso de [[Special:MyLanguage/Help:Category|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. <span id="Displaying_subpages"></span> == Exibindo subpáginas == Subpáginas podem ser listadas muito claramente ao transcluir a página especial [[Special:PrefixIndex]], desta maneira: <pre> {{Special:PrefixIndex/Help:Subpages/}} </pre> que produz o seguinte resultado: {{Special:PrefixIndex/Help:Subpages/}} Uma vez que a [[Special:MyLanguage/Help:Magic words|palavra mágica]] <code><nowiki>{{FULLPAGENAME}}</nowiki></code> gera a página atual, a marcação wiki geral para mostrar todas as subpáginas da página atual é <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/}}</nowiki></code>. Você pode passar parâmetros para isso, por exemplo, <code><nowiki>{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}</nowiki></code> A [[Special:MyLanguage/Category:Subpage extensions|extensões de subpáginas]], assim como a extensão {{ll|Extension:SubPageList}} ou {{ll|Extension:SubpageNavigation}}, permitem a você personalizar a exibição de subpáginas. <span id="Bypass_subpages_using_alternative_characters"></span> == Ignorar subpáginas usando caracteres alternativos == Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. A barra invertida (<code>\</code>) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[wikt:/|barra]] ou barra invertida (U+002F) pode ser usado em vez disso, como a barra invertida "[[wikt:⧸|barra invertida grande]]" (U+29F8), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[wikt:⁄|barra fracionária]] (U+2044), que resulta em Foo⁄bar. Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: # Pessoas sem as fontes necessárias não serão capazes de visualizar o caractere corretamente; # Redirecionamentos a partir do título com uma barra devem ser criados, para que a lincagem e a busca funcionem corretamente. # As [[Special:MyLanguage/Manual:Namespace#Subject-and-talk|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. O risco é que a semelhança visual faça com que isso passe despercebido aos editores humanos. <span id="See_also"></span> == Ver também == * {{ll|Manual:$wgNamespacesWithSubpages}} * {{ll|Help:Links#Subpage feature|2=Help:Links#Subpage feature}} * {{ll|Help:Variables#Page-names}} * [[Special:PrefixIndex]] – Fornece uma lista de subpáginas. * {{ll|Category:Subpage extensions}} * [[w:Subpages]] [[Category:Help{{#translation:}}|{{PAGENAME}}]] [[Category:Subpage{{#translation:}}|{{PAGENAME}}]] sq5ncgb7womms7003iz25rc0he7v07u Gerrit/New repositories/Requests 0 84638 8365094 8360842 2026-05-04T09:50:44Z QChrisNonWMF 2122778 /* mediawiki/extensions/RecentPageStats */ Mark done 8365094 wikitext text/x-wiki {{Archive box| [[/Archive/2012|2012]] &middot; [[/Archive/2013|2013]] &middot; [[/Archive/2014|2014]] &middot; [[/Archive/2015|2015]] &middot; [[/Archive/2016|2016]] &middot; [[/Archive/2017|2017]] &middot; [[/Archive/2018|2018]] &middot; [[/Archive/2019|2019]] &middot; [[/Archive/2020|2020]] &middot; [[/Archive/2021|2021]] &middot; [[/Archive/2022|2022]] &middot; [[/Archive/2023|2023]] &middot; [[/Archive/2024|2024]] &middot; [[/Archive/2025|2025]] }} [[Category:Git]] <div style="padding:15px; background:var(--background-color-content-added, #eeeeff); display:flow-root; margin:15px 0;" class="plainlinks"> [https://www.mediawiki.org/w/index.php?title=Gerrit/New_repositories/Requests&action=submit&preload=Gerrit/New_repositories/Request_preload&editintro=Gerrit/New_repositories/Request_preload_intro&nosummary=true&section=new&veaction=none <span class="mw-ui-button mw-ui-progressive mw-ui-big">Request new repository</span>]</div> {{Gerrit repository request | repository = mediawiki/extensions/ArticleGuidance | developer = ngkountas (Nik Gkountas) | phabricator = Article-Guidance }} <!-- Write any extra comments here, e.g. mention an existing repository you want to import. --> A new repository for the new ArticleGuidance extension. --[[User:NGkountas (WMF)|NGkountas (WMF)]] ([[User talk:NGkountas (WMF)|talk]]) 12:39, 21 January 2026 (UTC) {{done}} Created as [https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/ArticleGuidance mediawiki/extensions/ArticleGuidance] ([https://github.com/wikimedia/mediawiki-extensions-ArticleGuidance GitHub mirror])([https://phabricator.wikimedia.org/diffusion/EAGU/ Phabricator mirror]) --[[User:QChrisNonWMF|QChrisNonWMF]] ([[User talk:QChrisNonWMF|talk]]) 09:19, 24 January 2026 (UTC) {{Gerrit repository request | repository = mediawiki/extensions/Demo | developer = sbisson ([[User:SBisson (WMF)]]) | phabricator = <!-- Phabricator project name if one has already been created, or alternatively see https://www.mediawiki.org/wiki/Phabricator/Creating_and_renaming_projects#Creating_new_projects for requesting new projects --> }} <!-- Write any extra comments here, e.g. mention an existing repository you want to import. --> --[[User:SBisson (WMF)|SBisson (WMF)]] ([[User talk:SBisson (WMF)|talk]]) 16:28, 21 January 2026 (UTC) :{{ping|SBisson (WMF)}} Yay for demos! But as "Demo" on its own sounds very generic, I wondered if users know what to find in that extension? :Is there some specific part this extension wants to demo? And maybe that could guide us on arriving at a more descriptive name to help users find more easily what they are looking for? --[[User:QChrisNonWMF|QChrisNonWMF]] ([[User talk:QChrisNonWMF|talk]]) 09:28, 24 January 2026 (UTC) ::It's meant to be a mostly empty extension that we can submit patches against to deploy on patchdemo to demonstrate any new product ideas. I don't expect any patch to be merged but there can be a large number of WIP patches. I'm open to other name ideas. [[User:SBisson (WMF)|SBisson (WMF)]] ([[User talk:SBisson (WMF)|talk]]) 18:46, 26 January 2026 (UTC) ::: {{ping|SBisson (WMF)}} Is there a Phabricator task for this idea? Sounds like it might be good to discuss first before creating a repo. [[User:Jdforrester (WMF)|Jdforrester (WMF)]] ([[User talk:Jdforrester (WMF)|talk]]) 18:59, 26 January 2026 (UTC) {{Gerrit repository request | repository = mediawiki/extensions/ChatBot | developer = hslater | phabricator = - }} --[[User:Hslater|Hslater]] ([[User talk:Hslater|talk]]) 11:37, 28 January 2026 (UTC) {{ping|Hslater}} Just double-checking: This and ChatIntegration below do not need a BlueSpice prefix. Right? --[[User:QChrisNonWMF|QChrisNonWMF]] ([[User talk:QChrisNonWMF|talk]]) 20:47, 29 January 2026 (UTC) :Correct :) [[User:Hslater|Hslater]] ([[User talk:Hslater|talk]]) 09:39, 30 January 2026 (UTC) {{done}} Created as [https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/ChatBot mediawiki/extensions/ChatBot] ([https://github.com/wikimedia/mediawiki-extensions-ChatBot GitHub mirror])([https://phabricator.wikimedia.org/diffusion/ECTB/ Phabricator mirror]) --[[User:QChrisNonWMF|QChrisNonWMF]] ([[User talk:QChrisNonWMF|talk]]) 12:43, 31 January 2026 (UTC) {{Gerrit repository request | repository = mediawiki/extensions/ChatIntegration | developer = hslater | phabricator = - }} --[[User:Hslater|Hslater]] ([[User talk:Hslater|talk]]) 11:38, 28 January 2026 (UTC) {{done}} Created as [https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/ChatIntegration mediawiki/extensions/ChatIntegration] ([https://github.com/wikimedia/mediawiki-extensions-ChatIntegration GitHub mirror])([https://phabricator.wikimedia.org/diffusion/ECTI/ Phabricator mirror]) --[[User:QChrisNonWMF|QChrisNonWMF]] ([[User talk:QChrisNonWMF|talk]]) 12:47, 31 January 2026 (UTC) :Owner please :) [[User:Hslater|Hslater]] ([[User talk:Hslater|talk]]) 15:23, 2 February 2026 (UTC) :: Argh! :-D {{ping|Hslater}} I'm sorry. Could you please try again? --[[User:QChrisNonWMF|QChrisNonWMF]] ([[User talk:QChrisNonWMF|talk]]) 20:09, 2 February 2026 (UTC) :::Thanx! [[User:Hslater|Hslater]] ([[User talk:Hslater|talk]]) 08:07, 3 February 2026 (UTC) {{Gerrit repository request | repository = operations/slothslos | developer = Tiziano Fogli | phabricator = SRE-SLO }} <!-- Write any extra comments here, e.g. mention an existing repository you want to import. --> --[[User:Tiziano Fogli|Tiziano Fogli]] ([[User talk:Tiziano Fogli|talk]]) 14:38, 3 February 2026 (UTC) {{done}} Created as [https://gerrit.wikimedia.org/r/#/admin/projects/operations/slothslos operations/slothslos] ([https://github.com/wikimedia/operations-slothslos GitHub mirror])([https://phabricator.wikimedia.org/diffusion/OSLT/ Phabricator mirror]) --[[User:QChrisNonWMF|QChrisNonWMF]] ([[User talk:QChrisNonWMF|talk]]) 05:29, 4 February 2026 (UTC) {{Gerrit repository request | repository = mediawiki/extensions/DataMaps | developer = somerandomdeveloper | phabricator = - }} We would like to move our fork of DataMaps from https://github.com/miraheze/DataMaps/ to gerrit, where we plan to continue maintaining it. --[[User:SomeRandomDeveloper|SomeRandomDeveloper]] ([[User talk:SomeRandomDeveloper|talk]]) 14:10, 31 March 2026 (UTC) {{ping|SomeRandomDeveloper}} I see the collaboration between the extension's maintainer and the miraheze repo, so I guess things are fine. But just to avoid doubt: Is there some public statement that the maintainer wants the repo in Gerrit? :: {{ping|QChrisNonWMF}} I confirm that I'm OK with the repository being relocated to Gerrit. [[User:Alex44019|Alex44019]] ([[User talk:Alex44019|talk]]) 01:30, 6 April 2026 (UTC) ::: Thanks! --[[User:QChrisNonWMF|QChrisNonWMF]] ([[User talk:QChrisNonWMF|talk]]) 04:59, 7 April 2026 (UTC) {{done}} Created as [https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/DataMaps mediawiki/extensions/DataMaps] ([https://github.com/wikimedia/mediawiki-extensions-DataMaps GitHub mirror])([https://phabricator.wikimedia.org/diffusion/EDMP/ Phabricator mirror]) --[[User:QChrisNonWMF|QChrisNonWMF]] ([[User talk:QChrisNonWMF|talk]]) 04:59, 7 April 2026 (UTC) The <code>main</code> branch got renamed to <code>master</code>, as the <code>main</code> branch is [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/+/d599decc7a883a5d453056f2a2b1d1411f730596 prohibited for extensions] --[[User:QChrisNonWMF|QChrisNonWMF]] ([[User talk:QChrisNonWMF|talk]]) 05:04, 7 April 2026 (UTC) :Thanks! @[[User:QChrisNonWMF|QChrisNonWMF]] one more thing, could you add me (git@srd.dev / somerandomdeveloper on gerrit) and @[[User:Alex44019|Alex44019]] (rylatgl@gmail.com / alex44019) to the group for the repo: https://gerrit.wikimedia.org/r/admin/groups/1e68ed8600d1e4ea45fa39cf7577aa10b836d15c,members :I have merge rights because I have +2 in mediawiki/*, but I don't think I'm able to give other people merge rights in the repo myself without being a member of the group. [[User:SomeRandomDeveloper|SomeRandomDeveloper]] ([[User talk:SomeRandomDeveloper|talk]]) 12:26, 7 April 2026 (UTC) :: {{ping|SomeRandomDeveloper}} Whoops! My bad. I've now added you and Alex44019. Could you please try again? --[[User:QChrisNonWMF|QChrisNonWMF]] ([[User talk:QChrisNonWMF|talk]]) 19:04, 7 April 2026 (UTC) :::Looks like it worked, thanks! [[User:SomeRandomDeveloper|SomeRandomDeveloper]] ([[User talk:SomeRandomDeveloper|talk]]) 19:21, 7 April 2026 (UTC) {{Gerrit repository request | repository = wikimedia/product-safety-and-integrity/hcaptcha-secure-api-vendor | developer = Kosta Harlan | phabricator = hCaptcha }} <!-- Write any extra comments here, e.g. mention an existing repository you want to import. --> Would like to import contents of https://gitlab.wikimedia.org/repos/product-safety-and-integrity/hcaptcha-secure-api-vendor --[[User:KHarlan (WMF)|KHarlan (WMF)]] ([[User talk:KHarlan (WMF)|talk]]) 07:11, 27 April 2026 (UTC) Briefly talked with [[User:KHarlan (WMF)|KHarlan (WMF)]] in IRC and since there seem to benefits with keeping it in GitLab, this is on hold until the decision is made whether the repo should move to Gerrit --[[User:QChrisNonWMF|QChrisNonWMF]] ([[User talk:QChrisNonWMF|talk]]) 14:07, 28 April 2026 (UTC) {{Gerrit repository request | repository = mediawiki/extensions/RecentPageStats | developer = Jnanaranjan sahu | phabricator = <!-- Phabricator project name if one has already been created, or alternatively see https://www.mediawiki.org/wiki/Phabricator/Creating_and_renaming_projects#Creating_new_projects for requesting new projects --> }} <!-- Write any extra comments here, e.g. mention an existing repository you want to import. --> I would like to create a repo for [[Extension:RecentPageStats]] --[[User:Jnanaranjan sahu|Jnanaranjan sahu]] ([[User talk:Jnanaranjan sahu|talk]]) 11:23, 30 April 2026 (UTC) {{done}} Created as [https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/RecentPageStats mediawiki/extensions/RecentPageStats] ([https://github.com/wikimedia/mediawiki-extensions-RecentPageStats GitHub mirror])([https://phabricator.wikimedia.org/diffusion/ERPA/ Phabricator mirror]) The <code>main</code> branch got renamed to <code>master</code>, as the <code>main</code> branch is [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/+/d599decc7a883a5d453056f2a2b1d1411f730596 prohibited for extensions] --[[User:QChrisNonWMF|QChrisNonWMF]] ([[User talk:QChrisNonWMF|talk]]) 09:50, 4 May 2026 (UTC) o7hkusi9ilrz91caqbxow05ipnr9zwv Help:Extension:Translate/Components 12 98270 8364819 8112746 2026-05-04T02:24:05Z Shirayuki 472859 make untranslatable :( 8364819 wikitext text/x-wiki <languages/> {{Extension-Translate}} <translate><!--T:1--> Translate extension is extensible in many ways.</translate> <translate><!--T:2--> The most likely ways to extend Translate is to add support for new file formats (link to section) or new message groups (link to section).</translate> <translate><!--T:3--> Sometimes it is also useful to write a new message checks (link to section) or to extend Translate via hooks (link to section).</translate> <translate><!--T:4--> Sometimes you might get along only by using the existing {{<tvar name=1>ll|Help:Extension:Translate/API#Web-API</tvar>|web API}}.</translate> <translate><!--T:5--> In addition to the concepts already mentioned, there are many more important concepts and classes in Translate that are useful to understand when hacking Translate.</translate> <translate><!--T:6--> This pages aims to comprehensively detail all components of Translate.</translate> <translate> == Primary extensible components == <!--T:7--> === WebAPI === <!--T:8--> <!--T:9--> * In-depth documentation about [[<tvar name=1>Special:MyLanguage/Help:Extension:Translate/API</tvar>|API]] </translate> <translate><!--T:10--> In addition to hooks and interfaces that can only be used from PHP code, the WebAPI provides access to many message group and translating related information and actions.</translate> <translate><!--T:11--> It is based on the [[<tvar name=1>Special:MyLanguage/API:Main page</tvar>|MediaWiki API framework]], supporting many output formats like json and xml.</translate> <translate> === File format support (FFS) === <!--T:12--> </translate> * ''<translate><!--T:13--> In-depth documentation about [[<tvar name=1>Special:MyLanguage/Help:Extension:Translate/File format support</tvar>|file format support]]</translate>'' <translate><!--T:15--> The Translate extension supports translating of non-wiki content like software interface messages via File format support (FFS) classes.</translate> <translate><!--T:16--> These classes implement the FFS interface and abstract away parsing and generating of file contents.</translate> <translate><!--T:17--> The FFS classes are used by <tvar name=1>FileBasedMessageGroup</tvar> class via the [[<tvar name=2>Special:MyLanguage/Help:Extension:Translate/Group configuration</tvar>|YAML configuration files]].</translate> <translate> === Message groups === <!--T:18--> </translate> * ''<translate><!--T:102--> In-depth documentation about {{<tvar name=1>ll|Help:Extension:Translate/Message groups</tvar>|message groups}}</translate>'' <translate><!--T:30--> Message groups bring together a collection of messages.</translate> <translate><!--T:31--> They come in various types: translatable pages, SVG files or software interface messages stored in various file formats.</translate> <translate><!--T:32--> Each message group instance has a unique identifier, name and description.</translate> <translate><!--T:103--> In the code message groups are primarily referenced by their identifier, while the <tvar name=1><code>MessageGroups</code></tvar> class can be used to get the instances for a given ID.</translate> <translate><!--T:33--> Message groups can also control many translation process related actions like allowed translation languages and the message group workflow states.</translate> <translate><!--T:34--> Usually these behaviors fallback to the global defaults.</translate> <translate> <!--T:121--> The two primary ways to register message groups to Translate are the <tvar name=1>{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}}</tvar> hook and {{<tvar name=2>ll|Help:Extension:Translate/Group configuration example</tvar>|YAML configuration}}. === Translation aids (helpers) === <!--T:19--> </translate> * ''<translate><!--T:122--> In-depth documentation about {{<tvar name=1>ll|Help:Extension:Translate/Translation aids</tvar>|translation aids}}</translate>'' <translate><!--T:35--> Translation aids are little modules that provide helpful and necessary information for the translator when translating.</translate> <translate><!--T:36--> Different aids can provide suggestions from translation memory and machine translation, documentation about the message or even such a basic thing as the message definition – the text that needs to be translated.</translate> <translate><!--T:37--> Translate comes with many aid classes.</translate> <translate><!--T:38--> Currently there is no hook to add new classes.</translate> <translate><!--T:104--> Each class that extends the <tvar name=2>TranslationAid</tvar> class only needs to implement one method called <tvar name=1>getData</tvar>.</translate> <translate><!--T:105--> It should return the information in structured format (nested arrays), which is then exposed via <tvar name=1>ApiQueryTranslationAids</tvar> Web API module.</translate> <translate><!--T:39--> In addition to the aid class, changes are needed to actually use the provided data in the translation editor(s).</translate> <translate><!--T:40--> One special case of translation aids are machine translation services.</translate> <translate><!--T:41--> See the next section.</translate> <translate> === Web services === <!--T:20--> </translate> <translate><!--T:123--> Adding more machine translation services can easily be done by extending the <tvar name=1><code>TranslationWebService</code></tvar> class.</translate> <translate><!--T:42--> See the webservices subdirectory for examples.</translate> <translate><!--T:43--> You will need some basic information to implement such a class:</translate> * <translate><!--T:44--> URL for the service</translate> * <translate><!--T:45--> What language pairs are supported</translate> * <translate><!--T:46--> Whether they use language codes that differ from the codes used in MediaWiki</translate> * <translate><!--T:47--> Whether the service needs an API key</translate> <translate><!--T:124--> When you have this information, it is straightforward to write the <tvar name=1><code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code></tvar> methods.</translate> <translate><!--T:125--> You should use the <tvar name=1>TranslationWebServiceException</tvar> to signal errors.</translate> <translate><!--T:48--> The errors are automatically logged and tracked, and if the service goes down, it will automatically be suspended to avoid unnecessary requests to it.</translate> <translate><!--T:126--> The suggestions will automatically be displayed in the translation editor via the <tvar name=1>MachineTranslationAid</tvar> class and the <tvar name=2>ApiQueryTranslationAids</tvar> WebAPI module.</translate> <translate><!--T:106--> See also <tvar name=1>$wgTranslateTranslationServices</tvar> to see how those services are registered.</translate> <translate> === Message checkers === <!--T:21--> </translate> * ''{{ll|Help:Extension:Translate/Group configuration|2=<translate><!--T:127--> How to define checkers for file based message groups</translate>}}'' <translate><!--T:49--> We use computers to catch simple errors in translations, like unbalanced parenthesis or failing to use a variable placeholder.</translate> <translate><!--T:50--> These checkers can emit warnings that are displayed in the translation editor (constantly updating).</translate> <translate><!--T:51--> Any warning present in saved translation will also mark the translation as outdated (fuzzy in jargon).</translate> <translate><!--T:52--> Each message group determines which checks it uses.</translate> <translate> == Other core components == <!--T:22--> === Message collection === <!--T:23--> </translate> <translate><!--T:53--> Message collection provides access to the list of messages for a message group.</translate> <translate><!--T:54--> It is used to load a set of languages for certain group in a certain language.</translate> <translate><!--T:55--> It provides paging and filtering functionality.</translate> <translate><!--T:56--> There is currently a limitation that all messages in a collection must be in the same namespace.</translate> <translate><!--T:57--> This prevents the creation of aggregate groups that include groups which have messages in different namespaces.</translate> <translate> <!--T:58--> Here is short a example of how to use message collection to load all Finnish translations of group ''core'' and print the first ten of them: </translate> <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <translate> === Message === <!--T:24--> == Utility classes == <!--T:25--> === Font finder === <!--T:26--> </translate> <translate><!--T:59--> When rendering bitmap graphics, suitable fonts are needed for each language or script.</translate> <translate><!--T:107--> To solve this problem, the <tvar name=1>FCFontFinder</tvar> class was written.</translate> <translate><!--T:108--> It uses the <tvar name=1><code>fc-match</code></tvar> command of the package <tvar name=2><code>fontconfig</code></tvar> (so this doesn't work on Windows) to find a suitable font.</translate> <translate><!--T:60--> Many additional fonts should be installed on the server to make this useful.</translate> <translate><!--T:61--> It can either return a path to a font file or the name of the font, whichever is more suitable.</translate> <translate> === Message group cache === <!--T:27--> </translate> <translate><!--T:62--> The messages of file-based message groups are stored in CDB files.</translate> <translate><!--T:63--> Each language of each group has its own CDB cache file.</translate> <translate><!--T:64--> The reason for cache files are twofold.</translate> <translate><!--T:65--> First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</translate> <translate><!--T:66--> For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</translate> <translate><!--T:67--> The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</translate> <translate><!--T:68--> Having a snapshot of the state of translations in files and wiki (hopefully consistent at that point) allows us to automatically deduct whether something has been changed in the wiki or externally and make intelligent choices, leaving only real conflicts (messages changed both externally and on the wiki since last snapshot) to be resolved by the translation administrator.</translate> <translate> === Message group utilities === <!--T:28--> === Message index === <!--T:29--> </translate> <translate><!--T:69--> Message index is a reverse map of all known messages.</translate> <translate><!--T:109--> It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</translate> <translate><!--T:70--> It needs to be fast for single and multiple message key lookups.</translate> <translate><!--T:71--> Multiple different backends are implemented, with different trade-offs.</translate> * <translate><!--T:110--> Serialized file is fast to parse, but don't provide random access and is very memory inefficient when the number of keys grow.</translate> * <translate><!--T:111--> CDB file takes more disk space, but provides random access and reasonably fast lookups, while loading everything into memory is slower.</translate> * <translate><!--T:112--> Database backend provides efficient random access and full load with the expense of little slower individual lookups.</translate> <translate><!--T:113--> It also doesn't need to write to any files avoiding any permission problems.</translate> * <translate><!--T:114--> Also memory backend (memcached, apc) is provided, which could be useful alternatives to database backend in multiple server setups to reduce database contention.</translate> <translate><!--T:72--> Message index does not support incremental rebuilds.</translate> <translate><!--T:73--> Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</translate> <translate><!--T:74--> Depending on the message group, this might involve parsing files or doing database queries and loading the definitions, which can take a lot of memory.</translate> <translate><!--T:75--> The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</translate> <translate><!--T:76--> As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</translate> <translate> === Message table === <!--T:77--> </translate> {{todo}} <translate> === Metadata table === <!--T:78--> </translate> {{todo}} <translate> === Revtag === <!--T:79--> </translate> {{todo}} <translate> === Stats code === <!--T:80--> </translate> {{todo}} <translate> === String matcher/mangler === <!--T:81--> </translate> {{todo}} <translate> === Ttmserver (translation memory) === <!--T:82--> </translate> * ''<translate><!--T:128--> In-depth documentation at {{<tvar name=1>ll|Help:Extension:Translate/Translation_memories</tvar>|Translation memories}}.</translate>'' * ''<translate><!--T:115--> Blog post of history of this feature at [<tvar name=url>http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/</tvar> Niklas' blog].</translate>'' <translate><!--T:116--> Ttmserver is the name of translation memory interface.</translate> <translate><!--T:117--> It supports multiple backends for inserting and querying translation suggestions.</translate> <translate><!--T:118--> The code is located under <tvar name=1><code>ttmserver</code></tvar> directory.</translate> <translate> === Misc stuff: RC integration, preferences, toolbox, jobs === <!--T:83--> </translate> {{todo}} <translate> == Repository layout == <!--T:84--> <!--T:85--> Files in the root of the repository include: </translate> * <translate><!--T:119--> Standard MediaWiki extensions files like <tvar name=1><code>Translate.php</code></tvar>, translations and some documentation files like <tvar name=2><code>hooks.txt</code></tvar> and <tvar name=3><code>README</code></tvar> which includes change notes.</translate> * <translate><!--T:120--> Major translate classes like <tvar name=1><code>MessageCollection</code></tvar> and <tvar name=2><code>Message</code></tvar> and some misc utilities not yet moved under utils.</translate> <translate><!--T:86--> Rest of the code is under subdirectories.</translate> <translate><!--T:87--> Major parts have their own subdirectories each:</translate> * <code>api</code> – <translate><!--T:88--> for WebAPI code</translate> * <code>ffs</code> – <translate><!--T:89--> for file format support code</translate> * <code>messagegroups</code> – <translate><!--T:90--> for message groups</translate> * <code>scripts</code> – <translate><!--T:91--> for command line scripts</translate> * <code>tag</code> – <translate><!--T:92--> for page translation code</translate> * <code>ttmserver</code> – <translate><!--T:93--> for translation memory code</translate> * <code>specials</code> – <translate><!--T:94--> for all special pages</translate> * <code>tests</code> – <translate><!--T:95--> for all PHP unit tests</translate> <translate><!--T:96--> Most of the code is under utils.</translate> <translate><!--T:97--> Some additional folders for non-code:</translate> * <code>data</code> – <translate><!--T:98--> for miscellaneous data files</translate> * <code>libs</code> – <translate><!--T:99--> for bundled library dependencies</translate> * <code>resources</code> – <translate><!--T:100--> for all css, scripts and images</translate> * <code>sql</code> – <translate><!--T:101--> for all SQL table definitions</translate> [[Category:Extension:Translate{{#translation:}}]] fs32pkwxfb998iejxcd4wvoxc2i9wpp Template:Update/ja 10 125487 8364325 8364244 2026-05-03T12:47:05Z FuzzyBot 451990 Updating to match new version of source page 8364325 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |このページの一部 ({{{part|{{{1|}}}}}} 関連) の'''事実の正確性'''は、'''情報が古くなったことにより損なわれている可能性があります'''。 |このページの一部 ({{{part|{{{1|}}}}}} 関連) は直近の情報を'''反映していません'''。}} |{{#if:{{{inaccurate|}}} |このページの'''事実の正確性'''は、'''情報が古くなったことにより損なわれている可能性があります'''。 |このページは直近の情報を'''反映していません'''。}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|MediaWiki の古いバージョン用に記述されたため、最新バージョンには適用できない場合があります。}} このページを確認したり更新したりして、その内容が適切だと判断した場合は、このお知らせを除去してください。 {{#ifexist: {{TALKPAGENAME}} |&#32;これについて[[{{TALKPAGENAME}}|議論のページ]]で取り上げている場合があります }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>最終更新: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= このテンプレートの別名: * {{tlx|outdated}} <span id="Examples"></span> == 例 == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == 関連項目 == * {{tl|historical}} == TemplateData == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> cyim4mikjz9o1gb12ebongbynkrrop0 Help:Extension:ParserFunctions/ja 12 140499 8365021 8353937 2026-05-04T06:20:50Z FuzzyBot 451990 Updating to match new version of source page 8365021 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} {{ll|Extension:ParserFunctions|nsp=0}} 拡張機能は、MediaWiki コアに既に存在するものを補完する追加の[[Special:MyLanguage/Parser functions|パーサー関数]]を提供します。 ({{ll|Help:Magic words#Parser functions}}を参照。) (文字列処理のために追加のパーサー関数を提供するように設定できる''かもしれません''。ここでいう文字列関数の説明文書は{{ll|Extension:ParserFunctions/String functions|こちら}}を参照してください。) この拡張機能が提供するすべてのパーサー関数は以下の形式です: :<code><nowiki>{{</nowiki>'''#関数名''': ''引数 1'' | ''引数 2'' | ''引数 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=ここで言及していないほかの複数の演算子を含め、評価器の機能細部に関する詳細なマニュアル|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | 種類 ! {{hl1}} | 演算子 |- | {{hl2}} | グループ化 (括弧) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | 数値 | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | 二項演算子 <code>'''e'''</code> &nbsp; 単項 <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | 単項 | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | 二項 | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | 四捨五入 | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | 論理 | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} この関数は、数式を計算してその計算結果を返します。 この関数は<code>mw.ext.ParserFunctions.expr</code> 関数を介して {{ll|Extension:Scribunto|nsp=0}} でも使えます。 :<code><nowiki>{{#expr:</nowiki> ''数式'' <nowiki>}}</nowiki></code> 基本の例 :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' 表の右欄は使用できる演算子で、上ほど優先順位が高いものです。各演算子の機能の詳細は計算のヘルプ {{ll|Manual:Expr parser function syntax}} を参照してください。 出力結果の精度と形式には幅があり、ウィキを実行するサーバーのOSバージョン、サイト表示言語の数値形式の影響を受けます。 [[:ja:ブール代数|ブール代数]]を使用して評価する際、値がゼロなら {{phpi|false}}、非ゼロなら正の数でも負の数でも {{phpi|true}} と評価されます: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' 空の入力式は空の文字列を返します。無効な式はいくつかのエラー メッセージのうちのいずれかを返します。このエラーは <code>[[##iferror|#iferror]]</code> 関数を使用して捕捉できます: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' 数値の前後の加算および減算オペランドの順序は意味があり、誤った入力を持つオペランドとしてではなく、正または負の値として扱われる場合があります。 :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' メモ: マジックワードの出力を使用する場合は、コンマを削除して数字を翻訳するために、それらをraw形式にする必要があることに注意してください。 たとえば、<nowiki>{{NUMBEROFUSERS}}</nowiki> は {{NUMBEROFUSERS}} になりますが、{{formatnum:{{NUMBEROFUSERS}}|R}} が必要です。これは <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code> を使用して取得できます。 これは、数字が翻訳される一部の言語では特に重要です。 たとえば、ベンガル語では、<nowiki>{{NUMBEROFUSERS}}</nowiki> は ৩০,০৬১ を生成します。 :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=演算子 <code>mod</code> は、第 2 引数の値によっては誤った結果を返す場合があります: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (空の文字列を返しますが、123 を返すべきです)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=日付に基づいて計算を行う場合(たとえば、現在の日付と時刻が他の日付と時刻より後かどうかをテストする場合)、最初に<nowiki>{{#time: xNU }}</nowiki>を使用して時刻を1970年1月1日(UTC)以降の秒数に変換し、次に単純に加算して日付を数値として減算します。}} <span id="Rounding"></span> === 四捨五入機能 === 左側の数字を[https://php.net/function.round 四捨五入]して 1/10 の倍数に切り上げ、べき指数は右側に与えられた数の小数点2ケタ目以下を切り上げた値に等しくなります。 切り上げや切り捨てを行うには、それぞれ単項の<code>ceil</code>と<code>floor</code>を使用してください。 {| class="wikitable" ! {{hl1}} | テスト ケース ! {{hl1}} | 結果 ! {{hl1}} | 四捨五入の手法 |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || 最終桁が 5 未満であるため、切り上げはされません (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || 最終桁が 5 以上であるため、切り上げされます (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || この場合も、結果は最後の桁で切り上げられ、追加の切り上げが行われます。 (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || 負の値は小数点の左側に丸められるため、100に最も近い値に丸められます。 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || 正の値は小数点の右側に丸められるため、最も近い100番目に丸められます |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || round の右の値の小数点以下は、丸めの結果には影響しません |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || 小数点以下の切り捨て |- ! colspan=3 {{hl2}} | 最も近い整数への丸め |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || ''最も近い''整数への切り捨てで 0 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || 最も近い整数への切り上げで 1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || 最も近い整数への切り上げで 1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || 最も近い整数への切り上げで 0 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || 最も近い整数への切り捨てで -1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || 最も近い整数への切り捨てで -1 |- ! colspan=3 {{hl2}} | ''ceill'' や ''floor'' による切り上げや切り捨て |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || 次に大きい整数まで |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || 次の「小さい」整数、つまりゼロまで |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || 最も近い整数への切り上げで 0 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || 負の整数である次の小さい整数まで |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || 1が既に整数であるため、丸めは行なわれません<br />{{Warning|1=あなたの予想とは異なり、'''ceil('''1/3''')'''ではなく'''(ceil''' 1''')'''/3と解釈される}} |- ! colspan=3 {{hl2}} | 大きな数字を概数に変える |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | 非常に桁の大きな数字を丸めようとすると、無限大に近づきます。 したがって、無限大を備えない元の値を答えとして返します。 |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | 上記と同じ。 |} <span id="Strings"></span> === 文字列 === 式は数値のような値でのみ機能し、文字列や文字を比較することはできません。代わりに[[#ifeq]]を使用できます。 :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == この関数はテスト文字列を評価し、それが空であるかどうかを判定します。空白のみを含むテスト文字列は空であると見做されます。 :<syntaxhighlight lang="wikitext" inline>{{#if: テスト文字列 | テスト文字列が空ではない場合の値 | テスト文字列が空 (または空白のみ) の場合の値}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: パラメーター 1 | パラメーター 2 | パラメーター 3 }}</syntaxhighlight> この関数は、初めに最初の引数が空でないか確かめます。最初の引数が空でない場合、2 番目の引数を表示します。最初の引数が空または空白文字(空白、改行等)のみを含む場合、3 番目の引数を表示します。 :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' テスト文字列は常に純粋なテキストとして評価されます。そのため数式は評価されません ([[##ifexpr|#ifexpr]] を参照): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' 最後の引数 (false) は省略可能です: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' 関数はネストできます。これを行うには、囲んでいる <code>#if</code> 関数のパラメーターの代わりに、内部の <code>#if</code> 関数を完全な形式でネストします。ウィキやメモリ制限によって異なりますが、最大7レベルのネストが可能です。 <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:テスト文字列 | テスト文字列が空ではない場合の値 |{{#if:テスト文字列 |テスト文字列が空ではない場合の値 |テスト文字列が空 (または空白のみ) の場合の値 }} }} </syntaxhighlight> <code>#if</code> 文において引数をテスト文字列として用いることも可能です。 変数名の後には <code>|</code>(パイプ記号)を追加する必要があります。 (そのため、パラメーターに値がない場合は、文字列 "<code><nowiki>{{{1}}}</nowiki></code>"ではなく空の文字列に評価されます。) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=変数1にテキストを入力しました |2=変数1にテキストがありません }} このパーサー関数の他の例については {{ll|Help:Parser functions in templates}} を参照してください。 {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == このパーサー関数は、2つの入力文字列を比較し、それらが同一であるかどうかを判断し、結果に基づいて2つの文字列のうちの1つを返します。 さらに比較と出力文字列が必要な場合は、<code>#switch</code>の使用を検討してください。 :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> 両方の文字列が有効な数値である場合、文字列は数値的に比較されます。 :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' それ以外は文字列として比較します。その場合は大文字小文字を識別します。 :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(引用符なしで、上記の同様の例と比較してください)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(前述した同様の例と対比してみるには、<code>[[##expr|#expr]]</code> は有効な特定の数値を先に返します)'' 実用的な例として、既存の{{ll|Help:Templates|テンプレート}} <code>Template:Timer</code> をパーサーを使用して、短い時間と長い時間の2つの標準時間から選択するとします。 文字列「short」と比較する最初の入力としてパラメータを取ります&ndash;順序の規則はありませんが、パラメーターが最初にある方が読みやすくなります。 テンプレートコードは次のように定義されています: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> 以下のような結果になります: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=パーサー関数内で使用する場合、パーサータグおよびその他のパーサー関数は一時的に{{ll|Strip marker|一意のコード}}に置き換える必要があります。 これは比較に影響します: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' 比較するどの文字列も、そのタグを含む同じ{{ll|Help:Templates|テンプレート}}を呼び出す場合は真、そのタグを含み内容が同じだが別々のテンプレートを呼び出す場合は偽。 }} {{Warning|1={{ll|Help:Magic words#Page names|PAGENAMEマジックワード}}との文字通りの比較は、サイトの構成によっては失敗する場合があります。 たとえば、ウィキによっては、<nowiki>{{FULLPAGENAME}}</nowiki>が最初の文字を大文字にし、すべてのアンダースコアをスペースに置き換える場合があります。 これを回避するには、両方のパラメーターにマジックワードを適用します。 :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == この関数は入力文字列を取り、2つの結果から1つを返します。この関数は、 <code>[[##expr|#expr]]</code> や <code>[[##time|#time]]</code> や <code>[[##rel2abs|#rel2abs]]</code> のような他のパーサー関数、ループや再帰のような[[Special:MyLanguage/Help:Templates|テンプレート]]エラー、その他の「フェースソフト」なパーサーエラーによって作られた <code>class="error"</code> を含む HTML オブジェクトが入力文字列に含まれていた場合に <code>true</code> と評価します。 :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> 戻り値の文字列の一方または両方が省略できます。 <code>correct</code> の文字列が省略されていた場合、エラーがないのであれば <code>test string</code> が返されます。 <code>error</code> の文字列も省略されていた場合は、エラー時に空文字列が返されます。 :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' エラーによっては追跡カテゴリを生じさせ、<code><nowiki>{{#iferror:}}</nowiki></code> を当てても同カテゴリの追加を回避できません。 == #ifexpr == この関数は数式を評価し、結果の真偽値に応じて2つの文字列のいずれかを返します: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <code>expression</code> 入力は、上記の<code>[[##expr|#expr]]</code>とまったく同じように評価され、同じ演算子を使用できます。次に、出力は真偽値の式として評価されます。 空の入力式は{{phpi|false}}と評価されます: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' 上記のように、ゼロは{{phpi|false}}と評価され、ゼロ以外の値は{{phpi|true}}と評価されるため、この関数は<code>[[##ifeq|#ifeq]]</code>と<code>[[##expr|#expr]]</code>のみを使用する関数と同等です: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> 空の入力式または間違った入力式を除きます(エラーメッセージは空の文字列として扱われます。ゼロに等しくないため、<code>value if true</code> を取得します)。 :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' 比較 :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' 戻り値のいずれかまたは両方を省略できます。適切なブランチが空のままの場合、出力は提供されません。 :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' 等号または不等号のブール演算子に対応します。 :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<code>[[##ifexpr|#ifexpr]]</code>による数値比較の結果は、<code>[[##ifeq|#ifeq]]</code>や<code>[[##switch|#switch]]</code>の結果と必ずしも一致しません。 これらの後者の2つは、<code>[[##ifexpr|#ifexpr]]</code>よりも正確であり、同等の結果を返しません。 変更された最後の桁とのこれらの比較を検討してください: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <code>[[##ifeq|#ifeq]]</code>と<code>[[##switch|#switch]]</code>で使用されるPHPは、整数型の2つの数値を比較するため、期待される結果を正しく返します。 一方、<code>[[##ifexpr|#ifexpr]]</code>と同じ番号の場合: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' 数字が異なると、equalの結果は実際には正しくありません。 <code>[[##ifexpr|#ifexpr]]</code>でのこの動作は、MediaWikiが式のリテラル数をfloat(フロート)型に変換するために発生します。これは、このような大きな整数の場合、丸めを伴います。<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=[[Manual:Checking for page existence|Manual:ページの有無を確認]]を参照すると、特定のページの有無とその他の制限要件が付いているかどうか確認が可能}} この関数は入力文字列を受け取り、それをページ名として解釈し、そのページがローカルウィキに存在するかどうかに応じて、2つの値のいずれかを返します。 :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> ページが存在する場合、コンテンツが含まれているかどうかにかかわらず、関数は {{phpi|true}} と評価されます(カテゴリリンクや{{ll|Help:Magic words|マジックワード}}などのメタデータが含まれていますが、表示されていません)。コンテンツ、空白、または{{ll|Help:Redirects|リダイレクト}}です。 存在していないページのみが {{phpi|false}} と評価されます。これには、ページが以前は存在していたが削除された場合も含まれます。 :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' この関数は、カスタマイズされた{{ll|Help:System message|システムメッセージ}}と、ソフトウェアによって定義された{{ll|Help:Special pages|特別ページ}}に対して{{phpi|true}}(真)と評価されます。 :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' ({{ll|Extension:Checkuser|nsp=0}}拡張機能がこのウィキにインストールされているため) | '''doesn't exist''' ({{ll|Extension:Checkuser|nsp=0}}拡張機能がこのウィキにインストールされていないため) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' ([[{{ns:8}}:Copyright]]がカスタマイズされているため) | '''doesn't exist''' ([[{{ns:8}}:Copyright]]がカスタマイズされていないため) }} MediaWiki 1.45 以前は、ページが<code>#ifexist:</code>を使用してターゲットをチェックする場合、そのページはターゲットページの[[{{#special:WhatLinksHere}}]]リストに表示されます。 したがって、コード<code><nowiki>{{#ifexist:Foo }}</nowiki></code>がこのページ({{FULLPAGENAME}})にライブで含まれている場合、[[{{#special:WhatLinksHere}}/Foo]]は{{FULLPAGENAME}}をリストします。 共有メディアリポジトリを使用するWikiでは、<code>#ifexist:</code>を使用して、ファイルがリポジトリにアップロードされているかどうかを確認できますが、Wiki自体にはアップロードされていません。 :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' ファイルのローカル説明ページが作成されている場合、結果は上記のすべてに対して '''exists'''になります。 <code>#ifexist:</code>は[[interwiki|インターウィキ]]リンクでは機能しません。 <span id="ifexist_limits"></span> === ifexistの制限 === <code>#ifexist:</code> は、「高負荷なパーサー関数」と見なされます。 1つのページに含めることができるのは限られた数だけです(参照読み込みされたテンプレート内の関数を含む)。 この制限を超えると、参照読み込み先ページが存在するかどうかに関係なく、それ以降の <code>#ifexist:</code> 関数は自動的にfalseを返し、ページは [[:Category:{{MediaWiki:expensive-parserfunction-category}}]] に分類されます。 {{ll|Help:Tracking categories|tracking category}} の名前は、ウィキのコンテンツ言語によって異なる場合があります。 使用事例によっては、<code>a.new</code> (存在しないページへのリンクを選択) または <code>a:not(.new)</code> (存在するページへのリンクを選択) を使用して ifexist 効果を css で代用できます。 さらに、単一ページで使用するメモリ消耗の激しいパーサ関数の件数の上限は <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code> で制御され、必要な場合は上限値を LocalSettings.php で変更できます。 <span id="ifexist_and_wanted_pages"></span> === 存在し、必要なページ === MediaWiki 1.45 まで当該ページは存在せず、#ifexistを使っているかどうかテスト済みのページは、[[Special:MyLanguage/Manual:WantedPages|募集ページ]]に分類されました。 根拠は {{phab|T14019}} に記述があり、 回避策の詳細は [[:w:Template:Linkless exists|Template:Linkless]] を参照してください。(訳注:リンク元は削除済み) == #rel2abs == この関数は相対ファイル パスを絶対ファイル パスに変換します。 :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <code>path</code> 部分では、以下の構文を使用できます: *<code>.</code> → 現在の階層 *<code>..</code> → 1 つ上の階層に移動 *<code>/foo</code> → 下位ディレクトリ /foo に 1 階層移動 <code>base path</code> を指定していない場合は、ページの完全なページ名が代わりに使用されます: :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <code>/.</code> や <code>/./</code> のような無効な構文は無視されます。 連続する終止符は2つまでしか許可されていないため、次のようなシーケンスを使用して、連続するステートメントを区切ることができます。 :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' 同様の関数のグループについては、[[Special:MyLanguage/Help:Magic words#URL data|ヘルプ:マジックワード#URL データ]] も参照してください。 組み込みパーサー関数には 'localurl:', 'fullurl:', 'anchorencode:' などがあります。 == #switch == ''関連項目: [[w:Help:Switch parser function]]'' この関数は入力値1件を複数のテストケースと比較し、ヒットした場合は当該の文字列を返します。 {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} 例: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' 部分的なトランスクルージョン タグを含む <nowiki>#</nowiki>switch は、テンプレート コーディングに慣れていない編集者が構成可能な要素を表示および編集できるようにする構成ファイルに影響を与える可能性があります。 <span id="Default"></span> === 既定 === <code>''case''</code>文字列に対応する<code>''comparison string''</code>がヒットしない場合、<code>''default result''</code>を返します。 :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' この構文では、既定の結果は最後のパラメーターである必要があり、生の等号(<code><nowiki>{{}}</nowiki></code>のない等号)を含めることはできません。 一致する場合は、ケース比較として扱われ、一致するケースがない場合はテキストは表示されません。 これは、既定値が定義されていない (空である) ためです。 ただし、大文字と小文字が一致する場合は、関連する文字列が返されます。 :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> 代替方法として、既定の結果を "<code>#default</code>" の<code>''case''</code>文字列で明示的に宣言することもできます。 {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} この方法で宣言された既定の結果は、関数内のどこにでも配置できます。 :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <code>''default''</code>パラメータが省略され、一致が行われない場合、<code>''result''</code>(結果)は返されません。 :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === グループ化の結果 === いくつかの <code>''case''</code> 文字列に同じ <code>''result''</code> 文字列を返す「フォールスルー」値を持たせることができます。これにより重複を最小限に抑えることができます。 {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} ここではケース2と3、4とも出力は<code>''result234''</code>です。ケース6と7の出力は両方とも<code>''result67''</code>です 上記の場合、最後のパラメータの「<code>#default = </code>」は省略できます。 <span id="Use_with_parameters"></span> === パラメータとともに使用 === この関数は、テスト文字列としてパラメータとともに使用できます。 この場合、大文字と小文字を文字列 「<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>」に設定する可能性は非常に低いため、パラメータ名の後にパイプを配置する必要はありません。 (これは、パイプが存在せず、パラメーターが存在しないか、値がある場合にパラメーターが既定で設定する値です。 {{ll|Help:Parser functions in templates}} を参照してください。) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> 上記の場合、<code><nowiki>{{{1}}}</nowiki></code>が<code>foo</code>に等しい場合、関数は<code>Foo</code>を返します。 <code>baz</code>に等しい場合、関数は<code>Baz</code>を返します。 パラメータが空であるか存在しない場合、関数は<code>Bar</code>を返します。 上記のセクションのように、ケースを組み合わせて単一の結果を得ることができます。 :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> ここで、<code><nowiki>{{{1}}}</nowiki></code>が<code>foo</code>、<code>zoo</code>、または<code>roo</code>に等しい場合、関数は<code>Foo</code>を返します。 <code>baz</code>に等しい場合、関数は<code>Baz</code>を返します。 パラメータが空であるか存在しない場合、関数は<code>Bar</code>を返します。 さらに、テストパラメータ値がいずれの場合にも一致しない場合に何も返したくない場合は、既定の結果を省略できます。 :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> この場合、<code><nowiki>{{{1}}}</nowiki></code>が存在して<code>foo</code>または<code>bar</code>に等しい場合を除き、関数は空の文字列を返します。この場合、関数はそれぞれ<code>Foo</code>または<code>Bar</code>を返します。 これは、既定の結果を空として宣言するのと同じ効果があります。 :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> 何らかの理由でケースを「<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>」に設定すると、パラメーターが存在しないか値がない場合に、関数はそのケースの結果を返します。 関数の既定の結果を返すには、パラメーターが存在し、文字列「<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>」以外の値を持っている必要があります。 :(<code><nowiki>{{{1}}}</nowiki></code>が存在しないか、空の場合): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(<code><nowiki>{{{1}}}</nowiki></code>の値が「<code>test</code>」の場合): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(<code><nowiki>{{{1}}}</nowiki></code>の値が「<code><nowiki>{{{1}}}</nowiki></code>」の場合): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' この架空のケースでは、パイプをパラメーター(<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>)に追加する必要があります。 <span id="Comparison_behavior"></span> === 比較の挙動 === <code>[[##ifeq|#ifeq]]</code> 同様、比較は比較する文字列と対象の格文字列が数値である場合、数値として処理されます。あるいは大文字小文字を識別する文字列として処理されます。 :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <code>''case''</code>文字列は空白の場合があります。 :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' 一致が見つかると、それ以降の<code>''cases''</code>は無視されます。 :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <code>[[##switch|#switch]]</code>および<code>[[##ifeq|#ifeq]]</code>を使用した数値比較は、式の比較と同等ではありません(上記も参照)。 :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <span id="Raw_equal_signs"></span> === 生の等号 === "Case" 文字列には生の等号を含めることができません。これを回避するには、[[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] マジックワードを使用して、等号記号を HTML コード <code><nowiki>&amp;#61;</nowiki></code> に置き換えます。 例: {| class="wikitable" ! 入力 ! 出力 |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=この関数を実社会で使う易しい例として[[:ja:NBA|NBA]][https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color] (訳注:[[:ja:Template:BasketColor|バスケットボールチームの配色用テンプレート]]) を参照してください。複雑なサンプルは {{ll|Template:Extension}} (テンプレート:拡張機能) と [[w:Template:BOTREQ]] (訳注:[[:ja:Template:BOTREQ|Bot作業依頼のコメント用テンプレート]]) の2件を参照してください。 }} <span id="Replacing_#ifeq"></span> === #ifeqの置換 === [[Special:MyLanguage/Help:Expansion depth|拡張深度]]を減らすには <code>#switch</code> を使用。 例: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> は、以下と同等です * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> つまり、深い入れ子、線形: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> 一方、switchの交換は、両方のブランチにネストされたIF(インデントの代替で示され、両側にインデントされている)の場合、複雑/非実用的であり、完全に対称的なツリーになります。 <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | コード ! {{hl1}} | 説明 ! {{hl1}} | 現在の出力<br /><small class="noprint">(更新するには[{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} このページのキャッシュを破棄]してください)</small> |- ! {{hl2}} colspan="3"| 年 |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | 4 桁の年 | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | 2 桁の年 | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 閏年の場合 1、平年の場合 0 | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|PHP 5.1.0 以降および [[rev:45208]] が必要|group=note}} | 指定した週の ISO-8601 年{{#tag:ref|Y と等値になるが、ISO 週番号 (W) が前月もしくは次月の場合、年で代用。|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|注1の場合が未記入だと、リテラル''o'' を出力。|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| 月 |- | style="text-align: center;" | <code>n</code> | 月番号、ゼロ補完なし | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | 月番号、ゼロ補完あり | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | サイトの言語での月名の省略形 | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | サイトの言語での完全な月名 | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | [[:ja:属格|属格]]と[[:ja:主格|主格]]を区別する表示言語では、月の名前の表記を属格形式で出力。このオプションは[[:ja:スラヴ語派|スラヴ語派]]のポーランド語やロシア語、ベラルーシ語やチェコ語、スロバキア語やスロベニア語、ウクライナ語などに使える。 | style="line-height: 1.6;" | ポーランド語の例:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(主格)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(所有格) |- ! {{hl2}} colspan="3"| 月または年の通算日 |- | style="text-align: center;" | <code>j</code> | 日、ゼロ補完なし | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | 日、ゼロ補完あり | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | 日 (1月&nbsp;1 = 0).<br />{{note}} ISO 日付を得るには 1 を加算する。 | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| 週および曜日 |- | style="text-align: center;" | <code>W</code> | ISO 8601 週番号、ゼロ補完あり | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | ISO 8601 曜日番号 (月曜日 = 1、日曜日 = 7) | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | 曜日番号 (日曜日 = 0、土曜日 = 6) | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | 曜日の略号。翻訳されない場合が多い。 | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | 曜日の省略しない表記。翻訳されない場合が多い。 | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| 時 |- | style="text-align: center;" | <code>a</code> | 午前 (00:00:00 ~ 11:59:59) の場合「am」、午後 (12:00:00 ~ 23:59:59) の場合「pm」 | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | 上の <code>a</code> の大文字版。 | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | 時、12 時間制、ゼロ補完なし | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | 時、12 時間制、ゼロ補完あり | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | 時、24 時間制、ゼロ補完なし | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| 時、24 時間制、ゼロ補完あり | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| 分と秒 |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | 分、ゼロ補完あり | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | 秒、ゼロ補完あり | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[:ja:UNIX時間|Unix 日時]]。 1970年1月1日 00:00:00 GMT からの経過秒数 | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| タイムゾーン ([[MediaWiki 1.22/Roadmap|1.22wmf2]] 時点) |- | style="text-align: center;" | <code>e</code> | タイムゾーン識別子 | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | 日時がサマータイムかどうか | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | グリニッジ標準時 (GMT) との差 | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | グリニッジ標準時 (GMT) との差、コロン付き | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | タイムゾーンの省略形 | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | タイムゾーンのオフセット (秒) | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| その他 |- | style="text-align: center;" | <code>t</code> | 日 | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | ISO 8601 形式の日付、<code>Y-m-d"T"H:i:s+00:00</code> と同等。 | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | [[rfc:5322|RFC 5322]] 形式の日時、<code>D, j M Y H:i:s +0000</code> と同等だが、曜日と月名は国際化されない。 | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | グレゴリオ暦以外 |- ! {{hl3}} colspan="3" | イスラム暦 |- | style="text-align: center;" | <code>xmj</code> | 日 | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | 完全な月名 | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | 月番号 | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | 完全な年 | {{#time:xmY}} |- ! {{hl3}} colspan="3" | イラン暦 (Jalaly) |- | style="text-align: center;" | <code>xit</code> | 月間の日数 | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | 日 | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | 日 | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | 完全な月名 | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | 月番号 | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | 完全な年 | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | 2 桁の年 | {{#time:xiy}} |- ! {{hl3}} colspan="3" | ユダヤ暦 |- | style="text-align: center;" | <code>xjj</code> | 日 | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | 完全な月名 | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | 月の日数 | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | 月名の所有格 | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | 月番号 | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | 完全な年 | {{#time:xjY}} |- ! {{hl3}} colspan="3" | タイ太陽暦 |- | style="text-align: center;" | <code>xkY</code> | [[:ja:タイ太陽暦|タイ太陽暦]]の完全な年。<br />{{note}} 1941 年より前の 1 月から 3 月の範囲は、適切には[[:ja:タイ太陽暦#新紀元|計算]]できません。 | {{#time:xkY}} |- ! {{hl3}} colspan="3" | 民国紀元/主体暦 |- | style="text-align: center;" | <code>xoY</code> | 完全な年 | {{#time:xoY}} |- ! {{hl3}} colspan="3" | 日本の年号 |- | style="text-align: center;" | <code>xtY</code> | 完全な年 | {{#time:xtY}} |- ! {{hl2}} colspan="3" | フラグ |- | style="text-align: center;" | <code>xn</code> | 後続の数値をそのまま半角英数字に整形する。 | ヒンディー語では、<syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> は ०६, 06 を返す。 |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <code>xn</code> と同様ですが、トグル フラグとして文字列の終端または文字列に次の <code>xN</code> が出現するまで保持されます。 |- | style="text-align: center;" | <code>xr</code> | 後続の数値をローマ数字に整形する。10,000 までの数値で動作する。<br /><small>(MediaWiki 1.20 以前は上限 3,000)</small> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | 後続の数値をヘブライ数字に整形する。 | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} このパーサ関数は日付あるいは時間 (グレゴリア暦) を取って指定の文法どおりにフォーマットします。日・時間のオブジェクトを特定する方法; 既定値は [[Special:MyLanguage/Help:Magic words#Date and time|マジックワード]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; つまりページが最近 HTML 形式で表示された日時。 :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> 右の図には利用できる書式コードをまとめてあります。 書式文字列内にこれら以外の文字が含まれると、未処理で出力します。空白類も扱いは同様です (コードの解析に不要なため)。 書式文字列で文字が認識されず、日付/時刻オブジェクトにエラーがない場合、書式文字列が出力として返されます。 また書式文字列内の文字をエスケープする方法が 2 つあります。 # バックスラッシュに続けて書式指定文字列を記述すると、ひとまとまりのリテラル文字として解釈 # 文字列を二重引用符で囲むと、リテラル文字として扱い引用符を除去。 またさらに、有向グラフ <code>xx</code> の場合、ひとまとまりのリテラル文字「x」と解釈します。 書式設定コードのリストは進化し続けているため (新しいカレンダーのサポートや、異なる方法で計算および書式設定された新しい日付フィールドのサポートなど)、変更せずに渡す必要があるすべてのリテラル文字 (書式設定コードで現在使用されている ASCII 文字だけでなく) をエスケープする必要があります。 残念ながら、現時点では、ASCII 一重引用符は、現在サポートされている ASCII 二重引用符(たとえば、JSON、C、C++ での文字列値の区切りなどの他の用途では二重引用符が必須です)とバックスラッシュ(JSON、C、C++、PHP、JavaScript、Lua など多くの言語で使用される文字列定数でもエスケープする必要があります)に代わるリテラル テキストをマークするための単純な代替手段としてはまだ認識されていません。 したがって、バックスラッシュでエスケープせずにリテラルの二重引用符を埋め込むことはできません (または、代わりに他の波型、角型、四角型の引用符を使用することもできます)。 :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' PHPは<code>''date/time object''</code>を受け取ると、どの書式でも [https://php.net/function.strtotime strtotime()] 関数で処理します (訳注:英文形式の日付を Unix タイムスタンプに変換)。 絶対時間 (例: <code>20 December 2000</code>)、相対時間 (例: <code>+20 hours</code>)、および組み合わせ時間 (例: <code>30 July +1 year</code>) が受け入れられます。 :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' [[:ja:ISO 639-3|ISO 639-3]] (?) の<code>''言語コード''</code>により、文字列を選択した言語で表示します。 :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <code>''local''</code>パラメーターは、「日付/時刻オブジェクト」がローカルタイムゾーンを参照するかUTCを参照するかを指定します。 これは真偽値のパラメーターです。その値は、引数の値をキャストすることによって決定されます(文字列を真偽値にキャストする方法の詳細については、[https://php.net/language.types.boolean#language.types.boolean.casting 公式PHPドキュメント]を参照してください)。 {{note|2=reminder|1=変数{{phpi|$wgLocaltimezone}}が<code>UTC</code>に設定されている場合、<code>local</code>が<code>true</code>または<code>false</code>に設定されていても、出力に違いはないことに注意してください。}} 詳細は以下の例を参照してください: :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' Unix タイムスタンプを計算する場合は、文字列の先頭に <code>@</code> 記号を付けると日付計算に使えます。 :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= もしタイムスタンプの数値の先頭に <code>@</code> を付けないと、ほぼ毎回、エラーか想定外の値を返します。 :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (正しい) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (年の書式が想定外) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (正しい) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' (年を想定、今日の月日を添える) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (正しい) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' (年を想定、今日の月日を添える) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (正しい) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (年の書式が想定外) }} {{Warning|1= 許容できる入力値は「1 January 0111 → 31 December 9999」の範囲です。年は100から110までが不定形です。Y (年) とうるう年はその 100-110 と同様に不定形、r (RFC 5322 形式)、D (曜日略号)、l (曜日)、U (Unix日時) を記述すると年を 2000-2010 の範囲として解釈します。 :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> (これはうるう年ではないから出力は正しい)、ただし :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' (こちらは間違い。100 を2000と解釈できたのに、うるう年だったため。) :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' 先頭に 0 を付けて 4 桁の書式にした場合を除いて、年の値 0-99 は 2000-2069 年および 1970-1999 年と解釈されます: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) 日は年が 100-110 の範囲か、1753以上で与えられ、原因は 111-1752 の範囲では r-出力が「不明」、l-出力が「<>」となってしまうからです。結果として、r-出力はこれらの範囲の年の入力値として許容されません。 }} 完全または部分的な絶対日付を指定できます。この関数は ''current'' 値を使用して、指定されていない日付の部分を「補完」します。 :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= 補完の関数は不定形です。特定の部分は現在の値で補完され、別の部分はエラーになります。 :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' この例は日のゼロ時ゼロ分、現在の日、数式に記述した月 (June=6月) と年を表示。 :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' この例はゼロ時ゼロ分、現在の月日、数式に記述した年を表示。 満員の日の例外ケースがあります: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' 1日の始まりと月の始まりを示します。 }} 4桁の数字は常に年として解釈され、時間や分としては解釈されません。<ref>2011年の{{rev|86805}}以前とは扱いが変わりました。</ref> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' 6桁の数字は時間と解釈、できるかぎり分と秒まで出力しようとしますが、それ以外の場合はエラーになります (たとえば年月日とは解釈しません)。 :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' 記述したコードは年とゼロ補完の月と日を要求したのに、出力は時間として解釈。 :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' 19:60:09 は有効な時刻ではないにもかかわらず、196009 は1960年9月とは解釈されません。 関数は日付計算をこなそうとします。(訳注:Fは「サイトの言語での完全な月名」、dはゼロ補完の日を求め、入力値の不備で出力結果が不定形。) :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <code>#time</code> に対する書式文字列の総文字数(すべての呼び出しでの総和)は半角6000文字に制限されています。<ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== タイムゾーンの問題点 ==== この#timeパーサ関数(より具体的には''PHP DateTime'' )には相対的なタイムゾーンオフセットとして''整数以外'' は渡せないというバグがあります。EDT ([[:ja:東部夏時間|東部夏時間]]) など時間通りのタイムゾーンを使用する場合、この問題は発生しません。例をあげます。: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} ところがインドは UTC ([[:ja:協定世界時|協定世界時]]) との時差が +5.5 時間のため、タイムゾーンを適用すると通常なら正しいオフセットの計算に失敗するはずです。実例はこちら: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} そこで回避策として、単純に時間を分か秒 (minutes か seconds) に換算して、次の例のように与えます。 * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} (関数の開発者 Tim Starling がこれを解決する構文を書いてくれました。) <span id="#time_format_like_in_signatures"></span> ==== 署名などの#time書式 ==== 時にはタイムスタンプを構築すると便利で、見た目はトークページの議論で[[Special:MyLanguage/Help:Signatures|署名機能]]が自動生成するタイムスタンプそっくりです。 英語版ウィキ類の場合は、以下の方法で生成します。 * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == この関数は構文のショートカットで <code>local</code> パラメータに {{phpi|true}} を設定すると挙動は <code><nowiki>{{#time: ... }}</nowiki></code> と同一、常に利用者が設定した標準時またはウィキが設定した時間帯を使用 (タイムゾーンの設定は {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}} に従う) 関数の構文は次のとおりです: :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=変数{{phpi|$wgLocaltimezone}}が<code>UTC</code>に設定されている場合、<code>local</code>が{{phpi|true}}または{{phpi|false}}に設定されていても、出力に違いはないことに注意してください。}} [[File:Time-Timel.png|thumb|タイムゾーンがUTCではないサーバーからの#timeおよび#timelパーサー関数の使用例]] 例えば、以下の例を参照してください: :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|https://no.wikipedia.org/wiki/Maldiskusjon:Sommertidからの警告例]] {{Warning|1= UTC(旧称GMT)とは異なるタイムゾーンのウィキペディアでは、1970-01-01 00:00:00 UTC以降、時間と時間の両方のUが同じ秒数を返すことに注意してください。 :<code>U</code> Unix時間。 1970年1月1日00:00:00 GMTからの秒数。 :<code>Z</code> タイムゾーンのオフセット (秒) :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == この関数は選択した言語の標準の書式を日付に与え、 <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> で定義した通りです(詳細は{{Phab|T223772}}を参照)。 : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1='''日時オブジェクト''' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1='''日時オブジェクト''' |2=''書式の種別'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1='''日時オブジェクト''' |2=''書式の種別'' |3='''言語コード''' }} ''date/time object'' の書式は[[#time|#time]]の場合と同じです。空欄の場合、ページをレンダリングした時点を採用します。 ''書式の種別''は以下のいずれかの場合があります。 ; <code>time</code> : 時間のみ表示。 ; <code>date</code> : 日付のみ表示。 ; <code>both</code> : 日付と時間の両方を表示。 ; <code>pretty</code> : 年を省いた略式の日付のみ表示。 これはすべての言語に対応していませんので、非対応の場合は 「date」書式を採用。 書式の種別 ''format type'' を指定しない場合はまるで <code>both</code> を指定したように、時間と日付を表示します。 もしも「言語コード」を指定しない場合は、そのページの内容の言語を採用。 言語単位で日付の書式が異なることから、<code>#time</code> の代わりに <code>#timef</code> を用いて、多言語への対応を簡素にしてあります。 英語では月日の順序を{{wg|AmericanDates}}で調節します。 例: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == この関数は [[#timef|#timef]] と同等ですが、{{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}に設定したその地域の標準時を採用します。 :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == この関数は、ページ名をスラッシュに基づいてセグメントに分離し、それらのセグメントの一部を出力します。 : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=ページ名 |2=返すセグメント数 |3=最初に返すセグメント }} ''返すセグメントの数'' パラメータの指定がない場合、既定値は''0'' で、「開始セグメント」から(含まれた)末尾までセグメント全件を返します。''開始セグメント'' パラメータを指定していない、または''0'' の場合は、既定値は''1'' です。 : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki> も参照してください。 : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' 両方の値に負の値が受け入れられます。''返されるセグメントの数''パラメータの負の値は、文字列の末尾からセグメントを効果的に「ストリップ」します。 「最初に返されるセグメント」の負の値は、「このセグメントを右から数えて開始する」という意味になります。 : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' 文字列の最後から数えてはじめのセグメントを削除します。 {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}} も参照してください。 : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' 文字列の末尾から4つのセグメントすべてを削除します : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' 文字列の末尾から5つのセグメントを削除します(存在する以上) : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' 最後のセグメントを返します。 {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}} も参照してください。 : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' 文字列の末尾から1つのセグメントを削除してから、2番目以降のセグメントを返します : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' 最後から2番目の要素からコピーを開始します。文字列の末尾から1つのセグメントを削除します 処理する前に、「pagename」パラメータはHTMLでデコードされます。標準のHTML文字エンティティが含まれている場合、それらはプレーン文字に変換されます(UTF-8で内部的にエンコードされます。つまり、MediaWikiソースページで使用するのと同じエンコードです。このパーサー関数)。 : たとえば、''pagename''に<code>&amp;quot;</code>、<code>&amp;#34;</code>、または<code>&amp;#x22;</code>が含まれている場合は、<code>"</code>に置き換えられます。 : HTMLからプレーンテキストへの他の変換は実行されないため、HTMLタグは、ページ名で無効であっても、この最初のステップではそのまま残ります。 {{tip| 1= MediaWiki の一部のマジックキーワードやパーサー関数 (<code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> など) は、入力パラメータが HTML エンコードされていない場合でも、不必要に HTML エンコードされた文字列を返すことが知られています。 titleparts パーサー関数を回避策として使用して、これらの返された文字列を変換できます。これにより、パラメータにページ名を受け取るがHTMLエンコードされた入力文字列では依然として正しく動作しない他のパーサー関数 (<code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code> など) によっても正しく処理できるようになります。 This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. たとえば、現在のページが [[commons:Category:Côte-d'Or|Category:Côte-d'Or]] の場合、次のようになります。 * <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight> と <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> は両方とも <code>1</code> を返します (#ifeq パーサー関数は入力パラメータの HTML デコードを実行します)。 * <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight> と <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> は両方とも <code>1</code> を返します (#switch パーサー関数は入力パラメータの HTML デコードを実行します)。 * $code 0、$code 1、または <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> はすべて、そのカテゴリ ページが存在する場合は <code>1</code> を返します (#ifexist パーサー関数は入力パラメータの HTML デコードを実行します)。 * カテゴリにページまたはサブカテゴリが含まれている場合、<syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> はゼロ以外の数値を返します'''が'''、: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight> は、次のように '''無条件に''' 0 を返す場合があります: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> この予期しない動作の理由は、MediaWiki の現在のバージョンには 2 つの注意事項があるためです。 * <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>、または <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> は、期待される <code>Category:Côte-d'Or</code> ではなく、実際に HTML エンコードされた文字列 <code>Category:Côte-d&apos;Or</code> を返す''場合''があります。 * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> は '''無条件に''' 0 を返します (PAGESINCAT マジック キーワードは入力パラメータの HTML デコードを実行しません)。 titleparts を使用した簡単な解決策 (両方の注意点が MediaWiki の新しいバージョンで修正されれば引き続き機能します) は次のとおりです。 * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>、これらはすべて同じカテゴリ内の実際のページ数を返します。 }} 次に、デコードされた''ページ名''は、可能な限り MediaWiki でサポートされている標準のページ名に正規化されます。 # すべてのアンダースコアは自動的にスペースに置き換えられます。 #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' 原文では下線が付いていますが、''bah_boo''ではありません。 # 文字列は最大 25 回分割され、それ以降のスラッシュは無視され、25 番目の要素に文字列の残りが含まれます。 文字列は [[Special:MyLanguage/Manual:Page table#Schema summary|ページ名]] として扱われるため、255 文字に制限されます。 #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: 何らかの理由でこの関数を限界まで押し上げる必要が生じた場合、可能性は低いですが、関数呼び出しをネストすることで最大 25 回の分割制限を回避することができます。 #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # 最後に、最初の部分文字列は、ローカル Wiki の大文字化設定に従って大文字化されます (その部分文字列もローカル名前空間名で始まる場合は、その名前空間名も正規化されます)。 #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= #titleparts を小さな「文字列パーサーおよびコンバーター」として使用できますが、大文字の最初の部分文字列を返すことに注意してください。 : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' 小文字を求めるには lc: 関数を使い出力をコントロールします。 : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' 文字列の先頭に「ダミー」のスラッシュを追加して、最初の部分文字列の大文字化 (大文字または小文字) を正しく行うことができます。''返される最初のセグメント'' には、<code>1</code> ではなく <code>2</code> を使用します。 : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= {{ll|Manual:Page title#Naming restrictions|ページ名に使用すると法律違反となる}}特定の文字があると、#titleparts はその文字列を解析できない例は次のとおり: : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. 以下の値にはなりません: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. ページ名では括弧は無効であり、このパーサー関数は、MediaWiki 構文やその他の HTML または MediaWiki タグが使用されている場合でも、入力 ''pagename'' パラメータに埋め込まれたリンクを処理しないため、機能しません。 : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". 「#」もページ名では不正なので機能しません。 }} {{Warning|1= ページ名の一部が「<code>.</code>」または「<code>..</code>」だけの場合、#titleparts は文字列を解析しません。 : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. 文字列全体が返されます。期待どおりの結果は生成されません。 '''one''' }} {{Warning|1= この関数は、入力が UTF-8 で 255 バイトを超える場合、入力文字列を適切に劣化させません。入力文字列が 256 バイト以上の場合は、文字列全体が返されます。 }} <span id="String_functions"></span> == 文字列関数 == {{Main|Extension:ParserFunctions/String functions}} ParserFunctions 拡張機能は、<code>$wgPFEnableStringFunctions</code> が {{phpi|true}} に設定されている場合、オプションでさまざまな文字列関数を定義します: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> 解説は特設したサブページ、例えば{{ll|Manual:Performing string operations with parser functions}}を参照してください。 {{Warning |1=2013 年に、これらの機能は大規模に使用すると非効率であるため、Wikimedia Wiki では ''決して'' 有効にしないこと'' が決定されました (履歴については [[phab:T8455]] を参照してください)。 '''これらの機能はWikimedia wikiでは動作しません。'''<br/><br/>Wikimedia プロジェクトについて何かを書くためにここに来ているのであれば、何か他のものを探していることになります。ホーム Wiki に文字列関数がある場合は、おそらく {{ll|Extension:Scribunto|Lua}} が使用されています。 たとえば、英語版 Wikipedia では [[w:Module:String|Module:String]] が使用されていますが、これは構文が大きく異なりますが、同じことの一部を実行します。 個別の[[w:Template:String-handling templates|文字列処理テンプレート]]もあります。 }} [[Module:String]] 関数の簡単な概要は次のとおりです。 * [[w:Module:String#len|&#35;len]] (文字列の長さ): <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] (部分文字列): <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] (ターゲットの位置): <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] (繰り返し): <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == 全般的な情報 == <span id="Substitution"></span> === subst展開 === パーサー関数の [[Special:MyLanguage/Help:Substitution|subst展開]]は、ハッシュ記号の前に<code>'''subst:'''</code>を足します。 :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' というページが存在するため、コード {{FULLPAGENAME}} がウィキテキストに挿入されます。 {{Warning|1= 式に{{ll|Help:Magic words#Variables|変数}}や他のパーサー関数などの「置換されていない」揮発性コードが含まれている場合、置換されたパーサー関数の結果は未定義になります。一貫した結果を得るには、評価される式内のすべての揮発性コードを置換する必要があります。[[w:Help:Substitution|Help:Substitution]] を参照してください。}} Subst展開は {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; では機能しないので、予測する結果を得るには<code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> を使ってください。 <span id="Redirects"></span> === リダイレクト === 中でも[[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] は文中に日付を含むページの{{ll|Help:Redirects|リダイレクト}}で特に利便性が高そうに見えても、実用上は機能しません。 <span id="Escaping_pipe_characters"></span> === パイプ記号のエスケープ === <span id="In_tables"></span> ==== 表の場合 ==== パーサー関数はウィキ記述の表 {{ll|Help:Tables|wikitable}} の構文を断ち切りパイプ記号 (<code><nowiki>|</nowiki></code>) に与える役目を変質させ、生のパイプ記号は単に変数の区切り子として扱います。 回避策として過去にはほとんどのウィキで [[{{ns:10}}:!]] テンプレートを使い生のパイプ記号 (<code><nowiki>|</nowiki></code>) 単体のみ記していたところ、MW 1.24 以降はこの苦しい方法に代わって {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> マジックワード}}が使えます。 これは見た目にパイプ記号を MediaWiki 関数に対して〈不可視化〉することで、特定のページ内のテンプレート類や変数がすべて展開するまで、処理の対象として保留されます。 そして表の列や行の区切り子として解釈されます。 代案として生の HTML 形式の関数の表を使う方法もあり、ただし直感的に記述しにくくエラー発生の確率も高めです。 パイプ記号&vert;は、解釈していない(平文の)文字としてエスケープすることも可能です。これには HTML エンティティまたは<code>&amp;vert;</code>を使います。 {| class="wikitable" ! 説明 ! 入力内容 ! 結果 |- | パイプ記号を表の行/列区切りとしてエスケープ | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | パイプ記号をプレーンな文字としてエスケープ | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== テンプレート呼び出しの場合 ==== 以下の例でも、パイプ記号の保護機能が適用されます。 <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> ''sandbox name=''の直前にパイプ記号|が存在する場合に''text after''が表示されない理由は、テンプレート''Documentation''のパラメータとして''|sandbox name=''と''|content=''が同じレベルと誤認されるからです。 <span id="Stripping_whitespace"></span> === 空白類の除去 === 空白 (改行、タブ、空白アキ) はパーサ関数の全パラメータの開始から終了まで除去します。これを回避するには、引用符で囲んでから文字列を比較します。 :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' then 部分および else 部分での空白の除去を回避する方法は [[m:Template:If]] を参照してください。 空白の代わりに <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> を使用することもできます。 :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' ただし連続する複数の空白文字はパーサにより1文字に圧縮されるため、この方法により処理できるのは'''1文字'''の空白文字に限定されます。 :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} このサンプルでは <code>white-space: pre</code> 書式を採用してブラウザ上で非表示でも、空白スペースが保持されるように強制します。ソフトウェアにより、ブラウザに渡す前に空白文字が除去されるため発生します。 この挙動を回避するには、ソフトウェアによって置換されないように空白類を <code>&amp;#32;</code> (改行可能空白) または <code>&amp;nbsp;</code> (改行不可空白、nbsp) に置換します。 :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' パラメータ同士の重みづけは同等でない点にご注意ください。 パーサ関数 ParserFunctions では、冒頭と末尾の空白スペースは常に除去されます。 {{ll|Help:Templates|テンプレート}}では冒頭と末尾の空白スペースは名前付きパラメータと名前をつけた名無しパラメータに関しては除去、ただし名無しのままのパラメータからは除去''しません'' : :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == その他のパーサー関数 == <span id="Case_conversion_functions"></span> === 大文字小文字の切り替え関数 === * '''小文字:''' {{xpdoc|lc: AbC|}} * '''大文字:''' {{xpdoc|uc: AbC|}} * '''小文字の頭文字:''' {{xpdoc|lcfirst: AbC}} * '''大文字の頭文字:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === コード化の関数 === * '''URL のエンコード:''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> 以下のように表示 ---- "{{urlencode: AbC dEf ghi}}" ---- そこで内部の新しい行は %0A に、内部の空白は + に変換されます。 <span id="Anchor_encoding"></span> === アンカーの符号化 === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> 以下のように表示 ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == 関連項目 == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – コアと拡張機能が追加したパーサ関数の一覧 (未完成)。 * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – 特に番号の書式設定とパッディング(余白) * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] は {{ll|Extension:StringFunctions}} を廃止 * ウィキベース対応のパーサ関数 (拡張機能によりウィキデータ収載を有効化): [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|ウィキメディア プロジェクト#パーサー関数でデータをどう扱うか]] <span id="References"></span> == 脚注 == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] 4xaaf7qlvdxmr0nlebud43153nitpvm OAuth/For Developers 0 171733 8364284 8364216 2026-05-03T12:24:31Z Shirayuki 472859 wrong markup 8364284 wikitext text/x-wiki <languages /> <translate> <!--T:1--> This page explains how to develop applications that can integrate with a wiki running <tvar name=1>{{ll|Extension:OAuth}}</tvar> (an extension which turns MediaWiki into an [[w:OAuth|OAuth]] server) to securely request permission to act on the user's behalf. </translate> {{Note|1=<translate><!--T:2--> If you are developing a bot or similar application that always uses the same account, you might prefer the simpler [[<tvar name=1>Special:MyLanguage/OAuth/Owner-only_consumers</tvar>|owner-only consumers]].</translate>}} <translate> == OAuth in a nutshell == <!--T:3--> <!--T:22--> OAuth allows an application to request permission from a user to act through that user's wiki account, without knowing the user's password, and without being able to do everything the user could (e.g. the app might be able to edit articles but not delete them, so even users with extended permissions can safely use OAuth-enabled tools). <!--T:23--> This happens via the <tvar name=1>[https://oauth.net/2/ OAuth 2.0]</tvar> or <tvar name=2>[https://oauth.net/core/1.0a/ OAuth 1.0a]</tvar> protocol, and consists of three stages: </translate> # <translate><!--T:24--> The developer must register the application (often called "consumer" in the OAuth terminology) on the wiki, possibly go through some sort of review process, and will receive some credentials.</translate> # <translate><!--T:25--> When a user wants to use it, the application must initiate an authorisation process.</translate> <translate><!--T:26--> This will involve sending the user to a special page on the wiki, which will display an authorisation dialog.</translate> <translate><!--T:27--> If the user accepts, the application will receive another set of credentials (which are specific to that user, and can be revoked by the user at any time).</translate> # <translate><!--T:28--> When the application actually needs to make an action (API request) on the user's behalf, it can combine the credentials received in steps 1 and 2 to sign the request.</translate> <translate><!--T:29--> OAuth is a widely used open standard (you can see it on sites like Google or Facebook or GitHub, e.g. when using accounts at those sites to log in elsewhere).</translate> {{info|1=<translate><!--T:30--> OAuth should not be confused with:</translate> * <translate><!--T:109--> [[w:Initiative for Open Authentication|OATH]] (a second-factor authentication protocol family, commonly known as "type the six numbers you see on your mobile app", now enabled on Wikimedia sites)</translate> * <translate><!--T:110--> [[w:OpenID Connect|OpenID Connect]] (an authentication protocol based on OAuth 2.0, which the OAuth MediaWiki extension partially supports).</translate> }} <translate> <!--T:31--> For a slightly larger nutshell on OAuth 1.0a, see [<tvar name=url>https://docs.google.com/presentation/d/1537HnwSaSzH-b8hINcz48SNhT8ElAUPC39to0_O1iNA/edit#slide=id.g15105b408d_0_287</tvar> these slides]. == OAuth in detail == <!--T:4--> </translate> <translate><!--T:32--> The registration is basically the same for OAuth 1.0a and OAuth 2, with the difference being only the presence of a few form fields. The remaining parts differ significantly depending on the OAuth version.</translate> <translate><!--T:111--> Generally, OAuth 2 is recommended if available in your environment.</translate> <translate> === Registration === <!--T:5--> </translate> <translate><!--T:39--> To register a new OAuth application, submit the form at <tvar name=1><code>[[m:Special:OAuthConsumerRegistration/propose|Special:OAuthConsumerRegistration/propose]]</code></tvar>.</translate> <translate><!--T:40--> Try to give sufficient information about the application for admins and users to decide whether it can be trusted.</translate> <translate><!--T:41--> URLs to places with more information (such as the application itself, the source code or on-wiki documentation) can be useful.</translate> <translate><!--T:42--> For OAuth applications to be used on Wikimedia projects, see [[<tvar name=1>meta:Special:MyLanguage/OAuth app guidelines</tvar>|app guidelines]].</translate> <translate><!--T:43--> Besides the descriptive ones, the fields have the following meaning:</translate> * <code>This consumer is for use only by {{tag|user|open|plain=1}}</code>: <translate><!--T:54--> whether you use [[<tvar name=1>Special:MyLanguage/OAuth/Owner-only_consumers</tvar>|owner-only consumers]] (which do not need to be reviewed or authorised but are only usable by yourself).</translate> * <code>callback URL</code> (<translate><!--T:107--> irrelevant to owner-only consumers</translate>): <translate><!--T:55--> the URL where the user returns after authorisation is checked against this.</translate> <translate><!--T:56--> (This is an extra layer of security against an attacker trying to steal credentials during authorisation.)</translate> <translate><!--T:57--> If the <code>use as prefix</code> option is enabled, the URL must start with this (the check is dumb so make sure to add at least a <tvar name=1><code>/</code></tvar> after the domain name), otherwise it must be an exact match.</translate> <translate><!--T:58--> If you are developing/testing your local machine, specify [[w:Localhost|Localhost]] in this field (e.g. <tvar name=1><code><nowiki>http://localhost:8080/</nowiki></code></tvar>).</translate> * <code>Applicable project</code> (<translate><!--T:104--> for wiki farms only</translate>): <translate><!--T:105--> project(s) on which to use your application.</translate> <translate><!--T:59--> You can limit the application to a single wiki or have it work everywhere.</translate> * <code>Types of grants</code> / <code>Applicable grants</code>: <translate><!--T:60--> the permissions needed by your application (be conservative). The actual permissions will be an intersection of this and what permissions the user has.</translate> <translate><!--T:61--> Currently, the user must authorise grouped permissions, not individual ones (<tvar name=1>[[Phab:T59505|T59505]]</tvar>).</translate> * <code>Allowed IP ranges</code>: <translate><!--T:62--> an optional specification of the IP ranges that you use, where OAuth requests not matching this will be rejected.</translate> <translate><!--T:63--> This is an extra layer of security against an attacker stealing your application's credentials and trying to impersonate it.</translate> <translate><!--T:64--> This is one of the few settings that you'll be able to change later.</translate> * <code>Public RSA key</code> (<translate><!--T:106--> <tvar name=1>OAuth 1.0a</tvar> only</translate>): <translate><!--T:65--> public key used by your application for signing requests.</translate> <translate><!--T:66--> You can just leave this empty (most applications do) to use a slightly simpler shared-secret mechanism instead.</translate> <translate><!--T:67--> This is one of the few settings that you'll be able to change later.</translate> <translate><!--T:68--> After registration, you'll receive the credentials needed to use OAuth.</translate> <translate><!--T:69--> You will be able to use it immediately with your own user account (this is meant for testing); others will only be able to use it once it is approved by an administrator.</translate> <translate> <!--T:45--> The list of applications (approved or otherwise) is public and can be browsed at <tvar name=1><code>[[m:Special:OAuthListConsumers|Special:OAuthListConsumers]]</code></tvar>. === OAuth 1.0a === <!--T:33--> ==== Authorisation ==== <!--T:6--> </translate> [[File:OAuth authorization interface.png|thumb|<translate><!--T:70--> Authorisation dialog shown to users</translate>]] <translate> <!--T:71--> When registering the application, you receive two pieces of credentials: the application token (a public ID for the application) and the application secret (sort of like a password). </translate> <translate><!--T:72--> To be able to identify a user or make API requests in their name, you need to get another set of credentials (these ones specific to that user): the access token and access secret.</translate><ref> <translate><!--T:73--> With an RSA key the credentials are slightly different.</translate> <translate><!--T:74--> It is assumed that people choosing to use an RSA key know what they are doing, so this tutorial will assume you have chosen the non-RSA option.</translate> </ref> <translate><!--T:75--> To get them, you need to go through the authorisation process, which consists of three steps:</translate><ref> <translate><!--T:76--> This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</translate> <translate><!--T:77--> See {{<tvar name=1>ll|OAuth/Owner-only consumers</tvar>|owner-only consumers}} for that.</translate> </ref> # <translate><!--T:78--> Get a request token from the wiki by sending a GET request to <tvar name=1><code>Special:OAuth/initiate</code></tvar>, signed with the application key and secret, with the callback URL (where the user will be sent after a successful authorisation) passed as the <tvar name=2><code>oauth_callback</code></tvar> query parameter (if you have set a constant URL at registration, the value of the parameter ''must'' be <tvar name=3><code>oob</code></tvar>).</translate><ref name="non-nice-url"><translate><!--T:79--> Due to <tvar name=3>[[phab:T59500]]</tvar> you must currently use a non-nice URL such as <tvar name=2><code>en.wikipedia.org/w/index.php?title=Special:OAuth/initiate</code></tvar>.</translate></ref> <translate><!--T:80--> If you are successful, the response will be a JSON object with <tvar name=1><code>token</code></tvar> and <tvar name=2><code>key</code></tvar> fields—the request token and request secret.</translate> <translate><!--T:81--> (If not, it will have an <tvar name=3><code>error</code></tvar> field.)</translate> # <translate><!--T:82--> Ask the user to authorise the application by sending them to <tvar name=1><code>Special:OAuth/authorize</code></tvar>, with the application token and request token passed as query parameters (<tvar name=2><code>oauth_consumer_key</code></tvar> and <tvar name=3><code>oauth_token</code></tvar>, respectively).</translate> <translate><!--T:84--> The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</translate> # <translate><!--T:85--> If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</translate> <translate><!--T:86--> A query parameter called <tvar name=1><code>oauth_verifier</code></tvar> will contain the verification code that you can use to exchange the request token and secret for the access token and secret.</translate> <translate><!--T:87--> To do this, send a request to <tvar name=1><code>Special:OAuth/token</code><ref name="non-nice-url" /></tvar> which includes the <tvar name=2><code>oauth_verifier</code></tvar> parameter you just received and is signed with the application token and secret and the request token and secret.</translate> <translate><!--T:88--> The response will contain the access token/secret (in the same format as the request token/secret in step 1).</translate> <translate><!--T:46--> The access token and secret is what you'll need to sign API requests.</translate> <translate><!--T:47--> The request token and secret is not useful anymore and can be discarded.</translate> <translate><!--T:48--> The access token will remain valid indefinitely, unless the user revokes it.</translate> <translate><!--T:49--> (If you prefer not to store it, you can just repeat the authorisation process at any time though.)</translate> <translate><!--T:50--> Applications which only need minimal privileges (have been registered as ''User identity verification only'') can use <tvar name=1><code>/authenticate</code></tvar> instead of <tvar name=2><code>/authorize</code></tvar> in step 2.</translate> <translate><!--T:51--> This works the same way, but the user will only see the authorisation dialog if they have not authorised this application before; otherwise the authorisation will silently succeed.</translate> <translate><!--T:52--> Chances are whatever language/framework you are using will have a library to support this procedure, so you don't have to implement it manually—each step will be a single function call.</translate> <translate><!--T:53--> See below for examples.</translate> <translate> ==== Making requests on the user's behalf ==== <!--T:7--> </translate> <translate><!--T:89--> To take advantage of the authorisation, requests have to be signed with the application token/secret and access token/secret.</translate> <translate><!--T:90--> When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</translate> <translate><!--T:91--> Only API requests can be made via OAuth, with one exception (see next section).</translate> <translate><!--T:108--> Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</translate> <translate> <!--T:92--> Applications registered as ''User identity verification only'' cannot use the API at all. ==== Identifying the user ==== <!--T:8--> </translate> <translate><!--T:93--> The OAuth extension includes a custom protocol (similar to OpenID Connect) for authenticating the user.</translate> <translate><!--T:94--> To use this, send a signed OAuth request to <tvar name=1><code>Special:OAuth/identify</code></tvar>:</translate><ref name="non-nice-url" /> <translate><!--T:95--> the response will be a [[w:JSON Web Token|JWT]] (<tvar name=1>JSON Web Token</tvar> &ndash; a signed JSON object) including the name of the user, their {{<tvar name=2>ll|Manual:Central ID</tvar>|central ID}} (under the key <tvar name=3><code>sub</code></tvar>) and various other information (such as their user groups and whether they are blocked; also the email address if the application was registered with the right grant type).</translate> <translate><!--T:96--> This is more secure than using the API (e.g. the userinfo module) for authentication, which could be subject to [[w:Man-in-the-middle attack|man-in-the-middle attacks]]; always use this if you need to identify a user!</translate> <translate><!--T:97--> Also, make sure you properly validate the JWT (there are many libraries which can help with that).</translate> <translate><!--T:98--> You should check each of the following: the issuer (<tvar name=1><code>iss</code></tvar>) matches the domain name of the wiki, the audience (<tvar name=2><code>aud</code></tvar>) matches your application key, the issued-at time (<tvar name=3><code>iat</code></tvar>) is in the past and reasonably close to current time, the expiration time (<tvar name=4><code>exp</code></tvar>) is in the future, the nonce (<tvar name=5><code>nonce</code></tvar>) matches the one you sent in the request.</translate> <translate> ==== Signing requests ==== <!--T:9--> </translate> <translate><!--T:99--> Steps 1 and 3 of the authorisation process require signing the request; API requests and <tvar name=1><code>Special:OAuth/identify</code></tvar> must likewise be signed.</translate> <translate><!--T:100--> The signing process is detailed in [<tvar name=url>https://oauth.net/core/1.0a/#signing_process</tvar> section 9 of the OAuth spec], but it is cumbersome to implement by hand and [<tvar name=url2>https://oauth.net/1/</tvar> many libraries] are available.</translate> <translate><!--T:101--> You can find code samples and an overview of how to do it by hand in the {{<tvar name=1>ll|OAuth/Owner-only_consumers</tvar>|owner-only consumer}} documentation.</translate> (<translate><!--T:102--> That is for signing with the consumer token/secret and access token/secret.</translate> <translate><!--T:103--> Modify as appropriate to sign with the consumer token/secret and request token/secret (authorisation step 3) or consumer token/secret only (authorisation step 1).</translate>) <translate> === OAuth 2 === <!--T:34--> ==== Authorisation ==== <!--T:35--> </translate> <translate><!--T:112--> When registering the application, you receive two pieces of credentials: the client application key (a public ID for the application, also called the client ID or consumer key) and the client application secret (a confidential password).</translate> <translate><!--T:113--> To be able to identify a user or make API requests in their name, you need to get another credential (this one specific to that user): the access token.</translate> <translate><!--T:114--> To get it, you need to go through the [<tvar name=url>https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/</tvar> the OAuth 2 Authorization Code flow], which consists of two steps:</translate><ref><translate><!--T:115--> This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</translate> <translate><!--T:116--> See [[<tvar name=1>Special:MyLanguage/OAuth/Owner-only consumers</tvar>|owner-only consumers]] for that.</translate></ref> # <translate><!--T:117--> Ask the user to authorise the application by sending them to <tvar name=1><code>oauth2/authorize</code></tvar> under the wiki's REST endpoint (usually <tvar name=2><code>rest.php</code></tvar>), with <tvar name=3><code>response_type=code</code></tvar> and the consumer key (also called the client application key) as the <tvar name=4><code>client_id</code></tvar>, possibly a <tvar name=5><code>state</code></tvar> if you want, and optionally the <tvar name=6><code>redirect_uri</code></tvar> (if yes, it must be the same as in your application request).</translate> <translate><!--T:118--> If your consumer is non-confidential, you'll also need to include a [<tvar name=url>https://www.oauth.com/oauth2-servers/pkce/authorization-request/</tvar> PKCE code challenge] (<tvar name=1><code>code_challenge</code></tvar> and <tvar name=2><code>code_challenge_method=S256</code></tvar>).</translate><ref>PKCE &mdash; Proof Key for Code Exchange</ref> <translate><!--T:119--> The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</translate> # <translate><!--T:120--> If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</translate> <translate><!--T:121--> A query parameter called <tvar name=1><code>code</code></tvar> will contain the authorisation code that you can use to fetch the access token.</translate> <translate><!--T:122--> To do this, send a POST request to <tvar name="access"><code>oauth2/access_token</code></tvar> under the wiki's REST endpoint (usually <tvar name=1><code>rest.php</code></tvar>), including <tvar name=3><code>grant_type=authorization_code</code></tvar>, the <tvar name=4><code>code</code></tvar> parameter you just received, your client authentication (typically as <tvar name=5><code>client_id</code></tvar> and, for confidential clients, <tvar name=6><code>client_secret</code></tvar>), the <tvar name=7><code>redirect_uri</code></tvar> if and only if you specified it in the previous step (must be the same value for both), and if non-confidential the PKCE <tvar name=8><code>code_verifier</code></tvar> and <tvar name=9><code>code_challenge_method</code></tvar>.</translate> <translate><!--T:123--> The response will contain the access token and a refresh token.</translate> <translate><!--T:124--> The access token is what you'll need to send future API requests.</translate> <translate><!--T:125--> The refresh token can be used to [<tvar name=url>https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/</tvar> fetch a new access token] if the original access token expires.</translate> <translate><!--T:126--> If you prefer not to store either token, you can just repeat the authorisation process at any time.</translate> <translate><!--T:127--> (Before MediaWiki 1.46, non-confidential clients could only use refresh tokens using their client secret keys, not using their client IDs only, see <tvar name=1>[[phabricator:T323855|T323855]]</tvar>.)</translate> <translate><!--T:128--> Chances are whatever language/framework you are using will have a library to support this procedure so you don't have to implement it manually - each step will be a single function call.</translate> <translate><!--T:129--> See below for examples.</translate> <translate> ==== Making requests on the user's behalf ==== <!--T:36--> </translate> <translate><!--T:130--> To take advantage of the authorisation, requests have to include the access token.</translate> <translate><!--T:131--> When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</translate> <translate><!--T:132--> Only API requests can be made via OAuth 2.</translate> <translate><!--T:133--> Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</translate> <translate><!--T:134--> If the access token is used to fetch a CSRF token or other tokens, the access token must still be passed (as a header) with requests that use those tokens.</translate> <translate> <!--T:135--> Applications which need minimal privileges (have been registered as ''User identity verification only'') cannot use the API at all. <!--T:136--> API requests including <tvar name=1><code>rest.php/oauth2/resource/profile</code></tvar> must be authenticated with an HTTP Authorization header containing the access token, like: </translate> <pre> Authorization: Bearer abcde....6789 </pre> <translate> ==== Identifying the user ==== <!--T:37--> </translate> <translate><!--T:137--> The OAuth extension includes a somewhat incomplete implementation of OpenID Connect for authenticating the user.</translate><ref><translate><!--T:138--> See <tvar name=1>[[phab:T254063|T254063]]</tvar> for details.</translate></ref> <translate><!--T:139--> To use this, send an authenticated OAuth GET request to the <tvar name=1><code>oauth2/resource/profile</code></tvar> API (MediaWiki's implementation of what the OIDC spec calls the UserInfo endpoint) under the wiki's REST endpoint (usually <tvar name=2><code>rest.php</code></tvar>); the response will include the name of the user and various other information.</translate> <translate><!--T:140--> Note that the GET request must use the HTTP <code>Authorization</code> header, not a query string token.</translate> * '''sub''' <translate><!--T:155--> (central user ID)</translate> * '''username''' * '''editcount''' * '''confirmed_email''' * '''blocked''' * '''registered''' * '''groups''' * '''rights''' * '''realname''' <translate><!--T:141--> (only if user granted permission)</translate> * '''email''' <translate><!--T:142--> (only if user granted permission)</translate> <translate> == Setting up a development environment == <!--T:10--> <!--T:156--> You can register an OAuth application on [<tvar name=url>https://meta.wikimedia.beta.wmflabs.org/wiki/Special:OAuthConsumerRegistration/propose</tvar> beta meta] and test your code against that. </translate> <translate><!--T:157--> If you want to improve the extension itself, or debug protocol issues in detail, OAuth is available in the <tvar name=1>{{ll|MediaWiki-Vagrant}}</tvar> development environment.</translate> <translate><!--T:158--> Add the <tvar name=1><code>oauth</code></tvar> role, and your local wiki will be able to authorise OAuth apps.</translate> <syntaxhighlight lang="shell-session"> $ vagrant roles enable oauth $ vagrant provision </syntaxhighlight> <translate><!--T:159--> Once the code is nearly ready, you can register an OAuth application on the real wiki.</translate> <translate><!--T:160--> You will be able to test it with the same user account used for registering, even before it gets reviewed by admins.</translate> <translate> <!--T:161--> If you are creating an application for Wikimedia projects, consider hosting it at [[<tvar name=1>Wikitech:Portal:Toolforge</tvar>|Wikimedia Toolforge]], a free tool forge and hosting platform for Wikimedia-related services. == Security benefits and trade-offs == <!--T:11--> </translate> * <translate><!--T:162--> Unlike password-based authentication, the OAuth 1.0 protocol prevents any [[w:Man-in-the-middle attack|man-in-the-middle attack]] even if the wiki does not require HTTPS: all interactions between MediaWiki and the application are signed with either a shared secret (using HMAC-SHA1), or a [[w:Public-key cryptography|public key]] (RSA).</translate> <translate><!--T:163--> HTTPS is still required for certain steps though (for obtaining the shared secret in the second step of authorisation when not using RSA, and during app registration).</translate> <translate><!--T:164--> OAuth 2.0 does not involve signing and relies on HTTPS for security.</translate> * <translate><!--T:165--> Actions via OAuth happen under the user's name but will be [[<tvar name=1>Special:MyLanguage/Manual:Tags</tvar>|tagged]] with the application's name as well so rogue applications can be identified.</translate> <translate><!--T:166--> Wiki admins can revoke the application's permissions (and thus bar it from any further action) if needed.</translate> * <translate><!--T:167--> The user can revoke the permission of the application to use that specific user account if they don't like how it works or don't trust it anymore.</translate> <translate><!--T:168--> Unlike a password change, this is not disruptive for the user.</translate> * <translate><!--T:169--> Sufficiently flexible applications might allow users to circumvent IP blocks (since MediaWiki will see the IP of the application server, not that of the user).</translate> <translate><!--T:170--> This can be handled the same way proxies are, by trusting XFF headers set by the application (see <tvar name=1>[[Phab:T159889|T159889]]</tvar> for some limitations).</translate> * <translate><!--T:171--> The application secret must be kept secret.</translate> <translate><!--T:172--> Submitting it to source control or putting it into user-accessible code (such as mobile app or desktop application; even if it is obfuscated) undermines the security model and will result in admins forcefully disabling the application.</translate> <translate><!--T:173--> Exceptions are made for example applications demoing OAuth usage, if they are explicitly labeled as such and request limited rights.</translate> <translate> == Libraries == <!--T:12--> </translate> === PHP === * [[oauthclient-php]] – <translate><!--T:174--> OAuth 1.0a client library maintained by Wikimedia</translate> * [https://php.net/book.oauth OAuth] – <translate><!--T:175--> PECL client library</translate> * [https://github.com/firebase/php-jwt firebase/php-jwt] – <translate><!--T:176--> a popular JWT library</translate> * [https://sr.ht/~taavi/laravel-socialite-mediawiki/ laravel-socialite-mediawiki] – <translate><!--T:177--> MediaWiki driver for [[w:Laravel|Laravel]]'s [<tvar name=url>https://laravel.com/docs/7.x/socialite</tvar> Socialite] library.</translate> === Python === * [https://github.com/valhallasw/flask-mwoauth flask-mwoauth] – <translate><!--T:178--> a Flask blueprint to run OAuth against MediaWiki's Extension:OAuth (See tutorial: [<tvar name=url>https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Flask_OAuth_tool</tvar> My first Flask OAuth tool])</translate> * [https://github.com/wikimedia/MediaWiki-OAuth MediaWiki-OAuth (mwoauth)] – <translate><!--T:179--> OAuth 1.0a on top of [<tvar name=url>http://requests-oauthlib.readthedocs.org/en/latest/oauth1_workflow.html</tvar> requests-oauthlib]</translate> * [https://github.com/python-social-auth/social-core python-social-auth] – <translate><!--T:180--> auth framework that includes a [<tvar name=url1>https://github.com/python-social-auth/social-core/blob/master/social_core/backends/mediawiki.py</tvar> MediaWiki backend] (Example tutorial: [<tvar name=url2>https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Django_OAuth_tool</tvar> My first Django OAuth tool])</translate> * [https://docs.authlib.org/en/latest/index.html authlib] – <translate><!--T:181--> auth framework to interact with Wikimedia OAuth 2.0 API (Full minimal Django OAuth 2.0 [<tvar name=url>https://code.basabuuka.org/alpcentaur/wmde_oauth_django_example</tvar> example])</translate> * [https://github.com/jpadilla/pyjwt pyjwt] – <translate><!--T:182--> a JWT library</translate> === Ruby === * [https://github.com/timwaters/omniauth-mediawiki omniauth-mediawiki] – <translate><!--T:183--> a MediaWiki strategy for OmniAuth (also available as a [<tvar name=url>https://rubygems.org/gems/omniauth-mediawiki</tvar> gem])</translate> === Rust === * [https://crates.io/crates/mediawiki MediaWiki crate] <translate><!--T:184--> implements both OAuth1 and OAuth2 login mechanisms.</translate> * [https://crates.io/crates/oauth2 oauth2 crate] === Node.js === * [https://www.npmjs.com/package/passport-mediawiki-oauth passport-mediawiki-oauth] – <translate><!--T:185--> MediaWiki strategy for the Passport auth framework (which can be used effortlessly as a middleware with Express JS and similar frameworks)</translate> * [https://www.npmjs.com/package/oauth-fetch-json oauth-fetch-json] – <translate><!--T:186--> library for signing OAuth requests</translate> * [https://www.npmjs.com/package/m3api-oauth2 m3api-oauth2] – an extension package for [https://www.npmjs.com/package/m3api m3api], making it easy to make requests authenticated via [[Special:MyLanguage/Help:OAuth|OAuth 2.0]] === Go === * [https://github.com/mrjones/oauth mrjones/oauth] (OAuth 1.0) * [https://pkg.go.dev/golang.org/x/oauth2 golang.org/x/oauth2] <translate><!--T:187--> (OAuth 2.0, [<tvar name=url>https://pkg.go.dev/golang.org/x/oauth2#example-Config</tvar> example])</translate> === Java === * [https://github.com/scribejava/scribejava ScribeJava] <translate><!--T:188--> since version 5.5.0 ([<tvar name=url>https://github.com/scribejava/scribejava/pull/852</tvar> pull request])</translate> <translate> == Example code == <!--T:13--> === PHP client without using any libraries === <!--T:14--> </translate> [[toollabs:oauth-hello-world|OAuth Hello World]] – <translate><!--T:143--> easy to understand demo application written in PHP without any libraries.</translate> <translate> === PHP command-line client with RSA keys, using oauthclient-php === <!--T:144--> </translate> <translate><!--T:145--> PHP application using classes from the OAuth extension codebase.</translate> {{Todo|1=<translate><!--T:146--> convert this to actually use <tvar name=1>oauthclient-php</tvar>! Probably just a bunch of <tvar name=2><code>use</code></tvar> declarations.</translate>}} <translate><!--T:147--> Before Starting:</translate> <syntaxhighlight lang="shell-session"> $ openssl genrsa -out appkey.pem 4096 $ openssl rsa -in appkey.pem -pubout > appkey.pub </syntaxhighlight> {{Collapse_top|title=<translate><!--T:148--> PHP source code</translate>}} <syntaxhighlight lang="php"> <?php if ( PHP_SAPI !== 'cli' ) { die( "CLI-only test script\n" ); } /** * <translate nowrap><!--T:189--> A basic client for overall testing</translate> */ function wfDebugLog( $method, $msg) { //echo "[$method] $msg\n"; } require 'OAuth.php'; require 'MWOAuthSignatureMethod.php'; $consumerKey = ''; #$consumerSecret = ''; // <translate nowrap><!--T:190--> We don't need this, since we're using RSA, except to validate the /identify call</translate> $privateKey = file_get_contents( 'appkey.pem' ); $baseurl = 'http://<wiki>/wiki/Special:OAuth'; $endpoint_req = $baseurl . '/initiate?format=json&oauth_callback=oob'; // <translate nowrap><!--T:191--> <tvar name=1>format=json</tvar> makes php a little easier</translate> $endpoint_acc = $baseurl . '/token?format=json'; $endpoint_id = $baseurl . '/identify'; $c = new OAuthConsumer( $consumerKey, $privateKey ); // <translate nowrap><!--T:192--> Make sure we sign title and format</translate> $parsed = parse_url( $endpoint_req ); $extraSignedParams = array(); parse_str($parsed['query'], $extraSignedParams); $extraSignedParams['title'] = 'Special:OAuth/initiate'; $init_req = OAuthRequest::from_consumer_and_token( $c, // <translate nowrap><!--T:193--> OAuthConsumer for your app</translate> NULL, // <translate nowrap><!--T:194--> User token, NULL for calls to initiate</translate> "GET", // <translate nowrap><!--T:195--> http method</translate> $endpoint_req, // <translate nowrap><!--T:196--> endpoint url (this is signed)</translate> $extraSignedParams // <translate nowrap><!--T:197--> extra parameters we want to sign (must include title)</translate> ); $rsa_method = new MWOAuthSignatureMethod_RSA_SHA1( new OAuthDataStore(), $privateKey ); $init_req->sign_request( $rsa_method, // OAuthSignatureMethod $c, // <translate nowrap><!--T:198--> OAuthConsumer for your app</translate> NULL // <translate nowrap><!--T:199--> User token, NULL for calls to initiate</translate> ); echo "Getting request token with: $init_req\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, (string) $init_req ); // <translate nowrap><!--T:200--> Pass OAuth in GET params</translate> curl_setopt( $ch, CURLOPT_HTTPGET, true ); curl_setopt( $ch, CURLOPT_HEADER, false ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $requestToken = json_decode( $data ); print "Visit $baseurl/authorize?oauth_token={$requestToken->key}&oauth_consumer_key=$consumerKey\n"; // <translate nowrap><!--T:201--> ACCESS TOKEN</translate> print "Enter the verification code:\n"; $fh = fopen( "php://stdin", "r" ); $line = fgets( $fh ); $rc = new OAuthToken( $requestToken->key, $requestToken->secret ); $parsed = parse_url( $endpoint_acc ); parse_str($parsed['query'], $params); $params['oauth_verifier'] = trim($line); $params['title'] = 'Special:OAuth/token'; $acc_req = OAuthRequest::from_consumer_and_token( $c, $rc, "GET", $endpoint_acc, $params ); $acc_req->sign_request($rsa_method, $c, $rc); echo "Calling: $acc_req\n"; unset( $ch ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_acc ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $acc_req->to_header() ) ); // <translate nowrap><!--T:202--> Set the Authorization Header</translate> $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $acc = json_decode( $data ); $accessToken = new OAuthToken( $acc->key, $acc->secret ); /** * <translate nowrap><!--T:203--> Insecurely call the api for information about the user.</translate> * <translate nowrap><!--T:204--> A MITM can forge a response from the server, so don't rely on this for identity!</translate> */ $apiurl = 'http://<wiki>/w/api.php'; $apiParams = array( 'action' => 'query', 'meta' => 'userinfo', 'uiprop' => 'rights', 'format' => 'json', ); $api_req = OAuthRequest::from_consumer_and_token( $c, // Consumer $accessToken, // User Access Token "GET", // HTTP Method $apiurl, // Endpoint url $apiParams // Extra signed parameters ); $api_req->sign_request( $rsa_method, $c, $accessToken ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $apiurl . "?" . http_build_query( $apiParams ) ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $api_req->to_header() ) ); // <translate nowrap><!--T:205--> Authorization header required for api</translate> $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; /** * <translate nowrap><!--T:206--> Securely get the identity of the user</translate> */ $consumerSecret = ''; $extraSignedParams = array( 'title' => 'Special:OAuth/identify' ); $req = OAuthRequest::from_consumer_and_token( $c, $accessToken, "GET", $endpoint_id, $extraSignedParams ); $req->sign_request( $rsa_method, $c, $accessToken ); echo "Calling: '$endpoint_id'\nHeader: {$req->to_header()}\n\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_id ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $req->to_header() ) ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } $identity = JWT::decode( $data, $consumerSecret ); // <translate nowrap><!--T:207--> Validate the JWT</translate> if ( !validateJWT( $identity, $consumerKey, $req->get_parameter( 'oauth_nonce' ) ) ) { print "The JWT did not validate"; } else { print "We got a valid JWT, describing the user as:\n"; print " * Username: {$identity->username}\n"; print " * User's current groups: " . implode( ',', $identity->groups ) . "\n"; print " * User's current rights: " . implode( ',', $identity->rights ) . "\n"; } /** * <translate nowrap><!--T:208--> Validate a JWT, to ensure this isn't a reply, spoof, etc.</translate> * @param $identity <translate nowrap><!--T:209--> the decoded JWT</translate> * @param $consumerKey <translate nowrap><!--T:210--> your App's Key</translate> * @param $nonce <translate nowrap><!--T:211--> the nonce sent with your request, which should be returned</translate> */ function validateJWT( $identity, $consumerKey, $nonce ) { $expectedConnonicalServer = 'http://<wiki>'; // <translate nowrap><!--T:212--> Verify the issuer is who we expect (server sends <tvar name=1>$wgCanonicalServer</tvar>)</translate> if ( $identity->iss !== $expectedConnonicalServer ) { print "Invalid Issuer"; return false; } // <translate nowrap><!--T:213--> Verify we are the intended audience</translate> if ( $identity->aud !== $consumerKey ) { print "Invalid Audience"; return false; } // <translate nowrap><!--T:214--> Verify we are within the time limits of the token.</translate> // <translate nowrap><!--T:215--> Issued at (iat) should be in the past,</translate> // <translate nowrap><!--T:216--> Expiration (exp) should be in the future.</translate> $now = time(); if ( $identity->iat > $now || $identity->exp < $now ) { print "Invalid Time"; return false; } // <translate nowrap><!--T:217--> Verify we haven't seen this nonce before, which would indicate a replay attack</translate> if ( $identity->nonce !== $nonce ) { print "Invalid Nonce"; return false; } return true; } </syntaxhighlight> {{Collapse_bottom}} <translate> === Python command-line client using mwoauth === <!--T:15--> </translate> {{Collapse_top|title=<translate><!--T:149--> Python source code</translate>}} <syntaxhighlight lang="python"> from mwoauth import ConsumerToken, Handshaker import requests from requests_oauthlib import OAuth1 from six.moves import input # <translate nowrap><!--T:218--> For compatibility between python 2 and 3</translate> # <translate nowrap><!--T:219--> Consruct a "consumer" from the key/secret provided by MediaWiki</translate> import config # <translate nowrap><!--T:220--> You'll need to provide this</translate> # <translate nowrap><!--T:221--> Create a file called <tvar name=3>config.py</tvar> somewhere where it will be found by python, e.g. in the same directory as this script, with the following content (not including the <tvar name=4>#</tvar> characters!)</translate> # consumer_key = "<translate nowrap><!--T:229--> the consumer token you got when you registered your applicaton</translate>" # consumer_secret = "<translate nowrap><!--T:230--> the secret token you got when you registered your application</translate>" # <translate nowrap><!--T:222--> For example:</translate> # consumer_key = "20bc67da5081a30c736340c493f60d14" # consumer_secret = "af4313371bb2fb38e81fe7d300080085f52849f9" consumer_token = ConsumerToken(config.consumer_key, config.consumer_secret) # <translate nowrap><!--T:223--> Construct handshaker with wiki URI and consumer</translate> handshaker = Handshaker("https://en.wikipedia.org/w/index.php", consumer_token) # <translate nowrap><!--T:224--> Step 1: Initialise -- ask MediaWiki for a temporary key/secret for user</translate> redirect, request_token = handshaker.initiate() # <translate nowrap><!--T:225--> Step 2: Authorise -- send user to MediaWiki to confirm authorisation</translate> print("Point your browser to: %s" % redirect) # response_qs = input("Response query string: ") # <translate nowrap><!--T:226--> Step 3: Complete -- obtain authorised key/secret for "resource owner"</translate> access_token = handshaker.complete(request_token, response_qs) # <translate nowrap><!--T:227--> Construct an auth object with the consumer and access tokens</translate> auth1 = OAuth1(consumer_token.key, client_secret=consumer_token.secret, resource_owner_key=access_token.key, resource_owner_secret=access_token.secret) # <translate nowrap><!--T:228--> Now, accessing the API on behalf of a user</translate> print("Reading top 10 watchlist items") response = requests.get( "https://en.wikipedia.org/w/api.php", params={ 'action': "query", 'list': "watchlist", 'wllimit': 10, 'wlprop': "title|comment", 'format': "json" }, auth=auth1 ) for item in response.json()['query']['watchlist']: print("{title}\t{comment}".format(**item)) </syntaxhighlight> {{Collapse_bottom}} <translate> === Python Toolforge tutorial using mwoauth === <!--T:16--> <!--T:17--> See: </translate> [[wikitech:Help:Toolforge/My first Flask OAuth tool]] === Python Toolforge tutorial using authlib (OAuth 2.0) === {{Collapse_top|title=Python source code}} <syntaxhighlight lang="python"> # > requirements.txt # flask==3.1.3 # requests==2.33.1 # authlib==1.7.0 # > config.py OAUTH_ACCESS_TOKEN_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/access_token" OAUTH_API_BASE_URL = "https://commons.wikimedia.org/w/" OAUTH_AUTHORIZE_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/authorize" OAUTH_CODE_CHALLENGE_METHOD = "S256" OAUTH_CONSUMER_KEY = "Y" OAUTH_CONSUMER_SECRET = "Z" OAUTH_SCOPE = "basic editpage" # > app.py from authlib.integrations.flask_client import FlaskOAuth2App, OAuth from flask import Flask, jsonify, redirect, request, session from requests import Response app = Flask() app.config.from_pyfile("config.py") oauth = OAuth(app) oauth.register( name="mediawiki", client_id=app.config["OAUTH_CONSUMER_KEY"], client_secret=app.config["OAUTH_CONSUMER_SECRET"], client_kwargs={ "code_challenge_method": app.config["OAUTH_CODE_CHALLENGE_METHOD"], "scope": app.config["OAUTH_SCOPE"], }, api_base_url=app.config["OAUTH_API_BASE_URL"], access_token_url=app.config["OAUTH_ACCESS_TOKEN_URL"], authorize_url=app.config["OAUTH_AUTHORIZE_URL"], ) oauth_client: FlaskOAuth2App = oauth.create_client("mediawiki") @app.route("/") def index(): return app.send_static_file("index.html") @app.route("/login") def login(): return oauth_client.authorize_redirect() @app.route("/oauth-callback") def auth(): token = oauth_client.authorize_access_token() session["token"] = token return redirect("/") @app.route("/logout") def logout(): session.pop("token", None) session.clear() return redirect("/") @app.route("/user") def user(): response: Response = oauth_client.request( "GET", "rest.php/oauth2/resource/profile", token=session["token"], ) user = response.json() response.raise_for_status() return jsonify(user=user) @app.route("/edit", methods=["POST"]) def edit(): data = request.get_json() pageid = int(data["pageid"]) response: Response = oauth_client.request( "POST", "api.php", token=session["token"], data=dict( format="json", formatversion="2", action="query", pageids=str(pageid), prop="revisions|wbentityusage", rvprop="content", rvslots="*", meta="tokens", ), ) r = response.json() token = r["query"]["tokens"]["csrftoken"] ... </syntaxhighlight> {{Collapse_bottom}} <translate> === Go command-line client using mrjones/auth (OAuth 1.0) === <!--T:18--> <!--T:19--> Before you begin: </translate> <syntaxhighlight lang="shell-session"> $ go get github.com/mrjones/oauth </syntaxhighlight> {{Collapse_top|title=<translate><!--T:150--> Go source code</translate>}} <syntaxhighlight lang="go"> package main import ( "fmt" "os" "github.com/mrjones/oauth" "io/ioutil" "strconv" ) func main() { var consumerKey string = "" var consumerSecret string = "" if len(consumerKey) == 0 || len(consumerSecret) == 0 { os.Exit(1) } c := oauth.NewConsumer( consumerKey, consumerSecret, oauth.ServiceProvider{ RequestTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/initiate", AuthorizeTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/authorize", AccessTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/token", }) c.Debug(true) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/initiate", } c.AdditionalAuthorizationUrlParams = map[string]string{ "oauth_consumer_key": consumerKey, } requestToken, url, err := c.GetRequestTokenAndUrl("oob") if err != nil { fmt.Println( err ) } fmt.Println( "Got token " + requestToken.Token ) fmt.Println("(1) Go to: " + url) fmt.Println("(2) Grant access, you should get back a verification code.") fmt.Println("(3) Enter that verification code here: ") verificationCode := "" fmt.Scanln(&verificationCode) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/token", } accessToken, err := c.AuthorizeToken(requestToken, verificationCode) if err != nil { fmt.Println(err) } fmt.Println( "Got access token " + accessToken.Token ) c.AdditionalParams = map[string]string{} response, err := c.Get( "http://<wiki>/wiki/api.php", map[string]string{ "action": "query", "meta": "userinfo", "uiprop": "rights", "format": "json", }, accessToken) if err != nil { fmt.Println(err) } fmt.Println( "\tResponse Status: '" + response.Status + "'\n" ) fmt.Println( "\tResponse Code: " + strconv.Itoa(response.StatusCode) + "\n" ) bytes, _ := ioutil.ReadAll(response.Body) fmt.Println( "\tResponse Body: " + string(bytes) + "\n" ) } </syntaxhighlight> {{Collapse_bottom}} <translate> === JavaScript applications using OAuth 2 === <!--T:151--> </translate> * [https://github.com/wikimedia/apiclient-wiki wikimedia/apiclient-wiki] – <translate><!--T:152--> entire application in 520 lines of code</translate> <translate> === Full applications using OAuth === <!--T:20--> </translate> * [https://github.com/jdlrobson/weekipedia/blob/master/libs/server/app.js Weekipedia], <translate><!--T:153--> A full scale <tvar name=1>React.js</tvar> port of the Wikipedia mobile site uses both.</translate> * <translate><!--T:154--> many [<tvar name=url>https://toolhub.wikimedia.org/search?keywords__term=oauth</tvar> Toolforge tools]</translate> <translate> ==Notes== <!--T:21--> </translate> <references /> odq6a63aecf5oxsi5rpzcd7rdv60i83 Help:Extension:ParserFunctions/en 12 172931 8365008 8353925 2026-05-04T06:20:10Z FuzzyBot 451990 Updating to match new version of source page 8365008 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} The {{ll|Extension:ParserFunctions|nsp=0}} extension provides additional [[Special:MyLanguage/Parser functions|parser functions]] to supplement those already present in MediaWiki core. (See {{ll|Help:Magic words#Parser functions}}.) (It ''may'' be configured to provide additional parser functions for string handling; these are only available to non-Wikimedia Foundation wikis hence these string functions are documented {{ll|Extension:ParserFunctions/String functions|elsewhere}}.) All the parser functions provided by this extension take the form: :<code><nowiki>{{</nowiki>'''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Type ! {{hl1}} | Operators |- | {{hl2}} | Grouping (parentheses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Numbers | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | binary operator <code>'''e'''</code> &nbsp; unary <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unary | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binary | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Round | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Logic | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} This function evaluates a mathematical expression and returns the calculated value. This function is also available in {{ll|Extension:Scribunto|nsp=0}} via the <code>mw.ext.ParserFunctions.expr</code> function. :<code><nowiki>{{#expr:</nowiki> ''expression'' <nowiki>}}</nowiki></code> Basic example :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' The available operators are listed to the right, in order of precedence. See {{ll|Manual:Expr parser function syntax}} for more details of the function of each operator. The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language. When evaluating using [[w:boolean algebra|boolean algebra]], zero evaluates to {{phpi|false}}, and any nonzero value, positive or negative, evaluates to {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code>[[##iferror|#iferror]]</code> function: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals. For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. This is especially important in some languages, where numerals are translated. For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=The operator <code>mod</code> gives wrong results for some values of the second argument: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produces an empty string; should be 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.}} === Rounding === [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. {| class="wikitable" ! {{hl1}} | Test case ! {{hl1}} | Result ! {{hl1}} | Method of rounding |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || Final digit is < 5, so no apparent rounding occurs (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || Final digit is ≥ 5, so it is rounded up (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Again, the result is rounded up on the last digit, which results in additional rounding (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Rounded to nearest 100 because negative values round to the left of the decimal point |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Rounded to nearest 100th because positive values round to the right of the decimal point |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimals in the rounding index make no difference in the rounded result |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Decimal portion truncated (chopped off) |- ! colspan=3 {{hl2}} | Rounding to the nearest integer |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Down to the ''nearest'' integer, which is zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Up to the nearest integer, which is one |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Up to the nearest integer, which is one |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Up to the nearest integer, which is zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Down to the nearest integer, which is negative one |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Down to the nearest integer, which is negative one |- ! colspan=3 {{hl2}} | Rounding up or down with ''ceil'' and ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Up to the next ''larger'' integer, which is one |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Down to the next ''smaller'' integer, which is zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Up to the next larger integer, which is zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Down to the next smaller integer, which is negative one |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Not rounded, since 1 already is an integer<br />{{Warning|1=Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect}} |- ! colspan=3 {{hl2}} | Rounding large numbers |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Rounding to a very large number leads to infinity. Hence, the original value without the infinity is given as the answer. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Same as above. |} === Strings === Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. :<syntaxhighlight lang="wikitext" inline>{{#if: test string | value if test string is not empty | value if test string is empty (or only white space)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: first parameter | second parameter | third parameter }}</syntaxhighlight> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' The last parameter (false) may be omitted: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> You can also use a parameter as the test string in your <code>#if</code> statement. You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable. (So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=You entered text in variable 1 |2=There is no text in variable 1 }} See {{ll|Help:Parser functions in templates}} for more examples of this parser function. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result. If more comparisons and output strings are required, consider using <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> If both strings are valid numerical values, the strings are compared numerically: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Otherwise, the comparison is made as text; this comparison is case-sensitive: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(compare to similar example above, without the quotes)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)'' As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long. It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first. The template code is defined as: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> the following ensue: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. }} {{Warning|1=Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration. For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces. To work around this, apply the magic word to both parameters: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> One or both of the return strings can be omitted. If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous. If the <code>error</code> string is also omitted, an empty string is returned on an error: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category. == #ifexpr == This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. An empty input expression evaluates to {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparing :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' Boolean operators of equality or inequality operators are supported. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>. These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results. Consider these comparisons with the final digit changed: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly. Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' With the different digit, the result of equal is actually incorrect. This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations}} This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}. Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted. :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki) | '''doesn't exist''' (because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (because [[{{ns:8}}:Copyright]] has been customized) | '''doesn't exist''' (because [[{{ns:8}}:Copyright]] has not been customized) }} Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page. So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}. On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' If a local description page has been created for the file, the result is '''exists''' for all of the above. <code>#ifexist:</code> does not work with interwiki links. === ifexist limits === <code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates). When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]]. The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki. For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages). Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed. === ifexist and wanted pages === Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]]. See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround. == #rel2abs == This function converts a relative file path into an absolute filepath. :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> Within the <code>path</code> input, the following syntax is valid: *<code>.</code> → the current level *<code>..</code> → go up one level *<code>/foo</code> → go down one level into the subdirectory /foo If the <code>base path</code> is not specified, the full page name of the page will be used instead: :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored. Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements: :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]]. Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc. == #switch == ''See also: [[w:Help:Switch parser function]]'' This function compares one input value against several test cases, returning an associated string if a match is found. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Examples: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. === Default === The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>). If it does, it will be treated as a case comparison, and no text will display if no cases match. This is because the default value has not been defined (is empty). If a case matches however, its associated string will be returned. :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Default results declared in this way may be placed anywhere within the function: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> === Grouping results === It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>. The "<code>#default = </code>" in the last parameter may be omitted in the above case. === Use with parameters === The function may be used with parameters as the test string. In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>". (This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value. See {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>. If it equals <code>baz</code>, the function will return <code>Baz</code>. If the parameter is empty or does not exist, the function will return <code>Bar</code>. As in the section above, cases can be combined to give a single result. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>. If it equals <code>baz</code>, the function will return <code>Baz</code>. If the parameter is empty or does not exist, the function will return <code>Bar</code>. Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. This has the same effect as declaring the default result as empty. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value. The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result. :(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). === Comparison behavior === As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' A <code>''case''</code> string may be empty: :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' Once a match is found, subsequent <code>''cases''</code> are ignored: :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} === Raw equal signs === "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. Example: {| class="wikitable" ! You type ! You get |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]]. }} === Replacing #ifeq === <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. For example: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> is equivalent to * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> i.e. deep nesting, linear: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Code ! {{hl1}} | Description ! {{hl1}} | Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small> |- ! {{hl2}} colspan="3"| Year |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | 4-digit year. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | 2-digit year. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1 if it's a leap year, 0 if not. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|Requires PHP 5.1.0 and newer and [[rev:45208]].|group=note}} | ISO-8601 year of the specified week.{{#tag:ref|This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|Will output literal ''o'' if note 1 not fulfilled.|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Month |- | style="text-align: center;" | <code>n</code> | Month index, not zero-padded. | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | Month index, zero-padded. | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | An abbreviation of the month name, in the site language. | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | The full month name in the site language. | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc. | style="line-height: 1.6;" | For Polish:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominative)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitive) |- ! {{hl2}} colspan="3"| Day of the month or the year |- | style="text-align: center;" | <code>j</code> | Day of the month, not zero-padded. | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | Day of the month, zero-padded. | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1. | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Week and day of the week |- | style="text-align: center;" | <code>W</code> | ISO 8601 week number, zero-padded. | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | ISO 8601 day of the week (Monday = 1, Sunday = 7). | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | Number of the day of the week (Sunday = 0, Saturday = 6). | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | An abbreviation for the day of the week. Rarely internationalized. | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | The full weekday name. Rarely internationalized. | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hour |- | style="text-align: center;" | <code>a</code> | "am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Uppercase version of <code>a</code> above. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hour in 12-hour format, not zero-padded. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hour in 12-hour format, zero-padded. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hour in 24-hour format, not zero-padded. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hour in 24-hour format, zero-padded. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutes and seconds |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | Minutes past the hour, zero-padded. | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | Seconds past the minute, zero-padded. | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Unix time]]. Seconds since January 1 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Timezone identifier. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | Whether or not the date is in daylight savings time. | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Difference to Greenwich time (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Difference to Greenwich time (GMT), with colon | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Timezone abbreviation. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | Timezone offset in seconds. | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Miscellaneous |- | style="text-align: center;" | <code>t</code> | Number of days in the current month. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>. | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | [[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized. | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Non-Gregorian calendars |- ! {{hl3}} colspan="3" | Islamic |- | style="text-align: center;" | <code>xmj</code> | Day of the month. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Full month name. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Month index. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Full year. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iranian (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Number of days in the month. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Day of the year. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Day of the month. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Full month name. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Month index. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Full year. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | 2-digit year. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebrew |- | style="text-align: center;" | <code>xjj</code> | Day of the month. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Full month name. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Number of days in month. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Genitive form of the month name. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Month number. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Full year. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Thai solar |- | style="text-align: center;" | <code>xkY</code> | Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly. | {{#time:xkY}} |- ! {{hl3}} colspan="3" | Minguo/Juche year |- | style="text-align: center;" | <code>xoY</code> | Full year. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | Japanese nengo |- | style="text-align: center;" | <code>xtY</code> | Full year. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | Flags |- | style="text-align: center;" | <code>xn</code> | Format the next numeric code as a raw ASCII number. | In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06. |- | style="text-align: center;" | <code>xN</code> | colspan="2" | Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string. |- | style="text-align: center;" | <code>xr</code> | Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>. | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | Format the next number as a Hebrew numeral. | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> The list of accepted formatting codes is given in the table to the right. Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes). If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output. There are also two ways to escape characters within the formatting string: # A backslash followed by a formatting character is interpreted as a single literal character # Characters enclosed in double quotes are considered literal characters, and the quotes are removed. In addition, the digraph <code>xx</code> is interpreted as a single literal "x". As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua). So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead). :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function. Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted. :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). {{note|2=reminder|1=Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.}} See the following examples for details: :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correct) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (unsupported year format) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correct) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' (interpreted as a year with current month and day of the month) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correct) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' (interpreted as a year with current month and day of the month) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correct) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (unsupported year format) }} {{Warning|1= The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> (correct, no leap year), but :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' (wrong, even if 100 is interpreted as 2000, because that is a leap year) :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. }} Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= The fill-in feature is not consistent; some parts are filled in using the current values, others are not: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' Gives the start of the day, but the current day of the month and the current year. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' Gives the start of the day, but the current day of the year. There's exception case of the filled day: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' Gives the start of the day and the start of the month. }} A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' Input is treated as a time rather than a year+month code. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960. The function performs a certain amount of date mathematics: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.<ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> ==== Time Zone issue ==== There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} To workaround this issue, simply convert the time into minutes or seconds, like this: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} (Tim Starling, the developer of this function, provided the exact syntax for this solution.) ==== #time format like in signatures ==== Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages. On an English-language wiki, it can be created with: * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). Syntax of the function is: :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}}} [[File:Time-Timel.png|thumb|Example of the use of #time and #timel parser functions from a server where the timezone is not UTC]] For instance, see the following examples: :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid]] {{Warning|1= Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) :<code>U</code> Unix time. Seconds since January 1 1970 00:00:00 GMT. :<code>Z</code> Timezone offset in seconds. :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}). : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=''date/time object'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=''date/time object'' |2=''format type'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=''date/time object'' |2=''format type'' |3=''language code'' }} The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. The ''format type'' may be one of: ; <code>time</code> : Only the time is shown. ; <code>date</code> : Only the date is shown. ; <code>both</code> : Both the time and date are shown. ; <code>pretty</code> : Only the date is shown, using an abbreviated format which does not include the year. Not all languages support this; if it is not supported, the "date" format is used. If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. If the ''language code'' is not specified, the page's content language is used. Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. In English, the order of the day and month is controlled by {{wg|AmericanDates}}. Examples: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}. :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == This function separates a page title into segments based on slashes, then returns some of those segments as output. : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=pagename |2=number of segments to return |3=segment to start at }} If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' Strips one segment from the end of the string. See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' Strips all 4 segments from the end of the string : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' Strips 5 segments from the end of the string (more than exist) : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' Returns last segment. See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' Strips one segment from the end of the string, then returns the second segment and beyond : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' Start copying at the second last element; strip one segment from the end of the string Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). : For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>. : No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles. {{tip| 1= Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: * <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters). * <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters). * <syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters); * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''': * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: * <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter). The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category. }} Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: # All underscores are automatically replaced with spaces: #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' Not bah_boo, despite the underscore in the original. # The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string. The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]: #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls: #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized). #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' If lower case is needed, use lc: function to control output: : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string: : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Does not produce the expected: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags. : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". Does not work because "#" is also illegal in page titles. }} {{Warning|1= If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. The whole string is returned. It does not produce the expected: '''one''' }} {{Warning|1= This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned. }} == String functions == {{Main|Extension:ParserFunctions/String functions}} The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples. {{Warning |1=In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history). '''These functions do <strong>NOT</strong> work on Wikimedia wikis!'''<br/><br/>If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}. For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax. There are also individual [[w:Template:String-handling templates|String-handling templates]]. }} Here is a short overview of [[Module:String]] functions: * [[w:Module:String#len|&#35;len]] (length of string): <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] (substring): <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] (position of target): <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] (repeat): <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> == General points == === Substitution === Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists. {{Warning|1= The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]].}} Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. === Redirects === Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. === Escaping pipe characters === ==== In tables ==== Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers. To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge. This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded. It will then be interpreted as a table row or column separator. Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone. You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . {| class="wikitable" ! Description ! You type ! You get |- | Escaping pipe character as table row/column separator | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | Escaping pipe character as a plain character | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} ==== In template calls ==== The same pipe protection applies as for the following example: <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. === Stripping whitespace === Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' To prevent the trimming of then and else parts, see [[m:Template:If]]. Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces. :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' Beware that not all parameters are created equal. In ParserFunctions, whitespace at the beginning and end is always stripped. In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters: :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' == Other parser functions == === Case conversion functions === * '''Lowercase:''' {{xpdoc|lc: AbC|}} * '''Uppercase:''' {{xpdoc|uc: AbC|}} * '''Lowercase first character:''' {{xpdoc|lcfirst: AbC}} * '''Uppercase first character:''' {{xpdoc|ucfirst: abc}} === Encoding functions === * '''URL encoding:''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> renders as ---- "{{urlencode: AbC dEf ghi}}" ---- So inner new lines convert into %0A, and inner spaces convert into +. === Anchor encoding === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> renders as ---- {{anchorencode: AbC dEf ghi}} ---- == See also == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – an (incomplete) list of parser functions added by core and extensions. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – in particular for number formatting and padding * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} * Parser functions for Wikibase (the extensions that enables Wikidata): [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|How to use data on Wikimedia projects#Parser function]] == References == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] riupzgep008kirmw7e0189x9jwik6zs Translations:Help:Talk pages/1/id 1198 174302 8364340 8327688 2026-05-03T12:59:53Z ~2026-26810-06 18367607 Xavier 8364340 wikitext text/x-wiki Setiap laman wiki memiliki laman pembicaraan terkait yang dapat digunakan untuk berdiskusi dan berkomunikasi dengan pengguna lain. Laman pembicaraan dapat diakses dengan mengeklik [[$nav|tab]] “$talk” di bagian atas suatu laman. Cukup sunting laman seperti biasa untuk menambahkan komentar Anda.finance YourDomain nvhb2q4dy8n56vmucczcq7z60dxlbw5 8364382 8364340 2026-05-03T13:50:49Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-26810-06|~2026-26810-06]] ([[User talk:~2026-26810-06|talk]]) to last version by Clump 6947591 wikitext text/x-wiki !!FUZZY!!Setiap laman wiki memiliki laman pembicaraan terkait yang dapat digunakan untuk berdiskusi dan berkomunikasi dengan pengguna lain. Laman pembicaraan dapat diakses dengan mengeklik [[$nav|tab]] “$talk” di bagian atas suatu laman. Cukup sunting laman seperti biasa untuk menambahkan komentar Anda. mari2t4ykbp3a4ytiao32efaqi46rwa Help:Extension:ParserFunctions/bg 12 175003 8365003 8353918 2026-05-04T06:19:52Z FuzzyBot 451990 Updating to match new version of source page 8365003 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span lang="en" dir="ltr" class="mw-content-ltr">The {{ll|Extension:ParserFunctions|nsp=0}} extension provides additional [[Special:MyLanguage/Parser functions|parser functions]] to supplement those already present in MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">(It ''may'' be configured to provide additional parser functions for string handling; these are only available to non-Wikimedia Foundation wikis hence these string functions are documented {{ll|Extension:ParserFunctions/String functions|elsewhere}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">All the parser functions provided by this extension take the form:</span> :<code><nowiki>{{</nowiki><span lang="en" dir="ltr" class="mw-content-ltr">'''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ...</span> <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Operators</span> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Grouping (parentheses)</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Numbers</span> | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | <span lang="en" dir="ltr" class="mw-content-ltr">binary operator</span> <code>'''e'''</code> &nbsp; <span lang="en" dir="ltr" class="mw-content-ltr">unary</span> <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Unary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Binary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Round</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Logic</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} <span lang="en" dir="ltr" class="mw-content-ltr">This function evaluates a mathematical expression and returns the calculated value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This function is also available in {{ll|Extension:Scribunto|nsp=0}} via the <code>mw.ext.ParserFunctions.expr</code> function.</span> :<code><nowiki>{{#expr:</nowiki> ''<span lang="en" dir="ltr" class="mw-content-ltr">expression</span>'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The available operators are listed to the right, in order of precedence. See {{ll|Manual:Expr parser function syntax}} for more details of the function of each operator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> When evaluating using [[w:boolean algebra|boolean algebra]], zero evaluates to {{phpi|false}}, and any nonzero value, positive or negative, evaluates to {{phpi|true}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code>[[##iferror|#iferror]]</code> function: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Rounding === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Test case</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Result</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Method of rounding</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is < 5, so no apparent rounding occurs</span> (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is ≥ 5, so it is rounded up</span> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to the nearest integer</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the ''nearest'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding up or down with ''ceil'' and ''floor''</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next ''larger'' integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next ''smaller'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next larger integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next smaller integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Not rounded, since 1 already is an integer</span><br />{{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect</span>}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Strings === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: test string | value if test string is not empty | value if test string is empty (or only white space)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: first parameter | second parameter | third parameter }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Пример: {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Year</span> |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">4-digit year.</span> | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Month</span> |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour</span> |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Minutes and seconds</span> |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] oamohjrhc4brxjkido576r96edkxvft Translations:Help:Extension:ParserFunctions/Page display title/pt 1198 178974 8365055 7785385 2026-05-04T07:05:54Z RogueScholar 14671222 8365055 wikitext text/x-wiki Ajuda:Extensão:Funções do Analisador ongwh6kk930n7y8aaxkkhe3h6f5sfft Help:Extension:ParserFunctions/lb 12 187028 8365023 8353939 2026-05-04T06:20:55Z FuzzyBot 451990 Updating to match new version of source page 8365023 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span lang="en" dir="ltr" class="mw-content-ltr">The {{ll|Extension:ParserFunctions|nsp=0}} extension provides additional [[Special:MyLanguage/Parser functions|parser functions]] to supplement those already present in MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> (Sie ''kann'' konfiguriert werden, um zusätzliche Parser-Funktionen zur Vearbeitung von Strings zur Verfügung zu stellen, diese sind {{ll|Extension:ParserFunctions/String functions|anderswo}} dokumentiert.) <span lang="en" dir="ltr" class="mw-content-ltr">All the parser functions provided by this extension take the form:</span> :<code><nowiki>{{</nowiki><span lang="en" dir="ltr" class="mw-content-ltr">'''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ...</span> <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Typ ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Operators</span> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Grouping (parentheses)</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Zuelen | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | <span lang="en" dir="ltr" class="mw-content-ltr">binary operator</span> <code>'''e'''</code> &nbsp; <span lang="en" dir="ltr" class="mw-content-ltr">unary</span> <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Unary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Binary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Round</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Logic</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} <span lang="en" dir="ltr" class="mw-content-ltr">This function evaluates a mathematical expression and returns the calculated value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This function is also available in {{ll|Extension:Scribunto|nsp=0}} via the <code>mw.ext.ParserFunctions.expr</code> function.</span> :<code><nowiki>{{#expr:</nowiki> ''<span lang="en" dir="ltr" class="mw-content-ltr">expression</span>'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The available operators are listed to the right, in order of precedence. See {{ll|Manual:Expr parser function syntax}} for more details of the function of each operator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> When evaluating using [[w:boolean algebra|boolean algebra]], zero evaluates to {{phpi|false}}, and any nonzero value, positive or negative, evaluates to {{phpi|true}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code>[[##iferror|#iferror]]</code> function: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <span id="Rounding"></span> === Op- an Ofronnen === <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Test case</span> ! {{hl1}} | Resultat ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Method of rounding</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is < 5, so no apparent rounding occurs</span> (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is ≥ 5, so it is rounded up</span> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to the nearest integer</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the ''nearest'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding up or down with ''ceil'' and ''floor''</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next ''larger'' integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next ''smaller'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next larger integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next smaller integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Not rounded, since 1 already is an integer</span><br />{{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect</span>}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Strings === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: test string | value if test string is not empty | value if test string is empty (or only white space)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: éischte Parameter | zweete Parameter | drëtte Parameter }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' vergläichen :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <code>#ifexist:</code> funktionéiert net mat Interwiki-Linken. <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Beispill: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Beispill: {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | Beschreiwung ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Joer |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">4-digit year.</span> | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mount |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Stonn |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutten a Sekonnen |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | Islamesch |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] 5jlqk4td04w37e5xdi7s95q0t2by4y7 Help:Extension:ParserFunctions/pl 12 195372 8365026 8353942 2026-05-04T06:21:06Z FuzzyBot 451990 Updating to match new version of source page 8365026 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span class="mw-translate-fuzzy">Rozszerzenie {{ll|Extension:ParserFunctions|nsp=0}} zapewnia jedenaście dodatkowych [[Special:MyLanguage/Parser functions|funkcji parsera]], aby dopełnić {{$2|magiczne słowa}}, które już są obecne w MediaWiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> (''Może'' być skonfigurowane tak, żeby zapewnić dodatkowe funkcje parsera do obsługi łańcuchów; te funkcje łańcuchowe są udokumentowane {{ll|Extension:ParserFunctions/String functions|w innym miejscu}}.) Wszystkie funkcje parsera dostarczane przez to rozszerzenie mają postać: :<code><nowiki>{{</nowiki>'''#nazwafunkcji''': ''argument 1'' | ''argument 2'' | ''argument 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Typ ! {{hl1}} | Operatory |- | {{hl2}} | Grupowanie (nawiasy) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Liczby | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | binarny operator <code>'''e'''</code> &nbsp; unarny <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Jednoargumentowy | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Dwa | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Zaokrąglenie | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Logiczny | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Ta funkcja określa wartość liczbową wyrażenia matematycznego i zwraca obliczoną wartość. Funkcja jest również dostępna w {{ll|Extension:Scribunto|nsp=0}} poprzez funkcję <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''wyrażenie'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Dostępne operatory są wymienione po prawej stronie, w kolejności pierwszeństwa. Aby uzyskać więcej informacji na temat funkcji każdego operatora - patrz {{ll|Manual:Expr parser function syntax}} Dokładność i format zwróconego wyniku będzie się różnić w zależności od systemu operacyjnego serwera, na którym działa wiki, i od formatu liczbowego języka użytego na stronie. Podczas obliczania za pomocą [[:pl:Tablica_prawdy|algebry Boole'a]], zero odpowiada {{phpi|false}}, a każdą niezerową (dodatnią lub ujemną) wartość, reprezentuje {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Puste wyrażenie wejściowe zwraca pusty ciąg. Nieprawidłowe wyrażenia zwracają jeden z kilku komunikatów o błędach, które można przechwycić za pomocą funkcji <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' Kolejność argumentów dodawania i odejmowania przed lub po liczbie ma znaczenie i może być traktowana jako wartość dodatnia lub ujemna, a nie jako argument z błędnymi danymi wejściowymi: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Zauważ, że jeśli używasz wyjścia magicznych słów, musisz usunąć ich formatowanie, aby usunąć przecinki i przetłumaczyć cyfry. Na przykład, <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code> daje wynik {{NUMBEROFUSERS}}, podczas gdy potrzebujemy {{formatnum:{{NUMBEROFUSERS}}|R}}, który można uzyskać za pomocą <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Jest to szczególnie ważne w niektórych językach, w których tłumaczone są cyfry. Na przykład w języku bengalskim <nowiki>{{NUMBEROFUSERS}}</nowiki> daje ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=Operator <code>mod</code> daje błędne wyniki dla niektórych wartości drugiego argumentu: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (zwraca pusty ciąg; a powinen zwrócić 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Jeśli chcesz wykonywać obliczenia na datach (np. aby sprawdzić, czy konkretna data wypada w przeszłości), najpierw dokonaj konwersji dat na liczbę sekund od 1 stycznia 1970 (UTC) z wykorzystaniem <nowiki>{{#time: xNU }}</nowiki>, a potem stosuj operacje dodawania i odejmowania tak samo jak dla liczb.}} <span id="Rounding"></span> === Zaokrąglenie === [https://php.net/function.round Zaokrągla] liczbę po lewej stronie do określonej liczby cyfr po przecinku (tj. liczba stanie się wielokrotnością 1/10 podniesionej do odpowiedniej potęgi). Aby zaokrąglić w górę lub w dół, użyj odpowiednio <code>ceil</code> lub <code>floor</code>. {| class="wikitable" ! {{hl1}} | Wyrażenie ! {{hl1}} | Wynik ! {{hl1}} | Metoda zaokrąglania |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || Pierwsza ucinana cyfra jest mniejsza od 5, więc nie trzeba dokonywać żadnych zmian w tym, co pozostanie (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || Pierwsza ucinana cyfra jest większa lub równa 5, dlatego ostatnia zachowywana zostaje powiększona o jeden (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Znowu, ostatnia pozostawiana cyfra jest zwiększana, lecz powoduje to kaskadowe powiększanie kolejnych (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Zaokrąglone do setek, ponieważ liczby ujemne oznaczają miejsca na lewo od przecinka |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Zaokrąglone do części setnych, ponieważ liczby dodatnie oznaczają miejsca na prawo od przecinka |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Części dziesiętne w określeniu ilości cyfr do zachowania nie wpływają na wynik |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Część ułamkowa zostaje ucięta |- ! colspan=3 {{hl2}} | Zaokrąglanie do liczby całkowitej |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Zaokrągla w dół do ''najbliższej'' liczby całkowitej, którą jest zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Zaokrągla w górę do najbliższej liczby całkowitej, którą jest jeden |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Zaokrągla w górę do najbliższej liczby całkowitej, którą jest jeden |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Zaokrągla w górę do najbliższej liczby całkowitej, którą jest zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Zaokrągla w dół do najbliższej liczby całkowitej, którą jest minus jeden |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Zaokrągla w dół do najbliższej liczby całkowitej, którą jest minus jeden |- ! colspan=3 {{hl2}} | Zaokrąglanie w górę i w dół z użyciem podłogi i sufitu |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Zaokrągla w górę do najbliższej ''większej'' liczby całkowitej, którą jest jeden |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Zaokrągla w dół do najbliższej ''mniejszej'' liczby całkowitej, którą jest zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Zaokrągla w górę do najbliższej liczby całkowitej, którą jest zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Zaokrągla w górę do najbliższej liczby całkowitej, którą jest minus jeden |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Nie jest zaokrąglone, gdyż 1 jest już liczbą całkowitą<br />{{Warning|1=Interpretowane jako '''(ceil''' 1''')'''/3, nie '''ceil('''1/3''')'''}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <span id="Strings"></span> === Napisy === Wyrażenia działają jedynie z wartościami typu liczbowego. Nie są w stanie porównywać liter lub ciągów znaków. Do tego służy [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Ta funkcja ewaluuje wyrażenie i sprawdza, czy jego wynikiem jest pusty napis. Ciąg składający się jedynie z białych znaków jest uznawany za pusty. :<syntaxhighlight lang="wikitext" inline>{{#if: wyrażenie testowe | wartość, jeśli sprawdzane wyrażenie jest niepuste | wartość, jeśli sprawdzany ciąg jest pusty (lub zawiera tylko białe znaki)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: pierwszy parametr | drugi parametr | trzeci parametr }}</syntaxhighlight> Funkcja sprawdza, czy napis w pierwszym argumencie nie jest pusty. Jeśli zawiera jakiś tekst, to wyświetlana jest treść drugiego parametru. W przeciwnym wypadku (pusty napis lub białe znaki – np. spacje lub przejścia do nowej linii), wypisywany jest trzeci argument. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' Wyrażenie testowe jest zawsze interpretowane jako tekst. Wyrażenia matematyczne nie są obliczane (do tego użyj [[##ifexpr|#ifexpr]]): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' Ostatni parametr (dla pustego napisu) może być pominięty: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' Funkcję można zagnieżdżać. Aby to zrobić, umieść pełną formę funkcji #if w miejscu parametru dla innej funkcji #if. Dopuszczalne jest do siedmiu poziomów zagnieżdżenia, ale może to zależeć od konkretnej wiki oraz od limitu pamięci. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:wyrażenie testowe | wartość, jeśli sprawdzane wyrażenie jest niepuste |{{#if:wyrażenie testowe |wartość sprawdzenia wyrażeń niepustych |wartość, jeśli sprawdzany ciąg jest pusty (lub zawiera tylko białe znaki) }} }} </syntaxhighlight> <span class="mw-translate-fuzzy">Jako parametru możesz użyć wyrażenia testowego jak w <code>#if</code>. Upewnij się, że po nazwie zmiennej wpisałeś $1 (pionowa kreska).</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> (Tak więc parametr pozbawiony przypisanej mu wartości, interpretowany jest jako puste wyrażenie, a nie jako "<code><nowiki>{{{1}}}</nowiki></code>") :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Wpisałeś tekst pod zmienną 1 |2=Brak tekstu pod zmienną 1 }} Więcej przykładów funkcji analizatora składni - patrz {{ll|Help:Parser functions in templates}} {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Funkcja analizatora składni porównuje dwa wprowadzone wyrażenia, określa czy są one identyczne, i na podstawie wyniku zwraca jedno z nich Jeśli wymagane jest więcej porównań i zwracanych wyrażeń, rozważ użycie <code>#switch</code> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Wyrażenia w postaci ciągów liczbowych są porównywane numerycznie: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' porównanie :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == Ta funkcja przekształca względną ścieżkę pliku na bezwzględną ścieżkę pliku. :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> W parametrze <code>path</code> poniższa składnia jest właściwa: *<code>.</code> → obecny poziom *<code>..</code> → przejdź w górę o jeden poziom *<code>/foo</code> → przejdź o jeden poziom w dół do podkatalogu /foo Jeżeli <code>base path</code> nie jest zdefiniowane, zostanie użyta pełna nazwa strony: :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' Niewłaściwa składnia, np. <code>/.</code> bądź <code>/./</code>, jest ignorowana. Ponieważ dozwolone są nie więcej niż dwie kropki obok siebie, sekwencje takie jak te można wykorzystać do oddzielenia kolejnych instrukcji: :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Zobacz też: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Przykłady: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Przykład: {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Na przykład: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Kod ! {{hl1}} | Opis ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Rok |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Rok 4-cyfrowy. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Rok 2-cyfrowy. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1 jeśli rok jest przestępny, 0 w innych przypadkach. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Miesiąc |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(mianownik)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(dopełniacz) |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | Numer dnia tygodnia (niedziela = 0, sobota = 6). | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Godzina |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minuty i sekundy |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> Sekundy od 1 stycznia 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | Identyfikator strefy czasowej. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Różnica w stosunku do czasu Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Różnica w stosunku do czasu Greenwich (GMT), z dwukropkiem | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Skrót strefy czasowej. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | Ofset strefy czasowej w sekundach. | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | Liczba dni w tym miesiącu. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Kalendarze nie-gregoriańskie |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | Dzień miesiąca. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Pełna nazwa miesiąca. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dzień miesiąca. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Pełna nazwa miesiąca. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | Dzień miesiąca. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Pełna nazwa miesiąca. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | Flagi |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> Czasy bezwzględne (np. <code>20 December 2000</code>), względne (np. <code>+20 hours</code>) i połączone (np. <code>30 July +1 year</code>) są dozwolone. :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> Zobacz też {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> Zobacz też {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <span id="Redirects"></span> === Przekierowania === <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Opis ! Wpisujesz ! Otrzymujesz |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Zobacz też == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] 076ysylhs6naenb4psj8vj8o48i1lzn Help:Extension:ParserFunctions/bn 12 195434 8365004 8353921 2026-05-04T06:20:00Z FuzzyBot 451990 Updating to match new version of source page 8365004 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span lang="en" dir="ltr" class="mw-content-ltr">The {{ll|Extension:ParserFunctions|nsp=0}} extension provides additional [[Special:MyLanguage/Parser functions|parser functions]] to supplement those already present in MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">(It ''may'' be configured to provide additional parser functions for string handling; these are only available to non-Wikimedia Foundation wikis hence these string functions are documented {{ll|Extension:ParserFunctions/String functions|elsewhere}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">All the parser functions provided by this extension take the form:</span> :<code><nowiki>{{</nowiki><span lang="en" dir="ltr" class="mw-content-ltr">'''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ...</span> <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | ধরন ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Operators</span> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Grouping (parentheses)</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Numbers</span> | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | <span lang="en" dir="ltr" class="mw-content-ltr">binary operator</span> <code>'''e'''</code> &nbsp; <span lang="en" dir="ltr" class="mw-content-ltr">unary</span> <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Unary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Binary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Round</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Logic</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} <span lang="en" dir="ltr" class="mw-content-ltr">This function evaluates a mathematical expression and returns the calculated value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This function is also available in {{ll|Extension:Scribunto|nsp=0}} via the <code>mw.ext.ParserFunctions.expr</code> function.</span> :<code><nowiki>{{#expr:</nowiki> ''<span lang="en" dir="ltr" class="mw-content-ltr">expression</span>'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The available operators are listed to the right, in order of precedence. See {{ll|Manual:Expr parser function syntax}} for more details of the function of each operator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> When evaluating using [[w:boolean algebra|boolean algebra]], zero evaluates to {{phpi|false}}, and any nonzero value, positive or negative, evaluates to {{phpi|true}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code>[[##iferror|#iferror]]</code> function: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Rounding === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Test case</span> ! {{hl1}} | ফলাফল ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Method of rounding</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is < 5, so no apparent rounding occurs</span> (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is ≥ 5, so it is rounded up</span> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to the nearest integer</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the ''nearest'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding up or down with ''ceil'' and ''floor''</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next ''larger'' integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next ''smaller'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next larger integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next smaller integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Not rounded, since 1 already is an integer</span><br />{{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect</span>}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Strings === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: test string | value if test string is not empty | value if test string is empty (or only white space)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: first parameter | second parameter | third parameter }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Example: </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Year</span> |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">4-digit year.</span> | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Month</span> |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour</span> |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Minutes and seconds</span> |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | অগ্রেগরীয় পঞ্জিকাসমূহ |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== সময় অঞ্চল সমস্যা ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! বিবরণ ! আপনি লিখবেন ! আপনি পাবেন |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == আরও দেখুন == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == তথ্যসূত্র == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] oq87cps647vi062328acm0awff1qhvt Category:Time/eu 14 198760 8364456 6880078 2026-05-03T15:45:24Z Hiyuune 17854348 Created page with "$1" 8364456 wikitext text/x-wiki <languages /> [[Category:MediaWiki components{{#translation:}}]] na0nbjk82ivoahnb20sa6kbhyph7ykw Help:Extension:ParserFunctions/ru 12 209590 8365030 8353946 2026-05-04T06:21:18Z FuzzyBot 451990 Updating to match new version of source page 8365030 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} Расширение {{ll|Extension:ParserFunctions|nsp=0}} предоставляет [[Special:MyLanguage/Parser functions|функции парсера]] в дополнение к уже присутствующим в MediaWiki. (См. {{ll|Help:Magic words#Parser functions}}.) (Его ''можно'' настроить на предоставления дополнительных функций парсера для обработки строк; они доступны только для не Викимедиа-проектов, отчего эти строковые функции задокументированы в {{ll|Extension:ParserFunctions/String functions|другом месте}}.) Все функции парсера, предоставляемые этим расширением, имеют вид: :<code><nowiki>{{</nowiki>'''#имя_функции''': ''аргумент 1'' | ''аргумент 2'' | ''аргумент 3'' … <nowiki>}}</nowiki></code> == #expr == {{for|1='''более подробного описания''' работы средства вычисления выражений и её тонкостей, включая некоторые операторы, не упомянутые здесь|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Тип ! {{hl1}} | Операторы |- | {{hl2}} | Группировка (круглые скобки) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Числа | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | бинарный оператор <code>'''e'''</code> &nbsp; унарные <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Унарные | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Бинарные | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Округление | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Логические | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Эта функция вычисляет математическое выражение и возвращает вычисленное значение. Эта функция также доступна в {{ll|Extension:Scribunto|nsp=0}} через функцию <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''выражение'' <nowiki>}}</nowiki></code> Простой пример :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Доступные операторы перечислены справа в порядке очередности. Дополнительные сведения о функции каждого оператора см. в {{ll|Manual:Expr parser function syntax}}. Точность и формат возвращаемого результата будут варьироваться в зависимости от операционной системы сервера, на котором выполняется вики, и числового формата языка сайта. При вычислениях с использованием [[w:boolean algebra|булевой алгебры]] ноль оценивается как {{phpi|false}}, а любое ненулевое значение, положительное или отрицательное, оценивается как {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Пустое входное выражение возвращает пустую строку. Недопустимые выражения возвращают одно из нескольких сообщений об ошибке, которые могут быть перехвачены с помощью функции <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' Порядок сложения и вычитания операндов до или после числа имеет смысл и может рассматриваться как положительное или отрицательное значение, а не как операнд с ошибочным вводом: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Обратите внимание: если вы используете вывод магических слов, вы должны отформатировать их в необработанном виде, чтобы удалить запятые и перевести цифры. Например, <nowiki>{{NUMBEROFUSERS}}</nowiki> дает результат {{NUMBEROFUSERS}}, если мы хотим получить {{formatnum:{{NUMBEROFUSERS}}|R}}, можно использовать <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Это особенно важно в некоторых языках, где цифры переводятся. Например, в бенгальском языке <nowiki>{{NUMBEROFUSERS}}</nowiki> производит ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=Оператор <code>mod</code> дает неверные результаты для некоторых значений второго аргумента: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (создает пустую строку; должно быть 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Если вы хотите сделать расчеты на основе дат (напр. проверить, является ли текущая дата и время после какой-то другой даты и времени), сначала преобразуйте время в количество секунд после 1 января 1970 года по UTC, используя <nowiki>{{#time: xNU }}</nowiki>, затем вы можете просто складывать и вычитать даты как числа.}} <span id="Rounding"></span> === Округление === [https://php.net/function.round Округление] число слева до кратного 1/10, возведенного в степень, с показателем степени, равным усеченному значению числа, заданного справа. Для округления увеличением или уменьшением используйте унарные <code>ceil</code> или <code>floor</code> соответственно. {| class="wikitable" ! {{hl1}} | Тестовый пример ! {{hl1}} | Результат ! {{hl1}} | Метод округления |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || Конечная цифра < 5, поэтому явного округления не происходит (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || Конечная цифра ≥ 5, поэтому она округляется (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Опять же, результат округляется до последней цифры, что приводит к дополнительному округлению (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Округляется до ближайшей 100, так как отрицательные значения округляются слева от десятичной запятой |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Округляется до ближайшей 100-ой, потому что положительные значения округляются справа от десятичной запятой |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Десятичные дроби в индексе округления не влияют на результат округления |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Десятичная часть отсечена (отброшена) |- ! colspan=3 {{hl2}} | Округление до ближайшего целого числа |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Уменьшение до ''ближайшего'' целого числа, которое равно нулю |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Увеличение до ближайшего целого числа, которое равно единице |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Увеличение до ближайшего целого числа, которое равно единице |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Увеличение до ближайшего целого числа, которое равно нулю |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Уменьшение до ближайшего целого числа, которое равно отрицательной единице |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Уменьшение до ближайшего целого числа, которое равно отрицательной единице |- ! colspan=3 {{hl2}} | Округление увеличением или уменьшением с помощью ''ceil'' и ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Увеличение до следующего ''большего'' целого числа, которое равно единице |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Уменьшение до следующего ''меньшего'' целого числа, которое равно нулю |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Увеличение до следующего большего целого числа, которое равно нулю |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Уменьшение до следующего меньшего целого числа, которое является отрицательной единицей |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Не округлялось, так как 1 уже является целым числом<br />{{Warning|1=Интерпретируется как '''(ceil''' 1''')'''/3, а не '''ceil('''1/3''')''', как вы могли бы ожидать}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Округление до очень большого числа приводит к бесконечности. Следовательно, исходное значение без бесконечности является ответом. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | То же самое, что и выше. |} <span id="Strings"></span> === Строки === Выражения работают только с числовыми значениями, они не могут сравнивать строки или символы. Вместо этого можно использовать [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Функция определяет, является тестовая строка пустой или нет. Строка, содержащая только пробелы, считается пустой. :<syntaxhighlight lang="wikitext" inline>{{#if: тестовая строка | значение, если тестовая строка не пустая | значение, если тестовая строка пустая (или только пробелы)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: первый параметр | второй параметр | третий параметр }}</syntaxhighlight> Эта функция сначала проверяет, не пуст ли первый параметр. Если первый параметр не пуст, то функция выводит второй аргумент. Если первый параметр пуст или содержит только пробельные символы (пробелы, новые строки и т. д.) он отображает третий аргумент. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' Тестовая строка всегда интерпретируется как чистый текст, поэтому математические выражения не вычисляются (подробнее см. [[##ifexpr|#ifexpr]]): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' Последний параметр (ложь) может быть опущен: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' Функция может быть вложенной. Для этого вложите внутреннюю функцию <code>#if</code> в ее полном виде вместо параметра заключающей функции <code>#if</code>. Возможно до семи уровней вложенности, хотя это может зависеть от Вики или ограничения памяти. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:тестовая строка | значение, если тестовая строка не пуста |{{#if:тестовая строка |значение, если тестовая строка не пуста |значение, если тестовая строка пуста (или содержит только пробел) }} }} </syntaxhighlight> <span class="mw-translate-fuzzy">Вы также можете использовать параметр в качестве тестовой строки в операторе <code>#if</code>. Вам нужно убедиться, что $1 (символ вертикальной черты) добавлен после имени переменной.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> (Таким образом, если параметр не имеет значения, он вычисляется в пустую строку вместо строки «<code><nowiki>{{{1}}}</nowiki></code>».) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Вы ввели текст в переменную 1 |2=Нет текста в переменной 1 }} Дополнительные примеры этой функции парсера см. в разделе {{ll|Help:Parser functions in templates}}. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Эта функция парсера сравнивает две входные строки, определяет, идентичны ли они, и возвращает одну из двух строк на основе результата. Если требуется больше сравнений и выходных строк, рассмотрите возможность использования <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Если обе строки являются допустимыми числовыми значениями, то строки сравниваются численно: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' В противном случае сравнение производится как текст; это сравнение чувствительно к регистру: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(сравните с аналогичным примером выше, без кавычек)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(сравните с аналогичным примером выше, с <code>[[##expr|#expr]]</code>, возвращающим сначала допустимое число)'' В качестве практического примера рассмотрим существующий {{ll|Help:Templates|шаблон}} <code>Template:Timer</code>, использующий синтаксический анализатор для выбора между двумя стандартными временами, коротким и длинным. Он принимает параметр в качестве первого входного сигнала для сравнения со строкой «short» &ndash; но его проще читать, если параметр идет первым. Код шаблона определяется как: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> и работает следующим образом: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=При использовании внутри функции парсера любые теги парсера и другие функции парсера должны быть временно заменены на {{ll|Strip marker|уникальный код}}. Это влияет на сравнение: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Если сравниваемые строки задаются как равные вызовы одного и того же {{ll|Help:Templates|шаблона}}, содержащего такие теги, то условие истинно, но в случае двух шаблонов с одинаковым содержимым, содержащих такие теги, оно ложно. }} {{Warning|1=Буквальное сравнение с {{ll|Help:Magic words#Page names|Волшебными словами}} может завершиться неудачей в зависимости от конфигурации сайта. Например, <nowiki>{{FULLPAGENAME}}</nowiki>, в зависимости от Вики, может прописывать первую букву и заменять все подчеркивания пробелами. Примените волшебные слова к обоим параметрам, чтобы временно исправить это: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Эта функция принимает входную строку и возвращает один из двух результатов; функция возвращает значение <code>true</code>, если входная строка содержит HTML-объект с <code>class="error"</code>, генерируемый другими функциями синтаксического анализатора, такими как <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> и <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|шаблоны]] ошибки, такие как циклы и рекурсии, и другие «отказоустойчивые» ошибки парсера. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">Одна или обе возвращаемые строки могут быть опущены. Если строка $1 опущена, то $2 возвращается, если она не ошибочна. Если строка $3 также опущена, то при ошибке возвращается пустая строка:</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Некоторые ошибки могут привести к добавлению категории отслеживания, использование <code><nowiki>{{#iferror:}}</nowiki></code> не подавит добавление категории. == #ifexpr == Эта функция вычисляет математическое выражение и возвращает одну из двух строк в зависимости от логического значения результата: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> Входные данные <code>expression</code> вычисляются точно так же, как и для <code>[[##expr|#expr]]</code> выше, причем доступны те же операторы. Выходные данные затем вычисляются как логическое выражение. Пустое входное выражение принимает значение {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Как упоминалось выше, нулевое значение равно {{phpi|false}}, а любое не нулевое значение равно {{phpi|true}}, поэтому эта функция эквивалентна функциям <code>[[##ifeq|#ifeq]]</code> и <code>[[##expr|#expr]]</code>, использующихся одновременно: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> за исключением пустого или неправильного входного выражения (сообщение об ошибке обрабатывается как пустая строка; оно не равно нулю, поэтому мы получаем <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' сравнение :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Одно или оба возвращаемых значения могут быть опущены; если соответствующая ветвь оставлена пустой, выходные данные не выводятся.: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' Поддерживаются логические операторы равенства или операторы неравенства. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Результаты численного сравнения с <code>[[##ifexpr|#ifexpr]]</code> не всегда совпадают с результатами <code>[[##ifeq|#ifeq]]</code> и <code>[[##switch|#switch]]</code>. Последние два являются более точными, чем <code>[[##ifexpr|#ifexpr]]</code>, и не возвращают эквивалентные результаты. Рассмотрим их, сравнивая конечные результаты: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Поскольку PHP, используемый в <code>[[##ifeq|#ifeq]]</code> и <code>[[##switch|#switch]]</code>, сравнивает два типа целых чисел, он возвращает ожидаемый результат правильно. Тогда как с <code>[[##ifexpr|#ifexpr]]</code> и теми же числами: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' С другой цифрой результат равенства фактически неверен. Такое поведение в <code>[[##ifexpr|#ifexpr]]</code> вызвано тем, что MediaWiki преобразует буквенные числа в выражениях в плавающие, которая для больших целых чисел, подобных этим, включает округление.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} Эта функция принимает входную строку, интерпретирует ее как заголовок страницы и возвращает одно из двух значений в зависимости от того, существует ли страница в локальной Вики. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">Функция возвращает значение {{phpi|true}}, если страница существует, независимо от того, содержит ли она контент, является ли она визуально пустой (содержит метаданные, такие как ссылки на категории или {{ll|Help:Magic words|волшебные слова}}, но не содержит видимого контента), является пустой или является {{ll|Help:Redirects|перенаправлением}}. Значение $2 возвращается только страницам по красным ссылками, в том числе если страница раньше существовала, но была удалена.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' Функция возвращает значение {{phpi|true}} для {{ll|Help:System message|системных сообщений}}, которые были настроены, и для {{ll|Help:Special pages|специальных страниц}}, которые определены программным обеспечением. :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (потому что расширение {{ll|Extension:Checkuser|nsp=0}} установлено на этой вики-странице) | '''doesn't exist''' (потому что расширение {{ll|Extension:Checkuser|nsp=0}} не установлено на этой вики-странице) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (потому что [[{{ns:8}}:Copyright]] был настроен) | '''doesn't exist''' (потому что [[{{ns:8}}: Copyright]] не был настроен) }} До версии MediaWiki 1.45, если страница проверяет целевую страницу с помощью <code>#ifexist:</code>, то та будет отображаться в списке [[{{#special:WhatLinksHere}}]] для целевой страницы. Если код <code><nowiki>{{#ifexist:Foo }}</nowiki></code> будет включён на этой странице ({{FULLPAGENAME}}), то [[{{#special:WhatLinksHere}}/Foo]] будет отображать {{FULLPAGENAME}}. В вики, использующих общий медиа-репозиторий, <code>#ifexist:</code> можно использовать для проверки, был ли файл загружен в репозиторий, но не в саму Вики: :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' Если для файла была создана локальная страница описания, результатом будет '''существуют''' для всех вышеперечисленных. <code>#ifexist:</code> не работает с интервики-ссылками. <span id="ifexist_limits"></span> === ограничения #ifexist === <code>#ifexist:</code> считается «дорогой функцией парсера»; только ограниченное число может быть включено на каждой отдельной странице (включая функции внутри трансклюзованных шаблонов). При превышении этого предела любые дополнительные функции <code>#ifexist:</code>автоматически возвращают Ложь, независимо от того, существует ли целевая страница или нет, и страница классифицируется в [[:Category:{{MediaWiki:expensive-parserfunction-category}}]]. Название {{ll|Help:Tracking categories|категории}} может варьироваться в зависимости от языка содержимого Вики. В некоторых случаях можно эмулировать эффект #ifexist с помощью css, используя селекторы <code>a.new</code> (для выбора ссылок на несуществующие страницы) или <code>a:not(.new)</code> (для выбора ссылок на существующие страницы). Кроме того, поскольку количество данных функций парсера, которые могут быть использованы на одной странице, контролируется <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, можно также увеличить лимит в LocalSettings.php, если нужно. <span id="ifexist_and_wanted_pages"></span> === #ifexist и требуемые страницы === До версии MediaWiki 1.45 страница, которая не существует и проверена на использование #ifexist, в конечном итоге окажется в списке [[Special:MyLanguage/Manual:WantedPages|Требуемых страниц]]. Смотри причину в {{phab|T14019}}, а для обходного пути [[w:Template:Linkless exists]]. == #rel2abs == Эта функция преобразует относительный путь к файлу в абсолютный путь к файлу. :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> Во входных данных <code>path</code> допустим следующий синтаксис: *<code>.</code> → текущий уровень *<code>..</code> → подняться на один уровень вверх *<code>/foo</code> → опустится на один уровень вниз в подкаталог /foo Если <code>base path</code> не указан, вместо него будет использоваться полное имя страницы: :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' Недопустимый синтаксис, например <code>/.</code> или <code>/./</code>, игнорируются. Поскольку допускается не более двух последовательных полных остановок, такие последовательности могут использоваться для разделения последовательных операторов: :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' О схожей группе функций см. также [[Special:MyLanguage/Help:Magic words#URL data|Помощь:Волшебные слова#Получение фрагментов URL]]. Встроенные функции Парсера включают: 'localurl:', 'fullurl:', 'anchorencode:' и т.д. == #switch == ''См. также: [[w:Help:Switch parser function]]'' Эта функция сравнивает одно входное значение с каждым из набора заранее указанных вариантов, возвращая соответствующую совпавшему варианту строку, если совпадение найдено. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Примеры: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <nowiki>#</nowiki>switch с тегами частичной трансклюзии может создавать конфигурационный файл, который позволяет редактору, незнакомому с шаблонным кодированием, просматривать и редактировать настраиваемые элементы. <span id="Default"></span> === По умолчанию === <code>''результат по умолчанию''</code> возвращается, если строка <code>''случай''</code> не совпадает с <code>''строка сравнения''</code> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' В этом синтаксисе результат по умолчанию должен быть последним параметром и не должен содержать обычный (необработанный) знак равенства (знак равенства без <code><nowiki>{{}}</nowiki></code>). Если это так, он будет рассматриваться как сравнение случаев, и текст не будет отображаться, если ни один случай не совпадает. Это потому, что значение по умолчанию не было определено (является пустым). Однако, если регистр совпадает, будет возвращена связанная с ним строка. :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> Кроме того, результат по умолчанию может быть явно объявлен с <code>''случай''</code> строкой «<code>#default</code>». {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Результаты по умолчанию, объявленные таким образом, могут быть размещены в любом месте функции: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' Если параметр <code>''default''</code> опущен и не выполняется сопоставление, то <code>''result''</code> не возвращается: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Группировка результатов === Возможен «провал» значения, где <code>''случай''</code> строки возвращают одинаковые <code>''результат''</code> строки. Это сводит к минимуму дублирование. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Здесь случаи 2, 3 и 4 возвращают <code>''результат234''</code>; случаи 6 и 7 оба возвращают <code>''результат67''</code>. «<code>#default = </code>» в последнем параметре может быть опущено в вышеупомянутом случае. <span id="Use_with_parameters"></span> === Использование с параметрами === Функция может использоваться с параметрами в виде тестовой строки. В этом случае нет необходимости помещать вертикальную черту после имени параметра, потому что очень маловероятно, что вы выберете регистр для строки «<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>». (Это значение, которое параметр будет использовать по умолчанию, если черта отсутствует, а параметр не существует или не имеет значения. См. {{ll|Help:Parser functions in templates}}) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> В приведенном выше случае, если <code><nowiki>{{{1}}}</nowiki></code> равен <code>foo</code>, функция вернет <code>Foo</code>. Если оно равно <code>baz</code>, функция вернет <code>Baz</code>. Если параметр пуст или не существует, функция вернет <code>Bar</code>. Как и в предыдущем разделе, кейсы можно комбинировать для получения единого результата. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> Здесь, если <code><nowiki>{{{1}}}</nowiki></code> равен <code>foo</code>, <code>zoo</code> или <code>roo</code>, функция вернет <code>Foo</code>. Если оно равно <code>baz</code>, функция вернет <code>Baz</code>. Если параметр пуст или не существует, функция вернет <code>Bar</code>. Кроме того, результат по умолчанию может быть опущен, если вы не хотите ничего возвращать, если значение параметра теста не соответствует ни одному из вариантов. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> В этом случае функция возвращает пустую строку, если <code><nowiki>{{{1}}}</nowiki></code> не существует и не равен <code>foo</code> или <code>bar</code>, и в этом случае она возвращает <code>Foo</code> или <code>Bar</code> соответственно. Это имеет тот же эффект, что и объявление результата по умолчанию как пустого. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> Если по какой-то причине вы решите установить случай как «<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>», функция вернет результат этого случая, когда параметр не существует или не имеет значения. Параметр должен существовать и иметь значение, отличное от строки «<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>», чтобы вернуть результат функции по умолчанию. :(когда <code><nowiki>{{{1}}}</nowiki></code> не существует или пуст): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(когда <code><nowiki>{{{1}}}</nowiki></code> имеет значение «<code>test</code>»): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(когда <code><nowiki>{{{1}}}</nowiki></code> имеет значение «<code><nowiki>{{{1}}}</nowiki></code>»): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' В этом гипотетическом случае к параметру надо будет добавить вертикальную черту (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). <span id="Comparison_behavior"></span> === Поведение сравнения === Как и в случае с <code>[[##ifeq|#ifeq]]</code>, сравнение производится численно, если и строка сравнения, и проверяемая строка регистра являются числовыми; или как чувствительная к регистру строка в противном случае: :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' Строка <code>''случай''</code> может быть пустой: :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' Как только совпадение найдено, последующие <code>''случаи''</code> игнорируются: :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= Численные сравнения с <code>[[##switch|#switch]]</code> и <code>[[##ifeq|#ifeq]]</code> не эквивалентны сравнениям в выражениях (смотри выше): :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <span id="Raw_equal_signs"></span> === Необработанные знаки равенства === Строки «Случай» не могут содержать необработанные знаки равенства. Чтобы обойти это, используйте магическое слово [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] или замените знак равенства HTML-кодом <code><nowiki>&amp;#61;</nowiki></code>. Пример: {| class="wikitable" ! Вы вводите ! Вы получаете |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=Для простого примера использования этой функции в реальной жизни проверьте [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Два сложных примера можно найти в {{ll|Template:Extension}} и [[w:Template:BOTREQ]]. }} <span id="Replacing_#ifeq"></span> === Замена #ifeq === <code>#switch</code> можно использовать для уменьшения [[Special:MyLanguage/Help:Expansion depth|глубины развёртывания]]. Например: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> эквивалентно * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> т.е. глубокая вложенность, линейная: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> С другой стороны, замена переключателя может быть сложной/непрактичной для #if, вложенных в обе ветви (показано с альтернативами отступа, отступами с обеих сторон), что делает полное симметричное дерево: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Код ! {{hl1}} | Описание ! {{hl1}} | Текущий вывод <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} очистить кэш этой страницы] для обновления)</small> |- ! {{hl2}} colspan="3"| Год |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Четырёхзначный год. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Двузначный год. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1, если это високосный год, 0, если нет. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|Требуется PHP 5.1.0 и новее и [[rev:45208]].|group=note}} | ISO-8601 год указанной недели.{{#tag:ref|Имеет то же значение, что и Y, за исключением того, что если номер недели ISO (W) принадлежит предыдущему или следующему году, то вместо него используется этот год.|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|Выведет литерал ''o'', если Примечание 1 не выполнено.|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Месяц |- | style="text-align: center;" | <code>n</code> | Индекс месяца, без нуля. | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | Индекс месяца, с нулем. | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | Аббревиатура названия месяца на языке сайта. | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | Полное название месяца на языке сайта. | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | Выведит полное название месяца в [[w:en:Genitive case|родительном]] падеже для языков сайта, которые различают родительный падеж и [[w:en:Nominative case|именительный]] падеж. Эта опция полезна для многих [[w:en:Slavic languages|славянских языков]], таких как польский, русский, белорусский, чешский, словацкий, словенский, украинский и т. д. | style="line-height: 1.6;" | Для польского:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(именительный падеж)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(родительный падеж) |- ! {{hl2}} colspan="3"| День месяца или года |- | style="text-align: center;" | <code>j</code> | День месяца, без нуля. | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | День месяца, с нулём. | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | День в году (1&nbsp;января = 0).<br />{{note}} Чтобы получить день в году по ISO, прибавьте 1. | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Неделя и день недели |- | style="text-align: center;" | <code>W</code> | ISO 8601 номер недели, c нулём. | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | ISO 8601 номер дня недели (понедельник = 1, воскресенье = 7). | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | Номер дня недели (воскресенье = 0, суббота = 6). | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | Аббревиатура дня недели. Редко интернационализируется. | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | Полное название дня недели. Редко интернационализируется. | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Час |- | style="text-align: center;" | <code>a</code> | «am» время до обеда (00:00:00 → 11:59:59), «pm» время после обеда (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Прописная версия <code>a</code> выше. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Час в 12-часовом формате, без нуля. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Час в 12-часовом формате, с ведущим нулём. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Час в 24-часовом формате, без ведущего нуля. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Час в 24-часовом формате, с ведущим нулём. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Минуты и секунды |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | Минуты без указания часа, с нулём. | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | Секунды без указания минуты, с нулем. | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:ru:UNIX-время|UNIX-время]]. Секунды, прошедшие с 1 января 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Часовой пояс (как и [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Идентификатор часового пояса. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | Независимо от того, находится ли эта дата в летнее время или нет. | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Разница с временем Гринвича (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Разница с временем Гринвича (GMT) с двоеточием | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Аббревиатура часового пояса. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | Смещение часового пояса в секундах. | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Разное |- | style="text-align: center;" | <code>t</code> | Количество дней в текущем месяце. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | Дата в формате ISO 8601, эквивалентная <code>Y-m-d"T"H:i:s+00:00</code>. | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | [[rfc:5322|RFC 5322]] форматированная дата, эквивалентная <code>D, j M Y H:i:s +0000</code>, с именем дня недели и именем месяца, не интернационализированными. | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Не Григорианские календари |- ! {{hl3}} colspan="3" | Исламский |- | style="text-align: center;" | <code>xmj</code> | День месяца. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Полное название месяца. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Номер месяца. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Год полностью. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Иранский (Джалали) |- | style="text-align: center;" | <code>xit</code> | Количество дней в текущем месяце. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | День года. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | День месяца. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Полное название месяца. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Номер месяца. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Год полностью. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Двузначный год. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Еврейский |- | style="text-align: center;" | <code>xjj</code> | День месяца. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Полное название месяца. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Количество дней в месяце. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Название месяца в родительном падеже. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Номер месяца. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Год полностью. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Тайский солнечный |- | style="text-align: center;" | <code>xkY</code> | Полный год в [[w:Thai solar calendar| Тайском солнечном календаре]]. <br /> {{note}} До 1941 года даты в диапазоне с января по март не [[w:Thai_solar_calendar#New_year|рассчитывались]] должным образом. | {{#time:xkY}} |- ! {{hl3}} colspan="3" | Год Минго/Чучхе |- | style="text-align: center;" | <code>xoY</code> | Год полностью. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | Японская система нэнго |- | style="text-align: center;" | <code>xtY</code> | Год полностью. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | Флаги |- | style="text-align: center;" | <code>xn</code> | Отформатируйте следующий числовой код как необработанное число ASCII. | На языке хинди <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> производит ०६, 06. |- | style="text-align: center;" | <code>xN</code> | colspan="2" | Подобен <code>xn</code>, но работает как переключатель: действует до конца строки или до следующего появления <code>xN</code> в строке. |- | style="text-align: center;" | <code>xr</code> | Форматирует следующее число как римское. Работает только для чисел до 10 000<br /><small>(до 3 000 в MediaWiki до 1.20)</small>. | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | Отформатируйте следующее число как число в иврите. | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} Эта функция парсера берет дату и/или время (по Григорианскому календарю) и форматирует ее в соответствии с заданным синтаксисом. Можно задать объект даты/времени; для этого, по умолчанию используется значение [[Special:MyLanguage/Help:Magic words#Date and time|волшебного слова]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; то есть время, когда страница была в последний раз отображена в HTML. :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> Список принятых кодов форматирования приведен в таблице справа. Любой не распознаваемый символ в строке форматирования передается как неизменённый; это относится также к пустым местам (система не нуждается в них для интерпретации кодов). <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> Существует также два способа экранирования символов в строке форматирования: # <span class="mw-translate-fuzzy">#Обратная косая черта, за которой следует символ форматирования, интерпретируется как один литеральный символ</span> # <span class="mw-translate-fuzzy">#Символы, заключенные в двойные кавычки, считаются литеральными символами, и кавычки удаляются.</span> Кроме того, орграф <code>xx</code> интерпретируется как один литерал x. Поскольку список кодов форматирования продолжает расширяться (включая поддержку новых календарей или новых полей, иначе рассчитываемых или форматируемых), рекомендуется экранировать все литеральные символы, которые должны отображаться без изменений, а не только буквы ASCII, используемые сейчас в кодах форматирования. К сожалению, сейчас одинарная кавычка ASCII все ещё не поддерживается в качестве простой альтернативы для экранирования текста, для этого следует использовать двойные кавычки-лапки (например, двойные кавычки используются в других целях вроде разделения строковых значений в JSON, C, C++...) и обратную косую черту (которая в свою очередь часто должна экранироваться в строковых константах во многих языках программирования и разметки, включая JSON, C, C++, PHP, JavaScript и Lua). Поэтому нельзя встраивать парные двойные кавычки без экранирования их обратной косой чертой (но можно использовать другие символы кавычек). :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <code>''date/time object''</code> может иметь любой формат, принятый функцией PHP [https://php.net/function.strtotime strtotime()]. Допустимы, абсолютное (например <code>20 December 2000</code>), относительное (например <code>+20 hours</code>), и комбинированное время (например <code>30 July +1 year</code>). :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <code>''language code''</code> в [[w:en:ISO 639-3|ISO 639-3]] позволяет отображать строку на выбранном языке :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' Параметр <code>''local''</code> указывает, относится ли «объект даты / времени» к местному часовому поясу или к UTC. Это логические параметры: его значение определяется преобразованием значения аргумента (подробности о том, как преобразовать строку в логические значения, см. В [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation]). {{note|2=reminder|1=Обратите внимание, что если для переменной {{phpi|$wgLocaltimezone}} задано значение <code>UTC</code>, в выводе не будет никакой разницы, если для <code>local</code> установлено значение <code>true</code> или <code>false</code>.}} См. подробности в следующих примерах: :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' Если вы рассчитали временную метку Unix, вы можете использовать ее при вычислении даты, предварительно поставив символ <code>@</code>. :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= Без префикса <code>@</code> перед числовыми значениями отметок времени результатом в большинстве случаев является ошибка или непредвиденное значение: :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (корректно) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (неподдерживаемый формат года) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (корректно) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' (интерпретируется как год с текущим месяцем и днём месяца) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (корректно) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' (интерпретируется как год с текущим месяцем и днём месяца) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (корректно) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (неподдерживаемый формат года) }} {{Warning|1= Диапазон допустимых входных данных составляет 1 января 0111 → 31 декабря 9999.For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> (корректно, никакого високосного года), но :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' (неверно, даже если 100 интерпретируется как 2000, потому что это високосный год) :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' Номера года 0-99 интерпретируются как 2000-2069 и 1970-1999, за исключением случаев, когда они записаны в 4-значном формате с ведущими нулями: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) День недели указан для годов 100-110 и с 1753 года, для годов 111-1752 показывает "Неизвестно", а l-output "<>". Как следствие, r-output не принимается в качестве входных данных за эти годы. }} Могут указываться как частичные, так и полные абсолютные даты; функция будет «заполнять» неуказанные части даты с использованием ''текущих'' значений: :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= Дополнение не везде последовательно; некоторые части даты дополняются значениями текущего времени, другие же нет: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' Для времени используется начало дня, но для дня в месяце и года используются текущие значения. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' Для времени используется начало дня, но для день и месяц используются текущие. Для дополнения дня при указанном месяце и годе поведение отличается: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' Используется начало суток и начало месяца. }} Четырёхзначное число всегда интерпретируется как год, и никогда как часы и минуты:<ref>До {{rev|86805}} в 2011 это было не так.</ref> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' Шестизначные числа пытаются интерпретироваться как часы, минуты и секунды, а если значения некорректны, то возвращается ошибка (не предусмотрена интерпретация, например, как года и месяца): :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' Входная строка рассматривается как время, а не как год+месяц. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' Несмотря на то, что не может быть времени 19:60:09, 196009 не рассматривается как сентябрь 1960. Функция может выполнять некоторые математические преобразования над датами: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span class="mw-translate-fuzzy">Общая длина форматной строки для вызовов функции $time ограничена 6000 символами<ref>См. [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$9 ParserFunctions.php] на phabricator.wikimedia.org</ref>.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Вопрос часового пояса ==== В функции #time parser существует ошибка(более конкретно в ''PHP DateTime''), которая не позволяет передавать ''нецелые числа'' в качестве относительных смещений часовых поясов. Эта проблема не касается использования часового пояса, например EDT. Например: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} Однако, Индия находится на смещении времени +5,5 часа от UTC, и поэтому использование ее часового пояса обычно не позволяет правильно рассчитать относительное смещение часового пояса. Вот что происходит: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} Чтобы обойти эту проблему, просто преобразуйте время в минуты или секунды, например: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} (Тим Старлинг, разработчик этой функции, предоставил точный синтаксис для его решения.) <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == Эта функция представляет собой синтаксический ярлык, который работает идентично <code><nowiki>{{#time: ... }}</nowiki></code> с параметром <code>local</code>, установленным в {{phpi|true}}, поэтому она всегда использует предпочтительный часовой пояс пользователя или настроенный часовой пояс вики (как установлено в {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). Синтаксис функции следующий: :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=Если переменая {{phpi|$wgLocaltimezone}} настроена как <code>UTC</code>, то нет никакой разницы, настроен ли <code>local</code> как {{phpi|true}} или как {{phpi|false}}, т. к. на выходе будет один и тот же результат.}} [[File:Time-Timel.png|thumb|Примеры использования функций парсера #time и #timel, когда часовой пояс сервера — не UTC]] Например, смотрите следующие образцы: :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|Пример предупреждения из https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid]] {{Warning|1= Имейте в виду, что U как для time, так и для timel вернет одинаковое количество секунд, начиная с 1970-01-01 00:00:00 UTC в Википедии с часовыми поясами, отличными от UTC (ранее известными как GMT). :<code>U</code> Unix-время. Количество секунд, прошедших с 00:00:00 1 января 1970 GMT. :<code>Z</code> Смещение часового пояса в секундах. :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == Эта функция разделяет заголовок страницы на сегменты, разделённые слэшем («/»), и затем на выходе возвращает некоторые из этих сегментов. : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=имя страницы |2=количество выводимых сегментов |3=сегмент, с которого нужно начать }} Если параметр ''количество выводимых сегментов'' не определён, он принимается равным нулю ("0"), и выводятся все сегменты, начиная с ''сегмент, с которого нужно начать'' до конца (включительно). Если ''сегмент, с которого нужно начать'' не определён или равен "0", то он принимает значение по умолчанию "1": : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' См. также <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' Для обоих значений принимаются отрицательные значения. Отрицательные значения параметра ''количество выводимых сегментов'' эффективно 'обрезает' сегменты с конца строки. Отрицательные значения для ''первого выводимого сегмента'' переводятся как "начните с этого сегмента, считая справа": : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' Отделяет один сегмент с конца строки. См. также {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' Отделяет все 4 сегмента с конца строки. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' Отделяет 5 сегментов с конца строки (больше, чем существует). : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' Возвращает последний сегмент. См. также {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' Отделяет один сегмент с конца строки и возвращает значение со второго сегмента. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' Начинает копирование со второго с конца элемента, обрезает один сегмент с конца строки. Перед обработкой параметр ''pagename'' декодируется в HTML: если он содержит некоторые стандартные объекты символов HTML, они будут преобразованы в обычные символы (внутренне закодированные с помощью UTF-8, т.е. в той же кодировке, что и на исходной странице MediaWiki с использованием этой функции парсера). : Например, любое появление <code>&amp;quot;</code>, <code>&amp;#34;</code> или <code>&amp;#x22;</code> в ''имя страницы'' будет заменено на <code>"</code>. : Никакого другого преобразования HTML в обычный текст не выполняется, поэтому теги HTML остаются нетронутыми на этом начальном этапе, даже если они недействительны в заголовках страниц. {{tip| 1= Известно, что некоторые волшебные ключевые слова или функции парсера MediaWiki (такие как <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> и подобные) возвращают строки, которые ненужно кодируются в HTML, даже если их собственный входной параметр не был закодирован в HTML: Функцию парсера titleparts можно использовать в качестве обходного пути для преобразования этих возвращаемых строк, чтобы их можно было правильно обрабатывать некоторыми другими функциями парсера, которые также принимают имя страницы в качестве параметра (например, <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>, но которые по-прежнему не работают должным образом с HTML-кодированными входными строками. This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. Например, если текущая страница это [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], тогда: * и <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, и <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> возвращают <code>1</code>; (функция #ifeq производит разбор HTML для входных параметров). * и <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, и <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> возвращают <code>1</code>; (функция #switch производит разбор HTML для входных параметров). * <syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight> и даже <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> возвращают <code>1</code>, если эта страница существует (функция #ifexist производит разбор HTML для входных параметров); * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> вернёт положительное число, если категория содержит страницы или подкатегории, '''но''': * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight> может всё равно '''безусловно''' возвращать 0, как и: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> Причина неопределённого поведения в том, что в текущих версиях движка MediaWiki существует два предостережения: * <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight> или даже <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''может'' вернуть в действительности строку с кодированием HTML <code>Category:Côte-d&apos;Or</code>, а не ожидаемую <code>Category:Côte-d'Or</code>, и поэтому: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''безусловно''' возвращает 0 (волшебное слово PAGESINCAT не производит разбор HTML для входных параметров). Существует простой обходной способ с помощью titleparts (который продолжит работать и в случае переопределения поведения в будущих версиях MediaWiki): * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, все эти варианты возвращают действительное количество страниц в той же категории. }} Затем декодированное ''имя страницы'' канонизируется в стандартный заголовок страницы, поддерживаемый MediaWiki, насколько это возможно: # Все подчёркивания автоматически заменяются пробелами: #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' Не bah_boo, несмотря на подчеркивание в оригинале. # Строка разделяется максимум 25 раз; дальнейшие косые черты игнорируются, и 25-й элемент будет содержать остальную часть строки. Длина строки также ограничена 255 символами, так как она рассматривается как [[Special:MyLanguage/Manual:Page table#Schema summary|заголовок страницы]]: #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: Если по какой-либо причине вам нужно было довести эту функцию до ее предела, хотя это маловероятно, можно обойти ограничение в 25 разбиений, вложив вызовы функций: #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # Наконец, первая подстрока пишется с заглавной буквы в соответствии с настройками заглавных букв локальной вики (если эта подстрока также начинается с имени локального пространства имен, это имя пространства имен также нормализуется). #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= Вы можете использовать #titleparts как небольшой "парсер и конвертер строк", но учтите, что он возвращает первую подстроку с заглавной буквы: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' Если необходим нижний регистр, используйте функцию lc: для управления выводом: : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' Вы можете добавить 'фиктивную' косую черту в начале строки, чтобы получить правильную заглавную букву первой подстроки (в верхнем или нижнем регистре). Используйте <code>2</code> вместо <code>1</code> для ''первого возвращаемого сегмента'': : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span class="mw-translate-fuzzy">Определенные символы, которые недопустимы в заголовке страницы, приведут к тому, что #titleparts не сможет проанализировать строку:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Не приводит к ожидаемому результату: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. Не работает, потому что скобки недопустимы в заголовках страниц, и эта функция парсера не обрабатывает ссылки, встроенные во входной параметр ''pagename'', даже если они используют синтаксис MediaWiki или любые другие теги HTML или MediaWiki. : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". Не работает, потому что "#" также недопустим в заголовках страниц. }} {{Warning|1= Если какая-либо часть заголовка представляет собой просто «<code>.</code>» или «<code>..</code>», #titleparts не будет анализировать строку: : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. Возвращается вся строка. Он не дает ожидаемого: '''one''' }} {{Warning|1= Эта функция не понижается корректно, если входные данные превышают 255 байт в UTF-8. Если входная строка имеет размер 256 байт или более, возвращается вся строка. }} <span id="String_functions"></span> == Строковые функции == {{Main|Extension:ParserFunctions/String functions}} <span class="mw-translate-fuzzy">Расширение ParserFunctions дополнительно определяет различные строковые функции ($1), если для <code>$wgPFEnableStringFunctions</code> установлено значение {{phpi|true}}.</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span class="mw-translate-fuzzy">См. [[w:Help:Manipulating strings#StringFunctions (from ParserFunctions)|здесь]] примеры.</span> {{Warning |1=В 2013 году было решено, что '''эти функции ''никогда'' не будут включены ни в одной вики Викимедиа''', поскольку они неэффективны при использовании в больших масштабах (немного истории см. в [[phab:T8455]]). '''Эти функции НЕ работают в вики Викимедиа!'''<br/><br/>Если вы здесь для того, чтобы написать что-то о проекте Викимедиа, вы ищете что-то другое: если в вашей домашней вики есть строковые функции, то, вероятно, для этого используется {{ll|Extension:Scribunto|Lua}}. Например, английская Википедия использует [[w:Module:String|Module:String]], который выполняет некоторые из тех же действий с совершенно другим синтаксисом. Существуют также отдельные [[w:Template:String-handling templates|шаблоны для обработки строк]]. }} Вот краткий обзор функций [[Module:String]]: * [[w:Module:String#len|&#35;len]] (длина строки): <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] (подстрока): <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] (позиция цели): <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] (повтор): <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Общие вопросы == <span id="Substitution"></span> === Подстановка === Функции парсера можно [[Special:MyLanguage/Help:Substitution|подставить]] с помощью префикса <code>'''subst:'''</code> перед символом решетки: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → код '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' будет вставлен как викитекст, поскольку страница {{FULLPAGENAME}} уже существует. {{Warning|1= Результаты замененных функций парсера не определены, если выражения содержат ''незамещенный'' изменчивый код, такой как {{ll|Help:Magic words#Variables|variables}} или другие функции парсера. Для получения согласованных результатов необходимо заменить весь изменчивый код в вычисляемом выражении. См. [[w:Help:Substitution|Help:Substitution]].}} Подстановка не работает внутри {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; для этой цели вы можете использовать <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code>. <span id="Redirects"></span> === Перенаправления === Особенно [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] может быть полезен в {{ll|Help:Redirects|перенаправлении}} для страниц, содержащих даты, но это не всегда работает. <span id="Escaping_pipe_characters"></span> <div class="mw-translate-fuzzy"> === Экранирование символа &#124; в таблицах === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> Функции парсера искажают синтаксис {{ll|Help:Tables|викитаблицы}} и символы вертикальной черты (<code><nowiki>|</nowiki></code>), рассматривая все необработанные символы вертикальной черты как разделители параметров. Чтобы избежать этого, большинство вики использовали шаблон [[{{ns:10}}:!]] с содержимым, состоящим только из необработанного символа вертикальной черты (<code><nowiki>|</nowiki></code>), начиная с MW 1.24 {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> волшебное слово}} заменило этот костыль. Это "скрывает" вертикальные черты от синтаксического анализатора MediaWiki, гарантируя, что он не будет рассматриваться до тех пор, пока все шаблоны и переменные на странице не будут развернуты. Затем он будет интерпретироваться как разделитель строк или столбцов таблицы. В качестве альтернативы можно использовать необработанный синтаксис таблицы HTML, хотя это менее интуитивно понятно и более подвержено ошибкам. <div class="mw-translate-fuzzy"> Вы также можете экранировать символ вертикальной черты для отображения в виде простого неинтерпретируемого символа, используя объект HTML: <code>&amp;#124;</code> . </div> {| class="wikitable" ! Описание ! Вы вводите ! Вы получаете |- | Экранирование вертикальной черты в качестве разделителя строки/столбца таблицы | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | Экранирование символа вертикальной черты как простого символа | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Зачистка пробелов === Пробелы, включая новые строки, табуляции и пробелы, удаляются из начала и конца всех параметров функций парсера. Если это нежелательно, то сравнение строк может быть сделано после того, как они будут заключены в кавычки. :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span class="mw-translate-fuzzy">Чтобы предотвратить обрезку деталей then и else, см. раздел [[m:Template:If]]. Некоторые люди достигают этого с помощью $2 вместо пробелов</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' Однако, этот метод можно использовать только для отображения '''одного''' символа пробела, так как синтаксический анализатор сжимает несколько символов пробела в строке в один. :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} Например, <code>white-space: pre</code> используется для принудительного сохранения белого пространства браузером, но даже при этом пробелы не отображаются. Это происходит потому, что пробелы очищаются программным обеспечением, прежде чем быть отправленными в браузер. Можно обойти это поведение, заменив пробелы на <code>&amp;#32;</code> (''breakable space'') или <code>&amp;nbsp;</code> (''non-breakable space''), поскольку они не изменяются программным обеспечением: :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' Помните, что не все параметры одинаковы. В ParserFunctions пробелы в начале и конце всегда удаляются. В {{ll|Help:Templates|templates}} пробелы в начале и конце удаляются для именованных и неименованных параметров, но ''не удаляются'' из неименованных параметров: :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Другие функции парсера == <span id="Case_conversion_functions"></span> === Функции преобразования регистра === * '''Нижний регистр:''' {{xpdoc|lc: AbC|}} * '''Верхний регистр:''' {{xpdoc|uc: AbC|}} * '''Первый символ в нижнем регистре:''' {{xpdoc|lcfirst: AbC}} * '''Первый символ в верхнем регистре:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Функции кодирования === * '''Кодирование URL:''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <span id="Anchor_encoding"></span> === Кодирование якорей === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == См. также == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – список (неполный) функций парсера, добавленных ядром и расширениями. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] или устаревшее {{ll|Extension:StringFunctions}} * Функции парсера для Викибазы (расширения, позволяющие использовать Викиданные): [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Примечания == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] jiugc4k8bnalwp7bjkfdt4awucm0p0r Help:Extension:ParserFunctions/ps 12 210623 8365027 8353943 2026-05-04T06:21:07Z FuzzyBot 451990 Updating to match new version of source page 8365027 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span lang="en" dir="ltr" class="mw-content-ltr">The {{ll|Extension:ParserFunctions|nsp=0}} extension provides additional [[Special:MyLanguage/Parser functions|parser functions]] to supplement those already present in MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">(It ''may'' be configured to provide additional parser functions for string handling; these are only available to non-Wikimedia Foundation wikis hence these string functions are documented {{ll|Extension:ParserFunctions/String functions|elsewhere}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">All the parser functions provided by this extension take the form:</span> :<code><nowiki>{{</nowiki><span lang="en" dir="ltr" class="mw-content-ltr">'''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ...</span> <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Operators</span> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Grouping (parentheses)</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Numbers</span> | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | <span lang="en" dir="ltr" class="mw-content-ltr">binary operator</span> <code>'''e'''</code> &nbsp; <span lang="en" dir="ltr" class="mw-content-ltr">unary</span> <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Unary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Binary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Round</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Logic</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} <span lang="en" dir="ltr" class="mw-content-ltr">This function evaluates a mathematical expression and returns the calculated value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This function is also available in {{ll|Extension:Scribunto|nsp=0}} via the <code>mw.ext.ParserFunctions.expr</code> function.</span> :<code><nowiki>{{#expr:</nowiki> ''<span lang="en" dir="ltr" class="mw-content-ltr">expression</span>'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The available operators are listed to the right, in order of precedence. See {{ll|Manual:Expr parser function syntax}} for more details of the function of each operator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> When evaluating using [[w:boolean algebra|boolean algebra]], zero evaluates to {{phpi|false}}, and any nonzero value, positive or negative, evaluates to {{phpi|true}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code>[[##iferror|#iferror]]</code> function: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Rounding === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Test case</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Result</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Method of rounding</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is < 5, so no apparent rounding occurs</span> (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is ≥ 5, so it is rounded up</span> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to the nearest integer</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the ''nearest'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding up or down with ''ceil'' and ''floor''</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next ''larger'' integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next ''smaller'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next larger integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next smaller integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Not rounded, since 1 already is an integer</span><br />{{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect</span>}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Strings === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: test string | value if test string is not empty | value if test string is empty (or only white space)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: first parameter | second parameter | third parameter }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} بېلگه: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> بېلگه: {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> د بېلگې په توگه: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | څرگندونه ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| کال |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">4-digit year.</span> | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| مياشت |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour</span> |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Minutes and seconds</span> |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | اسلامي |- | style="text-align: center;" | <code>xmj</code> | د مياشتې ورځ. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | د مياشتې بشپړ نوم. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | مياشت ليکلړ | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | بشپړ کال. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | د مياشتې ورځ. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | د مياشتې بشپړ نوم. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | مياشت ليکلړ. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | بشپړ کال. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! څرگندونه ! که داسې يې وټاپۍ ! داسې به يې اخلۍ |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] jrreohz50dtu9iablgd7lelvajpjavy Translations:Help:Subpages/4/pt-br 1198 214757 8364522 971121 2026-05-03T16:53:49Z Nerun 899342 8364522 wikitext text/x-wiki Como conseqüência da barra sendo um caractere reservado quando subpáginas são habilitadas, um caractere alternativo pode ser necessário. iq7tz7m4vonirxvlja2787a9pmo8j9l Translations:Help:Subpages/7/pt-br 1198 214760 8364520 4032719 2026-05-03T16:52:38Z Nerun 899342 8364520 wikitext text/x-wiki As [[$man-ns|versões assunto e discussão]] de uma página (e suas subpáginas correspondentes, por exemplo, arquivos de discussão) precisam usar o hack, de modo que mover uma página levaria todas as páginas conectadas ao novo título (se essa configuração for selecionada durante a movimentação). hzivnz98w06c36sdjni4cl4wgi0o46x Translations:Help:Subpages/16/pt-br 1198 214784 8364538 971179 2026-05-03T17:00:27Z Nerun 899342 8364538 wikitext text/x-wiki Subpáginas são úteis para organizar informações de forma hierárquica. 9oj6y5bpuf4g41w0ocaosf98fgof17j Template:Update/pt-br 10 220396 8364332 8364251 2026-05-03T12:47:08Z FuzzyBot 451990 Updating to match new version of source page 8364332 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |A '''precisão factual''' de partes desta página (aquelas relacionadas a {{{part|{{{1|}}}}}}) '''pode estar comprometida devido a informações desatualizadas'''. |Partes desta página (aquelas relacionadas a {{{part|{{{1|}}}}}}) estão '''desatualizadas'''.}} |{{#if:{{{inaccurate|}}} |A '''precisão factual''' desta página '''pode estar comprometida devido a informações desatualizadas'''. |Esta página está '''desatualizada'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|Seus assuntos foram escritos para uma versão mais antiga do MediaWiki e podem não se aplicar à versão mais recente.}} Após verificar ou atualizar esta página e determinar que o conteúdo está adequado, remova este aviso. {{#ifexist: {{TALKPAGENAME}} |&#32;Veja a [[{{TALKPAGENAME}}|página de discussão]] para uma possível discussão sobre isso. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Última atualização: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= Atalhos desta predefinição: * {{tlx|outdated}} <span id="Examples"></span> == Exemplos == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == Ver também == * {{tl|historical}} == TemplateData == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> 7zvov0483w0m0bwcqtosoh9uifri6la Help:Extension:ParserFunctions/zh 12 230390 8365040 8353956 2026-05-04T06:21:47Z FuzzyBot 451990 Updating to match new version of source page 8365040 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} {{NoteTA|G1=IT|G2=MediaWiki|1=zh-hans:扩展; zh-hant:擴充功能;}} {{ll|Extension:ParserFunctions|nsp=0}}扩展有提供額外的[[Special:MyLanguage/Parser functions|解析器函数]]以补充MediaWiki核心中既有的。 (參見{{ll|Help:Magic words#Parser functions}}.) (“有可能”会裝配额外針對字符處理的解析器函数;这些字符串函数已记载在{{ll|Extension:ParserFunctions/String functions|其他地方}}之中。) 此扩展所提供的所有解析器函数均采用以下形式: :<code><nowiki>{{</nowiki>'''#函数名''': ''参数1'' | ''参数2'' | ''参数3''... <nowiki>}}</nowiki></code> == #expr == {{for|1=此處並不涵蓋表達式評估器如何運作地更深入(包括一些額外運算符號)的手冊|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | 类型 ! {{hl1}} | 运算符号 |- | {{hl2}} | 分组(括弧) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | 数字 | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | 二元运算符 <code>'''e'''</code> &nbsp; 一元运算符 <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | 一元 | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | 二元 | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | 取整 | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | 逻辑 | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} 这个函数计算数学表达式并返回计算值。 可在{{ll|Extension:Scribunto|nsp=0}}中通过<code>mw.ext.ParserFunctions.expr</code>来使用此函数。 :<code><nowiki>{{#expr:</nowiki> ''表达式'' <nowiki>}}</nowiki></code> 基本示例 :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' 右表依优先级列出了支持的运算符,每個运算符的详细说明请參见{{ll|Manual:Expr parser function syntax}}。 运算结果的精度和格式受运行wiki服务器操作系统和站点语言的数字格式影响可能存在差异。 使用[[w:zh:逻辑代数|布尔代数]]时,0表示{{phpi|false}},其他任何非0数值(无论正负)均表示{{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' 空表达式返回空值,无效的表达式返回错误信息,使用<code>[[##iferror|#iferror]]</code>函数检查错误: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' 置于数字前或数字后的加减号是有意义的,会被视为正负号而不会报错: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' 注意:如果你使用魔术字的输出数值时,首先要将其格式化以去除逗号,获得纯数字,然後再翻譯該数值。 例如<nowiki>{{NUMBEROFUSERS}}</nowiki>會導致{{NUMBEROFUSERS}},这里我们想要的是{{formatnum:{{NUMBEROFUSERS}}|R}},則可以用<code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>得到。 这在某些数字也會被翻译的语言中尤为重要。 例如,在孟加拉语中,<nowiki>{{NUMBEROFUSERS}}</nowiki>會產出৩০,০৬১。 :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=运算符<code>mod</code>會對第二參數的某些值給出錯誤的结果: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (會輸出一個空字符串;但這應該是123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=如果你想要进行基于日期时间的计算(如检测当前日期时间是否超过指定日期时间),首先用<nowiki>{{#time: xNU }}</nowiki>将日期时间转换为距1970年1月1日(UTC)的秒数,再对秒数进行加减运算。}} <span id="Rounding"></span> === 四舍五入 === 将左边的数字[https://php.net/function.round 四舍五入]为十分之一的幂次方,其指数部份就是右边所给出的截断值数字。 想要無條件進位、無條件捨去,可分别使用<code>ceil</code>或<code>floor</code>。 {| class="wikitable" ! {{hl1}} | 测试案例 ! {{hl1}} | 结果 ! {{hl1}} | 舍入方式 |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || 最後一個位數小于5,所以没有明显的進位发生 (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || 最後一個位數≥5,所以被進位 (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || 同理,最后一個位数因后一位而加1,进而引起了前面的进位 (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || 因負值在小數點左側取整,故四捨五入至最接近的百位數。 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || 四捨五入至最接近的百分位數,因為正數會將小數點右側的數值四捨五入。 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || 四捨五入指數中的小數位數不會影響四捨五入後的結果 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || 小数部分被全部舍弃(截断) |- ! colspan=3 {{hl2}} | 四舍五入至最近的整数 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || 向下取整至0 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || 向上取整至1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || 向上取整至1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || 向上取整至0 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || 向下取整至-1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || 向下取整至-1 |- ! colspan=3 {{hl2}} | 使用ceil和floor無條件進位或無條件捨去 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || 無條件進位到下一個"較大"的整數,就是1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || 無條件捨去到下一個"較小"的整數,就是0 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || 無條件進位到下一個較大的整數,就是0 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || 無條件捨去到下一個較小的整數,就是-1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || 没有取整,因为1本来就是整数<br />{{Warning|1=注意会被解析为'''(ceil''' 1''')'''/3,而不是你想象中的'''ceil('''1/3''')'''}} |- ! colspan=3 {{hl2}} | 大數值的四捨五入 |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | 四捨五入到一個非常大的數值會導致無窮大。 因此,給你一個不是無限值的原始值做為答案。 |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | 同上。 |} <span id="Strings"></span> === {{LC zh|lang = {{{lang|}}}|type = H|zh-hans = 字符串|zh-hant = 字串}} === 表达式函数只用于仅含有数字和运算符号的表达式,而字母字符串和其它符号不在此列。若需要比较字符串,可以用[[#ifeq]]替代。 :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == 这个函数判断一个字符串是否为空。只包含空格的字符串被视为空字符串。 :<syntaxhighlight lang="wikitext" inline>{{#if: 测试的字符串 | 测试的字符串非空时的值 | 测试的字符串为空或仅包含空白字符时的值}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: 参数1 | 参数2 | 参数3 }}</syntaxhighlight> 这个函数首先判断参数1是否为空。如果参数1不为空,则输出参数2。如果参数1为空或只包含空白内容(空格、换行等),则输出参数3。 :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' 字符串内容会被处理为纯文本,因此不会计算数学表达式(参见[[##ifexpr|#ifexpr]]): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' 最后一个参数(false)可以忽略: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' 该函数可嵌套。为了做到这一点,嵌套内层的#if函数需要按规则完整填写所有参数以符合#if的参数形式。一般至多可嵌套7层,该数也可能为wiki自身限制和内存限制而有变动。 <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:测试的字符串 | 字符串非空时的值 |{{#if:测试的字符串 |字符串非空时的值 |字符串为空(或只有空格)的值 }} }} </syntaxhighlight> 你可以在<code>#if</code>条件句中以字符串变量代替测试的字符串。 <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> (因此如果参数没有值,则计算结果为一个空字符串而非"<code><nowiki>{{{1}}}</nowiki></code>"。) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=你在变量1里面输入了文本 |2=变量1里面没有文本 }} 参见{{ll|Help:Parser functions in templates}}以了解更多关于解析器函数中变量的相关例子。 {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == 这个函数判断两个輸入字符串是否相同,並根據結果輸出兩個字符串的其中一個。 如果需要更多的比較和輸出字符串,請考慮使用<code>#switch</code>。 :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> 如果两个字符串均为数字,则函数会进行数值的比较: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' 否则,函数会进行文本的比较(區分大小写): :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(对比上面没有引号的例子)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(对比上面带有<code>[[##expr|#expr]]</code>的例子,會先回傳一個有效的整數)'' 作为例子,考虑一个已存在的{{ll|Help:Templates|模板}}<code>Template:Timer</code>,该模板利用解析器来選擇兩個標準時間,short和long。 它以参数作为第一个输入来比较字符串“short”&ndash;这没有约定顺序,但是如果参数在第一个则更容易理解。 模板代码定义为: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> 会产生如下结果: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=任何的解析器标签和其它的解析器函数,用在解析器函数中时,都一定会被一个临时生成的独一无二的{{ll|Strip marker|标识码}}替代。这会影响如下比较: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' 如果被比较的字符串由相同的{{ll|Help:Templates|模板}}调用提供,且這個模板包含有这些标签,则条件视为真,但如果是两个内容相同但不同的模板,且這两個模板包含这些标签,則条件视为假。 }} {{Warning|1=随网站配置的变化,含有{{ll|Help:Magic words#Page names|页面名字的魔术字}}的字符串的字面比较可能会发生错误。 比如说,<nowiki>{{FULLPAGENAME}}</nowiki>这一魔术字随wiki的变化,可能在返回时使开头字母变成大写,也会用下划线替代空格。 为了解决这个问题,将这个魔术字应用到两个参数上: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == 这个函数接收一个输入字符串,返回两个结果中的一个。如果输入字符串包含一个由其他解析器函数(比如<code>[[##expr|#expr]]</code>、<code>[[##time|#time]]</code>和<code>[[##rel2abs|#rel2abs]]</code>)、[[Special:MyLanguage/Help:Templates|模板]]错误(比如模板循环和模板递归)或其他解析器“软错误”生成的<code>class="error"</code>的HTML对象,那么视为真。 :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> 待返回字符串参数可以省略。 若省略<code>correct</code>(正确)字符串参数,则在<code>test string</code>(测试字符串)不出错的情况下函数将返回被测字符串本身。 若省略<code>error</code>(错误)字符串参数,则函数将在被测字符串出错时返回空字符串: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' 某些错误可能会导致添加一个追踪分类,使用<code><nowiki>{{#iferror:}}</nowiki></code>不会阻止添加此分类。 == #ifexpr == 此函数会判断数学表达式并根据其布尔值结果返回对应的字符串: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> 这里<code>expression</code>输入串将原封不动的作为上面<code>[[##expr|#expr]]</code>的参数进行调用,且表达式运算符是通用的,返回值也将作为布尔表达式进行处理。 输入表达式为空时将视为{{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' 如上面所提,0将视为{{phpi|false}},非零值将视为{{phpi|true}},因此这个函数与下面的仅用<code>[[##ifeq|#ifeq]]</code>和<code>[[##expr|#expr]]</code>的表述等价: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> 除了下面这种情况:所输入表达式为空或者是一个错误表达式(空串会返回一条错误信息,而它不等于0,所以在后者我们会得到<code>value if true</code>)。 :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' 相对的 :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' 两个返回值都可以省略,当合适的对应分支被省略时,函数不输出: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' 支持相等或不等的布尔运算。 :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=使用<code>[[##ifexpr|#ifexpr]]</code>进行数字比较的结果不总是与<code>[[##ifeq|#ifeq]]</code>和<code>[[##switch|#switch]]</code>的结果一致。 后面两种比较相对于<code>[[##ifexpr|#ifexpr]]</code>而言更加精确,因而未必返回相同结果。 考虑比较下面两个仅有最后一位数不同的数: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' 因为<code>[[##ifeq|#ifeq]]</code>和<code>[[##switch|#switch]]</code>使用的PHP会比较两个整数类型的数,会正确返回预期结果。 然而用<code>[[##ifexpr|#ifexpr]]</code>比较相同的两个数时: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' 对于不同的数字,结果实际上是不正确的。 造成<code>[[##ifexpr|#ifexpr]]</code>出错行为的原因是MediaWiki将两个数依字面表达理解成了浮点数,而对于像这样的大数,转换为浮点数由于精度误差会存储为一样的数值,导致出错。<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=請參閱[[Manual:Checking for page existence|手冊:檢查頁面是否存在]],以瞭解檢查頁面是否存在的其他不同限制的方法。}} 这个函数将一组字符串作为输入,并翻译成页面标题,然后根据在本地wiki上是否存在该页面而返回对应的值。 :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> 只要页面存在就会判定为{{phpi|true}}(真值),即便那个页面看上去是空白的(比如像是分类链接或者是{{ll|Help:Magic words|魔术字}}解释页之类的却不包含任何可视内容的页面),或者是{{ll|Help:Redirects|重定向页}},或者它就是空白页。 当且仅当页面是红链时判定为{{phpi|false}}(假值),包括那些曾经存在却被删除的页面。 :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' 函数在{{ll|Help:System message|系统消息}}被自定义时返回{{phpi|true}},对{{ll|Help:Special pages|特殊页面}}的判定则取决于本地软件自身。 :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (因为{{ll|Extension:Checkuser|nsp=0}}扩展已经安装于此wiki) | '''doesn't exist''' (因为{{ll|Extension:Checkuser|nsp=0}}未安装于此wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (因为[[{{ns:8}}:Copyright]]已自定义) | '''doesn't exist''' (因为[[{{ns:8}}:Copyright]]未自定义) }} 在MediaWiki 1.45之前,如果一个页面使用了<code>#ifexist:</code>来检查目标页面,则这个检查页面将出现在被检查页面的[[{{#special:WhatLinksHere}}]]里。 因此,如果本页面({{FULLPAGENAME}})使用了代码<code><nowiki>{{#ifexist:Foo}}</nowiki></code>,则[[{{#special:WhatLinksHere}}/Foo]]将列出{{FULLPAGENAME}}。 若wiki有其在使用的对应的共享媒体库,<code>#ifexist:</code>就可用于检查一个文件是否在媒体库中,而不仅仅只是在wiki本体上检查: :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' 如果文件有一个已创建的对应的本地描述页面,上面的结果将全部是'''exists'''。 <code>#ifexist:</code>不会对跨wiki链接起作用。 <span id="ifexist_limits"></span> === ifexist 限制 === <code>#ifexist:</code>被视为“高开销(expensive)解析器函数”,每个页面调用这类函数的次数(包括包含于嵌入式模板的函数)存在一个限制。 当达到该限制时,更多的<code>#ifexist:</code>函数,无论其目标页面是否存在,只会自动返回错误值false,且该页面会被分类到[[:Category:{{MediaWiki:expensive-parserfunction-category}}]]中。 {{ll|Help:Tracking categories|追踪分类}}的名稱可能因您的wiki内容的语言而异。 一些情况下,在css中使用选择器<code>a.new</code>(以选出链接到不存在的页面的链接)或者是<code>a:not(.new)</code>(以选出已存在页面的链接),是可以达到模仿ifexist的效果的。 另外,<code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>可以调整对高开销解析器函数数量的限制,如果有需要,也可以增加页面LocalSettings.php中的限制值。 <span id="ifexist_and_wanted_pages"></span> === ifexisit和需要的页面 === 在MediaWiki 1.45之前,不存在的页面被#ifexist检测后会被计数在[[Special:MyLanguage/Manual:WantedPages|待创建页面]]中。 请参阅{{phab|T14019}}了解原因,并查看[[w:Template:Linkless exists]]以了解解决方法。 == #rel2abs == 这个函数将文件的相对路径转换为绝对路径。 :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> 在输入项<code>path</code>中,可以使用以下类型的句法: *<code>.</code> → 本级路径 *<code>..</code> → 回到上一级 *<code>/foo</code> → 向下一级进入子目录/foo 若<code>base path</code>没有指定,将默认的填入函数所在页面的绝对路径: :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' 无效语法,如<code>/.</code>或<code>/./</code>,将被忽略。 由于不允许超过两个连续的句号,因此可以使用诸如此类的序列来分隔连续的语句: :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' 針對一個類似的函數群組,另見[[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]]。 內建的解析器函數包含:'localurl:', 'fullurl:', 'anchorencode:' 等等。 == #switch == ''{{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 参阅:|zh-hant = 參閱:}} [[w:Help:Switch parser function]]'' 该函数将一个输入值同若干个测试用例(test cases)做比较,如果找到匹配,返回有关联的字符串。 {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} 例如: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' 含有部分嵌入包含标记的<nowiki>#</nowiki>switch会影响到能让不熟悉模板代码的编辑者查看和编辑可配置元素的配置文件。 <span id="Default"></span> === 默认 === 如果<code>''comparison string''</code>不能与任何<code>''case''</code>匹配,则返回<code>''default result''</code>: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' 在这种语法中,默认返回值必须是函数的最后一个参数,而且不能包含原始等号(不帶<code><nowiki>{{}}</nowiki></code>的等號)。 否则,就会解析为样例比较,无匹配的样例时不显示文本。 这是因为默认值没有定义(是空的)。 如果有样例匹配,则返回关联的字符串。 :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> 你也可以将<code>''case''</code>字符串设为''<code>#default</code>''从而清楚地声明默认值。 {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} 这种方式声明的默认结果可以放在函数的任何地方: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' 如果<code>"default"</code>参数被省略,且没有找到匹配,则不返回结果: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === 分组结果 === 该函数允许有“fall through”值,多个<code>''case''</code>字符串返回相同的<code>''result''</code>字符串,从而减少重复。 {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} 在本例中,第2、3、4个分支都会返回<code>''result234''</code>,第6和第7个分支都会返回<code>''result67''</code>。 上述案例中,最后一个参数中的“<code>#default = </code>”可以省略。 <span id="Use_with_parameters"></span> === 带有参数使用 === 该函数允许将参数用作测试字符串。 在這種情況下,不必将管道符放在参数名称后面,因为你不太可能會选择字符串“<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>”作为样例。 (如果没有管道符,且参数不存在或没有值,则参数就會預設为这样的值。 {{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 请参阅{{ll|Help:Parser functions in templates}}。|zh-hant = 請參閱{{ll|Help:Parser functions in templates}}。}}) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> 上面的例子中,如果<code><nowiki>{{{1}}}</nowiki></code>等于<code>foo</code>,函数返回<code>Foo</code>。 如果等于<code>baz</code>,函数返回<code>Baz</code>。 如果参数是空的或者不存在,函数返回<code>Bar</code>。 上面的这些中,也可以将样例组合起来以返回单个结果。 :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> 如果<code><nowiki>{{{1}}}</nowiki></code>等于<code>foo</code>、<code>zoo</code>或<code>roo</code>,函数返回<code>Foo</code>。 如果等于<code>baz</code>,函数返回<code>Baz</code>。 如果参数是空的或者不存在,函数返回<code>Bar</code>。 而且,如果你希望在测试参数不能匹配任何样例时不返回任何内容,可以省略默认结果。 :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> 在本例中,如果<code><nowiki>{{{1}}}</nowiki></code>存在且等于<code>foo</code>或<code>bar</code>,则分别返回<code>Foo</code>或<code>Bar</code>,否则不返回任何内容。 这样做相当于将默认值声明为空。 :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> 如果由于某些原因需要将样例设置为<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>,则函数在参数不存在或没有值的情况下返回该样例的结果。 参数需要存在且拥有不同于字符串“<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>”的值以返回函数的默认结果。 :(若<code><nowiki>{{{1}}}</nowiki></code>不存在或者是空的): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(若<code><nowiki>{{{1}}}</nowiki></code>的值为<code>test</code>): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(若<code><nowiki>{{{1}}}</nowiki></code>的值为<code><nowiki>{{{1}}}</nowiki></code>): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' 在这样的例子中,你需要给参数添加管道符(<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>)。 <span id="Comparison_behavior"></span> === 比较行为 === 如同<code>[[##ifeq|#ifeq]]</code>那样,若被比较字符串和测试用例字符串都是数字,那么按照数值进行比较;反之若存在一个非纯数字串,都会按照字符串比较规则进行: :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <code>''case''</code>字符串可以是空的: :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' 只要找到一个匹配,后面的<code>''case''</code>都会忽略: :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <code>[[##switch|#switch]]</code>和<code>[[##ifeq|#ifeq]]</code>的数值比较结果未必一致(参见上面<code>[[##ifeq|#ifeq]]</code>部分): :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <span id="Raw_equal_signs"></span> === 原始等号 === “case”字符串不能包含原始等号。可以使用魔術字符[[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]]創建一個仅包含一个等号: $code1的模板$tpl去繞開它,或者是用HTML标识码<code><nowiki>&amp;#61;</nowiki></code>来代替。 例如: {| class="wikitable" ! 您输入的 ! 您得到的 |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=为助您理解,您可以检查[https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 模板:NBA球队代表色]。{{ll|Template:Extension}}和[[w:Template:BOTREQ]]是两个使用该函数的复杂例子。 }} <span id="Replacing_#ifeq"></span> === 替换#ifeq === <code>#switch</code>可以用于减少[[Special:MyLanguage/Help:Expansion depth|擴張深度]]。 例如: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> 等效于 * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> 也就是线性的深度迭代判断: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> 另一方面,对于嵌套在两个分支中的if(以缩进形式呈现,两侧都缩进),替换成switch可能很复杂/不切实际,从而形成对称树: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | {{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 代码|zh-hant = 程式碼}} ! {{hl1}} | 描述 ! {{hl1}} | 当前输出<br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} 刷新此页面的缓存]以更新)</small> |- ! {{hl2}} colspan="3"| 年 |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | 4位数年。 | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | 2位数年。 | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 如果是闰年则为1,否则为0。 | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|需要 PHP 5.1.0 及更新版本和 [[rev:45208]].|group=note}} | 指定周的ISO-8601年。{{#tag:ref|这拥有与Y相同的值,除了当ISO周数(W)属于去年或明年时,会改用那一年。|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|如果未满足注释1,将输出文字“o”。|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| 月 |- | style="text-align: center;" | <code>n</code> | 月指数,無前缀零。 | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | 月指数,有前缀零。 | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | 月名的缩写,使用网站语言。 | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | 使用网站语言的完整月名。 | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | 不同于[[w:zh:主格|主格]]形式,以[[w:zh:所有格|所有格]]形式返回月份名的全称。这个代码适用大多数的[[w:zh:斯拉夫语言|斯拉夫语言]],比如波兰语、俄语、白俄罗斯语、捷克语、斯洛伐克语、斯洛文尼亚语、乌克兰语等。 | style="line-height: 1.6;" | 波兰语:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(主格)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(所有格) |- ! {{hl2}} colspan="3"| 一年或一个月内的第几天 |- | style="text-align: center;" | <code>j</code> | 月内的第几天,没有前缀零。 | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | 月内的第几天,用前缀零填满两位。 | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | 年内的第几天(一月一日视为第0天)。<br />{{note}}要获得ISO日期值请在此数基础上加1。 | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| 周,以及周内的第几天 |- | style="text-align: center;" | <code>W</code> | ISO 8601周数,有前缀零。 | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | ISO 8601 一周中的某天(星期一为1, 星期日为7)。 | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | 一周内的某天(星期日为0,星期六为6)。 | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | 星期几的简写。很少国际化。 | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | 星期几的全称。很少国际化。 | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| 小时 |- | style="text-align: center;" | <code>a</code> | 上午(00:00:00 → 11:59:59)返回“am”, 下午(12:00:00 → 23:59:59)返回“pm”。 | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | 上面的<code>a</code>项的大写版本。 | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | 十二小时制的小时数(无前缀零)。 | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | 十二小时制的小时(有前缀零)。 | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | 二十四小时制的小时(无前缀零)。 | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| 二十四小时制的小时(有前缀零)。 | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| 分钟和秒钟 |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | 一小时内已过去的分钟数(有前缀零)。 | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | 一分钟内已过去的秒数(有前缀零)。 | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:zh:Unix时间|Unix时间]]。 自1970年1月1日00:00:00 GMT的秒数。 | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| 时区(截至[[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | 时区标识符。 | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | 是否使用夏令时。 | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | 与格林尼治时间(GMT)的差值 | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | 与格林威治时间(GMT)的差异,带冒号 | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | 时区缩写。 | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | 时区偏移(秒)。 | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| 杂项 |- | style="text-align: center;" | <code>t</code> | 本月日数。 | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | ISO 8601格式化日期,与<code>Y-m-d"T"H:i:s+00:00</code>等效。 | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | [[rfc5322|RFC 5332]]格式化的日期。与<code>D, j M Y H:i:s +0000</code>等价,但週名和月名可能不是国际化表述。 | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | 非公历(格里历)历法 |- ! {{hl3}} colspan="3" | 伊斯兰教历法 |- | style="text-align: center;" | <code>xmj</code> | 月内一日。 | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | 月的全名。 | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | 月索引。 | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | 全年。 | {{#time:xmY}} |- ! {{hl3}} colspan="3" | 伊朗历法(Jalaly) |- | style="text-align: center;" | <code>xit</code> | 月内日数。 | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | 年内一日。 | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | 月内一日。 | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | 月的全名。 | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | 月索引。 | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | 全年。 | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | 2位数年。 | {{#time:xiy}} |- ! {{hl3}} colspan="3" | 希伯来历法 |- | style="text-align: center;" | <code>xjj</code> | 月内一日。 | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | 月的全名。 | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | 月内日数。 | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | 月份名称的所有格形式。 | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | 月数。 | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | 全年。 | {{#time:xjY}} |- ! {{hl3}} colspan="3" | 泰历 |- | style="text-align: center;" | <code>xkY</code> | [[w:Thai solar calendar|泰太阳历]]中的年份. <br />{{note}}1941年前后,本条目可能与依泰历的真实[[w:Thai_solar_calendar#New_year|计算方式]]出的年份有变化. | {{#time:xkY}} |- ! {{hl3}} colspan="3" | 民国历/主体历 |- | style="text-align: center;" | <code>xoY</code> | 全年。 | {{#time:xoY}} |- ! {{hl3}} colspan="3" | 日本历法 |- | style="text-align: center;" | <code>xtY</code> | 全年。 | {{#time:xtY}} |- ! {{hl2}} colspan="3" | 标记 |- | style="text-align: center;" | <code>xn</code> | 以ASCII原始数字表示的数字代码。 | 在印地语中,<syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight>产生०६, 06。 |- | style="text-align: center;" | <code>xN</code> | colspan="2" | 类似于<code>xn</code>,但是作为一个toggled flag,会持续到字符串的末尾或者字符串中<code>xN</code>下一次出现。 |- | style="text-align: center;" | <code>xr</code> | 将下一个数字格式化为罗马数字。仅适用于10000以内的数字<br /><small>(MediaWiki 1.20之前的版本为3000以内)</small> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | 将下一个数字格式化为希伯来数字。 | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} 该解析器函数接收一个(公历的)日期或者时间,并根据给定的语法将其格式化。可以指定日期/时间对象,默认则为[[Special:MyLanguage/Help:Magic words#Date and time|魔术字]]Special:MyLanguage/Help:Magic words#Date and time的当前值——也就是说,页面最后被渲染为HTML时的时间。 :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> 右表列举了支持的格式化代码。 任何不被识别的格式化字符串都不会被修改,这同样适用于空白字符(系统不使用空白字符来解释代码)。 如果格式化字符串中沒有識別到任何字符,且日期/時間物件沒有錯誤,則格式化字符會作為輸出傳回。 格式化字符串内有两种方法来转义字符: # 反斜杠后跟随一个格式化字符串会被解释为单个原始的字符 # 用英文双引号括起来的字符视为原始字符,引号将被移除。 此外,<code>xx</code>会被解释为单个原始的x。 由于格式化代码列表会持续发展(支持新日历,或支持以不同方式计算和格式化的新日期字段),您应该转义所有需要传入而保持不变的文字字符(不仅仅是格式化代码当前使用的ASCII字母)。 不幸的是,目前,ASCII单引号仍未被视为当前已经受支持的ASCII双引号(可标记文字文本)和反斜杠(在许多语言使用的字符串常量中也必须转义,包括JSON、C、C++、PHP、JavaScript、Lua)的简单替代方法(例如,双引号在其他用途​​中是强制性的,例如JSON、C、C++等语言中的字符串值的定界)。 因此,您仍然无法在不使用反斜杠转义的情况下嵌入任何文字双引号(或者也可以使用其他弯引号、角形引号或方引号)。 :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <code>''date/time object''</code>可以是任何PHP [https://php.net/function.strtotime strtotime()]函数接受的格式。 绝对(如<code>20 December 2000</code>)、相对(如<code>+20 hours</code>)和混合时间(如<code>30 July +1 year</code>)格式均是可以的。 :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' [[w:zh:ISO 639-3|ISO 639-3]](?)中的<code>''language code''</code>允许字符串显示为指定语言。 :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <code>''local''</code>参数指定''date/time object''是指本地时区还是UTC时间。 这是一个布尔参数,其值是通过转换(casting)参数值来确定的(有关如何将字符串转换为布尔值的详细信息,请参阅[https://php.net/language.types.boolean#language.types.boolean.casting 官方PHP文档])。 {{note|2=reminder|1=请注意,如果{{phpi|$wgLocaltimezone}}设为<code>UTC</code>,则当<code>local</code>设为<code>true</code>或<code>false</code>时输出无区别。}} 参考下面的详细示例: :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' 如果你已经计算了Unix时间戳,你可以通过添加<code>@</code>符号前缀来在日期计算中使用。 :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= 若不在數字格式的時間戳值的前面包含<code>@</code>前綴,結果通常會出錯或是未預期的數值: :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (正確) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (不支援的年份格式) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (正確) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' (被解讀為某年的当前月份和日期) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (正確) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' (被解讀為某年的当前月份和日期) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (正確) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (不支援的年分格式) }} {{Warning|1= 可接受的范围为0111年1月1日(1 January 0111)到9999年12月31日(31 December 9999)。对于年份100到110,输出不连贯,Y和闰年类似于年份100-110,而r、D、I和U可能会将这些年份解释为2000-2010。 :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> (正確,沒有閏年),但是 :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' (錯誤,即使100也被解讀為2000,因为那是閏年) :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' 年份数字0-99解释为2000-2069和1970-1999,除非添加前缀0以写成四位数格式: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) 年份100-110和1753之后的年份支持工作日,对于年份111-1752,r的输出显示“Unknown”,l输出“<>”,结果,这些年份不支持r输出。 }} 可以指定完整的或部分绝对的日期;函数会使用“当前”值“填充”日期中未被指定的部分。 :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= “填充”功能并不连贯,有些部分会使用当前值填充,其他的则不会: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' 给予这一天的开始,而不是当前月份中的日期和当前年份。 :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' 给予这一天的开始,而不是这一年的当前日期。 填充日期有特例: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' 给予这一天的开始和这个月的开始。 }} 4位數字總是被解讀為年分,而不是小時和分鐘:<ref>在2011年{{rev|86805}}之前,情況並非如此。</ref> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' 6位數字儘量被解讀為小時、分鐘、秒,不然會被解讀為錯誤(而不是年份和月份): :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' 輸入被視為時間而不是年+月代碼。 :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' 雖然19:60:09不是有效時間,但196009不被解讀為1960年9月。 該函數執行一定數量的日期算數: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <code>#time</code>的调用格式字符串的總長度限制為6000個字符。<ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== 时区问题 ==== <nowiki>#</nowiki>time解析器函数有个bug(尤其是PHP DateTime),不允许传入非整数的相对时区偏移。这个问题不适用于使用基于小时的时区,例如EDT。舉例如下: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} 然而,印度是UTC +5.5个小时的时间偏移,因此使用它的时区無法正常地计算相对时区的偏移。情況如下: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} 要閃開这个问题,可将时间简单转换为分钟或者秒,像这样: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} (Tim Starling,该函数的开发者,提供了该解决方案的准确语法。) <span id="#time_format_like_in_signatures"></span> ====如同簽名那樣的#time格式==== 有時候,建構一個時間戳是很有用的,它看起來就像是討論頁裏面的討論,由[[Special:MyLanguage/Help:Signatures|簽名]]自動產生的時間戳。 在英文wiki上,可以用以下方式建立: * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == 该函数是一个语法缩写,作用等价于将<code><nowiki>{{#time: ... }}</nowiki></code>的<code>local</code>参数设置为{{phpi|true}},因此它始终使用用户的首选时区或wiki的配置时区(在{{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}中设置)。 该函数的语法为: :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=请注意,如果变量{{phpi|$wgLocaltimezone}}设为<code>UTC</code>,则当<code>local</code>设为{{phpi|true}}或{{phpi|false}}时输出无区别。}} [[File:Time-Timel.png|thumb|使用#time和#timel解析器函数的示例,其中服务器处于非UTC时区]] 例如,参考以下示例: :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid的警告範例]] {{Warning|1= 注意对于time和timel,U会都返回自1970-01-01 00:00:00 UTC(即GMT)的秒数,无论时区是否为UTC。 :<code>U</code> Unix时间。自1970年1月1日 00:00:00(GMT)以来的秒数。 :<code>Z</code> 时区偏移(秒)。 :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == 此功能使用所選語言的標準格式來格式化日期,格式定義在<code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code>中(參見{{Phab|T223772}})。 : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=''日期/时间对象'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=''日期/时间对象'' |2=''顯示格式'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=''日期/时间对象'' |2=''顯示格式'' |3=''語言代碼'' }} 「日期/時間物件」的格式與 [[#time|#time]] 相同,如果為空,則使用頁面渲染時的時間。 此處的''顯示格式''可為下列中的其中一種: ; <code>time</code> : 只顯示時間。 ; <code>date</code> : 只顯示日期。 ; <code>both</code> : 時間與日期都顯示。 ; <code>pretty</code> : 僅顯示日期,採用省略年份的縮寫格式。 並非所有語言都支援此功能;若未支援,則採用「日期」格式。 若未指定「格式類型」,則時間與日期皆會顯示,如同是指定了 <code>both</code> 參數。 若未指定「語言代碼」,則使用該頁面的內容語言。 使用<code>#timef</code>而不是<code>#time</code>,可讓模板更輕鬆地支援多種語言,因為不同語言對日期格式化有不同的方式。 在英文中,日期和月份的順序是由{{wg|AmericanDates}}控制。 示例: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == 此函數與 [[#timef|#timef]] 相同,但會使用維基在{{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}中設定的本地時區。 :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == 此函数将页面标题根据斜杠划分成多个分段,然后返回这些分段中的某些部分做為输出。 : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=页面名称 |2=需要返回的分段数量 |3=要返回的第一个分段 }} 如果没有指定''要返回的分段数量''参数,则默认为“0”,会返回从''要返回的第一个分段''一直到結尾(有包含)的所有分段。如果''要返回的第一个分段''参数没有指定或者为“0”,则默认为“1”。 : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' {{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 请参阅<nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>。|zh-hant = 請參閱<nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>。}} : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' 两个值都接受负值。''要返回的分段数量''参数的负值会从字符串的最后开始“分解”分段。''要返回的第一个分段''参数的负值解释为“从这一分段开始,从右边开始计数”: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' 从字符串的末尾分解一段 {{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 请参阅{{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}。|zh-hant = 請參閱{{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}。}} : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' 从字符串的末尾分解所有4段 : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' 从字符串的末尾分解5段(多于已存在的) : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' 返回最后一段。 {{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 请参阅{{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}。|zh-hant = 請參閱{{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}。}} : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' 从字符串的末尾分解一段,然后返回第二段及以后的段 : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' 从倒数第二个元素开始复制;从字符串的末尾分解一段 处理前,''页面名称''参数是HTML解码的:如果包含一些标准的HTML字符实体,将被转换为纯字符(内部使用UTF-8编码,也就是与使用解析器函数的MediaWiki源页面中的编码相同)。 : 例如,''页面名称''中出现了<code>&amp;quot;</code>、<code>&amp;#34;</code>、<code>&amp;#x22;</code>的地方,都会替换为<code>"</code>。 : 不会执行从HTML到纯文本的其他转换,因此即使HTML标签在页面标题中无效,在此初始步骤中也会保持不变。 {{tip| 1= MediaWiki的一些魔术字或解析器函数(例如<code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code>和类似)会返回用多余的HTML编码的字符串,即使其自身的输入参数不是HTML编码的: titleparts解析器函数可以用作一个解决办法,以转换返回的字符串,因此可以被其他的一些解析器函数正确处理,如果这些<!-- 替换原文中的长定语 -->解析器函数参数中也会接收页面名称,比如<code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>(但对于HTML编码的字符串仍然不能正确处理)。 This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. 例如,如果当前页面是[[commons:Category:Côte-d'Or|Category:Côte-d'Or]],那么: * <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>、<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight>都会返回<code>1</code>;(#ifeq解析器函数不会对输入参数进行HTML解码)。 * <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>、<syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight>都会返回<code>1</code>;(#switch解析器函数不会对输入参数进行HTML解码)。 * <syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>、<syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>甚至<syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight>都会返回<code>1</code>,如果这个分类页面存在(#ifexpr解析器函数不会对输入参数进行HTML解码); * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight>返回非零数,如果该分类包含页面或子分类,'''但是''': * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>可能会'''无条件'''地返回0,就像: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> 这种非预料行为的原因是,对于当前版本的MediaWiki,有两个警告(caveats): * <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>,或者甚至<syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight>''可能会''返回实际HTML编码的字符串<code>Category:Côte-d&apos;Or</code>而不是预期中的<code>Category:Côte-d'Or</code>;<!-- “and that”不翻译 --> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight>'''无条件地'''返回0(PAGESINCAT魔术字不对输入参数进行任何的HTML解码)。 使用titleparts的简单解决方法(如果上述两个警告在MediaWiki的更高版本中修复了,也会继续生效): * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>,总是返回相同分类中的实际页面数量。 }} 解码后的''页面名称''会尽可能标准化为MediaWiki支持的标准页面名称: # 所有下划线都自动替换为空格: #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' 不是bah_boo,尽管原来的内容有下划线。 # 字符串最多分割25此;更多的斜杠都会忽略,第25个元素将会包含字符串的剩余内容。 字符串也限制在255个字符内,因为要被视为[[Special:MyLanguage/Manual:Page table#Schema summary|页面标题]]: #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: 如果出于某些原因确实要将此函数推到极限(尽管不太可能),可以通过嵌套函数调用来绕过只能分割25此的限制: #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # 最后,第一个子字符串根据本地wiki的大小写设置进行大写(如果该子字符串也以本地命名空间名称开头,则该命名空间名称也被标准化)。 #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= 您可以把#titleparts用作一个小的“字符串解析器和转换器”,但要考虑到返回第一个子字符串会大写: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' 如果需要小写,使用lc:函数以控制输出: : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' 你可以在字符串开头添加一个“伪”斜杠以修正第一个子字符串的大小写。对于''要返回的第一个分段'',应使用<code>2</code>而不是<code>1</code>。 : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= 一些字符{{ll|Manual:Page title#Naming restrictions|在页面标题中是非法的}},会导致#titleparts不去解析字符串。 : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. 不产生预期的: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. 不起作用,因为页面标题中的中括号是非法的,并且此解析器函数不处理嵌入在其输入的「页面名称」参数中的链接,即使使用了MediaWiki语法或任何其他HTML或MediaWiki标签。 : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". 不起作用,因为“#”在页面标题中是非法的。 }} {{Warning|1= 如果标题中的某个部分只是“<code>.</code>”或“<code>..</code>”,那么#titleparts不会解析字符串: : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. 返回整个字符串。不产生预期的: '''one''' }} {{Warning|1= 如果输入超过255个UTF-8字节,则此函数不会正常降级(degrade gracefully)。如果输入字符串为256字节或更多,则返回整个字符串。 }} <span id="String_functions"></span> == 字符串函数 == {{Main|Extension:ParserFunctions/String functions}} 如果將<code>$wgPFEnableStringFunctions</code>設定為{{phpi|true}},解析器函数的扩展會選擇性定義各種字串函式: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> 請參閱專屬子頁的說明文件,以及{{ll|Manual:Performing string operations with parser functions}}的範例。 {{Warning |1=2013年,維基媒體基金會決議'''這些功能將「永遠」不會在任何維基媒體維基啟用''',因為它們在大規模使用時效率低下(參見[[phab:T8455]]了解相關歷史)。 '''這些功能「無法」在維基媒體維基上運作!'''<br/><br/>若您是為在維基媒體專案上撰寫內容而來,您此刻尋找的應該是另有他物:若是您的主維基具備字串函數,它可能是使用 {{ll|Extension:Scribunto|Lua}}。 例如,中文維基百科使用[[w:zh:Module:String|模組:String]],它以截然不同的語法實現了部份相同的功能。 另亦有存在獨立的[[w:zh:Template:字串模板一覽|字串處理模板]]。 }} 以下是[[Module:String]]函数的简要概述: * [[w:Module:String#len|&#35;len]] (字符串长度): <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] (子字符串): <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] (目标位置): <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] (重复): <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == 一般帮助 == <span id="Substitution"></span> === 替换引用 === 在井号前面添加<code>'''subst:'''</code>可以将字符串函数[[Special:MyLanguage/Help:Substitution|替换引用]]: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → 将在文本中插入代码'''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''',因为{{FULLPAGENAME}}存在。 {{Warning|1= 如果表单时包含''未''替换引用的可变代码,例如{{ll|Help:Magic words#Variables|变量}}或者其他解析器函数,那么被替换引用的解析器函数的结果是未定义的。为使结果恒定,需要运算的表达式中的所有易变代码都必须被替换引用。参见[[w:zh:Help:替换引用|帮助:替换引用]]。}} {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}内的替换引用不起作用,如要使用,可以使用<code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code>。 <span id="Redirects"></span> === 重定向 === 特別是 [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] 在{{ll|Help:Redirects|重定向}}至含日期的頁面時相當實用,但此功能目前無法正常運作。 <span id="Escaping_pipe_characters"></span> === 转义管道符 === <span id="In_tables"></span> ==== 在表格中 ==== 解析器函数会破坏{{ll|Help:Tables|wikitable}}语法和管道字符(<code><nowiki>|</nowiki></code>),将所有的原始管道字符视为参数分隔符。 为了避免这个,大多的wiki都會使用模板[[{{ns:10}}:!]],其内容仅为一个管道符(<code><nowiki>|</nowiki></code>),自MediaWiki 1.24开始,{{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> 魔术字}}取代了這個蹩脚的方法。 这会“隐藏”MediaWiki解析器中的管道符号,以确保在展开页面上的所有模板和变量之前無需顧慮到它。 然后它将會被解释为表格的行或列分隔符。 另外,原生的HTML表格语法還是能夠使用,尽管这并不直观而且容易出错。 您也可以使用HTML實體:<code>&amp;#124;</code>或<code>&amp;vert;</code>,將管道字符&vert;转义為纯粹、未解析的字元來顯示。 {| class="wikitable" ! 说明 ! 您输入的 ! 您得到的 |- | 将管道字符转义为表格行/列分隔符 | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | 将管道字符转义为纯字符 | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== 在模板的呼叫中 ==== 如下列範例所示,套用相同的管道字符保護: <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> 我們觀察到,當管道字符 | 緊接在 ''sandbox name='' 之前存在時,''text after'' 不會顯示,因為 ''|sandbox name='' 被錯誤地視為與 ''|content='' 同級的''Documentation''模板的參數。 <span id="Stripping_whitespace"></span> === 除去空白字符 === 空白字符(whitespace),包括换行符、制表符和空格,在这些解析器函数的所有参数的开头和结尾处,都会被除去。如果不希望这样,可以将字符串放在引号中后进行比较。 :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' 要避免修整then和else部分,参见[[m:Template:If]]。 一些人为达到目的,会使用<nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki>而非空格。 :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' 然而,这种方法只能用于渲染'''单个'''空白字符,因为解析器函数会将一行中的多个空白字符挤压成一个。 :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} 在本例中,<code>white-space: pre</code>样式用来强制浏览器保留空白,但即使使用它,也不会显示空格。发生这种情况是因为这些空格在发送到浏览器之前,就已经被软件除去了。 要解决此问题,可以将空白字符替换为<code>&amp;#32;</code>(''可折行空格'')或者<code>&amp;nbsp;</code>(''不可折行空格''),因为这些字符不会被软件修改: :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' 请注意,并非所有参数都是平等的。 在解析器函数中,开头和结尾的空格始终是忽略的。 在{{ll|Help:Templates|模板}}中,命名参数和添加数字的非命名参数的开头和结尾的空格是被忽略的,但非命名参数的首尾空格不会被忽略: :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == 其他解析器函数 == <span id="Case_conversion_functions"></span> === 大小写转换函数 === * '''小写:''' {{xpdoc|lc: AbC|}} * '''大写:''' {{xpdoc|uc: AbC|}} * '''首字母小写:''' {{xpdoc|lcfirst: AbC}} * '''首字符大写:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === 编码函数 === * '''URL编码:''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> 生成 ---- "{{urlencode: AbC dEf ghi}}" ---- 因此內部換行符轉換為%0A,內部空格轉換為+。 <span id="Anchor_encoding"></span> === 锚编码 === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> 生成 ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == 參見 == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – 由核心和扩展所添加的解析器函数的(不完整)列表。 * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – 特別是針對數字格式與前缀零 * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]]已废弃的{{ll|Extension:StringFunctions}} * Wikibase的解析器函数(启用Wikidata的扩展): [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|如何在維基媒體計畫中應用數據#解析器函数]] <span id="References"></span> == 參考資料 == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] kwvq7xr6f7pnia8v0pu384icuv4ha13 Help:Extension:ParserFunctions/ta 12 237272 8365034 8353949 2026-05-04T06:21:31Z FuzzyBot 451990 Updating to match new version of source page 8365034 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span lang="en" dir="ltr" class="mw-content-ltr">The {{ll|Extension:ParserFunctions|nsp=0}} extension provides additional [[Special:MyLanguage/Parser functions|parser functions]] to supplement those already present in MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">(It ''may'' be configured to provide additional parser functions for string handling; these are only available to non-Wikimedia Foundation wikis hence these string functions are documented {{ll|Extension:ParserFunctions/String functions|elsewhere}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">All the parser functions provided by this extension take the form:</span> :<code><nowiki>{{</nowiki><span lang="en" dir="ltr" class="mw-content-ltr">'''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ...</span> <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | வகை ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Operators</span> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Grouping (parentheses)</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | எண்கள் | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | <span lang="en" dir="ltr" class="mw-content-ltr">binary operator</span> <code>'''e'''</code> &nbsp; <span lang="en" dir="ltr" class="mw-content-ltr">unary</span> <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Unary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Binary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Round</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Logic</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} <span lang="en" dir="ltr" class="mw-content-ltr">This function evaluates a mathematical expression and returns the calculated value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This function is also available in {{ll|Extension:Scribunto|nsp=0}} via the <code>mw.ext.ParserFunctions.expr</code> function.</span> :<code><nowiki>{{#expr:</nowiki> ''<span lang="en" dir="ltr" class="mw-content-ltr">expression</span>'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The available operators are listed to the right, in order of precedence. See {{ll|Manual:Expr parser function syntax}} for more details of the function of each operator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> When evaluating using [[w:boolean algebra|boolean algebra]], zero evaluates to {{phpi|false}}, and any nonzero value, positive or negative, evaluates to {{phpi|true}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code>[[##iferror|#iferror]]</code> function: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Rounding === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Test case</span> ! {{hl1}} | முடிவு ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Method of rounding</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is < 5, so no apparent rounding occurs</span> (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is ≥ 5, so it is rounded up</span> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to the nearest integer</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the ''nearest'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding up or down with ''ceil'' and ''floor''</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next ''larger'' integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next ''smaller'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next larger integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next smaller integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Not rounded, since 1 already is an integer</span><br />{{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect</span>}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Strings === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: test string | value if test string is not empty | value if test string is empty (or only white space)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: first parameter | second parameter | third parameter }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> எடுத்துக்காட்டு {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | விளக்கம் ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| ஆண்டு |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | 4-இலக்க ஆண்டு. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | 2-இலக்க ஆண்டு. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Month</span> |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour</span> |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| நிமிடங்களும் விநாடிகளும் |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | மாதத்தின் நாள். | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | முழு மாதப் பெயர். | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | முழு ஆண்டு. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | மாதத்தின் நாள். | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | முழு மாதப் பெயர். | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | முழு ஆண்டு. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | 2-இலக்க ஆண்டு. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | ஹீப்ரு |- | style="text-align: center;" | <code>xjj</code> | மாதத்தின் நாள். | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | முழு மாதப் பெயர். | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | மாதத்தின் நாட்களின் எண்ணிக்கை. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | திங்கள் எண். | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | முழு ஆண்டு. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | முழு ஆண்டு. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | முழு ஆண்டு. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! விளக்கம் ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] n9ch81ljexk2tfrq886e4n52lgjgq0g Extension:PageTriage/en 102 240066 8365068 8157888 2026-05-04T07:51:33Z FuzzyBot 451990 Updating to match new version of source page 8365068 wikitext text/x-wiki <languages /> {{Extension |templatemode = |status = stable |type1 = special |type2 = interface |newhook1 = |newhook2 = |username = |author = [[User:Kaldari|Ryan Kaldari]], [[User:Bsitu|Benny Situ]] |description = Facilitates reviewing and approving new pages |image = Extension-PageTriage Special-NewPagesFeed Screenshot.png |imagesize = 300 |version = |update = |version preview = |update preview = |compatibility policy = rel |mediawiki = |php = |composer = |table1 = pagetriage_page |table2 = pagetriage_page_tags |table3 = pagetriage_tags |download = {{WikimediaDownload|phab=EPTR}} |readme = |changelog = |example = [[wikipedia:Special:NewPagesFeed | Special:NewPagesFeed on the English Wikipedia]] |namespace = |tags = |compatibility = |bugzilla = |phabricator = PageTriage |vagrant-role = }} '''PageTriage''' is an extension that aims to provide a feature-rich interface for triaging newly-created articles. It is intended to replace the ''new page patrol'' core function while adding additional functionality for reviewing, tagging, and improving new articles. It adds a Special:NewPagesFeed page, and a page curation toolbar to new pages for those with the 'patrol' permission. It was developed by the Wikimedia Foundation's [[Wikimedia_Features_engineering|Features Engineering team]]. For additional details see ''[[Page Curation|Page Curation]]''. An important note is that some of the configuration and code is specific to the English-language Wikipedia's workflows and as it's constructed now the extension is pretty much impossible to internationalise. (See [[Phabricator:T50552]].) [[File:Page-Curation-Video.ogv|thumb|An overview of the page curation feature. The interface in the video is outdated but the content remains useful.]] == Installation == [[File:PageTriage-ListView-Whole.png|thumb|Screenshot of Special:NewPagesFeed as it appeared in 2012]] {{ExtensionInstall |db-update=yes |registration=required |localsettings= }} == Checking for successful install == To actually see the extension working: * Create a new page containing just a few sentences of text as an anonymous user. * Visit Special:NewPagesFeed The new page should appear, flagged as "{{int|pagetriage-no-categories}}", "{{int|pagetriage-orphan}}", etc. To see the page curation toolbar: * Login as a user with the 'sysop' permission, or add a group with the "[[Special:MyLanguage/Help:Patrolled_edits|patrol]]" permission, and add some user to that group, and login as that user. * Visit Special:NewPagesFeed * Now you should see a "{{int|pagetriage-triage}}" button next to the new page. * Click this and you should see the page curation toolbar on the new page. == Advanced installation == === Additional extensions === For full functionality, you'll also need to install some additional extensions, although PageTriage works without them. * {{ll|Extension:Echo|Echo}} - Allows users to receive notifications for things like when an article they created has been marked as reviewed. * {{ll|Extension:ORES|ORES}} - In Special:NewPagesFeed, allows filtering by "predicted class" (<code>articlequality</code>: stub, start, c-class, b-class, good, featured) and "potential issues" (<code>draftquality</code>: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because <code>draftquality</code> needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's [[git:mediawiki/extensions/ORES/+/8bd39f26548d58fa8bf6765e1c23f5e3086f1cd4/extension.json#225|extension.json file]]. * {{ll|Extension:WikiLove|WikiLove}} - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily. === Enabling draft namespace === By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php <syntaxhighlight lang="php" copy> // These three settings are optional, and will enable the Articles-for-Creation mode. $wgPageTriageDraftNamespaceId = 118; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft'; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk'; </syntaxhighlight> When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed. By default pages edited in the draft namespace will be "unsubmitted". Articles in the draft namespace can be submitted for review by adding <nowiki>[[Category:Pending_AfC_submissions]]</nowiki> to the draft page. At which point they will show up under "awaiting review". Note the toolbar controlled by the configuration variable '''$wgPageTriageEnableCurationToolbar''' does not show up in the draft namespace. === Cron jobs === To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: <code>cron/updatePageTriageQueue.php</code> == Manual testing == === Special:NewPagesFeed -> Articles for Creation === * Enable draftspace by following the directions above in the section [[#Enabling draft namespace]]. * In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories: ** Unsubmitted: (no category) ** Awaiting review: Category:Pending AfC submissions ** Under review: Category:Pending AfC submissions being reviewed now ** Declined: Category:Declined AfC submissions Note: The Page Curation toolbar does not display for drafts. === ORES === Enwiki has the [[Extension:ORES|ORES extension]] installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure: * Clone Extension:ORES and add <code>wfLoadExtension( 'ORES' );</code> in <code>LocalSettings.php</code> * Add this to <code>LocalSettings.php</code> <syntaxhighlight lang="php" copy> $wgPageTriageEnableOresFilters = true; $wgOresWikiId = 'enwiki'; $wgOresModels = [ 'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ], 'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'sources' => [ 1 ] ] ]; </syntaxhighlight> * Run <code>php maintenance/run.php ./extensions/ORES/maintenance/BackfillPageTriageQueue.php</code> == Determining if a page is reviewed == === Status codes === There are status codes used to track whether a page is reviewed or not. These are the values given when you query <code>patrol_status</code>, <code>ptrp_reviewed</code>, and <code>ptrl_reviewed</code>: * Unreviewed ** 0 - unreviewed * Reviewed ** 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar) ** 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page) ** 3 - autopatrolled (someone with the <code>autopatrol</code> user right created the page, or moved the page from a non-tracked namespace to a tracked namespace) ** no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job) === Via the API === To check the review status of pages using an API query, you can use <code>api.php?action=query&prop=isreviewed</code>. Sample JavaScript code:<syntaxhighlight lang="js" copy> /** * @param {number} pageID The page ID number. A positive number with no commas. */ async isReviewed(pageID) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', pageids: pageID, } ); return response.query.pages[0].isreviewed; } /** * @param {string} title One title. Can include namespace. Example: User:Test */ async function isReviewed(title) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', titles: title, } ); return response.query.pages[0].isreviewed; } </syntaxhighlight> === Via SQL === To check the review status of pages using an SQL query, you need to query the <code>{{ll|Extension:PageTriage/pagetriage page table|pagetriage_page}}</code> table and the <code>ptrp_reviewed</code> field. Follow the directions in [[#Status codes]] to interpret the values of this field. <syntaxhighlight lang="sql" copy> /* By page_id */ SELECT ptrp_reviewed FROM pagetriage_page WHERE ptrp_page_id = 71318376 /* By page_title and page_namespace */ SELECT ptrp_reviewed FROM pagetriage_page JOIN page ON page_id = ptrp_page_id WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces AND page_namespace = 0 </syntaxhighlight> == SQL == === SQL tables === {| class="wikitable" |+ !Name !Prefix !Description !Old entry deletion strategy !Service classes (when refactoring, SQL queries should be moved to here) !Data classes |- |[[Extension:PageTriage/pagetriage page table|pagetriage_page]] |ptrp_ |The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query <code>ptrp_reviewed > 0</code> in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. |All articles deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. |QueueManager, QueueLookup |QueueRecord |- |[[Extension:PageTriage/pagetriage page tags table|pagetriage_page_tags]] |ptrpt_ |Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the <code>pagetriage_tags</code> table. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. |All article metadata deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status. | | |- |[[Extension:PageTriage/pagetriage tags table|pagetriage_tags]] |ptrt_ |A dictionary of page_tags, and their corresponding ID number. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. | | | |} === pagetriage_page_tags === <code>pagetriage_page_tags</code> data is updated by calling <code>ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata()</code>. This is called in the following hooks: * <code>onPageMoveComplete()</code> - runs when moving a page * <code>onLinksUpdateComplete()</code> - runs when saving an edit * <code>onMarkPatrolledComplete()</code> - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user. ==== List of tags ==== The <code>pagetriage_page_tags</code> are as follows: * Author information ** user_id ** user_name - there's a filter where you can type in their username ** user_editcount ** user_creation_date ** user_autoconfirmed ** user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with <code>MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()</code> ** user_bot ** user_block_status * Deletion tags - will display a black trash can icon if marked for deletion ** afd_status ** blp_prod_status ** csd_status ** prod_status * Special:NewPagesFeed red warning text ** category_count - No categories ** linkcount - Orphan ** reference - No citations ** recreated - Previously deleted ** user_block_status - Blocked * Page information ** page_len - size of article, in bytes ** rev_count - number of edits to the article ** snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article * afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined * copyvio - latest revision ID that has been tagged as a likely copyright violation, if any == PHP == === Extension configuration === The extension is based on the 'patrol' right. For more information about configuring patrolling, see {{ll|Manual:Patrolling}}. The following configuration variables can be set from your LocalSettings.php file: {| class="wikitable" |+ ! Variable ! Default ! Description |- | {{phpi|$wgPageTriageEnableCurationToolbar}} | {{phpi|true}} | Set to false to disable the [[Special:MyLanguage/Page Curation#User Experience: Curation Toolbar|curation toolbar]] |- | {{phpi|$wgPageTriageInfiniteScrolling}} | {{phpi|true}} | Whether or not to use infinite scrolling in the new pages feed |- | {{phpi|$wgPageTriageMaxAge}} |90 | The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true). |- | {{phpi|$wgPageTriageNamespaces}} |NS_MAIN | The namespaces that PageTriage is active in. |- | {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} | {{phpi|false}} | Set this to true if new, unreviewed articles should be set to noindex. In other words, if they should not be indexed by search engines until they are reviewed. |} See [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/extension.json#698|extension.json]] for the full list of config variables. === API === PageTriage adds the following API endpoints which can be used: {| class="wikitable" |+ ! API ! Description ! Type ! Triggering action |- |pagetriageaction | Mark a page as reviewed or unreviewed, and logs the action in Special:Log. |Write | * Using the Page Curation toolbar to mark a page as reviewed * Using the Page Curation toolbar to mark a page as unreviewed |- |pagetriagelist | Retrieves the list of pages in the queue, and each page's metadata, including their reviewed status. To retrieve one page, you must provide the <code>page_id</code>. To provide multiple pages, you must select one of <code>showreviewed</code>/<code>showunreviewed</code>, and one of <code>showredirs</code>/<code>showdeleted</code>/<code>showothers</code>, or no pages will be returned. |Read | * Loading the Page Curation toolbar (automatically loaded if you have the <code>patrol</code> userright and view a page that is unpatrolled or recently patrolled) * Viewing Special:NewPagesFeed (provides the list of articles) |- |pagetriagestats | Retrieves stats about the number of pages in the queue for use in the header of Special:NewPagesFeed. |Read | * Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer) |- |pagetriagetagcopyvio |Mark an article as a potential copyright violation, and logs the action in Special:Log. |Write | * Marking as a copyright violation by a bot with the <code>copyviobot</code> userright |- |pagetriagetagging | Add clean-up tags or deletion templates to a page, and logs the action in Special:Log. |Write | * Using the Page Curation toolbar to place a maintenance tag on an article * Using the Page Curation toolbar to place a deletion tag on an article |} === Special:Log === The following logs are created by the extension: {| class="wikitable" |+ !Special:Log !<code>log_type</code> !<code>log_action</code> !Description !Notes |- |Page curation log |pagetriage-curation |delete, enqueue, reviewed, tag, unreviewed |Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed | |- |Potential copyright violation log |pagetriage-copyvio |insert |Allows a bot to log potential copyright violations |Doesn't display unless you set {{phpi|$wgPageTriageEnableCopyvio}} to true |} === Entry points === The extension's features can be triggered by various actions: {| class="wikitable" |+ !Entry point type !File location !Notes |- |5 APIs |includes/Api/* | |- |1 special page |includes/SpecialNewPagesFeed.php | |- |20 hooks | * includes/Hooks.php * includes/HookHandlers/UndeleteHookHandler.php * includes/HookHandlers/Schema.php | |- |1 cron job |cron/updatePageTriageQueue.php |runs every 48 hours |- |7 maintenance scripts |maintenance/* |need to be run manually |} Here is a list of some actions and the corresponding entry points they trigger: {| class="wikitable" |+ !Action !Entry points used |- |View Main page | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() |- |Save an edit to the Main page | * Hooks.php -> onRevisionFromEditComplete() * Hooks.php -> onPageSaveComplete() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onLinksUpdateComplete() |- |Type in search box, triggering search suggestions | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onApiMain__moduleManager() |- |View Special:NewPagesFeed | * Hooks.php -> onBeforeCreateEchoEvent() * SpecialNewPagesFeed * ApiPageTriageStats * ApiPageTriageList |- |View an unreviewed article while logged in and having the <code>patrol</code> permission. | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onResourceLoaderGetConfigVars() * Hooks.php -> onDefinedTags() * Hooks.php -> onApiMain__moduleManager() * ApiPageTriageList (by <code>page_id</code>) |} ==== Hooks ==== {| class="wikitable" |+ !File !Group !Hook !Actions it performs |- | rowspan="18" |Hooks.php |Move page |[[Manual:Hooks/PageMoveComplete|onPageMoveComplete]] |Changes patrolled status, updates cache, updates metadata in <code>pagetriage_page_tags</code> table. |- | rowspan="3" |Edit page |[[Manual:Hooks/RevisionFromEditComplete|onRevisionFromEditComplete]] |Handles marking '''redirects that flip to articles''' as unreviewed. [[Deferred updates|DeferredUpdate]]. |- |[[Manual:Hooks/PageSaveComplete|onPageSaveComplete]] |Add '''new articles''' to the New Pages Feed and <code>pagetriage_page</code> table. |- |[[Manual:Hooks/LinksUpdateComplete|onLinksUpdateComplete]] |[[Deferred updates|DeferredUpdate]] of metadata / <code>pagetriage_page_tags</code> table. |- |Every page load |[[Manual:Hooks/ArticleViewFooter|onArticleViewFooter]] | * Turn on '''noindex''' for new, unreviewed articles. * Determine whether to load a '''link for autopatrolled users to unpatrol''' their article * Displays the '''Page Curation toolbar''' on recently created pages. * Create '''"Add to New Pages Feed" toolbox link''' for old articles. |- |[[Help:Patrolled edits]] |[[Manual:Hooks/MarkPatrolledComplete|onMarkPatrolledComplete]] |Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage. |- | rowspan="2" |Blocking and unblocking |[[Manual:Hooks/BlockIpComplete|onBlockIpComplete]] | rowspan="2" |Update article metadata / <code>pagetriage_page_tags</code> when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users. |- |[[Manual:Hooks/UnblockUserComplete|onUnblockUserComplete]] |- | |[[Manual:Hooks/ResourceLoaderGetConfigVars|onResourceLoaderGetConfigVars]] |Adjusts some config vars related to draft namespace ID. |- | rowspan="3" |[[Extension:Echo]] |[[Manual:Hooks/BeforeCreateEchoEvent|onBeforeCreateEchoEvent]] | rowspan="3" |Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed. |- |[[Manual:Hooks/EchoGetDefaultNotifiedUsers|onEchoGetDefaultNotifiedUsers]] |- |[[Manual:Hooks/LocalUserCreated|onLocalUserCreated]] |- |[[Extension:ORES]] |[[Manual:Hooks/ORESCheckModels|onORESCheckModels]] |Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio. |- | rowspan="3" |[[Help:Tags]] |[[Manual:Hooks/ListDefinedTags|onListDefinedTags]] | rowspan="3" |Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage". |- |[[Manual:Hooks/ChangeTagsAllowedAdd|onChangeTagsAllowedAdd]] |- |[[Manual:Hooks/ChangeTagsListActive|onChangeTagsListActive]] |- |API |[[Manual:Hooks/ApiMain::moduleManager|onApiMain__moduleManager]] |Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings. |- | rowspan="2" |Delete or undelete page |[[Manual:Hooks/PageDeleteComplete|onPageDeleteComplete]] |If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache. |- |HookHandlers/ UndeleteHookHandler.php |[[Manual:Hooks/ArticleUndelete|onArticleUndelete]] |If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed. |- |HookHandlers/ Schema.php |SQL |[[Manual:Hooks/LoadExtensionSchemaUpdates|onLoadExtensionSchemaUpdates]] | * The code that installs PageTriage's 4 SQL tables when you run <code>php maintenance/run.php update</code>. * Will also alter schemas from previous versions to match the latest schema. * This is also where all the '''pagetriage_tags''' are hard-coded. |} ==== Cron jobs and maintenance scripts ==== {| class="wikitable" |+ !File !What it does !Why run it? When is it useful? ![[phab:T341431|Safe to delete maintenance script?]] |- |cron/updatePageTriageQueue.php |Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". |Keeps the SQL tables from getting too big. | |- |maintenance/cleanupPageTriage.php |Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. |Fix a bug? [[phab:T321982|T321982]] | |- |maintenance/cleanupPageTriageLog.php |Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log |One time conversion of old log entries to modern format? Logs are now always written in the new format. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/6d9105c020c62d648a4ef6be957297bbc8a6d7d2]. |Probably |- |maintenance/cleanupPageTriagePageTags.php |Remove page from <code>pagetriage_page_tags</code> if they are not in <code>pagetriage_page</code> |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/00a752368e00e0d8b29a4908bfc3bab3096268dd]. |Probably |- |maintenance/DeleteAfcStates.php |Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ab2d8d4a2f9d0f4ff981afaee35a85f33edb5e99]. [[phab:T203184#4592953|T203184#4592953]]. |Probably |- |maintenance/FixNominatedForDeletion.php |Set <code>pagetriage_page.ptrp_deleted</code> if the page is has any <code>pagetriage_page_tags</code> related to deletion (e.g. prod_status, blp_prod_status, etc.) |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ff0c433226300aeba692089b5389435d47feef1e]. [[phab:T202582|T202582]]. |Probably |- |maintenance/populateDraftQueue.php |Add missing Draft namespace pages to the AfC triage queue. |Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/59e1fedffcdafc46722d7231011aee194db9ee08]. | |- |maintenance/updateUserMetadata.php |Former cron job. Update expired user metadata in the <code>pagetriage_page_tags</code> table |[https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/92a675a5f1f2e07cee532ec90fc57eee7f2cd49b]. [[phab:T341432|T341432]]. | |} === NOINDEX === NOINDEX refers to the HTML code <code>&lt;meta name="robots" content="noindex"></code>, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode <code><nowiki>__NOINDEX__</nowiki></code>. When {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in <code>includes/Hooks.php</code>, in the <code>onArticleViewFooter()</code> method. ==== First check ==== * First check: Noindex the page if ALL of the following are true: ** {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is turned on ** Page age is less than {{phpi|$wgPageTriageMaxAge}} (set to 90 days on enwiki) ** Page is in <code>pagetriage_page</code> table<ref>Checked by <code>isPageUnreviewed()</code></ref> ** Page is marked as unpatrolled (ptrp_status = 0) ==== Second check ==== * Second check: If the wikitext has the <code><nowiki>__NOINDEX__</nowiki></code> magic word, noindex the page if ALL of the following are true: ** Page age is less than {{phpi|$wgPageTriageMaxNoIndexAge}} (set to 90 days on enwiki) ** If {{phpi|$wgPageTriageMaxNoIndexAge}} is not null, page is in <code>pagetriage_page</code> table<ref>Checked by <code>isNewEnoughToNoIndex()</code>, if it doesn't exit early due to <code>$wgPageTriageMaxNoIndexAge</code> being <code>null</code>.</ref> The main use case for the <nowiki>__NOINDEX__</nowiki> magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See [https://en.wikipedia.org/w/index.php?search=NOINDEX&title=Special:Search&profile=advanced&fulltext=1&ns10=1 this search]. ==== Is the page in the <code>pagetriage_page</code> table? ==== In regards to the requirement "Page is in <code>pagetriage_page</code> table", there are several ways a for a page to get into this table: * Not been deleted by a PageTriage cron job ** One cron job deletes redirects older than {{phpi|$wgPageTriageRedirectAutoreviewAge}} days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them. ** Another cron job deletes reviewed pages after 30 days of being reviewed * In a namespace that PageTriage is configured to patrol * Isn't an article that is so old it predates the installation of PageTriage == JavaScript == === Directory structure === * /modules/ ** ext.pageTriage.article - related to marking an article as reviewed ** ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar ** ext.pageTriage.init - creates a mw.pageTriage object ** ext.pageTriage.newPagesFeed - Special:NewPagesFeed ** ext.pageTriage.sidebarLink - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates ** ext.pageTriage.toolbar - Page Curation toolbar <!--** ext.pageTriage.toolbar - Page Curation toolbar (Vue version)--> ** ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code ** ext.pageTriage.util - Backbone.js models (article, revision, stats) ** external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore === Toolbar === The toolbar has three states: <code>maximized</code>, <code>minimized</code>, and <code>hidden</code>. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu. === External libraries === * front end ** old (moving away from) *** [[w:Backbone.js|Backbone.js]] *** [[w:jQuery|jQuery]] *** jQuery Badge *** jQuery Waypoints *** [[w:jQuery UI|jQuery UI]] *** [[w:Mustache (template system)|Mustache (template system)]] *** [[OOUI]] - used in modules/ext.PageTriage.enqueue ([https://codesearch.wmcloud.org/deployed/?q=oojs&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FPageTriage codesearch]) *** [[w:Underscore.js|Underscore.js]] ** new (moving towards) *** Codex *** [[w:Moment.js|Moment.js]] *** Vue Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, [[phab:T208256|we are interested in replacing these front end libraries]], to make the extension easier to maintain. === Client-side hooks === ==== mw.hook ==== * <code>ext.pageTriage.toolbar.ready</code> ==== mw.pageTriage.actionQueue ==== PageTriage provides a specialised action queue system to allow other scripts and gadgets to integrate with it. This is similar to <code>mw.hook</code> except that it uses promises. This is done using the <code>mw.pageTriage.actionQueue</code> module. See the comments in the {{tmpl|0={{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=$1}}|source code}} for documentation on how the system works. {{tmpl|0=It is [$1 not currently used by any scripts or gadgets on enwiki], but it is used internally by PageTriage. |1=https://en.wikipedia.org/w/index.php?search=%22actionQueue%22&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1&ns2300=1&ns2301=1&ns2302=1&ns2303=1 }} The actionQueue module is available after the mw.hook <code>ext.pageTriage.toolbar.ready</code> fires. PageTriage will give the action queue handler an Object with the following data, in addition to other data as noted below: * <code>pageid</code> — ID of the page being reviewed. * <code>title</code> — Title of the page, including namespace. * <code>reviewer</code> — Username of who is using PageTriage. * <code>creator</code> — Username of the creator of the page. * <code>reviewed</code> — Whether or not the page is currently or will be marked as reviewed. ===== Available actions ===== * <code>delete</code> — Fired when the reviewer tags a page for deletion. The data given to the handler also includes: ** <code>tags</code> — An object of all the templates added to the page. The keys are the template title, and the values are an object of metadata, including things like the speedy deletion code. * <code>mark</code> — Fired when the review status of a page is changed. Also includes: ** <code>note</code> — The personal message the reviewer added for the creator of the page. This may be blank. * <code>tags</code> — Fired when maintenance tags are added to the page. Also includes: ** <code>tags</code> — An array of the titles of all templates that were added to the page. ** <code>note</code> — The personal message the reviewer added for the creator of the page. This may be blank. ===== Example ===== To use the action queue, register a function to be ran when an aforementioned action is fired. PageTriage will wait for any asynchronous code to complete before doing anything else, such as refreshing the page. For example, to edit [[Sandbox]] after a page has been marked as reviewed, you could use: <syntaxhighlight lang="javascript"> $( function () { // You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time. mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) { // Listen for the 'mark' action. queue.add( 'mark', function ( data ) { return new mw.Api().edit( 'Sandbox', function ( revision ) { // Replace 'foo' with the note the reviewer left. return revision.content.replace( 'foo', data.note ); } ); } ); } ); } ); </syntaxhighlight> === Where are preferences stored? === Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is <code>userjs-NewPagesFeedFilterOptions</code>. It is set using <code>mw.Api().saveOption()</code> and read using <code>mw.user.options.get()</code>. This data ends up in the SQL <code>user_properties</code> table. Temporary accounts (IP masking) will not be able to store their preferences. == Installation on WMF wikis == This extension was designed for English Wikipedia. There is interest in changing its code and making it more useful to other wikis ([[phab:T50552]]), however this is challenging from a technical perspective and progress is slow. For now, the following are true: * PageTriage is allowed to be installed on other wikis<ref>https://meta.wikimedia.org/w/index.php?title=Limits_to_configuration_changes&diff=prev&oldid=26121135</ref> (although as of 2024 this hasn't happened yet). * The setting <code>$wgPageTriageEnableExtendedFeatures</code> can be set to <code>false</code> to turn off English Wikipedia-specific features such as maintenance tags and deletion tags in the Page Curation toolbar. * There are concerns that the noindex features (controlled by <code>$wgPageTriageNoIndexUnreviewedNewArticles</code> and <code>$wgPageTriageMaxNoIndexAge</code>) create search engine optimization problems, and these noindex features should not be enabled on new wikis without first discussing it with product manager [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]. * Like most other WMF-deployed extensions, PageTriage supports internationalization, and has its interface [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/i18n/|translated into many other languages]]. == See also == * [[commons:Category:PageTriage extension]] * [[Help:New pages feed]] * [[w:Wikipedia:Page Curation/Help]] == Notes == <references /> {{OnWikimedia}} {{Used by}} [[Category:API extensions{{#translation:}}]] pothdmghuc93tnpjcs5e01ao446gaar Extension:PageTriage/ja 102 240082 8365071 8157891 2026-05-04T07:51:35Z FuzzyBot 451990 Updating to match new version of source page 8365071 wikitext text/x-wiki <languages /> {{Extension |templatemode = |status = stable |type1 = special |type2 = interface |newhook1 = |newhook2 = |username = |author = [[User:Kaldari|Ryan Kaldari]], [[User:Bsitu|Benny Situ]] |description = 新規ページのレビューと承認を容易にする |image = Extension-PageTriage Special-NewPagesFeed Screenshot.png |imagesize = 300 |version = |update = |version preview = |update preview = |compatibility policy = rel |mediawiki = |php = |composer = |table1 = pagetriage_page |table2 = pagetriage_page_tags |table3 = pagetriage_tags |download = {{WikimediaDownload|phab=EPTR}} |readme = |changelog = |example = [[wikipedia:Special:NewPagesFeed | Special:NewPagesFeed on the English Wikipedia]] |namespace = |tags = |compatibility = |bugzilla = |phabricator = PageTriage |vagrant-role = }} '''PageTriage'''(ページトリアージ)拡張機能は、新しく作成された記事の予備的な評価(トリアージ)に使えるよう、機能豊富なインターフェイスを提供します。 その目的は既存のコア機能「新しいページの巡回」を置き換え、新規の記事にタグ付けし評価や改善の機能を追加することです。 新規立項のページに適用すると「巡回者」権限のある人向けに、「Special:NewPagesFeed」とページ査読ツールバーを追加します。 開発担当は、ウィキメディア財団の[[Wikimedia_Features_engineering|Features 拡張機能技術チーム]]です。 もっと詳しい情報は''[[Page Curation|Page Curation]]''(ページの査読)をご参照ください。 ここで要点として特筆しておくと、設定とコードの一部はウィキペディア英語版のワークフローに固有であり、現在の構成では拡張機能の国際化はほぼ不可能です。 ([[Phabricator:T50552]] を参照してください。) [[File:Page-Curation-Video.ogv|thumb|An overview of the page curation feature. The interface in the video is outdated but the content remains useful.]] <span id="Installation"></span> == インストール == [[File:PageTriage-ListView-Whole.png|thumb|Screenshot of Special:NewPagesFeed as it appeared in 2012]] {{ExtensionInstall |db-update=yes |registration=required |localsettings= }} == Checking for successful install == この拡張機能の働きを実際に見るには: * ログインしていない利用者として新しいページを作成し、内容は適当に文を2、3書き込み保存。 * Special:NewPagesFeedを開く すると新規ページが一覧になるので、フラグの「{{int|pagetriage-no-categories}}」「{{int|pagetriage-orphan}}」などを確認。 ページキュレーションツールバーを表示するには : * 「システム管理者」権限のあるアカウントでログイン、もしくは「[[Special:MyLanguage/Help:Patrolled_edits|巡回]]」権限のあるグループを追加してそのグループにあらかじめ特定の利用者名を加えておき、その利用者としてログイン。 * Special:NewPagesFeed を開く * ここで新規ページの隣に「{{int|pagetriage-triage}}」ボタンが表示されたはずです。 * これをクリックすると新規のページに査読ツールバーが表示されます。 <span id="Advanced_installation"></span> == 高度なインストール == <span id="Additional_extensions"></span> === 追加の拡張機能 === PageTriage は拡張機能がなくても動作し、機能を全て利用するには追加の拡張機能も必要でインストールします。 * {{ll|Extension:Echo|Echo}} - Allows users to receive notifications for things like when an article they created has been marked as reviewed. * {{ll|Extension:ORES|ORES}} - In Special:NewPagesFeed, allows filtering by "predicted class" (<code>articlequality</code>: stub, start, c-class, b-class, good, featured) and "potential issues" (<code>draftquality</code>: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because <code>draftquality</code> needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's [[git:mediawiki/extensions/ORES/+/8bd39f26548d58fa8bf6765e1c23f5e3086f1cd4/extension.json#225|extension.json file]]. * {{ll|Extension:WikiLove|WikiLove}} - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily. === Enabling draft namespace === By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php <syntaxhighlight lang="php" copy> // These three settings are optional, and will enable the Articles-for-Creation mode. $wgPageTriageDraftNamespaceId = 118; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft'; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk'; </syntaxhighlight> When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed. By default pages edited in the draft namespace will be "unsubmitted". Articles in the draft namespace can be submitted for review by adding <nowiki>[[Category:Pending_AfC_submissions]]</nowiki> to the draft page. At which point they will show up under "awaiting review". Note the toolbar controlled by the configuration variable '''$wgPageTriageEnableCurationToolbar''' does not show up in the draft namespace. === Cron jobs === To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: <code>cron/updatePageTriageQueue.php</code> == Manual testing == === Special:NewPagesFeed -> Articles for Creation === * Enable draftspace by following the directions above in the section [[#Enabling draft namespace]]. * In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories: ** Unsubmitted: (no category) ** Awaiting review: Category:Pending AfC submissions ** Under review: Category:Pending AfC submissions being reviewed now ** Declined: Category:Declined AfC submissions Note: The Page Curation toolbar does not display for drafts. === ORES === Enwiki has the [[Extension:ORES|ORES extension]] installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure: * Clone Extension:ORES and add <code>wfLoadExtension( 'ORES' );</code> in <code>LocalSettings.php</code> * Add this to <code>LocalSettings.php</code> <syntaxhighlight lang="php" copy> $wgPageTriageEnableOresFilters = true; $wgOresWikiId = 'enwiki'; $wgOresModels = [ 'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ], 'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'sources' => [ 1 ] ] ]; </syntaxhighlight> * Run <code>php maintenance/run.php ./extensions/ORES/maintenance/BackfillPageTriageQueue.php</code> == Determining if a page is reviewed == === Status codes === There are status codes used to track whether a page is reviewed or not. These are the values given when you query <code>patrol_status</code>, <code>ptrp_reviewed</code>, and <code>ptrl_reviewed</code>: * Unreviewed ** 0 - unreviewed * Reviewed ** 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar) ** 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page) ** 3 - autopatrolled (someone with the <code>autopatrol</code> user right created the page, or moved the page from a non-tracked namespace to a tracked namespace) ** no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job) === Via the API === To check the review status of pages using an API query, you can use <code>api.php?action=query&prop=isreviewed</code>. Sample JavaScript code:<syntaxhighlight lang="js" copy> /** * @param {number} pageID The page ID number. A positive number with no commas. */ async isReviewed(pageID) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', pageids: pageID, } ); return response.query.pages[0].isreviewed; } /** * @param {string} title One title. Can include namespace. Example: User:Test */ async function isReviewed(title) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', titles: title, } ); return response.query.pages[0].isreviewed; } </syntaxhighlight> === Via SQL === To check the review status of pages using an SQL query, you need to query the <code>{{ll|Extension:PageTriage/pagetriage page table|pagetriage_page}}</code> table and the <code>ptrp_reviewed</code> field. Follow the directions in [[#Status codes]] to interpret the values of this field. <syntaxhighlight lang="sql" copy> /* By page_id */ SELECT ptrp_reviewed FROM pagetriage_page WHERE ptrp_page_id = 71318376 /* By page_title and page_namespace */ SELECT ptrp_reviewed FROM pagetriage_page JOIN page ON page_id = ptrp_page_id WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces AND page_namespace = 0 </syntaxhighlight> == SQL == === SQL tables === {| class="wikitable" |+ !Name !Prefix !Description !Old entry deletion strategy !Service classes (when refactoring, SQL queries should be moved to here) !Data classes |- |[[Extension:PageTriage/pagetriage page table|pagetriage_page]] |ptrp_ |The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query <code>ptrp_reviewed > 0</code> in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. |All articles deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. |QueueManager, QueueLookup |QueueRecord |- |[[Extension:PageTriage/pagetriage page tags table|pagetriage_page_tags]] |ptrpt_ |Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the <code>pagetriage_tags</code> table. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. |All article metadata deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status. | | |- |[[Extension:PageTriage/pagetriage tags table|pagetriage_tags]] |ptrt_ |A dictionary of page_tags, and their corresponding ID number. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. | | | |} === pagetriage_page_tags === <code>pagetriage_page_tags</code> data is updated by calling <code>ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata()</code>. This is called in the following hooks: * <code>onPageMoveComplete()</code> - runs when moving a page * <code>onLinksUpdateComplete()</code> - runs when saving an edit * <code>onMarkPatrolledComplete()</code> - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user. ==== List of tags ==== The <code>pagetriage_page_tags</code> are as follows: * Author information ** user_id ** user_name - there's a filter where you can type in their username ** user_editcount ** user_creation_date ** user_autoconfirmed ** user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with <code>MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()</code> ** user_bot ** user_block_status * Deletion tags - will display a black trash can icon if marked for deletion ** afd_status ** blp_prod_status ** csd_status ** prod_status * Special:NewPagesFeed red warning text ** category_count - No categories ** linkcount - Orphan ** reference - No citations ** recreated - Previously deleted ** user_block_status - Blocked * Page information ** page_len - size of article, in bytes ** rev_count - number of edits to the article ** snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article * afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined * copyvio - latest revision ID that has been tagged as a likely copyright violation, if any == PHP == <span id="Extension_configuration"></span> === 拡張機能の設定 === 拡張機能は「巡回」権限に基づいています。 巡回の設定については、{{ll|Manual:Patrolling}}を参照してください。 利用者の LocalSettings.php ファイルから以下の設定変数を書き込みます。 {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">Variable</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Default</span> ! 説明 |- | {{phpi|$wgPageTriageEnableCurationToolbar}} | {{phpi|true}} | false を選ぶと[[Special:MyLanguage/Page Curation#User Experience: Curation Toolbar|査読ツールバー]]を無効にする。 |- | {{phpi|$wgPageTriageInfiniteScrolling}} | {{phpi|true}} | 新しいページフィードで無限スクロールを使用するか否か |- | {{phpi|$wgPageTriageMaxAge}} |90 | The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true). |- | {{phpi|$wgPageTriageNamespaces}} |NS_MAIN | The namespaces that PageTriage is active in. |- | {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} | {{phpi|false}} | レビューが未処理の新しい記事を索引対象外の noindex に設定する場合は、true に設定します。 言い換えるなら、査読が終わるまでは、検索エンジンに拾われないようにすることです。 |} 設定変数の総覧は [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/extension.json#698|extension.json]] を参照してください。 === API === PageTriage が追加する以下の API エンドポイントでは次のことができます。 {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">API</span> ! 説明 ! <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Triggering action</span> |- |pagetriageaction | 当該のページに査読の有無をマークし、操作の履歴をSpecial:Logに記録。 |Write | * Using the Page Curation toolbar to mark a page as reviewed * Using the Page Curation toolbar to mark a page as unreviewed |- |pagetriagelist | 検索結果からページの一覧を取得し、査読の状態を含めてそれぞれのメタデータを添えます。 To retrieve one page, you must provide the <code>page_id</code>. To provide multiple pages, you must select one of <code>showreviewed</code>/<code>showunreviewed</code>, and one of <code>showredirs</code>/<code>showdeleted</code>/<code>showothers</code>, or no pages will be returned. |Read | * Loading the Page Curation toolbar (automatically loaded if you have the <code>patrol</code> userright and view a page that is unpatrolled or recently patrolled) * Viewing Special:NewPagesFeed (provides the list of articles) |- |pagetriagestats | Special:NewPagesFeed のヘッダで使うため、クエリで検知したページの一覧を取得 |Read | * Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer) |- |pagetriagetagcopyvio |Mark an article as a potential copyright violation, and logs the action in Special:Log. |Write | * Marking as a copyright violation by a bot with the <code>copyviobot</code> userright |- |pagetriagetagging | 当該のページにクリーンナップ用タグもしくは削除テンプレートを付け、処理のログを Special:Log に書き込むこと。 |Write | * Using the Page Curation toolbar to place a maintenance tag on an article * Using the Page Curation toolbar to place a deletion tag on an article |} === Special:Log === The following logs are created by the extension: {| class="wikitable" |+ !Special:Log !<code>log_type</code> !<code>log_action</code> !Description !Notes |- |Page curation log |pagetriage-curation |delete, enqueue, reviewed, tag, unreviewed |Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed | |- |Potential copyright violation log |pagetriage-copyvio |insert |Allows a bot to log potential copyright violations |Doesn't display unless you set {{phpi|$wgPageTriageEnableCopyvio}} to true |} <span id="Entry_points"></span> === エントリー ポイント === 以下のさまざまな操作から、この拡張機能が起動します。 {| class="wikitable" |+ !Entry point type !File location !Notes |- |5 APIs |includes/Api/* | |- |1 special page |includes/SpecialNewPagesFeed.php | |- |20 hooks | * includes/Hooks.php * includes/HookHandlers/UndeleteHookHandler.php * includes/HookHandlers/Schema.php | |- |1 cron job |cron/updatePageTriageQueue.php |runs every 48 hours |- |7 maintenance scripts |maintenance/* |need to be run manually |} Here is a list of some actions and the corresponding entry points they trigger: {| class="wikitable" |+ !Action !Entry points used |- |View Main page | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() |- |Save an edit to the Main page | * Hooks.php -> onRevisionFromEditComplete() * Hooks.php -> onPageSaveComplete() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onLinksUpdateComplete() |- |Type in search box, triggering search suggestions | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onApiMain__moduleManager() |- |View Special:NewPagesFeed | * Hooks.php -> onBeforeCreateEchoEvent() * SpecialNewPagesFeed * ApiPageTriageStats * ApiPageTriageList |- |View an unreviewed article while logged in and having the <code>patrol</code> permission. | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onResourceLoaderGetConfigVars() * Hooks.php -> onDefinedTags() * Hooks.php -> onApiMain__moduleManager() * ApiPageTriageList (by <code>page_id</code>) |} ==== Hooks ==== {| class="wikitable" |+ !File !Group !Hook !Actions it performs |- | rowspan="18" |Hooks.php |Move page |[[Manual:Hooks/PageMoveComplete|onPageMoveComplete]] |Changes patrolled status, updates cache, updates metadata in <code>pagetriage_page_tags</code> table. |- | rowspan="3" |Edit page |[[Manual:Hooks/RevisionFromEditComplete|onRevisionFromEditComplete]] |Handles marking '''redirects that flip to articles''' as unreviewed. [[Deferred updates|DeferredUpdate]]. |- |[[Manual:Hooks/PageSaveComplete|onPageSaveComplete]] |Add '''new articles''' to the New Pages Feed and <code>pagetriage_page</code> table. |- |[[Manual:Hooks/LinksUpdateComplete|onLinksUpdateComplete]] |[[Deferred updates|DeferredUpdate]] of metadata / <code>pagetriage_page_tags</code> table. |- |Every page load |[[Manual:Hooks/ArticleViewFooter|onArticleViewFooter]] | * Turn on '''noindex''' for new, unreviewed articles. * Determine whether to load a '''link for autopatrolled users to unpatrol''' their article * Displays the '''Page Curation toolbar''' on recently created pages. * Create '''"Add to New Pages Feed" toolbox link''' for old articles. |- |[[Help:Patrolled edits]] |[[Manual:Hooks/MarkPatrolledComplete|onMarkPatrolledComplete]] |Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage. |- | rowspan="2" |Blocking and unblocking |[[Manual:Hooks/BlockIpComplete|onBlockIpComplete]] | rowspan="2" |Update article metadata / <code>pagetriage_page_tags</code> when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users. |- |[[Manual:Hooks/UnblockUserComplete|onUnblockUserComplete]] |- | |[[Manual:Hooks/ResourceLoaderGetConfigVars|onResourceLoaderGetConfigVars]] |Adjusts some config vars related to draft namespace ID. |- | rowspan="3" |[[Extension:Echo]] |[[Manual:Hooks/BeforeCreateEchoEvent|onBeforeCreateEchoEvent]] | rowspan="3" |Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed. |- |[[Manual:Hooks/EchoGetDefaultNotifiedUsers|onEchoGetDefaultNotifiedUsers]] |- |[[Manual:Hooks/LocalUserCreated|onLocalUserCreated]] |- |[[Extension:ORES]] |[[Manual:Hooks/ORESCheckModels|onORESCheckModels]] |Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio. |- | rowspan="3" |[[Help:Tags]] |[[Manual:Hooks/ListDefinedTags|onListDefinedTags]] | rowspan="3" |Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage". |- |[[Manual:Hooks/ChangeTagsAllowedAdd|onChangeTagsAllowedAdd]] |- |[[Manual:Hooks/ChangeTagsListActive|onChangeTagsListActive]] |- |API |[[Manual:Hooks/ApiMain::moduleManager|onApiMain__moduleManager]] |Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings. |- | rowspan="2" |Delete or undelete page |[[Manual:Hooks/PageDeleteComplete|onPageDeleteComplete]] |If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache. |- |HookHandlers/ UndeleteHookHandler.php |[[Manual:Hooks/ArticleUndelete|onArticleUndelete]] |If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed. |- |HookHandlers/ Schema.php |SQL |[[Manual:Hooks/LoadExtensionSchemaUpdates|onLoadExtensionSchemaUpdates]] | * The code that installs PageTriage's 4 SQL tables when you run <code>php maintenance/run.php update</code>. * Will also alter schemas from previous versions to match the latest schema. * This is also where all the '''pagetriage_tags''' are hard-coded. |} ==== Cron jobs and maintenance scripts ==== {| class="wikitable" |+ !File !What it does !Why run it? When is it useful? ![[phab:T341431|Safe to delete maintenance script?]] |- |cron/updatePageTriageQueue.php |Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". |Keeps the SQL tables from getting too big. | |- |maintenance/cleanupPageTriage.php |Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. |Fix a bug? [[phab:T321982|T321982]] | |- |maintenance/cleanupPageTriageLog.php |Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log |One time conversion of old log entries to modern format? Logs are now always written in the new format. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/6d9105c020c62d648a4ef6be957297bbc8a6d7d2]. |Probably |- |maintenance/cleanupPageTriagePageTags.php |Remove page from <code>pagetriage_page_tags</code> if they are not in <code>pagetriage_page</code> |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/00a752368e00e0d8b29a4908bfc3bab3096268dd]. |Probably |- |maintenance/DeleteAfcStates.php |Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ab2d8d4a2f9d0f4ff981afaee35a85f33edb5e99]. [[phab:T203184#4592953|T203184#4592953]]. |Probably |- |maintenance/FixNominatedForDeletion.php |Set <code>pagetriage_page.ptrp_deleted</code> if the page is has any <code>pagetriage_page_tags</code> related to deletion (e.g. prod_status, blp_prod_status, etc.) |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ff0c433226300aeba692089b5389435d47feef1e]. [[phab:T202582|T202582]]. |Probably |- |maintenance/populateDraftQueue.php |Add missing Draft namespace pages to the AfC triage queue. |Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/59e1fedffcdafc46722d7231011aee194db9ee08]. | |- |maintenance/updateUserMetadata.php |Former cron job. Update expired user metadata in the <code>pagetriage_page_tags</code> table |[https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/92a675a5f1f2e07cee532ec90fc57eee7f2cd49b]. [[phab:T341432|T341432]]. | |} === NOINDEX === NOINDEX refers to the HTML code <code>&lt;meta name="robots" content="noindex"></code>, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode <code><nowiki>__NOINDEX__</nowiki></code>. When {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in <code>includes/Hooks.php</code>, in the <code>onArticleViewFooter()</code> method. ==== First check ==== * First check: Noindex the page if ALL of the following are true: ** {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is turned on ** Page age is less than {{phpi|$wgPageTriageMaxAge}} (set to 90 days on enwiki) ** Page is in <code>pagetriage_page</code> table<ref>Checked by <code>isPageUnreviewed()</code></ref> ** Page is marked as unpatrolled (ptrp_status = 0) ==== Second check ==== * Second check: If the wikitext has the <code><nowiki>__NOINDEX__</nowiki></code> magic word, noindex the page if ALL of the following are true: ** Page age is less than {{phpi|$wgPageTriageMaxNoIndexAge}} (set to 90 days on enwiki) ** If {{phpi|$wgPageTriageMaxNoIndexAge}} is not null, page is in <code>pagetriage_page</code> table<ref>Checked by <code>isNewEnoughToNoIndex()</code>, if it doesn't exit early due to <code>$wgPageTriageMaxNoIndexAge</code> being <code>null</code>.</ref> The main use case for the <nowiki>__NOINDEX__</nowiki> magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See [https://en.wikipedia.org/w/index.php?search=NOINDEX&title=Special:Search&profile=advanced&fulltext=1&ns10=1 this search]. ==== Is the page in the <code>pagetriage_page</code> table? ==== In regards to the requirement "Page is in <code>pagetriage_page</code> table", there are several ways a for a page to get into this table: * Not been deleted by a PageTriage cron job ** One cron job deletes redirects older than {{phpi|$wgPageTriageRedirectAutoreviewAge}} days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them. ** Another cron job deletes reviewed pages after 30 days of being reviewed * In a namespace that PageTriage is configured to patrol * Isn't an article that is so old it predates the installation of PageTriage == JavaScript == === Directory structure === * /modules/ ** ext.pageTriage.article - related to marking an article as reviewed ** ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar ** ext.pageTriage.init - creates a mw.pageTriage object ** ext.pageTriage.newPagesFeed - Special:NewPagesFeed ** ext.pageTriage.sidebarLink - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates ** ext.pageTriage.toolbar - Page Curation toolbar <!--** ext.pageTriage.toolbar - Page Curation toolbar (Vue version)--> ** ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code ** ext.pageTriage.util - Backbone.js models (article, revision, stats) ** external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore <span id="Toolbar"></span> === ツールバー === The toolbar has three states: <code>maximized</code>, <code>minimized</code>, and <code>hidden</code>. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu. === External libraries === * front end ** old (moving away from) *** [[w:Backbone.js|Backbone.js]] *** [[w:jQuery|jQuery]] *** jQuery Badge *** jQuery Waypoints *** [[w:jQuery UI|jQuery UI]] *** [[w:Mustache (template system)|Mustache (template system)]] *** [[OOUI]] - used in modules/ext.PageTriage.enqueue ([https://codesearch.wmcloud.org/deployed/?q=oojs&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FPageTriage codesearch]) *** [[w:Underscore.js|Underscore.js]] ** new (moving towards) *** Codex *** [[w:Moment.js|Moment.js]] *** Vue Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, [[phab:T208256|we are interested in replacing these front end libraries]], to make the extension easier to maintain. <span id="Client-side_hooks"></span> === クライアント側のフック === ==== mw.hook ==== * <code>ext.pageTriage.toolbar.ready</code> ==== mw.pageTriage.actionQueue ==== PageTriage が提供する専門的な操作キュー・システムでは、他のスクリプトやガジェットを統合できるようにします。 <span lang="en" dir="ltr" class="mw-content-ltr">This is similar to <code>mw.hook</code> except that it uses promises.</span> これには <code>mw.pageTriage.actionQueue</code> モジュールを使って実行。 システムの作動に関する解説文書は、{{tmpl|0={{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=$1}}|ソースコード}}のコメントを参照。 {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">It is [$1 not currently used by any scripts or gadgets on enwiki], but it is used internally by PageTriage.</span> |1=https://en.wikipedia.org/w/index.php?search=%22actionQueue%22&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1&ns2300=1&ns2301=1&ns2302=1&ns2303=1 }} モジュールのactionQueue は、mw.hook <code>ext.pageTriage.toolbar.ready</code> が発動すると利用可能になります。 後述のその他のデータに加えて、操作キュー処理者にわたす固有のオブジェクトに含まれるデータは以下のとおり: * <code>pageid</code> — レビューするページのID。 * <code>title</code> — 名前空間を含むページ名。 * <code>reviewer</code> — PageTriageを使用している利用者の利用者名。 * <code>creator</code> — ページ作成者の利用者名。 * <code>reviewed</code> — 当該のページは査読が必要だと現在、印が付けてあるか、もしくは今後、付く可能性があるかどうか。 <span id="Available_actions"></span> ===== 利用できる操作 ===== * <code>delete</code> — 査読者が当該のページに削除タグを付けると発動。処理者にわたされるデータに含まれるものは以下のとおり: ** <code>tags</code> — 当該のページに追加されたすべてのテンプレートの特定の対象。検索キーはテンプレートの題名、検索値は即時削除コードなどメタデータの対象です。 * <code>mark</code> — 当該のページの査読状態が変化すると発動。他に含まれるものは以下のとおり: ** <code>note</code> — 査読者が記事の初稿投稿者にあてたメッセージ文。白紙の場合もあります。 * <code>tags</code> — 当該のページにメンテナンス・タグがつくと発動。他に含まれるものは以下のとおり: ** <code>tags</code> — 当該のページに追加した一連のテンプレートの題名一覧。 ** <code>note</code> — 査読者が記事の初稿投稿者にあてたメッセージ文。白紙の場合もあります。 <span id="Example"></span> ===== 例 ===== 操作のクエリを使うには、上記の操作により発動する関数を登録します。PageTriage は非同期のコードの入力を待って操作を終わらせてから、その他の操作すなわちページの再読み込みなどを実行します。たとえば査読済みとマークされた[[Sandbox/ja|サンドボックス]]を編集する場合は次の構文を使います。 <syntaxhighlight lang="javascript"> $( function () { // You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time. mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) { // Listen for the 'mark' action. queue.add( 'mark', function ( data ) { return new mw.Api().edit( 'Sandbox', function ( revision ) { // Replace 'foo' with the note the reviewer left. return revision.content.replace( 'foo', data.note ); } ); } ); } ); } ); </syntaxhighlight> === Where are preferences stored? === Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is <code>userjs-NewPagesFeedFilterOptions</code>. It is set using <code>mw.Api().saveOption()</code> and read using <code>mw.user.options.get()</code>. This data ends up in the SQL <code>user_properties</code> table. Temporary accounts (IP masking) will not be able to store their preferences. == Installation on WMF wikis == This extension was designed for English Wikipedia. There is interest in changing its code and making it more useful to other wikis ([[phab:T50552]]), however this is challenging from a technical perspective and progress is slow. For now, the following are true: * PageTriage is allowed to be installed on other wikis<ref>https://meta.wikimedia.org/w/index.php?title=Limits_to_configuration_changes&diff=prev&oldid=26121135</ref> (although as of 2024 this hasn't happened yet). * The setting <code>$wgPageTriageEnableExtendedFeatures</code> can be set to <code>false</code> to turn off English Wikipedia-specific features such as maintenance tags and deletion tags in the Page Curation toolbar. * There are concerns that the noindex features (controlled by <code>$wgPageTriageNoIndexUnreviewedNewArticles</code> and <code>$wgPageTriageMaxNoIndexAge</code>) create search engine optimization problems, and these noindex features should not be enabled on new wikis without first discussing it with product manager [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]. * Like most other WMF-deployed extensions, PageTriage supports internationalization, and has its interface [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/i18n/|translated into many other languages]]. <span id="See_also"></span> == 関連項目 == * [[commons:Category:PageTriage extension]] * [[Help:New pages feed]] * [[w:Wikipedia:Page Curation/Help]] == Notes == <references /> {{OnWikimedia}} {{Used by}} [[Category:API extensions{{#translation:}}]] tfsanc03jmvz0i8df1r6lq81slfdyfn Extension:PageTriage/es 102 240368 8365067 8157889 2026-05-04T07:51:33Z FuzzyBot 451990 Updating to match new version of source page 8365067 wikitext text/x-wiki <languages /> {{Extension |templatemode = |status = stable |type1 = special |type2 = interface |newhook1 = |newhook2 = |username = |author = [[User:Kaldari|Ryan Kaldari]], [[User:Bsitu|Benny Situ]] |description = Facilita la revisión y aprobación de nuevas páginas |image = Extension-PageTriage Special-NewPagesFeed Screenshot.png |imagesize = 300 |version = |update = |version preview = |update preview = |compatibility policy = rel |mediawiki = |php = |composer = |table1 = pagetriage_page |table2 = pagetriage_page_tags |table3 = pagetriage_tags |download = {{WikimediaDownload|phab=EPTR}} |readme = |changelog = |example = [[wikipedia:Special:NewPagesFeed | Special:NewPagesFeed on the English Wikipedia]] |namespace = |tags = |compatibility = |bugzilla = |phabricator = PageTriage |vagrant-role = }} '''PageTriage''' es una extensión que tiene como objetivo proporcionar una interfaz rica en funciones para clasificar artículos recién creados. Su objetivo es reemplazar la función principal de ''patrullaje de páginas nuevas'' al tiempo que agrega funcionalidad adicional para revisar, etiquetar y mejorar nuevos artículos. <span class="mw-translate-fuzzy">Agrega una nueva página a [[Special:NewPagesFeed]] y una barra de herramientas de revisión de páginas para páginas nuevas para aquellos con el permiso de [[:w:es:Wikipedia:Verificadores|verificador]].</span> Fue desarrollado por el [[Wikimedia_Features_engineering|equipo de desarrolladores de caracteísticas]] de la Fundación Wikimedia. Para detalles adicionales, véase ''[[Page Curation|Revisión de páginas]]''. Una nota importante es que parte de la configuración y el código son específicos de los flujos de trabajo de Wikipedia en inglés y, como está construido ahora, la extensión es prácticamente imposible de internacionalizar. (Véase [[Phabricator:T50552]].) [[File:Page-Curation-Video.ogv|thumb|An overview of the page curation feature. The interface in the video is outdated but the content remains useful.]] <span id="Installation"></span> <div class="mw-translate-fuzzy"> === Instalación === </div> [[File:PageTriage-ListView-Whole.png|thumb|Screenshot of Special:NewPagesFeed as it appeared in 2012]] {{ExtensionInstall |db-update=yes |registration=required |localsettings= }} == Checking for successful install == Para ver la extensión en funcionamiento: <div class="mw-translate-fuzzy"> * Agregue una nueva página de código auxiliar como usuario anónimo. </div> <div class="mw-translate-fuzzy"> * Visita [[Special:NewPagesFeed]] </div> La nueva página debería aparecer{{int|pagetriage-no-categories}} marcada como "{{int|pagetriage-no-categories}}", "{{int|pagetriage-orphan}}", etc. Para ver la barra de herramientas de revisión de páginas: * Inicie sesión como usuario con el permiso 'sysop', o agregue un grupo con el permiso "[[Special:MyLanguage/Help:Patrolled_edits|patrol]]", y agregue algún usuario a ese grupo, e inicie sesión como ese usuario. <div class="mw-translate-fuzzy"> * Visita [[Special:NewPagesFeed]] </div> * Ahora debería ver un botón "{{int|pagetriage-triage}}" al lado de la nueva página. * Haga clic en esto y debería ver la barra de herramientas de revisión de página en la nueva página. <div lang="en" dir="ltr" class="mw-content-ltr"> == Advanced installation == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Additional extensions === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For full functionality, you'll also need to install some additional extensions, although PageTriage works without them. </div> * {{ll|Extension:Echo|Echo}} - Allows users to receive notifications for things like when an article they created has been marked as reviewed. * {{ll|Extension:ORES|ORES}} - In Special:NewPagesFeed, allows filtering by "predicted class" (<code>articlequality</code>: stub, start, c-class, b-class, good, featured) and "potential issues" (<code>draftquality</code>: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because <code>draftquality</code> needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's [[git:mediawiki/extensions/ORES/+/8bd39f26548d58fa8bf6765e1c23f5e3086f1cd4/extension.json#225|extension.json file]]. * {{ll|Extension:WikiLove|WikiLove}} - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily. === Enabling draft namespace === By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php <syntaxhighlight lang="php" copy> // These three settings are optional, and will enable the Articles-for-Creation mode. $wgPageTriageDraftNamespaceId = 118; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft'; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk'; </syntaxhighlight> When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed. By default pages edited in the draft namespace will be "unsubmitted". Articles in the draft namespace can be submitted for review by adding <nowiki>[[Category:Pending_AfC_submissions]]</nowiki> to the draft page. At which point they will show up under "awaiting review". Note the toolbar controlled by the configuration variable '''$wgPageTriageEnableCurationToolbar''' does not show up in the draft namespace. === Cron jobs === To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: <code>cron/updatePageTriageQueue.php</code> == Manual testing == === Special:NewPagesFeed -> Articles for Creation === * Enable draftspace by following the directions above in the section [[#Enabling draft namespace]]. * In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories: ** Unsubmitted: (no category) ** Awaiting review: Category:Pending AfC submissions ** Under review: Category:Pending AfC submissions being reviewed now ** Declined: Category:Declined AfC submissions Note: The Page Curation toolbar does not display for drafts. === ORES === Enwiki has the [[Extension:ORES|ORES extension]] installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure: * Clone Extension:ORES and add <code>wfLoadExtension( 'ORES' );</code> in <code>LocalSettings.php</code> * Add this to <code>LocalSettings.php</code> <syntaxhighlight lang="php" copy> $wgPageTriageEnableOresFilters = true; $wgOresWikiId = 'enwiki'; $wgOresModels = [ 'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ], 'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'sources' => [ 1 ] ] ]; </syntaxhighlight> * Run <code>php maintenance/run.php ./extensions/ORES/maintenance/BackfillPageTriageQueue.php</code> == Determining if a page is reviewed == === Status codes === There are status codes used to track whether a page is reviewed or not. These are the values given when you query <code>patrol_status</code>, <code>ptrp_reviewed</code>, and <code>ptrl_reviewed</code>: * Unreviewed ** 0 - unreviewed * Reviewed ** 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar) ** 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page) ** 3 - autopatrolled (someone with the <code>autopatrol</code> user right created the page, or moved the page from a non-tracked namespace to a tracked namespace) ** no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job) === Via the API === To check the review status of pages using an API query, you can use <code>api.php?action=query&prop=isreviewed</code>. Sample JavaScript code:<syntaxhighlight lang="js" copy> /** * @param {number} pageID The page ID number. A positive number with no commas. */ async isReviewed(pageID) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', pageids: pageID, } ); return response.query.pages[0].isreviewed; } /** * @param {string} title One title. Can include namespace. Example: User:Test */ async function isReviewed(title) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', titles: title, } ); return response.query.pages[0].isreviewed; } </syntaxhighlight> === Via SQL === To check the review status of pages using an SQL query, you need to query the <code>{{ll|Extension:PageTriage/pagetriage page table|pagetriage_page}}</code> table and the <code>ptrp_reviewed</code> field. Follow the directions in [[#Status codes]] to interpret the values of this field. <syntaxhighlight lang="sql" copy> /* By page_id */ SELECT ptrp_reviewed FROM pagetriage_page WHERE ptrp_page_id = 71318376 /* By page_title and page_namespace */ SELECT ptrp_reviewed FROM pagetriage_page JOIN page ON page_id = ptrp_page_id WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces AND page_namespace = 0 </syntaxhighlight> == SQL == === SQL tables === {| class="wikitable" |+ !Name !Prefix !Description !Old entry deletion strategy !Service classes (when refactoring, SQL queries should be moved to here) !Data classes |- |[[Extension:PageTriage/pagetriage page table|pagetriage_page]] |ptrp_ |The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query <code>ptrp_reviewed > 0</code> in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. |All articles deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. |QueueManager, QueueLookup |QueueRecord |- |[[Extension:PageTriage/pagetriage page tags table|pagetriage_page_tags]] |ptrpt_ |Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the <code>pagetriage_tags</code> table. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. |All article metadata deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status. | | |- |[[Extension:PageTriage/pagetriage tags table|pagetriage_tags]] |ptrt_ |A dictionary of page_tags, and their corresponding ID number. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. | | | |} === pagetriage_page_tags === <code>pagetriage_page_tags</code> data is updated by calling <code>ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata()</code>. This is called in the following hooks: * <code>onPageMoveComplete()</code> - runs when moving a page * <code>onLinksUpdateComplete()</code> - runs when saving an edit * <code>onMarkPatrolledComplete()</code> - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user. ==== List of tags ==== The <code>pagetriage_page_tags</code> are as follows: * Author information ** user_id ** user_name - there's a filter where you can type in their username ** user_editcount ** user_creation_date ** user_autoconfirmed ** user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with <code>MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()</code> ** user_bot ** user_block_status * Deletion tags - will display a black trash can icon if marked for deletion ** afd_status ** blp_prod_status ** csd_status ** prod_status * Special:NewPagesFeed red warning text ** category_count - No categories ** linkcount - Orphan ** reference - No citations ** recreated - Previously deleted ** user_block_status - Blocked * Page information ** page_len - size of article, in bytes ** rev_count - number of edits to the article ** snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article * afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined * copyvio - latest revision ID that has been tagged as a likely copyright violation, if any == PHP == <span id="Extension_configuration"></span> === Configuración de extensión === La extensión se basa en el permiso de "verificador". Para obtener más información sobre la configuración de patrullaje, véase {{ll|Manual:Patrolling}}. Las siguientes variables de configuración se pueden establecer desde su archivo LocalSettings.php: {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">Variable</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Default</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> |- | {{phpi|$wgPageTriageEnableCurationToolbar}} | {{phpi|true}} | Establecer en falso para deshabilitar la [[Special:MyLanguage/Page Curation#User Experience: Curation Toolbar|barra de herramientas de revisión]] (el valor predeterminado es verdadero) |- | {{phpi|$wgPageTriageInfiniteScrolling}} | {{phpi|true}} | Si se usa o no el desplazamiento infinito en el nuevo feed de páginas (el valor predeterminado es verdadero) |- | {{phpi|$wgPageTriageMaxAge}} |90 | The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true). |- | {{phpi|$wgPageTriageNamespaces}} |NS_MAIN | The namespaces that PageTriage is active in. |- | {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} | {{phpi|false}} | Establezca esto en verdadero si los artículos nuevos no revisados deben establecerse en noindex. En otras palabras, si no deben ser indexados por los motores de búsqueda hasta que sean revisados. (el valor predeterminado es falso) |} Véase [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/extension.json#698|extension.json]] para la lista completa de variables de configuración. === API === <div class="mw-translate-fuzzy"> PageTriage agrega 5 ''endpoint'' de API que se pueden usar: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">API</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Triggering action</span> |- |pagetriageaction | <span class="mw-translate-fuzzy">Marca una página como revisada o no revisada</span> |Write | * Using the Page Curation toolbar to mark a page as reviewed * Using the Page Curation toolbar to mark a page as unreviewed |- |pagetriagelist | <span class="mw-translate-fuzzy">Recupera la lista de páginas en la cola y los metadatos asociados</span> To retrieve one page, you must provide the <code>page_id</code>. To provide multiple pages, you must select one of <code>showreviewed</code>/<code>showunreviewed</code>, and one of <code>showredirs</code>/<code>showdeleted</code>/<code>showothers</code>, or no pages will be returned. |Read | * Loading the Page Curation toolbar (automatically loaded if you have the <code>patrol</code> userright and view a page that is unpatrolled or recently patrolled) * Viewing Special:NewPagesFeed (provides the list of articles) |- |pagetriagestats | <span class="mw-translate-fuzzy">Recupera estadísticas sobre el número de páginas en la cola y los revisores principales</span> |Read | * Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer) |- |pagetriagetagcopyvio |Mark an article as a potential copyright violation, and logs the action in Special:Log. |Write | * Marking as a copyright violation by a bot with the <code>copyviobot</code> userright |- |pagetriagetagging | <span class="mw-translate-fuzzy">Agregua etiquetas de limpieza o plantillas de eliminación a una página</span> |Write | * Using the Page Curation toolbar to place a maintenance tag on an article * Using the Page Curation toolbar to place a deletion tag on an article |} === Special:Log === The following logs are created by the extension: {| class="wikitable" |+ !Special:Log !<code>log_type</code> !<code>log_action</code> !Description !Notes |- |Page curation log |pagetriage-curation |delete, enqueue, reviewed, tag, unreviewed |Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed | |- |Potential copyright violation log |pagetriage-copyvio |insert |Allows a bot to log potential copyright violations |Doesn't display unless you set {{phpi|$wgPageTriageEnableCopyvio}} to true |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Entry points === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The extension's features can be triggered by various actions: </div> {| class="wikitable" |+ !Entry point type !File location !Notes |- |5 APIs |includes/Api/* | |- |1 special page |includes/SpecialNewPagesFeed.php | |- |20 hooks | * includes/Hooks.php * includes/HookHandlers/UndeleteHookHandler.php * includes/HookHandlers/Schema.php | |- |1 cron job |cron/updatePageTriageQueue.php |runs every 48 hours |- |7 maintenance scripts |maintenance/* |need to be run manually |} Here is a list of some actions and the corresponding entry points they trigger: {| class="wikitable" |+ !Action !Entry points used |- |View Main page | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() |- |Save an edit to the Main page | * Hooks.php -> onRevisionFromEditComplete() * Hooks.php -> onPageSaveComplete() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onLinksUpdateComplete() |- |Type in search box, triggering search suggestions | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onApiMain__moduleManager() |- |View Special:NewPagesFeed | * Hooks.php -> onBeforeCreateEchoEvent() * SpecialNewPagesFeed * ApiPageTriageStats * ApiPageTriageList |- |View an unreviewed article while logged in and having the <code>patrol</code> permission. | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onResourceLoaderGetConfigVars() * Hooks.php -> onDefinedTags() * Hooks.php -> onApiMain__moduleManager() * ApiPageTriageList (by <code>page_id</code>) |} ==== Hooks ==== {| class="wikitable" |+ !File !Group !Hook !Actions it performs |- | rowspan="18" |Hooks.php |Move page |[[Manual:Hooks/PageMoveComplete|onPageMoveComplete]] |Changes patrolled status, updates cache, updates metadata in <code>pagetriage_page_tags</code> table. |- | rowspan="3" |Edit page |[[Manual:Hooks/RevisionFromEditComplete|onRevisionFromEditComplete]] |Handles marking '''redirects that flip to articles''' as unreviewed. [[Deferred updates|DeferredUpdate]]. |- |[[Manual:Hooks/PageSaveComplete|onPageSaveComplete]] |Add '''new articles''' to the New Pages Feed and <code>pagetriage_page</code> table. |- |[[Manual:Hooks/LinksUpdateComplete|onLinksUpdateComplete]] |[[Deferred updates|DeferredUpdate]] of metadata / <code>pagetriage_page_tags</code> table. |- |Every page load |[[Manual:Hooks/ArticleViewFooter|onArticleViewFooter]] | * Turn on '''noindex''' for new, unreviewed articles. * Determine whether to load a '''link for autopatrolled users to unpatrol''' their article * Displays the '''Page Curation toolbar''' on recently created pages. * Create '''"Add to New Pages Feed" toolbox link''' for old articles. |- |[[Help:Patrolled edits]] |[[Manual:Hooks/MarkPatrolledComplete|onMarkPatrolledComplete]] |Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage. |- | rowspan="2" |Blocking and unblocking |[[Manual:Hooks/BlockIpComplete|onBlockIpComplete]] | rowspan="2" |Update article metadata / <code>pagetriage_page_tags</code> when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users. |- |[[Manual:Hooks/UnblockUserComplete|onUnblockUserComplete]] |- | |[[Manual:Hooks/ResourceLoaderGetConfigVars|onResourceLoaderGetConfigVars]] |Adjusts some config vars related to draft namespace ID. |- | rowspan="3" |[[Extension:Echo]] |[[Manual:Hooks/BeforeCreateEchoEvent|onBeforeCreateEchoEvent]] | rowspan="3" |Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed. |- |[[Manual:Hooks/EchoGetDefaultNotifiedUsers|onEchoGetDefaultNotifiedUsers]] |- |[[Manual:Hooks/LocalUserCreated|onLocalUserCreated]] |- |[[Extension:ORES]] |[[Manual:Hooks/ORESCheckModels|onORESCheckModels]] |Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio. |- | rowspan="3" |[[Help:Tags]] |[[Manual:Hooks/ListDefinedTags|onListDefinedTags]] | rowspan="3" |Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage". |- |[[Manual:Hooks/ChangeTagsAllowedAdd|onChangeTagsAllowedAdd]] |- |[[Manual:Hooks/ChangeTagsListActive|onChangeTagsListActive]] |- |API |[[Manual:Hooks/ApiMain::moduleManager|onApiMain__moduleManager]] |Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings. |- | rowspan="2" |Delete or undelete page |[[Manual:Hooks/PageDeleteComplete|onPageDeleteComplete]] |If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache. |- |HookHandlers/ UndeleteHookHandler.php |[[Manual:Hooks/ArticleUndelete|onArticleUndelete]] |If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed. |- |HookHandlers/ Schema.php |SQL |[[Manual:Hooks/LoadExtensionSchemaUpdates|onLoadExtensionSchemaUpdates]] | * The code that installs PageTriage's 4 SQL tables when you run <code>php maintenance/run.php update</code>. * Will also alter schemas from previous versions to match the latest schema. * This is also where all the '''pagetriage_tags''' are hard-coded. |} ==== Cron jobs and maintenance scripts ==== {| class="wikitable" |+ !File !What it does !Why run it? When is it useful? ![[phab:T341431|Safe to delete maintenance script?]] |- |cron/updatePageTriageQueue.php |Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". |Keeps the SQL tables from getting too big. | |- |maintenance/cleanupPageTriage.php |Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. |Fix a bug? [[phab:T321982|T321982]] | |- |maintenance/cleanupPageTriageLog.php |Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log |One time conversion of old log entries to modern format? Logs are now always written in the new format. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/6d9105c020c62d648a4ef6be957297bbc8a6d7d2]. |Probably |- |maintenance/cleanupPageTriagePageTags.php |Remove page from <code>pagetriage_page_tags</code> if they are not in <code>pagetriage_page</code> |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/00a752368e00e0d8b29a4908bfc3bab3096268dd]. |Probably |- |maintenance/DeleteAfcStates.php |Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ab2d8d4a2f9d0f4ff981afaee35a85f33edb5e99]. [[phab:T203184#4592953|T203184#4592953]]. |Probably |- |maintenance/FixNominatedForDeletion.php |Set <code>pagetriage_page.ptrp_deleted</code> if the page is has any <code>pagetriage_page_tags</code> related to deletion (e.g. prod_status, blp_prod_status, etc.) |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ff0c433226300aeba692089b5389435d47feef1e]. [[phab:T202582|T202582]]. |Probably |- |maintenance/populateDraftQueue.php |Add missing Draft namespace pages to the AfC triage queue. |Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/59e1fedffcdafc46722d7231011aee194db9ee08]. | |- |maintenance/updateUserMetadata.php |Former cron job. Update expired user metadata in the <code>pagetriage_page_tags</code> table |[https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/92a675a5f1f2e07cee532ec90fc57eee7f2cd49b]. [[phab:T341432|T341432]]. | |} === NOINDEX === NOINDEX refers to the HTML code <code>&lt;meta name="robots" content="noindex"></code>, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode <code><nowiki>__NOINDEX__</nowiki></code>. When {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in <code>includes/Hooks.php</code>, in the <code>onArticleViewFooter()</code> method. ==== First check ==== * First check: Noindex the page if ALL of the following are true: ** {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is turned on ** Page age is less than {{phpi|$wgPageTriageMaxAge}} (set to 90 days on enwiki) ** Page is in <code>pagetriage_page</code> table<ref>Checked by <code>isPageUnreviewed()</code></ref> ** Page is marked as unpatrolled (ptrp_status = 0) ==== Second check ==== * Second check: If the wikitext has the <code><nowiki>__NOINDEX__</nowiki></code> magic word, noindex the page if ALL of the following are true: ** Page age is less than {{phpi|$wgPageTriageMaxNoIndexAge}} (set to 90 days on enwiki) ** If {{phpi|$wgPageTriageMaxNoIndexAge}} is not null, page is in <code>pagetriage_page</code> table<ref>Checked by <code>isNewEnoughToNoIndex()</code>, if it doesn't exit early due to <code>$wgPageTriageMaxNoIndexAge</code> being <code>null</code>.</ref> The main use case for the <nowiki>__NOINDEX__</nowiki> magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See [https://en.wikipedia.org/w/index.php?search=NOINDEX&title=Special:Search&profile=advanced&fulltext=1&ns10=1 this search]. ==== Is the page in the <code>pagetriage_page</code> table? ==== In regards to the requirement "Page is in <code>pagetriage_page</code> table", there are several ways a for a page to get into this table: * Not been deleted by a PageTriage cron job ** One cron job deletes redirects older than {{phpi|$wgPageTriageRedirectAutoreviewAge}} days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them. ** Another cron job deletes reviewed pages after 30 days of being reviewed * In a namespace that PageTriage is configured to patrol * Isn't an article that is so old it predates the installation of PageTriage == JavaScript == === Directory structure === * /modules/ ** ext.pageTriage.article - related to marking an article as reviewed ** ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar ** ext.pageTriage.init - creates a mw.pageTriage object ** ext.pageTriage.newPagesFeed - Special:NewPagesFeed ** ext.pageTriage.sidebarLink - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates ** ext.pageTriage.toolbar - Page Curation toolbar <!--** ext.pageTriage.toolbar - Page Curation toolbar (Vue version)--> ** ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code ** ext.pageTriage.util - Backbone.js models (article, revision, stats) ** external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore <div lang="en" dir="ltr" class="mw-content-ltr"> === Toolbar === </div> The toolbar has three states: <code>maximized</code>, <code>minimized</code>, and <code>hidden</code>. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu. === External libraries === * front end ** old (moving away from) *** [[w:Backbone.js|Backbone.js]] *** [[w:jQuery|jQuery]] *** jQuery Badge *** jQuery Waypoints *** [[w:jQuery UI|jQuery UI]] *** [[w:Mustache (template system)|Mustache (template system)]] *** [[OOUI]] - used in modules/ext.PageTriage.enqueue ([https://codesearch.wmcloud.org/deployed/?q=oojs&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FPageTriage codesearch]) *** [[w:Underscore.js|Underscore.js]] ** new (moving towards) *** Codex *** [[w:Moment.js|Moment.js]] *** Vue Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, [[phab:T208256|we are interested in replacing these front end libraries]], to make the extension easier to maintain. <div lang="en" dir="ltr" class="mw-content-ltr"> === Client-side hooks === </div> ==== mw.hook ==== * <code>ext.pageTriage.toolbar.ready</code> ==== mw.pageTriage.actionQueue ==== <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage provides a specialised action queue system to allow other scripts and gadgets to integrate with it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is similar to <code>mw.hook</code> except that it uses promises.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done using the <code>mw.pageTriage.actionQueue</code> module.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the comments in the {{tmpl|0={{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=$1}}|source code}} for documentation on how the system works.</span> {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">It is [$1 not currently used by any scripts or gadgets on enwiki], but it is used internally by PageTriage.</span> |1=https://en.wikipedia.org/w/index.php?search=%22actionQueue%22&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1&ns2300=1&ns2301=1&ns2302=1&ns2303=1 }} <span lang="en" dir="ltr" class="mw-content-ltr">The actionQueue module is available after the mw.hook <code>ext.pageTriage.toolbar.ready</code> fires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage will give the action queue handler an Object with the following data, in addition to other data as noted below:</span> * <code>pageid</code> — <span lang="en" dir="ltr" class="mw-content-ltr">ID of the page being reviewed.</span> * <code>title</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Title of the page, including namespace.</span> * <code>reviewer</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of who is using PageTriage.</span> * <code>creator</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of the creator of the page.</span> * <code>reviewed</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the page is currently or will be marked as reviewed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ===== Available actions ===== </div> * <code>delete</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the reviewer tags a page for deletion. The data given to the handler also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An object of all the templates added to the page. The keys are the template title, and the values are an object of metadata, including things like the speedy deletion code.</span> * <code>mark</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the review status of a page is changed. Also includes:</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> * <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when maintenance tags are added to the page. Also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An array of the titles of all templates that were added to the page.</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ===== Example ===== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To use the action queue, register a function to be ran when an aforementioned action is fired. PageTriage will wait for any asynchronous code to complete before doing anything else, such as refreshing the page. For example, to edit [[Sandbox]] after a page has been marked as reviewed, you could use: </div> <syntaxhighlight lang="javascript"> $( function () { // You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time. mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) { // Listen for the 'mark' action. queue.add( 'mark', function ( data ) { return new mw.Api().edit( 'Sandbox', function ( revision ) { // Replace 'foo' with the note the reviewer left. return revision.content.replace( 'foo', data.note ); } ); } ); } ); } ); </syntaxhighlight> === Where are preferences stored? === Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is <code>userjs-NewPagesFeedFilterOptions</code>. It is set using <code>mw.Api().saveOption()</code> and read using <code>mw.user.options.get()</code>. This data ends up in the SQL <code>user_properties</code> table. Temporary accounts (IP masking) will not be able to store their preferences. == Installation on WMF wikis == This extension was designed for English Wikipedia. There is interest in changing its code and making it more useful to other wikis ([[phab:T50552]]), however this is challenging from a technical perspective and progress is slow. For now, the following are true: * PageTriage is allowed to be installed on other wikis<ref>https://meta.wikimedia.org/w/index.php?title=Limits_to_configuration_changes&diff=prev&oldid=26121135</ref> (although as of 2024 this hasn't happened yet). * The setting <code>$wgPageTriageEnableExtendedFeatures</code> can be set to <code>false</code> to turn off English Wikipedia-specific features such as maintenance tags and deletion tags in the Page Curation toolbar. * There are concerns that the noindex features (controlled by <code>$wgPageTriageNoIndexUnreviewedNewArticles</code> and <code>$wgPageTriageMaxNoIndexAge</code>) create search engine optimization problems, and these noindex features should not be enabled on new wikis without first discussing it with product manager [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]. * Like most other WMF-deployed extensions, PageTriage supports internationalization, and has its interface [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/i18n/|translated into many other languages]]. <span id="See_also"></span> == Véase también == * [[commons:Category:PageTriage extension]] * [[Help:New pages feed]] * [[w:Wikipedia:Page Curation/Help]] == Notes == <references /> {{OnWikimedia}} {{Used by}} [[Category:API extensions{{#translation:}}]] f9vc4wx0jmc4qhleoaa670kaibkgpjl Extension:PageTriage/zh 102 240495 8365076 8353318 2026-05-04T07:51:39Z FuzzyBot 451990 Updating to match new version of source page 8365076 wikitext text/x-wiki <languages /> {{Extension |templatemode = |status = stable |type1 = special |type2 = interface |newhook1 = |newhook2 = |username = |author = [[User:Kaldari|Ryan Kaldari]], [[User:Bsitu|Benny Situ]] |description = 便於審核和批准新頁面 |image = Extension-PageTriage Special-NewPagesFeed Screenshot.png |imagesize = 300 |version = |update = |version preview = |update preview = |compatibility policy = rel |mediawiki = |php = |composer = |table1 = pagetriage_page |table2 = pagetriage_page_tags |table3 = pagetriage_tags |download = {{WikimediaDownload|phab=EPTR}} |readme = |changelog = |example = [[wikipedia:Special:NewPagesFeed | Special:NewPagesFeed on the English Wikipedia]] |namespace = |tags = |compatibility = |bugzilla = |phabricator = PageTriage |vagrant-role = }} {{NoteTA|G1=IT|1=zh-hans:扩展; zh-hant:擴充功能;}} '''PageTriage'''是一個-{zh-hans:扩展; zh-hant:擴充功能;}-,目的是提供功能豐富的介面來分級新建立的文章。 其目的是取代「新頁面巡查」的核心功能,同時增加審閱、標記、和改善新文章的額外功能。 它新增了一個 Special:NewPagesFeed 頁面,並為擁有「巡查」權限的人在新頁面上新增一個頁面精選工具列。 它是由維基媒體基金會的[[Wikimedia_Features_engineering|功能工程團隊]]所開發。 额外的详细信息参见''[[Page Curation|页面的精選]]''。 重要提醒:部份配置和代码是专为英语维基百科的工作流而设计的,且以目前此擴充功能的架構而言,此扩展目前差不多是沒法国际化了。 (請参见[[Phabricator:T50552]]。) [[File:Page-Curation-Video.ogv|thumb|An overview of the page curation feature. The interface in the video is outdated but the content remains useful.]] <span id="Installation"></span> == 安裝 == [[File:PageTriage-ListView-Whole.png|thumb|Screenshot of Special:NewPagesFeed as it appeared in 2012]] {{ExtensionInstall |db-update=yes |registration=required |localsettings= }} == Checking for successful install == 去實際看到扩展在運作: * 以匿名使用者身份建立一個只包含幾句文字的新頁面。 * -{zh:访问;zh-hans:访问;zh-hant:造訪;}-Special:NewPagesFeed 新頁面應該會出現,標記為「{{int|pagetriage-no-categories}}」、「{{int|pagetriage-orphan}} 」等。 去查看頁面的精選工具列: * 以具備「sysop」權限的使用者身分登入、或建立一個具備「[[Special:MyLanguage/Help:Patrolled_edits|patrol]]」權限的群組,並將某些使用者加入該群組,然後以該使用者的身分登入。 * -{zh:访问;zh-hans:访问;zh-hant:造訪;}-Special:NewPagesFeed * 現在您應該會在新頁面的旁邊看到一個「{{int|pagetriage-triage}}」按鈕。 * 點擊這個,您應能在新頁面上看到頁面的精選工具列。 <span id="Advanced_installation"></span> == -{zh-hans:高级;zh-hant:進階;}-安裝 == <span id="Additional_extensions"></span> === 額外的擴充功能 === 若要使用完整功能,您還需要安裝一些額外的擴充功能,不過頁面分級即使不安裝這些擴充功能也能正常運作。 * {{ll|Extension:Echo|Echo}} - Allows users to receive notifications for things like when an article they created has been marked as reviewed. * {{ll|Extension:ORES|ORES}} - In Special:NewPagesFeed, allows filtering by "predicted class" (<code>articlequality</code>: stub, start, c-class, b-class, good, featured) and "potential issues" (<code>draftquality</code>: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because <code>draftquality</code> needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's [[git:mediawiki/extensions/ORES/+/8bd39f26548d58fa8bf6765e1c23f5e3086f1cd4/extension.json#225|extension.json file]]. * {{ll|Extension:WikiLove|WikiLove}} - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily. === Enabling draft namespace === By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php <syntaxhighlight lang="php" copy> // These three settings are optional, and will enable the Articles-for-Creation mode. $wgPageTriageDraftNamespaceId = 118; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft'; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk'; </syntaxhighlight> When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed. By default pages edited in the draft namespace will be "unsubmitted". Articles in the draft namespace can be submitted for review by adding <nowiki>[[Category:Pending_AfC_submissions]]</nowiki> to the draft page. At which point they will show up under "awaiting review". Note the toolbar controlled by the configuration variable '''$wgPageTriageEnableCurationToolbar''' does not show up in the draft namespace. === Cron jobs === To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: <code>cron/updatePageTriageQueue.php</code> == Manual testing == === Special:NewPagesFeed -> Articles for Creation === * Enable draftspace by following the directions above in the section [[#Enabling draft namespace]]. * In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories: ** Unsubmitted: (no category) ** Awaiting review: Category:Pending AfC submissions ** Under review: Category:Pending AfC submissions being reviewed now ** Declined: Category:Declined AfC submissions Note: The Page Curation toolbar does not display for drafts. === ORES === Enwiki has the [[Extension:ORES|ORES extension]] installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure: * Clone Extension:ORES and add <code>wfLoadExtension( 'ORES' );</code> in <code>LocalSettings.php</code> * Add this to <code>LocalSettings.php</code> <syntaxhighlight lang="php" copy> $wgPageTriageEnableOresFilters = true; $wgOresWikiId = 'enwiki'; $wgOresModels = [ 'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ], 'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'sources' => [ 1 ] ] ]; </syntaxhighlight> * Run <code>php maintenance/run.php ./extensions/ORES/maintenance/BackfillPageTriageQueue.php</code> == Determining if a page is reviewed == === Status codes === There are status codes used to track whether a page is reviewed or not. These are the values given when you query <code>patrol_status</code>, <code>ptrp_reviewed</code>, and <code>ptrl_reviewed</code>: * Unreviewed ** 0 - unreviewed * Reviewed ** 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar) ** 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page) ** 3 - autopatrolled (someone with the <code>autopatrol</code> user right created the page, or moved the page from a non-tracked namespace to a tracked namespace) ** no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job) === Via the API === To check the review status of pages using an API query, you can use <code>api.php?action=query&prop=isreviewed</code>. Sample JavaScript code:<syntaxhighlight lang="js" copy> /** * @param {number} pageID The page ID number. A positive number with no commas. */ async isReviewed(pageID) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', pageids: pageID, } ); return response.query.pages[0].isreviewed; } /** * @param {string} title One title. Can include namespace. Example: User:Test */ async function isReviewed(title) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', titles: title, } ); return response.query.pages[0].isreviewed; } </syntaxhighlight> === Via SQL === To check the review status of pages using an SQL query, you need to query the <code>{{ll|Extension:PageTriage/pagetriage page table|pagetriage_page}}</code> table and the <code>ptrp_reviewed</code> field. Follow the directions in [[#Status codes]] to interpret the values of this field. <syntaxhighlight lang="sql" copy> /* By page_id */ SELECT ptrp_reviewed FROM pagetriage_page WHERE ptrp_page_id = 71318376 /* By page_title and page_namespace */ SELECT ptrp_reviewed FROM pagetriage_page JOIN page ON page_id = ptrp_page_id WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces AND page_namespace = 0 </syntaxhighlight> == SQL == === SQL tables === {| class="wikitable" |+ !Name !Prefix !Description !Old entry deletion strategy !Service classes (when refactoring, SQL queries should be moved to here) !Data classes |- |[[Extension:PageTriage/pagetriage page table|pagetriage_page]] |ptrp_ |The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query <code>ptrp_reviewed > 0</code> in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. |All articles deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. |QueueManager, QueueLookup |QueueRecord |- |[[Extension:PageTriage/pagetriage page tags table|pagetriage_page_tags]] |ptrpt_ |Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the <code>pagetriage_tags</code> table. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. |All article metadata deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status. | | |- |[[Extension:PageTriage/pagetriage tags table|pagetriage_tags]] |ptrt_ |A dictionary of page_tags, and their corresponding ID number. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. | | | |} === pagetriage_page_tags === <code>pagetriage_page_tags</code> data is updated by calling <code>ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata()</code>. This is called in the following hooks: * <code>onPageMoveComplete()</code> - runs when moving a page * <code>onLinksUpdateComplete()</code> - runs when saving an edit * <code>onMarkPatrolledComplete()</code> - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user. ==== List of tags ==== The <code>pagetriage_page_tags</code> are as follows: * Author information ** user_id ** user_name - there's a filter where you can type in their username ** user_editcount ** user_creation_date ** user_autoconfirmed ** user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with <code>MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()</code> ** user_bot ** user_block_status * Deletion tags - will display a black trash can icon if marked for deletion ** afd_status ** blp_prod_status ** csd_status ** prod_status * Special:NewPagesFeed red warning text ** category_count - No categories ** linkcount - Orphan ** reference - No citations ** recreated - Previously deleted ** user_block_status - Blocked * Page information ** page_len - size of article, in bytes ** rev_count - number of edits to the article ** snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article * afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined * copyvio - latest revision ID that has been tagged as a likely copyright violation, if any == PHP == <span id="Extension_configuration"></span> === 扩展配置 === 此擴充功能基於「patrol」權限。 如需更多關於設定巡邏功能的資訊,請參閱 {{ll|Manual:Patrolling}}。 可以从你的LocalSettings.php文件中设置以下配置变量。 {| class="wikitable" |+ ! {{LC zh|lang = {{{lang|}}}|type = C|zh-hans = 变量|zh-hant = 變數}} ! -{zh-hans:默认; zh-hant:預設;}- ! 描述 |- | {{phpi|$wgPageTriageEnableCurationToolbar}} | {{phpi|true}} | 設定為false以停用[[Special:MyLanguage/Page Curation#User Experience: Curation Toolbar|精選工具列]] |- | {{phpi|$wgPageTriageInfiniteScrolling}} | {{phpi|true}} | 是否要在新頁面動態消息中使用無限捲動功能 |- | {{phpi|$wgPageTriageMaxAge}} |90 | The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true). |- | {{phpi|$wgPageTriageNamespaces}} |NS_MAIN | The namespaces that PageTriage is active in. |- | {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} | {{phpi|false}} | 若需將新發布且未經審核的文章設為 noindex,請將此選項設為 true。 換句話說,在經過審核之前,這些內容不應被搜尋引擎收錄。 |} 有关配置变量的完整列表,请参阅[[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/extension.json#698|extension.json]]。 === API === 頁面分級功能新增了以下可供使用的API端點: {| class="wikitable" |+ ! API ! 描述 ! 类型 ! 觸發的操作 |- |pagetriageaction | 將頁面標記為已審閱或未審閱,並將此操作記錄在 Special:Log 中。 |Write | * Using the Page Curation toolbar to mark a page as reviewed * Using the Page Curation toolbar to mark a page as unreviewed |- |pagetriagelist | 擷取佇列中的頁面清單、以及各頁面的元資料,其包括其審核的狀態。 To retrieve one page, you must provide the <code>page_id</code>. To provide multiple pages, you must select one of <code>showreviewed</code>/<code>showunreviewed</code>, and one of <code>showredirs</code>/<code>showdeleted</code>/<code>showothers</code>, or no pages will be returned. |Read | * Loading the Page Curation toolbar (automatically loaded if you have the <code>patrol</code> userright and view a page that is unpatrolled or recently patrolled) * Viewing Special:NewPagesFeed (provides the list of articles) |- |pagetriagestats | 擷取在佇列中的頁面數量的統計資料,供Special:NewPagesFeed的頁首使用。 |Read | * Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer) |- |pagetriagetagcopyvio |Mark an article as a potential copyright violation, and logs the action in Special:Log. |Write | * Marking as a copyright violation by a bot with the <code>copyviobot</code> userright |- |pagetriagetagging | 在頁面中加入清理標籤或刪除模板,並將此操作記錄在 Special:Log 中。 |Write | * Using the Page Curation toolbar to place a maintenance tag on an article * Using the Page Curation toolbar to place a deletion tag on an article |} === Special:Log === The following logs are created by the extension: {| class="wikitable" |+ !Special:Log !<code>log_type</code> !<code>log_action</code> !Description !Notes |- |Page curation log |pagetriage-curation |delete, enqueue, reviewed, tag, unreviewed |Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed | |- |Potential copyright violation log |pagetriage-copyvio |insert |Allows a bot to log potential copyright violations |Doesn't display unless you set {{phpi|$wgPageTriageEnableCopyvio}} to true |} <span id="Entry_points"></span> === 切入點 === 此擴充功能的各項功能可透過多種操作觸發: {| class="wikitable" |+ !Entry point type !File location !Notes |- |5 APIs |includes/Api/* | |- |1 special page |includes/SpecialNewPagesFeed.php | |- |20 hooks | * includes/Hooks.php * includes/HookHandlers/UndeleteHookHandler.php * includes/HookHandlers/Schema.php | |- |1 cron job |cron/updatePageTriageQueue.php |runs every 48 hours |- |7 maintenance scripts |maintenance/* |need to be run manually |} Here is a list of some actions and the corresponding entry points they trigger: {| class="wikitable" |+ !Action !Entry points used |- |View Main page | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() |- |Save an edit to the Main page | * Hooks.php -> onRevisionFromEditComplete() * Hooks.php -> onPageSaveComplete() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onLinksUpdateComplete() |- |Type in search box, triggering search suggestions | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onApiMain__moduleManager() |- |View Special:NewPagesFeed | * Hooks.php -> onBeforeCreateEchoEvent() * SpecialNewPagesFeed * ApiPageTriageStats * ApiPageTriageList |- |View an unreviewed article while logged in and having the <code>patrol</code> permission. | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onResourceLoaderGetConfigVars() * Hooks.php -> onDefinedTags() * Hooks.php -> onApiMain__moduleManager() * ApiPageTriageList (by <code>page_id</code>) |} ==== Hooks ==== {| class="wikitable" |+ !File !Group !Hook !Actions it performs |- | rowspan="18" |Hooks.php |Move page |[[Manual:Hooks/PageMoveComplete|onPageMoveComplete]] |Changes patrolled status, updates cache, updates metadata in <code>pagetriage_page_tags</code> table. |- | rowspan="3" |Edit page |[[Manual:Hooks/RevisionFromEditComplete|onRevisionFromEditComplete]] |Handles marking '''redirects that flip to articles''' as unreviewed. [[Deferred updates|DeferredUpdate]]. |- |[[Manual:Hooks/PageSaveComplete|onPageSaveComplete]] |Add '''new articles''' to the New Pages Feed and <code>pagetriage_page</code> table. |- |[[Manual:Hooks/LinksUpdateComplete|onLinksUpdateComplete]] |[[Deferred updates|DeferredUpdate]] of metadata / <code>pagetriage_page_tags</code> table. |- |Every page load |[[Manual:Hooks/ArticleViewFooter|onArticleViewFooter]] | * Turn on '''noindex''' for new, unreviewed articles. * Determine whether to load a '''link for autopatrolled users to unpatrol''' their article * Displays the '''Page Curation toolbar''' on recently created pages. * Create '''"Add to New Pages Feed" toolbox link''' for old articles. |- |[[Help:Patrolled edits]] |[[Manual:Hooks/MarkPatrolledComplete|onMarkPatrolledComplete]] |Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage. |- | rowspan="2" |Blocking and unblocking |[[Manual:Hooks/BlockIpComplete|onBlockIpComplete]] | rowspan="2" |Update article metadata / <code>pagetriage_page_tags</code> when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users. |- |[[Manual:Hooks/UnblockUserComplete|onUnblockUserComplete]] |- | |[[Manual:Hooks/ResourceLoaderGetConfigVars|onResourceLoaderGetConfigVars]] |Adjusts some config vars related to draft namespace ID. |- | rowspan="3" |[[Extension:Echo]] |[[Manual:Hooks/BeforeCreateEchoEvent|onBeforeCreateEchoEvent]] | rowspan="3" |Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed. |- |[[Manual:Hooks/EchoGetDefaultNotifiedUsers|onEchoGetDefaultNotifiedUsers]] |- |[[Manual:Hooks/LocalUserCreated|onLocalUserCreated]] |- |[[Extension:ORES]] |[[Manual:Hooks/ORESCheckModels|onORESCheckModels]] |Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio. |- | rowspan="3" |[[Help:Tags]] |[[Manual:Hooks/ListDefinedTags|onListDefinedTags]] | rowspan="3" |Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage". |- |[[Manual:Hooks/ChangeTagsAllowedAdd|onChangeTagsAllowedAdd]] |- |[[Manual:Hooks/ChangeTagsListActive|onChangeTagsListActive]] |- |API |[[Manual:Hooks/ApiMain::moduleManager|onApiMain__moduleManager]] |Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings. |- | rowspan="2" |Delete or undelete page |[[Manual:Hooks/PageDeleteComplete|onPageDeleteComplete]] |If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache. |- |HookHandlers/ UndeleteHookHandler.php |[[Manual:Hooks/ArticleUndelete|onArticleUndelete]] |If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed. |- |HookHandlers/ Schema.php |SQL |[[Manual:Hooks/LoadExtensionSchemaUpdates|onLoadExtensionSchemaUpdates]] | * The code that installs PageTriage's 4 SQL tables when you run <code>php maintenance/run.php update</code>. * Will also alter schemas from previous versions to match the latest schema. * This is also where all the '''pagetriage_tags''' are hard-coded. |} ==== Cron jobs and maintenance scripts ==== {| class="wikitable" |+ !File !What it does !Why run it? When is it useful? ![[phab:T341431|Safe to delete maintenance script?]] |- |cron/updatePageTriageQueue.php |Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". |Keeps the SQL tables from getting too big. | |- |maintenance/cleanupPageTriage.php |Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. |Fix a bug? [[phab:T321982|T321982]] | |- |maintenance/cleanupPageTriageLog.php |Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log |One time conversion of old log entries to modern format? Logs are now always written in the new format. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/6d9105c020c62d648a4ef6be957297bbc8a6d7d2]. |Probably |- |maintenance/cleanupPageTriagePageTags.php |Remove page from <code>pagetriage_page_tags</code> if they are not in <code>pagetriage_page</code> |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/00a752368e00e0d8b29a4908bfc3bab3096268dd]. |Probably |- |maintenance/DeleteAfcStates.php |Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ab2d8d4a2f9d0f4ff981afaee35a85f33edb5e99]. [[phab:T203184#4592953|T203184#4592953]]. |Probably |- |maintenance/FixNominatedForDeletion.php |Set <code>pagetriage_page.ptrp_deleted</code> if the page is has any <code>pagetriage_page_tags</code> related to deletion (e.g. prod_status, blp_prod_status, etc.) |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ff0c433226300aeba692089b5389435d47feef1e]. [[phab:T202582|T202582]]. |Probably |- |maintenance/populateDraftQueue.php |Add missing Draft namespace pages to the AfC triage queue. |Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/59e1fedffcdafc46722d7231011aee194db9ee08]. | |- |maintenance/updateUserMetadata.php |Former cron job. Update expired user metadata in the <code>pagetriage_page_tags</code> table |[https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/92a675a5f1f2e07cee532ec90fc57eee7f2cd49b]. [[phab:T341432|T341432]]. | |} === NOINDEX === NOINDEX refers to the HTML code <code>&lt;meta name="robots" content="noindex"></code>, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode <code><nowiki>__NOINDEX__</nowiki></code>. When {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in <code>includes/Hooks.php</code>, in the <code>onArticleViewFooter()</code> method. ==== First check ==== * First check: Noindex the page if ALL of the following are true: ** {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is turned on ** Page age is less than {{phpi|$wgPageTriageMaxAge}} (set to 90 days on enwiki) ** Page is in <code>pagetriage_page</code> table<ref>Checked by <code>isPageUnreviewed()</code></ref> ** Page is marked as unpatrolled (ptrp_status = 0) ==== Second check ==== * Second check: If the wikitext has the <code><nowiki>__NOINDEX__</nowiki></code> magic word, noindex the page if ALL of the following are true: ** Page age is less than {{phpi|$wgPageTriageMaxNoIndexAge}} (set to 90 days on enwiki) ** If {{phpi|$wgPageTriageMaxNoIndexAge}} is not null, page is in <code>pagetriage_page</code> table<ref>Checked by <code>isNewEnoughToNoIndex()</code>, if it doesn't exit early due to <code>$wgPageTriageMaxNoIndexAge</code> being <code>null</code>.</ref> The main use case for the <nowiki>__NOINDEX__</nowiki> magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See [https://en.wikipedia.org/w/index.php?search=NOINDEX&title=Special:Search&profile=advanced&fulltext=1&ns10=1 this search]. ==== Is the page in the <code>pagetriage_page</code> table? ==== In regards to the requirement "Page is in <code>pagetriage_page</code> table", there are several ways a for a page to get into this table: * Not been deleted by a PageTriage cron job ** One cron job deletes redirects older than {{phpi|$wgPageTriageRedirectAutoreviewAge}} days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them. ** Another cron job deletes reviewed pages after 30 days of being reviewed * In a namespace that PageTriage is configured to patrol * Isn't an article that is so old it predates the installation of PageTriage == JavaScript == === Directory structure === * /modules/ ** ext.pageTriage.article - related to marking an article as reviewed ** ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar ** ext.pageTriage.init - creates a mw.pageTriage object ** ext.pageTriage.newPagesFeed - Special:NewPagesFeed ** ext.pageTriage.sidebarLink - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates ** ext.pageTriage.toolbar - Page Curation toolbar <!--** ext.pageTriage.toolbar - Page Curation toolbar (Vue version)--> ** ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code ** ext.pageTriage.util - Backbone.js models (article, revision, stats) ** external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore <span id="Toolbar"></span> === 工具列 === The toolbar has three states: <code>maximized</code>, <code>minimized</code>, and <code>hidden</code>. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu. === External libraries === * front end ** old (moving away from) *** [[w:Backbone.js|Backbone.js]] *** [[w:jQuery|jQuery]] *** jQuery Badge *** jQuery Waypoints *** [[w:jQuery UI|jQuery UI]] *** [[w:Mustache (template system)|Mustache (template system)]] *** [[OOUI]] - used in modules/ext.PageTriage.enqueue ([https://codesearch.wmcloud.org/deployed/?q=oojs&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FPageTriage codesearch]) *** [[w:Underscore.js|Underscore.js]] ** new (moving towards) *** Codex *** [[w:Moment.js|Moment.js]] *** Vue Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, [[phab:T208256|we are interested in replacing these front end libraries]], to make the extension easier to maintain. <span id="Client-side_hooks"></span> === 客戶端鉤點 === ==== mw.hook ==== * <code>ext.pageTriage.toolbar.ready</code> ==== mw.pageTriage.actionQueue ==== 頁面分級功能提供了一個專用的操作佇列系統,使其能與其他腳本和小工具整合。 這與 <code>mw.hook</code> 類似,只是它使用了 Promise。 這是使用<code>mw.pageTriage.actionQueue</code>模組來完成的。 有關系統運作方式的文檔,請參閱{{tmpl|0={{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=$1}}|原始碼}}中的註解。 {{tmpl|0=它[$1 目前尚未被英文wiki上的任何腳本或小工具使用],但頁面分級功能會在內部使用它。 |1=https://en.wikipedia.org/w/index.php?search=%22actionQueue%22&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1&ns2300=1&ns2301=1&ns2302=1&ns2303=1 }} 在mw.hook的<code>ext.pageTriage.toolbar.ready</code>觸發後,actionQueue模組即可使用。 頁面分級功能會將一個包含以下資料的Object傳遞給動作佇列處理程序,此外還包含下文所述的其他資料: * <code>pageid</code> — 正在審查的頁面的ID。 * <code>title</code> — 頁面的標題,包含命名空間。 * <code>reviewer</code> — 正在使用頁面分級的使用者名稱。 * <code>creator</code> — 該頁面建立者的使用者名稱。 * <code>reviewed</code> — 該頁面目前是否已被標記為已審核,或將被標記為已審核。 <span id="Available_actions"></span> ===== 可用操作 ===== * <code>delete</code> — 當審核者將頁面標記為待刪除時觸發。傳遞給處理程序的資料還包含: ** <code>tags</code> — 此頁面中所有新增模板的物件。其鍵為模板標題,而值則為一個包含元資料的物件,其中包含快速刪除代碼等資訊。 * <code>mark</code> — 當頁面的審核狀態變更時觸發。此外還包含: ** <code>note</code> — 評論者為該頁面創建者添加的個人訊息。此處可能為空白。 * <code>tags</code> — 當頁面新增維護標籤時觸發。此外還包含: ** <code>tags</code> — 一個包含所有已新增至該頁面的模板的標題的陣列。 ** <code>note</code> — 評論者為該頁面創建者添加的個人訊息。此處可能為空白。 <span id="Example"></span> ===== -{zh-hans:示例; zh-hant:範例;}- ===== 若要使用操作佇列,請註冊一個函式,以便在前述動作觸發時執行。頁面分級會在執行其他操作(例如重新整理頁面)之前,先等待所有非同步程式碼完成。例如,若要在頁面被標記為「已審核」後編輯[[Sandbox]],您可以使用: <syntaxhighlight lang="javascript"> $( function () { // You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time. mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) { // Listen for the 'mark' action. queue.add( 'mark', function ( data ) { return new mw.Api().edit( 'Sandbox', function ( revision ) { // Replace 'foo' with the note the reviewer left. return revision.content.replace( 'foo', data.note ); } ); } ); } ); } ); </syntaxhighlight> === Where are preferences stored? === Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is <code>userjs-NewPagesFeedFilterOptions</code>. It is set using <code>mw.Api().saveOption()</code> and read using <code>mw.user.options.get()</code>. This data ends up in the SQL <code>user_properties</code> table. Temporary accounts (IP masking) will not be able to store their preferences. == Installation on WMF wikis == This extension was designed for English Wikipedia. There is interest in changing its code and making it more useful to other wikis ([[phab:T50552]]), however this is challenging from a technical perspective and progress is slow. For now, the following are true: * PageTriage is allowed to be installed on other wikis<ref>https://meta.wikimedia.org/w/index.php?title=Limits_to_configuration_changes&diff=prev&oldid=26121135</ref> (although as of 2024 this hasn't happened yet). * The setting <code>$wgPageTriageEnableExtendedFeatures</code> can be set to <code>false</code> to turn off English Wikipedia-specific features such as maintenance tags and deletion tags in the Page Curation toolbar. * There are concerns that the noindex features (controlled by <code>$wgPageTriageNoIndexUnreviewedNewArticles</code> and <code>$wgPageTriageMaxNoIndexAge</code>) create search engine optimization problems, and these noindex features should not be enabled on new wikis without first discussing it with product manager [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]. * Like most other WMF-deployed extensions, PageTriage supports internationalization, and has its interface [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/i18n/|translated into many other languages]]. <span id="See_also"></span> == 參見 == * [[commons:Category:PageTriage extension]] * [[Help:New pages feed]] * [[w:Wikipedia:Page Curation/Help]] == Notes == <references /> {{OnWikimedia}} {{Used by}} [[Category:API extensions{{#translation:}}]] eueux67hcu887e9duhq8vzeyoisbcwq Category:Time/vi 14 258865 8364448 6880101 2026-05-03T15:43:15Z Hiyuune 17854348 Created page with "$1" 8364448 wikitext text/x-wiki <languages /> [[Category:MediaWiki components{{#translation:}}]] na0nbjk82ivoahnb20sa6kbhyph7ykw Help:Extension:ParserFunctions/it 12 302127 8365020 8353936 2026-05-04T06:20:43Z FuzzyBot 451990 Updating to match new version of source page 8365020 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span class="mw-translate-fuzzy">L'estensione {{ll|Extension:ParserFunctions|nsp=0}} fornisce delle [[Special:MyLanguage/Parser functions|funzioni parser]] aggiuntive per completare le "{{$2|magic words}}", già presenti in MediaWiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> (''Può'' essere configurata per fornire funzioni parser aggiuntive per la gestione di stringhe; queste funzioni per le stringhe sono documentate {{ll|Extension:ParserFunctions/String functions|in un'altra pagina}}.) Tutte le ''funzioni parser'' fornite da questa estensione hanno la forma: :<code><nowiki>{{</nowiki>'''#nome_funzione''': ''argomento 1'' | ''argomento 2'' | ''argomento 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=un manuale più dettagliato sugli aspetti più precisi del funzionamento del valutatore di espressioni, inclusi alcuni operatori aggiuntivi non spiegati in questo manuale|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operatori |- | {{hl2}} | Raggruppamento (parentesi) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Numeri | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operatore binario <code>'''e'''</code> &nbsp; unario <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unari | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binari | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arrotondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Logici | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Questa funzione calcola una espressione matematica e ne restituisce il risultato. Questa funzione è disponibile anche in {{ll|Extension:Scribunto|nsp=0}} tramite la funzione <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''espressione'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Gli operatori disponibili sono elencati a destra, in ordine di precedenza. Vedi {{ll|Manual:Expr parser function syntax}} per maggiori dettagli sulla funzione di ciascun operatore. L'accuratezza e il formato del risultato restituito possono variare in dipendenza del sistema operativo del server che gestisce il wiki e del formato numerico della lingua del sito. Quando usiamo l'[[w:Algebra di Boole|algebra booleana]], lo zero viene valutato come {{phpi|false}}, e qualsiasi valore differente da zero, positivo o negativo, come {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Un'espressione senza un valore d'input non ritorna alcuna stringa. Le espressioni non valide restituiscono uno fra i seguenti messaggi d'errore, che possono essere letti con la funzione <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' L'ordine degli operandi di addizione e di sottrazione prima o dopo un numero è importante e può essere valutato come positivo o negativo invece che come operando con un input errato: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Nota, se usi l'output di parole magiche, che devi formattarle rimuovendo le virgole e traducendo i numerali. Per esempio, la variabile <nowiki>{{NUMBEROFUSERS}}</nowiki> produce come risultato {{NUMBEROFUSERS}}, mentre se lo vogliamo nel formato {{formatnum:{{NUMBEROFUSERS}}|R}}, dobbiamo utilizzare la parola magica <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Questo è particolarmente importante in alcune lingue, dove i numeri sono tradotti. Ad esempio, nella lingua Bengali, la variabile <nowiki>{{NUMBEROFUSERS}}</nowiki> produce il risultato ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=L'operatore <code>mod</code> potrebbe dare risultati errati per certi valori del secondo argomento: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produce una stringa vuota; dovrebbe essere 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Se vuoi fare calcoli sulle date (ad esempio, verificare se la data e l'ora correnti sono successive a un'altra data e ora), prima converti il ​​tempo in numero di secondi dopo il 1 gennaio 1970 (UTC) usando <nowiki>{{#time: xNU }}</nowiki>, quindi puoi semplicemente aggiungere e sottrarre le date come numeri.}} <span id="Rounding"></span> === Arrotondamento === [https://php.net/function.round Arrotonda] per difetto il numero di sinistra ad un multiplo di 1/10 elevato a una potenza, con l'esponente uguale al valore troncato del numero di destra. Per arrotondare per eccesso o per difetto usa rispettivamente gli operatori unari <code>ceil</code> e <code>floor</code>. {| class="wikitable" ! {{hl1}} | Caso di test ! {{hl1}} | Risultato ! {{hl1}} | Metodo di arrotondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || Ci sono meno di 5 cifre decimali, per cui non ci sono arrotondamenti (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || Ci sono più di 5 cifre decimali, per cui è arrotondato (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Di nuovo, il risultato è arrotondato per eccesso sino all'ultima cifra, che causa un'ulteriore arrotondamento (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arrotondato alla centinaia più vicina visto che i valori negativi vengono arrotondati a sinistra del punto decimale |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arrotondato alla centinaia più vicina visto che i valori positivi vengono arrotondati a destra del punto decimale |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || I decimali nell'indice d'arrotondamento non fanno differenza nel risultato arrotondato |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Parte decimale troncata (tagliata) |- ! colspan=3 {{hl2}} | Arrotondamento all'intero più vicino |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Per difetto all'intero più ''vicino'', che è zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Per eccesso all'intero più vicino, che è uno |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Per eccesso all'intero più vicino, che è uno |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Per eccesso all'intero più vicino, che è zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Per difetto all'intero più vicino, che è meno uno |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Per difetto all'intero più vicino, che è meno uno |- ! colspan=3 {{hl2}} | Arrotondamento per eccesso e per difetto con ''ceil'' e ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Arrotondamento per eccesso all'intero più ''grande'', che è uno |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Arrotondamento per difetto all'intero più ''piccolo'', che è zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Arrotondamento per eccesso all'intero più grande, che è zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Arrotondamento per difetto all'intero più piccolo, che è meno uno |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Non arrotondato visto che 1 è già intero<br />{{Warning|1=Interpretato come '''(ceil''' 1''')'''/3 e non '''ceil('''1/3''')''' come ti potresti aspettare}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arrotondare un numero molto grande porta ad infinito. Allora il valore originale senza infinito viene fornito come risposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Come sopra. |} <span id="Strings"></span> === Stringhe === Le espressioni funzionano solo con valori di tipo numerico; non possono confrontate stringhe o caratteri. [[#ifeq]] può essere usata al loro posto. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Questa funzione valuta una stringa di test e determina se è vuota oppure no. Una stringa di test contenente solo spazi è considerata essere vuota. :<syntaxhighlight lang="wikitext" inline>{{#if: stringa di test | valore se la stringa di test non è vuota | valore se la stringa di test è vuota (o è composta solo da spazi)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primo parametro | secondo parametro | terzo parametro }}</syntaxhighlight> Questa funzione prima verifica se il primo parametro non è vuoto. Se il primo parametro non è vuoto, la funzione mostra il secondo argomento. Se il primo parametro è vuoto o contiene solo caratteri di spazio bianco (spazi, newline, ecc.) mostra il terzo argomento. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' La stringa di test è sempre interpretata come testo puro, quindi le espressioni matematiche non vengono valutate (vedere [[##ifexpr|#ifexpr]] per esse): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' L'ultimo parametro (falso) potrebbe essere omesso: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:stringa di test | valore se la stringa di test non è vuota |{{#if:stringa di test |valore se la stringa di test non è vuota |valore se la stringa di test è vuota (o è composta solo da spazi) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> Per aggirare questo problema, applica la parola magica ad entrambi i parametri: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=Vedere [[Manual:Checking for page existence|Manuale:Checking for page existence]] per altri metodi di verificare se una pagina esista con differenti limitazioni}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === Limiti di ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Esempi: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> === Default === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Esempio: {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Per esempio: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> è equivalente a: * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Codice ! {{hl1}} | Descrizione ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Anno |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Anno di 4 cifre | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Anno di 2 cifre | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1 se è un anno bisestile, 0 se non lo è. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|Richiede PHP 5.1.0 o più recente e [[rev:45208]].|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mese |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitivo) |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | Giorno del mese, senza zero. | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | Giorno del mese, con lo zero. | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Ore |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minuti e secondi |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Zona oraria (come su [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | Islamico |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (corretto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (corretto) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <span id="Substitution"></span> === Sostituzione === <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> === Redirects === <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Descrizione ! Digitando ! Ottieni |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Vedi anche == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Note == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] 8l67axxsgofal710iq1w91fyijab3zt Help:Extension:ParserFunctions/fi 12 325711 8365011 8353928 2026-05-04T06:20:18Z FuzzyBot 451990 Updating to match new version of source page 8365011 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span lang="en" dir="ltr" class="mw-content-ltr">The {{ll|Extension:ParserFunctions|nsp=0}} extension provides additional [[Special:MyLanguage/Parser functions|parser functions]] to supplement those already present in MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">(It ''may'' be configured to provide additional parser functions for string handling; these are only available to non-Wikimedia Foundation wikis hence these string functions are documented {{ll|Extension:ParserFunctions/String functions|elsewhere}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">All the parser functions provided by this extension take the form:</span> :<code><nowiki>{{</nowiki>'''#funktionnimi''': ''argumentti 1'' | ''argumentti 2'' | ''argumentti 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tyyppi ! {{hl1}} | Operaattorit |- | {{hl2}} | Ryhmittely (sulkeet) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Numerot | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | <span lang="en" dir="ltr" class="mw-content-ltr">binary operator</span> <code>'''e'''</code> &nbsp; <span lang="en" dir="ltr" class="mw-content-ltr">unary</span> <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Unary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binääri | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Round</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Looginen | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} <span lang="en" dir="ltr" class="mw-content-ltr">This function evaluates a mathematical expression and returns the calculated value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This function is also available in {{ll|Extension:Scribunto|nsp=0}} via the <code>mw.ext.ParserFunctions.expr</code> function.</span> :<code><nowiki>{{#expr:</nowiki> ''<span lang="en" dir="ltr" class="mw-content-ltr">expression</span>'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The available operators are listed to the right, in order of precedence. See {{ll|Manual:Expr parser function syntax}} for more details of the function of each operator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> When evaluating using [[w:boolean algebra|boolean algebra]], zero evaluates to {{phpi|false}}, and any nonzero value, positive or negative, evaluates to {{phpi|true}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code>[[##iferror|#iferror]]</code> function: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <span id="Rounding"></span> === Pyöristys === <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Test case</span> ! {{hl1}} | Tulos ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Method of rounding</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is < 5, so no apparent rounding occurs</span> (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is ≥ 5, so it is rounded up</span> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to the nearest integer</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the ''nearest'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding up or down with ''ceil'' and ''floor''</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next ''larger'' integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next ''smaller'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next larger integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next smaller integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Not rounded, since 1 already is an integer</span><br />{{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect</span>}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <span id="Strings"></span> === Merkkijonot === <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Tämä funktio arvioi kokeiltavaa merkkijonoa ja päättelee, onko se tyhjä. Jos merkkijono sisältää pelkkiä tyhjämerkkejä, se tulkitaan tyhjäksi. :<syntaxhighlight lang="wikitext" inline>{{#if: kokeiltava merkkijono | arvo, jos kokeiltava merkkijono ei ole tyhjä | arvo, jos kokeiltava merkkijono on tyhjä (tai pelkkä tyhjämerkki)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: ensimmäinen parametri | toinen parametri | kolmas parametri }}</syntaxhighlight> Tämä funktio tarkistaa, onko ensimmäinen parametri tyhjä vai ei. Jos ensimmäinen parametri ei ole tyhjä, funktio näyttää toisen parametrin. Jos ensimmäinen parametri on tyhjä tai sisältää pelkkiä tyhjämerkkejä (välilyntejä, rivivaihtoja jne.), se näyttää kolmannen parametrin. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Katso myös: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Esimerkkejä: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Oletus === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Esimerkki: {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Esimerkiksi: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Koodi ! {{hl1}} | Kuvaus ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Vuosi |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | 4-numeroinen vuosiluku. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | 2-numeroinen vuosiluku. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1 jos on karkausvuosi, 0 jos ei. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Kuukausi |- | style="text-align: center;" | <code>n</code> | Kuukauden numero, ilman etunollaa. | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | Kuukauden numero, etunollan kanssa. | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | Kuukauden nimen lyhenne sivuston kielellä. | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | Kuukauden täysi nimi sivuston kielellä. | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominatiivi)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genetiivi) |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | Viikon päivän numero (sunnuntai = 0, lauantai = 6) | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Tunti |- | style="text-align: center;" | <code>a</code> | "am" aamulla (0:00:00 → 11:59:59), muulloin "pm" (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minuutit ja sekunnit |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | Onko päiväys kesäajassa. | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Ero Greenwichin aikaan (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Ero Greenwichin aikaan (GMT), kaksoispisteellä | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Sekalaiset |- | style="text-align: center;" | <code>t</code> | Tämänhetkisen kuukauden päivien määrä. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Kuukauden numero. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Kuukauden numero. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Kuukauden nimen genetiivimuoto. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Kuvaus ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Katso myös == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] 921fk5c0pylg7m3ai5q3inxjsvosh6j Phabricator/Projects 0 340261 8364665 8363293 2026-05-03T18:13:10Z Crystal-bot 5243179 Bot: Updating project taxonomy 8364665 wikitext text/x-wiki {{/Header}} Data as of: 18:11, 03 May 2026 (UTC) === Projects === * [[phab:project/view/1929/|3D]] * [[phab:project/view/3147/|3D2Commons]] * [[phab:project/view/5331/|a Wikimedia CLI]] * [[phab:project/view/6364/|Abstract Wikipedia NLG]] * [[phab:project/view/7654/|Abstract Wikipedia Sandbox]] * Abstract ** [[phab:project/view/6221/|Abstract-Wikipedia-Digital-Garden]] * [[phab:project/view/217/|AbuseFilter]] * Accuracy ** [[phab:project/view/1994/|Accuracy-Review-of-Wikipedias]] * [[phab:project/view/6355/|Ace editor updates]] * Acme ** [[phab:project/view/3694/|Acme-chief]] * [[phab:project/view/8296/|Activity Tab on iOS]] * [[phab:project/view/7277/|Add A Fact]] * Add ** [[phab:project/view/5045/|Add-Link-Structured-Task]] * [[phab:project/view/6328/|AddMe]] * address ** [[phab:project/view/4382/|address-knowledge-gaps]] * [[phab:project/view/6888/|Adiutor]] * Advanced ** [[phab:project/view/2798/|Advanced-Search]] * [[phab:project/view/1295/|AhoCorasick]] * [[phab:project/view/527/|AJAXPoll]] * Analytics ** [[phab:project/view/7008/|Analytics-Canonical-Data]] * [[phab:project/view/2255/|Android Design]] * [[phab:project/view/8300/|Android Donation Reminder]] * [[phab:project/view/8342/|Android Games]] * [[phab:project/view/8550/|Android Reading Challenge]] * [[phab:project/view/3826/|Anisa]] * [[phab:project/view/257/|AntiSpoof]] * [[phab:project/view/8160/|Apertium]] * [[phab:project/view/941/|Apex]] * [[phab:project/view/5376/|API Platform]] * API ** [[phab:project/view/6563/|API-Guidelines]] ** [[phab:project/view/5046/|API-Portal]] * api ** [[phab:project/view/8504/|api-testing-tool]] * [[phab:project/view/842/|ApiFeatureUsage]] * [[phab:project/view/4465/|Application Security Reviews]] * [[phab:project/view/7615/|Applied Science]] * [[phab:project/view/6262/|AQS2.0]] * Arc ** [[phab:project/view/4222/|Arc-Lamp]] * [[phab:project/view/8061/|ArchiveExternalLinks]] * Article ** [[phab:project/view/8435/|Article-Guidance]] ** [[phab:project/view/1351/|Article-Recommendation]] ** [[phab:project/view/2749/|Article-Reminder-Notifications]] * [[phab:project/view/481/|ArticleFeedbackv5]] * [[phab:project/view/1416/|ArticlePlaceholder]] * articlequality ** [[phab:project/view/1675/|articlequality-modeling]] * [[phab:project/view/1948/|ArticleRatings]] * [[phab:project/view/4724/|Articles Needing links]] * AS ** [[phab:project/view/6685/|AS-Report]] * at ** [[phab:project/view/1304/|at-ease]] * [[phab:project/view/5713/|Auto schema]] * [[phab:project/view/2294/|Automated list generation]] * [[phab:project/view/6612/|Automoderator]] * [[phab:project/view/6378/|AutosuggestSitelink]] * [[phab:project/view/1012/|AutoWikiBrowser]] ** [[phab:project/view/7665/|AutoWikiBrowser-Priorities]] * AvoinGLAM ** [[phab:project/view/4190/|AvoinGLAM-Saami]] * [[phab:project/view/5371/|bacula]] * Bad ** [[phab:project/view/1470/|Bad-Words-Detection-System]] * banana ** [[phab:project/view/6558/|banana-checker]] * [[phab:project/view/3372/|base_convert]] * [[phab:project/view/6257/|Bcp47Code]] * Beta ** [[phab:project/view/497/|Beta-Cluster-Infrastructure]] * [[phab:project/view/741/|BetaFeatures]] * [[phab:project/view/1250/|BiblioPlus]] * [[phab:project/view/6542/|Bitu]] * [[phab:project/view/676/|BlogPage]] * [[phab:project/view/1092/|BlueSky]] * Bot ** [[phab:project/view/2746/|Bot-Frameworks]] * bot ** [[phab:project/view/8108/|bot-traffic-requests]] * [[phab:project/view/2258/|Bouquet]] * [[phab:project/view/5662/|CampaignEvents]] * [[phab:project/view/6228/|Capacity Exchange]] * CAS ** [[phab:project/view/4766/|CAS-SSO]] * [[phab:project/view/1976/|Cassandra]] * [[phab:project/view/4922/|Castor]] * [[phab:project/view/6782/|Catalyst]] * [[phab:project/view/7451/|Ceph]] * CFSSL ** [[phab:project/view/5338/|CFSSL-PKI]] * [[phab:project/view/2264/|Challenge]] * [[phab:project/view/2114/|ChangeProp]] * [[phab:project/view/185/|CharInsert]] * [[phab:project/view/7224/|Charts]] * [[phab:project/view/203/|CheckUser]] ** [[phab:project/view/7397/|CheckUser-GlobalContributions]] ** [[phab:project/view/8124/|CheckUser-SuggestedInvestigations]] ** [[phab:project/view/7782/|CheckUser-UserInfoCard]] * [[phab:project/view/4398/|ChessBrowser]] * China ** [[phab:project/view/8576/|China-Judgments-Online-Preservation-Program]] * [[phab:project/view/209/|CirrusSearch]] * Citation ** [[phab:project/view/7126/|Citation-Watchlist]] * [[phab:project/view/172/|Cite]] ** [[phab:project/view/7785/|Cite (Sub-referencing)]] ** [[phab:project/view/4050/|Cite-Unseen]] * [[phab:project/view/980/|CiteThisPage]] * [[phab:project/view/62/|Citoid]] * [[phab:project/view/8401/|CLDRPluralRuleParser]] * [[phab:project/view/5263/|Cloud Services Proposals]] * Cloud ** [[phab:project/view/474/|Cloud-VPS]] * [[phab:project/view/6311/|CloverDiff]] * [[phab:project/view/580/|CodeEditor]] * [[phab:project/view/5587/|Codex]] * [[phab:project/view/2320/|Cognate]] * [[phab:project/view/329/|Collection]] * [[phab:project/view/322/|CologneBlue]] * commit ** [[phab:project/view/2163/|commit-message-validator]] * [[phab:project/view/4829/|CommonPasswords]] * [[phab:project/view/5429/|Commons Deletion Notification bot]] * Commons ** [[phab:project/view/1986/|Commons-Datasets]] ** [[phab:project/view/6855/|Commons-Impact-Metrics]] ** [[phab:project/view/7305/|Commons-Impact-Metrics-Requests]] ** [[phab:project/view/3166/|Commons-Mass-Description]] ** [[phab:project/view/3616/|Commons-Twitter-Bot]] * [[phab:project/view/736/|CommonsMetadata]] * [[phab:project/view/6424/|Community Feedback (Growth)]] * [[phab:project/view/6402/|Community Feedback (Reader)]] * [[phab:project/view/6245/|Community Tech CRS Support]] * Community ** [[phab:project/view/973/|Community-IdeaLab]] ** [[phab:project/view/978/|Community-LearningPatterns]] * [[phab:project/view/225/|ConfirmEdit (CAPTCHA extension)]] * [[phab:project/view/4218/|conftool]] * Connection ** [[phab:project/view/5766/|Connection-Design]] * [[phab:project/view/776/|ContentTranslation]] * Continuous ** [[phab:project/view/401/|Continuous-Integration-Infrastructure]] * [[phab:project/view/388/|ContributionScores]] * Convenient ** [[phab:project/view/3851/|Convenient-Discussions]] * [[phab:project/view/7376/|Cookiecutter]] * [[phab:project/view/1638/|CopyPatrol]] * [[phab:project/view/8635/|corto]] * [[phab:project/view/5017/|Cosmos]] * Countervandalism ** [[phab:project/view/6347/|Countervandalism-Network]] * [[phab:project/view/5841/|CoverMe]] * COVID ** [[phab:project/view/4721/|COVID-19 Global Dashboard]] ** [[phab:project/view/4676/|COVID-19-Graphics]] * [[phab:project/view/5309/|CreateAPage]] * [[phab:project/view/8351/|crm4wb]] * css ** [[phab:project/view/2598/|css-sanitizer]] * [[phab:project/view/6330/|CSSJanus]] * [[phab:project/view/6541/|Cumin]] * [[phab:project/view/6348/|CVNBot]] * [[phab:project/view/7938/|CXServer]] * [[phab:project/view/2669/|Cyberbot]] * [[phab:project/view/5616/|Data Pipelines]] * Data ** [[phab:project/view/5697/|Data-Catalog]] ** [[phab:project/view/817/|Data-Engineering-Dashiki]] ** [[phab:project/view/3711/|Data-Engineering-Jupyter]] ** [[phab:project/view/3153/|Data-Engineering-Legal]] ** [[phab:project/view/5996/|Data-Engineering-Operations]] ** [[phab:project/view/7697/|Data-Engineering-Roadmap]] ** [[phab:project/view/206/|Data-Engineering-Wikistats]] ** [[phab:project/view/4997/|Data-Persistence-Backup]] ** [[phab:project/view/8186/|Data-Persistence-Design-Review]] ** [[phab:project/view/5006/|Data-Persistence-Misc]] ** [[phab:project/view/1393/|Data-release]] ** [[phab:project/view/2874/|Data-Services]] * database ** [[phab:project/view/5372/|database-backups]] * Datasets ** [[phab:project/view/1135/|Datasets-Archiving]] ** [[phab:project/view/189/|Datasets-General-or-Unknown]] * [[phab:project/view/123/|DataTypes]] * [[phab:project/view/122/|DataValues]] ** [[phab:project/view/924/|DataValues-JavaScript]] * dbbackups ** [[phab:project/view/5291/|dbbackups-dashboard]] * decommission ** [[phab:project/view/3364/|decommission-hardware]] * Dependency ** [[phab:project/view/3502/|Dependency-Tracking]] * [[phab:project/view/349/|Deployments]] * [[phab:project/view/2259/|DeskMessMirrored]] * dev ** [[phab:project/view/4032/|dev-images]] * Developer ** [[phab:project/view/6671/|Developer-Outreach]] * [[phab:project/view/5853/|DicoAdo.org]] * Diff ** [[phab:project/view/328/|Diff-blog]] * [[phab:project/view/53/|Diffusion]] * [[phab:project/view/4358/|DiscussionTools]] * [[phab:project/view/266/|DismissableSiteNotice]] * [[phab:project/view/154/|DNS]] * [[phab:project/view/6808/|doc.wikimedia.org]] * Docker ** [[phab:project/view/3094/|Docker-Hub-MediaWiki]] * docker ** [[phab:project/view/3161/|docker-pkg]] * Documentation ** [[phab:project/view/6561/|Documentation-Metrics-Dashboard]] ** [[phab:project/view/5093/|Documentation-Review-Board]] * [[phab:project/view/1040/|Domains]] * [[phab:project/view/3499/|donate.wikimedia.org]] * [[phab:project/view/7472/|DPE Temporary Accounts]] * DPE ** [[phab:project/view/7842/|DPE-Data-Quality]] ** [[phab:project/view/7695/|DPE-Mediawiki-Content]] * draftquality ** [[phab:project/view/2369/|draftquality-modeling]] * drafttopic ** [[phab:project/view/3086/|drafttopic-modeling]] * Dumps ** [[phab:project/view/1519/|Dumps-Generation]] ** [[phab:project/view/1729/|Dumps-Rewrite]] * [[phab:project/view/2260/|Dusk]] * [[phab:project/view/2261/|DuskToDawn]] * [[phab:project/view/201/|DynamicPageList]] * [[phab:project/view/140/|EasyTimeline]] * [[phab:project/view/6653/|Edit Recovery]] * Edit ** [[phab:project/view/2040/|Edit-Review-Improvements]] ** [[phab:project/view/2721/|Edit-Review-Improvements-Integrated-Filters]] ** [[phab:project/view/2201/|Edit-Review-Improvements-RC-Page]] * [[phab:project/view/6334/|EditCheck]] * [[phab:project/view/8062/|EditCheckComponent]] * Editing ** [[phab:project/view/4796/|Editing-Team-Request]] * editquality ** [[phab:project/view/1673/|editquality-modeling]] * edittypes ** [[phab:project/view/1674/|edittypes-modeling]] * Education ** [[phab:project/view/1052/|Education-Program-Dashboard]] * [[phab:project/view/6421/|EImage]] * [[phab:project/view/77/|Elasticsearch]] * Electron ** [[phab:project/view/2162/|Electron-PDFs]] * English ** [[phab:project/view/8426/|English-Wikipedia-RSP-restructuring]] * [[phab:project/view/6922/|EntitySchema service WPP]] * [[phab:project/view/5184/|envoy]] * Equity ** [[phab:project/view/5828/|Equity-Landscape]] * [[phab:project/view/3068/|Equivset]] * Etalemi ** [[phab:project/view/7650/|Etalemi-Mingi]] * [[phab:project/view/3543/|Event Metrics]] * [[phab:project/view/789/|EventStreams]] * [[phab:project/view/2783/|Example (skin)]] * [[phab:project/view/3708/|Excimer]] * [[phab:project/view/7596/|Experimentation Lab Roadmap]] * Expiring ** [[phab:project/view/1995/|Expiring-Watchlist-Items]] * [[phab:project/view/8554/|Explore Feed Redesign on Android App]] * [[phab:project/view/8412/|Explore Feed Refresh iOS]] * [[phab:project/view/336/|ExtensionDistributor]] * [[phab:project/view/2603/|ExternalArticles]] * [[phab:project/view/3780/|ExternalGuidance]] * [[phab:project/view/3673/|FactGrid]] * [[phab:project/view/810/|FanBoxes]] * Feature ** [[phab:project/view/6722/|Feature-Engineering-Hiring]] * [[phab:project/view/6299/|Fediverso WMES]] * Fiwiki ** [[phab:project/view/6360/|Fiwiki-tools]] ** [[phab:project/view/6519/|Fiwiki-Wikidata-Commons]] * Fix ** [[phab:project/view/5519/|Fix-Suggester-Bot]] * [[phab:project/view/296/|FlaggedRevs]] * [[phab:project/view/1496/|FormWizard]] ** [[phab:project/view/3568/|FormWizard-Gadget]] * Foundation ** [[phab:project/view/7583/|Foundation-Office-Wiki]] * [[phab:project/view/3093/|Fountain]] * FR ** [[phab:project/view/1895/|FR-ActiveMQ]] ** [[phab:project/view/1602/|FR-Adyen]] ** [[phab:project/view/6035/|FR-Alerts]] ** [[phab:project/view/1600/|FR-Amazon]] ** [[phab:project/view/5239/|FR-Australia]] ** [[phab:project/view/4660/|FR-AutoTY-Email]] ** [[phab:project/view/7410/|FR-Batch-Data-Entry]] ** [[phab:project/view/5273/|FR-BigBundle]] ** [[phab:project/view/5754/|FR-Braintree-Integration]] ** [[phab:project/view/5829/|FR-Brazil]] ** [[phab:project/view/5236/|FR-Canada]] ** [[phab:project/view/3546/|FR-CentralNotice-Caching]] * Fr ** [[phab:project/view/3233/|Fr-CentralNotice-Translation-Bugs]] * FR ** [[phab:project/view/3545/|FR-CentralNotice-translations]] ** [[phab:project/view/4263/|FR-Civi-Dedupe]] ** [[phab:project/view/4037/|FR-Civi-Planned-Giving]] ** [[phab:project/view/4036/|FR-Civi-Prospect]] * Fr ** [[phab:project/view/2928/|Fr-CiviCRM-dedupe-FY2017/18]] * FR ** [[phab:project/view/5223/|FR-CiviCRM-Searchkit]] ** [[phab:project/view/4356/|FR-cross-training]] ** [[phab:project/view/1603/|FR-dlocal]] ** [[phab:project/view/5137/|FR-Docker]] ** [[phab:project/view/8292/|FR-Donation-Processing]] ** [[phab:project/view/7717/|FR-Donor-portal]] * Fr ** [[phab:project/view/5128/|Fr-drupal-upgrade-2025]] * FR ** [[phab:project/view/2062/|FR-Email]] ** [[phab:project/view/5159/|FR-email-preferences]] ** [[phab:project/view/5274/|FR-EN6C]] ** [[phab:project/view/4975/|FR-endowment]] ** [[phab:project/view/3692/|FR-failmail]] ** [[phab:project/view/5770/|FR-form-chooser-refactor]] ** [[phab:project/view/4264/|FR-fortnightly]] ** [[phab:project/view/5233/|FR-France]] ** [[phab:project/view/5753/|FR-Gpay-Integration]] ** [[phab:project/view/5229/|FR-India]] ** [[phab:project/view/5234/|FR-Ireland]] ** [[phab:project/view/5232/|FR-Italy]] ** [[phab:project/view/5230/|FR-Japan]] ** [[phab:project/view/5228/|FR-LATAM]] ** [[phab:project/view/5464/|FR-matching-gifts]] ** [[phab:project/view/8502/|FR-MGFE]] ** [[phab:project/view/4769/|FR-MW-Vagrant]] ** [[phab:project/view/5272/|FR-Netherlands]] ** [[phab:project/view/5238/|FR-New-Zealand]] ** [[phab:project/view/1605/|FR-OtherProcessors]] ** [[phab:project/view/5764/|FR-payments-general]] ** [[phab:project/view/1601/|FR-Paypal]] ** [[phab:project/view/1893/|FR-PayPal-ExpressCheckout]] ** [[phab:project/view/1894/|FR-PCI]] ** [[phab:project/view/4494/|FR-planning-ahead]] ** [[phab:project/view/6974/|FR-recurring upgrade]] ** [[phab:project/view/1653/|FR-Smashpig]] ** [[phab:project/view/5231/|FR-Sweden]] ** [[phab:project/view/5384/|FR-Target-Smart]] ** [[phab:project/view/3232/|FR-Tech-Analytics]] ** [[phab:project/view/6714/|FR-tech-data-integrity]] ** [[phab:project/view/5235/|FR-UK]] ** [[phab:project/view/5237/|FR-US]] ** [[phab:project/view/1931/|FR-WMF-Audit]] ** [[phab:project/view/1599/|FR-Worldpay]] * [[phab:project/view/59/|freigabe3]] * [[phab:project/view/4744/|Fresh]] * [[phab:project/view/3893/|Fresnel]] * [[phab:project/view/6491/|FrostlyBot]] * function ** [[phab:project/view/5276/|function-evaluator]] ** [[phab:project/view/5277/|function-orchestrator]] ** [[phab:project/view/5364/|function-schemata]] * Fundraising ** [[phab:project/view/7969/|Fundraising - Civi Standalone Issues]] * [[phab:project/view/7482/|Fundraising analytics stack]] * [[phab:project/view/6902/|Fundraising Refactor]] * fundraising ** [[phab:project/view/1091/|fundraising-tech-ops]] * gadget ** [[phab:project/view/7721/|gadget-Cat-a-lot]] ** [[phab:project/view/7591/|gadget-rcp]] ** [[phab:project/view/7064/|gadget-RTRC]] ** [[phab:project/view/6892/|gadget-WhatLeavesHere]] * [[phab:project/view/2262/|Gamepress]] * [[phab:project/view/5999/|Ganeti]] * [[phab:project/view/5290/|GAWA]] * [[phab:project/view/2912/|Genealogy]] * [[phab:project/view/605/|GeoCrumbs]] * [[phab:project/view/600/|GeoData]] * [[phab:project/view/330/|Gerrit]] * [[phab:project/view/2003/|GerritBot]] * [[phab:project/view/5057/|GitLab]] ** [[phab:project/view/5984/|GitLab-Application-Security-Pipeline]] * gitlab ** [[phab:project/view/5484/|gitlab-settings]] * GLAM ** [[phab:project/view/2087/|GLAM-Tech]] * [[phab:project/view/2690/|glam2commons]] * [[phab:project/view/315/|GlobalBlocking]] * [[phab:project/view/749/|GlobalCssJs]] * [[phab:project/view/394/|GlobalUsage]] * [[phab:project/view/802/|GlobalUserPage]] * [[phab:project/view/4288/|GLOW]] * [[phab:project/view/2926/|Goatification]] * Google ** [[phab:project/view/4740/|Google-api-proxy]] ** [[phab:project/view/4068/|Google-Drive-to-Commons]] * [[phab:project/view/23/|GoogleLogin]] * [[phab:project/view/3695/|GraphQL]] * [[phab:project/view/866/|GreyStuff]] * [[phab:project/view/8245/|Growth Team Maintenance]] * Growth ** [[phab:project/view/5971/|Growth-Positive-Reinforcement]] * [[phab:project/view/3716/|GrowthExperiments]] ** [[phab:project/view/7298/|GrowthExperiments-Community-Updates]] ** [[phab:project/view/3985/|GrowthExperiments-Help panel]] ** [[phab:project/view/4099/|GrowthExperiments-HelpModule]] ** [[phab:project/view/3986/|GrowthExperiments-Homepage]] ** [[phab:project/view/4097/|GrowthExperiments-ImpactModule]] ** [[phab:project/view/6302/|GrowthExperiments-LevelingUp]] ** [[phab:project/view/4098/|GrowthExperiments-Mentorship]] ** [[phab:project/view/4226/|GrowthExperiments-NewcomerTasks]] * grunt ** [[phab:project/view/7160/|grunt-stylelint]] * [[phab:project/view/7915/|HaproxyKafka]] * [[phab:project/view/3229/|Hashtags]] * [[phab:project/view/2771/|HasSomeColours]] * [[phab:project/view/3067/|HAWelcome]] * [[phab:project/view/8676/|hCaptcha]] * [[phab:project/view/7580/|Hiddenparma]] * [[phab:project/view/8692/|Hiruwiki]] * [[phab:project/view/6885/|Hitaden]] * [[phab:project/view/4373/|homer]] * [[phab:project/view/1822/|Horizon]] * [[phab:project/view/4892/|HtmlFormatter]] * [[phab:project/view/520/|Huggle]] * [[phab:project/view/7182/|Huma]] * [[phab:project/view/4967/|Humaniki]] * [[phab:project/view/1746/|HyperSwitch]] * [[phab:project/view/2793/|IA Upload]] * [[phab:project/view/80/|Icinga]] * Image ** [[phab:project/view/5253/|Image-Suggestion-API]] ** [[phab:project/view/5098/|Image-Suggestions]] * [[phab:project/view/243/|ImageMap]] * [[phab:project/view/2461/|ImageRating]] * [[phab:project/view/1650/|ImageTweaks]] * IMD ** [[phab:project/view/7832/|IMD-UG 2025 AP]] * import ** [[phab:project/view/3503/|import-500px]] * [[phab:project/view/1431/|ImportUsers]] * [[phab:project/view/6098/|Incident Tooling]] * Incident ** [[phab:project/view/4038/|Incident-Reporting-System]] * [[phab:project/view/3752/|incubator.wikimedia.org]] * [[phab:project/view/6343/|Infrastructure Security]] * Instrument ** [[phab:project/view/6276/|Instrument-ClientError]] * [[phab:project/view/7656/|Integrate Wikifunction on Wikipedia]] * [[phab:project/view/3156/|InteractionTimeline]] * [[phab:project/view/7163/|Internet In A Box]] * [[phab:project/view/2160/|InternetArchiveBot]] * [[phab:project/view/6425/|Intuition]] * [[phab:project/view/4923/|IP Info]] * IPA ** [[phab:project/view/6242/|IPA-Validator]] * IPBee (IP ** [[phab:project/view/6147/|IPBee (IP-Blocked Editor Experience)]] * iPoid ** [[phab:project/view/5870/|iPoid-Service]] * [[phab:project/view/3382/|Ipwatcher]] * [[phab:project/view/2122/|IRCecho]] * [[phab:project/view/5357/|ircservserv]] * [[phab:project/view/3981/|ISA]] * [[phab:project/view/5209/|Item Quality Evaluator]] * [[phab:project/view/4932/|Item Quality Scoring Improvement]] * [[phab:project/view/3249/|Jouncebot]] * jQuery ** [[phab:project/view/1119/|jQuery-Client (User-Agent parser)]] * [[phab:project/view/3689/|JSDoc WMF theme]] * [[phab:project/view/6761/|JsonCodec]] * [[phab:project/view/1103/|JsonConfig]] * [[phab:project/view/2809/|Junta Directiva]] * [[phab:project/view/6646/|JWTAuth]] * KaiOS ** [[phab:project/view/4305/|KaiOS-Wikipedia-app]] * [[phab:project/view/2777/|KartoEditor]] * [[phab:project/view/3771/|Keyholder]] * Knowledge ** [[phab:project/view/4384/|Knowledge-Integrity]] * [[phab:project/view/6268/|LandingCheck]] * Language ** [[phab:project/view/5974/|Language-Diversity-Hub]] * [[phab:project/view/547/|LastModified]] * LDAP ** [[phab:project/view/1564/|LDAP-Access-Requests]] * [[phab:project/view/7804/|LeaderBoard]] * [[phab:project/view/4/|Legalpad]] * [[phab:project/view/6353/|Less.php]] * [[phab:project/view/7786/|Liberica]] * [[phab:project/view/43/|Librarization]] * Library ** [[phab:project/view/2765/|Library-Card-Platform]] * [[phab:project/view/2930/|LibUp]] * Lift ** [[phab:project/view/5020/|Lift-Wing]] * Lingua ** [[phab:project/view/6913/|Lingua-Libre]] ** [[phab:project/view/3393/|Lingua-Libre-Legacy]] * [[phab:project/view/799/|LinkFilter]] * [[phab:project/view/6312/|linkwatcher]] * Local ** [[phab:project/view/1682/|Local-Wiki-Template-And-Gadget-Issues]] * [[phab:project/view/4000/|LogoFunctions]] * logspam ** [[phab:project/view/7157/|logspam-watch]] * [[phab:project/view/373/|LookupUser]] * [[phab:project/view/5876/|LSC]] * [[phab:project/view/3225/|LuaSandbox]] * [[phab:project/view/6831/|Luthor]] * [[phab:project/view/7857/|m3api]] * [[phab:project/view/983/|Mail]] * Map ** [[phab:project/view/3607/|Map-of-monuments]] * [[phab:project/view/1127/|Maps]] * [[phab:project/view/4011/|Mask]] * [[phab:project/view/4417/|Massmailer]] * [[phab:project/view/717/|MassMessage]] * [[phab:project/view/5541/|masz]] * [[phab:project/view/2422/|Material]] * [[phab:project/view/130/|Math]] ** [[phab:project/view/4847/|Math-Chemistry-Support]] ** [[phab:project/view/4848/|Math-Macro-Proposals]] ** [[phab:project/view/4849/|Math-Non-WMF-Installations]] ** [[phab:project/view/3743/|Mathe für Nicht-Freaks]] * [[phab:project/view/796/|Mathoid]] * [[phab:project/view/737/|MathSearch]] * [[phab:project/view/4056/|Matrix]] * [[phab:project/view/7165/|MDWikiOffline]] * Measuring ** [[phab:project/view/1400/|Measuring-value-added]] * media ** [[phab:project/view/5373/|media-backups]] ** [[phab:project/view/2455/|media-reports-tool]] * [[phab:project/view/4608/|MediaModeration]] * [[phab:project/view/4899/|MediaSearch]] * [[phab:project/view/5204/|MediaUploader]] * [[phab:project/view/230/|MediaViewer]] * [[phab:project/view/1464/|MediaWiki Language Extension Bundle]] * [[phab:project/view/4835/|MediaWiki Train Development Environment]] * MediaWiki ** [[phab:project/view/200/|MediaWiki-Action-API]] ** [[phab:project/view/4731/|MediaWiki-Blocks]] ** [[phab:project/view/150/|MediaWiki-Categories]] ** [[phab:project/view/181/|MediaWiki-Change-tagging]] ** [[phab:project/view/1087/|MediaWiki-Codesniffer]] ** [[phab:project/view/3742/|MediaWiki-Comment-store]] ** [[phab:project/view/359/|MediaWiki-Configuration]] ** [[phab:project/view/256/|MediaWiki-ContentHandler]] ** [[phab:project/view/1037/|MediaWiki-Core-AuthManager]] ** [[phab:project/view/6258/|MediaWiki-Core-Benchmarker]] ** [[phab:project/view/7048/|MediaWiki-Core-DeferredUpdates]] ** [[phab:project/view/4730/|MediaWiki-Core-Hooks]] ** [[phab:project/view/5723/|MediaWiki-Core-HTTP-Cache]] ** [[phab:project/view/269/|MediaWiki-Core-JobQueue]] ** [[phab:project/view/7663/|MediaWiki-Core-Notifications]] ** [[phab:project/view/163/|MediaWiki-Core-Preferences]] ** [[phab:project/view/4586/|MediaWiki-Core-Profiler]] ** [[phab:project/view/3880/|MediaWiki-Core-Revision-backend]] ** [[phab:project/view/2119/|MediaWiki-Core-Router]] ** [[phab:project/view/4795/|MediaWiki-Core-Skin-Architecture]] ** [[phab:project/view/174/|MediaWiki-Core-Snapshots]] ** [[phab:project/view/313/|MediaWiki-Core-Tests]] ** [[phab:project/view/8278/|MediaWiki-CreateAccount-page]] ** [[phab:project/view/1694/|MediaWiki-Debian]] ** [[phab:project/view/1129/|MediaWiki-Debug-Logger]] ** [[phab:project/view/234/|MediaWiki-DjVu]] ** [[phab:project/view/4585/|MediaWiki-Docker]] ** [[phab:project/view/132/|MediaWiki-Documentation]] ** [[phab:project/view/7594/|MediaWiki-DomainEvents]] ** [[phab:project/view/6637/|MediaWiki-Editnotice]] ** [[phab:project/view/216/|MediaWiki-Email]] ** [[phab:project/view/137/|MediaWiki-extension-requests]] ** [[phab:project/view/564/|MediaWiki-extensions-AccessControl]] ** [[phab:project/view/887/|MediaWiki-extensions-AccountInfo]] ** [[phab:project/view/3299/|MediaWiki-extensions-AddPersonalUrls]] ** [[phab:project/view/389/|MediaWiki-extensions-AdminLinks]] ** [[phab:project/view/454/|MediaWiki-extensions-AdvancedMeta]] ** [[phab:project/view/4601/|MediaWiki-extensions-AkismetKlik]] ** [[phab:project/view/8287/|MediaWiki-extensions-AllowlistHTMLTags]] ** [[phab:project/view/3574/|MediaWiki-extensions-Approved-Revs]] ** [[phab:project/view/6329/|MediaWiki-extensions-ArrayFunctions]] ** [[phab:project/view/3565/|MediaWiki-extensions-Arrays]] ** [[phab:project/view/2887/|MediaWiki-extensions-ArticleCreationWorkflow]] ** [[phab:project/view/4489/|MediaWiki-extensions-ArticleToCategory2]] ** [[phab:project/view/2719/|MediaWiki-extensions-Auth_remoteuser]] ** [[phab:project/view/354/|MediaWiki-extensions-AutoCreateCategoryPages]] ** [[phab:project/view/317/|MediaWiki-extensions-Babel]] ** [[phab:project/view/4594/|MediaWiki-extensions-BibManager]] ** [[phab:project/view/6132/|MediaWiki-extensions-BlockInactive]] ** [[phab:project/view/7802/|MediaWiki-extensions-BoilerPlate]] ** [[phab:project/view/806/|MediaWiki-extensions-BounceHandler]] ** [[phab:project/view/7148/|MediaWiki-extensions-BrickipediaExtra]] ** [[phab:project/view/6560/|MediaWiki-extensions-BulkBlock]] ** [[phab:project/view/7883/|MediaWiki-extensions-Calendar-Wikivoyage]] ** [[phab:project/view/706/|MediaWiki-extensions-Campaigns]] ** [[phab:project/view/787/|MediaWiki-extensions-Capiunto]] ** [[phab:project/view/1029/|MediaWiki-extensions-Cargo]] ** [[phab:project/view/236/|MediaWiki-extensions-CategoryTree]] ** [[phab:project/view/2832/|MediaWiki-extensions-CategoryWatch]] ** [[phab:project/view/167/|MediaWiki-extensions-CentralAuth]] ** [[phab:project/view/291/|MediaWiki-extensions-CentralNotice]] ** [[phab:project/view/6240/|MediaWiki-extensions-ChangeAuthor]] ** [[phab:project/view/5907/|MediaWiki-extensions-CiteDrawer]] ** [[phab:project/view/455/|MediaWiki-extensions-CLDR]] ** [[phab:project/view/586/|MediaWiki-extensions-CleanChanges]] ** [[phab:project/view/4588/|MediaWiki-extensions-CloseWikis]] ** [[phab:project/view/1162/|MediaWiki-extensions-CodeMirror]] ** [[phab:project/view/5908/|MediaWiki-extensions-CollapsibleSections]] ** [[phab:project/view/889/|MediaWiki-extensions-CollapsibleVector]] ** [[phab:project/view/649/|MediaWiki-extensions-Commentbox]] ** [[phab:project/view/506/|MediaWiki-extensions-Comments]] ** [[phab:project/view/2820/|MediaWiki-extensions-CommentStreams]] ** [[phab:project/view/4642/|MediaWiki-extensions-CommonMessages]] ** [[phab:project/view/6959/|MediaWiki-extensions-CommunityConfiguration]] ** [[phab:project/view/7325/|MediaWiki-extensions-CommunityRequests]] ** [[phab:project/view/288/|MediaWiki-extensions-ConfirmAccount]] ** [[phab:project/view/405/|MediaWiki-extensions-ContactPage]] ** [[phab:project/view/253/|MediaWiki-extensions-Contributors]] ** [[phab:project/view/7511/|MediaWiki-extensions-CookieConsent]] ** [[phab:project/view/2240/|MediaWiki-extensions-CookieWarning]] ** [[phab:project/view/4602/|MediaWiki-extensions-CountDownClock]] ** [[phab:project/view/2827/|MediaWiki-extensions-Create-User-Page]] ** [[phab:project/view/4483/|MediaWiki-extensions-CreateRedirect]] ** [[phab:project/view/598/|MediaWiki-extensions-CreditsSource]] ** [[phab:project/view/477/|MediaWiki-extensions-CSS]] ** [[phab:project/view/4006/|MediaWiki-extensions-DarkMode]] ** [[phab:project/view/2924/|MediaWiki-extensions-Dashiki]] ** [[phab:project/view/791/|MediaWiki-extensions-DataTransfer]] ** [[phab:project/view/4512/|MediaWiki-extensions-DeleteBatch]] ** [[phab:project/view/1549/|MediaWiki-extensions-DeletePagesForGood]] ** [[phab:project/view/4462/|MediaWiki-extensions-DisableAccount]] ** [[phab:project/view/212/|MediaWiki-extensions-Disambiguator]] ** [[phab:project/view/7854/|MediaWiki-extensions-DiscordRCFeed]] ** [[phab:project/view/6041/|MediaWiki-extensions-Discourse]] ** [[phab:project/view/798/|MediaWiki-extensions-DiscussionThreading]] ** [[phab:project/view/2694/|MediaWiki-extensions-DisplayTitle]] ** [[phab:project/view/4227/|MediaWiki-extensions-DocBookExport]] ** [[phab:project/view/409/|MediaWiki-extensions-DonationInterface]] ** [[phab:project/view/4640/|MediaWiki-extensions-DPLforum]] ** [[phab:project/view/316/|MediaWiki-extensions-Drafts]] ** [[phab:project/view/4999/|MediaWiki-extensions-DrawioEditor]] ** [[phab:project/view/4675/|MediaWiki-extensions-DumpsOnDemand]] ** [[phab:project/view/614/|MediaWiki-extensions-DynamicSidebar]] ** [[phab:project/view/5909/|MediaWiki-extensions-EditAccount]] ** [[phab:project/view/220/|MediaWiki-extensions-Editcount]] ** [[phab:project/view/2007/|MediaWiki-extensions-EditNotify]] ** [[phab:project/view/560/|MediaWiki-extensions-EditUser]] ** [[phab:project/view/2826/|MediaWiki-extensions-Email_Authorization]] ** [[phab:project/view/2358/|MediaWiki-extensions-EmailAuth]] ** [[phab:project/view/5910/|MediaWiki-extensions-EncryptedUploads]] ** [[phab:project/view/7130/|MediaWiki-extensions-EnhanceContactForm]] ** [[phab:project/view/534/|MediaWiki-extensions-EtherpadLite]] ** [[phab:project/view/589/|MediaWiki-extensions-EventLogging]] ** [[phab:project/view/1405/|MediaWiki-extensions-Examples]] ** [[phab:project/view/494/|MediaWiki-extensions-ExternalData]] ** [[phab:project/view/5911/|MediaWiki-extensions-ExternalLinkConfirm]] ** [[phab:project/view/792/|MediaWiki-extensions-ExtraLanguageLink]] ** [[phab:project/view/514/|MediaWiki-extensions-FeaturedFeeds]] ** [[phab:project/view/6597/|MediaWiki-extensions-FlexDiagrams]] ** [[phab:project/view/5912/|MediaWiki-extensions-FlickrAPI]] ** [[phab:project/view/3117/|MediaWiki-extensions-Form]] ** [[phab:project/view/622/|MediaWiki-extensions-FundraiserLandingPage]] ** [[phab:project/view/285/|MediaWiki-extensions-Gadgets]] ** [[phab:project/view/176/|MediaWiki-extensions-General]] ** [[phab:project/view/884/|MediaWiki-extensions-Git2Pages]] ** [[phab:project/view/7147/|MediaWiki-extensions-GlobalNotice]] ** [[phab:project/view/763/|MediaWiki-extensions-GlobalPreferences]] ** [[phab:project/view/7131/|MediaWiki-extensions-GlobalUserrights]] ** [[phab:project/view/4828/|MediaWiki-extensions-GlobalWatchlist]] ** [[phab:project/view/4228/|MediaWiki-extensions-GoogleAdSense]] ** [[phab:project/view/5913/|MediaWiki-extensions-GoogleAnalyticsMetrics]] ** [[phab:project/view/5914/|MediaWiki-extensions-GoogleCustomWikiSearch]] ** [[phab:project/view/7132/|MediaWiki-extensions-GoogleDocs4MW]] ** [[phab:project/view/509/|MediaWiki-extensions-GoogleNewsSitemap]] ** [[phab:project/view/1548/|MediaWiki-extensions-GPGMail]] ** [[phab:project/view/3902/|MediaWiki-extensions-GraphQL]] ** [[phab:project/view/5294/|MediaWiki-extensions-Gravatar]] ** [[phab:project/view/5915/|MediaWiki-extensions-GroupWhitelist]] ** [[phab:project/view/582/|MediaWiki-extensions-GuidedTour]] ** [[phab:project/view/5722/|MediaWiki-extensions-HeaderTabs]] ** [[phab:project/view/853/|MediaWiki-extensions-Hierarchy-Builder]] ** [[phab:project/view/1320/|MediaWiki-extensions-HitCounters]] ** [[phab:project/view/7170/|MediaWiki-extensions-HoneyPot]] ** [[phab:project/view/2350/|MediaWiki-extensions-HostStats]] ** [[phab:project/view/8656/|MediaWiki-extensions-HTML_Tags]] ** [[phab:project/view/1512/|MediaWiki-extensions-ImportArticles]] ** [[phab:project/view/290/|MediaWiki-extensions-ImportFreeImages]] ** [[phab:project/view/6814/|MediaWiki-extensions-Inbox]] ** [[phab:project/view/6535/|MediaWiki-extensions-InlineComments]] ** [[phab:project/view/180/|MediaWiki-extensions-InputBox]] ** [[phab:project/view/690/|MediaWiki-extensions-Insider]] ** [[phab:project/view/4366/|MediaWiki-extensions-InterwikiExtracts]] ** [[phab:project/view/2374/|MediaWiki-extensions-InterwikiSorting]] ** [[phab:project/view/4600/|MediaWiki-extensions-InviteSignup]] ** [[phab:project/view/6932/|MediaWiki-extensions-IPReputation]] ** [[phab:project/view/1032/|MediaWiki-extensions-Josa]] ** [[phab:project/view/3242/|MediaWiki-extensions-JSBreadCrumbs]] ** [[phab:project/view/4501/|MediaWiki-extensions-JsonData]] ** [[phab:project/view/302/|MediaWiki-extensions-LabeledSectionTransclusion]] ** [[phab:project/view/371/|MediaWiki-extensions-LanguageSelector]] ** [[phab:project/view/5202/|MediaWiki-extensions-LastUserLogin]] ** [[phab:project/view/4169/|MediaWiki-extensions-LDAPAuthentication2]] ** [[phab:project/view/863/|MediaWiki-extensions-LDAPAuthorization]] ** [[phab:project/view/3070/|MediaWiki-extensions-LDAPGroups]] ** [[phab:project/view/3952/|MediaWiki-extensions-LDAPProvider]] ** [[phab:project/view/3953/|MediaWiki-extensions-LDAPUserInfo]] ** [[phab:project/view/5916/|MediaWiki-extensions-LegalLogin]] ** [[phab:project/view/723/|MediaWiki-extensions-Lingo]] ** [[phab:project/view/7300/|MediaWiki-extensions-LinkCards]] ** [[phab:project/view/2164/|MediaWiki-extensions-LinkedWiki]] ** [[phab:project/view/4499/|MediaWiki-extensions-LinkSuggest]] ** [[phab:project/view/5917/|MediaWiki-extensions-LinkTarget]] ** [[phab:project/view/2318/|MediaWiki-extensions-Linter]] ** [[phab:project/view/303/|MediaWiki-extensions-LiquidThreads]] ** [[phab:project/view/5207/|MediaWiki-extensions-LockAuthor]] ** [[phab:project/view/416/|MediaWiki-extensions-Lockdown]] ** [[phab:project/view/7146/|MediaWiki-extensions-LockDownEnglishPages]] ** [[phab:project/view/321/|MediaWiki-extensions-LogEntry]] ** [[phab:project/view/2419/|MediaWiki-extensions-LoginNotify]] ** [[phab:project/view/3567/|MediaWiki-extensions-Loops]] ** [[phab:project/view/6966/|MediaWiki-extensions-Magic_Link_Authentication]] ** [[phab:project/view/4596/|MediaWiki-extensions-MagicNoCache]] ** [[phab:project/view/1424/|MediaWiki-extensions-Mailgun]] ** [[phab:project/view/451/|MediaWiki-extensions-Maintenance (by Skizzerz)]] ** [[phab:project/view/643/|MediaWiki-extensions-MaintenanceShell]] ** [[phab:project/view/640/|MediaWiki-extensions-MapSources]] ** [[phab:project/view/769/|MediaWiki-extensions-MarkAsHelpful]] ** [[phab:project/view/4486/|MediaWiki-extensions-MassEditRegex]] ** [[phab:project/view/5918/|MediaWiki-extensions-MassMessageEmail]] ** [[phab:project/view/286/|MediaWiki-extensions-MediaFunctions]] ** [[phab:project/view/6613/|MediaWiki-extensions-MediaSpoiler]] ** [[phab:project/view/2687/|MediaWiki-extensions-MediaWikiFarm]] ** [[phab:project/view/7145/|MediaWiki-extensions-MessageCommons]] ** [[phab:project/view/5919/|MediaWiki-extensions-MetaMaster]] ** [[phab:project/view/3577/|MediaWiki-extensions-MintyDocs]] ** [[phab:project/view/793/|MediaWiki-extensions-MobileApp]] ** [[phab:project/view/5145/|MediaWiki-extensions-MobileDetect]] ** [[phab:project/view/2421/|MediaWiki-extensions-MsCalendar]] ** [[phab:project/view/926/|MediaWiki-extensions-MsCatSelect]] ** [[phab:project/view/883/|MediaWiki-extensions-MsUpload]] ** [[phab:project/view/295/|MediaWiki-extensions-MultiBoilerplate]] ** [[phab:project/view/6007/|MediaWiki-extensions-MultiMail]] ** [[phab:project/view/4490/|MediaWiki-extensions-MultiMaps]] ** [[phab:project/view/8360/|MediaWiki-extensions-MultiTitle]] ** [[phab:project/view/5920/|MediaWiki-extensions-MyVariables]] ** [[phab:project/view/6548/|MediaWiki-extensions-NCBITaxonomyLookup]] ** [[phab:project/view/4515/|MediaWiki-extensions-NetworkAuth]] ** [[phab:project/view/319/|MediaWiki-extensions-NewestPages]] ** [[phab:project/view/7144/|MediaWiki-extensions-NewsBox]] ** [[phab:project/view/888/|MediaWiki-extensions-Newsletter]] ** [[phab:project/view/1863/|MediaWiki-extensions-NewUserActions]] ** [[phab:project/view/305/|MediaWiki-extensions-NewUserMessage]] ** [[phab:project/view/450/|MediaWiki-extensions-NewUserNotif]] ** [[phab:project/view/563/|MediaWiki-extensions-NSFileRepo]] ** [[phab:project/view/231/|MediaWiki-extensions-Nuke]] ** [[phab:project/view/7143/|MediaWiki-extensions-NumberOfWikis]] ** [[phab:project/view/554/|MediaWiki-extensions-OATHAuth]] ** [[phab:project/view/682/|MediaWiki-extensions-OAuth]] ** [[phab:project/view/1263/|MediaWiki-extensions-OAuthAuthentication]] ** [[phab:project/view/4904/|MediaWiki-extensions-OAuthRateLimiter]] ** [[phab:project/view/553/|MediaWiki-extensions-OnlineStatusBar]] ** [[phab:project/view/882/|MediaWiki-extensions-OnlyRecentRecentChanges]] ** [[phab:project/view/4498/|MediaWiki-extensions-OpenGraphMeta]] ** [[phab:project/view/862/|MediaWiki-extensions-OpenID-Connect]] ** [[phab:project/view/4530/|MediaWiki-extensions-OpenJsCad]] ** [[phab:project/view/1662/|MediaWiki-extensions-ORES]] ** [[phab:project/view/2861/|MediaWiki-extensions-OrphanedTalkPages]] ** [[phab:project/view/308/|MediaWiki-extensions-Other]] ** [[phab:project/view/272/|MediaWiki-extensions-Page_Forms]] ** [[phab:project/view/1936/|MediaWiki-extensions-PageAssessments]] ** [[phab:project/view/403/|MediaWiki-extensions-PagedTiffHandler]] ** [[phab:project/view/6640/|MediaWiki-extensions-PageExchange]] ** [[phab:project/view/5922/|MediaWiki-extensions-PageMagic]] ** [[phab:project/view/392/|MediaWiki-extensions-PageNotice]] ** [[phab:project/view/8002/|MediaWiki-extensions-PagePermissions]] ** [[phab:project/view/7562/|MediaWiki-extensions-PagePort]] ** [[phab:project/view/652/|MediaWiki-extensions-PageSchemas]] ** [[phab:project/view/4487/|MediaWiki-extensions-ParserMigration]] ** [[phab:project/view/261/|MediaWiki-extensions-Patroller]] ** [[phab:project/view/393/|MediaWiki-extensions-PdfHandler]] ** [[phab:project/view/5923/|MediaWiki-extensions-PerPageLanguage]] ** [[phab:project/view/786/|MediaWiki-extensions-Petition]] ** [[phab:project/view/4513/|MediaWiki-extensions-PGFTikZ]] ** [[phab:project/view/5901/|MediaWiki-extensions-Phonos]] ** [[phab:project/view/7743/|MediaWiki-extensions-PlaceNewSection]] ** [[phab:project/view/861/|MediaWiki-extensions-Pluggable-Auth]] ** [[phab:project/view/232/|MediaWiki-extensions-Poem]] ** [[phab:project/view/415/|MediaWiki-extensions-Poll]] ** [[phab:project/view/5924/|MediaWiki-extensions-PopupAlerts]] ** [[phab:project/view/7142/|MediaWiki-extensions-Prezi]] ** [[phab:project/view/2796/|MediaWiki-extensions-PropertySuggester]] ** [[phab:project/view/4395/|MediaWiki-extensions-ProtectionIndicator]] ** [[phab:project/view/6145/|MediaWiki-extensions-ProtectSite]] ** [[phab:project/view/4643/|MediaWiki-extensions-Push]] ** [[phab:project/view/4500/|MediaWiki-extensions-PushToWatch]] ** [[phab:project/view/7135/|MediaWiki-extensions-Quantcast]] ** [[phab:project/view/1984/|MediaWiki-extensions-QuickGV]] ** [[phab:project/view/5881/|MediaWiki-extensions-QuickInstantCommons]] ** [[phab:project/view/289/|MediaWiki-extensions-Quiz]] ** [[phab:project/view/248/|MediaWiki-extensions-RandomImage]] ** [[phab:project/view/4639/|MediaWiki-extensions-RandomInCategory]] ** [[phab:project/view/6153/|MediaWiki-extensions-ReadingLists]] ** [[phab:project/view/6042/|MediaWiki-extensions-Realnames]] ** [[phab:project/view/5782/|MediaWiki-extensions-RedirectManager]] ** [[phab:project/view/780/|MediaWiki-extensions-RefreshSpecial]] ** [[phab:project/view/595/|MediaWiki-extensions-RelatedSites]] ** [[phab:project/view/344/|MediaWiki-extensions-ReplaceText]] ** [[phab:project/view/4615/|MediaWiki-extensions-RightFunctions]] ** [[phab:project/view/430/|MediaWiki-extensions-RSS]] ** [[phab:project/view/822/|MediaWiki-extensions-SandboxLink]] ** [[phab:project/view/5925/|MediaWiki-extensions-SaveSpinner]] ** [[phab:project/view/613/|MediaWiki-extensions-Score]] ** [[phab:project/view/1550/|MediaWiki-extensions-Screenplay]] ** [[phab:project/view/876/|MediaWiki-extensions-SearchExtraNS]] ** [[phab:project/view/4674/|MediaWiki-extensions-SearchStats]] ** [[phab:project/view/3366/|MediaWiki-extensions-SecureAuth]] ** [[phab:project/view/3495/|MediaWiki-extensions-SecureLinkFixer]] ** [[phab:project/view/238/|MediaWiki-extensions-SecurePoll]] ** [[phab:project/view/260/|MediaWiki-extensions-SelectCategory]] ** [[phab:project/view/855/|MediaWiki-extensions-Semantic-Rating]] ** [[phab:project/view/4497/|MediaWiki-extensions-SemanticACL]] ** [[phab:project/view/2051/|MediaWiki-extensions-SemanticQueryInterface]] ** [[phab:project/view/2954/|MediaWiki-extensions-SendGrid]] ** [[phab:project/view/6569/|MediaWiki-extensions-Share]] ** [[phab:project/view/7134/|MediaWiki-extensions-SharedHelpPages]] ** [[phab:project/view/6146/|MediaWiki-extensions-Shibboleth]] ** [[phab:project/view/491/|MediaWiki-extensions-ShortUrl]] ** [[phab:project/view/5926/|MediaWiki-extensions-ShowMe]] ** [[phab:project/view/859/|MediaWiki-extensions-SimpleSAMLphp]] ** [[phab:project/view/4502/|MediaWiki-extensions-Site_Settings]] ** [[phab:project/view/1406/|MediaWiki-extensions-SkinPerNamespace]] ** [[phab:project/view/4616/|MediaWiki-extensions-SkinPerPage]] ** [[phab:project/view/625/|MediaWiki-extensions-SlimboxThumbs]] ** [[phab:project/view/1252/|MediaWiki-extensions-SmiteSpam]] ** [[phab:project/view/7140/|MediaWiki-extensions-SoftwareVersion]] ** [[phab:project/view/5931/|MediaWiki-extensions-SpamDiffTool]] ** [[phab:project/view/7750/|MediaWiki-extensions-SpamWatch]] ** [[phab:project/view/3794/|MediaWiki-extensions-SparkPost]] ** [[phab:project/view/6254/|MediaWiki-extensions-SpecialNamespaces]] ** [[phab:project/view/467/|MediaWiki-extensions-SphinxSearch]] ** [[phab:project/view/7941/|MediaWiki-extensions-Springboard]] ** [[phab:project/view/7139/|MediaWiki-extensions-StaffEdits]] ** [[phab:project/view/7133/|MediaWiki-extensions-StaffPowers]] ** [[phab:project/view/4641/|MediaWiki-extensions-StalkerLog]] ** [[phab:project/view/7138/|MediaWiki-extensions-StatCounter.com_Integration]] ** [[phab:project/view/781/|MediaWiki-extensions-StopForumSpam]] ** [[phab:project/view/411/|MediaWiki-extensions-StringFunctionsEscaped]] ** [[phab:project/view/4587/|MediaWiki-extensions-SubPageList3]] ** [[phab:project/view/874/|MediaWiki-extensions-SubpageSortkey]] ** [[phab:project/view/4638/|MediaWiki-extensions-Sudo]] ** [[phab:project/view/660/|MediaWiki-extensions-Survey]] ** [[phab:project/view/872/|MediaWiki-extensions-SwiftMailer]] ** [[phab:project/view/4016/|MediaWiki-extensions-TEI]] ** [[phab:project/view/604/|MediaWiki-extensions-TemplateSandbox]] ** [[phab:project/view/3284/|MediaWiki-extensions-TemplateWizard]] ** [[phab:project/view/1363/|MediaWiki-extensions-TestLanguageNameGrammar]] ** [[phab:project/view/671/|MediaWiki-extensions-ThrottleOverride]] ** [[phab:project/view/3575/|MediaWiki-extensions-TinyMCE]] ** [[phab:project/view/854/|MediaWiki-extensions-Title-Icon]] ** [[phab:project/view/397/|MediaWiki-extensions-TitleKey]] ** [[phab:project/view/666/|MediaWiki-extensions-TocTree]] ** [[phab:project/view/6037/|MediaWiki-extensions-Toolhub]] ** [[phab:project/view/444/|MediaWiki-extensions-TorBlock]] ** [[phab:project/view/271/|MediaWiki-extensions-Translate]] ** [[phab:project/view/2138/|MediaWiki-extensions-TrustedXFF]] ** [[phab:project/view/619/|MediaWiki-extensions-TwitterCards]] ** [[phab:project/view/650/|MediaWiki-extensions-TwnMainPage]] ** [[phab:project/view/4599/|MediaWiki-extensions-UnicodeConverter]] ** [[phab:project/view/6106/|MediaWiki-extensions-UnlinkedWikibase]] ** [[phab:project/view/1846/|MediaWiki-extensions-UploadsLink]] ** [[phab:project/view/809/|MediaWiki-extensions-UrlShortener]] ** [[phab:project/view/3531/|MediaWiki-extensions-UserAgreement]] ** [[phab:project/view/5208/|MediaWiki-extensions-UseResource]] ** [[phab:project/view/453/|MediaWiki-extensions-UserMerge]] ** [[phab:project/view/5927/|MediaWiki-extensions-UserProtect]] ** [[phab:project/view/3326/|MediaWiki-extensions-Variables]] ** [[phab:project/view/7181/|MediaWiki-extensions-VECancelButton]] ** [[phab:project/view/3576/|MediaWiki-extensions-VEForAll]] ** [[phab:project/view/3213/|MediaWiki-extensions-VersionCompare]] ** [[phab:project/view/858/|MediaWiki-extensions-VIKI]] ** [[phab:project/view/857/|MediaWiki-extensions-VikiSemanticTitle]] ** [[phab:project/view/505/|MediaWiki-extensions-VipsScaler]] ** [[phab:project/view/8232/|MediaWiki-extensions-Wanda]] ** [[phab:project/view/8288/|MediaWiki-extensions-WandaScore]] ** [[phab:project/view/8313/|MediaWiki-extensions-WandaScribe]] ** [[phab:project/view/6669/|MediaWiki-extensions-WatchAnalytics]] ** [[phab:project/view/4488/|MediaWiki-extensions-WatchSubpages]] ** [[phab:project/view/3888/|MediaWiki-extensions-WebDAV]] ** [[phab:project/view/4266/|MediaWiki-extensions-WebToolsManager]] ** [[phab:project/view/7137/|MediaWiki-extensions-Whitelist_Pages]] ** [[phab:project/view/4491/|MediaWiki-extensions-WhoIsWatching]] ** [[phab:project/view/6389/|MediaWiki-extensions-WhosOnline]] ** [[phab:project/view/358/|MediaWiki-extensions-Widgets]] ** [[phab:project/view/4747/|MediaWiki-extensions-WikEdDiff]] ** [[phab:project/view/6967/|MediaWiki-extensions-WikiApiary]] ** [[phab:project/view/114/|MediaWiki-extensions-Wikibase-Client]] ** [[phab:project/view/113/|MediaWiki-extensions-Wikibase-Repo]] ** [[phab:project/view/5043/|MediaWiki-extensions-WikibaseManifest]] ** [[phab:project/view/1176/|MediaWiki-extensions-WikibaseView]] ** [[phab:project/view/4823/|MediaWiki-extensions-WikimediaApiPortalOAuth]] ** [[phab:project/view/3286/|MediaWiki-extensions-WikimediaBadges]] ** [[phab:project/view/707/|MediaWiki-extensions-WikimediaEvents]] ** [[phab:project/view/471/|MediaWiki-extensions-WikimediaIncubator]] ** [[phab:project/view/492/|MediaWiki-extensions-WikimediaMaintenance]] ** [[phab:project/view/1309/|MediaWiki-extensions-WikiShare]] ** [[phab:project/view/8348/|MediaWiki-extensions-WP25EasterEggs]] ** [[phab:project/view/5370/|MediaWiki-extensions-WSOAuth]] ** [[phab:project/view/131/|MediaWiki-File-management]] ** [[phab:project/view/1498/|MediaWiki-Gallery]] ** [[phab:project/view/135/|MediaWiki-General]] ** [[phab:project/view/1525/|MediaWiki-HTML-Templating]] ** [[phab:project/view/540/|MediaWiki-HTMLForm]] ** [[phab:project/view/147/|MediaWiki-Installer]] ** [[phab:project/view/144/|MediaWiki-Internationalization]] ** [[phab:project/view/1685/|MediaWiki-Interwiki]] ** [[phab:project/view/223/|MediaWiki-Language-converter]] ** [[phab:project/view/5082/|MediaWiki-libs-Assert]] ** [[phab:project/view/1329/|MediaWiki-libs-BagOStuff]] ** [[phab:project/view/1024/|MediaWiki-libs-Cdb]] ** [[phab:project/view/3777/|MediaWiki-libs-HTTP]] ** [[phab:project/view/1553/|MediaWiki-libs-IPUtils]] ** [[phab:project/view/4783/|MediaWiki-libs-Mime]] ** [[phab:project/view/165/|MediaWiki-libs-Rdbms]] ** [[phab:project/view/5496/|MediaWiki-libs-RequestTimeout]] ** [[phab:project/view/3395/|MediaWiki-libs-RunningStat]] ** [[phab:project/view/2283/|MediaWiki-libs-ScopedCallback]] ** [[phab:project/view/3390/|MediaWiki-libs-Services]] ** [[phab:project/view/5583/|MediaWiki-libs-Stats]] ** [[phab:project/view/2285/|MediaWiki-libs-Timestamp]] ** [[phab:project/view/7090/|MediaWiki-libs-UpdateHistory]] ** [[phab:project/view/1069/|MediaWiki-libs-utfnormal]] ** [[phab:project/view/6297/|MediaWiki-libs-UUID]] ** [[phab:project/view/2284/|MediaWiki-libs-WaitConditionLoop]] ** [[phab:project/view/3514/|MediaWiki-libs-WrappedString]] ** [[phab:project/view/356/|MediaWiki-Logevents]] ** [[phab:project/view/268/|MediaWiki-Maintenance-system]] ** [[phab:project/view/4728/|MediaWiki-MergeHistory]] ** [[phab:project/view/6545/|MediaWiki-Metal]] ** [[phab:project/view/213/|MediaWiki-Page-deletion]] ** [[phab:project/view/3881/|MediaWiki-Page-derived-data]] ** [[phab:project/view/149/|MediaWiki-Page-diffs]] ** [[phab:project/view/139/|MediaWiki-Page-editing]] ** [[phab:project/view/4287/|MediaWiki-Page-history]] ** [[phab:project/view/278/|MediaWiki-Page-protection]] ** [[phab:project/view/4727/|MediaWiki-Page-rename]] ** [[phab:project/view/136/|MediaWiki-Parser]] ** [[phab:project/view/142/|MediaWiki-Parser-Templates]] ** [[phab:project/view/4634/|MediaWiki-Parser-TrackingCategories]] ** [[phab:project/view/195/|MediaWiki-Patrolling]] ** [[phab:project/view/7449/|MediaWiki-Quickstart (Docker)]] ** [[phab:project/view/194/|MediaWiki-Recent-changes]] ** [[phab:project/view/160/|MediaWiki-Redirects]] ** [[phab:project/view/3044/|MediaWiki-Release-Tools]] ** [[phab:project/view/274/|MediaWiki-ResourceLoader]] ** [[phab:project/view/4020/|MediaWiki-REST-API]] ** [[phab:project/view/337/|MediaWiki-Revision-deletion]] ** [[phab:project/view/146/|MediaWiki-Search]] ** [[phab:project/view/3150/|MediaWiki-Shell]] ** [[phab:project/view/656/|MediaWiki-Site-system]] ** [[phab:project/view/5070/|MediaWiki-skins-Amethyst]] ** [[phab:project/view/5703/|MediaWiki-skins-Cavendish]] ** [[phab:project/view/5077/|MediaWiki-skins-Erudite]] ** [[phab:project/view/5076/|MediaWiki-skins-Foreground]] ** [[phab:project/view/5131/|MediaWiki-skins-GuMaxDD]] ** [[phab:project/view/5134/|MediaWiki-skins-Mirage]] ** [[phab:project/view/5073/|MediaWiki-skins-p2wiki]] ** [[phab:project/view/6075/|MediaWiki-skins-Pivot]] ** [[phab:project/view/5130/|MediaWiki-skins-Schulenburg]] ** [[phab:project/view/7952/|MediaWiki-skins-SimpleText]] ** [[phab:project/view/5072/|MediaWiki-skins-Strapping]] ** [[phab:project/view/5074/|MediaWiki-skins-Tempo]] ** [[phab:project/view/5075/|MediaWiki-skins-WebPlatform]] ** [[phab:project/view/133/|MediaWiki-Special-pages]] ** [[phab:project/view/158/|MediaWiki-Uploading]] ** [[phab:project/view/155/|MediaWiki-User-Interface]] ** [[phab:project/view/148/|MediaWiki-User-login-and-signup]] ** [[phab:project/view/198/|MediaWiki-User-management]] ** [[phab:project/view/204/|MediaWiki-User-rename]] ** [[phab:project/view/627/|MediaWiki-Vagrant]] ** [[phab:project/view/818/|MediaWiki-Vendor]] ** [[phab:project/view/173/|MediaWiki-Watchlist]] * [[phab:project/view/7904/|mediawiki.util]] * [[phab:project/view/1950/|MediaWikiChat]] * [[phab:project/view/7677/|message]] * [[phab:project/view/1023/|Metrolook]] * [[phab:project/view/2799/|MinervaNeue]] * [[phab:project/view/2390/|MiniInvite]] * [[phab:project/view/6526/|MinT]] * [[phab:project/view/2998/|MinusX]] * [[phab:project/view/5385/|Mismatch Finder]] * [[phab:project/view/8352/|Missingwiki Finder]] * [[phab:project/view/3458/|Mitmachen]] * ML ** [[phab:project/view/5244/|ML-Governance]] * [[phab:project/view/1157/|MobileFrontend]] * [[phab:project/view/5482/|MobileFrontend Content Provider]] * [[phab:project/view/396/|Modern]] * [[phab:project/view/8350/|Monaco]] * [[phab:project/view/355/|MonoBook]] * [[phab:project/view/3379/|MontserratFont]] * [[phab:project/view/2696/|Monumental]] * Move ** [[phab:project/view/2671/|Move-Files-To-Commons]] ** [[phab:project/view/3451/|MoveComms-Support]] ** [[phab:project/view/7009/|Movement-Metrics]] ** [[phab:project/view/6447/|MPGuy2824-MoveToDraft]] * Multi ** [[phab:project/view/3112/|Multi-Content-Revisions]] * [[phab:project/view/6747/|Multiblocks]] * MW ** [[phab:project/view/8669/|MW-Drivel-Defence]] ** [[phab:project/view/4946/|MW-on-K8s]] * mwbot ** [[phab:project/view/6183/|mwbot-rs (mwapi)]] ** [[phab:project/view/6184/|mwbot-rs (mwapi_errors)]] ** [[phab:project/view/6185/|mwbot-rs (mwapi_responses)]] ** [[phab:project/view/6186/|mwbot-rs (mwbot)]] ** [[phab:project/view/6187/|mwbot-rs (mwseaql)]] ** [[phab:project/view/6188/|mwbot-rs (mwtitle)]] ** [[phab:project/view/6189/|mwbot-rs (parsoid)]] ** [[phab:project/view/6313/|mwbot-rs (toolforge)]] * [[phab:project/view/4910/|Nagf]] * Navigation ** [[phab:project/view/2055/|Navigation-Popups-Gadget]] * [[phab:project/view/642/|NavigationTiming]] * [[phab:project/view/4609/|NearbyPages]] * [[phab:project/view/4031/|netbox]] * [[phab:project/view/950/|netops]] * [[phab:project/view/6929/|NetworkSession]] * New ** [[phab:project/view/7107/|New-Engagement-Experiments]] * [[phab:project/view/2265/|NewSignupPage]] * [[phab:project/view/807/|Nimbus]] * [[phab:project/view/5986/|noc.wikimedia.org]] * Nonpublic ** [[phab:project/view/1485/|Nonpublic-Information-Access-Policy]] * [[phab:project/view/5414/|NormalizedException]] * [[phab:project/view/865/|Nostalgia]] * [[phab:project/view/182/|Notifications (Echo)]] * [[phab:project/view/2734/|OABot]] * [[phab:project/view/3244/|ObjectFactory]] * [[phab:project/view/84/|observability]] * Observability ** [[phab:project/view/5394/|Observability-Alerting]] ** [[phab:project/view/5393/|Observability-Logging]] ** [[phab:project/view/5392/|Observability-Metrics]] ** [[phab:project/view/5395/|Observability-Tracing]] * [[phab:project/view/5710/|ogv.js]] * [[phab:project/view/748/|OOjs core]] * [[phab:project/view/697/|OOUI]] * [[phab:project/view/916/|OpenBadges]] * Openstack ** [[phab:project/view/6568/|Openstack-Magnum]] * ops ** [[phab:project/view/955/|ops-codfw]] ** [[phab:project/view/5329/|ops-drmrs]] ** [[phab:project/view/1635/|ops-eqdfw]] ** [[phab:project/view/952/|ops-eqiad]] ** [[phab:project/view/1636/|ops-eqord]] ** [[phab:project/view/3127/|ops-eqsin]] ** [[phab:project/view/951/|ops-esams]] ** [[phab:project/view/6935/|ops-magru]] ** [[phab:project/view/954/|ops-ulsfo]] * [[phab:project/view/5061/|Orchestrator]] * [[phab:project/view/1467/|ORES]] ** [[phab:project/view/3327/|ORES-Support-Checklist]] * [[phab:project/view/6439/|OrphanTalk]] * Other ** [[phab:project/view/824/|Other-skins]] * [[phab:project/view/6140/|OurWorldInData]] * Outreach ** [[phab:project/view/2537/|Outreach-Programs-Projects]] * [[phab:project/view/1782/|Packaging]] * [[phab:project/view/2885/|Page Content Service]] * Page ** [[phab:project/view/765/|Page-Previews]] * [[phab:project/view/731/|PageImages]] * [[phab:project/view/541/|PageTriage]] * [[phab:project/view/1753/|PageViewInfo]] * Pageviews ** [[phab:project/view/3905/|Pageviews-Anomaly]] ** [[phab:project/view/1772/|Pageviews-API]] * [[phab:project/view/237/|ParserFunctions]] * [[phab:project/view/487/|Parsoid]] ** [[phab:project/view/1046/|Parsoid-Nowiki]] ** [[phab:project/view/5532/|Parsoid-Read-Views]] ** [[phab:project/view/1286/|Parsoid-Rendering]] ** [[phab:project/view/1045/|Parsoid-Robustness]] ** [[phab:project/view/488/|Parsoid-Serializer]] ** [[phab:project/view/610/|Parsoid-Tests]] ** [[phab:project/view/581/|Parsoid-Tokenizer]] * [[phab:project/view/4058/|PasswordlessLogin]] * [[phab:project/view/1648/|PAWS]] * [[phab:project/view/8239/|PendingChangesBot]] * Performance ** [[phab:project/view/4983/|Performance-Device-Lab]] * [[phab:project/view/8179/|PersonalDashboard]] * [[phab:project/view/5/|Phabricator]] * [[phab:project/view/4460/|Phabricator Antivandalism Extension]] * [[phab:project/view/5254/|Phabricator maintenance bot]] * [[phab:project/view/8379/|Phabricator Translations Extension]] * Phabricator ** [[phab:project/view/981/|Phabricator-Bot-Requests]] * [[phab:project/view/3065/|PhabTaskGraph]] * [[phab:project/view/3906/|phan]] ** [[phab:project/view/3149/|phan-taint-check-plugin]] * [[phab:project/view/4578/|Phatality]] * [[phab:project/view/5900/|PhotoSwipe]] * PHP ** [[phab:project/view/2349/|PHP-API-for-Wikisource]] * php ** [[phab:project/view/1581/|php-session-serializer]] ** [[phab:project/view/4060/|php-wmerrors]] ** [[phab:project/view/3222/|phpunit-patch-coverage]] * [[phab:project/view/880/|PictureGame]] * [[phab:project/view/5933/|Pixel]] * [[phab:project/view/510/|PollNY]] * [[phab:project/view/4144/|Poncho]] * [[phab:project/view/6192/|Pontoon]] * [[phab:project/view/437/|PoolCounter]] * [[phab:project/view/7192/|Popular Pages Bot]] * preview ** [[phab:project/view/5365/|preview-environment]] * [[phab:project/view/2830/|PrivateDomains]] * [[phab:project/view/7161/|probenet]] * [[phab:project/view/1155/|procurement]] * Prod ** [[phab:project/view/2290/|Prod-Kubernetes]] ** [[phab:project/view/4982/|Product-Platform Operations]] * production ** [[phab:project/view/6675/|production-risk-assessment]] * [[phab:project/view/8472/|Produnto]] * Progression ** [[phab:project/view/8201/|Progression-System]] * [[phab:project/view/645/|PronunciationRecording]] * [[phab:project/view/276/|ProofreadPage]] * [[phab:project/view/2960/|Proton]] * ProveIt ** [[phab:project/view/2317/|ProveIt-Gadget]] * [[phab:project/view/8374/|Pulac]] * Puppet ** [[phab:project/view/6543/|Puppet-Core]] ** [[phab:project/view/6544/|Puppet-Infrastructure]] * [[phab:project/view/5750/|Purtle]] * Push ** [[phab:project/view/2699/|Push-Notification-Service]] * [[phab:project/view/6314/|PushAll]] * [[phab:project/view/984/|PyBal]] * [[phab:project/view/87/|Pywikibot]] ** [[phab:project/view/92/|Pywikibot-archivebot.py]] ** [[phab:project/view/93/|Pywikibot-category.py]] ** [[phab:project/view/755/|Pywikibot-catfiles]] ** [[phab:project/view/1484/|Pywikibot-Commons]] ** [[phab:project/view/95/|Pywikibot-cosmetic-changes]] ** [[phab:project/view/6440/|Pywikibot-delete.py]] ** [[phab:project/view/99/|Pywikibot-i18n]] ** [[phab:project/view/100/|Pywikibot-interwiki.py]] ** [[phab:project/view/101/|Pywikibot-Login]] ** [[phab:project/view/1246/|Pywikibot-OAuth]] ** [[phab:project/view/104/|Pywikibot-pagegenerators]] ** [[phab:project/view/105/|Pywikibot-redirect.py]] ** [[phab:project/view/1293/|Pywikibot-replace.py]] ** [[phab:project/view/103/|Pywikibot-Scripts]] ** [[phab:project/view/106/|Pywikibot-solve-disambiguation.py]] ** [[phab:project/view/108/|Pywikibot-textlib]] ** [[phab:project/view/109/|Pywikibot-weblinkchecker.py]] * QRpedia ** [[phab:project/view/728/|QRpedia-General]] * QS ** [[phab:project/view/8349/|QS-Test-Automation]] * [[phab:project/view/800/|Quarry]] ** [[phab:project/view/2572/|QuarryBot-enwiki]] * [[phab:project/view/2772/|Quibble]] ** [[phab:project/view/8655/|Quibble-Local]] * [[phab:project/view/1429/|QuickSurveys]] * [[phab:project/view/879/|QuizGame]] * [[phab:project/view/877/|RandomGameUnit]] * React ** [[phab:project/view/5048/|React-i18n]] * [[phab:project/view/8040/|ReaderExperiments]] ** [[phab:project/view/8402/|ReaderExperiments-ImageBrowsing]] ** [[phab:project/view/8404/|ReaderExperiments-MinervaTOC]] ** [[phab:project/view/8610/|ReaderExperiments-MobilePagePreviews]] ** [[phab:project/view/8609/|ReaderExperiments-ShareHighlight]] ** [[phab:project/view/8403/|ReaderExperiments-StickyHeaders]] * [[phab:project/view/2740/|Reading List Service]] * [[phab:project/view/6286/|RealMe]] * [[phab:project/view/5506/|Realtime Preview]] * Recommendation ** [[phab:project/view/2128/|Recommendation-API]] * [[phab:project/view/5458/|Reconciliation]] * [[phab:project/view/3840/|Reference Previews]] * [[phab:project/view/1956/|Refreshed]] * [[phab:project/view/345/|RegexBlock]] * [[phab:project/view/688/|RelatedArticles]] * [[phab:project/view/1276/|ReleaseTaggerBot]] * [[phab:project/view/2978/|RemexHtml]] * Reports ** [[phab:project/view/1940/|Reports-bot]] * [[phab:project/view/8023/|requestctl]] * [[phab:project/view/6123/|Research Course]] * [[phab:project/view/6121/|Research Fund]] * Research ** [[phab:project/view/2113/|Research-collaborations]] ** [[phab:project/view/1402/|Research-consulting]] ** [[phab:project/view/7209/|Research-engineering]] ** [[phab:project/view/4383/|Research-foundational]] ** [[phab:project/view/3243/|Research-landing-page]] ** [[phab:project/view/1395/|Research-management]] ** [[phab:project/view/1394/|Research-outreach]] * [[phab:project/view/833/|RESTBase]] ** [[phab:project/view/851/|RESTBase-API]] ** [[phab:project/view/834/|RESTBase-Cassandra]] * restbase ** [[phab:project/view/4389/|restbase-mysql]] * Revise ** [[phab:project/view/6222/|Revise-Tone-Structured-Task]] * Revision ** [[phab:project/view/1639/|Revision-Slider]] * [[phab:project/view/1677/|revscoring]] * Riksarkivet ** [[phab:project/view/5289/|Riksarkivet-NAD]] * [[phab:project/view/1449/|Scap]] * [[phab:project/view/4051/|Scribe]] * [[phab:project/view/558/|Scribunto]] * SDAW ** [[phab:project/view/5877/|SDAW-Search-Improvements]] ** [[phab:project/view/5979/|SDAW-SearchVue]] * [[phab:project/view/34/|SDC General]] * SDC ** [[phab:project/view/3936/|SDC-Statements]] * [[phab:project/view/3915/|Section Editing (Mobile)]] * Section ** [[phab:project/view/6012/|Section-Level-Image-Suggestions]] ** [[phab:project/view/6013/|Section-Topics]] * [[phab:project/view/4430/|Security Architecture Tooling]] * [[phab:project/view/4428/|Security Awareness]] * [[phab:project/view/4424/|Security Incident Response]] * [[phab:project/view/4423/|Security policy and procedure]] * [[phab:project/view/4466/|Security Preview]] * [[phab:project/view/4421/|Security Risk Management]] * [[phab:project/view/4427/|Security Supplier Assessments]] * [[phab:project/view/4429/|Security Team AppSec]] * [[phab:project/view/8230/|Semantic Search]] * Server ** [[phab:project/view/5629/|Server-side-upload-request]] * service ** [[phab:project/view/1062/|service-runner]] ** [[phab:project/view/7877/|service-utils]] * ServiceOps ** [[phab:project/view/8415/|ServiceOps-Datastores]] ** [[phab:project/view/8449/|ServiceOps-good-first-task]] ** [[phab:project/view/8416/|ServiceOps-Mediawiki]] ** [[phab:project/view/8414/|ServiceOps-Services-Oids]] ** [[phab:project/view/8445/|ServiceOps-SharedInfra]] ** [[phab:project/view/8413/|ServiceOps-Upgrades-Hardware]] * [[phab:project/view/5125/|Shellbox]] * [[phab:project/view/620/|ShoutWiki Calendar]] * [[phab:project/view/5310/|ShoutWikiAds]] * [[phab:project/view/186/|SiteMatrix]] * [[phab:project/view/875/|SiteMetrics]] * [[phab:project/view/326/|SocialProfile]] * [[phab:project/view/4418/|SonarQube Bot]] * [[phab:project/view/8391/|SourceWiki]] * [[phab:project/view/3476/|Soweego]] * [[phab:project/view/192/|SpamBlacklist]] * [[phab:project/view/2383/|SpamRegex]] * [[phab:project/view/5674/|Special:NewLexeme revival]] * [[phab:project/view/1922/|Special:Notifications]] * [[phab:project/view/903/|SpellingDictionary]] * [[phab:project/view/5222/|Spicerack]] * [[phab:project/view/1928/|Splash]] * [[phab:project/view/6736/|SportsTeams]] * [[phab:project/view/4544/|SRE Program Management]] * SRE ** [[phab:project/view/956/|SRE-Access-Requests]] ** [[phab:project/view/7955/|SRE-SLO]] ** [[phab:project/view/76/|SRE-swift-storage]] ** [[phab:project/view/1828/|SRE-tools]] * [[phab:project/view/8633/|Starter Kit]] * [[phab:project/view/1364/|Stashbot]] * [[phab:project/view/3903/|Status]] * [[phab:project/view/1821/|stewardbots]] * Stewards ** [[phab:project/view/6852/|Stewards-Onboarding-Tool]] * [[phab:project/view/2134/|Striker]] * [[phab:project/view/657/|StructuredDiscussions]] * [[phab:project/view/5633/|SuenaWiki Reloaded]] * [[phab:project/view/2340/|Suggestor]] * [[phab:project/view/5683/|superset.wikimedia.org]] * [[phab:project/view/6584/|superset.wmcloud.org]] * [[phab:project/view/3542/|SVG Translate Tool]] * [[phab:project/view/277/|SyntaxHighlight]] * Synthetic ** [[phab:project/view/3619/|Synthetic-Performance-Testing]] * [[phab:project/view/1582/|TaxonBot]] * Tech ** [[phab:project/view/4953/|Tech-Product API Roadmap]] * [[phab:project/view/4610/|Technical Blog]] * Technical ** [[phab:project/view/4654/|Technical-blog-posts]] ** [[phab:project/view/2235/|Technical-Tool-Request]] * Template ** [[phab:project/view/7101/|Template-Discovery-And-Recall]] * [[phab:project/view/638/|TemplateData]] * [[phab:project/view/1932/|TemplateStyles]] * [[phab:project/view/5751/|Temporary accounts]] * [[phab:project/view/6630/|Test Kitchen]] * [[phab:project/view/7934/|Test Kitchen UI]] * [[phab:project/view/747/|TextExtracts]] * [[phab:project/view/1771/|Texvcjs]] * [[phab:project/view/5678/|Teyora]] * Thank ** [[phab:project/view/4977/|Thank-You-Page]] * [[phab:project/view/628/|Thanks]] * The ** [[phab:project/view/1690/|The-Wikipedia-Adventure]] * [[phab:project/view/1388/|Theme]] * [[phab:project/view/4426/|Threat Modeling]] * [[phab:project/view/1672/|Thumbor]] * [[phab:project/view/299/|TimedMediaHandler]] ** [[phab:project/view/1590/|TimedMediaHandler-TimedText]] ** [[phab:project/view/1591/|TimedMediaHandler-Transcode]] * [[phab:project/view/1912/|Timeless]] * [[phab:project/view/292/|TitleBlacklist]] * [[phab:project/view/2423/|tofawiki]] * [[phab:project/view/8141/|tofu.wmcloud.org]] * Tool ** [[phab:project/view/7457/|Tool-adjustyoursett]] ** [[phab:project/view/3261/|Tool-admin]] ** [[phab:project/view/6850/|Tool-alnor-bot]] ** [[phab:project/view/5356/|Tool-ameisenbot]] ** [[phab:project/view/1138/|Tool-anagrimes]] ** [[phab:project/view/6294/|Tool-animanga-db-import-bot]] ** [[phab:project/view/6275/|Tool-animanga-db-matcher]] ** [[phab:project/view/6296/|Tool-animanga-db-matcher-backend]] ** [[phab:project/view/6295/|Tool-animanga-db-matcher-frontend]] ** [[phab:project/view/6430/|Tool-apt-browser]] ** [[phab:project/view/6104/|Tool-arbota]] ** [[phab:project/view/762/|Tool-Article-request]] ** [[phab:project/view/8687/|Tool-ascal]] ** [[phab:project/view/1290/|Tool-Attribution-Generator]] ** [[phab:project/view/6691/|Tool-bash]] ** [[phab:project/view/6532/|Tool-beehind]] ** [[phab:project/view/8372/|Tool-blockcheck]] ** [[phab:project/view/7557/|Tool-bluehillbotb]] ** [[phab:project/view/5166/|Tool-bodh]] ** [[phab:project/view/5355/|Tool-botmahmood]] ** [[phab:project/view/6018/|Tool-boxybot]] ** [[phab:project/view/4955/|Tool-bridgebot]] ** [[phab:project/view/6094/|Tool-bub2]] ** [[phab:project/view/7834/|Tool-bulkuserinfo]] ** [[phab:project/view/7586/|Tool-bullseye]] ** [[phab:project/view/7897/|Tool-campwiz-nxt]] ** [[phab:project/view/8686/|Tool-catcre]] ** [[phab:project/view/7998/|Tool-centralnotice-banner-editor]] ** [[phab:project/view/8463/|Tool-changedetection-io]] ** [[phab:project/view/6357/|Tool-checklink]] ** [[phab:project/view/7749/|Tool-checkmate]] ** [[phab:project/view/8518/|Tool-clarity-tool]] ** [[phab:project/view/7781/|Tool-cobain]] ** [[phab:project/view/7461/|Tool-codex-playground]] ** [[phab:project/view/7564/|Tool-commons-browser]] ** [[phab:project/view/8652/|Tool-commons-delinquent]] ** [[phab:project/view/4889/|Tool-commonsapi]] ** [[phab:project/view/8395/|Tool-community]] ** [[phab:project/view/8041/|Tool-community-activity-alerts-system]] ** [[phab:project/view/7227/|Tool-containers]] ** [[phab:project/view/8377/|Tool-curator]] ** [[phab:project/view/6947/|Tool-cyberai]] ** [[phab:project/view/4968/|Tool-cycling-init-bot]] ** [[phab:project/view/7194/|Tool-dabfix]] ** [[phab:project/view/8181/|Tool-datosferalab]] ** [[phab:project/view/8572/|Tool-delintbot]] ** [[phab:project/view/5401/|Tool-deploy-commands]] ** [[phab:project/view/8100/|Tool-digitalt2commons]] * tool ** [[phab:project/view/5936/|tool-docs]] * Tool ** [[phab:project/view/8252/|Tool-dopbot]] ** [[phab:project/view/5350/|Tool-drift-tracker]] ** [[phab:project/view/6432/|Tool-ducttape]] ** [[phab:project/view/6914/|Tool-dyslexianwiki]] ** [[phab:project/view/6477/|Tool-earlgraytool]] ** [[phab:project/view/7962/|Tool-easypage-ai]] ** [[phab:project/view/8582/|Tool-echo-chamber]] ** [[phab:project/view/7961/|Tool-edit-requests]] ** [[phab:project/view/7195/|Tool-editathonstat]] ** [[phab:project/view/7507/|Tool-eicgame]] ** [[phab:project/view/8273/|Tool-enderbot]] ** [[phab:project/view/8258/|Tool-enderbot-dev]] ** [[phab:project/view/7657/|Tool-erinnermich]] ** [[phab:project/view/775/|Tool-Erwin's-tools]] ** [[phab:project/view/7644/|Tool-eswstool2]] ** [[phab:project/view/8636/|Tool-etherpad-backup]] ** [[phab:project/view/7651/|Tool-events-impact-report]] ** [[phab:project/view/5058/|Tool-explore-TopicContribs]] ** [[phab:project/view/7881/|Tool-ext-links-monitor]] ** [[phab:project/view/4010/|Tool-extjsonuploader]] ** [[phab:project/view/7189/|Tool-extloc]] ** [[phab:project/view/7815/|Tool-fa-speed]] * tool ** [[phab:project/view/6197/|tool-fast-ec]] * Tool ** [[phab:project/view/2834/|Tool-fatameh]] ** [[phab:project/view/6550/|Tool-fault-tolerance]] ** [[phab:project/view/6466/|Tool-fedi-share]] ** [[phab:project/view/8376/|Tool-fileauditor]] ** [[phab:project/view/7380/|Tool-flaschbot1]] ** [[phab:project/view/7365/|Tool-flickr2commons-ng]] ** [[phab:project/view/4052/|Tool-flickrdash]] ** [[phab:project/view/8074/|Tool-flicks-wikimedia]] ** [[phab:project/view/6300/|Tool-ft5-darqa]] ** [[phab:project/view/4972/|Tool-g8-patrol]] ** [[phab:project/view/8605/|Tool-gabuse]] ** [[phab:project/view/6450/|Tool-geoeditior]] ** [[phab:project/view/986/|Tool-Gerrit-Patch-Uploader]] ** [[phab:project/view/7960/|Tool-ghanasupremecases]] ** [[phab:project/view/8253/|Tool-ghanasupremecases1]] ** [[phab:project/view/6901/|Tool-gitlab-account-approval]] ** [[phab:project/view/8291/|Tool-gitlab-bot]] ** [[phab:project/view/7858/|Tool-gitlab-content]] ** [[phab:project/view/8675/|Tool-glam-tool-hospital]] ** [[phab:project/view/4053/|Tool-global-search]] ** [[phab:project/view/766/|Tool-Global-user-contributions]] ** [[phab:project/view/7588/|Tool-globalcontribution]] ** [[phab:project/view/8690/|Tool-glues]] ** [[phab:project/view/7301/|Tool-handle-commons-on-osm]] ** [[phab:project/view/8575/|Tool-humaniki-2]] ** [[phab:project/view/6559/|Tool-ial-recommender-system]] ** [[phab:project/view/6534/|Tool-ifttt]] ** [[phab:project/view/7546/|Tool-iNaturalistReviewer]] ** [[phab:project/view/7267/|Tool-incunabula]] ** [[phab:project/view/5135/|Tool-infogeek244-grammabot]] ** [[phab:project/view/4059/|Tool-inteGraality]] ** [[phab:project/view/5348/|Tool-ip]] ** [[phab:project/view/5295/|Tool-itwiki]] ** [[phab:project/view/6746/|Tool-iw]] ** [[phab:project/view/6465/|Tool-jackpomi]] ** [[phab:project/view/6823/|Tool-jas42-memorials-to-women]] ** [[phab:project/view/6844/|Tool-jigsaws]] ** [[phab:project/view/6687/|Tool-k8s-status]] ** [[phab:project/view/7136/|Tool-karsilayici]] ** [[phab:project/view/6582/|Tool-keo010122bot-2]] ** [[phab:project/view/5333/|Tool-klexiboxen]] ** [[phab:project/view/7700/|Tool-klw-2024-25]] ** [[phab:project/view/8178/|Tool-knowledgetrain]] ** [[phab:project/view/7348/|Tool-Kuvaton]] ** [[phab:project/view/5955/|Tool-kuwikibot]] ** [[phab:project/view/7183/|Tool-lastbot]] ** [[phab:project/view/3999/|Tool-ldap]] ** [[phab:project/view/5342/|Tool-leksem-indonesia]] ** [[phab:project/view/8399/|Tool-leksem-indonesia-test]] ** [[phab:project/view/7566/|Tool-letaxobot]] ** [[phab:project/view/7441/|Tool-lexeme-forms]] ** [[phab:project/view/8516/|Tool-lexemes]] ** [[phab:project/view/7493/|Tool-lexica-tool]] ** [[phab:project/view/6764/|Tool-lightning-api]] ** [[phab:project/view/6943/|Tool-link-dispenser]] ** [[phab:project/view/7268/|Tool-links-monitor]] ** [[phab:project/view/708/|Tool-lists]] ** [[phab:project/view/5182/|Tool-logo-test]] ** [[phab:project/view/7386/|Tool-logos-purge]] ** [[phab:project/view/4678/|Tool-MajavahBot]] ** [[phab:project/view/6531/|Tool-masto-collab]] ** [[phab:project/view/7238/|Tool-matchandsplit]] ** [[phab:project/view/750/|Tool-Matthewrbowker's-tools]] ** [[phab:project/view/4771/|Tool-mdvt]] ** [[phab:project/view/773/|Tool-meetbot]] ** [[phab:project/view/8602/|Tool-memorial-6402]] ** [[phab:project/view/7894/|Tool-mengeditbot]] ** [[phab:project/view/4746/|Tool-MoeData]] ** [[phab:project/view/7579/|Tool-moqabot1]] ** [[phab:project/view/7609/|Tool-multilingual-missing-articles]] ** [[phab:project/view/6727/|Tool-multitrack-drafting]] ** [[phab:project/view/8674/|Tool-mw-qa-dashboard]] ** [[phab:project/view/7660/|Tool-mwcli]] ** [[phab:project/view/6346/|Tool-nfp]] ** [[phab:project/view/112/|Tool-nlwikibots]] ** [[phab:project/view/6484/|Tool-nppbrowser]] ** [[phab:project/view/7520/|Tool-nrani04]] ** [[phab:project/view/5016/|Tool-openstack-browser]] ** [[phab:project/view/2045/|Tool-Pageviews]] ** [[phab:project/view/6109/|Tool-patsabot]] ** [[phab:project/view/7320/|Tool-paulina]] ** [[phab:project/view/6054/|Tool-pdlarcher]] ** [[phab:project/view/7022/|Tool-pdlarticlefixer]] ** [[phab:project/view/7702/|Tool-petscan-list]] ** [[phab:project/view/6733/|Tool-phab-ban]] ** [[phab:project/view/2159/|Tool-Phabricator-bug-status]] ** [[phab:project/view/8375/|Tool-pid-bangladesh-uploadbot]] ** [[phab:project/view/6880/|Tool-pm20-search]] ** [[phab:project/view/6886/|Tool-potd]] ** [[phab:project/view/8644/|Tool-prosesize]] ** [[phab:project/view/6475/|Tool-python-toolforge]] ** [[phab:project/view/6489/|Tool-query-chest]] ** [[phab:project/view/7419/|Tool-quickcategories]] ** [[phab:project/view/5049/|Tool-rangeblockfinder]] ** [[phab:project/view/8691/|Tool-rangetree]] ** [[phab:project/view/7643/|Tool-ranker]] ** [[phab:project/view/5987/|Tool-rc-discord]] ** [[phab:project/view/8551/|Tool-recaptime-dev]] ** [[phab:project/view/8487/|Tool-redminbot]] ** [[phab:project/view/5013/|Tool-refill]] ** [[phab:project/view/6598/|Tool-replag]] ** [[phab:project/view/8552/|Tool-rtdev-phorge-tools]] ** [[phab:project/view/8281/|Tool-sal]] ** [[phab:project/view/8464/|Tool-savibot]] ** [[phab:project/view/5549/|Tool-sbdjwhsh]] ** [[phab:project/view/7210/|Tool-schedule-deployment]] ** [[phab:project/view/5037/|Tool-search-filters]] ** [[phab:project/view/7667/|Tool-sitesampler]] ** [[phab:project/view/5138/|Tool-socks]] ** [[phab:project/view/4235/|Tool-spacemedia]] ** [[phab:project/view/7062/|Tool-spamcheck]] * tool ** [[phab:project/view/5673/|tool-sql-optimizer]] * Tool ** [[phab:project/view/5085/|Tool-sqlchecker]] ** [[phab:project/view/7379/|Tool-stimmberechtigung]] ** [[phab:project/view/8525/|Tool-subtitler]] ** [[phab:project/view/4988/|Tool-suggestbotbn]] ** [[phab:project/view/6496/|Tool-switchmaster]] ** [[phab:project/view/7381/|Tool-techcontribs]] ** [[phab:project/view/8335/|Tool-toolinfo-scraper]] ** [[phab:project/view/6487/|Tool-toolviews]] ** [[phab:project/view/6891/|Tool-toolwatch]] ** [[phab:project/view/6206/|Tool-top25report-site]] ** [[phab:project/view/5518/|Tool-topictagging]] ** [[phab:project/view/7420/|Tool-translatetagger]] ** [[phab:project/view/8398/|Tool-twelephant-bot-archive]] ** [[phab:project/view/8198/|Tool-unwatchlist]] ** [[phab:project/view/6092/|Tool-vartani]] ** [[phab:project/view/7401/|Tool-video-answer-tool]] ** [[phab:project/view/6803/|Tool-wasp]] ** [[phab:project/view/7162/|Tool-wd-image-positions]] ** [[phab:project/view/7882/|Tool-wdactle]] * tool ** [[phab:project/view/6985/|tool-wdlocator]] * Tool ** [[phab:project/view/7885/|Tool-wdrecentchanges]] ** [[phab:project/view/6757/|Tool-whattodo]] ** [[phab:project/view/4956/|Tool-wiki-importer]] ** [[phab:project/view/7312/|Tool-wiki-loves-monument-uk]] ** [[phab:project/view/8606/|Tool-wiki-mail-verify]] ** [[phab:project/view/7959/|Tool-wiki-ocr]] ** [[phab:project/view/8274/|Tool-wikialert]] ** [[phab:project/view/5056/|Tool-wikiauthbot]] ** [[phab:project/view/8304/|Tool-wikicap]] ** [[phab:project/view/8418/|Tool-wikicontest]] ** [[phab:project/view/7867/|Tool-wikicordo]] ** [[phab:project/view/8689/|Tool-wikidata-geo-dumps]] ** [[phab:project/view/1262/|Tool-Wikidata-Periodic-Table]] ** [[phab:project/view/8153/|Tool-wikievents]] ** [[phab:project/view/8578/|Tool-wikiget]] ** [[phab:project/view/8101/|Tool-wikiguessr]] ** [[phab:project/view/7033/|Tool-wikilinkchecker]] ** [[phab:project/view/1847/|Tool-wikiloves]] ** [[phab:project/view/8501/|Tool-wikimedia-attribution]] ** [[phab:project/view/8514/|Tool-wikimonitor]] ** [[phab:project/view/7526/|Tool-wikiqanda]] ** [[phab:project/view/6756/|Tool-wikistatistics2-0]] ** [[phab:project/view/8159/|Tool-wikitanvirbot]] ** [[phab:project/view/8670/|Tool-wikitermbase]] ** [[phab:project/view/8102/|Tool-wikitrustindex]] ** [[phab:project/view/7864/|Tool-wikivirus-api-proxy]] ** [[phab:project/view/8560/|Tool-wiktlexbot]] ** [[phab:project/view/8417/|Tool-wlbdashboard]] ** [[phab:project/view/6307/|Tool-wlh]] ** [[phab:project/view/8251/|Tool-wmf-openapi-linter]] ** [[phab:project/view/6253/|Tool-wmgmcbot]] ** [[phab:project/view/7539/|Tool-wn2wd]] ** [[phab:project/view/6779/|Tool-wosretbot]] * tool ** [[phab:project/view/3758/|tool-ws-cat-browser]] * Tool ** [[phab:project/view/7890/|Tool-ws-contest-global]] * tool ** [[phab:project/view/3422/|tool-wscontest]] * Tool ** [[phab:project/view/8215/|Tool-wsindex]] ** [[phab:project/view/7788/|Tool-xokriyota]] ** [[phab:project/view/7158/|Tool-yearinreview]] ** [[phab:project/view/5325/|Tool-zhwpvg-article-list]] ** [[phab:project/view/8125/|Tool-zury]] * [[phab:project/view/539/|Toolforge]] * [[phab:project/view/7218/|toolforge_i18n]] * [[phab:project/view/5196/|ToolforgeBundle]] * [[phab:project/view/3224/|Toolhub]] * [[phab:project/view/6283/|Toolhunt]] * tox ** [[phab:project/view/4548/|tox-wikimedia]] * [[phab:project/view/7826/|Traduc Ivoir']] * [[phab:project/view/6248/|Transcriber]] * [[phab:project/view/551/|TranslationNotifications]] * [[phab:project/view/2263/|Truglass]] * Twinkle ** [[phab:project/view/5589/|Twinkle-on-Turkish-Wikipedia]] * Twitter ** [[phab:project/view/4176/|Twitter-to-Commons]] * Two ** [[phab:project/view/2277/|Two-Column-Edit-Conflict-Merge]] * ULS ** [[phab:project/view/1116/|ULS-CompactLinks]] * [[phab:project/view/6210/|Ultraviolet]] * [[phab:project/view/7351/|Universal Security Dashboard]] * [[phab:project/view/442/|UniversalLanguageSelector]] * [[phab:project/view/2204/|UnusedRedirects]] * [[phab:project/view/402/|UploadWizard]] * [[phab:project/view/2386/|uprightdiff]] * [[phab:project/view/4324/|urbanecmbot]] * usage ** [[phab:project/view/6498/|usage-tool]] * User ** [[phab:project/view/2853/|User-Testing]] * [[phab:project/view/2268/|UserStatus]] * Utilities ** [[phab:project/view/446/|Utilities-code-utils]] ** [[phab:project/view/753/|Utilities-grabbers]] ** [[phab:project/view/864/|Utilities-UnicodeJS]] * [[phab:project/view/4269/|Vabatahtlikule]] * [[phab:project/view/918/|ValueView]] * [[phab:project/view/166/|Vector (legacy skin)]] * [[phab:project/view/4281/|Vector 2022]] * [[phab:project/view/7026/|VerySmallGLAM]] * [[phab:project/view/1827/|Video extension]] * [[phab:project/view/2141/|video2commons]] * [[phab:project/view/4054/|VideoCutTool]] * [[phab:project/view/4375/|VideoJS player]] * [[phab:project/view/7164/|VideoWiki]] * View ** [[phab:project/view/6085/|View-it!]] * [[phab:project/view/3383/|VisualCategories]] * [[phab:project/view/8123/|VisualEditor Suggestion Mode]] * VisualEditor ** [[phab:project/view/480/|VisualEditor-ContentEditable]] ** [[phab:project/view/499/|VisualEditor-ContentLanguage]] ** [[phab:project/view/898/|VisualEditor-CopyPaste]] ** [[phab:project/view/503/|VisualEditor-DataModel]] ** [[phab:project/view/4171/|VisualEditor-Edit Cards ]] ** [[phab:project/view/486/|VisualEditor-EditingTools]] ** [[phab:project/view/612/|VisualEditor-Initialisation]] ** [[phab:project/view/899/|VisualEditor-InterfaceLanguage]] ** [[phab:project/view/1268/|VisualEditor-LanguageTool]] ** [[phab:project/view/1020/|VisualEditor-Links]] ** [[phab:project/view/1021/|VisualEditor-Media]] ** [[phab:project/view/484/|VisualEditor-MediaWiki]] ** [[phab:project/view/2301/|VisualEditor-MediaWiki-2017WikitextEditor]] ** [[phab:project/view/830/|VisualEditor-MediaWiki-Links]] ** [[phab:project/view/828/|VisualEditor-MediaWiki-Media]] ** [[phab:project/view/515/|VisualEditor-MediaWiki-Mobile]] ** [[phab:project/view/1019/|VisualEditor-MediaWiki-Plugins]] ** [[phab:project/view/827/|VisualEditor-MediaWiki-References]] ** [[phab:project/view/829/|VisualEditor-MediaWiki-Templates]] ** [[phab:project/view/4111/|VisualEditor-Mobile-UsabilityImprovements]] ** [[phab:project/view/831/|VisualEditor-Performance]] ** [[phab:project/view/826/|VisualEditor-Tables]] ** [[phab:project/view/2710/|VisualEditor-VisualDiffs]] * vm ** [[phab:project/view/1234/|vm-requests]] * [[phab:project/view/729/|VoteNY]] * VPS ** [[phab:project/view/3158/|VPS-project-Codesearch]] ** [[phab:project/view/7096/|VPS-project-devtools]] ** [[phab:project/view/819/|VPS-project-Extdist]] ** [[phab:project/view/2103/|VPS-project-Phabricator]] ** [[phab:project/view/8158/|VPS-project-voterlists]] ** [[phab:project/view/5497/|VPS-Project-wikicommunityhealth]] ** [[phab:project/view/543/|VPS-project-Wikistats]] * [[phab:project/view/5725/|vrts]] * [[phab:project/view/4431/|Vulnerability Management]] * [[phab:project/view/6585/|WarnNotRecentlyUpdated]] * Watchlist ** [[phab:project/view/8183/|Watchlist-Labels]] * [[phab:project/view/4340/|WatchTranslations]] * [[phab:project/view/6963/|WbStack API]] * [[phab:project/view/6964/|WbStack Deploy]] * [[phab:project/view/6965/|WbStack Mediawiki]] * [[phab:project/view/6962/|WbStack UI]] * [[phab:project/view/7542/|WDLexAudio]] * WDQS ** [[phab:project/view/3027/|WDQS-Optimizer]] * [[phab:project/view/7805/|Wdqsai]] * [[phab:project/view/7831/|WdTmCollab]] * [[phab:project/view/8651/|WE4.12 Content policy model evaluation]] * [[phab:project/view/3165/|Weapon of Mass Description]] * Web2Cit ** [[phab:project/view/5669/|Web2Cit-Community]] ** [[phab:project/view/5670/|Web2Cit-Core]] ** [[phab:project/view/5760/|Web2Cit-Editor]] ** [[phab:project/view/5929/|Web2Cit-Gadget]] ** [[phab:project/view/6133/|Web2Cit-JSON-Editor]] ** [[phab:project/view/5810/|Web2Cit-Monitor]] ** [[phab:project/view/5668/|Web2Cit-Research]] ** [[phab:project/view/5689/|Web2Cit-Server]] * Who ** [[phab:project/view/3836/|Who-Wrote-That]] * [[phab:project/view/6453/|Wiki Loves Living Heritage]] * [[phab:project/view/6122/|Wiki Workshop]] * Wiki ** [[phab:project/view/4042/|Wiki-goes-Caribbean]] ** [[phab:project/view/545/|Wiki-Loves-Monuments-Database]] ** [[phab:project/view/550/|Wiki-Loves-Monuments-Sources]] ** [[phab:project/view/2941/|Wiki-Setup]] * [[phab:project/view/6702/|Wiki2Map.org]] * [[phab:project/view/5505/|Wiki2Reveal]] * [[phab:project/view/2341/|WikiApiary]] * [[phab:project/view/2909/|wikiba.se website]] * [[phab:project/view/17/|Wikibase (3rd party installations)]] * Wikibase ** [[phab:project/view/4930/|Wikibase - Automated Configuration Detection (WikibaseManifest)]] ** [[phab:project/view/4604/|Wikibase - Federated Properties]] * [[phab:project/view/7728/|Wikibase Action API (WPP)]] * [[phab:project/view/5094/|Wikibase and Wikidata Architecture Overview]] * [[phab:project/view/7488/|Wikibase Architecture]] * [[phab:project/view/5563/|Wikibase Cloud]] * [[phab:project/view/7489/|Wikibase data storage]] * [[phab:project/view/8152/|Wikibase GraphQL]] * [[phab:project/view/5307/|Wikibase OPEN!NEXT]] * [[phab:project/view/5095/|Wikibase Pingback]] * [[phab:project/view/5063/|Wikibase Release Strategy]] * [[phab:project/view/6693/|Wikibase REST API (WPP)]] * [[phab:project/view/7589/|Wikibase REST API Search]] * Wikibase ** [[phab:project/view/920/|Wikibase-DataModel]] ** [[phab:project/view/923/|Wikibase-DataModel-JavaScript]] ** [[phab:project/view/922/|Wikibase-DataModel-Serialization]] ** [[phab:project/view/1335/|Wikibase-DataModel-Services]] ** [[phab:project/view/921/|Wikibase-Internal-Serialization]] ** [[phab:project/view/925/|Wikibase-JavaScript-Api]] ** [[phab:project/view/3336/|Wikibase-Lua]] ** [[phab:project/view/1202/|Wikibase-Quality-Constraints]] ** [[phab:project/view/919/|Wikibase-Serialization-JavaScript]] * [[phab:project/view/1816/|WikibaseMediaInfo]] * [[phab:project/view/36/|Wikibugs]] * [[phab:project/view/1641/|WikiCategoryTagCloud]] * [[phab:project/view/1608/|WikiCite]] * WikiConnect ** [[phab:project/view/8011/|WikiConnect-ParseWiki]] * [[phab:project/view/7031/|Wikidata Change Dispatching & Watchlists]] * [[phab:project/view/4521/|Wikidata Design System]] * [[phab:project/view/8353/|Wikidata Location Validator]] * [[phab:project/view/8362/|Wikidata MCP]] * [[phab:project/view/3404/|Wikidata Mobile]] * [[phab:project/view/4990/|Wikidata Query Builder]] * [[phab:project/view/2901/|Wikidata Query UI]] * [[phab:project/view/8311/|Wikidata Reference Validator]] * [[phab:project/view/7037/|Wikidata Sitelinks]] * [[phab:project/view/4242/|Wikidata Tainted References]] * Wikidata ** [[phab:project/view/4074/|Wikidata-Bridge]] ** [[phab:project/view/1278/|Wikidata-Gadgets]] ** [[phab:project/view/1158/|Wikidata-Page-Banner]] ** [[phab:project/view/2788/|Wikidata-primary-sources]] ** [[phab:project/view/891/|Wikidata-Query-Service]] ** [[phab:project/view/3620/|Wikidata-Termbox]] ** [[phab:project/view/6906/|Wikidata-WikiProject-Ontology]] * [[phab:project/view/125/|Wikidata.org]] * [[phab:project/view/270/|wikidiff2]] * [[phab:project/view/3394/|Wikidocumentaries]] * [[phab:project/view/342/|WikiEditor (2010)]] * [[phab:project/view/4110/|Wikifeeds]] * [[phab:project/view/469/|WikiForum]] * Wikifunctions ** [[phab:project/view/6927/|Wikifunctions-new-language-requests]] * [[phab:project/view/183/|WikiHiero]] * [[phab:project/view/6712/|WikiInfo]] * [[phab:project/view/8420/|Wikikysely]] * [[phab:project/view/1466/|Wikilabels]] * [[phab:project/view/5275/|WikiLambda]] ** [[phab:project/view/5054/|WikiLambda Front-end]] * [[phab:project/view/6264/|WikiLearn]] * Wikilink ** [[phab:project/view/4082/|Wikilink-Tool]] * [[phab:project/view/445/|WikiLove]] * wikimaps ** [[phab:project/view/1886/|wikimaps-warper]] * [[phab:project/view/3215/|Wikimedia Australia]] * Wikimedia Enterprise ** [[phab:project/view/6662/|Wikimedia Enterprise - Content Integrity]] ** [[phab:project/view/6663/|Wikimedia Enterprise - Machine Readability]] * [[phab:project/view/6223/|Wikimedia Enterprise Dashboard]] * [[phab:project/view/5642/|Wikimedia Enterprise DevOps]] * [[phab:project/view/5520/|Wikimedia Enterprise Discussion]] * [[phab:project/view/5777/|Wikimedia Enterprise Engineering]] * [[phab:project/view/5778/|Wikimedia Enterprise Modeling]] * [[phab:project/view/5610/|Wikimedia Enterprise QA]] * [[phab:project/view/5684/|Wikimedia Enterprise Volunteer Request]] * [[phab:project/view/5569/|Wikimedia Enterprise Web Application]] * Wikimedia Enterprise ** [[phab:project/view/6485/|Wikimedia Enterprise-Big-Data-Analysis]] ** [[phab:project/view/6455/|Wikimedia Enterprise-Breaking-News]] * [[phab:project/view/3501/|Wikimedia Foundation Governance Wiki (foundation.wikimedia.org)]] * [[phab:project/view/4739/|Wikimedia OCR]] * [[phab:project/view/1871/|Wikimedia Resource Center]] * Wikimedia ** [[phab:project/view/5185/|Wikimedia-Affiliates-Data-Portal]] ** [[phab:project/view/382/|Wikimedia-Apache-configuration]] ** [[phab:project/view/152/|Wikimedia-Bugzilla]] ** [[phab:project/view/2479/|Wikimedia-CentralNotice-Administration]] ** [[phab:project/view/4941/|Wikimedia-Developer-Portal]] ** [[phab:project/view/7685/|Wikimedia-Enterprise-Kanban-On-Call]] ** [[phab:project/view/447/|Wikimedia-Etherpad]] ** [[phab:project/view/188/|Wikimedia-Extension-setup]] ** [[phab:project/view/2893/|Wikimedia-FR-Tech-Projects]] ** [[phab:project/view/2892/|Wikimedia-FR-Tech-Systems]] ** [[phab:project/view/2715/|Wikimedia-Fundraising-Banners]] ** [[phab:project/view/1130/|Wikimedia-Fundraising-Campaigns]] ** [[phab:project/view/404/|Wikimedia-Fundraising-CiviCRM]] ** [[phab:project/view/1524/|Wikimedia-GitHub]] ** [[phab:project/view/7574/|Wikimedia-Hackathon-Kerala]] ** [[phab:project/view/143/|Wikimedia-Interwiki-links]] * wikimedia ** [[phab:project/view/2751/|wikimedia-irc-libera]] * Wikimedia ** [[phab:project/view/227/|Wikimedia-IRC-RC-Server]] ** [[phab:project/view/772/|Wikimedia-Logstash]] ** [[phab:project/view/190/|Wikimedia-Mailing-lists]] ** [[phab:project/view/2670/|Wikimedia-maintenance-script-run]] ** [[phab:project/view/5193/|Wikimedia-Minify]] ** [[phab:project/view/2666/|Wikimedia-Phabricator-Extensions]] ** [[phab:project/view/413/|Wikimedia-Planet]] ** [[phab:project/view/1619/|Wikimedia-Portals]] * wikimedia ** [[phab:project/view/6864/|wikimedia-risk-calculator]] * Wikimedia ** [[phab:project/view/178/|Wikimedia-Site-requests]] ** [[phab:project/view/5625/|Wikimedia-Small-Projects-User-Group-Projects]] ** [[phab:project/view/211/|Wikimedia-SVG-rendering]] * [[phab:project/view/536/|wikimedia.biterg.io]] * [[phab:project/view/4822/|WikimediaApiPortal]] * [[phab:project/view/6784/|WikimediaCampaignEvents]] * [[phab:project/view/8356/|WikimediaCustomizations]] * [[phab:project/view/4924/|WikimediaDebug]] * [[phab:project/view/3496/|wikimediafoundation.org]] * [[phab:project/view/426/|WikimediaMessages]] * [[phab:project/view/8393/|Wikimedians Kerala Website]] * [[phab:project/view/5220/|Wikimini.org]] * [[phab:project/view/3314/|Wikinity]] * Wikipedia ** [[phab:project/view/4393/|Wikipedia-Preview]] ** [[phab:project/view/913/|Wikipedia-Store-Theme]] * [[phab:project/view/4156/|wikipedia.de]] * [[phab:project/view/4090/|WikiPEG]] * [[phab:project/view/3857/|Wikiportrait]] * WikiProject ** [[phab:project/view/3493/|WikiProject-Biodiversity]] ** [[phab:project/view/3356/|WikiProject-ShEx]] * Wikirun ** [[phab:project/view/7947/|Wikirun-Game]] * [[phab:project/view/5868/|WikiSEO]] * [[phab:project/view/8233/|Wikisource Reader App (Android)]] * Wikispeech ** [[phab:project/view/4379/|Wikispeech-Jobrunner]] ** [[phab:project/view/4349/|Wikispeech-Speech-Data-Collector]] ** [[phab:project/view/4344/|Wikispeech-Text-to-Speech]] * [[phab:project/view/4250/|Wikispore]] * [[phab:project/view/5564/|Wikistories]] * [[phab:project/view/531/|wikitech.wikimedia.org]] * [[phab:project/view/871/|WikiTextLoggedInOut]] * [[phab:project/view/5672/|WikiWho]] * [[phab:project/view/6895/|WLM Finland 2024]] * WLM ** [[phab:project/view/4326/|WLM-Italy]] ** [[phab:project/view/4325/|WLM-Italy-Finder]] ** [[phab:project/view/4327/|WLM-Italy-Finder-App]] * WLX ** [[phab:project/view/1741/|WLX-Jury]] * WM ** [[phab:project/view/668/|WM-Bot]] ** [[phab:project/view/6641/|WMCH-Argo]] ** [[phab:project/view/7404/|WMCH-Cassandra]] ** [[phab:project/view/4782/|WMCH-Cronos-Calendar]] ** [[phab:project/view/4830/|WMCH-Infrastructure]] ** [[phab:project/view/4799/|WMCH-Minipedia]] ** [[phab:project/view/3712/|WMCZ-General]] ** [[phab:project/view/5305/|WMCZ-Stats]] ** [[phab:project/view/3391/|WMCZ-Tracker]] ** [[phab:project/view/4399/|WMCZ-Web]] * [[phab:project/view/5892/|WMDE Requirements on WMF needing prioritization]] * WMDE ** [[phab:project/view/5928/|WMDE-FUN-Tech-Payment-Refactoring]] ** [[phab:project/view/1688/|WMDE-Fundraising-Tech]] ** [[phab:project/view/2821/|WMDE-New-Editors-Banner-Campaigns]] ** [[phab:project/view/6284/|WMDE-References-FocusArea]] * wmde ** [[phab:project/view/5865/|wmde-team-b-tech]] * WMDE ** [[phab:project/view/1702/|WMDE-Tech-Communication-Mentoring-And-Events]] ** [[phab:project/view/8355/|WMDE-TechWish (product board)]] * wmde ** [[phab:project/view/5864/|wmde-wikidata-tech]] * [[phab:project/view/8237/|WME Blocked (has dependencies)]] * [[phab:project/view/8238/|WME Blocking (has dependents)]] * WME ** [[phab:project/view/6912/|WME-API-Usability]] * [[phab:project/view/3609/|WMEE 101+]] * WMEE ** [[phab:project/view/3560/|WMEE-gen]] * WMF ** [[phab:project/view/42/|WMF-Annual-Report]] ** [[phab:project/view/151/|WMF-General-or-Unknown]] ** [[phab:project/view/811/|WMF-JobQueue]] * wmf ** [[phab:project/view/4861/|wmf-laptop]] * WMF ** [[phab:project/view/7269/|WMF-Memory-Bank]] ** [[phab:project/view/5595/|WMF-Safety-Survey]] * Wmfdata ** [[phab:project/view/4627/|Wmfdata-Python]] * [[phab:project/view/5611/|wmfdb]] * WMFI ** [[phab:project/view/7179/|WMFI-imagehash]] ** [[phab:project/view/6372/|WMFI-Sámi]] * WMIT ** [[phab:project/view/5827/|WMIT-CiviCRM]] ** [[phab:project/view/6614/|WMIT-GLAMs]] ** [[phab:project/view/5047/|WMIT-Infrastructure]] ** [[phab:project/view/5241/|WMIT-LimeSurvey]] * WMNO ** [[phab:project/view/3255/|WMNO-General]] * WMSE ** [[phab:project/view/7071/|WMSE-A-network-of-places]] ** [[phab:project/view/7487/|WMSE-A-Wikispeech-for-everybody]] ** [[phab:project/view/7708/|WMSE-CommonsDB-registry]] ** [[phab:project/view/7706/|WMSE-Content-partners-2025]] ** [[phab:project/view/8476/|WMSE-Content-partners-2026]] ** [[phab:project/view/8289/|WMSE-Content-Partnerships-Hub-2025]] ** [[phab:project/view/8478/|WMSE-Content-Partnerships-Hub-2026]] ** [[phab:project/view/5440/|WMSE-Content-partnerships-support-2021]] ** [[phab:project/view/5445/|WMSE-Content-partnerships-support-2021-Capacity-building]] ** [[phab:project/view/5442/|WMSE-Content-partnerships-support-2021-Communication]] ** [[phab:project/view/5446/|WMSE-Content-partnerships-support-2021-Fundraising]] ** [[phab:project/view/5448/|WMSE-Content-partnerships-support-2021-Helpdesk]] ** [[phab:project/view/5444/|WMSE-Content-partnerships-support-2021-IGO/INGO]] ** [[phab:project/view/5441/|WMSE-Content-partnerships-support-2021-Project-management]] ** [[phab:project/view/5443/|WMSE-Content-partnerships-support-2021-Research]] ** [[phab:project/view/5447/|WMSE-Content-partnerships-support-2021-Software-development]] ** [[phab:project/view/5613/|WMSE-Content-partnerships-support-2021-Strategic-data-uploads]] ** [[phab:project/view/7714/|WMSE-Development-of-the-association-2025]] ** [[phab:project/view/8483/|WMSE-Development-of-the-association-2026]] ** [[phab:project/view/8479/|WMSE-ECHOLOT-European-Cultural-Heritage-Optimised-Linked-Open-Tools]] ** [[phab:project/view/7078/|WMSE-Existing-communities-2024]] ** [[phab:project/view/7712/|WMSE-Existing-communities-2025]] ** [[phab:project/view/8481/|WMSE-Existing-communities-2026]] ** [[phab:project/view/7711/|WMSE-International-content-partners-2025]] ** [[phab:project/view/7715/|WMSE-International-free-knowledge-movement-2025]] ** [[phab:project/view/8484/|WMSE-International-free-knowledge-movement-2026]] ** [[phab:project/view/6738/|WMSE-Knowledge-rights-in-Sweden]] ** [[phab:project/view/7713/|WMSE-New-communities-2025]] ** [[phab:project/view/8482/|WMSE-New-communities-2026]] ** [[phab:project/view/7647/|WMSE-Open-Glam-in-Ukraine]] ** [[phab:project/view/8378/|WMSE-Open-GLAM-in-Ukraine-2]] ** [[phab:project/view/7709/|WMSE-Political-decision-makers-2025]] ** [[phab:project/view/8477/|WMSE-Political-decision-makers-2026]] ** [[phab:project/view/3220/|WMSE-Project-leftovers]] ** [[phab:project/view/7710/|WMSE-Promoting-Knowledge-Rights-in-Sweden]] ** [[phab:project/view/5743/|WMSE-Wikipedia-for-All-of-Sweden-2022]] ** [[phab:project/view/8480/|WMSE-Wikispeech-for-All-Basque-Edition]] * WMUA ** [[phab:project/view/7439/|WMUA-Community-Support]] ** [[phab:project/view/7438/|WMUA-Contests]] ** [[phab:project/view/7437/|WMUA-Tech]] * [[phab:project/view/2764/|WoOgLeShades]] * [[phab:project/view/4842/|WPCleaner]] * [[phab:project/view/4979/|WPtouch]] * [[phab:project/view/3917/|WS Export]] * [[phab:project/view/1182/|XAnalytics]] * [[phab:project/view/4987/|XMPReader]] * [[phab:project/view/803/|XTools]] * [[phab:project/view/8564/|Zelph]] * [[phab:project/view/210/|Znuny]] * [Deprecated] service ** [[phab:project/view/1072/|[Deprecated] service-template-node]] === Umbrella projects === * [[phab:project/view/8604/|Abstract Wikipedia]] * [[phab:project/view/1887/|BlueSpice]] * [[phab:project/view/8325/|Browser Test Platform]] * Cloud ** [[phab:project/view/832/|Cloud-Services]] * Data ** [[phab:project/view/6843/|Data-Platform]] * [[phab:project/view/3789/|EntitySchema]] * Google ** [[phab:project/view/2540/|Google-Summer-of-Code]] * Internet ** [[phab:project/view/1576/|Internet-Archive]] * LDAP ** [[phab:project/view/3071/|LDAP-Extensions]] * [[phab:project/view/8029/|LPL Projects]] * MediaWiki ** [[phab:project/view/1539/|MediaWiki-Releasing]] ** [[phab:project/view/5614/|MediaWiki-SettingsBuilder]] * mwbot ** [[phab:project/view/6182/|mwbot-rs]] * [[phab:project/view/4085/|OpenRefine]] * [[phab:project/view/2206/|Outreachy]] * Projects ** [[phab:project/view/2829/|Projects-Cleanup]] * [[phab:project/view/1807/|Puppet CI]] * Recurring ** [[phab:project/view/1311/|Recurring-Donations]] * [[phab:project/view/2453/|Release Pipeline]] * [[phab:project/view/6289/|RESTBase Sunsetting]] * [[phab:project/view/3610/|rsc assessment]] * Security ** [[phab:project/view/4420/|Security-Team-Services]] * Social ** [[phab:project/view/1009/|Social-Tools]] * [[phab:project/view/3632/|StructuredDataOnCommons]] * [[phab:project/view/5976/|The Signpost]] * Tool ** [[phab:project/view/7819/|Tool-documentation]] * [[phab:project/view/703/|Tools]] ** [[phab:project/view/7095/|Toolsbeta-Tools]] * [[phab:project/view/483/|VisualEditor]] * VPS ** [[phab:project/view/525/|VPS-Projects]] * [[phab:project/view/5081/|wbstack]] * [[phab:project/view/5593/|Web2Cit]] * Wiki ** [[phab:project/view/575/|Wiki-Loves-Monuments]] ** [[phab:project/view/3345/|Wikibase-UserGroup]] * [[phab:project/view/71/|Wikidata]] * [[phab:project/view/6749/|Wikidata Integration in Wikimedia projects]] * [[phab:project/view/2292/|Wikidata Lexicographical data]] * [[phab:project/view/7856/|Wikidata Omega Product]] * [[phab:project/view/6279/|Wikifunctions]] * [[phab:project/view/7669/|Wikifunctions integration]] * [[phab:project/view/8396/|WikiNYC]] * [[phab:project/view/1663/|Wikispeech]] * WMDE ** [[phab:project/view/3295/|WMDE-TechWish-Maintenance]] ** [[phab:project/view/5799/|WMDE-TechWish-Survey]] * [[phab:project/view/4636/|WMEE]] * [[phab:project/view/4034/|WMFI]] * [[phab:project/view/3128/|WMNO]] * [[phab:project/view/2480/|WMSE]] * [[phab:project/view/7435/|WMUA]] === Tags === * 2026 ** [[phab:project/view/8565/|2026-user-javascript-incident]] * [[phab:project/view/8363/|25 Dec Q3 Planning]] * [[phab:project/view/171/|Accessibility]] * affects ** [[phab:project/view/4381/|affects-Kiwix-and-openZIM]] ** [[phab:project/view/6096/|affects-Miraheze]] ** [[phab:project/view/6000/|affects-scribe-org]] ** [[phab:project/view/4298/|affects-translatewiki.net]] ** [[phab:project/view/6265/|affects-WikiLearn]] * Analytics ** [[phab:project/view/7149/|Analytics-Data-Problem]] * API ** [[phab:project/view/6274/|API-Platform-Consultation]] * Arabic ** [[phab:project/view/8681/|Arabic-Sites]] * [[phab:project/view/6112/|ARM support]] * artificial ** [[phab:project/view/2454/|artificial-intelligence]] * audits ** [[phab:project/view/1317/|audits-data-retention]] * [[phab:project/view/4716/|AWS]] * Bangla ** [[phab:project/view/2393/|Bangla-Sites]] * Beta ** [[phab:project/view/1563/|Beta-Cluster-reproducible]] ** [[phab:project/view/58/|Beta-Feature]] * Browser ** [[phab:project/view/1298/|Browser-Support-Android-Google-Chrome]] ** [[phab:project/view/350/|Browser-Support-Apple-Safari]] ** [[phab:project/view/284/|Browser-Support-Firefox]] ** [[phab:project/view/362/|Browser-Support-Google-Chrome]] ** [[phab:project/view/164/|Browser-Support-Internet-Explorer]] ** [[phab:project/view/4575/|Browser-Support-KaiOS]] ** [[phab:project/view/1433/|Browser-Support-Microsoft-Edge]] ** [[phab:project/view/233/|Browser-Support-Opera]] ** [[phab:project/view/4456/|Browser-support-print-media]] ** [[phab:project/view/1617/|Browser-Tests]] * Chinese ** [[phab:project/view/2409/|Chinese-Sites]] * ci ** [[phab:project/view/4177/|ci-test-error]] * Cloud ** [[phab:project/view/5638/|Cloud-Services-Origin-Alert]] ** [[phab:project/view/5639/|Cloud-Services-Origin-Team]] ** [[phab:project/view/5637/|Cloud-Services-Origin-User]] ** [[phab:project/view/5635/|Cloud-Services-Worktype-Maintenance]] ** [[phab:project/view/5634/|Cloud-Services-Worktype-Project]] ** [[phab:project/view/5636/|Cloud-Services-Worktype-Unplanned]] * Code ** [[phab:project/view/3310/|Code-Health]] ** [[phab:project/view/4622/|Code-Health-DevEd]] ** [[phab:project/view/4720/|Code-Health-DevEd-Curriculum]] ** [[phab:project/view/3670/|Code-Health-Help-Wanted]] ** [[phab:project/view/5000/|Code-Health-Objective]] ** [[phab:project/view/3144/|Code-Stewardship-Reviews]] * Community ** [[phab:project/view/8284/|Community-collaboration]] ** [[phab:project/view/175/|Community-consensus-needed]] ** [[phab:project/view/7874/|Community-Wishlist]] ** [[phab:project/view/7223/|CommunityConfiguration-Adoption]] * [[phab:project/view/1093/|Composer]] * [[phab:project/view/4365/|ContentSecurityPolicy]] * Croatian ** [[phab:project/view/5624/|Croatian-Sites]] * [[phab:project/view/145/|Crosswiki]] * [[phab:project/view/2149/|CSS]] * Dagbani ** [[phab:project/view/5538/|Dagbani-Sites]] * dark ** [[phab:project/view/7232/|dark-mode]] * Datacenter ** [[phab:project/view/3571/|Datacenter-Switchover]] * [[phab:project/view/4656/|Dependency injection]] * [[phab:project/view/157/|Design]] * [[phab:project/view/4096/|Desktop]] * [[phab:project/view/3521/|Developer Productivity]] * [[phab:project/view/987/|Documentation]] * [[phab:project/view/4400/|Doxygen]] * [[phab:project/view/7724/|DPE HAProxy Migration]] * [[phab:project/view/942/|Epic]] * Esperanto ** [[phab:project/view/1775/|Esperanto-Sites]] * Essential ** [[phab:project/view/1454/|Essential-Work]] * Event ** [[phab:project/view/1474/|Event-Platform]] * [[phab:project/view/2552/|events]] * [[phab:project/view/7595/|Experimentation Lab Radar]] * [[phab:project/view/8566/|Federation]] * fr ** [[phab:project/view/7544/|fr-acoustic]] * FR ** [[phab:project/view/8140/|FR-Audience-Dev]] * fr ** [[phab:project/view/7999/|fr-combowiki]] ** [[phab:project/view/7972/|fr-current-sprint]] ** [[phab:project/view/7518/|fr-direct-mail]] * FR ** [[phab:project/view/1654/|FR-Fraud]] ** [[phab:project/view/7409/|FR-Imports]] * fr ** [[phab:project/view/8318/|fr-payments-ACH]] ** [[phab:project/view/8275/|fr-techtalk]] * Fundraising ** [[phab:project/view/7853/|Fundraising-ComboWiki-Dependency]] ** [[phab:project/view/7863/|Fundraising-FRUP]] * fundraising ** [[phab:project/view/7820/|fundraising-supporter-opt-in]] * FY2025 ** [[phab:project/view/8019/|FY2025-26 WE5.2.3 API Monitoring & Alarms]] * [[phab:project/view/8017/|FY2526 WE5 Responsible Use of Infrastructure]] * [[phab:project/view/8018/|FY2526 WE5.2 Evolve API offering]] * [[phab:project/view/8020/|FY2526 WE5.2.4 Enterprise Lead Generation]] * Gender ** [[phab:project/view/3108/|Gender-Support]] * git ** [[phab:project/view/7089/|git-lfs]] * [[phab:project/view/169/|good first task]] * [[phab:project/view/81/|Grafana]] * Gujarati ** [[phab:project/view/4825/|Gujarati-Sites]] * Hindi ** [[phab:project/view/2418/|Hindi-Sites]] * [[phab:project/view/5351/|HTML5]] * [[phab:project/view/162/|HTTPS]] * Hungarian ** [[phab:project/view/5693/|Hungarian-Sites]] * [[phab:project/view/156/|I18n]] * IABot ** [[phab:project/view/6004/|IABot-Priority-Eastern-Europe-Former-USSR]] * [[phab:project/view/8646/|Incident Severity 1]] * [[phab:project/view/8647/|Incident Severity 2]] * [[phab:project/view/8648/|Incident Severity 3]] * [[phab:project/view/6825/|Initial Setup & Configuration]] * [[phab:project/view/184/|IPv6]] * IRC ** [[phab:project/view/1773/|IRC-Meetings]] * [[phab:project/view/267/|JavaScript]] * [[phab:project/view/83/|Jenkins]] * [[phab:project/view/2361/|Kubernetes]] * [[phab:project/view/4981/|Language codes]] * [[phab:project/view/982/|LDAP]] * [[phab:project/view/3827/|Logos]] * Malayalam ** [[phab:project/view/2417/|Malayalam-Sites]] * mariadb ** [[phab:project/view/4313/|mariadb-optimizer-bug]] * [[phab:project/view/2691/|Microcontribution]] * ml ** [[phab:project/view/7541/|ml-model-requests]] * [[phab:project/view/372/|Mobile]] * OKR ** [[phab:project/view/1453/|OKR-Work]] * [[phab:project/view/1852/|Paper]] * Patch ** [[phab:project/view/1825/|Patch-Needs-Improvement]] * patch ** [[phab:project/view/418/|patch-welcome]] * payments ** [[phab:project/view/7023/|payments-orchestration]] * [[phab:project/view/196/|Performance Issue]] * periodic ** [[phab:project/view/2807/|periodic-update]] * [[phab:project/view/3825/|PermanentlyPrivate]] * [[phab:project/view/5132/|PHP 8.1 support]] * [[phab:project/view/6053/|PHP 8.2 support]] * [[phab:project/view/6610/|PHP 8.3 support]] * [[phab:project/view/6953/|PHP 8.4 support]] * [[phab:project/view/7720/|PHP 8.5 support]] * [[phab:project/view/8489/|PHP 8.6 support]] * [[phab:project/view/6310/|PHP 9.0 support]] * php ** [[phab:project/view/6130/|php-segfault]] * PHP ** [[phab:project/view/7678/|PHP-strong-typing]] * [[phab:project/view/4665/|Pikk plaan]] * Plural ** [[phab:project/view/3172/|Plural-Support]] * [[phab:project/view/4411/|PM]] * [[phab:project/view/7250/|PM Review before Production]] * [[phab:project/view/2339/|PostgreSQL]] * [[phab:project/view/1205/|Privacy]] * Product ** [[phab:project/view/5001/|Product-Feature]] * [[phab:project/view/1542/|Proposal]] * [[phab:project/view/78/|Puppet]] * Python3 ** [[phab:project/view/4522/|Python3-Porting]] * Pywikibot ** [[phab:project/view/1774/|Pywikibot-Announce]] ** [[phab:project/view/97/|Pywikibot-Documentation]] ** [[phab:project/view/102/|Pywikibot-network]] ** [[phab:project/view/1260/|Pywikibot-RfCs]] ** [[phab:project/view/107/|Pywikibot-tests]] ** [[phab:project/view/110/|Pywikibot-Wikidata]] * Quality ** [[phab:project/view/4342/|Quality-and-Test-Engineering-Office-Hours]] * [[phab:project/view/914/|Regression]] * research ** [[phab:project/view/1292/|research-ideas]] * RESTBase ** [[phab:project/view/837/|RESTBase-architecture]] * [[phab:project/view/1280/|RTL]] * [[phab:project/view/1618/|Ruby]] * Russian ** [[phab:project/view/2621/|Russian-Sites]] * Schema ** [[phab:project/view/161/|Schema-change]] ** [[phab:project/view/1494/|Schema-change-in-production]] * [[phab:project/view/8567/|Scraper]] * SecTeam ** [[phab:project/view/5180/|SecTeam-Processed]] * [[phab:project/view/4573/|Security]] ** [[phab:project/view/8069/|Security-Audits]] ** [[phab:project/view/5181/|Security-Incidents]] * [[phab:project/view/1163/|SEO]] * Serbian ** [[phab:project/view/3791/|Serbian-Sites]] * Service ** [[phab:project/view/838/|Service-Architecture]] ** [[phab:project/view/1305/|Service-deployment-requests]] ** [[phab:project/view/8469/|Serviceops-easywins]] * serviceops ** [[phab:project/view/8532/|serviceops-tooling]] * [[phab:project/view/4063/|Skipped QA]] * Software ** [[phab:project/view/1443/|Software-Licensing]] * Spanish ** [[phab:project/view/2564/|Spanish-Sites]] * [[phab:project/view/6824/|Speedier Release]] * [[phab:project/view/2085/|Spike]] * [[phab:project/view/2752/|SQLite]] * sre ** [[phab:project/view/6682/|sre-alert-triage]] * SRE ** [[phab:project/view/6448/|SRE-Unowned]] * [[phab:project/view/1541/|Story]] * [[phab:project/view/1465/|Surveys]] * [[phab:project/view/1167/|Sustainability]] * [[phab:project/view/5762/|SVG]] * Tamil ** [[phab:project/view/2416/|Tamil-Sites]] * task ** [[phab:project/view/7191/|task-needs-improvement]] * Technical ** [[phab:project/view/609/|Technical-Debt]] * Test ** [[phab:project/view/3223/|Test-Coverage]] ** [[phab:project/view/6699/|Test-Infrastructure]] ** [[phab:project/view/4524/|Testing-Roadblocks]] * [[phab:project/view/138/|TestMe]] * Thai ** [[phab:project/view/5950/|Thai-Sites]] * [[phab:project/view/2835/|Tor]] * Tracking ** [[phab:project/view/134/|Tracking-Neverending]] * Transaction ** [[phab:project/view/7517/|Transaction-missing-in-CiviCRM]] * Turkish ** [[phab:project/view/3231/|Turkish-Sites]] * Unplanned ** [[phab:project/view/1318/|Unplanned-Sprint-Work]] * Unstewarded ** [[phab:project/view/5503/|Unstewarded-production-error]] * [[phab:project/view/153/|Upstream]] * User ** [[phab:project/view/1097/|User-notice]] ** [[phab:project/view/6095/|User-notice-archive]] * UX ** [[phab:project/view/3687/|UX-Debt]] * [[phab:project/view/825/|Verified]] * Vertical ** [[phab:project/view/6134/|Vertical-Writing]] * [[phab:project/view/1255/|Video]] * [[phab:project/view/1355/|Voice & Tone]] * [[phab:project/view/5602/|Vue.js]] * WCAG ** [[phab:project/view/3289/|WCAG-Level-A]] ** [[phab:project/view/3290/|WCAG-Level-AA]] ** [[phab:project/view/3291/|WCAG-Level-AAA]] * [[phab:project/view/8568/|Wikibase Federation]] * [[phab:project/view/6024/|Wikidata data quality and trust]] * Wikimedia ** [[phab:project/view/4182/|Wikimedia-database-issue]] ** [[phab:project/view/7645/|Wikimedia-database-table-cleanup]] ** [[phab:project/view/2953/|Wikimedia-extension-review-queue]] ** [[phab:project/view/2143/|Wikimedia-Incident]] ** [[phab:project/view/1559/|Wikimedia-Performance-publish]] ** [[phab:project/view/6718/|Wikimedia-Performance-recommendation]] ** [[phab:project/view/1055/|Wikimedia-production-error]] ** [[phab:project/view/5427/|Wikimedia-Slow-DB-Query]] * [[phab:project/view/7898/|WIT External Ticket]] * WMDE ** [[phab:project/view/4433/|WMDE-Fundraising-CFR]] ** [[phab:project/view/1943/|WMDE-Fundraising-CN]] * [[phab:project/view/7835/|Workstreams]] * [[phab:project/view/836/|Zuul]] === User groups === * [[phab:project/view/4876/|Abstract Wikipedia team]] * Africa ** [[phab:project/view/2858/|Africa-Wikimedia-Developers]] * All ** [[phab:project/view/1117/|All-and-every-Wikisource]] ** [[phab:project/view/1115/|All-and-every-Wiktionary]] * ARCHIVED ** [[phab:project/view/1585/|ARCHIVED - WMDE-Analytics-Engineering]] * [[phab:project/view/5960/|AvoinGLAM]] * [[phab:project/view/1942/|Brickimedia]] * cloud ** [[phab:project/view/2773/|cloud-services-team]] * Code ** [[phab:project/view/3621/|Code-Health-Metrics]] * [[phab:project/view/8071/|Codex Steering Committee]] * collaboration ** [[phab:project/view/6002/|collaboration-services]] * [[phab:project/view/1118/|Commons]] * Community ** [[phab:project/view/7403/|Community-Growth-DE&L]] ** [[phab:project/view/945/|Community-Resources]] ** [[phab:project/view/1274/|Community-Tech]] * Connection ** [[phab:project/view/5430/|Connection-Team]] * Content ** [[phab:project/view/5846/|Content-Transform-Team]] * Data ** [[phab:project/view/5462/|Data-Engineering]] ** [[phab:project/view/7606/|Data-Engineering-Icebox]] ** [[phab:project/view/5682/|Data-Engineering-Radar]] ** [[phab:project/view/4996/|Data-Persistence]] ** [[phab:project/view/5050/|Data-Persistence (work done)]] ** [[phab:project/view/7377/|Data-Persistence-Automations]] ** [[phab:project/view/6524/|Data-Platform-SRE]] * [[phab:project/view/1060/|DBA]] * DC ** [[phab:project/view/1784/|DC-Ops]] * Design ** [[phab:project/view/839/|Design-Research]] * Diffusion ** [[phab:project/view/85/|Diffusion-Repository-Administrators]] * Discovery ** [[phab:project/view/1849/|Discovery-Search]] * [[phab:project/view/3728/|Editing QA]] * Editing ** [[phab:project/view/2823/|Editing-team]] * [[phab:project/view/1588/|ELiSo]] * English ** [[phab:project/view/5856/|English-Arbitration-Committee]] * [[phab:project/view/7578/|ERC]] * ESEAP ** [[phab:project/view/8165/|ESEAP-Hub]] * FR ** [[phab:project/view/4915/|FR-donorrelations]] * Front ** [[phab:project/view/1616/|Front-end-Standards-Group]] * Fundraising Tech ** [[phab:project/view/6067/|Fundraising Tech - Chaos Crew]] * [[phab:project/view/6954/|Fundraising Tech Chaos Holding Pen]] * Fundraising ** [[phab:project/view/1390/|Fundraising-Analysis]] ** [[phab:project/view/41/|Fundraising-Backlog]] ** [[phab:project/view/7551/|Fundraising-Tech-Roadmap]] * Future ** [[phab:project/view/6706/|Future-Audiences]] * Gerrit ** [[phab:project/view/3957/|Gerrit-Privilege-Requests]] * [[phab:project/view/2086/|GLAM]] * Growth ** [[phab:project/view/1114/|Growth-Team]] ** [[phab:project/view/5314/|Growth-Team-Filtering]] * Igbo ** [[phab:project/view/5069/|Igbo-Wikimedians-User-Group]] * Indiana ** [[phab:project/view/5949/|Indiana-Wikimedians]] * [[phab:project/view/5147/|Indic MediaWiki Developers UG]] * Indic ** [[phab:project/view/3748/|Indic-TechCom]] * Infrastructure ** [[phab:project/view/5387/|Infrastructure-Foundations]] * Java ** [[phab:project/view/6725/|Java-Scala-Standardization]] * Koninklijke ** [[phab:project/view/5086/|Koninklijke-Bibliotheek-Team-Wiki]] * [[phab:project/view/7245/|Language and Product Localization]] * [[phab:project/view/7273/|LPL Analytics]] * [[phab:project/view/7247/|LPL Essential]] * [[phab:project/view/7280/|LPL Hypothesis]] * [[phab:project/view/7282/|LPL Onboarding and Development]] * Machine ** [[phab:project/view/1901/|Machine-Learning-Team]] * MediaWiki ** [[phab:project/view/6796/|MediaWiki-Engineering]] ** [[phab:project/view/1005/|MediaWiki-Farmers]] ** [[phab:project/view/3956/|MediaWiki-Gerrit-Group-Requests]] ** [[phab:project/view/6654/|MediaWiki-Platform-Team]] ** [[phab:project/view/1071/|MediaWiki-Stakeholders-Group]] * Moderator ** [[phab:project/view/5869/|Moderator-Tools-Team]] * [[phab:project/view/3901/|Moegirlpedia]] * Movement ** [[phab:project/view/6566/|Movement-Insights]] * MW ** [[phab:project/view/6931/|MW-Interfaces-Team]] * NFDI ** [[phab:project/view/5664/|NFDI-Germany]] * Odia ** [[phab:project/view/7833/|Odia-Wikimedians-UG]] * Offline ** [[phab:project/view/2387/|Offline-Working-Group]] * Policy ** [[phab:project/view/1869/|Policy-Admins]] * [[phab:project/view/4425/|Privacy Engineering]] * [[phab:project/view/8218/|Product Safety and Integrity]] * Product ** [[phab:project/view/3313/|Product-Analytics]] * Project ** [[phab:project/view/835/|Project-Admins]] * Quality ** [[phab:project/view/4403/|Quality-and-Test-Engineering-Team]] * [[phab:project/view/8004/|Reader Experience Team]] * [[phab:project/view/8003/|Reader Growth Team]] * Release ** [[phab:project/view/20/|Release-Engineering-Team]] * [[phab:project/view/45/|Research]] ** [[phab:project/view/1864/|Research-Freezer]] * [[phab:project/view/7735/|RoadToWiki]] * [[phab:project/view/4630/|secscrum]] * Security ** [[phab:project/view/1179/|Security-Team]] * [[phab:project/view/8409/|ServiceOps new]] * serviceops ** [[phab:project/view/3775/|serviceops-deprecated]] ** [[phab:project/view/4114/|serviceops-radar]] * [[phab:project/view/988/|ShoutWiki]] * [[phab:project/view/5008/|Smithsonian]] * [[phab:project/view/1025/|SRE]] * [[phab:project/view/5391/|SRE Observability]] * SRE ** [[phab:project/view/4626/|SRE-OnFire]] * Stewards ** [[phab:project/view/1596/|Stewards-and-global-tools]] * [[phab:project/view/3302/|Tech Ambassadors & Translators]] * tech ** [[phab:project/view/5179/|tech-decision-forum]] * Tech ** [[phab:project/view/6599/|Tech-Docs-Team]] * [[phab:project/view/7508/|Test Platform]] * The ** [[phab:project/view/1270/|The-Wikipedia-Library]] * Toolforge ** [[phab:project/view/2457/|Toolforge-standards-committee]] * tools ** [[phab:project/view/8202/|tools-infrastructure-team]] ** [[phab:project/view/8203/|tools-platform-team]] * [[phab:project/view/1201/|Traffic]] ** [[phab:project/view/5516/|Traffic-Icebox]] * [[phab:project/view/991/|translatewiki.net]] * Trust ** [[phab:project/view/1058/|Trust-and-Safety]] ** [[phab:project/view/3104/|Trusted-Contributors]] * [[phab:project/view/3998/|Uncyclomedia]] * [[phab:project/view/8495/|Wiki Folklore Documentation]] * Wiki ** [[phab:project/view/3359/|Wiki-Loves-Love]] ** [[phab:project/view/6926/|Wiki-Mentor-Africa]] * [[phab:project/view/6692/|Wikibase Reuse Team]] * [[phab:project/view/5755/|Wikibase Suite Team]] * [[phab:project/view/4286/|WikiClubWest]] * [[phab:project/view/8467/|Wikidata Platform Team]] * Wikidata ** [[phab:project/view/3402/|Wikidata-Campsite]] ** [[phab:project/view/7736/|Wikidata-Omega]] ** [[phab:project/view/6493/|Wikidata-UX]] ** [[phab:project/view/5417/|Wikidata-WikiProject-Music]] * [[phab:project/view/1920/|Wikifab]] * [[phab:project/view/8234/|WikiForAll]] * [[phab:project/view/4317/|WikiJournals]] * [[phab:project/view/4929/|Wikimedia Enterprise]] * [[phab:project/view/2836/|Wikimedia Taiwan]] * Wikimedia ** [[phab:project/view/4752/|Wikimedia-abusefilter-global-maintainers]] ** [[phab:project/view/4329/|Wikimedia-and-Libraries-User-Group]] ** [[phab:project/view/3171/|Wikimedia-Cameroon-User-Group]] ** [[phab:project/view/1043/|Wikimedia-DC]] ** [[phab:project/view/57/|Wikimedia-Design]] ** [[phab:project/view/6066/|Wikimedia-España]] ** [[phab:project/view/363/|Wikimedia-Fundraising]] ** [[phab:project/view/2367/|Wikimedia-Israel-Hackers]] ** [[phab:project/view/2588/|Wikimedia-Medicine]] ** [[phab:project/view/5197/|Wikimedia-Small-Projects-User-Group]] ** [[phab:project/view/2865/|Wikimedia-Small-Projects-User-Group-TechCom]] ** [[phab:project/view/2990/|Wikimedia-User-Group-Basque]] ** [[phab:project/view/2677/|Wikimedia-Venezuela]] * [[phab:project/view/7552/|Wikimedians of Kerala UG]] * Wikinews ** [[phab:project/view/8111/|Wikinews-Developer-Group]] * [[phab:project/view/8397/|WikiNYC Tech Committee]] * Wikipedia ** [[phab:project/view/489/|Wikipedia-Android-App-Backlog]] ** [[phab:project/view/782/|Wikipedia-iOS-App-Backlog]] * Wikisource ** [[phab:project/view/1334/|Wikisource-Community-User-Group]] * Wikispeech ** [[phab:project/view/1979/|Wikispeech-KTH]] ** [[phab:project/view/1980/|Wikispeech-STTS]] ** [[phab:project/view/1978/|Wikispeech-WMSE]] * Wiktionary ** [[phab:project/view/4363/|Wiktionary-fr]] * [[phab:project/view/5408/|WMDE Analytics]] * WMDE ** [[phab:project/view/1944/|WMDE-Design]] ** [[phab:project/view/2276/|WMDE-FUN-Team]] ** [[phab:project/view/2323/|WMDE-TechWish]] * WMF ** [[phab:project/view/1520/|WMF-Communications]] ** [[phab:project/view/28/|WMF-Legal]] ** [[phab:project/view/974/|WMF-NDA-Requests]] * WMSE ** [[phab:project/view/2521/|WMSE-Communication]] * [[phab:project/view/6016/|[Archived]Wikidata Dev Team]] === ACLs === * acl*access ** [[phab:project/view/1515/|acl*access-policy-approvers]] * acl*Analytics ** [[phab:project/view/3154/|acl*Analytics-Legal_policy_admins]] * [[phab:project/view/2025/|acl*annual_report_policy_admins]] * acl*Batch ** [[phab:project/view/13/|acl*Batch-Editors]] * acl*blog ** [[phab:project/view/3774/|acl*blog-admins]] * [[phab:project/view/1418/|acl*communityrelations_policy_admins]] * acl*data ** [[phab:project/view/2217/|acl*data-engineering]] * acl*English ** [[phab:project/view/5855/|acl*English-Arbitration-Committee_policy_admins]] * acl*Feature ** [[phab:project/view/6721/|acl*Feature-Engineering-Hiring_policy_admins]] * [[phab:project/view/1142/|acl*fr_policy_admins]] * [[phab:project/view/1644/|acl*fundraising_research_policy_admins]] * [[phab:project/view/6871/|acl*mediawiki_platform_team]] * acl*otrs ** [[phab:project/view/2406/|acl*otrs-admins]] * [[phab:project/view/5603/|acl*performance_team]] * [[phab:project/view/1081/|acl*phabricator]] * acl*procurement ** [[phab:project/view/1586/|acl*procurement-review]] * acl*Project ** [[phab:project/view/1776/|acl*Project-Admins]] * [[phab:project/view/1615/|acl*releng]] * acl*repository ** [[phab:project/view/2624/|acl*repository-admins]] * [[phab:project/view/2112/|acl*research_collaborations_policy_admins]] * [[phab:project/view/30/|acl*security]] * [[phab:project/view/6986/|acl*security_bots]] * [[phab:project/view/4569/|acl*security_bugwrangler]] * [[phab:project/view/4564/|acl*security_developer]] * [[phab:project/view/4568/|acl*security_documentation]] * [[phab:project/view/7949/|acl*security_frtech]] * [[phab:project/view/4571/|acl*security_legal]] * [[phab:project/view/4565/|acl*security_management]] * [[phab:project/view/7976/|acl*security_ml_team]] * [[phab:project/view/4567/|acl*security_product_manager]] * [[phab:project/view/4566/|acl*security_program_manager]] * [[phab:project/view/4563/|acl*security_releng]] * [[phab:project/view/4560/|acl*security_secteam]] * [[phab:project/view/4562/|acl*security_sre]] * [[phab:project/view/4570/|acl*security_steward]] * [[phab:project/view/2356/|acl*security_team]] * [[phab:project/view/4561/|acl*security_trusa]] * [[phab:project/view/4559/|acl*security_volunteer]] * [[phab:project/view/4572/|acl*security_wmde]] * acl*sre ** [[phab:project/view/29/|acl*sre-team]] * [[phab:project/view/2849/|acl*stewards]] * [[phab:project/view/2135/|acl*support_and_safety_policy_admins]] * [[phab:project/view/3442/|acl*userdisable]] * acl*Wikimedia ** [[phab:project/view/2991/|acl*Wikimedia-User-Group-Basque_policy_admins]] * [[phab:project/view/2808/|acl*wikisp_policy_admins]] * acl*wmcs ** [[phab:project/view/4858/|acl*wmcs-team]] * acl*WMDE ** [[phab:project/view/4753/|acl*WMDE-Technical-Wishes-Private_policy_admins]] * acl*WMF ** [[phab:project/view/4457/|acl*WMF-Communications_policy_admins]] ** [[phab:project/view/1070/|acl*WMF-FR]] * [[phab:project/view/2904/|acl*wmf_blog_social_team_policy_admins]] * acl*WMIT ** [[phab:project/view/5818/|acl*WMIT-Private_policy_admins]] * [[phab:project/view/2052/|acl*WMUA_policy_admins]] * WMF ** [[phab:project/view/61/|WMF-NDA]] === Goals === * Account ** [[phab:project/view/7225/|Account-Vanishing]] * [[phab:project/view/7292/|Bot detection and mitigation]] * Campaign ** [[phab:project/view/5515/|Campaign-Registration]] * Chart ** [[phab:project/view/8580/|Chart-Community-Wish-W414]] * Event ** [[phab:project/view/6249/|Event-Creation]] ** [[phab:project/view/6745/|Event-Discovery]] * Front ** [[phab:project/view/6392/|Front-end Modernization]] * FY2024 ** [[phab:project/view/6298/|FY2024-25 KR 3.1 Content Discovery]] ** [[phab:project/view/7375/|FY2024-25 KR 5.2 Simplify feature development]] ** [[phab:project/view/7364/|FY2024-25 WE3.2 Donation Entry Points]] ** [[phab:project/view/7293/|FY2024-25 WE4.2.1 Unique device identification model]] ** [[phab:project/view/7279/|FY2024-25 WE4.2.2 Account reputation score for anti-abuse work]] ** [[phab:project/view/7278/|FY2024-25 WE4.2.9 Contextual information on Special:Block]] * FY2025 ** [[phab:project/view/8038/|FY2025-26 KR 3.2 Reader/Consumer Strategy]] ** [[phab:project/view/8028/|FY2025-26 KR 5.1]] ** [[phab:project/view/8055/|FY2025-26 WE 4.6 - Account Security]] ** [[phab:project/view/8035/|FY2025-26 WE3.1 Engaging New Audiences]] ** [[phab:project/view/8036/|FY2025-26 WE3.2 Diversifying donation opportunities]] ** [[phab:project/view/8176/|FY2025-26 WE3.6 Consumer Strategy]] * FY25 ** [[phab:project/view/8037/|FY25-26 Reading Lists]] ** [[phab:project/view/8442/|FY25-26 WE3.5 Donor Identification and recognition]] * [[phab:project/view/2169/|Goal]] * Google ** [[phab:project/view/6593/|Google-Chrome-User-Agent-Deprecation]] * [[phab:project/view/8629/|hCaptcha on Mobile Apps]] * http ** [[phab:project/view/6594/|http-client-hints]] * [[phab:project/view/8632/|iOS Game: Which Came First]] * IP ** [[phab:project/view/6632/|IP-Blocking-Impacts]] * [[phab:project/view/8500/|Liquid Glass]] * MediaWiki ** [[phab:project/view/6370/|MediaWiki-Engineering-Group-onboarding]] * Metrics ** [[phab:project/view/8684/|Metrics-Sprint-2026-2027]] * [[phab:project/view/8204/|PES1.3.3 WP25 Easter Eggs]] * Pywikibot ** [[phab:project/view/904/|Pywikibot-compat-to-core]] * [[phab:project/view/6556/|Share QR Codes 2023]] * [[phab:project/view/7175/|SUL3]] * TPP ** [[phab:project/view/6083/|TPP-Phase1]] ** [[phab:project/view/6213/|TPP-Scaling]] * [[phab:project/view/2770/|Train Deployments]] * WE4.2 Anti ** [[phab:project/view/7313/|WE4.2 Anti-abuse]] * [[phab:project/view/7668/|Wikidata access on Wikifunctions]] * [[phab:project/view/7670/|Wikifunctions Improve performance]] * [[phab:project/view/3580/|WMEE Miljon+]] === Milestones === * 1.46.0 ** [[phab:project/view/8540/|1.46.0-wmf.26; 2026-04-28]] (MW-1.46-notes) * 1.47.0 ** [[phab:project/view/8658/|1.47.0-wmf.1; 2026-05-05]] (MW-1.47-notes) ** [[phab:project/view/8660/|1.47.0-wmf.2; 2026-05-12]] (MW-1.47-notes) ** [[phab:project/view/8661/|1.47.0-wmf.3; 2026-05-19]] (MW-1.47-notes) ** [[phab:project/view/8662/|1.47.0-wmf.4; 2026-05-26]] (MW-1.47-notes) * 2024 ** [[phab:project/view/7655/|2024-25Q3]] (Abstract Wikipedia Sandbox) * [[phab:project/view/8423/|2026]] (Google-Summer-of-Code) ** [[phab:project/view/8586/|2026-04-21]] (Phabricator) ** [[phab:project/view/8672/|2026-04-24 - 2026-05-15]] (Data-Platform-SRE) ** [[phab:project/view/8666/|2026-04-28]] (Phabricator) ** [[phab:project/view/8400/|2026.01.05 - 2026.01.30]] (Discovery-Search) ** [[phab:project/view/8506/|2026.02.02 - 2026.02.27]] (Discovery-Search) ** [[phab:project/view/8570/|2026.03.03 - 2026.04.03]] (Discovery-Search) ** [[phab:project/view/8645/|2026.04.06 - 2026.05.01]] (Discovery-Search) * [[phab:project/view/8368/|26Q3 (Jan–Mar)]] (Abstract Wikipedia team) * [[phab:project/view/8601/|26Q4 (Apr–Jun)]] (Abstract Wikipedia team) * [[phab:project/view/2860/|3rd party support]] (MinervaNeue) * [[phab:project/view/8473/|4.8 TA Patrolling]] (Temporary accounts) * [[phab:project/view/6554/|Account Approval]] (GitLab) * [[phab:project/view/5151/|actions]] (MediaWiki-User-Interface) * [[phab:project/view/5152/|active libraries]] (MediaWiki-User-Interface) * [[phab:project/view/7496/|Actual multiblocks]] (Multiblocks) * [[phab:project/view/5557/|Administration, Settings & Policy]] (GitLab) * [[phab:project/view/8175/|Advanced mobile mode and feature detection]] (MobileFrontend) * AI ** [[phab:project/view/6980/|AI-and-TDM-event]] (WMSE-Knowledge-rights-in-Sweden) * [[phab:project/view/7102/|Allow users to favorite a template]] (Template-Discovery-And-Recall) * Android Release ** [[phab:project/view/8008/|Android Release - FY2025-26]] (Wikipedia-Android-App-Backlog) * [[phab:project/view/6507/|API Gateway Roadmap]] (API Platform) * [[phab:project/view/6516/|API Guidelines Roadmap]] (API Platform) * [[phab:project/view/5377/|API Platform Roadmap]] (API Platform) * [[phab:project/view/6515/|API Portal Roadmap]] (API Platform) * [[phab:project/view/5554/|Auth & Access]] (GitLab) * [[phab:project/view/5059/|autocomplete search]] (MediaWiki-User-Interface) * [[phab:project/view/5867/|Bad data]] (Wikimedia-database-issue) * [[phab:project/view/8679/|Basel 26]] (Test Platform) * [[phab:project/view/2812/|Blubber]] (Release Pipeline) * [[phab:project/view/7666/|Bug Backlog]] (Wikipedia-iOS-App-Backlog) * Campaigns ** [[phab:project/view/4030/|Campaigns-jogging]] (SDC-Statements) * [[phab:project/view/5555/|CI & Job Runners]] (GitLab) * [[phab:project/view/8171/|Citation drawer]] (MobileFrontend) * [[phab:project/view/2944/|Close]] (Wiki-Setup) * [[phab:project/view/8166/|Codex]] (Readers Essential Work) * [[phab:project/view/5153/|collapsible elements]] (MediaWiki-User-Interface) * [[phab:project/view/6058/|Commons]] (Wikistories) * [[phab:project/view/7737/|Completed Tasks]] (Wikidata-Omega) * [[phab:project/view/6256/|Comunidad]] (Wikimedia-Small-Projects-User-Group) * Connection ** [[phab:project/view/8638/|Connection-Q4-11May-22May-2026]] (Connection-Team) ** [[phab:project/view/8624/|Connection-Q4-13Apr-24Apr-2026]] (Connection-Team) ** [[phab:project/view/8641/|Connection-Q4-22Jun-3Jul-2026]] (Connection-Team) ** [[phab:project/view/8639/|Connection-Q4-25May-5Jun-2026]] (Connection-Team) ** [[phab:project/view/8637/|Connection-Q4-27Apr-8May-2026]] (Connection-Team) ** [[phab:project/view/8640/|Connection-Q4-8Jun-19Jun-2026]] (Connection-Team) * [[phab:project/view/8174/|Core PHP]] (MobileFrontend) * [[phab:project/view/2942/|Create]] (Wiki-Setup) * [[phab:project/view/8107/|Debian Bullseye Deprecation]] (Cloud-VPS) * [[phab:project/view/3590/|Delete / Redirect]] (Wiki-Setup) * Depicts ** [[phab:project/view/3938/|Depicts-Walking]] (SDC-Statements) * [[phab:project/view/3443/|Deployment]] (Multi-Content-Revisions) * [[phab:project/view/5265/|Deployment Training Requests]] (Release-Engineering-Team) * [[phab:project/view/5562/|Deployments]] (Editing-team) * [[phab:project/view/5155/|deprecated JS libraries]] (MediaWiki-User-Interface) * [[phab:project/view/3473/|Deprecation process]] (Technical-Debt) * [[phab:project/view/2569/|Design]] (Wikipedia-iOS-App-Backlog) * [[phab:project/view/2859/|Desktop]] (MinervaNeue) * [[phab:project/view/4814/|Discovery]] (KaiOS-Wikipedia-app) * [[phab:project/view/5160/|Dodo]] (Parsoid) * [[phab:project/view/7506/|Doing 😎]] (Release-Engineering-Team) * [[phab:project/view/3845/|Economy]] (WMSE) * Editing ** [[phab:project/view/8529/|Editing-18Mar-27Mar-2026]] (Editing-team) ** [[phab:project/view/8496/|Editing-2Mar-17Mar-2026]] (Editing-team) ** [[phab:project/view/8619/|Editing-current-Q4-27Apr-8May-2026]] (Editing-team) ** [[phab:project/view/8620/|Editing-Q4-11May-22May-2026]] (Editing-team) ** [[phab:project/view/8614/|Editing-Q4-13Apr-24Apr-2026]] (Editing-team) ** [[phab:project/view/8623/|Editing-Q4-22Jun-3Jul-2026]] (Editing-team) ** [[phab:project/view/8621/|Editing-Q4-25May-5Jun-2026]] (Editing-team) ** [[phab:project/view/8579/|Editing-Q4-30Mar-10Apr-2026]] (Editing-team) ** [[phab:project/view/8622/|Editing-Q4-8Jun-19Jun-2026]] (Editing-team) * [[phab:project/view/6255/|Educación & Idiomas]] (Wikimedia-Small-Projects-User-Group) * [[phab:project/view/5349/|Enablement]] (Editing-team) * [[phab:project/view/8076/|Epics]] (Test Platform) * [[phab:project/view/7554/|Epics & Stalled]] ([Archived]Wikidata Dev Team) * [[phab:project/view/8613/|Epics (Test)]] (Wikipedia-iOS-App-Backlog) * [[phab:project/view/8664/|Experiment Platform Sprint 23]] (Test Kitchen) * [[phab:project/view/6998/|Figure out Analytics/Instrumentation for Temp Accounts rollout]] (Temporary accounts) * Flexible ** [[phab:project/view/6981/|Flexible-Copyright]] (WMSE-Knowledge-rights-in-Sweden) * [[phab:project/view/7613/|Fox Squad]] (Community-Tech) * FY2025 ** [[phab:project/view/8283/|FY2025-26 Q2]] (LPL Essential) ** [[phab:project/view/8380/|FY2025-26 Q3]] (LPL Essential) ** [[phab:project/view/8596/|FY2025-26 Q4 Sprint 2]] (Growth-Team) ** [[phab:project/view/7906/|FY2025-26-Research-April-June]] (Research) ** [[phab:project/view/7909/|FY2025-26-Research-January-March]] (Research) ** [[phab:project/view/7977/|FY2025/2026-Q1]] (SRE Observability) ** [[phab:project/view/7978/|FY2025/2026-Q2]] (SRE Observability) ** [[phab:project/view/7979/|FY2025/2026-Q3]] (SRE Observability) ** [[phab:project/view/8405/|FY2025/2026-Q3-Q4]] (cloud-services-team) ** [[phab:project/view/7982/|FY2025/2026-Q4]] (SRE Observability) * FY25 ** [[phab:project/view/8471/|FY25-26 H2]] (Movement-Insights) * [[phab:project/view/6059/|Generator]] (Wikistories) * [[phab:project/view/7240/|Gerrit 3.10]] (Gerrit) * [[phab:project/view/7534/|Gerrit 3.11]] (Gerrit) * [[phab:project/view/7859/|Gerrit 3.12]] (Gerrit) * [[phab:project/view/8533/|Gerrit 3.13]] (Gerrit) * [[phab:project/view/6418/|Gerrit 3.7]] (Gerrit) * [[phab:project/view/7417/|Global wiki rollout]] (Temporary accounts) * [[phab:project/view/6127/|Grant end]] (Web2Cit) * [[phab:project/view/3846/|Grants]] (WMSE) * Guided article creation ** [[phab:project/view/8528/|Guided article creation - FY26 WE 3.1]] (LPL Projects) * [[phab:project/view/4482/|Hardware]] (cloud-services-team) * [[phab:project/view/3844/|HR]] (WMSE) * [[phab:project/view/8170/|image carousel (media viewer)]] (MobileFrontend) * [[phab:project/view/7495/|Implement Codex Special:Block]] (Multiblocks) * [[phab:project/view/7345/|Improve display of large content in Vector 2022 and Minerva skins]] (Readers Essential Work) * [[phab:project/view/4758/|Incident Followup]] (Sustainability) * [[phab:project/view/5553/|Infrastructure]] (GitLab) * [[phab:project/view/5556/|Integrations]] (GitLab) * [[phab:project/view/6949/|iPoid 1.0]] (iPoid-Service) * [[phab:project/view/7285/|IPoid OpenSearch]] (iPoid-Service) * [[phab:project/view/3842/|IT]] (WMSE) * [[phab:project/view/8172/|JavaScript core library]] (MobileFrontend) * [[phab:project/view/4659/|Jio2]] (KaiOS-Wikipedia-app) * [[phab:project/view/6546/|Kanban]] (WMDE Analytics) * [[phab:project/view/4320/|Kanban]] (Product-Analytics) * [[phab:project/view/5880/|Kanban]] (Moderator-Tools-Team) * [[phab:project/view/7213/|Kanban Board]] (Wikidata Integration in Wikimedia projects) * [[phab:project/view/8048/|Kanban Board]] (Wikibase Cloud) * [[phab:project/view/1692/|Kartographer]] (Maps) * [[phab:project/view/1829/|Kartotherian]] (Maps) * [[phab:project/view/4810/|Language]] (KaiOS-Wikipedia-app) * [[phab:project/view/7836/|Language Converter Support]] (Parsoid-Read-Views) * [[phab:project/view/8615/|Language Onboarding (i18n & L10n support)]] (LPL Projects) * [[phab:project/view/8169/|Language overlay]] (MobileFrontend) * [[phab:project/view/8322/|Large Wikipedias]] (Parsoid-Read-Views) * [[phab:project/view/8367/|Legal footer]] (Readers Essential Work) * Logged ** [[phab:project/view/8618/|Logged-out CTA WE 1.8.5]] (FY25-26 Reading Lists) * [[phab:project/view/8422/|Luka Ijo Pimeja Jan]] (Catalyst) * [[phab:project/view/6433/|M1: technical preparation]] (EntitySchema) * [[phab:project/view/6434/|M2: Linking to EntitySchemas in statements]] (EntitySchema) * [[phab:project/view/6435/|M3: EntitySchemas shown as labels instead of ID]] (EntitySchema) * [[phab:project/view/6436/|M4: EntitySchema Termbox standardised]] (EntitySchema) * [[phab:project/view/6437/|M5: Project closure ]] (EntitySchema) * Machine ** [[phab:project/view/4109/|Machine-vision-depicts]] (SDC-Statements) * [[phab:project/view/2952/|Maintainer needed]] (Toolforge-standards-committee) * Map ** [[phab:project/view/1633/|Map-Styles]] (Maps) ** [[phab:project/view/2054/|Maps-data]] (Maps) * [[phab:project/view/6958/|MediaModeration 2.1]] (MediaModeration) * MediaSearch ** [[phab:project/view/5186/|MediaSearch-ImageRecs]] (MediaSearch) ** [[phab:project/view/5014/|MediaSearch-ReleaseCandidate2]] (MediaSearch) * MediaWiki ** [[phab:project/view/2743/|MediaWiki-MultiDC]] (Sustainability) * [[phab:project/view/4947/|mediawiki.widgets]] (MediaWiki-User-Interface) * [[phab:project/view/5769/|Menus 2.0]] (MediaWiki-Core-Skin-Architecture) * [[phab:project/view/7476/|Merge mobile and desktop media viewers]] (Readers Essential Work) * [[phab:project/view/7789/|Metabase]] (WMSE-International-content-partners-2025) * [[phab:project/view/8425/|Metabase]] (WMSE-Content-Partnerships-Hub-2025) * [[phab:project/view/6649/|Microsite]] (Wiki-Highlights) * [[phab:project/view/6087/|Milestone 1: CSS changes to all wikis]] (SDAW-Search-Improvements) * [[phab:project/view/6088/|Milestone 2: QuickView MVP]] (SDAW-Search-Improvements) * [[phab:project/view/6089/|Milestone 3: QuickView mobile]] (SDAW-Search-Improvements) * [[phab:project/view/6090/|Milestone 4: Additional QuickView features]] (SDAW-Search-Improvements) * [[phab:project/view/7679/|Minerva and Vector work consistently]] (Readers Essential Work) * [[phab:project/view/5558/|Misc]] (GitLab) * Mobile ** [[phab:project/view/4737/|Mobile-Prototype]] (Wikipedia-Preview) * [[phab:project/view/8173/|MobileFormatter]] (MobileFrontend) * [[phab:project/view/5654/|MobileFrontend (Editor)]] (MobileFrontend) * [[phab:project/view/3707/|MobileFrontend Special Pages]] (MobileFrontend) * [[phab:project/view/5698/|MVP]] (Wikistories) * [[phab:project/view/8408/|MVP]] (Semantic Search) * [[phab:project/view/5154/|mw.notifications]] (MediaWiki-User-Interface) * MWI ** [[phab:project/view/7584/|MWI-Roadmap]] (MW-Interfaces-Team) ** [[phab:project/view/8627/|MWI-Sprint-31 (2026-04-07 to 2026-04-21)]] (MW-Interfaces-Team) ** [[phab:project/view/8665/|MWI-Sprint-32 (2026-04-21 to 2026-05-05)]] (MW-Interfaces-Team) * National ** [[phab:project/view/6979/|National-Coordinator]] (WMSE-Knowledge-rights-in-Sweden) * [[phab:project/view/3678/|New Features]] (Multi-Content-Revisions) * New ** [[phab:project/view/6277/|New-wikipedia.se]] (WMSE-Wikipedia-for-All-of-Sweden-2022) * [[phab:project/view/8561/|Next quarter]] (ServiceOps new) * [[phab:project/view/7727/|Nordic Museum 2025]] (WMSE-Content-partners-2025) * [[phab:project/view/5631/|Onboarding 🚀]] (Release-Engineering-Team) * [[phab:project/view/7830/|Ongoing Epics]] (Catalyst) * [[phab:project/view/6244/|Operaciones]] (Wikimedia-Small-Projects-User-Group) * [[phab:project/view/4811/|Optimize]] (KaiOS-Wikipedia-app) * [[phab:project/view/8032/|Other]] (LPL Projects) * other ** [[phab:project/view/4255/|other-input-types-on-a-dirigible]] (SDC-Statements) * Other ** [[phab:project/view/3940/|Other-statements-running]] (SDC-Statements) * Overhaul ** [[phab:project/view/4939/|Overhaul-2020]] (AbuseFilter) * [[phab:project/view/4808/|Partnerships]] (The-Wikipedia-Library) * [[phab:project/view/7367/|PatchDemo]] (Catalyst) * [[phab:project/view/7693/|Performance]] (Parsoid-Read-Views) * phabricator ** [[phab:project/view/8682/|phabricator-next]] (Phabricator) * Phase 1 ** [[phab:project/view/5534/|Phase 1 - DiscussionTools support]] (Parsoid-Read-Views) * Phase 2 ** [[phab:project/view/8515/|Phase 2 - Beta feature]] (FY25-26 Reading Lists) ** [[phab:project/view/5535/|Phase 2 - testwiki Main namespace support]] (Parsoid-Read-Views) * Phase 3 ** [[phab:project/view/5536/|Phase 3 - Main namespace of officewiki / mediawiki.org renders with Parsoid]] (Parsoid-Read-Views) * Phase 4 ** [[phab:project/view/5537/|Phase 4 - Parsoid generates metadata needed by core]] (Parsoid-Read-Views) * [[phab:project/view/8643/|Phase out supervisord]] (Quibble) * [[phab:project/view/6607/|Pipeline Services Migration🐤]] (GitLab) * [[phab:project/view/8021/|Planning]] (Editing-team) * [[phab:project/view/8581/|Plovdiv 25]] (Test Platform) * [[phab:project/view/5585/|Priority Backlog 📥]] (Release-Engineering-Team) * [[phab:project/view/5552/|Project Migration]] (GitLab) * [[phab:project/view/7886/|Project start bot]] (WMSE-Development-of-the-association-2025) * Project ** [[phab:project/view/2875/|Project-requests]] (Cloud-VPS) * [[phab:project/view/6511/|Puppet 7.0]] (Puppet) * [[phab:project/view/8340/|Q3 Kanban Board]] (MediaWiki-Platform-Team) * Q4 FS25/26 April 1st ** [[phab:project/view/8625/|Q4 FS25/26 April 1st - June 30st]] (Data-Engineering) * Q4 FY2025 ** [[phab:project/view/8628/|Q4 FY2025-26]] (Machine-Learning-Team) * [[phab:project/view/6472/|Quality Engineering]] (Quality-and-Test-Engineering-Team) * [[phab:project/view/6750/|Quality Tools "Sprint"]] ([Archived]Wikidata Dev Team) * Quota ** [[phab:project/view/2880/|Quota-requests]] (Cloud-VPS) ** [[phab:project/view/4481/|Quota-requests]] (Data-Services) ** [[phab:project/view/4834/|Quota-requests]] (Toolforge) * [[phab:project/view/5988/|R2]] (Wikistories) * [[phab:project/view/6695/|Radar]] (MediaWiki-Platform-Team) * [[phab:project/view/7510/|Radar]] (Test Platform) * [[phab:project/view/7866/|Radar]] (Catalyst) * [[phab:project/view/5320/|Radar]] (Release-Engineering-Team) * [[phab:project/view/7844/|Radar/Epics/Stalled]] (Wikidata-Omega) * [[phab:project/view/3679/|Reactive]] (Multi-Content-Revisions) * [[phab:project/view/7684/|Reading List MVP 3.1 (Intern Research)]] (FY2024-25 KR 3.1 Content Discovery) * [[phab:project/view/6788/|RedWarn Compatibility]] (Ultraviolet) * [[phab:project/view/6768/|Release 0 (Pilot wikis)]] (http-client-hints) * [[phab:project/view/6769/|Release 1 (all production wikis)]] (http-client-hints) * [[phab:project/view/6770/|Release 2 (iteration, increase data collection coverage)]] (http-client-hints) * [[phab:project/view/2943/|Rename]] (Wiki-Setup) * [[phab:project/view/3417/|Reportings]] (WMDE-New-Editors-Banner-Campaigns) * [[phab:project/view/8280/|ResourceLoader]] (MobileFrontend) * [[phab:project/view/5173/|Responsive]] (MonoBook) * [[phab:project/view/6514/|RESTBase Deprecation Roadmap]] (API Platform) * REx Sprint 19 [Q4 Apr 21 ** [[phab:project/view/8663/|REx Sprint 19 [Q4 Apr 21 - May 4]]] (Reader Experience Team) * [[phab:project/view/8519/|Round 32]] (Outreachy) * RW ** [[phab:project/view/2297/|RW-Design-Debt]] (Design) ** [[phab:project/view/2296/|RW-Tech-Debt]] (Technical-Debt) ** [[phab:project/view/3912/|RW-Test-Cases]] (Product-QA) * [[phab:project/view/7614/|Sea Lion Squad]] (Community-Tech) * [[phab:project/view/2523/|Search]] (Phabricator) * [[phab:project/view/5323/|Seen]] (Release-Engineering-Team) * [[phab:project/view/8132/|Simplify MobileFrontend]] (Readers Essential Work) * [[phab:project/view/7694/|Small Size Wikipedias]] (Parsoid-Read-Views) * [[phab:project/view/6419/|SonarCloud Admin]] (Quality-and-Test-Engineering-Team) * [[phab:project/view/8168/|Special:EditWatchlist]] (MobileFrontend) * [[phab:project/view/8167/|Special:MobileOptions]] (MobileFrontend) * [[phab:project/view/7619/|SpiderPig 🕸️]] (Scap) * [[phab:project/view/4380/|Sprint]] (Wikispeech-Jobrunner) * [[phab:project/view/8630/|Sprint 04 (2026/04/08)]] (Wikidata Platform Team) * Sprint 14 (Mar 17 ** [[phab:project/view/8585/|Sprint 14 (Mar 17 - 31)]] (Wikibase Suite Team) * Sprint 15 (Mar 31 ** [[phab:project/view/8607/|Sprint 15 (Mar 31 - Apr 28)]] (Wikibase Suite Team) * Sprint 16 (Apr 28 ** [[phab:project/view/8683/|Sprint 16 (Apr 28 - May 12)]] (Wikibase Suite Team) * Sprint 2025 ** [[phab:project/view/7950/|Sprint 2025-05 Inmagik]] (WMCH-Cassandra) * Sprint 3 (Apr 29 ** [[phab:project/view/8685/|Sprint 3 (Apr 29 - May 12) Q4 25/26]] (Reader Growth Team) * [[phab:project/view/8677/|Sprint 68]] (Wikibase Reuse Team) * Sprint 9 (Nov 25 ** [[phab:project/view/8346/|Sprint 9 (Nov 25 - Dec 9)]] (Wikibase Suite Team) * [[phab:project/view/7212/|Sprint Board]] ([Archived] Wikidata Integrations Team) ** [[phab:project/view/8589/|Sprint Board (Sprint 2 March 23 - April 4)]] (Wikidata Integration in Wikimedia projects) * [[phab:project/view/8612/|Sprint Board (Test)]] (Wikipedia-iOS-App-Backlog) * Sprint Tulip (Apr 13 ** [[phab:project/view/8634/|Sprint Tulip (Apr 13 - May 1)]] (Product Safety and Integrity) * Sprint XXX (May 4 ** [[phab:project/view/8688/|Sprint XXX (May 4 - May 22)]] (Product Safety and Integrity) * [[phab:project/view/8616/|Starter kit MVP]] (LPL Projects) * Statement ** [[phab:project/view/3987/|Statement-and-keyword-search-power-walking]] (SDC-Statements) * [[phab:project/view/8369/|Sunsetting]] (Readers Essential Work) * [[phab:project/view/5551/|Support]] (GitLab) * [[phab:project/view/8305/|Surface content gaps contribution opportunities to engage native speakers in small wikis]] (LPL Projects) * [[phab:project/view/8316/|Swedish Natural History Museum 2025]] (WMSE-Content-partners-2025) * [[phab:project/view/4906/|Tables]] (MediaWiki-User-Interface) * [[phab:project/view/3677/|Tech Debt]] (Multi-Content-Revisions) * Temporary ** [[phab:project/view/2414/|Temporary-UserRights]] (Stewards-and-global-tools) * [[phab:project/view/6415/|Test engineering]] (Quality-and-Test-Engineering-Team) * [[phab:project/view/6420/|Test Infrastructure]] (Quality-and-Test-Engineering-Team) * [[phab:project/view/7738/|The Board]] (Wikidata-Omega) * Third ** [[phab:project/view/5206/|Third-party]] (Editing-team) ** [[phab:project/view/5100/|Third-party]] (Parsoid) * [[phab:project/view/1830/|Tilerator]] (Maps) * [[phab:project/view/8210/|Tracking]] (3D) * [[phab:project/view/8220/|Tracking]] (MediaWiki-extensions-InputBox) * [[phab:project/view/7206/|Tracking]] (Vector 2022) * [[phab:project/view/4905/|Tracking]] (MobileFrontend) * [[phab:project/view/5172/|Tracking]] (Modern) * [[phab:project/view/5174/|Tracking]] (MonoBook) * [[phab:project/view/5175/|Tracking]] (CologneBlue) * [[phab:project/view/4496/|Tracking]] (Vector (legacy skin)) * [[phab:project/view/3769/|Tracking]] (Page-Previews) * [[phab:project/view/4541/|Tracking]] (Editing-team) * [[phab:project/view/3297/|Tracking]] (MinervaNeue) * [[phab:project/view/5099/|Tracking]] (Parsoid) * UI ** [[phab:project/view/4192/|UI-consolidation-on-a-Ferris-wheel]] (SDC-Statements) * [[phab:project/view/8034/|ULS rewrite]] (LPL Projects) * [[phab:project/view/7001/|Update MediaWiki Core to introduce temp accounts]] (Temporary accounts) * [[phab:project/view/6/|Upstream]] (Phabricator) * [[phab:project/view/6429/|Upstream pit of despair 🕳️]] (GitLab) * [[phab:project/view/5667/|v3.0]] (InternetArchiveBot) * [[phab:project/view/8591/|Vector 2022 is responsive on wikifunctions.org]] (Readers Essential Work) * Vue ** [[phab:project/view/7954/|Vue-Rewrite]] (Ultraviolet) * [[phab:project/view/8485/|WE 4.6.13 Encourage Email Verification]] (FY2025-26 WE 4.6 - Account Security) * WE 4.6.4 ** [[phab:project/view/8231/|WE 4.6.4 - 2FA improvements and passkey support]] (FY2025-26 WE 4.6 - Account Security) * [[phab:project/view/8530/|WE 4.6.9 (Passwordless login and passkey promotion)]] (FY2025-26 WE 4.6 - Account Security) * WE1 FY2025 ** [[phab:project/view/8373/|WE1 FY2025-26]] (OKR-Work) * [[phab:project/view/8654/|WE4.10 hCaptcha]] (Bot detection and mitigation) * [[phab:project/view/7755/|WE4.2 hCaptcha account creation trial]] (Bot detection and mitigation) * [[phab:project/view/8213/|WE4.2 hCaptcha editing trial]] (Bot detection and mitigation) * [[phab:project/view/8546/|WE4.6.12 (login form for mobile apps)]] (FY2025-26 WE 4.6 - Account Security) * [[phab:project/view/7422/|Wiki loves earth]] (WMSE-Existing-communities-2024) * [[phab:project/view/7722/|Wiki Loves Earth 2025]] (WMSE-Existing-communities-2025) * [[phab:project/view/8046/|Wiki Loves Earth 2025 in India]] (Wikimedians of Kerala UG) * [[phab:project/view/8490/|Wiki Loves Earth 2026]] (WMSE-Existing-communities-2026) * [[phab:project/view/8493/|Wiki Loves Earth 2026]] (WMSE-Existing-communities-2026) * [[phab:project/view/7723/|Wiki Loves Monuments 2025]] (WMSE-Existing-communities-2025) * [[phab:project/view/8492/|Wiki Loves Monuments 2026]] (WMSE-Existing-communities-2026) * [[phab:project/view/8433/|Wikidata & WikiCommons]] (Parsoid-Read-Views) * [[phab:project/view/7560/|Wikidata Omega Triage]] (wmde-wikidata-tech) * [[phab:project/view/8545/|Wikidata Visibility Initiative]] (Wikidata Integration in Wikimedia projects) * [[phab:project/view/6751/|Wikidata.org Slice]] ([Archived]Wikidata Dev Team) * [[phab:project/view/7843/|Wikifunctions Support]] (Parsoid-Read-Views) * Wikipedia iOS Release FY2025 ** [[phab:project/view/8007/|Wikipedia iOS Release FY2025-26]] (Wikipedia-iOS-App-Backlog) * [[phab:project/view/7692/|Wiktionary]] (Parsoid-Read-Views) * WLM ** [[phab:project/view/6737/|WLM-Italy-WebApp]] (WLM-Italy) * [[phab:project/view/8441/|WMDE Fundraising Tech Design System]] (WMDE-Fundraising-Tech) * WMDE ** [[phab:project/view/3114/|WMDE-Design-Workboard Doing]] (WMDE-Design) * WMF ** [[phab:project/view/4742/|WMF-deployed Build Failure]] (ci-test-error) * WMSE ** [[phab:project/view/5990/|WMSE-Nordic-Museum-2022]] (WMSE-GLAM-2022) * [[phab:project/view/7674/|Work In Progress]] (Content-Transform-Team) * [[phab:project/view/5319/|Yak Shaving 🐃🪒]] (Release-Engineering-Team) * [[phab:project/view/7592/|Zuul upgrade]] (Continuous-Integration-Infrastructure) === Releases === * [[phab:project/view/7392/|Codex 2.0]] * Gadgets ** [[phab:project/view/1634/|Gadgets-2.0]] * MediaWiki ** [[phab:project/view/2239/|MediaWiki-backport-deployments]] * MW ** [[phab:project/view/5796/|MW-1.39-notes]] ** [[phab:project/view/7083/|MW-1.43-notes]] ** [[phab:project/view/6911/|MW-1.43-release]] ** [[phab:project/view/7464/|MW-1.44-notes]] ** [[phab:project/view/7057/|MW-1.44-release]] ** [[phab:project/view/7878/|MW-1.45-notes]] ** [[phab:project/view/7572/|MW-1.45-release]] ** [[phab:project/view/8266/|MW-1.46-notes]] ** [[phab:project/view/8270/|MW-1.46-release]] ** [[phab:project/view/8657/|MW-1.47-notes]] ** [[phab:project/view/8659/|MW-1.47-release]] * [[phab:project/view/1333/|Release]] === Sprints === * Abstract Wikipedia Fix ** [[phab:project/view/5712/|Abstract Wikipedia Fix-It tasks]] * [[phab:project/view/7920/|Android Sprint 2025: 'O'o]] * [[phab:project/view/7918/|Android Sprint 2025: Lunar]] * [[phab:project/view/7923/|Android Sprint 2025: MilkyWay]] * [[phab:project/view/7919/|Android Sprint 2025: N]] * [[phab:project/view/7921/|Android Sprint 2025: Pluto]] * [[phab:project/view/7922/|Android Sprint 2025: Q]] * [[phab:project/view/7924/|Android Sprint 2025: RZA]] * [[phab:project/view/7925/|Android Sprint 2025: Simone Biles]] * [[phab:project/view/7927/|Android Sprint 2025: U]] * [[phab:project/view/7928/|Android Sprint 2025: V]] * [[phab:project/view/7929/|Android Sprint 2025: W]] * [[phab:project/view/7930/|Android Sprint 2025: X]] * [[phab:project/view/7932/|Android Sprint 2025: Y]] * [[phab:project/view/7931/|Android Sprint 2025: Z]] * CEE ** [[phab:project/view/7570/|CEE-Meeting-2025]] * [[phab:project/view/1230/|Elections]] * [[phab:project/view/8668/|Fundraising Sprint Hutch Ado About Nothing]] * [[phab:project/view/8334/|Fundraising Sprint WWaally hoo]] * [[phab:project/view/8475/|Fundraising Sprint: Ball pit]] * [[phab:project/view/8164/|Fundraising Sprint: rich, the]] * [[phab:project/view/8279/|Fundraising Sprint: UTM_key lime pie]] * [[phab:project/view/8383/|Fundraising Sprint: Yabba Dabba Stew]] * [[phab:project/view/8549/|iOS Reading Challenge]] * [[phab:project/view/7602/|iOS Sprint 2025: Bellach]] * [[phab:project/view/7603/|iOS Sprint 2025: Cairo]] * [[phab:project/view/7621/|iOS Sprint 2025: Didcot]] * [[phab:project/view/7622/|iOS Sprint 2025: Egypt]] * [[phab:project/view/7623/|iOS Sprint 2025: Fuerteventura]] * [[phab:project/view/7624/|iOS Sprint 2025: Graubünden]] * [[phab:project/view/7625/|iOS Sprint 2025: Helsinki]] * [[phab:project/view/7626/|iOS Sprint 2025: Istanbul]] * [[phab:project/view/7627/|iOS Sprint 2025: Joanne]] * [[phab:project/view/7628/|iOS Sprint 2025: K]] * [[phab:project/view/7629/|iOS Sprint 2025: Longmont]] * [[phab:project/view/7630/|iOS Sprint 2025: Mineral Wells]] * [[phab:project/view/7631/|iOS Sprint 2025: No]] * [[phab:project/view/7632/|iOS Sprint 2025: Okay, OK]] * [[phab:project/view/8149/|iOS Sprint 2025: Palestine]] * [[phab:project/view/8187/|iOS Sprint 2025: Q]] * [[phab:project/view/8195/|iOS Sprint 2025: R]] * [[phab:project/view/8188/|iOS Sprint 2025: Sprinty McSeddonface in São Paulo]] * [[phab:project/view/8189/|iOS Sprint 2025: Tapajós]] * [[phab:project/view/8190/|iOS Sprint 2025: Useless Loop]] * [[phab:project/view/8191/|iOS Sprint 2025: V]] * [[phab:project/view/8192/|iOS Sprint 2025: W]] * [[phab:project/view/8193/|iOS Sprint 2025: X]] * [[phab:project/view/8194/|iOS Sprint 2025: Y]] * [[phab:project/view/7571/|iOS Sprint: Zaphod]] * [[phab:project/view/4797/|itWikiCon]] ** [[phab:project/view/7480/|itWikiCon-2025]] * [[phab:project/view/7034/|Readers Essential Work]] * Wikimania ** [[phab:project/view/8144/|Wikimania-Hackathon-2026]] * [[phab:project/view/5906/|Wikimedia Wishathon]] * Wikimedia ** [[phab:project/view/8319/|Wikimedia-Hackathon-2026]] * WMA ** [[phab:project/view/8359/|WMA-HackChallenge-2025]] * WMDE ** [[phab:project/view/8497/|WMDE-FUN-Sprint-2026-02-03]] ** [[phab:project/view/8588/|WMDE-FUN-Sprint-2026-03-17]] ** [[phab:project/view/8649/|WMDE-FUN-Sprint-2026-04-14]] ** [[phab:project/view/8680/|WMDE-FUN-Sprint-2026-04-28]] ** [[phab:project/view/8673/|WMDE-TechWish-Sprint-2026-04-27-Multicolor-Potatoes]] * [MWI] FY2025 ** [[phab:project/view/8016/|[MWI] FY2025-26 Q1]] ** [[phab:project/view/8243/|[MWI] FY2025-26 Q2]] ** [[phab:project/view/8394/|[MWI] FY2025-26 Q3]] ** [[phab:project/view/8626/|[MWI] FY2025-26 Q4]] === User projects === * User ** [[phab:project/view/4580/|User-A-NEUN]] * user ** [[phab:project/view/8466/|user-a_smart_kitten]] * User ** [[phab:project/view/2688/|User-Abbe98]] ** [[phab:project/view/3908/|User-abi_]] ** [[phab:project/view/5822/|User-AKlapper]] ** [[phab:project/view/2518/|User-Alicia_Fagerving_WMSE]] ** [[phab:project/view/8092/|User-AMarkossyan-WMF]] ** [[phab:project/view/3418/|User-Amire80]] ** [[phab:project/view/6975/|User-Anna_Jegeus_WMSE]] ** [[phab:project/view/4396/|User-Apap04]] ** [[phab:project/view/2995/|User-ArielGlenn]] ** [[phab:project/view/6905/|User-Atieno]] ** [[phab:project/view/2776/|User-aude]] ** [[phab:project/view/4464/|User-awight]] ** [[phab:project/view/929/|User-bd808]] ** [[phab:project/view/5418/|User-Bongo-Cat]] ** [[phab:project/view/4463/|User-brennen]] ** [[phab:project/view/5317/|User-Carn]] ** [[phab:project/view/3734/|User-CDanis]] ** [[phab:project/view/4198/|User-Cicalese]] ** [[phab:project/view/3381/|User-Cirdan]] ** [[phab:project/view/3588/|User-Daimona]] ** [[phab:project/view/4859/|User-dancy]] ** [[phab:project/view/2384/|User-Daniel]] ** [[phab:project/view/3849/|User-DannyS712]] ** [[phab:project/view/5584/|User-dcaro]] ** [[phab:project/view/5779/|User-dduvall]] ** [[phab:project/view/2187/|User-Dereckson]] ** [[phab:project/view/6581/|User-diegodlh]] ** [[phab:project/view/4377/|User-Dyolf77]] ** [[phab:project/view/6072/|User-EAkinloose]] ** [[phab:project/view/3865/|User-EBernhardson]] ** [[phab:project/view/3075/|User-Eevans]] ** [[phab:project/view/7827/|User-elenorweijmar]] ** [[phab:project/view/2398/|User-Elukey]] ** [[phab:project/view/2517/|User-Eric_Luth_WMSE]] ** [[phab:project/view/4556/|User-Etonkovidova]] ** [[phab:project/view/2668/|User-fgiunchedi]] ** [[phab:project/view/5932/|User-Frostly]] ** [[phab:project/view/8315/|User-Gabor_Kiss_WMSE]] ** [[phab:project/view/4764/|User-gabrielchl]] ** [[phab:project/view/2895/|User-GoranSMilovanovic]] ** [[phab:project/view/1436/|User-greg]] ** [[phab:project/view/4345/|User-HannaLindgren]] ** [[phab:project/view/4003/|User-Harej]] ** [[phab:project/view/3429/|User-herron]] ** [[phab:project/view/2962/|User-Huji]] ** [[phab:project/view/2077/|User-Hydriz]] ** [[phab:project/view/8671/|User-Ida_Nordlander_WMSE]] ** [[phab:project/view/8112/|User-Ida_Ragnarsson]] ** [[phab:project/view/8392/|User-IKhitron]] ** [[phab:project/view/5221/|User-Inductiveload]] ** [[phab:project/view/5804/|User-ItamarWMDE]] ** [[phab:project/view/3076/|User-Jayprakash12345]] ** [[phab:project/view/4357/|User-jbond]] ** [[phab:project/view/2985/|User-Jdlrobson]] ** [[phab:project/view/2563/|User-JeanFred]] ** [[phab:project/view/5436/|User-jeena]] ** [[phab:project/view/4748/|User-Jenny_Brandt_WMSE]] ** [[phab:project/view/3572/|User-jijiki]] ** [[phab:project/view/7214/|User-jnuche]] ** [[phab:project/view/2271/|User-Joe]] ** [[phab:project/view/1763/|User-Johan]] ** [[phab:project/view/2542/|User-John_Cummings]] ** [[phab:project/view/2512/|User-Jopparn]] ** [[phab:project/view/1724/|User-Josve05a]] ** [[phab:project/view/5599/|User-Juan90264]] ** [[phab:project/view/8156/|User-KarinGlasemannWMSE]] ** [[phab:project/view/2946/|User-KartikMistry]] ** [[phab:project/view/3077/|User-Kizule]] ** [[phab:project/view/3735/|User-kostajh]] ** [[phab:project/view/3778/|User-kzimmerman]] ** [[phab:project/view/7418/|User-Lens0021]] ** [[phab:project/view/8450/|User-LeoRudberg]] ** [[phab:project/view/2451/|User-Lokal_Profil]] ** [[phab:project/view/5358/|User-LSobanski]] ** [[phab:project/view/1765/|User-Luke081515]] ** [[phab:project/view/3069/|User-MacFan4000]] ** [[phab:project/view/8424/|User-Marc_Maillard_WMSE]] ** [[phab:project/view/2877/|User-MarcoAurelio]] ** [[phab:project/view/8451/|User-MariaMolander]] ** [[phab:project/view/3490/|User-Marostegui]] ** [[phab:project/view/2896/|User-Matthewrbowker]] ** [[phab:project/view/2079/|User-MBinder_WMF]] ** [[phab:project/view/6483/|User-Mhurd]] ** [[phab:project/view/3749/|User-Michael]] ** [[phab:project/view/4779/|User-MoritzMuehlenhoff]] ** [[phab:project/view/2223/|User-MuhammadShuaib]] ** [[phab:project/view/2222/|User-Nikerabbit]] ** [[phab:project/view/3272/|User-Physikerwelt]] ** [[phab:project/view/7590/|User-ppelberg]] ** [[phab:project/view/4374/|User-PPham]] ** [[phab:project/view/6168/|User-pwangai]] ** [[phab:project/view/4741/|User-QEDK]] ** [[phab:project/view/8553/|User-Raine]] ** [[phab:project/view/5676/|User-Raymond_Ndibe]] ** [[phab:project/view/1725/|User-Reedy]] ** [[phab:project/view/3138/|User-revi]] ** [[phab:project/view/4159/|User-RhinosF1]] ** [[phab:project/view/3508/|User-Rxy]] ** [[phab:project/view/2433/|User-Ryasmeen]] ** [[phab:project/view/5288/|User-Salgo60]] * user ** [[phab:project/view/3979/|user-sbassett]] * User ** [[phab:project/view/8090/|User-SDunlap]] ** [[phab:project/view/2511/|User-Sebastian_Berlin-WMSE]] ** [[phab:project/view/8044/|User-SGautam_WMF]] ** [[phab:project/view/8452/|User-SignekrantzWMSE]] ** [[phab:project/view/5658/|User-Slst2020]] ** [[phab:project/view/7058/|User-SLyngshede-WMF]] ** [[phab:project/view/2921/|User-Smalyshev]] ** [[phab:project/view/4833/|User-Soham]] ** [[phab:project/view/4392/|User-srishakatux]] ** [[phab:project/view/5601/|User-STei-WMF]] ** [[phab:project/view/3341/|User-TArrow]] ** [[phab:project/view/2728/|User-Tgr]] ** [[phab:project/view/3770/|User-TheDJ]] ** [[phab:project/view/2539/|User-TheresNoTime]] ** [[phab:project/view/4289/|User-TheSandDoctor]] ** [[phab:project/view/3107/|User-thiemowmde]] ** [[phab:project/view/5720/|User-Tks4Fish]] ** [[phab:project/view/2196/|User-Tobi_WMDE_SW]] ** [[phab:project/view/2098/|User-Urbanecm]] ** [[phab:project/view/4943/|User-Urbanecm_WMF]] ** [[phab:project/view/6131/|User-vaughnwalters]] ** [[phab:project/view/4832/|User-Vidhi-Mody]] ** [[phab:project/view/7618/|User-Viktoria_Hillerud_WMSE]] ** [[phab:project/view/4302/|User-VisbyStar]] ** [[phab:project/view/2658/|User-WMDE-leszek]] ** [[phab:project/view/3525/|User-xSavitar]] ** [[phab:project/view/1938/|User-zeljkofilipin]] ** [[phab:project/view/2745/|User-Zppix]] === Miscellaneous === * Continuous ** [[phab:project/view/1208/|Continuous-Integration-Config]] * Patch ** [[phab:project/view/32/|Patch-For-Review]] * [[phab:project/view/89/|Trash]] === Bugs === {{/Footer}} 702x6722ki4xbjnzs7uce51nl5txplk Extension:PageTriage/fr 102 345071 8365069 8157890 2026-05-04T07:51:33Z FuzzyBot 451990 Updating to match new version of source page 8365069 wikitext text/x-wiki <languages /> {{Extension |templatemode = |status = stable |type1 = special |type2 = interface |newhook1 = |newhook2 = |username = |author = [[User:Kaldari|Ryan Kaldari]], [[User:Bsitu|Benny Situ]] |description = Facilite la révision et l'approbation des nouvelles pages |image = Extension-PageTriage Special-NewPagesFeed Screenshot.png |imagesize = 300 |version = |update = |version preview = |update preview = |compatibility policy = rel |mediawiki = |php = |composer = |table1 = pagetriage_page |table2 = pagetriage_page_tags |table3 = pagetriage_tags |download = {{WikimediaDownload|phab=EPTR}} |readme = |changelog = |example = [[wikipedia:Special:NewPagesFeed | Special:NewPagesFeed on the English Wikipedia]] |namespace = |tags = |compatibility = |bugzilla = |phabricator = PageTriage |vagrant-role = }} '''PageTriage''' est une extension qui vise à fournir une interface riche en fonctionnalités pour trier les articles nouvellement créés. Il est destiné à remplacer la fonction principale « nouvelle patrouille de page » tout en ajoutant des fonctionnalités supplémentaires pour la révision, le balisage et l'amélioration de nouveaux articles. <span lang="en" dir="ltr" class="mw-content-ltr">It adds a Special:NewPagesFeed page, and a page curation toolbar to new pages for those with the 'patrol' permission.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It was developed by the Wikimedia Foundation's [[Wikimedia_Features_engineering|Features Engineering team]].</span> Pour les détails supplémentaires voir ''[[Page Curation|Page Curation]]''. <span lang="en" dir="ltr" class="mw-content-ltr">An important note is that some of the configuration and code is specific to the English-language Wikipedia's workflows and as it's constructed now the extension is pretty much impossible to internationalise.</span> (Voir [[Phabricator:T50552]].) [[File:Page-Curation-Video.ogv|thumb|An overview of the page curation feature. The interface in the video is outdated but the content remains useful.]] <span id="Installation"></span> <div class="mw-translate-fuzzy"> === Installation === </div> [[File:PageTriage-ListView-Whole.png|thumb|Screenshot of Special:NewPagesFeed as it appeared in 2012]] {{ExtensionInstall |db-update=yes |registration=required |localsettings= }} == Checking for successful install == <div lang="en" dir="ltr" class="mw-content-ltr"> To actually see the extension working: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Create a new page containing just a few sentences of text as an anonymous user. </div> <div class="mw-translate-fuzzy"> * Visitez [[Special:NewPagesFeed]] (Fil des nouvelles pages) </div> La nouvelle page devrait apparaître, marquée comme «&nbsp;{{int|pagetriage-no-categories}}&nbsp;», «&nbsp;{{int|pagetriage-orphan}}&nbsp;», etc. <span lang="en" dir="ltr" class="mw-content-ltr">To see the page curation toolbar:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Login as a user with the 'sysop' permission, or add a group with the "[[Special:MyLanguage/Help:Patrolled_edits|patrol]]" permission, and add some user to that group, and login as that user. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Visit Special:NewPagesFeed </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Now you should see a "{{int|pagetriage-triage}}" button next to the new page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Click this and you should see the page curation toolbar on the new page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Advanced installation == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Additional extensions === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For full functionality, you'll also need to install some additional extensions, although PageTriage works without them. </div> * {{ll|Extension:Echo|Echo}} - Allows users to receive notifications for things like when an article they created has been marked as reviewed. * {{ll|Extension:ORES|ORES}} - In Special:NewPagesFeed, allows filtering by "predicted class" (<code>articlequality</code>: stub, start, c-class, b-class, good, featured) and "potential issues" (<code>draftquality</code>: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because <code>draftquality</code> needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's [[git:mediawiki/extensions/ORES/+/8bd39f26548d58fa8bf6765e1c23f5e3086f1cd4/extension.json#225|extension.json file]]. * {{ll|Extension:WikiLove|WikiLove}} - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily. === Enabling draft namespace === By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php <syntaxhighlight lang="php" copy> // These three settings are optional, and will enable the Articles-for-Creation mode. $wgPageTriageDraftNamespaceId = 118; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft'; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk'; </syntaxhighlight> When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed. By default pages edited in the draft namespace will be "unsubmitted". Articles in the draft namespace can be submitted for review by adding <nowiki>[[Category:Pending_AfC_submissions]]</nowiki> to the draft page. At which point they will show up under "awaiting review". Note the toolbar controlled by the configuration variable '''$wgPageTriageEnableCurationToolbar''' does not show up in the draft namespace. === Cron jobs === To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: <code>cron/updatePageTriageQueue.php</code> == Manual testing == === Special:NewPagesFeed -> Articles for Creation === * Enable draftspace by following the directions above in the section [[#Enabling draft namespace]]. * In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories: ** Unsubmitted: (no category) ** Awaiting review: Category:Pending AfC submissions ** Under review: Category:Pending AfC submissions being reviewed now ** Declined: Category:Declined AfC submissions Note: The Page Curation toolbar does not display for drafts. === ORES === Enwiki has the [[Extension:ORES|ORES extension]] installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure: * Clone Extension:ORES and add <code>wfLoadExtension( 'ORES' );</code> in <code>LocalSettings.php</code> * Add this to <code>LocalSettings.php</code> <syntaxhighlight lang="php" copy> $wgPageTriageEnableOresFilters = true; $wgOresWikiId = 'enwiki'; $wgOresModels = [ 'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ], 'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'sources' => [ 1 ] ] ]; </syntaxhighlight> * Run <code>php maintenance/run.php ./extensions/ORES/maintenance/BackfillPageTriageQueue.php</code> == Determining if a page is reviewed == === Status codes === There are status codes used to track whether a page is reviewed or not. These are the values given when you query <code>patrol_status</code>, <code>ptrp_reviewed</code>, and <code>ptrl_reviewed</code>: * Unreviewed ** 0 - unreviewed * Reviewed ** 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar) ** 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page) ** 3 - autopatrolled (someone with the <code>autopatrol</code> user right created the page, or moved the page from a non-tracked namespace to a tracked namespace) ** no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job) === Via the API === To check the review status of pages using an API query, you can use <code>api.php?action=query&prop=isreviewed</code>. Sample JavaScript code:<syntaxhighlight lang="js" copy> /** * @param {number} pageID The page ID number. A positive number with no commas. */ async isReviewed(pageID) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', pageids: pageID, } ); return response.query.pages[0].isreviewed; } /** * @param {string} title One title. Can include namespace. Example: User:Test */ async function isReviewed(title) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', titles: title, } ); return response.query.pages[0].isreviewed; } </syntaxhighlight> === Via SQL === To check the review status of pages using an SQL query, you need to query the <code>{{ll|Extension:PageTriage/pagetriage page table|pagetriage_page}}</code> table and the <code>ptrp_reviewed</code> field. Follow the directions in [[#Status codes]] to interpret the values of this field. <syntaxhighlight lang="sql" copy> /* By page_id */ SELECT ptrp_reviewed FROM pagetriage_page WHERE ptrp_page_id = 71318376 /* By page_title and page_namespace */ SELECT ptrp_reviewed FROM pagetriage_page JOIN page ON page_id = ptrp_page_id WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces AND page_namespace = 0 </syntaxhighlight> == SQL == === SQL tables === {| class="wikitable" |+ !Name !Prefix !Description !Old entry deletion strategy !Service classes (when refactoring, SQL queries should be moved to here) !Data classes |- |[[Extension:PageTriage/pagetriage page table|pagetriage_page]] |ptrp_ |The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query <code>ptrp_reviewed > 0</code> in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. |All articles deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. |QueueManager, QueueLookup |QueueRecord |- |[[Extension:PageTriage/pagetriage page tags table|pagetriage_page_tags]] |ptrpt_ |Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the <code>pagetriage_tags</code> table. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. |All article metadata deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status. | | |- |[[Extension:PageTriage/pagetriage tags table|pagetriage_tags]] |ptrt_ |A dictionary of page_tags, and their corresponding ID number. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. | | | |} === pagetriage_page_tags === <code>pagetriage_page_tags</code> data is updated by calling <code>ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata()</code>. This is called in the following hooks: * <code>onPageMoveComplete()</code> - runs when moving a page * <code>onLinksUpdateComplete()</code> - runs when saving an edit * <code>onMarkPatrolledComplete()</code> - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user. ==== List of tags ==== The <code>pagetriage_page_tags</code> are as follows: * Author information ** user_id ** user_name - there's a filter where you can type in their username ** user_editcount ** user_creation_date ** user_autoconfirmed ** user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with <code>MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()</code> ** user_bot ** user_block_status * Deletion tags - will display a black trash can icon if marked for deletion ** afd_status ** blp_prod_status ** csd_status ** prod_status * Special:NewPagesFeed red warning text ** category_count - No categories ** linkcount - Orphan ** reference - No citations ** recreated - Previously deleted ** user_block_status - Blocked * Page information ** page_len - size of article, in bytes ** rev_count - number of edits to the article ** snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article * afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined * copyvio - latest revision ID that has been tagged as a likely copyright violation, if any == PHP == <span id="Extension_configuration"></span> === Configuration de l'extension === <span lang="en" dir="ltr" class="mw-content-ltr">The extension is based on the 'patrol' right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For more information about configuring patrolling, see {{ll|Manual:Patrolling}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following configuration variables can be set from your LocalSettings.php file: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">Variable</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Default</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> |- | {{phpi|$wgPageTriageEnableCurationToolbar}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set to false to disable the [[Special:MyLanguage/Page Curation#User Experience: Curation Toolbar|curation toolbar]]</span> |- | {{phpi|$wgPageTriageInfiniteScrolling}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not to use infinite scrolling in the new pages feed</span> |- | {{phpi|$wgPageTriageMaxAge}} |90 | The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true). |- | {{phpi|$wgPageTriageNamespaces}} |NS_MAIN | The namespaces that PageTriage is active in. |- | {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} | {{phpi|false}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set this to true if new, unreviewed articles should be set to noindex.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In other words, if they should not be indexed by search engines until they are reviewed.</span> |} Voir [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/extension.json#698|extension.json]] pour la liste complète des variables de configuration. === API === <div lang="en" dir="ltr" class="mw-content-ltr"> PageTriage adds the following API endpoints which can be used: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">API</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Triggering action</span> |- |pagetriageaction | <span lang="en" dir="ltr" class="mw-content-ltr">Mark a page as reviewed or unreviewed, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to mark a page as reviewed * Using the Page Curation toolbar to mark a page as unreviewed |- |pagetriagelist | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves the list of pages in the queue, and each page's metadata, including their reviewed status.</span> To retrieve one page, you must provide the <code>page_id</code>. To provide multiple pages, you must select one of <code>showreviewed</code>/<code>showunreviewed</code>, and one of <code>showredirs</code>/<code>showdeleted</code>/<code>showothers</code>, or no pages will be returned. |Read | * Loading the Page Curation toolbar (automatically loaded if you have the <code>patrol</code> userright and view a page that is unpatrolled or recently patrolled) * Viewing Special:NewPagesFeed (provides the list of articles) |- |pagetriagestats | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves stats about the number of pages in the queue for use in the header of Special:NewPagesFeed.</span> |Read | * Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer) |- |pagetriagetagcopyvio |Mark an article as a potential copyright violation, and logs the action in Special:Log. |Write | * Marking as a copyright violation by a bot with the <code>copyviobot</code> userright |- |pagetriagetagging | <span lang="en" dir="ltr" class="mw-content-ltr">Add clean-up tags or deletion templates to a page, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to place a maintenance tag on an article * Using the Page Curation toolbar to place a deletion tag on an article |} === Special:Log === The following logs are created by the extension: {| class="wikitable" |+ !Special:Log !<code>log_type</code> !<code>log_action</code> !Description !Notes |- |Page curation log |pagetriage-curation |delete, enqueue, reviewed, tag, unreviewed |Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed | |- |Potential copyright violation log |pagetriage-copyvio |insert |Allows a bot to log potential copyright violations |Doesn't display unless you set {{phpi|$wgPageTriageEnableCopyvio}} to true |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Entry points === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The extension's features can be triggered by various actions: </div> {| class="wikitable" |+ !Entry point type !File location !Notes |- |5 APIs |includes/Api/* | |- |1 special page |includes/SpecialNewPagesFeed.php | |- |20 hooks | * includes/Hooks.php * includes/HookHandlers/UndeleteHookHandler.php * includes/HookHandlers/Schema.php | |- |1 cron job |cron/updatePageTriageQueue.php |runs every 48 hours |- |7 maintenance scripts |maintenance/* |need to be run manually |} Here is a list of some actions and the corresponding entry points they trigger: {| class="wikitable" |+ !Action !Entry points used |- |View Main page | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() |- |Save an edit to the Main page | * Hooks.php -> onRevisionFromEditComplete() * Hooks.php -> onPageSaveComplete() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onLinksUpdateComplete() |- |Type in search box, triggering search suggestions | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onApiMain__moduleManager() |- |View Special:NewPagesFeed | * Hooks.php -> onBeforeCreateEchoEvent() * SpecialNewPagesFeed * ApiPageTriageStats * ApiPageTriageList |- |View an unreviewed article while logged in and having the <code>patrol</code> permission. | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onResourceLoaderGetConfigVars() * Hooks.php -> onDefinedTags() * Hooks.php -> onApiMain__moduleManager() * ApiPageTriageList (by <code>page_id</code>) |} ==== Hooks ==== {| class="wikitable" |+ !File !Group !Hook !Actions it performs |- | rowspan="18" |Hooks.php |Move page |[[Manual:Hooks/PageMoveComplete|onPageMoveComplete]] |Changes patrolled status, updates cache, updates metadata in <code>pagetriage_page_tags</code> table. |- | rowspan="3" |Edit page |[[Manual:Hooks/RevisionFromEditComplete|onRevisionFromEditComplete]] |Handles marking '''redirects that flip to articles''' as unreviewed. [[Deferred updates|DeferredUpdate]]. |- |[[Manual:Hooks/PageSaveComplete|onPageSaveComplete]] |Add '''new articles''' to the New Pages Feed and <code>pagetriage_page</code> table. |- |[[Manual:Hooks/LinksUpdateComplete|onLinksUpdateComplete]] |[[Deferred updates|DeferredUpdate]] of metadata / <code>pagetriage_page_tags</code> table. |- |Every page load |[[Manual:Hooks/ArticleViewFooter|onArticleViewFooter]] | * Turn on '''noindex''' for new, unreviewed articles. * Determine whether to load a '''link for autopatrolled users to unpatrol''' their article * Displays the '''Page Curation toolbar''' on recently created pages. * Create '''"Add to New Pages Feed" toolbox link''' for old articles. |- |[[Help:Patrolled edits]] |[[Manual:Hooks/MarkPatrolledComplete|onMarkPatrolledComplete]] |Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage. |- | rowspan="2" |Blocking and unblocking |[[Manual:Hooks/BlockIpComplete|onBlockIpComplete]] | rowspan="2" |Update article metadata / <code>pagetriage_page_tags</code> when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users. |- |[[Manual:Hooks/UnblockUserComplete|onUnblockUserComplete]] |- | |[[Manual:Hooks/ResourceLoaderGetConfigVars|onResourceLoaderGetConfigVars]] |Adjusts some config vars related to draft namespace ID. |- | rowspan="3" |[[Extension:Echo]] |[[Manual:Hooks/BeforeCreateEchoEvent|onBeforeCreateEchoEvent]] | rowspan="3" |Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed. |- |[[Manual:Hooks/EchoGetDefaultNotifiedUsers|onEchoGetDefaultNotifiedUsers]] |- |[[Manual:Hooks/LocalUserCreated|onLocalUserCreated]] |- |[[Extension:ORES]] |[[Manual:Hooks/ORESCheckModels|onORESCheckModels]] |Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio. |- | rowspan="3" |[[Help:Tags]] |[[Manual:Hooks/ListDefinedTags|onListDefinedTags]] | rowspan="3" |Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage". |- |[[Manual:Hooks/ChangeTagsAllowedAdd|onChangeTagsAllowedAdd]] |- |[[Manual:Hooks/ChangeTagsListActive|onChangeTagsListActive]] |- |API |[[Manual:Hooks/ApiMain::moduleManager|onApiMain__moduleManager]] |Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings. |- | rowspan="2" |Delete or undelete page |[[Manual:Hooks/PageDeleteComplete|onPageDeleteComplete]] |If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache. |- |HookHandlers/ UndeleteHookHandler.php |[[Manual:Hooks/ArticleUndelete|onArticleUndelete]] |If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed. |- |HookHandlers/ Schema.php |SQL |[[Manual:Hooks/LoadExtensionSchemaUpdates|onLoadExtensionSchemaUpdates]] | * The code that installs PageTriage's 4 SQL tables when you run <code>php maintenance/run.php update</code>. * Will also alter schemas from previous versions to match the latest schema. * This is also where all the '''pagetriage_tags''' are hard-coded. |} ==== Cron jobs and maintenance scripts ==== {| class="wikitable" |+ !File !What it does !Why run it? When is it useful? ![[phab:T341431|Safe to delete maintenance script?]] |- |cron/updatePageTriageQueue.php |Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". |Keeps the SQL tables from getting too big. | |- |maintenance/cleanupPageTriage.php |Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. |Fix a bug? [[phab:T321982|T321982]] | |- |maintenance/cleanupPageTriageLog.php |Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log |One time conversion of old log entries to modern format? Logs are now always written in the new format. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/6d9105c020c62d648a4ef6be957297bbc8a6d7d2]. |Probably |- |maintenance/cleanupPageTriagePageTags.php |Remove page from <code>pagetriage_page_tags</code> if they are not in <code>pagetriage_page</code> |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/00a752368e00e0d8b29a4908bfc3bab3096268dd]. |Probably |- |maintenance/DeleteAfcStates.php |Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ab2d8d4a2f9d0f4ff981afaee35a85f33edb5e99]. [[phab:T203184#4592953|T203184#4592953]]. |Probably |- |maintenance/FixNominatedForDeletion.php |Set <code>pagetriage_page.ptrp_deleted</code> if the page is has any <code>pagetriage_page_tags</code> related to deletion (e.g. prod_status, blp_prod_status, etc.) |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ff0c433226300aeba692089b5389435d47feef1e]. [[phab:T202582|T202582]]. |Probably |- |maintenance/populateDraftQueue.php |Add missing Draft namespace pages to the AfC triage queue. |Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/59e1fedffcdafc46722d7231011aee194db9ee08]. | |- |maintenance/updateUserMetadata.php |Former cron job. Update expired user metadata in the <code>pagetriage_page_tags</code> table |[https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/92a675a5f1f2e07cee532ec90fc57eee7f2cd49b]. [[phab:T341432|T341432]]. | |} === NOINDEX === NOINDEX refers to the HTML code <code>&lt;meta name="robots" content="noindex"></code>, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode <code><nowiki>__NOINDEX__</nowiki></code>. When {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in <code>includes/Hooks.php</code>, in the <code>onArticleViewFooter()</code> method. ==== First check ==== * First check: Noindex the page if ALL of the following are true: ** {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is turned on ** Page age is less than {{phpi|$wgPageTriageMaxAge}} (set to 90 days on enwiki) ** Page is in <code>pagetriage_page</code> table<ref>Checked by <code>isPageUnreviewed()</code></ref> ** Page is marked as unpatrolled (ptrp_status = 0) ==== Second check ==== * Second check: If the wikitext has the <code><nowiki>__NOINDEX__</nowiki></code> magic word, noindex the page if ALL of the following are true: ** Page age is less than {{phpi|$wgPageTriageMaxNoIndexAge}} (set to 90 days on enwiki) ** If {{phpi|$wgPageTriageMaxNoIndexAge}} is not null, page is in <code>pagetriage_page</code> table<ref>Checked by <code>isNewEnoughToNoIndex()</code>, if it doesn't exit early due to <code>$wgPageTriageMaxNoIndexAge</code> being <code>null</code>.</ref> The main use case for the <nowiki>__NOINDEX__</nowiki> magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See [https://en.wikipedia.org/w/index.php?search=NOINDEX&title=Special:Search&profile=advanced&fulltext=1&ns10=1 this search]. ==== Is the page in the <code>pagetriage_page</code> table? ==== In regards to the requirement "Page is in <code>pagetriage_page</code> table", there are several ways a for a page to get into this table: * Not been deleted by a PageTriage cron job ** One cron job deletes redirects older than {{phpi|$wgPageTriageRedirectAutoreviewAge}} days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them. ** Another cron job deletes reviewed pages after 30 days of being reviewed * In a namespace that PageTriage is configured to patrol * Isn't an article that is so old it predates the installation of PageTriage == JavaScript == === Directory structure === * /modules/ ** ext.pageTriage.article - related to marking an article as reviewed ** ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar ** ext.pageTriage.init - creates a mw.pageTriage object ** ext.pageTriage.newPagesFeed - Special:NewPagesFeed ** ext.pageTriage.sidebarLink - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates ** ext.pageTriage.toolbar - Page Curation toolbar <!--** ext.pageTriage.toolbar - Page Curation toolbar (Vue version)--> ** ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code ** ext.pageTriage.util - Backbone.js models (article, revision, stats) ** external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore <div lang="en" dir="ltr" class="mw-content-ltr"> === Toolbar === </div> The toolbar has three states: <code>maximized</code>, <code>minimized</code>, and <code>hidden</code>. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu. === External libraries === * front end ** old (moving away from) *** [[w:Backbone.js|Backbone.js]] *** [[w:jQuery|jQuery]] *** jQuery Badge *** jQuery Waypoints *** [[w:jQuery UI|jQuery UI]] *** [[w:Mustache (template system)|Mustache (template system)]] *** [[OOUI]] - used in modules/ext.PageTriage.enqueue ([https://codesearch.wmcloud.org/deployed/?q=oojs&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FPageTriage codesearch]) *** [[w:Underscore.js|Underscore.js]] ** new (moving towards) *** Codex *** [[w:Moment.js|Moment.js]] *** Vue Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, [[phab:T208256|we are interested in replacing these front end libraries]], to make the extension easier to maintain. <span id="Client-side_hooks"></span> === Accroches côté client === ==== mw.hook ==== * <code>ext.pageTriage.toolbar.ready</code> ==== mw.pageTriage.actionQueue ==== <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage provides a specialised action queue system to allow other scripts and gadgets to integrate with it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is similar to <code>mw.hook</code> except that it uses promises.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done using the <code>mw.pageTriage.actionQueue</code> module.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the comments in the {{tmpl|0={{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=$1}}|source code}} for documentation on how the system works.</span> {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">It is [$1 not currently used by any scripts or gadgets on enwiki], but it is used internally by PageTriage.</span> |1=https://en.wikipedia.org/w/index.php?search=%22actionQueue%22&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1&ns2300=1&ns2301=1&ns2302=1&ns2303=1 }} <span lang="en" dir="ltr" class="mw-content-ltr">The actionQueue module is available after the mw.hook <code>ext.pageTriage.toolbar.ready</code> fires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage will give the action queue handler an Object with the following data, in addition to other data as noted below:</span> * <code>pageid</code> — ID de la page en cours de révision. * <code>title</code> — Titre de la page, y compris l'espace de noms. * <code>reviewer</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of who is using PageTriage.</span> * <code>creator</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of the creator of the page.</span> * <code>reviewed</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the page is currently or will be marked as reviewed.</span> <span id="Available_actions"></span> ===== Actions disponibles ===== * <code>delete</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the reviewer tags a page for deletion. The data given to the handler also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An object of all the templates added to the page. The keys are the template title, and the values are an object of metadata, including things like the speedy deletion code.</span> * <code>mark</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the review status of a page is changed. Also includes:</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> * <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when maintenance tags are added to the page. Also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An array of the titles of all templates that were added to the page.</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> <span id="Example"></span> ===== Exemple ===== <div lang="en" dir="ltr" class="mw-content-ltr"> To use the action queue, register a function to be ran when an aforementioned action is fired. PageTriage will wait for any asynchronous code to complete before doing anything else, such as refreshing the page. For example, to edit [[Sandbox]] after a page has been marked as reviewed, you could use: </div> <syntaxhighlight lang="javascript"> $( function () { // You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time. mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) { // Listen for the 'mark' action. queue.add( 'mark', function ( data ) { return new mw.Api().edit( 'Sandbox', function ( revision ) { // Replace 'foo' with the note the reviewer left. return revision.content.replace( 'foo', data.note ); } ); } ); } ); } ); </syntaxhighlight> === Where are preferences stored? === Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is <code>userjs-NewPagesFeedFilterOptions</code>. It is set using <code>mw.Api().saveOption()</code> and read using <code>mw.user.options.get()</code>. This data ends up in the SQL <code>user_properties</code> table. Temporary accounts (IP masking) will not be able to store their preferences. == Installation on WMF wikis == This extension was designed for English Wikipedia. There is interest in changing its code and making it more useful to other wikis ([[phab:T50552]]), however this is challenging from a technical perspective and progress is slow. For now, the following are true: * PageTriage is allowed to be installed on other wikis<ref>https://meta.wikimedia.org/w/index.php?title=Limits_to_configuration_changes&diff=prev&oldid=26121135</ref> (although as of 2024 this hasn't happened yet). * The setting <code>$wgPageTriageEnableExtendedFeatures</code> can be set to <code>false</code> to turn off English Wikipedia-specific features such as maintenance tags and deletion tags in the Page Curation toolbar. * There are concerns that the noindex features (controlled by <code>$wgPageTriageNoIndexUnreviewedNewArticles</code> and <code>$wgPageTriageMaxNoIndexAge</code>) create search engine optimization problems, and these noindex features should not be enabled on new wikis without first discussing it with product manager [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]. * Like most other WMF-deployed extensions, PageTriage supports internationalization, and has its interface [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/i18n/|translated into many other languages]]. <span id="See_also"></span> == Voir aussi == * [[commons:Category:PageTriage extension]] * [[Help:New pages feed]] * [[w:Wikipedia:Page Curation/Help]] == Notes == <references /> {{OnWikimedia}} {{Used by}} [[Category:API extensions{{#translation:}}]] 75tcx5ttessk757m69vkz8l06usl4w2 Extension:NoTOC/ja 102 354502 8365103 6857666 2026-05-04T10:21:19Z FuzzyBot 451990 Updating to match new version of source page 8365103 wikitext text/x-wiki <languages /> {{Unmaintained extension|alternative={{ll|Extension:NoTOCModern}}}} {{Extension code in wiki}} {{Extension |status = unmaintained |type1 = parser |type2 = |hook1 = ParserClearState |hook2 = |username = Frantik |author = Andrew Fitzgerald |description = すべてのページで目次を既定で無効にする |image = |imagesize = |version = 0.1.1 |update = 2013-12-11 |mediawiki = |php = |license = GPL-2.0-or-later |download = [[#Code|コードの節]]を参照してください |needs-updatephp = No |readme = |changelog = |parameters = |tags = |rights = |example = |compatibility = }} '''NoTOC'''は、既定で目次を隠す拡張機能です。 マジックワードの<nowiki>__TOC__</nowiki>は引き続き正常に使用できます。 <span id="Installation"></span> ==インストール== {{ExtensionInstall |download-link=[[#Code|コードをファイルにコピーしてください。]] }} <span id="Code"></span> ==コード== ;NoTOC.php <syntaxhighlight lang="php"> <?php /** * NoTOC extension - Turns off the Table of Contents (TOC) by default on all pages * @version 0.1.1 - 2013/12/11 * * @link https://www.mediawiki.org/wiki/Extension:NoTOC Documentation * @link https://www.mediawiki.org/wiki/Extension_talk:NoTOC Support * * @ingroup Extensions * @package MediaWiki * @author Andrew Fitzgerald (Frantik) * @author Karsten Hoffmeyer (Kghbln) * @copyright (C) 2010 Andrew Fitzgerald * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ // check the call if ( !defined( 'MEDIAWIKI' ) ) { die( 'This file is a MediaWiki extension and thus not a valid entry point.' ); } // provide information $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'NoTOC', 'author' => array( 'Andrew Fitzgerald', '...' ), 'url' => 'https://www.mediawiki.org/wiki/Extension:NoTOC', 'descriptionmsg' => 'notoc-desc', 'version' => '0.1.1' ); // show way to files $wgExtensionMessagesFiles['NoTOC'] = dirname( __FILE__ ) . '/NoTOC.i18n.php'; // register hooks $wgHooks['ParserClearState'][] = 'efMWNoTOC'; // perform purpose function efMWNoTOC($parser) { $parser->mShowToc = false; return true; } </syntaxhighlight> ;NoTOC.i18n.php <syntaxhighlight lang="php"> <?php /** * Internationalization file for the NoTOC extension. * * @licence GNU GPL v2+ * @author Karsten Hoffmeyer (Kghbln) */ $messages = array(); /** English * @author Frantik * @author Kghbln */ $messages['en'] = array( 'notoc-desc' => 'Turns off the Table of Contents (TOC) by default on all pages', ); /** Message documentation (Message documentation) * @author Kghbln */ $messages['qqq'] = array( 'notoc-desc' => '{{desc|name=NoTOC|url=https://www.mediawiki.org/wiki/Extension:NoTOC}}', ); /** German (Deutsch) * @author Kghbln */ $messages['de'] = array( 'notoc-desc' => 'Unterdrückt die automatische Generierung des Inhaltsverzeichnisses', ); </syntaxhighlight> <span id="See_also"></span> ==関連項目== * {{ll|Extension:ForceTocOnEveryPage}} * {{ll|Extension:DeToc}} - この拡張機能では、目次のHTMLを抽出したり、目次を除去したり、目次をページの他のセクションに配置したりすることができます。 [[Category:TOC extensions{{#translation:}}]] fhywtt77nn9lcf2meeamdtj4xkpf33h Extension:NoTOC/es 102 354687 8365102 5910911 2026-05-04T10:21:19Z FuzzyBot 451990 Updating to match new version of source page 8365102 wikitext text/x-wiki <languages /> {{Unmaintained extension|alternative={{ll|Extension:NoTOCModern}}}} {{Extension code in wiki}} {{Extension |status = unmaintained |type1 = parser |type2 = |hook1 = ParserClearState |hook2 = |username = Frantik |author = Andrew Fitzgerald |description = <span lang="en" dir="ltr" class="mw-content-ltr">Turns off Table of Contents by default on all pages</span> |image = |imagesize = |version = 0.1.1 |update = 2013-12-11 |mediawiki = |php = |license = GPL-2.0-or-later |download = <span lang="en" dir="ltr" class="mw-content-ltr">See the [[#Code|code section]]</span> |needs-updatephp = No |readme = |changelog = |parameters = |tags = |rights = |example = |compatibility = }} <span lang="en" dir="ltr" class="mw-content-ltr">The '''NoTOC''' extension hides the table of contents by default.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The magic word <nowiki>__TOC__</nowiki> can still be used normally.</span> <span id="Installation"></span> ==Instalación== {{ExtensionInstall |download-link=[[#Code|<span lang="en" dir="ltr" class="mw-content-ltr">Copy the code into files</span>]] }} <span id="Code"></span> ==Código== ;NoTOC.php <syntaxhighlight lang="php"> <?php /** * NoTOC extension - Turns off the Table of Contents (TOC) by default on all pages * @version 0.1.1 - 2013/12/11 * * @link https://www.mediawiki.org/wiki/Extension:NoTOC Documentation * @link https://www.mediawiki.org/wiki/Extension_talk:NoTOC Support * * @ingroup Extensions * @package MediaWiki * @author Andrew Fitzgerald (Frantik) * @author Karsten Hoffmeyer (Kghbln) * @copyright (C) 2010 Andrew Fitzgerald * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ // check the call if ( !defined( 'MEDIAWIKI' ) ) { die( 'This file is a MediaWiki extension and thus not a valid entry point.' ); } // provide information $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'NoTOC', 'author' => array( 'Andrew Fitzgerald', '...' ), 'url' => 'https://www.mediawiki.org/wiki/Extension:NoTOC', 'descriptionmsg' => 'notoc-desc', 'version' => '0.1.1' ); // show way to files $wgExtensionMessagesFiles['NoTOC'] = dirname( __FILE__ ) . '/NoTOC.i18n.php'; // register hooks $wgHooks['ParserClearState'][] = 'efMWNoTOC'; // perform purpose function efMWNoTOC($parser) { $parser->mShowToc = false; return true; } </syntaxhighlight> ;NoTOC.i18n.php <syntaxhighlight lang="php"> <?php /** * Internationalization file for the NoTOC extension. * * @licence GNU GPL v2+ * @author Karsten Hoffmeyer (Kghbln) */ $messages = array(); /** English * @author Frantik * @author Kghbln */ $messages['en'] = array( 'notoc-desc' => 'Turns off the Table of Contents (TOC) by default on all pages', ); /** Message documentation (Message documentation) * @author Kghbln */ $messages['qqq'] = array( 'notoc-desc' => '{{desc|name=NoTOC|url=https://www.mediawiki.org/wiki/Extension:NoTOC}}', ); /** German (Deutsch) * @author Kghbln */ $messages['de'] = array( 'notoc-desc' => 'Unterdrückt die automatische Generierung des Inhaltsverzeichnisses', ); </syntaxhighlight> <span id="See_also"></span> ==Véase también== * {{ll|Extension:ForceTocOnEveryPage}} * {{ll|Extension:DeToc}} - <span lang="en" dir="ltr" class="mw-content-ltr">This can be used to extract TOC HTML and to remove it or put it in some other section of the page.</span> [[Category:TOC extensions{{#translation:}}]] qmuvq7pcrdq1d08so8fdtmmj5vl91k1 Help:Extension:ParserFunctions/ko 12 358870 8365022 8353938 2026-05-04T06:20:51Z FuzzyBot 451990 Updating to match new version of source page 8365022 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span class="mw-translate-fuzzy">{{ll|Extension:ParserFunctions|nsp=0}}은 미디어 위키에 있는 {{$2|magic words}}기능을 보조하는, 11개의 추가적인 파서 기능을 제공합니다.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> ({{ll|Extension:ParserFunctions/String functions|문자열 함수 목록}}에는 추가적인 파서 함수들을 제공하기 위해 설명되어 있으나 2013년부터 사용되지 않는 몇몇 파서 함수들이 포함된 문서입니다) 모든 파서함수는 다음과 같은 꼴입니다: :<code><nowiki>{{</nowiki>'''#(함수 이름)''': ''매개변수 1'' | ''매개변수 2'' | ''매개변수 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | 종류 ! {{hl1}} | 연산자 |- | {{hl2}} | 그룹화 (괄호) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | 수 | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | 이항 연산자 <code>'''e'''</code> &nbsp; 단항 <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | 단항 | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | 이항 | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | 반올림 | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | 논리 | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} 이 함수는 수학적인 표현을 계산하고 결과값을 리턴합니다. 이 함수는 <code>mw.ext.ParserFunctions.expr</code> 함수를 통해, {{ll|Extension:Scribunto|nsp=0}}에서도 쓸 수 있습니다. :<code><nowiki>{{#expr:</nowiki> ''식'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span class="mw-translate-fuzzy">사용 가능한 연산자는 필요한 것부터 오른쪽에 정리되어 있습니다. 구체적으로 각각의 연산자가 어떻게 작동하는지에 관해서는, [[{{ll|Manual:Expr parser function syntax}}|도움말:연산]]을 참고하세요. 출력되는 결과의 정확성과 작성 방법은 서버가 돌아가는 위키와 사이트에서 사용되는 언어를 작성하는 방식에 따라 다를 수 있습니다.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div class="mw-translate-fuzzy"> [[w:불 논리|참 거짓 연산]]을 이용할 경우 0은 거짓을 반환할 것이고, 음수 또는 양수처럼 0이 아닌 수는 참을 반환할 겁니다. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' 아무 것도 입력하지 않으면 비어있는 문자열이 출력됩니다. 입력값이 무효할 경우 여러 오류 중 하나가 출력됩니다. 이 오류는 <code>[[##iferror|#iferror]]</code>로 파악할 수 있습니다. :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' 앞에 덧셈과 뺄셈을 붙이는 것은 잘못된 입력으로 받아들이는 것이 아닌 유효하며 식은 양수 혹은 음수값을 출력합니다. :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> 이는 그 언어에서만 쓰이는 숫자를 써야하는 언어에서 중요할 수 있습니다. 예를 들어 벵골 숫자는 <nowiki>{{NUMBEROFUSERS}}</nowiki>를 사용하면 ৩০,০৬১를 출력합니다. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <span id="Rounding"></span> === 반올림 === <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | 예시 ! {{hl1}} | 결과 ! {{hl1}} | 반올림이 적용된 방식에 대한 설명 |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || 마지막 자릿수가 5보다 작아 반올림이 적용되지 않았습니다. 이와는 별개로 5는 다섯 자릿수까지만 남긴다는 뜻입니다. (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || 마지막 자릿수가 5보다 같거나 클 경우 반올림이 적용됩니다. 마찬 가지로 5는 다섯 자릿수까지만 남긴다는 뜻입니다. (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || 이해를 돕기 위한 다른 예시로, 반올림되어 숫자가 10이 되는 경우 소수는 끝자리의 0을 생략하므로 표시되지 않습니다. (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || -2라는 음수로 설정하여 소숫점으로부터 왼쪽으로 두 자릿수까지 반올림된 모습입니다. |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || 양수로 2를 설정하여 소숫점 오른쪽으로 두 자릿수까지 반올림된 모습입니다. |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || 소수로 반올림 자릿수를 지정할 경우 그냥 정수값으로 적용됩니다. |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || 버림, 즉 '''trunc'''을 이용하여 소수점 표기를 생략합니다. |- ! colspan=3 {{hl2}} | 소수가 없는 정수로의 변환 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || 소수 자리가 5보다 작아 반올림으로 0이 되었습니다. |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || 소수 자리가 5보다 커서 반올림으로 1이 되었습니다. |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || 소수 자리가 5보다 커서 반올림으로 1이 되었습니다. |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || 음수로 소수 자리가 -5보다 작아서 반올림으로 -0이 되었습니다. |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || 음수로 소수 자리가 -5보다 커서 반올림으로 -1이 되었습니다. |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || 음수로 소수 자리가 -5보다 커서 반올림으로 -1이 되었습니다. |- ! colspan=3 {{hl2}} | 올림 혹은 내림 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || 올림을 이용해 1을 만들었습니다. |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || 내렴을 이용해 0을 만들었습니다. |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || 올림을 이용해 -0을 만들었습니다. |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || 내림을 이용해 -1을 만들었습니다. |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || 괄호가 있어야 적용됩니다.<br />{{Warning|1=이렇게 쓸 경우 시스템은 '''ceil('''1/3''')'''이 아닌 '''(ceil''' 1''')'''/3로 해석합니다.}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <span id="Strings"></span> === 문자열 자료형 === 표현식은 오직 숫자 자료형만 받습니다. 문자열 자료형이나 문자 자료형은 비교할 수 없습니다. 따옴표를 쓴 "1"도 문자열입니다. 이 경우 [[#ifeq]]를 사용하셔야 합니다. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 테스트 문자열 | value if test string is not empty | value if test string is empty (or only white space)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: 첫 번째 변수 | 두 번째 변수 | 세 번째 변수 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' 이 함수는 여러 경우에 대해 하나의 입력 값을 비교하여 같은 값일 경우 연관된 문자열을 반환합니다. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} 예제: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <nowiki>#</nowiki>switch를 <code><nowiki><onlyinclude /></nowiki></code> 등 [[Transclusion/ko#문서 끼워넣기|끼워넣기 태그]]와 사용하는 것은 틀 제작 및 편집에 익숙치 않은 사용자가 값들을 확인하고 편집할 수 있도록 도와주고 가독성을 지원하는 설정 파일에 영향을 줄 수 있습니다. 끼워넣기 태그와 함께 사용하는 것을 피하세요. <span id="Default"></span> === 기본값 === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Example: </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === #ifeq 대체 === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | 코드 ! {{hl1}} | 설명 ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Year</span> |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">4-digit year.</span> | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Month</span> |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour</span> |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| 분과 초 |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === 공백 제거 === <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == 같이 보기 == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] mnl3tjkxfozhw1gewcvkhwayk27mp09 Help:Extension:ParserFunctions/gl 12 364383 8365013 8353930 2026-05-04T06:20:26Z FuzzyBot 451990 Updating to match new version of source page 8365013 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span class="mw-translate-fuzzy">A extensión {{ll|Extension:ParserFunctions|nsp=0}} fornece once funcións sintácticas adicionais para estender as "{{$2|palabras máxicas}}", que xa forman parte de MediaWiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">(It ''may'' be configured to provide additional parser functions for string handling; these are only available to non-Wikimedia Foundation wikis hence these string functions are documented {{ll|Extension:ParserFunctions/String functions|elsewhere}}.)</span> Tódalas funcións sintácticas definidas nesta extensión asumen o seguinte paradigma: :<code><nowiki>{{</nowiki>'''#nomedafunción''': ''parámetro 1'' | ''parámetro 2'' | ''parámetro 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipo ! {{hl1}} | Operadores |- | {{hl2}} | Agrupación (parénteses) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | Operador binario <code>'''e'''</code> &nbsp; unario <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unarios | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binarios | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arredondamento | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lóxicos | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Esta función calcula a expresión matemática e devolve o seu resultado. <span lang="en" dir="ltr" class="mw-content-ltr">This function is also available in {{ll|Extension:Scribunto|nsp=0}} via the <code>mw.ext.ParserFunctions.expr</code> function.</span> :<code><nowiki>{{#expr:</nowiki> ''expresión'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span class="mw-translate-fuzzy">Os operadores dispoñibles son clasificados á dereita, en orde de precedencia. Véxase [[{{ll|Manual:Expr parser function syntax}}|Axuda:Cálculo]] para máis detalles da función de cada operador. A precisión e o formato do resultado devolto cambiará a depender do sistema operativo do servidor correndo a wiki, e o formato de número da linguaxe do sitio.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div class="mw-translate-fuzzy"> Cando avaliar usando [[:gl:Álxebra de Boole|álxebra booleana]], o valor cero é avaliado coma <code>false</code> (falso) e calquera valor distinto de cero, positivo ou negativo, é avaliado coma <code>true</code> (verdadeiro): </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Unha expresión de entrada baleira retorna un valor string baleiro. Expresións inválidas retornan unha das varias mensaxes de erro, que poden ser capturadas usando a función <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' A orde de operandos de adición e subtracción antes ou despois de un número é significativa, podendo este ser tratado coma un valor positivo ou negativo en lugar dun operando cunha entrada errónea: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span class="mw-translate-fuzzy">Nótese que, cando se utiliza a saída das palabras máxicas, débese formatalos en raw, para eliminar as comas e traducir os números. Por exemplo $numberofusers resulta dentro $nou-result, na que se quer $nou-result-raw, cal pode ser obtido utilizando $numberofusers2. Isto é especialmente importante nalgunhas linguas, nas que os números son traducidos. Por exemplo, en bengalí, $numberofusers3 produce $bengali.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=O operador <code>mod</code> devolve resultados equivocados para algúns valores do segundo parámetro: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (retorna un valor baleiro de string; cando debería devolver 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span class="mw-translate-fuzzy">Se o desiderátum for facer cálculos baseados en datas (ex. test se a data e hora actual está despois dalgunha outra data e hora), primeiro, débese converter a hora para contar os segundos despois de 1 de xaneiro de 1970 utilizándose <nowiki>{{#time: xNU }}</nowiki>, entón pódese simplemente sumar e subtraer datas coma números.</span>}} <span id="Rounding"></span> === Arredondamento === [https://php.net/function.round Redondea] o número á esquerda a un múltiple de 1/10 elevado a unha potencia, co expoñente igual ó valor truncado do número á dereita. Para redondear para cima ou para baixo débese usar os operadores unarios <code>ceil</code> ou <code>floor</code>, respectivamente. {| class="wikitable" ! {{hl1}} | Caso de test ! {{hl1}} | Resultado ! {{hl1}} | Medio de arredondamento |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || Se o díxito final for < 5, ningún arredondamento aparente acontece (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || Se o díxito final é >= 5, redondease cara arriba (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Outra vez, o resultado é redondeado no último díxito, que sucede nun redondeado adicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Redondeado cara máis preto de 100 porque valores negativos redondéanse á esquerda do punto decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Redondeado cara o cento máis preto, porque valores positivos redodéanse á dereita do punto decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Os decimais no índice redondeado non significan ningunha diferenza no resultado redondeado |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Porción decimal truncada (cortada) |- ! colspan=3 {{hl2}} | Redondeando ó enteiro máis preto |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Reducido cara o enteiro "máis preto", que é cero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Aumentado cara o enteiro máis preto, que é un |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Aumentado cara o enteiro máis preto, que é un |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Aumentado cara o enteiro máis preto, que é cero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Reducido cara o enteiro máis preto, que é un negativo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Reducido cara o enteiro máis preto, que é un negativo |- ! colspan=3 {{hl2}} | Redondeamento cara arriba ou baixo con "ceil" e "floor" |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Aumentado cara o próximo enteiro "meirande", que é un |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Reducido cara o próximo entero "máis pequeno", que é cero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Aumentado cara o próximo enteiro meirande, que é cero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Reducido cara o próximo entero máis pequeno, que é un negativo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Non se redondea porque 1 xa é enteiro<br />{{Warning|1=Interpretado coma '''(ceil''' 1''')'''/3 e non coma '''ceil('''1/3''')''', como se podería esperar}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Strings === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Esta función avalía un string de test e determina se está baleiro ou non. Considérase que un string de test que posúe soamente espazo en branco está baleiro. :<syntaxhighlight lang="wikitext" inline>{{#if: string de test | retorno se string de test é non baleiro | retorno se string de test é baleiro (ou contén soamente espazos en branco)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primeiro parámetro | segundo parámetro | terceiro parámetro }}</syntaxhighlight> Esta función primeiro proba se o primeiro parámetro non está baleiro. Se tal non está baleiro, a función mostra o segundo. Se o primeiro parámetro está baleiro ou contén soamente caracteres en branco (espazos, quebra de liña etc.), móstrase o terceiro. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div class="mw-translate-fuzzy"> String de test é sempre interpretado coma texto puro, así expresións matemáticas non son analizadas: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' O último parámetro (false) pode omitirse: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' A función pode ser agrupada. Para facer así, poña completamente a función #if interior no lugar do terceiro parámetro da función #if que se encerra. Ata sete niveis de agrupamento é posible, aínda que iso pode depender da wiki ou do límite de memoria. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:string de test | retorno se string de test é non baleiro |{{#if:test string |value if test string is not empty |retorno se string de test é baleiro (ou contén soamente espazos en branco) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} Véxase {{ll|Help:Parser functions in templates}} para máis exemplos desta función. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Esta función de analizador compara dúas cadeas de entrada, determina se son idénticas e devolve unha das dúas cadeas en función do resultado. <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Se ambos os dous strings son valores numéricos válidos, son comparadas numericamente: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' En caso contrario, a comparación é feita coma texto; esta comparación é sensible a letras maiúsculas: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(compare con exemplo similar arriba, sen comiñas)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(compare cun exemplo similar anterior, con <code>[[##expr|#expr]]</code> que devolve primeiro un número válido)'' <span class="mw-translate-fuzzy">Como exemplo práctico, considere un {{ll|Help:Templates|modelo}} existente <code>Template:Timer</code> usando o analizador para escoller entre dúas veces estándar, curta e longa.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> resulta no seguinte: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Cando se usa dentro dunha función de analizador, calquera etiqueta de analizador e outras funcións de analizador deben substituírse temporalmente por {{ll|Strip marker|un código único}}. Isto afecta ás comparacións: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Se strings para seren comparados son dadas coma chamadas iguais ao mesmo {{ll|Help:Templates|modelo}} contendo tales etiquetas, entón a condición é verdadeira, pero no caso de dous modelos con contido idéntico que contén tales etiquetas é tido falso. }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Esta función toma un string de entrada e devolve un de dous resultados. A función toma como <code>true</code> se a string de entrada contén un obxecto de HTML con <code>class="error"</code>, a medida que é xerado por outras funcións sintácticas, coma <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> e <code>[[##rel2abs|#rel2abs]]</code>, erros de [[Special:MyLanguage/Help:Templates|modelos]] coma bucles, recorrencias e outros erros sintácticos de "failsoft". :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">Un ou ambos os strings de retorno poden ser omitidos. Se o string <code>''correcto''</code> é omitido, o <code>''string de test''</code> é devolto se non estiver errado. Se o string <code>''erro''</code> é tamén omitido, un string baleiro é devolto nun erro:</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == Esta función avalía unha expresión matemática e devolve un de dous strings, dependendo do valor binario do resultado: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div class="mw-translate-fuzzy"> A entrada de <code>''expresión''</code> é avaliada exactamente como está por <code>[[##expr|#expr]]</code> arriba, cos mesmos operadores que están dispoñibles. A saída é entón avaliada como sendo unha expresión binaria. </div> Unha expresión de entrada baleira avalía cara {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Como mencionado arriba, cero avalía cara {{phpi|false}} e calquera valor non cero avalía cara {{phpi|true}}, así esta función é equivalente a unha utilizando soamente <code>[[##ifeq|#ifeq]]</code> e <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div class="mw-translate-fuzzy"> agás unha expresión de entrada baleira ou equivocada (unha mensaxe de erro é tratada coma string baleiro; non é igual a cero, así poñemos <code>''value if true''</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparando :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Calquera ou ambos os valores de retorno poden ser omitidos; ningunha saída é dada cando o sitio apropiado é deixado baleiro: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span class="mw-translate-fuzzy"><code>[[##ifexpr|#ifexpr]]</code> non informa de comparacións numéricas equivalentes cos analizadores <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Debido a que PHP usado en <code>[[##ifeq|#ifeq]]</code> e <code>[[##switch|#switch]]</code> compara dous números de tipo enteiro, devolve correctamente o resultado esperado. <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> Este comportamento en <code>[[##ifexpr|#ifexpr]]</code> é causado porque MediaWiki converte os números literais en expresións en tipo float, o que, para enteiros grandes coma estes, implica redondeo.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} Esta función toma un string de entrada, interprétao coma un título de páxina, e devolve un de dous valores, dependendo se páxina existe na wiki local ou non. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">A función avalía coma <code>true</code> (verdadeiro) se a páxina existe, se contén contido, está visiblemente baleiro (contén meta-datos como ligazóns de categoría ou {{ll|Help:Magic words|palabras máxicas}}, pero ningún contido visible), está baleira, ou é unha {{ll|Help:Redirects|redirección}}. Soamente páxinas que son ligazóns vermellas avalían cara falso (<code>false</code>), incluíndo se a páxina existía mais foi borrada.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div class="mw-translate-fuzzy"> A función trata coma <code>true</code> (verdadeiro) para [[ll|Help:System message|mensaxes de sistema]] que foron personalizadas, e para [[ll|Help:Special pages|páxinas especiais]] que son definidas polo software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (porque a extensión {{ll|Extension:Checkuser|nsp=0}} está instalada nesta wiki) | '''doesn't exist''' (porque a {{ll|Extension:Checkuser|nsp=0}} non está instalada nesta wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (porque [[{{ns:8}}:Copyright]] foi personalizado) | '''doesn't exist''' (porque [[{{ns:8}}:Copyright]] non foi personalizado) }} <span class="mw-translate-fuzzy">Se unha páxina comproba un destino utilizando <code>#ifexist:</code>, entón tal páxina aparecerá na lista {{#special:WhatLinksHere}} para a páxina de destino. Así se o código <code><nowiki>{{#ifexist:Foo}}</nowiki></code> foi incluído en tempo de execución nesta páxina ({{FULLPAGENAME}}), {{#special:WhatLinksHere}}/Foo listará {{FULLPAGENAME}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> En wikis que utilizan un repositorio compartido de medias, <code>#ifexist:</code> pode ser utilizada para comprobar se un arquivo foi cargado ó repositorio, pero non á wiki ''de per se'': :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' Se unha páxina de descrición local foi creada para o arquivo, o resultado é '''existe''' para tódolos ítens arriba. <code>#ifexist:</code> non funciona con ligazóns de interwiki. <span id="ifexist_limits"></span> === Limites de ifexist === <code>#ifexist:</code> é considerada unha "función sintáctica custosa"; soamente unha cantidade limitada dela pode ser incluída nalgunha unha páxina (incluíndo funcións dentro de modelos translucidos). Cando este límite é superado, calquera outra función <code>#ifexist:</code> automaticamente devolve falso, se a páxina de destino existe ou non, e a páxina é clasificada en [[:Category:{{MediaWiki:expensive-parserfunction-category}}]]. O nome da {{ll|Help:Tracking categories|tracking category}} pode variar dependendo da lingua do contido da wiki. <span class="mw-translate-fuzzy">Nalgúns casos de é posíbel emular o efecto de ifexist con CSS, usando os selectores <code>a.new</code> (para seleccionar as ligazóns das páxinas inexistentes) ou <code>a:not(.new)</code> (para seleccionar as ligazóns páxinas existentes).</span> <span class="mw-translate-fuzzy">Ademais, porque a cantidade de funcións sintácticas custosas que poden ser utilizadas nunha soa páxina é controlada por <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, pódese aumentar este límite en LocalSettings.php, se for preciso.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == Esta función converte un camiño de arquivo relativo nun absoluto. :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> Dentro da entrada de <code>path</code>, a sintaxe s seguir é válida: *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> Se non se especifica <code>base path</code>, utilizarase no seu lugar o nome da páxina completa: :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' Sintaxe errónea, coma <code>/.</code> ou <code>/./</code>, é ignorada. Vez que non máis que dous puntos consecutivos son permitidos, secuencias coma estas poden ser utilizadas para separar declaracións sucesivas: :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' Esta función proba un valor de entrada contra varios casos de test, devolvendo unha cadea asociada se unha correspondencia é atopada. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemplos: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Estándar === O <code>''resultado estándar''</code> é devolto se ningún string dos <code>''casos''</code> combina có <code>''string de comparación''</code>: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' Nesta sintaxe, o resultado estándar debe ser o último parámetro e non debe conter un sinal de igual puro (un signo igual sen <code><nowiki>{{}}</nowiki></code>). <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> Alternativamente, o resultado estándar pode ser explicitamente declarado cun string de <code>''case''</code> para "<code>#default</code>". {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Un resultado estándar declarado desta forma pode ser posto en calquera sitio dentro da función: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' Se o parámetro <code>''default''</code> (estándar) é omitido e ningunha correspondencia é atopada, ningún <code>''result''</code> (resultado) é devolto: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupando resultados === É posible ter valores 'malogrados', cando varias strings de <code>''case''</code> devolven a mesma cadea de <code>''result''</code> (resultado). Isto minimiza duplicación. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Aquí, os casos 2, 3 e 4 todos devolven <code>''result234''</code>; ambos os casos 6 e 7 devolven <code>''result67''</code> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Comportamento de comparación === Tal como con <code>[[##ifeq|#ifeq]]</code>, a comparación é feita numericamente se tanto o string de comparación coma o string de caso so proba son numéricas; ou como string sensible a letras maiúsculas doutra forma: :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' O string de <code>''case''</code> pode ser baleiro: :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' Unha vez unha correspondencia é atopada, os <code>''cases''</code> (casos) seguintes son ignorados: :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= As comparacións numéricas con <code>[[##switch|#switch]]</code> e <code>[[##ifeq|#ifeq]]</code> non son equivalentes ás comparacións en expresións (véxase arriba tamén): :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <span id="Raw_equal_signs"></span> === Sinais de igual puros === <div class="mw-translate-fuzzy"> Strings de "caso" non poden conter sinais de igual puros. Para contornar isto, débese crear un modelo $tpl contendo un sinal de igual simple: $code1 ou substitúe signo igual por código html <code><nowiki>&amp;#61;</nowiki></code>. </div> Exemplo: {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span class="mw-translate-fuzzy">Para un simple exemplo factual do uso desta función, vexa [$enwp-nba-color Template:NBA color]. Dous exemplos complexos poden ser atopados en $tpl-ext e [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === Substituíndo #ifeq === <div class="mw-translate-fuzzy"> <code>#switch</code> pode ser utilizado reducir [[Special:MyLanguage/Help:Expansion depth|profundidade de expansión]]. </div> Por exemplo: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> é equivalente a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Código ! {{hl1}} | Descrición ! {{hl1}} | Retorno actual <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Limpe o cache desta páxina] para actualizar)</small> |- ! {{hl2}} colspan="3"| Ano |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Ano con catro díxitos | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Ano con dous díxitos. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1, se é ano bisesto; 0, se non. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|Require PHP 5.1.0 e o mais novo e a [[rev:45208]].|group=note}} | Código ISO-8601 do ano da semana especificada.{{#tag:ref|Isto ten o mesmo valor de Y, agás que se o código ISO de semana (W) pertence ao ano anterior ou posterior, tal ano é utilizado polo outro.|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|Sairá literal ''o'' se a nota 1 non se cumpre.|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mes |- | style="text-align: center;" | <code>n</code> | Número do mes, sen cero á esquerda. | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | Número do mes, con cero á esquerda. | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | Abreviatura do nome do mes na lingua do sitio. | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | Nome completo do mes na lingua do sitio. | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | Devolve o nome enteiro de mes na forma do [[w:en:Genitive case|caso xenitivo]] para linguas de sitios que distinguen entre as formas xenitiva e [[w:en:Nominative case|nominativa]]. Esta opción é útil para moitas [[w:en:Slavic languages|linguas eslavas]] coma polaco, ruso, eslovaco, checo, bielorruso, esloveno, ucraíno etc. | style="line-height: 1.6;" | Para polaco:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominativo)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(xenitivo) |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | Día do mes, sen cero á esquerda. | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | Día do mes, con cero á esquerda. | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | Día do ano (Xaneiro&nbsp;1 = 0).<br/>{{note}} Para obter o código ISO do día do ano, sumar 1. | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | Código ISO-8601 do número da semana, con cero á esquerda. | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | Código ISO-8601 do día da semana (luns = 1, domingo = 7) | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | Número do día da hebdómada (domingo = 0, sábado = 6). | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | Abreviatura do día da hebdómada. Raramente internacionalizado. | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | Nome completo do día da semana. Raramente internacionalizado. | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durante a mañá (00:00:00 → 11:59:59), "pm" polo contrario (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span class="mw-translate-fuzzy">Versión en maiúsculas de <code>a</code> arriba.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora no formato de 12 horas, sen cero á esquerda. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora no formato de 12 horas, con cero á esquerda. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora no formato de 24 horas, sen cero á esquerda. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora no formato de 24 horas, con cero á esquerda. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minutos e segundos |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | Minutos pasados nunha hora, con cero á esquerda. | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | Segundos contados nun minuto, con cero á esquerda. | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> Segundos dende 1 de xaneiro de 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fuso horario (des [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fuso horario. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | Se a data é, ou non, durante o horario de verán | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferenza para a hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferenza para a hora de Greenwich (GMT), con dous puntos | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura do fuso horario. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | Desprazamento do fuso horario en segundos. | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversos |- | style="text-align: center;" | <code>t</code> | Números de días no mes actual | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span class="mw-translate-fuzzy">Data no formato ISO-8601, equivalente a <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span class="mw-translate-fuzzy">Data no formato [[rfc:5322|RFC 5322]], equivalente a <code>D, j M Y H:i:s +0000</code>, co nome do día da semana e co nome do mes non internacionalizados.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendarios non gregorianos |- ! {{hl3}} colspan="3" | Islámico |- | style="text-align: center;" | <code>xmj</code> | Día do mes | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nome completo do mes | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Número do mes. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Ano completo. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraniano (Jalaly) |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Día do mes | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nome completo do mes | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Número do mes. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Ano completo | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Ano con dous díxitos. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreo |- | style="text-align: center;" | <code>xjj</code> | Día do mes | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nome completo do mes. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Número de días no mes. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma xenitiva do nome de mes. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número do mes | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Ano completo | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendario solar tailandés |- | style="text-align: center;" | <code>xkY</code> | Ano completo no [[w:Thai solar calendar|calendario solar tailandés]].<br />{{note}} Para os anos antes de 1941 as datas na escala Jan-Mar non son ben [[w:Thai_solar_calendar#New_year|calculadas]]. | {{#time:xkY}} |- ! {{hl3}} colspan="3" | Ano Minguo/Juche |- | style="text-align: center;" | <code>xoY</code> | Ano completo. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | Calendario xaponés (nengo) |- | style="text-align: center;" | <code>xtY</code> | Ano completo. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | Flags |- | style="text-align: center;" | <code>xn</code> | Formata o seguinte código numérico coma número de ASCII puro. | Na lingua hindú, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> fai ०६, 06. |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span class="mw-translate-fuzzy">Coma <code>xn</code>, pero como unha flag alternada, que dura ata o fin do string ou ata a seguinte aparición de <code>xN</code> no string.</span> |- | style="text-align: center;" | <code>xr</code> | Formata o número seguinte coma número romano. Soamente funciona para números ata 10.000<br /><small>(ata 3.000 antes de MediaWiki 1.20)</small>. | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | Formata o número seguinte en números hebreos. | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} Esta función sintáctica toma unha data e/ou hora (no calendario gregoriano) e formata conforme a sintaxe dada. Un obxecto de data/hora pode ser especificado; o estándar é o valor da [[Special:MyLanguage/Help:Magic words#Date and time|palabra máxica]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; é dicir, a hora na que a páxina foi por último traducída en HTML. :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> A lista de códigos de formato aceptados é dada na táboa á dereita. Calquera carácter na texto so formato que non é recoñecida é pasado completamente inalterado; isto aplícase para tamén borrar espazos (o sistema non os necesita para interpretar os códigos). <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> Hai tamén dúas formas de escaparse de carácteres dentro do texto formato: # <span class="mw-translate-fuzzy">#Unha barra invertida seguido por un carácter é interpretado exactamente coma un único carácter</span> # <span class="mw-translate-fuzzy">#Caracteres entre comiñas son considerados caracteres literais, e as comiñas son sacadas.</span> Ademais, o dígrafo <code>xx</code> é interpretado como un só carácter "x". <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' O <code>''código da lingua''</code> en [[w:en:ISO 639-3|ISO 639-3]] (?) permite mostrar o texto na lingua escollida :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div class="mw-translate-fuzzy"> Se xa se calculou un data e hora en Unix, pódese utilizar esta forma de cálculo en operacións con data preto coa anteposición do símbolo <code>@</code>. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= O intervalo de entrada aceptable é 1 de xaneiro de 0111 ata 31 de decembro de 9999. Para os anos de 100 a 110 a saída é incoherente, Y e anos bisestos son coma os anos 100-110, r, D, l e U son coma interpretar estes anos coma 2000-2010. :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> (correcto, ano común), pero :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' (erróneo, aínda que o ano 100 sexa interpretado coma 2000, pois é un ano bisesto) :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' Os números do ano 0-99 interprétanse como 2000-2069 e 1970-1999, excepto cando se escriben en formato de 4 díxitos con ceros ao principio: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) O día da hebdómada é soportado para os anos entre 100 e 110 e des 1753. Para os anos entre 111 e 1752 o retorno á dereita mostra "Unknown" e o da esquerda, "<>". Como consecuencia, o retorno á dereita non é aceptado para entrada destes anos. }} Datas absolutas completas ou non poden ser especificadas; a función "completará" as partes da data que non son dadas, utilizándose dos valores ''actuais'': :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= O recurso de complemento non é consistente. Algunhas partes son cubertas cos valores actuais; outras, non: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' Devolve o comezo do día, pero para o día presente do mes e do ano actuais. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' Devolve o comezo do día, pero para o presente día do ano actual. <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} Un número de catro díxitos será interpretado coma un ano, endexamais coma hora e minutos:<ref>Antes de {{rev|86805}} en 2011 este non era o caso.</ref> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' Un número de seis díxitos é interpretado coma horas, minutos e segundos, se posíbel, pero, por outra banda, coma un erro (non, por exemplo, un ano e un mes): :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' A entrada é tida coma unha hora máis do que un código de ano+mes. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' Aínda que 19:60:09 non sexa unha hora válida, 196009 non é interpretado coma setembro de 1960. A función realiza un certo número de operacións con data: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span class="mw-translate-fuzzy">A achura total do textos de formato das chamadas de $time é limitada a 6000 caracteres [https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/ParserFunctions.git;a=blob;f=ParserFunctions_body.php;hb=HEAD].</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Choiando con fusos horarios ==== <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} Para contornar esta situación, pódese converter o tempo en minutos ou segundos, así: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} (Tim Starling, o desenvolvedor desta función, forneceu a sintaxe exacta para esta solución.) <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == Esta función divide o título da páxina en segmentos baseados no carácter de barra, entón devolve algúns deses segmentos. : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div class="mw-translate-fuzzy"> Valores negativos son aceptados para ambos os valores. Valores negativos para <code>number of segments</code> decotan efectivamente segmentos do fin do texto. Valores negativos para <code>first segment</code> traduce para "empezar con este segmento contando da dereita": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' Elimina un segmento do fin do string. Véxase tamén {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' Elimina os 4 segmentos do fin do string : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' Elimina 5 segmentos do fin do string (máis do que existen) : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' Devolve o último segmento. Véxase tamén {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' Elimina un segmento do fin do string, entón devolve do segundo segmento en diante : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' Empeza a copiar no segundo último elemento; extrae un segmento do fin do string <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # O texto de entrata posúe o límite de 25 cortes; as barras a máis son ignoradas e o 25º elemento conterá o resto do texto. O texto é tamén limitado a 255 caracteres, e é tratado como un [[Special:MyLanguage/Manual:Page table#Schema summary|título de páxina]]: #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: Se por calquera razón necesítase forzar esta función ó seu límite, aínda que moi improbable, é posible contornar o límite de 25 cortes agrupándose unha función dentro doutra: #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= Pódese utilizar #titleparts como un pequeno "texto analítico e conversor", mais débese considerar que devolve a primeira parte capitalizada. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' Se letras minúsculas son imprescindíbeis, débese usar a función lc: para axustar o retorno. : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span class="mw-translate-fuzzy">Certos caracteres que son ilegais nun título de páxina farán con que #titleparts non analice o string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Non retorna o resultado esperado: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span class="mw-translate-fuzzy">Esta función non se degrada ordinariamente se a súa entrada supera 255 carácteres. Se o texto for maior que 256 caracteres, esta función sinxelamente retornará o mesmo texto.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Aspectos xerais == <span id="Substitution"></span> === Substitución === As funcións sintácticas poden ser [[Special:MyLanguage/Help:Substitution|substituídas]] engadindose o termo <code>'''subst:'''</code> antes do carácter #; :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → o código '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' será engadido no texto wiki se a páxina {{FULLPAGENAME}} existir. {{Warning|1= Os resultados das funcións sintácticas substituídas son indefinidos se as expresións conteñen código volátil '''non''' substituído, coma {{ll|Help:Magic words#Variables|variables}} ou outra función. Para resultados coherentes, débese substituír todolo código volátil na expresión so avaliación. Véxase [[w:Help:Substitution|Axuda:Substitución]].}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <span id="Redirects"></span> === Redireccións === <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <span id="Escaping_pipe_characters"></span> <div class="mw-translate-fuzzy"> === Elidindo o carácter de barra vertical en táboas === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> As funcións sintácticas estragarán as sintaxe de {{ll|Help:Tables|táboas wiki}} e caracteres de barra vertical (<code><nowiki>|</nowiki></code>), tratando tódolas barras verticais coma divisores de parámetros. <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> Isto 'esconde' a barra vertical da sintaxe MediaWiki, asegurando que non será considerado ata que despois de todo os modelos e variables sobre unha páxina sexan expandidos. Será entón interpretado coma unha liña de táboa ou divisor de columna. Alternativamente, o código de táboa en HTML puro pode ser utilizado, aínda que isto sexa menos intuitivo e máis propenso de erro. <div class="mw-translate-fuzzy"> Pódese tamén escaparse do carácter de barra vertical, para mostralo coma un carácter simple non interpretado, utilizando unha entidade de carácter HTML: <code>&amp;#124;</code>. </div> {| class="wikitable" ! Descrición ! Escribíndose ! Obtense |- | Elidindo o carácter de barra vertical coma divisor de liña/columna | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | Elidindo o carácter de barra vertical coma un carácter simple | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Eliminación de espazos en branco === Espazos en branco, incluíndose os caracteres de liña nova, tabuladores e espazo, son elididos antes e despois de cada un dos parámetros das funcións sintácticas. Para impedir que tal suceda, as comparacións de texto poden ser feitas engadindo comiñas. :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div class="mw-translate-fuzzy"> Pero este método soamente permite a interpretación de '''un''' espazo en branco, pois a función sintáctica reduce espazos múltiples a un só. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div class="mw-translate-fuzzy"> Neste exemplo, o estilo <code>white-space: pre</code> é utilizado para formar con que os espazos en branco sexan preservados polo navegador, aínda así os espazos non son mostrados. Isto sucede porque os espazos son eliminados polo software, antes de envialos ó explorador. </div> <div class="mw-translate-fuzzy"> É posíbel contornar este comportamento cambiando espazos en branco por <code>&amp;#32;</code> (carácter de espazo, ou ''espazo crebadizo'') ou <code>&amp;nbsp;</code> (espazo sen quebra, ou ''espazo ríxido''), pois non son modificados polo software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Véxase tamén == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] o2dct59gg6o59531y7crc7o6lc4ht5z Translations:Category:User interface/Page display title/vi 1198 369958 8364474 1402067 2026-05-03T15:52:53Z Hiyuune 17854348 8364474 wikitext text/x-wiki Thể loại:Giao diện người dùng tm1gq4d6yh19a0il9zyiwdjnktrdmz8 Category:User interface/vi 14 369959 8364476 4886619 2026-05-03T15:53:15Z Hiyuune 17854348 Created page with "Thể loại này chứa các trang liên quan đến giao diện người dùng MediaWiki." 8364476 wikitext text/x-wiki <languages/> Thể loại này chứa các trang liên quan đến giao diện người dùng MediaWiki. [[Category:Manual{{#translation:}}]] [[Category:MediaWiki components{{#translation:}}]] 2aq5bpxvrk2z4qw1bxfqxq3tazvsjwr 8364478 8364476 2026-05-03T15:53:30Z Hiyuune 17854348 8364478 wikitext text/x-wiki <languages/> Thể loại này chứa các nội dung liên quan đến giao diện người dùng MediaWiki. [[Category:Manual{{#translation:}}]] [[Category:MediaWiki components{{#translation:}}]] s6o1595mvxzeywy165l65c18v40mjek Template:Clear/doc 10 370183 8364282 8364281 2026-05-03T12:14:49Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-26935-72|~2026-26935-72]] ([[User talk:~2026-26935-72|talk]]) to last version by Clump 7699688 wikitext text/x-wiki {{Languages|Template:Clear/doc}} {{documentation subpage}} <!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> {{tsh|-|clr}} Shorthand for <syntaxhighlight inline lang="html"><div style="clear: both;"></div></syntaxhighlight>. == TemplateData == {{TemplateData header}} <templatedata> { "description": { "en": "Clear floating block-level elements without line break.", "pt-br": "“Limpar” elementos flutuantes em nível de bloco sem quebra de linha através do parâmetro “clear” do CSS." }, "params": { "1": { "label": { "en": "Clear", "pt-br": "Atributo" }, "description": { "en": "CSS clear: left, right, both, none.", "pt-br": "Atributos do parâmetro clear do CSS: left, right, both, none." }, "default": "both", "type": "string" } }, "format": "inline" } </templatedata> <includeonly>{{Sandbox other|| <!-- Categories below this line; interwikis at Wikidata --> [[Category:Formatting templates{{#translation:}}]] [[Category:Typing-aid templates{{#translation:}}]] [[Category:Utility templates{{#translation:}}]] }}</includeonly> 1iypuf77ovdkevs7qtco62kgukfvkpl Extension:NoTOC/en 102 423487 8365101 5910910 2026-05-04T10:21:17Z FuzzyBot 451990 Updating to match new version of source page 8365101 wikitext text/x-wiki <languages /> {{Unmaintained extension|alternative={{ll|Extension:NoTOCModern}}}} {{Extension code in wiki}} {{Extension |status = unmaintained |type1 = parser |type2 = |hook1 = ParserClearState |hook2 = |username = Frantik |author = Andrew Fitzgerald |description = Turns off Table of Contents by default on all pages |image = |imagesize = |version = 0.1.1 |update = 2013-12-11 |mediawiki = |php = |license = GPL-2.0-or-later |download = See the [[#Code|code section]] |needs-updatephp = No |readme = |changelog = |parameters = |tags = |rights = |example = |compatibility = }} The '''NoTOC''' extension hides the table of contents by default. The magic word <nowiki>__TOC__</nowiki> can still be used normally. ==Installation== {{ExtensionInstall |download-link=[[#Code|Copy the code into files]] }} ==Code== ;NoTOC.php <syntaxhighlight lang="php"> <?php /** * NoTOC extension - Turns off the Table of Contents (TOC) by default on all pages * @version 0.1.1 - 2013/12/11 * * @link https://www.mediawiki.org/wiki/Extension:NoTOC Documentation * @link https://www.mediawiki.org/wiki/Extension_talk:NoTOC Support * * @ingroup Extensions * @package MediaWiki * @author Andrew Fitzgerald (Frantik) * @author Karsten Hoffmeyer (Kghbln) * @copyright (C) 2010 Andrew Fitzgerald * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ // check the call if ( !defined( 'MEDIAWIKI' ) ) { die( 'This file is a MediaWiki extension and thus not a valid entry point.' ); } // provide information $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'NoTOC', 'author' => array( 'Andrew Fitzgerald', '...' ), 'url' => 'https://www.mediawiki.org/wiki/Extension:NoTOC', 'descriptionmsg' => 'notoc-desc', 'version' => '0.1.1' ); // show way to files $wgExtensionMessagesFiles['NoTOC'] = dirname( __FILE__ ) . '/NoTOC.i18n.php'; // register hooks $wgHooks['ParserClearState'][] = 'efMWNoTOC'; // perform purpose function efMWNoTOC($parser) { $parser->mShowToc = false; return true; } </syntaxhighlight> ;NoTOC.i18n.php <syntaxhighlight lang="php"> <?php /** * Internationalization file for the NoTOC extension. * * @licence GNU GPL v2+ * @author Karsten Hoffmeyer (Kghbln) */ $messages = array(); /** English * @author Frantik * @author Kghbln */ $messages['en'] = array( 'notoc-desc' => 'Turns off the Table of Contents (TOC) by default on all pages', ); /** Message documentation (Message documentation) * @author Kghbln */ $messages['qqq'] = array( 'notoc-desc' => '{{desc|name=NoTOC|url=https://www.mediawiki.org/wiki/Extension:NoTOC}}', ); /** German (Deutsch) * @author Kghbln */ $messages['de'] = array( 'notoc-desc' => 'Unterdrückt die automatische Generierung des Inhaltsverzeichnisses', ); </syntaxhighlight> ==See also== * {{ll|Extension:ForceTocOnEveryPage}} * {{ll|Extension:DeToc}} - This can be used to extract TOC HTML and to remove it or put it in some other section of the page. [[Category:TOC extensions{{#translation:}}]] bez1thrgf19t1l9i4wxgffhm5ngtrvc Extension:NoTOC/zh 102 431028 8365108 7793690 2026-05-04T10:21:23Z FuzzyBot 451990 Updating to match new version of source page 8365108 wikitext text/x-wiki <languages /> {{Unmaintained extension|alternative={{ll|Extension:NoTOCModern}}}} {{Extension code in wiki}} {{Extension |status = unmaintained |type1 = parser |type2 = |hook1 = ParserClearState |hook2 = |username = Frantik |author = Andrew Fitzgerald |description = 默认情况下,在所有页面上关闭目录。 |image = |imagesize = |version = 0.1.1 |update = 2013-12-11 |mediawiki = |php = |license = GPL-2.0-or-later |download = 请查阅[[#Code|代码部分]] |needs-updatephp = No |readme = |changelog = |parameters = |tags = |rights = |example = |compatibility = }} '''NoTOC'''扩展默认将目录隐藏。 魔术字<nowiki>__TOC__</nowiki>仍然可以正常使用。 <span id="Installation"></span> == 安裝 == {{ExtensionInstall |download-link=[[#Code|将代码复制到文件中]] }} <span id="Code"></span> ==代码== ;NoTOC.php <syntaxhighlight lang="php"> <?php /** * NoTOC extension - Turns off the Table of Contents (TOC) by default on all pages * @version 0.1.1 - 2013/12/11 * * @link https://www.mediawiki.org/wiki/Extension:NoTOC Documentation * @link https://www.mediawiki.org/wiki/Extension_talk:NoTOC Support * * @ingroup Extensions * @package MediaWiki * @author Andrew Fitzgerald (Frantik) * @author Karsten Hoffmeyer (Kghbln) * @copyright (C) 2010 Andrew Fitzgerald * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ // check the call if ( !defined( 'MEDIAWIKI' ) ) { die( 'This file is a MediaWiki extension and thus not a valid entry point.' ); } // provide information $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'NoTOC', 'author' => array( 'Andrew Fitzgerald', '...' ), 'url' => 'https://www.mediawiki.org/wiki/Extension:NoTOC', 'descriptionmsg' => 'notoc-desc', 'version' => '0.1.1' ); // show way to files $wgExtensionMessagesFiles['NoTOC'] = dirname( __FILE__ ) . '/NoTOC.i18n.php'; // register hooks $wgHooks['ParserClearState'][] = 'efMWNoTOC'; // perform purpose function efMWNoTOC($parser) { $parser->mShowToc = false; return true; } </syntaxhighlight> ;NoTOC.i18n.php <syntaxhighlight lang="php"> <?php /** * Internationalization file for the NoTOC extension. * * @licence GNU GPL v2+ * @author Karsten Hoffmeyer (Kghbln) */ $messages = array(); /** English * @author Frantik * @author Kghbln */ $messages['en'] = array( 'notoc-desc' => 'Turns off the Table of Contents (TOC) by default on all pages', ); /** Message documentation (Message documentation) * @author Kghbln */ $messages['qqq'] = array( 'notoc-desc' => '{{desc|name=NoTOC|url=https://www.mediawiki.org/wiki/Extension:NoTOC}}', ); /** German (Deutsch) * @author Kghbln */ $messages['de'] = array( 'notoc-desc' => 'Unterdrückt die automatische Generierung des Inhaltsverzeichnisses', ); </syntaxhighlight> <span id="See_also"></span> == {{LC zh|lang = {{{lang|}}}|type = H|zh-hans = 参阅|zh-hant = 參閱}} == * {{ll|Extension:ForceTocOnEveryPage}} * {{ll|Extension:DeToc}} - <span lang="en" dir="ltr" class="mw-content-ltr">This can be used to extract TOC HTML and to remove it or put it in some other section of the page.</span> [[Category:TOC extensions{{#translation:}}]] 9h0cn11sr71k3gzl1u3mbwo72bp00dn Help:Extension:ParserFunctions/ar 12 436111 8365001 8353920 2026-05-04T06:19:52Z FuzzyBot 451990 Updating to match new version of source page 8365001 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span lang="en" dir="ltr" class="mw-content-ltr">The {{ll|Extension:ParserFunctions|nsp=0}} extension provides additional [[Special:MyLanguage/Parser functions|parser functions]] to supplement those already present in MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> ("يمكن" تكوينه لتوفير وظائف محلل إضافية لمعالجة السلسلة ؛ يتم توثيق وظائف السلسلة هذه {{ll|Extension:ParserFunctions/String functions | في مكان آخر}}.) <span lang="en" dir="ltr" class="mw-content-ltr">All the parser functions provided by this extension take the form:</span> :<code><nowiki>{{</nowiki><span lang="en" dir="ltr" class="mw-content-ltr">'''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ...</span> <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | النوع ! {{hl1}} | المشغلين |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Grouping (parentheses)</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | أرقام | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | تشغيل ثنائي <code>'''e'''</code> &nbsp; أحادي <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | أحادي | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | ثنائي | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | جولة | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | منطق | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} <span lang="en" dir="ltr" class="mw-content-ltr">This function evaluates a mathematical expression and returns the calculated value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This function is also available in {{ll|Extension:Scribunto|nsp=0}} via the <code>mw.ext.ParserFunctions.expr</code> function.</span> :<code><nowiki>{{#expr:</nowiki> ''تعبير'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The available operators are listed to the right, in order of precedence. See {{ll|Manual:Expr parser function syntax}} for more details of the function of each operator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> When evaluating using [[w:boolean algebra|boolean algebra]], zero evaluates to {{phpi|false}}, and any nonzero value, positive or negative, evaluates to {{phpi|true}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code>[[##iferror|#iferror]]</code> function: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Rounding === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Test case</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Result</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Method of rounding</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is < 5, so no apparent rounding occurs</span> (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is ≥ 5, so it is rounded up</span> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to the nearest integer</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the ''nearest'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding up or down with ''ceil'' and ''floor''</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next ''larger'' integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next ''smaller'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next larger integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next smaller integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Not rounded, since 1 already is an integer</span><br />{{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect</span>}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Strings === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: test string | value if test string is not empty | value if test string is empty (or only white space)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: first parameter | second parameter | third parameter }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Example: </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Year</span> |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">4-digit year.</span> | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Month</span> |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour</span> |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Minutes and seconds</span> |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] 6kwl5w5egnv3poug8yjoyhpromnf3da Help:Extension:ParserFunctions/vi 12 446028 8365038 8353954 2026-05-04T06:21:43Z FuzzyBot 451990 Updating to match new version of source page 8365038 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span class="mw-translate-fuzzy">Tiện ích mở rộng {{ll|Extension:ParserFunctions|nsp=0}} cung cấp thêm các [[Special:MyLanguage/Parser functions|hàm phân tích cú pháp]] (parser functions, sau đây gọi ngắn gọn là hàm phân tích) để bổ sung cho những cái đã có sẵn trong lõi MediaWiki.</span> (Xem {{ll|Help:Magic words#Parser functions}}.) (Ngoài ra, lập trình viên có thể thiết lập để bổ sung thêm các hàm phân tích khác nữa dành cho việc xử lí xâu kí tự; những hàm này được miêu tả tại {{ll|Extension:ParserFunctions/String functions|đây}}.) Tất cả các hàm phân tích cung cấp bởi phần mở rộng này đều có dạng: :<code><nowiki>{{</nowiki>'''#tên_hàm''': ''đối số 1'' | ''đối số 2'' | ''đối số 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=một "hướng dẫn chi tiết" hơn về các điểm tinh tế trong cách hoạt động của trình tính biểu thức, bao gồm một số toán tử bổ sung không được đề cập ở đây|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Loại ! {{hl1}} | Toán tử |- | {{hl2}} | Nhóm (dấu ngoặc) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Số | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | toán tử nhị phân <code>'''e'''</code> &nbsp; đơn phân <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Đơn phân | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Nhị phân | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Làm tròn | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Logic | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Hàm này tính biểu thức toán học và trả về giá trị được tính. Hàm này cũng có sẵn trong {{ll|Extension:Scribunto|nsp=0}} thông qua hàm <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''biểu thức'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span class="mw-translate-fuzzy">Các toán tử có sẵn được liệt kê ở bên phải, theo thứ tự ưu tiên thực hiện. Xem {{ll|Manual:Expr parser function syntax}} để biết thêm chi tiết về chức năng của mỗi toán tử.</span> Độ chính xác và định dạng của kết quả tra về sẽ khác nhau tùy theo hệ điều hành của máy chủ chạy wiki và định dạng số của ngôn ngữ trang web. <div class="mw-translate-fuzzy"> Khi tính toán sử dụng [[:vi:Đại số Boole|đại số Boole]], giá trị 0 bằng {{phpi|false}}, và bất kì giá trị nào khác 0, âm hay dương, bằng {{phpi|true}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Một biểu thức đầu vào trống trả về một chuỗi trống. Các biểu thức không hợp lệ trả về một trong số các thông báo lỗi có thể được phát hiện sử dụng hàm <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' Thứ tự của các toán hạng cộng trừ trước hoặc sau một số có ý nghĩa và có thể được xử lý như một giá trị dương hoặc âm thay vì một toán hạng với đầu vào sai. :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Lưu ý, nếu sử dụng đầu ra của các câu thần chú (magic words), bạn cần định dạng lại chúng ở dạng thô để loại bỏ các dấu phẩy và dịch các chữ số. Ví dụ, <nowiki>{{NUMBEROFUSERS}}</nowiki> cho kết quả là {{NUMBEROFUSERS}}, trong khi chúng ta cần {{formatnum:{{NUMBEROFUSERS}}|R}}. Để đạt được điều này, bạn có thể sử dụng <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Điều này rất quan trọng trong một số ngôn ngữ có các chữ số được dịch ra. Ví dụ, trong tiếng Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> sẽ cho ra ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=Toán tử <code>mod</code> cho kết quả sai đối với vài giá trị của đối số thứ hai: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (trả về một chuỗi trống; đáng lẽ ra phải là 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span class="mw-translate-fuzzy">Nếu bạn muốn thực hiện các phép toán trên ngày tháng (VD: kiểm tra xem một ngày này là trước hay sau so với ngày kia), trước tiên hãy chuyển đổi ngày, giờ đó sang số giây kể từ 1 tháng 1 năm 1970 (UTC) sử dụng <nowiki>{{#time: xNU }}</nowiki>, sau đó đơn giản là thêm hoặc trừ ngày tháng như số.</span>}} <span id="Rounding"></span> === Làm tròn số === [https://php.net/function.round Làm tròn số] bên trái đến bội số của 1/10 nâng lên một lũy thừa, với số mũ bằng giá trị nguyên của số bên phải. Để chủ động làm tròn lên hoặc xuống, sử dụng lần lượt <code>ceil</code> hoặc <code>floor</code>. {| class="wikitable" ! {{hl1}} | Trường hợp kiểm thử ! {{hl1}} | Kết quả ! {{hl1}} | Cách làm tròn |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || Chữ số cuối cùng < 5, vì thế phép làm tròn không tạo ra thay đổi nào (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || Chữ số cuối cùng >= 5, vì thế được làm tròn lên (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Một lần nữa, chữ số cuối cùng được làm tròn lên, dẫn đến việc các chữ số tiếp theo liên tiếp được làm tròn (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Làm tròn đến hàng trăm (100) vì giá trị âm làm tròn về phía bên trái dấu phẩy |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Làm tròn đến hàng phần trăm (0.01) vì giá trị dương làm tròn về phía bên phải dấu phẩy |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Phần thập phân trong số làm tròn không ảnh hưởng đến kết quả phép làm tròn |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Phần thập phân bị bỏ đi (chặt vứt đi) |- ! colspan=3 {{hl2}} | Làm tròn đến số nguyên gần nhất |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Xuống đến số nguyên "gần nhất", ở đây là 0 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Lên đến số nguyên gần nhất, ở đây là 1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Lên đến số nguyên gần nhất, ở đây là 1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Lên đến số nguyên gần nhất, ở đây là 0 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Xuống đến số nguyên gần nhất, ở đây là âm 1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Xuống đến số nguyên gần nhất, ở đây là âm 1 |- ! colspan=3 {{hl2}} | Làm tròn lên hoặc xuống với toán tử "ceil" và "floor" ("trần nhà" và "sàn nhà") |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Lên đến số nguyên tiếp sau, ở đây là 1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Xuống đến số nguyên ngay trước nó, ở đây là 0 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Lên đến số nguyên tiếp sau, ở đây là 0 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Xuống đến số nguyên ngay trước, ở đây là âm 1 |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Không được làm tròn vì 1 đã là số nguyên<br />{{Warning|1=Được hiểu là '''(ceil''' 1''')'''/3, chứ không phải '''ceil('''1/3''')''' như một số bạn có thể sẽ nghĩ}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <span id="Strings"></span> === Xâu === Biểu thức chỉ hoạt động với các giá trị kiểu số, chúng không thể so sánh các xâu hoặc kí tự. [[#ifeq]] có thể được dùng thay vào đó. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Hàm này kiểm tra một xâu thử xem nó rỗng hay không. Một xâu thử chứa chỉ toàn các kí tự trắng cũng được xem là rỗng. :<syntaxhighlight lang="wikitext" inline>{{#if: xâu thử | giá trị nếu xâu thử không rỗng | giá trị nếu xâu thử rỗng (hoặc chỉ chứa kí tự trắng)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: tham số thứ nhất | tham số thứ hai | tham số thứ ba }}</syntaxhighlight> Hàm này trước tiên kiểm tra xem tham số thứ nhất rỗng hay không. Nếu tham số thứ nhất không rỗng, hàm sẽ trả về tham số thứ hai. Nếu tham số thứ nhất rỗng hoặc chỉ chứa các kí tự trắng (khoảng trắng, dấu xuống dòng, v.v...), hàm sẽ trả về tham số thứ ba. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' Xâu thử luôn luôn được hiểu là văn bản thuần (pure text), vì thế các biểu thức toán học không được thực hiện: :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' Tham số cuối cùng (false) có thể để trống: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' Hàm này có thể được lồng vào nhau. Muốn vậy, đưa một hàm #if ở dạng đầy đủ vào vị trí một tham số của một hàm #if khác. Có thể lên tới 7 cấp độ làm tổ, tuy nhiên điều này có thể phụ thuộc vào wiki hoặc giới hạn bộ nhớ. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:xâu thử | giá trị nếu xâu thử không rỗng |{{#if:test string |value if test string is not empty |giá trị nếu xâu thử rỗng (hoặc chỉ chứa kí tự trắng) }} }} </syntaxhighlight> <span class="mw-translate-fuzzy">Bạn cũng có thể dùng một tham số làm xâu thử trong lần gọi <code>#if</code>. Hãy nhớ đừng quên thêm $1 (dấu sổ thẳng, dấu sổ dọc) sau tên của biến.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> (Để nếu tham số cuối cùng không có giá trị, nó sẽ được đánh giá thành một xâu rỗng thay ví xâu "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Bạn đã nhập văn bản cho biến 1 |2=Văn bản không được nhập cho biến 1 }} Xem {{ll|Help:Parser functions in templates}} để xem thêm các ví dụ khác về parser function này. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Hàm phân tích cú pháp này so sánh hai xâu đầu vào, xác định xem chúng có giống nhau hay không và trả về một trong hai xâu dựa trên kết quả. Nếu cần so sánh nhiều hơn và có xâu đầu ra, hãy cân nhắc sử dụng <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Nếu cả hai xâu là các giá trị số hợp lệ, chúng được so sánh như hai số: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Ngược lại, chúng được so sánh như hai văn bản; việc so sánh là phân biệt hoa thường (case sensitive): :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(so sánh với ví dụ tương tự ở trên, không có ngoặc kép)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(so sánh với ví dụ tương tự ở trên, với <code>[[##expr|#expr]]</code> trả về một số hợp lệ trước tiên)'' <span class="mw-translate-fuzzy">Để làm ví dụ thực tế, hãy xem xét {{ll|Help:Templates|bản mẫu}} <code>Template:Timer</code> hiện có bằng cách sử dụng trình phân tích cú pháp để chọn giữa hai thời điểm chuẩn, ngắn và dài.</span> Nó nhận tham số này làm đầu vào đầu tiên để so sánh với xâu "short"&ndash; không có quy ước nào về thứ tự, nhưng sẽ dễ đọc hơn nếu tham số này đứng trước. Mã bản mẫu được định nghĩa là: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> khi đó: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Khi các thẻ phân tích và các hàm phân tích được lồng bên trong một hàm phân tích, chúng phải được thay thế bằng {{ll|Strip marker|đoạn mã duy nhất}}. Điều này ảnh hưởng đến các phép so sánh: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Hàm này nghiên cứu xâu được nhập vào và trả về một trong hai kết quả; hàm này xem xâu là <code>true</code> nếu xâu có chứa một object HTML với <code>class="error"</code>, tạo ra bởi các parser functions khác như <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> và <code>[[##rel2abs|#rel2abs]]</code>, các lỗi [[Special:MyLanguage/Help:Templates|bản mẫu]] như lặp (loops) và đệ quy (recursion), cũng như các lỗi "failsoft" parser khác. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">Một hoặc cả hai giá trị trả về có thể được để trống. Nếu <code>''value if correct''</code> được để trống và hàm xác định xâu đưa vào là không lỗi, hàm sẽ trả về chính xâu đó. Nếu <code>''value if error''</code> được để trống, khi gặp lỗi hàm sẽ trả về một xâu rỗng.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == Hàm này tính toán giá trị của biểu thức toán học đưa vào và trả về một trong hai xâu phụ thuộc vào giá trị boole (đúng/sai) của kết quả: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === Giới hạn của ifexist === <code>#ifexist:</code> được coi là một "hàm phân tích tốn kém"; chỉ một số lượng giới hạn có thể được nhúng vào bất kì một trang nào (bao gồm các hàm trong các bản mẫu được truyền tải). Khi đạt đến giới hạn, những hàm <code>#ifexist:</code> chạy sau sẽ tự động trả về false false, dù trang mục tiêu có tồn tại hay không, và trang đó sẽ được đưa vào [[:Category:{{MediaWiki:expensive-parserfunction-category}}]]. Tên của {{ll|Help:Tracking categories|thể loại theo dõi}} có thể khác nhau tuỳ thuộc vào ngôn ngữ nội dung của wiki của bạn. <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === Mặc định === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === Sử dụng với tham số === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <span id="Comparison_behavior"></span> === Hành vi so sánh === <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Example: </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Năm |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Năm 4 chữ số | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Năm 2 chữ số | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1 nếu là năm nhuận, 0 nếu không phải. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Tháng |- | style="text-align: center;" | <code>n</code> | Tháng theo số, không độn 0. | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | Tháng theo số, độn 0. | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | Tên tháng viết tắt, theo ngôn ngữ trang web. | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | Tên tháng đầy đủ, theo ngôn ngữ trang web. | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| Ngày trong tháng hoặc năm |- | style="text-align: center;" | <code>j</code> | Ngày trong tháng, không độn 0. | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | Ngày trong tháng, độn 0. | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | Ngày trong năm (1 tháng 1 = 0).<br />{{note}} Để lấy ngày ISO trong năm, hãy cộng 1. | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Tuần và ngày trong tuần |- | style="text-align: center;" | <code>W</code> | Số tuần ISO 8601, độn 0. | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | Ngày ISO 8601 trong tuần (Thứ 2 = 1, Chủ nhật = 7). | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | Ngày trong tuần (Chủ nhật = 0, thứ 7 = 6) | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | Tên thứ viết tắt. | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | Tên thứ đầy đủ. | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Giờ |- | style="text-align: center;" | <code>a</code> | "am" trong buổi sáng (00:00:00 → 11:59:59)<br>"pm" trong buổi chiều tối (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span class="mw-translate-fuzzy">Phiên bản viết hoa của <code>a</code> ở trên.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Giờ trong quy ước 12 giờ, không độn 0. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Giờ trong quy ước 12 giờ, độn 0. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Giờ trong quy ước 24 giờ, không độn 0. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Giờ trong quy ước 24 giờ, độn 0. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Phút và giây |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | Phút trong giờ, độn 0. | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | Giây trong phút, độn 0. | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:vi:Thời gian Unix|Thời gian Unix]]. Giây từ 1 tháng 1, 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] rk8dpqdnc30r19tu7fiuuk5awjvxqtl Help:Watching pages/ca 12 453684 8365085 8352077 2026-05-04T08:41:45Z ~2026-24214-58 18357906 8365085 wikitext text/x-wiki <languages/> {{PD Help Page|imported=yes}} '''Mirar pàgines''' la seguiment permet qualsevol [[Special:MyLanguage/Help:Logging in|logged dins]] usuari per seguir una llista de "pàgines" mirades i per ser notificat de recent edita a aquestes pàgines. MediaWiki no permet que els usuaris siguin "propietaris" de les pàgines, tot i així, la funcionalitat de "[[Special:MyLanguage/Help:Watchlist|seguiment de pàgines]]" juntament amb l'habilitat de desfer qualsevol canvi permet mantenir involucrats als usuaris interessats en cada pàgina sense els desavantatges de donar a una persona el control total sobre una pàgina. {{void|1= A més a més de la llista de seguiment incorporada al wiki, existeix una llista accessible a http://tools.wikimedia.de/~luxo/gwatch/ que permet visualitzar simultàniament canvis a tants projectes de Wikimedia com es vulgui. }} <span id="Controlling_which_pages_are_watched"></span> == Controlar quines pàgines segueixo == Només es poden seguir les pàgines que no es generen dinàmicament La pàgina es segueix juntament amb la seva pàgina de discussió corresponent Totes les modificacions de la llista de seguiment afecten a la pàgina principal i la seva discussió corresponent: no es pot seguir una de les dues sense seguir l'altra ; Mentre es visualitza la pàgina : L'estrella blanca (o l'enllaç «<code>{{int|watch}}</code>» a la pell del monollibre), situada al marge de cada pàgina, afegeix la pàgina actual a la vostra llista de seguiment i converteix l'estrella en blau (o a la pell del monollibre un «<code>{{int|unwatch}}</code>»). : El {{msgtxt|addedwatchtext}} o {{msgtxt|removedwatchtext}}, respectivament, es mostren a dalt de la pàgina i es canvia <code>{{int|watch}}</code> per <code>{{int|unwatch}}</code>. Depenent del navegador, això es duu a terme sense refrescar tota la pàgina, usant [[ca:w:Ajax|AJAX]] amb [https://phabricator.wikimedia.org/diffusion/SVN/browse/trunk/phase3/skins/common/ajaxwatch.js;78105?view=markup ajaxwatch.js] ; Mentre es desa la pàgina : Quan es desa una pàgina es pot vigilar la pàgina activant la casella <code>{{int|watchthis}}</code>. : Si s'activa la opció "<code>{{int|tog-watchdefault}}</code>" a les [[Special:MyLanguage/Help:Preferences|preferències d'usuari]], la casella estarà seleccionada per defecte, per tant si no es desmarca abans de desat, la pàgina s'afegirà a la llista de seguiment. Hi ha altres opcions: :* {{int|tog-watchcreations}} - (si l'anterior s'ha seleccionat no cal marcar-la ja que la creació de pàgines conta com una edició) :* {{int|tog-watchmoves}} :* {{int|tog-watchdeletion}} ; Editant la llista sencera : <span lang="en" dir="ltr" class="mw-content-ltr">A specific link to "{{int|rcfilters-watchlist-edit-watchlist-button}}" is provided on top of page {{#Special:Watchlist}}, and several additional links are available at top of all watchlist-related pages:</span> :* <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:EditWatchlist|{{int|watchlisttools-edit}}]] provides a paginated list of watched pages (including links to the pages and their talk pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Selecting one or several checkboxes and then clicking the "{{int|watchlistedit-table-remove-selected}}" button will remove selected pages from the list.</span> [[Help:Watchlist labels|Watchlist labels]] can also be assigned and removed from this page. :* [[{{#Special:WatchlistLabels}}|{{int:watchlisttools-labels}}]] lets you edit creat, edit, and delete [[Help:watchlist labels|watchlist labels]]. :* <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:EditWatchlist/raw|{{int|watchlisttools-raw}}]] provides a textarea with a list of watched pages (without listing the talk pages), with one title on every line, sorted by namespace number and then in [[Manual:Page naming#Alphabetical sorting in page names|alphabetic order]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">This allows editing the list directly, copying it to an external editor, or replacing it with one created elsewhere.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Duplicates are automatically removed on saving.</span> :* <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:EditWatchlist/clear|{{int|watchlisttools-clear}}]] to empty the list of watched pages.</span> :* <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:Watchlist|{{int|watchlisttools-view}}]] to show the status of the watched pages.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Watchlist Expiry ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">A new watchlist feature was added in {{ll|MediaWiki 1.35}}: Watchlist Expiry.</span> <span lang="en" dir="ltr" class="mw-content-ltr">With this feature, you can optionally select to watch a page for a temporary period of time.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once the watch period has expired, the page will be automatically removed from your watchlist.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can update the watch period at any time, including switching from temporary to permanent status.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Temporarily watched pages are usually represented by a half star (as opposed to a full star, which represents permanently watched pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">To find out when Watchlist Expiry will be enabled on your wiki, you can check out the [[m:Special:MyLanguage/Community_Tech/Watchlist_Expiry/Release_Schedule|release schedule]] on Meta-wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For documentation on how to use the feature, please visit {{ll|Help:Watchlist expiry}}.</span> <span id="Watchlist"></span> ==Llista de seguiment== <span lang="en" dir="ltr" class="mw-content-ltr">When the user is [[Special:MyLanguage/Help:Logging in|logged in]], every page has a link to the user's watchlist, also accessible by the link [[Special:Watchlist]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">This page shows a list of all recently changed watched pages, separated by days, ordered backward according to the time of the edit.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each line shows details of each edit: whether [[Special:MyLanguage/Help:Minor edit|minor]] ('''{{int|minoreditletter}}''') or major, whether made by a [[Special:MyLanguage/bot|bot]] ('''{{int|boteditletter}}'''), the time, a link to the page, the difference between the current version and the last one, the history, the increase or decrease of the number of bytes, the user name, the user's talk page, the user's contributions and the edit summary.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Depending on site configuration, the page name is bolded if the page has changed after the last time the user viewed the page (while logged in).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Technically, the watchlist is just another way to filter [[Special:MyLanguage/Help:Recent changes|recent changes]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The entries come from the {{ll|Manual:recentchanges table|recentchanges}} table and are therefore restricted to edits not older than {{ll|Manual:$wgRCMaxAge|$wgRCMaxAge}} (30 days in most [[Special:MyLanguage/Wikimedia Foundation|WMF]] projects).</span> <span id="Options"></span> ===Opcions=== <span lang="en" dir="ltr" class="mw-content-ltr">One can hide or show the following types of edits, using the corresponding links: minor edits, bot edits, one's own edits.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These can also be set in [[Special:MyLanguage/Help:Preferences|preferences]] as initial options when the user comes to [[Special:Watchlist]] page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Another preference option, although named <code>{{int|prefs-watchlist-days}}</code>, also sets only the initial value for a period of time for which changes are shown.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This period can be easily changed with corresponding links.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There is also a drop-down box that allows to see the changes only in one specific namespace. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Unlike recent changes, watchlist cannot hide edits by logged in/logged out users, there are no links to show only specific number of edits, and there is no way to show all namespaces except one. </div> <span id="Simple_watchlist"></span> === Llista de seguiment simple === <div lang="en" dir="ltr" class="mw-content-ltr"> By default watchlist only shows the last edit to each watched page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There are two possible problems if a page had a non-minor recent edit, but the last edit was marked as [[Special:MyLanguage/Help:Minor edit|minor]]: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * non-minor edits will not be shown. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Since one is typically interested in all changes since one last checked, in this case the history of the page needs to be checked.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * if watchlist is set not to show minor changes, then the page will not appear in the watchlist at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Many experienced users prefer to use Expanded Watchlist. </div> <span id="Expanded_watchlist"></span> === Llista de seguiment estesa === <div lang="en" dir="ltr" class="mw-content-ltr"> With the preference <code>{{int|tog-extendwatchlist}}</code> the watchlist will show all recent edits, listed in chronological order. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case the preference <code>{{int|tog-usenewrc}}</code>, which toggles [[Special:MyLanguage/Help:enhanced recent changes|enhanced recent changes]], also affects the watchlist the same way: recent changes of watched pages are grouped by day, and within a day by page. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Another preference option is <code>{{int|prefs-watchlist-edits}}</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">A site can limit the maximum value for this option, for example the maximum seems to be 1000 on [[Special:MyLanguage/Wikimedia Foundation|WMF]] projects.</span> <!--did not check all of them though- AlexSm--> <span lang="en" dir="ltr" class="mw-content-ltr">To show pages with older edits, view the changes by namespaces or use the non-enhanced watchlist, and/or reduce the number of watched pages.</span> <span id="Other_effects_of_watching_a_page"></span> ==Altres efectes del seguiment d'una pàgina== <div lang="en" dir="ltr" class="mw-content-ltr"> The watchlist is only one of the features with regard to watching pages; even without ever using it, specifying pages to watch is useful. </div> <span id="Recent_and_related_changes,_page_history"></span> ===Canvis recents, canvis relacionats i pàgina d'historial=== <div lang="en" dir="ltr" class="mw-content-ltr"> In [[Special:MyLanguage/Help:Recent changes|Recent Changes]], [[Special:MyLanguage/Help:Enhanced recent changes|Enhanced Recent Changes]], and [[Special:MyLanguage/Help:Related changes|Related Changes]], watched pages are bolded. </div> <span lang="en" dir="ltr" class="mw-content-ltr">If one views the [[Special:MyLanguage/Help:Page history|history]] of a watched page directly, without first viewing the page, the edit at the top (the most recent one) may be marked using update marker {{msgtxt|updatedmarker}}; this applies if the edit was made by someone else and you have not viewed the page (while logged in) since it was made.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is actually enabled together with [[#Email notification|email notification]].</span> <span id="Email_notification"></span> ===Notificacions per correu electrònic=== :''<span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Notifications}} for the 2013 extension.</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">From [[Special:MyLanguage/Release notes/1.5|MediaWiki 1.5]], you can get an email after a watched page has been edited by somebody else.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will not be repeated until you view the page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Viewing a diff or the page history is not enough.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that you have to be logged in when viewing the page, otherwise you will not be notified of further changes.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Optionally this notification system can ignore minor changes (this is the default).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whether the feature is enabled on a wiki can be seen in the [[Special:Preferences|preferences]]: if it is, the {{msgtxt|tog-enotifwatchlistpages}} will be one of the options of the main section.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The notifications for user talk edits are enabled by another preference option.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Having a separate email for every edited page that one likes to watch in the sense of the other watch features, may be too much.</span> <span lang="en" dir="ltr" class="mw-content-ltr">New features are being proposed and developed to deal with this: the option to have emails sent, after a delay, with a ''list'' of edited pages, and/or the possibility to specify a subset of watched pages for email notification.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Echo (Notifications)}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For the latter, as a workaround, one may be tempted to log in under a different username just to specify a different (typically smaller) watchlist for email notification.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, after viewing a page under one username, one would have to clear the notification flag for that page for the other username too.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ====Technical details==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To enable it on a wiki, {{ll|Manual:$wgEnotifWatchlist|$wgEnotifWatchlist}} is set to true, and it still depends on preference settings.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The email message below is:</span> <blockquote>{{msgtxt|enotif body}}</blockquote> <span lang="en" dir="ltr" class="mw-content-ltr">See [[Special:MyLanguage/Manual:Configuration_settings#Email notification (Enotif) settings|Email notification]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since May 2011 the feature is enabled on all Wikimedia projects for the user talk notifications, and since April 2012 for watchlist edits too.</span> <span lang="en" dir="ltr" class="mw-content-ltr">From early May 2012, the preference for edited pages to be added to watchlist is the default.</span> <span id="User_preferences"></span> === Preferències d'usuari === <div lang="en" dir="ltr" class="mw-content-ltr"> The following options are (or can be) available in Preferences >> User Profile tab </div> * {{int|allowemail}} * {{int|tog-ccmeonemails}} * {{int|tog-enotifwatchlistpages}} * {{int|tog-enotifusertalkpages}} * {{int|tog-enotifminoredits}} * {{int|lqt-preference-notify-talk}} <span id="Common_misunderstandings"></span> === Errors habituals === <div lang="en" dir="ltr" class="mw-content-ltr"> Email notification has many settings, so if you think you've missed something check them carefully. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * The notifications about a page that "has been created" may be about any log action (such as protection) on the page, see {{task|T16901}} and sons. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * If you don't click the link in the notification, you won't receive it next time. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Look for bolded items in your Special:Watchlist: they're pages you've not yet seen after recent changes and you won't be notified about them (note: your wiki may have hidden this essential highlighting feature).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Edits by authorised bots sometimes don't cause an email notification even if you've configured your preferences to receive one for that kind of action: namely, if they make a minor edit on your talk page and you've set (only?) <code>{{int|tog-enotifusertalkpages}}</code>, or if they make a minor edit on any page and you've set <code>{{int|tog-enotifminoredits}}</code>. </div> <span lang="en" dir="ltr" class="mw-content-ltr">This behavior is not documented nor configurable and has some bugs; see {{task|T40874}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> See also the [https://phabricator.wikimedia.org/tag/mediawiki-email/ list of known bugs]. </div> <span id="What_you_cannot_watch"></span> == Allò que no es pot fer un seguiment == <div lang="en" dir="ltr" class="mw-content-ltr"> Watchlist only detects actual edits to the wikitext of the page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ;Included pages: :Changes to transcluded pages can also change the way the watched page is rendered, however these changes do not appear in the watchlist. </div> <span lang="en" dir="ltr" class="mw-content-ltr">For more information see [[Special:MyLanguage/Help:Page history#Linking to a specific version of a page|Help:Page history#Linking to a specific version of a page]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">One may choose to watch all the templates used, and the templates used by these templates, etc.</span> ;<span lang="en" dir="ltr" class="mw-content-ltr">Actions will not appear in watchlist:</span> * {{ll|Help:Moving a page}} :<span lang="en" dir="ltr" class="mw-content-ltr">Note that after the move both the old and the new name are watched.</span> * {{ll|Help:Protecting and unprotecting pages}} :<span lang="en" dir="ltr" class="mw-content-ltr">Some projects have special templates (such as {{tl|sprotected}}) that should be added to protected pages, thus partly solving the problem.</span> * {{ll|Help:Deletion and undeletion}} :<span lang="en" dir="ltr" class="mw-content-ltr">Some projects might have a policy to add a deletion notice to the page first, or even to notify main authors on their talk pages.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">One can also periodically check [[Special:Watchlist/edit|Special:Watchlist/edit]] page and inspect all broken (red) links.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ;Images and categories :Watching an image or a category means watching only the editable part. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Watchlist will not show uploads of new versions of images.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is not possible to watch a category in the sense of being notified if pages are added or removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">With "related changes," additions to categories can be detected; for removals, one has to watch all pages in the category.</span> <span id="Watching_a_nonexistent_page"></span> ==Seguiment d'una pàgina no existent== <span lang="en" dir="ltr" class="mw-content-ltr">One can watch a nonexistent page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This page will appear in the watchlist changes when somebody creates it.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if you watch a page that does not yet have a talk page, you will be notified when someone starts a new discussion on the talk page. </div> <span lang="en" dir="ltr" class="mw-content-ltr">You can watch a page even if neither the content page nor the talk page exists.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do that, go to the page's URL, either by typing the URL directly or following a (broken) link, and then pressing <code>{{int|watchthis}}</code> (depending on the skin you may have to press <code>{{int|cancel}}</code> before getting a <code>{{int|watch}}</code> link).</span> <span id="Page_moves_and_the_watchlist"></span> ==Pàgines reanomenades i la llista de seguiment== <span lang="en" dir="ltr" class="mw-content-ltr">If a page you have watched is [[Special:MyLanguage/Help:Moving a page|moved]] to a new title, the new title will be automatically added to your watchlist.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Even if the page is later moved back, the new title will remain in your watchlist along with the old one.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Even if the new title is deleted after the page has been moved back, a note about the deletion will appear on your watchlist and the title will remain in your list of watched pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you notice mysterious nonexistent pages appearing on your watchlist, this is the most likely explanation.</span> <span id="Related_changes_feature"></span> ==Funció de canvis relacionats== : <span lang="en" dir="ltr" class="mw-content-ltr">Main article: [[w:Help:Public watchlist]]</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The "[[Special:MyLanguage/Help:Related changes#Watchlist-like functionality|Related changes]]" can be used to set up watchlist-like functionality, as explained below. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Pages with links (possibly specially created for this purpose, e.g. as subpages of one's user page) can be used with Related Changes as a collection of separate "watchlists".</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note however that unlike My Watchlist, Related Changes does not automatically include talk pages; to watch also the corresponding talk pages, links to them also have to be in the page on which Related Changes is applied.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the links to the talk pages are put just for this purpose, a blank space as link label can be used, which makes the link invisible and ineffective, except for Related Changes.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also, using Related Changes there is not the convenience of pressing a <code>{{int|watch}}</code> link to add the current page to the list of "watched pages".</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that Related Changes does not detect an edit in the page itself and its talk page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Either include a self-link and a link to the talk page in the page, or put the page in another "special watchlist", or in one's standard watchlist.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Such pages can use the template mechanism to include other pages.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Watching pages in a category by applying Related Changes to the category has a major drawback: ''removal of a page from the category is not detected''. </div> <span lang="en" dir="ltr" class="mw-content-ltr">An advantage of using Related Changes as alternative for the list of watched pages is that a revision history of the page(s) with links is available, while the system does not keep a record of pages that one has watched.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, [[Special:Watchlist/raw|Special:Watchlist/raw]] allows storage of the list: locally, or in a user subpage on the wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If privacy is a concern, an advantage of the watchlist feature (if the list is not stored in a page on the wiki) is that it does not publicly reveal one's interest in a page (if one does not edit it).</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also below.</span> ==CSS== <div lang="en" dir="ltr" class="mw-content-ltr"> As an alternative or in addition to using the watchlist feature, one can also define a [[Special:MyLanguage/Manual:Interface/Stylesheets|user style]] for links to selected pages, putting in one's [[w:Cascading Style Sheets|CSS]] a list of lines like: </div> a[title ="''pagename''"] {color: white; background: red; font-size: 150% } <div lang="en" dir="ltr" class="mw-content-ltr"> This works in Opera, but not in Internet Explorer. </div> <span lang="en" dir="ltr" class="mw-content-ltr">On the (Enhanced) Recent Changes page it works like the bolding feature mentioned above, but it is more versatile, e.g. allowing extra emphasis on pages one is ''very'' interested in, or different styles for different categories of interesting pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, it also works on user contributions pages, and on regular pages (also for piped links, but not for indirect links through a redirect).</span> <span lang="en" dir="ltr" class="mw-content-ltr">It also applies, less usefully, for the section editing links in the page itself.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To highlight links to the given page also from other websites, including interlanguage links, use instead of the above: </div> a[href ="''full URL'' "] { .. } <div lang="en" dir="ltr" class="mw-content-ltr"> Note that the full URL is needed, even to highlight links from the same project, even though the [[w:HTML|HTML]] code uses the relative URL /wiki/''pagename''. </div> <span id="Privacy_of_watchlists"></span> ==Privadesa de les llistes de seguiment== <span lang="en" dir="ltr" class="mw-content-ltr">Ordinary users or [[Special:MyLanguage/Project:Administrators|administrators]] cannot tell what is in your watchlist, or who is watching any particular page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:MyLanguage/Developers|Developer]]s who have access to the servers that hold the Wikipedia database can figure out this kind of information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Wikipedia:Database download|Publicly available database dumps]] do not include this kind of information.</span> <span id="See_also"></span> ==Vegeu també== * {{ll|Manual:watchlist table}} * [[m:Watchlist sizes for enwiki 2004-08-11|<span lang="en" dir="ltr" class="mw-content-ltr">m:Watchlist sizes for enwiki 2004-08-11</span>]] {{watchlists navigation}} [[Category:Help{{#translation:}}]] [[Category:Watchlist{{#translation:}}]] lu0hs9boa7caowxhbvfedbbognqmh4t 8365087 8365085 2026-05-04T08:43:02Z ~2026-24214-58 18357906 8365087 wikitext text/x-wiki <languages/> {{PD Help Page|imported=yes}} '''Mirar pàgines''' la seguiment permet qualsevol [[Special:MyLanguage/Help:Logging in|logged dins]] usuari per seguir una llista de "pàgines" mirades i per ser notificat de recent edita a aquestes pàgines. MediaWiki no permet que els usuaris siguin "MediaWiki" de les pàgines, tot i així, la funcionalitat de "[[Special:MyLanguage/Help:Watchlist|seguiment de pàgines]]" juntament amb l'habilitat de desfer qualsevol canvi permet mantenir involucrats als usuaris interessats en cada pàgina sense els desavantatges de donar a una persona el control total sobre una pàgina. {{void|1= A més a més de la llista de seguiment incorporada al wiki, existeix una llista accessible a http://tools.wikimedia.de/~luxo/gwatch/ que permet visualitzar simultàniament canvis a tants projectes de Wikimedia com es vulgui. }} <span id="Controlling_which_pages_are_watched"></span> == Controlar quines pàgines segueixo == Només es poden seguir les pàgines que no es generen dinàmicament La pàgina es segueix juntament amb la seva pàgina de discussió corresponent Totes les modificacions de la llista de seguiment afecten a la pàgina principal i la seva discussió corresponent: no es pot seguir una de les dues sense seguir l'altra ; Mentre es visualitza la pàgina : L'estrella blanca (o l'enllaç «<code>{{int|watch}}</code>» a la pell del monollibre), situada al marge de cada pàgina, afegeix la pàgina actual a la vostra llista de seguiment i converteix l'estrella en blau (o a la pell del monollibre un «<code>{{int|unwatch}}</code>»). : El {{msgtxt|addedwatchtext}} o {{msgtxt|removedwatchtext}}, respectivament, es mostren a dalt de la pàgina i es canvia <code>{{int|watch}}</code> per <code>{{int|unwatch}}</code>. Depenent del navegador, això es duu a terme sense refrescar tota la pàgina, usant [[ca:w:Ajax|AJAX]] amb [https://phabricator.wikimedia.org/diffusion/SVN/browse/trunk/phase3/skins/common/ajaxwatch.js;78105?view=markup ajaxwatch.js] ; Mentre es desa la pàgina : Quan es desa una pàgina es pot vigilar la pàgina activant la casella <code>{{int|watchthis}}</code>. : Si s'activa la opció "<code>{{int|tog-watchdefault}}</code>" a les [[Special:MyLanguage/Help:Preferences|preferències d'usuari]], la casella estarà seleccionada per defecte, per tant si no es desmarca abans de desat, la pàgina s'afegirà a la llista de seguiment. Hi ha altres opcions: :* {{int|tog-watchcreations}} - (si l'anterior s'ha seleccionat no cal marcar-la ja que la creació de pàgines conta com una edició) :* {{int|tog-watchmoves}} :* {{int|tog-watchdeletion}} ; Editant la llista sencera : <span lang="en" dir="ltr" class="mw-content-ltr">A specific link to "{{int|rcfilters-watchlist-edit-watchlist-button}}" is provided on top of page {{#Special:Watchlist}}, and several additional links are available at top of all watchlist-related pages:</span> :* <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:EditWatchlist|{{int|watchlisttools-edit}}]] provides a paginated list of watched pages (including links to the pages and their talk pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Selecting one or several checkboxes and then clicking the "{{int|watchlistedit-table-remove-selected}}" button will remove selected pages from the list.</span> [[Help:Watchlist labels|Watchlist labels]] can also be assigned and removed from this page. :* [[{{#Special:WatchlistLabels}}|{{int:watchlisttools-labels}}]] lets you edit creat, edit, and delete [[Help:watchlist labels|watchlist labels]]. :* <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:EditWatchlist/raw|{{int|watchlisttools-raw}}]] provides a textarea with a list of watched pages (without listing the talk pages), with one title on every line, sorted by namespace number and then in [[Manual:Page naming#Alphabetical sorting in page names|alphabetic order]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">This allows editing the list directly, copying it to an external editor, or replacing it with one created elsewhere.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Duplicates are automatically removed on saving.</span> :* <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:EditWatchlist/clear|{{int|watchlisttools-clear}}]] to empty the list of watched pages.</span> :* <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:Watchlist|{{int|watchlisttools-view}}]] to show the status of the watched pages.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Watchlist Expiry ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">A new watchlist feature was added in {{ll|MediaWiki 1.35}}: Watchlist Expiry.</span> <span lang="en" dir="ltr" class="mw-content-ltr">With this feature, you can optionally select to watch a page for a temporary period of time.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once the watch period has expired, the page will be automatically removed from your watchlist.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can update the watch period at any time, including switching from temporary to permanent status.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Temporarily watched pages are usually represented by a half star (as opposed to a full star, which represents permanently watched pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">To find out when Watchlist Expiry will be enabled on your wiki, you can check out the [[m:Special:MyLanguage/Community_Tech/Watchlist_Expiry/Release_Schedule|release schedule]] on Meta-wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For documentation on how to use the feature, please visit {{ll|Help:Watchlist expiry}}.</span> <span id="Watchlist"></span> ==Llista de seguiment== <span lang="en" dir="ltr" class="mw-content-ltr">When the user is [[Special:MyLanguage/Help:Logging in|logged in]], every page has a link to the user's watchlist, also accessible by the link [[Special:Watchlist]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">This page shows a list of all recently changed watched pages, separated by days, ordered backward according to the time of the edit.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each line shows details of each edit: whether [[Special:MyLanguage/Help:Minor edit|minor]] ('''{{int|minoreditletter}}''') or major, whether made by a [[Special:MyLanguage/bot|bot]] ('''{{int|boteditletter}}'''), the time, a link to the page, the difference between the current version and the last one, the history, the increase or decrease of the number of bytes, the user name, the user's talk page, the user's contributions and the edit summary.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Depending on site configuration, the page name is bolded if the page has changed after the last time the user viewed the page (while logged in).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Technically, the watchlist is just another way to filter [[Special:MyLanguage/Help:Recent changes|recent changes]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The entries come from the {{ll|Manual:recentchanges table|recentchanges}} table and are therefore restricted to edits not older than {{ll|Manual:$wgRCMaxAge|$wgRCMaxAge}} (30 days in most [[Special:MyLanguage/Wikimedia Foundation|WMF]] projects).</span> <span id="Options"></span> ===Opcions=== <span lang="en" dir="ltr" class="mw-content-ltr">One can hide or show the following types of edits, using the corresponding links: minor edits, bot edits, one's own edits.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These can also be set in [[Special:MyLanguage/Help:Preferences|preferences]] as initial options when the user comes to [[Special:Watchlist]] page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Another preference option, although named <code>{{int|prefs-watchlist-days}}</code>, also sets only the initial value for a period of time for which changes are shown.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This period can be easily changed with corresponding links.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There is also a drop-down box that allows to see the changes only in one specific namespace. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Unlike recent changes, watchlist cannot hide edits by logged in/logged out users, there are no links to show only specific number of edits, and there is no way to show all namespaces except one. </div> <span id="Simple_watchlist"></span> === Llista de seguiment simple === <div lang="en" dir="ltr" class="mw-content-ltr"> By default watchlist only shows the last edit to each watched page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There are two possible problems if a page had a non-minor recent edit, but the last edit was marked as [[Special:MyLanguage/Help:Minor edit|minor]]: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * non-minor edits will not be shown. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Since one is typically interested in all changes since one last checked, in this case the history of the page needs to be checked.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * if watchlist is set not to show minor changes, then the page will not appear in the watchlist at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Many experienced users prefer to use Expanded Watchlist. </div> <span id="Expanded_watchlist"></span> === Llista de seguiment estesa === <div lang="en" dir="ltr" class="mw-content-ltr"> With the preference <code>{{int|tog-extendwatchlist}}</code> the watchlist will show all recent edits, listed in chronological order. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case the preference <code>{{int|tog-usenewrc}}</code>, which toggles [[Special:MyLanguage/Help:enhanced recent changes|enhanced recent changes]], also affects the watchlist the same way: recent changes of watched pages are grouped by day, and within a day by page. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Another preference option is <code>{{int|prefs-watchlist-edits}}</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">A site can limit the maximum value for this option, for example the maximum seems to be 1000 on [[Special:MyLanguage/Wikimedia Foundation|WMF]] projects.</span> <!--did not check all of them though- AlexSm--> <span lang="en" dir="ltr" class="mw-content-ltr">To show pages with older edits, view the changes by namespaces or use the non-enhanced watchlist, and/or reduce the number of watched pages.</span> <span id="Other_effects_of_watching_a_page"></span> ==Altres efectes del seguiment d'una pàgina== <div lang="en" dir="ltr" class="mw-content-ltr"> The watchlist is only one of the features with regard to watching pages; even without ever using it, specifying pages to watch is useful. </div> <span id="Recent_and_related_changes,_page_history"></span> ===Canvis recents, canvis relacionats i pàgina d'historial=== <div lang="en" dir="ltr" class="mw-content-ltr"> In [[Special:MyLanguage/Help:Recent changes|Recent Changes]], [[Special:MyLanguage/Help:Enhanced recent changes|Enhanced Recent Changes]], and [[Special:MyLanguage/Help:Related changes|Related Changes]], watched pages are bolded. </div> <span lang="en" dir="ltr" class="mw-content-ltr">If one views the [[Special:MyLanguage/Help:Page history|history]] of a watched page directly, without first viewing the page, the edit at the top (the most recent one) may be marked using update marker {{msgtxt|updatedmarker}}; this applies if the edit was made by someone else and you have not viewed the page (while logged in) since it was made.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is actually enabled together with [[#Email notification|email notification]].</span> <span id="Email_notification"></span> ===Notificacions per correu electrònic=== :''<span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Notifications}} for the 2013 extension.</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">From [[Special:MyLanguage/Release notes/1.5|MediaWiki 1.5]], you can get an email after a watched page has been edited by somebody else.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will not be repeated until you view the page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Viewing a diff or the page history is not enough.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that you have to be logged in when viewing the page, otherwise you will not be notified of further changes.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Optionally this notification system can ignore minor changes (this is the default).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whether the feature is enabled on a wiki can be seen in the [[Special:Preferences|preferences]]: if it is, the {{msgtxt|tog-enotifwatchlistpages}} will be one of the options of the main section.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The notifications for user talk edits are enabled by another preference option.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Having a separate email for every edited page that one likes to watch in the sense of the other watch features, may be too much.</span> <span lang="en" dir="ltr" class="mw-content-ltr">New features are being proposed and developed to deal with this: the option to have emails sent, after a delay, with a ''list'' of edited pages, and/or the possibility to specify a subset of watched pages for email notification.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Echo (Notifications)}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For the latter, as a workaround, one may be tempted to log in under a different username just to specify a different (typically smaller) watchlist for email notification.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, after viewing a page under one username, one would have to clear the notification flag for that page for the other username too.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ====Technical details==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To enable it on a wiki, {{ll|Manual:$wgEnotifWatchlist|$wgEnotifWatchlist}} is set to true, and it still depends on preference settings.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The email message below is:</span> <blockquote>{{msgtxt|enotif body}}</blockquote> <span lang="en" dir="ltr" class="mw-content-ltr">See [[Special:MyLanguage/Manual:Configuration_settings#Email notification (Enotif) settings|Email notification]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since May 2011 the feature is enabled on all Wikimedia projects for the user talk notifications, and since April 2012 for watchlist edits too.</span> <span lang="en" dir="ltr" class="mw-content-ltr">From early May 2012, the preference for edited pages to be added to watchlist is the default.</span> <span id="User_preferences"></span> === Preferències d'usuari === <div lang="en" dir="ltr" class="mw-content-ltr"> The following options are (or can be) available in Preferences >> User Profile tab </div> * {{int|allowemail}} * {{int|tog-ccmeonemails}} * {{int|tog-enotifwatchlistpages}} * {{int|tog-enotifusertalkpages}} * {{int|tog-enotifminoredits}} * {{int|lqt-preference-notify-talk}} <span id="Common_misunderstandings"></span> === Errors habituals === <div lang="en" dir="ltr" class="mw-content-ltr"> Email notification has many settings, so if you think you've missed something check them carefully. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * The notifications about a page that "has been created" may be about any log action (such as protection) on the page, see {{task|T16901}} and sons. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * If you don't click the link in the notification, you won't receive it next time. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Look for bolded items in your Special:Watchlist: they're pages you've not yet seen after recent changes and you won't be notified about them (note: your wiki may have hidden this essential highlighting feature).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Edits by authorised bots sometimes don't cause an email notification even if you've configured your preferences to receive one for that kind of action: namely, if they make a minor edit on your talk page and you've set (only?) <code>{{int|tog-enotifusertalkpages}}</code>, or if they make a minor edit on any page and you've set <code>{{int|tog-enotifminoredits}}</code>. </div> <span lang="en" dir="ltr" class="mw-content-ltr">This behavior is not documented nor configurable and has some bugs; see {{task|T40874}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> See also the [https://phabricator.wikimedia.org/tag/mediawiki-email/ list of known bugs]. </div> <span id="What_you_cannot_watch"></span> == Allò que no es pot fer un seguiment == <div lang="en" dir="ltr" class="mw-content-ltr"> Watchlist only detects actual edits to the wikitext of the page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ;Included pages: :Changes to transcluded pages can also change the way the watched page is rendered, however these changes do not appear in the watchlist. </div> <span lang="en" dir="ltr" class="mw-content-ltr">For more information see [[Special:MyLanguage/Help:Page history#Linking to a specific version of a page|Help:Page history#Linking to a specific version of a page]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">One may choose to watch all the templates used, and the templates used by these templates, etc.</span> ;<span lang="en" dir="ltr" class="mw-content-ltr">Actions will not appear in watchlist:</span> * {{ll|Help:Moving a page}} :<span lang="en" dir="ltr" class="mw-content-ltr">Note that after the move both the old and the new name are watched.</span> * {{ll|Help:Protecting and unprotecting pages}} :<span lang="en" dir="ltr" class="mw-content-ltr">Some projects have special templates (such as {{tl|sprotected}}) that should be added to protected pages, thus partly solving the problem.</span> * {{ll|Help:Deletion and undeletion}} :<span lang="en" dir="ltr" class="mw-content-ltr">Some projects might have a policy to add a deletion notice to the page first, or even to notify main authors on their talk pages.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">One can also periodically check [[Special:Watchlist/edit|Special:Watchlist/edit]] page and inspect all broken (red) links.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ;Images and categories :Watching an image or a category means watching only the editable part. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Watchlist will not show uploads of new versions of images.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is not possible to watch a category in the sense of being notified if pages are added or removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">With "related changes," additions to categories can be detected; for removals, one has to watch all pages in the category.</span> <span id="Watching_a_nonexistent_page"></span> ==Seguiment d'una pàgina no existent== <span lang="en" dir="ltr" class="mw-content-ltr">One can watch a nonexistent page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This page will appear in the watchlist changes when somebody creates it.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if you watch a page that does not yet have a talk page, you will be notified when someone starts a new discussion on the talk page. </div> <span lang="en" dir="ltr" class="mw-content-ltr">You can watch a page even if neither the content page nor the talk page exists.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do that, go to the page's URL, either by typing the URL directly or following a (broken) link, and then pressing <code>{{int|watchthis}}</code> (depending on the skin you may have to press <code>{{int|cancel}}</code> before getting a <code>{{int|watch}}</code> link).</span> <span id="Page_moves_and_the_watchlist"></span> ==Pàgines reanomenades i la llista de seguiment== <span lang="en" dir="ltr" class="mw-content-ltr">If a page you have watched is [[Special:MyLanguage/Help:Moving a page|moved]] to a new title, the new title will be automatically added to your watchlist.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Even if the page is later moved back, the new title will remain in your watchlist along with the old one.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Even if the new title is deleted after the page has been moved back, a note about the deletion will appear on your watchlist and the title will remain in your list of watched pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you notice mysterious nonexistent pages appearing on your watchlist, this is the most likely explanation.</span> <span id="Related_changes_feature"></span> ==Funció de canvis relacionats== : <span lang="en" dir="ltr" class="mw-content-ltr">Main article: [[w:Help:Public watchlist]]</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The "[[Special:MyLanguage/Help:Related changes#Watchlist-like functionality|Related changes]]" can be used to set up watchlist-like functionality, as explained below. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Pages with links (possibly specially created for this purpose, e.g. as subpages of one's user page) can be used with Related Changes as a collection of separate "watchlists".</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note however that unlike My Watchlist, Related Changes does not automatically include talk pages; to watch also the corresponding talk pages, links to them also have to be in the page on which Related Changes is applied.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the links to the talk pages are put just for this purpose, a blank space as link label can be used, which makes the link invisible and ineffective, except for Related Changes.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also, using Related Changes there is not the convenience of pressing a <code>{{int|watch}}</code> link to add the current page to the list of "watched pages".</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that Related Changes does not detect an edit in the page itself and its talk page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Either include a self-link and a link to the talk page in the page, or put the page in another "special watchlist", or in one's standard watchlist.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Such pages can use the template mechanism to include other pages.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Watching pages in a category by applying Related Changes to the category has a major drawback: ''removal of a page from the category is not detected''. </div> <span lang="en" dir="ltr" class="mw-content-ltr">An advantage of using Related Changes as alternative for the list of watched pages is that a revision history of the page(s) with links is available, while the system does not keep a record of pages that one has watched.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, [[Special:Watchlist/raw|Special:Watchlist/raw]] allows storage of the list: locally, or in a user subpage on the wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If privacy is a concern, an advantage of the watchlist feature (if the list is not stored in a page on the wiki) is that it does not publicly reveal one's interest in a page (if one does not edit it).</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also below.</span> ==CSS== <div lang="en" dir="ltr" class="mw-content-ltr"> As an alternative or in addition to using the watchlist feature, one can also define a [[Special:MyLanguage/Manual:Interface/Stylesheets|user style]] for links to selected pages, putting in one's [[w:Cascading Style Sheets|CSS]] a list of lines like: </div> a[title ="''pagename''"] {color: white; background: red; font-size: 150% } <div lang="en" dir="ltr" class="mw-content-ltr"> This works in Opera, but not in Internet Explorer. </div> <span lang="en" dir="ltr" class="mw-content-ltr">On the (Enhanced) Recent Changes page it works like the bolding feature mentioned above, but it is more versatile, e.g. allowing extra emphasis on pages one is ''very'' interested in, or different styles for different categories of interesting pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, it also works on user contributions pages, and on regular pages (also for piped links, but not for indirect links through a redirect).</span> <span lang="en" dir="ltr" class="mw-content-ltr">It also applies, less usefully, for the section editing links in the page itself.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To highlight links to the given page also from other websites, including interlanguage links, use instead of the above: </div> a[href ="''full URL'' "] { .. } <div lang="en" dir="ltr" class="mw-content-ltr"> Note that the full URL is needed, even to highlight links from the same project, even though the [[w:HTML|HTML]] code uses the relative URL /wiki/''pagename''. </div> <span id="Privacy_of_watchlists"></span> ==Privadesa de les llistes de seguiment== <span lang="en" dir="ltr" class="mw-content-ltr">Ordinary users or [[Special:MyLanguage/Project:Administrators|administrators]] cannot tell what is in your watchlist, or who is watching any particular page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:MyLanguage/Developers|Developer]]s who have access to the servers that hold the Wikipedia database can figure out this kind of information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Wikipedia:Database download|Publicly available database dumps]] do not include this kind of information.</span> <span id="See_also"></span> ==Vegeu també== * {{ll|Manual:watchlist table}} * [[m:Watchlist sizes for enwiki 2004-08-11|<span lang="en" dir="ltr" class="mw-content-ltr">m:Watchlist sizes for enwiki 2004-08-11</span>]] {{watchlists navigation}} [[Category:Help{{#translation:}}]] [[Category:Watchlist{{#translation:}}]] bltbds97aiiecpj6zvagjm4nop2e8le 8365116 8365087 2026-05-04T10:48:26Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-24214-58|~2026-24214-58]] ([[User talk:~2026-24214-58|talk]]) to last version by Jmarchn 8365116 wikitext text/x-wiki <languages/> {{PD Help Page|imported=yes}} '''Mirar pàgines''' la seguiment permet qualsevol [[Special:MyLanguage/Help:Logging in|logged dins]] usuari per seguir una llista de "pàgines" mirades i per ser notificat de recent edita a aquestes pàgines. MediaWiki no permet que els usuaris siguin "propietaris" de les pàgines, tot i així, la funcionalitat de "[[Special:MyLanguage/Help:Watchlist|seguiment de pàgines]]" juntament amb l'habilitat de desfer qualsevol canvi permet mantenir involucrats als usuaris interessats en cada pàgina sense els desavantatges de donar a una persona el control total sobre una pàgina. {{void|1= A més a més de la llista de seguiment incorporada al wiki, existeix una llista accessible a http://tools.wikimedia.de/~luxo/gwatch/ que permet visualitzar simultàniament canvis a tants projectes de Wikimedia com es vulgui. }} <span id="Controlling_which_pages_are_watched"></span> == Controlar quines pàgines segueixo == Només es poden seguir les pàgines que no es generen dinàmicament La pàgina es segueix juntament amb la seva pàgina de discussió corresponent Totes les modificacions de la llista de seguiment afecten a la pàgina principal i la seva discussió corresponent: no es pot seguir una de les dues sense seguir l'altra ; Mentre es visualitza la pàgina : L'estrella blanca (o l'enllaç «<code>{{int|watch}}</code>» a la pell del monollibre), situada al marge de cada pàgina, afegeix la pàgina actual a la vostra llista de seguiment i converteix l'estrella en blau (o a la pell del monollibre un «<code>{{int|unwatch}}</code>»). : El {{msgtxt|addedwatchtext}} o {{msgtxt|removedwatchtext}}, respectivament, es mostren a dalt de la pàgina i es canvia <code>{{int|watch}}</code> per <code>{{int|unwatch}}</code>. Depenent del navegador, això es duu a terme sense refrescar tota la pàgina, usant [[ca:w:Ajax|AJAX]] amb [https://phabricator.wikimedia.org/diffusion/SVN/browse/trunk/phase3/skins/common/ajaxwatch.js;78105?view=markup ajaxwatch.js] ; Mentre es desa la pàgina : Quan es desa una pàgina es pot vigilar la pàgina activant la casella <code>{{int|watchthis}}</code>. : Si s'activa la opció "<code>{{int|tog-watchdefault}}</code>" a les [[Special:MyLanguage/Help:Preferences|preferències d'usuari]], la casella estarà seleccionada per defecte, per tant si no es desmarca abans de desat, la pàgina s'afegirà a la llista de seguiment. Hi ha altres opcions: :* {{int|tog-watchcreations}} - (si l'anterior s'ha seleccionat no cal marcar-la ja que la creació de pàgines conta com una edició) :* {{int|tog-watchmoves}} :* {{int|tog-watchdeletion}} ; Editant la llista sencera : <span lang="en" dir="ltr" class="mw-content-ltr">A specific link to "{{int|rcfilters-watchlist-edit-watchlist-button}}" is provided on top of page {{#Special:Watchlist}}, and several additional links are available at top of all watchlist-related pages:</span> :* <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:EditWatchlist|{{int|watchlisttools-edit}}]] provides a paginated list of watched pages (including links to the pages and their talk pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Selecting one or several checkboxes and then clicking the "{{int|watchlistedit-table-remove-selected}}" button will remove selected pages from the list.</span> [[Help:Watchlist labels|Watchlist labels]] can also be assigned and removed from this page. :* [[{{#Special:WatchlistLabels}}|{{int:watchlisttools-labels}}]] lets you edit creat, edit, and delete [[Help:watchlist labels|watchlist labels]]. :* <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:EditWatchlist/raw|{{int|watchlisttools-raw}}]] provides a textarea with a list of watched pages (without listing the talk pages), with one title on every line, sorted by namespace number and then in [[Manual:Page naming#Alphabetical sorting in page names|alphabetic order]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">This allows editing the list directly, copying it to an external editor, or replacing it with one created elsewhere.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Duplicates are automatically removed on saving.</span> :* <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:EditWatchlist/clear|{{int|watchlisttools-clear}}]] to empty the list of watched pages.</span> :* <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:Watchlist|{{int|watchlisttools-view}}]] to show the status of the watched pages.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Watchlist Expiry ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">A new watchlist feature was added in {{ll|MediaWiki 1.35}}: Watchlist Expiry.</span> <span lang="en" dir="ltr" class="mw-content-ltr">With this feature, you can optionally select to watch a page for a temporary period of time.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once the watch period has expired, the page will be automatically removed from your watchlist.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can update the watch period at any time, including switching from temporary to permanent status.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Temporarily watched pages are usually represented by a half star (as opposed to a full star, which represents permanently watched pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">To find out when Watchlist Expiry will be enabled on your wiki, you can check out the [[m:Special:MyLanguage/Community_Tech/Watchlist_Expiry/Release_Schedule|release schedule]] on Meta-wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For documentation on how to use the feature, please visit {{ll|Help:Watchlist expiry}}.</span> <span id="Watchlist"></span> ==Llista de seguiment== <span lang="en" dir="ltr" class="mw-content-ltr">When the user is [[Special:MyLanguage/Help:Logging in|logged in]], every page has a link to the user's watchlist, also accessible by the link [[Special:Watchlist]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">This page shows a list of all recently changed watched pages, separated by days, ordered backward according to the time of the edit.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each line shows details of each edit: whether [[Special:MyLanguage/Help:Minor edit|minor]] ('''{{int|minoreditletter}}''') or major, whether made by a [[Special:MyLanguage/bot|bot]] ('''{{int|boteditletter}}'''), the time, a link to the page, the difference between the current version and the last one, the history, the increase or decrease of the number of bytes, the user name, the user's talk page, the user's contributions and the edit summary.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Depending on site configuration, the page name is bolded if the page has changed after the last time the user viewed the page (while logged in).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Technically, the watchlist is just another way to filter [[Special:MyLanguage/Help:Recent changes|recent changes]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The entries come from the {{ll|Manual:recentchanges table|recentchanges}} table and are therefore restricted to edits not older than {{ll|Manual:$wgRCMaxAge|$wgRCMaxAge}} (30 days in most [[Special:MyLanguage/Wikimedia Foundation|WMF]] projects).</span> <span id="Options"></span> ===Opcions=== <span lang="en" dir="ltr" class="mw-content-ltr">One can hide or show the following types of edits, using the corresponding links: minor edits, bot edits, one's own edits.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These can also be set in [[Special:MyLanguage/Help:Preferences|preferences]] as initial options when the user comes to [[Special:Watchlist]] page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Another preference option, although named <code>{{int|prefs-watchlist-days}}</code>, also sets only the initial value for a period of time for which changes are shown.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This period can be easily changed with corresponding links.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There is also a drop-down box that allows to see the changes only in one specific namespace. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Unlike recent changes, watchlist cannot hide edits by logged in/logged out users, there are no links to show only specific number of edits, and there is no way to show all namespaces except one. </div> <span id="Simple_watchlist"></span> === Llista de seguiment simple === <div lang="en" dir="ltr" class="mw-content-ltr"> By default watchlist only shows the last edit to each watched page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There are two possible problems if a page had a non-minor recent edit, but the last edit was marked as [[Special:MyLanguage/Help:Minor edit|minor]]: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * non-minor edits will not be shown. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Since one is typically interested in all changes since one last checked, in this case the history of the page needs to be checked.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * if watchlist is set not to show minor changes, then the page will not appear in the watchlist at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Many experienced users prefer to use Expanded Watchlist. </div> <span id="Expanded_watchlist"></span> === Llista de seguiment estesa === <div lang="en" dir="ltr" class="mw-content-ltr"> With the preference <code>{{int|tog-extendwatchlist}}</code> the watchlist will show all recent edits, listed in chronological order. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case the preference <code>{{int|tog-usenewrc}}</code>, which toggles [[Special:MyLanguage/Help:enhanced recent changes|enhanced recent changes]], also affects the watchlist the same way: recent changes of watched pages are grouped by day, and within a day by page. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Another preference option is <code>{{int|prefs-watchlist-edits}}</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">A site can limit the maximum value for this option, for example the maximum seems to be 1000 on [[Special:MyLanguage/Wikimedia Foundation|WMF]] projects.</span> <!--did not check all of them though- AlexSm--> <span lang="en" dir="ltr" class="mw-content-ltr">To show pages with older edits, view the changes by namespaces or use the non-enhanced watchlist, and/or reduce the number of watched pages.</span> <span id="Other_effects_of_watching_a_page"></span> ==Altres efectes del seguiment d'una pàgina== <div lang="en" dir="ltr" class="mw-content-ltr"> The watchlist is only one of the features with regard to watching pages; even without ever using it, specifying pages to watch is useful. </div> <span id="Recent_and_related_changes,_page_history"></span> ===Canvis recents, canvis relacionats i pàgina d'historial=== <div lang="en" dir="ltr" class="mw-content-ltr"> In [[Special:MyLanguage/Help:Recent changes|Recent Changes]], [[Special:MyLanguage/Help:Enhanced recent changes|Enhanced Recent Changes]], and [[Special:MyLanguage/Help:Related changes|Related Changes]], watched pages are bolded. </div> <span lang="en" dir="ltr" class="mw-content-ltr">If one views the [[Special:MyLanguage/Help:Page history|history]] of a watched page directly, without first viewing the page, the edit at the top (the most recent one) may be marked using update marker {{msgtxt|updatedmarker}}; this applies if the edit was made by someone else and you have not viewed the page (while logged in) since it was made.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is actually enabled together with [[#Email notification|email notification]].</span> <span id="Email_notification"></span> ===Notificacions per correu electrònic=== :''<span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Notifications}} for the 2013 extension.</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">From [[Special:MyLanguage/Release notes/1.5|MediaWiki 1.5]], you can get an email after a watched page has been edited by somebody else.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will not be repeated until you view the page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Viewing a diff or the page history is not enough.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that you have to be logged in when viewing the page, otherwise you will not be notified of further changes.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Optionally this notification system can ignore minor changes (this is the default).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whether the feature is enabled on a wiki can be seen in the [[Special:Preferences|preferences]]: if it is, the {{msgtxt|tog-enotifwatchlistpages}} will be one of the options of the main section.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The notifications for user talk edits are enabled by another preference option.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Having a separate email for every edited page that one likes to watch in the sense of the other watch features, may be too much.</span> <span lang="en" dir="ltr" class="mw-content-ltr">New features are being proposed and developed to deal with this: the option to have emails sent, after a delay, with a ''list'' of edited pages, and/or the possibility to specify a subset of watched pages for email notification.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Echo (Notifications)}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For the latter, as a workaround, one may be tempted to log in under a different username just to specify a different (typically smaller) watchlist for email notification.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, after viewing a page under one username, one would have to clear the notification flag for that page for the other username too.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ====Technical details==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To enable it on a wiki, {{ll|Manual:$wgEnotifWatchlist|$wgEnotifWatchlist}} is set to true, and it still depends on preference settings.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The email message below is:</span> <blockquote>{{msgtxt|enotif body}}</blockquote> <span lang="en" dir="ltr" class="mw-content-ltr">See [[Special:MyLanguage/Manual:Configuration_settings#Email notification (Enotif) settings|Email notification]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since May 2011 the feature is enabled on all Wikimedia projects for the user talk notifications, and since April 2012 for watchlist edits too.</span> <span lang="en" dir="ltr" class="mw-content-ltr">From early May 2012, the preference for edited pages to be added to watchlist is the default.</span> <span id="User_preferences"></span> === Preferències d'usuari === <div lang="en" dir="ltr" class="mw-content-ltr"> The following options are (or can be) available in Preferences >> User Profile tab </div> * {{int|allowemail}} * {{int|tog-ccmeonemails}} * {{int|tog-enotifwatchlistpages}} * {{int|tog-enotifusertalkpages}} * {{int|tog-enotifminoredits}} * {{int|lqt-preference-notify-talk}} <span id="Common_misunderstandings"></span> === Errors habituals === <div lang="en" dir="ltr" class="mw-content-ltr"> Email notification has many settings, so if you think you've missed something check them carefully. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * The notifications about a page that "has been created" may be about any log action (such as protection) on the page, see {{task|T16901}} and sons. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * If you don't click the link in the notification, you won't receive it next time. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Look for bolded items in your Special:Watchlist: they're pages you've not yet seen after recent changes and you won't be notified about them (note: your wiki may have hidden this essential highlighting feature).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Edits by authorised bots sometimes don't cause an email notification even if you've configured your preferences to receive one for that kind of action: namely, if they make a minor edit on your talk page and you've set (only?) <code>{{int|tog-enotifusertalkpages}}</code>, or if they make a minor edit on any page and you've set <code>{{int|tog-enotifminoredits}}</code>. </div> <span lang="en" dir="ltr" class="mw-content-ltr">This behavior is not documented nor configurable and has some bugs; see {{task|T40874}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> See also the [https://phabricator.wikimedia.org/tag/mediawiki-email/ list of known bugs]. </div> <span id="What_you_cannot_watch"></span> == Allò que no es pot fer un seguiment == <div lang="en" dir="ltr" class="mw-content-ltr"> Watchlist only detects actual edits to the wikitext of the page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ;Included pages: :Changes to transcluded pages can also change the way the watched page is rendered, however these changes do not appear in the watchlist. </div> <span lang="en" dir="ltr" class="mw-content-ltr">For more information see [[Special:MyLanguage/Help:Page history#Linking to a specific version of a page|Help:Page history#Linking to a specific version of a page]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">One may choose to watch all the templates used, and the templates used by these templates, etc.</span> ;<span lang="en" dir="ltr" class="mw-content-ltr">Actions will not appear in watchlist:</span> * {{ll|Help:Moving a page}} :<span lang="en" dir="ltr" class="mw-content-ltr">Note that after the move both the old and the new name are watched.</span> * {{ll|Help:Protecting and unprotecting pages}} :<span lang="en" dir="ltr" class="mw-content-ltr">Some projects have special templates (such as {{tl|sprotected}}) that should be added to protected pages, thus partly solving the problem.</span> * {{ll|Help:Deletion and undeletion}} :<span lang="en" dir="ltr" class="mw-content-ltr">Some projects might have a policy to add a deletion notice to the page first, or even to notify main authors on their talk pages.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">One can also periodically check [[Special:Watchlist/edit|Special:Watchlist/edit]] page and inspect all broken (red) links.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ;Images and categories :Watching an image or a category means watching only the editable part. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Watchlist will not show uploads of new versions of images.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is not possible to watch a category in the sense of being notified if pages are added or removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">With "related changes," additions to categories can be detected; for removals, one has to watch all pages in the category.</span> <span id="Watching_a_nonexistent_page"></span> ==Seguiment d'una pàgina no existent== <span lang="en" dir="ltr" class="mw-content-ltr">One can watch a nonexistent page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This page will appear in the watchlist changes when somebody creates it.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if you watch a page that does not yet have a talk page, you will be notified when someone starts a new discussion on the talk page. </div> <span lang="en" dir="ltr" class="mw-content-ltr">You can watch a page even if neither the content page nor the talk page exists.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do that, go to the page's URL, either by typing the URL directly or following a (broken) link, and then pressing <code>{{int|watchthis}}</code> (depending on the skin you may have to press <code>{{int|cancel}}</code> before getting a <code>{{int|watch}}</code> link).</span> <span id="Page_moves_and_the_watchlist"></span> ==Pàgines reanomenades i la llista de seguiment== <span lang="en" dir="ltr" class="mw-content-ltr">If a page you have watched is [[Special:MyLanguage/Help:Moving a page|moved]] to a new title, the new title will be automatically added to your watchlist.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Even if the page is later moved back, the new title will remain in your watchlist along with the old one.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Even if the new title is deleted after the page has been moved back, a note about the deletion will appear on your watchlist and the title will remain in your list of watched pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you notice mysterious nonexistent pages appearing on your watchlist, this is the most likely explanation.</span> <span id="Related_changes_feature"></span> ==Funció de canvis relacionats== : <span lang="en" dir="ltr" class="mw-content-ltr">Main article: [[w:Help:Public watchlist]]</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The "[[Special:MyLanguage/Help:Related changes#Watchlist-like functionality|Related changes]]" can be used to set up watchlist-like functionality, as explained below. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Pages with links (possibly specially created for this purpose, e.g. as subpages of one's user page) can be used with Related Changes as a collection of separate "watchlists".</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note however that unlike My Watchlist, Related Changes does not automatically include talk pages; to watch also the corresponding talk pages, links to them also have to be in the page on which Related Changes is applied.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the links to the talk pages are put just for this purpose, a blank space as link label can be used, which makes the link invisible and ineffective, except for Related Changes.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also, using Related Changes there is not the convenience of pressing a <code>{{int|watch}}</code> link to add the current page to the list of "watched pages".</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that Related Changes does not detect an edit in the page itself and its talk page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Either include a self-link and a link to the talk page in the page, or put the page in another "special watchlist", or in one's standard watchlist.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Such pages can use the template mechanism to include other pages.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Watching pages in a category by applying Related Changes to the category has a major drawback: ''removal of a page from the category is not detected''. </div> <span lang="en" dir="ltr" class="mw-content-ltr">An advantage of using Related Changes as alternative for the list of watched pages is that a revision history of the page(s) with links is available, while the system does not keep a record of pages that one has watched.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, [[Special:Watchlist/raw|Special:Watchlist/raw]] allows storage of the list: locally, or in a user subpage on the wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If privacy is a concern, an advantage of the watchlist feature (if the list is not stored in a page on the wiki) is that it does not publicly reveal one's interest in a page (if one does not edit it).</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also below.</span> ==CSS== <div lang="en" dir="ltr" class="mw-content-ltr"> As an alternative or in addition to using the watchlist feature, one can also define a [[Special:MyLanguage/Manual:Interface/Stylesheets|user style]] for links to selected pages, putting in one's [[w:Cascading Style Sheets|CSS]] a list of lines like: </div> a[title ="''pagename''"] {color: white; background: red; font-size: 150% } <div lang="en" dir="ltr" class="mw-content-ltr"> This works in Opera, but not in Internet Explorer. </div> <span lang="en" dir="ltr" class="mw-content-ltr">On the (Enhanced) Recent Changes page it works like the bolding feature mentioned above, but it is more versatile, e.g. allowing extra emphasis on pages one is ''very'' interested in, or different styles for different categories of interesting pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, it also works on user contributions pages, and on regular pages (also for piped links, but not for indirect links through a redirect).</span> <span lang="en" dir="ltr" class="mw-content-ltr">It also applies, less usefully, for the section editing links in the page itself.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To highlight links to the given page also from other websites, including interlanguage links, use instead of the above: </div> a[href ="''full URL'' "] { .. } <div lang="en" dir="ltr" class="mw-content-ltr"> Note that the full URL is needed, even to highlight links from the same project, even though the [[w:HTML|HTML]] code uses the relative URL /wiki/''pagename''. </div> <span id="Privacy_of_watchlists"></span> ==Privadesa de les llistes de seguiment== <span lang="en" dir="ltr" class="mw-content-ltr">Ordinary users or [[Special:MyLanguage/Project:Administrators|administrators]] cannot tell what is in your watchlist, or who is watching any particular page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:MyLanguage/Developers|Developer]]s who have access to the servers that hold the Wikipedia database can figure out this kind of information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Wikipedia:Database download|Publicly available database dumps]] do not include this kind of information.</span> <span id="See_also"></span> ==Vegeu també== * {{ll|Manual:watchlist table}} * [[m:Watchlist sizes for enwiki 2004-08-11|<span lang="en" dir="ltr" class="mw-content-ltr">m:Watchlist sizes for enwiki 2004-08-11</span>]] {{watchlists navigation}} [[Category:Help{{#translation:}}]] [[Category:Watchlist{{#translation:}}]] lu0hs9boa7caowxhbvfedbbognqmh4t 8365118 8365116 2026-05-04T10:49:12Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-24214-58|~2026-24214-58]] ([[User talk:~2026-24214-58|talk]]) to last version by Jmarchn 8365118 wikitext text/x-wiki <languages/> {{PD Help Page|imported=yes}} La funció de '''seguiment de pàgines''' permet a qualsevol usuari que s'hagi [[Special:MyLanguage/Help:Logging in|identificat]] mantenir una llista pàgines controlades i rebre notificacions dels canvis recents en aquestes pàgines. MediaWiki no permet que els usuaris siguin "propietaris" de les pàgines, tot i així, la funcionalitat de "[[Special:MyLanguage/Help:Watchlist|seguiment de pàgines]]" juntament amb l'habilitat de desfer qualsevol canvi permet mantenir involucrats als usuaris interessats en cada pàgina sense els desavantatges de donar a una persona el control total sobre una pàgina. {{void|1= A més a més de la llista de seguiment incorporada al wiki, existeix una llista accessible a http://tools.wikimedia.de/~luxo/gwatch/ que permet visualitzar simultàniament canvis a tants projectes de Wikimedia com es vulgui. }} <span id="Controlling_which_pages_are_watched"></span> == Controlar quines pàgines segueixo == Només es poden seguir les pàgines que no es generen dinàmicament La pàgina es segueix juntament amb la seva pàgina de discussió corresponent Totes les modificacions de la llista de seguiment afecten a la pàgina principal i la seva discussió corresponent: no es pot seguir una de les dues sense seguir l'altra ; Mentre es visualitza la pàgina : L'estrella blanca (o l'enllaç «<code>{{int|watch}}</code>» a la pell del monollibre), situada al marge de cada pàgina, afegeix la pàgina actual a la vostra llista de seguiment i converteix l'estrella en blau (o a la pell del monollibre un «<code>{{int|unwatch}}</code>»). : El {{msgtxt|addedwatchtext}} o {{msgtxt|removedwatchtext}}, respectivament, es mostren a dalt de la pàgina i es canvia <code>{{int|watch}}</code> per <code>{{int|unwatch}}</code>. Depenent del navegador, això es duu a terme sense refrescar tota la pàgina, usant [[ca:w:Ajax|AJAX]] amb [https://phabricator.wikimedia.org/diffusion/SVN/browse/trunk/phase3/skins/common/ajaxwatch.js;78105?view=markup ajaxwatch.js] ; Mentre es desa la pàgina : Quan es desa una pàgina es pot vigilar la pàgina activant la casella <code>{{int|watchthis}}</code>. : Si s'activa la opció "<code>{{int|tog-watchdefault}}</code>" a les [[Special:MyLanguage/Help:Preferences|preferències d'usuari]], la casella estarà seleccionada per defecte, per tant si no es desmarca abans de desat, la pàgina s'afegirà a la llista de seguiment. Hi ha altres opcions: :* {{int|tog-watchcreations}} - (si l'anterior s'ha seleccionat no cal marcar-la ja que la creació de pàgines conta com una edició) :* {{int|tog-watchmoves}} :* {{int|tog-watchdeletion}} ; Editant la llista sencera : <span lang="en" dir="ltr" class="mw-content-ltr">A specific link to "{{int|rcfilters-watchlist-edit-watchlist-button}}" is provided on top of page {{#Special:Watchlist}}, and several additional links are available at top of all watchlist-related pages:</span> :* <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:EditWatchlist|{{int|watchlisttools-edit}}]] provides a paginated list of watched pages (including links to the pages and their talk pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Selecting one or several checkboxes and then clicking the "{{int|watchlistedit-table-remove-selected}}" button will remove selected pages from the list.</span> [[Help:Watchlist labels|Watchlist labels]] can also be assigned and removed from this page. :* [[{{#Special:WatchlistLabels}}|{{int:watchlisttools-labels}}]] lets you edit creat, edit, and delete [[Help:watchlist labels|watchlist labels]]. :* <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:EditWatchlist/raw|{{int|watchlisttools-raw}}]] provides a textarea with a list of watched pages (without listing the talk pages), with one title on every line, sorted by namespace number and then in [[Manual:Page naming#Alphabetical sorting in page names|alphabetic order]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">This allows editing the list directly, copying it to an external editor, or replacing it with one created elsewhere.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Duplicates are automatically removed on saving.</span> :* <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:EditWatchlist/clear|{{int|watchlisttools-clear}}]] to empty the list of watched pages.</span> :* <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:Watchlist|{{int|watchlisttools-view}}]] to show the status of the watched pages.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Watchlist Expiry ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">A new watchlist feature was added in {{ll|MediaWiki 1.35}}: Watchlist Expiry.</span> <span lang="en" dir="ltr" class="mw-content-ltr">With this feature, you can optionally select to watch a page for a temporary period of time.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once the watch period has expired, the page will be automatically removed from your watchlist.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can update the watch period at any time, including switching from temporary to permanent status.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Temporarily watched pages are usually represented by a half star (as opposed to a full star, which represents permanently watched pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">To find out when Watchlist Expiry will be enabled on your wiki, you can check out the [[m:Special:MyLanguage/Community_Tech/Watchlist_Expiry/Release_Schedule|release schedule]] on Meta-wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For documentation on how to use the feature, please visit {{ll|Help:Watchlist expiry}}.</span> <span id="Watchlist"></span> ==Llista de seguiment== <span lang="en" dir="ltr" class="mw-content-ltr">When the user is [[Special:MyLanguage/Help:Logging in|logged in]], every page has a link to the user's watchlist, also accessible by the link [[Special:Watchlist]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">This page shows a list of all recently changed watched pages, separated by days, ordered backward according to the time of the edit.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each line shows details of each edit: whether [[Special:MyLanguage/Help:Minor edit|minor]] ('''{{int|minoreditletter}}''') or major, whether made by a [[Special:MyLanguage/bot|bot]] ('''{{int|boteditletter}}'''), the time, a link to the page, the difference between the current version and the last one, the history, the increase or decrease of the number of bytes, the user name, the user's talk page, the user's contributions and the edit summary.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Depending on site configuration, the page name is bolded if the page has changed after the last time the user viewed the page (while logged in).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Technically, the watchlist is just another way to filter [[Special:MyLanguage/Help:Recent changes|recent changes]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The entries come from the {{ll|Manual:recentchanges table|recentchanges}} table and are therefore restricted to edits not older than {{ll|Manual:$wgRCMaxAge|$wgRCMaxAge}} (30 days in most [[Special:MyLanguage/Wikimedia Foundation|WMF]] projects).</span> <span id="Options"></span> ===Opcions=== <span lang="en" dir="ltr" class="mw-content-ltr">One can hide or show the following types of edits, using the corresponding links: minor edits, bot edits, one's own edits.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These can also be set in [[Special:MyLanguage/Help:Preferences|preferences]] as initial options when the user comes to [[Special:Watchlist]] page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Another preference option, although named <code>{{int|prefs-watchlist-days}}</code>, also sets only the initial value for a period of time for which changes are shown.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This period can be easily changed with corresponding links.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There is also a drop-down box that allows to see the changes only in one specific namespace. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Unlike recent changes, watchlist cannot hide edits by logged in/logged out users, there are no links to show only specific number of edits, and there is no way to show all namespaces except one. </div> <span id="Simple_watchlist"></span> === Llista de seguiment simple === <div lang="en" dir="ltr" class="mw-content-ltr"> By default watchlist only shows the last edit to each watched page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There are two possible problems if a page had a non-minor recent edit, but the last edit was marked as [[Special:MyLanguage/Help:Minor edit|minor]]: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * non-minor edits will not be shown. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Since one is typically interested in all changes since one last checked, in this case the history of the page needs to be checked.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * if watchlist is set not to show minor changes, then the page will not appear in the watchlist at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Many experienced users prefer to use Expanded Watchlist. </div> <span id="Expanded_watchlist"></span> === Llista de seguiment estesa === <div lang="en" dir="ltr" class="mw-content-ltr"> With the preference <code>{{int|tog-extendwatchlist}}</code> the watchlist will show all recent edits, listed in chronological order. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case the preference <code>{{int|tog-usenewrc}}</code>, which toggles [[Special:MyLanguage/Help:enhanced recent changes|enhanced recent changes]], also affects the watchlist the same way: recent changes of watched pages are grouped by day, and within a day by page. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Another preference option is <code>{{int|prefs-watchlist-edits}}</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">A site can limit the maximum value for this option, for example the maximum seems to be 1000 on [[Special:MyLanguage/Wikimedia Foundation|WMF]] projects.</span> <!--did not check all of them though- AlexSm--> <span lang="en" dir="ltr" class="mw-content-ltr">To show pages with older edits, view the changes by namespaces or use the non-enhanced watchlist, and/or reduce the number of watched pages.</span> <span id="Other_effects_of_watching_a_page"></span> ==Altres efectes del seguiment d'una pàgina== <div lang="en" dir="ltr" class="mw-content-ltr"> The watchlist is only one of the features with regard to watching pages; even without ever using it, specifying pages to watch is useful. </div> <span id="Recent_and_related_changes,_page_history"></span> ===Canvis recents, canvis relacionats i pàgina d'historial=== <div lang="en" dir="ltr" class="mw-content-ltr"> In [[Special:MyLanguage/Help:Recent changes|Recent Changes]], [[Special:MyLanguage/Help:Enhanced recent changes|Enhanced Recent Changes]], and [[Special:MyLanguage/Help:Related changes|Related Changes]], watched pages are bolded. </div> <span lang="en" dir="ltr" class="mw-content-ltr">If one views the [[Special:MyLanguage/Help:Page history|history]] of a watched page directly, without first viewing the page, the edit at the top (the most recent one) may be marked using update marker {{msgtxt|updatedmarker}}; this applies if the edit was made by someone else and you have not viewed the page (while logged in) since it was made.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is actually enabled together with [[#Email notification|email notification]].</span> <span id="Email_notification"></span> ===Notificacions per correu electrònic=== :''<span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Notifications}} for the 2013 extension.</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">From [[Special:MyLanguage/Release notes/1.5|MediaWiki 1.5]], you can get an email after a watched page has been edited by somebody else.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will not be repeated until you view the page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Viewing a diff or the page history is not enough.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that you have to be logged in when viewing the page, otherwise you will not be notified of further changes.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Optionally this notification system can ignore minor changes (this is the default).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whether the feature is enabled on a wiki can be seen in the [[Special:Preferences|preferences]]: if it is, the {{msgtxt|tog-enotifwatchlistpages}} will be one of the options of the main section.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The notifications for user talk edits are enabled by another preference option.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Having a separate email for every edited page that one likes to watch in the sense of the other watch features, may be too much.</span> <span lang="en" dir="ltr" class="mw-content-ltr">New features are being proposed and developed to deal with this: the option to have emails sent, after a delay, with a ''list'' of edited pages, and/or the possibility to specify a subset of watched pages for email notification.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Echo (Notifications)}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For the latter, as a workaround, one may be tempted to log in under a different username just to specify a different (typically smaller) watchlist for email notification.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, after viewing a page under one username, one would have to clear the notification flag for that page for the other username too.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ====Technical details==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To enable it on a wiki, {{ll|Manual:$wgEnotifWatchlist|$wgEnotifWatchlist}} is set to true, and it still depends on preference settings.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The email message below is:</span> <blockquote>{{msgtxt|enotif body}}</blockquote> <span lang="en" dir="ltr" class="mw-content-ltr">See [[Special:MyLanguage/Manual:Configuration_settings#Email notification (Enotif) settings|Email notification]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since May 2011 the feature is enabled on all Wikimedia projects for the user talk notifications, and since April 2012 for watchlist edits too.</span> <span lang="en" dir="ltr" class="mw-content-ltr">From early May 2012, the preference for edited pages to be added to watchlist is the default.</span> <span id="User_preferences"></span> === Preferències d'usuari === <div lang="en" dir="ltr" class="mw-content-ltr"> The following options are (or can be) available in Preferences >> User Profile tab </div> * {{int|allowemail}} * {{int|tog-ccmeonemails}} * {{int|tog-enotifwatchlistpages}} * {{int|tog-enotifusertalkpages}} * {{int|tog-enotifminoredits}} * {{int|lqt-preference-notify-talk}} <span id="Common_misunderstandings"></span> === Errors habituals === <div lang="en" dir="ltr" class="mw-content-ltr"> Email notification has many settings, so if you think you've missed something check them carefully. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * The notifications about a page that "has been created" may be about any log action (such as protection) on the page, see {{task|T16901}} and sons. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * If you don't click the link in the notification, you won't receive it next time. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Look for bolded items in your Special:Watchlist: they're pages you've not yet seen after recent changes and you won't be notified about them (note: your wiki may have hidden this essential highlighting feature).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Edits by authorised bots sometimes don't cause an email notification even if you've configured your preferences to receive one for that kind of action: namely, if they make a minor edit on your talk page and you've set (only?) <code>{{int|tog-enotifusertalkpages}}</code>, or if they make a minor edit on any page and you've set <code>{{int|tog-enotifminoredits}}</code>. </div> <span lang="en" dir="ltr" class="mw-content-ltr">This behavior is not documented nor configurable and has some bugs; see {{task|T40874}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> See also the [https://phabricator.wikimedia.org/tag/mediawiki-email/ list of known bugs]. </div> <span id="What_you_cannot_watch"></span> == Allò que no es pot fer un seguiment == <div lang="en" dir="ltr" class="mw-content-ltr"> Watchlist only detects actual edits to the wikitext of the page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ;Included pages: :Changes to transcluded pages can also change the way the watched page is rendered, however these changes do not appear in the watchlist. </div> <span lang="en" dir="ltr" class="mw-content-ltr">For more information see [[Special:MyLanguage/Help:Page history#Linking to a specific version of a page|Help:Page history#Linking to a specific version of a page]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">One may choose to watch all the templates used, and the templates used by these templates, etc.</span> ;<span lang="en" dir="ltr" class="mw-content-ltr">Actions will not appear in watchlist:</span> * {{ll|Help:Moving a page}} :<span lang="en" dir="ltr" class="mw-content-ltr">Note that after the move both the old and the new name are watched.</span> * {{ll|Help:Protecting and unprotecting pages}} :<span lang="en" dir="ltr" class="mw-content-ltr">Some projects have special templates (such as {{tl|sprotected}}) that should be added to protected pages, thus partly solving the problem.</span> * {{ll|Help:Deletion and undeletion}} :<span lang="en" dir="ltr" class="mw-content-ltr">Some projects might have a policy to add a deletion notice to the page first, or even to notify main authors on their talk pages.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">One can also periodically check [[Special:Watchlist/edit|Special:Watchlist/edit]] page and inspect all broken (red) links.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ;Images and categories :Watching an image or a category means watching only the editable part. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Watchlist will not show uploads of new versions of images.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is not possible to watch a category in the sense of being notified if pages are added or removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">With "related changes," additions to categories can be detected; for removals, one has to watch all pages in the category.</span> <span id="Watching_a_nonexistent_page"></span> ==Seguiment d'una pàgina no existent== <span lang="en" dir="ltr" class="mw-content-ltr">One can watch a nonexistent page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This page will appear in the watchlist changes when somebody creates it.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if you watch a page that does not yet have a talk page, you will be notified when someone starts a new discussion on the talk page. </div> <span lang="en" dir="ltr" class="mw-content-ltr">You can watch a page even if neither the content page nor the talk page exists.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do that, go to the page's URL, either by typing the URL directly or following a (broken) link, and then pressing <code>{{int|watchthis}}</code> (depending on the skin you may have to press <code>{{int|cancel}}</code> before getting a <code>{{int|watch}}</code> link).</span> <span id="Page_moves_and_the_watchlist"></span> ==Pàgines reanomenades i la llista de seguiment== <span lang="en" dir="ltr" class="mw-content-ltr">If a page you have watched is [[Special:MyLanguage/Help:Moving a page|moved]] to a new title, the new title will be automatically added to your watchlist.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Even if the page is later moved back, the new title will remain in your watchlist along with the old one.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Even if the new title is deleted after the page has been moved back, a note about the deletion will appear on your watchlist and the title will remain in your list of watched pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you notice mysterious nonexistent pages appearing on your watchlist, this is the most likely explanation.</span> <span id="Related_changes_feature"></span> ==Funció de canvis relacionats== : <span lang="en" dir="ltr" class="mw-content-ltr">Main article: [[w:Help:Public watchlist]]</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The "[[Special:MyLanguage/Help:Related changes#Watchlist-like functionality|Related changes]]" can be used to set up watchlist-like functionality, as explained below. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Pages with links (possibly specially created for this purpose, e.g. as subpages of one's user page) can be used with Related Changes as a collection of separate "watchlists".</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note however that unlike My Watchlist, Related Changes does not automatically include talk pages; to watch also the corresponding talk pages, links to them also have to be in the page on which Related Changes is applied.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the links to the talk pages are put just for this purpose, a blank space as link label can be used, which makes the link invisible and ineffective, except for Related Changes.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also, using Related Changes there is not the convenience of pressing a <code>{{int|watch}}</code> link to add the current page to the list of "watched pages".</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that Related Changes does not detect an edit in the page itself and its talk page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Either include a self-link and a link to the talk page in the page, or put the page in another "special watchlist", or in one's standard watchlist.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Such pages can use the template mechanism to include other pages.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Watching pages in a category by applying Related Changes to the category has a major drawback: ''removal of a page from the category is not detected''. </div> <span lang="en" dir="ltr" class="mw-content-ltr">An advantage of using Related Changes as alternative for the list of watched pages is that a revision history of the page(s) with links is available, while the system does not keep a record of pages that one has watched.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, [[Special:Watchlist/raw|Special:Watchlist/raw]] allows storage of the list: locally, or in a user subpage on the wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If privacy is a concern, an advantage of the watchlist feature (if the list is not stored in a page on the wiki) is that it does not publicly reveal one's interest in a page (if one does not edit it).</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also below.</span> ==CSS== <div lang="en" dir="ltr" class="mw-content-ltr"> As an alternative or in addition to using the watchlist feature, one can also define a [[Special:MyLanguage/Manual:Interface/Stylesheets|user style]] for links to selected pages, putting in one's [[w:Cascading Style Sheets|CSS]] a list of lines like: </div> a[title ="''pagename''"] {color: white; background: red; font-size: 150% } <div lang="en" dir="ltr" class="mw-content-ltr"> This works in Opera, but not in Internet Explorer. </div> <span lang="en" dir="ltr" class="mw-content-ltr">On the (Enhanced) Recent Changes page it works like the bolding feature mentioned above, but it is more versatile, e.g. allowing extra emphasis on pages one is ''very'' interested in, or different styles for different categories of interesting pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, it also works on user contributions pages, and on regular pages (also for piped links, but not for indirect links through a redirect).</span> <span lang="en" dir="ltr" class="mw-content-ltr">It also applies, less usefully, for the section editing links in the page itself.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To highlight links to the given page also from other websites, including interlanguage links, use instead of the above: </div> a[href ="''full URL'' "] { .. } <div lang="en" dir="ltr" class="mw-content-ltr"> Note that the full URL is needed, even to highlight links from the same project, even though the [[w:HTML|HTML]] code uses the relative URL /wiki/''pagename''. </div> <span id="Privacy_of_watchlists"></span> ==Privadesa de les llistes de seguiment== <span lang="en" dir="ltr" class="mw-content-ltr">Ordinary users or [[Special:MyLanguage/Project:Administrators|administrators]] cannot tell what is in your watchlist, or who is watching any particular page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">[[Special:MyLanguage/Developers|Developer]]s who have access to the servers that hold the Wikipedia database can figure out this kind of information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Wikipedia:Database download|Publicly available database dumps]] do not include this kind of information.</span> <span id="See_also"></span> ==Vegeu també== * {{ll|Manual:watchlist table}} * [[m:Watchlist sizes for enwiki 2004-08-11|<span lang="en" dir="ltr" class="mw-content-ltr">m:Watchlist sizes for enwiki 2004-08-11</span>]] {{watchlists navigation}} [[Category:Help{{#translation:}}]] [[Category:Watchlist{{#translation:}}]] fon6ooc5gu3t1926bopijau5yhwpn1t Translations:Help:Watching pages/1/ca 1198 453685 8365084 8129813 2026-05-04T08:41:44Z ~2026-24214-58 18357906 8365084 wikitext text/x-wiki '''Mirar pàgines''' la seguiment permet qualsevol [[$login|logged dins]] usuari per seguir una llista de "pàgines" mirades i per ser notificat de recent edita a aquestes pàgines. ghcw61od3dvele19buoc2cez8u16gtn 8365117 8365084 2026-05-04T10:49:11Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-24214-58|~2026-24214-58]] ([[User talk:~2026-24214-58|talk]]) to last version by Jmarchn 8129813 wikitext text/x-wiki La funció de '''seguiment de pàgines''' permet a qualsevol usuari que s'hagi [[$login|identificat]] mantenir una llista pàgines controlades i rebre notificacions dels canvis recents en aquestes pàgines. 6ngx1h57fu5r05ywemdyd7o9jf2mui7 Translations:Help:Watching pages/2/ca 1198 453686 8365086 6199001 2026-05-04T08:43:01Z ~2026-24214-58 18357906 8365086 wikitext text/x-wiki MediaWiki no permet que els usuaris siguin "MediaWiki" de les pàgines, tot i així, la funcionalitat de "[[$1|seguiment de pàgines]]" juntament amb l'habilitat de desfer qualsevol canvi permet mantenir involucrats als usuaris interessats en cada pàgina sense els desavantatges de donar a una persona el control total sobre una pàgina. 8r1fc9egrdm1jobw3kipvo2qiri89cc 8365115 8365086 2026-05-04T10:48:25Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-24214-58|~2026-24214-58]] ([[User talk:~2026-24214-58|talk]]) to last version by Jmarchn 6199001 wikitext text/x-wiki MediaWiki no permet que els usuaris siguin "propietaris" de les pàgines, tot i així, la funcionalitat de "[[$1|seguiment de pàgines]]" juntament amb l'habilitat de desfer qualsevol canvi permet mantenir involucrats als usuaris interessats en cada pàgina sense els desavantatges de donar a una persona el control total sobre una pàgina. t83ceatu7nyqrl1om1ew765bye1ti39 Help:VisualEditor/User guide/Citation templates 12 458802 8365043 8246099 2026-05-04T06:52:55Z TzrZzz 18352707 Corrected the scope of the translate element. Corrected areas where the code element was not set. 8365043 wikitext text/x-wiki <languages/> {{PD Help Page}} <translate> <!--T:1--> This page is '''a guide to adding footnotes (also called "citations", "inline citations" or "references")''' when local citation templates have been configured for your wiki, but the [[<tvar name=citoid>:mw:Citoid</tvar>|Citoid service]] has not been set up for your wiki. == The toolbar == <!--T:2--> </translate> <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=<translate><!--T:4--> Screenshot of the VisualEditor toolbar</translate>]] </div> {| cellpadding="20" |- | colspan=2 | <translate><!--T:5--> The VisualEditor toolbar appears at the top of the screen when you begin editing.</translate> |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<translate><!--T:7--> <tvar name=label><code>{{int|Cite-ve-toolbar-group-label}}</code></tvar> button:</translate>''' <translate><!--T:8--> The <tvar name=label><code>{{int|Cite-ve-toolbar-group-label}}</code></tvar> button is used to add footnotes.</translate> <translate><!--T:9--> All projects have access to <tvar name=tooltip><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> reference formatting and the ability to <tvar name=tool><code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code></tvar> citations from here.</translate> <translate><!--T:10--> This dialog also gives you quick access to local citation templates.</translate> <translate><!--T:11--> (Instructions for adding more local citation templates to the <tvar name=label><code>{{int|Cite-ve-toolbar-group-label}}</code></tvar> menu at your wiki are available at <tvar name=2>{{ll|VisualEditor/Citation tool}}</tvar>.)</translate> |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | <translate><!--T:12--> '''<tvar name=insert><code>{{int|visualeditor-toolbar-insert}}</code></tvar>:''' The <tvar name=insert><code>{{int|visualeditor-toolbar-insert}}</code></tvar> menu may be different on some projects. Two options are useful for citations:</translate> * <translate><!--T:13--> The <tvar name=template><code>{{int|visualeditor-dialogbutton-template-tooltip}}</code></tvar> icon (a puzzle piece) allows you to [[<tvar name=editemplate>Special:MyLanguage/Help:VisualEditor/User guide#Editing templates</tvar>|insert and edit templates]]. You can use this to create a citation, using a standard template, when you want a citation that is '''not''' going to be a footnote. </translate> * <translate><!--T:14--> The <tvar name=reflist><code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code></tvar> icon (three books) is to specify where the reader will see the list of footnotes for the page. Usually this only needs to be done once on every page. (If the page already shows footnotes, then you don't want to click on this icon.)</translate> <translate><!--T:59--> You can also set references group to display using dialog window.</translate> |} <div class="overflowbugx" style="overflow:auto; "> <translate> == Editing an existing footnote == <!--T:15--> </translate> {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | <translate><!--T:17--> To edit an existing footnote, click on it where it appears in the text (usually as a bracketed number). You will then see either a <tvar name=vedial><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> icon (bookmark) or, an another icon with the name of the template that was used to create this footnote. Clicking on the "Edit" button will open a dialog where you can edit the footnote.</translate> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | <translate><!--T:19--> If you are editing a <tvar name=reftip><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> footnote, clicking on "Edit" will open the Reference dialog, where you can edit the text which is in the footnote. Editing this text is similar to editing in the main window - you can format text, add a link, or use special characters.</translate> <translate><!--T:20--> Unless you are sure you know what you are doing, do not use the Cite or Insert menus within the Reference dialog.</translate> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | <translate><!--T:22--> If, instead of the <tvar name=vidial><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> icon (bookmark), what appears when you click on a footnote is an icon for a standard template for citations, then clicking on "Edit" will take you directly to the template mini-editor dialog.</translate> |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | <translate><!--T:24--> In the template mini-editor, fields (template parameters) that already have content will be shown initially.</translate> <translate><!--T:70--> While some recommended parameters will also be shown, not all of them are required.</translate> <translate><!--T:71--> You can remove them from the main dialog by unchecking the checkbox in the sidebar.</translate> <translate><!--T:72--> If a parameter’s checkbox is greyed out and not clickable, that field is required and can't be removed.</translate> <translate><!--T:25--> To add an entirely new field, use the shortcut <tvar name=1>{{Key press|Ctrl|Shift|D}}</tvar> and then click on <tvar name=2><code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code></tvar> at the bottom of the mini-editor.</translate> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | <translate><!--T:26--> Click on <tvar name=veapply><code>{{int|visualeditor-dialog-action-apply}}</code></tvar> when you're done. </translate> |} <translate> == Re-using an existing footnote == <!--T:27--> </translate> {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | <translate><!--T:29--> Ideally, every sentence or paragraph in an article should be supported by a citation, in a footnote.</translate> <translate><!--T:67--> If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</translate> <translate><!--T:30--> To re-use an existing reference, place your cursor in the body of the text where you want to add a footnote.</translate> <translate><!--T:68--> Then from the <tvar name=toolbel><code>{{int|Cite-ve-toolbar-group-label}}</code></tvar> dialog, click on the "Re-use" tab.</translate> <translate><!--T:32--> Then look at the list for the reference you want to reuse, and select it.</translate> <translate><!--T:69--> If there are many references, you can use the search box (labeled <tvar name=place><code>{{int|cite-ve-reference-input-placeholder}}</code></tvar>) to find only those references that include certain text.</translate> |- | colspan=2 | <hr /> |- | colspan=2 | |} <translate> == Adding a new footnote == <!--T:33--> === Using a standard citation template for a new footnote === <!--T:34--> </translate> {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | <translate><!--T:36--> The <tvar name=1><code>{{int|Cite-ve-toolbar-group-label}}</code></tvar> button is used to add a new footnote.</translate> <translate><!--T:62--> First, place your cursor where you want to add a footnote, in the text.</translate> <translate><!--T:63--> Then, click on the <tvar name=1><code>{{int|citoid-citoiddialog-mode-manual}}</code></tvar> tab.</translate> <translate><!--T:64--> Then select a standard citation type in the dialog.</translate> <translate><!--T:65--> If the citation type you want is not on the menu, select the <tvar name=1><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> item.</translate> <translate><!--T:66--> (Instructions for adding more citation templates to this menu, on your local wiki, are available at <tvar name=1>{{ll|VisualEditor/Citation tool}}</tvar>.)</translate> |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | <translate><!--T:38--> Clicking on a standard cite template icon such as "Book" will take you into the template mini-editor for that template. While the most common fields (template parameters) will be shown, not all of them are required. Important fields may be marked with an asterisk and a grey checkbox in the left sidebar. Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar.</translate> <translate> <!--T:61--> To add an entirely new field, use the shortcut <tvar name=2>{{Key press|Ctrl|Shift|D}}</tvar> and then click on <tvar name=1><code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code></tvar> at the bottom of the mini editor. <!--T:41--> Click on <tvar name=dialinsert><code>{{int|visualeditor-dialog-action-insert}}</code></tvar> when you're done. </translate> |} <translate> === Using the <tvar name=1><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> citation for a new footnote === <!--T:42--> </translate> {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | <translate><!--T:44--> You can also choose the <tvar name=reftip><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> item from the <tvar name=vebel><code>{{int|Cite-ve-toolbar-group-label}}</code></tvar> menu.</translate> <translate><!--T:45--> The <tvar name=vediref><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> item is used for two purposes. You can create a footnote that doesn't use any citation template. Or you can create a footnote using a citation template that is not on the <tvar name=vebel><code>{{int|Cite-ve-toolbar-group-label}}</code></tvar> menu.</translate> |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | <translate><!--T:47--> Shown here is an example of selecting the <tvar name=vediref><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> item, and then, in the Reference editor, adding text, including formatting, but not using a citation template.</translate> <translate><!--T:48--> You can make the new footnote belong to a group other than general references, although this is normally not done. (If you do have two or more groups of footnotes, the <tvar name=refslist><code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code></tvar> tool must specify the group of footnotes to be displayed).</translate> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | <translate><!--T:50--> In the Reference dialog, you can get to a citation template that is not (yet) on the <tvar name=toolla><code>{{int|Cite-ve-toolbar-group-label}}</code></tvar> menu. From the <tvar name=veti><code>{{int|visualeditor-toolbar-insert}}</code></tvar> toolbar menu, click on the <tvar name=dibuttip><code>{{int|visualeditor-dialogbutton-template-tooltip}}</code></tvar> icon (puzzle piece). </translate> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | <translate><!--T:52--> Then, type the name (or part of the name) of the citation template you want to use, select it, click on "Add template", and edit it as you would any other template. (See the [[<tvar name=1>Special:MyLanguage/Help:VisualEditor/User guide#Editing templates</tvar>|Editing templates]] section, below, if you need more information about templates.)</translate> <translate><!--T:53--> After you're done editing the template, click on <tvar name=actsert><code>{{int|visualeditor-dialog-action-insert}}</code></tvar> to return to the Reference editor, and <tvar name=actsert><code>{{int|visualeditor-dialog-action-insert}}</code></tvar> again to return to the page you're editing.</translate> |} <translate> ==Adding a citation outside of a footnote== <!--T:54--> </translate> <mark><translate><!--T:60--> How to create a ==Further reading== list using Insert > Template > Cite book (etc.)</translate></mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | <translate><!--T:55--> You can add citation templates directly into the article, without putting them in footnotes or by using Basic references editor. From the Insert menu, click on the <tvar name=dibuttip><code>{{int|visualeditor-dialogbutton-template-tooltip}}</code></tvar> icon (a puzzle piece) </translate> |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | <translate><!--T:57--> Then, type the name (or part of the name) of the citation template you want to use, select it, click on "Add template", and edit it as you would any other template. (See the [[<tvar name=uguide>Special:MyLanguage/Help:VisualEditor/User guide#Editing templates</tvar>|Editing templates]] section in the user guide if you need more information about templates.)</translate> <translate><!--T:58--> After you're done editing the template, click on <tvar name=actsert><code>{{int|visualeditor-dialog-action-insert}}</code></tvar> to return to the Reference editor, and <tvar name=actsert><code>{{int|visualeditor-dialog-action-insert}}</code></tvar> again to return to the page you're editing.</translate> |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] n9qx44otjalt6huc9hzuyv2a0h8zf9u 8365047 8365043 2026-05-04T06:56:22Z TzrZzz 18352707 The changes were not resolved on [[Help:VisualEditor/User_guide/Citation_templates/ja]], so they were rolled back. Undid revision [[Special:Diff/8365043|8365043]] by [[Special:Contributions/TzrZzz|TzrZzz]] ([[User talk:TzrZzz|talk]]) 8365047 wikitext text/x-wiki <languages/> {{PD Help Page}} <translate> <!--T:1--> This page is '''a guide to adding footnotes (also called "citations", "inline citations" or "references")''' when local citation templates have been configured for your wiki, but the [[<tvar name=citoid>:mw:Citoid</tvar>|Citoid service]] has not been set up for your wiki. == The toolbar == <!--T:2--> </translate> <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=<translate><!--T:4--> Screenshot of the VisualEditor toolbar</translate>]] </div> {| cellpadding="20" |- | colspan=2 | <translate><!--T:5--> The VisualEditor toolbar appears at the top of the screen when you begin editing.</translate> |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<translate><!--T:7--> <tvar name=label><code>{{int|Cite-ve-toolbar-group-label}}</code></tvar> button:</translate>''' <translate><!--T:8--> The <tvar name=label><code>{{int|Cite-ve-toolbar-group-label}}</code></tvar> button is used to add footnotes.</translate> <translate><!--T:9--> All projects have access to <tvar name=tooltip><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> reference formatting and the ability to <tvar name=tool><code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code></tvar> citations from here.</translate> <translate><!--T:10--> This dialog also gives you quick access to local citation templates.</translate> <translate><!--T:11--> (Instructions for adding more local citation templates to the <tvar name=label><code>{{int|Cite-ve-toolbar-group-label}}</code></tvar> menu at your wiki are available at <tvar name=2>{{ll|VisualEditor/Citation tool}}</tvar>.)</translate> |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | <translate><!--T:12--> '''<tvar name=insert><code>{{int|visualeditor-toolbar-insert}}</code></tvar>:''' The <tvar name=insert><code>{{int|visualeditor-toolbar-insert}}</code></tvar> menu may be different on some projects. Two options are useful for citations:</translate> * <translate><!--T:13--> The <tvar name=template><code>{{int|visualeditor-dialogbutton-template-tooltip}}</code></tvar> icon (a puzzle piece) allows you to [[<tvar name=editemplate>Special:MyLanguage/Help:VisualEditor/User guide#Editing templates</tvar>|insert and edit templates]]. You can use this to create a citation, using a standard template, when you want a citation that is '''not''' going to be a footnote. </translate> * <translate><!--T:14--> The <tvar name=reflist><code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code></tvar> icon (three books) is to specify where the reader will see the list of footnotes for the page. Usually this only needs to be done once on every page. (If the page already shows footnotes, then you don't want to click on this icon.)</translate> <translate><!--T:59--> You can also set references group to display using dialog window.</translate> |} <div class="overflowbugx" style="overflow:auto; "> <translate> == Editing an existing footnote == <!--T:15--> </translate> {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | <translate><!--T:17--> To edit an existing footnote, click on it where it appears in the text (usually as a bracketed number). You will then see either a <tvar name=vedial><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> icon (bookmark) or, an another icon with the name of the template that was used to create this footnote. Clicking on the "Edit" button will open a dialog where you can edit the footnote.</translate> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | <translate><!--T:19--> If you are editing a <tvar name=reftip><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> footnote, clicking on "Edit" will open the Reference dialog, where you can edit the text which is in the footnote. Editing this text is similar to editing in the main window - you can format text, add a link, or use special characters.</translate> <translate><!--T:20--> Unless you are sure you know what you are doing, do not use the Cite or Insert menus within the Reference dialog.</translate> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | <translate><!--T:22--> If, instead of the <tvar name=vidial><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> icon (bookmark), what appears when you click on a footnote is an icon for a standard template for citations, then clicking on "Edit" will take you directly to the template mini-editor dialog.</translate> |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | <translate><!--T:24--> In the template mini-editor, fields (template parameters) that already have content will be shown initially.</translate> <translate><!--T:70--> While some recommended parameters will also be shown, not all of them are required.</translate> <translate><!--T:71--> You can remove them from the main dialog by unchecking the checkbox in the sidebar.</translate> <translate><!--T:72--> If a parameter’s checkbox is greyed out and not clickable, that field is required and can't be removed.</translate> <translate><!--T:25--> To add an entirely new field, use the shortcut <tvar name=1>{{Key press|Ctrl|Shift|D}}</tvar> and then click on <tvar name=2><code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code></tvar> at the bottom of the mini-editor.</translate> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | <translate><!--T:26--> Click on <tvar name=veapply><code>{{int|visualeditor-dialog-action-apply}}</code></tvar> when you're done. </translate> |} <translate> == Re-using an existing footnote == <!--T:27--> </translate> {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | <translate><!--T:29--> Ideally, every sentence or paragraph in an article should be supported by a citation, in a footnote.</translate> <translate><!--T:67--> If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</translate> <translate><!--T:30--> To re-use an existing reference, place your cursor in the body of the text where you want to add a footnote.</translate> <translate><!--T:68--> Then from the <tvar name=toolbel><code>{{int|Cite-ve-toolbar-group-label}}</code></tvar> dialog, click on the "Re-use" tab.</translate> <translate><!--T:32--> Then look at the list for the reference you want to reuse, and select it.</translate> <translate><!--T:69--> If there are many references, you can use the search box (labeled <tvar name=place><code>{{int|cite-ve-reference-input-placeholder}}</code></tvar>) to find only those references that include certain text.</translate> |- | colspan=2 | <hr /> |- | colspan=2 | |} <translate> == Adding a new footnote == <!--T:33--> === Using a standard citation template for a new footnote === <!--T:34--> </translate> {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | <translate><!--T:36--> The <tvar name=1><code>{{int|Cite-ve-toolbar-group-label}}</code></tvar> button is used to add a new footnote.</translate> <translate><!--T:62--> First, place your cursor where you want to add a footnote, in the text.</translate> <translate><!--T:63--> Then, click on the <tvar name=1><code>{{int|citoid-citoiddialog-mode-manual}}</code></tvar> tab.</translate> <translate><!--T:64--> Then select a standard citation type in the dialog.</translate> <translate><!--T:65--> If the citation type you want is not on the menu, select the <tvar name=1><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> item.</translate> <translate><!--T:66--> (Instructions for adding more citation templates to this menu, on your local wiki, are available at <tvar name=1>{{ll|VisualEditor/Citation tool}}</tvar>.)</translate> |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | <translate><!--T:38--> Clicking on a standard cite template icon such as "Book" will take you into the template mini-editor for that template. While the most common fields (template parameters) will be shown, not all of them are required. Important fields may be marked with an asterisk and a grey checkbox in the left sidebar.</translate> Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. <translate> <!--T:61--> To add an entirely new field, use the shortcut <tvar name=2>{{Key press|Ctrl|Shift|D}}</tvar> and then click on "<tvar name=1>Add undocumented parameter</tvar>" at the bottom of the mini editor. <!--T:41--> Click on <tvar name=dialinsert><code>{{int|visualeditor-dialog-action-insert}}</code></tvar> when you're done. </translate> |} <translate> === Using the <tvar name=1><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> citation for a new footnote === <!--T:42--> </translate> {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | <translate><!--T:44--> You can also choose the <tvar name=reftip><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> item from the <tvar name=vebel><code>{{int|Cite-ve-toolbar-group-label}}</code></tvar> menu.</translate> <translate><!--T:45--> The <tvar name=vediref><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> item is used for two purposes. You can create a footnote that doesn't use any citation template. Or you can create a footnote using a citation template that is not on the <tvar name=vebel><code>{{int|Cite-ve-toolbar-group-label}}</code></tvar> menu.</translate> |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | <translate><!--T:47--> Shown here is an example of selecting the <tvar name=vediref><code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code></tvar> item, and then, in the Reference editor, adding text, including formatting, but not using a citation template.</translate> <translate><!--T:48--> You can make the new footnote belong to a group other than general references, although this is normally not done. (If you do have two or more groups of footnotes, the <tvar name=refslist><code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code></tvar> tool must specify the group of footnotes to be displayed).</translate> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | <translate><!--T:50--> In the Reference dialog, you can get to a citation template that is not (yet) on the <tvar name=toolla><code>{{int|Cite-ve-toolbar-group-label}}</code></tvar> menu. From the <tvar name=veti><code>{{int|visualeditor-toolbar-insert}}</code></tvar> toolbar menu, click on the <tvar name=dibuttip><code>{{int|visualeditor-dialogbutton-template-tooltip}}</code></tvar> icon (puzzle piece). </translate> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | <translate><!--T:52--> Then, type the name (or part of the name) of the citation template you want to use, select it, click on "Add template", and edit it as you would any other template. (See the [[<tvar name=1>Special:MyLanguage/Help:VisualEditor/User guide#Editing templates</tvar>|Editing templates]] section, below, if you need more information about templates.)</translate> <translate><!--T:53--> After you're done editing the template, click on <tvar name=actsert><code>{{int|visualeditor-dialog-action-insert}}</code></tvar> to return to the Reference editor, and <tvar name=actsert><code>{{int|visualeditor-dialog-action-insert}}</code></tvar> again to return to the page you're editing.</translate> |} <translate> ==Adding a citation outside of a footnote== <!--T:54--> </translate> <mark><translate><!--T:60--> How to create a ==Further reading== list using Insert > Template > Cite book (etc.)</translate></mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | <translate><!--T:55--> You can add citation templates directly into the article, without putting them in footnotes or by using Basic references editor. From the Insert menu, click on the <tvar name=dibuttip><code>{{int|visualeditor-dialogbutton-template-tooltip}}</code></tvar> icon (a puzzle piece) </translate> |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | <translate><!--T:57--> Then, type the name (or part of the name) of the citation template you want to use, select it, click on "Add template", and edit it as you would any other template. (See the [[<tvar name=uguide>Special:MyLanguage/Help:VisualEditor/User guide#Editing templates</tvar>|Editing templates]] section in the user guide if you need more information about templates.)</translate> <translate><!--T:58--> After you're done editing the template, click on <tvar name=actsert><code>{{int|visualeditor-dialog-action-insert}}</code></tvar> to return to the Reference editor, and <tvar name=actsert><code>{{int|visualeditor-dialog-action-insert}}</code></tvar> again to return to the page you're editing.</translate> |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] i3iib9vnawjddrutdstyurpk11t7yra Help:Extension:ParserFunctions/fa 12 468238 8365009 8353927 2026-05-04T06:20:17Z FuzzyBot 451990 Updating to match new version of source page 8365009 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span class="mw-translate-fuzzy">افزونهٔ {{ll|Extension:ParserFunctions|nsp=0}} یازده تابع تجزیه‌کنندهٔ بیشتر را به عنوان مکمل «{{$2|کلمات جادویی}}» که در مدیاویکی از پیش موجود هستند، فراهم می‌کند.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">(It ''may'' be configured to provide additional parser functions for string handling; these are only available to non-Wikimedia Foundation wikis hence these string functions are documented {{ll|Extension:ParserFunctions/String functions|elsewhere}}.)</span> همه توابع تجزیه‌کنندهٔ فراهم شده توسط این افزونه به صورت زیر عمل می‌کنند: :<code><nowiki>{{</nowiki><span lang="en" dir="ltr" class="mw-content-ltr">'''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ...</span> <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | نوع ! {{hl1}} | عملگرها |- | {{hl2}} | گروه‌بندی (پرانتزها) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | اعداد | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | عملگر دوتایی <code>'''e'''</code> &nbsp; یگانی <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | یگانی | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | دوتایی | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | گرد | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | منطقی | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} این تابع یک عبارت ریاضی را ارزیابی می‌کند و مقدار محاسبه شده را برمی‌گرداند. این تابع در {{ll|Extension:Scribunto|nsp=0}} نیز با تابع <code>mw.ext.ParserFunctions.expr</code> در دسترس است. :<code><nowiki>{{#expr:</nowiki> ''عبارت'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span class="mw-translate-fuzzy">عملگرهای در دسترس در سمت چپ به ترتیب اولویت فهرست شده‌اند. [[{{ll|Manual:Expr parser function syntax}}|راهنما:محاسبه]] را برای جزئیات بیشتر تابع هر عملگر ببینید. دقت و قالب نتیجهٔ برگردانده شده متغیر و وابسته به سیستم عامل سرور اجراکننده ویکی و قالب اعداد زبان سایت است.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div class="mw-translate-fuzzy"> هنگام ارزیابی [[w:boolean algebra (logic)|جبر منطقی]] صفر به عنوان <code>نادرست</code> و هر مقدار غیر صفر، مثبت یا منفی، به عنوان <code>درست</code> ارزیابی می‌شود. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' عبارت ورودی خالی، یک رشته خالی را برمی‌گرداند. عبارت‌های اشتباه یکی از پیام‌های خطا را برمی‌گردانند که می‌تواند توسط تابع <code>[[##iferror|#iferror]]</code> گرفته شود. :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' ترتیب علامت‌های + و - پیش و پس از یک عدد با معنی است و ممکن است به دلیل ورود اشتباه، به جای عملگر به عنوان مقدار مثبت یا منفی در نظر گرفته شوند. :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=عملگر <code>mod</code> برای برخی از مقدارهای آرگومان دوم، نتیجهٔ نادرستی را برمی‌گرداند. <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (یک رشتهٔ خالی تولید می‌کند؛ باید به صورت ۱۲۳ باشد)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span class="mw-translate-fuzzy">اگر می‌خواهید محاسباتی را بر اساس تاریخ انجام دهید (مثلاً آیا امروز یا این ساعت، در فاصلهٔ مشخصی از یک روز یا ساعت دیگر قرار دارد)، ابتدا با استفاده از <nowiki>{{#time: xNU }}</nowiki> تاریخ مورد نظر را به تعداد ثانیهٔ گذشته از ۱ ژانویهٔ ۱۹۷۰ تبدیل کنید. سپس می‌توانید تاریخ را مانند یک عدد، جمع و تفریق کنید.</span>}} <span id="Rounding"></span> === گرد کردن === <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | مورد آزمایشی ! {{hl1}} | نتیجه ! {{hl1}} | روش گرد کردن |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || رقم آخر کمتر از ۵ است، گرد کردن تغییری ایجاد نمی‌کند (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || رقم آخر بزرگتر یا مساوی ۵ است، پس به سمت بالا گرد می‌شود (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || رقم آخر به سمت بالا گرد می‌شود، در نتیجه نیاز به گرد کردن بیشتر است. (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || به نزدیک‌ترین مضرب ۱۰۰ گرد می‌شود، زیرا مقدار منفی به سمت چپ ممیز گرد می‌کند |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || به نزدیک‌ترین مضرب یک‌صدم گرد می‌کند، زیرا مقدار مثبت به سمت راست ممیز گرد می‌کند |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || وجود اعشار در شاخص گرد کردن، تفاوتی در نتیجه ایجاد نمی‌کند. |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || بخش اعشاری حذف می‌شود |- ! colspan=3 {{hl2}} | گرد کردن به نزدیک‌ترین عدد صحیح |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || کاهش به ''نزدیک‌ترین'' عدد صحیح که صفر است |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || افزایش به نزدیک‌ترین عدد صحیح که یک است |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || افزایش به نزدیک‌ترین عدد صحیح که یک است |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || افزایش به نزدیک‌ترین عدد صحیح که صفر است |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || کاهش به نزدیک‌ترین عدد صحیح که منفی یک است |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || کاهش به نزدیک‌ترین عدد صحیح که منفی یک است |- ! colspan=3 {{hl2}} | گرد کردن به بالا و پایین با ''ceil'' و ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || افزایش به نزدیک‌ترین عدد صحیح ''بزرگ‌تر'' که یک است |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || کاهش به نزدیک‌ترین عدد صحیح ''کوچک‌تر'' که صفر است |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || افزایش به نزدیک‌ترین عدد صحیح بزرگتر که صفر است |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || کاهش به نزدیک‌ترین عدد صحیح کوچکتر که منفی یک است |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || گرد نمی‌شود، زیرا یک خودش یک عدد صحیح است<br />{{Warning|1=بر خلاف آن‌چه ممکن است انتظار بدارید، به جای '''ceil('''1/3''')''' به صورت '''(ceil''' 1''')'''/3 تفسیر می‌شود}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <span id="Strings"></span> === تنظیمات === <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == این تابع یک رشته را ارزیابی می‌کند و پر یا خالی بودن آن را تعیین می‌کند. رشته‌ای که تنها شامل فاصله باشد، به عنوان رشتهٔ خالی در نظر گرفته می‌شود. :<syntaxhighlight lang="wikitext" inline>{{#if: رشته | مقدار در صورتی که رشته خالی نباشد | مقدار در صورتی که رشته خالی باشد (یا تنها شامل فاصله باشد)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: پارامتر اول | پارامتر دوم | پارامتر سوم }}</syntaxhighlight> این تابع نخست پر یا خالی بودن پارامتر اول را بررسی می‌کند. اگر خالی نباشد، پارامتر دوم را نمایش می دهد. اگر پارامتر اول خالی باشد یا تنها شامل فاصله باشد، پارامتر سوم را نمایش می‌دهد. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div class="mw-translate-fuzzy"> رشته همواره به صورت متن در نظر گرفته می‌شود، بنابراین عبارت‌های ریاضی ارزیابی نمی‌شوند: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' می‌توان پارامتر آخر را حذف کرد: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span class="mw-translate-fuzzy">می‌توانید در #if از یک پارامتر نیز به عنوان رشته استفاده کنید. فراموش نکنید که پس از نام متغیر، $pipe را بیفزایید.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=شما متنی را در متغیر ۱ وارد کردید |2=متغیر ۱ خالی باشد }} برای مثال‌های بیشتر این تابع تجزیه‌کننده، {{ll|Help:Parser functions in templates}} را ببینید. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span class="mw-translate-fuzzy">این تابع تجزیه‌کننده، دو رشته را مقایسه می‌کند و یکسان بودن آن‌ها را ارزیابی می‌کند.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> اگر هر دو رشته شامل مقادیر عددی صحیح باشند، رشته‌ها به صورت عددی با هم مقایسه می‌شوند: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' در غیر این صورت، مقایسه بر اساس متن انجام می‌شود. این مقایسه به بزرگی و کوچکی حروف حساس است: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(با مثال مشابه بالا که " نداشت مقایسه کنید)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span class="mw-translate-fuzzy">(با مثال مشابه بالا که <code>[[##expr|#expr]]</code> داشت، مقایسه کنید)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> کد الگو به صورت زیر تعریف می‌شود: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> موارد زیر حاصل می‌شود: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' مقایسه کردن :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <span id="ifexist_limits"></span> === محدودیت‌های ifexist === <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → سطح فعلی *<code>..</code> → یک سطح بالاتر بروید *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''همچنین ببینید: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} مثال ها: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <span id="Default"></span> === پیش‌فرض === <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === نتایج گروه‌بندی === <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <span id="Use_with_parameters"></span> === استفاده با پارامترها === <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> {{ll|Help:Parser functions in templates}} را ببینید.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> مثال: {| class="wikitable" ! شما تایپ می‌کنید ! نمایش می‌یابد |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <span id="Replacing_#ifeq"></span> === جایگزین کردن #ifeq === <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> برای نمونه: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> برابر است با * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | کد ! {{hl1}} | توضیحات ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| سال |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | سال ۴-شماره‌ای. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | سال ۲-شماره‌ای | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| ماه |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | برای لهستانی:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| روز ماه یا سال |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| ساعت |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| دقیقه‌ها و ثانیه‌ها |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | اسلامی |- | style="text-align: center;" | <code>xmj</code> | روز ماه. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | نام کامل ماه. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | شاخص ماه. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | سال کامل. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | ایرانی (جلالی) |- | style="text-align: center;" | <code>xit</code> | تعداد روزهای ماه. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | روز سال. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | روز ماه. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | نام کامل ماه. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | شاخص ماه. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | سال کامل. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | سال ۲-شماره‌ای. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | عبری |- | style="text-align: center;" | <code>xjj</code> | روز ماه. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | نام کامل ماه. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | تعداد روزهای ماه. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | شماره ماه. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | سال کامل. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | خورشیدی تایلندی |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | سال مینگو/جوچه |- | style="text-align: center;" | <code>xoY</code> | سال کامل. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | ننگوی ژاپنی |- | style="text-align: center;" | <code>xtY</code> | سال کامل. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | پرچم‌ها |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | به زبان هندی، <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> ०६, 06 را تولید می‌کند. |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (صحیح) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (قالب سال پشتیبانی نشده) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (صحیح) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (صحیح) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (صحیح) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (قالب سال پشتیبانی نشده) }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=نام صفحه |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> همچنین {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}} را ببینید. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> همچنین {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}} را ببینید. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> === نکات کلی === <span id="Substitution"></span> === تعویض === <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <span id="Redirects"></span> === تغییرمسیرها === <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! توضیحات ! تایپ می‌کنید ! نمایش میابد |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == جستارهای وابسته == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]]، {{ll|Extension:StringFunctions}} را منسوخ می‌کند * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == منابع == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] ouuebslww58zxlv38qx5axqjdull3a4 Help:VisualEditor/User guide/Citation templates/ja 12 483858 8364861 8246433 2026-05-04T03:14:38Z ~2026-27009-87 18368053 Created page with "推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。" 8364861 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」とここで説明する注釈を作成する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このメニューからはまた、地域化された注釈テンプレートに素早くアクセスできます。 (ご利用のウィキの<code>{{int|Cite-ve-toolbar-group-label}}</code>メニューに地域化した注釈テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈には便利なオプションが2種類。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの使用と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です。(すでに脚注が表示されたページでは押さないでください。) また、ダイアログ ウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内の文を編集できます。編集そのものは本文の編集と同じで - 書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「出典」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型のダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディタを開くと、まず内容がある欄 (テンプレートのパラメータ) のみ表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 <span lang="en" dir="ltr" class="mw-content-ltr">You can remove them from the main dialog by unchecking the checkbox in the sidebar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a parameter’s checkbox is greyed out and not clickable, that field is required and can't be removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To add an entirely new field, use the shortcut {{Key press|Ctrl|Shift|D}} and then click on <code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code> at the bottom of the mini-editor.</span> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 理論上は、記事の文または段落単位で典拠を脚注に補足すればよいのです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] srmm1g1tya9qqe2vifldudcpx7h5171 8364893 8364861 2026-05-04T04:51:45Z TzrZzz 18352707 8364893 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」とここで説明する注釈を作成する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このメニューからはまた、地域化された注釈テンプレートに素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈には便利なオプションが2種類。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの使用と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です。(すでに脚注が表示されたページでは押さないでください。) また、ダイアログ ウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内の文を編集できます。編集そのものは本文の編集と同じで - 書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「出典」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型のダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディタを開くと、まず内容がある欄 (テンプレートのパラメータ) のみ表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 <span lang="en" dir="ltr" class="mw-content-ltr">You can remove them from the main dialog by unchecking the checkbox in the sidebar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a parameter’s checkbox is greyed out and not clickable, that field is required and can't be removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To add an entirely new field, use the shortcut {{Key press|Ctrl|Shift|D}} and then click on <code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code> at the bottom of the mini-editor.</span> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 理論上は、記事の文または段落単位で典拠を脚注に補足すればよいのです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] rd4sj39jboi5avxva5yppncov1yhx9w 8364895 8364893 2026-05-04T04:52:38Z TzrZzz 18352707 8364895 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」とここで説明する注釈を作成する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈には便利なオプションが2種類。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの使用と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です。(すでに脚注が表示されたページでは押さないでください。) また、ダイアログ ウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内の文を編集できます。編集そのものは本文の編集と同じで - 書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「出典」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型のダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディタを開くと、まず内容がある欄 (テンプレートのパラメータ) のみ表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 <span lang="en" dir="ltr" class="mw-content-ltr">You can remove them from the main dialog by unchecking the checkbox in the sidebar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a parameter’s checkbox is greyed out and not clickable, that field is required and can't be removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To add an entirely new field, use the shortcut {{Key press|Ctrl|Shift|D}} and then click on <code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code> at the bottom of the mini-editor.</span> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 理論上は、記事の文または段落単位で典拠を脚注に補足すればよいのです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] tiv29n68jkjsyjeizdhzv7x5knku480 8364897 8364895 2026-05-04T04:58:46Z TzrZzz 18352707 8364897 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈には便利なオプションが2種類。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの使用と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です。(すでに脚注が表示されたページでは押さないでください。) また、ダイアログ ウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内の文を編集できます。編集そのものは本文の編集と同じで - 書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「出典」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型のダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディタを開くと、まず内容がある欄 (テンプレートのパラメータ) のみ表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 <span lang="en" dir="ltr" class="mw-content-ltr">You can remove them from the main dialog by unchecking the checkbox in the sidebar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a parameter’s checkbox is greyed out and not clickable, that field is required and can't be removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To add an entirely new field, use the shortcut {{Key press|Ctrl|Shift|D}} and then click on <code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code> at the bottom of the mini-editor.</span> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 理論上は、記事の文または段落単位で典拠を脚注に補足すればよいのです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] ekga879xb0ryl4jzx5aaq592ortwi6n 8364899 8364897 2026-05-04T05:02:26Z TzrZzz 18352707 8364899 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。引用に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの使用と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です。(すでに脚注が表示されたページでは押さないでください。) また、ダイアログ ウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内の文を編集できます。編集そのものは本文の編集と同じで - 書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「出典」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型のダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディタを開くと、まず内容がある欄 (テンプレートのパラメータ) のみ表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 <span lang="en" dir="ltr" class="mw-content-ltr">You can remove them from the main dialog by unchecking the checkbox in the sidebar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a parameter’s checkbox is greyed out and not clickable, that field is required and can't be removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To add an entirely new field, use the shortcut {{Key press|Ctrl|Shift|D}} and then click on <code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code> at the bottom of the mini-editor.</span> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 理論上は、記事の文または段落単位で典拠を脚注に補足すればよいのです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] jgnhp3fhle6u7e6em59rampqrvosqxe 8364901 8364899 2026-05-04T05:04:44Z TzrZzz 18352707 8364901 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの使用と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です。(すでに脚注が表示されたページでは押さないでください。) また、ダイアログ ウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内の文を編集できます。編集そのものは本文の編集と同じで - 書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「出典」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型のダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディタを開くと、まず内容がある欄 (テンプレートのパラメータ) のみ表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 <span lang="en" dir="ltr" class="mw-content-ltr">You can remove them from the main dialog by unchecking the checkbox in the sidebar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a parameter’s checkbox is greyed out and not clickable, that field is required and can't be removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To add an entirely new field, use the shortcut {{Key press|Ctrl|Shift|D}} and then click on <code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code> at the bottom of the mini-editor.</span> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 理論上は、記事の文または段落単位で典拠を脚注に補足すればよいのです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] th3nwnsjb1a3tatj3rrugxd9j1qzary 8364905 8364901 2026-05-04T05:09:03Z TzrZzz 18352707 8364905 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です。(すでに脚注が表示されたページでは押さないでください。) また、ダイアログ ウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内の文を編集できます。編集そのものは本文の編集と同じで - 書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「出典」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型のダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディタを開くと、まず内容がある欄 (テンプレートのパラメータ) のみ表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 <span lang="en" dir="ltr" class="mw-content-ltr">You can remove them from the main dialog by unchecking the checkbox in the sidebar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a parameter’s checkbox is greyed out and not clickable, that field is required and can't be removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To add an entirely new field, use the shortcut {{Key press|Ctrl|Shift|D}} and then click on <code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code> at the bottom of the mini-editor.</span> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 理論上は、記事の文または段落単位で典拠を脚注に補足すればよいのです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] 6l0fsg6bhu2zb2jmbwmqouet47p7qah 8364907 8364905 2026-05-04T05:11:33Z TzrZzz 18352707 8364907 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログ ウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内の文を編集できます。編集そのものは本文の編集と同じで - 書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「出典」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型のダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディタを開くと、まず内容がある欄 (テンプレートのパラメータ) のみ表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 <span lang="en" dir="ltr" class="mw-content-ltr">You can remove them from the main dialog by unchecking the checkbox in the sidebar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a parameter’s checkbox is greyed out and not clickable, that field is required and can't be removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To add an entirely new field, use the shortcut {{Key press|Ctrl|Shift|D}} and then click on <code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code> at the bottom of the mini-editor.</span> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 理論上は、記事の文または段落単位で典拠を脚注に補足すればよいのです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] 0pxrb06vaiid8n1g9r816jtkqux7gzd 8364909 8364907 2026-05-04T05:12:16Z TzrZzz 18352707 8364909 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内の文を編集できます。編集そのものは本文の編集と同じで - 書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「出典」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型のダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディタを開くと、まず内容がある欄 (テンプレートのパラメータ) のみ表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 <span lang="en" dir="ltr" class="mw-content-ltr">You can remove them from the main dialog by unchecking the checkbox in the sidebar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a parameter’s checkbox is greyed out and not clickable, that field is required and can't be removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To add an entirely new field, use the shortcut {{Key press|Ctrl|Shift|D}} and then click on <code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code> at the bottom of the mini-editor.</span> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 理論上は、記事の文または段落単位で典拠を脚注に補足すればよいのです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] 7t8cohi6i189mwh7ol3qa939r9i9mx0 8364912 8364909 2026-05-04T05:17:08Z TzrZzz 18352707 8364912 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「出典」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型のダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディタを開くと、まず内容がある欄 (テンプレートのパラメータ) のみ表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 <span lang="en" dir="ltr" class="mw-content-ltr">You can remove them from the main dialog by unchecking the checkbox in the sidebar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a parameter’s checkbox is greyed out and not clickable, that field is required and can't be removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To add an entirely new field, use the shortcut {{Key press|Ctrl|Shift|D}} and then click on <code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code> at the bottom of the mini-editor.</span> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 理論上は、記事の文または段落単位で典拠を脚注に補足すればよいのです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] d1zdjkp81cvmv5oip004wbyvrh1rfoj 8364914 8364912 2026-05-04T05:17:55Z TzrZzz 18352707 8364914 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型のダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディタを開くと、まず内容がある欄 (テンプレートのパラメータ) のみ表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 <span lang="en" dir="ltr" class="mw-content-ltr">You can remove them from the main dialog by unchecking the checkbox in the sidebar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a parameter’s checkbox is greyed out and not clickable, that field is required and can't be removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To add an entirely new field, use the shortcut {{Key press|Ctrl|Shift|D}} and then click on <code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code> at the bottom of the mini-editor.</span> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 理論上は、記事の文または段落単位で典拠を脚注に補足すればよいのです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] ir2ings22roog6f4zicwxmfulrmewny 8364918 8364914 2026-05-04T05:19:44Z TzrZzz 18352707 8364918 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディタを開くと、まず内容がある欄 (テンプレートのパラメータ) のみ表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 <span lang="en" dir="ltr" class="mw-content-ltr">You can remove them from the main dialog by unchecking the checkbox in the sidebar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a parameter’s checkbox is greyed out and not clickable, that field is required and can't be removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To add an entirely new field, use the shortcut {{Key press|Ctrl|Shift|D}} and then click on <code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code> at the bottom of the mini-editor.</span> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 理論上は、記事の文または段落単位で典拠を脚注に補足すればよいのです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] pu7xcdtwi9b3zvwi61v8roh48n8jt3a 8364927 8364918 2026-05-04T05:21:25Z TzrZzz 18352707 8364927 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 <span lang="en" dir="ltr" class="mw-content-ltr">You can remove them from the main dialog by unchecking the checkbox in the sidebar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a parameter’s checkbox is greyed out and not clickable, that field is required and can't be removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To add an entirely new field, use the shortcut {{Key press|Ctrl|Shift|D}} and then click on <code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code> at the bottom of the mini-editor.</span> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 理論上は、記事の文または段落単位で典拠を脚注に補足すればよいのです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] i28851wn7oqeiimwlqkyminq1uyt9wq 8364929 8364927 2026-05-04T05:21:52Z TzrZzz 18352707 Created page with "サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。" 8364929 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 <span lang="en" dir="ltr" class="mw-content-ltr">If a parameter’s checkbox is greyed out and not clickable, that field is required and can't be removed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To add an entirely new field, use the shortcut {{Key press|Ctrl|Shift|D}} and then click on <code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code> at the bottom of the mini-editor.</span> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 理論上は、記事の文または段落単位で典拠を脚注に補足すればよいのです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] k3nmaam1iu2grlg787izo4s6ajto5ba 8364931 8364929 2026-05-04T05:22:04Z TzrZzz 18352707 Created page with "パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。" 8364931 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 <span lang="en" dir="ltr" class="mw-content-ltr">To add an entirely new field, use the shortcut {{Key press|Ctrl|Shift|D}} and then click on <code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code> at the bottom of the mini-editor.</span> |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 理論上は、記事の文または段落単位で典拠を脚注に補足すればよいのです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] sjhiipzppwe7o0wl3vghxvzrpfgdpgo 8364933 8364931 2026-05-04T05:22:48Z TzrZzz 18352707 Created page with "まったく新しいフィールドを追加するには、ショートカット $1 を使用し、小型エディター下部の「$2」をクリックします。" 8364933 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 理論上は、記事の文または段落単位で典拠を脚注に補足すればよいのです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] cyj7fhxh72p5sq9f2n2192dv2nm5tpj 8364935 8364933 2026-05-04T05:24:19Z TzrZzz 18352707 8364935 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 <span lang="en" dir="ltr" class="mw-content-ltr">If you have some text that needs a citation (source) to support it, and the page already has a footnote that applies to (supports) that text, then you can re-use the existing citation, because one footnote can support multiple, different sentences or paragraphs.</span> 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] 6pd3v8senbp2q7b3eno945salaifdd7 8364939 8364935 2026-05-04T05:25:23Z TzrZzz 18352707 Created page with "引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。" 8364939 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の出典の流用の手順は、本文の脚注を付けたい箇所にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] ez5lc6kezsof2ke4ae819a8g8z0250d 8364941 8364939 2026-05-04T05:26:02Z TzrZzz 18352707 8364941 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 流用したい出典は一覧から探して選びます。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] f43xs30zlg0lglcdehrhef73x8dad9s 8364945 8364941 2026-05-04T05:27:24Z TzrZzz 18352707 8364945 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 <span lang="en" dir="ltr" class="mw-content-ltr">If there are many references, you can use the search box (labeled <code>{{int|cite-ve-reference-input-placeholder}}</code>) to find only those references that include certain text.</span> |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] aqk0jgofvgmkh2sawpn409wlaacp07y 8364947 8364945 2026-05-04T05:28:37Z TzrZzz 18352707 Created page with "出典が多数ある場合は、検索ボックス(「$place」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。" 8364947 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 <span lang="en" dir="ltr" class="mw-content-ltr">First, place your cursor where you want to add a footnote, in the text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] jtcc2b4qumuv1zslilksfc5z3sobow4 8364951 8364947 2026-05-04T05:31:19Z TzrZzz 18352707 Created page with "まず、本文中の脚注を追加したい位置にカーソルを置きます。" 8364951 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 <span lang="en" dir="ltr" class="mw-content-ltr">Then, click on the <code>{{int|citoid-citoiddialog-mode-manual}}</code> tab.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] 86j0lgqzv95wza9gktvlb4t4dcr7hn3 8364953 8364951 2026-05-04T05:32:00Z TzrZzz 18352707 Created page with "次に「$1」タブをクリックします。" 8364953 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 <span lang="en" dir="ltr" class="mw-content-ltr">Then select a standard citation type in the dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] irvv4c9zdjbvf8qd8gxy9pdnrqn1qf1 8364955 8364953 2026-05-04T05:34:27Z TzrZzz 18352707 Created page with "その後、ダイアログから標準の引用タイプを選択します。" 8364955 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 <span lang="en" dir="ltr" class="mw-content-ltr">If the citation type you want is not on the menu, select the <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> item.</span> (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] 7sdrjld1h186lzwcveq1l052cl7l78w 8364959 8364955 2026-05-04T05:35:26Z TzrZzz 18352707 Created page with "希望する引用タイプがメニューにない場合は、「$1」を選択してください。" 8364959 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 希望する引用タイプがメニューにない場合は、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択してください。 (ご利用のローカルウィキでこのメニューに出典テンプレートを増やす方法は、{{ll|VisualEditor/Citation tool}}の手順をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] 4bz2dz1az9jnmqwynb9zwmzvswe0sna 8364961 8364959 2026-05-04T05:37:13Z TzrZzz 18352707 8364961 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な出典テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 希望する引用タイプがメニューにない場合は、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択してください。 (ご利用のローカルウィキでこのメニューに引用テンプレートを追加する手順は、 {{ll|VisualEditor/Citation tool}} をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] 19zny7d587yxb7wbkcjvhuwcsk3it8w 8364965 8364961 2026-05-04T05:38:31Z TzrZzz 18352707 8364965 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な引用テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 希望する引用タイプがメニューにない場合は、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択してください。 (ご利用のローカルウィキでこのメニューに引用テンプレートを追加する手順は、 {{ll|VisualEditor/Citation tool}} をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | メニューにある出典テンプレートから例えば「書籍」ボタンを押すと、そのテンプレート用の小窓が開きます。もっとも多用される欄 (テンプレートの引数) が表示されるものの、場合により使わない欄もあります。米印 (<nowiki>*</nowiki>) が付いた欄は必ず記入します。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] 28tq2l2brco240943ai0qr0ia6t4ukm 8364969 8364965 2026-05-04T05:41:38Z TzrZzz 18352707 8364969 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な引用テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 希望する引用タイプがメニューにない場合は、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択してください。 (ご利用のローカルウィキでこのメニューに引用テンプレートを追加する手順は、 {{ll|VisualEditor/Citation tool}} をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | 「書籍」などの標準引用テンプレートのアイコンをクリックすると、そのテンプレートの小型エディターが開きます。よく使われるフィールド(テンプレートのパラメーター)が表示されますが、すべてが必須というわけではありません。重要なフィールドはアスタリスクと左サイドバーのグレーのチェックボックスで示されます。任意フィールド(青色のチェックボックス)はサイドバーのチェックボックスをオン・オフすることで追加・削除できます。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}}を入力、編集小窓の一番下の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] edv3k3q6jzurvp8zuphb2j0omg4yit5 8364971 8364969 2026-05-04T05:43:14Z TzrZzz 18352707 8364971 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な引用テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 希望する引用タイプがメニューにない場合は、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択してください。 (ご利用のローカルウィキでこのメニューに引用テンプレートを追加する手順は、 {{ll|VisualEditor/Citation tool}} をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | 「書籍」などの標準引用テンプレートのアイコンをクリックすると、そのテンプレートの小型エディターが開きます。よく使われるフィールド(テンプレートのパラメーター)が表示されますが、すべてが必須というわけではありません。重要なフィールドはアスタリスクと左サイドバーのグレーのチェックボックスで示されます。任意フィールド(青色のチェックボックス)はサイドバーのチェックボックスをオン・オフすることで追加・削除できます。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}} を入力、小型エディター下部の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>出典テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] rk07onpzt4w36uf52hg218ydperhzs7 8364973 8364971 2026-05-04T05:44:18Z TzrZzz 18352707 8364973 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な引用テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 希望する引用タイプがメニューにない場合は、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択してください。 (ご利用のローカルウィキでこのメニューに引用テンプレートを追加する手順は、 {{ll|VisualEditor/Citation tool}} をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | 「書籍」などの標準引用テンプレートのアイコンをクリックすると、そのテンプレートの小型エディターが開きます。よく使われるフィールド(テンプレートのパラメーター)が表示されますが、すべてが必須というわけではありません。重要なフィールドはアスタリスクと左サイドバーのグレーのチェックボックスで示されます。任意フィールド(青色のチェックボックス)はサイドバーのチェックボックスをオン・オフすることで追加・削除できます。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}} を入力、小型エディター下部の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> 引用テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、注釈テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない注釈テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] 4n4ac2j7sbc49vchq4tvvp264nbvth4 8364975 8364973 2026-05-04T05:45:13Z TzrZzz 18352707 8364975 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な引用テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 希望する引用タイプがメニューにない場合は、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択してください。 (ご利用のローカルウィキでこのメニューに引用テンプレートを追加する手順は、 {{ll|VisualEditor/Citation tool}} をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | 「書籍」などの標準引用テンプレートのアイコンをクリックすると、そのテンプレートの小型エディターが開きます。よく使われるフィールド(テンプレートのパラメーター)が表示されますが、すべてが必須というわけではありません。重要なフィールドはアスタリスクと左サイドバーのグレーのチェックボックスで示されます。任意フィールド(青色のチェックボックス)はサイドバーのチェックボックスをオン・オフすることで追加・削除できます。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}} を入力、小型エディター下部の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> 引用テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、引用テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない引用テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | このサンプルは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を押してから、出典テンプレートを使わない手順を示します。出典エディタを使って記入、フォーマット他を指定します。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] 7e7rybajk3vdkrpy4cc6y8ksxr6rayj 8364977 8364975 2026-05-04T05:49:38Z TzrZzz 18352707 8364977 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な引用テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 希望する引用タイプがメニューにない場合は、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択してください。 (ご利用のローカルウィキでこのメニューに引用テンプレートを追加する手順は、 {{ll|VisualEditor/Citation tool}} をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | 「書籍」などの標準引用テンプレートのアイコンをクリックすると、そのテンプレートの小型エディターが開きます。よく使われるフィールド(テンプレートのパラメーター)が表示されますが、すべてが必須というわけではありません。重要なフィールドはアスタリスクと左サイドバーのグレーのチェックボックスで示されます。任意フィールド(青色のチェックボックス)はサイドバーのチェックボックスをオン・オフすることで追加・削除できます。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}} を入力、小型エディター下部の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> 引用テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、引用テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない引用テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | ここでは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択し、「脚注」エディターでテキストに書式設定を加えつつ、引用テンプレートを使わずに記入する例を示しています。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない出典テンプレートを呼び出すことができます。ツールバーの「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューから<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>アイコン (ぱずるのかけら) をクリック。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] oyydwcungelxi897gm0t9jmogd1qo8j 8364979 8364977 2026-05-04T05:56:26Z TzrZzz 18352707 8364979 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な引用テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 希望する引用タイプがメニューにない場合は、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択してください。 (ご利用のローカルウィキでこのメニューに引用テンプレートを追加する手順は、 {{ll|VisualEditor/Citation tool}} をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | 「書籍」などの標準引用テンプレートのアイコンをクリックすると、そのテンプレートの小型エディターが開きます。よく使われるフィールド(テンプレートのパラメーター)が表示されますが、すべてが必須というわけではありません。重要なフィールドはアスタリスクと左サイドバーのグレーのチェックボックスで示されます。任意フィールド(青色のチェックボックス)はサイドバーのチェックボックスをオン・オフすることで追加・削除できます。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}} を入力、小型エディター下部の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> 引用テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、引用テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない引用テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | ここでは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択し、「脚注」エディターでテキストに書式設定を加えつつ、引用テンプレートを使わずに記入する例を示しています。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない引用テンプレートを呼び出すことができます。「<code>{{int|visualeditor-toolbar-insert}}</code>」ツールバーメニューから「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code> アイコン」(パズルのピース)をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] (草稿) をご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] 4sv4fbxwzuzrgkfn7e03z1vw9r29a5w 8364981 8364979 2026-05-04T05:57:48Z TzrZzz 18352707 8364981 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な引用テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 希望する引用タイプがメニューにない場合は、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択してください。 (ご利用のローカルウィキでこのメニューに引用テンプレートを追加する手順は、 {{ll|VisualEditor/Citation tool}} をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | 「書籍」などの標準引用テンプレートのアイコンをクリックすると、そのテンプレートの小型エディターが開きます。よく使われるフィールド(テンプレートのパラメーター)が表示されますが、すべてが必須というわけではありません。重要なフィールドはアスタリスクと左サイドバーのグレーのチェックボックスで示されます。任意フィールド(青色のチェックボックス)はサイドバーのチェックボックスをオン・オフすることで追加・削除できます。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}} を入力、小型エディター下部の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> 引用テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、引用テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない引用テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | ここでは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択し、「脚注」エディターでテキストに書式設定を加えつつ、引用テンプレートを使わずに記入する例を示しています。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない引用テンプレートを呼び出すことができます。「<code>{{int|visualeditor-toolbar-insert}}</code>」ツールバーメニューから「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code> アイコン」(パズルのピース)をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] セクションをご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] 3hwgc4rpu2h31hlyclya6q9jaoq5yco 8364983 8364981 2026-05-04T05:59:35Z TzrZzz 18352707 8364983 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な引用テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 希望する引用タイプがメニューにない場合は、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択してください。 (ご利用のローカルウィキでこのメニューに引用テンプレートを追加する手順は、 {{ll|VisualEditor/Citation tool}} をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | 「書籍」などの標準引用テンプレートのアイコンをクリックすると、そのテンプレートの小型エディターが開きます。よく使われるフィールド(テンプレートのパラメーター)が表示されますが、すべてが必須というわけではありません。重要なフィールドはアスタリスクと左サイドバーのグレーのチェックボックスで示されます。任意フィールド(青色のチェックボックス)はサイドバーのチェックボックスをオン・オフすることで追加・削除できます。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}} を入力、小型エディター下部の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> 引用テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、引用テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない引用テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | ここでは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択し、「脚注」エディターでテキストに書式設定を加えつつ、引用テンプレートを使わずに記入する例を示しています。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない引用テンプレートを呼び出すことができます。「<code>{{int|visualeditor-toolbar-insert}}</code>」ツールバーメニューから「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code> アイコン」(パズルのピース)をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] セクションをご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディターに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに注釈を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] ia2s4sjva7up9vnaxx44ijt4a4kcqur 8364985 8364983 2026-05-04T06:00:14Z TzrZzz 18352707 8364985 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な引用テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 希望する引用タイプがメニューにない場合は、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択してください。 (ご利用のローカルウィキでこのメニューに引用テンプレートを追加する手順は、 {{ll|VisualEditor/Citation tool}} をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | 「書籍」などの標準引用テンプレートのアイコンをクリックすると、そのテンプレートの小型エディターが開きます。よく使われるフィールド(テンプレートのパラメーター)が表示されますが、すべてが必須というわけではありません。重要なフィールドはアスタリスクと左サイドバーのグレーのチェックボックスで示されます。任意フィールド(青色のチェックボックス)はサイドバーのチェックボックスをオン・オフすることで追加・削除できます。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}} を入力、小型エディター下部の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> 引用テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、引用テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない引用テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | ここでは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択し、「脚注」エディターでテキストに書式設定を加えつつ、引用テンプレートを使わずに記入する例を示しています。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない引用テンプレートを呼び出すことができます。「<code>{{int|visualeditor-toolbar-insert}}</code>」ツールバーメニューから「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code> アイコン」(パズルのピース)をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] セクションをご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディターに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに引用を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 脚注節を作らなくても、あるいは基本機能の出典エディタを使わなくても、記事本文に直接、出典テンプレートを追加できます。「挿入」メニューを開き「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのかけら)をクリック。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] jezbkrbgxikjdbp5rsnkjfysmsyybch 8364987 8364985 2026-05-04T06:02:25Z TzrZzz 18352707 8364987 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な引用テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 希望する引用タイプがメニューにない場合は、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択してください。 (ご利用のローカルウィキでこのメニューに引用テンプレートを追加する手順は、 {{ll|VisualEditor/Citation tool}} をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | 「書籍」などの標準引用テンプレートのアイコンをクリックすると、そのテンプレートの小型エディターが開きます。よく使われるフィールド(テンプレートのパラメーター)が表示されますが、すべてが必須というわけではありません。重要なフィールドはアスタリスクと左サイドバーのグレーのチェックボックスで示されます。任意フィールド(青色のチェックボックス)はサイドバーのチェックボックスをオン・オフすることで追加・削除できます。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}} を入力、小型エディター下部の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> 引用テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、引用テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない引用テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | ここでは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択し、「脚注」エディターでテキストに書式設定を加えつつ、引用テンプレートを使わずに記入する例を示しています。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない引用テンプレートを呼び出すことができます。「<code>{{int|visualeditor-toolbar-insert}}</code>」ツールバーメニューから「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code> アイコン」(パズルのピース)をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] セクションをご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディターに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに引用を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 引用テンプレートを、脚注に入れたり基本機能の出典エディターを使ったりせずに、記事に直接追加することができます。「挿入」メニューから「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのピース)をクリックします。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 記入欄に使いたいテンプレートの名前(の冒頭の数文字)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] p4r61rd7wj5h0l3bw1cga69bocib5en 8364989 8364987 2026-05-04T06:03:48Z TzrZzz 18352707 8364989 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な引用テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 希望する引用タイプがメニューにない場合は、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択してください。 (ご利用のローカルウィキでこのメニューに引用テンプレートを追加する手順は、 {{ll|VisualEditor/Citation tool}} をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | 「書籍」などの標準引用テンプレートのアイコンをクリックすると、そのテンプレートの小型エディターが開きます。よく使われるフィールド(テンプレートのパラメーター)が表示されますが、すべてが必須というわけではありません。重要なフィールドはアスタリスクと左サイドバーのグレーのチェックボックスで示されます。任意フィールド(青色のチェックボックス)はサイドバーのチェックボックスをオン・オフすることで追加・削除できます。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}} を入力、小型エディター下部の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> 引用テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、引用テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない引用テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | ここでは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択し、「脚注」エディターでテキストに書式設定を加えつつ、引用テンプレートを使わずに記入する例を示しています。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない引用テンプレートを呼び出すことができます。「<code>{{int|visualeditor-toolbar-insert}}</code>」ツールバーメニューから「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code> アイコン」(パズルのピース)をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] セクションをご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディターに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに引用を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 引用テンプレートを、脚注に入れたり基本機能の出典エディターを使ったりせずに、記事に直接追加することができます。「挿入」メニューから「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのピース)をクリックします。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に、記入欄に使いたいテンプレートの名前(または一部)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディタに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] i98m04iki5xen1uhf3jkevg4xoc622p 8364991 8364989 2026-05-04T06:04:52Z TzrZzz 18352707 8364991 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な引用テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 希望する引用タイプがメニューにない場合は、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択してください。 (ご利用のローカルウィキでこのメニューに引用テンプレートを追加する手順は、 {{ll|VisualEditor/Citation tool}} をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | 「書籍」などの標準引用テンプレートのアイコンをクリックすると、そのテンプレートの小型エディターが開きます。よく使われるフィールド(テンプレートのパラメーター)が表示されますが、すべてが必須というわけではありません。重要なフィールドはアスタリスクと左サイドバーのグレーのチェックボックスで示されます。任意フィールド(青色のチェックボックス)はサイドバーのチェックボックスをオン・オフすることで追加・削除できます。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}} を入力、小型エディター下部の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> 引用テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、引用テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない引用テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | ここでは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択し、「脚注」エディターでテキストに書式設定を加えつつ、引用テンプレートを使わずに記入する例を示しています。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない引用テンプレートを呼び出すことができます。「<code>{{int|visualeditor-toolbar-insert}}</code>」ツールバーメニューから「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code> アイコン」(パズルのピース)をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] セクションをご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディターに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに引用を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 引用テンプレートを、脚注に入れたり基本機能の出典エディターを使ったりせずに、記事に直接追加することができます。「挿入」メニューから「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのピース)をクリックします。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に、記入欄に使いたいテンプレートの名前(または一部)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディターに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] 8oqfimzlizkmqyxni5yf1ysuod499sr 8364993 8364991 2026-05-04T06:05:11Z TzrZzz 18352707 8364993 wikitext text/x-wiki <languages/> {{PD Help Page}} このページでは、ユーザーが利用するウィキに地域化された注釈テンプレートは設定されたが[[:mw:Citoid|citoid service]]は導入されていない場合に、'''脚注("注釈"、"本文中の注釈"、"出典" とも呼ぶ)を追加する方法'''を示しています。 <span id="The_toolbar"></span> == ツールバー == <div class="overflowbugx" style="overflow:auto; width: 100%;"> [[{{lm|VisualEditor_toolbar|png|-}}|frameless|center|1200px|alt=ビジュアルエディターのツールバーの画面キャプチャ]] </div> {| cellpadding="20" |- | colspan=2 | 編集を始めると画面上部にビジュアルエディターのツールバーが表示されます。 |- | [[{{lm|VisualEditor_citoid_Cite_button|png|-}}|frameless|border|300px|center]] | '''<code>{{int|Cite-ve-toolbar-group-label}}</code> ボタン:''' 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ボタンを使って脚注を追加。 出典の書式設定の「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」と引用を再利用する「<code>{{int|Cite-ve-dialog-reference-useexisting-tool}}</code>」は、どのプロジェクトでも利用できます。 このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 (ご利用のウィキの「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにローカルの引用テンプレートを追加する手順は {{ll|VisualEditor/Citation tool}} を参照してください。) |- | [[{{lm|VisualEditor Insert Menu|png|-}}|frameless|border|250px|center]] | '''<code>{{int|visualeditor-toolbar-insert}}</code>:''' 「<code>{{int|visualeditor-toolbar-insert}}</code>」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 * 「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(ジグソーパズルの駒の形)を押すと[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 * 「<code>{{int| Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 |} <div class="overflowbugx" style="overflow:auto; "> <span id="Editing_an_existing_footnote"></span> == 既存の脚注の編集 == {| cellpadding="15" |- | [[{{lm|VisualEditor - Editing references 1|png|-}}|frameless|border|400px|center]] | 既存の脚注を編集するには、本文中の脚注をクリックします (通常、角括弧付きの数字で表示されます)。すると、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (ブックマーク) か、脚注の作成に使用されたテンプレートの名前が書かれた別のアイコンが表示されます。「編集」ボタンをクリックすると、脚注を編集するためのダイアログが表示されます。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 6|png|-}}|frameless|border|center|500px]] | 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing References - Cite Web|png|-}}|frameless|border|center|400px]] | 脚注マークをクリックした時に「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 |- | colspan=2 | <hr /> |- | [[File:Editing a reference in a citation template.png|alt=Editing a reference in a citation template|center|frameless|649x649px]] | テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 まったく新しいフィールドを追加するには、ショートカット {{Key press|Ctrl|Shift|D}} を使用し、小型エディター下部の「<code>{{int|visualeditor-dialog-transclusion-add-undocumented-param}}</code>」をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Apply Changes|png|-}}|frameless|border|center|150px]] | 完了したら、「<code>{{int|visualeditor-dialog-action-apply}}</code>」を押します。 |} <span id="Re-using_an_existing_footnote"></span> == 既存の脚注の再利用 == {| cellpadding="15" |- | [[{{lm|VisualEditor_Cite_menu_re-use_tab|png|-}}|frameless|border|500px|center]] | 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 次に「<code>{{int|Cite-ve-toolbar-group-label}}</code>」ダイアログの「再利用」タブをクリックします。 再利用したい出典を一覧から探して選択します。 出典が多数ある場合は、検索ボックス(「<code>{{int|cite-ve-reference-input-placeholder}}</code>」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 |- | colspan=2 | <hr /> |- | colspan=2 | |} <span id="Adding_a_new_footnote"></span> == 新しい脚注の追加 == <span id="Using_a_standard_citation_template_for_a_new_footnote"></span> === 標準的な引用テンプレートで脚注を追加 === {| cellpadding="15" |- | [[{{lm|Manual_tab_only_-_visual_editor_-_citations|png|-}}|frameless|border|407x407px|center]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから新しい脚注を追加します。 まず、本文中の脚注を追加したい位置にカーソルを置きます。 次に「<code>{{int|citoid-citoiddialog-mode-manual}}</code>」タブをクリックします。 その後、ダイアログから標準の引用タイプを選択します。 希望する引用タイプがメニューにない場合は、「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択してください。 (ご利用のローカルウィキでこのメニューに引用テンプレートを追加する手順は、 {{ll|VisualEditor/Citation tool}} をご参照ください。) |- | colspan=2 | <hr /> |- | [[{{lm|Required and optional parameters in the sidebar|png|-}}|alt=Using a standard citation template for a new footnote|center|frameless|644x644px]] | 「書籍」などの標準引用テンプレートのアイコンをクリックすると、そのテンプレートの小型エディターが開きます。よく使われるフィールド(テンプレートのパラメーター)が表示されますが、すべてが必須というわけではありません。重要なフィールドはアスタリスクと左サイドバーのグレーのチェックボックスで示されます。任意フィールド(青色のチェックボックス)はサイドバーのチェックボックスをオン・オフすることで追加・削除できます。 Optional fields (blue checkbox) can be added and removed from the template by checking and unchecking them in the sidebar. それまでにない欄を追加するには、ショートカットの {{Key press|Ctrl|Shift|D}} を入力、小型エディター下部の「Add undocumented parameter」を押します。 完了したら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押します。 |} <span id="Using_the_<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>_citation_for_a_new_footnote"></span> === <code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code> 引用テンプレートで脚注を追加する === {| cellpadding="15" |[[{{lm|VisualEditor references more|png|-}}|centre|frameless|424x424px]] | 「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューから「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選ぶこともできます。 「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」項目の使用目的は、引用テンプレートを使わずに脚注を作るか、「<code>{{int|Cite-ve-toolbar-group-label}}</code>」メニューにない引用テンプレートを使って脚注を作るかの2つあります。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 20|png|-}}|frameless|border|500px|center]] | ここでは「<code>{{int|Cite-ve-dialogbutton-reference-tooltip}}</code>」を選択し、出典エディターでテキストに書式設定を加えつつ、引用テンプレートを使わずに記入する例を示しています。 新しく追加した脚注を他と区別する方法もありますが、一般的ではありません。 (脚注を2グループ以上に分割するときは、どのグループの脚注を表示するか「<code>{{int|Cite-ve-dialogbutton-referenceslist-tooltip}}</code>」ツールで指定してください。) |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor Basic citation Insert menu with citation templates|png|-}}|frameless|border|center|500px]] | 出典エディタでは「<code>{{int|Cite-ve-toolbar-group-label}}</code>」に (まだ) 表示されない引用テンプレートを呼び出すことができます。「<code>{{int|visualeditor-toolbar-insert}}</code>」ツールバーメニューから「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code> アイコン」(パズルのピース)をクリックします。 |- | colspan=2 | <hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|#Editing templates]] セクションをご参照ください。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディターに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} <span id="Adding_a_citation_outside_of_a_footnote"></span> == 脚注以外のところに引用を追加 == <mark>挿入 > テンプレート > Cite book(の類)を使って、== 参考文献 == 節の一覧を書く方法</mark> {| cellpadding="15" |- | [[{{lm|VisualEditor Template Insert Menu|png|-}}|frameless|border|center|300px]] | 引用テンプレートを、脚注に入れたり基本機能の出典エディターを使ったりせずに、記事に直接追加することができます。「挿入」メニューから「<code>{{int|visualeditor-dialogbutton-template-tooltip}}</code>」アイコン(パズルのピース)をクリックします。 |- | colspan="2" |<hr /> |- | [[{{lm|VisualEditor - Editing references 9|png|-}}|frameless|border|center|500px]] | 次に、記入欄に使いたいテンプレートの名前(または一部)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[Special:MyLanguage/Help:VisualEditor/User guide#Editing templates|テンプレートの編集]]節に詳しい説明があります。) テンプレートの編集が終わったら、「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと出典エディターに戻り、もう一度「<code>{{int|visualeditor-dialog-action-insert}}</code>」を押すと編集していた元のページに戻ります。 |} </div> [[Category:VisualEditor{{#translation:}}|User guide]] 9nwik5qxoadv1vu66bmfq9onv4nfz4v Template:Update/en 10 495975 8364318 8364238 2026-05-03T12:47:01Z FuzzyBot 451990 Updating to match new version of source page 8364318 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |The '''factual accuracy''' of parts of this page (those related to {{{part|{{{1|}}}}}}) '''may be compromised due to out-of-date information'''. |Parts of this page (those related to {{{part|{{{1|}}}}}}) are '''outdated'''.}} |{{#if:{{{inaccurate|}}} |The '''factual accuracy''' of this page '''may be compromised due to out-of-date information'''. |This page is '''outdated'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|It was written for an older version of MediaWiki and may not apply to the most recent version.}} If you have checked or updated this page and found the content to be suitable, please remove this notice. {{#ifexist: {{TALKPAGENAME}} |&#32;See the [[{{TALKPAGENAME}}|talk page]] for a possible discussion on this. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Last update: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= Aliases of this template: * {{tlx|outdated}} == Examples == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} == See also == * {{tl|historical}} == TemplateData == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> gcemmym1fq6zhphbl83vjojcaubhwxs Template:Update/es 10 496242 8364319 8364239 2026-05-03T12:47:02Z FuzzyBot 451990 Updating to match new version of source page 8364319 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |La '''exactitud fáctica''' de partes de esta página (aquellas relacionadas con {{{part|{{{1|}}}}}}) '''puede verse comprometida debido a la presencia de información desactualizada'''. |Partes de esta página (aquellas relacionadas con {{{part|{{{1|}}}}}}) están '''desactualizadas'''.}} |{{#if:{{{inaccurate|}}} |La '''exactitud fáctica''' de esta página '''puede verse comprometida debido a la presencia de información desactualizada'''. |Esta página está '''desactualizada'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|Está escrita para una versión anterior de MediaWiki y puede que no aplique a la versión más reciente.}} Si comprobó o modificó esta página y considera que el contenido ya se encuentra actualizado, elimine este aviso. {{#ifexist: {{TALKPAGENAME}} |&#32;Consulte la [[{{TALKPAGENAME}}|página de discusión]] para una posible discusión sobre este. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Última actualización: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= Alias de esta plantilla: * {{tlx|outdated}} <span id="Examples"></span> == Ejemplos == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == Véase también == * {{tl|historical}} <div lang="en" dir="ltr" class="mw-content-ltr"> == TemplateData == </div> {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> pfb73rq8w4qs72vqv00v63iog5q1net Template:Update/ru 10 521286 8364333 8364253 2026-05-03T12:47:09Z FuzzyBot 451990 Updating to match new version of source page 8364333 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |'''Фактическая точность''' частей этой страницы (относящихся к {{{part|{{{1|}}}}}}) '''может быть скомпрометирована из-за устаревшей информации'''. |Части этой страницы (связанных с {{{part|{{{1|}}}}}}) '''устарели'''.}} |{{#if:{{{inaccurate|}}} |'''Фактическая точность''' этой страницы '''может быть скомпрометирована из-за устаревшей информации'''. |Эта страница '''устарела'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|Она была написана для более старой версии MediaWiki и может не относиться к самой последней версии.}} Если вы проверили или обновили эту страницу и нашли содержание подходящим, удалите это уведомление. {{#ifexist: {{TALKPAGENAME}} |&#32;Смотрите [[{{TALKPAGENAME}}|страницу обсуждения]] для возможного обсуждения этого. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Последнее обновление: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= Псевдонимы этого шаблона: * {{tlx|outdated}} <span id="Examples"></span> == Примеры == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == См. также == * {{tl|historical}} == TemplateData == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> k9sbntcr1ewosr7j80pal05bda3gttg Template:Update/zh 10 523190 8364336 8364257 2026-05-03T12:47:11Z FuzzyBot 451990 Updating to match new version of source page 8364336 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |'''由于过时信息''',此頁面一部分(与{{{part|{{{1|}}}}}}相关)的'''事实准确性可能有待查证'''。 |此頁面的一部分(与{{{part|{{{1|}}}}}}相关)已'''过时'''。}} |{{#if:{{{inaccurate|}}} |'''由于过时信息''',此頁面的'''事实准确性可能有待查证'''。 |此頁面已'''过时'''。}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|这是为MediaWiki的旧版本撰写的,可能不会应用到最新版本。}} 如果您检查或更新了此页面,并发现内容合适,请移除此通知。 {{#ifexist: {{TALKPAGENAME}} |&#32;参见[[{{TALKPAGENAME}}|讨论页]]以获取可能有关此问题的讨论。 }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>上次更新: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= 该模板的别名: * {{tlx|outdated}} <span id="Examples"></span> == {{LC zh|lang = {{{lang|}}}|type = H|zh-hans = 示例|zh-hant = 範例}} == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == 参见 == * {{tl|historical}} <span id="TemplateData"></span> == 模板数据 == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> oggo88dk33e5w8iavi0rr1t9aavpog1 Help:Extension:ParserFunctions/hy 12 554277 8365018 8353934 2026-05-04T06:20:41Z FuzzyBot 451990 Updating to match new version of source page 8365018 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span lang="en" dir="ltr" class="mw-content-ltr">The {{ll|Extension:ParserFunctions|nsp=0}} extension provides additional [[Special:MyLanguage/Parser functions|parser functions]] to supplement those already present in MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">(It ''may'' be configured to provide additional parser functions for string handling; these are only available to non-Wikimedia Foundation wikis hence these string functions are documented {{ll|Extension:ParserFunctions/String functions|elsewhere}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">All the parser functions provided by this extension take the form:</span> :<code><nowiki>{{</nowiki>'''#ֆունկցիայիանուն''': ''փոփոխական 1'' | ''փոփոխական 2'' | ''փոփոխական 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Տեսակ ! {{hl1}} | Օպերատորներ |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Grouping (parentheses)</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Թվեր | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | <span lang="en" dir="ltr" class="mw-content-ltr">binary operator</span> <code>'''e'''</code> &nbsp; <span lang="en" dir="ltr" class="mw-content-ltr">unary</span> <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Unary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Binary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Round</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Logic</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Այս ֆունկցիան թվերով արտահայտում է մաթեմատիկական արտահայտությունները և արտացոլում է հաշվարկված արժեքը: Այս ֆունկցիան նաև հասանելի է {{ll|Extension:Scribunto|nsp=0}}-ում՝ <code>mw.ext.ParserFunctions.expr</code> ֆունկցիայի տեսքով: :<code><nowiki>{{#expr:</nowiki> ''արտահայտություն'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span class="mw-translate-fuzzy">Հասանելի օպերատորների ցանկը աջ կողմում է։ Օպերատորների ֆունկցիաների առավել մանրամասն տեղեկությունների համար այցելեք [[{{ll|Manual:Expr parser function syntax}}|Help:Calculation]]։ Արդյունքի ճշտություն ու ձևաչափը կախված է տվյալ վիքիի սերվերի օպերացիոն համակարգից և լեզվից։</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div class="mw-translate-fuzzy"> Գնահատելիս օգտագործվում է [[:hy:Բուլյան հանրահաշիվ|Բուլյան հանրահաշիվը]]. զրոն գնահատվում է <code>սխալ</code>, իսկ զրոյից տարբեր ցանկացած արժեք՝ <code>ճշմարիտ</code>։ </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code>[[##iferror|#iferror]]</code> function: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Rounding === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Test case</span> ! {{hl1}} | Արդյունք ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Method of rounding</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is < 5, so no apparent rounding occurs</span> (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is ≥ 5, so it is rounded up</span> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to the nearest integer</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the ''nearest'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding up or down with ''ceil'' and ''floor''</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next ''larger'' integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next ''smaller'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next larger integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next smaller integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Not rounded, since 1 already is an integer</span><br />{{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect</span>}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Strings === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: փորձնական տող | արժեք, երբ փորձնական տողը դատարկ չէ | արժեք, երբ փորձնական տողը դատարկ է (կամ պարունակում է միայն բացատ)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: առաջին պարամետր | երկրորդ պարամետր | երրորդ պարամետր }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Example: </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Year</span> |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">4-digit year.</span> | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Month</span> |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Ժամ |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Minutes and seconds</span> |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Տես նաև == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] gi37nch1u4211lv8myuvuxhmq1cnhxn Help:Extension:ParserFunctions/uk 12 568117 8365037 8353953 2026-05-04T06:21:39Z FuzzyBot 451990 Updating to match new version of source page 8365037 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span class="mw-translate-fuzzy">Розширення {{ll|Extension:ParserFunctions|nsp=0}} впроваджує одинадцять додаткових [[Special:MyLanguage/Parser functions|функцій парсера]] на додачу до «{{$2|магічних слів}}», які вже присутні у MediaWiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> (''Можна'' налаштувати конфігурацію для впровадження інших функцій парсера для обробки текстових рядків; ці функції для рядків задокументовані в {{ll|Extension:ParserFunctions/String functions|іншому місці}}.) Всі парсерні функції впроваджені цим розширенням мають таку форму: :<code><nowiki>{{</nowiki>'''#ім'я_функції''': ''аргумент 1'' | ''аргумент 2'' | ''аргумент 3'' … <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Тип ! {{hl1}} | Оператори |- | {{hl2}} | Групування (круглі дужки) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Числа | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | бінарний оператор <code>'''e'''</code> &nbsp; унарний <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Унарні | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Бінарні | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Округлення | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Логічні | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Ця функція обчислює математичний вираз і повертає обчислене значення. Ця функція також доступна в {{ll|Extension:Scribunto|nsp=0}} під назвою <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''вираз'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span class="mw-translate-fuzzy">Всі доступні оператори перелічені в таблиці справа, в порядку пріоритету. Дивитися [[{{ll|Manual:Expr parser function syntax}}|Help:Calculation]] для детальнішої інформації про роботу кожного з операторів. Точність та формат поверненого результуючого значення відрізняються в залежності від операційної системи сервера, на якому встановлена вікі, та від формату чисел загальноприйнятого для мови сайту.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div class="mw-translate-fuzzy"> У виразах, що використовують [[:uk:Булева алгебра|булеву алгебру]], нуль приймає значення <code>false</code>, а всі інші значення, як додатні, так і від'ємні, приймають значення <code>true</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Отримавши на вході порожній вираз, функція повертає порожній рядок. Некоректні вирази призводять до повернення одного чи декількох повідомлень про помилку, які можна перехопити використовуючи функцію <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' Порядок операторів додавання та віднімання перед чи після числа має значення і може бути сприйнятий як додатне чи від'ємне число, а не як вираз із помилкою: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Зверніть увагу, що при використання у виразі значення поверненого магічним словом, необхідно спочатку привести це значення до «сирого» формату щоб прибрати всі пробіли між цифрами і перевести цифри до арабських. Наприклад, <nowiki>{{NUMBEROFUSERS}}</nowiki> повертає значення {{NUMBEROFUSERS}}, при тому що потрібним значенням є {{formatnum:{{NUMBEROFUSERS}}|R}}, яке можна отримати за допомогою <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Це особливо важливо для деяких мов, де числа записуються не арабськими цифрами. Наприклад, для бенгальської мови <nowiki>{{NUMBEROFUSERS}}</nowiki> поверне ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=Оператор <code>mod</code> дає неправильні результати для деяких значень другого аргументу: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (повертає повідомлення про помилку, хоча має повернути 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span class="mw-translate-fuzzy">Якщо необхідно здійснити обчислення із датами (наприклад, перевірити чи поточні дата і час є пізнішими ніж деякі задані дата і час), спершу переведіть час в кількість секунд що пройшли з 1 січня 1970 використовуючи <nowiki>{{#time: xNU }}</nowiki>, після чого можна просто віднімати та додавати дати як числа.</span>}} <span id="Rounding"></span> === Округлення === Оператор [https://php.net/function.round округлення] округляє число зліва від нього до 1/10 в степені числа справа (в якому дробова частина відкидається). Для округлення до більшого чи меншого цілого значення використовуються унарні оператори <code>ceil</code> та <code>floor</code> відповідно. {| class="wikitable" ! {{hl1}} | Вираз ! {{hl1}} | Результат ! {{hl1}} | Метод округлення |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || Остання цифра (3) є меншою за 5, тому округлення не відбувається (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || Остання цифра (6) є більшою за 5, тому округлення відбувається (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || І знову, результат округляється відповідно до останньої цифри і це призводить до додаткового округлення (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Округлено до найближчого числа кратного 100, оскільки від'ємна експонента (число справа) округляє вліво від десяткової точки |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Округлено до найближчої сотої частини, оскільки додатня експонента (число справа) округляє вправо від десяткової точки |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Дробова частина експоненти не враховується і не впливає на результат округлення |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Відкидання дробової частини |- ! colspan=3 {{hl2}} | Округлення до найближчого цілого числа |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Округлення до ''найближчого'' цілого числа, в даному випадку до нуля, який є меншим за вхідне значення |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Округлення до найближчого цілого числа, в даному випадку до одиниці, яка є більшою за вхідне значення |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Округлення до найближчого цілого числа, в даному випадку до одиниці, яка є більшою за вхідне значення |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Округлення до найближчого цілого числа, в даному випадку до нуля, який є більшим за вхідне значення |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Округлення до найближчого цілого числа, яке є від'ємним та меншим за вхідне значення |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Округлення до найближчого цілого числа, яке є від'ємним та меншим за вхідне значення |- ! colspan=3 {{hl2}} | Округлення до більшого чи меншого цілого значення за допомогою ''ceil'' та ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Округлення до наступного ''більшого'' цілого числа, в даному випадку до одиниці |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Округлення до наступного ''меншого'' цілого числа, в даному випадку до нуля |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Округлення до наступного більшого цілого числа, в даному випадку до нуля |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Округлення до наступного меншого цілого числа, яке є від'ємним |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Не округлено, оскільки 1 вже і так ціле число<br />{{Warning|1=Інтерпретовано як '''(ceil''' 1''')'''/3, а не '''ceil('''1/3''')''', як того можна очікувати}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <span id="Strings"></span> === Текстові рядки === Математичні вирази можуть містити лише числа, вони не можуть порівнювати текстові рядки або символи. Для цього слід використовувати функцію [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Ця функція визначає чи є тестовий рядок порожнім чи ні. Текстовий рядок, що містить тільки пробільні символи, вважається порожнім. :<syntaxhighlight lang="wikitext" inline>{{#if: тестовий рядок | значення, якщо тестовий рядок не порожній | значення, якщо тестовий рядок порожній (або містить тільки пробільні символи)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: перший параметр | другий параметр | третій параметр }}</syntaxhighlight> Спершу функція перевіряє чи не є перший параметр порожнім. Якщо він не порожній, функція виводить другий параметр. Якщо параметр порожній або містить тільки пробільні символи (пробіли, символи перенесення рядка тощо), функція виводить третій параметр. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' Тестовий рядок завжди інтерпретується як текстовий, математичні вирази не вираховуються (див. [[##ifexpr|#ifexpr]]): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' Останній аргумент може бути відсутнім: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' Функція може бути вкладеною. Для цього внутрішня функція #if у повній формі розміщується на місці параметра охоплюючої функції #if. Допускається не більше семи рівнів вкладеності, хоча це може залежати від вікі або обмеження пам'яті. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:тестовий рядок | значення, якщо тестовий рядок не порожній |{{#if:test string |value if test string is not empty |значення, якщо тестовий рядок порожній (або містить тільки пробільні символи) }} }} </syntaxhighlight> <span class="mw-translate-fuzzy">Також, можна використовувати параметр в якості тестового рядку у функції <code>#if</code>. Необхідно переконатися, що ви додано символ $1 (вертикальна риска) після імені змінної.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> (так що, якщо параметр не має значення, то він оцінюється в порожній рядок замість рядка «<code><nowiki>{{{1}}}</nowiki></code>») :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Ви ввели текст у змінній 1 |2=Тексту у змінній 1 немає }} Див. {{ll|Help:Parser functions in templates}} для інших прикладів використання цієї функції парсера. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Ця функція парсера порівнює два введені рядки, визначає чи є вони ідентичними та повертає один з двох текстових рядків залежно від результату. Якщо вимагається більша кількість порівнянь і вихідних рядків, розгляньте використання <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Якщо обидва текстові рядки є числовими значеннями, вони порівнюються як числа: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' В іншому разі порівнюється текст; це порівняння чутливе до регістру: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(порівняти з подібним прикладом вище, без лапок)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(порівняти з подібним прикладом вище, де <code>[[##expr|#expr]]</code> повертає дійсне число першим)'' <span class="mw-translate-fuzzy">Як практичний приклад, розглянемо наявний {{ll|Help:Templates|шаблон}} <code>Template:Timer</code>, який використовує парсер для вибору між двома форматами часу: коротким та довгим.</span> Він бере параметр як перший аргумент і порівнює з текстовим рядком «short» — порядок розміщення цих рядків не має значення, але легше читати якщо параметр іде першим. Код шаблону визначено як: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> і працює таким чином: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=При використанні всередині функції парсера, будь-які теги та інші функції парсера мають бути замінені на {{ll|Strip marker|унікальний код}}. Це впливає на порівняння таким чином: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Якщо текстові рядки які необхідно порівняти є однаковими викликами одного {{ll|Help:Templates|шаблону}} що містять теги, то повертається значення true, але в разі виклику двох шаблонів із однаковим вмістом що містить теги, повертається false. }} {{Warning|1=Порівняння текстового рядка із {{ll|Help:Magic words#Page names|магічним словом}}, яке повертає назву сторінки, може не спрацювати залежно від конфігурації сайту. Наприклад, <nowiki>{{FULLPAGENAME}}</nowiki>, залежно від вікі, може зробити першу літеру великою і замінити всі пробіли на знаки підкреслення. Для обходу цього застосуйте магічне слово до обох параметрів: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Функція приймає на вході текстовий рядок і повертає значення <code>true</code> якщо цей рядок містить об'єкт HTML із <code>class="error"</code>, який був згенерований іншою функцією парсера, зокрема <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> або <code>[[##rel2abs|#rel2abs]]</code>, або був згенерований [[Special:MyLanguage/Help:Templates|шаблоном]] з помилкою, такою як нескінченний цикл або рекурсія, або виник внаслідок іншої помилки. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">Один чи обидва текстові рядки для повернення, можуть бути пропущені. Якщо пропущено рядок <code>''correct''</code>, то замість нього буде повернено значення <code>''test string''</code> якщо воно не містить помилок. Якщо пропущено рядок <code>''error''</code>, то у випадку помилки буде повернений порожній текстовий рядок.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == Ця функція обчислює математичний вираз та повертає один з двох текстових рядків залежно від логічного значення результату: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div class="mw-translate-fuzzy"> Вираз <code>''expression''</code> обчислюється так само як і у функції <code>[[##expr|#expr]]</code>, з використанням тих самих операторів. Результат виразу, після цього, трактується як логічне значення. </div> Порожній вхідний вираз трактується як {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Як сказано вище, нуль приймає значення {{phpi|false}}, а будь-яке ненульове значення приймає значення {{phpi|false}}, тому ця функція еквівалентна до використання <code>[[##expr|#expr]]</code> всередині <code>[[##ifeq|#ifeq]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div class="mw-translate-fuzzy"> за винятком порожнього виразу чи виразу із помилкою (повідомлення про помилку вважається порожнім рядком; воно не рівне нулю, тому застосовується <code>''value if true''</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' в порівнянні з :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Одне чи обидва значення для повернення, можуть бути пропущені; якщо значення пропущене, замість нього повертається порожній рядок: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Результати порівняння чисел з <code>[[##ifexpr|#ifexpr]]</code> не завжди співпадають з результатами <code>[[##ifeq|#ifeq]]</code> і <code>[[##switch|#switch]]</code>. Два останні є точнішими за <code>[[##ifexpr|#ifexpr]]</code> і не повертають еквівалентні результати. Розгляньте ці порівняння зі зміненою останньою цифрою: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Оскільки PHP, що використовується в <code>[[##ifeq|#ifeq]]</code> і <code>[[##switch|#switch]]</code>, порівнює два числа цілочислового типу, то він коректно повертає очікуваний результат. Тоді як <code>[[##ifexpr|#ifexpr]]</code> для тих самих чисел: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' З іншою цифрою результат рівності дійсно некоректний. Така поведінка <code>[[##ifexpr|#ifexpr]]</code> пояснюється тим, що MediaWiki перетворює числа у виразах на [[:w:uk:Число з рухомою комою|числа з рухомою комою]], що для великих чисел, як ті що використані в прикладі, передбачає деяку степінь округлення.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} Ця функція бере на вході текстовий рядок, інтерпретує його як назву сторінку, та повертає один з двох текстових рядків залежно від того чи існує сторінка на цій вікі. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span class="mw-translate-fuzzy">Функція повертає <code>true</code> якщо сторінка існує, незалежно від того чи є на ній видимий вміст чи вона є порожньою (містить тільки метадані такі як посилання на категорії, {{ll|Help:Magic words|магічні слова}} або {{ll|Help:Redirects|перенаправлення}}, але не містить видимого вмісту, або ж і взагалі є повністю порожньою). Тільки сторінки які є «червоними посиланнями» повертають значення <code>false</code>, включаючи сторінки що існували раніше але були видалені.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div class="mw-translate-fuzzy"> Функція повертає значення <code>true</code> {{ll|Help:System message|системних повідомлень}} що були адаптовані та для {{ll|Help:Special pages|спеціальних сторінок}} які задані програмним забезпеченням. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (оскільки на цій вікі встановлене розширення {{ll|Extension:Checkuser|nsp=0}}) | '''doesn't exist''' (оскільки на цій вікі не встановлене розширення {{ll|Extension:Checkuser|nsp=0}}) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (оскільки [[{{ns:8}}:Copyright]] було адаптовано) | '''doesn't exist''' (оскільки [[{{ns:8}}:Copyright]] не було адаптовано) }} <span class="mw-translate-fuzzy">Якщо на одній сторінці перевіряється існування другої за допомогою <code>#ifexist:</code>, то перша (та на якій перевіряється) з'явиться в списку [[{{#special:WhatLinksHere}}]] для другої (та яка перевіряється). Тому, якщо $code1:Foo $code2 було би включене до цієї сторінки, то $fullpagename2 з'явилась би в списку [[$wth/Foo]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> На вікі, які використовують спільний репозиторій медіафайлів (зокрема Вікісховище), функція <code>#ifexist:</code> може бути використана для перевірки того чи існує файл із такою назвою, і функція перевірить існування файлу на репозиторії, а не на самій вікі: :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' Якщо була створена сторінка опису файла на цій вікі, то для всіх трьох попередніх прикладів результатом буде '''exists'''. Функція <code>#ifexist:</code> не працює з міжмовними посиланнями (інтервікі). <span id="ifexist_limits"></span> === Обмеження === Функція <code>#ifexist:</code> вважається «ресурсомісткою функцією парсера», тому кількість викликів цієї функції з однієї сторінки є обмеженою (включаючи виклики зроблені в шаблонах, що включаються до сторінки). <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> Також, сторінки із таким перевищенням обмеження додаються до {{ll|Help:Tracking categories|категорії спостереження}} $category, чия назва може відрізнятися залежно від мови вікі. <span class="mw-translate-fuzzy">Для деяких випадків можливо імітувати функцію «ifexist» за допомогою CSS, використовуючи селектори <code>a.new</code> (щоб вибрати посилання на неіснуючі статті) або <code>a:not(.new)</code> (щоб вибрати посилання на існуючі статті).</span> <span class="mw-translate-fuzzy">Крім того, оскільки максимальна кількість викликів ресурсомістких функцій на одній сторінці вказана в <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, то можна показати більшу кількість у файлі LocalSettings.php за потреби.</span> <span id="ifexist_and_wanted_pages"></span> === ifexist і бажані сторінки === <span class="mw-translate-fuzzy">Сторінку, яка не існує та випробовується для використання #ifexist, буде додано до [[Special:MyLanguage/Manual:WantedPages|Бажані сторінки]].</span> Див. {{phab|T14019}} щодо причини цього й [[w:Template:Linkless exists]] за обхідним шляхом. == #rel2abs == Ця функція перетворює відносний шлях до файла на абсолютний. :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> В аргументі <code>path</code> дійсним є наступний синтаксис: *<code>.</code> → поточний рівень *<code>..</code> → піднятися на один рівень *<code>/foo</code> → опуститися на один рівень у підкаталог /foo Якщо <code>base path</code> не задано, замість нього буде використана повна назва поточної сторінки: :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' Неправильний синтаксис, такий як <code>/.</code> або <code>/./</code>, ігнорується. Оскільки не більше двох повних зупинок поспіль дозволено, то послідовності на кшталт цих можуть бути використані для відокремлення послідовних інструкцій: :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''Див. також: [[w:Help:Switch parser function]]'' Ця функція порівнює вхідний аргумент із декількома текстовими рядками, і якщо збіг знайдено, повертає значення поставлене у відповідність до знайденого рядка. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Приклади: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' Функція <nowiki>#</nowiki>switch з тегами частково включення може використовуватись в конфігураційних файлах, що дає змогу користувачам незнайомим з шаблонами переглядати та змінювати конфігуровані елементи. <span id="Default"></span> === За замовчуванням === Результат <code>''за замовчуванням''</code> повертається якщо жоден <code>''випадок''</code> не збігається із <code>''рядком для порівняння''</code>: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' У цьому синтаксисі результат за замовчуванням повинен бути останнім параметром і не повинен містити сирий знак рівності (знак рівності без <code><nowiki>{{}}</nowiki></code>). Якщо це так, то розглядатиметься як порівняння випадків, і жодний текст не виводитиметься, якщо жодний випадок не відповідає. Це тому що значення за замовчуванням не було визначене (порожнє). Проте, якщо випадок відповідає, то асоційований із ним рядок буде повернуто. :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> Або можна прямо вказати результат за замовчуванням вказавши «<code>#default</code>» в якості <code>''випадку''</code>. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Результати за замовчуванням вказані таким способом можна розмістити будь-де всередині функції: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' Якщо результат <code>''за замовчуванням''</code> не вказано і не знайдено випадку що збігається із рядком для порівняння, повертається порожній рядок: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Групування результатів === Можна зробити «провалювання» (об'єднання) одних <code>''випадків''</code> в інші. Тоді декілька <code>''випадків''</code> повернуть той самий <code>''результат''</code>. Це мінімізує повторення коду. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Тут випадки 2, 3 та 4 повертають однаковий результат <code>''result234''</code>; Обоє випадки 6 та 7 повернуть <code>''result67''</code>. «<code>#default = </code>» в останньому параметрі може бути опущений у вищенаведеному випадку. <span id="Use_with_parameters"></span> === Використання з параметрами === Функція може бути використана з параметрами як тестовий рядок. У цьому випадку необов'язково розміщувати вертикальну риску після імені параметру, оскільки дуже малоймовірно, що ви виберете встановити випадок із рядком «<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>». (Це значення, яке параметр матиме за замовчуванням, якщо вертикальна риска відсутня, а параметр не існує чи має значення. Див. {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> У вищенаведеному випадку якщо <code><nowiki>{{{1}}}</nowiki></code> дорівнює <code>foo</code>, то функція поверне <code>Foo</code>. Якщо ж дорівнює <code>baz</code>, то функція поверне <code>Baz</code>. Якщо параметр порожній або не існує, то функція поверне <code>Bar</code>. Як у розділі вище, випадки можуть поєднуватися й давати єдиний результат. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> Тут, якщо <code><nowiki>{{{1}}}</nowiki></code> дорівнює <code>foo</code>, <code>zoo</code> чи <code>roo</code>, то функція поверне <code>Foo</code>. Якщо ж дорівнює <code>baz</code>, то функція поверне <code>Baz</code>. Якщо параметр порожній або не існує, то функція поверне <code>Bar</code>. На додачу, результат за замовчуванням може бути опущений, якщо ви не бажаєте нічого повертати, якщо значення тестового параметру не відповідає жодному випадку. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> У цьому випадку функція повертає порожній рядок, якщо <code><nowiki>{{{1}}}</nowiki></code> не існує чи не дорівнює <code>foo</code> або <code>bar</code>, у цьому випадку вона повертає <code>Foo</code> або <code>Bar</code>. Це має той самий ефект, що й оголошення порожнім результату за замовчуванням. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> Якщо з деяких причин ви вирішили встановити випадок як «<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>», то функція поверне результат такого випадку, коли параметр не існує чи не має значення. Параметр повинен існувати та мати будь-яке значення, крім рядка «<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>» для повернення результату функції за замовчуванням. :(якщо <code><nowiki>{{{1}}}</nowiki></code> не існує чи порожнє) ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span class="mw-translate-fuzzy">(якщо <code><nowiki>{{{1}}}</nowiki></code> має значення «<code>test</code>»):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(якщо <code><nowiki>{{{1}}}</nowiki></code> має значення «<code><nowiki>{{{1}}}</nowiki></code>»): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' В такому гіпотетичному випадку слід додати до параметра вертикальну риску (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). <span id="Comparison_behavior"></span> === Нюанси порівняння === Так само як і в <code>[[##ifeq|#ifeq]]</code>, якщо рядок для порівнянна та випадок є числами, вони порівнюються як числа. В іншому випадку вони вважаються текстовими рядками чутливими до реєстру: :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <code>''Випадок''</code> може бути порожнім текстовим рядком: :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' Як тільки знайдено збіг, всі подальші <code>''випадки''</code> ігноруються: :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= Порівняння чисел в <code>[[##switch|#switch]]</code> та <code>[[##ifeq|#ifeq]]</code> здійснюються відмінно від того як це робиться у математичних виразах (див. вище): :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <span id="Raw_equal_signs"></span> === Буквальне включення знаку рівності === Текстові рядки випадків не можуть містити знаків рівності. Щоб обійти це обмеження, використайте магічне слово [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] або замість символу рівності вставте його HTML-код <code><nowiki>&amp;#61;</nowiki></code>. Приклад: {| class="wikitable" ! Ваш тип ! Ви отримуєте |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=Реальний простий приклад використання функції «#switch» можна побачити в шаблоні [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Двома складнішими прикладами є {{ll|Template:Extension}} та [[w:Template:BOTREQ]]. }} <span id="Replacing_#ifeq"></span> === Заміна #ifeq === Функція <code>#switch</code> може використовуватись для зниження [[Special:MyLanguage/Help:Expansion depth|рівня вкладеності]]. Наприклад: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> є еквівалентними до * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> тобто глибокого вкладення, лінійного: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> З іншого боку, заміна switch може бути складною чи непрактичною для IF, вкладених в обидві гілки (показано з альтернативами відступів з обох боків), утворюючи повне симетричне дерево: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Код ! {{hl1}} | Опис ! {{hl1}} | Результат для поточного моменту <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Очистіть кеш цієї сторінки] для оновлення результатів)</small> |- ! {{hl2}} colspan="3"| Рік |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Рік в чотирьох цифрах. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Останні дві цифри року. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1 якщо рік високосний, 0 якщо ні. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|Потребує PHP версії 5.1.0 або новіше та [[rev:45208]].|group=note}} | Рік вказаного тижня відповідно до ISO-8601.{{#tag:ref|Має те саме значення що і Y, окрім випадку коли номер тижня (W) за ISO належить до попереднього чи наступного року, в якому повертається цей рік.|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|Поверне рядок ''o'', якщо не виконуються умови першої примітки.|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Місяць |- | style="text-align: center;" | <code>n</code> | Номер місяця без додавання нуля спереду. | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | Номер місяця із додаванням нуля спереду за потреби. | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | Скорочена назва місяця мовою сайту. | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | Повна назва місяця мовою сайту. | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | Виводить повну назву місяця в [[w:uk:Родовий відмінок|родовому відмінку]] мовою сайту, для розділення родового та [[w:uk:Називний відмінок|називного відмінку]]. Така можливість є корисною для багатьох [[w:uk:Слов'янські мови|слов'янських мов]], наприклад польської, російської, білоруської, чеської, словацької, словенської, української тощо. | style="line-height: 1.6;" | Для польської мови:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(називний відмінок)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(родовий відмінок) |- ! {{hl2}} colspan="3"| День місяця або року |- | style="text-align: center;" | <code>j</code> | День місяця без додавання нуля спереду. | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | День місяця із додаванням нуля спереду за потреби. | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | День року (1&nbsp;січня = 0).<br/>{{note}} Щоб отримати день року за ISO, додайте 1. | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Тиждень та день тижня |- | style="text-align: center;" | <code>W</code> | Номер тижня за ISO 8601 із додаванням нуля спереду за потреби. | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | Номер дня тижня за ISO 8601 (понеділок = 1, неділя = 7). | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | Номер дня тижня (неділя = 0, субота = 6). | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | Скорочення назви дня тижня. Перекладено не на всі мови. | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | Повна назва дня тижня. Перекладено не на всі мови. | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Година |- | style="text-align: center;" | <code>a</code> | «am» в першій половині дня (00:00:00 → 11:59:59), «pm» в другій (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span class="mw-translate-fuzzy">Те саме що і <code>a</code> зверху, тільки великими літерами.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Година в 12-годинному форматі без додавання нуля спереду. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Година в 12-годинному форматі із додаванням нуля спереду за потреби. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Година в 24-годинному форматі без додавання нуля спереду. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Година в 24-годинному форматі із додаванням нуля спереду за потреби. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Хвилини та секунди |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | Хвилини із додаванням нуля спереду за потреби. | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | Секунди із додаванням нуля спереду за потреби. | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[:w:uk:Час Unix|Час Unix]]. Кількість секунд що пройшли із 1 січня 1970 року, 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Часовий пояс (відповідно до [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Ідентифікатор часового поясу. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | Чи належить дата до періоду літнього часу. | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Різниця із часом за Гринвічем (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Різниця із часом за Гринвічем (GMT) з двокрапкою | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Абревіатура часового поясу. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | Різниця часових поясів у секундах. | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Різне |- | style="text-align: center;" | <code>t</code> | Кількість днів у поточному місяці. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | Дата форматована за ISO 8601, еквівалентна до <code>Y-m-d"T"H:i:s+00:00</code>. | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | Дата форматована за [[rfc:5322|RFC 5322]], еквівалентна до <code>D, j M Y H:i:s +0000</code>, де назва дня тижня та назва місяця тільки англійською. | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Негрегоріанські календарі |- ! {{hl3}} colspan="3" | [[:w:uk:Мусульманський календар|Мусульманський]] |- | style="text-align: center;" | <code>xmj</code> | День місяця. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Повна назва місяця. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Номер місяця. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Рік повністю. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | [[:w:uk:Іранський календар|Іранський]] |- | style="text-align: center;" | <code>xit</code> | Кількість днів у поточному місяці. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | День року. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | День місяця. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Повна назва місяця. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Номер місяця. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Рік повністю. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Останні дві цифри року. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | [[:w:uk:Єврейський календар|Єврейський]] |- | style="text-align: center;" | <code>xjj</code> | День місяця. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Повна назва місяця. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Кількість днів у поточному місяці. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Назва місяця в родовому відмінку. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Номер місяця. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Рік повністю. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | [[:w:uk:Тайський сонячний календар|Тайський сонячний]] |- | style="text-align: center;" | <code>xkY</code> | Повний рік у [[w:Thai solar calendar|тайському сонячному календарі]].<br />{{note}} Для років до 1941 дати у проміжку з січня до березня не [[w:Thai solar calendar#New year|обчислюються]] належним чином. | {{#time:xkY}} |- ! {{hl3}} colspan="3" | [[:w:uk:Календар чучхе|Міньго/Чучхе]] |- | style="text-align: center;" | <code>xoY</code> | Рік повністю. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | [[:w:uk:Японське традиційне літочислення|Японське ненґо]] |- | style="text-align: center;" | <code>xtY</code> | Рік повністю. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | Прапори |- | style="text-align: center;" | <code>xn</code> | Форматувати наступний числовий код як число в ASCII. | В мові гінді, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> повертає ०६, 06. |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span class="mw-translate-fuzzy">Те саме що і <code>xn</code>, але як переключений прапор, який діє аж до кінця рядка або до наступної появи <code>xN</code> в текстовому рядку.</span> |- | style="text-align: center;" | <code>xr</code> | Форматує наступне число у вигляді числа із римськими цифрами. Працює тільки для чисел що не перевищують 10 000<br /><small>(3 000 в MediaWiki до версії 1.20)</small>. | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | Форматує наступне число у вигляді числа із єврейськими цифрами. | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} Ця функція парсера приймає дату та/або час (за Грегоріанським календарем) і форматує їх відповідно до заданого синтаксису. Можна задати об'єкт дати/часу; за замовчуванням береться значення [[Special:MyLanguage/Help:Magic words#Date and time|магічного слова]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight>, яке містить час коли поточна сторінка в останнє трансформувалась в HTML. :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> Список допустимих кодів форматування наведено в таблиці справа. Будь-який символ в текстовому рядку для форматування, який не розпізнано, включається до результату без змін; це стосується також і пробілів (для інтерпритації коду системі вони не потрібні). <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> Існує два способи уникнення трактування символу як коду форматування: # <span class="mw-translate-fuzzy"># Обернена коса риска після якої йде символ, трактується як просто цей символ;</span> # <span class="mw-translate-fuzzy"># Символи всередині подвійних лапок так і залишаються символами, а лапки відкидаються.</span> До того ж, подвійний символ <code>xx</code> трактується як один символ «x». Оскільки список кодів форматування продовжує розвиватися (з підтримкою нових календарів або нових полів дати, обчислених і відформатованих по-іншому), ви повинні екранувати всі літерні символи (а не лише літери ASCII, які зараз використовуються в кодах форматування), які потрібно передати через незмінне. На жаль, наразі одинарні лапки ASCII все ще не розпізнаються як проста альтернатива для позначення буквального тексту до підтримуваних на даний момент подвійних лапок ASCII (наприклад, подвійні лапки є обов’язковими для інших видів використання, як-от розмежування значень рядка в JSON, C , C++…) і зворотні косі риски (які також потрібно екранувати в рядкових константах, які використовуються багатьма мовами, включаючи JSON, C, C++, PHP, JavaScript, Lua). Таким чином, ви все одно не можете вставити будь-які буквальні подвійні лапки, не екрануючи їх за допомогою зворотної косої риски (або замість них ви можете використовувати інші фігурні, кутові чи квадратні лапки). :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <code>''Об'єкт дати/часу''</code> можна задавати в будь-якому форматі який допускається у функції [https://php.net/function.strtotime strtotime()] мови PHP. <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <code>''Код мови''</code> у форматі [[w:uk:ISO 639-3|ISO 639-3]] дозволяє відобразити результат обраною мовою: :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' Параметр <code>''local''</code> визначає, чи ''об'єкт дата/час'' позначає місцевий часовий пояс, чи UTC. Це булеві параметри: їхнє значення визначається приведенням значення аргументу (докладніше про приведення рядків до булевих значень див. [https://php.net/language.types.boolean#language.types.boolean.casting офіційну документацію PHP]). {{note|2=reminder|1=Зверніть, будь ласка, увагу на те, що, якщо змінну {{phpi|$wgLocaltimezone}} встановлено в <code>UTC</code>, то немає різниці у виведенні, коли <code>local</code> встановлено у <code>true</code> чи <code>false</code>.}} Докладніше див. наступні приклади: :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div class="mw-translate-fuzzy"> [[:w:uk:Час Unix|Час Unix]] можна використовувати для підрахунку дати, якщо поставити перед ним символ <code>@</code>. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div class="mw-translate-fuzzy"> Без вказання символу <code>@</code> перед часом Unix, результатом зазвичай буде помилка, або ж неочікуване значення: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (правильний результат) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (непідтримуваний формат року) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (правильний результат) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' (трактується як рік з поточними місяцем та числом) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (правильний результат) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' (трактується як рік з поточними місяцем та числом) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (правильний результат) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (непідтримуваний формат року) }} {{Warning|1= Допустимим є час в проміжку від 1 січня 0111 до 31 грудня 9999. Для років від 100 до 100 не завжди правильний, так само як і для Y та високосних років. Коди r, D, l та U трактують ці роки як 2000-2010. :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> (правильний результат, не високосний рік), але :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' (неправильний результат, навіть якщо 100 трактується як 2000, оскільки це високосний рік) :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' Роки з однозначним чи двозначним числовим записом, тобто 0-99, трактуються як 2000-2069 та 1970-1999, окрім випадку коли вони записані як чотиризначні числа що починаються з нулів: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) День тижня підтримується тільки для років 100—110 та для років починаючи із 1753. Для років 111—1752 код «r» повертає «Unknown», а код «l» повертає «<>». В наслідок цього, результат повернений кодом «r» для цих років, не приймається як вхідні дані. }} Дати можна вказувати не тільки повністю, але і частково; функція доповнить частини дати яких не вистачає, використовуючи значення для поточного моменту: :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= Доповнення частин дати доповнює не всі частини дати; деякі частини доповнюються значеннями для поточного моменту, деякі ні: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' Повертає початковий час дня, але поточні день та рік. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' Повертає початковий час дня, але поточні день та місяць. Є виняток із заповненим днем: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' Повертає початок дня і початок місяця. }} Чотиризначне число завжди трактується як рік, і ніколи як години та хвилини:<ref>До випуску версії {{rev|86805}} в 2011 році, це не завжди було так.</ref> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' Шестизначне число трактується як години, хвилини та секунди, якщо це можливо, інакше як помилка (не як рік та місяць): :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' Введене значення трактується як час, а не рік і місяць. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' Попри те що 19:60:09 не є коректним часом, 196009 не трактується як вересень 1960 року. Функція може здійснювати деякі перетворення дати: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span class="mw-translate-fuzzy">Довжина вхідних даних для функції $time має обмеження в 6000 символів<ref>[https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$9 ParserFunctions.php] на phabricator.wikimedia.org</ref>.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Проблема із часовими поясами ==== Існує недолік в роботі функції #time (а саме у класі «DateTime» мови PHP, який використовується цією функцією) який не дозволяє нецілі значення в якості зміщення в годинах для часових поясів. Це не стосується випадків для часових поясів із зміщенням у цілу кількість годин, таких як EDT. Наприклад: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} Але Індія має часовий зсув +5.5 годин від UTC, тому застосування її часового поясу не дозволить правильно обчислити відносний зсув часового поясу. Відбудеться ось що: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} Щоб уникнути цієї проблеми, просто вкажіть зміщення часу у хвилинах чи секундах, наприклад: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} (Тім Старлінг, розробник цієї функції, запропонував синтаксис для вирішення цієї проблеми.) <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == Ця функція є ідентичною до <code><nowiki>{{#time: ... }}</nowiki></code>, окрім того що вона використовує місцевий час для поточної вікі (який налаштований в {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}), якщо час не вказано. Синтаксис функції наступний: :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=Зверніть, будь ласка, увагу на те, що, якщо змінну {{phpi|$wgLocaltimezone}} встановлено в <code>UTC</code>, то немає різниці у виведенні, коли <code>local</code> встановлено у {{phpi|true}} чи {{phpi|false}}.}} [[File:Time-Timel.png|thumb|Приклад застосування функцій парсера #time і #timel на сервері, де встановлено відмінний від UTC часовий пояс]] Наприклад, див. наступні приклади: :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|Приклад попередження з https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid]] {{Warning|1= Пам'ятайте, що код U як в #time, так в #timel, поверне однакову кількість секунд що пройшли з моменту 00:00:00 1 січня 1970 року за UTC навіть у вікі з часовим поясом що відрізняється від UTC (раніше відомий як GMT) :<code>U</code> Час Unix. Кількість секунд що пройшли з моменту 00:00:00 1 січня 1970 року за GMT. :<code>Z</code> Зміщення часового поясу в секундах. :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == Ця функція поділяє назву сторінки на сегменти, що розділені символами косої риски. Після цього деякі із цих сегментів повертаються в якості результату. : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=назва сторінки |2=кількість сегментів для повернення |3=перший сегмент, який повертається }} Якщо ''кількість сегментів, що треба повернути'' не вказано, то вона отримує значення за замовчуванням «0», яке повертає всі сегменти від ''сегмент з якого почати'' до кінця. Якщо не вказано ''сегмент з якого почати'' або для нього вказане значення «0», то аргумент отримує значення за замовчуванням «1»: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' Від'ємні значення допускаються в обох аргументах. Якщо від'ємне значення вказане для ''кількість сегментів, що треба повернути'', то функція відрізує вказану кількість сегментів від кінця. При від'ємному значенні для ''сегмент з якого почати'', сегменти рахуються з кінця: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' Відрізує один сегмент від кінця текстового рядка. Див. також {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' Відрізує всі 4 сегменти від кінця рядка : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' Відрізує 5 сегментів від кінця рядка (що більше ніж існує) : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' Повертає останній сегмент. Див. також {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' Відрізує один сегмент від кінця рядка, після чого повертає другий сегмент і все після нього, що залишилось : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' Бере другий сегмент і все після нього, після чого відрізує один сегмент від кінця Перед обробкою параметр ''pagename'' є HTML-розкодованим: якщо він містить деякі стандартні сутності символів HTML, то вони перетворяться у прості символи (внутрішньо закодовані в UTF-8, тобто те саме кодування, що й на початковій сторінці MediaWiki, за допомогою цієї функції парсера). : Наприклад, будь-яке входження <code>&amp;quot;</code>, <code>&amp;#34;</code> чи <code>&amp;#x22;</code> у ''pagename'' буд замінене на <code>"</code>. : Жодних інших перетворень із HTML у простий текст не здійснюється, тому теги HTML залишаються неушкодженими на цьому початковому етапі навіть, якщо вони недійсні у заголовках сторінок. {{tip| 1= Деякі магічні слова чи функції парсера MediaWiki (як-от <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> і подібні), як відомо, повертають рядки, які без потреби закодовані HTML навіть, якщо їхній власний вхідний параметр не був закодований HTML. Функція парсера titleparts потім може бути використана як обхідний шлях для перетворення цих повернених рядків так, що вони можуть бути коректно оброблені деякими іншими функціями парсера, що також приймають назву сторінки в параметрі (як-от <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>), але які досі не працюють як слід із закодованими HTML вхідними рядками. This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. Наприклад, якщо поточна сторінка [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], то: * <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight> і <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> повернуть <code>1</code>; (функція парсера #ifeq здійснює розкодування HTML своїх вхідних параметрів). * <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight> і <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> повернуть <code>1</code>; (функція парсера #switch здійснює розкодування HTML своїх вхідних параметрів). * <syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight> або навіть <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> повернуть <code>1</code>, якщо така сторінка категорії існує (функція парсера #ifexist виконує розкодування HTML своїх вхідних параметрів); * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> поверне ненульове число, якщо така категорія містить сторінки чи підкатегорії, '''але''': * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight> все ще може '''безумовно''' повертати 0, просто як: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> Причиною цієї неочікуваної поведінки є те, що з поточними версіями MediaWiki є два застереження: * <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight> чи навіть <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''можуть'' повертати дійсний HTML-закодований рядок <code>Category:Côte-d&apos;Or</code>, а не очікуваний <code>Category:Côte-d'Or</code>, і тому: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''безумовно''' повертає 0 (магічне слово PAGESINCAT не здійснює жодного розкодування HTML своїх вхідних параметрів). Простим обхідним шляхом за допомогою titleparts (який продовжуватиме працювати, якщо два застереження будуть виправлені в пізніших версіях MediaWiki) є: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, які повертають дійсну кількість сторінок у тій самій категорії. }} Потім розкодована ''назва сторінки'' канонізується у стандартну, підтримувану MediaWiki, якомога більше: # Всі підкреслення автоматично замінюються пробілами: #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span class="mw-translate-fuzzy">Не bah_boo, попри підкреслення в оригіналі.</span> # Рядок ділиться до 25 разів; подальші риски ігноруються, і 25-й елемент міститиме решту рядка. Рядок також обмежений 255 символами, адже він розцінюється як [[Special:MyLanguage/Manual:Page table#Schema summary|заголовок сторінки]]: #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: Якщо з деяких причин вам потрібно проштовхнути цю функцію до даної межі, хоча й дуже малоймовірно, то можливо обійти обмеження 25 розділенням шляхом вкладання викликів функції: #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # Нарешті, перший підрядок починається з великої літери згідно з налаштуваннями великих літер локальної вікіпедії (якщо такий підрядок також починається з локальної назви простору назв, то назва простору назв також нормалізована). #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= Ви можете використовувати #titleparts як малий «рядковий парсер і перетворювач», але зважте на те, що він повертає перший підрядок із великої літери: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' Якщо потрібний нижній регістр, використовуйте функцію lc: для керування виведенням: : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' Ви можете додати «підставну» риску на початку рядка для отримання коректної капіталізації першого підрядка (верхній або нижній регістр). Використовуйте <code>2</code> замість <code>1</code> для «повернути перший сегмент». : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span class="mw-translate-fuzzy">Певні символи, заборонені в назвах сторінок, змусять #titleparts не парсити рядок.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Не виробляє очікуване: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. Не працює, тому що квадратні дужки заборонені в назвах сторінок і ця функція парсера не обробляє посилання, вбудовані в її вхідний параметр «pagename», навіть, коли вони використовують синтаксис MediaWiki чи будь-які інші теги HTML або MediaWiki. : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". Не працює, тому що «#» також заборонений у назвах сторінок. }} {{Warning|1= <div class="mw-translate-fuzzy"> Якщо будь-якою частиною назви є просто «<code>.</code>» або «<code>..</code>», то #titleparts не парситиме рядок: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. Повернено весь рядок. Це не виробляє очікуваного: '''one''' }} {{Warning|1= Ця функція не деградує витончено, якщо введення перевищує 255 байтів у UTF-8. Якщо вхідний рядок складається з 256 байтів або більше, то повертається весь рядок. }} <span id="String_functions"></span> == Рядкові функції == {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Загальні поради == <span id="Substitution"></span> === Підстановка === Функції парсера можуть бути [[Special:MyLanguage/Help:Substitution|підставлені]]. Для цього вкажіть префікс <code>'''subst:'''</code> перед знаком решітки у виклику функції: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → код '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' буде вставлений до вікітексту оскільки сторінка {{FULLPAGENAME}} існує. {{Warning|1= Результати підставлених функцій парсера невизначені, якщо вирази містять ''не''підставлений volatile код на кшталт {{ll|Help:Magic words#Variables|змінних}} чи інших функцій парсера. Для узгоджених результатів увесь volatile код у обчислюваному виразі повинен бути підставлений. Див. [[w:uk:Довідка:Підстановка|Довідка:Підстановка]].}} Підстановка не працює в {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; ви можете використати <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> з цією метою. <span id="Redirects"></span> === Перенаправлення === Підстановка поточного часу за допомогою [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]], хоч і може використовуватись в посиланнях, але не працює в {{ll|Help:Redirects|перенаправленнях}}. <span id="Escaping_pipe_characters"></span> <div class="mw-translate-fuzzy"> === Вставка символів вертикальної риски до таблиць === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> Функції парсера спотворять синтаксис {{ll|Help:Tables|вікітаблиці}} та вертикальні риски (<code><nowiki>|</nowiki></code>), розцінюючи всі сирі символи вертикальних рисок як роздільники параметрів. Для уникнення цього більшість вікіпедій використовували шаблон [[{{ns:10}}:!]], вмістом якого був тільки сирий символ вертикальної риски (<code><nowiki>|</nowiki></code>), починаючи з MW 1.24 {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> магічне слово}} замінило цей kludge. Це «ховає» вертикальну риску від парсера MediaWiki, забезпечуючи те, що він не розглянеться до того, як усі шаблони та змінні на сторінці не будуть розширені. Потім він інтерпретується як рядом таблиці чи роздільник колонки. Альтернативно, синтаксис сирої таблиці HTML може бути використано, хоча це менш інтуїтивно та ухильніше до помилок. <div class="mw-translate-fuzzy"> Ви також можете екранувати символ «pipe» для відображення як простий, неінтерпретований символ за допомогою сутності HTML: <code>&amp;#124;</code>. </div> {| class="wikitable" ! Опис ! Ви пишете ! Ви отримуєте |- | Екранування символу «pipe» як роздільника рядка чи колонки таблиці | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | Екранування символу «pipe» як простого символу | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <span id="Stripping_whitespace"></span> === Прибирання пробільних символів === Пробільні символи, включаючи символи нового рядка, символи табуляції та пробіли, прибираються із початку та з кінця всіх параметрів всіх функцій парсера. Якщо при порівнянні текстових рядків, пробільні символи в початку чи в кінці текстового рядка, що є аргументом функції, все ж таки потрібні, цей текстовий рядок можна помістити у подвійні лапки. :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span class="mw-translate-fuzzy">Щоб уникнути прибирання пробільних символів в аргументах функції #if можна скористатися шаблоном [[m:Template:If]] або використати $2 замість пробілів.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' Однак, цей метод може бути використаний для рендерингу тільки '''єдиного''' пробільного символу, оскільки парсер стискає багато пробільних символів у рядку в один. :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div class="mw-translate-fuzzy"> У цьому прикладі стиль <code>white-space: pre</code> використовується, щоб примусово зберігати пробіли браузером, але навіть із ним пробіли не показуються. Це стається тому, що пробіли are stripped програмним забезпеченням, до надсилання у браузер. </div> <div class="mw-translate-fuzzy"> Можливо обійти цю поведінку, замінивши whitespaces на <code>&amp;#32;</code> (''розривний пробіл'') або <code>&amp;nbsp;</code> (''нерозривний пробіл''), адже вони не модифікуються програмним забезпеченням: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Див. також == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] що замінив {{ll|Extension:StringFunctions}} * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Примітки == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] hyy81reimf55xrq046tudpk9hs9ryp2 Help:Extension:ParserFunctions/sl 12 580084 8365032 8353948 2026-05-04T06:21:23Z FuzzyBot 451990 Updating to match new version of source page 8365032 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span lang="en" dir="ltr" class="mw-content-ltr">The {{ll|Extension:ParserFunctions|nsp=0}} extension provides additional [[Special:MyLanguage/Parser functions|parser functions]] to supplement those already present in MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">(It ''may'' be configured to provide additional parser functions for string handling; these are only available to non-Wikimedia Foundation wikis hence these string functions are documented {{ll|Extension:ParserFunctions/String functions|elsewhere}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">All the parser functions provided by this extension take the form:</span> :<code><nowiki>{{</nowiki><span lang="en" dir="ltr" class="mw-content-ltr">'''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ...</span> <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Operators</span> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Grouping (parentheses)</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Numbers</span> | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | <span lang="en" dir="ltr" class="mw-content-ltr">binary operator</span> <code>'''e'''</code> &nbsp; <span lang="en" dir="ltr" class="mw-content-ltr">unary</span> <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Unary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Binary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Round</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Logic</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} <span lang="en" dir="ltr" class="mw-content-ltr">This function evaluates a mathematical expression and returns the calculated value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This function is also available in {{ll|Extension:Scribunto|nsp=0}} via the <code>mw.ext.ParserFunctions.expr</code> function.</span> :<code><nowiki>{{#expr:</nowiki> ''<span lang="en" dir="ltr" class="mw-content-ltr">expression</span>'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The available operators are listed to the right, in order of precedence. See {{ll|Manual:Expr parser function syntax}} for more details of the function of each operator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> When evaluating using [[w:boolean algebra|boolean algebra]], zero evaluates to {{phpi|false}}, and any nonzero value, positive or negative, evaluates to {{phpi|true}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code>[[##iferror|#iferror]]</code> function: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Rounding === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Test case</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Result</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Method of rounding</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is < 5, so no apparent rounding occurs</span> (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is ≥ 5, so it is rounded up</span> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to the nearest integer</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the ''nearest'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding up or down with ''ceil'' and ''floor''</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next ''larger'' integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next ''smaller'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next larger integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next smaller integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Not rounded, since 1 already is an integer</span><br />{{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect</span>}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Strings === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: test string | value if test string is not empty | value if test string is empty (or only white space)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: first parameter | second parameter | third parameter }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Example: </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Year</span> |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">4-digit year.</span> | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Month</span> |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour</span> |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Minutes and seconds</span> |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <span id="Substitution"></span> === Substitucija === <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> ==Glej tudi== * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] klah01ap8sjoxqsrirquak2ynlz24b5 Template:Update/hu 10 586233 8364323 8364243 2026-05-03T12:47:04Z FuzzyBot 451990 Updating to match new version of source page 8364323 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |<span lang="en" dir="ltr" class="mw-content-ltr">The '''factual accuracy''' of parts of this page (those related to {{{part|{{{1|}}}}}}) '''may be compromised due to out-of-date information'''.</span> |<span lang="en" dir="ltr" class="mw-content-ltr">Parts of this page (those related to {{{part|{{{1|}}}}}}) are '''outdated'''.</span>}} |{{#if:{{{inaccurate|}}} |<span lang="en" dir="ltr" class="mw-content-ltr">The '''factual accuracy''' of this page '''may be compromised due to out-of-date information'''.</span> |Ez a lap '''elavult'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|A leírás a MediaWiki egy korábbi verziójához készült, és nem biztos, hogy az újabb verzióra is vonatkozik.}} <span lang="en" dir="ltr" class="mw-content-ltr">If you have checked or updated this page and found the content to be suitable, please remove this notice.</span> {{#ifexist: {{TALKPAGENAME}} |&#32;További információért lásd a [[{{TALKPAGENAME}}|vitalapot]]. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Utolsó frissítés: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= <div lang="en" dir="ltr" class="mw-content-ltr"> Aliases of this template: </div> * {{tlx|outdated}} <span id="Examples"></span> == Példák == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == Lásd még == * {{tl|historical}} == TemplateData == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> 12eyv8hq4mykf6c1hxqw8q0piskgmr5 Translations:Help:Extension:ParserFunctions/16/pt 1198 586731 8365058 7771767 2026-05-04T07:29:45Z RogueScholar 14671222 8365058 wikitext text/x-wiki Quando avaliar utilizando a [[w:pt:Álgebra booliana|álgebra booliana]], o número zero assume $1, e qualquer valor diferente de zero, positivo ou negativo, assume $2: 7nsetdj8wfmoyb8ybd1il9jd9juzhw5 Template:Update/pl 10 594284 8364330 8364252 2026-05-03T12:47:08Z FuzzyBot 451990 Updating to match new version of source page 8364330 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |<span lang="en" dir="ltr" class="mw-content-ltr">The '''factual accuracy''' of parts of this page (those related to {{{part|{{{1|}}}}}}) '''may be compromised due to out-of-date information'''.</span> |<span lang="en" dir="ltr" class="mw-content-ltr">Parts of this page (those related to {{{part|{{{1|}}}}}}) are '''outdated'''.</span>}} |{{#if:{{{inaccurate|}}} |<span lang="en" dir="ltr" class="mw-content-ltr">The '''factual accuracy''' of this page '''may be compromised due to out-of-date information'''.</span> |Ta strona jest '''przestarzała'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|Została napisana dla starszej wersji MediaWiki i może nie dotyczyć najnowszej wersji.}} Jeśli sprawdziłeś lub zaktualizowałeś tę stronę i znalazł pasującą treść, usuń ten komunikat. {{#ifexist: {{TALKPAGENAME}} |&#32;Zobacz [[{{TALKPAGENAME}}|stronę dyskusji]], aby zapoznać się z tym tematem. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Ostatnia aktualizacja: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= <div lang="en" dir="ltr" class="mw-content-ltr"> Aliases of this template: </div> * {{tlx|outdated}} <div lang="en" dir="ltr" class="mw-content-ltr"> == Examples == </div> <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == Zobacz też == * {{tl|historical}} <div lang="en" dir="ltr" class="mw-content-ltr"> == TemplateData == </div> {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> ou9jy1aj5d8a5dm9uedh7rfeyqfxzjl Help:Extension:ParserFunctions/nl 12 605289 8365025 8353941 2026-05-04T06:21:01Z FuzzyBot 451990 Updating to match new version of source page 8365025 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} De extensie {{ll|Extension:ParserFunctions|nsp=0}} zorgt voor [[Special:MyLanguage/Parser functions|extra parserfuncties]] naast die er al waren op MediaWiki. (Zie {{ll|Help:Magic words#Parser functions}}.) (Het ''kan'' geconfigureerd worden om extra parserfuncties voor tekstbewerking te krijgen; deze functies zijn {{ll|Extension:ParserFunctions/String functions|hier beschreven}}.) Al deze functies hebben de syntaxis: :<code><nowiki>{{</nowiki>'''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=een meer diepgaande handleiding over de finesses van de werking van de expressiebeoordelaar, inclusief enkele extra operatoren die hier niet worden behandeld|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Type ! {{hl1}} | Operatoren |- | {{hl2}} | Groeperen (haakjes) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Nummers | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | binaire operator <code>'''e'''</code> &nbsp; unaire <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unaire | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binaire | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Afronden | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Logica | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Deze functie verwerkt een mathematische expressie en geeft een berekende waarde terug. Deze functie is ook beschikbaar in {{ll|Extension:Scribunto|nsp=0}} met de functie <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressie'' <nowiki>}}</nowiki></code> Basis voorbeeld :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' De beschikbare operatoren worden rechts genoemd, op volgorde van bewerking. Lees {{ll|Manual:Expr parser function syntax}} voor de functie van elke operator. De nauwkeurigheid en het formaat van het resultaat zal per besturingssysteem (waar de wiki op draait) verschillen, dat is ook afhankelijk van het nummerformaat van de taal van de website. Bij [[w:boolean algebra|booleanse algebra]] wordt zero omgezet naar {{phpi|false}}, elke andere waarde wordt {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Een lege expressie geeft een lege tekst terug. Ongeldige expressies geven een of meerdere foutboodschappen die verwerkt kunnen worden met de functie <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' De volgorde van operanden is van belang. Een min of plus voor een getal kan als een negatief getal of een positief getal worden gezien, het is dan geen fout in de invoer: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' NB: bij het gebruik van de uitvoer van magische woorden, moet er een formaataanpassing gedaan worden om komma's te verwijderen en de nummers te vertalen. <nowiki>{{NUMBEROFUSERS}}</nowiki> geeft {{NUMBEROFUSERS}}, waar we {{formatnum:{{NUMBEROFUSERS}}|R}} willen hebben, wat kan worden verkregen met <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Dit is vooral van belang bij talen waar getallen worden vertaald. In het Bengaals, wordt <nowiki>{{NUMBEROFUSERS}}</nowiki> dan ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=De operator <code>mod</code> geeft bij sommige waarden van het tweede argument een verkeerd resultaat: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (maakt een lege string; het zou 123 moeten zijn)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Bij het rekenen met datums (bijvoorbeeld of de huidige datum en tijd na een ander tijdstip is), converteer met <nowiki>{{#time: xNU }}</nowiki> de tijd eerst naar het aantal seconden na 1 januari 1970 (UTC), dan kunt u eenvoudig datums als getallen optellen of aftrekken.}} <span id="Rounding"></span> == Afronden == [https://php.net/function.round Rounds], het getal wordt links afgerond op een veelvoud van 1/10 verhoogd tot een macht, waarbij de exponent gelijk is aan de afgekapte waarde van het getal rechts. Om naar boven of naar beneden af te ronden, gebruikt u respectievelijk unaire <code>ceil</code> of <code>floor</code>. {| class="wikitable" ! {{hl1}} | Testgeval ! {{hl1}} | Resultaat ! {{hl1}} | Afrondingsmethode |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || Het laatste cijfer is kleiner dan 5, er treedt dus geen duidelijke afronding op. (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || Het laatste cijfer is 5 of hoger, er wordt naar boven afgerond (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Ook hier wordt het resultaat op het laatste cijfer naar boven afgerond, wat resulteert in extra afronding (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Afgerond op 100 omdat negatieve waarden links van de komma worden afgerond |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Afgerond op de dichtstbijzijnde 100e omdat positieve waarden rechts van het decimaalteken worden afgerond |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Decimalen in de afrondingsindex maken geen verschil in het afgeronde resultaat |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Decimaal gedeelte afgekapt |- ! colspan=3 {{hl2}} | Afronden op het dichtstbijzijnde gehele getal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Lager tot aan het ''dichtstbijzijnde'' gehele getal, dat nul is |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Naar boven tot het dichtstbijzijnde gehele getal, dat 1 is |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Naar boven tot het dichtstbijzijnde gehele getal, dat 1 is |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Naar boven tot het dichtstbijzijnde gehele getal, dat 0 is |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Naar beneden tot het dichtstbijzijnde gehele getal, dat -1 is |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Naar beneden tot het dichtstbijzijnde gehele getal, dat -1 is |- ! colspan=3 {{hl2}} | Afronden naar boven of beneden met ''ceil'' en ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Tot het volgende ''hogere'' gehele getal (1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Lager tot aan het ''dichtstbijzijnde'' gehele getal (0) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Naar boven tot aan het ''dichtstbijzijnde'' gehele getal (0) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Naar beneden tot het dichtstbijzijnde gehele getal (-1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Niet afgerond, 1 is al een geheel getal<br />{{Warning|1=Geïnterpreteerd als '''(ceil''' 1''')'''/3, niet als '''ceil('''1/3''')''', zoals u zou verwachten}} |- ! colspan=3 {{hl2}} | Grote getallen afronden |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Afronding op een zeer groot getal leidt tot een oneindig getal. Daarom wordt alleen de oorspronkelijke waarde als antwoord gegeven. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Net als hierboven. |} <span id="Strings"></span> === Teksten === Expressies werken alleen met getalachtige waarden, ze kunnen geen tekenreeksen of tekens vergelijken. [[#ifeq]] kan in plaats daarvan worden gebruikt. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Deze functie evalueert een testreeks en bepaalt of deze leeg is of niet. Een testreeks die alleen witruimte bevat, wordt als leeg beschouwd. :<syntaxhighlight lang="wikitext" inline>{{#if: testreeks | waarde als tekstreeks niet leeg is | waarde als tekstreeks leeg is (of alleen witruimte bevat)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: eerste parameter | tweede parameter | derde parameter }}</syntaxhighlight> Deze functie test eerst of de eerste parameter niet leeg is. Als de eerste parameter niet leeg is, geeft de functie het tweede argument weer. Als de eerste parameter leeg is of alleen witruimtetekens bevat (spaties, nieuwe regels, enz.), wordt het derde argument weergegeven. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' De testreeks wordt altijd geïnterpreteerd als pure tekst, dus wiskundige uitdrukkingen worden niet geëvalueerd (zie daarvoor [[##ifexpr|#ifexpr]]): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' De laatste parameter (false) mag worden weggelatenː :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' De functie kan genest zijn. Om dit te doen, nest de binnenste <code>#if</code>-functie in zijn volledige vorm in plaats van een parameter van de omsluitende <code>#if</code>-functie. Er zijn maximaal zeven niveaus van nesting mogelijk, hoewel dat afhankelijk kan zijn van de wiki of een geheugenlimiet. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:testreeks | waarde als tekstreeks niet leeg is |{{#if:testreeks |waarde als de teststring niet leeg is |waarde als tekstreeks leeg is (of alleen witruimte bevat) }} }} </syntaxhighlight> U kunt ook een parameter gebruiken als de testreeks in uw <code>#if</code>-statement. U moet ervoor zorgen dat u de <code>|</code> (pipe) achter de naam van de variabele toevoegt. (Zodat als de parameter geen waarde heeft, deze wordt geëvalueerd naar een lege tekenreeks in plaats van de tekenreeks "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=U hebt tekst ingevoerd in variabele 1 |2=Er is geen tekst in variabele 1 }} Bekijk {{ll|Help:Parser functions in templates}} voor meer voorbeelden van het gebruik van deze parserfunctie. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Deze parserfunctie vergelijkt twee invoerreeksen, bepaalt of ze identiek zijn en retourneert een van de twee tekenreeksen op basis van het resultaat. Als er meer vergelijkingen en uitvoerreeksen nodig zijn, kunt u overwegen <code>#switch</code> te gebruiken. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Als beide tekenreeksen geldige numerieke waarden zijn, worden de tekenreeksen numeriek vergeleken: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Anders wordt de vergelijking als tekst gemaakt; Deze vergelijking is hoofdlettergevoelig: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(vergelijk met vergelijkbaar voorbeeld hierboven, zonder de aanhalingstekens)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(vergelijk met vergelijkbaar voorbeeld hierboven, waarbij <code>[[##expr|#expr]]</code> eerst een geldig nummer retourneert)'' Neem als praktisch voorbeeld een bestaande {{ll|Help:Templates|template}} <code>Template:Timer</code> met behulp van de parser om te kiezen tussen twee standaardtijden, kort en lang. Het neemt de parameter als eerste invoer om te vergelijken met de tekenreeks "short" - er is geen conventie voor de volgorde, maar het is eenvoudiger te lezen als de parameter als eerste gaat. De sjablooncode wordt gedefinieerd als: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> Het volgende volgt: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Bij gebruik binnen een parserfunctie moeten alle parsertags en andere parserfuncties tijdelijk worden vervangen door {{ll|Strip marker|een unieke code}}. Dit is van invloed op vergelijkingen: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Als de te vergelijken tekenreeksen als gelijke aanroepen worden gegeven aan dezelfde {{ll|Help:Templates|sjabloon}} die dergelijke tags bevat, dan is de voorwaarde waar, maar in het geval van twee sjablonen met identieke inhoud die dergelijke tags bevat, is het onwaar. }} {{Warning|1=Letterlijke vergelijkingen met {{ll|Help:Magic words#Page names|paginanaam, magische woorden}} kunnen mislukken, afhankelijk van de siteconfiguratie. Zo kan <nowiki>{{FULLPAGENAME}}</nowiki>, afhankelijk van wiki, de eerste letter met een hoofdletter schrijven en alle onderstrepingstekens vervangen door spaties. Om dit te omzeilen, past u het magische woord toe op beide parameters: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Deze functie neemt een invoerreeks en retourneert een van de twee resultaten; de functie evalueert <code>true</code> of de invoerreeks een HTML-object met <code>class="error"</code> bevat, zoals gegenereerd door andere parserfuncties zoals <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> en $rel 2abs, [[Special:MyLanguage/Help:Templates|sjabloon]] fouten zoals loops en recursies, en andere "failsoft" parserfouten. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Een of beide retourreeksen kunnen worden weggelaten. Als de tekenreeks <code>correct</code> wordt weggelaten, wordt de <code>test string</code> geretourneerd als deze niet onjuist is. Als de tekenreeks <code>error</code> ook wordt weggelaten, wordt een lege tekenreeks geretourneerd bij een fout : :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Sommige fouten kunnen leiden tot het toevoegen van een trackingcategorie, dit toevoegen kan niet met behulp van <code><nowiki>{{#iferror:}}</nowiki></code> worden onderdrukt. == #ifexpr == Deze functie evalueert een wiskundige expressie en retourneert een van de twee tekenreeksen, afhankelijk van de booleaanse waarde van het resultaat: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> De invoer <code>expression</code> wordt precies zo geëvalueerd als voor <code>[[##expr|#expr]]</code> hierboven, waarbij dezelfde operatoren beschikbaar zijn. De uitvoer wordt vervolgens geëvalueerd als een booleaanse expressie. Een lege invoerexpressie evalueert naar {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Zoals hierboven vermeld, evalueert nul naar {{phpi|false}} en elke niet-nulwaarde evalueert naar {{phpi|true}}, dus deze functie is gelijk aan één die alleen <code>[[##ifeq|#ifeq]]</code> en <code>[[##expr|#expr]]</code> gebruikt: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> behalve voor een lege of verkeerde invoerexpressie (een foutmelding wordt behandeld als een lege tekenreeks; deze is niet gelijk aan nul, dus we krijgen <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' vergelijken :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Een of beide retourwaarden kunnen worden weggelaten; Er wordt geen uitvoer gegeven wanneer de juiste tak leeg is: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' De Booleaanse operatoren voor gelijk en ongelijk worden ondersteund. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=De resultaten van numerieke vergelijkingen met <code>[[##ifexpr|#ifexpr]]</code> komen niet altijd overeen met die van <code>[[##ifeq|#ifeq]]</code> en <code>[[##switch|#switch]]</code>. Deze laatste twee zijn nauwkeuriger dan <code>[[##ifexpr|#ifexpr]]</code> en leveren dus mogelijk geen gelijkwaardige resultaten op. Beoordeel deze vergelijkingen met het laatste cijfer gewijzigd: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Omdat PHP die in <code>[[##ifeq|#ifeq]]</code> wordt gebruikt en <code>[[##switch|#switch]]</code> twee getallen van het type geheel getal vergelijkt, wordt het verwachte resultaat correct geretourneerd. Overwegende dat met <code>[[##ifexpr|#ifexpr]]</code> en dezelfde aantallen: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Bij het andere cijfer is het resultaat van gelijk eigenlijk onjuist. Dit gedrag in <code>[[##ifexpr|#ifexpr]]</code> wordt veroorzaakt doordat MediaWiki letterlijke getallen in expressies omzet in type float, wat voor grote gehele getallen als deze afronding met zich meebrengt.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=Zie [[Manual:Checking for page existence|Handleiding Controleren op het bestaan van pagina's]] voor andere methoden om te controleren of een pagina bestaat met andere beperkingen}} Deze functie neemt een invoerreeks, interpreteert deze als een paginatitel en retourneert een van de twee waarden, afhankelijk van het feit of de pagina al dan niet op de lokale wiki bestaat. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> De functie evalueert naar {{phpi|true}} als de pagina bestaat, of deze inhoud bevat, zichtbaar leeg is (metagegevens bevat zoals categoriekoppelingen of {{ll|Help:Magic words|magische woorden}}, maar geen zichtbare inhoud), leeg is of een {{ll|Help:Redirects|doorverwijzing}} is. Alleen pagina's met een rode link worden beoordeeld op {{phpi|false}}, ook als de pagina bestond maar is verwijderd. :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' De functie evalueert naar {{phpi|true}} voor {{ll|Help:System message|systeemberichten}} die zijn aangepast en voor {{ll|Help:Special pages|speciale pagina's}} die door de software zijn gedefinieerd. :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (omdat de extensie {{ll|Extension:Checkuser|nsp=0}} op deze wiki is geïnstalleerd) | '''doesn't exist''' (omdat de extensie {{ll|Extension:Checkuser|nsp=0}} niet op deze wiki is geïnstalleerd) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (omdat [[{{ns:8}}:Copyright]] is aangepast) | '''doesn't exist''' (omdat [[{{ns:8}}:Copyright]] niet is aangepast) }} Voor Mediawiki 1.45, als een pagina een doel controleert met <code>#ifexist:</code>, wordt die pagina weergegeven in de [[{{#special:WhatLinksHere}}]]-lijst voor de doelpagina. Dus als de code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> op deze pagina is opgenomen ({{FULLPAGENAME}}), zal [[{{#special:WhatLinksHere}}/Foo]] {{FULLPAGENAME}} vermelden. Op wiki's die een gedeelde repository voor de media gebruiken, kan <code>#ifexist:</code> worden gebruikt om te controleren of een bestand is geüpload naar de repository, maar niet naar de wiki zelf: :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' Als er een lokale beschrijvingspagina voor het bestand is gemaakt, is het resultaat '''bestaat''' voor al het bovenstaande. <code>#ifexist:</code> werkt niet met interwikilinks. <span id="ifexist_limits"></span> === ifexist limieten === <code>#ifexist:</code> wordt beschouwd als een "dure parserfunctie"; Slechts een beperkt aantal daarvan kan op één pagina worden opgenomen (inclusief functies in transclude sjablonen). Als deze limiet wordt overschreden, retourneren alle daaropvolgende <code>#ifexist:</code>-functies automatisch false, ongeacht of de doelpagina bestaat of niet, en wordt de pagina gecategoriseerd in [[:Category:{{MediaWiki:expensive-parserfunction-category}}]]. De naam van de {{ll|Help:Tracking categories|volgende categorie}} kan variëren afhankelijk van de taal van uw wiki. Voor sommige testgevallen is het mogelijk om het ifexist effect te emuleren met css, door gebruik te maken van de selectors <code>a.new</code> (om links naar niet-bestaande pagina's te selecteren) of <code>a:not(.new)</code> (om links naar bestaande pagina's te selecteren). Bovendien, aangezien het aantal dure parserfuncties dat op een enkele pagina kan worden gebruikt, wordt beheerd door <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, kan men ook de limiet in LocalSettings.php verhogen. <span id="ifexist_and_wanted_pages"></span> === ifexist en gewenste pagina's === Voor Mediawiki 1.45, een pagina die niet bestaat en is getest op het gebruik van #ifexist, komt terecht op de [[Special:MyLanguage/Manual:WantedPages|Gewenste pagina's]]. Zie {{phab|T14019}} voor de reden, en een [[w:Template:Linkless exists|tijdelijke oplossing]]. == #rel2abs == Deze functie converteert een relatief bestandspad naar een absoluut bestandspad. :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> Binnen de <code>path</code>-invoer is de volgende syntaxis geldig: *<code>.</code> → het huidige niveau *<code>..</code> → ga een niveau hoger *<code>/foo</code> → ga een niveau lager naar de submap /foo Als de <code>base path</code> niet is opgegeven, wordt in plaats daarvan de volledige paginanaam van de pagina gebruikt: :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' Ongeldige syntaxis, zoals <code>/.</code> of <code>/./</code>, wordt genegeerd. Aangezien er niet meer dan twee opeenvolgende volledige stops zijn toegestaan, kunnen reeksen zoals deze worden gebruikt om opeenvolgende instructies te scheiden: :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' Voor een vergelijkbare groep functies zie ook [[Special:MyLanguage/Help:Magic words#URL data| Bij de Magische woorden de URL-gegevens]]. Interne parserfuncties bevatten: 'localurl:', 'fullurl:', 'anchorencode:' enz. == #switch == ''Zie ook: [[w:Help:Switch parser function]]'' Deze functie vergelijkt één invoerwaarde met verschillende testgevallen en retourneert een gekoppelde tekenreeks als er een overeenkomst wordt gevonden. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Voorbeelden: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <nowiki>#</nowiki>switch met gedeeltelijke transclusie-tags kan van invloed zijn op een configuratiebestand waarmee een editor die niet bekend is met sjablooncodering configureerbare elementen kan bekijken en bewerken. <span id="Default"></span> === Standaardwaarde === Het <code>''standaardresultaat''</code> wordt geretourneerd als er geen <code>''case''</code> tekenreeks overeenkomt met de <code>''vergelijkingsreeks''</code>: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' In deze syntaxis moet het standaardresultaat de laatste parameter zijn en mag het geen onbewerkt gelijkteken bevatten (een gelijkteken zonder <code><nowiki>{{}}</nowiki></code>). Als dit wel het geval is, wordt het behandeld als een vergelijking en wordt er geen tekst weergegeven als er geen gevallen overeenkomen. Dat komt omdat de standaardwaarde niet is gedefinieerd (leeg is). Als er een case echter overeenkomt, wordt de bijbehorende tekenreeks geretourneerd. :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> Als alternatief kan het standaardresultaat expliciet worden aangegeven met een <code>''case''</code> string van "<code>#default</code>". {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Standaardresultaten die op deze manier zijn gedeclareerd, kunnen overal in de functie worden geplaatst: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' Als de parameter <code>''default''</code> wordt weggelaten en er geen overeenkomst wordt gemaakt, wordt er geen <code>''result''</code> geretourneerd: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Resultaten groeperen === Het is mogelijk om 'doorval'-waarden te hebben, waarbij meerdere <code>''case''</code> tekenreeksen dezelfde <code>''result''</code> tekenreeks retourneren. Dit minimaliseert dubbel werk. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Hier wordt bij 2, 3 en 4 allemaal <code>''result234''</code> terug; Bij 6 en 7 is het resultaat <code>''result67''</code>. De "<code>#default = </code>" in de laatste parameter kan in het bovenstaande geval worden weggelaten. <span id="Use_with_parameters"></span> === Met gebruik van parameters === De functie kan worden gebruikt met parameters als testreeks. In dit geval is het niet nodig om de 'pipe' achter de parameternaam te plaatsen, omdat het zeer onwaarschijnlijk is dat u ervoor kiest om iets in te stellen voor de tekenreeks "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>". (Dit is de waarde die de parameter standaard heeft als de 'pipe' afwezig is en de parameter niet bestaat of een waarde heeft. Zie {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> In het bovenstaande geval, als <code><nowiki>{{{1}}}</nowiki></code> gelijk is aan <code>foo</code>, retourneert de functie <code>Foo</code>. Als het gelijk is aan <code>baz</code>, retourneert de functie <code>Baz</code>. Als de parameter leeg is of niet bestaat, retourneert de functie <code>Bar</code>. Net als in het bovenstaande gedeelte kunnen gevallen worden gecombineerd om één resultaat te geven. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> Hier, als <code><nowiki>{{{1}}}</nowiki></code> gelijk is aan <code>foo</code>, <code>zoo</code> of <code>roo</code>, retourneert de functie <code>Foo</code>. Als het gelijk is aan <code>baz</code>, retourneert de functie <code>Baz</code>. Als de parameter leeg is of niet bestaat, retourneert de functie <code>Bar</code>. Bovendien kan het standaardresultaat worden weggelaten als u niets wilt retourneren als de waarde van de testparameter niet overeenkomt met een van de gevallen. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> In dit geval retourneert de functie een lege tekenreeks, tenzij <code><nowiki>{{{1}}}</nowiki></code> bestaat en gelijk is aan <code>foo</code> of <code>bar</code>, in welk geval het respectievelijk <code>Foo</code> of <code>Bar</code> retourneert. Dit heeft hetzelfde effect als het standaardresultaat als leeg verklaren. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> Als u om de een of andere reden besluit een case in te stellen als "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", retourneert de functie het resultaat van die case wanneer de parameter niet bestaat of geen waarde heeft. De parameter moet bestaan en een andere waarde hebben dan de tekenreeks "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" om het standaardresultaat van de functie te retourneren. :(wanneer <code><nowiki>{{{1}}}</nowiki></code> niet bestaat of leeg is): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(wanneer <code><nowiki>{{{1}}}</nowiki></code> de waarde "<code>test</code>" heeft): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(wanneer <code><nowiki>{{{1}}}</nowiki></code> de waarde "<code><nowiki>{{{1}}}</nowiki></code>" heeft): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' In dit hypothetische geval zou u de 'pipe' aan de parameter moeten toevoegen (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). <span id="Comparison_behavior"></span> === Vergelijking gedrag === Net als bij <code>[[##ifeq|#ifeq]]</code> wordt de vergelijking numeriek gemaakt als zowel de vergelijkingsreeks als de string die wordt getest numeriek zijn; of als een hoofdlettergevoelige tekenreeks: :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' Een <code>''case''</code> string kan leeg zijn: :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' Zodra een match is gevonden, worden volgende <code>''cases''</code> genegeerd: :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= Numerieke vergelijkingen met <code>[[##switch|#switch]]</code> en <code>[[##ifeq|#ifeq]]</code> zijn niet gelijk aan vergelijkingen in uitdrukkingen (zie ook hierboven): :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <span id="Raw_equal_signs"></span> === Ruwe gelijktekens === "Case"-tekenreeksen mogen geen onbewerkte gelijktekenstekens bevatten. Om dit te omzeilen, gebruikt u het magische woord [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] of vervangt u het gelijkteken door HTML-code <code><nowiki>&amp;#61;</nowiki></code>. Voorbeeld: {| class="wikitable" ! U typt ! U krijgt |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=Voor een eenvoudig voorbeeld uit de praktijk van het gebruik van deze functie, raadpleegt u [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Twee complexe voorbeelden zijn te vinden op {{ll|Template:Extension}} en [[w:Template:BOTREQ]]. }} <span id="Replacing_#ifeq"></span> === #ifeq vervangen === <code>#switch</code> kan worden gebruikt om de [[Special:MyLanguage/Help:Expansion depth|expansiediepte]] te beperken. Bijvoorbeeld: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> is gelijk aan * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> d.w.z. diep nestelen, lineair: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> Aan de andere kant kan de vervanging van de schakelaar ingewikkeld / onpraktisch zijn voor IF's die in beide takken zijn genest (weergegeven met alternatieven voor inspringing, aan beide zijden ingesprongen), waardoor een volledige symmetrische boom ontstaat: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Code ! {{hl1}} | Beschrijving ! {{hl1}} | Huidige uitvoer <br /><small class="noprint"> ([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} De cache van deze pagina leegmaken] om bij te werken)</small> |- ! {{hl2}} colspan="3"| Jaar |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Jaar met vier cijfers. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Jaar met twee cijfers. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1 als het een schrikkeljaar is, anders 0. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|Hiervoor is minimaal PHP 5.1.0 vereist en [[rev:45208]].|group=note}} | ISO-8601 jaar van de gespecificeerde week.{{#tag:ref|Dit heeft dezelfde waarde als Y, behalve dat als het ISO-weeknummer (W) bij het vorige of volgende jaar hoort, dat jaar in plaats daarvan wordt gebruikt.|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|Zal letterlijk ''o'' uitvoeren als noot 1 niet wordt vervuld.|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Maand |- | style="text-align: center;" | <code>n</code> | Maandnummer, zonder nul vooraan. | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | Maandnummer, met nul vooraan. | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | Afkorting van de maand, in de taal van de website. | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | De volledige maand, in de taal van de website. | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | Geeft de volledige maandnaam in het formulier [[w:Genitive case|genitive]] voor sitetalen die onderscheid maken tussen genitief en [[w:Nominatief|nominatief]] formulieren. Deze optie is handig voor veel [[w:Slavic languages|Slavische talen]] zoals Pools, Russisch, Wit-Russisch, Tsjechisch, Slowaaks, Sloveens, Oekraïens, enz. | style="line-height: 1.6;" | In het Pools:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominatief)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitief) |- ! {{hl2}} colspan="3"| Dag van de maand of het jaar |- | style="text-align: center;" | <code>j</code> | Dag van de maand (met nul vooraan) | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | Dag van de maand (met nul vooraan) | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | Dag van het jaar (1 januari = 0). {{note}} Om de ISO-dag van het jaar te krijgen, voegt u 1 toe. | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Week en dag van de week |- | style="text-align: center;" | <code>W</code> | ISO 8601 weeknummer, met nul vooraan. | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | ISO 8601 dag van de week (maandag = 1, zondag = 7). | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | Nummer van de dag van de week (zondag = 0, zaterdag = 6). | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | Een afkorting voor de dag van de week. Niet vaak geïnternationaliseerd. | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | De volledige doordeweekse naam. Niet vaak geïnternationaliseerd. | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Uur |- | style="text-align: center;" | <code>a</code> | "vm" 00:00:00 → 11:59:59, "nm" 12:00:00 → 23:59:59. | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Versie van <code>a</code> hierboven in hoofdletters. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Uur in 12-uurs formaat, zonder nul vooraan | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Uur in 12-uurs formaat, met nul vooraan | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Uur in 24-uurs formaat, zonder nul vooraan | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Uur in 24-uurs formaat, met nul vooraan | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minuten en seconden |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | Minuten na het uur, met voorloopnul | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | Seconden na de minuut, met voorloopnul | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Unix tijd]]. Seconden na 1 januari 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Tijdzone (vanaf [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Tijdzone-id | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | Of de datum wel of niet in de zomertijd valt. | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Verschil met de Greenwich tijd (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Verschil met de Greenwich tijd (GMT), met dubbele punt | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Tijdzone afkorting | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | Tijdzone offset in seconden. | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Diversen |- | style="text-align: center;" | <code>t</code> | Aantal dagen in de huidige maand. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | ISO 8601 geformatteerde datum, gelijkwaardig aan <code>Y-m-d"T"H:i:s+00:00</code>. | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | [[rfc:5322|RFC 5322]] geformatteerde datum, gelijk aan <code>D, j M Y H:i:s +0000</code>, met weekdagnaam en maandnaam niet geïnternationaliseerd. | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Niet-Gregoriaanse kalenders |- ! {{hl3}} colspan="3" | Islamitisch |- | style="text-align: center;" | <code>xmj</code> | Dag van de maand. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Volledige maandnaam. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Maandnummer. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Volledig jaar. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iraans (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Aantal dagen in de maand. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dag van het jaar. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dag van de maand. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Volledige maandnaam. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Maandnummer. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Volledig jaar. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Jaar in twee cijfers. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreeuws |- | style="text-align: center;" | <code>xjj</code> | Dag van de maand. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Volledige maandnaam. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Aantal dagen in de maand. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Genitieve vorm van de maandnaam. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Maand nummer. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Volledig jaar. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Thais zonne |- | style="text-align: center;" | <code>xkY</code> | Volledig jaar in [[ːnl:Thaise zonkalender|Thaise zonnekalender]]<br />{{note}} Voor jaren voor 1941 worden de data in de maanden Jan-Mar niet correct [[w:Thai_solar_calendar#New_year|berekend]]. | {{#time:xkY}} |- ! {{hl3}} colspan="3" | Minguo/Juche jaar |- | style="text-align: center;" | <code>xoY</code> | Volledig jaar. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | Japanse nengo |- | style="text-align: center;" | <code>xtY</code> | Volledig jaar. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | Vlaggen |- | style="text-align: center;" | <code>xn</code> | De volgende numerieke code opmaken als een onbewerkt ASCII-nummer | In de Hindi-taal produceert <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> ०६, 06. |- | style="text-align: center;" | <code>xN</code> | colspan="2" | Als <code>xn</code>, maar dan als een vaste vlag, die blijft bestaan tot het einde van de string of tot het volgende voorkomen van <code>xN</code> in de string. |- | style="text-align: center;" | <code>xr</code> | Maak het volgende getal op als een Romeins cijfer. Werkt alleen voor getallen tot 10.000 <br /><small>(tot 3.000 in pre MediaWiki 1.20)</small>. | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | Maak het volgende getal op als een Hebreeuws cijfer. | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} Deze parserfunctie neemt een datum en/of tijd (in de Gregoriaanse kalender) en maakt deze op volgens de gegeven syntaxis. Er kan een datum/tijd-object worden opgegeven; de standaardwaarde is de waarde van het <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> [[Special:MyLanguage/Help:Magic words#Date and time|magische woord]], dat wil zeggen het tijdstip waarop de pagina voor het laatst in HTML is weergegeven. :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> De lijst met geaccepteerde opmaakcodes wordt gegeven in de tabel aan de rechterkant. Elk teken in de opmaaktekenreeks dat niet wordt herkend, wordt ongewijzigd doorgegeven. Dit geldt ook voor lege ruimtes (het systeem heeft ze niet nodig voor het interpreteren van de codes). Als er geen teken wordt herkend in de opmaaktekenreeks en het datum-/tijdobject geen fouten bevat, wordt de opmaaktekenreeks geretourneerd als uitvoer. Er zijn ook twee manieren om te ontsnappen aan tekens in de opmaakreeks: # Een backslash gevolgd door een opmaakteken wordt geïnterpreteerd als één letterlijk teken # Tekens tussen dubbele aanhalingstekens worden beschouwd als letterlijke tekens en de aanhalingstekens worden verwijderd. Bovendien worden de twee tekens <code>xx</code> geïnterpreteerd als een enkele letterlijke "x". Naarmate de lijst met opmaakcodes blijft evolueren (met de ondersteuning van nieuwe kalenders of van nieuwe datumvelden die anders zijn berekend en opgemaakt), moet u zorgen dat alle letterlijke tekens (niet alleen ASCII-letters die momenteel worden gebruikt door opmaakcodes) ongewijzigd worden doorgegeven als het dus niet als opmaak bedoeld is. Helaas wordt het enkele citaat van ASCII voorlopig nog steeds niet herkend als een eenvoudig alternatief voor het markeren van letterlijke tekst voor de momenteel ondersteunde dubbele ASCII-aanhalingstekens (dubbele aanhalingstekens zijn bijvoorbeeld verplicht voor andere toepassingen, zoals de afbakening van tekenreekswaarden in JSON, C, C ++...) en backslashes (die ook moeten worden ontsnapt in tekenreeksconstanten die door veel talen worden gebruikt, waaronder JSON, C, C++, PHP, JavaScript, Lua). U kunt dus nog steeds geen letterlijk dubbel citaat insluiten zonder het te markeren met een backslash (of u kunt in plaats daarvan andere krullende, hoekige of vierkante aanhalingstekens gebruiken). :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' Het <code>''date/time object''</code> kan in elk formaat zijn dat door PHP's [https://php.net/function.strtotime strtotime()] functie wordt geaccepteerd. Absolute (bijv. <code>20 December 2000</code>), relatieve (bijv. <code>+20 hours</code>) en gecombineerde tijden (bijv. <code>30 July +1 year</code>) worden geaccepteerd. :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' De <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) maakt het mogelijk om de string in de gekozen taal weer te geven :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' De parameter <code>''local''</code> geeft aan of het ''date/time object'' verwijst naar de lokale tijdzone of naar UTC. Dit is een booleaanse parameter: de waarde ervan wordt bepaald door de waarde van het argument te casten (zie de [https://php.net/language.types.boolean#language.types.boolean.casting officiële PHP-documentatie] voor details over hoe tekenreeksen worden gegoten naar booleaanse waarden). {{note|2=reminder|1=Houd er rekening mee dat als de variabele {{phpi|$wgLocaltimezone}} is ingesteld op <code>UTC</code>, er geen verschil is in de uitvoer wanneer <code>local</code> is ingesteld op <code>true</code> of <code>false</code>.}} Zie de volgende voorbeelden voor meer informatie: :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' Als u een Unix-tijdstempel hebt berekend, kunt u deze gebruiken in datumberekeningen door er een symbool <code>@</code> voor te zetten. :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= Zonder <code>@</code> vóór numerieke tijdstempelwaarden is het resultaat meestal een fout of een onverwachte waarde: :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (goed) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (niet-ondersteunde jaarnotatie) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (goed) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' (geïnterpreteerd als een jaar met de huidige maand en dag van de maand) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (goed) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' (geïnterpreteerd als een jaar met de huidige maand en dag van de maand) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (goed) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (niet-ondersteunde jaarnotatie) }} {{Warning|1= Het bereik van de invoer is 1 januari 0111 → 31 december 9999. Voor de jaren 100 tot en met 110 is de uitvoer inconsistent, Y en schrikkeljaren zijn als de jaren 100-110, r, D, l en men interpreteert deze jaren als 2000-2010. :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> (correct, geen schrikkeljaar), maar :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' (fout, ook al wordt 100 geïnterpreteerd als 2000, want dat is een schrikkeljaar) :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' Jaarnummers 0-99 worden geïnterpreteerd als 2000-2069 en 1970-1999, behalve wanneer geschreven in 4-cijferige notatie met voorloopnullen: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) De weekdag wordt geleverd voor de jaren 100-110 en vanaf 1753, voor de jaren 111-1752 toont de r-uitgang "Onbekend" en de l-uitgang "". Als gevolg hiervan wordt de r-output niet geaccepteerd als invoer voor deze jaren. }} Er kunnen volledige of gedeeltelijke absolute data worden opgegeven; De functie zal delen van de datum "invullen" die niet zijn opgegeven met behulp van de ''huidige'' waarden: :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= De invulfunctie is niet consistent; Sommige delen worden ingevuld met de huidige waarden, andere niet: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' Geeft het begin van de dag, maar de huidige dag van de maand en het huidige jaar. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' Geeft het begin van de dag, maar de huidige dag van het jaar. Er is een uitzondering van de gevulde dag: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' Geeft het begin van de dag en het begin van de maand. }} Een viercijferig getal wordt altijd geïnterpreteerd als een jaar, nooit als uren en minuten: Vóór {{rev|86805}} in 2011 was dit niet het geval. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' Een getal van zes cijfers wordt geïnterpreteerd als uren, minuten en seconden indien mogelijk, maar verder als een fout (bijvoorbeeld niet als een jaar en maand): :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' Invoer wordt behandeld als een tijd in plaats van een code voor een jaar + maand. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' Hoewel 19:60:09 geen geldige tijd is, wordt 196009 niet geïnterpreteerd als september 1960. De functie voert een bepaalde hoeveelheid datumwiskunde uit: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' De totale lengte van de opmaakreeksen van de aanroepen van <code>#time</code> is beperkt tot 6000 tekens.<ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Tijdzone probleem ==== Er is een bug in deze #time parserfunctie (meer specifiek in ''PHP DateTime'') die het doorgeven van ''niet-gehele getallen'' als relatieve tijdzone-verschuivingen niet toestaat. Dit probleem is niet van toepassing bij het gebruik van een tijdzone op het uur, zoals EDT. Bijvoorbeeld: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} India bevindt zich echter op een tijdverschuiving van +5,5 uur ten opzichte van UTC en dus zal het gebruik van zijn tijdzone normaal gesproken niet de juiste berekening van een relatieve tijdzone-offset mogelijk maken. Dit is wat er gebeurt: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} U kunt dit probleem omzeilen door de tijd als volgt om te zetten in minuten of seconden: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} (Tim Starling, de ontwikkelaar van deze functie, leverde de exacte syntaxis voor deze oplossing.) <span id="#time_format_like_in_signatures"></span> ==== formaat #time als in handtekeningen ==== Soms is het handig om een tijdstempel te maken, die eruitziet als het automatische tijdstempel dat wordt gegenereerd door [[Special:MyLanguage/Help:Signatures|handtekeningen]] in discussies op overlegpagina's. Op een wiki in de Engelse taal kan het worden gemaakt met: * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == Deze functie is een snelkoppeling die identiek is aan <code><nowiki>{{#time: ... }}</nowiki></code>, waarbij de parameter <code>local</code> is ingesteld op {{phpi|true}}, dus het gebruikt altijd de lokale tijdzone van de gebruiker of die van de wiki (zoals ingesteld in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). Syntaxis van de functie: :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=Houd er rekening mee dat als de variabele {{phpi|$wgLocaltimezone}} is ingesteld op <code>UTC</code>, er geen verschil is in de uitvoer wanneer <code>local</code> is ingesteld op {{phpi|true}} of {{phpi|false}}.}} [[File:Time-Timel.png|thumb|Voorbeeld van het gebruik van de parserfuncties #time en #timel vanaf een server waarop de tijdzone geen UTC is]] Zie daarvan de volgende voorbeeldenː :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|Waarschuwing Voorbeeld van https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid]] {{Warning|1= Houd er rekening mee dat voor zowel time als time1 hetzelfde aantal seconden retourneert sinds 1970-01-01 00:00:00 UTC op Wikipedia's met andere tijdzones dan UTC (voorheen bekend als GMT) :<code>U</code> Unix tijd. Seconden na 1 januari 1970 00:00:00 GMT. :<code>Z</code> Tijdzone offset in seconden. :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == Deze functie formatteert een datum met behulp van een standaardformaat voor de geselecteerde taal, zoals gedefinieerd in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (zie {{Phab|T223772}}). : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=''date/time object'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=''date/time object'' |2=''formaattype'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=''date/time object'' |2=''formaattype'' |3=''taalcode'' }} Het formaat van het object ''date/time'' is hetzelfde als voor [[#time|#time]]. Als het leeg is, wordt de tijd gebruikt waarop de pagina is opgebouwd. Het ''formaattype'' kan een van de volgende zijn: ; <code>time</code> : Alleen de tijd wordt getoond. ; <code>date</code> : Alleen de datum wordt getoond. ; <code>both</code> : Zowel de tijd als de datum worden getoond. ; <code>pretty</code> : Alleen de datum wordt weergegeven, in een formaat zonder het jaar. Niet alle talen ondersteunen dit; indien het niet wordt ondersteund, wordt het formaat "date" gebruikt. Als het ''formaattype'' niet is opgegeven, worden zowel de tijd als de datum weergegeven, alsof <code>both</code> is opgegeven. Als de ''taalcode'' niet is opgegeven, wordt de taal van de pagina-inhoud gebruikt. Met <code>#timef</code> in plaats van <code>#time</code> kunnen sjablonen meer talen gemakkelijk ondersteunen, omdat verschillende talen verschillende manieren hebben om datums te formatteren. In het Engels wordt de volgorde van dag en maand bepaald met {{wg|AmericanDates}}. Voorbeelden: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == Deze functie is hetzelfde als [[#timef|#timef]] behalve dat het de lokale tijdszone van de wiki wordt gebruikt zoals geconfigureerd in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}. :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == Deze functie scheidt een paginatitel in segmenten op basis van schuine strepen en retourneert vervolgens enkele van die segmenten als uitvoer. : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=paginanaam |2=aantal te retourneren segmenten |3=eerste te retourneren segment }} Als de parameter ''aantal te retourneren segmenten'' niet is opgegeven, wordt standaard "0" ingesteld, waarmee alle segmenten van het ''eerste segment dat moet worden geretourneerd'' (inbegrepen) worden geretourneerd. Als de parameter ''eerste te retourneren segment'' niet is opgegeven of "0" is, wordt standaard "1" gebruikt: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Zie ook <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' Voor beide waarden worden negatieve waarden geaccepteerd. Negatieve waarden voor de parameter ''aantal te retourneren segmenten'' 'stript' effectief segmenten van het einde van de tekenreeks. Negatieve waarden voor het ''eerste te retourneren segment'' vertaalt zich naar 'begin rechts te tellen': : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' Hiermee stript u één segment van het uiteinde van de tekenreeks. Zie ook {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' Stript alle 4 segmenten van het einde van de string : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' Stript 5 segmenten van het einde van de string (meer dan er zijn) : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' Retourneert het laatste segment. Zie ook {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' Stript één segment van het einde van de tekenreeks, retourneert vervolgens het tweede segment en verder : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' Begin met kopiëren bij het voorlaatste element; strip één segment van het einde van de string Voor de verwerking is de parameter ''pagename'' HTML-gedecodeerd: als deze enkele standaard HTML-tekenentiteiten bevat, worden deze geconverteerd naar gewone tekens (intern gecodeerd met UTF-8, d.w.z. dezelfde codering als in de MediaWiki-bronpagina met behulp van deze parserfunctie). : Bijvoorbeeld, elke vermelding van <code>&amp;quot;</code>, <code>&amp;#34;</code> of <code>&amp;#x22;</code> in ''paginanaam'' wordt vervangen door <code>"</code>. : Er wordt geen andere conversie van HTML naar platte tekst uitgevoerd, dus HTML-tags worden intact gelaten bij deze eerste stap, zelfs als ze ongeldig zijn in paginatitels. {{tip| 1= Van sommige magische trefwoorden of parserfuncties van MediaWiki (zoals <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> en dergelijke) is bekend dat ze tekenreeksen retourneren die onnodig HTML-gecodeerd zijn, zelfs als hun eigen invoerparameter niet HTML-gecodeerd was: De parserfunctie titleparts kan vervolgens worden gebruikt als tijdelijke oplossing om deze geretourneerde tekenreeksen te converteren, zodat ze correct kunnen worden verwerkt door sommige andere parserfuncties die ook een paginanaam in parameter nemen (zoals <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code> maar die nog steeds niet goed werken met HTML-gecodeerde invoerreeksen. This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. Als de huidige pagina bijvoorbeeld de categorie [[commons:Category:Côte-d'Or|Ivoorkust]], is, dan: * <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight> en <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> worden beide geretourneerd als beide <code>1</code>; (de #ifeq parserfunctie voert de HTML-decodering van de invoerparameters uit). * <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight> en <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> worden beide als <code>1</code> geretourneerd; (de #ifeq parserfunctie voert de HTML-decodering van de invoerparameters uit). * <syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight> zelfs <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> zullen allemaal <code>1</code> retourneren als die categoriepagina bestaat (de #ifexist parserfunctie voert de HTML-decodering van de invoerparameters uit); * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> retourneert een niet-nulgetal, als die categorie pagina's of subcategorieën bevat, '''maar''': * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, kan nog steeds '''onvoorwaardelijk''' 0 retourneren, net als: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> De reden van dit onverwachte gedrag is dat er bij de huidige versies van MediaWiki er twee kanttekeningen zijn: * <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, of zelfs <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''kan'' de daadwerkelijk HTML-gecodeerde tekenreeks retourneren <code>Category:Côte-d&apos;Or</code> en niet de verwachte <code>Category:Côte-d'Or</code>, en dat: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> retourneert '''onvoorwaardelijk''' 0 (het magische trefwoord PAGESINCAT voert geen HTML-decodering van de invoerparameter uit). De eenvoudige oplossing met behulp van titleparts (die zal blijven werken als de twee kanttekeningen worden opgelost in een latere versie van MediaWiki) is: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, die allemaal het werkelijke aantal pagina's in dezelfde categorie retourneren. }} Vervolgens wordt de gedecodeerde ''pagename'' zoveel mogelijk gecanoniseerd tot een standaard paginatitel die door MediaWiki wordt ondersteund: # Alle underscores worden automatisch vervangen door spaties: #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' Niet bah_boo, ondanks de underscore in het origineel. # De string wordt maximaal 25 keer gesplitst; Verdere schuine strepen worden genegeerd en het 25e element bevat de rest van de tekenreeks. De tekenreeks is ook beperkt tot 255 tekens, omdat deze wordt behandeld als een [[Special:MyLanguage/Manual:Page table#Schema summary|paginatitel]]: #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: Als u om welke reden dan ook deze functie tot het uiterste moest pushen, hoewel zeer onwaarschijnlijk, is het mogelijk om de limiet van 25 splitsingen te omzeilen door functie-aanroepen te nesten: #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # Ten slotte wordt de eerste subtekenreeks met een hoofdletter geschreven volgens de hoofdletterinstellingen van de lokale wiki (als die subtekenreeks ook begint met de naam van een lokale namespace, wordt die naam ook genormaliseerd). #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= U kunt #titleparts gebruiken als een kleine "string parser en converter", maar houd er rekening mee dat het de eerste subtekenreeks met een hoofdletter retourneert: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' Als kleine letters nodig zijn, gebruik dan de functie lc: om de uitvoer te regelen: : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' U kunt een schuine streep aan het begin van de tekenreeks voorafgaan om de juiste eerste subtekenreekshoofdletter (hoofdletter of kleine letter) te krijgen. Gebruik <code>2</code> in plaats van <code>1</code> voor ''eerste segment om te retourneren'': : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= Bepaalde tekens die {{ll|Manual:Page title#Naming restrictions|illegaal zijn in een paginatitel}}, zorgen ervoor dat #titleparts de tekenreeks niet goed verwerkt: : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Levert niet het verwachte: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. Werkt niet omdat haakjes illegaal zijn in paginatitels en deze parserfunctie verwerkt geen koppelingen die zijn ingesloten in de invoerparameter ''paginanaam'', zelfs niet wanneer ze de MediaWiki-syntaxis of andere HTML- of MediaWiki-tags gebruiken. : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". Werkt niet omdat "#" ook illegaal is in paginatitels. }} {{Warning|1= Als een deel van de titel alleen "<code>.</code>>" of "<code>..</code>" is, zal #titleparts de tekenreeks niet parseren: : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. De hele string wordt geretourneerd. Het levert niet de verwachte: '''one''' }} {{Warning|1= Deze functie degradeert niet gracieus als de invoer groter is dan 255 bytes in UTF-8. Als de invoerreeks 256 bytes of meer is, wordt de hele tekenreeks geretourneerd. }} <span id="String_functions"></span> == Tekenreeksfuncties == {{Main|Extension:ParserFunctions/String functions}} De extensie ParserFunctions definieert optioneel verschillende tekenreeksfuncties als <code>$wgPFEnableStringFunctions</code> is ingesteld op {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Zie voor voorbeelden de speciale subpagina voor documentatie en {{ll|Manual:Performing string operations with parser functions}}. {{Warning |1=In 2013 werd besloten dat '''deze functies ''nooit'' zullen worden ingeschakeld op een Wikimedia-wiki''', omdat ze inefficiënt zijn wanneer ze op grote schaal worden gebruikt (zie [[phab:T8455]] voor wat geschiedenis). '''Deze functies werken NIET op Wikimedia wiki's!'''<br/><br/>Als u hier bent om iets te schrijven op een Wikimedia-project, dan zoekt u iets anders: als uw home wiki stringsfuncties heeft, gebruikt het waarschijnlijk {{ll|Extension:Scribunto|Lua}}. De Engelstalige Wikipedia gebruikt bijvoorbeeld [[w:Module:String|Module String]], die een aantal van dezelfde dingen doet met een totaal verschillende syntaxis. Er zijn ook individuele [[w:Template:String-handling templates|Sjablonen voor het verwerken van tekenreeksen]]. }} Hier is een kort overzicht van de functies van [[Module:String]]: * [[w:Module:String#len|&#35;len]] (lengte van de string): <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] (substring): <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] (positie van doel): <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] (herhaal): <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Algemene punten == <span id="Substitution"></span> === Vervanging === Parserfuncties kunnen [[Special:MyLanguage/Help:Substitution|vervangen]] worden door het hash-teken vooraf te voegen met <code>'''subst:'''</code>: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → de code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' wordt ingevoegd in de wikitekst aangezien de pagina {{FULLPAGENAME}} bestaat. {{Warning|1= De resultaten van gesubstitueerde parserfuncties zijn ongedefinieerd als de expressies ''niet-''substitueerde vluchtige code bevatten, zoals {{ll|Help:Magic words#Variables|variables|variabelen}} of andere parserfuncties. Voor consistente resultaten moet alle vluchtige code in de te evalueren expressie worden vervangen. Zie [[w:Help:Substitution| Vervanging]].}} Substitutie werkt niet binnen {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; U kunt hiervoor <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> gebruiken. <span id="Redirects"></span> === Doorverwijzingen === Vooral [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] zou handig kunnen zijn bij {{ll|Help:Redirects|doorverwijzingen}} naar pagina's inclusief datums, maar dit werkt niet. <span id="Escaping_pipe_characters"></span> === pipe-tekens escapen === <span id="In_tables"></span> ==== In tabellen ==== Parserfuncties vernielen de {{ll|Help:Tables|wikitable}} syntaxis en pipe-tekens (<code><nowiki>|</nowiki></code>), waarbij alle onbewerkte pipe-tekens als parameterscheiders worden behandeld. Om dit te voorkomen, gebruikten de meeste wiki's een sjabloon [[{{ns:10}}:!]] met als inhoud alleen een onbewerkte pipe-teken (<code><nowiki>|</nowiki></code>), aangezien MW 1.24 een {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magisch woord}} deze lelijke oplossing verving. Dit 'verbergt' de pipe voor de MediaWiki-parser, waardoor deze pas wordt overwogen nadat alle sjablonen en variabelen op een pagina zijn uitgebreid. Het wordt dan geïnterpreteerd als een tabelrij of kolomscheidingsteken. Als alternatief kan onbewerkte HTML-tabelsyntaxis worden gebruikt, hoewel dit minder intuïtief en foutgevoeliger is. U kunt het pipe-teken &vert; onderdrukken bij weergave als een gewoon, niet-geïnterpreteerd teken met behulp van een HTML-entiteit: <code>&amp;#124;</code> of <code>&amp;vert;</code>. {| class="wikitable" ! Beschrijving ! U typt ! U krijgt |- | Het pipe-teken als tabelrij/kolomscheidingsteken | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | Het pipe-teken als gewoon teken | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== In sjabloonaanroepen ==== Voorbeeld van de beveiliging van het pipe-teken: <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> We zien dat ''text after'' niet wordt weergegeven wanneer het | net voor ''sandbox name='' aanwezig is, omdat ''|sandbox name='' als fout wordt beschouwd als een parameter van sjabloon ''Documentation'' op hetzelfde niveau als ''|content='' is. <span id="Stripping_whitespace"></span> === Witruimte verwijderen === Van alle parameters van deze parserfuncties wordt de witruimte, inclusief nieuwe lijnen, tabs en spaties, vooraan en achteraan verwijderd. Als dit niet wenselijk is, kan vergelijking van strings worden gedaan nadat ze tussen aanhalingstekens zijn geplaatst. :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' Om het trimmen van 'then' en 'else' delen te voorkomen, zie [[m:Template:If]]. Sommige mensen doen dit door <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> te gebruiken in plaats van spaties. :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' Deze methode kan echter alleen worden gebruikt om een witruimteteken met één ruimte weer te geven, omdat de parser meerdere witruimtetekens op een rij in één samenperst. :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} In dit voorbeeld wordt de stijl <code>white-space: pre</code> gebruikt om te forceren dat de witruimte door de browser wordt bewaard, maar zelfs daarmee worden de spaties niet weergegeven. Dit gebeurt omdat de ruimtes door de software worden gestript voordat ze naar de browser worden verzonden. Het is mogelijk om dit gedrag te omzeilen door witruimtes te vervangen door <code>&amp;#32;</code> (''breakable space'') of <code>&amp;nbsp;</code> (''non-breakable space''), omdat ze niet door de software worden gewijzigd: :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' NBː Niet alle parameters worden gelijk aangemaakt. In ParserFunctions wordt altijd mogelijke witte ruimte aan het begin en het einde verwijderd. In {{ll|Help:Templates|sjablonen}}, wordt witte ruimte aan het begin en het einde verwijderd voor parameters met naam en benoemde parameters zonder naam, maar "niet" voor onbenoemde parameters: :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Overige parserfuncties == <span id="Case_conversion_functions"></span> === Conversie functies === * '''Kleine letters:''' {{xpdoc|lc: AbC|}} * '''Hoofdletters:''' {{xpdoc|uc: AbC|}} * '''Eerste teken kleine letter:''' {{xpdoc|lcfirst: AbC}} * '''Eerste teken hoofdletter:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Coderingsfuncties === * '''URL encoding:''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> uitvoer wordt ---- "{{urlencode: AbC dEf ghi}}" ---- Dus interne nieuwe regels worden omgezet in %0A, en interne spaties worden omgezet in +. === Anchor encoding === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> uitvoer wordt ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Zie ook == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – een (onvolledige) lijst van parserfuncties die zijn toegevoegd per core en extensie. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – met name voor getalopmaak en padding * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] maakt {{ll|Extension:StringFunctions}} verouderd * Parserfuncties voor Wikibase (de extensies die Wikidata mogelijk maken): [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|How to use data on Wikimedia projects/nl#Parserfunctie]] <span id="References"></span> == Referenties == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] fher9pvlh0w3ngl7as3h0pcjf6wl7kj Translations:Help:Contents/52/it 1198 605629 8364458 6802957 2026-05-03T15:45:44Z ~2026-26781-45 18367723 8364458 wikitext text/x-wiki Molte wiki basate su MediaWiki rimandano a questa pagina per la documentazione tecnica. d1uucyyvfjp0vk8x0rzvv2hgpdk11mm Translations:Help:Contents/51/it 1198 605630 8364461 6802961 2026-05-03T15:46:12Z ~2026-26781-45 18367723 8364461 wikitext text/x-wiki Se sei arrivato qui da un'altra wiki e stai cercando aiuto riguardo ai contenuti o alla comunità di quella wiki, questa pagina potrebbe non essere quella che ti serve. n8qqfefcfm98e8dbrf0pmvb0pty0xlw Help:Extension:ParserFunctions/hu 12 631605 8365017 8353933 2026-05-04T06:20:34Z FuzzyBot 451990 Updating to match new version of source page 8365017 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} A {{ll|Extension:ParserFunctions|nsp=0}} kiterjesztés új [[Special:MyLanguage/Parser functions|elemzőfüggvényeket]] kínál a MediaWikiben már megtalálhatóak kiegészítésére. (Lásd: {{ll|Help:Magic words#Parser functions}}.) (''Lehet'' úgy konfigurálva, hogy további, szövegkezelő függvényeket is kínáljon; ezek dokumentációja {{ll|Extension:ParserFunctions/String functions|máshol}} található.) Ennek a kiterjesztésnek az összes függvénye az alábbi formában hívható meg: :<code><nowiki>{{</nowiki>'''#függvénynév''': ''1. paraméter'' | ''2. paraméter'' | ''3. paraméter'' … <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Típus ! {{hl1}} | Operátorok |- | {{hl2}} | Csoportosítás (zárójelek) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Számok | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | bináris operátorok <code>'''e'''</code> &nbsp; unáris <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unáris | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Bináris | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Kerekítés | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Logikai | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Ez a függvény kiértékel egy matematikai kifejezést és visszaadja a kiszámolt értéket. Ez a függvény a [[Extension:Scribunto/hu|Scribuntóból]] is elérhető az <code>mw.ext.ParserFunctions.expr</code> függvénnyel. :<code><nowiki>{{#expr:</nowiki> ''kifejezés'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span class="mw-translate-fuzzy">Az elérhető operátorok jobbra láthatók a műveleti sorrendben. Lásd a [[{{ll|Manual:Expr parser function syntax}}|Help:Calculation]] lapot további információkért az egyes operátorokról. Az eredmény pontossága és formátuma eltérő lesz a wikit futtató szerver operációs rendszerétől és a wiki nyelvének számformátumától függően.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> [[:hu:Boole-algebra (informatika)|Boole-algebra]] szerinti kiértékeléskor a nulla értéke {{phpi|false}} (hamis), a nem nulla értékeké – akár pozitívak, akár negatívak – {{phpi|true}} (igaz). :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Egy üres bemenet üres kimenetet ad vissza. Az érvénytelen kifejezések a számos hibaüzenet egyikét adják vissza, ami az <code>[[##iferror|#iferror]]</code> függvénnyel kapható el: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Varázsszavak kimenetét használatakor nyers formázást kell használni a tagolók (pl. tizedesvessző) és számjegyek visszaalakításához. <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=A <code>mod</code> operátor hibás eredményt ad a második argumentum bizonyos értékeinél: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (üres a kimenete, 123-nak kellene lennie)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Ha dátumokkal számolsz (pl. annak vizsgálata, hogy a elmúlt-e egy adott időpont), először alakítsd át az időt az 1970. január 1., 0:00 UTC óta eltelt másodpercek számává a <nowiki>{{#time: xNU }}</nowiki> függvénnyel, utána egyszerűen összeadhatod vagy kivonhatod őket számokként.}} <span id="Rounding"></span> === Kerekítés === <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> A lefelé vagy felfelé kerekítésre a <code>ceil</code> és <code>floor</code> operátorok szolgálnak. {| class="wikitable" ! {{hl1}} | Teszteset ! {{hl1}} | Eredmény ! {{hl1}} | Kerekítési eljárás |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || Az utolsó számjegy kisebb 5-nél, úgyhogy nem történik látható kerekítés (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || Az utolsó számjegy legalább 5, felfelé kerekíti (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Az eredményt ismét felfelé kerekíti az utolsó számjegynél, ami további kerekítéshez vezet (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Kerekítés a legközelebbi százasra, a negatív értékek a tizedesvesszőtől balra kerekítenek |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Kerekítés a legközelebbi századra, a pozitív értékek a tizedesvesszőtől jobbra kerekítenek |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || A kerekítési pontosságban lévő tizedesjegyek nem változtatnak az eredményen |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || A tizedesjegyek levágva |- ! colspan=3 {{hl2}} | Kerekítés a legközelebbi egészre |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Lefelé a ''legközelebbi'' egészre, ami a nulla |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Felfelé a legközelebbi egészre, ami az egy |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Felfelé a legközelebbi egészre, ami az egy |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Felfelé a legközelebbi egészre, ami a nulla |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Lefelé a legközelebbi egészre, ami a mínusz egy |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Lefelé a legközelebbi egészre, ami a mínusz egy |- ! colspan=3 {{hl2}} | Kerekítés felfelé vagy lefelé a ''ceil'' és ''floor'' segítségével |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Felfelé a következő ''nagyobb'' egészre, ami az egy |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Lefelé a következő ''kisebb'' egészre, ami a nulla |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Felfelé a következő nagyobb egészre, ami a nulla |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Lefelé a következő kisebb egészre, ami a mínusz egy |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Nincs kerekítve, az 1 már egész<br />{{Warning|1='''(ceil''' 1''')'''/3-ként értelmeződik, nem '''ceil('''1/3''')'''-ként, amint várható lenne}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <span id="Strings"></span> === Szövegek === A kifejezések csak számszerű értékekkel működnek, nem hasonlíthatnak össze karakterláncokat vagy karaktereket. Ehelyett használható az [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: tesztsztring | érték, ha a tesztsztring nem üres | érték, ha a tesztsztring üres (vagy csak szóközökből áll)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: első paraméter | második paraméter | harmadik paraméter }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' Az utolsó paraméter (false) elhagyható: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:tesztsztring | érték, ha a tesztsztring nem üres |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=Nincs szöveg az 1-es változóban }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(hasonló a fenti példához, az idézőjelek nélkül)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (mivel a {{ll|Extension:Checkuser|nsp=0}} kiterjesztés telepítve van a wikin) | '''doesn't exist''' (mivel a {{ll|Extension:Checkuser|nsp=0}} kiterjesztés nincs telepítve a wikin) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> Az <code>#ifexist:</code> nem működik wikiközi hivatkozásokkal. <span id="ifexist_limits"></span> === Az ifexist korlátai === Az <code>#ifexist:</code> „költséges elemzőfüggvénynek” számít, amik csak korlátozott mennyiségben használható egy oldalon (beleértve a beillesztett sablonokban lévő függvényeket). E határ túllépésekor minden további <code>#ifexist:</code> függvény automatikusan hamis értéket ad, függetlenül attól, hogy létezik-e a céllap, és az oldal a [[:Category:{{MediaWiki:expensive-parserfunction-category}}]] kategóriába kerül. <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → jelenlegi szint *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' Az érvénytelen szintaxist, például ezeket: <code>/.</code> vagy <code>/./</code>, figyelmen kívül hagyják. <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Példák: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> Lásd: {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> A fenti esetben ha <code><nowiki>{{{1}}}</nowiki></code> megegyezik <code>foo</code> paraméterrel, a függvény kimeneti értéke <code>Foo</code>. Ha az megegyezik a <code>baz</code> paraméterrel, a függvény kimeneti értéke <code>Baz</code>. Ha a paraméter üres vagy nem létezik, a függvény kimeneti értéke <code>Bar</code>. <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> Ha a paraméter üres vagy nem létezik, a függvény kimeneti értéke <code>Bar</code>. <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :(ha <code><nowiki>{{{1}}}</nowiki></code> nem létezik vagy üres): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(ha <code><nowiki>{{{1}}}</nowiki></code> értéke „<code>test</code>”): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(ha <code><nowiki>{{{1}}}</nowiki></code> értéke „<code><nowiki>{{{1}}}</nowiki></code>”): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' Ez esetben hozzá kell adni egy függőleges vonalat a paraméterhez (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Példa: {| class="wikitable" ! Ezt írod ! Ezt kapod |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> Például: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> ezzel egyezik meg * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Kód ! {{hl1}} | Leírás ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Év |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | 4 számjegyű év. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | 2 számjegyű év. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1, ha szökőév, 0, ha nem. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|PHP 5.1.0 vagy újabb és [[rev:45208]] szükséges.|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Hónap |- | style="text-align: center;" | <code>n</code> | Nullával nem kiegészített hónapszám. | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | Nullával kiegészített hónapszám. | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | A hónap nevének rövidítése a honlap nyelvén. | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | A hónap teljes neve a honlap nyelvén. | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | Lengyel nyelv esetén:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(alanyeset)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(birtokos eset) |- ! {{hl2}} colspan="3"| A hónap vagy az év napja |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | Az év napja (január 1. = 0).<br />{{note}} Az év ISO szerinti napjához adj hozzá 1-et. | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Hét és hét napja |- | style="text-align: center;" | <code>W</code> | ISO 8601 szerinti hétszám, nullával kiegészítve. | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Óra |- | style="text-align: center;" | <code>a</code> | „am” dél előtt (00:00:00 → 11:59:59), egyébként „pm” (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Minutes and seconds</span> |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Unix-idő]] 1970. január 1., 00:00:00 (GMT) óta eltelt másodpercek. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Időzóna ([[MediaWiki 1.22/Roadmap|1.22wmf2]]-től) |- | style="text-align: center;" | <code>e</code> | Időzóna-azonosító. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | Hogy a dátum nyári időszámításban van-e. | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Eltérés a greenwichi időtől (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Eltérés a greenwichi időtől (GMT) kettősponttal | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Időzóna-rövidítés. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | Időzóna-eltérés másodpercben. | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Egyéb |- | style="text-align: center;" | <code>t</code> | A jelenlegi hónap napjainak száma. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Teljes év. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Teljes év. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | 2 számjegyű év. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Teljes év. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | Teljes év. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | Teljes év. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | Zászlók |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | A hindi nyelvben a <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> eredménye ०६, 06. |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | A következő szám római számkénti formázása. Csak 10 000-nél nem nagyobb számoknál működik<br /><small>(a MediaWiki 1.20 előtt 3000-nél nem nagyobb számoknál)</small> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | A következő szám héber számkénti formázása. | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> Abszolút (pl. <code>20 December 2000</code>), relatív (pl. <code>+20 hours</code>) és vegyes idők (pl. <code>30 July +1 year</code>) is elfogadhatók. :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' Ha kiszámítottál egy Unix-időbélyegzőt, a dátumszámításnál használhatod úgy, hogy elé írsz egy <code>@</code> karaktert. :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= A numerikus értékeket megelőző <code>@</code> nélkül az eredmény általában hiba, esetleg egy váratlan érték: :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (helyes) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (nem támogatott évformátum) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (helyes) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (helyes) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (helyes) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (nem támogatott évformátum) }} {{Warning|1= Az elfogadható bemenetek: 111. január 1-től 9999. december 31-ig. 100-tól 110-ig a kimenet nem konzisztens, az Y és a szökőévek 100-tól 110-ig kezelik, az r, D, l és U 2000–2010 köztiként kezelik. :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> (helyes, nem szökőév), de :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' (hibás, még akkor is, ha a 100-at 2000-ként kezelik, mert az szökőév) :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} Teljes vagy részleges abszolút dátumok is megadhatók – a függvény „kitölti” a dátum meg nem adott részeit a ''jelenlegi'' értékek felhasználásával: :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= A kitöltőfunkció nem konzisztens – egyes részeket a jelenlegi értékekkel tölt ki, másokat nem: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' A nap kezdetét adja ki, ugyanakkor a hónap jelenlegi napját és a jelenlegi évet írja ki. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' A nap és a hónap kezdetét adja ki. }} A négyjegyű számot mindig évszámként kezelik, sose óraként és percként:<ref>A 2011-ben megjelent {{rev|86805}} előtt nem így volt.</ref> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' Ha lehetséges, a hatjegyű számot óraként, percként és másodpercként kezelik, ellenkező esetben hibát adnak (például nem évként és hónapként): :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' A bemenetet időként kezelik, nem év+hónap kódként. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' Noha 19:60:09 nem érvényes idő, a 196009-es számot nem kezelik 1960. szeptemberként. <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span class="mw-translate-fuzzy">A $time-hívások karakterláncainak összhossza nem lehet több 6000 karakternél.<ref>[https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] a phabricator.wikimedia.org-on</ref></span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> A függvény szintaxisa: :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= Az U a time és timel elemzőfüggvényeknél egyaránt ugyanannyi 1970-01-01 00:00:00 UTC óta eltelt másodpercet adnak az UTC-től (korábban GMT) különböző időzónájú Wikipédiákon :<code>U</code> Unix-idő. Az 1970. január 1., 00:00:00 (GMT) óta eltelt másodpercek. :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * A <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''feltétlenül''' 0-val tér vissza (a PAGESINCAT varázsszó a bemeneti paraméterét nem dekódolja HTML-ből). <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> A karakterlánc legfeljebb 255 karakteres lehet, ugyanis [[Special:MyLanguage/Manual:Page table#Schema summary|oldalcímként]] kezelik. #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Nem a várt eredményt adja ki: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. Nem működik, mert a szögletes zárójelek nem szerepelhetnek oldalcímben, és ez az elemzőfüggvény nem dolgozza fel a ''pagename'' bemeneti paraméterében lévő linkeket, még akkor se, ha a MediaWiki-szintaxist vagy más HTML- vagy MediaWiki-címkét használnak. : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". Nem működik, mert a „#” nem szerepelhet oldalcímben. }} {{Warning|1= Ha a cím bármely eleme <code>.</code> vagy <code>..</code>, a #titleparts nem értelmezi a karakterláncot: : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} A helyettesítés a {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }} esetén nem működik, e célból használható a <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code>. <span id="Redirects"></span> === Átirányítások === <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Leírás ! Ezt írod ! Ezt kapod |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Lásd még == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Hivatkozások == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] bw09hdj148v8cqg19d1ache9c8sox1d Template:Update/nl 10 639247 8364328 8364249 2026-05-03T12:47:06Z FuzzyBot 451990 Updating to match new version of source page 8364328 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |De '''[[w:Wikipedia:Accuracy dispute|feitelijke accuraatheid]]''' van delen van deze pagina (gerelateerd aan {{{part|{{{1|}}}}}})''' zijn mogelijk aangetast vanwege verouderde informatie'''. |Delen van deze pagina (gerelateerd aan {{{part|{{{1|}}}}}}) zijn '''verouderd'''.}} |{{#if:{{{inaccurate|}}} |De '''feitelijke accuraatheid''' van delen van deze pagina '''is mogelijk aangetast vanwege verouderde informatie'''. |Deze pagina is '''verouderd'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|Het is geschreven voor een oudere versie van MediaWiki en is mogelijk niet van toepassing op de meest recente versie.}} Als u deze pagina hebt gecontroleerd of bijgewerkt en hebt bevonden dat de inhoud voldoet, verwijder dan deze melding. {{#ifexist: {{TALKPAGENAME}} |&#32;Zie de [[{{TALKPAGENAME}}|overlegpagina]] voor een mogelijke discussie over deze kwestie. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Laatst bijgewerkt: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= Aliassen (alternatieve namen) van dit sjabloon * {{tlx|outdated}} <span id="Examples"></span> ==Voorbeelden== <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == Zie ook == * {{tl|historical}} == TemplateData == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> 0hwzytmf69smuvmxglq3g5ma4gwgppm Help:Extension:Translate/Insertables/ja 12 652592 8364889 8203487 2026-05-04T04:06:49Z Shirayuki 472859 Created page with "== 設定 ==" 8364889 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳対象の文字列は、翻訳結果でもそのまま保持されるべきマークアップを含むことがよくあります。 マークアップは特殊な文字を多く含むため、タイプするのが低速・困難になる場合があります。 Insertable (インサータブル、挿入要素) は、マークアップの断片であり、翻訳者にはボタンやその他のインターフェイス要素として表示されます。 ボタンをクリックすることで、翻訳内の現在のカーソルの位置に、マークアップの断片が挿入されます。 各メッセージ群は1つの <code>InsertablesSuggester</code> を保持できます。 このクラスは <code>Insertable</code> の一覧の生成を担当します。 各 <code>Insertable</code> は以下の3つの部分で構成されます: # 利用者に表示するもの # 翻訳内のカーソルの位置の前に何を挿入するか # 翻訳内のカーソルの位置の後ろに何を挿入するか Translate 拡張機能には組み込みの <code>MediaWikiInsertablesSuggester</code> が同梱されています。 他の種類のコンテンツの Suggester は [[phab:diffusion/GTWN/browse/groups|translatewiki.net]] git リポジトリにあります。 <span id="User_interface"></span> == ユーザーインターフェイス == [[File:Translate extension Insertables interface.png|600px|thumb|{{dir|{{pagelang}}|right|left}}|Insertable は翻訳のテキストエリアの下部に表示されます。 これにより、どの言語でも不変のマークアップの断片を容易に挿入できるようになります。]] {{clear}} <span id="Configuration"></span> == 設定 == <div lang="en" dir="ltr" class="mw-content-ltr"> Here's a sample configuration change in a YAML file, </div> <syntaxhighlight lang="yaml" line="1" start="1"> INSERTABLES: # pre-bundled insertable - class: RegexInsertablesSuggester params: "/\$[a-zA-Z0-9]+/" # custom insertable - class: FreeColInsertablesSuggester AUTOLOAD: FreeColInsertablesSuggester: Suggester.php </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Pre-provided / Bundled insertables == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a list of bundled insertables. </div> === HtmlTagInsertablesSuggester === <div lang="en" dir="ltr" class="mw-content-ltr"> This insertable will display suggestion for any HTML tags found inside the source string. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Message:</span> ''This <a href="abc">link</a>link takes you to the home page.'' * <span lang="en" dir="ltr" class="mw-content-ltr">Suggester displayed:</span> <code><a href="abc"></a></code> === MediaWikiInsertablesSuggester === <span lang="en" dir="ltr" class="mw-content-ltr">This insertable will display various suggestion for MediaWiki related wikitext messages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These include suggestion for,</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Parameters like <code>$1user</code> which are present in API Help messages. </div> * <code>PLURALS</code>, <code>GENDER</code>, <code>GRAMMAR</code> <div lang="en" dir="ltr" class="mw-content-ltr"> * Suggestions for HTML tags. </div> === NumericalParameterInsertablesSuggester === <div lang="en" dir="ltr" class="mw-content-ltr"> This insertable will display suggestions for numerical parameters such as <code>$1</code>, <code>$2</code>, <code>$3</code> </div> === RegexInsertablesSuggester === <div lang="en" dir="ltr" class="mw-content-ltr"> This insertable is a general purpose insertable that can be used to display suggestions based on a custom regular expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Example: </div> <syntaxhighlight lang="yaml" line="1" start="1"> # simple example # matches and suggests: $abc - class: RegexInsertablesSuggester params: "/\$[a-zA-Z0-9]+/" # complex example using named captures. # matches: [abc](ac) # suggester displayed: [](ac) - class: RegexInsertablesSuggester params: regex: /(?<pre>\[)[^]]+(?<post>\]\([^)]+\))/ display: $pre $post pre: $pre post: $post </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> Parameter description, </div> * '''regex''' – <span lang="en" dir="ltr" class="mw-content-ltr">The regex to use for identifying insertables.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Mandatory.</span> * '''display''' – <span lang="en" dir="ltr" class="mw-content-ltr">What to show to the user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not mandatory, defaults to matched value.</span> * '''pre''' – <span lang="en" dir="ltr" class="mw-content-ltr">What to insert before selection, or replace selection if <code>post</code> remains empty</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not mandatory, defaults to matched value.</span> * '''post''' – <span lang="en" dir="ltr" class="mw-content-ltr">What to insert after selection.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not mandatory, defaults to matched value.</span> === TranslatablePageInsertablesSuggester === <div lang="en" dir="ltr" class="mw-content-ltr"> Used primarily on translatable pages to provide suggester for variables like <code>$abc</code>. </div> === UrlInsertablesSuggester === <div lang="en" dir="ltr" class="mw-content-ltr"> This insertable finds URLs (that are normally unchanged in translations) and suggests them for insertion. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Adding a custom insertable == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In case existing insertables are not sufficient to meet your requirements, it is possible to add custom insertables. </div> 既存のファイル ベースのメッセージ群である「FreeCol」に Insertable 対応を追加する例を示します。 YAML ファイルは[[Special:MyLanguage/Help:Extension:Translate/Group configuration example|簡潔にするため一部省略されています]]。 新たに追加された行が強調されています。 FreeCol.yaml: <syntaxhighlight lang=yaml highlight=21,22,26> --- BASIC: id: out-freecol label: FreeCol description: "A strategy game" namespace: NS_FREECOL class: FileBasedMessageGroup FILES: class: JavaFFS sourcePattern: %GROUPROOT%/freecol/data/strings/FreeColMessages_%CODE%.properties definitionFile: %GROUPROOT%/freecol/data/strings/FreeColMessages.properties targetPattern: freecol/data/strings/FreeColMessages_%CODE%.properties INSERTABLES: - class: FreeColInsertablesSuggester AUTOLOAD: FreeColInsertablesSuggester: Suggester.php </syntaxhighlight> Suggester.php: <syntaxhighlight lang=php> class FreecolInsertablesSuggester { public function getInsertables( $text ) { $insertables = array(); $matches = array(); // %name% の形式の変数を見つける。 // これは Checker.php での正規表現と同一。 preg_match_all( '/%[a-zA-Z_]+%/', $text, $matches, PREG_SET_ORDER ); $new = array_map( function( $match ) { // $match[0] は完全一致であり、部分一致は一切使用しない。 // 挿入した位置の末尾にカーソルを設定したいため、"pre" フィールドに文字列全体を設定する。 return new Insertable( $match[0], $match[0] ); }, $matches ); return $insertables; } } </syntaxhighlight> Insertable のパラメーターは以下の通りです: <syntaxhighlight lang=php> class Insertable { /** * @param string $display 利用者に表示するもの * @param string $pre What to insert before selection, or replace selection if $post remains empty * @param string $post 選択の後ろに挿入するもの */ public function __construct( $display, $pre = '', $post = '' ) { $this->display = $display; $this->pre = $pre; $this->post = $post; } [...] } </syntaxhighlight> [[Category:Extension:Translate{{#translation:}}]] aowrf6aga1httg97uew24eqrgaygvmw Extension:TimedMediaHandler/VideoJS Player 102 683792 8364338 8363677 2026-05-03T12:55:52Z TheDJ 77414 add frame step, and reorder slightly 8364338 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|<translate><!--T:1--> Screenshot of the VideoJS player in action</translate>]] <translate> <!--T:22--> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. <!--T:5--> It is based on [<tvar name=url>https://videojs.com/</tvar> VideoJS], and has a modern, fast user interface with compatibility with mobile devices and HTML5. == Usage == <!--T:23--> </translate> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|<translate><!--T:2--> Example video player</translate>]] [[File:Armstrong Small Step.ogg|thumb|<translate><!--T:24--> Example audio player</translate>]] <translate><!--T:25--> There is both an audio and video player.</translate> <translate><!--T:26--> You can find examples of both players on this page.</translate> <translate><!--T:27--> Once launched you will see a control bar when interacting with the video.</translate> [[File:VideoJS controlbar.png|frameless|350px]] <translate><!--T:28--> The controls in order from left to right are:</translate> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<translate><!--T:29--> Play/pause control</translate> * [[File:VideoJS volume control.png|30px|]]&nbsp;<translate><!--T:30--> Volume control</translate> * <translate><!--T:31--> Playback position</translate> * <translate><!--T:32--> Remaining playback time</translate> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<translate><!--T:33--> Subtitle language selector and subtitle style controls</translate> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<translate><!--T:34--> Resolution selector</translate> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<translate><!--T:35--> Optional Picture-in-Picture control</translate> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<translate><!--T:36--> Fullscreen control</translate> * [[File:VideoJS file description control.png|30px|]]&nbsp;<translate><!--T:37--> Info button to take you to the file description page</translate> <translate> === Mouse and keyboard controls === <!--T:38--> </translate> * <translate><!--T:39--> Click the play icon above the thumbnail to begin playback of the media file.</translate> * <translate><!--T:40--> Right click or middle click the thumbnail to open the file description page</translate> * <translate><!--T:41--> Play/Pause the player with a single mouse click inside the player window</translate> * <translate><!--T:42--> Double click the player window to enter or leave fullscreen mode</translate> * <translate><!--T:43--> The following keyboard controls are available:</translate> *; {{Key press|k}} / {{Key press|Space}} : <translate><!--T:44--> Play/pause the media playback</translate> *; {{Key press|f}} : <translate><!--T:45--> Enter/Leave fullscreen</translate> *; {{Key press|m}} : <translate><!--T:46--> Mute the audio</translate> *; {{Key press|c}} / {{Key press|s}} : <translate><!--T:77--> Toggle subtitles on / off</translate> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <translate><!--T:73--> Decrease and increase playback speed</translate> *; {{Key press|←}} / {{Key press|→}} : <translate><!--T:74--> Skip 5 seconds back / forward</translate> *; {{Key press|j}} / {{Key press|l}} : <translate><!--T:75--> Skip 10 seconds back / forward</translate> *; {{Key press|Home}} / {{Key press|End}} : <translate><!--T:76--> Skip to start / end of video</translate> *; {{Key press|,}} / {{Key press|.}} : <translate>When paused, skip 1 fram back or forward</translate> * <translate><!--T:47--> The player is fully keyboard accessible using tab, enter and spacebar keys</translate> <translate> == Known issues == <!--T:7--> <!--T:12--> The video player is still in development, but if you find any problems, please report these on the [[<tvar name=1>Extension_talk:TimedMediaHandler/VideoJS Player</tvar>|talk page]] or file them in [<tvar name=url>https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player</tvar> Phabricator]. == Developers == <!--T:57--> </translate> <translate><!--T:58--> Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</translate> <translate><!--T:59--> Below is an example of typical usage.</translate> <translate> === Basic Configuration Example === <!--T:60--> </translate> {{Note |1=<translate><!--T:61--> This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</translate> |2=gotcha }} <syntaxhighlight lang="js"> // <translate nowrap><!--T:62--> The first argument can be a string ID or a <video> element</translate> var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* <translate nowrap><!--T:63--> array of source files in various sizes and formats</translate> */ ] } ); </syntaxhighlight> <translate><!--T:64--> The <tvar name=1><code>sources</code></tvar> can also be provided in the HTML <tvar name=2>{{tag|video|open}}</tvar> element instead of in JS:</translate> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <translate> === Advanced configuration with Ogv.js support === <!--T:65--> </translate> <translate><!--T:66--> If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [<tvar name=1>https://github.com/hartman/videojs-ogvjs</tvar> Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</translate> <translate><!--T:67--> Example configuration:</translate> <syntaxhighlight lang="js"> var player; // <translate nowrap><!--T:68--> Load the appropriate modules in ResourceLoader</translate> mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // <translate nowrap><!--T:69--> Load ogvjs if necessary; when this promise resolves,</translate> // <translate nowrap><!--T:70--> all necessary code has been loaded</translate> return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* <translate nowrap><!--T:71--> array of sources</translate> */ ], // <translate nowrap><!--T:72--> Ogv.js-specific configuration</translate> ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> l85ptwqeqrd0jwrlsjqyef8ahp90td9 8364339 8364338 2026-05-03T12:56:20Z TheDJ 77414 8364339 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|<translate><!--T:1--> Screenshot of the VideoJS player in action</translate>]] <translate> <!--T:22--> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. <!--T:5--> It is based on [<tvar name=url>https://videojs.com/</tvar> VideoJS], and has a modern, fast user interface with compatibility with mobile devices and HTML5. == Usage == <!--T:23--> </translate> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|<translate><!--T:2--> Example video player</translate>]] [[File:Armstrong Small Step.ogg|thumb|<translate><!--T:24--> Example audio player</translate>]] <translate><!--T:25--> There is both an audio and video player.</translate> <translate><!--T:26--> You can find examples of both players on this page.</translate> <translate><!--T:27--> Once launched you will see a control bar when interacting with the video.</translate> [[File:VideoJS controlbar.png|frameless|350px]] <translate><!--T:28--> The controls in order from left to right are:</translate> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<translate><!--T:29--> Play/pause control</translate> * [[File:VideoJS volume control.png|30px|]]&nbsp;<translate><!--T:30--> Volume control</translate> * <translate><!--T:31--> Playback position</translate> * <translate><!--T:32--> Remaining playback time</translate> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<translate><!--T:33--> Subtitle language selector and subtitle style controls</translate> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<translate><!--T:34--> Resolution selector</translate> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<translate><!--T:35--> Optional Picture-in-Picture control</translate> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<translate><!--T:36--> Fullscreen control</translate> * [[File:VideoJS file description control.png|30px|]]&nbsp;<translate><!--T:37--> Info button to take you to the file description page</translate> <translate> === Mouse and keyboard controls === <!--T:38--> </translate> * <translate><!--T:39--> Click the play icon above the thumbnail to begin playback of the media file.</translate> * <translate><!--T:40--> Right click or middle click the thumbnail to open the file description page</translate> * <translate><!--T:41--> Play/Pause the player with a single mouse click inside the player window</translate> * <translate><!--T:42--> Double click the player window to enter or leave fullscreen mode</translate> * <translate><!--T:43--> The following keyboard controls are available:</translate> *; {{Key press|k}} / {{Key press|Space}} : <translate><!--T:44--> Play/pause the media playback</translate> *; {{Key press|f}} : <translate><!--T:45--> Enter/Leave fullscreen</translate> *; {{Key press|m}} : <translate><!--T:46--> Mute the audio</translate> *; {{Key press|c}} / {{Key press|s}} : <translate><!--T:77--> Toggle subtitles on / off</translate> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <translate><!--T:73--> Decrease and increase playback speed</translate> *; {{Key press|←}} / {{Key press|→}} : <translate><!--T:74--> Skip 5 seconds back / forward</translate> *; {{Key press|j}} / {{Key press|l}} : <translate><!--T:75--> Skip 10 seconds back / forward</translate> *; {{Key press|Home}} / {{Key press|End}} : <translate><!--T:76--> Skip to start / end of video</translate> *; {{Key press|,}} / {{Key press|.}} : <translate>When paused, skip 1 frame back or forward</translate> * <translate><!--T:47--> The player is fully keyboard accessible using tab, enter and spacebar keys</translate> <translate> == Known issues == <!--T:7--> <!--T:12--> The video player is still in development, but if you find any problems, please report these on the [[<tvar name=1>Extension_talk:TimedMediaHandler/VideoJS Player</tvar>|talk page]] or file them in [<tvar name=url>https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player</tvar> Phabricator]. == Developers == <!--T:57--> </translate> <translate><!--T:58--> Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</translate> <translate><!--T:59--> Below is an example of typical usage.</translate> <translate> === Basic Configuration Example === <!--T:60--> </translate> {{Note |1=<translate><!--T:61--> This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</translate> |2=gotcha }} <syntaxhighlight lang="js"> // <translate nowrap><!--T:62--> The first argument can be a string ID or a <video> element</translate> var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* <translate nowrap><!--T:63--> array of source files in various sizes and formats</translate> */ ] } ); </syntaxhighlight> <translate><!--T:64--> The <tvar name=1><code>sources</code></tvar> can also be provided in the HTML <tvar name=2>{{tag|video|open}}</tvar> element instead of in JS:</translate> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <translate> === Advanced configuration with Ogv.js support === <!--T:65--> </translate> <translate><!--T:66--> If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [<tvar name=1>https://github.com/hartman/videojs-ogvjs</tvar> Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</translate> <translate><!--T:67--> Example configuration:</translate> <syntaxhighlight lang="js"> var player; // <translate nowrap><!--T:68--> Load the appropriate modules in ResourceLoader</translate> mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // <translate nowrap><!--T:69--> Load ogvjs if necessary; when this promise resolves,</translate> // <translate nowrap><!--T:70--> all necessary code has been loaded</translate> return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* <translate nowrap><!--T:71--> array of sources</translate> */ ], // <translate nowrap><!--T:72--> Ogv.js-specific configuration</translate> ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> i9627hqjghkz9f29z1tyf4qoyn9bh91 8364348 8364339 2026-05-03T13:12:09Z Shirayuki 472859 Marked this version for translation 8364348 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|<translate><!--T:1--> Screenshot of the VideoJS player in action</translate>]] <translate> <!--T:22--> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. <!--T:5--> It is based on [<tvar name=url>https://videojs.com/</tvar> VideoJS], and has a modern, fast user interface with compatibility with mobile devices and HTML5. == Usage == <!--T:23--> </translate> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|<translate><!--T:2--> Example video player</translate>]] [[File:Armstrong Small Step.ogg|thumb|<translate><!--T:24--> Example audio player</translate>]] <translate><!--T:25--> There is both an audio and video player.</translate> <translate><!--T:26--> You can find examples of both players on this page.</translate> <translate><!--T:27--> Once launched you will see a control bar when interacting with the video.</translate> [[File:VideoJS controlbar.png|frameless|350px]] <translate><!--T:28--> The controls in order from left to right are:</translate> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<translate><!--T:29--> Play/pause control</translate> * [[File:VideoJS volume control.png|30px|]]&nbsp;<translate><!--T:30--> Volume control</translate> * <translate><!--T:31--> Playback position</translate> * <translate><!--T:32--> Remaining playback time</translate> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<translate><!--T:33--> Subtitle language selector and subtitle style controls</translate> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<translate><!--T:34--> Resolution selector</translate> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<translate><!--T:35--> Optional Picture-in-Picture control</translate> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<translate><!--T:36--> Fullscreen control</translate> * [[File:VideoJS file description control.png|30px|]]&nbsp;<translate><!--T:37--> Info button to take you to the file description page</translate> <translate> === Mouse and keyboard controls === <!--T:38--> </translate> * <translate><!--T:39--> Click the play icon above the thumbnail to begin playback of the media file.</translate> * <translate><!--T:40--> Right click or middle click the thumbnail to open the file description page</translate> * <translate><!--T:41--> Play/Pause the player with a single mouse click inside the player window</translate> * <translate><!--T:42--> Double click the player window to enter or leave fullscreen mode</translate> * <translate><!--T:43--> The following keyboard controls are available:</translate> *; {{Key press|k}} / {{Key press|Space}} : <translate><!--T:44--> Play/pause the media playback</translate> *; {{Key press|f}} : <translate><!--T:45--> Enter/Leave fullscreen</translate> *; {{Key press|m}} : <translate><!--T:46--> Mute the audio</translate> *; {{Key press|c}} / {{Key press|s}} : <translate><!--T:77--> Toggle subtitles on / off</translate> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <translate><!--T:73--> Decrease and increase playback speed</translate> *; {{Key press|←}} / {{Key press|→}} : <translate><!--T:74--> Skip 5 seconds back / forward</translate> *; {{Key press|j}} / {{Key press|l}} : <translate><!--T:75--> Skip 10 seconds back / forward</translate> *; {{Key press|Home}} / {{Key press|End}} : <translate><!--T:76--> Skip to start / end of video</translate> *; {{Key press|,}} / {{Key press|.}} : <translate><!--T:78--> When paused, skip 1 frame back or forward</translate> * <translate><!--T:47--> The player is fully keyboard accessible using tab, enter and spacebar keys</translate> <translate> == Known issues == <!--T:7--> <!--T:12--> The video player is still in development, but if you find any problems, please report these on the [[<tvar name=1>Extension_talk:TimedMediaHandler/VideoJS Player</tvar>|talk page]] or file them in [<tvar name=url>https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player</tvar> Phabricator]. == Developers == <!--T:57--> </translate> <translate><!--T:58--> Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</translate> <translate><!--T:59--> Below is an example of typical usage.</translate> <translate> === Basic Configuration Example === <!--T:60--> </translate> {{Note |1=<translate><!--T:61--> This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</translate> |2=gotcha }} <syntaxhighlight lang="js"> // <translate nowrap><!--T:62--> The first argument can be a string ID or a <video> element</translate> var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* <translate nowrap><!--T:63--> array of source files in various sizes and formats</translate> */ ] } ); </syntaxhighlight> <translate><!--T:64--> The <tvar name=1><code>sources</code></tvar> can also be provided in the HTML <tvar name=2>{{tag|video|open}}</tvar> element instead of in JS:</translate> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <translate> === Advanced configuration with Ogv.js support === <!--T:65--> </translate> <translate><!--T:66--> If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [<tvar name=1>https://github.com/hartman/videojs-ogvjs</tvar> Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</translate> <translate><!--T:67--> Example configuration:</translate> <syntaxhighlight lang="js"> var player; // <translate nowrap><!--T:68--> Load the appropriate modules in ResourceLoader</translate> mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // <translate nowrap><!--T:69--> Load ogvjs if necessary; when this promise resolves,</translate> // <translate nowrap><!--T:70--> all necessary code has been loaded</translate> return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* <translate nowrap><!--T:71--> array of sources</translate> */ ], // <translate nowrap><!--T:72--> Ogv.js-specific configuration</translate> ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 714brsfqzqsxlgmyugw2vgrjp3kkzcz 8364395 8364348 2026-05-03T14:11:45Z Simon04 98499 /* Mouse and keyboard controls */ {{Key press}} 8364395 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|<translate><!--T:1--> Screenshot of the VideoJS player in action</translate>]] <translate> <!--T:22--> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. <!--T:5--> It is based on [<tvar name=url>https://videojs.com/</tvar> VideoJS], and has a modern, fast user interface with compatibility with mobile devices and HTML5. == Usage == <!--T:23--> </translate> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|<translate><!--T:2--> Example video player</translate>]] [[File:Armstrong Small Step.ogg|thumb|<translate><!--T:24--> Example audio player</translate>]] <translate><!--T:25--> There is both an audio and video player.</translate> <translate><!--T:26--> You can find examples of both players on this page.</translate> <translate><!--T:27--> Once launched you will see a control bar when interacting with the video.</translate> [[File:VideoJS controlbar.png|frameless|350px]] <translate><!--T:28--> The controls in order from left to right are:</translate> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<translate><!--T:29--> Play/pause control</translate> * [[File:VideoJS volume control.png|30px|]]&nbsp;<translate><!--T:30--> Volume control</translate> * <translate><!--T:31--> Playback position</translate> * <translate><!--T:32--> Remaining playback time</translate> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<translate><!--T:33--> Subtitle language selector and subtitle style controls</translate> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<translate><!--T:34--> Resolution selector</translate> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<translate><!--T:35--> Optional Picture-in-Picture control</translate> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<translate><!--T:36--> Fullscreen control</translate> * [[File:VideoJS file description control.png|30px|]]&nbsp;<translate><!--T:37--> Info button to take you to the file description page</translate> <translate> === Mouse and keyboard controls === <!--T:38--> </translate> * <translate><!--T:39--> Click the play icon above the thumbnail to begin playback of the media file.</translate> * <translate><!--T:40--> Right click or middle click the thumbnail to open the file description page</translate> * <translate><!--T:41--> Play/Pause the player with a single mouse click inside the player window</translate> * <translate><!--T:42--> Double click the player window to enter or leave fullscreen mode</translate> * <translate><!--T:43--> The following keyboard controls are available:</translate> *; {{Key press|k}} / {{Key press|Space}} : <translate><!--T:44--> Play/pause the media playback</translate> *; {{Key press|f}} : <translate><!--T:45--> Enter/Leave fullscreen</translate> *; {{Key press|m}} : <translate><!--T:46--> Mute the audio</translate> *; {{Key press|c}} / {{Key press|s}} : <translate><!--T:77--> Toggle subtitles on / off</translate> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <translate><!--T:73--> Decrease and increase playback speed</translate> *; {{Key press|←}} / {{Key press|→}} : <translate><!--T:74--> Skip 5 seconds back / forward</translate> *; {{Key press|j}} / {{Key press|l}} : <translate><!--T:75--> Skip 10 seconds back / forward</translate> *; {{Key press|Home}} / {{Key press|End}} : <translate><!--T:76--> Skip to start / end of video</translate> *; {{Key press|,}} / {{Key press|.}} : <translate><!--T:78--> When paused, skip 1 frame back or forward</translate> * <translate><!--T:47--> The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</translate> <translate> == Known issues == <!--T:7--> <!--T:12--> The video player is still in development, but if you find any problems, please report these on the [[<tvar name=1>Extension_talk:TimedMediaHandler/VideoJS Player</tvar>|talk page]] or file them in [<tvar name=url>https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player</tvar> Phabricator]. == Developers == <!--T:57--> </translate> <translate><!--T:58--> Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</translate> <translate><!--T:59--> Below is an example of typical usage.</translate> <translate> === Basic Configuration Example === <!--T:60--> </translate> {{Note |1=<translate><!--T:61--> This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</translate> |2=gotcha }} <syntaxhighlight lang="js"> // <translate nowrap><!--T:62--> The first argument can be a string ID or a <video> element</translate> var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* <translate nowrap><!--T:63--> array of source files in various sizes and formats</translate> */ ] } ); </syntaxhighlight> <translate><!--T:64--> The <tvar name=1><code>sources</code></tvar> can also be provided in the HTML <tvar name=2>{{tag|video|open}}</tvar> element instead of in JS:</translate> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <translate> === Advanced configuration with Ogv.js support === <!--T:65--> </translate> <translate><!--T:66--> If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [<tvar name=1>https://github.com/hartman/videojs-ogvjs</tvar> Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</translate> <translate><!--T:67--> Example configuration:</translate> <syntaxhighlight lang="js"> var player; // <translate nowrap><!--T:68--> Load the appropriate modules in ResourceLoader</translate> mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // <translate nowrap><!--T:69--> Load ogvjs if necessary; when this promise resolves,</translate> // <translate nowrap><!--T:70--> all necessary code has been loaded</translate> return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* <translate nowrap><!--T:71--> array of sources</translate> */ ], // <translate nowrap><!--T:72--> Ogv.js-specific configuration</translate> ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 171vzi16ca6qdji2cl3y1tu58gzxxgm 8364764 8364395 2026-05-03T23:13:08Z Shirayuki 472859 8364764 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|<translate><!--T:1--> Screenshot of the VideoJS player in action</translate>]] <translate> <!--T:22--> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. <!--T:5--> It is based on [<tvar name=url>https://videojs.com/</tvar> VideoJS], and has a modern, fast user interface with compatibility with mobile devices and HTML5. == Usage == <!--T:23--> </translate> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|<translate><!--T:2--> Example video player</translate>]] [[File:Armstrong Small Step.ogg|thumb|<translate><!--T:24--> Example audio player</translate>]] <translate><!--T:25--> There is both an audio and video player.</translate> <translate><!--T:26--> You can find examples of both players on this page.</translate> <translate><!--T:27--> Once launched you will see a control bar when interacting with the video.</translate> [[File:VideoJS controlbar.png|frameless|350px]] <translate><!--T:28--> The controls in order from left to right are:</translate> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<translate><!--T:29--> Play/pause control</translate> * [[File:VideoJS volume control.png|30px|]]&nbsp;<translate><!--T:30--> Volume control</translate> * <translate><!--T:31--> Playback position</translate> * <translate><!--T:32--> Remaining playback time</translate> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<translate><!--T:33--> Subtitle language selector and subtitle style controls</translate> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<translate><!--T:34--> Resolution selector</translate> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<translate><!--T:35--> Optional Picture-in-Picture control</translate> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<translate><!--T:36--> Fullscreen control</translate> * [[File:VideoJS file description control.png|30px|]]&nbsp;<translate><!--T:37--> Info button to take you to the file description page</translate> <translate> === Mouse and keyboard controls === <!--T:38--> </translate> * <translate><!--T:39--> Click the play icon above the thumbnail to begin playback of the media file.</translate> * <translate><!--T:40--> Right click or middle click the thumbnail to open the file description page</translate> * <translate><!--T:41--> Play/Pause the player with a single mouse click inside the player window</translate> * <translate><!--T:42--> Double click the player window to enter or leave fullscreen mode</translate> * <translate><!--T:43--> The following keyboard controls are available:</translate> *; {{Key press|k}} / {{Key press|Space}} : <translate><!--T:44--> Play/pause the media playback</translate> *; {{Key press|f}} : <translate><!--T:45--> Enter/Leave fullscreen</translate> *; {{Key press|m}} : <translate><!--T:46--> Mute the audio</translate> *; {{Key press|c}} / {{Key press|s}} : <translate><!--T:77--> Toggle subtitles on / off</translate> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <translate><!--T:73--> Decrease and increase playback speed</translate> *; {{Key press|←}} / {{Key press|→}} : <translate><!--T:74--> Skip 5 seconds back / forward</translate> *; {{Key press|j}} / {{Key press|l}} : <translate><!--T:75--> Skip 10 seconds back / forward</translate> *; {{Key press|Home}} / {{Key press|End}} : <translate><!--T:76--> Skip to start / end of video</translate> *; {{Key press|,}} / {{Key press|.}} : <translate><!--T:78--> When paused, skip 1 frame back or forward</translate> * <translate><!--T:47--> The player is fully keyboard accessible using {{<tvar name=1>Key press</tvar>|Tab}}, {{<tvar name=1>Key press</tvar>|Enter}} and {{<tvar name=1>Key press</tvar>|Space}} keys</translate> <translate> == Known issues == <!--T:7--> <!--T:12--> The video player is still in development, but if you find any problems, please report these on the [[<tvar name=1>Extension_talk:TimedMediaHandler/VideoJS Player</tvar>|talk page]] or file them in [<tvar name=url>https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player</tvar> Phabricator]. == Developers == <!--T:57--> </translate> <translate><!--T:58--> Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</translate> <translate><!--T:59--> Below is an example of typical usage.</translate> <translate> === Basic Configuration Example === <!--T:60--> </translate> {{Note|1=<translate><!--T:61--> This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</translate>|2=gotcha}} <syntaxhighlight lang="js"> // <translate nowrap><!--T:62--> The first argument can be a string ID or a <video> element</translate> var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* <translate nowrap><!--T:63--> array of source files in various sizes and formats</translate> */ ] } ); </syntaxhighlight> <translate><!--T:64--> The <tvar name=1><code>sources</code></tvar> can also be provided in the HTML <tvar name=2>{{tag|video|open}}</tvar> element instead of in JS:</translate> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <translate> === Advanced configuration with Ogv.js support === <!--T:65--> </translate> <translate><!--T:66--> If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [<tvar name=1>https://github.com/hartman/videojs-ogvjs</tvar> Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</translate> <translate><!--T:67--> Example configuration:</translate> <syntaxhighlight lang="js"> var player; // <translate nowrap><!--T:68--> Load the appropriate modules in ResourceLoader</translate> mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // <translate nowrap><!--T:69--> Load ogvjs if necessary; when this promise resolves,</translate> // <translate nowrap><!--T:70--> all necessary code has been loaded</translate> return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* <translate nowrap><!--T:71--> array of sources</translate> */ ], // <translate nowrap><!--T:72--> Ogv.js-specific configuration</translate> ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 7x86uize4gmt9r1a1cja7av0z99gnm3 Template:Update/fr 10 707508 8364320 8364241 2026-05-03T12:47:02Z FuzzyBot 451990 Updating to match new version of source page 8364320 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |La '''pertinence factuelle''' des parties de cette page relatives à {{{part|{{{1|}}}}}} '''peut être incorrecte en raison d'informations obsolètes'''. |Certaines parties de cette page (celles relatives à {{{part|{{{1|}}}}}}) sont '''obsolètes'''.}} |{{#if:{{{inaccurate|}}} |La '''pertinence factuelle''' de cette page '''peut être incorrecte en raison d'informations obsolètes'''. |Cette page est '''obsolète'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|Elle a été écrite pour une version antérieure de MediaWiki et il est possible qu'elle ne s'applique plus à la dernière version.}} Si vous avez vérifié (ou mis à jour) cette page et que vous avez trouvé le contenu adapté, vous pouvez supprimer cette note. {{#ifexist: {{TALKPAGENAME}} |&#32;Voir la [[{{TALKPAGENAME}}|page de discussion]] pour une discussion possible sur ce sujet. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Dernière mise à jour : {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= Alias de ce modèle : * {{tlx|outdated}} <span id="Examples"></span> == Exemples == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == Voir aussi == * {{tl|historical}} == TemplateData == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> jp2xstynto7g48n7b23wth8btg9ahfm Translations:Help:Extension:ParserFunctions/2373/pt 1198 767895 8364915 5239627 2026-05-04T05:18:31Z RogueScholar 14671222 8364915 wikitext text/x-wiki Também pode usar um parâmetro como a cadeia de texto de teste na sua declaração $2. g4o8xyrds6bxh540kdyicwzwf9w6hzm Translations:Help:Extension:ParserFunctions/76/pt 1198 767954 8364936 7771818 2026-05-04T05:24:43Z RogueScholar 14671222 8364936 wikitext text/x-wiki Podem ser omitidas uma ou ambas as cadeias de texto a devolver. jo1afqtdq6h5ms8wynypxu0xm15onje Translations:Help:VisualEditor/User guide/Citation templates/9/ja 1198 800002 8364896 2832225 2026-05-04T04:58:46Z TzrZzz 18352707 8364896 wikitext text/x-wiki 出典の書式設定の「$tooltip」と引用を再利用する「$tool」は、どのプロジェクトでも利用できます。 c4clrmnpc6vple3hr7w3s1hjj2rtuch Translations:Help:VisualEditor/User guide/Citation templates/10/ja 1198 800011 8364894 2832242 2026-05-04T04:52:37Z TzrZzz 18352707 8364894 wikitext text/x-wiki このダイアログでは、ローカルの引用テンプレートにも素早くアクセスできます。 61owcqvtwxhovxgu7b24lq8khp7jvq3 Translations:Help:VisualEditor/User guide/Citation templates/11/ja 1198 800012 8364892 5351775 2026-05-04T04:51:44Z TzrZzz 18352707 8364892 wikitext text/x-wiki (ご利用のウィキの「$label」メニューにローカルの引用テンプレートを追加する手順は $2 を参照してください。) 6ysinrkq9c9qcnbgfscxnu2r61diwa9 Translations:Help:VisualEditor/User guide/Citation templates/12/ja 1198 800115 8364898 2832485 2026-05-04T05:02:25Z TzrZzz 18352707 8364898 wikitext text/x-wiki '''$insert:''' 「$insert」メニューはプロジェクトごとに異なることがあります。引用に便利なオプションが2つあります。 3r5suu6e10u490agd5eirpnna4ckkoi 8364900 8364898 2026-05-04T05:04:44Z TzrZzz 18352707 8364900 wikitext text/x-wiki '''$insert:''' 「$insert」メニューはプロジェクトごとに異なることがあります。注釈に便利なオプションが2つあります。 oyu0r11enciecpg5e54qvp23hmlidqc Translations:Help:VisualEditor/User guide/Citation templates/13/ja 1198 800117 8364904 2832488 2026-05-04T05:09:03Z TzrZzz 18352707 8364904 wikitext text/x-wiki 「$template」アイコン(ジグソーパズルの駒の形)を押すと[[$editemplate|テンプレートの挿入と編集ができます]]。脚注に'''したくない'''注釈は、これを使って標準的なテンプレートを挿入し注釈を作ります。 tb0xycey1oxrehv3i705opjv8kzjanp Translations:Help:VisualEditor/User guide/Citation templates/14/ja 1198 800118 8364906 2832490 2026-05-04T05:11:32Z TzrZzz 18352707 8364906 wikitext text/x-wiki 「$reflist」アイコン(3冊の本の形)は、ページに脚注を表示する場所で押します。通常は1ページに1回使えば充分です(すでに脚注が表示されたページでは押さないでください)。 jmyea0dugal4tn0nmjqx330bia0fade Translations:Help:VisualEditor/User guide/Citation templates/59/ja 1198 800119 8364908 5334369 2026-05-04T05:12:15Z TzrZzz 18352707 8364908 wikitext text/x-wiki また、ダイアログウィンドウで表示する参考文献グループを設定することもできます。 lwnd9jm8wttzftohu6li95iv0fdkfpl Translations:Help:VisualEditor/User guide/Citation templates/34/ja 1198 800122 8364964 3316843 2026-05-04T05:38:31Z TzrZzz 18352707 8364964 wikitext text/x-wiki === 標準的な引用テンプレートで脚注を追加 === m8bqb9kjgln7qti4p890vadi43j0je1 Translations:Help:VisualEditor/User guide/Citation templates/45/ja 1198 800127 8364974 2832508 2026-05-04T05:45:13Z TzrZzz 18352707 8364974 wikitext text/x-wiki 「$vediref」項目の使用目的は、引用テンプレートを使わずに脚注を作るか、「$vebel」メニューにない引用テンプレートを使って脚注を作るかの2つあります。 lk7thry7mvy75xz5hpg9q4g6dp1pah4 Translations:Help:VisualEditor/User guide/Citation templates/54/ja 1198 800128 8364984 2832513 2026-05-04T06:00:13Z TzrZzz 18352707 8364984 wikitext text/x-wiki == 脚注以外のところに引用を追加 == e7ctj3sklu6swijx222zxpofcmoclux Extension:NoTOC/da 102 843163 8365099 5910907 2026-05-04T10:21:17Z FuzzyBot 451990 Updating to match new version of source page 8365099 wikitext text/x-wiki <languages /> {{Unmaintained extension|alternative={{ll|Extension:NoTOCModern}}}} {{Extension code in wiki}} {{Extension |status = unmaintained |type1 = parser |type2 = |hook1 = ParserClearState |hook2 = |username = Frantik |author = Andrew Fitzgerald |description = <span lang="en" dir="ltr" class="mw-content-ltr">Turns off Table of Contents by default on all pages</span> |image = |imagesize = |version = 0.1.1 |update = 2013-12-11 |mediawiki = |php = |license = GPL-2.0-or-later |download = <span lang="en" dir="ltr" class="mw-content-ltr">See the [[#Code|code section]]</span> |needs-updatephp = No |readme = |changelog = |parameters = |tags = |rights = |example = |compatibility = }} <span lang="en" dir="ltr" class="mw-content-ltr">The '''NoTOC''' extension hides the table of contents by default.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The magic word <nowiki>__TOC__</nowiki> can still be used normally.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==Installation== </div> {{ExtensionInstall |download-link=[[#Code|<span lang="en" dir="ltr" class="mw-content-ltr">Copy the code into files</span>]] }} <span id="Code"></span> ==Kode== ;NoTOC.php <syntaxhighlight lang="php"> <?php /** * NoTOC extension - Turns off the Table of Contents (TOC) by default on all pages * @version 0.1.1 - 2013/12/11 * * @link https://www.mediawiki.org/wiki/Extension:NoTOC Documentation * @link https://www.mediawiki.org/wiki/Extension_talk:NoTOC Support * * @ingroup Extensions * @package MediaWiki * @author Andrew Fitzgerald (Frantik) * @author Karsten Hoffmeyer (Kghbln) * @copyright (C) 2010 Andrew Fitzgerald * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ // check the call if ( !defined( 'MEDIAWIKI' ) ) { die( 'This file is a MediaWiki extension and thus not a valid entry point.' ); } // provide information $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'NoTOC', 'author' => array( 'Andrew Fitzgerald', '...' ), 'url' => 'https://www.mediawiki.org/wiki/Extension:NoTOC', 'descriptionmsg' => 'notoc-desc', 'version' => '0.1.1' ); // show way to files $wgExtensionMessagesFiles['NoTOC'] = dirname( __FILE__ ) . '/NoTOC.i18n.php'; // register hooks $wgHooks['ParserClearState'][] = 'efMWNoTOC'; // perform purpose function efMWNoTOC($parser) { $parser->mShowToc = false; return true; } </syntaxhighlight> ;NoTOC.i18n.php <syntaxhighlight lang="php"> <?php /** * Internationalization file for the NoTOC extension. * * @licence GNU GPL v2+ * @author Karsten Hoffmeyer (Kghbln) */ $messages = array(); /** English * @author Frantik * @author Kghbln */ $messages['en'] = array( 'notoc-desc' => 'Turns off the Table of Contents (TOC) by default on all pages', ); /** Message documentation (Message documentation) * @author Kghbln */ $messages['qqq'] = array( 'notoc-desc' => '{{desc|name=NoTOC|url=https://www.mediawiki.org/wiki/Extension:NoTOC}}', ); /** German (Deutsch) * @author Kghbln */ $messages['de'] = array( 'notoc-desc' => 'Unterdrückt die automatische Generierung des Inhaltsverzeichnisses', ); </syntaxhighlight> <span id="See_also"></span> ==Se også== * {{ll|Extension:ForceTocOnEveryPage}} * {{ll|Extension:DeToc}} - <span lang="en" dir="ltr" class="mw-content-ltr">This can be used to extract TOC HTML and to remove it or put it in some other section of the page.</span> [[Category:TOC extensions{{#translation:}}]] 0t8ciludlppr1zlbywp9887ygyhuxxc Translations:Help:Extension:ParserFunctions/2447/pt 1198 905651 8365056 3169265 2026-05-04T07:22:22Z RogueScholar 14671222 8365056 wikitext text/x-wiki (''Pode'' ser configurado para fornecer funções adicionais do analisador para o tratamento de cadeias de texto; elas só estão disponíveis para wikis que não pertencem à Fundação Wikimedia, portanto, estão documentadas {{$ext-sf|em outros lugares}}.) hxfemtm6lottu3abl7oz00z4lhoiekl Manual:User rights/cs 100 912884 8364661 8358847 2026-05-03T17:20:57Z Rebulka 17532855 8364661 wikitext text/x-wiki <languages/> '''Uživatelská práva''' jsou oprávnění k akcím (například možnost upravit stránku wiki, ale také třeba možnost zablokovat jiného uživatele), která je možno přiřadit různým '''uživatelským skupinám'''. MediaWiki je dodáváno s výchozí sadou uživatelských práv a uživatelských skupin, ale tyto je možné přizpůsobovat. Tato stránka vysvětluje, jak fungují výchozí práva a skupiny, a jak lze jejich nastavení změnit. Pokud chcete vědět, jak lze jednotlivé uživatele přiřazovat do skupin (a odebírat je z nich), přečtěte si {{ll|Help:User rights and groups}} a {{ll|Manual:Setting user groups in MediaWiki}}. <span id="Changing_group_permissions"></span> == Změna práv skupiny == Výchozí instalace MediaWiki přiřazuje určitá práva výchozím skupinám (viz tabulka v [[#List of permissions|#Seznamu oprávnění]]). Výchozí práva můžete změnit úpravou pole {{Wg|GroupPermissions}} v {{ll|Manual:LocalSettings.php|LocalSettings.php}} se syntaxí. <syntaxhighlight lang="php" copy> $wgGroupPermissions['group']['right'] = true /* nebo false (nepravdivé) */; </syntaxhighlight> {{Note | 1 = Ve výchozí instalaci bude {{wg|GroupPermissions}} nastaveno v <code>includes/DefaultSettings.php</code>, ale v <code>LocalSettings.php</code> ''není'' přítomno. Budete jej muset do tohoto souboru přidat. }} Pokud má člen více skupin, získá všechna oprávnění od každé ze skupin, do kterých patří. Všichni uživatelé, včetně anonymních uživatelů, jsou ve skupině <code>*</code>. Všichni registrovaní uživatelé jsou ve skupině <code>user</code>. Kromě výchozích skupin můžete libovolně vytvářet nové skupiny pomocí stejného pole. <span id="Examples"></span> === Příklady === Tento příklad zakáže prohlížení všech stránek, které nejsou uvedeny v {{wg|WhitelistRead}}. Poté je znovu povolí pouze pro registrované uživatele: <syntaxhighlight lang="php" copy> $wgGroupPermissions['*']['read'] = false; # Následující řádek není ve skutečnosti nutný, protože je ve výchozím nastavení. Nastavení '*' na false neovlivní práva pro skupiny, které mají právo samostatně nastaveno na true! $wgGroupPermissions['user']['read'] = true; </syntaxhighlight> Tento příklad zakáže úpravy všech stránek a poté znovu povolí uživatelům pouze [[Special:MyLanguage/Manual:$wgEmailAuthentication|potvrzené e-mailové adresy]]: <!-- This is pretty complicated, not so well explained and beyond scope; should we keep it? Chealer 20250722 --> <syntaxhighlight lang="php" copy> # Zakázat všem. $wgGroupPermissions['*']['edit'] = false; # Zakázat také pro uživatele: Ve výchozím nastavení je 'uživatel' oprávněn upravovat, i když není '*'. $wgGroupPermissions['user']['edit'] = false; # Ujistěte se, že uživatelé s potvrzenými e-mailovými adresami jsou ve skupině. $wgAutopromote['emailconfirmed'] = APCOND_EMAILCONFIRMED; # Skrýt skupinu ze seznamu uživatelů. $wgImplicitGroups[] = 'emailconfirmed'; # Nakonec nastavte pro požadovanou skupinu hodnotu true. $wgGroupPermissions['emailconfirmed']['edit'] = true; </syntaxhighlight> <span id="Creating_a_new_group_and_assigning_permissions_to_it"></span> == Vytvoření nové skupiny a přiřazení oprávnění k této skupině == Lze vytvářet vlastní skupiny. Skupina se vytváří implicitně, pouhým přiřazením práv v {{tmpl|0=<code class="mw-highlight">{{#tag:span|$wgGroupPermissions|class=nv}}[ {{#tag:span|'<nowiki/>$1'|class=s1}} ]</code>|''NazevSkupiny''}}, kde ''NazevSkupiny'' je skutečný název skupiny. Od MW 1.12 můžete pomocí aplikace {{wg|Autopromote}} vytvořit své vlastní skupiny, do kterých jsou uživatelé automaticky povýšeni (jako u <code>autoconfirmed</code>). Kromě přiřazování oprávnění byste měli také vytvořit tyto tři wiki stránky s vhodným obsahem: * {{blue|MediaWiki:Group-&lt;group-name>}} (obsahuje: <code>Name of the group</code> (název skupiny)) * {{blue|MediaWiki:Group-&lt;group-name>-member}} (obsahuje: <code>Name of a member of the group</code> (jméno člena skupiny)) * {{blue|MediaWiki:Grouppage-&lt;group-name>}} (obsahuje: <code>Name of the group page</code> (název skupiny stránek)) Ve výchozím nastavení mohou byrokraté přidávat uživatele do jakékoli skupiny nebo je z ní odebírat. Pokud však používáte {{Wg|AddGroups}} a {{Wg|RemoveGroups}}, možná je budete muset místo toho upravit. <span id="Examples"></span> === Příklady === Tento příklad vytvoří libovolnou skupinu <code>projectmember</code>, která může blokovat uživatele a mazat stránky a jejichž úpravy jsou ve výchozím nastavení v protokolu posledních změn skryty: <syntaxhighlight lang="php" copy> $wgGroupPermissions['projectmember']['bot'] = true; $wgGroupPermissions['projectmember']['block'] = true; $wgGroupPermissions['projectmember']['delete'] = true; </syntaxhighlight> {{note|1=Název skupiny nesmí obsahovat mezery, proto použijte <code>{{color|var(--color-content-added, #006400)|'random-group'}}</code> nebo <code>{{color|var(--color-content-added, #006400)|'random_group'}}</code> místo <code>{{color|var(--color-content-removed, #8B0000)|'random group'}}</code>. Kromě toho se doporučuje k vytvoření názvů skupiny použít pouze malá písmena.}} V tomto příkladu byste pravděpodobně také chtěli vytvořit tyto stránky: * {{blue|MediaWiki:Group-projectmember}} (obsahuje: <code>Project members</code> (členové projektu)) * {{blue|MediaWiki:Group-projectmember-member}} (obsahuje: <code>Project member</code> (člen projektu)) * {{blue|MediaWiki:Grouppage-projectmember}} (obsahuje: <code>Project:Project Members</code> (člen projektu skupiny stránek)) Tím bude zajištěno, že skupina bude v celém rozhraní označována jako "Project members" (členové projektu) a člen bude označován jako "Project member" (člen projektu). Přehledy propojí název skupiny s {{blue|Project:Project members}}. Tento příklad ve výchozím nastavení zakáže přístup pro zápis (úpravy a vytváření stránek), vytvoří skupinu s názvem <code>writer</code> a udělí jí přístup pro zápis. Uživatele lze do této skupiny přidat ručně pomocí [[Special:UserRights]]: <syntaxhighlight lang="php" copy> $wgGroupPermissions['*']['edit'] = false; $wgGroupPermissions['*']['createpage'] = false; $wgGroupPermissions['user']['edit'] = false; $wgGroupPermissions['user']['createpage'] = false; $wgGroupPermissions['writer']['edit'] = true; $wgGroupPermissions['writer']['createpage'] = true; </syntaxhighlight> V tomto příkladu byste pravděpodobně také chtěli vytvořit tyto stránky: * {{blue|MediaWiki:Group-writer}} (obsahuje: <code>Writers</code> (autoři)) * {{blue|MediaWiki:Group-writer-member}} (obsahuje: <code>Writer</code> (autor)) * {{blue|MediaWiki:Grouppage-writer}} (obsahuje: <code>Project:Write</code> (autor skupinových stránek)) <span id="List_of_permissions"></span> == Přehled oprávnění == V nejnovější verzi MediaWiki jsou k dispozici následující uživatelská práva. Pokud používáte starší verzi, podívejte se na stránku [[Special:Version]] na vaší wiki a podívejte se, zda je vaše verze uvedena ve sloupci "Verze". {| class="wikitable sortable" |- !{{hl2}} | Správně !{{hl2}} | Popis !{{hl2}} | Skupiny uživatelů, které mají toto právo ve výchozím nastavení !{{hl2}} | Verze |-style="text-align:center" |{{hl3}} colspan="4"|'''{{visible anchor|1=Čtení}}''' |- {{anchor|read}} |style="vertical-align:top"|read |{{int|right-read}} – Pokud je nastaveno na false, přepíše se u konkrétních stránek pomocí {{wg|WhitelistRead}} ---- {{Uploaded-files-access-restriction-info}} | *, user | [[rev:9367|1.5+]] |-style="text-align:center" |{{hl3}} colspan="4"|'''{{visible anchor|1=Editace}}''' |-{{anchor|applychangetags}} |applychangetags |{{int|right-applychangetags}} – vyžaduje právo <code>edit</code> |user |1.25+ |-{{anchor|autocreateaccount}} |autocreateaccount |{{int|right-autocreateaccount}} - omezenější verze ''createaccount'' (vytvoření účtu) |— |1.27+ |-{{anchor|createaccount}} |createaccount |{{int|right-createaccount}} – registr / registrace |*, sysop |[[rev:9367|1.5+]] |-{{anchor|createpage}} |createpage |{{int|right-createpage}} – vyžaduje právo <code>edit</code> |*, user |[[rev:11973|1.6+]] |-{{anchor|createtalk}} |createtalk |{{int|right-createtalk}} – vyžaduje právo <code>edit</code> |*, user |[[rev:11973|1.6+]] |-{{anchor|delete-redirect}} |delete-redirect |{{int|right-delete-redirect}} (tohle právo není nutné, pokud má skupina právo <code>delete</code>) |— |[[gerrit:559622|1.36+]] |-{{anchor|edit}} |edit |{{int|right-edit}} – vyžaduje právo <code>read</code> |*, user |[[rev:9632|1.5+]] |-{{anchor|editsemiprotected}} |editsemiprotected |{{int|right-editsemiprotected}} – bez kaskádové ochrany – vyžaduje právo <code>edit</code> |autoconfirmed, bot, sysop |1.22+ |-{{anchor|editprotected}} |editprotected |{{int|right-editprotected}} – bez kaskádové ochrany – vyžaduje právo <code>edit</code> |sysop |[[rev:32164|1.13+]] |-{{anchor|minoredit}} |minoredit |{{int|right-minoredit}} – vyžaduje právo <code>edit</code> |user |[[rev:12359|1.6+]] |-{{anchor|move}} |move |{{int|right-move}} – vyžaduje právo <code>edit</code> |user, sysop |[[rev:9367|1.5+]] |-{{anchor|move-categorypages}} |move-categorypages |{{int|right-move-categorypages}} – vyžaduje právo <code>move</code> |user, sysop |[[gerrit:111096|1.25+]] |-{{anchor|move-rootuserpages}} |move-rootuserpages |{{int|right-move-rootuserpages}} – vyžaduje právo <code>move</code> |user, sysop |[[rev:41961|1.14+]] |-{{anchor|move-subpages}} |move-subpages |{{int|right-move-subpages}} – vyžaduje právo <code>move</code> |user, sysop |[[rev:35213|1.13+]] |-{{anchor|movefile}} |movefile |{{int|right-movefile}} – vyžaduje také právo <code>move</code> |user, sysop |[[rev:45276|1.14+]] |-{{anchor|reupload}} |reupload |{{int|right-reupload}} – vyžaduje právo <code>upload</code> |user, sysop |[[rev:10906|1.6+]] |-{{anchor|reupload-own}} |reupload-own |{{int|right-reupload-own}} – vyžaduje právo <code>upload</code> (toto není nutné, pokud skupina již má právo na opětovné načtení) |— |[[rev:21943|1.11+]] |-{{anchor|reupload-shared}} |reupload-shared |{{int|right-reupload-shared}} – (pokud je nastaven) s místními soubory (vyžaduje právo <code>upload</code>) |user, sysop |[[rev:10906|1.6+]] |-{{anchor|sendemail}} |sendemail |{{int|right-sendemail}} |user |[[rev:56962|1.16+]] |-{{anchor|upload}} |upload |{{int|right-upload}} – vyžaduje, aby bylo právo <code>edit</code> a {{wg|EnableUploads}} {{phpi|true}} |user, sysop |[[rev:9499|1.5+]] |-{{anchor|upload_by_url}} |upload_by_url |{{int|right-upload_by_url}} – vyžaduje právo <code>upload</code> (Před 1.20 bylo dáno sysopsům) |— |[[rev:16162|1.8+]] |-style="text-align:center" |{{hl3}} colspan="4"|'''{{visible anchor|1=Řízení}}''' |-{{anchor|autopatrol}} |autopatrol | Upraví určité akce prováděné držitelem oprávnění a automaticky je označí jako {{ll|Help:Patrolling|"sledované"}} – Závisí na {{ltt|noconj=1|fmt={{wg|$1}}|UseRCPatrol|UseNPPatrol|UseFilePatrol}} |bot, sysop |[[rev:18496|1.9+]] |-{{anchor|bigdelete}} |bigdelete |{{int|right-bigdelete}} (jak je určeno {{wg|DeleteRevisionsLimit}}) – vyžaduje právo ''<code>delete</code>'' |sysop |[[rev:29872|1.12+]] |-{{anchor|block}} |block |{{int|right-block}} – Možnosti blokování zahrnují zabránění úpravám a registraci nových účtů a blokování ostatních uživatelů na stejné IP adrese |sysop |[[rev:9367|1.5+]] |-{{anchor|blockemail}} |blockemail |{{int|right-blockemail}} – umožňuje zabránit použití rozhraní [[Special:Emailuser]] při blokování – vyžaduje právo <code>block</code> |sysop |[[rev:22827|1.11+]] |-{{anchor|browsearchive}} |browsearchive |{{int|right-browsearchive}} – prostřednictvím [[Special:Undelete]] – vyžaduje právo ''<code>deletedhistory</code>'' |sysop |[[rev:32456|1.13+]] |-{{anchor|changetags}} |changetags |{{int|right-changetags}} – aktuálně rozšířeními nepoužívaná |user |1.25+ |-{{anchor|delete}} |delete |{{int|right-delete}}<br />{{MW version-inline|1.5-1.11}}umožňuje smazání nebo obnovení stránek.<br />{{MW version-inline|1.12+}}umožňuje mazání stránek. U obnovování je nyní <code>undelete</code> právo, viz níže |sysop |[[rev:9367|1.5+]] |-{{anchor|deletedhistory}} |deletedhistory |{{int|right-deletedhistory}} |sysop |[[rev:12241|1.6+]] |-{{anchor|deletedtext}} |deletedtext |{{int|right-deletedtext}} – vyžaduje právo <code>deletedhistory</code> |sysop |1.16+ |-{{anchor|deletelogentry}} |deletelogentry |{{int|right-deletelogentry}} – umožňuje mazat nebo odebírat informace (text akce, shrnutí, uživatel, který provedl akci) konkrétních položek protokolu - vyžaduje právo ''odstraňování revizí'' (deleterevision) |suppress |[[gerrit:12889|1.20+]] |-{{anchor|deleterevision}} |deleterevision |{{int|right-deleterevision}} – umožňuje mazat nebo odebírat informace (text revize, shrnutí úprav, uživatel, který provedl úpravu) konkrétních revizí (Rozděleno na <code>deleterevision</code> a <code>deletelogentry</code> v 1.20) |suppress |[[rev:13224|1.6+]] |-{{anchor|editcontentmodel}} |editcontentmodel |{{int|right-editcontentmodel}} – vyžaduje právo ''<code>edit</code>'' |user |[[gerrit:176201|1.23.7+]] |-{{anchor|editinterface}} |editinterface |{{int|right-editinterface}} – obsahuje [[Special:MyLanguage/Manual:Interface|rozhraní]]. Pro úpravy CSS/JSON/JS na webu existují nyní oddělená práva, viz níže. – vyžaduje právo ''<code>edit</code>'' |sysop, interface-admin |[[rev:9367|1.5+]] |-{{anchor|editmyoptions}} |editmyoptions |{{int|right-editmyoptions}} |* |[[gerrit:67876|1.22+]] |-{{anchor|editmyprivateinfo}} |editmyprivateinfo |{{int|right-editmyprivateinfo}} – skryje také volbu "Change Password" (změnit heslo), ovšem pak nebude pro uživatele žádná jiná cesta jak by si mohl změnit heslo – vyžaduje právo <code>viewmyprivateinfo</code> |* |[[gerrit:67876|1.22+]] |-{{anchor|editmyusercss}} |editmyusercss |{{int|right-editmyusercss}} – před 1.31 byl přiřazen všem (tj. "*") (tato poznámka není nutná, pokud skupina již má právo <code>editusercss</code>) – vyžaduje právo ''<code>edit</code>'' |user |[[gerrit:67874|1.22+]] |-{{anchor|editmyuserjs}} |editmyuserjs |{{int|right-editmyuserjs}} – před 1.31 byl přiřazen všem (tj. "*") (tato poznámka není nutná, pokud skupina již má právo <code>edituserjs</code>) – vyžaduje právo ''<code>edit</code>'' |user |[[gerrit:67874|1.22+]] |-{{anchor|editmyuserjsredirect}} |editmyuserjsredirect |{{int|right-editmyuserjsredirect}} (tohle právo není nutné, pokud má skupina právo <code>edituserjs</code>) – vyžaduje právo ''<code>edit</code>'' |— |[[gerrit:502667|1.34+]] |-{{anchor|editmyuserjson}} |editmyuserjson |{{int|right-editmyuserjson}} (Všimněte si, že to není nutné, pokud skupina již má právo <code>edituserjson</code>) – vyžaduje právo ''<code>edit</code>'' |user |[[gerrit:408940|1.31+]] |-{{anchor|editmywatchlist}} |editmywatchlist |{{int|right-editmywatchlist}} – vyžaduje právo <code>viewmywatchlist</code> |user |[[gerrit:67875|1.22+]] |-{{anchor|editsitecss}} |editsitecss |{{int|right-editsitecss}} – vyžaduje právo ''<code>editinterface</code>'' |interface-admin |[[gerrit:421121|1.32+]] |-{{anchor|editsitejs}} |editsitejs |{{int|right-editsitejs}} – vyžaduje právo ''<code>editinterface</code>'' |interface-admin |[[gerrit:421121|1.32+]] |-{{anchor|editsitejson}} |editsitejson |{{int|right-editsitejson}} – vyžaduje právo ''<code>editinterface</code>'' |sysop, interface-admin |[[gerrit:421121|1.32+]] |-{{anchor|editusercss}} |editusercss |{{int|right-editusercss}} – vyžaduje právo ''<code>edit</code>'' |interface-admin |[[rev:54153|1.16+]] |-{{anchor|edituserjs}} |edituserjs |{{int|right-edituserjs}} – vyžaduje právo ''<code>edit</code>'' |interface-admin |[[rev:54153|1.16+]] |-{{anchor|edituserjson}} |edituserjson |{{int|right-edituserjson}} – vyžaduje právo ''<code>edit</code>'' |sysop, interface-admin |[[gerrit:408940|1.31+]] |-{{anchor|hideuser}} |hideuser |{{int|right-hideuser}} – Ve výchozím nastavení lze potlačit pouze uživatele s 1 000 úpravami nebo méně – vyžaduje právo ''<code>block</code>'' K deaktivaci použijte {{wg|HideUserContribLimit}}. |suppress |[[rev:20446|1.10+]] |-{{anchor|ignore-restricted-groups}} |ignore-restricted-groups |{{int|right-ignore-restricted-groups}} – Platí pouze pro skupiny, které by uživatel jinak mohl změnit na základě práva <code>userrights</code> a obsahu {{wg|AddGroups}}. |— |[[gerrit:1200077|1.46+]] |-{{anchor|markbotedits}} |markbotedits |{{int|right-markbotedits}} – Podívejte se na stránku {{ll|Manual:Rollback}}. – vyžaduje právo ''<code>rollback</code>'' |sysop |[[rev:27658|1.12+]] |-{{anchor|mergehistory}} |mergehistory |{{int|right-mergehistory}} – vyžaduje právo ''<code>edit</code>'' |sysop |[[rev:27823|1.12+]] |-{{anchor|pagelang}} |pagelang |{{int|right-pagelang}} – {{wg|PageLanguageUseDB}} musí být {{phpi|true}} |— |[[gerrit:135312|1.24+]] |-{{anchor|patrol}} |patrol | Označit určité akce jako {{ll|Help:Patrolling|"sledované"}} – depends on {{ltt|noconj=1|fmt={{wg|$1}}|UseRCPatrol|UseNPPatrol|UseFilePatrol}} |sysop |[[rev:9367|1.5+]] |-{{anchor|patrolmarks}} |patrolmarks |{{int|right-patrolmarks}} (Všimněte si, že toto není nutné, pokud skupina již má právo <code>patrol</code>) |— |[[rev:54153|1.16+]] |-{{anchor|protect}} |protect |{{int|right-protect}} – vyžaduje právo ''<code>edit</code>'' |sysop |[[rev:9367|1.5+]] |-{{anchor|rollback}} |rollback |[[Special:MyLanguage/Manual:Rollback|{{int|right-rollback}}]] – vyžaduje právo ''<code>edit</code>'' |sysop |[[rev:9367|1.5+]] |-{{anchor|suppressionlog}} |suppressionlog |{{int|right-suppressionlog}} |suppress |[[rev:13224|1.6+]] |-{{anchor|suppressrevision}} |suppressrevision |{{int|right-suppressrevision}} – ''''''Před [[rev:35303|1.13]] bylo toto právo pojmenováno hiderevision'''''' – vyžaduje právo ''<code>deleterevision</code>'' |suppress |[[rev:13224|1.6+]] |-{{anchor|unblockself}} |unblockself |{{int|right-unblockself}} – Bez něj se správce, který má schopnost blokovat, nemůže sám odblokovat, pokud je blokován jiným správcem |sysop |[[rev:64228|1.17+]] |-{{anchor|undelete}} |undelete |{{int|right-undelete}} – vyžaduje právo ''<code>deletedhistory</code>'' |sysop |[[rev:28151|1.12+]] |-{{anchor|userrights}} |userrights |{{int|right-userrights}} – umožňuje přiřazení nebo odebrání všech(*) skupin libovolnému uživateli.<br /> <small>(*) S {{wg|AddGroups}} a {{wg|RemoveGroups}} můžete nastavit možnost přidat nebo odebrat určité skupiny místo všech</small> |bureaucrat |[[rev:9367|1.5+]] |-{{anchor|userrights-interwiki}} |userrights-interwiki |{{int|right-userrights-interwiki}} – vyžaduje právo <code>userrights</code> |— |[[rev:28650|1.12+]] |-{{anchor|viewmyprivateinfo}} |viewmyprivateinfo |{{int|right-viewmyprivateinfo}} |* |[[gerrit:67876|1.22+]] |-{{anchor|viewmywatchlist}} |viewmywatchlist |{{int|right-viewmywatchlist}} |user |[[gerrit:67875|1.22+]] |-{{anchor|viewsuppressed}} |viewsuppressed |{{int|right-viewsuppressed}} – tj. užší alternativa k <code>suppressrevision</code> (všimněte si, že to není nutné, pokud skupina již má právo <code>suppressrevision</code>) |suppress |[[gerrit:139277|1.24+]] |-style="text-align:center" |{{hl3}} colspan="4"|'''{{visible anchor|1=Správa}}''' |-{{anchor|deletechangetags}} |deletechangetags |{{int|right-deletechangetags}} – aktuálně rozšířeními nepoužívaná |sysop |[[gerrit:286282|1.28+]] |-{{anchor|import}} |import |{{int|right-import}} – "transwiki" – vyžaduje právo ''<code>edit</code>'' |sysop |[[rev:9498|1.5+]] |-{{anchor|importupload}} |importupload |{{int|right-importupload}} – Toto právo bylo nazváno 'importraw' (import surového) v a před verzí 1.5 – vyžaduje právo ''<code>edit</code>'' |sysop |[[rev:9499|1.5+]] |-{{anchor|managechangetags}} |managechangetags |{{int|right-managechangetags}} – aktuálně rozšířeními nepoužívaná |sysop |1.25+ |-{{anchor|renameuser}} |renameuser |{{int|right-renameuser}} (dříve bylo součástí rozšíření Renameuser) |bureaucrat |1.40+ |-{{anchor|siteadmin}} |siteadmin |{{int|right-siteadmin}} – které blokuje veškeré interakce s webovým serverem kromě prohlížení. (''ve výchozím nastavení není k dispozici'') |— |[[rev:9367|1.5+]] |-{{anchor|unwatchedpages}} |unwatchedpages |{{int|right-unwatchedpages}} – vypíše seznam stránek, které žádný uživatel nezvolil |sysop |[[rev:12196|1.6+]] |-style="text-align:center" |{{hl3}} colspan="4"|'''{{visible anchor|1=Technické}}''' |-{{anchor|apihighlimits}} |apihighlimits |{{int|right-apihighlimits}} |bot, sysop |[[rev:27949|1.12+]] |-{{anchor|autoconfirmed}} |autoconfirmed |{{int|right-autoconfirmed}} – pro skupinu 'autoconfirmed' (automaticky potvrzeno), viz další tabulka dole pro více informací (poznámka: toto není nutné, pokud skupina již má právo <code>noratelimit</code>) |autoconfirmed, bot, sysop |[[rev:12207|1.6+]] |-{{anchor|bot}} |bot |{{int|right-bot}} – úpravy a zaznamenané akce jsou skryty před nedávnými změnami, volitelně je lze zobrazit |bot |[[rev:9367|1.5+]] |-{{anchor|ipblock-exempt}} |ipblock-exempt |{{int|right-ipblock-exempt}} |sysop |[[rev:18904|1.9+]] |-{{anchor|nominornewtalk}} |nominornewtalk |{{int|right-nominornewtalk}} – vyžaduje právo ''<code>minoredit</code>'' |bot |[[rev:17281|1.9+]] |-{{anchor|noratelimit}} |noratelimit |{{int|right-noratelimit}} – není ovlivněna [[Special:MyLanguage/Manual:$wgRateLimits|limity sazby]] (''před zavedením tohoto práva byla pro tento účel použita konfigurační proměnná {{wg|RateLimitsExcludedGroups}}'') |sysop, bureaucrat |[[rev:35908|1.13+]] |-{{anchor|override-export-depth}} |override-export-depth |{{int|right-override-export-depth}}<br /><small>S tímto právem můžete definovat hloubku propojených stránek na [[Special:Export]]. Jinak bude použita hodnota {{wg|ExportMaxLinkDepth}}, která je ve výchozím nastavení 0.</small> |— |1.15+ |-{{anchor|suppressredirect}} |suppressredirect |{{int|right-suppressredirect}} – vyžaduje právo ''<code>move</code>'' |bot, sysop |[[rev:27774|1.12+]] |} {{Note|1=Přestože všechna tato oprávnění řídí jednotlivé věci, někdy k provedení určitých akcí potřebujete více oprávnění. Například umožnit lidem upravovat, ale nečíst stránky, nedává smysl, protože k tomu, abyste mohli upravit stránku, musíte ji nejprve umět číst (Za předpokladu, že žádné stránky nejsou na seznamu povolených). Povolení nahrávání, ale ne úpravy, nedává smysl, protože k nahrání obrázku musíte implicitně vytvořit stránku popisu obrázku atd.}} <span id="Predefined_groups"></span> == Seznam skupin == Následující skupiny jsou k dispozici v nejnovější verzi MediaWiki. Pokud používáte starší verzi, nemusí být některé z nich implementovány. {|class="wikitable" |- !{{hl2}} | Skupina !{{hl2}} | Popis !{{hl2}} | Výchozí práva !{{hl2}} | Verze |- | * | Všichni uživatelé (včetně anonymních). |createaccount, createpage, createtalk, edit, editmyoptions, editmyprivateinfo, read, viewmyprivateinfo |[[rev:9367|1.5+]] |- |temp | Dočasné uživatelské účty ([[phab:T330816|T330816]]) | Podobné skupině <code>*</code> |1.41+ |- |user | Registrované účty. ''Nezahrnuje'' dočasné účty. |applychangetags, changetags, createpage, createtalk, edit, editcontentmodel, editmyusercss, editmyuserjs, editmyuserjson, editmywatchlist, minoredit, move, move-categorypages, move-rootuserpages, move-subpages, movefile, purge, read, reupload, reupload-shared, sendemail, upload, viewmywatchlist |1.13+ |- |autoconfirmed | Registrované účty přinejmenším stejně staré jako {{wg|AutoConfirmAge}} a které mají alespoň tolik úprav jako {{wg|AutoConfirmCount}}. |autoconfirmed, editsemiprotected |[[rev:12207|1.6+]] |- |bot | Účty s právem ''bot'' (určené pro automatické skripty). |autoconfirmed, autopatrol, apihighlimits, bot, editsemiprotected, nominornewtalk, suppressredirect |[[rev:9367|1.5+]] |- |sysop | Uživatelé, kteří ve výchozím nastavení mohou mazat a obnovovat stránky, blokovat a odblokovat uživatele atd. |apihighlimits, autoconfirmed, autopatrol, bigdelete, block, blockemail, browsearchive, createaccount, delete, deletedhistory, deletedtext, editinterface, editprotected, editsemiprotected, editsitejson, edituserjson, import, importupload, ipblock-exempt, managechangetags, markbotedits, mergehistory, move, move-categorypages, move-rootuserpages, move-subpages, movefile, noratelimit, patrol, protect, reupload, reupload-shared, rollback, suppressredirect, unblockself, undelete, unwatchedpages, upload |[[rev:9367|1.5+]] |- |interface-admin | Uživatelé, kteří mohou upravovat CSS/JS pro celý web. |editinterface, editsitecss, editsitejs, editsitejson, editusercss, edituserjs, edituserjson |1.32+ |- |bureaucrat | Uživatelé, kteří mohou standardně měnit práva ostatních uživatelů a mají tedy plný přístup k celé wiki. |noratelimit, renameuser, userrights |[[rev:9367|1.5+]] |- |suppress | |deletelogentry, deleterevision, hideuser, suppressionlog, suppressrevision, viewsuppressed |1.13+ |} <span id="Removing_predefined_groups"></span> === Odstranění předdefinovaných skupin === MediaWiki po instalaci obsahuje řadu předdefinovaných skupin. Většina z těchto skupin může být odstraněna zrušením nastavení klíčů pole, mezi nimi {{tmpl|0=<span class="mw-highlight">{{#tag:span|$wgGroupPermissions|class=nv}}[ {{#tag:span|'<nowiki/>$1'|class=s1}} ]</span>|NazevSkupiny}}. Podrobnosti najdete níže. <span id="Example"></span> ==== Příklad ==== Tento příklad zcela odstraní skupinu <code>bureaucrat</code>. Je nutné zajistit, aby všech šest těchto proměnných nebylo nastaveno pro každou skupinu, kterou si přejete odstranit ze seznamu na [[Special:ListGroupRights]]. K odstranění ze [[Special:UserRights]] však bude stačit pouze deaktivace <code>$wgGroupPermissions</code>. <syntaxhighlight lang="php" copy> unset( $wgGroupPermissions['bureaucrat'] ); unset( $wgRevokePermissions['bureaucrat'] ); unset( $wgAddGroups['bureaucrat'] ); unset( $wgRemoveGroups['bureaucrat'] ); unset( $wgGroupsAddToSelf['bureaucrat'] ); unset( $wgGroupsRemoveFromSelf['bureaucrat'] ); </syntaxhighlight> Tento kód nebude fungovat, pokud je nainstalováno jakékoli rozšíření, které upravuje výchozí práva pro skupinu <code>bureaucrat</code>, například {{ll|Extension:AntiSpoof}}. {{Tracked|T275334|open}} Obecněji řečeno, chcete-li zakázat skupinu uživatelů vytvořenou rozšířením, výše uvedený kód musí být spuštěn po registraci všech rozšíření. Dříve to bylo možné registrací funkce rozšíření v <code>LocalSettings.php</code>: <syntaxhighlight lang="php" copy> $wgExtensionFunctions[] = function() use ( &$wgGroupPermissions ) { unset( $wgGroupPermissions['oversight'] ); unset( $wgGroupPermissions['flow-bot'] ); }; </syntaxhighlight> Nicméně toto '''již nefunguje spolehlivě''' kvůli [[phab:T275334|T275334]]. {{Note|type=warn|1= '''Poznámka ke skupině s názvem "user"''' Pomocí výše uvedeného mechanismu můžete odstranit skupiny {{ltt|noconj=1|fmt=<code>$1</code>|sysop|bureaucrat|bot|interface-admin|suppress}}, které - pokud jsou použity - mohou být přiřazeny prostřednictvím obvyklého [[Special:MyLanguage/Help:User rights and groups|uživatelského systému oprávnění]]. V současné době však nelze odebrat skupinu <code>user</code> (uživatel). Tato skupina není přiřazena pomocí obvyklého systému oprávnění. Místo toho je každý přihlášený uživatel automaticky členem této skupiny. Toto je v MediaWiki pevně zakódováno a v současné době to nelze snadno změnit. }} <span id="Default_rights"></span> == Výchozí práva == Výchozí práva jsou definována v {{ll|Manual:MainConfigSchema.php|MainConfigSchema.php}}. * {{git file|project=mediawiki/core|branch=HEAD|file=includes/MainConfigSchema.php|text=Výchozí hodnoty v aktuální alfa verzi (HEAD, verze {{MW alpha branch number}})}} * {{git file|project=mediawiki/core|branch={{#invoke:Version|get|stable|git}}|file=includes/MainConfigSchema.php|text=Výchozí hodnoty v nejnovější stabilní verzi (větev {{#invoke:Version|get|stable|git}}, verze {{MW stable branch number}})}} * Další práva: Spuštěním {{phpi|PermissionManager::getAllRights()}} byste měli být schopni vypsat všechna oprávnění dostupná na vaší wiki. <span id="Adding_new_rights"></span> === Přidávání nových práv === ''Informace pro kodéry jsou pouze následující.'' Pokud přidáváte nové právo v jádru, například [[Special:MyLanguage/Manual:Special pages|ovládat novou speciální stránku]], ''musíte'' ho přidat do seznamu dostupných práv v {{ll|Manual:PermissionManager.php|PermissionManager.php}}, {{phpi|$coreRights}} ([https://gerrit.wikimedia.org/r/c/mediawiki/core/+/559622/9/includes/Permissions/PermissionManager.php příklad]). Pokud to {{ll|Manual:Developing extensions|děláte v rozšíření}}, musíte místo toho použít {{wg|AvailableRights}}, nebo nejlépe definovat právo v {{ll|Manual:$wgAvailableRights|extensions.json}}. Pravděpodobně také budete chtít přiřadit některé uživatelské skupině úpravy {{wg|GroupPermissions}} popsané výše. Pokud chcete, aby toto právo bylo přístupné externím aplikacím pomocí {{ll|Help:OAuth|OAuth}} nebo [[Special:MyLanguage/Manual:Bot passwords|bot hesla]], budete je muset přidat do grantu úpravou {{wg|GrantPermissions}}. <syntaxhighlight lang="php" copy> // vytvoření pravomocí členů projektu $wgAvailableRights[] = 'projectmember-powers'; // přidat pravomoci člena projektu do skupiny člena projektu $wgGroupPermissions['projectmember']['projectmember-powers'] = true; // přidejte do 'základního' grantu pravomoci členů projektu, abychom mohli využít své pravomoci členů projektu nad požadavkem API $wgGrantPermissions['basic']['projectmember-powers'] = true; </syntaxhighlight> <span class="mw-translate-fuzzy">Musíte také přidat zprávy rozhraní <code>right-[name]</code> a <code>action-[name]</code> do /languages/i18n/en.json (s dokumentací v qqq.json).</span> Správné zprávy <code>right-*</code> lze vidět na [[Special:ListGroupRights]] a zprávy akce <code>action-*</code> se používají ve větě jako "Nemáte oprávnění k ..." (you do not have permission to). <span id="See_also"></span> == Související odkazy == * [[Special:ListGroupRights]] – odkazy na tuto stránku nápovědy a mohou obsahovat dosud zdokumentovaná práva * {{ll|Help:User rights and groups}} – stránka nápovědy popisující použití rozhraní Special:Userrights (pro byrokraty) * {{ll|Manual:Setting user groups in MediaWiki}} – informace o správě a přiřazení skupin uživatelů. * {{ll|Manual:$wgNamespaceProtection}} * {{ll|Manual:$wgAutopromote}} * {{ltt|noconj=1|fmt={{ll|Manual:$wg$1}}|AddGroups|RemoveGroups}} * {{ll|Manual:Preventing access}} – příklady * {{ll|Manual:Establishing a hierarchy of bureaucrats}} * {{ll|Category:User rights extensions}} – mnoho rozšíření týkajících se uživatelských práv {{Log events}} [[Category:Special Pages{{#translation:}}]] [[Category:Permission{{#translation:}}]] hms2mh2d2v3omvf8a1ccyfykgd2txem Translations:Template:Main page/Page display title/ar 1198 914220 8364492 8333770 2026-05-03T16:39:39Z ~2026-26760-44 18367088 8364492 wikitext text/x-wiki قالب:رئيسي تثبيت اللغه العربيه 9w5w5iqr6j5ztzteng8sycmweboogdt 8364505 8364492 2026-05-03T16:47:02Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-26760-44|~2026-26760-44]] ([[User talk:~2026-26760-44|talk]]) to last version by Jianhui67 8315279 wikitext text/x-wiki قالب:رئيسي pz2lkadcqxp12ql7c4ohrowi28lola3 Template:Main page/ar 10 914221 8364494 8363312 2026-05-03T16:41:22Z ~2026-26760-44 18367088 8364494 wikitext text/x-wiki <span style="opacity:0;position:absolute;">{{DISPLAYTITLE:{{FULLPAGENAME}}}}</span>{{#switch: | = <templatestyles src="Template:Main_page/styles.css" /> <div id="lang_dir" class="mw-content-{{dir|{{{1|{{PAGELANGUAGE}}}}}}}" dir="{{dir|{{{1|{{PAGELANGUAGE}}}}}}}"> <span id="MediaWiki_is_a_collaboration_and_documentation_platform_brought_to_you_by_a_vibrant_community."></span> ==ميدياويكي هي منصة تعاون وتوثيق يقدّمها لكم مجتمع حيوي== <div aria-hidden="true" role="presentation">[[File:Wikimedia Hackathon 2026 group photo 01.jpg|{{dir|{{{1|{{PAGELANGUAGE}}}}}|left|right}}|thumb|320px|<span class="mw-translate-fuzzy">صورة جماعية للمشاركين في {{ll|Wikimedia Hackathon 2026}}</span>]]</div> يستخدم برمجية ميدياويكي [[Special:MyLanguage/Sites using MediaWiki|عشرات آلاف المواقع على الشبكة]] كذلك [[Special:MyLanguage/MediaWiki testimonials|آلاف الشركات والمؤسسات]]. كما أنه يستخدم في تشغيل ويكيبيديا وهذا الموقع أيضًال شارع خولان مصنع التضامن لانتاج البلك تساعدك "ميدياويكي" في جمع وتنظيم المعرفة وتوفيرها للناس. إنه برنامج قوي [[Special:MyLanguage/Localisation|متعدد اللغات]] و[[w:FLOSS|مجاني ومفتوح]] ويمكن إضافة إضافات له وتخصيصه وجدير بالثقة ودون مقابل. [[Special:MyLanguage/Manual:What is MediaWiki?|تعرف على المزيد]] وما إذا كان [[Special:MyLanguage/Manual:Deciding whether to use a wiki as your website type|ميدياويكي هو الأفضل لك]]. <div id="audiences" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon settings.svg|20px|middle|link=]]</span><span>نصب برمجيات ميدياويكي وشغلها</span></h3> <div id="mainpage-admins" title="إداريو النظام" class="items"> * '''[[Special:MyLanguage/Download|نزل]]''' و[[Special:MyLanguage/Manual:Installing MediaWiki|نصب]] و[[Special:MyLanguage/Manual:System administration|أعد]] ميدياويكي * أضف وظائف عن طريق تنصيب [[Special:MyLanguage/Manual:Extensions|امتدادات]] * هل تواجهك مشاكل؟ طالع [[Special:MyLanguage/Manual:Common errors and symptoms|الأخطاء والأعراض]] وكذلك [[Special:MyLanguage/Manual:FAQ|الأسئلة المتكررة]] * ليس لديك خادوم خاص بك؟ طالع [[Special:MyLanguage/Hosting services|خدمات الاستضافة]] * {{ll|Professional development and consulting|2=أحصل على تطوير مهني واستشارات مهنية}} * انضم إلى مجموعة المستخدمين الخاصة [[Special:MyLanguage/MediaWiki Stakeholders' Group|بذوي الشأن في ميدياويكي]] </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon edit.svg|20px|middle|link=]]</span><span>عدل ميدياويكي واستخدمها</span></h3> <div id="mainpage-users" title="المستخدمون" class="items"> * {{ll|Help:Navigation|2=تعرف على كيفية الإبحار}} * '''{{ll|Help:Editing_pages|2=تعرف على كيفية تعديل صفحة}}''' * {{ll|Help:Contents|2=تعرف على المزيد عن القراءة والتعديل والتخصيص}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon markup.svg|20px|middle|link=]]</span><span>صمم الكود البرمجي ووسع مجال عمله</span></h3> <div id="mainpage-devs" title="المطورون" class="items"> * طالع [[Special:MyLanguage/Developer hub|توثيق التطوير البرمجي]] لبرمجيات ميدياويكي * زر [https://developer.wikimedia.org البوابة الإلكترونية لمطوري ويكيميديا] </div> </div> </div> <div id="misc-news" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon helpNotice.svg|20px|middle|link=]]</span><span>أحصل على المساعدة وشارك</span></h3> <div id=mainpage-help-contribute" title="الدعم والمساهمة" class="items"> * لا يمكنك إيجاد إجابة على مشكلة تتعلق بميدياويكي؟ اطرح سؤالك على [[Project:Support desk|مكتب الدعم]]! * [[Special:MyLanguage/How to contribute|شارك في الأمر]] مترجما أو مصمما أو كاتب مستندات توثيق أو مختبر أو سفير تقنية أو مطور برمجيات. * {{ll|How to report a bug|2=أبلغ عن سلوكيات البرمجيات الخاطئة أو قدم اقتراح للمستقبل}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon feedback.svg|20px|middle|link=]]</span><span>الأخبار</span></h3> <div id="mainpage-news" title="الأخبار" class="items"> <div style="margin: auto; vertical-align:top; text-align:{{dir|{{{1|{{PAGELANGUAGE}}}}}|right|left}}"> <div class="mainpage_boxcontents_small"> {{#ifeq:{{translatable}}|Template:Main page |{{#if:{{{1|{{PAGELANGUAGE}}}}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{{1|{{PAGELANGUAGE}}}}} |{{MediaWiki News/{{{1|{{PAGELANGUAGE}}}}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} |{{#if:{{int:lang}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{int:lang}} |{{MediaWiki News/{{int:lang}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} }} </div> [[Special:MyLanguage/News|أخبار قديمة]] </div> </div> </div> </div> </div> | #default= {{#if: {{#invoke:String|match|s= {{{1|{{int:lang}}}}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang=zh|1=zh}}<!--use /zh--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang={{{1|{{int:lang}}}}}|1={{{1|{{int:lang}}}}}}} }}<!-- -->{{#ifeq:{{NAMESPACE}}||{{languages|Template:Main page}}}} }} __NOEDITSECTION__ __NOTOC__<noinclude>[[Category:Main page templates{{#translation:}}|*]]</noinclude><languages /><noinclude> </noinclude> kwklr5lvmptw2sjwr6sbhq4zgeea2if 8364496 8364494 2026-05-03T16:42:07Z ~2026-26760-44 18367088 8364496 wikitext text/x-wiki <span style="opacity:0;position:absolute;">{{DISPLAYTITLE:{{FULLPAGENAME}}}}</span>{{#switch: | = <templatestyles src="Template:Main_page/styles.css" /> <div id="lang_dir" class="mw-content-{{dir|{{{1|{{PAGELANGUAGE}}}}}}}" dir="{{dir|{{{1|{{PAGELANGUAGE}}}}}}}"> <span id="MediaWiki_is_a_collaboration_and_documentation_platform_brought_to_you_by_a_vibrant_community."></span> ==ميدياويكي هي منصة تعاون وتوثيق يقدّمها لكم مجتمع حيوي== <div aria-hidden="true" role="presentation">[[File:Wikimedia Hackathon 2026 group photo 01.jpg|{{dir|{{{1|{{PAGELANGUAGE}}}}}|left|right}}|thumb|320px|<span class="mw-translate-fuzzy">صورة جماعية للمشاركين في {{ll|Wikimedia Hackathon 2026}}</span>]]</div> يستخدم برمجية ميدياويكي [[Special:MyLanguage/Sites using MediaWiki|عشرات آلاف المواقع على الشبكة]] كذلك [[Special:MyLanguage/MediaWiki testimonials|آلاف الشركات والمؤسسات]]. كما أنه يستخدم في تشغيل ويكيبيديا وهذا الموقع أيضًال شارع خولان مصنع التضامن لانتاج البلك تساعدك "ميدياويكي" في جمع وتنظيم المعرفة وتوفيرها للناس. إنه برنامج قوي [[Special:MyLanguage/Localisation|متعدد اللغات]] و[[w:FLOSS|مجاني ومفتوح]] ويمكن إضافة إضافات له وتخصيصه وجدير بالثقة ودون مقابل. [[Special:MyLanguage/Manual:What is MediaWiki?|تعرف على المزيد]] وما إذا كان [[Special:MyLanguage/Manual:Deciding whether to use a wiki as your website type|ميدياويكي هو الأفضل لك]]. <div id="audiences" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon settings.svg|20px|middle|link=]]</span><span>نصب برمجيات ميدياويكي وشغلها</span></h3> <div id="mainpage-admins" title="إداريو النظام" class="items"> * '''[[Special:MyLanguage/Download|نزل]]''' و[[Special:MyLanguage/Manual:Installing MediaWiki|نصب]] و[[Special:MyLanguage/Manual:System administration|أعد]] ميدياويكي اللغه العربيه * أضف وظائف عن طريق تنصيب [[Special:MyLanguage/Manual:Extensions|امتدادات]] * هل تواجهك مشاكل؟ طالع [[Special:MyLanguage/Manual:Common errors and symptoms|الأخطاء والأعراض]] وكذلك [[Special:MyLanguage/Manual:FAQ|الأسئلة المتكررة]] * ليس لديك خادوم خاص بك؟ طالع [[Special:MyLanguage/Hosting services|خدمات الاستضافة]] * {{ll|Professional development and consulting|2=أحصل على تطوير مهني واستشارات مهنية}} * انضم إلى مجموعة المستخدمين الخاصة [[Special:MyLanguage/MediaWiki Stakeholders' Group|بذوي الشأن في ميدياويكي]] </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon edit.svg|20px|middle|link=]]</span><span>عدل ميدياويكي واستخدمها</span></h3> <div id="mainpage-users" title="المستخدمون" class="items"> * {{ll|Help:Navigation|2=تعرف على كيفية الإبحار}} * '''{{ll|Help:Editing_pages|2=تعرف على كيفية تعديل صفحة}}''' * {{ll|Help:Contents|2=تعرف على المزيد عن القراءة والتعديل والتخصيص}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon markup.svg|20px|middle|link=]]</span><span>صمم الكود البرمجي ووسع مجال عمله</span></h3> <div id="mainpage-devs" title="المطورون" class="items"> * طالع [[Special:MyLanguage/Developer hub|توثيق التطوير البرمجي]] لبرمجيات ميدياويكي * زر [https://developer.wikimedia.org البوابة الإلكترونية لمطوري ويكيميديا] </div> </div> </div> <div id="misc-news" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon helpNotice.svg|20px|middle|link=]]</span><span>أحصل على المساعدة وشارك</span></h3> <div id=mainpage-help-contribute" title="الدعم والمساهمة" class="items"> * لا يمكنك إيجاد إجابة على مشكلة تتعلق بميدياويكي؟ اطرح سؤالك على [[Project:Support desk|مكتب الدعم]]! * [[Special:MyLanguage/How to contribute|شارك في الأمر]] مترجما أو مصمما أو كاتب مستندات توثيق أو مختبر أو سفير تقنية أو مطور برمجيات. * {{ll|How to report a bug|2=أبلغ عن سلوكيات البرمجيات الخاطئة أو قدم اقتراح للمستقبل}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon feedback.svg|20px|middle|link=]]</span><span>الأخبار</span></h3> <div id="mainpage-news" title="الأخبار" class="items"> <div style="margin: auto; vertical-align:top; text-align:{{dir|{{{1|{{PAGELANGUAGE}}}}}|right|left}}"> <div class="mainpage_boxcontents_small"> {{#ifeq:{{translatable}}|Template:Main page |{{#if:{{{1|{{PAGELANGUAGE}}}}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{{1|{{PAGELANGUAGE}}}}} |{{MediaWiki News/{{{1|{{PAGELANGUAGE}}}}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} |{{#if:{{int:lang}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{int:lang}} |{{MediaWiki News/{{int:lang}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} }} </div> [[Special:MyLanguage/News|أخبار قديمة]] </div> </div> </div> </div> </div> | #default= {{#if: {{#invoke:String|match|s= {{{1|{{int:lang}}}}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang=zh|1=zh}}<!--use /zh--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang={{{1|{{int:lang}}}}}|1={{{1|{{int:lang}}}}}}} }}<!-- -->{{#ifeq:{{NAMESPACE}}||{{languages|Template:Main page}}}} }} __NOEDITSECTION__ __NOTOC__<noinclude>[[Category:Main page templates{{#translation:}}|*]]</noinclude><languages /><noinclude> </noinclude> d2hvnjfn5d7vstghvb2zxtqljmy2ft7 8364498 8364496 2026-05-03T16:43:31Z ~2026-26760-44 18367088 8364498 wikitext text/x-wiki <span style="opacity:0;position:absolute;">{{DISPLAYTITLE:{{FULLPAGENAME}}}}</span>{{#switch: | = <templatestyles src="Template:Main_page/styles.css" /> <div id="lang_dir" class="mw-content-{{dir|{{{1|{{PAGELANGUAGE}}}}}}}" dir="{{dir|{{{1|{{PAGELANGUAGE}}}}}}}"> <span id="MediaWiki_is_a_collaboration_and_documentation_platform_brought_to_you_by_a_vibrant_community."></span> ==ميدياويكي هي منصة تعاون وتوثيق يقدّمها لكم مجتمع حيوي== <div aria-hidden="true" role="presentation">[[File:Wikimedia Hackathon 2026 group photo 01.jpg|{{dir|{{{1|{{PAGELANGUAGE}}}}}|left|right}}|thumb|320px|<span class="mw-translate-fuzzy">صورة جماعية للمشاركين في {{ll|Wikimedia Hackathon 2026}}</span>]]</div> يستخدم برمجية ميدياويكي [[Special:MyLanguage/Sites using MediaWiki|عشرات آلاف المواقع على الشبكة]] كذلك [[Special:MyLanguage/MediaWiki testimonials|آلاف الشركات والمؤسسات]]. كما أنه يستخدم في تشغيل ويكيبيديا وهذا الموقع أيضًال شارع خولان مصنع التضامن لانتاج البلك تساعدك "ميدياويكي" في جمع وتنظيم المعرفة وتوفيرها للناس. إنه برنامج قوي [[Special:MyLanguage/Localisation|متعدد اللغات]] و[[w:FLOSS|مجاني ومفتوح]] ويمكن إضافة إضافات له وتخصيصه وجدير بالثقة ودون مقابل. [[Special:MyLanguage/Manual:What is MediaWiki?|تعرف على المزيد]] وما إذا كان [[Special:MyLanguage/Manual:Deciding whether to use a wiki as your website type|ميدياويكي هو الأفضل لك]]. <div id="audiences" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon settings.svg|20px|middle|link=]]</span><span>نصب برمجيات ميدياويكي وشغلها</span></h3> <div id="mainpage-admins" title="إداريو النظام" class="items"> * '''[[Special:MyLanguage/Download|نزل]]''' و[[Special:MyLanguage/Manual:Installing MediaWiki|نصب]] و[[Special:MyLanguage/Manual:System administration|أعد]] ميدياويكي اللغه العربيه * أضف وظائف عن طريق تنصيب [[Special:MyLanguage/Manual:Extensions|امتدادات]] * هل تواجهك مشاكل؟ طالع [[Special:MyLanguage/Manual:Common errors and symptoms|الأخطاء والأعراض]] وكذلك [[Special:MyLanguage/Manual:FAQ|الأسئلة المتكررة]] * ليس لديك خادوم خاص بك؟ طالع [[Special:MyLanguage/Hosting services|خدمات الاستضافة]] * {{ll|Professional development and consulting|2=أحصل على تطوير مهني واستشارات مهنية}} * انضم إلى مجموعة المستخدمين الخاصة [[Special:MyLanguage/MediaWiki Stakeholders' Group|بذوي الشأن في ميدياويكي]] </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon edit.svg|20px|middle|link=]]</span><span>عدل ميدياويكي واستخدمها</span></h3> <div id="mainpage-users" title="المستخدمون" class="items"> * {{ll|Help:Navigation|2=تعرف على كيفية الإبحار}} * '''{{ll|Help:Editing_pages|2=تعرف على كيفية تعديل صفحة}}''' * {{ll|Help:Contents|2=تعرف على المزيد عن القراءة والتعديل والتخصيص}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon markup.svg|20px|middle|link=]]</span><span>صمم الكود البرمجي ووسع مجال عمله</span></h3> <div id="mainpage-devs" title="المطورون" class="items"> * طالع [[Special:MyLanguage/Developer hub|توثيق التطوير البرمجي]] لبرمجيات ميدياويكي * زر [https://developer.wikimedia.org البوابة الإلكترونية لمطوري ويكيميديا] </div> </div> </div> <div id="misc-news" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon helpNotice.svg|20px|middle|link=]]</span><span>أحصل على المساعدة وشارك</span></h3> <div id=mainpage-help-contribute" title="الدعم والمساهمة" class="items"> * لا يمكنك إيجاد إجابة على مشكلة تتعلق بميدياويكي؟ اطرح سؤالك على [[Project:Support desk|مكتب الدعم]]!اللغه العربيه اليمن * [[Special:MyLanguage/How to contribute|شارك في الأمر]] مترجما أو مصمما أو كاتب مستندات توثيق أو مختبر أو سفير تقنية أو مطور برمجيات. * {{ll|How to report a bug|2=أبلغ عن سلوكيات البرمجيات الخاطئة أو قدم اقتراح للمستقبل}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon feedback.svg|20px|middle|link=]]</span><span>الأخبار</span></h3> <div id="mainpage-news" title="الأخبار" class="items"> <div style="margin: auto; vertical-align:top; text-align:{{dir|{{{1|{{PAGELANGUAGE}}}}}|right|left}}"> <div class="mainpage_boxcontents_small"> {{#ifeq:{{translatable}}|Template:Main page |{{#if:{{{1|{{PAGELANGUAGE}}}}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{{1|{{PAGELANGUAGE}}}}} |{{MediaWiki News/{{{1|{{PAGELANGUAGE}}}}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} |{{#if:{{int:lang}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{int:lang}} |{{MediaWiki News/{{int:lang}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} }} </div> [[Special:MyLanguage/News|أخبار قديمة]] </div> </div> </div> </div> </div> | #default= {{#if: {{#invoke:String|match|s= {{{1|{{int:lang}}}}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang=zh|1=zh}}<!--use /zh--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang={{{1|{{int:lang}}}}}|1={{{1|{{int:lang}}}}}}} }}<!-- -->{{#ifeq:{{NAMESPACE}}||{{languages|Template:Main page}}}} }} __NOEDITSECTION__ __NOTOC__<noinclude>[[Category:Main page templates{{#translation:}}|*]]</noinclude><languages /><noinclude> </noinclude> fh49o1h8dzjuewmwv6twl43udzop61k 8364500 8364498 2026-05-03T16:43:39Z ~2026-26760-44 18367088 8364500 wikitext text/x-wiki <span style="opacity:0;position:absolute;">{{DISPLAYTITLE:{{FULLPAGENAME}}}}</span>{{#switch: | = <templatestyles src="Template:Main_page/styles.css" /> <div id="lang_dir" class="mw-content-{{dir|{{{1|{{PAGELANGUAGE}}}}}}}" dir="{{dir|{{{1|{{PAGELANGUAGE}}}}}}}"> <span id="MediaWiki_is_a_collaboration_and_documentation_platform_brought_to_you_by_a_vibrant_community."></span> ==ميدياويكي هي منصة تعاون وتوثيق يقدّمها لكم مجتمع حيوي== <div aria-hidden="true" role="presentation">[[File:Wikimedia Hackathon 2026 group photo 01.jpg|{{dir|{{{1|{{PAGELANGUAGE}}}}}|left|right}}|thumb|320px|<span class="mw-translate-fuzzy">صورة جماعية للمشاركين في {{ll|Wikimedia Hackathon 2026}}</span>]]</div> يستخدم برمجية ميدياويكي [[Special:MyLanguage/Sites using MediaWiki|عشرات آلاف المواقع على الشبكة]] كذلك [[Special:MyLanguage/MediaWiki testimonials|آلاف الشركات والمؤسسات]]. كما أنه يستخدم في تشغيل ويكيبيديا وهذا الموقع أيضًال شارع خولان مصنع التضامن لانتاج البلك تساعدك "ميدياويكي" في جمع وتنظيم المعرفة وتوفيرها للناس. إنه برنامج قوي [[Special:MyLanguage/Localisation|متعدد اللغات]] و[[w:FLOSS|مجاني ومفتوح]] ويمكن إضافة إضافات له وتخصيصه وجدير بالثقة ودون مقابل. [[Special:MyLanguage/Manual:What is MediaWiki?|تعرف على المزيد]] وما إذا كان [[Special:MyLanguage/Manual:Deciding whether to use a wiki as your website type|ميدياويكي هو الأفضل لك]]. <div id="audiences" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon settings.svg|20px|middle|link=]]</span><span>نصب برمجيات ميدياويكي وشغلها</span></h3> <div id="mainpage-admins" title="إداريو النظام" class="items"> * '''[[Special:MyLanguage/Download|نزل]]''' و[[Special:MyLanguage/Manual:Installing MediaWiki|نصب]] و[[Special:MyLanguage/Manual:System administration|أعد]] ميدياويكي اللغه العربيه * أضف وظائف عن طريق تنصيب [[Special:MyLanguage/Manual:Extensions|امتدادات]] * هل تواجهك مشاكل؟ طالع [[Special:MyLanguage/Manual:Common errors and symptoms|الأخطاء والأعراض]] وكذلك [[Special:MyLanguage/Manual:FAQ|الأسئلة المتكررة]] * ليس لديك خادوم خاص بك؟ طالع [[Special:MyLanguage/Hosting services|خدمات الاستضافة]] * {{ll|Professional development and consulting|2=أحصل على تطوير مهني واستشارات مهنية}} * انضم إلى مجموعة المستخدمين الخاصة [[Special:MyLanguage/MediaWiki Stakeholders' Group|بذوي الشأن في ميدياويكي]] </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon edit.svg|20px|middle|link=]]</span><span>عدل ميدياويكي واستخدمها</span></h3> <div id="mainpage-users" title="المستخدمون" class="items"> * {{ll|Help:Navigation|2=تعرف على كيفية الإبحار}} * '''{{ll|Help:Editing_pages|2=تعرف على كيفية تعديل صفحة}}''' * {{ll|Help:Contents|2=تعرف على المزيد عن القراءة والتعديل والتخصيص}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon markup.svg|20px|middle|link=]]</span><span>صمم الكود البرمجي ووسع مجال عمله</span></h3> <div id="mainpage-devs" title="المطورون" class="items"> * طالع [[Special:MyLanguage/Developer hub|توثيق التطوير البرمجي]] لبرمجيات ميدياويكي * زر [https://developer.wikimedia.org البوابة الإلكترونية لمطوري ويكيميديا] </div> </div> </div> <div id="misc-news" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon helpNotice.svg|20px|middle|link=]]</span><span>أحصل على المساعدة وشارك</span></h3> <div id=mainpage-help-contribute" title="الدعم والمساهمة" class="items"> * لا يمكنك إيجاد إجابة على مشكلة تتعلق بميدياويكي؟ اطرح سؤالك على [[Project:Support desk|مكتب الدعم]]!اللغه العربيه اليمن * [[Special:MyLanguage/How to contribute|شارك في الأمر]] مترجما أو مصمما أو كاتب مستندات توثيق أو مختبر أو * {{ll|How to report a bug|2=أبلغ عن سلوكيات البرمجيات الخاطئة أو قدم اقتراح للمستقبل}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon feedback.svg|20px|middle|link=]]</span><span>الأخبار</span></h3> <div id="mainpage-news" title="الأخبار" class="items"> <div style="margin: auto; vertical-align:top; text-align:{{dir|{{{1|{{PAGELANGUAGE}}}}}|right|left}}"> <div class="mainpage_boxcontents_small"> {{#ifeq:{{translatable}}|Template:Main page |{{#if:{{{1|{{PAGELANGUAGE}}}}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{{1|{{PAGELANGUAGE}}}}} |{{MediaWiki News/{{{1|{{PAGELANGUAGE}}}}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} |{{#if:{{int:lang}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{int:lang}} |{{MediaWiki News/{{int:lang}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} }} </div> [[Special:MyLanguage/News|أخبار قديمة]] </div> </div> </div> </div> </div> | #default= {{#if: {{#invoke:String|match|s= {{{1|{{int:lang}}}}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang=zh|1=zh}}<!--use /zh--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang={{{1|{{int:lang}}}}}|1={{{1|{{int:lang}}}}}}} }}<!-- -->{{#ifeq:{{NAMESPACE}}||{{languages|Template:Main page}}}} }} __NOEDITSECTION__ __NOTOC__<noinclude>[[Category:Main page templates{{#translation:}}|*]]</noinclude><languages /><noinclude> </noinclude> cxzayzb1h0vl6k67lpwn7d2yh91ubeg 8364502 8364500 2026-05-03T16:44:41Z ~2026-26760-44 18367088 8364502 wikitext text/x-wiki <span style="opacity:0;position:absolute;">{{DISPLAYTITLE:{{FULLPAGENAME}}}}</span>{{#switch: | = <templatestyles src="Template:Main_page/styles.css" /> <div id="lang_dir" class="mw-content-{{dir|{{{1|{{PAGELANGUAGE}}}}}}}" dir="{{dir|{{{1|{{PAGELANGUAGE}}}}}}}"> <span id="MediaWiki_is_a_collaboration_and_documentation_platform_brought_to_you_by_a_vibrant_community."></span> ==ميدياويكي هي منصة تعاون وتوثيق يقدّمها لكم مجتمع حيوي== <div aria-hidden="true" role="presentation">[[File:Wikimedia Hackathon 2026 group photo 01.jpg|{{dir|{{{1|{{PAGELANGUAGE}}}}}|left|right}}|thumb|320px|<span class="mw-translate-fuzzy">صورة جماعية للمشاركين في {{ll|Wikimedia Hackathon 2026}}</span>]]</div> يستخدم برمجية ميدياويكي [[Special:MyLanguage/Sites using MediaWiki|عشرات آلاف المواقع على الشبكة]] كذلك [[Special:MyLanguage/MediaWiki testimonials|آلاف الشركات والمؤسسات]]. كما أنه يستخدم في تشغيل ويكيبيديا وهذا الموقع أيضًال شارع خولان مصنع التضامن لانتاج البلك تساعدك "ميدياويكي" في جمع وتنظيم المعرفة وتوفيرها للناس. إنه برنامج قوي [[Special:MyLanguage/Localisation|متعدد اللغات]] و[[w:FLOSS|مجاني ومفتوح]] ويمكن إضافة إضافات له وتخصيصه وجدير بالثقة ودون مقابل. [[Special:MyLanguage/Manual:What is MediaWiki?|تعرف على المزيد]] وما إذا كان [[Special:MyLanguage/Manual:Deciding whether to use a wiki as your website type|ميدياويكي هو الأفضل لك]]. <div id="audiences" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon settings.svg|20px|middle|link=]]</span><span>نصب برمجيات ميدياويكي وشغلها</span></h3> <div id="mainpage-admins" title="إداريو النظام" class="items"> * '''[[Special:MyLanguage/Download|نزل]]''' و[[Special:MyLanguage/Manual:Installing MediaWiki|نصب]] و[[Special:MyLanguage/Manual:System administration|أعد]] ميدياويكي اللغه العربيه * أضف وظائف عن طريق تنصيب [[Special:MyLanguage/Manual:Extensions|امتدادات]] * هل تواجهك مشاكل؟ طالع [[Special:MyLanguage/Manual:Common errors and symptoms|الأخطاء والأعراض]] وكذلك [[Special:MyLanguage/Manual:FAQ|الأسئلة المتكررة]] * ليس لديك خادوم خاص بك؟ طالع [[Special:MyLanguage/Hosting services|خدمات الاستضافة]] * {{ll|Professional development and consulting|2=أحصل على تطوير مهني واستشارات مهنية}} * انضم إلى مجموعة المستخدمين الخاصة [[Special:MyLanguage/MediaWiki Stakeholders' Group|بذوي الشأن في ميدياويكي]] </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon edit.svg|20px|middle|link=]]</span><span>عدل ميدياويكي واستخدمها</span></h3> <div id="mainpage-users" title="المستخدمون" class="items"> * {{ll|Help:Navigation|2=تعرف على كيفية الإبحار}} * '''{{ll|Help:Editing_pages|2=تعرف على كيفية تعديل صفحة}}''' * {{ll|Help:Contents|2=تعرف على المزيد عن القراءة والتعديل والتخصيص}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon markup.svg|20px|middle|link=]]</span><span>صمم الكود البرمجي ووسع مجال عمله</span></h3> <div id="mainpage-devs" title="المطورون" class="items"> * طالع [[Special:MyLanguage/Developer hub|توثيق التطوير البرمجي]] لبرمجيات ميدياويكي * زر [https://developer.wikimedia.org البوابة الإلكترونية لمطوري ويكيميديا] </div> </div> </div> <div id="misc-news" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon helpNotice.svg|20px|middle|link=]]</span><span>أحصل على المساعدة تنزيل اللغه العربيه اليمن</span></h3> <div id=mainpage-help-contribute" title="الدعم والمساهمة" class="items"> * لا يمكنك إيجاد إجابة على مشكلة تتعلق بميدياويكي؟ اطرح سؤالك على [[Project:Support desk|مكتب الدعم]]!اللغه العربيه اليمن * [[Special:MyLanguage/How to contribute|شارك في الأمر]] مترجما أو مصمما أو كاتب مستندات توثيق أو مختبر أو * {{ll|How to report a bug|2=أبلغ عن سلوكيات البرمجيات الخاطئة أو قدم اقتراح للمستقبل}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon feedback.svg|20px|middle|link=]]</span><span>الأخبار</span></h3> <div id="mainpage-news" title="الأخبار" class="items"> <div style="margin: auto; vertical-align:top; text-align:{{dir|{{{1|{{PAGELANGUAGE}}}}}|right|left}}"> <div class="mainpage_boxcontents_small"> {{#ifeq:{{translatable}}|Template:Main page |{{#if:{{{1|{{PAGELANGUAGE}}}}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{{1|{{PAGELANGUAGE}}}}} |{{MediaWiki News/{{{1|{{PAGELANGUAGE}}}}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} |{{#if:{{int:lang}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{int:lang}} |{{MediaWiki News/{{int:lang}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} }} </div> [[Special:MyLanguage/News|أخبار قديمة]] </div> </div> </div> </div> </div> | #default= {{#if: {{#invoke:String|match|s= {{{1|{{int:lang}}}}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang=zh|1=zh}}<!--use /zh--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang={{{1|{{int:lang}}}}}|1={{{1|{{int:lang}}}}}}} }}<!-- -->{{#ifeq:{{NAMESPACE}}||{{languages|Template:Main page}}}} }} __NOEDITSECTION__ __NOTOC__<noinclude>[[Category:Main page templates{{#translation:}}|*]]</noinclude><languages /><noinclude> </noinclude> 74n9cloiic9wbxbti4oyoyhf1nr5cru 8364504 8364502 2026-05-03T16:45:09Z ~2026-26760-44 18367088 8364504 wikitext text/x-wiki <span style="opacity:0;position:absolute;">{{DISPLAYTITLE:{{FULLPAGENAME}}}}</span>{{#switch: | = <templatestyles src="Template:Main_page/styles.css" /> <div id="lang_dir" class="mw-content-{{dir|{{{1|{{PAGELANGUAGE}}}}}}}" dir="{{dir|{{{1|{{PAGELANGUAGE}}}}}}}"> <span id="MediaWiki_is_a_collaboration_and_documentation_platform_brought_to_you_by_a_vibrant_community."></span> ==ميدياويكي هي منصة تعاون وتوثيق يقدّمها لكم مجتمع حيوي== <div aria-hidden="true" role="presentation">[[File:Wikimedia Hackathon 2026 group photo 01.jpg|{{dir|{{{1|{{PAGELANGUAGE}}}}}|left|right}}|thumb|320px|<span class="mw-translate-fuzzy">صورة جماعية للمشاركين في {{ll|Wikimedia Hackathon 2026}}</span>]]</div> يستخدم برمجية ميدياويكي [[Special:MyLanguage/Sites using MediaWiki|عشرات آلاف المواقع على الشبكة]] كذلك [[Special:MyLanguage/MediaWiki testimonials|آلاف الشركات والمؤسسات]]. كما أنه يستخدم في تشغيل ويكيبيديا وهذا الموقع أيضًال شارع خولان مصنع التضامن لانتاج البلك تساعدك "ميدياويكي" في جمع وتنظيم المعرفة وتوفيرها للناس. إنه برنامج قوي [[Special:MyLanguage/Localisation|متعدد اللغات]] و[[w:FLOSS|مجاني ومفتوح]] ويمكن إضافة إضافات له وتخصيصه وجدير بالثقة ودون مقابل. [[Special:MyLanguage/Manual:What is MediaWiki?|تعرف على المزيد]] وما إذا كان [[Special:MyLanguage/Manual:Deciding whether to use a wiki as your website type|ميدياويكي هو الأفضل لك]]. <div id="audiences" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon settings.svg|20px|middle|link=]]</span><span>نصب برمجيات ميدياويكي وشغلها</span></h3> <div id="mainpage-admins" title="إداريو النظام" class="items"> * '''[[Special:MyLanguage/Download|نزل]]''' و[[Special:MyLanguage/Manual:Installing MediaWiki|نصب]] و[[Special:MyLanguage/Manual:System administration|أعد]] ميدياويكي اللغه العربيه اللغه العربيه * أضف وظائف عن طريق تنصيب [[Special:MyLanguage/Manual:Extensions|امتدادات]] * هل تواجهك مشاكل؟ طالع [[Special:MyLanguage/Manual:Common errors and symptoms|الأخطاء والأعراض]] وكذلك [[Special:MyLanguage/Manual:FAQ|الأسئلة المتكررة]] * ليس لديك خادوم خاص بك؟ طالع [[Special:MyLanguage/Hosting services|خدمات الاستضافة]] * {{ll|Professional development and consulting|2=أحصل على تطوير مهني واستشارات مهنية}} * انضم إلى مجموعة المستخدمين الخاصة [[Special:MyLanguage/MediaWiki Stakeholders' Group|بذوي الشأن في ميدياويكي]] </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon edit.svg|20px|middle|link=]]</span><span>عدل ميدياويكي واستخدمها</span></h3> <div id="mainpage-users" title="المستخدمون" class="items"> * {{ll|Help:Navigation|2=تعرف على كيفية الإبحار}} * '''{{ll|Help:Editing_pages|2=تعرف على كيفية تعديل صفحة}}''' * {{ll|Help:Contents|2=تعرف على المزيد عن القراءة والتعديل والتخصيص}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon markup.svg|20px|middle|link=]]</span><span>صمم الكود البرمجي ووسع مجال عمله</span></h3> <div id="mainpage-devs" title="المطورون" class="items"> * طالع [[Special:MyLanguage/Developer hub|توثيق التطوير البرمجي]] لبرمجيات ميدياويكي * زر [https://developer.wikimedia.org البوابة الإلكترونية لمطوري ويكيميديا] </div> </div> </div> <div id="misc-news" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon helpNotice.svg|20px|middle|link=]]</span><span>أحصل على المساعدة تنزيل اللغه العربيه اليمن</span></h3> <div id=mainpage-help-contribute" title="الدعم والمساهمة" class="items"> * لا يمكنك إيجاد إجابة على مشكلة تتعلق بميدياويكي؟ اطرح سؤالك على [[Project:Support desk|مكتب الدعم]]!اللغه العربيه اليمن * [[Special:MyLanguage/How to contribute|شارك في الأمر]] مترجما أو مصمما أو كاتب مستندات توثيق أو مختبر أو * {{ll|How to report a bug|2=أبلغ عن سلوكيات البرمجيات الخاطئة أو قدم اقتراح للمستقبل}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon feedback.svg|20px|middle|link=]]</span><span>الأخبار</span></h3> <div id="mainpage-news" title="الأخبار" class="items"> <div style="margin: auto; vertical-align:top; text-align:{{dir|{{{1|{{PAGELANGUAGE}}}}}|right|left}}"> <div class="mainpage_boxcontents_small"> {{#ifeq:{{translatable}}|Template:Main page |{{#if:{{{1|{{PAGELANGUAGE}}}}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{{1|{{PAGELANGUAGE}}}}} |{{MediaWiki News/{{{1|{{PAGELANGUAGE}}}}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} |{{#if:{{int:lang}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{int:lang}} |{{MediaWiki News/{{int:lang}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} }} </div> [[Special:MyLanguage/News|أخبار قديمة]] </div> </div> </div> </div> </div> | #default= {{#if: {{#invoke:String|match|s= {{{1|{{int:lang}}}}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang=zh|1=zh}}<!--use /zh--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang={{{1|{{int:lang}}}}}|1={{{1|{{int:lang}}}}}}} }}<!-- -->{{#ifeq:{{NAMESPACE}}||{{languages|Template:Main page}}}} }} __NOEDITSECTION__ __NOTOC__<noinclude>[[Category:Main page templates{{#translation:}}|*]]</noinclude><languages /><noinclude> </noinclude> 6v37k5o6hpuh8do0smg4g3r04mw799g 8364507 8364504 2026-05-03T16:47:17Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-26760-44|~2026-26760-44]] ([[User talk:~2026-26760-44|talk]]) to last version by Clump 8364507 wikitext text/x-wiki <span style="opacity:0;position:absolute;">{{DISPLAYTITLE:{{FULLPAGENAME}}}}</span>{{#switch: | = <templatestyles src="Template:Main_page/styles.css" /> <div id="lang_dir" class="mw-content-{{dir|{{{1|{{PAGELANGUAGE}}}}}}}" dir="{{dir|{{{1|{{PAGELANGUAGE}}}}}}}"> <span id="MediaWiki_is_a_collaboration_and_documentation_platform_brought_to_you_by_a_vibrant_community."></span> ==ميدياويكي هي منصة تعاون وتوثيق يقدّمها لكم مجتمع حيوي== <div aria-hidden="true" role="presentation">[[File:Wikimedia Hackathon 2026 group photo 01.jpg|{{dir|{{{1|{{PAGELANGUAGE}}}}}|left|right}}|thumb|320px|<span class="mw-translate-fuzzy">صورة جماعية للمشاركين في {{ll|Wikimedia Hackathon 2026}}</span>]]</div> يستخدم برمجية ميدياويكي [[Special:MyLanguage/Sites using MediaWiki|عشرات آلاف المواقع على الشبكة]] كذلك [[Special:MyLanguage/MediaWiki testimonials|آلاف الشركات والمؤسسات]]. كما أنه يستخدم في تشغيل ويكيبيديا وهذا الموقع أيضًا. تساعدك "ميدياويكي" في جمع وتنظيم المعرفة وتوفيرها للناس. إنه برنامج قوي [[Special:MyLanguage/Localisation|متعدد اللغات]] و[[w:FLOSS|مجاني ومفتوح]] ويمكن إضافة إضافات له وتخصيصه وجدير بالثقة ودون مقابل. [[Special:MyLanguage/Manual:What is MediaWiki?|تعرف على المزيد]] وما إذا كان [[Special:MyLanguage/Manual:Deciding whether to use a wiki as your website type|ميدياويكي هو الأفضل لك]]. <div id="audiences" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon settings.svg|20px|middle|link=]]</span><span>نصب برمجيات ميدياويكي وشغلها</span></h3> <div id="mainpage-admins" title="إداريو النظام" class="items"> * '''[[Special:MyLanguage/Download|نزل]]''' و[[Special:MyLanguage/Manual:Installing MediaWiki|نصب]] و[[Special:MyLanguage/Manual:System administration|أعد]] ميدياويكي اللغه العربيه اللغه العربيه * أضف وظائف عن طريق تنصيب [[Special:MyLanguage/Manual:Extensions|امتدادات]] * هل تواجهك مشاكل؟ طالع [[Special:MyLanguage/Manual:Common errors and symptoms|الأخطاء والأعراض]] وكذلك [[Special:MyLanguage/Manual:FAQ|الأسئلة المتكررة]] * ليس لديك خادوم خاص بك؟ طالع [[Special:MyLanguage/Hosting services|خدمات الاستضافة]] * {{ll|Professional development and consulting|2=أحصل على تطوير مهني واستشارات مهنية}} * انضم إلى مجموعة المستخدمين الخاصة [[Special:MyLanguage/MediaWiki Stakeholders' Group|بذوي الشأن في ميدياويكي]] </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon edit.svg|20px|middle|link=]]</span><span>عدل ميدياويكي واستخدمها</span></h3> <div id="mainpage-users" title="المستخدمون" class="items"> * {{ll|Help:Navigation|2=تعرف على كيفية الإبحار}} * '''{{ll|Help:Editing_pages|2=تعرف على كيفية تعديل صفحة}}''' * {{ll|Help:Contents|2=تعرف على المزيد عن القراءة والتعديل والتخصيص}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon markup.svg|20px|middle|link=]]</span><span>صمم الكود البرمجي ووسع مجال عمله</span></h3> <div id="mainpage-devs" title="المطورون" class="items"> * طالع [[Special:MyLanguage/Developer hub|توثيق التطوير البرمجي]] لبرمجيات ميدياويكي * زر [https://developer.wikimedia.org البوابة الإلكترونية لمطوري ويكيميديا] </div> </div> </div> <div id="misc-news" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon helpNotice.svg|20px|middle|link=]]</span><span>أحصل على المساعدة تنزيل اللغه العربيه اليمن</span></h3> <div id=mainpage-help-contribute" title="الدعم والمساهمة" class="items"> * لا يمكنك إيجاد إجابة على مشكلة تتعلق بميدياويكي؟ اطرح سؤالك على [[Project:Support desk|مكتب الدعم]]!اللغه العربيه اليمن * [[Special:MyLanguage/How to contribute|شارك في الأمر]] مترجما أو مصمما أو كاتب مستندات توثيق أو مختبر أو * {{ll|How to report a bug|2=أبلغ عن سلوكيات البرمجيات الخاطئة أو قدم اقتراح للمستقبل}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon feedback.svg|20px|middle|link=]]</span><span>الأخبار</span></h3> <div id="mainpage-news" title="الأخبار" class="items"> <div style="margin: auto; vertical-align:top; text-align:{{dir|{{{1|{{PAGELANGUAGE}}}}}|right|left}}"> <div class="mainpage_boxcontents_small"> {{#ifeq:{{translatable}}|Template:Main page |{{#if:{{{1|{{PAGELANGUAGE}}}}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{{1|{{PAGELANGUAGE}}}}} |{{MediaWiki News/{{{1|{{PAGELANGUAGE}}}}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} |{{#if:{{int:lang}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{int:lang}} |{{MediaWiki News/{{int:lang}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} }} </div> [[Special:MyLanguage/News|أخبار قديمة]] </div> </div> </div> </div> </div> | #default= {{#if: {{#invoke:String|match|s= {{{1|{{int:lang}}}}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang=zh|1=zh}}<!--use /zh--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang={{{1|{{int:lang}}}}}|1={{{1|{{int:lang}}}}}}} }}<!-- -->{{#ifeq:{{NAMESPACE}}||{{languages|Template:Main page}}}} }} __NOEDITSECTION__ __NOTOC__<noinclude>[[Category:Main page templates{{#translation:}}|*]]</noinclude><languages /><noinclude> </noinclude> npep0xe23p9uljhhrdifqrmtc3ym8eu 8364510 8364507 2026-05-03T16:47:21Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-26760-44|~2026-26760-44]] ([[User talk:~2026-26760-44|talk]]) to last version by Clump 8364510 wikitext text/x-wiki <span style="opacity:0;position:absolute;">{{DISPLAYTITLE:{{FULLPAGENAME}}}}</span>{{#switch: | = <templatestyles src="Template:Main_page/styles.css" /> <div id="lang_dir" class="mw-content-{{dir|{{{1|{{PAGELANGUAGE}}}}}}}" dir="{{dir|{{{1|{{PAGELANGUAGE}}}}}}}"> <span id="MediaWiki_is_a_collaboration_and_documentation_platform_brought_to_you_by_a_vibrant_community."></span> ==ميدياويكي هي منصة تعاون وتوثيق يقدّمها لكم مجتمع حيوي== <div aria-hidden="true" role="presentation">[[File:Wikimedia Hackathon 2026 group photo 01.jpg|{{dir|{{{1|{{PAGELANGUAGE}}}}}|left|right}}|thumb|320px|<span class="mw-translate-fuzzy">صورة جماعية للمشاركين في {{ll|Wikimedia Hackathon 2026}}</span>]]</div> يستخدم برمجية ميدياويكي [[Special:MyLanguage/Sites using MediaWiki|عشرات آلاف المواقع على الشبكة]] كذلك [[Special:MyLanguage/MediaWiki testimonials|آلاف الشركات والمؤسسات]]. كما أنه يستخدم في تشغيل ويكيبيديا وهذا الموقع أيضًا. تساعدك "ميدياويكي" في جمع وتنظيم المعرفة وتوفيرها للناس. إنه برنامج قوي [[Special:MyLanguage/Localisation|متعدد اللغات]] و[[w:FLOSS|مجاني ومفتوح]] ويمكن إضافة إضافات له وتخصيصه وجدير بالثقة ودون مقابل. [[Special:MyLanguage/Manual:What is MediaWiki?|تعرف على المزيد]] وما إذا كان [[Special:MyLanguage/Manual:Deciding whether to use a wiki as your website type|ميدياويكي هو الأفضل لك]]. <div id="audiences" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon settings.svg|20px|middle|link=]]</span><span>نصب برمجيات ميدياويكي وشغلها</span></h3> <div id="mainpage-admins" title="إداريو النظام" class="items"> * '''[[Special:MyLanguage/Download|نزل]]''' و[[Special:MyLanguage/Manual:Installing MediaWiki|نصب]] و[[Special:MyLanguage/Manual:System administration|أعد]] ميدياويكي اللغه العربيه اللغه العربيه * أضف وظائف عن طريق تنصيب [[Special:MyLanguage/Manual:Extensions|امتدادات]] * هل تواجهك مشاكل؟ طالع [[Special:MyLanguage/Manual:Common errors and symptoms|الأخطاء والأعراض]] وكذلك [[Special:MyLanguage/Manual:FAQ|الأسئلة المتكررة]] * ليس لديك خادوم خاص بك؟ طالع [[Special:MyLanguage/Hosting services|خدمات الاستضافة]] * {{ll|Professional development and consulting|2=أحصل على تطوير مهني واستشارات مهنية}} * انضم إلى مجموعة المستخدمين الخاصة [[Special:MyLanguage/MediaWiki Stakeholders' Group|بذوي الشأن في ميدياويكي]] </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon edit.svg|20px|middle|link=]]</span><span>عدل ميدياويكي واستخدمها</span></h3> <div id="mainpage-users" title="المستخدمون" class="items"> * {{ll|Help:Navigation|2=تعرف على كيفية الإبحار}} * '''{{ll|Help:Editing_pages|2=تعرف على كيفية تعديل صفحة}}''' * {{ll|Help:Contents|2=تعرف على المزيد عن القراءة والتعديل والتخصيص}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon markup.svg|20px|middle|link=]]</span><span>صمم الكود البرمجي ووسع مجال عمله</span></h3> <div id="mainpage-devs" title="المطورون" class="items"> * طالع [[Special:MyLanguage/Developer hub|توثيق التطوير البرمجي]] لبرمجيات ميدياويكي * زر [https://developer.wikimedia.org البوابة الإلكترونية لمطوري ويكيميديا] </div> </div> </div> <div id="misc-news" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon helpNotice.svg|20px|middle|link=]]</span><span>أحصل على المساعدة تنزيل اللغه العربيه اليمن</span></h3> <div id=mainpage-help-contribute" title="الدعم والمساهمة" class="items"> * لا يمكنك إيجاد إجابة على مشكلة تتعلق بميدياويكي؟ اطرح سؤالك على [[Project:Support desk|مكتب الدعم]]! * [[Special:MyLanguage/How to contribute|شارك في الأمر]] مترجما أو مصمما أو كاتب مستندات توثيق أو مختبر أو * {{ll|How to report a bug|2=أبلغ عن سلوكيات البرمجيات الخاطئة أو قدم اقتراح للمستقبل}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon feedback.svg|20px|middle|link=]]</span><span>الأخبار</span></h3> <div id="mainpage-news" title="الأخبار" class="items"> <div style="margin: auto; vertical-align:top; text-align:{{dir|{{{1|{{PAGELANGUAGE}}}}}|right|left}}"> <div class="mainpage_boxcontents_small"> {{#ifeq:{{translatable}}|Template:Main page |{{#if:{{{1|{{PAGELANGUAGE}}}}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{{1|{{PAGELANGUAGE}}}}} |{{MediaWiki News/{{{1|{{PAGELANGUAGE}}}}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} |{{#if:{{int:lang}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{int:lang}} |{{MediaWiki News/{{int:lang}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} }} </div> [[Special:MyLanguage/News|أخبار قديمة]] </div> </div> </div> </div> </div> | #default= {{#if: {{#invoke:String|match|s= {{{1|{{int:lang}}}}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang=zh|1=zh}}<!--use /zh--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang={{{1|{{int:lang}}}}}|1={{{1|{{int:lang}}}}}}} }}<!-- -->{{#ifeq:{{NAMESPACE}}||{{languages|Template:Main page}}}} }} __NOEDITSECTION__ __NOTOC__<noinclude>[[Category:Main page templates{{#translation:}}|*]]</noinclude><languages /><noinclude> </noinclude> r4yjuhfu5kor4dnqerb27e44eechfeo 8364512 8364510 2026-05-03T16:47:23Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-26760-44|~2026-26760-44]] ([[User talk:~2026-26760-44|talk]]) to last version by Clump 8364512 wikitext text/x-wiki <span style="opacity:0;position:absolute;">{{DISPLAYTITLE:{{FULLPAGENAME}}}}</span>{{#switch: | = <templatestyles src="Template:Main_page/styles.css" /> <div id="lang_dir" class="mw-content-{{dir|{{{1|{{PAGELANGUAGE}}}}}}}" dir="{{dir|{{{1|{{PAGELANGUAGE}}}}}}}"> <span id="MediaWiki_is_a_collaboration_and_documentation_platform_brought_to_you_by_a_vibrant_community."></span> ==ميدياويكي هي منصة تعاون وتوثيق يقدّمها لكم مجتمع حيوي== <div aria-hidden="true" role="presentation">[[File:Wikimedia Hackathon 2026 group photo 01.jpg|{{dir|{{{1|{{PAGELANGUAGE}}}}}|left|right}}|thumb|320px|<span class="mw-translate-fuzzy">صورة جماعية للمشاركين في {{ll|Wikimedia Hackathon 2026}}</span>]]</div> يستخدم برمجية ميدياويكي [[Special:MyLanguage/Sites using MediaWiki|عشرات آلاف المواقع على الشبكة]] كذلك [[Special:MyLanguage/MediaWiki testimonials|آلاف الشركات والمؤسسات]]. كما أنه يستخدم في تشغيل ويكيبيديا وهذا الموقع أيضًا. تساعدك "ميدياويكي" في جمع وتنظيم المعرفة وتوفيرها للناس. إنه برنامج قوي [[Special:MyLanguage/Localisation|متعدد اللغات]] و[[w:FLOSS|مجاني ومفتوح]] ويمكن إضافة إضافات له وتخصيصه وجدير بالثقة ودون مقابل. [[Special:MyLanguage/Manual:What is MediaWiki?|تعرف على المزيد]] وما إذا كان [[Special:MyLanguage/Manual:Deciding whether to use a wiki as your website type|ميدياويكي هو الأفضل لك]]. <div id="audiences" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon settings.svg|20px|middle|link=]]</span><span>نصب برمجيات ميدياويكي وشغلها</span></h3> <div id="mainpage-admins" title="إداريو النظام" class="items"> * '''[[Special:MyLanguage/Download|نزل]]''' و[[Special:MyLanguage/Manual:Installing MediaWiki|نصب]] و[[Special:MyLanguage/Manual:System administration|أعد]] ميدياويكي اللغه العربيه اللغه العربيه * أضف وظائف عن طريق تنصيب [[Special:MyLanguage/Manual:Extensions|امتدادات]] * هل تواجهك مشاكل؟ طالع [[Special:MyLanguage/Manual:Common errors and symptoms|الأخطاء والأعراض]] وكذلك [[Special:MyLanguage/Manual:FAQ|الأسئلة المتكررة]] * ليس لديك خادوم خاص بك؟ طالع [[Special:MyLanguage/Hosting services|خدمات الاستضافة]] * {{ll|Professional development and consulting|2=أحصل على تطوير مهني واستشارات مهنية}} * انضم إلى مجموعة المستخدمين الخاصة [[Special:MyLanguage/MediaWiki Stakeholders' Group|بذوي الشأن في ميدياويكي]] </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon edit.svg|20px|middle|link=]]</span><span>عدل ميدياويكي واستخدمها</span></h3> <div id="mainpage-users" title="المستخدمون" class="items"> * {{ll|Help:Navigation|2=تعرف على كيفية الإبحار}} * '''{{ll|Help:Editing_pages|2=تعرف على كيفية تعديل صفحة}}''' * {{ll|Help:Contents|2=تعرف على المزيد عن القراءة والتعديل والتخصيص}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon markup.svg|20px|middle|link=]]</span><span>صمم الكود البرمجي ووسع مجال عمله</span></h3> <div id="mainpage-devs" title="المطورون" class="items"> * طالع [[Special:MyLanguage/Developer hub|توثيق التطوير البرمجي]] لبرمجيات ميدياويكي * زر [https://developer.wikimedia.org البوابة الإلكترونية لمطوري ويكيميديا] </div> </div> </div> <div id="misc-news" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon helpNotice.svg|20px|middle|link=]]</span><span>أحصل على المساعدة تنزيل اللغه العربيه اليمن</span></h3> <div id=mainpage-help-contribute" title="الدعم والمساهمة" class="items"> * لا يمكنك إيجاد إجابة على مشكلة تتعلق بميدياويكي؟ اطرح سؤالك على [[Project:Support desk|مكتب الدعم]]! * [[Special:MyLanguage/How to contribute|شارك في الأمر]] مترجما أو مصمما أو كاتب مستندات توثيق أو مختبر أو سفير تقنية أو مطور برمجيات. * {{ll|How to report a bug|2=أبلغ عن سلوكيات البرمجيات الخاطئة أو قدم اقتراح للمستقبل}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon feedback.svg|20px|middle|link=]]</span><span>الأخبار</span></h3> <div id="mainpage-news" title="الأخبار" class="items"> <div style="margin: auto; vertical-align:top; text-align:{{dir|{{{1|{{PAGELANGUAGE}}}}}|right|left}}"> <div class="mainpage_boxcontents_small"> {{#ifeq:{{translatable}}|Template:Main page |{{#if:{{{1|{{PAGELANGUAGE}}}}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{{1|{{PAGELANGUAGE}}}}} |{{MediaWiki News/{{{1|{{PAGELANGUAGE}}}}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} |{{#if:{{int:lang}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{int:lang}} |{{MediaWiki News/{{int:lang}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} }} </div> [[Special:MyLanguage/News|أخبار قديمة]] </div> </div> </div> </div> </div> | #default= {{#if: {{#invoke:String|match|s= {{{1|{{int:lang}}}}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang=zh|1=zh}}<!--use /zh--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang={{{1|{{int:lang}}}}}|1={{{1|{{int:lang}}}}}}} }}<!-- -->{{#ifeq:{{NAMESPACE}}||{{languages|Template:Main page}}}} }} __NOEDITSECTION__ __NOTOC__<noinclude>[[Category:Main page templates{{#translation:}}|*]]</noinclude><languages /><noinclude> </noinclude> sx2mn6xxkavf2vki8kkgn9p6rgp0cp3 8364513 8364512 2026-05-03T16:47:23Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-26760-44|~2026-26760-44]] ([[User talk:~2026-26760-44|talk]]) to last version by Jianhui67 8364513 wikitext text/x-wiki <span style="opacity:0;position:absolute;">{{DISPLAYTITLE:{{FULLPAGENAME}}}}</span>{{#switch: | = <templatestyles src="Template:Main_page/styles.css" /> <div id="lang_dir" class="mw-content-{{dir|{{{1|{{PAGELANGUAGE}}}}}}}" dir="{{dir|{{{1|{{PAGELANGUAGE}}}}}}}"> <span id="MediaWiki_is_a_collaboration_and_documentation_platform_brought_to_you_by_a_vibrant_community."></span> ==ميدياويكي هي منصة تعاون وتوثيق يقدّمها لكم مجتمع حيوي== <div aria-hidden="true" role="presentation">[[File:Wikimedia Hackathon 2026 group photo 01.jpg|{{dir|{{{1|{{PAGELANGUAGE}}}}}|left|right}}|thumb|320px|<span class="mw-translate-fuzzy">صورة جماعية للمشاركين في {{ll|Wikimedia Hackathon 2026}}</span>]]</div> يستخدم برمجية ميدياويكي [[Special:MyLanguage/Sites using MediaWiki|عشرات آلاف المواقع على الشبكة]] كذلك [[Special:MyLanguage/MediaWiki testimonials|آلاف الشركات والمؤسسات]]. كما أنه يستخدم في تشغيل ويكيبيديا وهذا الموقع أيضًا. تساعدك "ميدياويكي" في جمع وتنظيم المعرفة وتوفيرها للناس. إنه برنامج قوي [[Special:MyLanguage/Localisation|متعدد اللغات]] و[[w:FLOSS|مجاني ومفتوح]] ويمكن إضافة إضافات له وتخصيصه وجدير بالثقة ودون مقابل. [[Special:MyLanguage/Manual:What is MediaWiki?|تعرف على المزيد]] وما إذا كان [[Special:MyLanguage/Manual:Deciding whether to use a wiki as your website type|ميدياويكي هو الأفضل لك]]. <div id="audiences" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon settings.svg|20px|middle|link=]]</span><span>نصب برمجيات ميدياويكي وشغلها</span></h3> <div id="mainpage-admins" title="إداريو النظام" class="items"> * '''[[Special:MyLanguage/Download|نزل]]''' و[[Special:MyLanguage/Manual:Installing MediaWiki|نصب]] و[[Special:MyLanguage/Manual:System administration|أعد]] ميدياويكي اللغه العربيه اللغه العربيه * أضف وظائف عن طريق تنصيب [[Special:MyLanguage/Manual:Extensions|امتدادات]] * هل تواجهك مشاكل؟ طالع [[Special:MyLanguage/Manual:Common errors and symptoms|الأخطاء والأعراض]] وكذلك [[Special:MyLanguage/Manual:FAQ|الأسئلة المتكررة]] * ليس لديك خادوم خاص بك؟ طالع [[Special:MyLanguage/Hosting services|خدمات الاستضافة]] * {{ll|Professional development and consulting|2=أحصل على تطوير مهني واستشارات مهنية}} * انضم إلى مجموعة المستخدمين الخاصة [[Special:MyLanguage/MediaWiki Stakeholders' Group|بذوي الشأن في ميدياويكي]] </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon edit.svg|20px|middle|link=]]</span><span>عدل ميدياويكي واستخدمها</span></h3> <div id="mainpage-users" title="المستخدمون" class="items"> * {{ll|Help:Navigation|2=تعرف على كيفية الإبحار}} * '''{{ll|Help:Editing_pages|2=تعرف على كيفية تعديل صفحة}}''' * {{ll|Help:Contents|2=تعرف على المزيد عن القراءة والتعديل والتخصيص}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon markup.svg|20px|middle|link=]]</span><span>صمم الكود البرمجي ووسع مجال عمله</span></h3> <div id="mainpage-devs" title="المطورون" class="items"> * طالع [[Special:MyLanguage/Developer hub|توثيق التطوير البرمجي]] لبرمجيات ميدياويكي * زر [https://developer.wikimedia.org البوابة الإلكترونية لمطوري ويكيميديا] </div> </div> </div> <div id="misc-news" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon helpNotice.svg|20px|middle|link=]]</span><span>أحصل على المساعدة وشارك</span></h3> <div id=mainpage-help-contribute" title="الدعم والمساهمة" class="items"> * لا يمكنك إيجاد إجابة على مشكلة تتعلق بميدياويكي؟ اطرح سؤالك على [[Project:Support desk|مكتب الدعم]]! * [[Special:MyLanguage/How to contribute|شارك في الأمر]] مترجما أو مصمما أو كاتب مستندات توثيق أو مختبر أو سفير تقنية أو مطور برمجيات. * {{ll|How to report a bug|2=أبلغ عن سلوكيات البرمجيات الخاطئة أو قدم اقتراح للمستقبل}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon feedback.svg|20px|middle|link=]]</span><span>الأخبار</span></h3> <div id="mainpage-news" title="الأخبار" class="items"> <div style="margin: auto; vertical-align:top; text-align:{{dir|{{{1|{{PAGELANGUAGE}}}}}|right|left}}"> <div class="mainpage_boxcontents_small"> {{#ifeq:{{translatable}}|Template:Main page |{{#if:{{{1|{{PAGELANGUAGE}}}}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{{1|{{PAGELANGUAGE}}}}} |{{MediaWiki News/{{{1|{{PAGELANGUAGE}}}}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} |{{#if:{{int:lang}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{int:lang}} |{{MediaWiki News/{{int:lang}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} }} </div> [[Special:MyLanguage/News|أخبار قديمة]] </div> </div> </div> </div> </div> | #default= {{#if: {{#invoke:String|match|s= {{{1|{{int:lang}}}}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang=zh|1=zh}}<!--use /zh--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang={{{1|{{int:lang}}}}}|1={{{1|{{int:lang}}}}}}} }}<!-- -->{{#ifeq:{{NAMESPACE}}||{{languages|Template:Main page}}}} }} __NOEDITSECTION__ __NOTOC__<noinclude>[[Category:Main page templates{{#translation:}}|*]]</noinclude><languages /><noinclude> </noinclude> c9jbf7edv5928hftbr8cyzjh0vqv8ed 8364515 8364513 2026-05-03T16:47:25Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-26760-44|~2026-26760-44]] ([[User talk:~2026-26760-44|talk]]) to last version by Clump 8364515 wikitext text/x-wiki <span style="opacity:0;position:absolute;">{{DISPLAYTITLE:{{FULLPAGENAME}}}}</span>{{#switch: | = <templatestyles src="Template:Main_page/styles.css" /> <div id="lang_dir" class="mw-content-{{dir|{{{1|{{PAGELANGUAGE}}}}}}}" dir="{{dir|{{{1|{{PAGELANGUAGE}}}}}}}"> <span id="MediaWiki_is_a_collaboration_and_documentation_platform_brought_to_you_by_a_vibrant_community."></span> ==ميدياويكي هي منصة تعاون وتوثيق يقدّمها لكم مجتمع حيوي== <div aria-hidden="true" role="presentation">[[File:Wikimedia Hackathon 2026 group photo 01.jpg|{{dir|{{{1|{{PAGELANGUAGE}}}}}|left|right}}|thumb|320px|<span class="mw-translate-fuzzy">صورة جماعية للمشاركين في {{ll|Wikimedia Hackathon 2026}}</span>]]</div> يستخدم برمجية ميدياويكي [[Special:MyLanguage/Sites using MediaWiki|عشرات آلاف المواقع على الشبكة]] كذلك [[Special:MyLanguage/MediaWiki testimonials|آلاف الشركات والمؤسسات]]. كما أنه يستخدم في تشغيل ويكيبيديا وهذا الموقع أيضًا. تساعدك "ميدياويكي" في جمع وتنظيم المعرفة وتوفيرها للناس. إنه برنامج قوي [[Special:MyLanguage/Localisation|متعدد اللغات]] و[[w:FLOSS|مجاني ومفتوح]] ويمكن إضافة إضافات له وتخصيصه وجدير بالثقة ودون مقابل. [[Special:MyLanguage/Manual:What is MediaWiki?|تعرف على المزيد]] وما إذا كان [[Special:MyLanguage/Manual:Deciding whether to use a wiki as your website type|ميدياويكي هو الأفضل لك]]. <div id="audiences" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon settings.svg|20px|middle|link=]]</span><span>نصب برمجيات ميدياويكي وشغلها</span></h3> <div id="mainpage-admins" title="إداريو النظام" class="items"> * '''[[Special:MyLanguage/Download|نزل]]''' و[[Special:MyLanguage/Manual:Installing MediaWiki|نصب]] و[[Special:MyLanguage/Manual:System administration|أعد]] ميدياويكي * أضف وظائف عن طريق تنصيب [[Special:MyLanguage/Manual:Extensions|امتدادات]] * هل تواجهك مشاكل؟ طالع [[Special:MyLanguage/Manual:Common errors and symptoms|الأخطاء والأعراض]] وكذلك [[Special:MyLanguage/Manual:FAQ|الأسئلة المتكررة]] * ليس لديك خادوم خاص بك؟ طالع [[Special:MyLanguage/Hosting services|خدمات الاستضافة]] * {{ll|Professional development and consulting|2=أحصل على تطوير مهني واستشارات مهنية}} * انضم إلى مجموعة المستخدمين الخاصة [[Special:MyLanguage/MediaWiki Stakeholders' Group|بذوي الشأن في ميدياويكي]] </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon edit.svg|20px|middle|link=]]</span><span>عدل ميدياويكي واستخدمها</span></h3> <div id="mainpage-users" title="المستخدمون" class="items"> * {{ll|Help:Navigation|2=تعرف على كيفية الإبحار}} * '''{{ll|Help:Editing_pages|2=تعرف على كيفية تعديل صفحة}}''' * {{ll|Help:Contents|2=تعرف على المزيد عن القراءة والتعديل والتخصيص}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon markup.svg|20px|middle|link=]]</span><span>صمم الكود البرمجي ووسع مجال عمله</span></h3> <div id="mainpage-devs" title="المطورون" class="items"> * طالع [[Special:MyLanguage/Developer hub|توثيق التطوير البرمجي]] لبرمجيات ميدياويكي * زر [https://developer.wikimedia.org البوابة الإلكترونية لمطوري ويكيميديا] </div> </div> </div> <div id="misc-news" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon helpNotice.svg|20px|middle|link=]]</span><span>أحصل على المساعدة وشارك</span></h3> <div id=mainpage-help-contribute" title="الدعم والمساهمة" class="items"> * لا يمكنك إيجاد إجابة على مشكلة تتعلق بميدياويكي؟ اطرح سؤالك على [[Project:Support desk|مكتب الدعم]]! * [[Special:MyLanguage/How to contribute|شارك في الأمر]] مترجما أو مصمما أو كاتب مستندات توثيق أو مختبر أو سفير تقنية أو مطور برمجيات. * {{ll|How to report a bug|2=أبلغ عن سلوكيات البرمجيات الخاطئة أو قدم اقتراح للمستقبل}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon feedback.svg|20px|middle|link=]]</span><span>الأخبار</span></h3> <div id="mainpage-news" title="الأخبار" class="items"> <div style="margin: auto; vertical-align:top; text-align:{{dir|{{{1|{{PAGELANGUAGE}}}}}|right|left}}"> <div class="mainpage_boxcontents_small"> {{#ifeq:{{translatable}}|Template:Main page |{{#if:{{{1|{{PAGELANGUAGE}}}}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{{1|{{PAGELANGUAGE}}}}} |{{MediaWiki News/{{{1|{{PAGELANGUAGE}}}}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} |{{#if:{{int:lang}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{int:lang}} |{{MediaWiki News/{{int:lang}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} }} </div> [[Special:MyLanguage/News|أخبار قديمة]] </div> </div> </div> </div> </div> | #default= {{#if: {{#invoke:String|match|s= {{{1|{{int:lang}}}}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang=zh|1=zh}}<!--use /zh--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang={{{1|{{int:lang}}}}}|1={{{1|{{int:lang}}}}}}} }}<!-- -->{{#ifeq:{{NAMESPACE}}||{{languages|Template:Main page}}}} }} __NOEDITSECTION__ __NOTOC__<noinclude>[[Category:Main page templates{{#translation:}}|*]]</noinclude><languages /><noinclude> </noinclude> t2jf8h4nx3zjv3pbjb1m2wtju8l07co Translations:Template:Main page/22/ar 1198 914227 8364493 7925592 2026-05-03T16:41:21Z ~2026-26760-44 18367088 8364493 wikitext text/x-wiki كما أنه يستخدم في تشغيل ويكيبيديا وهذا الموقع أيضًال شارع خولان مصنع التضامن لانتاج البلك cc6ghatnf41p5clvg3hj652nr8njcfi 8364506 8364493 2026-05-03T16:47:16Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-26760-44|~2026-26760-44]] ([[User talk:~2026-26760-44|talk]]) to last version by Clump 6892122 wikitext text/x-wiki كما أنه يستخدم في تشغيل ويكيبيديا وهذا الموقع أيضًا. ttgz7s2g5y2y2umos8z3f9ov44db0gg Translations:Template:Main page/5/ar 1198 914249 8364501 8333768 2026-05-03T16:44:40Z ~2026-26760-44 18367088 8364501 wikitext text/x-wiki أحصل على المساعدة تنزيل اللغه العربيه اليمن 631p6nkkl7y1zk0eon2zprsoi74l6wo 8364511 8364501 2026-05-03T16:47:23Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-26760-44|~2026-26760-44]] ([[User talk:~2026-26760-44|talk]]) to last version by Jianhui67 3192577 wikitext text/x-wiki أحصل على المساعدة وشارك 5zd93yvzmq3gskxgvtfwipdxf4wnge6 Translations:Template:Main page/32/ar 1198 914294 8364495 8363310 2026-05-03T16:42:07Z ~2026-26760-44 18367088 8364495 wikitext text/x-wiki '''[[$1|نزل]]''' و[[$2|نصب]] و[[$3|أعد]] ميدياويكي اللغه العربيه ftw9bp869n7psdnzibnhab8ytzfbvhv 8364503 8364495 2026-05-03T16:45:08Z ~2026-26760-44 18367088 8364503 wikitext text/x-wiki '''[[$1|نزل]]''' و[[$2|نصب]] و[[$3|أعد]] ميدياويكي اللغه العربيه اللغه العربيه lu2rn4jhceo10kqeiphj511cj7e4o3s 8364514 8364503 2026-05-03T16:47:24Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-26760-44|~2026-26760-44]] ([[User talk:~2026-26760-44|talk]]) to last version by Clump 6892114 wikitext text/x-wiki '''[[$1|نزل]]''' و[[$2|نصب]] و[[$3|أعد]] ميدياويكي 4sdnxlis4gikflhrbkm7jfwft8k0vc2 Translations:Template:Main page/38/ar 1198 914300 8364497 8363307 2026-05-03T16:43:30Z ~2026-26760-44 18367088 8364497 wikitext text/x-wiki اطرح سؤالك على [[$1|مكتب الدعم]]!اللغه العربيه اليمن cogrrbmhqz2jc55xbafs5w9dwi34lce 8364508 8364497 2026-05-03T16:47:21Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-26760-44|~2026-26760-44]] ([[User talk:~2026-26760-44|talk]]) to last version by Clump 3192759 wikitext text/x-wiki اطرح سؤالك على [[$1|مكتب الدعم]]! tdegpn3657fbckrscmp9fpdb2t7j1p3 Translations:Template:Main page/39/ar 1198 914301 8364499 5722035 2026-05-03T16:43:38Z ~2026-26760-44 18367088 8364499 wikitext text/x-wiki [[$1|شارك في الأمر]] مترجما أو مصمما أو كاتب مستندات توثيق أو مختبر أو bcfwr59t940dkpsbup3ltb7jtacu93d 8364509 8364499 2026-05-03T16:47:22Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-26760-44|~2026-26760-44]] ([[User talk:~2026-26760-44|talk]]) to last version by Clump 5214704 wikitext text/x-wiki [[$1|شارك في الأمر]] مترجما أو مصمما أو كاتب مستندات توثيق أو مختبر أو سفير تقنية أو مطور برمجيات. 7jymwossloih6cfav43emzkn1fbzrvs Template:Main page/cs 10 914582 8364440 8363054 2026-05-03T15:30:55Z Rebulka 17532855 8364440 wikitext text/x-wiki <span style="opacity:0;position:absolute;">{{DISPLAYTITLE:{{FULLPAGENAME}}}}</span>{{#switch: | = <templatestyles src="Template:Main_page/styles.css" /> <div id="lang_dir" class="mw-content-{{dir|{{{1|{{PAGELANGUAGE}}}}}}}" dir="{{dir|{{{1|{{PAGELANGUAGE}}}}}}}"> <span id="MediaWiki_is_a_collaboration_and_documentation_platform_brought_to_you_by_a_vibrant_community."></span> ==MediaWiki je platforma pro dokumentaci a spolupráci, kterou vám přináší živá komunita.== <div aria-hidden="true" role="presentation">[[File:Wikimedia Hackathon 2026 group photo 01.jpg|{{dir|{{{1|{{PAGELANGUAGE}}}}}|left|right}}|thumb|320px|Fotografie účastníků {{ll|Wikimedia Hackathon 2026}}]]</div> Software MediaWiki používají [[Special:MyLanguage/Sites using MediaWiki|desetitisíce webů]] a [[Special:MyLanguage/MediaWiki testimonials|tisíce společností a organizací]]. Běží na něm Wikipedie i tento web. MediaWiki vám pomáhá sbírat a organizovat vědomosti a zpřístupnit je dalším lidem. Je to silný, [[Special:MyLanguage/Localisation|mnohojazyčný]] nástroj, [[w:FLOSS|svobodný a otevřený]], rozšiřitelný, přizpůsobitelný, spolehlivý a bezplatný. [[Special:MyLanguage/Manual:What is MediaWiki?|Získejte více informací]] a zjistěte, zda [[Special:MyLanguage/Manual:Deciding whether to use a wiki as your website type|je MediaWiki pro vás to pravé]]. <div id="audiences" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon settings.svg|20px|middle|link=]]</span><span>Nastavení a spuštění MediaWiki</span></h3> <div id="mainpage-admins" title="Systémoví administrátoři" class="items"> * '''[[Special:MyLanguage/Download|Stažení]]''', [[Special:MyLanguage/Manual:Installing MediaWiki|instalace]] a [[Special:MyLanguage/Manual:System administration|nastavení]] MediaWiki * Přidání možností instalací [[Special:MyLanguage/Manual:Extensions|rozšíření]] * Máte problém? Podívejte se na stránku [[Special:MyLanguage/Manual:Common errors and symptoms|Chyby a jejich průvodní znaky]] a na [[Special:MyLanguage/Manual:FAQ|FAQ – časté dotazy]] * Nemáte vlastní server? Podívejte se na stránku [[Special:MyLanguage/Hosting services|Hostingové služby]] * {{ll|Professional development and consulting|2=Získejte pomoc či radu od profesionálních vývojářů}} * Přidejte se k uživatelské skupině [[Special:MyLanguage/MediaWiki Stakeholders' Group|MediaWiki Stakeholders]] </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon edit.svg|20px|middle|link=]]</span><span>Editace a použití stránek MediaWiki</span></h3> <div id="mainpage-users" title="Uživatelé" class="items"> * {{ll|Help:Navigation|2=Naučte se zde orientovat}} * '''{{ll|Help:Editing_pages|2=Naučte se, jak upravit stránku}}''' * {{ll|Help:Contents|2=Více informací o čtení, úpravách a osobním přizpůsobení}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon markup.svg|20px|middle|link=]]</span><span>Vývoj a rozšiřování kódu</span></h3> <div id="mainpage-devs" title="Vývojáři" class="items"> * Čtěte [[Special:MyLanguage/Developer hub|dokumentaci pro vývojáře]] MediaWiki * Navštivte [https://developer.wikimedia.org Vývojářský portál Wikimedia] </div> </div> </div> <div id="misc-news" class="mainpage_row"> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon helpNotice.svg|20px|middle|link=]]</span><span>Kde hledat pomoc a jak přispět</span></h3> <div id=mainpage-help-contribute" title="Podpora a příspěvky" class="items"> * Nedaří se vám nalézt odpověď na váš problém s MediaWiki? Zeptejte se na [[Project:Support desk|stránce podpory]]! * [[Special:MyLanguage/How to contribute|Zapojte se]] jako překladatel, návrhář, autor dokumentace, tester, technický vyslanec nebo vývojář * {{ll|How to report a bug|2=Nahlásit chybné chování software nebo návrh nové funkcionality}} </div> </div> <div class="mainpage_box"> <h3><span class="header_icon" aria-hidden="true" role="presentation">[[File:Codex icon feedback.svg|20px|middle|link=]]</span><span>Novinky</span></h3> <div id="mainpage-news" title="Novinky" class="items"> <div style="margin: auto; vertical-align:top; text-align:{{dir|{{{1|{{PAGELANGUAGE}}}}}|right|left}}"> <div class="mainpage_boxcontents_small"> {{#ifeq:{{translatable}}|Template:Main page |{{#if:{{{1|{{PAGELANGUAGE}}}}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{{1|{{PAGELANGUAGE}}}}} |{{MediaWiki News/{{{1|{{PAGELANGUAGE}}}}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} |{{#if:{{int:lang}} |{{#if: {{#invoke:String|match|s= {{int:lang}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{MediaWiki News/zh|condensed=1}}<!--use /zh--> |{{#ifexist: Template:MediaWiki News/{{int:lang}} |{{MediaWiki News/{{int:lang}}|condensed=1}} |{{MediaWiki News/en|condensed=1}} }} }} |{{MediaWiki News/en|condensed=1}} }} }} </div> [[Special:MyLanguage/News|Starší zprávy]] </div> </div> </div> </div> </div> | #default= {{#if: {{#invoke:String|match|s= {{{1|{{int:lang}}}}} |pattern= zh- |plain= true |nomatch= }}<!--Chinese variants--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang=zh|1=zh}}<!--use /zh--> |{{#invoke:Template translation|renderTranslatedTemplate|template=Template:Main page|noshift=1|uselang={{{1|{{int:lang}}}}}|1={{{1|{{int:lang}}}}}}} }}<!-- -->{{#ifeq:{{NAMESPACE}}||{{languages|Template:Main page}}}} }} __NOEDITSECTION__ __NOTOC__<noinclude>[[Category:Main page templates{{#translation:}}|*]]</noinclude><languages /><noinclude> </noinclude> ozxctrvx7fw71xz87duelmejqbnwbz9 Translations:Template:Main page/19/cs 1198 914585 8364439 6825368 2026-05-03T15:30:55Z Rebulka 17532855 Marked translation unit as no longer outdated with no changes 5959081 wikitext text/x-wiki Fotografie účastníků $1 to943d7gcxqchbrrgsyu4ldielml16j Translations:Help:Formatting/35/cs 1198 915918 8364650 3198908 2026-05-03T17:19:24Z Rebulka 17532855 8364650 wikitext text/x-wiki Úroveň 2 h0pt9ytl5munadvtyleieoxmp34fll9 Translations:Help:Formatting/36/cs 1198 915919 8364652 3198910 2026-05-03T17:19:37Z Rebulka 17532855 8364652 wikitext text/x-wiki Úroveň 3 fe9zoxl4pkorkasatq44xcoxuatvwiw Translations:Help:Formatting/37/cs 1198 915920 8364654 3198912 2026-05-03T17:19:48Z Rebulka 17532855 8364654 wikitext text/x-wiki Úroveň 4 5iagtbzh8y8vpkfp2bvn31tbungbm9b Translations:Help:Formatting/38/cs 1198 915921 8364656 3198914 2026-05-03T17:19:58Z Rebulka 17532855 8364656 wikitext text/x-wiki Úroveň 5 rc5yrs5u31d05yaku5fcumqoklnhum8 Translations:Help:Formatting/39/cs 1198 915922 8364658 3198916 2026-05-03T17:20:08Z Rebulka 17532855 8364658 wikitext text/x-wiki Úroveň 6 kju6v3b1cfwardmeyxqyxozp2xg7qs0 OAuth/For Developers/ru 0 919266 8364294 8350299 2026-05-03T12:27:52Z FuzzyBot 451990 Updating to match new version of source page 8364294 wikitext text/x-wiki <languages /> На этой странице объясняется, как разрабатывать приложения, которые могут интегрироваться с вики с запущенным {{ll|Extension:OAuth}} (расширение, превращающее MediaWiki в сервер [[w:OAuth|OAuth]]) для безопасного запроса разрешения действовать от имени пользователя. {{Note|1=<span class="mw-translate-fuzzy">Если вы разрабатываете бота или подобное приложение, в котором один и тот же потребитель всегда используется с одной и той же учетной записью пользователя, вы можете предпочесть более простые [[Special:MyLanguage/OAuth/Owner-only_consumers| только для владельцев (owner-only consumers)]].</span>}} <span id="OAuth_in_a_nutshell"></span> == OAuth в двух словах == OAuth позволяет приложению запрашивать разрешение у пользователя действовать через его вики-учетную запись, не зная пароля пользователя, и при этом не в состоянии делать все, что может пользователь (например, приложение может редактировать статьи, но не удалять их, поэтому даже пользователи с расширенными разрешениями могут безопасно использовать инструменты с поддержкой OAuth). <div class="mw-translate-fuzzy"> Это происходит по протоколу [https://oauth.net/2/ OAuth 2.0] или [https://oauth.net/core/1.0a/ OAuth 1.0a] и состоит из трёх компонентов: </div> # <span class="mw-translate-fuzzy">#Разработчик должен зарегистрировать приложение (часто называемое «потребителем» в терминологии OAuth) в вики, возможно, пройти через процесс проверки и получить определённые учетные данные.</span> # <span class="mw-translate-fuzzy">#Когда пользователь хочет использовать его, приложение должно инициировать процесс авторизации.</span> Это будет включать отправку пользователя на специальную страницу в вики, где будет отображаться диалог авторизации. Если пользователь подтверждает авторизацию, приложение получит другой набор учетных данных (которые относятся к этому пользователю и могут быть отозваны пользователем в любое время). # <span class="mw-translate-fuzzy">#Когда приложению действительно необходимо выполнить действие (запрос API) от имени пользователя, оно может объединить учетные данные, полученные на этапах 1 и 2, для подписания запроса.</span> OAuth - это широко используемый открытый стандарт (вы можете увидеть его на таких сайтах, как Google, Facebook или GitHub, например, при использовании учетных записей на этих сайтах для входа в систему в другом месте). {{info|1=<span class="mw-translate-fuzzy">Его не следует путать с [[w:Initiative for Open Authentication|OATH]] (семейство протоколов двухфакторной аутентификации, известное как "введите шесть цифр, которые вы видите в своем мобильном приложении", сейчас включено на сайтах Викимедиа) и [[w:OpenID Connect|OpenID Подключение]] (протокол аутентификации, основанный на OAuth 2.0, который частично поддерживает расширение OAuth MediaWiki).</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Initiative for Open Authentication|OATH]] (a second-factor authentication protocol family, commonly known as "type the six numbers you see on your mobile app", now enabled on Wikimedia sites)</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:OpenID Connect|OpenID Connect]] (an authentication protocol based on OAuth 2.0, which the OAuth MediaWiki extension partially supports).</span> }} Несколько более подробное описание OAuth 1.0a можно найти в [https://docs.google.com/presentation/d/1537HnwSaSzH-b8hINcz48SNhT8ElAUPC39to0_O1iNA/edit#slide=id.g15105b408d_0_287 эти слайды]. <span id="OAuth_in_detail"></span> == OAuth в деталях == <span lang="en" dir="ltr" class="mw-content-ltr">The registration is basically the same for OAuth 1.0a and OAuth 2, with the difference being only the presence of a few form fields. The remaining parts differ significantly depending on the OAuth version.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Generally, OAuth 2 is recommended if available in your environment.</span> <span id="Registration"></span> === Регистрация === <span lang="en" dir="ltr" class="mw-content-ltr">To register a new OAuth application, submit the form at <code>[[m:Special:OAuthConsumerRegistration/propose|Special:OAuthConsumerRegistration/propose]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Try to give sufficient information about the application for admins and users to decide whether it can be trusted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">URLs to places with more information (such as the application itself, the source code or on-wiki documentation) can be useful.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For OAuth applications to be used on Wikimedia projects, see [[meta:Special:MyLanguage/OAuth app guidelines|app guidelines]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Besides the descriptive ones, the fields have the following meaning:</span> * <code>This consumer is for use only by {{tag|user|open|plain=1}}</code>: <span lang="en" dir="ltr" class="mw-content-ltr">whether you use [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]] (which do not need to be reviewed or authorised but are only usable by yourself).</span> * <code>callback URL</code> (<span lang="en" dir="ltr" class="mw-content-ltr">irrelevant to owner-only consumers</span>): <span lang="en" dir="ltr" class="mw-content-ltr">the URL where the user returns after authorisation is checked against this.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(This is an extra layer of security against an attacker trying to steal credentials during authorisation.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>use as prefix</code> option is enabled, the URL must start with this (the check is dumb so make sure to add at least a <code>/</code> after the domain name), otherwise it must be an exact match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you are developing/testing your local machine, specify [[w:Localhost|Localhost]] in this field (e.g. <code><nowiki>http://localhost:8080/</nowiki></code>).</span> * <code>Applicable project</code> (<span lang="en" dir="ltr" class="mw-content-ltr">for wiki farms only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">project(s) on which to use your application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can limit the application to a single wiki or have it work everywhere.</span> * <code>Types of grants</code> / <code>Applicable grants</code>: <span lang="en" dir="ltr" class="mw-content-ltr">the permissions needed by your application (be conservative). The actual permissions will be an intersection of this and what permissions the user has.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Currently, the user must authorise grouped permissions, not individual ones ([[Phab:T59505|T59505]]).</span> * <code>Allowed IP ranges</code>: <span lang="en" dir="ltr" class="mw-content-ltr">an optional specification of the IP ranges that you use, where OAuth requests not matching this will be rejected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is an extra layer of security against an attacker stealing your application's credentials and trying to impersonate it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> * <code>Public RSA key</code> (<span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">public key used by your application for signing requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can just leave this empty (most applications do) to use a slightly simpler shared-secret mechanism instead.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> <span lang="en" dir="ltr" class="mw-content-ltr">After registration, you'll receive the credentials needed to use OAuth.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to use it immediately with your own user account (this is meant for testing); others will only be able to use it once it is approved by an administrator.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The list of applications (approved or otherwise) is public and can be browsed at <code>[[m:Special:OAuthListConsumers|Special:OAuthListConsumers]]</code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === OAuth 1.0a === </div> <span id="Authorisation"></span> === Авторизация === [[File:OAuth authorization interface.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Authorisation dialog shown to users</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> When registering the application, you receive two pieces of credentials: the application token (a public ID for the application) and the application secret (sort of like a password). </div> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another set of credentials (these ones specific to that user): the access token and access secret.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">With an RSA key the credentials are slightly different.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is assumed that people choosing to use an RSA key know what they are doing, so this tutorial will assume you have chosen the non-RSA option.</span> </ref> <span lang="en" dir="ltr" class="mw-content-ltr">To get them, you need to go through the authorisation process, which consists of three steps:</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|OAuth/Owner-only consumers|owner-only consumers}} for that.</span> </ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Get a request token from the wiki by sending a GET request to <code>Special:OAuth/initiate</code>, signed with the application key and secret, with the callback URL (where the user will be sent after a successful authorisation) passed as the <code>oauth_callback</code> query parameter (if you have set a constant URL at registration, the value of the parameter ''must'' be <code>oob</code>).</span><ref name="non-nice-url"><span lang="en" dir="ltr" class="mw-content-ltr">Due to [[phab:T59500]] you must currently use a non-nice URL such as <code>en.wikipedia.org/w/index.php?title=Special:OAuth/initiate</code>.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">If you are successful, the response will be a JSON object with <code>token</code> and <code>key</code> fields—the request token and request secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If not, it will have an <code>error</code> field.)</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>Special:OAuth/authorize</code>, with the application token and request token passed as query parameters (<code>oauth_consumer_key</code> and <code>oauth_token</code>, respectively).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>oauth_verifier</code> will contain the verification code that you can use to exchange the request token and secret for the access token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a request to <code>Special:OAuth/token</code><ref name="non-nice-url" /> which includes the <code>oauth_verifier</code> parameter you just received and is signed with the application token and secret and the request token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token/secret (in the same format as the request token/secret in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token and secret is what you'll need to sign API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The request token and secret is not useful anymore and can be discarded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token will remain valid indefinitely, unless the user revokes it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If you prefer not to store it, you can just repeat the authorisation process at any time though.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Applications which only need minimal privileges (have been registered as ''User identity verification only'') can use <code>/authenticate</code> instead of <code>/authorize</code> in step 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This works the same way, but the user will only see the authorisation dialog if they have not authorised this application before; otherwise the authorisation will silently succeed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure, so you don't have to implement it manually—each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <span id="Making_requests_on_the_user&#039;s_behalf"></span> === Создание запросов от имени пользователя === <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to be signed with the application token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth, with one exception (see next section).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications registered as ''User identity verification only'' cannot use the API at all. </div> <span id="Identifying_the_user"></span> === Идентификация пользователя === <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a custom protocol (similar to OpenID Connect) for authenticating the user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send a signed OAuth request to <code>Special:OAuth/identify</code>:</span><ref name="non-nice-url" /> <span lang="en" dir="ltr" class="mw-content-ltr">the response will be a [[w:JSON Web Token|JWT]] (JSON Web Token &ndash; a signed JSON object) including the name of the user, their {{ll|Manual:Central ID|central ID}} (under the key <code>sub</code>) and various other information (such as their user groups and whether they are blocked; also the email address if the application was registered with the right grant type).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is more secure than using the API (e.g. the userinfo module) for authentication, which could be subject to [[w:Man-in-the-middle attack|man-in-the-middle attacks]]; always use this if you need to identify a user!</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also, make sure you properly validate the JWT (there are many libraries which can help with that).</span> <span lang="en" dir="ltr" class="mw-content-ltr">You should check each of the following: the issuer (<code>iss</code>) matches the domain name of the wiki, the audience (<code>aud</code>) matches your application key, the issued-at time (<code>iat</code>) is in the past and reasonably close to current time, the expiration time (<code>exp</code>) is in the future, the nonce (<code>nonce</code>) matches the one you sent in the request.</span> <span id="Signing_requests"></span> === Подписывание запросов === <span lang="en" dir="ltr" class="mw-content-ltr">Steps 1 and 3 of the authorisation process require signing the request; API requests and <code>Special:OAuth/identify</code> must likewise be signed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The signing process is detailed in [https://oauth.net/core/1.0a/#signing_process section 9 of the OAuth spec], but it is cumbersome to implement by hand and [https://oauth.net/1/ many libraries] are available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find code samples and an overview of how to do it by hand in the {{ll|OAuth/Owner-only_consumers|owner-only consumer}} documentation.</span> (<span lang="en" dir="ltr" class="mw-content-ltr">That is for signing with the consumer token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Modify as appropriate to sign with the consumer token/secret and request token/secret (authorisation step 3) or consumer token/secret only (authorisation step 1).</span>) <div lang="en" dir="ltr" class="mw-content-ltr"> === OAuth 2 === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Authorisation ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">When registering the application, you receive two pieces of credentials: the client application key (a public ID for the application, also called the client ID or consumer key) and the client application secret (a confidential password).</span> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another credential (this one specific to that user): the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To get it, you need to go through the [https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/ the OAuth 2 Authorization Code flow], which consists of two steps:</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See [[Special:MyLanguage/OAuth/Owner-only consumers|owner-only consumers]] for that.</span></ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>oauth2/authorize</code> under the wiki's REST endpoint (usually <code>rest.php</code>), with <code>response_type=code</code> and the consumer key (also called the client application key) as the <code>client_id</code>, possibly a <code>state</code> if you want, and optionally the <code>redirect_uri</code> (if yes, it must be the same as in your application request).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If your consumer is non-confidential, you'll also need to include a [https://www.oauth.com/oauth2-servers/pkce/authorization-request/ PKCE code challenge] (<code>code_challenge</code> and <code>code_challenge_method=S256</code>).</span><ref>PKCE &mdash; Proof Key for Code Exchange</ref> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>code</code> will contain the authorisation code that you can use to fetch the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a POST request to <code>oauth2/access_token</code> under the wiki's REST endpoint (usually <code>rest.php</code>), including <code>grant_type=authorization_code</code>, the <code>code</code> parameter you just received, your client authentication (typically as <code>client_id</code> and, for confidential clients, <code>client_secret</code>), the <code>redirect_uri</code> if and only if you specified it in the previous step (must be the same value for both), and if non-confidential the PKCE <code>code_verifier</code> and <code>code_challenge_method</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token and a refresh token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token is what you'll need to send future API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The refresh token can be used to [https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/ fetch a new access token] if the original access token expires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you prefer not to store either token, you can just repeat the authorisation process at any time.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(Before MediaWiki 1.46, non-confidential clients could only use refresh tokens using their client secret keys, not using their client IDs only, see [[phabricator:T323855|T323855]].)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure so you don't have to implement it manually - each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Making requests on the user's behalf ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to include the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the access token is used to fetch a CSRF token or other tokens, the access token must still be passed (as a header) with requests that use those tokens.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications which need minimal privileges (have been registered as ''User identity verification only'') cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> API requests including <code>rest.php/oauth2/resource/profile</code> must be authenticated with an HTTP Authorization header containing the access token, like: </div> <pre> Authorization: Bearer abcde....6789 </pre> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Identifying the user ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a somewhat incomplete implementation of OpenID Connect for authenticating the user.</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">See [[phab:T254063|T254063]] for details.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send an authenticated OAuth GET request to the <code>oauth2/resource/profile</code> API (MediaWiki's implementation of what the OIDC spec calls the UserInfo endpoint) under the wiki's REST endpoint (usually <code>rest.php</code>); the response will include the name of the user and various other information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that the GET request must use the HTTP <code>Authorization</code> header, not a query string token.</span> * '''sub''' <span lang="en" dir="ltr" class="mw-content-ltr">(central user ID)</span> * '''username''' * '''editcount''' * '''confirmed_email''' * '''blocked''' * '''registered''' * '''groups''' * '''rights''' * '''realname''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> * '''email''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> <span id="Setting_up_a_development_environment"></span> == Настройка среды разработки == <div lang="en" dir="ltr" class="mw-content-ltr"> You can register an OAuth application on [https://meta.wikimedia.beta.wmflabs.org/wiki/Special:OAuthConsumerRegistration/propose beta meta] and test your code against that. </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you want to improve the extension itself, or debug protocol issues in detail, OAuth is available in the {{ll|MediaWiki-Vagrant}} development environment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Add the <code>oauth</code> role, and your local wiki will be able to authorise OAuth apps.</span> <syntaxhighlight lang="shell-session"> $ vagrant roles enable oauth $ vagrant provision </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Once the code is nearly ready, you can register an OAuth application on the real wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to test it with the same user account used for registering, even before it gets reviewed by admins.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If you are creating an application for Wikimedia projects, consider hosting it at [[Wikitech:Portal:Toolforge|Wikimedia Toolforge]], a free tool forge and hosting platform for Wikimedia-related services. </div> <span id="Security_benefits_and_trade-offs"></span> == Преимущества безопасности и компромиссы == * <span lang="en" dir="ltr" class="mw-content-ltr">Unlike password-based authentication, the OAuth 1.0 protocol prevents any [[w:Man-in-the-middle attack|man-in-the-middle attack]] even if the wiki does not require HTTPS: all interactions between MediaWiki and the application are signed with either a shared secret (using HMAC-SHA1), or a [[w:Public-key cryptography|public key]] (RSA).</span> <span lang="en" dir="ltr" class="mw-content-ltr">HTTPS is still required for certain steps though (for obtaining the shared secret in the second step of authorisation when not using RSA, and during app registration).</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 2.0 does not involve signing and relies on HTTPS for security.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Actions via OAuth happen under the user's name but will be [[Special:MyLanguage/Manual:Tags|tagged]] with the application's name as well so rogue applications can be identified.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Wiki admins can revoke the application's permissions (and thus bar it from any further action) if needed.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The user can revoke the permission of the application to use that specific user account if they don't like how it works or don't trust it anymore.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Unlike a password change, this is not disruptive for the user.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Sufficiently flexible applications might allow users to circumvent IP blocks (since MediaWiki will see the IP of the application server, not that of the user).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This can be handled the same way proxies are, by trusting XFF headers set by the application (see [[Phab:T159889|T159889]] for some limitations).</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The application secret must be kept secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Submitting it to source control or putting it into user-accessible code (such as mobile app or desktop application; even if it is obfuscated) undermines the security model and will result in admins forcefully disabling the application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Exceptions are made for example applications demoing OAuth usage, if they are explicitly labeled as such and request limited rights.</span> <span id="Libraries"></span> == Библиотеки == === PHP === * [[oauthclient-php]] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a client library maintained by Wikimedia</span> * [https://php.net/book.oauth OAuth] – <span lang="en" dir="ltr" class="mw-content-ltr">PECL client library</span> * [https://github.com/firebase/php-jwt firebase/php-jwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a popular JWT library</span> * [https://sr.ht/~taavi/laravel-socialite-mediawiki/ laravel-socialite-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki driver for [[w:Laravel|Laravel]]'s [https://laravel.com/docs/7.x/socialite Socialite] library.</span> === Python === * [https://github.com/valhallasw/flask-mwoauth flask-mwoauth] – <span lang="en" dir="ltr" class="mw-content-ltr">a Flask blueprint to run OAuth against MediaWiki's Extension:OAuth (See tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Flask_OAuth_tool My first Flask OAuth tool])</span> * [https://github.com/wikimedia/MediaWiki-OAuth MediaWiki-OAuth (mwoauth)] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a on top of [http://requests-oauthlib.readthedocs.org/en/latest/oauth1_workflow.html requests-oauthlib]</span> * [https://github.com/python-social-auth/social-core python-social-auth] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework that includes a [https://github.com/python-social-auth/social-core/blob/master/social_core/backends/mediawiki.py MediaWiki backend] (Example tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Django_OAuth_tool My first Django OAuth tool])</span> * [https://docs.authlib.org/en/latest/index.html authlib] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework to interact with Wikimedia OAuth 2.0 API (Full minimal Django OAuth 2.0 [https://code.basabuuka.org/alpcentaur/wmde_oauth_django_example example])</span> * [https://github.com/jpadilla/pyjwt pyjwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a JWT library</span> === Ruby === * [https://github.com/timwaters/omniauth-mediawiki omniauth-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">a MediaWiki strategy for OmniAuth (also available as a [https://rubygems.org/gems/omniauth-mediawiki gem])</span> === Rust === * [https://crates.io/crates/mediawiki MediaWiki crate] <span lang="en" dir="ltr" class="mw-content-ltr">implements both OAuth1 and OAuth2 login mechanisms.</span> * [https://crates.io/crates/oauth2 oauth2 crate] === Node.js === * [https://www.npmjs.com/package/passport-mediawiki-oauth passport-mediawiki-oauth] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki strategy for the Passport auth framework (which can be used effortlessly as a middleware with Express JS and similar frameworks)</span> * [https://www.npmjs.com/package/oauth-fetch-json oauth-fetch-json] – <span lang="en" dir="ltr" class="mw-content-ltr">library for signing OAuth requests</span> * [https://www.npmjs.com/package/m3api-oauth2 m3api-oauth2] – an extension package for [https://www.npmjs.com/package/m3api m3api], making it easy to make requests authenticated via [[Special:MyLanguage/Help:OAuth|OAuth 2.0]] === Go === * [https://github.com/mrjones/oauth mrjones/oauth] (OAuth 1.0) * [https://pkg.go.dev/golang.org/x/oauth2 golang.org/x/oauth2] <span lang="en" dir="ltr" class="mw-content-ltr">(OAuth 2.0, [https://pkg.go.dev/golang.org/x/oauth2#example-Config example])</span> === Java === * [https://github.com/scribejava/scribejava ScribeJava] <span lang="en" dir="ltr" class="mw-content-ltr">since version 5.5.0 ([https://github.com/scribejava/scribejava/pull/852 pull request])</span> <span id="Example_code"></span> == Примеры кода == <span id="PHP_client_without_using_any_libraries"></span> === PHP-клиент без использования библиотек === [[toollabs:oauth-hello-world|OAuth Hello World]] – <span lang="en" dir="ltr" class="mw-content-ltr">easy to understand demo application written in PHP without any libraries.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === PHP command-line client with RSA keys, using oauthclient-php === </div> <span lang="en" dir="ltr" class="mw-content-ltr">PHP application using classes from the OAuth extension codebase.</span> {{Todo|1=<span lang="en" dir="ltr" class="mw-content-ltr">convert this to actually use oauthclient-php! Probably just a bunch of <code>use</code> declarations.</span>}} <span lang="en" dir="ltr" class="mw-content-ltr">Before Starting:</span> <syntaxhighlight lang="shell-session"> $ openssl genrsa -out appkey.pem 4096 $ openssl rsa -in appkey.pem -pubout > appkey.pub </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">PHP source code</span>}} <syntaxhighlight lang="php"> <?php if ( PHP_SAPI !== 'cli' ) { die( "CLI-only test script\n" ); } /** * A basic client for overall testing */ function wfDebugLog( $method, $msg) { //echo "[$method] $msg\n"; } require 'OAuth.php'; require 'MWOAuthSignatureMethod.php'; $consumerKey = ''; #$consumerSecret = ''; // We don't need this, since we're using RSA, except to validate the /identify call $privateKey = file_get_contents( 'appkey.pem' ); $baseurl = 'http://<wiki>/wiki/Special:OAuth'; $endpoint_req = $baseurl . '/initiate?format=json&oauth_callback=oob'; // format=json makes php a little easier $endpoint_acc = $baseurl . '/token?format=json'; $endpoint_id = $baseurl . '/identify'; $c = new OAuthConsumer( $consumerKey, $privateKey ); // Make sure we sign title and format $parsed = parse_url( $endpoint_req ); $extraSignedParams = array(); parse_str($parsed['query'], $extraSignedParams); $extraSignedParams['title'] = 'Special:OAuth/initiate'; $init_req = OAuthRequest::from_consumer_and_token( $c, // OAuthConsumer for your app NULL, // User token, NULL for calls to initiate "GET", // http method $endpoint_req, // endpoint url (this is signed) $extraSignedParams // extra parameters we want to sign (must include title) ); $rsa_method = new MWOAuthSignatureMethod_RSA_SHA1( new OAuthDataStore(), $privateKey ); $init_req->sign_request( $rsa_method, // OAuthSignatureMethod $c, // OAuthConsumer for your app NULL // User token, NULL for calls to initiate ); echo "Getting request token with: $init_req\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, (string) $init_req ); // Pass OAuth in GET params curl_setopt( $ch, CURLOPT_HTTPGET, true ); curl_setopt( $ch, CURLOPT_HEADER, false ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $requestToken = json_decode( $data ); print "Visit $baseurl/authorize?oauth_token={$requestToken->key}&oauth_consumer_key=$consumerKey\n"; // ACCESS TOKEN print "Enter the verification code:\n"; $fh = fopen( "php://stdin", "r" ); $line = fgets( $fh ); $rc = new OAuthToken( $requestToken->key, $requestToken->secret ); $parsed = parse_url( $endpoint_acc ); parse_str($parsed['query'], $params); $params['oauth_verifier'] = trim($line); $params['title'] = 'Special:OAuth/token'; $acc_req = OAuthRequest::from_consumer_and_token( $c, $rc, "GET", $endpoint_acc, $params ); $acc_req->sign_request($rsa_method, $c, $rc); echo "Calling: $acc_req\n"; unset( $ch ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_acc ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $acc_req->to_header() ) ); // Set the Authorization Header $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $acc = json_decode( $data ); $accessToken = new OAuthToken( $acc->key, $acc->secret ); /** * Insecurely call the api for information about the user. * A MITM can forge a response from the server, so don't rely on this for identity! */ $apiurl = 'http://<wiki>/w/api.php'; $apiParams = array( 'action' => 'query', 'meta' => 'userinfo', 'uiprop' => 'rights', 'format' => 'json', ); $api_req = OAuthRequest::from_consumer_and_token( $c, // Consumer $accessToken, // User Access Token "GET", // HTTP Method $apiurl, // Endpoint url $apiParams // Extra signed parameters ); $api_req->sign_request( $rsa_method, $c, $accessToken ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $apiurl . "?" . http_build_query( $apiParams ) ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $api_req->to_header() ) ); // Authorization header required for api $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; /** * Securely get the identity of the user */ $consumerSecret = ''; $extraSignedParams = array( 'title' => 'Special:OAuth/identify' ); $req = OAuthRequest::from_consumer_and_token( $c, $accessToken, "GET", $endpoint_id, $extraSignedParams ); $req->sign_request( $rsa_method, $c, $accessToken ); echo "Calling: '$endpoint_id'\nHeader: {$req->to_header()}\n\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_id ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $req->to_header() ) ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } $identity = JWT::decode( $data, $consumerSecret ); // Validate the JWT if ( !validateJWT( $identity, $consumerKey, $req->get_parameter( 'oauth_nonce' ) ) ) { print "The JWT did not validate"; } else { print "We got a valid JWT, describing the user as:\n"; print " * Username: {$identity->username}\n"; print " * User's current groups: " . implode( ',', $identity->groups ) . "\n"; print " * User's current rights: " . implode( ',', $identity->rights ) . "\n"; } /** * Validate a JWT, to ensure this isn't a reply, spoof, etc. * @param $identity the decoded JWT * @param $consumerKey your App's Key * @param $nonce the nonce sent with your request, which should be returned */ function validateJWT( $identity, $consumerKey, $nonce ) { $expectedConnonicalServer = 'http://<wiki>'; // Verify the issuer is who we expect (server sends $wgCanonicalServer) if ( $identity->iss !== $expectedConnonicalServer ) { print "Invalid Issuer"; return false; } // Verify we are the intended audience if ( $identity->aud !== $consumerKey ) { print "Invalid Audience"; return false; } // Verify we are within the time limits of the token. // Issued at (iat) should be in the past, // Expiration (exp) should be in the future. $now = time(); if ( $identity->iat > $now || $identity->exp < $now ) { print "Invalid Time"; return false; } // Verify we haven't seen this nonce before, which would indicate a replay attack if ( $identity->nonce !== $nonce ) { print "Invalid Nonce"; return false; } return true; } </syntaxhighlight> {{Collapse_bottom}} <span id="Python_command-line_client_using_mwoauth"></span> === Клиент Python для командной строки, использующий mwoauth === {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Python source code</span>}} <syntaxhighlight lang="python"> from mwoauth import ConsumerToken, Handshaker import requests from requests_oauthlib import OAuth1 from six.moves import input # For compatibility between python 2 and 3 # Consruct a "consumer" from the key/secret provided by MediaWiki import config # You'll need to provide this # Create a file called config.py somewhere where it will be found by python, e.g. in the same directory as this script, with the following content (not including the # characters!) # consumer_key = "the consumer token you got when you registered your applicaton" # consumer_secret = "the secret token you got when you registered your application" # For example: # consumer_key = "20bc67da5081a30c736340c493f60d14" # consumer_secret = "af4313371bb2fb38e81fe7d300080085f52849f9" consumer_token = ConsumerToken(config.consumer_key, config.consumer_secret) # Construct handshaker with wiki URI and consumer handshaker = Handshaker("https://en.wikipedia.org/w/index.php", consumer_token) # Step 1: Initialise -- ask MediaWiki for a temporary key/secret for user redirect, request_token = handshaker.initiate() # Step 2: Authorise -- send user to MediaWiki to confirm authorisation print("Point your browser to: %s" % redirect) # response_qs = input("Response query string: ") # Step 3: Complete -- obtain authorised key/secret for "resource owner" access_token = handshaker.complete(request_token, response_qs) # Construct an auth object with the consumer and access tokens auth1 = OAuth1(consumer_token.key, client_secret=consumer_token.secret, resource_owner_key=access_token.key, resource_owner_secret=access_token.secret) # Now, accessing the API on behalf of a user print("Reading top 10 watchlist items") response = requests.get( "https://en.wikipedia.org/w/api.php", params={ 'action': "query", 'list': "watchlist", 'wllimit': 10, 'wlprop': "title|comment", 'format': "json" }, auth=auth1 ) for item in response.json()['query']['watchlist']: print("{title}\t{comment}".format(**item)) </syntaxhighlight> {{Collapse_bottom}} <span id="Python_Toolforge_tutorial_using_mwoauth"></span> === Туториал для Python по Toolforge, использующий mwoauth === Смотрите: [[wikitech:Help:Toolforge/My first Flask OAuth tool]] === Python Toolforge tutorial using authlib (OAuth 2.0) === {{Collapse_top|title=Python source code}} <syntaxhighlight lang="python"> # > requirements.txt # flask==3.1.3 # requests==2.33.1 # authlib==1.7.0 # > config.py OAUTH_ACCESS_TOKEN_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/access_token" OAUTH_API_BASE_URL = "https://commons.wikimedia.org/w/" OAUTH_AUTHORIZE_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/authorize" OAUTH_CODE_CHALLENGE_METHOD = "S256" OAUTH_CONSUMER_KEY = "Y" OAUTH_CONSUMER_SECRET = "Z" OAUTH_SCOPE = "basic editpage" # > app.py from authlib.integrations.flask_client import FlaskOAuth2App, OAuth from flask import Flask, jsonify, redirect, request, session from requests import Response app = Flask() app.config.from_pyfile("config.py") oauth = OAuth(app) oauth.register( name="mediawiki", client_id=app.config["OAUTH_CONSUMER_KEY"], client_secret=app.config["OAUTH_CONSUMER_SECRET"], client_kwargs={ "code_challenge_method": app.config["OAUTH_CODE_CHALLENGE_METHOD"], "scope": app.config["OAUTH_SCOPE"], }, api_base_url=app.config["OAUTH_API_BASE_URL"], access_token_url=app.config["OAUTH_ACCESS_TOKEN_URL"], authorize_url=app.config["OAUTH_AUTHORIZE_URL"], ) oauth_client: FlaskOAuth2App = oauth.create_client("mediawiki") @app.route("/") def index(): return app.send_static_file("index.html") @app.route("/login") def login(): return oauth_client.authorize_redirect() @app.route("/oauth-callback") def auth(): token = oauth_client.authorize_access_token() session["token"] = token return redirect("/") @app.route("/logout") def logout(): session.pop("token", None) session.clear() return redirect("/") @app.route("/user") def user(): response: Response = oauth_client.request( "GET", "rest.php/oauth2/resource/profile", token=session["token"], ) user = response.json() response.raise_for_status() return jsonify(user=user) @app.route("/edit", methods=["POST"]) def edit(): data = request.get_json() pageid = int(data["pageid"]) response: Response = oauth_client.request( "POST", "api.php", token=session["token"], data=dict( format="json", formatversion="2", action="query", pageids=str(pageid), prop="revisions|wbentityusage", rvprop="content", rvslots="*", meta="tokens", ), ) r = response.json() token = r["query"]["tokens"]["csrftoken"] ... </syntaxhighlight> {{Collapse_bottom}} <span id="Go_command-line_client_using_mrjones/auth_(OAuth_1.0)"></span> <div class="mw-translate-fuzzy"> === Go клиент командной строки на основе mrjones/auth === </div> Прежде чем вы начнете: <syntaxhighlight lang="shell-session"> $ go get github.com/mrjones/oauth </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Go source code</span>}} <syntaxhighlight lang="go"> package main import ( "fmt" "os" "github.com/mrjones/oauth" "io/ioutil" "strconv" ) func main() { var consumerKey string = "" var consumerSecret string = "" if len(consumerKey) == 0 || len(consumerSecret) == 0 { os.Exit(1) } c := oauth.NewConsumer( consumerKey, consumerSecret, oauth.ServiceProvider{ RequestTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/initiate", AuthorizeTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/authorize", AccessTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/token", }) c.Debug(true) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/initiate", } c.AdditionalAuthorizationUrlParams = map[string]string{ "oauth_consumer_key": consumerKey, } requestToken, url, err := c.GetRequestTokenAndUrl("oob") if err != nil { fmt.Println( err ) } fmt.Println( "Got token " + requestToken.Token ) fmt.Println("(1) Go to: " + url) fmt.Println("(2) Grant access, you should get back a verification code.") fmt.Println("(3) Enter that verification code here: ") verificationCode := "" fmt.Scanln(&verificationCode) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/token", } accessToken, err := c.AuthorizeToken(requestToken, verificationCode) if err != nil { fmt.Println(err) } fmt.Println( "Got access token " + accessToken.Token ) c.AdditionalParams = map[string]string{} response, err := c.Get( "http://<wiki>/wiki/api.php", map[string]string{ "action": "query", "meta": "userinfo", "uiprop": "rights", "format": "json", }, accessToken) if err != nil { fmt.Println(err) } fmt.Println( "\tResponse Status: '" + response.Status + "'\n" ) fmt.Println( "\tResponse Code: " + strconv.Itoa(response.StatusCode) + "\n" ) bytes, _ := ioutil.ReadAll(response.Body) fmt.Println( "\tResponse Body: " + string(bytes) + "\n" ) } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === JavaScript applications using OAuth 2 === </div> * [https://github.com/wikimedia/apiclient-wiki wikimedia/apiclient-wiki] – <span lang="en" dir="ltr" class="mw-content-ltr">entire application in 520 lines of code</span> <span id="Full_applications_using_OAuth"></span> === Полные приложения, использующие OAuth === * [https://github.com/jdlrobson/weekipedia/blob/master/libs/server/app.js Weekipedia], <span lang="en" dir="ltr" class="mw-content-ltr">A full scale React.js port of the Wikipedia mobile site uses both.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">many [https://toolhub.wikimedia.org/search?keywords__term=oauth Toolforge tools]</span> <span id="Notes"></span> ==Заметки== <references /> 3ur8zuu8no2g3keii6mnp10ihfhamnl OAuth/For Developers/en 0 919376 8364285 8350291 2026-05-03T12:27:43Z FuzzyBot 451990 Updating to match new version of source page 8364285 wikitext text/x-wiki <languages /> This page explains how to develop applications that can integrate with a wiki running {{ll|Extension:OAuth}} (an extension which turns MediaWiki into an [[w:OAuth|OAuth]] server) to securely request permission to act on the user's behalf. {{Note|1=If you are developing a bot or similar application that always uses the same account, you might prefer the simpler [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]].}} == OAuth in a nutshell == OAuth allows an application to request permission from a user to act through that user's wiki account, without knowing the user's password, and without being able to do everything the user could (e.g. the app might be able to edit articles but not delete them, so even users with extended permissions can safely use OAuth-enabled tools). This happens via the [https://oauth.net/2/ OAuth 2.0] or [https://oauth.net/core/1.0a/ OAuth 1.0a] protocol, and consists of three stages: # The developer must register the application (often called "consumer" in the OAuth terminology) on the wiki, possibly go through some sort of review process, and will receive some credentials. # When a user wants to use it, the application must initiate an authorisation process. This will involve sending the user to a special page on the wiki, which will display an authorisation dialog. If the user accepts, the application will receive another set of credentials (which are specific to that user, and can be revoked by the user at any time). # When the application actually needs to make an action (API request) on the user's behalf, it can combine the credentials received in steps 1 and 2 to sign the request. OAuth is a widely used open standard (you can see it on sites like Google or Facebook or GitHub, e.g. when using accounts at those sites to log in elsewhere). {{info|1=OAuth should not be confused with: * [[w:Initiative for Open Authentication|OATH]] (a second-factor authentication protocol family, commonly known as "type the six numbers you see on your mobile app", now enabled on Wikimedia sites) * [[w:OpenID Connect|OpenID Connect]] (an authentication protocol based on OAuth 2.0, which the OAuth MediaWiki extension partially supports). }} For a slightly larger nutshell on OAuth 1.0a, see [https://docs.google.com/presentation/d/1537HnwSaSzH-b8hINcz48SNhT8ElAUPC39to0_O1iNA/edit#slide=id.g15105b408d_0_287 these slides]. == OAuth in detail == The registration is basically the same for OAuth 1.0a and OAuth 2, with the difference being only the presence of a few form fields. The remaining parts differ significantly depending on the OAuth version. Generally, OAuth 2 is recommended if available in your environment. === Registration === To register a new OAuth application, submit the form at <code>[[m:Special:OAuthConsumerRegistration/propose|Special:OAuthConsumerRegistration/propose]]</code>. Try to give sufficient information about the application for admins and users to decide whether it can be trusted. URLs to places with more information (such as the application itself, the source code or on-wiki documentation) can be useful. For OAuth applications to be used on Wikimedia projects, see [[meta:Special:MyLanguage/OAuth app guidelines|app guidelines]]. Besides the descriptive ones, the fields have the following meaning: * <code>This consumer is for use only by {{tag|user|open|plain=1}}</code>: whether you use [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]] (which do not need to be reviewed or authorised but are only usable by yourself). * <code>callback URL</code> (irrelevant to owner-only consumers): the URL where the user returns after authorisation is checked against this. (This is an extra layer of security against an attacker trying to steal credentials during authorisation.) If the <code>use as prefix</code> option is enabled, the URL must start with this (the check is dumb so make sure to add at least a <code>/</code> after the domain name), otherwise it must be an exact match. If you are developing/testing your local machine, specify [[w:Localhost|Localhost]] in this field (e.g. <code><nowiki>http://localhost:8080/</nowiki></code>). * <code>Applicable project</code> (for wiki farms only): project(s) on which to use your application. You can limit the application to a single wiki or have it work everywhere. * <code>Types of grants</code> / <code>Applicable grants</code>: the permissions needed by your application (be conservative). The actual permissions will be an intersection of this and what permissions the user has. Currently, the user must authorise grouped permissions, not individual ones ([[Phab:T59505|T59505]]). * <code>Allowed IP ranges</code>: an optional specification of the IP ranges that you use, where OAuth requests not matching this will be rejected. This is an extra layer of security against an attacker stealing your application's credentials and trying to impersonate it. This is one of the few settings that you'll be able to change later. * <code>Public RSA key</code> (OAuth 1.0a only): public key used by your application for signing requests. You can just leave this empty (most applications do) to use a slightly simpler shared-secret mechanism instead. This is one of the few settings that you'll be able to change later. After registration, you'll receive the credentials needed to use OAuth. You will be able to use it immediately with your own user account (this is meant for testing); others will only be able to use it once it is approved by an administrator. The list of applications (approved or otherwise) is public and can be browsed at <code>[[m:Special:OAuthListConsumers|Special:OAuthListConsumers]]</code>. === OAuth 1.0a === ==== Authorisation ==== [[File:OAuth authorization interface.png|thumb|Authorisation dialog shown to users]] When registering the application, you receive two pieces of credentials: the application token (a public ID for the application) and the application secret (sort of like a password). To be able to identify a user or make API requests in their name, you need to get another set of credentials (these ones specific to that user): the access token and access secret.<ref> With an RSA key the credentials are slightly different. It is assumed that people choosing to use an RSA key know what they are doing, so this tutorial will assume you have chosen the non-RSA option. </ref> To get them, you need to go through the authorisation process, which consists of three steps:<ref> This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available. See {{ll|OAuth/Owner-only consumers|owner-only consumers}} for that. </ref> # Get a request token from the wiki by sending a GET request to <code>Special:OAuth/initiate</code>, signed with the application key and secret, with the callback URL (where the user will be sent after a successful authorisation) passed as the <code>oauth_callback</code> query parameter (if you have set a constant URL at registration, the value of the parameter ''must'' be <code>oob</code>).<ref name="non-nice-url">Due to [[phab:T59500]] you must currently use a non-nice URL such as <code>en.wikipedia.org/w/index.php?title=Special:OAuth/initiate</code>.</ref> If you are successful, the response will be a JSON object with <code>token</code> and <code>key</code> fields—the request token and request secret. (If not, it will have an <code>error</code> field.) # Ask the user to authorise the application by sending them to <code>Special:OAuth/authorize</code>, with the application token and request token passed as query parameters (<code>oauth_consumer_key</code> and <code>oauth_token</code>, respectively). The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel. # If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1). A query parameter called <code>oauth_verifier</code> will contain the verification code that you can use to exchange the request token and secret for the access token and secret. To do this, send a request to <code>Special:OAuth/token</code><ref name="non-nice-url" /> which includes the <code>oauth_verifier</code> parameter you just received and is signed with the application token and secret and the request token and secret. The response will contain the access token/secret (in the same format as the request token/secret in step 1). The access token and secret is what you'll need to sign API requests. The request token and secret is not useful anymore and can be discarded. The access token will remain valid indefinitely, unless the user revokes it. (If you prefer not to store it, you can just repeat the authorisation process at any time though.) Applications which only need minimal privileges (have been registered as ''User identity verification only'') can use <code>/authenticate</code> instead of <code>/authorize</code> in step 2. This works the same way, but the user will only see the authorisation dialog if they have not authorised this application before; otherwise the authorisation will silently succeed. Chances are whatever language/framework you are using will have a library to support this procedure, so you don't have to implement it manually—each step will be a single function call. See below for examples. ==== Making requests on the user's behalf ==== To take advantage of the authorisation, requests have to be signed with the application token/secret and access token/secret. When that's successfully done, the wiki will treat the request as if it was made by the authorising user. Only API requests can be made via OAuth, with one exception (see next section). Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled. Applications registered as ''User identity verification only'' cannot use the API at all. ==== Identifying the user ==== The OAuth extension includes a custom protocol (similar to OpenID Connect) for authenticating the user. To use this, send a signed OAuth request to <code>Special:OAuth/identify</code>:<ref name="non-nice-url" /> the response will be a [[w:JSON Web Token|JWT]] (JSON Web Token &ndash; a signed JSON object) including the name of the user, their {{ll|Manual:Central ID|central ID}} (under the key <code>sub</code>) and various other information (such as their user groups and whether they are blocked; also the email address if the application was registered with the right grant type). This is more secure than using the API (e.g. the userinfo module) for authentication, which could be subject to [[w:Man-in-the-middle attack|man-in-the-middle attacks]]; always use this if you need to identify a user! Also, make sure you properly validate the JWT (there are many libraries which can help with that). You should check each of the following: the issuer (<code>iss</code>) matches the domain name of the wiki, the audience (<code>aud</code>) matches your application key, the issued-at time (<code>iat</code>) is in the past and reasonably close to current time, the expiration time (<code>exp</code>) is in the future, the nonce (<code>nonce</code>) matches the one you sent in the request. ==== Signing requests ==== Steps 1 and 3 of the authorisation process require signing the request; API requests and <code>Special:OAuth/identify</code> must likewise be signed. The signing process is detailed in [https://oauth.net/core/1.0a/#signing_process section 9 of the OAuth spec], but it is cumbersome to implement by hand and [https://oauth.net/1/ many libraries] are available. You can find code samples and an overview of how to do it by hand in the {{ll|OAuth/Owner-only_consumers|owner-only consumer}} documentation. (That is for signing with the consumer token/secret and access token/secret. Modify as appropriate to sign with the consumer token/secret and request token/secret (authorisation step 3) or consumer token/secret only (authorisation step 1).) === OAuth 2 === ==== Authorisation ==== When registering the application, you receive two pieces of credentials: the client application key (a public ID for the application, also called the client ID or consumer key) and the client application secret (a confidential password). To be able to identify a user or make API requests in their name, you need to get another credential (this one specific to that user): the access token. To get it, you need to go through the [https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/ the OAuth 2 Authorization Code flow], which consists of two steps:<ref>This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available. See [[Special:MyLanguage/OAuth/Owner-only consumers|owner-only consumers]] for that.</ref> # Ask the user to authorise the application by sending them to <code>oauth2/authorize</code> under the wiki's REST endpoint (usually <code>rest.php</code>), with <code>response_type=code</code> and the consumer key (also called the client application key) as the <code>client_id</code>, possibly a <code>state</code> if you want, and optionally the <code>redirect_uri</code> (if yes, it must be the same as in your application request). If your consumer is non-confidential, you'll also need to include a [https://www.oauth.com/oauth2-servers/pkce/authorization-request/ PKCE code challenge] (<code>code_challenge</code> and <code>code_challenge_method=S256</code>).<ref>PKCE &mdash; Proof Key for Code Exchange</ref> The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel. # If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1). A query parameter called <code>code</code> will contain the authorisation code that you can use to fetch the access token. To do this, send a POST request to <code>oauth2/access_token</code> under the wiki's REST endpoint (usually <code>rest.php</code>), including <code>grant_type=authorization_code</code>, the <code>code</code> parameter you just received, your client authentication (typically as <code>client_id</code> and, for confidential clients, <code>client_secret</code>), the <code>redirect_uri</code> if and only if you specified it in the previous step (must be the same value for both), and if non-confidential the PKCE <code>code_verifier</code> and <code>code_challenge_method</code>. The response will contain the access token and a refresh token. The access token is what you'll need to send future API requests. The refresh token can be used to [https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/ fetch a new access token] if the original access token expires. If you prefer not to store either token, you can just repeat the authorisation process at any time. (Before MediaWiki 1.46, non-confidential clients could only use refresh tokens using their client secret keys, not using their client IDs only, see [[phabricator:T323855|T323855]].) Chances are whatever language/framework you are using will have a library to support this procedure so you don't have to implement it manually - each step will be a single function call. See below for examples. ==== Making requests on the user's behalf ==== To take advantage of the authorisation, requests have to include the access token. When that's successfully done, the wiki will treat the request as if it was made by the authorising user. Only API requests can be made via OAuth 2. Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled. If the access token is used to fetch a CSRF token or other tokens, the access token must still be passed (as a header) with requests that use those tokens. Applications which need minimal privileges (have been registered as ''User identity verification only'') cannot use the API at all. API requests including <code>rest.php/oauth2/resource/profile</code> must be authenticated with an HTTP Authorization header containing the access token, like: <pre> Authorization: Bearer abcde....6789 </pre> ==== Identifying the user ==== The OAuth extension includes a somewhat incomplete implementation of OpenID Connect for authenticating the user.<ref>See [[phab:T254063|T254063]] for details.</ref> To use this, send an authenticated OAuth GET request to the <code>oauth2/resource/profile</code> API (MediaWiki's implementation of what the OIDC spec calls the UserInfo endpoint) under the wiki's REST endpoint (usually <code>rest.php</code>); the response will include the name of the user and various other information. Note that the GET request must use the HTTP <code>Authorization</code> header, not a query string token. * '''sub''' (central user ID) * '''username''' * '''editcount''' * '''confirmed_email''' * '''blocked''' * '''registered''' * '''groups''' * '''rights''' * '''realname''' (only if user granted permission) * '''email''' (only if user granted permission) == Setting up a development environment == You can register an OAuth application on [https://meta.wikimedia.beta.wmflabs.org/wiki/Special:OAuthConsumerRegistration/propose beta meta] and test your code against that. If you want to improve the extension itself, or debug protocol issues in detail, OAuth is available in the {{ll|MediaWiki-Vagrant}} development environment. Add the <code>oauth</code> role, and your local wiki will be able to authorise OAuth apps. <syntaxhighlight lang="shell-session"> $ vagrant roles enable oauth $ vagrant provision </syntaxhighlight> Once the code is nearly ready, you can register an OAuth application on the real wiki. You will be able to test it with the same user account used for registering, even before it gets reviewed by admins. If you are creating an application for Wikimedia projects, consider hosting it at [[Wikitech:Portal:Toolforge|Wikimedia Toolforge]], a free tool forge and hosting platform for Wikimedia-related services. == Security benefits and trade-offs == * Unlike password-based authentication, the OAuth 1.0 protocol prevents any [[w:Man-in-the-middle attack|man-in-the-middle attack]] even if the wiki does not require HTTPS: all interactions between MediaWiki and the application are signed with either a shared secret (using HMAC-SHA1), or a [[w:Public-key cryptography|public key]] (RSA). HTTPS is still required for certain steps though (for obtaining the shared secret in the second step of authorisation when not using RSA, and during app registration). OAuth 2.0 does not involve signing and relies on HTTPS for security. * Actions via OAuth happen under the user's name but will be [[Special:MyLanguage/Manual:Tags|tagged]] with the application's name as well so rogue applications can be identified. Wiki admins can revoke the application's permissions (and thus bar it from any further action) if needed. * The user can revoke the permission of the application to use that specific user account if they don't like how it works or don't trust it anymore. Unlike a password change, this is not disruptive for the user. * Sufficiently flexible applications might allow users to circumvent IP blocks (since MediaWiki will see the IP of the application server, not that of the user). This can be handled the same way proxies are, by trusting XFF headers set by the application (see [[Phab:T159889|T159889]] for some limitations). * The application secret must be kept secret. Submitting it to source control or putting it into user-accessible code (such as mobile app or desktop application; even if it is obfuscated) undermines the security model and will result in admins forcefully disabling the application. Exceptions are made for example applications demoing OAuth usage, if they are explicitly labeled as such and request limited rights. == Libraries == === PHP === * [[oauthclient-php]] – OAuth 1.0a client library maintained by Wikimedia * [https://php.net/book.oauth OAuth] – PECL client library * [https://github.com/firebase/php-jwt firebase/php-jwt] – a popular JWT library * [https://sr.ht/~taavi/laravel-socialite-mediawiki/ laravel-socialite-mediawiki] – MediaWiki driver for [[w:Laravel|Laravel]]'s [https://laravel.com/docs/7.x/socialite Socialite] library. === Python === * [https://github.com/valhallasw/flask-mwoauth flask-mwoauth] – a Flask blueprint to run OAuth against MediaWiki's Extension:OAuth (See tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Flask_OAuth_tool My first Flask OAuth tool]) * [https://github.com/wikimedia/MediaWiki-OAuth MediaWiki-OAuth (mwoauth)] – OAuth 1.0a on top of [http://requests-oauthlib.readthedocs.org/en/latest/oauth1_workflow.html requests-oauthlib] * [https://github.com/python-social-auth/social-core python-social-auth] – auth framework that includes a [https://github.com/python-social-auth/social-core/blob/master/social_core/backends/mediawiki.py MediaWiki backend] (Example tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Django_OAuth_tool My first Django OAuth tool]) * [https://docs.authlib.org/en/latest/index.html authlib] – auth framework to interact with Wikimedia OAuth 2.0 API (Full minimal Django OAuth 2.0 [https://code.basabuuka.org/alpcentaur/wmde_oauth_django_example example]) * [https://github.com/jpadilla/pyjwt pyjwt] – a JWT library === Ruby === * [https://github.com/timwaters/omniauth-mediawiki omniauth-mediawiki] – a MediaWiki strategy for OmniAuth (also available as a [https://rubygems.org/gems/omniauth-mediawiki gem]) === Rust === * [https://crates.io/crates/mediawiki MediaWiki crate] implements both OAuth1 and OAuth2 login mechanisms. * [https://crates.io/crates/oauth2 oauth2 crate] === Node.js === * [https://www.npmjs.com/package/passport-mediawiki-oauth passport-mediawiki-oauth] – MediaWiki strategy for the Passport auth framework (which can be used effortlessly as a middleware with Express JS and similar frameworks) * [https://www.npmjs.com/package/oauth-fetch-json oauth-fetch-json] – library for signing OAuth requests * [https://www.npmjs.com/package/m3api-oauth2 m3api-oauth2] – an extension package for [https://www.npmjs.com/package/m3api m3api], making it easy to make requests authenticated via [[Special:MyLanguage/Help:OAuth|OAuth 2.0]] === Go === * [https://github.com/mrjones/oauth mrjones/oauth] (OAuth 1.0) * [https://pkg.go.dev/golang.org/x/oauth2 golang.org/x/oauth2] (OAuth 2.0, [https://pkg.go.dev/golang.org/x/oauth2#example-Config example]) === Java === * [https://github.com/scribejava/scribejava ScribeJava] since version 5.5.0 ([https://github.com/scribejava/scribejava/pull/852 pull request]) == Example code == === PHP client without using any libraries === [[toollabs:oauth-hello-world|OAuth Hello World]] – easy to understand demo application written in PHP without any libraries. === PHP command-line client with RSA keys, using oauthclient-php === PHP application using classes from the OAuth extension codebase. {{Todo|1=convert this to actually use oauthclient-php! Probably just a bunch of <code>use</code> declarations.}} Before Starting: <syntaxhighlight lang="shell-session"> $ openssl genrsa -out appkey.pem 4096 $ openssl rsa -in appkey.pem -pubout > appkey.pub </syntaxhighlight> {{Collapse_top|title=PHP source code}} <syntaxhighlight lang="php"> <?php if ( PHP_SAPI !== 'cli' ) { die( "CLI-only test script\n" ); } /** * A basic client for overall testing */ function wfDebugLog( $method, $msg) { //echo "[$method] $msg\n"; } require 'OAuth.php'; require 'MWOAuthSignatureMethod.php'; $consumerKey = ''; #$consumerSecret = ''; // We don't need this, since we're using RSA, except to validate the /identify call $privateKey = file_get_contents( 'appkey.pem' ); $baseurl = 'http://<wiki>/wiki/Special:OAuth'; $endpoint_req = $baseurl . '/initiate?format=json&oauth_callback=oob'; // format=json makes php a little easier $endpoint_acc = $baseurl . '/token?format=json'; $endpoint_id = $baseurl . '/identify'; $c = new OAuthConsumer( $consumerKey, $privateKey ); // Make sure we sign title and format $parsed = parse_url( $endpoint_req ); $extraSignedParams = array(); parse_str($parsed['query'], $extraSignedParams); $extraSignedParams['title'] = 'Special:OAuth/initiate'; $init_req = OAuthRequest::from_consumer_and_token( $c, // OAuthConsumer for your app NULL, // User token, NULL for calls to initiate "GET", // http method $endpoint_req, // endpoint url (this is signed) $extraSignedParams // extra parameters we want to sign (must include title) ); $rsa_method = new MWOAuthSignatureMethod_RSA_SHA1( new OAuthDataStore(), $privateKey ); $init_req->sign_request( $rsa_method, // OAuthSignatureMethod $c, // OAuthConsumer for your app NULL // User token, NULL for calls to initiate ); echo "Getting request token with: $init_req\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, (string) $init_req ); // Pass OAuth in GET params curl_setopt( $ch, CURLOPT_HTTPGET, true ); curl_setopt( $ch, CURLOPT_HEADER, false ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $requestToken = json_decode( $data ); print "Visit $baseurl/authorize?oauth_token={$requestToken->key}&oauth_consumer_key=$consumerKey\n"; // ACCESS TOKEN print "Enter the verification code:\n"; $fh = fopen( "php://stdin", "r" ); $line = fgets( $fh ); $rc = new OAuthToken( $requestToken->key, $requestToken->secret ); $parsed = parse_url( $endpoint_acc ); parse_str($parsed['query'], $params); $params['oauth_verifier'] = trim($line); $params['title'] = 'Special:OAuth/token'; $acc_req = OAuthRequest::from_consumer_and_token( $c, $rc, "GET", $endpoint_acc, $params ); $acc_req->sign_request($rsa_method, $c, $rc); echo "Calling: $acc_req\n"; unset( $ch ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_acc ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $acc_req->to_header() ) ); // Set the Authorization Header $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $acc = json_decode( $data ); $accessToken = new OAuthToken( $acc->key, $acc->secret ); /** * Insecurely call the api for information about the user. * A MITM can forge a response from the server, so don't rely on this for identity! */ $apiurl = 'http://<wiki>/w/api.php'; $apiParams = array( 'action' => 'query', 'meta' => 'userinfo', 'uiprop' => 'rights', 'format' => 'json', ); $api_req = OAuthRequest::from_consumer_and_token( $c, // Consumer $accessToken, // User Access Token "GET", // HTTP Method $apiurl, // Endpoint url $apiParams // Extra signed parameters ); $api_req->sign_request( $rsa_method, $c, $accessToken ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $apiurl . "?" . http_build_query( $apiParams ) ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $api_req->to_header() ) ); // Authorization header required for api $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; /** * Securely get the identity of the user */ $consumerSecret = ''; $extraSignedParams = array( 'title' => 'Special:OAuth/identify' ); $req = OAuthRequest::from_consumer_and_token( $c, $accessToken, "GET", $endpoint_id, $extraSignedParams ); $req->sign_request( $rsa_method, $c, $accessToken ); echo "Calling: '$endpoint_id'\nHeader: {$req->to_header()}\n\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_id ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $req->to_header() ) ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } $identity = JWT::decode( $data, $consumerSecret ); // Validate the JWT if ( !validateJWT( $identity, $consumerKey, $req->get_parameter( 'oauth_nonce' ) ) ) { print "The JWT did not validate"; } else { print "We got a valid JWT, describing the user as:\n"; print " * Username: {$identity->username}\n"; print " * User's current groups: " . implode( ',', $identity->groups ) . "\n"; print " * User's current rights: " . implode( ',', $identity->rights ) . "\n"; } /** * Validate a JWT, to ensure this isn't a reply, spoof, etc. * @param $identity the decoded JWT * @param $consumerKey your App's Key * @param $nonce the nonce sent with your request, which should be returned */ function validateJWT( $identity, $consumerKey, $nonce ) { $expectedConnonicalServer = 'http://<wiki>'; // Verify the issuer is who we expect (server sends $wgCanonicalServer) if ( $identity->iss !== $expectedConnonicalServer ) { print "Invalid Issuer"; return false; } // Verify we are the intended audience if ( $identity->aud !== $consumerKey ) { print "Invalid Audience"; return false; } // Verify we are within the time limits of the token. // Issued at (iat) should be in the past, // Expiration (exp) should be in the future. $now = time(); if ( $identity->iat > $now || $identity->exp < $now ) { print "Invalid Time"; return false; } // Verify we haven't seen this nonce before, which would indicate a replay attack if ( $identity->nonce !== $nonce ) { print "Invalid Nonce"; return false; } return true; } </syntaxhighlight> {{Collapse_bottom}} === Python command-line client using mwoauth === {{Collapse_top|title=Python source code}} <syntaxhighlight lang="python"> from mwoauth import ConsumerToken, Handshaker import requests from requests_oauthlib import OAuth1 from six.moves import input # For compatibility between python 2 and 3 # Consruct a "consumer" from the key/secret provided by MediaWiki import config # You'll need to provide this # Create a file called config.py somewhere where it will be found by python, e.g. in the same directory as this script, with the following content (not including the # characters!) # consumer_key = "the consumer token you got when you registered your applicaton" # consumer_secret = "the secret token you got when you registered your application" # For example: # consumer_key = "20bc67da5081a30c736340c493f60d14" # consumer_secret = "af4313371bb2fb38e81fe7d300080085f52849f9" consumer_token = ConsumerToken(config.consumer_key, config.consumer_secret) # Construct handshaker with wiki URI and consumer handshaker = Handshaker("https://en.wikipedia.org/w/index.php", consumer_token) # Step 1: Initialise -- ask MediaWiki for a temporary key/secret for user redirect, request_token = handshaker.initiate() # Step 2: Authorise -- send user to MediaWiki to confirm authorisation print("Point your browser to: %s" % redirect) # response_qs = input("Response query string: ") # Step 3: Complete -- obtain authorised key/secret for "resource owner" access_token = handshaker.complete(request_token, response_qs) # Construct an auth object with the consumer and access tokens auth1 = OAuth1(consumer_token.key, client_secret=consumer_token.secret, resource_owner_key=access_token.key, resource_owner_secret=access_token.secret) # Now, accessing the API on behalf of a user print("Reading top 10 watchlist items") response = requests.get( "https://en.wikipedia.org/w/api.php", params={ 'action': "query", 'list': "watchlist", 'wllimit': 10, 'wlprop': "title|comment", 'format': "json" }, auth=auth1 ) for item in response.json()['query']['watchlist']: print("{title}\t{comment}".format(**item)) </syntaxhighlight> {{Collapse_bottom}} === Python Toolforge tutorial using mwoauth === See: [[wikitech:Help:Toolforge/My first Flask OAuth tool]] === Python Toolforge tutorial using authlib (OAuth 2.0) === {{Collapse_top|title=Python source code}} <syntaxhighlight lang="python"> # > requirements.txt # flask==3.1.3 # requests==2.33.1 # authlib==1.7.0 # > config.py OAUTH_ACCESS_TOKEN_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/access_token" OAUTH_API_BASE_URL = "https://commons.wikimedia.org/w/" OAUTH_AUTHORIZE_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/authorize" OAUTH_CODE_CHALLENGE_METHOD = "S256" OAUTH_CONSUMER_KEY = "Y" OAUTH_CONSUMER_SECRET = "Z" OAUTH_SCOPE = "basic editpage" # > app.py from authlib.integrations.flask_client import FlaskOAuth2App, OAuth from flask import Flask, jsonify, redirect, request, session from requests import Response app = Flask() app.config.from_pyfile("config.py") oauth = OAuth(app) oauth.register( name="mediawiki", client_id=app.config["OAUTH_CONSUMER_KEY"], client_secret=app.config["OAUTH_CONSUMER_SECRET"], client_kwargs={ "code_challenge_method": app.config["OAUTH_CODE_CHALLENGE_METHOD"], "scope": app.config["OAUTH_SCOPE"], }, api_base_url=app.config["OAUTH_API_BASE_URL"], access_token_url=app.config["OAUTH_ACCESS_TOKEN_URL"], authorize_url=app.config["OAUTH_AUTHORIZE_URL"], ) oauth_client: FlaskOAuth2App = oauth.create_client("mediawiki") @app.route("/") def index(): return app.send_static_file("index.html") @app.route("/login") def login(): return oauth_client.authorize_redirect() @app.route("/oauth-callback") def auth(): token = oauth_client.authorize_access_token() session["token"] = token return redirect("/") @app.route("/logout") def logout(): session.pop("token", None) session.clear() return redirect("/") @app.route("/user") def user(): response: Response = oauth_client.request( "GET", "rest.php/oauth2/resource/profile", token=session["token"], ) user = response.json() response.raise_for_status() return jsonify(user=user) @app.route("/edit", methods=["POST"]) def edit(): data = request.get_json() pageid = int(data["pageid"]) response: Response = oauth_client.request( "POST", "api.php", token=session["token"], data=dict( format="json", formatversion="2", action="query", pageids=str(pageid), prop="revisions|wbentityusage", rvprop="content", rvslots="*", meta="tokens", ), ) r = response.json() token = r["query"]["tokens"]["csrftoken"] ... </syntaxhighlight> {{Collapse_bottom}} === Go command-line client using mrjones/auth (OAuth 1.0) === Before you begin: <syntaxhighlight lang="shell-session"> $ go get github.com/mrjones/oauth </syntaxhighlight> {{Collapse_top|title=Go source code}} <syntaxhighlight lang="go"> package main import ( "fmt" "os" "github.com/mrjones/oauth" "io/ioutil" "strconv" ) func main() { var consumerKey string = "" var consumerSecret string = "" if len(consumerKey) == 0 || len(consumerSecret) == 0 { os.Exit(1) } c := oauth.NewConsumer( consumerKey, consumerSecret, oauth.ServiceProvider{ RequestTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/initiate", AuthorizeTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/authorize", AccessTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/token", }) c.Debug(true) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/initiate", } c.AdditionalAuthorizationUrlParams = map[string]string{ "oauth_consumer_key": consumerKey, } requestToken, url, err := c.GetRequestTokenAndUrl("oob") if err != nil { fmt.Println( err ) } fmt.Println( "Got token " + requestToken.Token ) fmt.Println("(1) Go to: " + url) fmt.Println("(2) Grant access, you should get back a verification code.") fmt.Println("(3) Enter that verification code here: ") verificationCode := "" fmt.Scanln(&verificationCode) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/token", } accessToken, err := c.AuthorizeToken(requestToken, verificationCode) if err != nil { fmt.Println(err) } fmt.Println( "Got access token " + accessToken.Token ) c.AdditionalParams = map[string]string{} response, err := c.Get( "http://<wiki>/wiki/api.php", map[string]string{ "action": "query", "meta": "userinfo", "uiprop": "rights", "format": "json", }, accessToken) if err != nil { fmt.Println(err) } fmt.Println( "\tResponse Status: '" + response.Status + "'\n" ) fmt.Println( "\tResponse Code: " + strconv.Itoa(response.StatusCode) + "\n" ) bytes, _ := ioutil.ReadAll(response.Body) fmt.Println( "\tResponse Body: " + string(bytes) + "\n" ) } </syntaxhighlight> {{Collapse_bottom}} === JavaScript applications using OAuth 2 === * [https://github.com/wikimedia/apiclient-wiki wikimedia/apiclient-wiki] – entire application in 520 lines of code === Full applications using OAuth === * [https://github.com/jdlrobson/weekipedia/blob/master/libs/server/app.js Weekipedia], A full scale React.js port of the Wikipedia mobile site uses both. * many [https://toolhub.wikimedia.org/search?keywords__term=oauth Toolforge tools] ==Notes== <references /> pv7vfdbfdhsgrwjf85dapmkjy6hnx3b OAuth/For Developers/ja 0 919378 8364291 8350295 2026-05-03T12:27:48Z FuzzyBot 451990 Updating to match new version of source page 8364291 wikitext text/x-wiki <languages /> このページでは、MediaWikiサーバーへの操作リクエストを安全に行うために使用される、{{ll|Extension:OAuth}} (MediaWikiを[[w:OAuth|OAuth]]サーバーに対応させる拡張機能) がインストールされたウィキにおいて、アプリケーションを開発する方法を解説します。 {{Note|1=ボットや同様のアプリケーションを開発しており、常に同じアカウントを使用する場合は、より単純な[[Special:MyLanguage/OAuth/Owner-only_consumers|所有者専用コンシューマー]]を使用するほうがいいかもしれません。}} <span id="OAuth_in_a_nutshell"></span> == OAuthの概要 == OAuth は、利用者のパスワードを知らずに、利用者のウィキ アカウントを通じて操作の許可をアプリケーションがリクエストできる仕組みであり、利用者ができるすべての操作を行えるわけではありません (例: アプリケーションは記事の編集はできても削除はできないなど)。そのため、拡張権限を持つ利用者も OAuth 対応ツールを安全に利用できます。 本拡張機能は \[https://oauth.net/2/ OAuth 2.0] または \[https://oauth.net/core/1.0a/ OAuth 1.0a] プロトコルを使用し、3 つの段階から構成されます: # 開発者はアプリケーションをウィキに登録する必要があり、場合に応じたレビュープロセスを経て、資格情報を取得します。(ここでの「開発者」は、OAuthの用語では「コンシューマー」としばしば呼ばれます。) # 運用時は、アプリケーションの認証プロセスを経る必要があります。 この処理では、利用者がウィキの特別ページに送られ、認可ダイアログが表示されます。 利用者が許可すると、アプリケーションは別の資格情報を受け取ります (これは当該利用者専用で、利用者がいつでも取り消すことができます)。 # アプリケーションが実際に利用者の代わりに操作 (API リクエスト) を行う際、ステップ 1 と 2 で取得した資格情報を組み合わせてリクエストに署名します。 OAuthは広く使用されているオープン・スタンダードです。(Google、Facebook、GitHubなどもこれを使用しており、例としてこれらのサイトのアカウントを使用し、別のサイトにログインする場合などに用いられています。) {{info|1=OAuth を以下のものと混同しないでください: * [[w:Initiative for Open Authentication|OATH]] (二段階認証プロトコル、「モバイル機器に表示された6桁の番号の入力してください」というメッセージで知られているもの) * [[w:OpenID Connect|OpenID Connect]] (OAuth 2.0ベースの認証プロトコル、OAuthの拡張機能が部分的にサポート) }} OAuth 1.0aに関してのより詳細な情報は、[https://docs.google.com/presentation/d/1537HnwSaSzH-b8hINcz48SNhT8ElAUPC39to0_O1iNA/edit#slide=id.g15105b408d_0_287 スライド]をご覧ください。 <span id="OAuth_in_detail"></span> == OAuthの詳細 == 登録プロセスは、入力フォームフィールドの一部の内容を除き、OAuth 1.0aとOAuth 2とで基本的に同一です。ただし、この他の部分はOAuthのバージョンにより大きく異なります。 <span lang="en" dir="ltr" class="mw-content-ltr">Generally, OAuth 2 is recommended if available in your environment.</span> <span id="Registration"></span> === 登録 === 新しくOAuthアプリケーションを登録する場合、<b><code>[[m:Special:OAuthConsumerRegistration/propose|Special:OAuthConsumerRegistration/propose]]</code></b>からフォームを送信してください。 アプリケーションの承認審査を円滑にするため、フォームには必要情報を十分に入力してください。 追加情報が得られるURL (アプリケーション自体のウェブサイト、ソースコード、ウィキ上のドキュメンテーションなど) を提供することがより望まれます。 アプリケーションをウィキメディアプロジェクト上で運用する場合は、[[meta:Special:MyLanguage/OAuth app guidelines|ガイドライン]]も参照してください。 記述式以外のフィールドについては、以下の内容を入力してください: * <code>This consumer is for use only by {{tag|user|open|plain=1}}</code>: [[Special:MyLanguage/OAuth/Owner-only_consumers|所有者専用コンシューマー]]を使用するかどうかを指定します (レビューや承認は不要ですが、使用できるのは自分だけです)。 * <code>callback URL</code> (所有者専用コンシューマーを使用しない場合): 認証完了後に利用者が戻る URL はこれと照合されます。 (これは、認証の処理段階で資格情報が盗まれることを防ぐための、追加のセキュリティ設定です。) <code>use as prefix</code>オプションを有効化した場合、転送先のURLはここで設定したURLとの先頭一致が要求されます(このチェックは粗略なため、最低限<code>/</code>をドメイン名の後ろに含めてください)。無効化した場合、URLの完全一致が要求されます。 ローカル環境で開発やテストを行う場合、このフィールドには[[w:Localhost|Localhost]]を指定してください(例: <code><nowiki>http://localhost:8080/</nowiki></code>)。 * <code>Applicable project</code> (ウィキファームの場合のみ): アプリケーションを使用するプロジェクトを指定します。 特定のウィキのみに対象を制限することも、すべてのウィキで使用可能にすることもできます。 * <code>Types of grants</code> / <code>Applicable grants</code>: アプリケーションが必要とする権限を指定します(慎重に選択してください)。実際に割り当てられる権限は、アカウントが所持している権限からに限定されます。 現在の仕様では、登録可能な利用者権限はグループ化されており、権限を個別に選択することはできません([[Phab:T59505|T59505]])。 * <code>Allowed IP ranges</code>: OAuthリクエストを受け付けるIPレンジを任意で指定します(一致しないリクエストは拒否されます)。 これは、悪意をもった人物がアプリケーションの資格情報を盗み、なりすまそうとするのを防ぐための追加のセキュリティ対策です。 これは、のちに変更が可能な数少ない設定項目の一つです。 * <code>Public RSA key</code> (OAuth 1.0aのみ): リクエストの署名に使用するアプリケーションの公開鍵を指定します。 この欄を空白にし、簡略化された共有シークレットメカニズムを使用することも可能です(ほとんどのアプリケーションがこの方法で登録されます)。 これは、のちに変更が可能な数少ない設定項目の一つです。 登録後、OAuthを使用するための資格情報が提供されます。 自身の利用者アカウントからは、当該アプリケーションを(テスト目的で)即座に使用可能になります。他利用者は、管理者の承認後に使用可能になります。 アプリケーションの一覧は(承認の是非を問わず)公開されており、<code>[[m:Special:OAuthListConsumers|Special:OAuthListConsumers]]</code>で閲覧することができます。 === OAuth 1.0a === <span id="Authorisation"></span> === 認証 === [[File:OAuth authorization interface.png|thumb|利用者に表示される認証ダイアログ]] アプリケーションを登録すると、アプリケーショントークン(アプリケーションの公開ID)とアプリケーションシークレット(一種のパスワード)の2つの資格情報が提供されます。 利用者の識別や、他者名義でAPIリクエストを行う必要がある場合は、追加で(当該利用者に固有の)アクセストークンとアクセスシークレットの取得が必要です。<ref> RSA鍵を使用する場合、資格情報が少々異なります。 RSA鍵を使用する場合はその仕組みを理解していることが前提となるため、本チュートリアルではRSA鍵を選択しなかった場合を想定し解説します。 </ref> この情報の取得には、以下3つの認証プロセスが必要となります:<ref> これは、時より「三脚OAuthフロー」と呼ばれます。状況により、よりシンプルなワンステップの代替手段である「一脚OAuthフロー」も利用可能です。 詳細は{{ll|OAuth/Owner-only consumers|所有者専用コンシューマー}}を参照してください。 </ref> # GET リクエストを <code>Special:OAuth/initiate</code> に送信して、ウィキからリクエスト トークンを取得します。リクエストにはアプリケーション キーとシークレットで署名し、認証成功後に利用者が転送されるコールバック URL を <code>oauth_callback</code> クエリ パラメーターとして渡します (登録時に固定の URL を設定している場合は、パラメーターの値を ''必ず'' <code>oob</code> にする必要があります)。<ref name="non-nice-url">現在は、[[phab:T59500]] により <code>en.wikipedia.org/w/index.php?title=Special:OAuth/initiate</code> のように不格好な URL を使用する必要があります。</ref> リクエストに成功すると、<code>token</code>および<code>key</code>のフィールド(リクエストトークンとリクエストシークレット)が含まれるJSONオブジェクトがレスポンスとして返ります。 (失敗した場合、当該JSONオブジェクトは<code>error</code>のフィールドを含みます。) # 利用者にアプリケーションの承認を求めるため、アプリケーション トークン (<code>oauth_consumer_key</code>) とリクエスト トークン (<code>oauth_token</code>) をクエリ パラメーターとして付けて、<code>Special:OAuth/authorize</code> に誘導します。 利用者には、アプリケーションの基本情報と付与される権限の一覧が表示された認可ダイアログが表示され、承認するかキャンセルするかを選択できます。 # 利用者が承認した場合、登録時に指定したコールバック URL (またはステップ 1 で指定した URL パラメーター) に転送されます。 <code>oauth_verifier</code>というクエリパラメータには、リクエストトークンとリクエストシークレットをアクセストークンとアクセスシークレットへ交換するために使用可能な認証コードが含まれます。 この交換を行うには、<code>Special:OAuth/token</code><ref name="non-nice-url" />にリクエストを送信します。これには先ほど受け取った<code>oauth_verifier</code>パラメータを含め、アプリケーショントークンとアプリケーションシークレット、およびリクエストトークンとリクエストシークレットで署名を行います。 レスポンスとして、アクセストークンとアクセスシークレットが返ります(ステップ1のリクエストトークンおよびリクエストシークレットと同一形式です)。 このアクセストークンとアクセスシークレットが、APIリクエストの署名用途で必要になります。 リクエストトークンとリクエストシークレットは、この時点で不要となります。 アクセス トークンは、利用者が取り消さない限り、無期限に有効です。 (ただし、アプリケーションにこの情報を保持させたくない場合、一回ごとに認証プロセスを繰り返させる方式を取ることも可能です。) 要求する権限が最小限のアプリケーション (''User identity verification only'' として登録されたもの) は、ステップ 2 で <code>/authorize</code> の代わりに <code>/authenticate</code> を使用できます。 これも同様の仕組みで動作しますが、利用者が以前にこのアプリケーションを承認していない場合にのみ認可ダイアログが表示されます。承認済みの場合は、認可は自動的に行われます。 アプリケーションの開発にいかなる言語やフレームワークを使用しようとも、上記の手順をサポートしているライブラリが存在する可能性が高いため、手動で実装する必要はありません。各ステップは1回の関数呼び出しで処理できます。 実例はこのページの下部をご覧ください。 <span id="Making_requests_on_the_user&#039;s_behalf"></span> ==== 利用者の代理でリクエストを送信 ==== ここまでの認証情報を使用するには、HTTPリクエストをアプリケーショントークン/シークレットとアクセストークン/シークレットで署名する必要があります。 これが正常に完了すると、ウィキはそのリクエストを認可した利用者によって行われたものとして扱います。 OAuthを使用して行えるのは(後述の一つの例外を除き)APIリクエストのみです。 なお、OAuthを通すことに意味を成さない特定のAPIモジュール(login/logoutなど)や、利用者権限の範囲拡大をするAPIモジュール(centralauthtoken APIなど)は無効化されています。 <code>User identity verification only</code>として登録されたアプリケーションは、APIを完全に使用できません。 <span id="Identifying_the_user"></span> ==== 利用者の識別 ==== OAuth 拡張機能は、利用者認証のために (OpenID Connect に似た) 独自のプロトコルを含みます。 これを使用するには、署名されたOAuthリクエストを<code>Special:OAuth/identify</code>へ送信してください:<ref name="non-nice-url" /> レスポンスは、利用者名、{{ll|Manual:Central ID|中央管理ID}}(キー<code>sub</code>の下部)のほかに、さまざまな情報を含む[[w:JSON Web Token|JWT]](JSON Web Token - 署名されたJSONオブジェクト)が返されます(この「情報」には、利用者グループやブロック状態、さらに権限付与設定で選択されている場合メールアドレスなども含まれます)。 これは[[w:Man-in-the-middle attack|中間者攻撃]]の対象となる可能性がある API (例: userinfo モジュール) を使った認証よりも安全です。利用者を識別する必要がある場合は、必ずこちらを使用してください。 なお、必ずJWTを適切に読み込める環境を構築してください(この助けとなるライブラリは多数あります)。 追加で、発行者(<code>iss</code>)がウィキのドメイン名と一致すること、受信者(<code>aud</code>)がアプリケーションキーと一致すること、発行時間(<code>iat</code>)が直近の過去時刻であること、期限(<code>exp</code>)が未来の時刻であること、ノンス(<code>nonce</code>)がリクエストで送信したものと一致することを確認してください。 <span id="Signing_requests"></span> ==== リクエストに署名 ==== 認証プロセスのステップ1と3ではリクエストに署名をする必要があります。同様に、APIリクエストと<code>Special:OAuth/identify</code>にも署名をする必要があります。 署名プロセスは[https://oauth.net/core/1.0a/#signing_process OAuth仕様書のセクション9]に詳細に記載されていますが、手動で実装するのには手間が掛かるため、[https://oauth.net/1/ 多数存在するライブラリ]の使用が推奨されます。 手動で実装する方法の概要とコード サンプルは、{{ll|OAuth/Owner-only_consumers|所有者専用コンシューマー}}の説明文書にあります。 (これは、コンシューマートークン/シークレットおよびアクセストークン/シークレットで署名するためのものです。 必要に応じ、コンシューマートークン/シークレットで署名をし、リクエストトークン/シークレットをリクエスト(認証ステップ3)、またはコンシューマートークン/シークレットのみをリクエスト(認証ステップ1)するよう変更を加えてください。) === OAuth 2 === <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Authorisation ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">When registering the application, you receive two pieces of credentials: the client application key (a public ID for the application, also called the client ID or consumer key) and the client application secret (a confidential password).</span> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another credential (this one specific to that user): the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To get it, you need to go through the [https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/ the OAuth 2 Authorization Code flow], which consists of two steps:</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See [[Special:MyLanguage/OAuth/Owner-only consumers|owner-only consumers]] for that.</span></ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>oauth2/authorize</code> under the wiki's REST endpoint (usually <code>rest.php</code>), with <code>response_type=code</code> and the consumer key (also called the client application key) as the <code>client_id</code>, possibly a <code>state</code> if you want, and optionally the <code>redirect_uri</code> (if yes, it must be the same as in your application request).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If your consumer is non-confidential, you'll also need to include a [https://www.oauth.com/oauth2-servers/pkce/authorization-request/ PKCE code challenge] (<code>code_challenge</code> and <code>code_challenge_method=S256</code>).</span><ref>PKCE &mdash; Proof Key for Code Exchange</ref> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>code</code> will contain the authorisation code that you can use to fetch the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a POST request to <code>oauth2/access_token</code> under the wiki's REST endpoint (usually <code>rest.php</code>), including <code>grant_type=authorization_code</code>, the <code>code</code> parameter you just received, your client authentication (typically as <code>client_id</code> and, for confidential clients, <code>client_secret</code>), the <code>redirect_uri</code> if and only if you specified it in the previous step (must be the same value for both), and if non-confidential the PKCE <code>code_verifier</code> and <code>code_challenge_method</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token and a refresh token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token is what you'll need to send future API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The refresh token can be used to [https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/ fetch a new access token] if the original access token expires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you prefer not to store either token, you can just repeat the authorisation process at any time.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(Before MediaWiki 1.46, non-confidential clients could only use refresh tokens using their client secret keys, not using their client IDs only, see [[phabricator:T323855|T323855]].)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure so you don't have to implement it manually - each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Making requests on the user's behalf ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to include the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the access token is used to fetch a CSRF token or other tokens, the access token must still be passed (as a header) with requests that use those tokens.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications which need minimal privileges (have been registered as ''User identity verification only'') cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> API requests including <code>rest.php/oauth2/resource/profile</code> must be authenticated with an HTTP Authorization header containing the access token, like: </div> <pre> Authorization: Bearer abcde....6789 </pre> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Identifying the user ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a somewhat incomplete implementation of OpenID Connect for authenticating the user.</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">See [[phab:T254063|T254063]] for details.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send an authenticated OAuth GET request to the <code>oauth2/resource/profile</code> API (MediaWiki's implementation of what the OIDC spec calls the UserInfo endpoint) under the wiki's REST endpoint (usually <code>rest.php</code>); the response will include the name of the user and various other information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that the GET request must use the HTTP <code>Authorization</code> header, not a query string token.</span> * '''sub''' <span lang="en" dir="ltr" class="mw-content-ltr">(central user ID)</span> * '''username''' * '''editcount''' * '''confirmed_email''' * '''blocked''' * '''registered''' * '''groups''' * '''rights''' * '''realname''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> * '''email''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Setting up a development environment == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> You can register an OAuth application on [https://meta.wikimedia.beta.wmflabs.org/wiki/Special:OAuthConsumerRegistration/propose beta meta] and test your code against that. </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you want to improve the extension itself, or debug protocol issues in detail, OAuth is available in the {{ll|MediaWiki-Vagrant}} development environment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Add the <code>oauth</code> role, and your local wiki will be able to authorise OAuth apps.</span> <syntaxhighlight lang="shell-session"> $ vagrant roles enable oauth $ vagrant provision </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Once the code is nearly ready, you can register an OAuth application on the real wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to test it with the same user account used for registering, even before it gets reviewed by admins.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If you are creating an application for Wikimedia projects, consider hosting it at [[Wikitech:Portal:Toolforge|Wikimedia Toolforge]], a free tool forge and hosting platform for Wikimedia-related services. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Security benefits and trade-offs == </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Unlike password-based authentication, the OAuth 1.0 protocol prevents any [[w:Man-in-the-middle attack|man-in-the-middle attack]] even if the wiki does not require HTTPS: all interactions between MediaWiki and the application are signed with either a shared secret (using HMAC-SHA1), or a [[w:Public-key cryptography|public key]] (RSA).</span> <span lang="en" dir="ltr" class="mw-content-ltr">HTTPS is still required for certain steps though (for obtaining the shared secret in the second step of authorisation when not using RSA, and during app registration).</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 2.0 does not involve signing and relies on HTTPS for security.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Actions via OAuth happen under the user's name but will be [[Special:MyLanguage/Manual:Tags|tagged]] with the application's name as well so rogue applications can be identified.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Wiki admins can revoke the application's permissions (and thus bar it from any further action) if needed.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The user can revoke the permission of the application to use that specific user account if they don't like how it works or don't trust it anymore.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Unlike a password change, this is not disruptive for the user.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Sufficiently flexible applications might allow users to circumvent IP blocks (since MediaWiki will see the IP of the application server, not that of the user).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This can be handled the same way proxies are, by trusting XFF headers set by the application (see [[Phab:T159889|T159889]] for some limitations).</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The application secret must be kept secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Submitting it to source control or putting it into user-accessible code (such as mobile app or desktop application; even if it is obfuscated) undermines the security model and will result in admins forcefully disabling the application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Exceptions are made for example applications demoing OAuth usage, if they are explicitly labeled as such and request limited rights.</span> <span id="Libraries"></span> == ライブラリ == === PHP === * [[oauthclient-php]] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a client library maintained by Wikimedia</span> * [https://php.net/book.oauth OAuth] – <span lang="en" dir="ltr" class="mw-content-ltr">PECL client library</span> * [https://github.com/firebase/php-jwt firebase/php-jwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a popular JWT library</span> * [https://sr.ht/~taavi/laravel-socialite-mediawiki/ laravel-socialite-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki driver for [[w:Laravel|Laravel]]'s [https://laravel.com/docs/7.x/socialite Socialite] library.</span> === Python === * [https://github.com/valhallasw/flask-mwoauth flask-mwoauth] – <span lang="en" dir="ltr" class="mw-content-ltr">a Flask blueprint to run OAuth against MediaWiki's Extension:OAuth (See tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Flask_OAuth_tool My first Flask OAuth tool])</span> * [https://github.com/wikimedia/MediaWiki-OAuth MediaWiki-OAuth (mwoauth)] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a on top of [http://requests-oauthlib.readthedocs.org/en/latest/oauth1_workflow.html requests-oauthlib]</span> * [https://github.com/python-social-auth/social-core python-social-auth] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework that includes a [https://github.com/python-social-auth/social-core/blob/master/social_core/backends/mediawiki.py MediaWiki backend] (Example tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Django_OAuth_tool My first Django OAuth tool])</span> * [https://docs.authlib.org/en/latest/index.html authlib] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework to interact with Wikimedia OAuth 2.0 API (Full minimal Django OAuth 2.0 [https://code.basabuuka.org/alpcentaur/wmde_oauth_django_example example])</span> * [https://github.com/jpadilla/pyjwt pyjwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a JWT library</span> === Ruby === * [https://github.com/timwaters/omniauth-mediawiki omniauth-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">a MediaWiki strategy for OmniAuth (also available as a [https://rubygems.org/gems/omniauth-mediawiki gem])</span> === Rust === * [https://crates.io/crates/mediawiki MediaWiki crate] <span lang="en" dir="ltr" class="mw-content-ltr">implements both OAuth1 and OAuth2 login mechanisms.</span> * [https://crates.io/crates/oauth2 oauth2 crate] === Node.js === * [https://www.npmjs.com/package/passport-mediawiki-oauth passport-mediawiki-oauth] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki strategy for the Passport auth framework (which can be used effortlessly as a middleware with Express JS and similar frameworks)</span> * [https://www.npmjs.com/package/oauth-fetch-json oauth-fetch-json] – <span lang="en" dir="ltr" class="mw-content-ltr">library for signing OAuth requests</span> * [https://www.npmjs.com/package/m3api-oauth2 m3api-oauth2] – an extension package for [https://www.npmjs.com/package/m3api m3api], making it easy to make requests authenticated via [[Special:MyLanguage/Help:OAuth|OAuth 2.0]] === Go === * [https://github.com/mrjones/oauth mrjones/oauth] (OAuth 1.0) * [https://pkg.go.dev/golang.org/x/oauth2 golang.org/x/oauth2] <span lang="en" dir="ltr" class="mw-content-ltr">(OAuth 2.0, [https://pkg.go.dev/golang.org/x/oauth2#example-Config example])</span> === Java === * [https://github.com/scribejava/scribejava ScribeJava] <span lang="en" dir="ltr" class="mw-content-ltr">since version 5.5.0 ([https://github.com/scribejava/scribejava/pull/852 pull request])</span> <span id="Example_code"></span> == コード例 == <div lang="en" dir="ltr" class="mw-content-ltr"> === PHP client without using any libraries === </div> [[toollabs:oauth-hello-world|OAuth Hello World]] – <span lang="en" dir="ltr" class="mw-content-ltr">easy to understand demo application written in PHP without any libraries.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === PHP command-line client with RSA keys, using oauthclient-php === </div> <span lang="en" dir="ltr" class="mw-content-ltr">PHP application using classes from the OAuth extension codebase.</span> {{Todo|1=<span lang="en" dir="ltr" class="mw-content-ltr">convert this to actually use oauthclient-php! Probably just a bunch of <code>use</code> declarations.</span>}} <span lang="en" dir="ltr" class="mw-content-ltr">Before Starting:</span> <syntaxhighlight lang="shell-session"> $ openssl genrsa -out appkey.pem 4096 $ openssl rsa -in appkey.pem -pubout > appkey.pub </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">PHP source code</span>}} <syntaxhighlight lang="php"> <?php if ( PHP_SAPI !== 'cli' ) { die( "CLI-only test script\n" ); } /** * A basic client for overall testing */ function wfDebugLog( $method, $msg) { //echo "[$method] $msg\n"; } require 'OAuth.php'; require 'MWOAuthSignatureMethod.php'; $consumerKey = ''; #$consumerSecret = ''; // We don't need this, since we're using RSA, except to validate the /identify call $privateKey = file_get_contents( 'appkey.pem' ); $baseurl = 'http://<wiki>/wiki/Special:OAuth'; $endpoint_req = $baseurl . '/initiate?format=json&oauth_callback=oob'; // format=json makes php a little easier $endpoint_acc = $baseurl . '/token?format=json'; $endpoint_id = $baseurl . '/identify'; $c = new OAuthConsumer( $consumerKey, $privateKey ); // Make sure we sign title and format $parsed = parse_url( $endpoint_req ); $extraSignedParams = array(); parse_str($parsed['query'], $extraSignedParams); $extraSignedParams['title'] = 'Special:OAuth/initiate'; $init_req = OAuthRequest::from_consumer_and_token( $c, // OAuthConsumer for your app NULL, // User token, NULL for calls to initiate "GET", // http method $endpoint_req, // endpoint url (this is signed) $extraSignedParams // extra parameters we want to sign (must include title) ); $rsa_method = new MWOAuthSignatureMethod_RSA_SHA1( new OAuthDataStore(), $privateKey ); $init_req->sign_request( $rsa_method, // OAuthSignatureMethod $c, // OAuthConsumer for your app NULL // User token, NULL for calls to initiate ); echo "Getting request token with: $init_req\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, (string) $init_req ); // Pass OAuth in GET params curl_setopt( $ch, CURLOPT_HTTPGET, true ); curl_setopt( $ch, CURLOPT_HEADER, false ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $requestToken = json_decode( $data ); print "Visit $baseurl/authorize?oauth_token={$requestToken->key}&oauth_consumer_key=$consumerKey\n"; // ACCESS TOKEN print "Enter the verification code:\n"; $fh = fopen( "php://stdin", "r" ); $line = fgets( $fh ); $rc = new OAuthToken( $requestToken->key, $requestToken->secret ); $parsed = parse_url( $endpoint_acc ); parse_str($parsed['query'], $params); $params['oauth_verifier'] = trim($line); $params['title'] = 'Special:OAuth/token'; $acc_req = OAuthRequest::from_consumer_and_token( $c, $rc, "GET", $endpoint_acc, $params ); $acc_req->sign_request($rsa_method, $c, $rc); echo "Calling: $acc_req\n"; unset( $ch ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_acc ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $acc_req->to_header() ) ); // Set the Authorization Header $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $acc = json_decode( $data ); $accessToken = new OAuthToken( $acc->key, $acc->secret ); /** * Insecurely call the api for information about the user. * A MITM can forge a response from the server, so don't rely on this for identity! */ $apiurl = 'http://<wiki>/w/api.php'; $apiParams = array( 'action' => 'query', 'meta' => 'userinfo', 'uiprop' => 'rights', 'format' => 'json', ); $api_req = OAuthRequest::from_consumer_and_token( $c, // Consumer $accessToken, // User Access Token "GET", // HTTP Method $apiurl, // Endpoint url $apiParams // Extra signed parameters ); $api_req->sign_request( $rsa_method, $c, $accessToken ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $apiurl . "?" . http_build_query( $apiParams ) ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $api_req->to_header() ) ); // Authorization header required for api $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; /** * Securely get the identity of the user */ $consumerSecret = ''; $extraSignedParams = array( 'title' => 'Special:OAuth/identify' ); $req = OAuthRequest::from_consumer_and_token( $c, $accessToken, "GET", $endpoint_id, $extraSignedParams ); $req->sign_request( $rsa_method, $c, $accessToken ); echo "Calling: '$endpoint_id'\nHeader: {$req->to_header()}\n\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_id ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $req->to_header() ) ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } $identity = JWT::decode( $data, $consumerSecret ); // Validate the JWT if ( !validateJWT( $identity, $consumerKey, $req->get_parameter( 'oauth_nonce' ) ) ) { print "The JWT did not validate"; } else { print "We got a valid JWT, describing the user as:\n"; print " * Username: {$identity->username}\n"; print " * User's current groups: " . implode( ',', $identity->groups ) . "\n"; print " * User's current rights: " . implode( ',', $identity->rights ) . "\n"; } /** * Validate a JWT, to ensure this isn't a reply, spoof, etc. * @param $identity the decoded JWT * @param $consumerKey your App's Key * @param $nonce the nonce sent with your request, which should be returned */ function validateJWT( $identity, $consumerKey, $nonce ) { $expectedConnonicalServer = 'http://<wiki>'; // Verify the issuer is who we expect (server sends $wgCanonicalServer) if ( $identity->iss !== $expectedConnonicalServer ) { print "Invalid Issuer"; return false; } // Verify we are the intended audience if ( $identity->aud !== $consumerKey ) { print "Invalid Audience"; return false; } // Verify we are within the time limits of the token. // Issued at (iat) should be in the past, // Expiration (exp) should be in the future. $now = time(); if ( $identity->iat > $now || $identity->exp < $now ) { print "Invalid Time"; return false; } // Verify we haven't seen this nonce before, which would indicate a replay attack if ( $identity->nonce !== $nonce ) { print "Invalid Nonce"; return false; } return true; } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Python command-line client using mwoauth === </div> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Python source code</span>}} <syntaxhighlight lang="python"> from mwoauth import ConsumerToken, Handshaker import requests from requests_oauthlib import OAuth1 from six.moves import input # For compatibility between python 2 and 3 # Consruct a "consumer" from the key/secret provided by MediaWiki import config # You'll need to provide this # Create a file called config.py somewhere where it will be found by python, e.g. in the same directory as this script, with the following content (not including the # characters!) # consumer_key = "the consumer token you got when you registered your applicaton" # consumer_secret = "the secret token you got when you registered your application" # For example: # consumer_key = "20bc67da5081a30c736340c493f60d14" # consumer_secret = "af4313371bb2fb38e81fe7d300080085f52849f9" consumer_token = ConsumerToken(config.consumer_key, config.consumer_secret) # Construct handshaker with wiki URI and consumer handshaker = Handshaker("https://en.wikipedia.org/w/index.php", consumer_token) # Step 1: Initialise -- ask MediaWiki for a temporary key/secret for user redirect, request_token = handshaker.initiate() # Step 2: Authorise -- send user to MediaWiki to confirm authorisation print("Point your browser to: %s" % redirect) # response_qs = input("Response query string: ") # Step 3: Complete -- obtain authorised key/secret for "resource owner" access_token = handshaker.complete(request_token, response_qs) # Construct an auth object with the consumer and access tokens auth1 = OAuth1(consumer_token.key, client_secret=consumer_token.secret, resource_owner_key=access_token.key, resource_owner_secret=access_token.secret) # Now, accessing the API on behalf of a user print("Reading top 10 watchlist items") response = requests.get( "https://en.wikipedia.org/w/api.php", params={ 'action': "query", 'list': "watchlist", 'wllimit': 10, 'wlprop': "title|comment", 'format': "json" }, auth=auth1 ) for item in response.json()['query']['watchlist']: print("{title}\t{comment}".format(**item)) </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Python Toolforge tutorial using mwoauth === </div> 以下を参照してください: [[wikitech:Help:Toolforge/My first Flask OAuth tool]] === Python Toolforge tutorial using authlib (OAuth 2.0) === {{Collapse_top|title=Python source code}} <syntaxhighlight lang="python"> # > requirements.txt # flask==3.1.3 # requests==2.33.1 # authlib==1.7.0 # > config.py OAUTH_ACCESS_TOKEN_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/access_token" OAUTH_API_BASE_URL = "https://commons.wikimedia.org/w/" OAUTH_AUTHORIZE_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/authorize" OAUTH_CODE_CHALLENGE_METHOD = "S256" OAUTH_CONSUMER_KEY = "Y" OAUTH_CONSUMER_SECRET = "Z" OAUTH_SCOPE = "basic editpage" # > app.py from authlib.integrations.flask_client import FlaskOAuth2App, OAuth from flask import Flask, jsonify, redirect, request, session from requests import Response app = Flask() app.config.from_pyfile("config.py") oauth = OAuth(app) oauth.register( name="mediawiki", client_id=app.config["OAUTH_CONSUMER_KEY"], client_secret=app.config["OAUTH_CONSUMER_SECRET"], client_kwargs={ "code_challenge_method": app.config["OAUTH_CODE_CHALLENGE_METHOD"], "scope": app.config["OAUTH_SCOPE"], }, api_base_url=app.config["OAUTH_API_BASE_URL"], access_token_url=app.config["OAUTH_ACCESS_TOKEN_URL"], authorize_url=app.config["OAUTH_AUTHORIZE_URL"], ) oauth_client: FlaskOAuth2App = oauth.create_client("mediawiki") @app.route("/") def index(): return app.send_static_file("index.html") @app.route("/login") def login(): return oauth_client.authorize_redirect() @app.route("/oauth-callback") def auth(): token = oauth_client.authorize_access_token() session["token"] = token return redirect("/") @app.route("/logout") def logout(): session.pop("token", None) session.clear() return redirect("/") @app.route("/user") def user(): response: Response = oauth_client.request( "GET", "rest.php/oauth2/resource/profile", token=session["token"], ) user = response.json() response.raise_for_status() return jsonify(user=user) @app.route("/edit", methods=["POST"]) def edit(): data = request.get_json() pageid = int(data["pageid"]) response: Response = oauth_client.request( "POST", "api.php", token=session["token"], data=dict( format="json", formatversion="2", action="query", pageids=str(pageid), prop="revisions|wbentityusage", rvprop="content", rvslots="*", meta="tokens", ), ) r = response.json() token = r["query"]["tokens"]["csrftoken"] ... </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Go command-line client using mrjones/auth (OAuth 1.0) === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Before you begin: </div> <syntaxhighlight lang="shell-session"> $ go get github.com/mrjones/oauth </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Go source code</span>}} <syntaxhighlight lang="go"> package main import ( "fmt" "os" "github.com/mrjones/oauth" "io/ioutil" "strconv" ) func main() { var consumerKey string = "" var consumerSecret string = "" if len(consumerKey) == 0 || len(consumerSecret) == 0 { os.Exit(1) } c := oauth.NewConsumer( consumerKey, consumerSecret, oauth.ServiceProvider{ RequestTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/initiate", AuthorizeTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/authorize", AccessTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/token", }) c.Debug(true) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/initiate", } c.AdditionalAuthorizationUrlParams = map[string]string{ "oauth_consumer_key": consumerKey, } requestToken, url, err := c.GetRequestTokenAndUrl("oob") if err != nil { fmt.Println( err ) } fmt.Println( "Got token " + requestToken.Token ) fmt.Println("(1) Go to: " + url) fmt.Println("(2) Grant access, you should get back a verification code.") fmt.Println("(3) Enter that verification code here: ") verificationCode := "" fmt.Scanln(&verificationCode) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/token", } accessToken, err := c.AuthorizeToken(requestToken, verificationCode) if err != nil { fmt.Println(err) } fmt.Println( "Got access token " + accessToken.Token ) c.AdditionalParams = map[string]string{} response, err := c.Get( "http://<wiki>/wiki/api.php", map[string]string{ "action": "query", "meta": "userinfo", "uiprop": "rights", "format": "json", }, accessToken) if err != nil { fmt.Println(err) } fmt.Println( "\tResponse Status: '" + response.Status + "'\n" ) fmt.Println( "\tResponse Code: " + strconv.Itoa(response.StatusCode) + "\n" ) bytes, _ := ioutil.ReadAll(response.Body) fmt.Println( "\tResponse Body: " + string(bytes) + "\n" ) } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === JavaScript applications using OAuth 2 === </div> * [https://github.com/wikimedia/apiclient-wiki wikimedia/apiclient-wiki] – <span lang="en" dir="ltr" class="mw-content-ltr">entire application in 520 lines of code</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Full applications using OAuth === </div> * [https://github.com/jdlrobson/weekipedia/blob/master/libs/server/app.js Weekipedia], <span lang="en" dir="ltr" class="mw-content-ltr">A full scale React.js port of the Wikipedia mobile site uses both.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">many [https://toolhub.wikimedia.org/search?keywords__term=oauth Toolforge tools]</span> <span id="Notes"></span> ==注記== <references /> rtiyrg1vh3tt67zrszcmh1yb4jr3cqp Help:Extension:ParserFunctions/id 12 919952 8365019 8353935 2026-05-04T06:20:43Z FuzzyBot 451990 Updating to match new version of source page 8365019 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span lang="en" dir="ltr" class="mw-content-ltr">The {{ll|Extension:ParserFunctions|nsp=0}} extension provides additional [[Special:MyLanguage/Parser functions|parser functions]] to supplement those already present in MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">(It ''may'' be configured to provide additional parser functions for string handling; these are only available to non-Wikimedia Foundation wikis hence these string functions are documented {{ll|Extension:ParserFunctions/String functions|elsewhere}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">All the parser functions provided by this extension take the form:</span> :<code><nowiki>{{</nowiki>'''#namafungsi''': ''argumen1'' | ''argumen2'' | ''argumen3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipe ! {{hl1}} | Operator |- | {{hl2}} | Pengelompokan (tanda kurung) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Nomor | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | <span lang="en" dir="ltr" class="mw-content-ltr">binary operator</span> <code>'''e'''</code> &nbsp; <span lang="en" dir="ltr" class="mw-content-ltr">unary</span> <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Unary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Binary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Round</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Logic</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} <span lang="en" dir="ltr" class="mw-content-ltr">This function evaluates a mathematical expression and returns the calculated value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This function is also available in {{ll|Extension:Scribunto|nsp=0}} via the <code>mw.ext.ParserFunctions.expr</code> function.</span> :<code><nowiki>{{#expr:</nowiki> ''<span lang="en" dir="ltr" class="mw-content-ltr">expression</span>'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The available operators are listed to the right, in order of precedence. See {{ll|Manual:Expr parser function syntax}} for more details of the function of each operator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> When evaluating using [[w:boolean algebra|boolean algebra]], zero evaluates to {{phpi|false}}, and any nonzero value, positive or negative, evaluates to {{phpi|true}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code>[[##iferror|#iferror]]</code> function: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <span id="Rounding"></span> === Pembulatan === <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Test case</span> ! {{hl1}} | Hasil ! {{hl1}} | Metode pembulatan |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || Digit terakhir adalah<5, jadi tidak terjadi pembulatan yang jelas (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is ≥ 5, so it is rounded up</span> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to the nearest integer</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the ''nearest'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding up or down with ''ceil'' and ''floor''</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next ''larger'' integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next ''smaller'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next larger integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next smaller integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Not rounded, since 1 already is an integer</span><br />{{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect</span>}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Strings === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: test string | value if test string is not empty | value if test string is empty (or only white space)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: first parameter | second parameter | third parameter }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> Contoh: {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| Tahun |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Tahun 4 digit. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Tahun 2 digit. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Bulan |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Jam |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Menit dan detik |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (benar) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (benar) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (benar) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (benar) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|Contoh peringatan dari https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <span id="Redirects"></span> === Pengalihan === <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! Deskripsi ! Anda mengetik ! Anda mendapatkan |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Lihat pula == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Referensi == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] ohm19b1vx09cvcqb9sx14zfemp7a8qi OAuth/For Developers/eo 0 922867 8364288 8350293 2026-05-03T12:27:46Z FuzzyBot 451990 Updating to match new version of source page 8364288 wikitext text/x-wiki <languages /> <div lang="en" dir="ltr" class="mw-content-ltr"> This page explains how to develop applications that can integrate with a wiki running {{ll|Extension:OAuth}} (an extension which turns MediaWiki into an [[w:OAuth|OAuth]] server) to securely request permission to act on the user's behalf. </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you are developing a bot or similar application that always uses the same account, you might prefer the simpler [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]].</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> == OAuth in a nutshell == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> OAuth allows an application to request permission from a user to act through that user's wiki account, without knowing the user's password, and without being able to do everything the user could (e.g. the app might be able to edit articles but not delete them, so even users with extended permissions can safely use OAuth-enabled tools). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This happens via the [https://oauth.net/2/ OAuth 2.0] or [https://oauth.net/core/1.0a/ OAuth 1.0a] protocol, and consists of three stages: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">The developer must register the application (often called "consumer" in the OAuth terminology) on the wiki, possibly go through some sort of review process, and will receive some credentials.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">When a user wants to use it, the application must initiate an authorisation process.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will involve sending the user to a special page on the wiki, which will display an authorisation dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the user accepts, the application will receive another set of credentials (which are specific to that user, and can be revoked by the user at any time).</span> # <span lang="en" dir="ltr" class="mw-content-ltr">When the application actually needs to make an action (API request) on the user's behalf, it can combine the credentials received in steps 1 and 2 to sign the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth is a widely used open standard (you can see it on sites like Google or Facebook or GitHub, e.g. when using accounts at those sites to log in elsewhere).</span> {{info|1=<span lang="en" dir="ltr" class="mw-content-ltr">OAuth should not be confused with:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Initiative for Open Authentication|OATH]] (a second-factor authentication protocol family, commonly known as "type the six numbers you see on your mobile app", now enabled on Wikimedia sites)</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:OpenID Connect|OpenID Connect]] (an authentication protocol based on OAuth 2.0, which the OAuth MediaWiki extension partially supports).</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> For a slightly larger nutshell on OAuth 1.0a, see [https://docs.google.com/presentation/d/1537HnwSaSzH-b8hINcz48SNhT8ElAUPC39to0_O1iNA/edit#slide=id.g15105b408d_0_287 these slides]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == OAuth in detail == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The registration is basically the same for OAuth 1.0a and OAuth 2, with the difference being only the presence of a few form fields. The remaining parts differ significantly depending on the OAuth version.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Generally, OAuth 2 is recommended if available in your environment.</span> <span id="Registration"></span> === Registrado === <span lang="en" dir="ltr" class="mw-content-ltr">To register a new OAuth application, submit the form at <code>[[m:Special:OAuthConsumerRegistration/propose|Special:OAuthConsumerRegistration/propose]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Try to give sufficient information about the application for admins and users to decide whether it can be trusted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">URLs to places with more information (such as the application itself, the source code or on-wiki documentation) can be useful.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For OAuth applications to be used on Wikimedia projects, see [[meta:Special:MyLanguage/OAuth app guidelines|app guidelines]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Besides the descriptive ones, the fields have the following meaning:</span> * <code>This consumer is for use only by {{tag|user|open|plain=1}}</code>: <span lang="en" dir="ltr" class="mw-content-ltr">whether you use [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]] (which do not need to be reviewed or authorised but are only usable by yourself).</span> * <code>callback URL</code> (<span lang="en" dir="ltr" class="mw-content-ltr">irrelevant to owner-only consumers</span>): <span lang="en" dir="ltr" class="mw-content-ltr">the URL where the user returns after authorisation is checked against this.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(This is an extra layer of security against an attacker trying to steal credentials during authorisation.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>use as prefix</code> option is enabled, the URL must start with this (the check is dumb so make sure to add at least a <code>/</code> after the domain name), otherwise it must be an exact match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you are developing/testing your local machine, specify [[w:Localhost|Localhost]] in this field (e.g. <code><nowiki>http://localhost:8080/</nowiki></code>).</span> * <code>Applicable project</code> (<span lang="en" dir="ltr" class="mw-content-ltr">for wiki farms only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">project(s) on which to use your application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can limit the application to a single wiki or have it work everywhere.</span> * <code>Types of grants</code> / <code>Applicable grants</code>: <span lang="en" dir="ltr" class="mw-content-ltr">the permissions needed by your application (be conservative). The actual permissions will be an intersection of this and what permissions the user has.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Currently, the user must authorise grouped permissions, not individual ones ([[Phab:T59505|T59505]]).</span> * <code>Allowed IP ranges</code>: <span lang="en" dir="ltr" class="mw-content-ltr">an optional specification of the IP ranges that you use, where OAuth requests not matching this will be rejected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is an extra layer of security against an attacker stealing your application's credentials and trying to impersonate it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> * <code>Public RSA key</code> (<span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">public key used by your application for signing requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can just leave this empty (most applications do) to use a slightly simpler shared-secret mechanism instead.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> <span lang="en" dir="ltr" class="mw-content-ltr">After registration, you'll receive the credentials needed to use OAuth.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to use it immediately with your own user account (this is meant for testing); others will only be able to use it once it is approved by an administrator.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The list of applications (approved or otherwise) is public and can be browsed at <code>[[m:Special:OAuthListConsumers|Special:OAuthListConsumers]]</code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === OAuth 1.0a === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Authorisation ==== </div> [[File:OAuth authorization interface.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Authorisation dialog shown to users</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> When registering the application, you receive two pieces of credentials: the application token (a public ID for the application) and the application secret (sort of like a password). </div> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another set of credentials (these ones specific to that user): the access token and access secret.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">With an RSA key the credentials are slightly different.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is assumed that people choosing to use an RSA key know what they are doing, so this tutorial will assume you have chosen the non-RSA option.</span> </ref> <span lang="en" dir="ltr" class="mw-content-ltr">To get them, you need to go through the authorisation process, which consists of three steps:</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|OAuth/Owner-only consumers|owner-only consumers}} for that.</span> </ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Get a request token from the wiki by sending a GET request to <code>Special:OAuth/initiate</code>, signed with the application key and secret, with the callback URL (where the user will be sent after a successful authorisation) passed as the <code>oauth_callback</code> query parameter (if you have set a constant URL at registration, the value of the parameter ''must'' be <code>oob</code>).</span><ref name="non-nice-url"><span lang="en" dir="ltr" class="mw-content-ltr">Due to [[phab:T59500]] you must currently use a non-nice URL such as <code>en.wikipedia.org/w/index.php?title=Special:OAuth/initiate</code>.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">If you are successful, the response will be a JSON object with <code>token</code> and <code>key</code> fields—the request token and request secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If not, it will have an <code>error</code> field.)</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>Special:OAuth/authorize</code>, with the application token and request token passed as query parameters (<code>oauth_consumer_key</code> and <code>oauth_token</code>, respectively).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>oauth_verifier</code> will contain the verification code that you can use to exchange the request token and secret for the access token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a request to <code>Special:OAuth/token</code><ref name="non-nice-url" /> which includes the <code>oauth_verifier</code> parameter you just received and is signed with the application token and secret and the request token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token/secret (in the same format as the request token/secret in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token and secret is what you'll need to sign API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The request token and secret is not useful anymore and can be discarded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token will remain valid indefinitely, unless the user revokes it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If you prefer not to store it, you can just repeat the authorisation process at any time though.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Applications which only need minimal privileges (have been registered as ''User identity verification only'') can use <code>/authenticate</code> instead of <code>/authorize</code> in step 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This works the same way, but the user will only see the authorisation dialog if they have not authorised this application before; otherwise the authorisation will silently succeed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure, so you don't have to implement it manually—each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Making requests on the user's behalf ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to be signed with the application token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth, with one exception (see next section).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications registered as ''User identity verification only'' cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Identifying the user ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a custom protocol (similar to OpenID Connect) for authenticating the user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send a signed OAuth request to <code>Special:OAuth/identify</code>:</span><ref name="non-nice-url" /> <span lang="en" dir="ltr" class="mw-content-ltr">the response will be a [[w:JSON Web Token|JWT]] (JSON Web Token &ndash; a signed JSON object) including the name of the user, their {{ll|Manual:Central ID|central ID}} (under the key <code>sub</code>) and various other information (such as their user groups and whether they are blocked; also the email address if the application was registered with the right grant type).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is more secure than using the API (e.g. the userinfo module) for authentication, which could be subject to [[w:Man-in-the-middle attack|man-in-the-middle attacks]]; always use this if you need to identify a user!</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also, make sure you properly validate the JWT (there are many libraries which can help with that).</span> <span lang="en" dir="ltr" class="mw-content-ltr">You should check each of the following: the issuer (<code>iss</code>) matches the domain name of the wiki, the audience (<code>aud</code>) matches your application key, the issued-at time (<code>iat</code>) is in the past and reasonably close to current time, the expiration time (<code>exp</code>) is in the future, the nonce (<code>nonce</code>) matches the one you sent in the request.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Signing requests ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Steps 1 and 3 of the authorisation process require signing the request; API requests and <code>Special:OAuth/identify</code> must likewise be signed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The signing process is detailed in [https://oauth.net/core/1.0a/#signing_process section 9 of the OAuth spec], but it is cumbersome to implement by hand and [https://oauth.net/1/ many libraries] are available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find code samples and an overview of how to do it by hand in the {{ll|OAuth/Owner-only_consumers|owner-only consumer}} documentation.</span> (<span lang="en" dir="ltr" class="mw-content-ltr">That is for signing with the consumer token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Modify as appropriate to sign with the consumer token/secret and request token/secret (authorisation step 3) or consumer token/secret only (authorisation step 1).</span>) <div lang="en" dir="ltr" class="mw-content-ltr"> === OAuth 2 === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Authorisation ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">When registering the application, you receive two pieces of credentials: the client application key (a public ID for the application, also called the client ID or consumer key) and the client application secret (a confidential password).</span> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another credential (this one specific to that user): the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To get it, you need to go through the [https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/ the OAuth 2 Authorization Code flow], which consists of two steps:</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See [[Special:MyLanguage/OAuth/Owner-only consumers|owner-only consumers]] for that.</span></ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>oauth2/authorize</code> under the wiki's REST endpoint (usually <code>rest.php</code>), with <code>response_type=code</code> and the consumer key (also called the client application key) as the <code>client_id</code>, possibly a <code>state</code> if you want, and optionally the <code>redirect_uri</code> (if yes, it must be the same as in your application request).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If your consumer is non-confidential, you'll also need to include a [https://www.oauth.com/oauth2-servers/pkce/authorization-request/ PKCE code challenge] (<code>code_challenge</code> and <code>code_challenge_method=S256</code>).</span><ref>PKCE &mdash; Proof Key for Code Exchange</ref> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>code</code> will contain the authorisation code that you can use to fetch the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a POST request to <code>oauth2/access_token</code> under the wiki's REST endpoint (usually <code>rest.php</code>), including <code>grant_type=authorization_code</code>, the <code>code</code> parameter you just received, your client authentication (typically as <code>client_id</code> and, for confidential clients, <code>client_secret</code>), the <code>redirect_uri</code> if and only if you specified it in the previous step (must be the same value for both), and if non-confidential the PKCE <code>code_verifier</code> and <code>code_challenge_method</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token and a refresh token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token is what you'll need to send future API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The refresh token can be used to [https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/ fetch a new access token] if the original access token expires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you prefer not to store either token, you can just repeat the authorisation process at any time.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(Before MediaWiki 1.46, non-confidential clients could only use refresh tokens using their client secret keys, not using their client IDs only, see [[phabricator:T323855|T323855]].)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure so you don't have to implement it manually - each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Making requests on the user's behalf ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to include the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the access token is used to fetch a CSRF token or other tokens, the access token must still be passed (as a header) with requests that use those tokens.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications which need minimal privileges (have been registered as ''User identity verification only'') cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> API requests including <code>rest.php/oauth2/resource/profile</code> must be authenticated with an HTTP Authorization header containing the access token, like: </div> <pre> Authorization: Bearer abcde....6789 </pre> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Identifying the user ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a somewhat incomplete implementation of OpenID Connect for authenticating the user.</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">See [[phab:T254063|T254063]] for details.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send an authenticated OAuth GET request to the <code>oauth2/resource/profile</code> API (MediaWiki's implementation of what the OIDC spec calls the UserInfo endpoint) under the wiki's REST endpoint (usually <code>rest.php</code>); the response will include the name of the user and various other information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that the GET request must use the HTTP <code>Authorization</code> header, not a query string token.</span> * '''sub''' <span lang="en" dir="ltr" class="mw-content-ltr">(central user ID)</span> * '''username''' * '''editcount''' * '''confirmed_email''' * '''blocked''' * '''registered''' * '''groups''' * '''rights''' * '''realname''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> * '''email''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Setting up a development environment == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> You can register an OAuth application on [https://meta.wikimedia.beta.wmflabs.org/wiki/Special:OAuthConsumerRegistration/propose beta meta] and test your code against that. </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you want to improve the extension itself, or debug protocol issues in detail, OAuth is available in the {{ll|MediaWiki-Vagrant}} development environment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Add the <code>oauth</code> role, and your local wiki will be able to authorise OAuth apps.</span> <syntaxhighlight lang="shell-session"> $ vagrant roles enable oauth $ vagrant provision </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Once the code is nearly ready, you can register an OAuth application on the real wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to test it with the same user account used for registering, even before it gets reviewed by admins.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If you are creating an application for Wikimedia projects, consider hosting it at [[Wikitech:Portal:Toolforge|Wikimedia Toolforge]], a free tool forge and hosting platform for Wikimedia-related services. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Security benefits and trade-offs == </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Unlike password-based authentication, the OAuth 1.0 protocol prevents any [[w:Man-in-the-middle attack|man-in-the-middle attack]] even if the wiki does not require HTTPS: all interactions between MediaWiki and the application are signed with either a shared secret (using HMAC-SHA1), or a [[w:Public-key cryptography|public key]] (RSA).</span> <span lang="en" dir="ltr" class="mw-content-ltr">HTTPS is still required for certain steps though (for obtaining the shared secret in the second step of authorisation when not using RSA, and during app registration).</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 2.0 does not involve signing and relies on HTTPS for security.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Actions via OAuth happen under the user's name but will be [[Special:MyLanguage/Manual:Tags|tagged]] with the application's name as well so rogue applications can be identified.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Wiki admins can revoke the application's permissions (and thus bar it from any further action) if needed.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The user can revoke the permission of the application to use that specific user account if they don't like how it works or don't trust it anymore.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Unlike a password change, this is not disruptive for the user.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Sufficiently flexible applications might allow users to circumvent IP blocks (since MediaWiki will see the IP of the application server, not that of the user).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This can be handled the same way proxies are, by trusting XFF headers set by the application (see [[Phab:T159889|T159889]] for some limitations).</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The application secret must be kept secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Submitting it to source control or putting it into user-accessible code (such as mobile app or desktop application; even if it is obfuscated) undermines the security model and will result in admins forcefully disabling the application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Exceptions are made for example applications demoing OAuth usage, if they are explicitly labeled as such and request limited rights.</span> <span id="Libraries"></span> == Bibliotekoj == === PHP === * [[oauthclient-php]] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a client library maintained by Wikimedia</span> * [https://php.net/book.oauth OAuth] – <span lang="en" dir="ltr" class="mw-content-ltr">PECL client library</span> * [https://github.com/firebase/php-jwt firebase/php-jwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a popular JWT library</span> * [https://sr.ht/~taavi/laravel-socialite-mediawiki/ laravel-socialite-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki driver for [[w:Laravel|Laravel]]'s [https://laravel.com/docs/7.x/socialite Socialite] library.</span> === Python === * [https://github.com/valhallasw/flask-mwoauth flask-mwoauth] – <span lang="en" dir="ltr" class="mw-content-ltr">a Flask blueprint to run OAuth against MediaWiki's Extension:OAuth (See tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Flask_OAuth_tool My first Flask OAuth tool])</span> * [https://github.com/wikimedia/MediaWiki-OAuth MediaWiki-OAuth (mwoauth)] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a on top of [http://requests-oauthlib.readthedocs.org/en/latest/oauth1_workflow.html requests-oauthlib]</span> * [https://github.com/python-social-auth/social-core python-social-auth] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework that includes a [https://github.com/python-social-auth/social-core/blob/master/social_core/backends/mediawiki.py MediaWiki backend] (Example tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Django_OAuth_tool My first Django OAuth tool])</span> * [https://docs.authlib.org/en/latest/index.html authlib] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework to interact with Wikimedia OAuth 2.0 API (Full minimal Django OAuth 2.0 [https://code.basabuuka.org/alpcentaur/wmde_oauth_django_example example])</span> * [https://github.com/jpadilla/pyjwt pyjwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a JWT library</span> === Ruby === * [https://github.com/timwaters/omniauth-mediawiki omniauth-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">a MediaWiki strategy for OmniAuth (also available as a [https://rubygems.org/gems/omniauth-mediawiki gem])</span> === Rust === * [https://crates.io/crates/mediawiki MediaWiki crate] <span lang="en" dir="ltr" class="mw-content-ltr">implements both OAuth1 and OAuth2 login mechanisms.</span> * [https://crates.io/crates/oauth2 oauth2 crate] === Node.js === * [https://www.npmjs.com/package/passport-mediawiki-oauth passport-mediawiki-oauth] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki strategy for the Passport auth framework (which can be used effortlessly as a middleware with Express JS and similar frameworks)</span> * [https://www.npmjs.com/package/oauth-fetch-json oauth-fetch-json] – <span lang="en" dir="ltr" class="mw-content-ltr">library for signing OAuth requests</span> * [https://www.npmjs.com/package/m3api-oauth2 m3api-oauth2] – an extension package for [https://www.npmjs.com/package/m3api m3api], making it easy to make requests authenticated via [[Special:MyLanguage/Help:OAuth|OAuth 2.0]] === Go === * [https://github.com/mrjones/oauth mrjones/oauth] (OAuth 1.0) * [https://pkg.go.dev/golang.org/x/oauth2 golang.org/x/oauth2] <span lang="en" dir="ltr" class="mw-content-ltr">(OAuth 2.0, [https://pkg.go.dev/golang.org/x/oauth2#example-Config example])</span> === Java === * [https://github.com/scribejava/scribejava ScribeJava] <span lang="en" dir="ltr" class="mw-content-ltr">since version 5.5.0 ([https://github.com/scribejava/scribejava/pull/852 pull request])</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Example code == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === PHP client without using any libraries === </div> [[toollabs:oauth-hello-world|OAuth Hello World]] – <span lang="en" dir="ltr" class="mw-content-ltr">easy to understand demo application written in PHP without any libraries.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === PHP command-line client with RSA keys, using oauthclient-php === </div> <span lang="en" dir="ltr" class="mw-content-ltr">PHP application using classes from the OAuth extension codebase.</span> {{Todo|1=<span lang="en" dir="ltr" class="mw-content-ltr">convert this to actually use oauthclient-php! Probably just a bunch of <code>use</code> declarations.</span>}} <span lang="en" dir="ltr" class="mw-content-ltr">Before Starting:</span> <syntaxhighlight lang="shell-session"> $ openssl genrsa -out appkey.pem 4096 $ openssl rsa -in appkey.pem -pubout > appkey.pub </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">PHP source code</span>}} <syntaxhighlight lang="php"> <?php if ( PHP_SAPI !== 'cli' ) { die( "CLI-only test script\n" ); } /** * A basic client for overall testing */ function wfDebugLog( $method, $msg) { //echo "[$method] $msg\n"; } require 'OAuth.php'; require 'MWOAuthSignatureMethod.php'; $consumerKey = ''; #$consumerSecret = ''; // We don't need this, since we're using RSA, except to validate the /identify call $privateKey = file_get_contents( 'appkey.pem' ); $baseurl = 'http://<wiki>/wiki/Special:OAuth'; $endpoint_req = $baseurl . '/initiate?format=json&oauth_callback=oob'; // format=json makes php a little easier $endpoint_acc = $baseurl . '/token?format=json'; $endpoint_id = $baseurl . '/identify'; $c = new OAuthConsumer( $consumerKey, $privateKey ); // Make sure we sign title and format $parsed = parse_url( $endpoint_req ); $extraSignedParams = array(); parse_str($parsed['query'], $extraSignedParams); $extraSignedParams['title'] = 'Special:OAuth/initiate'; $init_req = OAuthRequest::from_consumer_and_token( $c, // OAuthConsumer for your app NULL, // User token, NULL for calls to initiate "GET", // http method $endpoint_req, // endpoint url (this is signed) $extraSignedParams // extra parameters we want to sign (must include title) ); $rsa_method = new MWOAuthSignatureMethod_RSA_SHA1( new OAuthDataStore(), $privateKey ); $init_req->sign_request( $rsa_method, // OAuthSignatureMethod $c, // OAuthConsumer for your app NULL // User token, NULL for calls to initiate ); echo "Getting request token with: $init_req\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, (string) $init_req ); // Pass OAuth in GET params curl_setopt( $ch, CURLOPT_HTTPGET, true ); curl_setopt( $ch, CURLOPT_HEADER, false ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $requestToken = json_decode( $data ); print "Visit $baseurl/authorize?oauth_token={$requestToken->key}&oauth_consumer_key=$consumerKey\n"; // ACCESS TOKEN print "Enter the verification code:\n"; $fh = fopen( "php://stdin", "r" ); $line = fgets( $fh ); $rc = new OAuthToken( $requestToken->key, $requestToken->secret ); $parsed = parse_url( $endpoint_acc ); parse_str($parsed['query'], $params); $params['oauth_verifier'] = trim($line); $params['title'] = 'Special:OAuth/token'; $acc_req = OAuthRequest::from_consumer_and_token( $c, $rc, "GET", $endpoint_acc, $params ); $acc_req->sign_request($rsa_method, $c, $rc); echo "Calling: $acc_req\n"; unset( $ch ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_acc ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $acc_req->to_header() ) ); // Set the Authorization Header $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $acc = json_decode( $data ); $accessToken = new OAuthToken( $acc->key, $acc->secret ); /** * Insecurely call the api for information about the user. * A MITM can forge a response from the server, so don't rely on this for identity! */ $apiurl = 'http://<wiki>/w/api.php'; $apiParams = array( 'action' => 'query', 'meta' => 'userinfo', 'uiprop' => 'rights', 'format' => 'json', ); $api_req = OAuthRequest::from_consumer_and_token( $c, // Consumer $accessToken, // User Access Token "GET", // HTTP Method $apiurl, // Endpoint url $apiParams // Extra signed parameters ); $api_req->sign_request( $rsa_method, $c, $accessToken ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $apiurl . "?" . http_build_query( $apiParams ) ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $api_req->to_header() ) ); // Authorization header required for api $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; /** * Securely get the identity of the user */ $consumerSecret = ''; $extraSignedParams = array( 'title' => 'Special:OAuth/identify' ); $req = OAuthRequest::from_consumer_and_token( $c, $accessToken, "GET", $endpoint_id, $extraSignedParams ); $req->sign_request( $rsa_method, $c, $accessToken ); echo "Calling: '$endpoint_id'\nHeader: {$req->to_header()}\n\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_id ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $req->to_header() ) ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } $identity = JWT::decode( $data, $consumerSecret ); // Validate the JWT if ( !validateJWT( $identity, $consumerKey, $req->get_parameter( 'oauth_nonce' ) ) ) { print "The JWT did not validate"; } else { print "We got a valid JWT, describing the user as:\n"; print " * Username: {$identity->username}\n"; print " * User's current groups: " . implode( ',', $identity->groups ) . "\n"; print " * User's current rights: " . implode( ',', $identity->rights ) . "\n"; } /** * Validate a JWT, to ensure this isn't a reply, spoof, etc. * @param $identity the decoded JWT * @param $consumerKey your App's Key * @param $nonce the nonce sent with your request, which should be returned */ function validateJWT( $identity, $consumerKey, $nonce ) { $expectedConnonicalServer = 'http://<wiki>'; // Verify the issuer is who we expect (server sends $wgCanonicalServer) if ( $identity->iss !== $expectedConnonicalServer ) { print "Invalid Issuer"; return false; } // Verify we are the intended audience if ( $identity->aud !== $consumerKey ) { print "Invalid Audience"; return false; } // Verify we are within the time limits of the token. // Issued at (iat) should be in the past, // Expiration (exp) should be in the future. $now = time(); if ( $identity->iat > $now || $identity->exp < $now ) { print "Invalid Time"; return false; } // Verify we haven't seen this nonce before, which would indicate a replay attack if ( $identity->nonce !== $nonce ) { print "Invalid Nonce"; return false; } return true; } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Python command-line client using mwoauth === </div> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Python source code</span>}} <syntaxhighlight lang="python"> from mwoauth import ConsumerToken, Handshaker import requests from requests_oauthlib import OAuth1 from six.moves import input # For compatibility between python 2 and 3 # Consruct a "consumer" from the key/secret provided by MediaWiki import config # You'll need to provide this # Create a file called config.py somewhere where it will be found by python, e.g. in the same directory as this script, with the following content (not including the # characters!) # consumer_key = "the consumer token you got when you registered your applicaton" # consumer_secret = "the secret token you got when you registered your application" # For example: # consumer_key = "20bc67da5081a30c736340c493f60d14" # consumer_secret = "af4313371bb2fb38e81fe7d300080085f52849f9" consumer_token = ConsumerToken(config.consumer_key, config.consumer_secret) # Construct handshaker with wiki URI and consumer handshaker = Handshaker("https://en.wikipedia.org/w/index.php", consumer_token) # Step 1: Initialise -- ask MediaWiki for a temporary key/secret for user redirect, request_token = handshaker.initiate() # Step 2: Authorise -- send user to MediaWiki to confirm authorisation print("Point your browser to: %s" % redirect) # response_qs = input("Response query string: ") # Step 3: Complete -- obtain authorised key/secret for "resource owner" access_token = handshaker.complete(request_token, response_qs) # Construct an auth object with the consumer and access tokens auth1 = OAuth1(consumer_token.key, client_secret=consumer_token.secret, resource_owner_key=access_token.key, resource_owner_secret=access_token.secret) # Now, accessing the API on behalf of a user print("Reading top 10 watchlist items") response = requests.get( "https://en.wikipedia.org/w/api.php", params={ 'action': "query", 'list': "watchlist", 'wllimit': 10, 'wlprop': "title|comment", 'format': "json" }, auth=auth1 ) for item in response.json()['query']['watchlist']: print("{title}\t{comment}".format(**item)) </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Python Toolforge tutorial using mwoauth === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> See: </div> [[wikitech:Help:Toolforge/My first Flask OAuth tool]] === Python Toolforge tutorial using authlib (OAuth 2.0) === {{Collapse_top|title=Python source code}} <syntaxhighlight lang="python"> # > requirements.txt # flask==3.1.3 # requests==2.33.1 # authlib==1.7.0 # > config.py OAUTH_ACCESS_TOKEN_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/access_token" OAUTH_API_BASE_URL = "https://commons.wikimedia.org/w/" OAUTH_AUTHORIZE_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/authorize" OAUTH_CODE_CHALLENGE_METHOD = "S256" OAUTH_CONSUMER_KEY = "Y" OAUTH_CONSUMER_SECRET = "Z" OAUTH_SCOPE = "basic editpage" # > app.py from authlib.integrations.flask_client import FlaskOAuth2App, OAuth from flask import Flask, jsonify, redirect, request, session from requests import Response app = Flask() app.config.from_pyfile("config.py") oauth = OAuth(app) oauth.register( name="mediawiki", client_id=app.config["OAUTH_CONSUMER_KEY"], client_secret=app.config["OAUTH_CONSUMER_SECRET"], client_kwargs={ "code_challenge_method": app.config["OAUTH_CODE_CHALLENGE_METHOD"], "scope": app.config["OAUTH_SCOPE"], }, api_base_url=app.config["OAUTH_API_BASE_URL"], access_token_url=app.config["OAUTH_ACCESS_TOKEN_URL"], authorize_url=app.config["OAUTH_AUTHORIZE_URL"], ) oauth_client: FlaskOAuth2App = oauth.create_client("mediawiki") @app.route("/") def index(): return app.send_static_file("index.html") @app.route("/login") def login(): return oauth_client.authorize_redirect() @app.route("/oauth-callback") def auth(): token = oauth_client.authorize_access_token() session["token"] = token return redirect("/") @app.route("/logout") def logout(): session.pop("token", None) session.clear() return redirect("/") @app.route("/user") def user(): response: Response = oauth_client.request( "GET", "rest.php/oauth2/resource/profile", token=session["token"], ) user = response.json() response.raise_for_status() return jsonify(user=user) @app.route("/edit", methods=["POST"]) def edit(): data = request.get_json() pageid = int(data["pageid"]) response: Response = oauth_client.request( "POST", "api.php", token=session["token"], data=dict( format="json", formatversion="2", action="query", pageids=str(pageid), prop="revisions|wbentityusage", rvprop="content", rvslots="*", meta="tokens", ), ) r = response.json() token = r["query"]["tokens"]["csrftoken"] ... </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Go command-line client using mrjones/auth (OAuth 1.0) === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Before you begin: </div> <syntaxhighlight lang="shell-session"> $ go get github.com/mrjones/oauth </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Go source code</span>}} <syntaxhighlight lang="go"> package main import ( "fmt" "os" "github.com/mrjones/oauth" "io/ioutil" "strconv" ) func main() { var consumerKey string = "" var consumerSecret string = "" if len(consumerKey) == 0 || len(consumerSecret) == 0 { os.Exit(1) } c := oauth.NewConsumer( consumerKey, consumerSecret, oauth.ServiceProvider{ RequestTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/initiate", AuthorizeTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/authorize", AccessTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/token", }) c.Debug(true) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/initiate", } c.AdditionalAuthorizationUrlParams = map[string]string{ "oauth_consumer_key": consumerKey, } requestToken, url, err := c.GetRequestTokenAndUrl("oob") if err != nil { fmt.Println( err ) } fmt.Println( "Got token " + requestToken.Token ) fmt.Println("(1) Go to: " + url) fmt.Println("(2) Grant access, you should get back a verification code.") fmt.Println("(3) Enter that verification code here: ") verificationCode := "" fmt.Scanln(&verificationCode) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/token", } accessToken, err := c.AuthorizeToken(requestToken, verificationCode) if err != nil { fmt.Println(err) } fmt.Println( "Got access token " + accessToken.Token ) c.AdditionalParams = map[string]string{} response, err := c.Get( "http://<wiki>/wiki/api.php", map[string]string{ "action": "query", "meta": "userinfo", "uiprop": "rights", "format": "json", }, accessToken) if err != nil { fmt.Println(err) } fmt.Println( "\tResponse Status: '" + response.Status + "'\n" ) fmt.Println( "\tResponse Code: " + strconv.Itoa(response.StatusCode) + "\n" ) bytes, _ := ioutil.ReadAll(response.Body) fmt.Println( "\tResponse Body: " + string(bytes) + "\n" ) } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === JavaScript applications using OAuth 2 === </div> * [https://github.com/wikimedia/apiclient-wiki wikimedia/apiclient-wiki] – <span lang="en" dir="ltr" class="mw-content-ltr">entire application in 520 lines of code</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Full applications using OAuth === </div> * [https://github.com/jdlrobson/weekipedia/blob/master/libs/server/app.js Weekipedia], <span lang="en" dir="ltr" class="mw-content-ltr">A full scale React.js port of the Wikipedia mobile site uses both.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">many [https://toolhub.wikimedia.org/search?keywords__term=oauth Toolforge tools]</span> <span id="Notes"></span> == Notoj == <references /> c0aa5xez64ld1mfbvlfbv1uc1k3za48 Growth/Communities/How to configure the mentors' list/cs 0 954246 8364417 8355078 2026-05-03T15:26:25Z Rebulka 17532855 8364417 wikitext text/x-wiki <languages /> {{Growth/Active wikis}} Chcete se stát mentorem? Děkujeme! Tým Growth nabízí mentorský systém všem komunitám Wikipedie. Cílem je na wiki spárovat nováčky s mentory. Mentoři jsou zkušení uživatelé, připraveni pomoci novým uživatelům. Jsou klíčovým faktorem pro začlenění a povzbuzení nových uživatelů k úpravě wiki. Nováčci jsou informováni o svém mentorovi na [[#presentation|domovské stránce pro nováčky]]. Mentoři vidí, koho mentorují na [[#ready|mentorském panelu]]. Prosím, podívejte se na naše {{pll|Growth/Communities/How to work with newcomers on help desks|materiály o komunikaci s nováčky}} a následně se představte jako mentor. ; Ve zkratce : Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. Je to možné na wikinách, kde existuje seznam mentorů. : Pokud seznam neexistuje, musíte [[#create|nastavit seznam mentorů na vaší wiki]]. {{anchor|presentation}} <span id="Presentation_of_mentors_on_the_Homepage"></span> == Prezentace na Domovské stránce == [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11.png|thumb|Tento obrázek ukazuje, jak bude vaše představení ukázané v Domovské stránce.]] [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11 too long.png|thumb|Zprávy, které jsou delší než 240 znaků, jsou useknuté.]] {{pll|Growth/Personalized first day/Newcomer homepage|Domovská stránka nováčků}} je navržena tak, aby jim pomohla v uskutečnění jejich prvních kroků na Wikipedii. Nováčci mají přímý přístup na svou domovskou stránku. Tam vidí jméno zkušeného uživatele, který je připraven jim v případě potřeby pomoci: Jejich mentora. Mentoři jsou náhodně přiděleni více nováčkům, ale ne všichni svého mentora kontaktují. V průměru dostává mentor každý týden 0 až 6 otázek od nováčků. {{anchor|add}} <span id="How_to_add_yourself_to_the_mentor_list"></span> == Jak se přidat do seznamu mentorů == Děkujeme, že jste se dobrovolně stali mentorem! Je to obohacující zkušenost. <span id="Visit_the_Mentor_Dashboard"></span> === Navštivte panel Mentor Dashboard === Některé wiki vytvořily konkrétní stránku se seznamem mentorů, ale také pravidly nebo osvědčenými postupy, které je třeba dodržovat. Stránku své komunity můžete najít [[d:Q14339834|na Wikidata]]. Tento seznam vám řekne, jaké jsou podmínky pro to, abyste byli mentorem, pokud nějaká podmínka platí. Ve výchozím nastavení je proces registrace otevřen editorům, kteří mají 500 úprav a 90 dní přítomnosti. Ve výchozím nastavení je seznam mentorů pro vaši wiki umístěn na <code>Special:ManageMentors</code>. Tam můžete vidět, kdo je mentor. Pokud vaše wiki nastavila mentorský program a pokud se kvalifikujete být mentorem podle místních pravidel, navštivte prosím <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code> a zaregistrujte se. {{anchor|description}} <span id="Add_your_description"></span> === Přidejte svůj popis === Budete požádáni, abyste se popsali jako mentor. Tento krátký popis se zobrazí na domovské stránce nováčka. Ve výchozím nastavení je toto představení "{{Int|growthexperiments-homepage-mentorship-intro}}". Maximální délka popisu je 240 znaků. Pokud je delší, systém popis omezí. Nepřidávejte do popisu wikitext (bez odkazů, bez šablon), HTML nebo CSS: Nebude přijat. Správci mohou upravit váš popis pomocí <code>Special:ManageMentors</code>. <span id="Descriptions_examples"></span> ==== Příklady popisů ==== <small>(Z důvodu překladů mohou příklady níže přesáhnout limit 240 znaků.)</small> Můžete se představit neutrálně: * "Jsem tady, abych vám pomohl s orientováním se ve Wikipedii, neváhejte se mě zeptat na různé otázky!" Pokud upravujete Wikipedii a podílíte se na životě své komunity, máte dostatek zkušeností, abyste mohli odpovědět na jakoukoli otázku. Ale nenechte lidi, aby si mysleli, že jim můžete pomoci jen s něčím konkrétním. * Nepište "Edituji články o fotbalu". Nováčci si mohou myslet, že se vás nemohou zeptat na nic dalšího, než na fotbal. * Namísto toho napište "Nejčastěji přispívám o fotbalu, ale mohu vám pomoci s jakýmkoliv dalším tématem." Můžete pozvat nováčky, aby vás kontaktovali: * "Mohu vám odpovědět na vaše otázky o editování Wikipedie. Nejčastěji přispívám články o fotbalu. O čem budete přispívat vy?" * "Byl jsem stejně zmatený, jako jste teď vy. Pomohlo mi, že jsem se ptal zkušenějších uživatelů. Neváhejte se mě zeptat na cokoliv." Prosím, udržte své představení krátké: 240 znaků je maximum. Zvolili jsme tento limit, abychom se vyhnuli dlouhým textům, které by odváděly pozornost od ostatních informací, které již jsou na Domovské stránce k dispozici. Ze stejného důvodu nebude fungovat wikitext. Aby se o vás nováčci dozvěděli více, mohou kliknout na vaši uživatelskou stránku, na kterou z Domovské stránky vede odkaz. Vaše uživatelské jméno se již zobrazí na domovské stránce nováčků spolu s odkazem na vaši uživatelskou stránku. Není třeba nováčkům ve své prezentaci připomínat, kdo jste. <span id="Welcome_templates"></span> === Uvítací šablony === Komunity si mohou vytvářet nebo upravovat vlastní uvítací šablony. Mohou existovat uvítací šablony speciálně navržené pro mentory, které mohou dát svým menteům (vědecké pracovnice a pracovníci v počáteční fázi své kariéry), aby jim pomohly s představováním mentorů a procesem zaškolování nováčků. Například anglická Wikipedie má [[w:Template:Mentor welcome|<nowiki>{{Mentor welcome}}</nowiki>]] a [[w:Template:Welcome mentee |<nowiki>{{Welcome mentee}}</nowiki>]]. Francouzská Wikipedie má [[w:fr:Template:Bienvenue nouveau |<nowiki>{{Bienvenue nouveau}}</nowiki>]]. Uvítací šablony nejsou povinné, ale doporučené: Někteří nově příchozí se nedívají na svou domovskou stránku, zatímco jiní se nedívají na svou diskusní stránku. <span lang="en" dir="ltr" class="mw-content-ltr">An automatic distribution of a welcome template to all new accounts can increase the number of interactions with an experienced mentor.</span> [[special:MyLanguage/Growth/FAQ#magicword|Magické slovo]] <code>{{ll|Growth/FAQ#magicword|<nowiki>{{#mentor}}</nowiki>}}</code> je k dispozici pro šablonování a {{tlc|#mentor:''NewcomerName''}} zobrazuje mentora daného nováčka. <span class="mw-translate-fuzzy">Je na každé komunitě, aby se rozhodla, zda má být jméno mentora [[Special:MyLanguage/Help:Substitution|nahrazeno]]. Každé řešení má své výhody a nevýhody:</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each solution has pros and cons:</span> ; Pokud je název nahrazen : Ve zprávě se trvale zobrazí jméno mentora, který byl nově příchozím přidělen v době, kdy byla zpráva zanechána. : Toto použití je relevantní, pokud je uvítací zpráva distribuována ručně mentorem, protože historie uvádí, kdo zprávu distribuoval. Pokud se však nováček pokusí kontaktovat daného mentora a tento mentor již opustil mentorství nebo wiki, může to vést k určité frustraci. ; Pokud název není nahrazen : [[#reassign|Když se mentor změní]], magické slovo vybere jméno nového mentora. Tímto způsobem nováček, který si nepřečetl uvítací zprávu nebo zapomněl na svého předchozího mentora, uvidí toto jméno jako aktivního mentora uvedeného na domovské stránce. To snižuje zmatek pro nováčky. : To může být relevantní v případech, kdy je zpráva distribuována robotem nebo prostřednictvím služby [[Extension:NewUserMessage|NewUserMessage]], nebo v případech, kdy historie vztahu mentor/mentorovaný není tak důležitá (log ji uchovává). {{anchor|ready}} <span id="You_are_ready"></span> === Jste připraveni === <span class="mw-translate-fuzzy">Po zaregistrování vám systém začne přiřazovat nové mentorované. Pravidelně navštěvujte $1, abyste sledovali nováčky, kteří vám byly přiděleni.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Regularly visit <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code> to keep an eye on the newcomers assigned to you.</span> <span class="mw-translate-fuzzy">Nováčci vás také začnou kontaktovat přímo na vaší diskusní stránce. Nezapomeňte je zmínit, když odpovíte na jejich zprávy. Zkontrolujte také naši dokumentaci na stránce [[$1|Jak ovlivňovat nováčky]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Don't forget to mention them when you reply to their messages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please also check our documentation on [[Special:MyLanguage/Growth/Communities/How to interact with newcomers|how to interact with newcomers]].</span> {{anchor|create}} <span id="How_to_create_a_list_of_mentors"></span> == Jak vytvořit a udržovat seznam mentorů == <span id="1._Agree_on_having_mentorship"></span> === 1. Dohodněte se na mentorství === Nejprve musíte zkontrolovat, zda jsou nástroje Growth [[Growth/Deployment table|instalovány na vaší wiki]]. Pokud tomu tak ještě není, přečtěte si, prosím, [[#get|jak získat tyto funkce]]. Pak musíte najít nějaké další mentory, kteří se dobrovolně přihlásí. Doporučujeme vám zahájit konverzaci na příslušných místech na vaší wiki, abyste se mohli rozhodnout, zda by měl být tento seznam mentorů vytvořen. Je to také dobrý způsob, jak získat mentory. Mentorský systém Growth může [[Special:MyLanguage/Growth/FAQ#existing|nahradit nebo doplnit stávající mentorský systém]]. Na základě našeho pozorování doporučujeme mít jednoho mentora pro každou skupinu 500 nových uživatelů, které vaše wiki měsíčně získá. Například, pokud má vaše wiki 2 500 nových účtů za měsíc, měli byste mít alespoň 5 mentorů. Doporučujeme mít alespoň 3 mentory. Mentoři se mohou zaregistrovat před aktivací mentorského systému na <code>Special:EnrollAsMentor</code>. <span id="2._Activate_mentorship"></span> === 2. Aktivujte mentorship === Na vaší wiki musí administrátor zapnout mentorský systém pomocí konfigurační stránky (<code>Special:CommunityConfiguration</code>). <span id="3._List_of_mentors"></span> === 3. Seznam mentorů === Seznam mentorů se zobrazí na <code>Special:ManageMentors</code>. Seznam mentorů můžete [[Transclusion|přenést]] kamkoli s následující syntaxí: <code><nowiki>{{Special:ManageMentors}}</nowiki></code>. Pokud se rozhodnete vytvořit stránku, kam převedete seznam mentorů, uveďte ji [[d:Q14339834|na wikidata]]. Na konfigurační stránce přidáte některá kritéria pro definování toho, kdo může být mentorem. Ve výchozím nastavení jsou požadavky na více než 500 provedených úprav a účet, který je alespoň 90 dní starý. Vaše komunita může také definovat některá specifická pravidla o tom, kdo může být mentorem (stáří účtu, počet provedených úprav, počet úprav provedených v hlavním prostoru, mít konkrétní roli atd.), a poté přidělit roli mentora kterémukoli účtu. Pokud chcete tento proces použít, [[talk:Growth|kontaktujte nás]]. <span id="4._Mentors_can_now_signup"></span> === 4. Mentoři se nyní mohou zaregistrovat === Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. <span id="Options"></span> == Možnosti == Mentoři mohou spravovat svůj účet: * [[Special:MyLanguage/Growth/FAQ#claim|Nárokovat nováčka od jiného mentora]] * [[Special:MyLanguage/Growth/FAQ#reassign|Přiřadit mentorované dalším mentorům]] * [[Special:MyLanguage/Growth/FAQ#change|Změnit počet nově přiřazených nováčků]] * [[Special:MyLanguage/Growth/FAQ#pause|Pauza mentorství]] * [[Special:MyLanguage/Growth/FAQ#quit|Ukončit mentorství]] Systém poskytuje možnosti pro správu mentorů: * [[Special:MyLanguage/Growth/FAQ#inactivity|Odstranit neaktivního mentora ze seznamu]] * [[Special:MyLanguage/Growth/FAQ#block|Spravuje blokované mentory]] <span id="See_also"></span> == Související odkazy == * [[Special:MyLanguage/Growth/FAQ#mentoring|Growth FAQ, o mentoringu]] mjvtph9viccg9ebde66wsl960upou4u 8364419 8364417 2026-05-03T15:26:32Z Rebulka 17532855 Created page with "Automatické rozeslání uvítací šablony všem novým účtům může zvýšit počet interakcí se zkušeným mentorem." 8364419 wikitext text/x-wiki <languages /> {{Growth/Active wikis}} Chcete se stát mentorem? Děkujeme! Tým Growth nabízí mentorský systém všem komunitám Wikipedie. Cílem je na wiki spárovat nováčky s mentory. Mentoři jsou zkušení uživatelé, připraveni pomoci novým uživatelům. Jsou klíčovým faktorem pro začlenění a povzbuzení nových uživatelů k úpravě wiki. Nováčci jsou informováni o svém mentorovi na [[#presentation|domovské stránce pro nováčky]]. Mentoři vidí, koho mentorují na [[#ready|mentorském panelu]]. Prosím, podívejte se na naše {{pll|Growth/Communities/How to work with newcomers on help desks|materiály o komunikaci s nováčky}} a následně se představte jako mentor. ; Ve zkratce : Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. Je to možné na wikinách, kde existuje seznam mentorů. : Pokud seznam neexistuje, musíte [[#create|nastavit seznam mentorů na vaší wiki]]. {{anchor|presentation}} <span id="Presentation_of_mentors_on_the_Homepage"></span> == Prezentace na Domovské stránce == [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11.png|thumb|Tento obrázek ukazuje, jak bude vaše představení ukázané v Domovské stránce.]] [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11 too long.png|thumb|Zprávy, které jsou delší než 240 znaků, jsou useknuté.]] {{pll|Growth/Personalized first day/Newcomer homepage|Domovská stránka nováčků}} je navržena tak, aby jim pomohla v uskutečnění jejich prvních kroků na Wikipedii. Nováčci mají přímý přístup na svou domovskou stránku. Tam vidí jméno zkušeného uživatele, který je připraven jim v případě potřeby pomoci: Jejich mentora. Mentoři jsou náhodně přiděleni více nováčkům, ale ne všichni svého mentora kontaktují. V průměru dostává mentor každý týden 0 až 6 otázek od nováčků. {{anchor|add}} <span id="How_to_add_yourself_to_the_mentor_list"></span> == Jak se přidat do seznamu mentorů == Děkujeme, že jste se dobrovolně stali mentorem! Je to obohacující zkušenost. <span id="Visit_the_Mentor_Dashboard"></span> === Navštivte panel Mentor Dashboard === Některé wiki vytvořily konkrétní stránku se seznamem mentorů, ale také pravidly nebo osvědčenými postupy, které je třeba dodržovat. Stránku své komunity můžete najít [[d:Q14339834|na Wikidata]]. Tento seznam vám řekne, jaké jsou podmínky pro to, abyste byli mentorem, pokud nějaká podmínka platí. Ve výchozím nastavení je proces registrace otevřen editorům, kteří mají 500 úprav a 90 dní přítomnosti. Ve výchozím nastavení je seznam mentorů pro vaši wiki umístěn na <code>Special:ManageMentors</code>. Tam můžete vidět, kdo je mentor. Pokud vaše wiki nastavila mentorský program a pokud se kvalifikujete být mentorem podle místních pravidel, navštivte prosím <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code> a zaregistrujte se. {{anchor|description}} <span id="Add_your_description"></span> === Přidejte svůj popis === Budete požádáni, abyste se popsali jako mentor. Tento krátký popis se zobrazí na domovské stránce nováčka. Ve výchozím nastavení je toto představení "{{Int|growthexperiments-homepage-mentorship-intro}}". Maximální délka popisu je 240 znaků. Pokud je delší, systém popis omezí. Nepřidávejte do popisu wikitext (bez odkazů, bez šablon), HTML nebo CSS: Nebude přijat. Správci mohou upravit váš popis pomocí <code>Special:ManageMentors</code>. <span id="Descriptions_examples"></span> ==== Příklady popisů ==== <small>(Z důvodu překladů mohou příklady níže přesáhnout limit 240 znaků.)</small> Můžete se představit neutrálně: * "Jsem tady, abych vám pomohl s orientováním se ve Wikipedii, neváhejte se mě zeptat na různé otázky!" Pokud upravujete Wikipedii a podílíte se na životě své komunity, máte dostatek zkušeností, abyste mohli odpovědět na jakoukoli otázku. Ale nenechte lidi, aby si mysleli, že jim můžete pomoci jen s něčím konkrétním. * Nepište "Edituji články o fotbalu". Nováčci si mohou myslet, že se vás nemohou zeptat na nic dalšího, než na fotbal. * Namísto toho napište "Nejčastěji přispívám o fotbalu, ale mohu vám pomoci s jakýmkoliv dalším tématem." Můžete pozvat nováčky, aby vás kontaktovali: * "Mohu vám odpovědět na vaše otázky o editování Wikipedie. Nejčastěji přispívám články o fotbalu. O čem budete přispívat vy?" * "Byl jsem stejně zmatený, jako jste teď vy. Pomohlo mi, že jsem se ptal zkušenějších uživatelů. Neváhejte se mě zeptat na cokoliv." Prosím, udržte své představení krátké: 240 znaků je maximum. Zvolili jsme tento limit, abychom se vyhnuli dlouhým textům, které by odváděly pozornost od ostatních informací, které již jsou na Domovské stránce k dispozici. Ze stejného důvodu nebude fungovat wikitext. Aby se o vás nováčci dozvěděli více, mohou kliknout na vaši uživatelskou stránku, na kterou z Domovské stránky vede odkaz. Vaše uživatelské jméno se již zobrazí na domovské stránce nováčků spolu s odkazem na vaši uživatelskou stránku. Není třeba nováčkům ve své prezentaci připomínat, kdo jste. <span id="Welcome_templates"></span> === Uvítací šablony === Komunity si mohou vytvářet nebo upravovat vlastní uvítací šablony. Mohou existovat uvítací šablony speciálně navržené pro mentory, které mohou dát svým menteům (vědecké pracovnice a pracovníci v počáteční fázi své kariéry), aby jim pomohly s představováním mentorů a procesem zaškolování nováčků. Například anglická Wikipedie má [[w:Template:Mentor welcome|<nowiki>{{Mentor welcome}}</nowiki>]] a [[w:Template:Welcome mentee |<nowiki>{{Welcome mentee}}</nowiki>]]. Francouzská Wikipedie má [[w:fr:Template:Bienvenue nouveau |<nowiki>{{Bienvenue nouveau}}</nowiki>]]. Uvítací šablony nejsou povinné, ale doporučené: Někteří nově příchozí se nedívají na svou domovskou stránku, zatímco jiní se nedívají na svou diskusní stránku. Automatické rozeslání uvítací šablony všem novým účtům může zvýšit počet interakcí se zkušeným mentorem. [[special:MyLanguage/Growth/FAQ#magicword|Magické slovo]] <code>{{ll|Growth/FAQ#magicword|<nowiki>{{#mentor}}</nowiki>}}</code> je k dispozici pro šablonování a {{tlc|#mentor:''NewcomerName''}} zobrazuje mentora daného nováčka. <span class="mw-translate-fuzzy">Je na každé komunitě, aby se rozhodla, zda má být jméno mentora [[Special:MyLanguage/Help:Substitution|nahrazeno]]. Každé řešení má své výhody a nevýhody:</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each solution has pros and cons:</span> ; Pokud je název nahrazen : Ve zprávě se trvale zobrazí jméno mentora, který byl nově příchozím přidělen v době, kdy byla zpráva zanechána. : Toto použití je relevantní, pokud je uvítací zpráva distribuována ručně mentorem, protože historie uvádí, kdo zprávu distribuoval. Pokud se však nováček pokusí kontaktovat daného mentora a tento mentor již opustil mentorství nebo wiki, může to vést k určité frustraci. ; Pokud název není nahrazen : [[#reassign|Když se mentor změní]], magické slovo vybere jméno nového mentora. Tímto způsobem nováček, který si nepřečetl uvítací zprávu nebo zapomněl na svého předchozího mentora, uvidí toto jméno jako aktivního mentora uvedeného na domovské stránce. To snižuje zmatek pro nováčky. : To může být relevantní v případech, kdy je zpráva distribuována robotem nebo prostřednictvím služby [[Extension:NewUserMessage|NewUserMessage]], nebo v případech, kdy historie vztahu mentor/mentorovaný není tak důležitá (log ji uchovává). {{anchor|ready}} <span id="You_are_ready"></span> === Jste připraveni === <span class="mw-translate-fuzzy">Po zaregistrování vám systém začne přiřazovat nové mentorované. Pravidelně navštěvujte $1, abyste sledovali nováčky, kteří vám byly přiděleni.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Regularly visit <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code> to keep an eye on the newcomers assigned to you.</span> <span class="mw-translate-fuzzy">Nováčci vás také začnou kontaktovat přímo na vaší diskusní stránce. Nezapomeňte je zmínit, když odpovíte na jejich zprávy. Zkontrolujte také naši dokumentaci na stránce [[$1|Jak ovlivňovat nováčky]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Don't forget to mention them when you reply to their messages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please also check our documentation on [[Special:MyLanguage/Growth/Communities/How to interact with newcomers|how to interact with newcomers]].</span> {{anchor|create}} <span id="How_to_create_a_list_of_mentors"></span> == Jak vytvořit a udržovat seznam mentorů == <span id="1._Agree_on_having_mentorship"></span> === 1. Dohodněte se na mentorství === Nejprve musíte zkontrolovat, zda jsou nástroje Growth [[Growth/Deployment table|instalovány na vaší wiki]]. Pokud tomu tak ještě není, přečtěte si, prosím, [[#get|jak získat tyto funkce]]. Pak musíte najít nějaké další mentory, kteří se dobrovolně přihlásí. Doporučujeme vám zahájit konverzaci na příslušných místech na vaší wiki, abyste se mohli rozhodnout, zda by měl být tento seznam mentorů vytvořen. Je to také dobrý způsob, jak získat mentory. Mentorský systém Growth může [[Special:MyLanguage/Growth/FAQ#existing|nahradit nebo doplnit stávající mentorský systém]]. Na základě našeho pozorování doporučujeme mít jednoho mentora pro každou skupinu 500 nových uživatelů, které vaše wiki měsíčně získá. Například, pokud má vaše wiki 2 500 nových účtů za měsíc, měli byste mít alespoň 5 mentorů. Doporučujeme mít alespoň 3 mentory. Mentoři se mohou zaregistrovat před aktivací mentorského systému na <code>Special:EnrollAsMentor</code>. <span id="2._Activate_mentorship"></span> === 2. Aktivujte mentorship === Na vaší wiki musí administrátor zapnout mentorský systém pomocí konfigurační stránky (<code>Special:CommunityConfiguration</code>). <span id="3._List_of_mentors"></span> === 3. Seznam mentorů === Seznam mentorů se zobrazí na <code>Special:ManageMentors</code>. Seznam mentorů můžete [[Transclusion|přenést]] kamkoli s následující syntaxí: <code><nowiki>{{Special:ManageMentors}}</nowiki></code>. Pokud se rozhodnete vytvořit stránku, kam převedete seznam mentorů, uveďte ji [[d:Q14339834|na wikidata]]. Na konfigurační stránce přidáte některá kritéria pro definování toho, kdo může být mentorem. Ve výchozím nastavení jsou požadavky na více než 500 provedených úprav a účet, který je alespoň 90 dní starý. Vaše komunita může také definovat některá specifická pravidla o tom, kdo může být mentorem (stáří účtu, počet provedených úprav, počet úprav provedených v hlavním prostoru, mít konkrétní roli atd.), a poté přidělit roli mentora kterémukoli účtu. Pokud chcete tento proces použít, [[talk:Growth|kontaktujte nás]]. <span id="4._Mentors_can_now_signup"></span> === 4. Mentoři se nyní mohou zaregistrovat === Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. <span id="Options"></span> == Možnosti == Mentoři mohou spravovat svůj účet: * [[Special:MyLanguage/Growth/FAQ#claim|Nárokovat nováčka od jiného mentora]] * [[Special:MyLanguage/Growth/FAQ#reassign|Přiřadit mentorované dalším mentorům]] * [[Special:MyLanguage/Growth/FAQ#change|Změnit počet nově přiřazených nováčků]] * [[Special:MyLanguage/Growth/FAQ#pause|Pauza mentorství]] * [[Special:MyLanguage/Growth/FAQ#quit|Ukončit mentorství]] Systém poskytuje možnosti pro správu mentorů: * [[Special:MyLanguage/Growth/FAQ#inactivity|Odstranit neaktivního mentora ze seznamu]] * [[Special:MyLanguage/Growth/FAQ#block|Spravuje blokované mentory]] <span id="See_also"></span> == Související odkazy == * [[Special:MyLanguage/Growth/FAQ#mentoring|Growth FAQ, o mentoringu]] r596follcac4rn5lz9psvcf3bs3o19e 8364421 8364419 2026-05-03T15:26:44Z Rebulka 17532855 8364421 wikitext text/x-wiki <languages /> {{Growth/Active wikis}} Chcete se stát mentorem? Děkujeme! Tým Growth nabízí mentorský systém všem komunitám Wikipedie. Cílem je na wiki spárovat nováčky s mentory. Mentoři jsou zkušení uživatelé, připraveni pomoci novým uživatelům. Jsou klíčovým faktorem pro začlenění a povzbuzení nových uživatelů k úpravě wiki. Nováčci jsou informováni o svém mentorovi na [[#presentation|domovské stránce pro nováčky]]. Mentoři vidí, koho mentorují na [[#ready|mentorském panelu]]. Prosím, podívejte se na naše {{pll|Growth/Communities/How to work with newcomers on help desks|materiály o komunikaci s nováčky}} a následně se představte jako mentor. ; Ve zkratce : Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. Je to možné na wikinách, kde existuje seznam mentorů. : Pokud seznam neexistuje, musíte [[#create|nastavit seznam mentorů na vaší wiki]]. {{anchor|presentation}} <span id="Presentation_of_mentors_on_the_Homepage"></span> == Prezentace na Domovské stránce == [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11.png|thumb|Tento obrázek ukazuje, jak bude vaše představení ukázané v Domovské stránce.]] [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11 too long.png|thumb|Zprávy, které jsou delší než 240 znaků, jsou useknuté.]] {{pll|Growth/Personalized first day/Newcomer homepage|Domovská stránka nováčků}} je navržena tak, aby jim pomohla v uskutečnění jejich prvních kroků na Wikipedii. Nováčci mají přímý přístup na svou domovskou stránku. Tam vidí jméno zkušeného uživatele, který je připraven jim v případě potřeby pomoci: Jejich mentora. Mentoři jsou náhodně přiděleni více nováčkům, ale ne všichni svého mentora kontaktují. V průměru dostává mentor každý týden 0 až 6 otázek od nováčků. {{anchor|add}} <span id="How_to_add_yourself_to_the_mentor_list"></span> == Jak se přidat do seznamu mentorů == Děkujeme, že jste se dobrovolně stali mentorem! Je to obohacující zkušenost. <span id="Visit_the_Mentor_Dashboard"></span> === Navštivte panel Mentor Dashboard === Některé wiki vytvořily konkrétní stránku se seznamem mentorů, ale také pravidly nebo osvědčenými postupy, které je třeba dodržovat. Stránku své komunity můžete najít [[d:Q14339834|na Wikidata]]. Tento seznam vám řekne, jaké jsou podmínky pro to, abyste byli mentorem, pokud nějaká podmínka platí. Ve výchozím nastavení je proces registrace otevřen editorům, kteří mají 500 úprav a 90 dní přítomnosti. Ve výchozím nastavení je seznam mentorů pro vaši wiki umístěn na <code>Special:ManageMentors</code>. Tam můžete vidět, kdo je mentor. Pokud vaše wiki nastavila mentorský program a pokud se kvalifikujete být mentorem podle místních pravidel, navštivte prosím <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code> a zaregistrujte se. {{anchor|description}} <span id="Add_your_description"></span> === Přidejte svůj popis === Budete požádáni, abyste se popsali jako mentor. Tento krátký popis se zobrazí na domovské stránce nováčka. Ve výchozím nastavení je toto představení "{{Int|growthexperiments-homepage-mentorship-intro}}". Maximální délka popisu je 240 znaků. Pokud je delší, systém popis omezí. Nepřidávejte do popisu wikitext (bez odkazů, bez šablon), HTML nebo CSS: Nebude přijat. Správci mohou upravit váš popis pomocí <code>Special:ManageMentors</code>. <span id="Descriptions_examples"></span> ==== Příklady popisů ==== <small>(Z důvodu překladů mohou příklady níže přesáhnout limit 240 znaků.)</small> Můžete se představit neutrálně: * "Jsem tady, abych vám pomohl s orientováním se ve Wikipedii, neváhejte se mě zeptat na různé otázky!" Pokud upravujete Wikipedii a podílíte se na životě své komunity, máte dostatek zkušeností, abyste mohli odpovědět na jakoukoli otázku. Ale nenechte lidi, aby si mysleli, že jim můžete pomoci jen s něčím konkrétním. * Nepište "Edituji články o fotbalu". Nováčci si mohou myslet, že se vás nemohou zeptat na nic dalšího, než na fotbal. * Namísto toho napište "Nejčastěji přispívám o fotbalu, ale mohu vám pomoci s jakýmkoliv dalším tématem." Můžete pozvat nováčky, aby vás kontaktovali: * "Mohu vám odpovědět na vaše otázky o editování Wikipedie. Nejčastěji přispívám články o fotbalu. O čem budete přispívat vy?" * "Byl jsem stejně zmatený, jako jste teď vy. Pomohlo mi, že jsem se ptal zkušenějších uživatelů. Neváhejte se mě zeptat na cokoliv." Prosím, udržte své představení krátké: 240 znaků je maximum. Zvolili jsme tento limit, abychom se vyhnuli dlouhým textům, které by odváděly pozornost od ostatních informací, které již jsou na Domovské stránce k dispozici. Ze stejného důvodu nebude fungovat wikitext. Aby se o vás nováčci dozvěděli více, mohou kliknout na vaši uživatelskou stránku, na kterou z Domovské stránky vede odkaz. Vaše uživatelské jméno se již zobrazí na domovské stránce nováčků spolu s odkazem na vaši uživatelskou stránku. Není třeba nováčkům ve své prezentaci připomínat, kdo jste. <span id="Welcome_templates"></span> === Uvítací šablony === Komunity si mohou vytvářet nebo upravovat vlastní uvítací šablony. Mohou existovat uvítací šablony speciálně navržené pro mentory, které mohou dát svým menteům (vědecké pracovnice a pracovníci v počáteční fázi své kariéry), aby jim pomohly s představováním mentorů a procesem zaškolování nováčků. Například anglická Wikipedie má [[w:Template:Mentor welcome|<nowiki>{{Mentor welcome}}</nowiki>]] a [[w:Template:Welcome mentee |<nowiki>{{Welcome mentee}}</nowiki>]]. Francouzská Wikipedie má [[w:fr:Template:Bienvenue nouveau |<nowiki>{{Bienvenue nouveau}}</nowiki>]]. Uvítací šablony nejsou povinné, ale doporučené: Někteří nově příchozí se nedívají na svou domovskou stránku, zatímco jiní se nedívají na svou diskusní stránku. Automatické rozeslání uvítací šablony všem novým účtům může zvýšit počet interakcí se zkušeným mentorem. [[special:MyLanguage/Growth/FAQ#magicword|Magické slovo]] <code>{{ll|Growth/FAQ#magicword|<nowiki>{{#mentor}}</nowiki>}}</code> je k dispozici pro šablonování a {{tlc|#mentor:''NewcomerName''}} zobrazuje mentora daného nováčka. Je na každé komunitě, aby se rozhodla, zda má být jméno mentora [[Special:MyLanguage/Help:Substitution|nahrazeno]]. <span lang="en" dir="ltr" class="mw-content-ltr">Each solution has pros and cons:</span> ; Pokud je název nahrazen : Ve zprávě se trvale zobrazí jméno mentora, který byl nově příchozím přidělen v době, kdy byla zpráva zanechána. : Toto použití je relevantní, pokud je uvítací zpráva distribuována ručně mentorem, protože historie uvádí, kdo zprávu distribuoval. Pokud se však nováček pokusí kontaktovat daného mentora a tento mentor již opustil mentorství nebo wiki, může to vést k určité frustraci. ; Pokud název není nahrazen : [[#reassign|Když se mentor změní]], magické slovo vybere jméno nového mentora. Tímto způsobem nováček, který si nepřečetl uvítací zprávu nebo zapomněl na svého předchozího mentora, uvidí toto jméno jako aktivního mentora uvedeného na domovské stránce. To snižuje zmatek pro nováčky. : To může být relevantní v případech, kdy je zpráva distribuována robotem nebo prostřednictvím služby [[Extension:NewUserMessage|NewUserMessage]], nebo v případech, kdy historie vztahu mentor/mentorovaný není tak důležitá (log ji uchovává). {{anchor|ready}} <span id="You_are_ready"></span> === Jste připraveni === <span class="mw-translate-fuzzy">Po zaregistrování vám systém začne přiřazovat nové mentorované. Pravidelně navštěvujte $1, abyste sledovali nováčky, kteří vám byly přiděleni.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Regularly visit <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code> to keep an eye on the newcomers assigned to you.</span> <span class="mw-translate-fuzzy">Nováčci vás také začnou kontaktovat přímo na vaší diskusní stránce. Nezapomeňte je zmínit, když odpovíte na jejich zprávy. Zkontrolujte také naši dokumentaci na stránce [[$1|Jak ovlivňovat nováčky]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Don't forget to mention them when you reply to their messages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please also check our documentation on [[Special:MyLanguage/Growth/Communities/How to interact with newcomers|how to interact with newcomers]].</span> {{anchor|create}} <span id="How_to_create_a_list_of_mentors"></span> == Jak vytvořit a udržovat seznam mentorů == <span id="1._Agree_on_having_mentorship"></span> === 1. Dohodněte se na mentorství === Nejprve musíte zkontrolovat, zda jsou nástroje Growth [[Growth/Deployment table|instalovány na vaší wiki]]. Pokud tomu tak ještě není, přečtěte si, prosím, [[#get|jak získat tyto funkce]]. Pak musíte najít nějaké další mentory, kteří se dobrovolně přihlásí. Doporučujeme vám zahájit konverzaci na příslušných místech na vaší wiki, abyste se mohli rozhodnout, zda by měl být tento seznam mentorů vytvořen. Je to také dobrý způsob, jak získat mentory. Mentorský systém Growth může [[Special:MyLanguage/Growth/FAQ#existing|nahradit nebo doplnit stávající mentorský systém]]. Na základě našeho pozorování doporučujeme mít jednoho mentora pro každou skupinu 500 nových uživatelů, které vaše wiki měsíčně získá. Například, pokud má vaše wiki 2 500 nových účtů za měsíc, měli byste mít alespoň 5 mentorů. Doporučujeme mít alespoň 3 mentory. Mentoři se mohou zaregistrovat před aktivací mentorského systému na <code>Special:EnrollAsMentor</code>. <span id="2._Activate_mentorship"></span> === 2. Aktivujte mentorship === Na vaší wiki musí administrátor zapnout mentorský systém pomocí konfigurační stránky (<code>Special:CommunityConfiguration</code>). <span id="3._List_of_mentors"></span> === 3. Seznam mentorů === Seznam mentorů se zobrazí na <code>Special:ManageMentors</code>. Seznam mentorů můžete [[Transclusion|přenést]] kamkoli s následující syntaxí: <code><nowiki>{{Special:ManageMentors}}</nowiki></code>. Pokud se rozhodnete vytvořit stránku, kam převedete seznam mentorů, uveďte ji [[d:Q14339834|na wikidata]]. Na konfigurační stránce přidáte některá kritéria pro definování toho, kdo může být mentorem. Ve výchozím nastavení jsou požadavky na více než 500 provedených úprav a účet, který je alespoň 90 dní starý. Vaše komunita může také definovat některá specifická pravidla o tom, kdo může být mentorem (stáří účtu, počet provedených úprav, počet úprav provedených v hlavním prostoru, mít konkrétní roli atd.), a poté přidělit roli mentora kterémukoli účtu. Pokud chcete tento proces použít, [[talk:Growth|kontaktujte nás]]. <span id="4._Mentors_can_now_signup"></span> === 4. Mentoři se nyní mohou zaregistrovat === Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. <span id="Options"></span> == Možnosti == Mentoři mohou spravovat svůj účet: * [[Special:MyLanguage/Growth/FAQ#claim|Nárokovat nováčka od jiného mentora]] * [[Special:MyLanguage/Growth/FAQ#reassign|Přiřadit mentorované dalším mentorům]] * [[Special:MyLanguage/Growth/FAQ#change|Změnit počet nově přiřazených nováčků]] * [[Special:MyLanguage/Growth/FAQ#pause|Pauza mentorství]] * [[Special:MyLanguage/Growth/FAQ#quit|Ukončit mentorství]] Systém poskytuje možnosti pro správu mentorů: * [[Special:MyLanguage/Growth/FAQ#inactivity|Odstranit neaktivního mentora ze seznamu]] * [[Special:MyLanguage/Growth/FAQ#block|Spravuje blokované mentory]] <span id="See_also"></span> == Související odkazy == * [[Special:MyLanguage/Growth/FAQ#mentoring|Growth FAQ, o mentoringu]] 01rh0kv6res8h41oxny4nn8f2omccn6 8364423 8364421 2026-05-03T15:26:48Z Rebulka 17532855 Created page with "Každé řešení má své výhody a nevýhody:" 8364423 wikitext text/x-wiki <languages /> {{Growth/Active wikis}} Chcete se stát mentorem? Děkujeme! Tým Growth nabízí mentorský systém všem komunitám Wikipedie. Cílem je na wiki spárovat nováčky s mentory. Mentoři jsou zkušení uživatelé, připraveni pomoci novým uživatelům. Jsou klíčovým faktorem pro začlenění a povzbuzení nových uživatelů k úpravě wiki. Nováčci jsou informováni o svém mentorovi na [[#presentation|domovské stránce pro nováčky]]. Mentoři vidí, koho mentorují na [[#ready|mentorském panelu]]. Prosím, podívejte se na naše {{pll|Growth/Communities/How to work with newcomers on help desks|materiály o komunikaci s nováčky}} a následně se představte jako mentor. ; Ve zkratce : Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. Je to možné na wikinách, kde existuje seznam mentorů. : Pokud seznam neexistuje, musíte [[#create|nastavit seznam mentorů na vaší wiki]]. {{anchor|presentation}} <span id="Presentation_of_mentors_on_the_Homepage"></span> == Prezentace na Domovské stránce == [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11.png|thumb|Tento obrázek ukazuje, jak bude vaše představení ukázané v Domovské stránce.]] [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11 too long.png|thumb|Zprávy, které jsou delší než 240 znaků, jsou useknuté.]] {{pll|Growth/Personalized first day/Newcomer homepage|Domovská stránka nováčků}} je navržena tak, aby jim pomohla v uskutečnění jejich prvních kroků na Wikipedii. Nováčci mají přímý přístup na svou domovskou stránku. Tam vidí jméno zkušeného uživatele, který je připraven jim v případě potřeby pomoci: Jejich mentora. Mentoři jsou náhodně přiděleni více nováčkům, ale ne všichni svého mentora kontaktují. V průměru dostává mentor každý týden 0 až 6 otázek od nováčků. {{anchor|add}} <span id="How_to_add_yourself_to_the_mentor_list"></span> == Jak se přidat do seznamu mentorů == Děkujeme, že jste se dobrovolně stali mentorem! Je to obohacující zkušenost. <span id="Visit_the_Mentor_Dashboard"></span> === Navštivte panel Mentor Dashboard === Některé wiki vytvořily konkrétní stránku se seznamem mentorů, ale také pravidly nebo osvědčenými postupy, které je třeba dodržovat. Stránku své komunity můžete najít [[d:Q14339834|na Wikidata]]. Tento seznam vám řekne, jaké jsou podmínky pro to, abyste byli mentorem, pokud nějaká podmínka platí. Ve výchozím nastavení je proces registrace otevřen editorům, kteří mají 500 úprav a 90 dní přítomnosti. Ve výchozím nastavení je seznam mentorů pro vaši wiki umístěn na <code>Special:ManageMentors</code>. Tam můžete vidět, kdo je mentor. Pokud vaše wiki nastavila mentorský program a pokud se kvalifikujete být mentorem podle místních pravidel, navštivte prosím <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code> a zaregistrujte se. {{anchor|description}} <span id="Add_your_description"></span> === Přidejte svůj popis === Budete požádáni, abyste se popsali jako mentor. Tento krátký popis se zobrazí na domovské stránce nováčka. Ve výchozím nastavení je toto představení "{{Int|growthexperiments-homepage-mentorship-intro}}". Maximální délka popisu je 240 znaků. Pokud je delší, systém popis omezí. Nepřidávejte do popisu wikitext (bez odkazů, bez šablon), HTML nebo CSS: Nebude přijat. Správci mohou upravit váš popis pomocí <code>Special:ManageMentors</code>. <span id="Descriptions_examples"></span> ==== Příklady popisů ==== <small>(Z důvodu překladů mohou příklady níže přesáhnout limit 240 znaků.)</small> Můžete se představit neutrálně: * "Jsem tady, abych vám pomohl s orientováním se ve Wikipedii, neváhejte se mě zeptat na různé otázky!" Pokud upravujete Wikipedii a podílíte se na životě své komunity, máte dostatek zkušeností, abyste mohli odpovědět na jakoukoli otázku. Ale nenechte lidi, aby si mysleli, že jim můžete pomoci jen s něčím konkrétním. * Nepište "Edituji články o fotbalu". Nováčci si mohou myslet, že se vás nemohou zeptat na nic dalšího, než na fotbal. * Namísto toho napište "Nejčastěji přispívám o fotbalu, ale mohu vám pomoci s jakýmkoliv dalším tématem." Můžete pozvat nováčky, aby vás kontaktovali: * "Mohu vám odpovědět na vaše otázky o editování Wikipedie. Nejčastěji přispívám články o fotbalu. O čem budete přispívat vy?" * "Byl jsem stejně zmatený, jako jste teď vy. Pomohlo mi, že jsem se ptal zkušenějších uživatelů. Neváhejte se mě zeptat na cokoliv." Prosím, udržte své představení krátké: 240 znaků je maximum. Zvolili jsme tento limit, abychom se vyhnuli dlouhým textům, které by odváděly pozornost od ostatních informací, které již jsou na Domovské stránce k dispozici. Ze stejného důvodu nebude fungovat wikitext. Aby se o vás nováčci dozvěděli více, mohou kliknout na vaši uživatelskou stránku, na kterou z Domovské stránky vede odkaz. Vaše uživatelské jméno se již zobrazí na domovské stránce nováčků spolu s odkazem na vaši uživatelskou stránku. Není třeba nováčkům ve své prezentaci připomínat, kdo jste. <span id="Welcome_templates"></span> === Uvítací šablony === Komunity si mohou vytvářet nebo upravovat vlastní uvítací šablony. Mohou existovat uvítací šablony speciálně navržené pro mentory, které mohou dát svým menteům (vědecké pracovnice a pracovníci v počáteční fázi své kariéry), aby jim pomohly s představováním mentorů a procesem zaškolování nováčků. Například anglická Wikipedie má [[w:Template:Mentor welcome|<nowiki>{{Mentor welcome}}</nowiki>]] a [[w:Template:Welcome mentee |<nowiki>{{Welcome mentee}}</nowiki>]]. Francouzská Wikipedie má [[w:fr:Template:Bienvenue nouveau |<nowiki>{{Bienvenue nouveau}}</nowiki>]]. Uvítací šablony nejsou povinné, ale doporučené: Někteří nově příchozí se nedívají na svou domovskou stránku, zatímco jiní se nedívají na svou diskusní stránku. Automatické rozeslání uvítací šablony všem novým účtům může zvýšit počet interakcí se zkušeným mentorem. [[special:MyLanguage/Growth/FAQ#magicword|Magické slovo]] <code>{{ll|Growth/FAQ#magicword|<nowiki>{{#mentor}}</nowiki>}}</code> je k dispozici pro šablonování a {{tlc|#mentor:''NewcomerName''}} zobrazuje mentora daného nováčka. Je na každé komunitě, aby se rozhodla, zda má být jméno mentora [[Special:MyLanguage/Help:Substitution|nahrazeno]]. Každé řešení má své výhody a nevýhody: ; Pokud je název nahrazen : Ve zprávě se trvale zobrazí jméno mentora, který byl nově příchozím přidělen v době, kdy byla zpráva zanechána. : Toto použití je relevantní, pokud je uvítací zpráva distribuována ručně mentorem, protože historie uvádí, kdo zprávu distribuoval. Pokud se však nováček pokusí kontaktovat daného mentora a tento mentor již opustil mentorství nebo wiki, může to vést k určité frustraci. ; Pokud název není nahrazen : [[#reassign|Když se mentor změní]], magické slovo vybere jméno nového mentora. Tímto způsobem nováček, který si nepřečetl uvítací zprávu nebo zapomněl na svého předchozího mentora, uvidí toto jméno jako aktivního mentora uvedeného na domovské stránce. To snižuje zmatek pro nováčky. : To může být relevantní v případech, kdy je zpráva distribuována robotem nebo prostřednictvím služby [[Extension:NewUserMessage|NewUserMessage]], nebo v případech, kdy historie vztahu mentor/mentorovaný není tak důležitá (log ji uchovává). {{anchor|ready}} <span id="You_are_ready"></span> === Jste připraveni === <span class="mw-translate-fuzzy">Po zaregistrování vám systém začne přiřazovat nové mentorované. Pravidelně navštěvujte $1, abyste sledovali nováčky, kteří vám byly přiděleni.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Regularly visit <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code> to keep an eye on the newcomers assigned to you.</span> <span class="mw-translate-fuzzy">Nováčci vás také začnou kontaktovat přímo na vaší diskusní stránce. Nezapomeňte je zmínit, když odpovíte na jejich zprávy. Zkontrolujte také naši dokumentaci na stránce [[$1|Jak ovlivňovat nováčky]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Don't forget to mention them when you reply to their messages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please also check our documentation on [[Special:MyLanguage/Growth/Communities/How to interact with newcomers|how to interact with newcomers]].</span> {{anchor|create}} <span id="How_to_create_a_list_of_mentors"></span> == Jak vytvořit a udržovat seznam mentorů == <span id="1._Agree_on_having_mentorship"></span> === 1. Dohodněte se na mentorství === Nejprve musíte zkontrolovat, zda jsou nástroje Growth [[Growth/Deployment table|instalovány na vaší wiki]]. Pokud tomu tak ještě není, přečtěte si, prosím, [[#get|jak získat tyto funkce]]. Pak musíte najít nějaké další mentory, kteří se dobrovolně přihlásí. Doporučujeme vám zahájit konverzaci na příslušných místech na vaší wiki, abyste se mohli rozhodnout, zda by měl být tento seznam mentorů vytvořen. Je to také dobrý způsob, jak získat mentory. Mentorský systém Growth může [[Special:MyLanguage/Growth/FAQ#existing|nahradit nebo doplnit stávající mentorský systém]]. Na základě našeho pozorování doporučujeme mít jednoho mentora pro každou skupinu 500 nových uživatelů, které vaše wiki měsíčně získá. Například, pokud má vaše wiki 2 500 nových účtů za měsíc, měli byste mít alespoň 5 mentorů. Doporučujeme mít alespoň 3 mentory. Mentoři se mohou zaregistrovat před aktivací mentorského systému na <code>Special:EnrollAsMentor</code>. <span id="2._Activate_mentorship"></span> === 2. Aktivujte mentorship === Na vaší wiki musí administrátor zapnout mentorský systém pomocí konfigurační stránky (<code>Special:CommunityConfiguration</code>). <span id="3._List_of_mentors"></span> === 3. Seznam mentorů === Seznam mentorů se zobrazí na <code>Special:ManageMentors</code>. Seznam mentorů můžete [[Transclusion|přenést]] kamkoli s následující syntaxí: <code><nowiki>{{Special:ManageMentors}}</nowiki></code>. Pokud se rozhodnete vytvořit stránku, kam převedete seznam mentorů, uveďte ji [[d:Q14339834|na wikidata]]. Na konfigurační stránce přidáte některá kritéria pro definování toho, kdo může být mentorem. Ve výchozím nastavení jsou požadavky na více než 500 provedených úprav a účet, který je alespoň 90 dní starý. Vaše komunita může také definovat některá specifická pravidla o tom, kdo může být mentorem (stáří účtu, počet provedených úprav, počet úprav provedených v hlavním prostoru, mít konkrétní roli atd.), a poté přidělit roli mentora kterémukoli účtu. Pokud chcete tento proces použít, [[talk:Growth|kontaktujte nás]]. <span id="4._Mentors_can_now_signup"></span> === 4. Mentoři se nyní mohou zaregistrovat === Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. <span id="Options"></span> == Možnosti == Mentoři mohou spravovat svůj účet: * [[Special:MyLanguage/Growth/FAQ#claim|Nárokovat nováčka od jiného mentora]] * [[Special:MyLanguage/Growth/FAQ#reassign|Přiřadit mentorované dalším mentorům]] * [[Special:MyLanguage/Growth/FAQ#change|Změnit počet nově přiřazených nováčků]] * [[Special:MyLanguage/Growth/FAQ#pause|Pauza mentorství]] * [[Special:MyLanguage/Growth/FAQ#quit|Ukončit mentorství]] Systém poskytuje možnosti pro správu mentorů: * [[Special:MyLanguage/Growth/FAQ#inactivity|Odstranit neaktivního mentora ze seznamu]] * [[Special:MyLanguage/Growth/FAQ#block|Spravuje blokované mentory]] <span id="See_also"></span> == Související odkazy == * [[Special:MyLanguage/Growth/FAQ#mentoring|Growth FAQ, o mentoringu]] 0n8c3q4sgch42pqihm10equid0kr7k0 8364425 8364423 2026-05-03T15:27:06Z Rebulka 17532855 8364425 wikitext text/x-wiki <languages /> {{Growth/Active wikis}} Chcete se stát mentorem? Děkujeme! Tým Growth nabízí mentorský systém všem komunitám Wikipedie. Cílem je na wiki spárovat nováčky s mentory. Mentoři jsou zkušení uživatelé, připraveni pomoci novým uživatelům. Jsou klíčovým faktorem pro začlenění a povzbuzení nových uživatelů k úpravě wiki. Nováčci jsou informováni o svém mentorovi na [[#presentation|domovské stránce pro nováčky]]. Mentoři vidí, koho mentorují na [[#ready|mentorském panelu]]. Prosím, podívejte se na naše {{pll|Growth/Communities/How to work with newcomers on help desks|materiály o komunikaci s nováčky}} a následně se představte jako mentor. ; Ve zkratce : Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. Je to možné na wikinách, kde existuje seznam mentorů. : Pokud seznam neexistuje, musíte [[#create|nastavit seznam mentorů na vaší wiki]]. {{anchor|presentation}} <span id="Presentation_of_mentors_on_the_Homepage"></span> == Prezentace na Domovské stránce == [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11.png|thumb|Tento obrázek ukazuje, jak bude vaše představení ukázané v Domovské stránce.]] [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11 too long.png|thumb|Zprávy, které jsou delší než 240 znaků, jsou useknuté.]] {{pll|Growth/Personalized first day/Newcomer homepage|Domovská stránka nováčků}} je navržena tak, aby jim pomohla v uskutečnění jejich prvních kroků na Wikipedii. Nováčci mají přímý přístup na svou domovskou stránku. Tam vidí jméno zkušeného uživatele, který je připraven jim v případě potřeby pomoci: Jejich mentora. Mentoři jsou náhodně přiděleni více nováčkům, ale ne všichni svého mentora kontaktují. V průměru dostává mentor každý týden 0 až 6 otázek od nováčků. {{anchor|add}} <span id="How_to_add_yourself_to_the_mentor_list"></span> == Jak se přidat do seznamu mentorů == Děkujeme, že jste se dobrovolně stali mentorem! Je to obohacující zkušenost. <span id="Visit_the_Mentor_Dashboard"></span> === Navštivte panel Mentor Dashboard === Některé wiki vytvořily konkrétní stránku se seznamem mentorů, ale také pravidly nebo osvědčenými postupy, které je třeba dodržovat. Stránku své komunity můžete najít [[d:Q14339834|na Wikidata]]. Tento seznam vám řekne, jaké jsou podmínky pro to, abyste byli mentorem, pokud nějaká podmínka platí. Ve výchozím nastavení je proces registrace otevřen editorům, kteří mají 500 úprav a 90 dní přítomnosti. Ve výchozím nastavení je seznam mentorů pro vaši wiki umístěn na <code>Special:ManageMentors</code>. Tam můžete vidět, kdo je mentor. Pokud vaše wiki nastavila mentorský program a pokud se kvalifikujete být mentorem podle místních pravidel, navštivte prosím <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code> a zaregistrujte se. {{anchor|description}} <span id="Add_your_description"></span> === Přidejte svůj popis === Budete požádáni, abyste se popsali jako mentor. Tento krátký popis se zobrazí na domovské stránce nováčka. Ve výchozím nastavení je toto představení "{{Int|growthexperiments-homepage-mentorship-intro}}". Maximální délka popisu je 240 znaků. Pokud je delší, systém popis omezí. Nepřidávejte do popisu wikitext (bez odkazů, bez šablon), HTML nebo CSS: Nebude přijat. Správci mohou upravit váš popis pomocí <code>Special:ManageMentors</code>. <span id="Descriptions_examples"></span> ==== Příklady popisů ==== <small>(Z důvodu překladů mohou příklady níže přesáhnout limit 240 znaků.)</small> Můžete se představit neutrálně: * "Jsem tady, abych vám pomohl s orientováním se ve Wikipedii, neváhejte se mě zeptat na různé otázky!" Pokud upravujete Wikipedii a podílíte se na životě své komunity, máte dostatek zkušeností, abyste mohli odpovědět na jakoukoli otázku. Ale nenechte lidi, aby si mysleli, že jim můžete pomoci jen s něčím konkrétním. * Nepište "Edituji články o fotbalu". Nováčci si mohou myslet, že se vás nemohou zeptat na nic dalšího, než na fotbal. * Namísto toho napište "Nejčastěji přispívám o fotbalu, ale mohu vám pomoci s jakýmkoliv dalším tématem." Můžete pozvat nováčky, aby vás kontaktovali: * "Mohu vám odpovědět na vaše otázky o editování Wikipedie. Nejčastěji přispívám články o fotbalu. O čem budete přispívat vy?" * "Byl jsem stejně zmatený, jako jste teď vy. Pomohlo mi, že jsem se ptal zkušenějších uživatelů. Neváhejte se mě zeptat na cokoliv." Prosím, udržte své představení krátké: 240 znaků je maximum. Zvolili jsme tento limit, abychom se vyhnuli dlouhým textům, které by odváděly pozornost od ostatních informací, které již jsou na Domovské stránce k dispozici. Ze stejného důvodu nebude fungovat wikitext. Aby se o vás nováčci dozvěděli více, mohou kliknout na vaši uživatelskou stránku, na kterou z Domovské stránky vede odkaz. Vaše uživatelské jméno se již zobrazí na domovské stránce nováčků spolu s odkazem na vaši uživatelskou stránku. Není třeba nováčkům ve své prezentaci připomínat, kdo jste. <span id="Welcome_templates"></span> === Uvítací šablony === Komunity si mohou vytvářet nebo upravovat vlastní uvítací šablony. Mohou existovat uvítací šablony speciálně navržené pro mentory, které mohou dát svým menteům (vědecké pracovnice a pracovníci v počáteční fázi své kariéry), aby jim pomohly s představováním mentorů a procesem zaškolování nováčků. Například anglická Wikipedie má [[w:Template:Mentor welcome|<nowiki>{{Mentor welcome}}</nowiki>]] a [[w:Template:Welcome mentee |<nowiki>{{Welcome mentee}}</nowiki>]]. Francouzská Wikipedie má [[w:fr:Template:Bienvenue nouveau |<nowiki>{{Bienvenue nouveau}}</nowiki>]]. Uvítací šablony nejsou povinné, ale doporučené: Někteří nově příchozí se nedívají na svou domovskou stránku, zatímco jiní se nedívají na svou diskusní stránku. Automatické rozeslání uvítací šablony všem novým účtům může zvýšit počet interakcí se zkušeným mentorem. [[special:MyLanguage/Growth/FAQ#magicword|Magické slovo]] <code>{{ll|Growth/FAQ#magicword|<nowiki>{{#mentor}}</nowiki>}}</code> je k dispozici pro šablonování a {{tlc|#mentor:''NewcomerName''}} zobrazuje mentora daného nováčka. Je na každé komunitě, aby se rozhodla, zda má být jméno mentora [[Special:MyLanguage/Help:Substitution|nahrazeno]]. Každé řešení má své výhody a nevýhody: ; Pokud je název nahrazen : Ve zprávě se trvale zobrazí jméno mentora, který byl nově příchozím přidělen v době, kdy byla zpráva zanechána. : Toto použití je relevantní, pokud je uvítací zpráva distribuována ručně mentorem, protože historie uvádí, kdo zprávu distribuoval. Pokud se však nováček pokusí kontaktovat daného mentora a tento mentor již opustil mentorství nebo wiki, může to vést k určité frustraci. ; Pokud název není nahrazen : [[#reassign|Když se mentor změní]], magické slovo vybere jméno nového mentora. Tímto způsobem nováček, který si nepřečetl uvítací zprávu nebo zapomněl na svého předchozího mentora, uvidí toto jméno jako aktivního mentora uvedeného na domovské stránce. To snižuje zmatek pro nováčky. : To může být relevantní v případech, kdy je zpráva distribuována robotem nebo prostřednictvím služby [[Extension:NewUserMessage|NewUserMessage]], nebo v případech, kdy historie vztahu mentor/mentorovaný není tak důležitá (log ji uchovává). {{anchor|ready}} <span id="You_are_ready"></span> === Jste připraveni === Po zaregistrování vám systém začne přiřazovat nové mentorované. <span lang="en" dir="ltr" class="mw-content-ltr">Regularly visit <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code> to keep an eye on the newcomers assigned to you.</span> <span class="mw-translate-fuzzy">Nováčci vás také začnou kontaktovat přímo na vaší diskusní stránce. Nezapomeňte je zmínit, když odpovíte na jejich zprávy. Zkontrolujte také naši dokumentaci na stránce [[$1|Jak ovlivňovat nováčky]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Don't forget to mention them when you reply to their messages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please also check our documentation on [[Special:MyLanguage/Growth/Communities/How to interact with newcomers|how to interact with newcomers]].</span> {{anchor|create}} <span id="How_to_create_a_list_of_mentors"></span> == Jak vytvořit a udržovat seznam mentorů == <span id="1._Agree_on_having_mentorship"></span> === 1. Dohodněte se na mentorství === Nejprve musíte zkontrolovat, zda jsou nástroje Growth [[Growth/Deployment table|instalovány na vaší wiki]]. Pokud tomu tak ještě není, přečtěte si, prosím, [[#get|jak získat tyto funkce]]. Pak musíte najít nějaké další mentory, kteří se dobrovolně přihlásí. Doporučujeme vám zahájit konverzaci na příslušných místech na vaší wiki, abyste se mohli rozhodnout, zda by měl být tento seznam mentorů vytvořen. Je to také dobrý způsob, jak získat mentory. Mentorský systém Growth může [[Special:MyLanguage/Growth/FAQ#existing|nahradit nebo doplnit stávající mentorský systém]]. Na základě našeho pozorování doporučujeme mít jednoho mentora pro každou skupinu 500 nových uživatelů, které vaše wiki měsíčně získá. Například, pokud má vaše wiki 2 500 nových účtů za měsíc, měli byste mít alespoň 5 mentorů. Doporučujeme mít alespoň 3 mentory. Mentoři se mohou zaregistrovat před aktivací mentorského systému na <code>Special:EnrollAsMentor</code>. <span id="2._Activate_mentorship"></span> === 2. Aktivujte mentorship === Na vaší wiki musí administrátor zapnout mentorský systém pomocí konfigurační stránky (<code>Special:CommunityConfiguration</code>). <span id="3._List_of_mentors"></span> === 3. Seznam mentorů === Seznam mentorů se zobrazí na <code>Special:ManageMentors</code>. Seznam mentorů můžete [[Transclusion|přenést]] kamkoli s následující syntaxí: <code><nowiki>{{Special:ManageMentors}}</nowiki></code>. Pokud se rozhodnete vytvořit stránku, kam převedete seznam mentorů, uveďte ji [[d:Q14339834|na wikidata]]. Na konfigurační stránce přidáte některá kritéria pro definování toho, kdo může být mentorem. Ve výchozím nastavení jsou požadavky na více než 500 provedených úprav a účet, který je alespoň 90 dní starý. Vaše komunita může také definovat některá specifická pravidla o tom, kdo může být mentorem (stáří účtu, počet provedených úprav, počet úprav provedených v hlavním prostoru, mít konkrétní roli atd.), a poté přidělit roli mentora kterémukoli účtu. Pokud chcete tento proces použít, [[talk:Growth|kontaktujte nás]]. <span id="4._Mentors_can_now_signup"></span> === 4. Mentoři se nyní mohou zaregistrovat === Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. <span id="Options"></span> == Možnosti == Mentoři mohou spravovat svůj účet: * [[Special:MyLanguage/Growth/FAQ#claim|Nárokovat nováčka od jiného mentora]] * [[Special:MyLanguage/Growth/FAQ#reassign|Přiřadit mentorované dalším mentorům]] * [[Special:MyLanguage/Growth/FAQ#change|Změnit počet nově přiřazených nováčků]] * [[Special:MyLanguage/Growth/FAQ#pause|Pauza mentorství]] * [[Special:MyLanguage/Growth/FAQ#quit|Ukončit mentorství]] Systém poskytuje možnosti pro správu mentorů: * [[Special:MyLanguage/Growth/FAQ#inactivity|Odstranit neaktivního mentora ze seznamu]] * [[Special:MyLanguage/Growth/FAQ#block|Spravuje blokované mentory]] <span id="See_also"></span> == Související odkazy == * [[Special:MyLanguage/Growth/FAQ#mentoring|Growth FAQ, o mentoringu]] bij67w1vjs20supu7tn4vdikt8m262h 8364427 8364425 2026-05-03T15:27:10Z Rebulka 17532855 Created page with "Pravidelně navštěvujte $1, abyste sledovali nováčky, kteří vám byly přiděleni." 8364427 wikitext text/x-wiki <languages /> {{Growth/Active wikis}} Chcete se stát mentorem? Děkujeme! Tým Growth nabízí mentorský systém všem komunitám Wikipedie. Cílem je na wiki spárovat nováčky s mentory. Mentoři jsou zkušení uživatelé, připraveni pomoci novým uživatelům. Jsou klíčovým faktorem pro začlenění a povzbuzení nových uživatelů k úpravě wiki. Nováčci jsou informováni o svém mentorovi na [[#presentation|domovské stránce pro nováčky]]. Mentoři vidí, koho mentorují na [[#ready|mentorském panelu]]. Prosím, podívejte se na naše {{pll|Growth/Communities/How to work with newcomers on help desks|materiály o komunikaci s nováčky}} a následně se představte jako mentor. ; Ve zkratce : Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. Je to možné na wikinách, kde existuje seznam mentorů. : Pokud seznam neexistuje, musíte [[#create|nastavit seznam mentorů na vaší wiki]]. {{anchor|presentation}} <span id="Presentation_of_mentors_on_the_Homepage"></span> == Prezentace na Domovské stránce == [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11.png|thumb|Tento obrázek ukazuje, jak bude vaše představení ukázané v Domovské stránce.]] [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11 too long.png|thumb|Zprávy, které jsou delší než 240 znaků, jsou useknuté.]] {{pll|Growth/Personalized first day/Newcomer homepage|Domovská stránka nováčků}} je navržena tak, aby jim pomohla v uskutečnění jejich prvních kroků na Wikipedii. Nováčci mají přímý přístup na svou domovskou stránku. Tam vidí jméno zkušeného uživatele, který je připraven jim v případě potřeby pomoci: Jejich mentora. Mentoři jsou náhodně přiděleni více nováčkům, ale ne všichni svého mentora kontaktují. V průměru dostává mentor každý týden 0 až 6 otázek od nováčků. {{anchor|add}} <span id="How_to_add_yourself_to_the_mentor_list"></span> == Jak se přidat do seznamu mentorů == Děkujeme, že jste se dobrovolně stali mentorem! Je to obohacující zkušenost. <span id="Visit_the_Mentor_Dashboard"></span> === Navštivte panel Mentor Dashboard === Některé wiki vytvořily konkrétní stránku se seznamem mentorů, ale také pravidly nebo osvědčenými postupy, které je třeba dodržovat. Stránku své komunity můžete najít [[d:Q14339834|na Wikidata]]. Tento seznam vám řekne, jaké jsou podmínky pro to, abyste byli mentorem, pokud nějaká podmínka platí. Ve výchozím nastavení je proces registrace otevřen editorům, kteří mají 500 úprav a 90 dní přítomnosti. Ve výchozím nastavení je seznam mentorů pro vaši wiki umístěn na <code>Special:ManageMentors</code>. Tam můžete vidět, kdo je mentor. Pokud vaše wiki nastavila mentorský program a pokud se kvalifikujete být mentorem podle místních pravidel, navštivte prosím <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code> a zaregistrujte se. {{anchor|description}} <span id="Add_your_description"></span> === Přidejte svůj popis === Budete požádáni, abyste se popsali jako mentor. Tento krátký popis se zobrazí na domovské stránce nováčka. Ve výchozím nastavení je toto představení "{{Int|growthexperiments-homepage-mentorship-intro}}". Maximální délka popisu je 240 znaků. Pokud je delší, systém popis omezí. Nepřidávejte do popisu wikitext (bez odkazů, bez šablon), HTML nebo CSS: Nebude přijat. Správci mohou upravit váš popis pomocí <code>Special:ManageMentors</code>. <span id="Descriptions_examples"></span> ==== Příklady popisů ==== <small>(Z důvodu překladů mohou příklady níže přesáhnout limit 240 znaků.)</small> Můžete se představit neutrálně: * "Jsem tady, abych vám pomohl s orientováním se ve Wikipedii, neváhejte se mě zeptat na různé otázky!" Pokud upravujete Wikipedii a podílíte se na životě své komunity, máte dostatek zkušeností, abyste mohli odpovědět na jakoukoli otázku. Ale nenechte lidi, aby si mysleli, že jim můžete pomoci jen s něčím konkrétním. * Nepište "Edituji články o fotbalu". Nováčci si mohou myslet, že se vás nemohou zeptat na nic dalšího, než na fotbal. * Namísto toho napište "Nejčastěji přispívám o fotbalu, ale mohu vám pomoci s jakýmkoliv dalším tématem." Můžete pozvat nováčky, aby vás kontaktovali: * "Mohu vám odpovědět na vaše otázky o editování Wikipedie. Nejčastěji přispívám články o fotbalu. O čem budete přispívat vy?" * "Byl jsem stejně zmatený, jako jste teď vy. Pomohlo mi, že jsem se ptal zkušenějších uživatelů. Neváhejte se mě zeptat na cokoliv." Prosím, udržte své představení krátké: 240 znaků je maximum. Zvolili jsme tento limit, abychom se vyhnuli dlouhým textům, které by odváděly pozornost od ostatních informací, které již jsou na Domovské stránce k dispozici. Ze stejného důvodu nebude fungovat wikitext. Aby se o vás nováčci dozvěděli více, mohou kliknout na vaši uživatelskou stránku, na kterou z Domovské stránky vede odkaz. Vaše uživatelské jméno se již zobrazí na domovské stránce nováčků spolu s odkazem na vaši uživatelskou stránku. Není třeba nováčkům ve své prezentaci připomínat, kdo jste. <span id="Welcome_templates"></span> === Uvítací šablony === Komunity si mohou vytvářet nebo upravovat vlastní uvítací šablony. Mohou existovat uvítací šablony speciálně navržené pro mentory, které mohou dát svým menteům (vědecké pracovnice a pracovníci v počáteční fázi své kariéry), aby jim pomohly s představováním mentorů a procesem zaškolování nováčků. Například anglická Wikipedie má [[w:Template:Mentor welcome|<nowiki>{{Mentor welcome}}</nowiki>]] a [[w:Template:Welcome mentee |<nowiki>{{Welcome mentee}}</nowiki>]]. Francouzská Wikipedie má [[w:fr:Template:Bienvenue nouveau |<nowiki>{{Bienvenue nouveau}}</nowiki>]]. Uvítací šablony nejsou povinné, ale doporučené: Někteří nově příchozí se nedívají na svou domovskou stránku, zatímco jiní se nedívají na svou diskusní stránku. Automatické rozeslání uvítací šablony všem novým účtům může zvýšit počet interakcí se zkušeným mentorem. [[special:MyLanguage/Growth/FAQ#magicword|Magické slovo]] <code>{{ll|Growth/FAQ#magicword|<nowiki>{{#mentor}}</nowiki>}}</code> je k dispozici pro šablonování a {{tlc|#mentor:''NewcomerName''}} zobrazuje mentora daného nováčka. Je na každé komunitě, aby se rozhodla, zda má být jméno mentora [[Special:MyLanguage/Help:Substitution|nahrazeno]]. Každé řešení má své výhody a nevýhody: ; Pokud je název nahrazen : Ve zprávě se trvale zobrazí jméno mentora, který byl nově příchozím přidělen v době, kdy byla zpráva zanechána. : Toto použití je relevantní, pokud je uvítací zpráva distribuována ručně mentorem, protože historie uvádí, kdo zprávu distribuoval. Pokud se však nováček pokusí kontaktovat daného mentora a tento mentor již opustil mentorství nebo wiki, může to vést k určité frustraci. ; Pokud název není nahrazen : [[#reassign|Když se mentor změní]], magické slovo vybere jméno nového mentora. Tímto způsobem nováček, který si nepřečetl uvítací zprávu nebo zapomněl na svého předchozího mentora, uvidí toto jméno jako aktivního mentora uvedeného na domovské stránce. To snižuje zmatek pro nováčky. : To může být relevantní v případech, kdy je zpráva distribuována robotem nebo prostřednictvím služby [[Extension:NewUserMessage|NewUserMessage]], nebo v případech, kdy historie vztahu mentor/mentorovaný není tak důležitá (log ji uchovává). {{anchor|ready}} <span id="You_are_ready"></span> === Jste připraveni === Po zaregistrování vám systém začne přiřazovat nové mentorované. Pravidelně navštěvujte <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code>, abyste sledovali nováčky, kteří vám byly přiděleni. <span class="mw-translate-fuzzy">Nováčci vás také začnou kontaktovat přímo na vaší diskusní stránce. Nezapomeňte je zmínit, když odpovíte na jejich zprávy. Zkontrolujte také naši dokumentaci na stránce [[$1|Jak ovlivňovat nováčky]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Don't forget to mention them when you reply to their messages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please also check our documentation on [[Special:MyLanguage/Growth/Communities/How to interact with newcomers|how to interact with newcomers]].</span> {{anchor|create}} <span id="How_to_create_a_list_of_mentors"></span> == Jak vytvořit a udržovat seznam mentorů == <span id="1._Agree_on_having_mentorship"></span> === 1. Dohodněte se na mentorství === Nejprve musíte zkontrolovat, zda jsou nástroje Growth [[Growth/Deployment table|instalovány na vaší wiki]]. Pokud tomu tak ještě není, přečtěte si, prosím, [[#get|jak získat tyto funkce]]. Pak musíte najít nějaké další mentory, kteří se dobrovolně přihlásí. Doporučujeme vám zahájit konverzaci na příslušných místech na vaší wiki, abyste se mohli rozhodnout, zda by měl být tento seznam mentorů vytvořen. Je to také dobrý způsob, jak získat mentory. Mentorský systém Growth může [[Special:MyLanguage/Growth/FAQ#existing|nahradit nebo doplnit stávající mentorský systém]]. Na základě našeho pozorování doporučujeme mít jednoho mentora pro každou skupinu 500 nových uživatelů, které vaše wiki měsíčně získá. Například, pokud má vaše wiki 2 500 nových účtů za měsíc, měli byste mít alespoň 5 mentorů. Doporučujeme mít alespoň 3 mentory. Mentoři se mohou zaregistrovat před aktivací mentorského systému na <code>Special:EnrollAsMentor</code>. <span id="2._Activate_mentorship"></span> === 2. Aktivujte mentorship === Na vaší wiki musí administrátor zapnout mentorský systém pomocí konfigurační stránky (<code>Special:CommunityConfiguration</code>). <span id="3._List_of_mentors"></span> === 3. Seznam mentorů === Seznam mentorů se zobrazí na <code>Special:ManageMentors</code>. Seznam mentorů můžete [[Transclusion|přenést]] kamkoli s následující syntaxí: <code><nowiki>{{Special:ManageMentors}}</nowiki></code>. Pokud se rozhodnete vytvořit stránku, kam převedete seznam mentorů, uveďte ji [[d:Q14339834|na wikidata]]. Na konfigurační stránce přidáte některá kritéria pro definování toho, kdo může být mentorem. Ve výchozím nastavení jsou požadavky na více než 500 provedených úprav a účet, který je alespoň 90 dní starý. Vaše komunita může také definovat některá specifická pravidla o tom, kdo může být mentorem (stáří účtu, počet provedených úprav, počet úprav provedených v hlavním prostoru, mít konkrétní roli atd.), a poté přidělit roli mentora kterémukoli účtu. Pokud chcete tento proces použít, [[talk:Growth|kontaktujte nás]]. <span id="4._Mentors_can_now_signup"></span> === 4. Mentoři se nyní mohou zaregistrovat === Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. <span id="Options"></span> == Možnosti == Mentoři mohou spravovat svůj účet: * [[Special:MyLanguage/Growth/FAQ#claim|Nárokovat nováčka od jiného mentora]] * [[Special:MyLanguage/Growth/FAQ#reassign|Přiřadit mentorované dalším mentorům]] * [[Special:MyLanguage/Growth/FAQ#change|Změnit počet nově přiřazených nováčků]] * [[Special:MyLanguage/Growth/FAQ#pause|Pauza mentorství]] * [[Special:MyLanguage/Growth/FAQ#quit|Ukončit mentorství]] Systém poskytuje možnosti pro správu mentorů: * [[Special:MyLanguage/Growth/FAQ#inactivity|Odstranit neaktivního mentora ze seznamu]] * [[Special:MyLanguage/Growth/FAQ#block|Spravuje blokované mentory]] <span id="See_also"></span> == Související odkazy == * [[Special:MyLanguage/Growth/FAQ#mentoring|Growth FAQ, o mentoringu]] 12vo7g5cvms4bukrh5n0fjhq7kmo732 8364429 8364427 2026-05-03T15:27:32Z Rebulka 17532855 8364429 wikitext text/x-wiki <languages /> {{Growth/Active wikis}} Chcete se stát mentorem? Děkujeme! Tým Growth nabízí mentorský systém všem komunitám Wikipedie. Cílem je na wiki spárovat nováčky s mentory. Mentoři jsou zkušení uživatelé, připraveni pomoci novým uživatelům. Jsou klíčovým faktorem pro začlenění a povzbuzení nových uživatelů k úpravě wiki. Nováčci jsou informováni o svém mentorovi na [[#presentation|domovské stránce pro nováčky]]. Mentoři vidí, koho mentorují na [[#ready|mentorském panelu]]. Prosím, podívejte se na naše {{pll|Growth/Communities/How to work with newcomers on help desks|materiály o komunikaci s nováčky}} a následně se představte jako mentor. ; Ve zkratce : Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. Je to možné na wikinách, kde existuje seznam mentorů. : Pokud seznam neexistuje, musíte [[#create|nastavit seznam mentorů na vaší wiki]]. {{anchor|presentation}} <span id="Presentation_of_mentors_on_the_Homepage"></span> == Prezentace na Domovské stránce == [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11.png|thumb|Tento obrázek ukazuje, jak bude vaše představení ukázané v Domovské stránce.]] [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11 too long.png|thumb|Zprávy, které jsou delší než 240 znaků, jsou useknuté.]] {{pll|Growth/Personalized first day/Newcomer homepage|Domovská stránka nováčků}} je navržena tak, aby jim pomohla v uskutečnění jejich prvních kroků na Wikipedii. Nováčci mají přímý přístup na svou domovskou stránku. Tam vidí jméno zkušeného uživatele, který je připraven jim v případě potřeby pomoci: Jejich mentora. Mentoři jsou náhodně přiděleni více nováčkům, ale ne všichni svého mentora kontaktují. V průměru dostává mentor každý týden 0 až 6 otázek od nováčků. {{anchor|add}} <span id="How_to_add_yourself_to_the_mentor_list"></span> == Jak se přidat do seznamu mentorů == Děkujeme, že jste se dobrovolně stali mentorem! Je to obohacující zkušenost. <span id="Visit_the_Mentor_Dashboard"></span> === Navštivte panel Mentor Dashboard === Některé wiki vytvořily konkrétní stránku se seznamem mentorů, ale také pravidly nebo osvědčenými postupy, které je třeba dodržovat. Stránku své komunity můžete najít [[d:Q14339834|na Wikidata]]. Tento seznam vám řekne, jaké jsou podmínky pro to, abyste byli mentorem, pokud nějaká podmínka platí. Ve výchozím nastavení je proces registrace otevřen editorům, kteří mají 500 úprav a 90 dní přítomnosti. Ve výchozím nastavení je seznam mentorů pro vaši wiki umístěn na <code>Special:ManageMentors</code>. Tam můžete vidět, kdo je mentor. Pokud vaše wiki nastavila mentorský program a pokud se kvalifikujete být mentorem podle místních pravidel, navštivte prosím <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code> a zaregistrujte se. {{anchor|description}} <span id="Add_your_description"></span> === Přidejte svůj popis === Budete požádáni, abyste se popsali jako mentor. Tento krátký popis se zobrazí na domovské stránce nováčka. Ve výchozím nastavení je toto představení "{{Int|growthexperiments-homepage-mentorship-intro}}". Maximální délka popisu je 240 znaků. Pokud je delší, systém popis omezí. Nepřidávejte do popisu wikitext (bez odkazů, bez šablon), HTML nebo CSS: Nebude přijat. Správci mohou upravit váš popis pomocí <code>Special:ManageMentors</code>. <span id="Descriptions_examples"></span> ==== Příklady popisů ==== <small>(Z důvodu překladů mohou příklady níže přesáhnout limit 240 znaků.)</small> Můžete se představit neutrálně: * "Jsem tady, abych vám pomohl s orientováním se ve Wikipedii, neváhejte se mě zeptat na různé otázky!" Pokud upravujete Wikipedii a podílíte se na životě své komunity, máte dostatek zkušeností, abyste mohli odpovědět na jakoukoli otázku. Ale nenechte lidi, aby si mysleli, že jim můžete pomoci jen s něčím konkrétním. * Nepište "Edituji články o fotbalu". Nováčci si mohou myslet, že se vás nemohou zeptat na nic dalšího, než na fotbal. * Namísto toho napište "Nejčastěji přispívám o fotbalu, ale mohu vám pomoci s jakýmkoliv dalším tématem." Můžete pozvat nováčky, aby vás kontaktovali: * "Mohu vám odpovědět na vaše otázky o editování Wikipedie. Nejčastěji přispívám články o fotbalu. O čem budete přispívat vy?" * "Byl jsem stejně zmatený, jako jste teď vy. Pomohlo mi, že jsem se ptal zkušenějších uživatelů. Neváhejte se mě zeptat na cokoliv." Prosím, udržte své představení krátké: 240 znaků je maximum. Zvolili jsme tento limit, abychom se vyhnuli dlouhým textům, které by odváděly pozornost od ostatních informací, které již jsou na Domovské stránce k dispozici. Ze stejného důvodu nebude fungovat wikitext. Aby se o vás nováčci dozvěděli více, mohou kliknout na vaši uživatelskou stránku, na kterou z Domovské stránky vede odkaz. Vaše uživatelské jméno se již zobrazí na domovské stránce nováčků spolu s odkazem na vaši uživatelskou stránku. Není třeba nováčkům ve své prezentaci připomínat, kdo jste. <span id="Welcome_templates"></span> === Uvítací šablony === Komunity si mohou vytvářet nebo upravovat vlastní uvítací šablony. Mohou existovat uvítací šablony speciálně navržené pro mentory, které mohou dát svým menteům (vědecké pracovnice a pracovníci v počáteční fázi své kariéry), aby jim pomohly s představováním mentorů a procesem zaškolování nováčků. Například anglická Wikipedie má [[w:Template:Mentor welcome|<nowiki>{{Mentor welcome}}</nowiki>]] a [[w:Template:Welcome mentee |<nowiki>{{Welcome mentee}}</nowiki>]]. Francouzská Wikipedie má [[w:fr:Template:Bienvenue nouveau |<nowiki>{{Bienvenue nouveau}}</nowiki>]]. Uvítací šablony nejsou povinné, ale doporučené: Někteří nově příchozí se nedívají na svou domovskou stránku, zatímco jiní se nedívají na svou diskusní stránku. Automatické rozeslání uvítací šablony všem novým účtům může zvýšit počet interakcí se zkušeným mentorem. [[special:MyLanguage/Growth/FAQ#magicword|Magické slovo]] <code>{{ll|Growth/FAQ#magicword|<nowiki>{{#mentor}}</nowiki>}}</code> je k dispozici pro šablonování a {{tlc|#mentor:''NewcomerName''}} zobrazuje mentora daného nováčka. Je na každé komunitě, aby se rozhodla, zda má být jméno mentora [[Special:MyLanguage/Help:Substitution|nahrazeno]]. Každé řešení má své výhody a nevýhody: ; Pokud je název nahrazen : Ve zprávě se trvale zobrazí jméno mentora, který byl nově příchozím přidělen v době, kdy byla zpráva zanechána. : Toto použití je relevantní, pokud je uvítací zpráva distribuována ručně mentorem, protože historie uvádí, kdo zprávu distribuoval. Pokud se však nováček pokusí kontaktovat daného mentora a tento mentor již opustil mentorství nebo wiki, může to vést k určité frustraci. ; Pokud název není nahrazen : [[#reassign|Když se mentor změní]], magické slovo vybere jméno nového mentora. Tímto způsobem nováček, který si nepřečetl uvítací zprávu nebo zapomněl na svého předchozího mentora, uvidí toto jméno jako aktivního mentora uvedeného na domovské stránce. To snižuje zmatek pro nováčky. : To může být relevantní v případech, kdy je zpráva distribuována robotem nebo prostřednictvím služby [[Extension:NewUserMessage|NewUserMessage]], nebo v případech, kdy historie vztahu mentor/mentorovaný není tak důležitá (log ji uchovává). {{anchor|ready}} <span id="You_are_ready"></span> === Jste připraveni === Po zaregistrování vám systém začne přiřazovat nové mentorované. Pravidelně navštěvujte <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code>, abyste sledovali nováčky, kteří vám byly přiděleni. Nováčci vás také začnou kontaktovat přímo na vaší diskusní stránce. <span lang="en" dir="ltr" class="mw-content-ltr">Don't forget to mention them when you reply to their messages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please also check our documentation on [[Special:MyLanguage/Growth/Communities/How to interact with newcomers|how to interact with newcomers]].</span> {{anchor|create}} <span id="How_to_create_a_list_of_mentors"></span> == Jak vytvořit a udržovat seznam mentorů == <span id="1._Agree_on_having_mentorship"></span> === 1. Dohodněte se na mentorství === Nejprve musíte zkontrolovat, zda jsou nástroje Growth [[Growth/Deployment table|instalovány na vaší wiki]]. Pokud tomu tak ještě není, přečtěte si, prosím, [[#get|jak získat tyto funkce]]. Pak musíte najít nějaké další mentory, kteří se dobrovolně přihlásí. Doporučujeme vám zahájit konverzaci na příslušných místech na vaší wiki, abyste se mohli rozhodnout, zda by měl být tento seznam mentorů vytvořen. Je to také dobrý způsob, jak získat mentory. Mentorský systém Growth může [[Special:MyLanguage/Growth/FAQ#existing|nahradit nebo doplnit stávající mentorský systém]]. Na základě našeho pozorování doporučujeme mít jednoho mentora pro každou skupinu 500 nových uživatelů, které vaše wiki měsíčně získá. Například, pokud má vaše wiki 2 500 nových účtů za měsíc, měli byste mít alespoň 5 mentorů. Doporučujeme mít alespoň 3 mentory. Mentoři se mohou zaregistrovat před aktivací mentorského systému na <code>Special:EnrollAsMentor</code>. <span id="2._Activate_mentorship"></span> === 2. Aktivujte mentorship === Na vaší wiki musí administrátor zapnout mentorský systém pomocí konfigurační stránky (<code>Special:CommunityConfiguration</code>). <span id="3._List_of_mentors"></span> === 3. Seznam mentorů === Seznam mentorů se zobrazí na <code>Special:ManageMentors</code>. Seznam mentorů můžete [[Transclusion|přenést]] kamkoli s následující syntaxí: <code><nowiki>{{Special:ManageMentors}}</nowiki></code>. Pokud se rozhodnete vytvořit stránku, kam převedete seznam mentorů, uveďte ji [[d:Q14339834|na wikidata]]. Na konfigurační stránce přidáte některá kritéria pro definování toho, kdo může být mentorem. Ve výchozím nastavení jsou požadavky na více než 500 provedených úprav a účet, který je alespoň 90 dní starý. Vaše komunita může také definovat některá specifická pravidla o tom, kdo může být mentorem (stáří účtu, počet provedených úprav, počet úprav provedených v hlavním prostoru, mít konkrétní roli atd.), a poté přidělit roli mentora kterémukoli účtu. Pokud chcete tento proces použít, [[talk:Growth|kontaktujte nás]]. <span id="4._Mentors_can_now_signup"></span> === 4. Mentoři se nyní mohou zaregistrovat === Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. <span id="Options"></span> == Možnosti == Mentoři mohou spravovat svůj účet: * [[Special:MyLanguage/Growth/FAQ#claim|Nárokovat nováčka od jiného mentora]] * [[Special:MyLanguage/Growth/FAQ#reassign|Přiřadit mentorované dalším mentorům]] * [[Special:MyLanguage/Growth/FAQ#change|Změnit počet nově přiřazených nováčků]] * [[Special:MyLanguage/Growth/FAQ#pause|Pauza mentorství]] * [[Special:MyLanguage/Growth/FAQ#quit|Ukončit mentorství]] Systém poskytuje možnosti pro správu mentorů: * [[Special:MyLanguage/Growth/FAQ#inactivity|Odstranit neaktivního mentora ze seznamu]] * [[Special:MyLanguage/Growth/FAQ#block|Spravuje blokované mentory]] <span id="See_also"></span> == Související odkazy == * [[Special:MyLanguage/Growth/FAQ#mentoring|Growth FAQ, o mentoringu]] piqdy523alerehzc2eydxe6622fxj7n 8364431 8364429 2026-05-03T15:27:45Z Rebulka 17532855 Created page with "Nezapomeňte je zmínit, když odpovíte na jejich zprávy." 8364431 wikitext text/x-wiki <languages /> {{Growth/Active wikis}} Chcete se stát mentorem? Děkujeme! Tým Growth nabízí mentorský systém všem komunitám Wikipedie. Cílem je na wiki spárovat nováčky s mentory. Mentoři jsou zkušení uživatelé, připraveni pomoci novým uživatelům. Jsou klíčovým faktorem pro začlenění a povzbuzení nových uživatelů k úpravě wiki. Nováčci jsou informováni o svém mentorovi na [[#presentation|domovské stránce pro nováčky]]. Mentoři vidí, koho mentorují na [[#ready|mentorském panelu]]. Prosím, podívejte se na naše {{pll|Growth/Communities/How to work with newcomers on help desks|materiály o komunikaci s nováčky}} a následně se představte jako mentor. ; Ve zkratce : Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. Je to možné na wikinách, kde existuje seznam mentorů. : Pokud seznam neexistuje, musíte [[#create|nastavit seznam mentorů na vaší wiki]]. {{anchor|presentation}} <span id="Presentation_of_mentors_on_the_Homepage"></span> == Prezentace na Domovské stránce == [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11.png|thumb|Tento obrázek ukazuje, jak bude vaše představení ukázané v Domovské stránce.]] [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11 too long.png|thumb|Zprávy, které jsou delší než 240 znaků, jsou useknuté.]] {{pll|Growth/Personalized first day/Newcomer homepage|Domovská stránka nováčků}} je navržena tak, aby jim pomohla v uskutečnění jejich prvních kroků na Wikipedii. Nováčci mají přímý přístup na svou domovskou stránku. Tam vidí jméno zkušeného uživatele, který je připraven jim v případě potřeby pomoci: Jejich mentora. Mentoři jsou náhodně přiděleni více nováčkům, ale ne všichni svého mentora kontaktují. V průměru dostává mentor každý týden 0 až 6 otázek od nováčků. {{anchor|add}} <span id="How_to_add_yourself_to_the_mentor_list"></span> == Jak se přidat do seznamu mentorů == Děkujeme, že jste se dobrovolně stali mentorem! Je to obohacující zkušenost. <span id="Visit_the_Mentor_Dashboard"></span> === Navštivte panel Mentor Dashboard === Některé wiki vytvořily konkrétní stránku se seznamem mentorů, ale také pravidly nebo osvědčenými postupy, které je třeba dodržovat. Stránku své komunity můžete najít [[d:Q14339834|na Wikidata]]. Tento seznam vám řekne, jaké jsou podmínky pro to, abyste byli mentorem, pokud nějaká podmínka platí. Ve výchozím nastavení je proces registrace otevřen editorům, kteří mají 500 úprav a 90 dní přítomnosti. Ve výchozím nastavení je seznam mentorů pro vaši wiki umístěn na <code>Special:ManageMentors</code>. Tam můžete vidět, kdo je mentor. Pokud vaše wiki nastavila mentorský program a pokud se kvalifikujete být mentorem podle místních pravidel, navštivte prosím <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code> a zaregistrujte se. {{anchor|description}} <span id="Add_your_description"></span> === Přidejte svůj popis === Budete požádáni, abyste se popsali jako mentor. Tento krátký popis se zobrazí na domovské stránce nováčka. Ve výchozím nastavení je toto představení "{{Int|growthexperiments-homepage-mentorship-intro}}". Maximální délka popisu je 240 znaků. Pokud je delší, systém popis omezí. Nepřidávejte do popisu wikitext (bez odkazů, bez šablon), HTML nebo CSS: Nebude přijat. Správci mohou upravit váš popis pomocí <code>Special:ManageMentors</code>. <span id="Descriptions_examples"></span> ==== Příklady popisů ==== <small>(Z důvodu překladů mohou příklady níže přesáhnout limit 240 znaků.)</small> Můžete se představit neutrálně: * "Jsem tady, abych vám pomohl s orientováním se ve Wikipedii, neváhejte se mě zeptat na různé otázky!" Pokud upravujete Wikipedii a podílíte se na životě své komunity, máte dostatek zkušeností, abyste mohli odpovědět na jakoukoli otázku. Ale nenechte lidi, aby si mysleli, že jim můžete pomoci jen s něčím konkrétním. * Nepište "Edituji články o fotbalu". Nováčci si mohou myslet, že se vás nemohou zeptat na nic dalšího, než na fotbal. * Namísto toho napište "Nejčastěji přispívám o fotbalu, ale mohu vám pomoci s jakýmkoliv dalším tématem." Můžete pozvat nováčky, aby vás kontaktovali: * "Mohu vám odpovědět na vaše otázky o editování Wikipedie. Nejčastěji přispívám články o fotbalu. O čem budete přispívat vy?" * "Byl jsem stejně zmatený, jako jste teď vy. Pomohlo mi, že jsem se ptal zkušenějších uživatelů. Neváhejte se mě zeptat na cokoliv." Prosím, udržte své představení krátké: 240 znaků je maximum. Zvolili jsme tento limit, abychom se vyhnuli dlouhým textům, které by odváděly pozornost od ostatních informací, které již jsou na Domovské stránce k dispozici. Ze stejného důvodu nebude fungovat wikitext. Aby se o vás nováčci dozvěděli více, mohou kliknout na vaši uživatelskou stránku, na kterou z Domovské stránky vede odkaz. Vaše uživatelské jméno se již zobrazí na domovské stránce nováčků spolu s odkazem na vaši uživatelskou stránku. Není třeba nováčkům ve své prezentaci připomínat, kdo jste. <span id="Welcome_templates"></span> === Uvítací šablony === Komunity si mohou vytvářet nebo upravovat vlastní uvítací šablony. Mohou existovat uvítací šablony speciálně navržené pro mentory, které mohou dát svým menteům (vědecké pracovnice a pracovníci v počáteční fázi své kariéry), aby jim pomohly s představováním mentorů a procesem zaškolování nováčků. Například anglická Wikipedie má [[w:Template:Mentor welcome|<nowiki>{{Mentor welcome}}</nowiki>]] a [[w:Template:Welcome mentee |<nowiki>{{Welcome mentee}}</nowiki>]]. Francouzská Wikipedie má [[w:fr:Template:Bienvenue nouveau |<nowiki>{{Bienvenue nouveau}}</nowiki>]]. Uvítací šablony nejsou povinné, ale doporučené: Někteří nově příchozí se nedívají na svou domovskou stránku, zatímco jiní se nedívají na svou diskusní stránku. Automatické rozeslání uvítací šablony všem novým účtům může zvýšit počet interakcí se zkušeným mentorem. [[special:MyLanguage/Growth/FAQ#magicword|Magické slovo]] <code>{{ll|Growth/FAQ#magicword|<nowiki>{{#mentor}}</nowiki>}}</code> je k dispozici pro šablonování a {{tlc|#mentor:''NewcomerName''}} zobrazuje mentora daného nováčka. Je na každé komunitě, aby se rozhodla, zda má být jméno mentora [[Special:MyLanguage/Help:Substitution|nahrazeno]]. Každé řešení má své výhody a nevýhody: ; Pokud je název nahrazen : Ve zprávě se trvale zobrazí jméno mentora, který byl nově příchozím přidělen v době, kdy byla zpráva zanechána. : Toto použití je relevantní, pokud je uvítací zpráva distribuována ručně mentorem, protože historie uvádí, kdo zprávu distribuoval. Pokud se však nováček pokusí kontaktovat daného mentora a tento mentor již opustil mentorství nebo wiki, může to vést k určité frustraci. ; Pokud název není nahrazen : [[#reassign|Když se mentor změní]], magické slovo vybere jméno nového mentora. Tímto způsobem nováček, který si nepřečetl uvítací zprávu nebo zapomněl na svého předchozího mentora, uvidí toto jméno jako aktivního mentora uvedeného na domovské stránce. To snižuje zmatek pro nováčky. : To může být relevantní v případech, kdy je zpráva distribuována robotem nebo prostřednictvím služby [[Extension:NewUserMessage|NewUserMessage]], nebo v případech, kdy historie vztahu mentor/mentorovaný není tak důležitá (log ji uchovává). {{anchor|ready}} <span id="You_are_ready"></span> === Jste připraveni === Po zaregistrování vám systém začne přiřazovat nové mentorované. Pravidelně navštěvujte <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code>, abyste sledovali nováčky, kteří vám byly přiděleni. Nováčci vás také začnou kontaktovat přímo na vaší diskusní stránce. Nezapomeňte je zmínit, když odpovíte na jejich zprávy. <span lang="en" dir="ltr" class="mw-content-ltr">Please also check our documentation on [[Special:MyLanguage/Growth/Communities/How to interact with newcomers|how to interact with newcomers]].</span> {{anchor|create}} <span id="How_to_create_a_list_of_mentors"></span> == Jak vytvořit a udržovat seznam mentorů == <span id="1._Agree_on_having_mentorship"></span> === 1. Dohodněte se na mentorství === Nejprve musíte zkontrolovat, zda jsou nástroje Growth [[Growth/Deployment table|instalovány na vaší wiki]]. Pokud tomu tak ještě není, přečtěte si, prosím, [[#get|jak získat tyto funkce]]. Pak musíte najít nějaké další mentory, kteří se dobrovolně přihlásí. Doporučujeme vám zahájit konverzaci na příslušných místech na vaší wiki, abyste se mohli rozhodnout, zda by měl být tento seznam mentorů vytvořen. Je to také dobrý způsob, jak získat mentory. Mentorský systém Growth může [[Special:MyLanguage/Growth/FAQ#existing|nahradit nebo doplnit stávající mentorský systém]]. Na základě našeho pozorování doporučujeme mít jednoho mentora pro každou skupinu 500 nových uživatelů, které vaše wiki měsíčně získá. Například, pokud má vaše wiki 2 500 nových účtů za měsíc, měli byste mít alespoň 5 mentorů. Doporučujeme mít alespoň 3 mentory. Mentoři se mohou zaregistrovat před aktivací mentorského systému na <code>Special:EnrollAsMentor</code>. <span id="2._Activate_mentorship"></span> === 2. Aktivujte mentorship === Na vaší wiki musí administrátor zapnout mentorský systém pomocí konfigurační stránky (<code>Special:CommunityConfiguration</code>). <span id="3._List_of_mentors"></span> === 3. Seznam mentorů === Seznam mentorů se zobrazí na <code>Special:ManageMentors</code>. Seznam mentorů můžete [[Transclusion|přenést]] kamkoli s následující syntaxí: <code><nowiki>{{Special:ManageMentors}}</nowiki></code>. Pokud se rozhodnete vytvořit stránku, kam převedete seznam mentorů, uveďte ji [[d:Q14339834|na wikidata]]. Na konfigurační stránce přidáte některá kritéria pro definování toho, kdo může být mentorem. Ve výchozím nastavení jsou požadavky na více než 500 provedených úprav a účet, který je alespoň 90 dní starý. Vaše komunita může také definovat některá specifická pravidla o tom, kdo může být mentorem (stáří účtu, počet provedených úprav, počet úprav provedených v hlavním prostoru, mít konkrétní roli atd.), a poté přidělit roli mentora kterémukoli účtu. Pokud chcete tento proces použít, [[talk:Growth|kontaktujte nás]]. <span id="4._Mentors_can_now_signup"></span> === 4. Mentoři se nyní mohou zaregistrovat === Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. <span id="Options"></span> == Možnosti == Mentoři mohou spravovat svůj účet: * [[Special:MyLanguage/Growth/FAQ#claim|Nárokovat nováčka od jiného mentora]] * [[Special:MyLanguage/Growth/FAQ#reassign|Přiřadit mentorované dalším mentorům]] * [[Special:MyLanguage/Growth/FAQ#change|Změnit počet nově přiřazených nováčků]] * [[Special:MyLanguage/Growth/FAQ#pause|Pauza mentorství]] * [[Special:MyLanguage/Growth/FAQ#quit|Ukončit mentorství]] Systém poskytuje možnosti pro správu mentorů: * [[Special:MyLanguage/Growth/FAQ#inactivity|Odstranit neaktivního mentora ze seznamu]] * [[Special:MyLanguage/Growth/FAQ#block|Spravuje blokované mentory]] <span id="See_also"></span> == Související odkazy == * [[Special:MyLanguage/Growth/FAQ#mentoring|Growth FAQ, o mentoringu]] 6p3wqejkvuqbgv7xl0iq0rfqy3mnm2v 8364433 8364431 2026-05-03T15:27:52Z Rebulka 17532855 Created page with "Zkontrolujte také naši dokumentaci na stránce [[$1|Jak ovlivňovat nováčky]]." 8364433 wikitext text/x-wiki <languages /> {{Growth/Active wikis}} Chcete se stát mentorem? Děkujeme! Tým Growth nabízí mentorský systém všem komunitám Wikipedie. Cílem je na wiki spárovat nováčky s mentory. Mentoři jsou zkušení uživatelé, připraveni pomoci novým uživatelům. Jsou klíčovým faktorem pro začlenění a povzbuzení nových uživatelů k úpravě wiki. Nováčci jsou informováni o svém mentorovi na [[#presentation|domovské stránce pro nováčky]]. Mentoři vidí, koho mentorují na [[#ready|mentorském panelu]]. Prosím, podívejte se na naše {{pll|Growth/Communities/How to work with newcomers on help desks|materiály o komunikaci s nováčky}} a následně se představte jako mentor. ; Ve zkratce : Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. Je to možné na wikinách, kde existuje seznam mentorů. : Pokud seznam neexistuje, musíte [[#create|nastavit seznam mentorů na vaší wiki]]. {{anchor|presentation}} <span id="Presentation_of_mentors_on_the_Homepage"></span> == Prezentace na Domovské stránce == [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11.png|thumb|Tento obrázek ukazuje, jak bude vaše představení ukázané v Domovské stránce.]] [[File:Example mentor message from Mediawiki newcomer homepage 2019-07-11 too long.png|thumb|Zprávy, které jsou delší než 240 znaků, jsou useknuté.]] {{pll|Growth/Personalized first day/Newcomer homepage|Domovská stránka nováčků}} je navržena tak, aby jim pomohla v uskutečnění jejich prvních kroků na Wikipedii. Nováčci mají přímý přístup na svou domovskou stránku. Tam vidí jméno zkušeného uživatele, který je připraven jim v případě potřeby pomoci: Jejich mentora. Mentoři jsou náhodně přiděleni více nováčkům, ale ne všichni svého mentora kontaktují. V průměru dostává mentor každý týden 0 až 6 otázek od nováčků. {{anchor|add}} <span id="How_to_add_yourself_to_the_mentor_list"></span> == Jak se přidat do seznamu mentorů == Děkujeme, že jste se dobrovolně stali mentorem! Je to obohacující zkušenost. <span id="Visit_the_Mentor_Dashboard"></span> === Navštivte panel Mentor Dashboard === Některé wiki vytvořily konkrétní stránku se seznamem mentorů, ale také pravidly nebo osvědčenými postupy, které je třeba dodržovat. Stránku své komunity můžete najít [[d:Q14339834|na Wikidata]]. Tento seznam vám řekne, jaké jsou podmínky pro to, abyste byli mentorem, pokud nějaká podmínka platí. Ve výchozím nastavení je proces registrace otevřen editorům, kteří mají 500 úprav a 90 dní přítomnosti. Ve výchozím nastavení je seznam mentorů pro vaši wiki umístěn na <code>Special:ManageMentors</code>. Tam můžete vidět, kdo je mentor. Pokud vaše wiki nastavila mentorský program a pokud se kvalifikujete být mentorem podle místních pravidel, navštivte prosím <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code> a zaregistrujte se. {{anchor|description}} <span id="Add_your_description"></span> === Přidejte svůj popis === Budete požádáni, abyste se popsali jako mentor. Tento krátký popis se zobrazí na domovské stránce nováčka. Ve výchozím nastavení je toto představení "{{Int|growthexperiments-homepage-mentorship-intro}}". Maximální délka popisu je 240 znaků. Pokud je delší, systém popis omezí. Nepřidávejte do popisu wikitext (bez odkazů, bez šablon), HTML nebo CSS: Nebude přijat. Správci mohou upravit váš popis pomocí <code>Special:ManageMentors</code>. <span id="Descriptions_examples"></span> ==== Příklady popisů ==== <small>(Z důvodu překladů mohou příklady níže přesáhnout limit 240 znaků.)</small> Můžete se představit neutrálně: * "Jsem tady, abych vám pomohl s orientováním se ve Wikipedii, neváhejte se mě zeptat na různé otázky!" Pokud upravujete Wikipedii a podílíte se na životě své komunity, máte dostatek zkušeností, abyste mohli odpovědět na jakoukoli otázku. Ale nenechte lidi, aby si mysleli, že jim můžete pomoci jen s něčím konkrétním. * Nepište "Edituji články o fotbalu". Nováčci si mohou myslet, že se vás nemohou zeptat na nic dalšího, než na fotbal. * Namísto toho napište "Nejčastěji přispívám o fotbalu, ale mohu vám pomoci s jakýmkoliv dalším tématem." Můžete pozvat nováčky, aby vás kontaktovali: * "Mohu vám odpovědět na vaše otázky o editování Wikipedie. Nejčastěji přispívám články o fotbalu. O čem budete přispívat vy?" * "Byl jsem stejně zmatený, jako jste teď vy. Pomohlo mi, že jsem se ptal zkušenějších uživatelů. Neváhejte se mě zeptat na cokoliv." Prosím, udržte své představení krátké: 240 znaků je maximum. Zvolili jsme tento limit, abychom se vyhnuli dlouhým textům, které by odváděly pozornost od ostatních informací, které již jsou na Domovské stránce k dispozici. Ze stejného důvodu nebude fungovat wikitext. Aby se o vás nováčci dozvěděli více, mohou kliknout na vaši uživatelskou stránku, na kterou z Domovské stránky vede odkaz. Vaše uživatelské jméno se již zobrazí na domovské stránce nováčků spolu s odkazem na vaši uživatelskou stránku. Není třeba nováčkům ve své prezentaci připomínat, kdo jste. <span id="Welcome_templates"></span> === Uvítací šablony === Komunity si mohou vytvářet nebo upravovat vlastní uvítací šablony. Mohou existovat uvítací šablony speciálně navržené pro mentory, které mohou dát svým menteům (vědecké pracovnice a pracovníci v počáteční fázi své kariéry), aby jim pomohly s představováním mentorů a procesem zaškolování nováčků. Například anglická Wikipedie má [[w:Template:Mentor welcome|<nowiki>{{Mentor welcome}}</nowiki>]] a [[w:Template:Welcome mentee |<nowiki>{{Welcome mentee}}</nowiki>]]. Francouzská Wikipedie má [[w:fr:Template:Bienvenue nouveau |<nowiki>{{Bienvenue nouveau}}</nowiki>]]. Uvítací šablony nejsou povinné, ale doporučené: Někteří nově příchozí se nedívají na svou domovskou stránku, zatímco jiní se nedívají na svou diskusní stránku. Automatické rozeslání uvítací šablony všem novým účtům může zvýšit počet interakcí se zkušeným mentorem. [[special:MyLanguage/Growth/FAQ#magicword|Magické slovo]] <code>{{ll|Growth/FAQ#magicword|<nowiki>{{#mentor}}</nowiki>}}</code> je k dispozici pro šablonování a {{tlc|#mentor:''NewcomerName''}} zobrazuje mentora daného nováčka. Je na každé komunitě, aby se rozhodla, zda má být jméno mentora [[Special:MyLanguage/Help:Substitution|nahrazeno]]. Každé řešení má své výhody a nevýhody: ; Pokud je název nahrazen : Ve zprávě se trvale zobrazí jméno mentora, který byl nově příchozím přidělen v době, kdy byla zpráva zanechána. : Toto použití je relevantní, pokud je uvítací zpráva distribuována ručně mentorem, protože historie uvádí, kdo zprávu distribuoval. Pokud se však nováček pokusí kontaktovat daného mentora a tento mentor již opustil mentorství nebo wiki, může to vést k určité frustraci. ; Pokud název není nahrazen : [[#reassign|Když se mentor změní]], magické slovo vybere jméno nového mentora. Tímto způsobem nováček, který si nepřečetl uvítací zprávu nebo zapomněl na svého předchozího mentora, uvidí toto jméno jako aktivního mentora uvedeného na domovské stránce. To snižuje zmatek pro nováčky. : To může být relevantní v případech, kdy je zpráva distribuována robotem nebo prostřednictvím služby [[Extension:NewUserMessage|NewUserMessage]], nebo v případech, kdy historie vztahu mentor/mentorovaný není tak důležitá (log ji uchovává). {{anchor|ready}} <span id="You_are_ready"></span> === Jste připraveni === Po zaregistrování vám systém začne přiřazovat nové mentorované. Pravidelně navštěvujte <code>{{ll|Growth/Mentor dashboard|Special:MentorDashboard}}</code>, abyste sledovali nováčky, kteří vám byly přiděleni. Nováčci vás také začnou kontaktovat přímo na vaší diskusní stránce. Nezapomeňte je zmínit, když odpovíte na jejich zprávy. Zkontrolujte také naši dokumentaci na stránce [[Special:MyLanguage/Growth/Communities/How to interact with newcomers|Jak ovlivňovat nováčky]]. {{anchor|create}} <span id="How_to_create_a_list_of_mentors"></span> == Jak vytvořit a udržovat seznam mentorů == <span id="1._Agree_on_having_mentorship"></span> === 1. Dohodněte se na mentorství === Nejprve musíte zkontrolovat, zda jsou nástroje Growth [[Growth/Deployment table|instalovány na vaší wiki]]. Pokud tomu tak ještě není, přečtěte si, prosím, [[#get|jak získat tyto funkce]]. Pak musíte najít nějaké další mentory, kteří se dobrovolně přihlásí. Doporučujeme vám zahájit konverzaci na příslušných místech na vaší wiki, abyste se mohli rozhodnout, zda by měl být tento seznam mentorů vytvořen. Je to také dobrý způsob, jak získat mentory. Mentorský systém Growth může [[Special:MyLanguage/Growth/FAQ#existing|nahradit nebo doplnit stávající mentorský systém]]. Na základě našeho pozorování doporučujeme mít jednoho mentora pro každou skupinu 500 nových uživatelů, které vaše wiki měsíčně získá. Například, pokud má vaše wiki 2 500 nových účtů za měsíc, měli byste mít alespoň 5 mentorů. Doporučujeme mít alespoň 3 mentory. Mentoři se mohou zaregistrovat před aktivací mentorského systému na <code>Special:EnrollAsMentor</code>. <span id="2._Activate_mentorship"></span> === 2. Aktivujte mentorship === Na vaší wiki musí administrátor zapnout mentorský systém pomocí konfigurační stránky (<code>Special:CommunityConfiguration</code>). <span id="3._List_of_mentors"></span> === 3. Seznam mentorů === Seznam mentorů se zobrazí na <code>Special:ManageMentors</code>. Seznam mentorů můžete [[Transclusion|přenést]] kamkoli s následující syntaxí: <code><nowiki>{{Special:ManageMentors}}</nowiki></code>. Pokud se rozhodnete vytvořit stránku, kam převedete seznam mentorů, uveďte ji [[d:Q14339834|na wikidata]]. Na konfigurační stránce přidáte některá kritéria pro definování toho, kdo může být mentorem. Ve výchozím nastavení jsou požadavky na více než 500 provedených úprav a účet, který je alespoň 90 dní starý. Vaše komunita může také definovat některá specifická pravidla o tom, kdo může být mentorem (stáří účtu, počet provedených úprav, počet úprav provedených v hlavním prostoru, mít konkrétní roli atd.), a poté přidělit roli mentora kterémukoli účtu. Pokud chcete tento proces použít, [[talk:Growth|kontaktujte nás]]. <span id="4._Mentors_can_now_signup"></span> === 4. Mentoři se nyní mohou zaregistrovat === Abyste se mohli stát mentorem, [[#add|musíte přidat své uživatelské jméno do seznamu mentorů]]. <span id="Options"></span> == Možnosti == Mentoři mohou spravovat svůj účet: * [[Special:MyLanguage/Growth/FAQ#claim|Nárokovat nováčka od jiného mentora]] * [[Special:MyLanguage/Growth/FAQ#reassign|Přiřadit mentorované dalším mentorům]] * [[Special:MyLanguage/Growth/FAQ#change|Změnit počet nově přiřazených nováčků]] * [[Special:MyLanguage/Growth/FAQ#pause|Pauza mentorství]] * [[Special:MyLanguage/Growth/FAQ#quit|Ukončit mentorství]] Systém poskytuje možnosti pro správu mentorů: * [[Special:MyLanguage/Growth/FAQ#inactivity|Odstranit neaktivního mentora ze seznamu]] * [[Special:MyLanguage/Growth/FAQ#block|Spravuje blokované mentory]] <span id="See_also"></span> == Související odkazy == * [[Special:MyLanguage/Growth/FAQ#mentoring|Growth FAQ, o mentoringu]] ki16bn0qujpxxvb5649z7xrea6iiiro Translations:Help:VisualEditor/User guide/Citation templates/55/ja 1198 954712 8364986 3314411 2026-05-04T06:02:24Z TzrZzz 18352707 8364986 wikitext text/x-wiki 引用テンプレートを、脚注に入れたり基本機能の出典エディターを使ったりせずに、記事に直接追加することができます。「挿入」メニューから「$dibuttip」アイコン(パズルのピース)をクリックします。 phbvkwatf3lvpuf1nkfygrks1x6r70j Translations:Help:VisualEditor/User guide/Citation templates/57/ja 1198 954714 8364988 3314414 2026-05-04T06:03:47Z TzrZzz 18352707 8364988 wikitext text/x-wiki 次に、記入欄に使いたいテンプレートの名前(または一部)を入力すると候補が表示されるので、青字の表示をクリックして「追加」ボタンを押すとテンプレートの窓が開きます。各欄の記入の方法はほかのテンプレートと共通です (ユーザーガイドの[[$uguide|テンプレートの編集]]節に詳しい説明があります。) qjyh9ywc8ueuutsgz3nqgao3n4e7706 Translations:Help:VisualEditor/User guide/Citation templates/58/ja 1198 954715 8364990 3314416 2026-05-04T06:04:51Z TzrZzz 18352707 8364990 wikitext text/x-wiki テンプレートの編集が終わったら、「$actsert」を押すと出典エディターに戻り、もう一度「$actsert」を押すと編集していた元のページに戻ります。 ne1jqncb7ymd24cl5s7n4e4rdg8t020 Translations:Help:VisualEditor/User guide/Citation templates/19/ja 1198 954759 8364911 3314532 2026-05-04T05:17:08Z TzrZzz 18352707 8364911 wikitext text/x-wiki 「$reftip」の脚注の編集をするときは、「編集」ボタンを押すと出典ダイアログが開き、脚注内のテキストを編集できます。編集そのものはメインウィンドウでの編集と同じで、テキストの書式設定やリンクの添付、あるいは特殊な文字の使用ができます。 hv1ba9xsok3oe5b9li9euhaubapu32m Translations:Help:VisualEditor/User guide/Citation templates/20/ja 1198 954761 8364913 3314547 2026-05-04T05:17:54Z TzrZzz 18352707 8364913 wikitext text/x-wiki 手順を十分に理解しないうちは、注釈ダイアログで「引用」や「挿入」メニューを使わないでください。 co4p85pkjanehyobi8q0g2dy3ve4pgn Translations:Help:VisualEditor/User guide/Citation templates/22/ja 1198 954763 8364917 3314553 2026-05-04T05:19:44Z TzrZzz 18352707 8364917 wikitext text/x-wiki 脚注マークをクリックした時に「$vidial」アイコン (開いた本の形) 以外のものが表示されたらそれは標準的な出典用のテンプレートで、「編集」ボタンを押すとそのテンプレートの小型エディターのダイアログが開きます。 9q0p4p937trl4zfc7tdql1ss7jyx141 Translations:Help:VisualEditor/User guide/Citation templates/24/ja 1198 954767 8364926 3314564 2026-05-04T05:21:25Z TzrZzz 18352707 8364926 wikitext text/x-wiki テンプレートの小型エディターを開くと、既に内容が入力されている欄 (テンプレートのパラメーター) が最初に表示されます。欄の内容を編集したり、不用なら除去することもできます。 md31oyqeme1hg3xaxycs58el0uojxv0 Translations:Help:VisualEditor/User guide/Citation templates/53/ja 1198 954770 8364982 3314570 2026-05-04T05:59:34Z TzrZzz 18352707 8364982 wikitext text/x-wiki テンプレートの編集が終わったら、「$actsert」を押すと出典エディターに戻り、もう一度「$actsert」を押すと編集していた元のページに戻ります。 ne1jqncb7ymd24cl5s7n4e4rdg8t020 Translations:Help:VisualEditor/User guide/Citation templates/29/ja 1198 955661 8364934 5609105 2026-05-04T05:24:18Z TzrZzz 18352707 8364934 wikitext text/x-wiki 記事の各文または各段落は、理想的には脚注内の引用によって裏付けられるべきです。 9na7q0ghtcbmsuxf5cu8j3oui2a8kg9 Translations:Help:VisualEditor/User guide/Citation templates/30/ja 1198 955664 8364940 5609107 2026-05-04T05:26:02Z TzrZzz 18352707 8364940 wikitext text/x-wiki 既存の参照を再利用するには、脚注を追加したい本文中の位置にカーソルを置きます。 fsbj90wvvuqmhppbur3qqcsjtfk0ctx Translations:Help:VisualEditor/User guide/Citation templates/32/ja 1198 955671 8364944 5609111 2026-05-04T05:27:24Z TzrZzz 18352707 8364944 wikitext text/x-wiki 再利用したい出典を一覧から探して選択します。 4ii7l2tybuh6vf6e43egdx9ln6tqn7l Translations:Help:VisualEditor/User guide/Citation templates/38/ja 1198 955675 8364968 3316856 2026-05-04T05:41:37Z TzrZzz 18352707 8364968 wikitext text/x-wiki 「書籍」などの標準引用テンプレートのアイコンをクリックすると、そのテンプレートの小型エディターが開きます。よく使われるフィールド(テンプレートのパラメーター)が表示されますが、すべてが必須というわけではありません。重要なフィールドはアスタリスクと左サイドバーのグレーのチェックボックスで示されます。任意フィールド(青色のチェックボックス)はサイドバーのチェックボックスをオン・オフすることで追加・削除できます。 srmmawfy1awvjmsppr3epld3qsdzioi Translations:Help:VisualEditor/User guide/Citation templates/47/ja 1198 955681 8364976 3316872 2026-05-04T05:49:37Z TzrZzz 18352707 8364976 wikitext text/x-wiki ここでは「$vediref」を選択し、「脚注」エディターでテキストに書式設定を加えつつ、引用テンプレートを使わずに記入する例を示しています。 7oaid4alxi1xhckumxnzcngv4y7vdak 8364992 8364976 2026-05-04T06:05:10Z TzrZzz 18352707 8364992 wikitext text/x-wiki ここでは「$vediref」を選択し、出典エディターでテキストに書式設定を加えつつ、引用テンプレートを使わずに記入する例を示しています。 2idtrnof07i11ac9zyr73twils63h90 Translations:Help:VisualEditor/User guide/Citation templates/50/ja 1198 955686 8364978 3316879 2026-05-04T05:56:25Z TzrZzz 18352707 8364978 wikitext text/x-wiki 出典エディタでは「$toolla」に (まだ) 表示されない引用テンプレートを呼び出すことができます。「$veti」ツールバーメニューから「$dibuttip アイコン」(パズルのピース)をクリックします。 48xxwvf3mn5jwejp3hrojopebs7bq1v Translations:Help:VisualEditor/User guide/Citation templates/52/ja 1198 955696 8364980 4649919 2026-05-04T05:57:47Z TzrZzz 18352707 8364980 wikitext text/x-wiki 次に出典テンプレートの名前 (もしくはその一部 ) を入力、表示されたらクリックして 「テンプレートを追加」ボタンを押すと、他のテンプレート同様に編集できます (テンプレートの詳細は[[$1|#Editing templates]] セクションをご参照ください。) tmtt282co5x5fmvxd9fao6cicv30s6h Help:Extension:Translate/Validators 12 956235 8364870 6197406 2026-05-04T04:02:11Z Shirayuki 472859 make untranslatable :( 8364870 wikitext text/x-wiki <languages/> {{Extension-Translate}} <translate><!--T:1--> Translatable strings often contain markup that should be retained as-is in the translation.</translate> <translate><!--T:2--> Typing that markup can be slow and difficult because special characters are common.</translate> <translate><!--T:3--> Translate extension can provide translators a button clicking on which inserts the piece of markup into the translation to the current cursor position.</translate> <translate><!--T:4--> In addition, if a translation is missing that specific markup, the Translate extension can either warn the translator or simply reject the translation, since such markup is usually mandatory to display the messages properly to the end user.</translate> <translate><!--T:5--> For example in the string, <tvar name=1><blockquote>''Adapted by %{name} from a work by %{original}''</blockquote></tvar> there are two insertables - <tvar name=2><code>%{name}</code></tvar> and <tvar name=3><code>%{original}</code></tvar>.</translate> <translate><!--T:6--> If the translator does not add them to their translation, the end user using the software will not see a proper message.</translate> <translate><!--T:7--> The <tvar name=1><code>MessageValidator</code></tvar> framework has been added with the intent of helping with validating translations.</translate> <translate><!--T:8--> Validators run on the translated message and based on the configuration, a warning or error message is shown to the translator.</translate> <translate><!--T:9--> Translations with warnings can still be saved, but ones that have error cannot.</translate> <translate><!--T:10--> Only a user with <tvar name=1><code>translate-manage</code></tvar> permission can save translations that have errors.</translate> <translate><!--T:11--> When configuring a validator, a regex is defined to identify markup that is mandatory.</translate> <translate><!--T:12--> The validator can also be marked as insertable, in which case a button will be displayed to the translator to add that markup into the translation.</translate> <translate> <!--T:13--> Adding a custom validators is still possible and will be needed for more specialized validations. == Configuration == <!--T:14--> <!--T:15--> Following is a summarized validator configuration, </translate> <syntaxhighlight lang="yaml" line="1" start="1"> VALIDATORS: # <translate nowrap><!--T:16--> Example</translate> 1 - id: InsertableRegex enforce: true insertable: true params: /\$[a-z0-9]+/ keymatch: - 'untranslated' # <translate nowrap><!--T:17--> Matches key untranslated directly</translate> - type: 'wildcard' pattern: '*translated*' # <translate nowrap><!--T:18--> Matches any key that has the translated in it</translate> # <translate nowrap><!--T:19--> Example</translate> 2 - id: InsertableRegex insertable: true params: regex: /(?<pre>\[)[^]]+(?<post>\]\([^)]+\))/ display: $pre $post pre: $pre post: $post # <translate nowrap><!--T:20--> Example</translate> 3 - class: MathJaxMessageValidator enforce: true # <translate nowrap><!--T:21--> Example</translate> 4 - id: BraceBalance </syntaxhighlight> <translate> <!--T:22--> In the example above, </translate> # <translate><!--T:23--> <tvar name=1><code>InsertableRegex</code></tvar> is a bundled validator that can accept a custom regex and run validations.</translate> # <translate><!--T:24--> <tvar name=1><code>MathJaxMessageValidator</code></tvar> is a custom validator class.</translate> # <translate><!--T:25--> <tvar name=1><code>BraceBalance</code></tvar> is another bundled validator.</translate> <translate><!--T:26--> <tvar name=1><code>VALIDATORS</code></tvar> uses an array format.</translate> <translate><!--T:27--> Lets look at the various parameters being used here in each array item,</translate> <translate> === Parameters === <!--T:28--> </translate> {| class="wikitable" ! <translate><!--T:29--> Property</translate> ! <translate><!--T:30--> Type</translate> ! <translate><!--T:31--> Description</translate> |- |id | <translate><!--T:32--> string</translate> | <translate><!--T:33--> Incase a bundled / pre-provided validator is being used, the ID of the validator.</translate> <translate><!--T:34--> ''Required if <tvar name=1><code>class</code></tvar> is not specified.''</translate> |- |class | <translate><!--T:35--> string</translate> | <translate><!--T:36--> If a custom validator is being used, then use this option instead of <tvar name=1><code>id</code></tvar>.</translate> <translate><!--T:37--> Specifies the name of the validator class.</translate> <translate><!--T:174--> See '''example #3''' in the above config.</translate> <translate><!--T:38--> The <tvar name=1><code>AUTOLOAD</code></tvar> option can be used to load the class.</translate> <translate><!--T:39--> ''Required if <tvar name=1><code>id</code></tvar> is not specified.''</translate> |- |enforce | <translate><!--T:40--> boolean</translate> | <translate><!--T:41--> Whether the validator should be enforced.</translate> <translate><!--T:42--> If set to true, and a translation fails validation, an error will be displayed which must be fixed in order to save the translation.</translate> |- |insertable | <translate><!--T:43--> boolean</translate> | <translate><!--T:44--> Whether the validator should also be an insertable.</translate> |- |keymatch | <translate><!--T:45--> array</translate> | <translate><!--T:46--> With this option it is possible to limit certain validations to certain messages.</translate> <translate><!--T:47--> Keymatch is an array with each option being either a '''string''' or a '''prototype.''' If it is a string, a direct comparison with the message key is done.</translate> <translate><!--T:48--> See '''example #1''' in the above config.</translate> |- |keymatch[i].type | <translate><!--T:49--> string</translate> | <translate><!--T:50--> Type is either ''regex'' or ''wildcard''.</translate> <translate><!--T:51--> This is the approach that will be used to check if the message key matches a given pattern.</translate> |- |keymatch[i].pattern | <translate><!--T:52--> string</translate> | <translate><!--T:53--> Pattern is a string that will be used for matching.</translate> |- |params | <translate><!--T:54--> string / associative array</translate> | <translate><!--T:55--> If <tvar name=1><code>params</code></tvar> is specified '''as a string''', it is used as the regex.</translate> <translate><!--T:56--> See '''example #1'''</translate> <translate> <!--T:57--> In this case if insertable is true, </translate> # <translate><!--T:58--> <tvar name=1><code>display</code></tvar> is the first value from the regex match.</translate> # <translate><!--T:59--> <tvar name=1><code>pre</code></tvar> is also the first value from the regex match.</translate> # <translate><!--T:60--> <tvar name=1><code>post</code></tvar> is left empty.</translate> <translate><!--T:61--> If <tvar name=1><code>params</code></tvar> is specified '''as an associative array (see example #2)''', see below for further details.</translate> |- |params.regex | <translate><!--T:62--> string</translate> | <translate><!--T:63--> The regex to be used for validator.</translate> <translate><!--T:64--> Must use named captures.</translate> <translate><!--T:65--> When specifying named captures, do not use the <tvar name=1><code>$</code></tvar> symbol in the name.</translate> <translate><!--T:66--> In '''example #2''', two named captures are used - <tvar name=1><code>pre</code></tvar> and <tvar name=2><code>post</code></tvar>.</translate> |- |params.display | <translate><!--T:67--> string</translate> | <translate><!--T:68--> Mandatory value.</translate> <translate><!--T:69--> The display value for the insertable.</translate> <translate><!--T:70--> Named captures prefixed with $ are used here.</translate> <translate><!--T:71--> See '''example #2'''.</translate> |- |params.pre | <translate><!--T:72--> string</translate> | <translate><!--T:73--> The pre value for the insertable.</translate> <translate><!--T:74--> Value inserted before the cursor position.</translate> <translate><!--T:75--> Named captures prefixed with <tvar name=1>$</tvar> are used here.</translate> <translate><!--T:76--> If not specified, is set to the display value.</translate> <translate><!--T:77--> See '''example #2'''.</translate> |- |params.post | <translate><!--T:78--> string</translate> | <translate><!--T:79--> The post value for the insertable.</translate> <translate><!--T:80--> Value inserted after the cursor position.</translate> <translate><!--T:81--> Named captures prefixed with <tvar name=1>$</tvar> are used here.</translate> <translate><!--T:82--> See '''example #2'''.</translate> <translate><!--T:83--> If not specified, defaults to an empty string.</translate> |} <translate> === Pre-provided / Bundled validators === <!--T:84--> <!--T:85--> Following is a list of bundled validators, </translate> ==== BraceBalance ==== ID: <code>BraceBalance</code> <translate> <!--T:86--> Ensures that the number of open braces / brackets, matches the number of closed braces / brackets in the translation. <!--T:87--> For example, the following translations would pass, </translate> * <code><nowiki>{{ }}</nowiki></code> * <code>[ ]</code> <translate><!--T:88--> whereas, the following would fail,</translate> * <code>[ ]]</code> * <code><nowiki>{{ }</nowiki></code> <translate><!--T:89--> This validator cannot be marked as insertable.</translate> ==== EscapeCharacter ==== ID: <code>EscapeCharacter</code> <translate> <!--T:90--> The validator ensures that only the specified escape character are present in a translation. <!--T:91--> The allowed escape characters can be specified when adding the validator, and can only include, </translate> * <code>\t</code> * <code>\n</code> * <code>\'</code> * <code>\"</code> * <code>\f</code> * <code>\r</code> * <code>\a</code> * <code>\b</code> * <code>\\</code> <translate><!--T:92--> This validator is not insertable.</translate> ==== GettextNewline ==== ID: <code>GettextNewline</code> <translate> <!--T:93--> This works specifically for GetText based message groups. <!--T:94--> Ensures that the translation has the same number of newlines as the source message at the beginning and end of the string. </translate> ==== GettextPlural ==== ID: <code>GettextPlural</code> <translate> <!--T:95--> This works specifically on GetText based message groups. </translate> <translate><!--T:96--> Ensures that if the source / definition contains a plural in the format - <tvar name=1><code><nowiki>foo {{PLURAL:GETTEXT|one|many}} bar</nowiki></code></tvar>, the translation must contain it as well.</translate> <translate><!--T:97--> Based on the language this also checks if the translation has the correct number of plural forms.</translate> <translate><!--T:98--> For example, English has two, but Hebrew has four.</translate> ==== InsertableRegex ==== ID: <code>InsertableRegex</code> <translate> <!--T:99--> A generic reusable validator that can be used to specify custom validations and insertables. <!--T:100--> For example, take the following configuration where the validator is marked as insertable and enforced, </translate> <syntaxhighlight lang="yaml"> - id: InsertableRegex enforce: true insertable: true params: "/\$[a-zA-Z0-9]+/" </syntaxhighlight> <translate><!--T:101--> Given the following source message - <tvar name=1>''Hello $name. My name is $myName.''</tvar> that is being translated, the translation must have the parameters - <tvar name=2>''$name''</tvar> and <tvar name=3>''$myName''</tvar>.</translate> <translate><!--T:102--> They will also be displayed as insertables to make it easier for translators to use them in the translation.</translate> <translate><!--T:103--> An absence of these parameters will cause an error to be displayed to the translator.</translate> ==== InsertableRubyVariable ==== ID: <code>InsertableRubyVariable</code> <translate><!--T:104--> This is a validator that matches ruby variables in the translations.</translate> <translate><!--T:105--> Internally it extends <tvar name=1><code>InsertableRegexValidator</code></tvar> and uses the following regex - <tvar name=2><code>%{[a-zA-Z_]+}</code></tvar>.</translate> <translate><!--T:106--> This validator is insertable.</translate> <translate><!--T:107--> Example:</translate> <code>%{abc}</code> ==== IosVariable ==== ID: <code>IosVariable</code> <translate><!--T:108--> An insertable variable validator for Ios.</translate> <translate><!--T:109--> Regex is used [<tvar name=url>https://github.com/dcordero/Rubustrings/blob/61d477bffbb318ca3ffed9c2afc49ec301931d93/lib/rubustrings/action.rb#L91</tvar> from this Rubustrings source].</translate> <translate><!--T:110--> This validator is insertable.</translate> <translate><!--T:111--> Example:</translate> <code>%@</code> ==== MatchSet ==== ID: <code>MatchSet</code> <translate><!--T:112--> Ensures that the translation is present in the list of values.</translate> <translate><!--T:113--> Also takes a parameter - <tvar name=1><code>caseSensitive</code></tvar> that can be either <tvar name=2>true</tvar> (''default'') or <tvar name=3>false</tvar>.</translate> <translate><!--T:114--> For example the following configuration, the validator will validate the message with key - <tvar name=1><code>html.dir</code></tvar> and ensure that the values for it can either be ''ltr'' or ''rtl''.</translate> <translate><!--T:115--> Note that LTR or RTL will not be valid values, since <tvar name=1><code>caseSensitive</code></tvar> is true by default.</translate> <syntaxhighlight lang="yaml" line="1" start="1"> - id: MatchSet enforce: true keymatch: - html.dir params: values: - ltr - rtl </syntaxhighlight> ==== MediaWikiLink ==== ID: <code>MediaWikiLink</code> <translate><!--T:116--> Checks if the translation uses links that are discouraged.</translate> <translate><!--T:117--> Valid links are those that link to Special: pages, <tvar name=1><code><nowiki>{{ns:special}}:</nowiki></code></tvar> or project pages trough MediaWiki messages like <tvar name=2><code><nowiki>{{MediaWiki:helppage-url}}:</nowiki></code></tvar>.</translate> <translate><!--T:118--> Also links in the definition are allowed.</translate> ==== MediaWikiPageName ==== ID: <code>MediaWikiPageName</code> <translate><!--T:119--> Ensures that if the source / definition contains a namespace such as <tvar name=1><code><nowiki>{{ns:project}}:hello</nowiki></code></tvar> the translations made do not try to translate the namespaces itself.</translate> ==== MediaWikiParameter ==== ID: <code>MediaWikiParameter</code> <translate><!--T:120--> This is a validator that matches wiki parameters in the translations.</translate> <translate><!--T:121--> Internally it extends <tvar name=1><code>InsertableRegexValidator</code></tvar> and uses the following regex - <tvar name=2><code>/\$[1-9]/</code></tvar>.</translate> <translate><!--T:122--> This validator is insertable.</translate> <translate><!--T:123--> Example:</translate> <code>$1</code>, <code>$2</code>. ==== MediaWikiPlural ==== ID: <code>MediaWikiPlural</code> <translate><!--T:124--> Ensures that if the source / definition contains a <tvar name=1><code><nowiki>{{PLURAL:$1|message|messages}}</nowiki></code></tvar>, the translation should also have it.</translate> <translate><!--T:125--> It can also be used as an insertable.</translate> <translate><!--T:126--> Based on the language this also checks if the translation has the correct number of plural forms.</translate> <translate><!--T:127--> For example, English has two, but Hebrew has three.</translate> ==== MediaWikiTimeList ==== ID: <code>MediaWikiTimeList</code> <translate><!--T:128--> Provides validations for expiry options and IP block options specified in the MediaWiki core.</translate> <translate><!--T:129--> These are usually in the format,</translate> <syntaxhighlight lang="text"> indefinite:indefinite,3 hours:3 hours,12 hours:12 hours,24 hours:24 hours,31 hours:31 hours,36 hours:36 hours,48 hours:48 hours,60 hours:60 hours,72 hours:72 hours,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,2 years:2 years,3 years:3 years,infinite:indefinite </syntaxhighlight> <translate><!--T:130--> The validations ensure that the translations have the exact same number of key-value pairs.</translate> <translate><!--T:131--> These validations are run only on messages with keys,</translate> # protect-expiry-options # ipboptions ==== Newline ==== ID: <code>Newline</code> <translate><!--T:132--> Ensures that the translation has the same number of newlines as the source / definition message at the ''beginning of the string''.</translate> <translate><!--T:133--> This validator is not insertable.</translate> ==== NotEmpty ==== ID: <code>NotEmpty</code> <translate><!--T:134--> Ensures that the translation has some content, and that content is not just whitespace.</translate> <translate><!--T:135--> This validator is not insertable.</translate> ==== NumericalParameter ==== ID: <code>NumericalParameter</code> <translate><!--T:136--> This validator matches numerical parameters by using the following regex: <tvar name=1><code>/\$\d+/</code></tvar>.</translate> <translate><!--T:137--> This validator is insertable.</translate> <translate><!--T:138--> Example:</translate> <code>$33</code>, <code>$1</code> etc. ==== Printf ==== ID: <code>Printf</code> <translate><!--T:139--> This validator checks for missing and unknown printf formatting characters in translations.</translate> <translate><!--T:140--> This validator is insertable.</translate> <translate><!--T:141--> Example:</translate> <code>%2$f</code>, <code>%d</code> etc. ==== PythonInterpolation ==== ID: <code>PythonInterpolation</code> <translate><!--T:142--> This validator matches python string interpolation variables by using the following regex: <tvar name=1><code>/\%(?:\([a-zA-Z0-9]*?\))?[diouxXeEfFgGcrs]/U</code></tvar>.</translate> <translate><!--T:143--> This validator is insertable.</translate> <translate><!--T:144--> Example:</translate> <code>%s</code>, <code>%(name)s</code> ==== Replacement ==== ID: <code>Replacement</code> <translate><!--T:145--> Checks if a translation is using the <tvar name=1><code>search</code></tvar> string, and instead suggests the translator to use the string mentioned under <tvar name=2><code>replacement</code></tvar>.</translate> <translate><!--T:146--> This validator is not insertable.</translate> <syntaxhighlight lang="yaml" line="1"> - id: Replacement enforce: true params: search: '{{PLURAL:' replace: '{PLURAL:' </syntaxhighlight> ==== SmartFormatPlural ==== ID: <code>SmartFormatPlural</code> <translate> <!--T:147--> This works specifically on <tvar name=1>[https://github.com/axuno/SmartFormat SmartFormat]</tvar> based message groups. </translate> <translate><!--T:148--> Ensures that if the source / definition contains a plural in the format - <tvar name=1><code>{1:test|tests}{0:message|messages}</code></tvar>, the translation must contain it as well.</translate> <translate><!--T:149--> Based on the language this also checks if the translation has the correct number of plural forms.</translate> <translate><!--T:150--> For example, English has two, but Hebrew has four.</translate> ==== UnicodePlural ==== ID: <code>UnicodePlural</code> <translate><!--T:151--> Ensures that if the source / definition contains a plural in the format - <tvar name=1><code><nowiki>foo {{PLURAL|one=one|many}} bar</nowiki></code></tvar>, the translation must contain it as well.</translate> <translate><!--T:152--> Based on the language this also checks if the translation has the correct number of plural forms.</translate> <translate><!--T:153--> For example, English has two, but Hebrew has three.</translate> <translate> == User interface == <!--T:154--> </translate> <translate><!--T:155--> The user interface has been updated to differentiate between errors and warnings.</translate> [[File:Translate-validation-err-warning.png|thumb|345x345px|alt=|<translate><!--T:156--> A warning and error shown on top of a translation</translate>]] <translate> <!--T:157--> During translation, if an error is noticed with the translation, the '''Save translation''' button is disabled unless the user who is translating has <tvar name=1><code>translate-manage</code></tvar> permission. </translate> <translate><!--T:158--> Additionally validation is also done on the server when the user is saving the translation.</translate> <translate><!--T:159--> This will still allow users who have the <tvar name=1><code>translate-manage</code></tvar> permission to save the translation even if it has errors.</translate> <translate> == Custom validators == <!--T:160--> </translate> <translate><!--T:161--> Certain complicated validations might still require a custom validator to be written.</translate> <translate><!--T:162--> Custom validators must implement the <tvar name=1><code>MediaWiki\Extensions\Translate\Validation\MessageValidator</code></tvar> interface <tvar name=2>[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/MessageValidator.php]</tvar>.</translate> <translate> <!--T:163--> Below is an example of a custom validator, </translate> <syntaxhighlight lang="php" line="1" start="1"> <?php // Filename: Validator.php use MediaWiki\Extensions\Translate\Validation\MessageValidator; use MediaWiki\Extensions\Translate\Validation\ValidationIssue; use MediaWiki\Extensions\Translate\Validation\ValidationIssues; /** * <translate nowrap><!--T:164--> My Custom Validator</translate> */ class MyCustomValidator implements MessageValidator { public function getIssues( TMessage $message, string $targetLanguage ): ValidationIssues { $issues = new ValidationIssues(); // <translate nowrap><!--T:165--> Validation code goes here.</translate> <translate nowrap><!--T:166--> Push <tvar name=1>ValidationIssue</tvar> into the <tvar name=2>ValidationIssues</tvar>.</translate> <translate nowrap><!--T:167--> E.g.:</translate> $issue = new ValidationIssue( 'value-not-present', // <translate nowrap><!--T:168--> type</translate> 'invalid', // <translate nowrap><!--T:169--> sub-type</translate> 'translate-checks-value-not-present', // <translate nowrap><!--T:170--> message key</translate> [ // <translate nowrap><!--T:171--> message params</translate> [ 'PLAIN-PARAMS', $this->possibleValues ], [ 'COUNT', count( $this->possibleValues ) ] ] ); $issues->add( $issue ); return $issues; } } </syntaxhighlight> <translate><!--T:172--> Also see the following classes,</translate> # <code>ValidationIssues</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssues.php # <code>ValidationIssue</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssue.php <translate><!--T:173--> The add the custom validator in the configuration file,</translate> <syntaxhighlight lang="yaml"> VALIDATORS: - class: MyCustomValidator enforce: true AUTOLOAD: MyCustomValidator: Validator.php </syntaxhighlight> kq7tvcxf4y7wbalhk730k6fz71zm66k Help:Extension:Translate/Components/ja 12 965638 8364812 8112794 2026-05-04T02:19:29Z Shirayuki 472859 Created page with "{{$1|メッセージ群}}に関する詳細な説明文書" 8364812 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 <div lang="en" dir="ltr" class="mw-content-ltr"> The two primary ways to register message groups to Translate are the {{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} hook and {{ll|Help:Extension:Translate/Group configuration example|YAML configuration}}. </div> <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation about {{ll|Help:Extension:Translate/Translation aids|translation aids}}</span>'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 <span lang="en" dir="ltr" class="mw-content-ltr">Each class that extends the TranslationAid class only needs to implement one method called getData.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It should return the information in structured format (nested arrays), which is then exposed via ApiQueryTranslationAids Web API module.</span> ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === <span lang="en" dir="ltr" class="mw-content-ltr">Adding more machine translation services can easily be done by extending the <code>TranslationWebService</code> class.</span> 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか <span lang="en" dir="ltr" class="mw-content-ltr">When you have this information, it is straightforward to write the <code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> methods.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You should use the TranslationWebServiceException to signal errors.</span> エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 <span lang="en" dir="ltr" class="mw-content-ltr">The suggestions will automatically be displayed in the translation editor via the MachineTranslationAid class and the ApiQueryTranslationAids WebAPI module.</span> これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=<span lang="en" dir="ltr" class="mw-content-ltr">How to define checkers for file based message groups</span>}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は特定のメッセージグループ一覧にアクセスできるようにします。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これはメッセージを集めたグループを含む集約グループが異なる名前空間に作成されないよう予防します。 以下の短い例ではフィンランド語の翻訳を使って、メッセージ集をどのように使うと''core'' というグループの対訳を抽出して冒頭の10件をプリントする方法を示します。 <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 <span lang="en" dir="ltr" class="mw-content-ltr">To solve this problem, the FCFontFinder class was written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It uses the <code>fc-match</code> command of the package <code>fontconfig</code> (so this doesn't work on Windows) to find a suitable font.</span> これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === <span lang="en" dir="ltr" class="mw-content-ltr">The messages of file-based message groups are stored in CDB files.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each language of each group has its own CDB cache file.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] oabm7txnnn0o7tqx4iw2121gbtfbezz 8364814 8364812 2026-05-04T02:20:06Z Shirayuki 472859 Created page with "Translate にメッセージ群を登録する主な方法は、$1 フックと {{$2|YAML 設定}}の 2 つです。" 8364814 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 Translate にメッセージ群を登録する主な方法は、{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} フックと {{ll|Help:Extension:Translate/Group configuration example|YAML 設定}}の 2 つです。 <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation about {{ll|Help:Extension:Translate/Translation aids|translation aids}}</span>'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 <span lang="en" dir="ltr" class="mw-content-ltr">Each class that extends the TranslationAid class only needs to implement one method called getData.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It should return the information in structured format (nested arrays), which is then exposed via ApiQueryTranslationAids Web API module.</span> ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === <span lang="en" dir="ltr" class="mw-content-ltr">Adding more machine translation services can easily be done by extending the <code>TranslationWebService</code> class.</span> 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか <span lang="en" dir="ltr" class="mw-content-ltr">When you have this information, it is straightforward to write the <code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> methods.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You should use the TranslationWebServiceException to signal errors.</span> エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 <span lang="en" dir="ltr" class="mw-content-ltr">The suggestions will automatically be displayed in the translation editor via the MachineTranslationAid class and the ApiQueryTranslationAids WebAPI module.</span> これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=<span lang="en" dir="ltr" class="mw-content-ltr">How to define checkers for file based message groups</span>}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は特定のメッセージグループ一覧にアクセスできるようにします。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これはメッセージを集めたグループを含む集約グループが異なる名前空間に作成されないよう予防します。 以下の短い例ではフィンランド語の翻訳を使って、メッセージ集をどのように使うと''core'' というグループの対訳を抽出して冒頭の10件をプリントする方法を示します。 <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 <span lang="en" dir="ltr" class="mw-content-ltr">To solve this problem, the FCFontFinder class was written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It uses the <code>fc-match</code> command of the package <code>fontconfig</code> (so this doesn't work on Windows) to find a suitable font.</span> これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === <span lang="en" dir="ltr" class="mw-content-ltr">The messages of file-based message groups are stored in CDB files.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each language of each group has its own CDB cache file.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] jhfwevd4pmd0fukjg4n50hlr91384ts 8364816 8364814 2026-05-04T02:21:45Z Shirayuki 472859 Created page with "{{$1|翻訳支援}}に関する詳細な説明文書" 8364816 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 Translate にメッセージ群を登録する主な方法は、{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} フックと {{ll|Help:Extension:Translate/Group configuration example|YAML 設定}}の 2 つです。 <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''{{ll|Help:Extension:Translate/Translation aids|翻訳支援}}に関する詳細な説明文書'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 <span lang="en" dir="ltr" class="mw-content-ltr">Each class that extends the TranslationAid class only needs to implement one method called getData.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It should return the information in structured format (nested arrays), which is then exposed via ApiQueryTranslationAids Web API module.</span> ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === <span lang="en" dir="ltr" class="mw-content-ltr">Adding more machine translation services can easily be done by extending the <code>TranslationWebService</code> class.</span> 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか <span lang="en" dir="ltr" class="mw-content-ltr">When you have this information, it is straightforward to write the <code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> methods.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You should use the TranslationWebServiceException to signal errors.</span> エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 <span lang="en" dir="ltr" class="mw-content-ltr">The suggestions will automatically be displayed in the translation editor via the MachineTranslationAid class and the ApiQueryTranslationAids WebAPI module.</span> これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=<span lang="en" dir="ltr" class="mw-content-ltr">How to define checkers for file based message groups</span>}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は特定のメッセージグループ一覧にアクセスできるようにします。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これはメッセージを集めたグループを含む集約グループが異なる名前空間に作成されないよう予防します。 以下の短い例ではフィンランド語の翻訳を使って、メッセージ集をどのように使うと''core'' というグループの対訳を抽出して冒頭の10件をプリントする方法を示します。 <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 <span lang="en" dir="ltr" class="mw-content-ltr">To solve this problem, the FCFontFinder class was written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It uses the <code>fc-match</code> command of the package <code>fontconfig</code> (so this doesn't work on Windows) to find a suitable font.</span> これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === <span lang="en" dir="ltr" class="mw-content-ltr">The messages of file-based message groups are stored in CDB files.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each language of each group has its own CDB cache file.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] g8gyb56jnka3elqd9v7mq2dvs71c9j8 8364818 8364816 2026-05-04T02:22:58Z Shirayuki 472859 Created page with "TranslationAid クラスを継承する各クラスは、$1 という名前の 1 つのメソッドのみを実装する必要があります。" 8364818 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 Translate にメッセージ群を登録する主な方法は、{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} フックと {{ll|Help:Extension:Translate/Group configuration example|YAML 設定}}の 2 つです。 <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''{{ll|Help:Extension:Translate/Translation aids|翻訳支援}}に関する詳細な説明文書'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 TranslationAid クラスを継承する各クラスは、getData という名前の 1 つのメソッドのみを実装する必要があります。 <span lang="en" dir="ltr" class="mw-content-ltr">It should return the information in structured format (nested arrays), which is then exposed via ApiQueryTranslationAids Web API module.</span> ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === <span lang="en" dir="ltr" class="mw-content-ltr">Adding more machine translation services can easily be done by extending the <code>TranslationWebService</code> class.</span> 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか <span lang="en" dir="ltr" class="mw-content-ltr">When you have this information, it is straightforward to write the <code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> methods.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You should use the TranslationWebServiceException to signal errors.</span> エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 <span lang="en" dir="ltr" class="mw-content-ltr">The suggestions will automatically be displayed in the translation editor via the MachineTranslationAid class and the ApiQueryTranslationAids WebAPI module.</span> これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=<span lang="en" dir="ltr" class="mw-content-ltr">How to define checkers for file based message groups</span>}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は特定のメッセージグループ一覧にアクセスできるようにします。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これはメッセージを集めたグループを含む集約グループが異なる名前空間に作成されないよう予防します。 以下の短い例ではフィンランド語の翻訳を使って、メッセージ集をどのように使うと''core'' というグループの対訳を抽出して冒頭の10件をプリントする方法を示します。 <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 <span lang="en" dir="ltr" class="mw-content-ltr">To solve this problem, the FCFontFinder class was written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It uses the <code>fc-match</code> command of the package <code>fontconfig</code> (so this doesn't work on Windows) to find a suitable font.</span> これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === <span lang="en" dir="ltr" class="mw-content-ltr">The messages of file-based message groups are stored in CDB files.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each language of each group has its own CDB cache file.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] gnadil5i6mnhnh7deb3zyfcc0phj2yh 8364823 8364818 2026-05-04T02:30:41Z Shirayuki 472859 Created page with "これは構造化形式 (入れ子の配列) で情報を返し、その後 $1 Web API モジュールを通じて公開される必要があります。" 8364823 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 Translate にメッセージ群を登録する主な方法は、{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} フックと {{ll|Help:Extension:Translate/Group configuration example|YAML 設定}}の 2 つです。 <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''{{ll|Help:Extension:Translate/Translation aids|翻訳支援}}に関する詳細な説明文書'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 TranslationAid クラスを継承する各クラスは、getData という名前の 1 つのメソッドのみを実装する必要があります。 これは構造化形式 (入れ子の配列) で情報を返し、その後 ApiQueryTranslationAids Web API モジュールを通じて公開される必要があります。 ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === <span lang="en" dir="ltr" class="mw-content-ltr">Adding more machine translation services can easily be done by extending the <code>TranslationWebService</code> class.</span> 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか <span lang="en" dir="ltr" class="mw-content-ltr">When you have this information, it is straightforward to write the <code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> methods.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You should use the TranslationWebServiceException to signal errors.</span> エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 <span lang="en" dir="ltr" class="mw-content-ltr">The suggestions will automatically be displayed in the translation editor via the MachineTranslationAid class and the ApiQueryTranslationAids WebAPI module.</span> これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=<span lang="en" dir="ltr" class="mw-content-ltr">How to define checkers for file based message groups</span>}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は特定のメッセージグループ一覧にアクセスできるようにします。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これはメッセージを集めたグループを含む集約グループが異なる名前空間に作成されないよう予防します。 以下の短い例ではフィンランド語の翻訳を使って、メッセージ集をどのように使うと''core'' というグループの対訳を抽出して冒頭の10件をプリントする方法を示します。 <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 <span lang="en" dir="ltr" class="mw-content-ltr">To solve this problem, the FCFontFinder class was written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It uses the <code>fc-match</code> command of the package <code>fontconfig</code> (so this doesn't work on Windows) to find a suitable font.</span> これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === <span lang="en" dir="ltr" class="mw-content-ltr">The messages of file-based message groups are stored in CDB files.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each language of each group has its own CDB cache file.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] a5fs95aaqmlz37b91wgcx9g02jy8l1a 8364825 8364823 2026-05-04T02:31:53Z Shirayuki 472859 Created page with "追加の機械翻訳サービスは、$1 クラスを継承することで簡単に追加できます。" 8364825 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 Translate にメッセージ群を登録する主な方法は、{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} フックと {{ll|Help:Extension:Translate/Group configuration example|YAML 設定}}の 2 つです。 <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''{{ll|Help:Extension:Translate/Translation aids|翻訳支援}}に関する詳細な説明文書'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 TranslationAid クラスを継承する各クラスは、getData という名前の 1 つのメソッドのみを実装する必要があります。 これは構造化形式 (入れ子の配列) で情報を返し、その後 ApiQueryTranslationAids Web API モジュールを通じて公開される必要があります。 ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === 追加の機械翻訳サービスは、<code>TranslationWebService</code> クラスを継承することで簡単に追加できます。 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか <span lang="en" dir="ltr" class="mw-content-ltr">When you have this information, it is straightforward to write the <code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> methods.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You should use the TranslationWebServiceException to signal errors.</span> エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 <span lang="en" dir="ltr" class="mw-content-ltr">The suggestions will automatically be displayed in the translation editor via the MachineTranslationAid class and the ApiQueryTranslationAids WebAPI module.</span> これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=<span lang="en" dir="ltr" class="mw-content-ltr">How to define checkers for file based message groups</span>}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は特定のメッセージグループ一覧にアクセスできるようにします。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これはメッセージを集めたグループを含む集約グループが異なる名前空間に作成されないよう予防します。 以下の短い例ではフィンランド語の翻訳を使って、メッセージ集をどのように使うと''core'' というグループの対訳を抽出して冒頭の10件をプリントする方法を示します。 <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 <span lang="en" dir="ltr" class="mw-content-ltr">To solve this problem, the FCFontFinder class was written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It uses the <code>fc-match</code> command of the package <code>fontconfig</code> (so this doesn't work on Windows) to find a suitable font.</span> これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === <span lang="en" dir="ltr" class="mw-content-ltr">The messages of file-based message groups are stored in CDB files.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each language of each group has its own CDB cache file.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] 8inq7m7am5yxk2e742eop6rerdgnkou 8364827 8364825 2026-05-04T02:32:17Z Shirayuki 472859 Created page with "この情報があれば、$1 メソッドの実装は容易です。" 8364827 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 Translate にメッセージ群を登録する主な方法は、{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} フックと {{ll|Help:Extension:Translate/Group configuration example|YAML 設定}}の 2 つです。 <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''{{ll|Help:Extension:Translate/Translation aids|翻訳支援}}に関する詳細な説明文書'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 TranslationAid クラスを継承する各クラスは、getData という名前の 1 つのメソッドのみを実装する必要があります。 これは構造化形式 (入れ子の配列) で情報を返し、その後 ApiQueryTranslationAids Web API モジュールを通じて公開される必要があります。 ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === 追加の機械翻訳サービスは、<code>TranslationWebService</code> クラスを継承することで簡単に追加できます。 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか この情報があれば、<code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> メソッドの実装は容易です。 <span lang="en" dir="ltr" class="mw-content-ltr">You should use the TranslationWebServiceException to signal errors.</span> エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 <span lang="en" dir="ltr" class="mw-content-ltr">The suggestions will automatically be displayed in the translation editor via the MachineTranslationAid class and the ApiQueryTranslationAids WebAPI module.</span> これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=<span lang="en" dir="ltr" class="mw-content-ltr">How to define checkers for file based message groups</span>}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は特定のメッセージグループ一覧にアクセスできるようにします。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これはメッセージを集めたグループを含む集約グループが異なる名前空間に作成されないよう予防します。 以下の短い例ではフィンランド語の翻訳を使って、メッセージ集をどのように使うと''core'' というグループの対訳を抽出して冒頭の10件をプリントする方法を示します。 <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 <span lang="en" dir="ltr" class="mw-content-ltr">To solve this problem, the FCFontFinder class was written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It uses the <code>fc-match</code> command of the package <code>fontconfig</code> (so this doesn't work on Windows) to find a suitable font.</span> これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === <span lang="en" dir="ltr" class="mw-content-ltr">The messages of file-based message groups are stored in CDB files.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each language of each group has its own CDB cache file.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] p02z54nlod7wlq4ximnkgo274uywayj 8364829 8364827 2026-05-04T02:32:48Z Shirayuki 472859 Created page with "エラーを通知するには、$1 を使用してください。" 8364829 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 Translate にメッセージ群を登録する主な方法は、{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} フックと {{ll|Help:Extension:Translate/Group configuration example|YAML 設定}}の 2 つです。 <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''{{ll|Help:Extension:Translate/Translation aids|翻訳支援}}に関する詳細な説明文書'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 TranslationAid クラスを継承する各クラスは、getData という名前の 1 つのメソッドのみを実装する必要があります。 これは構造化形式 (入れ子の配列) で情報を返し、その後 ApiQueryTranslationAids Web API モジュールを通じて公開される必要があります。 ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === 追加の機械翻訳サービスは、<code>TranslationWebService</code> クラスを継承することで簡単に追加できます。 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか この情報があれば、<code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> メソッドの実装は容易です。 エラーを通知するには、TranslationWebServiceException を使用してください。 エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 <span lang="en" dir="ltr" class="mw-content-ltr">The suggestions will automatically be displayed in the translation editor via the MachineTranslationAid class and the ApiQueryTranslationAids WebAPI module.</span> これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=<span lang="en" dir="ltr" class="mw-content-ltr">How to define checkers for file based message groups</span>}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は特定のメッセージグループ一覧にアクセスできるようにします。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これはメッセージを集めたグループを含む集約グループが異なる名前空間に作成されないよう予防します。 以下の短い例ではフィンランド語の翻訳を使って、メッセージ集をどのように使うと''core'' というグループの対訳を抽出して冒頭の10件をプリントする方法を示します。 <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 <span lang="en" dir="ltr" class="mw-content-ltr">To solve this problem, the FCFontFinder class was written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It uses the <code>fc-match</code> command of the package <code>fontconfig</code> (so this doesn't work on Windows) to find a suitable font.</span> これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === <span lang="en" dir="ltr" class="mw-content-ltr">The messages of file-based message groups are stored in CDB files.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each language of each group has its own CDB cache file.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] 7rtm4kx6j6z4ylutjis8f3qtdmwpnmm 8364831 8364829 2026-05-04T02:33:20Z Shirayuki 472859 Created page with "提案は、$1 クラスと $2 WebAPI モジュールを通じて翻訳エディターに自動的に表示されます。" 8364831 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 Translate にメッセージ群を登録する主な方法は、{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} フックと {{ll|Help:Extension:Translate/Group configuration example|YAML 設定}}の 2 つです。 <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''{{ll|Help:Extension:Translate/Translation aids|翻訳支援}}に関する詳細な説明文書'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 TranslationAid クラスを継承する各クラスは、getData という名前の 1 つのメソッドのみを実装する必要があります。 これは構造化形式 (入れ子の配列) で情報を返し、その後 ApiQueryTranslationAids Web API モジュールを通じて公開される必要があります。 ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === 追加の機械翻訳サービスは、<code>TranslationWebService</code> クラスを継承することで簡単に追加できます。 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか この情報があれば、<code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> メソッドの実装は容易です。 エラーを通知するには、TranslationWebServiceException を使用してください。 エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 提案は、MachineTranslationAid クラスと ApiQueryTranslationAids WebAPI モジュールを通じて翻訳エディターに自動的に表示されます。 これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=<span lang="en" dir="ltr" class="mw-content-ltr">How to define checkers for file based message groups</span>}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は特定のメッセージグループ一覧にアクセスできるようにします。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これはメッセージを集めたグループを含む集約グループが異なる名前空間に作成されないよう予防します。 以下の短い例ではフィンランド語の翻訳を使って、メッセージ集をどのように使うと''core'' というグループの対訳を抽出して冒頭の10件をプリントする方法を示します。 <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 <span lang="en" dir="ltr" class="mw-content-ltr">To solve this problem, the FCFontFinder class was written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It uses the <code>fc-match</code> command of the package <code>fontconfig</code> (so this doesn't work on Windows) to find a suitable font.</span> これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === <span lang="en" dir="ltr" class="mw-content-ltr">The messages of file-based message groups are stored in CDB files.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each language of each group has its own CDB cache file.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] idgis1n246ddasnfmn71cyrho9iw60t 8364833 8364831 2026-05-04T02:34:23Z Shirayuki 472859 Created page with "ファイル ベースのメッセージ群のチェッカーの定義方法" 8364833 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 Translate にメッセージ群を登録する主な方法は、{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} フックと {{ll|Help:Extension:Translate/Group configuration example|YAML 設定}}の 2 つです。 <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''{{ll|Help:Extension:Translate/Translation aids|翻訳支援}}に関する詳細な説明文書'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 TranslationAid クラスを継承する各クラスは、getData という名前の 1 つのメソッドのみを実装する必要があります。 これは構造化形式 (入れ子の配列) で情報を返し、その後 ApiQueryTranslationAids Web API モジュールを通じて公開される必要があります。 ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === 追加の機械翻訳サービスは、<code>TranslationWebService</code> クラスを継承することで簡単に追加できます。 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか この情報があれば、<code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> メソッドの実装は容易です。 エラーを通知するには、TranslationWebServiceException を使用してください。 エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 提案は、MachineTranslationAid クラスと ApiQueryTranslationAids WebAPI モジュールを通じて翻訳エディターに自動的に表示されます。 これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=ファイル ベースのメッセージ群のチェッカーの定義方法}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は特定のメッセージグループ一覧にアクセスできるようにします。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これはメッセージを集めたグループを含む集約グループが異なる名前空間に作成されないよう予防します。 以下の短い例ではフィンランド語の翻訳を使って、メッセージ集をどのように使うと''core'' というグループの対訳を抽出して冒頭の10件をプリントする方法を示します。 <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 <span lang="en" dir="ltr" class="mw-content-ltr">To solve this problem, the FCFontFinder class was written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It uses the <code>fc-match</code> command of the package <code>fontconfig</code> (so this doesn't work on Windows) to find a suitable font.</span> これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === <span lang="en" dir="ltr" class="mw-content-ltr">The messages of file-based message groups are stored in CDB files.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each language of each group has its own CDB cache file.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] lus57lv5dy5q5tgvt2dx49wel1z5190 8364835 8364833 2026-05-04T02:35:08Z Shirayuki 472859 Created page with "この問題を解決するために、$1 クラスが作成されました。" 8364835 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 Translate にメッセージ群を登録する主な方法は、{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} フックと {{ll|Help:Extension:Translate/Group configuration example|YAML 設定}}の 2 つです。 <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''{{ll|Help:Extension:Translate/Translation aids|翻訳支援}}に関する詳細な説明文書'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 TranslationAid クラスを継承する各クラスは、getData という名前の 1 つのメソッドのみを実装する必要があります。 これは構造化形式 (入れ子の配列) で情報を返し、その後 ApiQueryTranslationAids Web API モジュールを通じて公開される必要があります。 ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === 追加の機械翻訳サービスは、<code>TranslationWebService</code> クラスを継承することで簡単に追加できます。 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか この情報があれば、<code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> メソッドの実装は容易です。 エラーを通知するには、TranslationWebServiceException を使用してください。 エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 提案は、MachineTranslationAid クラスと ApiQueryTranslationAids WebAPI モジュールを通じて翻訳エディターに自動的に表示されます。 これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=ファイル ベースのメッセージ群のチェッカーの定義方法}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は特定のメッセージグループ一覧にアクセスできるようにします。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これはメッセージを集めたグループを含む集約グループが異なる名前空間に作成されないよう予防します。 以下の短い例ではフィンランド語の翻訳を使って、メッセージ集をどのように使うと''core'' というグループの対訳を抽出して冒頭の10件をプリントする方法を示します。 <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 この問題を解決するために、FCFontFinder クラスが作成されました。 <span lang="en" dir="ltr" class="mw-content-ltr">It uses the <code>fc-match</code> command of the package <code>fontconfig</code> (so this doesn't work on Windows) to find a suitable font.</span> これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === <span lang="en" dir="ltr" class="mw-content-ltr">The messages of file-based message groups are stored in CDB files.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each language of each group has its own CDB cache file.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] duqexbzyy42fzy80rlaj94p3cnh6grb 8364837 8364835 2026-05-04T02:35:40Z Shirayuki 472859 Created page with "適切なフォントを見つけるために、パッケージ $2 の $1 コマンドを使用します (そのため、Windows では動作しません)。" 8364837 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 Translate にメッセージ群を登録する主な方法は、{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} フックと {{ll|Help:Extension:Translate/Group configuration example|YAML 設定}}の 2 つです。 <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''{{ll|Help:Extension:Translate/Translation aids|翻訳支援}}に関する詳細な説明文書'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 TranslationAid クラスを継承する各クラスは、getData という名前の 1 つのメソッドのみを実装する必要があります。 これは構造化形式 (入れ子の配列) で情報を返し、その後 ApiQueryTranslationAids Web API モジュールを通じて公開される必要があります。 ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === 追加の機械翻訳サービスは、<code>TranslationWebService</code> クラスを継承することで簡単に追加できます。 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか この情報があれば、<code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> メソッドの実装は容易です。 エラーを通知するには、TranslationWebServiceException を使用してください。 エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 提案は、MachineTranslationAid クラスと ApiQueryTranslationAids WebAPI モジュールを通じて翻訳エディターに自動的に表示されます。 これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=ファイル ベースのメッセージ群のチェッカーの定義方法}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は特定のメッセージグループ一覧にアクセスできるようにします。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これはメッセージを集めたグループを含む集約グループが異なる名前空間に作成されないよう予防します。 以下の短い例ではフィンランド語の翻訳を使って、メッセージ集をどのように使うと''core'' というグループの対訳を抽出して冒頭の10件をプリントする方法を示します。 <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 この問題を解決するために、FCFontFinder クラスが作成されました。 適切なフォントを見つけるために、パッケージ <code>fontconfig</code> の <code>fc-match</code> コマンドを使用します (そのため、Windows では動作しません)。 これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === <span lang="en" dir="ltr" class="mw-content-ltr">The messages of file-based message groups are stored in CDB files.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each language of each group has its own CDB cache file.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] 4stj8d10wlsyjammbmk3bn6qpyzbi4t 8364839 8364837 2026-05-04T02:39:20Z Shirayuki 472859 fix 8364839 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 Translate にメッセージ群を登録する主な方法は、{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} フックと {{ll|Help:Extension:Translate/Group configuration example|YAML 設定}}の 2 つです。 <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''{{ll|Help:Extension:Translate/Translation aids|翻訳支援}}に関する詳細な説明文書'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 TranslationAid クラスを継承する各クラスは、getData という名前の 1 つのメソッドのみを実装する必要があります。 これは構造化形式 (入れ子の配列) で情報を返し、その後 ApiQueryTranslationAids Web API モジュールを通じて公開される必要があります。 ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === 追加の機械翻訳サービスは、<code>TranslationWebService</code> クラスを継承することで簡単に追加できます。 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか この情報があれば、<code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> メソッドの実装は容易です。 エラーを通知するには、TranslationWebServiceException を使用してください。 エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 提案は、MachineTranslationAid クラスと ApiQueryTranslationAids WebAPI モジュールを通じて翻訳エディターに自動的に表示されます。 これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=ファイル ベースのメッセージ群のチェッカーの定義方法}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は、メッセージ群のメッセージ一覧へのアクセスを提供します。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これはメッセージを集めたグループを含む集約グループが異なる名前空間に作成されないよう予防します。 以下の短い例ではフィンランド語の翻訳を使って、メッセージ集をどのように使うと''core'' というグループの対訳を抽出して冒頭の10件をプリントする方法を示します。 <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 この問題を解決するために、FCFontFinder クラスが作成されました。 適切なフォントを見つけるために、パッケージ <code>fontconfig</code> の <code>fc-match</code> コマンドを使用します (そのため、Windows では動作しません)。 これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === <span lang="en" dir="ltr" class="mw-content-ltr">The messages of file-based message groups are stored in CDB files.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each language of each group has its own CDB cache file.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] 41rlx97z2t55n7uyqmwgilcmxf5hhq2 8364841 8364839 2026-05-04T02:41:36Z Shirayuki 472859 8364841 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 Translate にメッセージ群を登録する主な方法は、{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} フックと {{ll|Help:Extension:Translate/Group configuration example|YAML 設定}}の 2 つです。 <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''{{ll|Help:Extension:Translate/Translation aids|翻訳支援}}に関する詳細な説明文書'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 TranslationAid クラスを継承する各クラスは、getData という名前の 1 つのメソッドのみを実装する必要があります。 これは構造化形式 (入れ子の配列) で情報を返し、その後 ApiQueryTranslationAids Web API モジュールを通じて公開される必要があります。 ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === 追加の機械翻訳サービスは、<code>TranslationWebService</code> クラスを継承することで簡単に追加できます。 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか この情報があれば、<code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> メソッドの実装は容易です。 エラーを通知するには、TranslationWebServiceException を使用してください。 エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 提案は、MachineTranslationAid クラスと ApiQueryTranslationAids WebAPI モジュールを通じて翻訳エディターに自動的に表示されます。 これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=ファイル ベースのメッセージ群のチェッカーの定義方法}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は、メッセージ群のメッセージ一覧へのアクセスを提供します。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これにより、異なる名前空間にメッセージを持つメッセージ群を含む集約群の作成が防止されます。 以下の短い例ではフィンランド語の翻訳を使って、メッセージ集をどのように使うと''core'' というグループの対訳を抽出して冒頭の10件をプリントする方法を示します。 <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 この問題を解決するために、FCFontFinder クラスが作成されました。 適切なフォントを見つけるために、パッケージ <code>fontconfig</code> の <code>fc-match</code> コマンドを使用します (そのため、Windows では動作しません)。 これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === <span lang="en" dir="ltr" class="mw-content-ltr">The messages of file-based message groups are stored in CDB files.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Each language of each group has its own CDB cache file.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] gtlwg5a2rgc7a9v9df2k76v0niu1v6q 8364843 8364841 2026-05-04T02:44:16Z Shirayuki 472859 Created page with "ファイル ベースのメッセージ群のメッセージは、CDB ファイルに格納されます。" 8364843 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 Translate にメッセージ群を登録する主な方法は、{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} フックと {{ll|Help:Extension:Translate/Group configuration example|YAML 設定}}の 2 つです。 <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''{{ll|Help:Extension:Translate/Translation aids|翻訳支援}}に関する詳細な説明文書'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 TranslationAid クラスを継承する各クラスは、getData という名前の 1 つのメソッドのみを実装する必要があります。 これは構造化形式 (入れ子の配列) で情報を返し、その後 ApiQueryTranslationAids Web API モジュールを通じて公開される必要があります。 ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === 追加の機械翻訳サービスは、<code>TranslationWebService</code> クラスを継承することで簡単に追加できます。 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか この情報があれば、<code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> メソッドの実装は容易です。 エラーを通知するには、TranslationWebServiceException を使用してください。 エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 提案は、MachineTranslationAid クラスと ApiQueryTranslationAids WebAPI モジュールを通じて翻訳エディターに自動的に表示されます。 これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=ファイル ベースのメッセージ群のチェッカーの定義方法}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は、メッセージ群のメッセージ一覧へのアクセスを提供します。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これにより、異なる名前空間にメッセージを持つメッセージ群を含む集約群の作成が防止されます。 以下の短い例ではフィンランド語の翻訳を使って、メッセージ集をどのように使うと''core'' というグループの対訳を抽出して冒頭の10件をプリントする方法を示します。 <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 この問題を解決するために、FCFontFinder クラスが作成されました。 適切なフォントを見つけるために、パッケージ <code>fontconfig</code> の <code>fc-match</code> コマンドを使用します (そのため、Windows では動作しません)。 これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === ファイル ベースのメッセージ群のメッセージは、CDB ファイルに格納されます。 <span lang="en" dir="ltr" class="mw-content-ltr">Each language of each group has its own CDB cache file.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] n5dwd64zprcdci1i7fr6ff30z2n4f7g 8364845 8364843 2026-05-04T02:51:53Z Shirayuki 472859 Created page with "ファイル ベースのメッセージ群のメッセージは、CDB ファイルに格納されます。" 8364845 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 Translate にメッセージ群を登録する主な方法は、{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} フックと {{ll|Help:Extension:Translate/Group configuration example|YAML 設定}}の 2 つです。 <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''{{ll|Help:Extension:Translate/Translation aids|翻訳支援}}に関する詳細な説明文書'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 TranslationAid クラスを継承する各クラスは、getData という名前の 1 つのメソッドのみを実装する必要があります。 これは構造化形式 (入れ子の配列) で情報を返し、その後 ApiQueryTranslationAids Web API モジュールを通じて公開される必要があります。 ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === 追加の機械翻訳サービスは、<code>TranslationWebService</code> クラスを継承することで簡単に追加できます。 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか この情報があれば、<code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> メソッドの実装は容易です。 エラーを通知するには、TranslationWebServiceException を使用してください。 エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 提案は、MachineTranslationAid クラスと ApiQueryTranslationAids WebAPI モジュールを通じて翻訳エディターに自動的に表示されます。 これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=ファイル ベースのメッセージ群のチェッカーの定義方法}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は、メッセージ群のメッセージ一覧へのアクセスを提供します。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これにより、異なる名前空間にメッセージを持つメッセージ群を含む集約群の作成が防止されます。 以下の短い例ではフィンランド語の翻訳を使って、メッセージ集をどのように使うと''core'' というグループの対訳を抽出して冒頭の10件をプリントする方法を示します。 <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 この問題を解決するために、FCFontFinder クラスが作成されました。 適切なフォントを見つけるために、パッケージ <code>fontconfig</code> の <code>fc-match</code> コマンドを使用します (そのため、Windows では動作しません)。 これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === ファイル ベースのメッセージ群のメッセージは、CDB ファイルに格納されます。 ファイル ベースのメッセージ群のメッセージは、CDB ファイルに格納されます。 <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] qoqzmdi00wxt5yu7xzc14sgz0dumkjq 8364847 8364845 2026-05-04T02:53:16Z Shirayuki 472859 fix 8364847 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳拡張機能はさまざまな面で拡張が可能です。 翻訳の拡張とは、おそらく新規のファイル形式への対応 (節単位のリンク) あるいは新規のメッセージ群 (節単位のリンク) が最も多用されます。 ときには新しくへのリンクを作るため、メッセージチェックまたはフックからコンテンツ翻訳拡張機能を伸ばす方が便利なこともあります。 場合によっては既存の{{ll|Help:Extension:Translate/API#Web-API|web API}}の利用によってのみ利用できる状況があります。 前述の原理のほか、翻訳拡張機能には重要な原理やクラスが多く備わり、翻訳拡張機能のハッキングの際に利用できます。 このページでは翻訳拡張機能の構成要素をすべてわかりやすく解説します。 <span id="Primary_extensible_components"></span> == 拡張可能なプライマリの構成要素 == === WebAPI === * [[Special:MyLanguage/Help:Extension:Translate/API|API]]に関する詳細な解説文書 PHP コード上でのみ利用できるフックやインターフェイスに加え、WebAPI も多くのメッセージ群にアクセスして関連の情報や動作を翻訳できます。 [[Special:MyLanguage/API:Main page|MediaWiki API フレームワーク]]に基づき、json や xmlなど複数の出力形式に対応します。 <span id="File_format_support_(FFS)"></span> === ファイル形式対応 (FFS) === * ''[[Special:MyLanguage/Help:Extension:Translate/File format support|ファイル形式対応]]の詳細まで解説する文書'' 翻訳拡張機能を使うと、ウィキ形式ではないコンテンツの翻訳に使え、たとえばソフトウェアのUIメッセージを処理するにはファイル形式対応 (FFS) のクラスを使います。 これらのクラスはFFSインターフェイスを実装し、ファイルコンテンツの解析と生成を抽象化します。 FFS クラスは[[Special:MyLanguage/Help:Extension:Translate/Group configuration|YAML 設定ファイル]]によりFileBasedMessageGroupクラスに充当されます。 <span id="Message_groups"></span> === メッセージ群 === * ''{{ll|Help:Extension:Translate/Message groups|メッセージ群}}に関する詳細な説明文書'' メッセージ群はメッセージ集をまとめます。 さまざまなタイプがあり、翻訳対象ページ、SVG ファイル、ソフトウェアが発するインタフェースメッセージなど、保存してあるファイル形式もさまざまです。 それぞれのメッセージ集インスタンスには固有の識別子と名称、説明を振ってあります。 コード メッセージ群内はまず識別子を使って参照するところ、与えられた ID に対応する例を得るには <code>MessageGroups</code> クラスを使ってください。 メッセージ集はまた翻訳プロセス関連の多くの動作をコントロールしており、対訳を認める言語類、メッセージ集ワークフローの状態などです。 通常、これらの挙動はグローバルな既定にフォールバックさせます。 Translate にメッセージ群を登録する主な方法は、{{ll|Help:Extension:Translate/Hooks|TranslatePostInitGroups}} フックと {{ll|Help:Extension:Translate/Group configuration example|YAML 設定}}の 2 つです。 <span id="Translation_aids_(helpers)"></span> === 翻訳補助 (ヘルパー機能) === * ''{{ll|Help:Extension:Translate/Translation aids|翻訳支援}}に関する詳細な説明文書'' 翻訳補助とは小さなモジュールで作業中に翻訳者に必要で役立つ情報を表示します。 ヘルパー機能ごとに翻訳メモリや機械翻訳の訳文の候補、メッセージに関する説明文、あるいはメッセージの定義などの基礎情報 – 翻訳対象のテキストを示します。 翻訳にはさまざまなヘルプ機能のクラスが伴います。 新しいクラスを追加するフックは現状では提供されません。 TranslationAid クラスを継承する各クラスは、getData という名前の 1 つのメソッドのみを実装する必要があります。 これは構造化形式 (入れ子の配列) で情報を返し、その後 ApiQueryTranslationAids Web API モジュールを通じて公開される必要があります。 ヘルプ機能のクラスの他、提供するデータを翻訳エディタ類で使えるようにするには、変更が必要です。 翻訳補助の特殊な事例として機械翻訳サービスがあります。 次の見出しをご参照ください。 <span id="Web_services"></span> === ウェブサービス === 追加の機械翻訳サービスは、<code>TranslationWebService</code> クラスを継承することで簡単に追加できます。 例を見るにはウェブサービスのサブディレクトリを参照。 次のようなクラスの実装には、特定の基本情報が必要です。 * サービスの URL * 対応する言語ペアの一覧 * MediaWiki で採用する言語コードと異なる独自のコードを使うかどうか * API キーが必要なサービスかどうか この情報があれば、<code>mapCode</code>, <code>doPairs</code>, <code>doRequest</code> メソッドの実装は容易です。 エラーを通知するには、TranslationWebServiceException を使用してください。 エラーは自動でログに残して追跡し、サービスがダウンすると自動的に停止して不要なリクエスト送付を予防します。 提案は、MachineTranslationAid クラスと ApiQueryTranslationAids WebAPI モジュールを通じて翻訳エディターに自動的に表示されます。 これらサービスのレジストリを閲覧するには、$wgTranslateTranslationServicesを参照してください。 <span id="Message_checkers"></span> === メッセージ チェッカー === * ''{{ll|Help:Extension:Translate/Group configuration|2=ファイル ベースのメッセージ群のチェッカーの定義方法}}'' 翻訳の単純な間違いはパソコンで拾い出し、たとえばカッコのペアの過不足、必要なプレースホルダの欠落の検出などです。 これらのチェック機能は警告を発して翻訳エディタに表示されます(常に更新)。 保存した翻訳内に表示される警告もまた、その訳文を古いとマークします(特殊用語で fuzzy)。 メッセージ集単位でどのチェックを採用するか決まります。 <span id="Other_core_components"></span> == その他の構成要素 == <span id="Message_collection"></span> === メッセージ集 === メッセージ集は、メッセージ群のメッセージ一覧へのアクセスを提供します。 特定の言語内の特定の言語群を読み込むために使います。 機能としてページ割と絞り込みができます。 現状の制約として特定のコレクションに属するメッセージ集は同じ名前空間に配置しなければなりません。 これにより、異なる名前空間にメッセージを持つメッセージ群を含む集約群の作成が防止されます。 以下は、メッセージ集を使用してメッセージ群 ''core'' のフィンランド語のすべての翻訳を読み込み、そのうち最初の 10 件を出力する方法の短い例です: <syntaxhighlight lang=php> $group = MessageGroups::getGroup( 'core' ); $collection = $group->initCollection( 'fi' ); $collection->filter( 'ignored' ); $collection->filter( 'translated', false ); $collection->loadTranslations(); $collection->slice( 0, 10 ); foreach ( $collection->keys() as $mkey => $title ) { echo $title->getPrefixedText() . ': '; echo $collection[$mkey]->translation() . "\n\n"; } </syntaxhighlight> <span id="Message"></span> === メッセージ === <span id="Utility_classes"></span> == ユーティリティのクラス == <span id="Font_finder"></span> === フォントの検索 === ビットマップ画像をレンダ処理するとき、それぞれの言語もしくはスクリプトに最適なフォントが必要です。 この問題を解決するために、FCFontFinder クラスが作成されました。 適切なフォントを見つけるために、パッケージ <code>fontconfig</code> の <code>fc-match</code> コマンドを使用します (そのため、Windows では動作しません)。 これを有効に働かせるには、サーバに多くのその他のフォントを積まなければなりません。 返し値はフォントファイルへのパスもしくはフォント名を選択できます。 <span id="Message_group_cache"></span> === メッセージ群のキャッシュ === ファイル ベースのメッセージ群のメッセージは、CDB ファイルに格納されます。 ファイル ベースのメッセージ群のメッセージは、CDB ファイルに格納されます。 <span lang="en" dir="ltr" class="mw-content-ltr">The reason for cache files are twofold.</span> <span lang="en" dir="ltr" class="mw-content-ltr">First they provide constant and efficient access to message data avoiding the potentially expensive parsing of files in various places.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the list of message keys for each group can be loaded efficiently when rebuilding a message index.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The second reason is that the cache files are used together with the translations in the wiki to process external message changes.</span> 翻訳の状態のスナップショットをファイルとウィキに保持することで(その時点で一貫していることを期待して)、ウィキ内または外部で何かが変更されたかを自動的に判断し、賢明な選択を行うことができます。これにより、実際の競合(前回のスナップショットからウィキと外部の両方で変更されたメッセージ)のみが翻訳管理者によって解決されることになります。 <span id="Message_group_utilities"></span> === メッセージ群のユーティリティ === <span id="Message_index"></span> === メッセージの索引 === メッセージの索引は既存のメッセージ群のマッピングを逆引き。 <span lang="en" dir="ltr" class="mw-content-ltr">It provides efficient answer to the questions ''is this a known message'' and ''what groups does this message belong to''.</span> メッセージキーの検索を1件でも複数県でも素早く実行します。 種類の異なるバックエンドが複数実行され、それぞれに一長一短があります。 * ファイルをシリアル化しておくと解析が迅速ですが、出力にはランダムなアクセスができないし、キーの件数が増えるとメモリにとって非効率です。 * CDB ファイルはディスク空間を多く使いますが、ランダムなアクセスができて比較的迅速に検索でき、代わりにメモリに全て読み込むのに時間を食います。 * データベースのバックエンドは個別の検索がやや遅くなるという代償を伴いますが、効率的なランダムアクセスと全件読み込みを提供します。 <span lang="en" dir="ltr" class="mw-content-ltr">It also doesn't need to write to any files avoiding any permission problems.</span> * またメモリのバックエンド (memcached, apc) を提供、データベースの容量節約に使える代替手段として、複数サーバ構築のデータベースのバックエンドで有効な場合があります。 メッセージの検索は累積的なリビルドに対応しません。 <span lang="en" dir="ltr" class="mw-content-ltr">Thus rebuilding the index gets relatively resource intensive when the number of message groups and message keys increase.</span> メッセージ群によって、これはファイルのパーサ処理もしくはデータベースのクエリをしてから定義の読み込みを伴うことがあり、メモリをかなり消費します。 <span lang="en" dir="ltr" class="mw-content-ltr">The message index rebuilding is triggered in various places in Translate, and by default it is executed immediately during the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">As it gets slower, it can be delayed via the MediaWiki job queue and run outside of web requests.</span> <span id="Message_table"></span> === メッセージ === {{todo}} <span id="Metadata_table"></span> === メタデータ === {{todo}} === Revtag === {{todo}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Stats code === </div> {{todo}} <span id="String_matcher/mangler"></span> === 文字列対照/並べ替え === {{todo}} <span id="Ttmserver_(translation_memory)"></span> === Ttmserver (翻訳メモリ) === * ''<span lang="en" dir="ltr" class="mw-content-ltr">In-depth documentation at {{ll|Help:Extension:Translate/Translation_memories|Translation memories}}.</span>'' * ''この機能の変更履歴は [http://laxstrom.name/blag/2012/09/07/translation-memory-all-wikimedia-wikis/ Niklas' blog](ニクラのブログ)の投稿で読めます。'' 翻訳メモリのインタフェースを Ttmserver と呼びます。 翻訳提案のクエリや挿入について複数のバックエンドに対応します。 <span lang="en" dir="ltr" class="mw-content-ltr">The code is located under <code>ttmserver</code> directory.</span> <span id="Misc_stuff:_RC_integration,_preferences,_toolbox,_jobs"></span> === その他:RC 統合、設定、ツールボックス、ジョブ類 === {{todo}} <span id="Repository_layout"></span> == リポジトリの配置 == リポジトリのルートに格納したファイルは以下のとおりです。 * <span lang="en" dir="ltr" class="mw-content-ltr">Standard MediaWiki extensions files like <code>Translate.php</code>, translations and some documentation files like <code>hooks.txt</code> and <code>README</code> which includes change notes.</span> * ユーティリティ配下に移動が済んでいないものには主要な翻訳クラスとして<code>MessageCollection</code>や<code>Message</code>と、その他の小規模なユーティリティなどがあります。 コードの大部分はサブディレクトリに格納。 主なパーツには独自のサブディレクトリが伴います。 * <code>api</code> – WebAPI コード用 * <code>ffs</code> – ファイル形式をサポートするコード * <code>messagegroups</code> – メッセージ群用 * <code>scripts</code> – コマンドラインの文用 * <code>tag</code> – ページ翻訳のコード用 * <code>ttmserver</code> – 翻訳メモリのコード用 * <code>specials</code> – 特別ページ全て * <code>tests</code> – PHP ユニットテスト全般に対応 コードの大部分はユーティリティファイル内。 コード以外のための追加フォルダ: * <code>data</code> – その他の種類のデータファイル * <code>libs</code> – 同梱のライブラリに依存 * <code>resources</code> – css、スクリプト、画像全て * <code>sql</code> – SQL テーブルの定義全て [[Category:Extension:Translate{{#translation:}}]] m3c7pftntm3e5x8d0v12cn1hcdl4fhw Talk:Reading/Web/Desktop Improvements 1 974037 8365109 8361539 2026-05-04T10:26:39Z Nikerabbit 24 /* When a language link is clicked.. */ Reply 8365109 wikitext text/x-wiki {{Reading/Web/Desktop Improvements/Header|1=[[File:Welcome in 21 languages.svg|class=skin-invert|220px|{{dir|{{pagelang}}|left|right}}|link=]]{{Reading/Web/Desktop Improvements/Talk page intro}}{{clear}}}}{{User:Dexbot/Archivebot |archive = Talk:Reading/Web/Desktop Improvements/Archive%(counter)s |algo = old(42d) |counter = 11 |maxarchivesize = 200K |minthreadstoarchive = 1 |minthreadsleft = 4 }} {{WMF present |1=EBlackorby-WMF|timezone_1=UTC-5/4|lang_1=en, es, ja, de<br>|photo_1=EBinParis.jpg |2=OVasileva (WMF)|timezone_2=UTC+1/2|lang_2=en, es, bg|photo_2=Vasileva, Olga January 2017.jpg }} {{Archive box| [[Talk:Reading/Web/Desktop Improvements/Archive1|Archive1]] · [[Talk:Reading/Web/Desktop Improvements/Archive2|Archive2]] · [[Talk:Reading/Web/Desktop Improvements/Archive3|Archive3]] · [[Talk:Reading/Web/Desktop Improvements/Archive4|Archive4]] · [[Talk:Reading/Web/Desktop Improvements/Archive5|Archive5]] · [[Talk:Reading/Web/Desktop Improvements/Archive6|Archive6]] · [[Talk:Reading/Web/Desktop Improvements/Archive7|Archive7]] · [[Talk:Reading/Web/Desktop Improvements/Archive8|Archive8]] · [[Talk:Reading/Web/Desktop Improvements/Archive9|Archive9]] · [[Talk:Reading/Web/Desktop Improvements/Archive10|Archive10]] · [[Talk:Reading/Web/Desktop Improvements|Current discussion]] }} == Vector 2022 causes Preferences page to go dark mode == I am using MediaWiki version 1.43.5. We use Vector 2022 as the default skin. When I go to the Preferences page, it switches to dark mode ( I have the skin configured to use Light mode). It's not just me, this happens with every other user who is using the Vector 2022 skin + light mode. We only see this behavior with the Vector 2022 skin--the Vector Legacy (2010), Citizen, Monobook, and Timeless skins do not go to dark mode when the Preferences page is visited. I have made sure to use the latest download of the Vector skin. Any help in diagnosing and fixing this issue is appreciated! Thank you! [[User:Jbubz|Jbubz]] ([[User talk:Jbubz|talk]]) 00:46, 24 February 2026 (UTC) :@[[User:Jbubz|Jbubz]] This likely means that the server default for Vector is configured to use dark mode. When you are on preferences page (and login and create account), all user specific customizations get disabled and the page uses the server defaults. This is to avoid security problems and/or people locking themselves out of their accounts. —[[User:TheDJ|Th<span style="color: green">e</span>DJ (Not WMF)]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 12:52, 20 March 2026 (UTC) == Why isn't the Wikipedia 25th anniversary logo available in Vietnamese? == While languages like Chinese, English, and others are available, Vietnamese is not on Vector 2022 and 2010. [[User:Manhdeptraipro2114|Manhdeptraipro2114]] ([[User talk:Manhdeptraipro2114|talk]]) 10:36, 6 April 2026 (UTC) :Hello @[[User:Manhdeptraipro2114|Manhdeptraipro2114]] The Wikipedia 25th logo is not universally applied to every wiki. Each wiki community has the liberty to decide whether they want to and for how long they will display it. There was a [[:vi:Wikipedia:Thảo_luận/Lưu_119#Treo_logo_k%E1%BB%B7_ni%E1%BB%87m_25_n%C4%83m_Wikipedia|discussion on Vietnamese wiki about the 25th logo]]. If you wish to have the logo on Vietnamese wiki, the best thing to do is to talk to the community about this. Hope this helps! :[[User:IKristiani-WMF|IKristiani-WMF]] ([[User talk:IKristiani-WMF|talk]]) 05:53, 7 April 2026 (UTC) == When a language link is clicked.. == This is noticed on Telugu Wikipedia, on Windows 11, in Chrome browser Version 146.0.7680.178 (Official Build) (64-bit). When a language link is clicked with Control button pressed, the link opens in a new tab - as expected. But, simultaneously the link is opened in the current tab too, which is an unexpected behaviour. This has been noticed in the last two or three weeks. Please correct it so that the link opens ONLY in new tab. Thanks __ [[User:Chaduvari|Chaduvari]] ([[User talk:Chaduvari|talk]]) 13:46, 12 April 2026 (UTC) :You have most likely enabled the new language selector beta feature. Feel free to turn it off while we address this issue in the new version. [[User:Nikerabbit|Nikerabbit]] ([[User talk:Nikerabbit|talk]]) 06:46, 16 April 2026 (UTC) ::@[[User:Nikerabbit|Nikerabbit]], thank you. __ [[User:Chaduvari|Chaduvari]] ([[User talk:Chaduvari|talk]]) 19:02, 23 April 2026 (UTC) :::This issue has been fixed now in the new version. [[User:Nikerabbit|Nikerabbit]] ([[User talk:Nikerabbit|talk]]) 10:26, 4 May 2026 (UTC) == How do I amend the icons that appear in the top right corner? == I want to add/remove some of the icons in English Wikipedia. How do I do that? -[[User:Imcdc|Imcdc]] ([[User talk:Imcdc|talk]]) 15:39, 20 April 2026 (UTC) 00dfpjcptcozl2kegj0tb6ne1shn6j9 Extension:TimedMediaHandler/VideoJS Player/en 102 980471 8364353 8363682 2026-05-03T13:12:13Z FuzzyBot 451990 Updating to match new version of source page 8364353 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Screenshot of the VideoJS player in action]] The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. It is based on [https://videojs.com/ VideoJS], and has a modern, fast user interface with compatibility with mobile devices and HTML5. == Usage == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Example video player]] [[File:Armstrong Small Step.ogg|thumb|Example audio player]] There is both an audio and video player. You can find examples of both players on this page. Once launched you will see a control bar when interacting with the video. [[File:VideoJS controlbar.png|frameless|350px]] The controls in order from left to right are: <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;Play/pause control * [[File:VideoJS volume control.png|30px|]]&nbsp;Volume control * Playback position * Remaining playback time * [[File:VideoJS subtitle control.png|30px|]]&nbsp;Subtitle language selector and subtitle style controls * [[File:VideoJS resolution control.png|30px|]]&nbsp;Resolution selector * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;Optional Picture-in-Picture control * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;Fullscreen control * [[File:VideoJS file description control.png|30px|]]&nbsp;Info button to take you to the file description page === Mouse and keyboard controls === * Click the play icon above the thumbnail to begin playback of the media file. * Right click or middle click the thumbnail to open the file description page * Play/Pause the player with a single mouse click inside the player window * Double click the player window to enter or leave fullscreen mode * The following keyboard controls are available: *; {{Key press|k}} / {{Key press|Space}} : Play/pause the media playback *; {{Key press|f}} : Enter/Leave fullscreen *; {{Key press|m}} : Mute the audio *; {{Key press|c}} / {{Key press|s}} : Toggle subtitles on / off *; {{Key press|&lt;}} / {{Key press|&gt;}} : Decrease and increase playback speed *; {{Key press|←}} / {{Key press|→}} : Skip 5 seconds back / forward *; {{Key press|j}} / {{Key press|l}} : Skip 10 seconds back / forward *; {{Key press|Home}} / {{Key press|End}} : Skip to start / end of video *; {{Key press|,}} / {{Key press|.}} : When paused, skip 1 frame back or forward * The player is fully keyboard accessible using tab, enter and spacebar keys == Known issues == The video player is still in development, but if you find any problems, please report these on the [[Extension_talk:TimedMediaHandler/VideoJS Player|talk page]] or file them in [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. == Developers == Developers working on features that use the Video.js player will need to initialize and configure it appropriately. Below is an example of typical usage. === Basic Configuration Example === {{Note |1=This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback. |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS: <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> === Advanced configuration with Ogv.js support === If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler. Example configuration: <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> itsi5dd7hrpf96b1f4pnjd4x4wyys90 8364770 8364353 2026-05-03T23:14:38Z FuzzyBot 451990 Updating to match new version of source page 8364770 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Screenshot of the VideoJS player in action]] The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. It is based on [https://videojs.com/ VideoJS], and has a modern, fast user interface with compatibility with mobile devices and HTML5. == Usage == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Example video player]] [[File:Armstrong Small Step.ogg|thumb|Example audio player]] There is both an audio and video player. You can find examples of both players on this page. Once launched you will see a control bar when interacting with the video. [[File:VideoJS controlbar.png|frameless|350px]] The controls in order from left to right are: <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;Play/pause control * [[File:VideoJS volume control.png|30px|]]&nbsp;Volume control * Playback position * Remaining playback time * [[File:VideoJS subtitle control.png|30px|]]&nbsp;Subtitle language selector and subtitle style controls * [[File:VideoJS resolution control.png|30px|]]&nbsp;Resolution selector * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;Optional Picture-in-Picture control * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;Fullscreen control * [[File:VideoJS file description control.png|30px|]]&nbsp;Info button to take you to the file description page === Mouse and keyboard controls === * Click the play icon above the thumbnail to begin playback of the media file. * Right click or middle click the thumbnail to open the file description page * Play/Pause the player with a single mouse click inside the player window * Double click the player window to enter or leave fullscreen mode * The following keyboard controls are available: *; {{Key press|k}} / {{Key press|Space}} : Play/pause the media playback *; {{Key press|f}} : Enter/Leave fullscreen *; {{Key press|m}} : Mute the audio *; {{Key press|c}} / {{Key press|s}} : Toggle subtitles on / off *; {{Key press|&lt;}} / {{Key press|&gt;}} : Decrease and increase playback speed *; {{Key press|←}} / {{Key press|→}} : Skip 5 seconds back / forward *; {{Key press|j}} / {{Key press|l}} : Skip 10 seconds back / forward *; {{Key press|Home}} / {{Key press|End}} : Skip to start / end of video *; {{Key press|,}} / {{Key press|.}} : When paused, skip 1 frame back or forward * The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys == Known issues == The video player is still in development, but if you find any problems, please report these on the [[Extension_talk:TimedMediaHandler/VideoJS Player|talk page]] or file them in [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. == Developers == Developers working on features that use the Video.js player will need to initialize and configure it appropriately. Below is an example of typical usage. === Basic Configuration Example === {{Note|1=This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS: <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> === Advanced configuration with Ogv.js support === If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler. Example configuration: <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> aar8vbjah5kj2qrjpmskt5afrmzfz78 Extension:TimedMediaHandler/VideoJS Player/hu 102 980867 8364360 8363688 2026-05-03T13:12:16Z FuzzyBot 451990 Updating to match new version of source page 8364360 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Az új lejátszó képernyőképe működés közben]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> A [https://videojs.com/ VideoJS]-en alapul, és modernebb, gyorsabb felülete van, ami kompatibilis a mobileszközökkel és a HTML5-tel. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Példa videólejátszóra]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using tab, enter and spacebar keys</span> <span id="Known_issues"></span> == Ismert hibák == A videolejátszó még fejlesztés alatt áll, de ha bármilyen problémával találkozol, kérjük, jelentsd a [[Extension_talk:TimedMediaHandler/VideoJS Player|vitalapon]] vagy a [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricatorön]. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> bc4jqkshrin1b4f9jjl6g1vod8993zz 8364776 8364360 2026-05-03T23:14:41Z FuzzyBot 451990 Updating to match new version of source page 8364776 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Az új lejátszó képernyőképe működés közben]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> A [https://videojs.com/ VideoJS]-en alapul, és modernebb, gyorsabb felülete van, ami kompatibilis a mobileszközökkel és a HTML5-tel. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Példa videólejátszóra]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</span> <span id="Known_issues"></span> == Ismert hibák == A videolejátszó még fejlesztés alatt áll, de ha bármilyen problémával találkozol, kérjük, jelentsd a [[Extension_talk:TimedMediaHandler/VideoJS Player|vitalapon]] vagy a [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricatorön]. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 6yej2i32erq7jghzu2e8pc8jamjpdyl Template:Update/cs 10 987397 8364314 8364234 2026-05-03T12:46:59Z FuzzyBot 451990 Updating to match new version of source page 8364314 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |'''Věcná přesnost''' částí této stránky (těch souvisejících s {{{part|{{{1|}}}}}}) '''může být ohrožena kvůli zastaralým informacím'''. |Části této stránky (ty související s {{{part|{{{1|}}}}}}) jsou '''zastaralé'''.}} |{{#if:{{{inaccurate|}}} |'''Věcná přesnost''' této stránky '''může být ohrožena kvůli zastaralým informacím'''. |Tato stránka je '''zastaralá'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|Byla napsána pro starší verzi MediaWiki a nemusí se vztahovat na nejnovější verzi.}} Pokud jste zkontrolovali nebo aktualizovali tuto stránku a zjistili jste, že obsah je vhodný, odstraňte toto upozornění. {{#ifexist: {{TALKPAGENAME}} |&#32;Podívejte se na [[{{TALKPAGENAME}}|diskusní stránku]] pro možnou diskusi na toto téma. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Poslední aktualizace: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= Aliasy této šablony: * {{tlx|outdated}} <span id="Examples"></span> == Příklady == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == Související stránky == * {{tl|historical}} == TemplateData == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> 2oz7mzr6n927ot4nobdub4v34himh4e User talk:94rain 3 989552 8364864 8336705 2026-05-04T03:47:07Z 94rain 14443205 /* signup */ Reply 8364864 wikitext text/x-wiki Welcome to my talk page. If you have any questions, please feel free to start a new section. Thanks. == Global templates translation == Hi, I appreciate your support at [[Global templates/Discuss]]! I see in your userboxes that you are experienced with translation. If you have some time, it would be very nice if you could translate [[Global templates/Discuss|that page]] and also the [[Global templates/Proposed specification, short version|short version of the specification proposal]] to Chinese? Thanks! --[[User:Amire80|Amir E. Aharoni]] ([[User talk:Amire80|talk]]) 12:45, 22 December 2019 (UTC) :You did it! Thank you so much! --[[User:Amire80|Amir E. Aharoni]] ([[User talk:Amire80|talk]]) 12:55, 24 December 2019 (UTC) ::{{ping|Amire80}} No problem. I'm glad to do that. Thank you for preparing the proposal :) --<span style="text-shadow:0 1px 5px #99FFFF">[[User:94rain|<span style="color:#6495ED">94rain</span>]] [[User_talk:94rain|<sup style="color:gold">'''Talk'''</sup>]] </span> 13:56, 24 December 2019 (UTC) :Hi, :Can you please translate one more sentence at [[Global templates/Proposed specification, short version]]? Thanks :) --[[User:Amire80|Amir E. Aharoni]] &#123;{[[Global templates|🌎🌍🌏]]}} 14:08, 31 December 2019 (UTC) ::{{ping|Amire80}} I see that Techyan has already translated it. Best wishes for the new year! --<span style="text-shadow:0 1px 5px #99FFFF">[[User:94rain|<span style="color:#6495ED">94rain</span>]] [[User_talk:94rain|<sup style="color:gold">'''Talk'''</sup>]] </span> 02:33, 1 January 2020 (UTC) == Christmas cookies for you! == {| style="background-color: #fdffe7; border: 1px solid #fceb92;" |rowspan="2" style="vertical-align: middle; padding: 5px;" | [[File:Christmas Cookies Plateful.JPG|100px]] |style="font-size: x-large; padding: 3px 3px 0 3px; height: 1.5em;" | '''Thank you for your help''' |- |style="vertical-align: middle; padding: 3px;" | Thanks for your help with translations and your other contributions here at MediaWiki.org. I offer this plate of traditional American Christmas cookies to show my thanks. (The ones on the left, with the big [[w:Hershey's Kisses]] in the middle, might be the best, as long as you're not allergic to peanut butter!) [[User:Whatamidoing (WMF)|Whatamidoing (WMF)]] ([[User talk:Whatamidoing (WMF)|talk]]) 22:57, 27 December 2019 (UTC) |} :{{ping|Whatamidoing (WMF)}} Thanks! Wish you a happy new year. --<span style="text-shadow:0 1px 5px #99FFFF">[[User:94rain|<span style="color:#6495ED">94rain</span>]] [[User_talk:94rain|<sup style="color:gold">'''Talk'''</sup>]] </span> 03:38, 28 December 2019 (UTC) == Help wanted for global templates == You have shown support for global templates in the past. Staff of the Wikimedia Foundation view this change as big. We need to convince the Wikimedia Foundation to start working on this. We have to reassure them there is sufficient support by local project communities. You can help move this forward. Please do setup a page on the local projects you are (most) active on in the language of the project. Tell your fellow editors why you believe global templates are necessary. Follow the local project decision process to come to a discussion outcome as support or not. There is plenty of time for discussion. Please reach a conclusion before the end of April 2021. Please translate the coordinating page on meta to languages you are proficient in. [[:meta:Gathering support from local projects for global templates]] Please add a line to this meta page with a link to a discussion page on your local project(s). The goal is to have the Wikimedia Foundation include a program to develop infrastructure for global templates in their 2021/2022 Annual Plan. The Wikimedia Foundation will decide on the Annual Plan in May/June this year. The aim is to have several dozen local project communities to show support, and little concerns, issues or objections. Of course, any project can continue to use their local templates. When you have questions about this initiative you can reach me at ad{{@}}huikeshoven.org or + 31 6 40293574, and also on Telegram and Signal. You can also raise questions on the talk page on meta. Maybe some people would like to discuss this initiative in a meeting. Please let me know whether you would like to join a Zoom meeting in February. Regards, [[User:Ad Huikeshoven|Ad Huikeshoven]] ([[User talk:Ad Huikeshoven|talk]]) 12:07, 25 January 2021 (UTC) == Please delete my request page == Please delete [https://www.mediawiki.org/wiki/Project%3ASupport%20desk/Flow/2020/07#h-Please_help-2020-07-19T15%3A06%3A00.000Z].[[User:Gorning1|Gorning1]] ([[User talk:Gorning1|talk]]) 08:08, 25 May 2021 (UTC) *Hi Gorning1. Since there are other users that have commented, I feel it is inappropriate to delete the whole thread. You can simply leave it as it is. --<span style="text-shadow:0 1px 5px #99FFFF">[[User:94rain|<span style="color:#6495ED">94rain</span>]] [[User_talk:94rain|<sup style="color:gold">'''Talk'''</sup>]] </span> 08:19, 25 May 2021 (UTC) == Difficulty of connection == Hello, I should connect to Wikimedia office to fill out the form: [https://office.wikimedia.org/wiki/File:Expense_Reimbursement_Open_Office_Non_Employee_New_v1.3.ods|Expense Reimbursement]. But it doesn't work with my user account. So, I tried to reset the password and it didn't work. Please help me. Sincerely, [[User:Kitanago|Kitanago]] ([[User talk:Kitanago|Talk]]) 11:00, 05 August 2021 (UTC-4) == How we will see unregistered users == <section begin=content/> Hi! You get this message because you are an admin on a Wikimedia wiki. When someone edits a Wikimedia wiki without being logged in today, we show their IP address. As you may already know, we will not be able to do this in the future. This is a decision by the Wikimedia Foundation Legal department, because norms and regulations for privacy online have changed. Instead of the IP we will show a masked identity. You as an admin '''will still be able to access the IP'''. There will also be a new user right for those who need to see the full IPs of unregistered users to fight vandalism, harassment and spam without being admins. Patrollers will also see part of the IP even without this user right. We are also working on [[m:IP Editing: Privacy Enhancement and Abuse Mitigation/Improving tools|better tools]] to help. If you have not seen it before, you can [[m:IP Editing: Privacy Enhancement and Abuse Mitigation|read more on Meta]]. If you want to make sure you don’t miss technical changes on the Wikimedia wikis, you can [[m:Global message delivery/Targets/Tech ambassadors|subscribe]] to [[m:Tech/News|the weekly technical newsletter]]. We have [[m:IP Editing: Privacy Enhancement and Abuse Mitigation#IP Masking Implementation Approaches (FAQ)|two suggested ways]] this identity could work. '''We would appreciate your feedback''' on which way you think would work best for you and your wiki, now and in the future. You can [[m:Talk:IP Editing: Privacy Enhancement and Abuse Mitigation|let us know on the talk page]]. You can write in your language. The suggestions were posted in October and we will decide after 17 January. Thank you. /[[m:User:Johan (WMF)|Johan (WMF)]]<section end=content/> 18:17, 4 January 2022 (UTC) <!-- Message sent by User:Johan (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:Johan_(WMF)/Target_lists/Admins2022(5)&oldid=22532651 --> == Please redirect "MediaWiki/zh-cn" to "MediaWiki/zh-hans" == Please redirect [[MediaWiki/zh-cn]] to [[MediaWiki/zh-hans]], they are meant to be the same page. [[Special:Contributions/122.100.75.52|122.100.75.52]] 07:47, 13 April 2023 (UTC) :Redirected. It makes no difference though. Sorry for the late response. I encourage you to create an account. After 4 days you should be able to edit semi-protected pages directly. <span style="text-shadow:0 1px 5px #99FFFF">[[User:94rain|<span style="color:#6495ED">94rain</span>]] [[User_talk:94rain|<sup style="color:gold">'''Talk'''</sup>]] </span> 20:44, 25 December 2023 (UTC) == signup == <nowiki>I am trying to create an account/migrate my account but I am stuck on the anti-abuse throttle error. Can an admin help whitelist my IP or manually create the account? ~~~~</nowiki> [[Special:Contributions/&#126;2026-22299-61|&#126;2026-22299-61]] ([[User talk:&#126;2026-22299-61|talk]]) 21:29, 11 April 2026 (UTC) :Could you check out [[:en:Wikipedia:Request_an_account]]? After creating an account on Wikipedia, you should be able to log in to this site as well. If you still have the problem, feel free to message me again. <span style="text-shadow:0 1px 5px #99FFFF">[[User:94rain|<span style="color:#6495ED">94rain</span>]] [[User_talk:94rain|<sup style="color:gold">'''Talk'''</sup>]] </span> 03:47, 4 May 2026 (UTC) msdrtoaxho0z0rmp2e9frubdmjzv09g Extension:TimedMediaHandler/VideoJS Player/ja 102 990052 8364362 8363690 2026-05-03T13:12:17Z FuzzyBot 451990 Updating to match new version of source page 8364362 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|VideoJS プレーヤーが作動中のスクリーンショット]] '''VideoJS Player''' は、ウィキメディアのプロジェクト群における MediaWiki 向けの動画プレーヤーです。 [https://videojs.com/ VideoJS]をベースに、モバイル端末や HTML5 に対応した、現代風の高速なユーザーインターフェイスを実装しています。 <span id="Usage"></span> == 使用法 == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|動画プレーヤーの例]] [[File:Armstrong Small Step.ogg|thumb|音声プレーヤーの例]] 音声のみと映像の双方に対応したプレーヤーです。 このページで双方のプレーヤーを例示してご覧いただけます。 ひとたび起動すると、映像に連動する操作用バーが眼に留まるでしょう。 [[File:VideoJS controlbar.png|frameless|350px]] 操作部の機能は、左から右へ下記の通り。 <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;再生と停止 * [[File:VideoJS volume control.png|30px|]]&nbsp;音量調整 * 再生している位置 * 再生する残り時間 * [[File:VideoJS subtitle control.png|30px|]]&nbsp;字幕の言語および書式の設定 * [[File:VideoJS resolution control.png|30px|]]&nbsp;画質設定 * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;ピクチャー イン ピクチャー に切替 * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;全画面表示 * [[File:VideoJS file description control.png|30px|]]&nbsp;ファイルについての説明 <span id="Mouse_and_keyboard_controls"></span> === マウスとキーボードの操作 === * サムネイル上の再生アイコンをクリックすると、メディアファイルの再生を開始します。 * サムネイルを右クリックすると、コンテキストメニューを開きます。 * プレーヤーのウィンドウ内をクリックすることで再生と停止を行えます。 * プレーヤーのウィンドウをダブルクリックすると全画面表示への移行や解除ができます。 * キーボードから下記の操作が可能です。 *; {{Key press|k}} / {{Key press|Space}} : メディアの再生 / 停止 *; {{Key press|f}} : 全画面表示 / 解除 *; {{Key press|m}} : 消音 *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * このプレーヤーは [Tab]、[Enter] および [Space]キーを使用することで、キーボードからすべての機能にアクセスできます。 <span id="Known_issues"></span> == 既知の問題点 == ビデオプレーヤーはまだ開発中ですが、何か問題を見つけた場合は、[[Extension_talk:TimedMediaHandler/VideoJS Player|議論ページ]]で報告するか、[https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]にファイルしてください。 <span id="Developers"></span> == 開発者 == Developers working on features that use the Video.js player will need to initialize and configure it appropriately. 開発者の皆さんで、Video.js プレーヤーを使用する機能に取り組む場合は適切に初期化して構成してください。 一般的な使い方を以下に紹介します。 <span id="Basic_Configuration_Example"></span> === 基本的な環境設定 === {{Note |1=これは古いため再加工が必要で、videojs 再生に一貫したオプションと設定を適用するプレーヤー ラッパーに適合させます。 |2=gotcha }} <syntaxhighlight lang="js"> // 最初の引数に文字列 ID または <video> 要素を指定可能 var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* ソースファイルの配列、さまざまなサイズと形式 */ ] } ); </syntaxhighlight> HTML {{tag|video|open}} 要素として、JSではなく <code>sources</code> を提供できます: <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <span id="Advanced_configuration_with_Ogv.js_support"></span> === Ogv.js 対応の高度な設定 === OGG もしくは WebM ファイル類を異なるプラットフォーム間で再生する必要があるときは(どちらもコモンズで頻繁に出会うファイル形式) [https://github.com/hartman/videojs-ogvjs Video.js用のプラグイン Ogv.jsr]を採用する方法があり、これも TimedMediaHandler に同梱されています。 設定例: <syntaxhighlight lang="js"> var player; // ResourceLoaderに適切なモジュールを読み込み mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // 必要に応じて ogvjs を読み込み:その成果として、 // 必要なコードを全て読み込みました return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* ソースの配列 */ ], // Ogv.js 固有の設定 ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> mwwbgmbvt4sogjl5i8xm0042qw2req5 8364778 8364362 2026-05-03T23:14:42Z FuzzyBot 451990 Updating to match new version of source page 8364778 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|VideoJS プレーヤーが作動中のスクリーンショット]] '''VideoJS Player''' は、ウィキメディアのプロジェクト群における MediaWiki 向けの動画プレーヤーです。 [https://videojs.com/ VideoJS]をベースに、モバイル端末や HTML5 に対応した、現代風の高速なユーザーインターフェイスを実装しています。 <span id="Usage"></span> == 使用法 == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|動画プレーヤーの例]] [[File:Armstrong Small Step.ogg|thumb|音声プレーヤーの例]] 音声のみと映像の双方に対応したプレーヤーです。 このページで双方のプレーヤーを例示してご覧いただけます。 ひとたび起動すると、映像に連動する操作用バーが眼に留まるでしょう。 [[File:VideoJS controlbar.png|frameless|350px]] 操作部の機能は、左から右へ下記の通り。 <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;再生と停止 * [[File:VideoJS volume control.png|30px|]]&nbsp;音量調整 * 再生している位置 * 再生する残り時間 * [[File:VideoJS subtitle control.png|30px|]]&nbsp;字幕の言語および書式の設定 * [[File:VideoJS resolution control.png|30px|]]&nbsp;画質設定 * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;ピクチャー イン ピクチャー に切替 * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;全画面表示 * [[File:VideoJS file description control.png|30px|]]&nbsp;ファイルについての説明 <span id="Mouse_and_keyboard_controls"></span> === マウスとキーボードの操作 === * サムネイル上の再生アイコンをクリックすると、メディアファイルの再生を開始します。 * サムネイルを右クリックすると、コンテキストメニューを開きます。 * プレーヤーのウィンドウ内をクリックすることで再生と停止を行えます。 * プレーヤーのウィンドウをダブルクリックすると全画面表示への移行や解除ができます。 * キーボードから下記の操作が可能です。 *; {{Key press|k}} / {{Key press|Space}} : メディアの再生 / 停止 *; {{Key press|f}} : 全画面表示 / 解除 *; {{Key press|m}} : 消音 *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * このプレーヤーは [Tab]、[Enter] および [Space]キーを使用することで、キーボードからすべての機能にアクセスできます。 <span id="Known_issues"></span> == 既知の問題点 == ビデオプレーヤーはまだ開発中ですが、何か問題を見つけた場合は、[[Extension_talk:TimedMediaHandler/VideoJS Player|議論ページ]]で報告するか、[https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]にファイルしてください。 <span id="Developers"></span> == 開発者 == Developers working on features that use the Video.js player will need to initialize and configure it appropriately. 開発者の皆さんで、Video.js プレーヤーを使用する機能に取り組む場合は適切に初期化して構成してください。 一般的な使い方を以下に紹介します。 <span id="Basic_Configuration_Example"></span> === 基本的な環境設定 === {{Note|1=これは古いため再加工が必要で、videojs 再生に一貫したオプションと設定を適用するプレーヤー ラッパーに適合させます。|2=gotcha}} <syntaxhighlight lang="js"> // 最初の引数に文字列 ID または <video> 要素を指定可能 var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* ソースファイルの配列、さまざまなサイズと形式 */ ] } ); </syntaxhighlight> HTML {{tag|video|open}} 要素として、JSではなく <code>sources</code> を提供できます: <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <span id="Advanced_configuration_with_Ogv.js_support"></span> === Ogv.js 対応の高度な設定 === OGG もしくは WebM ファイル類を異なるプラットフォーム間で再生する必要があるときは(どちらもコモンズで頻繁に出会うファイル形式) [https://github.com/hartman/videojs-ogvjs Video.js用のプラグイン Ogv.jsr]を採用する方法があり、これも TimedMediaHandler に同梱されています。 設定例: <syntaxhighlight lang="js"> var player; // ResourceLoaderに適切なモジュールを読み込み mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // 必要に応じて ogvjs を読み込み:その成果として、 // 必要なコードを全て読み込みました return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* ソースの配列 */ ], // Ogv.js 固有の設定 ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 98ftn6ghyx977gx41ren25fyqu8kqoh Extension:TimedMediaHandler/VideoJS Player/de 102 991970 8364354 8363681 2026-05-03T13:12:13Z FuzzyBot 451990 Updating to match new version of source page 8364354 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Bildschirmfoto des neuen Players während der Nutzung]] Der '''VideoJS Player''' ist der Videoplayer für MediaWiki, der bei den Wikimedia-Projekten verwendet wird. Der Player nutzt [https://videojs.com/ VideoJS] und verfügt über eine moderne sowie schnelle Benutzeroberfläche, die auch mit mobilen Endgeräten und HTML5 kompatibel ist. <span id="Usage"></span> == Verwendung == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Beispielvideo im neuen Player]] [[File:Armstrong Small Step.ogg|thumb|Beispielaudio im neuen Player]] Es gibt sowohl einen Audio- als auch einen Videoplayer. Beispiele für beide Player findest du auf dieser Seite. Nach dem Start siehst du eine Kontrollleiste, wenn du mit dem Video interagierst. [[File:VideoJS controlbar.png|frameless|350px]] Die Bedienelemente sind in der Reihenfolge von links nach rechts: <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;Wiedergabe/Pause * [[File:VideoJS volume control.png|30px|]]&nbsp;Lautstärke * Abspielposition * Verbleibende Wiedergabedauer * [[File:VideoJS subtitle control.png|30px|]]&nbsp;Untertitel-Sprachauswahl und Untertitel-kontrollen * [[File:VideoJS resolution control.png|30px|]]&nbsp;Auswahl der Auflösung * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;Optionale Bild-im-Bild-Steuerung * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;Steuerung im Vollbildmodus * [[File:VideoJS file description control.png|30px|]]&nbsp;Info-Schaltfläche, um die Seite mit der Dateibeschreibung aufzurufen <span id="Mouse_and_keyboard_controls"></span> === Maus- und Tastatursteuerung === * Klicke auf das Wiedergabesymbol über der Miniaturansicht, um die Wiedergabe der Mediendatei zu starten. * Klicke mit der rechten Maustaste oder mit der mittleren Maustaste auf die Miniaturansicht, um die Seite mit der Dateibeschreibung zu öffnen. * Wiedergabe/Pause des Players mit einem einzigen Mausklick innerhalb des Player-Fensters * Doppelklicke auf das Player-Fenster, um den Vollbildmodus aufzurufen oder zu verlassen. * Die folgenden Tastatursteuerungen sind verfügbar: *; {{Key press|k}} / {{Key press|Space}} : Wiedergabe/Pause der Medienwiedergabe *; {{Key press|f}} : Vollbild aufrufen/verlassen *; {{Key press|m}} : Stummschalten des Tons *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * Der Player ist über die Tabulator-, Eingabe- und Leertaste vollständig über die Tastatur zugänglich. <span id="Known_issues"></span> == Bekannte Probleme == Der Video Player ist im Entwicklungsstadium. Falls Dir Probleme auffallen, melde sie bitte auf der [[Extension_talk:TimedMediaHandler/VideoJS Player|Diskussionsseite]] (in englischer Sprache) oder erstelle eine Meldung im [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator] (ebenfalls in englischer Sprache). <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> ki24xhxb641c7x54vm0todsebmjenae 8364769 8364354 2026-05-03T23:14:38Z FuzzyBot 451990 Updating to match new version of source page 8364769 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Bildschirmfoto des neuen Players während der Nutzung]] Der '''VideoJS Player''' ist der Videoplayer für MediaWiki, der bei den Wikimedia-Projekten verwendet wird. Der Player nutzt [https://videojs.com/ VideoJS] und verfügt über eine moderne sowie schnelle Benutzeroberfläche, die auch mit mobilen Endgeräten und HTML5 kompatibel ist. <span id="Usage"></span> == Verwendung == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Beispielvideo im neuen Player]] [[File:Armstrong Small Step.ogg|thumb|Beispielaudio im neuen Player]] Es gibt sowohl einen Audio- als auch einen Videoplayer. Beispiele für beide Player findest du auf dieser Seite. Nach dem Start siehst du eine Kontrollleiste, wenn du mit dem Video interagierst. [[File:VideoJS controlbar.png|frameless|350px]] Die Bedienelemente sind in der Reihenfolge von links nach rechts: <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;Wiedergabe/Pause * [[File:VideoJS volume control.png|30px|]]&nbsp;Lautstärke * Abspielposition * Verbleibende Wiedergabedauer * [[File:VideoJS subtitle control.png|30px|]]&nbsp;Untertitel-Sprachauswahl und Untertitel-kontrollen * [[File:VideoJS resolution control.png|30px|]]&nbsp;Auswahl der Auflösung * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;Optionale Bild-im-Bild-Steuerung * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;Steuerung im Vollbildmodus * [[File:VideoJS file description control.png|30px|]]&nbsp;Info-Schaltfläche, um die Seite mit der Dateibeschreibung aufzurufen <span id="Mouse_and_keyboard_controls"></span> === Maus- und Tastatursteuerung === * Klicke auf das Wiedergabesymbol über der Miniaturansicht, um die Wiedergabe der Mediendatei zu starten. * Klicke mit der rechten Maustaste oder mit der mittleren Maustaste auf die Miniaturansicht, um die Seite mit der Dateibeschreibung zu öffnen. * Wiedergabe/Pause des Players mit einem einzigen Mausklick innerhalb des Player-Fensters * Doppelklicke auf das Player-Fenster, um den Vollbildmodus aufzurufen oder zu verlassen. * Die folgenden Tastatursteuerungen sind verfügbar: *; {{Key press|k}} / {{Key press|Space}} : Wiedergabe/Pause der Medienwiedergabe *; {{Key press|f}} : Vollbild aufrufen/verlassen *; {{Key press|m}} : Stummschalten des Tons *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * Der Player ist über die Tabulator-, Eingabe- und Leertaste vollständig über die Tastatur zugänglich. <span id="Known_issues"></span> == Bekannte Probleme == Der Video Player ist im Entwicklungsstadium. Falls Dir Probleme auffallen, melde sie bitte auf der [[Extension_talk:TimedMediaHandler/VideoJS Player|Diskussionsseite]] (in englischer Sprache) oder erstelle eine Meldung im [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator] (ebenfalls in englischer Sprache). <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> lfd92vn6em55nbl818lrv78wevui6t6 Manual:Managing data in MediaWiki/en 100 999917 8364301 8363586 2026-05-03T12:44:43Z FuzzyBot 451990 Updating to match new version of source page 8364301 wikitext text/x-wiki <languages/> MediaWiki was designed to manage mostly free-form text and images. A limited amount of structure is available: {{ll|Help:Namespaces|namespaces}}, {{ll|Help:Subpages|subpages}} and {{ll|Help:Categories|categories}} help to group similar pages together, while features like {{ll|Infobox|infoboxes}} and {{ll|Gallery|galleries}} help to structure the contents within each page. However, MediaWiki by itself does not truly provide ways to manage structured data: data that can be queried, filtered, and in some cases displayed with visualizations including tables, charts, maps<ref>see also [[Wikimedia Maps]]</ref> and calendars. For that, a number of dedicated [[Special:MyLanguage/Manual:Extensions|extensions]] exist. The following table describes the extensions that can store the data edited by users in a MediaWiki database, from where it can then be queried. This is not a list of all structured data functionality; the "[[#See also|See also]]" section lists other extensions and features that can be used for storing or displaying structured data. {| class="wikitable" |- ! Feature ! [[File:20210702_Semantic_MediaWiki_logo_with_wordmark.png|100px]]<br/>[https://www.semantic-mediawiki.org/ Semantic MediaWiki] ! [[File:Wikibase_Suite_Vertical_2x_RGB.png|100px]]<br/>[https://wikiba.se/ Wikibase] ! [[File:Cargo logo.png|50px]]<br/>{{ll|Extension:Cargo|nsp=0}} ! {{ll|Extension:VisualData|VisualData}} !{{ll|Extension:Bucket|Bucket}} ! {{ll|Extension:NeoWiki|NeoWiki}} |- | Main usecase | Managing data within a MediaWiki installation, based on [[w:Semantic Web|Semantic Web]] standards. | Powering [[w:Wikidata|Wikidata]] and other editable graph databases. | Managing data within a MediaWiki installation. | Managing data within a MediaWiki installation based on JSON-schema. |lightweight Lua interface for storing and accessing structured data on wiki pages |Knowledge management system that combines collaborative editing and a [[:en:knowledge_graph|knowledge graph]] |- | Approach | Data (properties) are annotated within regular wikitext or by templates. With the datatype "reference", properties can be used to describe items using statements.<ref>https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data</ref> | Properties are defined and used to describe Items using statements. | Data is stored in database tables, with each table corresponding to a template. | Data are stored in a dedicated slot with JSON content model |Data is stored in '''buckets''', which are database tables with specific columns that you can define |Schemas can be defined and applied to wiki pages, stored in a dedicated slot as JSON data. |- | Available since | 2005 | 2012 | 2015 | 2022 (formerly known as {{ll|Extension:PageProperties|PageProperties}}) |2025 |2026 |- | Active installations | 1000s<ref>https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki</ref> | 100s<ref>https://wikiapiary.com/wiki/Extension:WikibaseRepository</ref><ref>https://wikibase.world</ref><ref>https://addshore.com/2024/10/visualizing-wikibase-connections-using-wikibase-world/</ref> | 100s<ref>https://wikiapiary.com/wiki/Extension:Cargo</ref> | n/a (new extension or unknown) | | |- | Community | 190+ developers<ref>https://www.openhub.net/p/smw</ref> | 172+ developers<ref>https://github.com/wikimedia/mediawiki-extensions-Wikibase</ref> | 63+ developers<ref>https://github.com/wikimedia/mediawiki-extensions-Cargo</ref> | ([[User:Thomas-topway-it|main developer]]) |[https://weirdgloop.org/discord Weird Gloop's Discord] |[https://echolot-eccch.eu/ ECHOLOT project], [https://professional.wiki/ Professinal Wiki], [https://knowledge.wiki KM-A], [https://bluespice.com/bluespice-galaxy/ BlueSpice Galaxy] |- | Storage | MediaWiki database, Elasticsearch, 5 different SPARQL stores<ref>https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore</ref> | MediaWiki database, Elasticsearch, SPARQL store (Blazegraph for wikidata.org) | MediaWiki database (or a separate database)<ref>{{ll|Extension:Cargo/Download and installation#Setting the Cargo database}}</ref> | MediaWiki database |MediaWiki database (MySQL/MariaDB) |different SPARQL stores, currently Neo4J |- | Property definition | By typing wikitext. Properties can be invented freely. They will be of datatype page by default and can be defined later. Datatypes can be changed any time. | Properties have to be defined before usage and can not be changed easily.<ref>[[d:Help:Data type#Changing datatype]]</ref> | Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table. | Properties are defined through one or more json-schema defined through a {{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}} |Tables in the Bucket: namespace |Form based schema editing |- | Value declaration | Inline (<code><nowiki>[[MyProperty::MyValue]]</nowiki></code>) or with templates. Form-based data entry with {{ll|Extension:Page_Forms|Page Forms}}. | Wikibase default form-like input interface. | With parser functions in templates. Form-based data entry with {{ll|Extension:Page_Forms|Page Forms}}. | Inline or popup OOUI {{ll|Extension:VisualData/Forms|forms}} automatically generated from JSON-schemas |via Lua call of the <code>bucket.put</code> function |OOUI based form editing |- | Predefined data types | 18<ref>https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes</ref> | 17<ref>[[d:Special:ListDatatypes]]</ref><ref>Some datatypes are defined by other extension: [[Special:MyLanguage/Extension:Math|Math]] and [[Special:MyLanguage/Extension:Score|Score]] both define one datatype, [[Special:MyLanguage/Extension:JsonConfig|JsonConfig]] defines two, [[Special:MyLanguage/Extension:WikibaseLexeme|WikibaseLexeme]] defines three, and Wikibase defines ten.</ref> | 18 | 4 (basic JSON-schema types) + 15 string formats | 5 <ref>https://meta.weirdgloop.org/w/Extension:Bucket#Basic_usage</ref> | |- | Property management | type definitions, constraint schemas, ontology import | custom, or import of Wikidata ontology | Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table. | through a graphical interface (dedicated {{ll|Extension:VisualData/Schema Builder|SchemaBuilder}}) | |through a graphical interface |- | Page names and internal linking | Pages have normal names and can be linked to with their names. | Page names are stored with their Q-numbers (displaying labels in available languages). Internal linking must be done to the Q-number; you cannot link to a label. | Pages have normal names and can be linked to with their names. | Schemas are stored in a dedicated namespace and JSON-data in a dedicated slot associated to wiki articles. JSON-data can be accessed through an extension of the wiki interface | |MediaWiki pages can have schemas |- | Inline queries | yes, with parser functions | no (external SPARQL queries); [[phab:T67626|planned]]<br/>supported via third-party extension {{ll|Extension:LinkedWiki|LinkedWiki}} | yes, with parser functions | yes, with parser functions | |yes, with parser functions via the SQL store |- | External querying | yes, with either an API or SPARQL querying (available through special extensions such as [[Special:MyLanguage/Extension:RDFIO|RDFIO]] and [[Special:MyLanguage/Extension:LinkedWiki|LinkedWiki]]) | yes, with SPARQL Query service | yes, with an API | yes, with an API<ref>{{ll|Extension:VisualData/API}}</ref> | API is not yet stable <ref>https://meta.weirdgloop.org/w/Extension:Bucket</ref> |yes, with an API or SPARQL endpoint |- | Result formats<ref>"Result formats" mean the ability of the wiki to display data (results of an inline query) in various formats, e.g. tables, calendars, maps, timelines, etc.</ref> | ~ 75<ref>https://www.semantic-mediawiki.org/wiki/Help:Result_formats</ref> | no native result display; data may be visualized via: * Query Service or other external tools * on wiki data access via LUA (no query support) * {{ll|Extension:LinkedWiki}} - third-party | ~ 25<ref>{{ll|Extension:Cargo/Display formats}}</ref> | 12+ (Json, Table, Datatable, Template, Calendar, Carousel, Map, pageid, pagetitle, count, raw, Lua ) <ref>{{ll|Extension:VisualData/Result_formats}}</ref> | | |- | Development | [[github:SemanticMediaWiki/SemanticMediaWiki|GitHub]] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Cargo Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/VisualData Gerrit] |[[github:weirdgloop/mediawiki-extensions-Bucket|GitHub]] |[[github:ProfessionalWiki/NeoWiki|GItHub]] |- | Complementary extensions | ~ 40<ref>{{ll|Category:Semantic MediaWiki extensions}}</ref>, e.g. {{ll|Extension:Semantic Result Formats|Semantic Result Formats}}, {{ll|Extension:Semantic Bundle|Semantic Bundle}}, {{ll|Extension:Semantic Scribunto|Semantic Scribunto}} | ~12<ref>{{ll|Category:Wikibase extensions}}</ref>, e.g. {{ll|Extension:Wikibase Repository|Wikibase Repository}}, {{ll|Extension:Wikibase Client|Wikibase Client}}, {{ll|Extension:WikibaseLexeme|WikibaseLexeme}}, [https://wikiba.se/applications/#query-service Query Service] | 2 ([[Special:MyLanguage/Extension:Page Forms|Page Forms]], [[Special:MyLanguage/Extension:Page Schemas|Page Schemas]]). Cargo provides some or all of the functionality of Semantic MediaWiki, Semantic Result Formats, Maps, Semantic Drilldown, Semantic Compound Queries, Semantic Internal Objects and Semantic Scribunto.<ref>[[Extension:Cargo/Cargo and Semantic MediaWiki]].</ref> | {{ll|Extension:ContactManager|ContactManager}} |{{ll|Extension:Lua|Lua}} | |} == Alternative comparisons == * {{ll|Extension:Cargo/Cargo and Semantic MediaWiki|2=Cargo and Semantic MediaWiki}} * [https://professional.wiki/en/articles/managing-data-in-mediawiki Semantic MediaWiki vs Wikibase vs Cargo] by [https://professional.wiki Professional Wiki] == References == <references/> == See also == * {{ll|Multi-Content Revisions}} – Ability to manage different independent content objects on the same wiki page * {{ll|Extension:WikiDB|WikiDB}} – Provides database features, somewhat similar to semantic properties * {{ll|Extension:JsonConfig|JsonConfig}} – store JSON (including tabular and map data) in wiki pages, and allow accessing them via Lua; no query support * {{ll|Extension:External Data|External Data}} – access data from external URL, local file, and SQL or MongoDB database * {{ll|Structured data across Wikimedia}} – 2021-2023 project for improving structured data support in MediaWiki * {{ll|Category:Data management extensions}} [[Category:MediaWiki Introduction{{#translation:}}]] [[Category:Extension comparisons{{#translation:}}]] 15rbuhl247us6xy8tuixtwyiqwpe3wi Manual:Managing data in MediaWiki/fr 100 1001241 8364302 8363587 2026-05-03T12:44:43Z FuzzyBot 451990 Updating to match new version of source page 8364302 wikitext text/x-wiki <languages/> MediaWiki a été conçu pour gérer la plupart des formes textuelles libres et les images. Un nombre limité de structures est à disposition : les {{ll|Help:Namespaces|espaces de noms}}, les {{ll|Help:Subpages|sous-pages}} et les {{ll|Help:Categories|catégories}} vous aident à regrouper ensemble les pages similaires, alors que les fonctionnalités comme les {{ll|Infobox|boîtes d'information}} et les {{ll|Gallery|galeries}} vous aident à structurer le contenu de chaque page. Néanmoins MediaWiki en lui-même ne propose pas vraiement de manières pour gérer les données structurées : les données pouvant être interrogées, filtrées, et dans certains cas affichées avec les visualisations des tables, graphiques, cartes géographiques<ref>voir aussi [[Wikimedia Maps]]</ref> et les calendriers. Pour cela il existe un certain nombre d'[[Special:MyLanguage/Manual:Extensions|extensions]] dédiées. Le tableau suivant décrit les extensions qui peuvent stocker dans une base de données MediaWiki les données éditées par les utilisateurs, d'où elles peuvent ensuite être consultées. Ce n'est pas la liste de toutes les fonctionnalités concernant les données structurées; la section ''[[#See also|Voir aussi]]'' fournit d'autres extensions et fonctionnalités pouvant être utilisées pour stocker ou pour afficher des données structurées. {| class="wikitable" |- ! Fonction ! [[File:20210702_Semantic_MediaWiki_logo_with_wordmark.png|100px]]<br/>[https://www.semantic-mediawiki.org/ Semantic MediaWiki] ! [[File:Wikibase_Suite_Vertical_2x_RGB.png|100px]]<br/>[https://wikiba.se/ Wikibase] ! [[File:Cargo logo.png|50px]]<br/>{{ll|Extension:Cargo|nsp=0}} ! {{ll|Extension:VisualData|VisualData}} !{{ll|Extension:Bucket|Bucket}} ! {{ll|Extension:NeoWiki|NeoWiki}} |- | Cas d'utilisation principal | Gérer les données d'une installation MediaWiki, basée sur les standards du [[w:Semantic Web|web sémantique]]. | Propulser [[w:Wikidata|Wikidata]] et d'autres bases de données graphiques modifiables. | Gérer les données d'une installation MediaWiki. | Gestion des données d'une installation MediaWiki basée sur un schéma JSON. |lightweight Lua interface for storing and accessing structured data on wiki pages |Knowledge management system that combines collaborative editing and a [[:en:knowledge_graph|knowledge graph]] |- | Approche | Les données (propriétés) sont annotées avec le wikicode régulier ou par les modèles. Avec le type de donnée ''reference'', les propriétés peuvent être utilisées pour décrire les éléments à l'aide de déclarations.<ref>https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data</ref> | Les propriétés sont définies et utilisées pour décrire les éléments à l'aide de déclarations. | Les données sont stockées dans les tables de la base de données et chaque table correspond à un modèle. | Les données sont stockées dans un espace dédié avec un modèle de contenu JSON |Data is stored in '''buckets''', which are database tables with specific columns that you can define |Schemas can be defined and applied to wiki pages, stored in a dedicated slot as JSON data. |- | Disponible depuis | 2005 | 2012 | 2015 | 2022 (initialement connu comme {{ll|Extension:PageProperties|PageProperties}}) |2025 |2026 |- | Temps d'installation | 1000&nbsp;s<ref>https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki</ref> | 100&nbsp;s<ref>https://wikiapiary.com/wiki/Extension:WikibaseRepository</ref><ref>https://wikibase.world</ref><ref>https://addshore.com/2024/10/visualizing-wikibase-connections-using-wikibase-world/</ref> | 100&nbsp;s<ref>https://wikiapiary.com/wiki/Extension:Cargo</ref> | n/a (nouvelle extension ou inconnue) | | |- | Communauté | 190+ développeurs<ref>https://www.openhub.net/p/smw</ref> | 172+ développeurs<ref>https://github.com/wikimedia/mediawiki-extensions-Wikibase</ref> | 63+ développeurs<ref>https://github.com/wikimedia/mediawiki-extensions-Cargo</ref> | ([[User:Thomas-topway-it|développeur principal]]) |[https://weirdgloop.org/discord Weird Gloop's Discord] |[https://echolot-eccch.eu/ ECHOLOT project], [https://professional.wiki/ Professinal Wiki], [https://knowledge.wiki KM-A], [https://bluespice.com/bluespice-galaxy/ BlueSpice Galaxy] |- | Stockage | Base de données MediaWiki, Elasticsearch, 5 dépôts SPARQL différents<ref>https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore</ref> | Base de données MediaWiki, Elasticsearch, dépôt SPARQL (Blazegraph pour wikidata.org) | Base de données MediaWiki (ou une base de données séparée)<ref>{{ll|Extension:Cargo/Download and installation#Setting the Cargo database}}</ref> | base de données MédiaWiki |MediaWiki database (MySQL/MariaDB) |different SPARQL stores, currently Neo4J |- | Définition de propriété | En saisissant le wikicode. Vous pouvez inventer librement des propriétés. Par défaut elle auront le type de donnée 'page' et pourront être définies ultérieurement. Le type des données peut être modifié à tout moment. | Les propriétés doivent avoir été définies avant leur utilisation et ne peuvent pas être modifiées facilement.<ref>[[d:Help:Data type#Changing datatype]]</ref> | Au lieu d'utiliser des propriétés, les tableaux de données sont définis avec un ensemble de champs prédéterminés (mais reconfigurables) par table. | Les propriétés sont définies par un ou plusieurs schémas JSON définis à travers un {{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}} |Tables in the Bucket: namespace |Form based schema editing |- | Déclarer les valeurs | En ligne (<code><nowiki>[[MaPropriété::MaValeur]]</nowiki></code>) ou avec les modèles. Saisie des données sous forme de formulaire avec {{ll|Extension:Page_Forms|Page Forms}}. | Interface de saisie par défaut, à la manière de Wikibase. | Avec les fonctions d'analyseur syntaxique dans les modèles. Saisie des données sous forme de formulaire avec {{ll|Extension:Page_Forms|Page Forms}}. | {{ll|Extension:VisualData/Forms|forms}} OOUI en ligne ou dans une fenêtre contextuelle, générés autmatiquement à partir des schémas JSON |via Lua call of the <code>bucket.put</code> function |OOUI based form editing |- | Nombre de types de données prédéfinis | 18<ref>https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes</ref> | 17<ref>[[d:Special:ListDatatypes]]</ref><ref>Certains types de données sont définis par une autre extension : [[Special:MyLanguage/Extension:Math|Math]] et [[Special:MyLanguage/Extension:Score|Score]] définissent ensemble un type de données, [[Special:MyLanguage/Extension:JsonConfig|JsonConfig]] en définit deux, [[Special:MyLanguage/Extension:WikibaseLexeme|WikibaseLexeme]] trois, et Wikibase dix.</ref> | 18 | 4 (types de base de schémas JSON) + 15 formats de chaînes de caractères | 5 <ref>https://meta.weirdgloop.org/w/Extension:Bucket#Basic_usage</ref> | |- | Gestion des propriétés | définitions de types, schémas de contraintes, importation d'ontologie | personnalisé, ou import d'ontologie Wikidata | Au lieu d'utiliser des propriétés, les tableaux de données sont définis avec un ensemble de champs prédéterminés (mais reconfigurables) par table. | via une interface graphique (dediée {{ll|Extension:VisualData/Schema Builder|SchemaBuilder}}) | |through a graphical interface |- | Nom des pages et liens internes | Le nom des pages est normal et peut être utilisé pour les référencer. | Le nom des pages est stocké avec leur Q-nombre (en affichant le 'label' dans les langues disponibles). Les liens internes doivent être faits vers le Q-nombre car vous ne pouvez pas référencer un 'label'. | Le nom des pages est normal et peut être utilisé pour les référencer. | Les schémas sont stockés dans un espace de noms dédié, et les données JSON dans un emplacement dédié associé aux articles du wiki. L'accès aux données JSON est possible via une extension de l'interface du wiki | |MediaWiki pages can have schemas |- | Requêtes en ligne | oui, avec les fonctions d'analyseur syntaxique | non (requêtes SPARQL externes); [[phab:T67626|prévu]]<br/>pris en charge par l'extension tierce {{ll|Extension:LinkedWiki|LinkedWiki}} | oui, avec les fonctions d'analyseur syntaxique | oui avec des fonctions d'analyse syntaxique | |yes, with parser functions via the SQL store |- | Requêtes externes | oui, avec un système de requête soit par API soit de type SPARQL (disponible via des extensions spéciales comme [[Special:MyLanguage/Extension:RDFIO|RDFIO]] et [[Special:MyLanguage/Extension:LinkedWiki|LinkedWiki]]) | oui, avec le service de requête SPARQL | oui, avec une API | oui, avec une API<ref>{{ll|Extension:VisualData/API}}</ref> | API is not yet stable <ref>https://meta.weirdgloop.org/w/Extension:Bucket</ref> |yes, with an API or SPARQL endpoint |- | Formats de sortie<ref>Les ''Formats des résultats'' représentent la capacité du wiki à afficher les données (résultats d'une requête en ligne) dans différents formats, par exemple en tableaux, calendriers, cartes, lignes chronologiques, etc.</ref> | ~ 75<ref>https://www.semantic-mediawiki.org/wiki/Help:Result_formats</ref> | Pas d'affichage des résultats en natif; les données peuvent être visualisées par : * Service des requêtes ou autres outils externes * sur les wikis, par l'accès aux données via LUA (pas de support de requête) * {{ll|Extension:LinkedWiki}} - tierce partie | environ 25<ref>{{ll|Extension:Cargo/Display formats}}</ref> | 12+ (Json, Table, Datatable, Template, Calendar, Carousel, Map, pageid, pagetitle, count, raw, Lua ) <ref>{{ll|Extension:VisualData/Result_formats}}</ref> | | |- | Développements | [[github:SemanticMediaWiki/SemanticMediaWiki|GitHub]] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Cargo Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/VisualData Gerrit] |[[github:weirdgloop/mediawiki-extensions-Bucket|GitHub]] |[[github:ProfessionalWiki/NeoWiki|GItHub]] |- | Extensions complémentaires | ~ 40<ref>{{ll|Category:Semantic MediaWiki extensions}}</ref>, e.g. {{ll|Extension:Semantic Result Formats|Semantic Result Formats}}, {{ll|Extension:Semantic Bundle|Semantic Bundle}}, {{ll|Extension:Semantic Scribunto|Semantic Scribunto}} | ~12<ref>{{ll|Category:Wikibase extensions}}</ref>, e.g. {{ll|Extension:Wikibase Repository|Wikibase Repository}}, {{ll|Extension:Wikibase Client|Wikibase Client}}, {{ll|Extension:WikibaseLexeme|WikibaseLexeme}}, [https://wikiba.se/applications/#query-service Query Service] | Il y en a 2 : [[Special:MyLanguage/Extension:Page Forms|Page Forms]], [[Special:MyLanguage/Extension:Page Schemas|Page Schemas]]. Cargo fournit certaines ou toutes les fonctionnalités de Semantic MediaWiki, Semantic Result Formats, Maps, Semantic Drilldown, Semantic Compound Queries, Semantic Internal Objects et Semantic Scribunto.<ref>[[Extension:Cargo/Cargo and Semantic MediaWiki]].</ref> | {{ll|Extension:ContactManager|ContactManager}} |{{ll|Extension:Lua|Lua}} | |} <span id="Alternative_comparisons"></span> == Comparaisons alternatives == * {{ll|Extension:Cargo/Cargo and Semantic MediaWiki|2=Cargo et Semantic MediaWiki}} * [https://professional.wiki/en/articles/managing-data-in-mediawiki Semantic MediaWiki avec Wikibase et Cargo] par [https://professional.wiki Professional Wiki] <span id="References"></span> == Références == <references/> <span id="See_also"></span> == Voir aussi == * {{ll|Multi-Content Revisions}} – Possibilité de gérer différents objets de contenu indépendants à l'intérieur d'une même page wiki * {{ll|Extension:WikiDB|WikiDB}} – Fournit les fonctionnalités de la base de données, semblables en certains points aux propriétés sémantiques. * {{ll|Extension:JsonConfig|JsonConfig}} – stocke le JSON (y compris les données tableur et les données de cartes) dans des pages wiki, et permet leur accès via Lua; ne supporte pas les requêtes * {{ll|Extension:External Data|External Data}} – accès aux données à partir d'URL externe, d'un fichier local, et de base de données SQL ou MongoDB * {{ll|Structured data across Wikimedia}} – projet de 2021 à 2023 concernant l'amélioration du support des données structurées dans MediaWiki * {{ll|Category:Data management extensions}} [[Category:MediaWiki Introduction{{#translation:}}]] [[Category:Extension comparisons{{#translation:}}]] qtsttua02wiazhsgpe03vufwg574e47 Template:Update/tr 10 1002932 8364337 8364255 2026-05-03T12:47:11Z FuzzyBot 451990 Updating to match new version of source page 8364337 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |'''Gerçek doğruluk''', bu sayfa parçaların ({{{part|{{{1|}}}}}} ile ilgili olanlar) '''güncel olmayan bilgilerden dolayı tehlikeye girebilir'''. |Bu sayfasının ({{{part|{{{1|}}}}}} ilgili olanlar) bölümleri '''eski'''.}} |{{#if:{{{inaccurate|}}} |'''Gerçek doğruluk''' bu sayfasının '''değerinde güncel olmayan bilgiler nedeniyle tehlikeye girebilir'''. |Bu sayfa '''eski'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|MediaWiki'nin daha eski bir sürümü için yazılmış ve en son sürüm için geçerli olmayabilir.}} Bu sayfayı kontrol ettiyseniz veya güncellediyseniz ve içeriği uygun bulduysanız, lütfen bu bildirimi kaldırın. {{#ifexist: {{TALKPAGENAME}} |&#32;Bu konuda olası bir tartışma için [[{{TALKPAGENAME}}|tartışma sayfasına]] bakınız. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Son güncelleme: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= Bu şablonun takma adları: * {{tlx|outdated}} <span id="Examples"></span> == Örnekler == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == Ayrıca bakınız == * {{tl|historical}} == TemplateData == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> okdb519hmlccq8fhhidkjurc4l889tb Template:Update/ko 10 1003883 8364326 8364246 2026-05-03T12:47:05Z FuzzyBot 451990 Updating to match new version of source page 8364326 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |이 문서 일부({{{part|{{{1|}}}}}} 관련)의 '''사실의 정확성'''은 '''정보가 오래되어 손상되었을 가능성이 있습니다'''. |이 문서 일부({{{part|{{{1|}}}}}} 관련)는 가장 최근의 정보를 '''반영하지 않았습니다'''.}} |{{#if:{{{inaccurate|}}} |이 문서의 '''사실의 정확성'''은 '''정보가 오래되어 손상되었을 가능성이 있습니다'''. |이 페이지 문서는 '''오래되었습니다'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|미디어위키의 이전 버전을 위해 쓰여졌으며 최근 버전에서는 적용되지 않을 수 있습니다.}} 이 문서를 확인하거나 업데이트한 후 내용이 적합하다고 판단되면, 틀을 삭제해 주세요. {{#ifexist: {{TALKPAGENAME}} |&#32;이에 대한 의견은 [[{{TALKPAGENAME}}|토론 문서]]를 참조하십시오. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>마지막 업데이트: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= 이 틀의 다른 이름: * {{tlx|outdated}} <span id="Examples"></span> == 예시 == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == 같이 보기 == * {{tl|historical}} <span id="TemplateData"></span> == 틀데이터 == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> 7fqirphh99aa53dfxyykcxrbjw219jm Translations:Help:Subpages/27/pt-br 1198 1008923 8364532 4686515 2026-05-03T16:58:46Z Nerun 899342 8364532 wikitext text/x-wiki A [[$1|extensões de subpáginas]], assim como a extensão $2 ou $3, permitem a você personalizar a exibição de subpáginas. fy6blsnay32keu27c4fs5il4xmf22e2 Manual:Managing data in MediaWiki/pt 100 1009400 8364309 8363594 2026-05-03T12:44:48Z FuzzyBot 451990 Updating to match new version of source page 8364309 wikitext text/x-wiki <languages/> <span class="mw-translate-fuzzy">MediaWiki foi criado para gerir principalmente a informação textual e faz isto muito bem.</span> <span lang="en" dir="ltr" class="mw-content-ltr">A limited amount of structure is available: {{ll|Help:Namespaces|namespaces}}, {{ll|Help:Subpages|subpages}} and {{ll|Help:Categories|categories}} help to group similar pages together, while features like {{ll|Infobox|infoboxes}} and {{ll|Gallery|galleries}} help to structure the contents within each page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, MediaWiki by itself does not truly provide ways to manage structured data: data that can be queried, filtered, and in some cases displayed with visualizations including tables, charts, maps<ref>see also [[Wikimedia Maps]]</ref> and calendars.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For that, a number of dedicated [[Special:MyLanguage/Manual:Extensions|extensions]] exist.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following table describes the extensions that can store the data edited by users in a MediaWiki database, from where it can then be queried. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is not a list of all structured data functionality; the "[[#See also|See also]]" section lists other extensions and features that can be used for storing or displaying structured data. </div> {| class="wikitable" |- ! Funcionalidade ! [[File:20210702_Semantic_MediaWiki_logo_with_wordmark.png|100px]]<br/>[https://www.semantic-mediawiki.org/ Semantic MediaWiki] ! [[File:Wikibase_Suite_Vertical_2x_RGB.png|100px]]<br/>[https://wikiba.se/ Wikibase] ! [[File:Cargo logo.png|50px]]<br/>{{ll|Extension:Cargo|nsp=0}} ! {{ll|Extension:VisualData|VisualData}} !{{ll|Extension:Bucket|Bucket}} ! {{ll|Extension:NeoWiki|NeoWiki}} |- | <span lang="en" dir="ltr" class="mw-content-ltr">Main usecase</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation, based on [[w:Semantic Web|Semantic Web]] standards.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Powering [[w:Wikidata|Wikidata]] and other editable graph databases.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation based on JSON-schema.</span> |lightweight Lua interface for storing and accessing structured data on wiki pages |Knowledge management system that combines collaborative editing and a [[:en:knowledge_graph|knowledge graph]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Approach</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data (properties) are annotated within regular wikitext or by templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">With the datatype "reference", properties can be used to describe items using statements.</span><ref>https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties are defined and used to describe Items using statements.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data is stored in database tables, with each table corresponding to a template.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data are stored in a dedicated slot with JSON content model</span> |Data is stored in '''buckets''', which are database tables with specific columns that you can define |Schemas can be defined and applied to wiki pages, stored in a dedicated slot as JSON data. |- | <span lang="en" dir="ltr" class="mw-content-ltr">Available since</span> | 2005 | 2012 | 2015 | 2022 <span lang="en" dir="ltr" class="mw-content-ltr">(formerly known as {{ll|Extension:PageProperties|PageProperties}})</span> |2025 |2026 |- | <span lang="en" dir="ltr" class="mw-content-ltr">Active installations</span> | <span lang="en" dir="ltr" class="mw-content-ltr">1000s</span><ref>https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">100s</span><ref>https://wikiapiary.com/wiki/Extension:WikibaseRepository</ref><ref>https://wikibase.world</ref><ref>https://addshore.com/2024/10/visualizing-wikibase-connections-using-wikibase-world/</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">100s</span><ref>https://wikiapiary.com/wiki/Extension:Cargo</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">n/a (new extension or unknown)</span> | | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Community</span> | <span lang="en" dir="ltr" class="mw-content-ltr">190+ developers</span><ref>https://www.openhub.net/p/smw</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">172+ developers</span><ref>https://github.com/wikimedia/mediawiki-extensions-Wikibase</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">63+ developers</span><ref>https://github.com/wikimedia/mediawiki-extensions-Cargo</ref> | ([[User:Thomas-topway-it|<span lang="en" dir="ltr" class="mw-content-ltr">main developer</span>]]) |[https://weirdgloop.org/discord Weird Gloop's Discord] |[https://echolot-eccch.eu/ ECHOLOT project], [https://professional.wiki/ Professinal Wiki], [https://knowledge.wiki KM-A], [https://bluespice.com/bluespice-galaxy/ BlueSpice Galaxy] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Storage</span> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database, Elasticsearch, 5 different SPARQL stores</span><ref>https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database, Elasticsearch, SPARQL store (Blazegraph for wikidata.org)</span> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database (or a separate database)</span><ref>{{ll|Extension:Cargo/Download and installation#Setting the Cargo database}}</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database</span> |MediaWiki database (MySQL/MariaDB) |different SPARQL stores, currently Neo4J |- | <span lang="en" dir="ltr" class="mw-content-ltr">Property definition</span> | <span lang="en" dir="ltr" class="mw-content-ltr">By typing wikitext.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Properties can be invented freely.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will be of datatype page by default and can be defined later.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Datatypes can be changed any time.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties have to be defined before usage and can not be changed easily.</span><ref>[[d:Help:Data type#Changing datatype]]</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties are defined through one or more json-schema defined through a {{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}}</span> |Tables in the Bucket: namespace |Form based schema editing |- | <span lang="en" dir="ltr" class="mw-content-ltr">Value declaration</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Inline (<code><nowiki>[[MyProperty::MyValue]]</nowiki></code>) or with templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Form-based data entry with {{ll|Extension:Page_Forms|Page Forms}}.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Wikibase default form-like input interface.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">With parser functions in templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Form-based data entry with {{ll|Extension:Page_Forms|Page Forms}}.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Inline or popup OOUI {{ll|Extension:VisualData/Forms|forms}} automatically generated from JSON-schemas</span> |via Lua call of the <code>bucket.put</code> function |OOUI based form editing |- | <span lang="en" dir="ltr" class="mw-content-ltr">Predefined data types</span> | 18<ref>https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes</ref> | 17<ref>[[d:Special:ListDatatypes]]</ref><ref><span lang="en" dir="ltr" class="mw-content-ltr">Some datatypes are defined by other extension: [[Special:MyLanguage/Extension:Math|Math]] and [[Special:MyLanguage/Extension:Score|Score]] both define one datatype, [[Special:MyLanguage/Extension:JsonConfig|JsonConfig]] defines two, [[Special:MyLanguage/Extension:WikibaseLexeme|WikibaseLexeme]] defines three, and Wikibase defines ten.</span></ref> | 18 | <span lang="en" dir="ltr" class="mw-content-ltr">4 (basic JSON-schema types) + 15 string formats</span> | 5 <ref>https://meta.weirdgloop.org/w/Extension:Bucket#Basic_usage</ref> | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Property management</span> | <span lang="en" dir="ltr" class="mw-content-ltr">type definitions, constraint schemas, ontology import</span> | <span lang="en" dir="ltr" class="mw-content-ltr">custom, or import of Wikidata ontology</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">through a graphical interface (dedicated {{ll|Extension:VisualData/Schema Builder|SchemaBuilder}})</span> | |through a graphical interface |- | <span lang="en" dir="ltr" class="mw-content-ltr">Page names and internal linking</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Page names are stored with their Q-numbers (displaying labels in available languages). Internal linking must be done to the Q-number; you cannot link to a label.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Schemas are stored in a dedicated namespace and JSON-data in a dedicated slot associated to wiki articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">JSON-data can be accessed through an extension of the wiki interface</span> | |MediaWiki pages can have schemas |- | <span lang="en" dir="ltr" class="mw-content-ltr">Inline queries</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | <span lang="en" dir="ltr" class="mw-content-ltr">no (external SPARQL queries);</span> [[phab:T67626|<span lang="en" dir="ltr" class="mw-content-ltr">planned</span>]]<br/><span lang="en" dir="ltr" class="mw-content-ltr">supported via third-party extension {{ll|Extension:LinkedWiki|LinkedWiki}}</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | |yes, with parser functions via the SQL store |- | <span lang="en" dir="ltr" class="mw-content-ltr">External querying</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with either an API or SPARQL querying (available through special extensions such as [[Special:MyLanguage/Extension:RDFIO|RDFIO]] and [[Special:MyLanguage/Extension:LinkedWiki|LinkedWiki]])</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with SPARQL Query service</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with an API</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with an API</span><ref>{{ll|Extension:VisualData/API}}</ref> | API is not yet stable <ref>https://meta.weirdgloop.org/w/Extension:Bucket</ref> |yes, with an API or SPARQL endpoint |- | <span lang="en" dir="ltr" class="mw-content-ltr">Result formats<ref>"Result formats" mean the ability of the wiki to display data (results of an inline query) in various formats, e.g. tables, calendars, maps, timelines, etc.</ref></span> | ~ 75<ref>https://www.semantic-mediawiki.org/wiki/Help:Result_formats</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">no native result display; data may be visualized via:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Query Service or other external tools </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * on wiki data access via LUA (no query support) </div> * {{ll|Extension:LinkedWiki}} - <span lang="en" dir="ltr" class="mw-content-ltr">third-party</span> | <span lang="en" dir="ltr" class="mw-content-ltr">~ 25</span><ref>{{ll|Extension:Cargo/Display formats}}</ref> | 12+ (Json, Table, Datatable, Template, Calendar, Carousel, Map, pageid, pagetitle, count, raw, Lua ) <ref>{{ll|Extension:VisualData/Result_formats}}</ref> | | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Development</span> | [[github:SemanticMediaWiki/SemanticMediaWiki|GitHub]] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Cargo Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/VisualData Gerrit] |[[github:weirdgloop/mediawiki-extensions-Bucket|GitHub]] |[[github:ProfessionalWiki/NeoWiki|GItHub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Complementary extensions</span> | ~ 40<ref>{{ll|Category:Semantic MediaWiki extensions}}</ref>, e.g. {{ll|Extension:Semantic Result Formats|Semantic Result Formats}}, {{ll|Extension:Semantic Bundle|Semantic Bundle}}, {{ll|Extension:Semantic Scribunto|Semantic Scribunto}} | ~12<ref>{{ll|Category:Wikibase extensions}}</ref>, e.g. {{ll|Extension:Wikibase Repository|Wikibase Repository}}, {{ll|Extension:Wikibase Client|Wikibase Client}}, {{ll|Extension:WikibaseLexeme|WikibaseLexeme}}, [https://wikiba.se/applications/#query-service Query Service] | <span lang="en" dir="ltr" class="mw-content-ltr">2 ([[Special:MyLanguage/Extension:Page Forms|Page Forms]], [[Special:MyLanguage/Extension:Page Schemas|Page Schemas]]). Cargo provides some or all of the functionality of Semantic MediaWiki, Semantic Result Formats, Maps, Semantic Drilldown, Semantic Compound Queries, Semantic Internal Objects and Semantic Scribunto.</span><ref>[[Extension:Cargo/Cargo and Semantic MediaWiki]].</ref> | {{ll|Extension:ContactManager|ContactManager}} |{{ll|Extension:Lua|Lua}} | |} <div lang="en" dir="ltr" class="mw-content-ltr"> == Alternative comparisons == </div> * {{ll|Extension:Cargo/Cargo and Semantic MediaWiki|2=<span lang="en" dir="ltr" class="mw-content-ltr">Cargo and Semantic MediaWiki</span>}} * <span lang="en" dir="ltr" class="mw-content-ltr">[https://professional.wiki/en/articles/managing-data-in-mediawiki Semantic MediaWiki vs Wikibase vs Cargo] by [https://professional.wiki Professional Wiki]</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references/> <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{ll|Multi-Content Revisions}} – <span lang="en" dir="ltr" class="mw-content-ltr">Ability to manage different independent content objects on the same wiki page</span> * {{ll|Extension:WikiDB|WikiDB}} – <span lang="en" dir="ltr" class="mw-content-ltr">Provides database features, somewhat similar to semantic properties</span> * {{ll|Extension:JsonConfig|JsonConfig}} – <span lang="en" dir="ltr" class="mw-content-ltr">store JSON (including tabular and map data) in wiki pages, and allow accessing them via Lua; no query support</span> * {{ll|Extension:External Data|External Data}} – <span lang="en" dir="ltr" class="mw-content-ltr">access data from external URL, local file, and SQL or MongoDB database</span> * {{ll|Structured data across Wikimedia}} – <span lang="en" dir="ltr" class="mw-content-ltr">2021-2023 project for improving structured data support in MediaWiki</span> * {{ll|Category:Data management extensions}} [[Category:MediaWiki Introduction{{#translation:}}]] [[Category:Extension comparisons{{#translation:}}]] n7gzyjfm0y0o1d0j0o1n6en4l8c0jqi Extension:TimedMediaHandler/VideoJS Player/fr 102 1011707 8364359 8363686 2026-05-03T13:12:15Z FuzzyBot 451990 Updating to match new version of source page 8364359 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Capture d'écran du lecteur VideoJS en action]] Le '''lecteur VideoJS''' est le lecteur vidéo de MediaWiki pour les projets Wikimedia. Il est basé sur [https://videojs.com/ VideoJS], et possède une interface utilisateur moderne, rapide, et compatible avec les appareils mobiles et HTML5. <span id="Usage"></span> == Utilisation == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Exemple de lecteur vidéo]] [[File:Armstrong Small Step.ogg|thumb|Exemple de lecteur audio]] Il possède à la fois un lecteur audio et un lecteur vidéo. Cette page présente des exemples de ces deux lecteurs. Une fois le lecteur lancé, vous verrez une barre de contrôle quand vous agirez sur la vidéo. [[File:VideoJS controlbar.png|frameless|350px]] Les commandes sont, de gauche à droite : <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;Bouton lecture/pause * [[File:VideoJS volume control.png|30px|]]&nbsp;Réglage du volume * Progression de la lecture * Temps de lecture restant * [[File:VideoJS subtitle control.png|30px|]]&nbsp;Sélecteur de langue des sous-titres et boutons de réglage du style des sous-titres. * [[File:VideoJS resolution control.png|30px|]]&nbsp;Sélecteur de résolution * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;Bouton "Image incrustée dans l'image" éventuel * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;Bouton plein écran * [[File:VideoJS file description control.png|30px|]]&nbsp;Bouton "info" pour accéder à la page de description du fichier <span id="Mouse_and_keyboard_controls"></span> === Commandes avec la souris et le clavier === * Cliquez sur l'icône de lecture au-dessus de la miniature pour commencer la lecture du média. * Clic droit ou clic molette sur la miniature pour ouvrir la page de description du fichier * Lancez et mettez en pause le lecteur avec un simple clic à l'intérieur de sa fenêtre * Double-cliquez sur la fenêtre du lecteur pour passer en mode plein écran ou en sortir * Les commandes au clavier disponibles sont les suivantes : *; {{Key press|k}} / {{Key press|Space}} : Lancer/mettre en pause la lecture du média *; {{Key press|f}} : Passer en/sortir du plein écran *; {{Key press|m}} : Couper le son *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * Le lecteur est intégralement utilisable avec le clavier en utilisant les touches {{button|Tab}}, {{button|Entrée}} et {{button|Espace}} <span id="Known_issues"></span> == Problèmes connus == Le lecteur vidéo est toujours en développement, mais si vous rencontrez des problèmes, merci de les signaler sur la [[Extension_talk:TimedMediaHandler/VideoJS Player|page de discussion]] ou de créer un rapport sur [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. <span id="Developers"></span> == Développeurs == Les développeurs qui travaillent sur les fonctionnalités impliquant le lecteur ''Video.js'', devront l'initialiser et le configurer correctement. Vous trouverez ci-après un exemple typique d'utilisation. <span id="Basic_Configuration_Example"></span> === Exemple de configuration de base === {{Note |1=Cette partie est ancienne et devrait être retravaillée afin de montrer l'utilisation de nos conteneurs (wrappers) qui appliquent des options et des paramètres cohérents pour la lecture avec ''VideoJS''. |2=gotcha }} <syntaxhighlight lang="js"> // Le premier argument peut être un ID de chaîne ou un élément <video> var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* tableau de fichiers source de taille et formats variés */ ] } ); </syntaxhighlight> Le <code>sources</code> peut également être fourni dans l'élément HTML {{tag|video|open}} au lieu d'être dans le JS : <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <span id="Advanced_configuration_with_Ogv.js_support"></span> === Configuration avancée avec prise en charge de Ogv.js === Si vous avez besoin de lire des fichiers OGG ou WebM inter-plateformes (beaucoup de fichiers de Commons ont ces formats), vous pouvez utiliser le [https://github.com/hartman/videojs-ogvjs greffon Ogv.js pour Video.js] également inclus dans TimedMediaHandler. Exemple de configurationː <syntaxhighlight lang="js"> var player; // charger les modules appropriés dans le ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // charger ogvjs si besoin; et quand c'est fini, // tout le code nécessaire est chargé return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* tableau des sources */ ], // configuration spécifique à Ogv.js ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 4yr57fx8u55p6kju7umuu5w8wsslrmo 8364775 8364359 2026-05-03T23:14:40Z FuzzyBot 451990 Updating to match new version of source page 8364775 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Capture d'écran du lecteur VideoJS en action]] Le '''lecteur VideoJS''' est le lecteur vidéo de MediaWiki pour les projets Wikimedia. Il est basé sur [https://videojs.com/ VideoJS], et possède une interface utilisateur moderne, rapide, et compatible avec les appareils mobiles et HTML5. <span id="Usage"></span> == Utilisation == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Exemple de lecteur vidéo]] [[File:Armstrong Small Step.ogg|thumb|Exemple de lecteur audio]] Il possède à la fois un lecteur audio et un lecteur vidéo. Cette page présente des exemples de ces deux lecteurs. Une fois le lecteur lancé, vous verrez une barre de contrôle quand vous agirez sur la vidéo. [[File:VideoJS controlbar.png|frameless|350px]] Les commandes sont, de gauche à droite : <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;Bouton lecture/pause * [[File:VideoJS volume control.png|30px|]]&nbsp;Réglage du volume * Progression de la lecture * Temps de lecture restant * [[File:VideoJS subtitle control.png|30px|]]&nbsp;Sélecteur de langue des sous-titres et boutons de réglage du style des sous-titres. * [[File:VideoJS resolution control.png|30px|]]&nbsp;Sélecteur de résolution * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;Bouton "Image incrustée dans l'image" éventuel * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;Bouton plein écran * [[File:VideoJS file description control.png|30px|]]&nbsp;Bouton "info" pour accéder à la page de description du fichier <span id="Mouse_and_keyboard_controls"></span> === Commandes avec la souris et le clavier === * Cliquez sur l'icône de lecture au-dessus de la miniature pour commencer la lecture du média. * Clic droit ou clic molette sur la miniature pour ouvrir la page de description du fichier * Lancez et mettez en pause le lecteur avec un simple clic à l'intérieur de sa fenêtre * Double-cliquez sur la fenêtre du lecteur pour passer en mode plein écran ou en sortir * Les commandes au clavier disponibles sont les suivantes : *; {{Key press|k}} / {{Key press|Space}} : Lancer/mettre en pause la lecture du média *; {{Key press|f}} : Passer en/sortir du plein écran *; {{Key press|m}} : Couper le son *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * Le lecteur est intégralement utilisable avec le clavier en utilisant les touches {{button|Tab}}, {{button|Entrée}} et {{button|Espace}} <span id="Known_issues"></span> == Problèmes connus == Le lecteur vidéo est toujours en développement, mais si vous rencontrez des problèmes, merci de les signaler sur la [[Extension_talk:TimedMediaHandler/VideoJS Player|page de discussion]] ou de créer un rapport sur [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. <span id="Developers"></span> == Développeurs == Les développeurs qui travaillent sur les fonctionnalités impliquant le lecteur ''Video.js'', devront l'initialiser et le configurer correctement. Vous trouverez ci-après un exemple typique d'utilisation. <span id="Basic_Configuration_Example"></span> === Exemple de configuration de base === {{Note|1=Cette partie est ancienne et devrait être retravaillée afin de montrer l'utilisation de nos conteneurs (wrappers) qui appliquent des options et des paramètres cohérents pour la lecture avec ''VideoJS''.|2=gotcha}} <syntaxhighlight lang="js"> // Le premier argument peut être un ID de chaîne ou un élément <video> var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* tableau de fichiers source de taille et formats variés */ ] } ); </syntaxhighlight> Le <code>sources</code> peut également être fourni dans l'élément HTML {{tag|video|open}} au lieu d'être dans le JS : <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <span id="Advanced_configuration_with_Ogv.js_support"></span> === Configuration avancée avec prise en charge de Ogv.js === Si vous avez besoin de lire des fichiers OGG ou WebM inter-plateformes (beaucoup de fichiers de Commons ont ces formats), vous pouvez utiliser le [https://github.com/hartman/videojs-ogvjs greffon Ogv.js pour Video.js] également inclus dans TimedMediaHandler. Exemple de configurationː <syntaxhighlight lang="js"> var player; // charger les modules appropriés dans le ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // charger ogvjs si besoin; et quand c'est fini, // tout le code nécessaire est chargé return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* tableau des sources */ ], // configuration spécifique à Ogv.js ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> jzweil0sspuhqmpfpaev8phyh9xibuk Manual:Managing data in MediaWiki/zh 100 1019419 8364312 8363597 2026-05-03T12:44:51Z FuzzyBot 451990 Updating to match new version of source page 8364312 wikitext text/x-wiki <languages/> {{NoteTA|G1=IT|G2=MediaWiki}} MediaWiki 最初的设计是为了管理主要由自由格式的文本和图像构成的内容。 MediaWiki 的结构支持比较有限:{{ll|Help:Namespaces|命名空间}}、{{ll|Help:Subpages|子页面}}和{{ll|Help:Categories|分类}}可以把相似的页面归在一起,而{{ll|Infobox|信息框}}和{{ll|Gallery|画廊}}等功能则能帮助整理页面内部的内容。 不过,MediaWiki 本身并没有内建管理结构化数据的功能。这类数据往往需要支持查询、过滤,有时还要能用表格、图表、地图<ref>参见 [[Wikimedia Maps]]</ref>或日历等方式进行可视化展示。 为满足这些需求,人们通常会使用一些专门的[[Special:MyLanguage/Manual:Extensions|扩展]]。 下表展示的是一些扩展,它们可以把用户编辑的数据存进 MediaWiki 数据库,并在之后进行查询。 不过,这并不是所有结构化数据功能的完整列表;在“[[#See also|另请参阅]]”部分,还列有其他可用于存储或展示结构化数据的扩展和功能。 {| class="wikitable" |- ! 功能 ! [[File:20210702_Semantic_MediaWiki_logo_with_wordmark.png|100px]]<br/>[https://www.semantic-mediawiki.org/ Semantic MediaWiki] ! [[File:Wikibase_Suite_Vertical_2x_RGB.png|100px]]<br/>[https://wikiba.se/ Wikibase] ! [[File:Cargo logo.png|50px]]<br/>{{ll|Extension:Cargo|nsp=0}} ! {{ll|Extension:VisualData|VisualData}} !{{ll|Extension:Bucket|Bucket}} ! {{ll|Extension:NeoWiki|NeoWiki}} |- | 主要使用情况 | 使用MediaWiki安装以管理数据,基于[[:zh:语义网|语义网]]标准。 | 为[[w:Wikidata|维基数据]]和其他可编辑的图数据库(graph database)提供支持。 | 在MediaWiki安装内管理数据。 | 在基于JSON-schema的MediaWiki安装中管理数据。 |lightweight Lua interface for storing and accessing structured data on wiki pages |Knowledge management system that combines collaborative editing and a [[:en:knowledge_graph|knowledge graph]] |- | 方法 | 数据(属性)是在标准的维基文本中或者通过模板来注解的。 若数据类型为“reference”,则属性可以用来使用statements来描述项。<ref>https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data</ref> | 属性是使用statements来定义的并用于描述项。 | 数据存储在数据库表中,每个表对应一个模板。 | -{zh-cn:数据存储在使用JSON内容模型的专用插槽中; zh-tw:資料儲存在使用JSON內容模型的專用插槽中; zh-hk:資料儲存在使用JSON內容模型的專用插槽中;}- |Data is stored in '''buckets''', which are database tables with specific columns that you can define |Schemas can be defined and applied to wiki pages, stored in a dedicated slot as JSON data. |- | 最早可用时间 | 2005 | 2012 | 2015 | 2022 -{zh-cn:(以前称为 {{ll|Extension:PageProperties|PageProperties}}); zh-tw:(以前稱為 {{ll|Extension:PageProperties|PageProperties}}); zh-hk:(前稱 {{ll|Extension:PageProperties|PageProperties}}); zh-sg:(以前称为 {{ll|Extension:PageProperties|PageProperties}}); zh-my:(以前称为 {{ll|Extension:PageProperties|PageProperties}}); zh-mo:(前稱 {{ll|Extension:PageProperties|PageProperties}});}- |2025 |2026 |- | 活跃安装数 | 1000<ref>https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki</ref> | 100<ref>https://wikiapiary.com/wiki/Extension:WikibaseRepository</ref><ref>https://wikibase.world</ref><ref>https://addshore.com/2024/10/visualizing-wikibase-connections-using-wikibase-world/</ref> | 100<ref>https://wikiapiary.com/wiki/Extension:Cargo</ref> | -{zh-cn:不适用(新扩展或未知); zh-tw:不適用(新擴充套件或未知); zh-hk:不適用(新擴充套件或未知); zh-sg:不适用(新扩展或未知); zh-my:不适用(新扩展或未知); zh-mo:不適用(新擴充套件或未知);}- | | |- | 社群 | 超过190位开发者<ref>https://www.openhub.net/p/smw</ref> | 超过172位开发者<ref>https://github.com/wikimedia/mediawiki-extensions-Wikibase</ref> | 超过63位开发者<ref>https://github.com/wikimedia/mediawiki-extensions-Cargo</ref> | ([[User:Thomas-topway-it|-{zh-cn:主要开发者; zh-tw:主要開發者;}-]]) |[https://weirdgloop.org/discord Weird Gloop's Discord] |[https://echolot-eccch.eu/ ECHOLOT project], [https://professional.wiki/ Professinal Wiki], [https://knowledge.wiki KM-A], [https://bluespice.com/bluespice-galaxy/ BlueSpice Galaxy] |- | 存储 | MediaWiki数据库、Elasticsearch、5个不同的SPARQL存储<ref>https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore</ref> | MediaWiki数据库、Elasticsearch、SPARQL存储(Blazegraph用于wikidata.org) | MediaWiki数据库(或者单独的数据库)<ref>{{ll|Extension:Cargo/Download and installation#Setting the Cargo database}}</ref> | -{zh-cn:MediaWiki数据库; zh-tw:MediaWiki資料庫; zh-hk:MediaWiki資料庫; zh-sg:MediaWiki数据库; zh-my:MediaWiki数据库; zh-mo:MediaWiki資料庫;}- |MediaWiki database (MySQL/MariaDB) |different SPARQL stores, currently Neo4J |- | 属性定义 | 通过输入维基文本。 属性可以自由产生。 这些属性默认为数据类型页面并且可以稍后定义。 -{zh-cn:数据类型可以随时更改; zh-tw:資料類型可以隨時更改;}- | 使用属性之前需要先定义,不能随意改变。<ref>[[d:Help:Data type#Changing datatype]]</ref> | 不使用属性,数据表是使用每个表的预定义好(但可以重新配置)的字段集合定义的。 | -{zh-cn:属性是通过一个或多个由{{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}}定义的JSON模式来定义的; zh-tw:屬性是透過一個或多個由{{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}}定義的JSON架構來定義的; zh-hk:屬性是透過一個或多個由{{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}}定義的JSON架構來定義的; zh-sg:属性是通过一个或多个由{{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}}定义的JSON模式来定义的; zh-my:属性是通过一个或多个由{{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}}定义的JSON模式来定义的; zh-mo:屬性是透過一個或多個由{{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}}定義的JSON架構來定義的;}- |Tables in the Bucket: namespace |Form based schema editing |- | 值声明 | 行内(<code><nowiki>[[MyProperty::MyValue]]</nowiki></code>)或使用模板。 带有{{ll|Extension:Page_Forms|Page Forms}}的基于表格的数据项。 | Wikibase默认为类似于表格的输入界面。 | 使用模板中的解析器函数 带有{{ll|Extension:Page_Forms|Page Forms}}的基于表格的数据项。 | -{zh-cn:从JSON模式自动生成的内联或弹出式{{ll|Extension:VisualData/Forms|forms}}; zh-tw:從JSON架構自動產生的行內或彈出式{{ll|Extension:VisualData/Forms|forms}}; zh-hk:從JSON架構自動產生的內嵌或彈出式{{ll|Extension:VisualData/Forms|forms}}; zh-sg:从JSON模式自动生成的内联或弹出式{{ll|Extension:VisualData/Forms|forms}}; zh-my:从JSON模式自动生成的内联或弹出式{{ll|Extension:VisualData/Forms|forms}}; zh-mo:從JSON架構自動產生的內嵌或彈出式{{ll|Extension:VisualData/Forms|forms}};}- |via Lua call of the <code>bucket.put</code> function |OOUI based form editing |- | 预定义的数据类型 | 18<ref>https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes</ref> | 17<ref>[[d:Special:ListDatatypes]]</ref><ref>-{zh-cn:某些数据类型由其他扩展定义:[[Special:MyLanguage/Extension:Math|Math]]和[[Special:MyLanguage/Extension:Score|Score]]各定义一个数据类型,[[Special:MyLanguage/Extension:JsonConfig|JsonConfig]]定义两个,[[Special:MyLanguage/Extension:WikibaseLexeme|WikibaseLexeme]]定义三个,而Wikibase定义十个。; zh-tw:某些資料類型由其他擴充套件定義:[[Special:MyLanguage/Extension:Math|Math]]和[[Special:MyLanguage/Extension:Score|Score]]各定義一個資料類型,[[Special:MyLanguage/Extension:JsonConfig|JsonConfig]]定義兩個,[[Special:MyLanguage/Extension:WikibaseLexeme|WikibaseLexeme]]定義三個,而Wikibase定義十個。;}-</ref> | 18 | -{zh-cn:4(基础JSON模式类型)+15种字符串格式; zh-tw:4(基礎JSON架構類型)+15種字串格式; zh-hk:4(基礎JSON架構類型)+15種字串格式; zh-sg:4(基础JSON模式类型)+15种字符串格式; zh-my:4(基础JSON模式类型)+15种字符串格式; zh-mo:4(基礎JSON架構類型)+15種字串格式;}- | 5 <ref>https://meta.weirdgloop.org/w/Extension:Bucket#Basic_usage</ref> | |- | 属性管理 | 类型定义、约束模式、本体导入 | 自定义或导入维基数据本体 | 不使用属性,数据表是使用每个表的预定义好(但可以重新配置)的字段集合定义的。 | -{zh-cn:通过图形界面(专用{{ll|Extension:VisualData/Schema Builder|SchemaBuilder}}); zh-tw:透過圖形介面(專用{{ll|Extension:VisualData/Schema Builder|SchemaBuilder}}); zh-hk:透過圖形介面(專用{{ll|Extension:VisualData/Schema Builder|SchemaBuilder}}); zh-sg:通过图形界面(专用{{ll|Extension:VisualData/Schema Builder|SchemaBuilder}}); zh-my:通过图形界面(专用{{ll|Extension:VisualData/Schema Builder|SchemaBuilder}}); zh-mo:透過圖形介面(專用{{ll|Extension:VisualData/Schema Builder|SchemaBuilder}});}- | |through a graphical interface |- | -{zh-cn:页面名称和内部链接; zh-tw:頁面名稱和內部連結;}- | -{zh-cn:页面有正常名称,并且可以通过其名称进行链接。; zh-tw:頁面有正常名稱,並且可以透過其名稱進行連結。; zh-hk:頁面有正常名稱,並且可以透過其名稱進行連結。; zh-sg:页面有正常名称,并且可以通过其名称进行链接。; zh-my:页面有正常名称,并且可以通过其名称进行链接。; zh-mo:頁面有正常名稱,並且可以透過其名稱進行連結。;}- | -{zh-cn: 页面名称使用其Q编号存储(在可用语言中显示标签)。内部链接必须链接到Q编号;不能链接到标签。; zh-tw: 頁面名稱使用其Q編號儲存(在可用語言中顯示標籤)。內部連結必須連結到Q編號;不能連結到標籤。; zh-hk: 頁面名稱使用其Q編號儲存(在可用語言中顯示標籤)。內部連結必須連結到Q編號;不能連結到標籤。; zh-sg: 页面名称使用其Q编号存储(在可用语言中显示标签)。内部链接必须链接到Q编号;不能链接到标签。; zh-my: 页面名称使用其Q编号存储(在可用语言中显示标签)。内部链接必须链接到Q编号;不能链接到标签。; zh-mo: 頁面名稱使用其Q編號儲存(在可用語言中顯示標籤)。內部連結必須連結到Q編號;不能連結到標籤。;}- | -{zh-cn:页面有正常名称,并且可以通过其名称进行链接。; zh-tw:頁面有正常名稱,並且可以透過其名稱進行連結。; zh-hk:頁面有正常名稱,並且可以透過其名稱進行連結。; zh-sg:页面有正常名称,并且可以通过其名称进行链接。; zh-my:页面有正常名称,并且可以通过其名称进行链接。; zh-mo:頁面有正常名稱,並且可以透過其名稱進行連結。;}- | -{zh-cn:模式存储在专用命名空间中,JSON数据存储在关联到维基页面的专用插槽中。; zh-tw:模式儲存在專用命名空間中,JSON資料儲存在關聯到維基頁面的專用插槽中。; zh-hk:模式儲存在專用命名空間中,JSON資料儲存在關聯到維基頁面的專用插槽中。; zh-sg:模式存储在专用命名空间中,JSON数据存储在关联到维基页面的专用插槽中。; zh-my:模式存储在专用命名空间中,JSON数据存储在关联到维基页面的专用插槽中。; zh-mo:模式儲存在專用命名空間中,JSON資料儲存在關聯到維基頁面的專用插槽中。;}- -{zh-cn: JSON数据可以通过wiki界面的扩展部分进行访问。; zh-tw: JSON資料可以透過wiki介面的擴充部分進行存取。; zh-hk: JSON資料可以透過wiki介面的擴充部分進行存取。; zh-sg: JSON数据可以通过wiki界面的扩展部分进行访问。; zh-my: JSON数据可以通过wiki界面的扩展部分进行访问。; zh-mo: JSON資料可以透過wiki介面的擴充部分進行存取。;}- | |MediaWiki pages can have schemas |- | 行内查询 | 有,有解析器函数 | 无(外部SPARQL查询); [[phab:T67626|计划中]]<br/>由第三方扩展{{ll|Extension:LinkedWiki|LinkedWiki}}支持 | 有,使用解析器函数 | -{zh-cn:是的,通过解析器函数; zh-tw:是的,透過解析器函式;}- | |yes, with parser functions via the SQL store |- | 外部查询 | <span class="mw-translate-fuzzy">是的,使用API或SPARQL查询(可通过特殊扩展获得,例如[[Extension:RDFIO|RDFIO]]和[[Extension:LinkedWiki|LinkedWiki]])</span> | 有,带有SPARQL查询服务 | 有,使用API | -{zh-cn:是的,通过API; zh-tw:是的,透過API; zh-hk:是的,透過API; zh-sg:是的,通过API; zh-my:是的,通过API; zh-mo:是的,透過API;}-<ref>{{ll|Extension:VisualData/API}}</ref> | API is not yet stable <ref>https://meta.weirdgloop.org/w/Extension:Bucket</ref> |yes, with an API or SPARQL endpoint |- | 结果格式<ref>“结果格式”指的是wiki以多种格式(例如表、日历、地图、时间线等)显示数据(行内查询结果)的能力</ref> | ~ 75<ref>https://www.semantic-mediawiki.org/wiki/Help:Result_formats</ref> | 无原生的结果显示;数据可以通过以下方式可视化: 查询服务或外部工具 通过Lua在wiki上访问数据(不提供查询) * {{ll|Extension:LinkedWiki}} - 第三方 | 约25<ref>{{ll|Extension:Cargo/Display formats}}</ref> | 12+ (Json, Table, Datatable, Template, Calendar, Carousel, Map, pageid, pagetitle, count, raw, Lua ) <ref>{{ll|Extension:VisualData/Result_formats}}</ref> | | |- | 开发 | [[github:SemanticMediaWiki/SemanticMediaWiki|GitHub]] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Cargo Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/VisualData Gerrit] |[[github:weirdgloop/mediawiki-extensions-Bucket|GitHub]] |[[github:ProfessionalWiki/NeoWiki|GItHub]] |- | 补充扩展 | ~ 40<ref>{{ll|Category:Semantic MediaWiki extensions}}</ref>, e.g. {{ll|Extension:Semantic Result Formats|Semantic Result Formats}}, {{ll|Extension:Semantic Bundle|Semantic Bundle}}, {{ll|Extension:Semantic Scribunto|Semantic Scribunto}} | ~12<ref>{{ll|Category:Wikibase extensions}}</ref>, e.g. {{ll|Extension:Wikibase Repository|Wikibase Repository}}, {{ll|Extension:Wikibase Client|Wikibase Client}}, {{ll|Extension:WikibaseLexeme|WikibaseLexeme}}, [https://wikiba.se/applications/#query-service Query Service] | 2 ([[Special:MyLanguage/Extension:Page Forms|Page Forms]], [[Special:MyLanguage/Extension:Page Schemas|Page Schemas]]). Cargo提供了Semantic MediaWiki、Semantic Result Formats、Maps、Semantic Drilldown、Semantic Compound Queries、Semantic Internal Objects和Semantic Scribunto的部分或全部功能。<ref>[[Extension:Cargo/Cargo and Semantic MediaWiki]].</ref> | {{ll|Extension:ContactManager|ContactManager}} |{{ll|Extension:Lua|Lua}} | |} <span id="Alternative_comparisons"></span> == 可选比较 == * {{ll|Extension:Cargo/Cargo and Semantic MediaWiki|2=Cargo和Semantic MediaWiki}} * -{zh-cn:[https://professional.wiki/en/articles/managing-data-in-mediawiki Semantic MediaWiki vs Wikibase vs Cargo],作者:[https://professional.wiki Professional Wiki]; zh-tw:[https://professional.wiki/en/articles/managing-data-in-mediawiki Semantic MediaWiki vs Wikibase vs Cargo],作者:[https://professional.wiki Professional Wiki];}- <span id="References"></span> == {{LC zh|lang = {{{lang|}}}|type = H|zh-hans = 参考资料|zh-hant = 參考資料}} == <references/> <span id="See_also"></span> == {{LC zh|lang = {{{lang|}}}|type = H|zh-hans = 参阅|zh-hant = 參閱}} == * {{ll|Multi-Content Revisions}} – <span class="mw-translate-fuzzy">通过对MediaWiki后端的技术更改,能够在同一wiki页面上管理不同的独立内容对象。</span> * {{ll|Extension:WikiDB|WikiDB}} – 提供資料庫功能,有點類似於語義屬性。 * {{ll|Extension:JsonConfig|JsonConfig}} – 在wiki页面中存储JSON(包括表格和地图数据),并允许通过Lua访问数据,没有查询支持 * {{ll|Extension:External Data|External Data}} – <span class="mw-translate-fuzzy">从外部URL、本地文件、SQL或MongoDB数据库(可能包含非MediaWiki网站的数据)访问数据</span> * {{ll|Structured data across Wikimedia}} – -{zh-cn:2021-2023年MediaWiki结构化数据支持改进项目; zh-tw:2021-2023年MediaWiki結構化資料支援改進專案;}- * {{ll|Category:Data management extensions}} [[Category:MediaWiki Introduction{{#translation:}}]] [[Category:Extension comparisons{{#translation:}}]] 1aetg807a784ganrvn3wmyjhnpi34ni Extension:TimedMediaHandler/VideoJS Player/zh 102 1019825 8364373 8363701 2026-05-03T13:12:23Z FuzzyBot 451990 Updating to match new version of source page 8364373 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|執行中的 VideoJS 播放器截圖]] {{NoteTA|G1=IT|G2=MediaWiki}} '''VideoJS Player'''是在各個維基媒體專案中針對MediaWiki的視訊播放器。 它基于[https://videojs.com/ VideoJS],具有现代、快速的使用者介面 ,并與移动设备和HTML5兼容。 <span id="Usage"></span> == 用法 == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|影片播放器範例]] [[File:Armstrong Small Step.ogg|thumb|音樂播放器範例]] 同時提供音訊和視訊的播放器。 您可以在本頁面中找到這兩種播放器的範例。 啟動之後,您會看到與視訊互動時的控制列。 [[File:VideoJS controlbar.png|frameless|350px]] 操控從左至右依序為: <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;播放/暫停控制 * [[File:VideoJS volume control.png|30px|]]&nbsp;音量控制 * 播放進度條 * 剩餘播放時間 * [[File:VideoJS subtitle control.png|30px|]]&nbsp;字幕語言選擇器和字幕樣式控制 * [[File:VideoJS resolution control.png|30px|]]&nbsp;畫質調整選單 * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;可選的子母畫面切換鈕 * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;全螢幕切換鈕 * [[File:VideoJS file description control.png|30px|]]&nbsp;前往檔案描述頁的資訊鈕 <span id="Mouse_and_keyboard_controls"></span> === 滑鼠與鍵盤操作方式 === * 点击缩略图上方的播放图标,即可开始播放该媒体文件。 * 右键或中键单击缩略图,即可打开文件说明页面 * 在播放器窗口内单击鼠标即可播放/暂停播放器 * 双击播放器窗口即可进入或退出全屏模式 * 可使用以下键盘控制键: *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : 進入/離開全螢幕 *; {{Key press|m}} : 靜音 *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * 播放器可完全通过键盘操作,使用Tab键、回车键和空格键进行交互 <span id="Known_issues"></span> == 已知問題 == 视频播放器仍在开发中,但若您发现任何问题,请在[[Extension_talk:TimedMediaHandler/VideoJS Player|讨论页]]上报告,或在[https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]中提出。 <span id="Developers"></span> == 开发人员 == 開發人員在開發使用 Video.js 播放器的功能時,需要適當地初始化和設定它。 以下是典型的使用範例。 <span id="Basic_Configuration_Example"></span> === 基本配置範例 === {{Note |1=此内容已过时,应重新进行调整,以使用我们的播放器封装组件,该组件会为视频JS播放应用统一的选项与设置。 |2=gotcha }} <syntaxhighlight lang="js"> // 第一个参数可以是字符串ID或<video>元素 var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* 由不同大小和格式的源文件组成的数组 */ ] } ); </syntaxhighlight> <code>sources</code>也可以在HTML {{tag|video|open}}元素中提供,而非在JavaScript中: <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> 如果你需要跨平台播放OGG或WebM文件(维基共享资源中的许多文件均采用这些格式),可使用[https://github.com/hartman/videojs-ogvjs 适用于Video.js的Ogv.js插件],该插件同样已集成在TimedMediaHandler中。 <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> cg8ahpa3iqgqb5vax5sq8fjy3h22cmm 8364789 8364373 2026-05-03T23:14:47Z FuzzyBot 451990 Updating to match new version of source page 8364789 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|執行中的 VideoJS 播放器截圖]] {{NoteTA|G1=IT|G2=MediaWiki}} '''VideoJS Player'''是在各個維基媒體專案中針對MediaWiki的視訊播放器。 它基于[https://videojs.com/ VideoJS],具有现代、快速的使用者介面 ,并與移动设备和HTML5兼容。 <span id="Usage"></span> == 用法 == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|影片播放器範例]] [[File:Armstrong Small Step.ogg|thumb|音樂播放器範例]] 同時提供音訊和視訊的播放器。 您可以在本頁面中找到這兩種播放器的範例。 啟動之後,您會看到與視訊互動時的控制列。 [[File:VideoJS controlbar.png|frameless|350px]] 操控從左至右依序為: <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;播放/暫停控制 * [[File:VideoJS volume control.png|30px|]]&nbsp;音量控制 * 播放進度條 * 剩餘播放時間 * [[File:VideoJS subtitle control.png|30px|]]&nbsp;字幕語言選擇器和字幕樣式控制 * [[File:VideoJS resolution control.png|30px|]]&nbsp;畫質調整選單 * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;可選的子母畫面切換鈕 * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;全螢幕切換鈕 * [[File:VideoJS file description control.png|30px|]]&nbsp;前往檔案描述頁的資訊鈕 <span id="Mouse_and_keyboard_controls"></span> === 滑鼠與鍵盤操作方式 === * 点击缩略图上方的播放图标,即可开始播放该媒体文件。 * 右键或中键单击缩略图,即可打开文件说明页面 * 在播放器窗口内单击鼠标即可播放/暂停播放器 * 双击播放器窗口即可进入或退出全屏模式 * 可使用以下键盘控制键: *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : 進入/離開全螢幕 *; {{Key press|m}} : 靜音 *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * 播放器可完全通过键盘操作,使用Tab键、回车键和空格键进行交互 <span id="Known_issues"></span> == 已知問題 == 视频播放器仍在开发中,但若您发现任何问题,请在[[Extension_talk:TimedMediaHandler/VideoJS Player|讨论页]]上报告,或在[https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]中提出。 <span id="Developers"></span> == 开发人员 == 開發人員在開發使用 Video.js 播放器的功能時,需要適當地初始化和設定它。 以下是典型的使用範例。 <span id="Basic_Configuration_Example"></span> === 基本配置範例 === {{Note|1=此内容已过时,应重新进行调整,以使用我们的播放器封装组件,该组件会为视频JS播放应用统一的选项与设置。|2=gotcha}} <syntaxhighlight lang="js"> // 第一个参数可以是字符串ID或<video>元素 var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* 由不同大小和格式的源文件组成的数组 */ ] } ); </syntaxhighlight> <code>sources</code>也可以在HTML {{tag|video|open}}元素中提供,而非在JavaScript中: <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> 如果你需要跨平台播放OGG或WebM文件(维基共享资源中的许多文件均采用这些格式),可使用[https://github.com/hartman/videojs-ogvjs 适用于Video.js的Ogv.js插件],该插件同样已集成在TimedMediaHandler中。 <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> dh479qihg8kfiu1zlg99d3z9pfa42xf OAuth/For Developers/ko 0 1025154 8364290 8350296 2026-05-03T12:27:48Z FuzzyBot 451990 Updating to match new version of source page 8364290 wikitext text/x-wiki <languages /> <div lang="en" dir="ltr" class="mw-content-ltr"> This page explains how to develop applications that can integrate with a wiki running {{ll|Extension:OAuth}} (an extension which turns MediaWiki into an [[w:OAuth|OAuth]] server) to securely request permission to act on the user's behalf. </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you are developing a bot or similar application that always uses the same account, you might prefer the simpler [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]].</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> == OAuth in a nutshell == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> OAuth allows an application to request permission from a user to act through that user's wiki account, without knowing the user's password, and without being able to do everything the user could (e.g. the app might be able to edit articles but not delete them, so even users with extended permissions can safely use OAuth-enabled tools). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This happens via the [https://oauth.net/2/ OAuth 2.0] or [https://oauth.net/core/1.0a/ OAuth 1.0a] protocol, and consists of three stages: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">The developer must register the application (often called "consumer" in the OAuth terminology) on the wiki, possibly go through some sort of review process, and will receive some credentials.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">When a user wants to use it, the application must initiate an authorisation process.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will involve sending the user to a special page on the wiki, which will display an authorisation dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the user accepts, the application will receive another set of credentials (which are specific to that user, and can be revoked by the user at any time).</span> # <span lang="en" dir="ltr" class="mw-content-ltr">When the application actually needs to make an action (API request) on the user's behalf, it can combine the credentials received in steps 1 and 2 to sign the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth is a widely used open standard (you can see it on sites like Google or Facebook or GitHub, e.g. when using accounts at those sites to log in elsewhere).</span> {{info|1=<span lang="en" dir="ltr" class="mw-content-ltr">OAuth should not be confused with:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Initiative for Open Authentication|OATH]] (a second-factor authentication protocol family, commonly known as "type the six numbers you see on your mobile app", now enabled on Wikimedia sites)</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:OpenID Connect|OpenID Connect]] (an authentication protocol based on OAuth 2.0, which the OAuth MediaWiki extension partially supports).</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> For a slightly larger nutshell on OAuth 1.0a, see [https://docs.google.com/presentation/d/1537HnwSaSzH-b8hINcz48SNhT8ElAUPC39to0_O1iNA/edit#slide=id.g15105b408d_0_287 these slides]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == OAuth in detail == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The registration is basically the same for OAuth 1.0a and OAuth 2, with the difference being only the presence of a few form fields. The remaining parts differ significantly depending on the OAuth version.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Generally, OAuth 2 is recommended if available in your environment.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Registration === </div> <span lang="en" dir="ltr" class="mw-content-ltr">To register a new OAuth application, submit the form at <code>[[m:Special:OAuthConsumerRegistration/propose|Special:OAuthConsumerRegistration/propose]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Try to give sufficient information about the application for admins and users to decide whether it can be trusted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">URLs to places with more information (such as the application itself, the source code or on-wiki documentation) can be useful.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For OAuth applications to be used on Wikimedia projects, see [[meta:Special:MyLanguage/OAuth app guidelines|app guidelines]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Besides the descriptive ones, the fields have the following meaning:</span> * <code>This consumer is for use only by {{tag|user|open|plain=1}}</code>: <span lang="en" dir="ltr" class="mw-content-ltr">whether you use [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]] (which do not need to be reviewed or authorised but are only usable by yourself).</span> * <code>callback URL</code> (<span lang="en" dir="ltr" class="mw-content-ltr">irrelevant to owner-only consumers</span>): <span lang="en" dir="ltr" class="mw-content-ltr">the URL where the user returns after authorisation is checked against this.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(This is an extra layer of security against an attacker trying to steal credentials during authorisation.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>use as prefix</code> option is enabled, the URL must start with this (the check is dumb so make sure to add at least a <code>/</code> after the domain name), otherwise it must be an exact match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you are developing/testing your local machine, specify [[w:Localhost|Localhost]] in this field (e.g. <code><nowiki>http://localhost:8080/</nowiki></code>).</span> * <code>Applicable project</code> (<span lang="en" dir="ltr" class="mw-content-ltr">for wiki farms only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">project(s) on which to use your application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can limit the application to a single wiki or have it work everywhere.</span> * <code>Types of grants</code> / <code>Applicable grants</code>: <span lang="en" dir="ltr" class="mw-content-ltr">the permissions needed by your application (be conservative). The actual permissions will be an intersection of this and what permissions the user has.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Currently, the user must authorise grouped permissions, not individual ones ([[Phab:T59505|T59505]]).</span> * <code>Allowed IP ranges</code>: <span lang="en" dir="ltr" class="mw-content-ltr">an optional specification of the IP ranges that you use, where OAuth requests not matching this will be rejected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is an extra layer of security against an attacker stealing your application's credentials and trying to impersonate it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> * <code>Public RSA key</code> (<span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">public key used by your application for signing requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can just leave this empty (most applications do) to use a slightly simpler shared-secret mechanism instead.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> <span lang="en" dir="ltr" class="mw-content-ltr">After registration, you'll receive the credentials needed to use OAuth.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to use it immediately with your own user account (this is meant for testing); others will only be able to use it once it is approved by an administrator.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The list of applications (approved or otherwise) is public and can be browsed at <code>[[m:Special:OAuthListConsumers|Special:OAuthListConsumers]]</code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === OAuth 1.0a === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Authorisation ==== </div> [[File:OAuth authorization interface.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Authorisation dialog shown to users</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> When registering the application, you receive two pieces of credentials: the application token (a public ID for the application) and the application secret (sort of like a password). </div> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another set of credentials (these ones specific to that user): the access token and access secret.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">With an RSA key the credentials are slightly different.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is assumed that people choosing to use an RSA key know what they are doing, so this tutorial will assume you have chosen the non-RSA option.</span> </ref> <span lang="en" dir="ltr" class="mw-content-ltr">To get them, you need to go through the authorisation process, which consists of three steps:</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|OAuth/Owner-only consumers|owner-only consumers}} for that.</span> </ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Get a request token from the wiki by sending a GET request to <code>Special:OAuth/initiate</code>, signed with the application key and secret, with the callback URL (where the user will be sent after a successful authorisation) passed as the <code>oauth_callback</code> query parameter (if you have set a constant URL at registration, the value of the parameter ''must'' be <code>oob</code>).</span><ref name="non-nice-url"><span lang="en" dir="ltr" class="mw-content-ltr">Due to [[phab:T59500]] you must currently use a non-nice URL such as <code>en.wikipedia.org/w/index.php?title=Special:OAuth/initiate</code>.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">If you are successful, the response will be a JSON object with <code>token</code> and <code>key</code> fields—the request token and request secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If not, it will have an <code>error</code> field.)</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>Special:OAuth/authorize</code>, with the application token and request token passed as query parameters (<code>oauth_consumer_key</code> and <code>oauth_token</code>, respectively).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>oauth_verifier</code> will contain the verification code that you can use to exchange the request token and secret for the access token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a request to <code>Special:OAuth/token</code><ref name="non-nice-url" /> which includes the <code>oauth_verifier</code> parameter you just received and is signed with the application token and secret and the request token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token/secret (in the same format as the request token/secret in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token and secret is what you'll need to sign API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The request token and secret is not useful anymore and can be discarded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token will remain valid indefinitely, unless the user revokes it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If you prefer not to store it, you can just repeat the authorisation process at any time though.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Applications which only need minimal privileges (have been registered as ''User identity verification only'') can use <code>/authenticate</code> instead of <code>/authorize</code> in step 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This works the same way, but the user will only see the authorisation dialog if they have not authorised this application before; otherwise the authorisation will silently succeed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure, so you don't have to implement it manually—each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Making requests on the user's behalf ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to be signed with the application token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth, with one exception (see next section).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications registered as ''User identity verification only'' cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Identifying the user ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a custom protocol (similar to OpenID Connect) for authenticating the user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send a signed OAuth request to <code>Special:OAuth/identify</code>:</span><ref name="non-nice-url" /> <span lang="en" dir="ltr" class="mw-content-ltr">the response will be a [[w:JSON Web Token|JWT]] (JSON Web Token &ndash; a signed JSON object) including the name of the user, their {{ll|Manual:Central ID|central ID}} (under the key <code>sub</code>) and various other information (such as their user groups and whether they are blocked; also the email address if the application was registered with the right grant type).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is more secure than using the API (e.g. the userinfo module) for authentication, which could be subject to [[w:Man-in-the-middle attack|man-in-the-middle attacks]]; always use this if you need to identify a user!</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also, make sure you properly validate the JWT (there are many libraries which can help with that).</span> <span lang="en" dir="ltr" class="mw-content-ltr">You should check each of the following: the issuer (<code>iss</code>) matches the domain name of the wiki, the audience (<code>aud</code>) matches your application key, the issued-at time (<code>iat</code>) is in the past and reasonably close to current time, the expiration time (<code>exp</code>) is in the future, the nonce (<code>nonce</code>) matches the one you sent in the request.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Signing requests ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Steps 1 and 3 of the authorisation process require signing the request; API requests and <code>Special:OAuth/identify</code> must likewise be signed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The signing process is detailed in [https://oauth.net/core/1.0a/#signing_process section 9 of the OAuth spec], but it is cumbersome to implement by hand and [https://oauth.net/1/ many libraries] are available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find code samples and an overview of how to do it by hand in the {{ll|OAuth/Owner-only_consumers|owner-only consumer}} documentation.</span> (<span lang="en" dir="ltr" class="mw-content-ltr">That is for signing with the consumer token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Modify as appropriate to sign with the consumer token/secret and request token/secret (authorisation step 3) or consumer token/secret only (authorisation step 1).</span>) <div lang="en" dir="ltr" class="mw-content-ltr"> === OAuth 2 === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Authorisation ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">When registering the application, you receive two pieces of credentials: the client application key (a public ID for the application, also called the client ID or consumer key) and the client application secret (a confidential password).</span> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another credential (this one specific to that user): the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To get it, you need to go through the [https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/ the OAuth 2 Authorization Code flow], which consists of two steps:</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See [[Special:MyLanguage/OAuth/Owner-only consumers|owner-only consumers]] for that.</span></ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>oauth2/authorize</code> under the wiki's REST endpoint (usually <code>rest.php</code>), with <code>response_type=code</code> and the consumer key (also called the client application key) as the <code>client_id</code>, possibly a <code>state</code> if you want, and optionally the <code>redirect_uri</code> (if yes, it must be the same as in your application request).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If your consumer is non-confidential, you'll also need to include a [https://www.oauth.com/oauth2-servers/pkce/authorization-request/ PKCE code challenge] (<code>code_challenge</code> and <code>code_challenge_method=S256</code>).</span><ref>PKCE &mdash; Proof Key for Code Exchange</ref> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>code</code> will contain the authorisation code that you can use to fetch the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a POST request to <code>oauth2/access_token</code> under the wiki's REST endpoint (usually <code>rest.php</code>), including <code>grant_type=authorization_code</code>, the <code>code</code> parameter you just received, your client authentication (typically as <code>client_id</code> and, for confidential clients, <code>client_secret</code>), the <code>redirect_uri</code> if and only if you specified it in the previous step (must be the same value for both), and if non-confidential the PKCE <code>code_verifier</code> and <code>code_challenge_method</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token and a refresh token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token is what you'll need to send future API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The refresh token can be used to [https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/ fetch a new access token] if the original access token expires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you prefer not to store either token, you can just repeat the authorisation process at any time.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(Before MediaWiki 1.46, non-confidential clients could only use refresh tokens using their client secret keys, not using their client IDs only, see [[phabricator:T323855|T323855]].)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure so you don't have to implement it manually - each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Making requests on the user's behalf ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to include the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the access token is used to fetch a CSRF token or other tokens, the access token must still be passed (as a header) with requests that use those tokens.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications which need minimal privileges (have been registered as ''User identity verification only'') cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> API requests including <code>rest.php/oauth2/resource/profile</code> must be authenticated with an HTTP Authorization header containing the access token, like: </div> <pre> Authorization: Bearer abcde....6789 </pre> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Identifying the user ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a somewhat incomplete implementation of OpenID Connect for authenticating the user.</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">See [[phab:T254063|T254063]] for details.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send an authenticated OAuth GET request to the <code>oauth2/resource/profile</code> API (MediaWiki's implementation of what the OIDC spec calls the UserInfo endpoint) under the wiki's REST endpoint (usually <code>rest.php</code>); the response will include the name of the user and various other information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that the GET request must use the HTTP <code>Authorization</code> header, not a query string token.</span> * '''sub''' <span lang="en" dir="ltr" class="mw-content-ltr">(central user ID)</span> * '''username''' * '''editcount''' * '''confirmed_email''' * '''blocked''' * '''registered''' * '''groups''' * '''rights''' * '''realname''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> * '''email''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Setting up a development environment == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> You can register an OAuth application on [https://meta.wikimedia.beta.wmflabs.org/wiki/Special:OAuthConsumerRegistration/propose beta meta] and test your code against that. </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you want to improve the extension itself, or debug protocol issues in detail, OAuth is available in the {{ll|MediaWiki-Vagrant}} development environment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Add the <code>oauth</code> role, and your local wiki will be able to authorise OAuth apps.</span> <syntaxhighlight lang="shell-session"> $ vagrant roles enable oauth $ vagrant provision </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Once the code is nearly ready, you can register an OAuth application on the real wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to test it with the same user account used for registering, even before it gets reviewed by admins.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If you are creating an application for Wikimedia projects, consider hosting it at [[Wikitech:Portal:Toolforge|Wikimedia Toolforge]], a free tool forge and hosting platform for Wikimedia-related services. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Security benefits and trade-offs == </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Unlike password-based authentication, the OAuth 1.0 protocol prevents any [[w:Man-in-the-middle attack|man-in-the-middle attack]] even if the wiki does not require HTTPS: all interactions between MediaWiki and the application are signed with either a shared secret (using HMAC-SHA1), or a [[w:Public-key cryptography|public key]] (RSA).</span> <span lang="en" dir="ltr" class="mw-content-ltr">HTTPS is still required for certain steps though (for obtaining the shared secret in the second step of authorisation when not using RSA, and during app registration).</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 2.0 does not involve signing and relies on HTTPS for security.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Actions via OAuth happen under the user's name but will be [[Special:MyLanguage/Manual:Tags|tagged]] with the application's name as well so rogue applications can be identified.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Wiki admins can revoke the application's permissions (and thus bar it from any further action) if needed.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The user can revoke the permission of the application to use that specific user account if they don't like how it works or don't trust it anymore.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Unlike a password change, this is not disruptive for the user.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Sufficiently flexible applications might allow users to circumvent IP blocks (since MediaWiki will see the IP of the application server, not that of the user).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This can be handled the same way proxies are, by trusting XFF headers set by the application (see [[Phab:T159889|T159889]] for some limitations).</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The application secret must be kept secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Submitting it to source control or putting it into user-accessible code (such as mobile app or desktop application; even if it is obfuscated) undermines the security model and will result in admins forcefully disabling the application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Exceptions are made for example applications demoing OAuth usage, if they are explicitly labeled as such and request limited rights.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Libraries == </div> === PHP === * [[oauthclient-php]] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a client library maintained by Wikimedia</span> * [https://php.net/book.oauth OAuth] – <span lang="en" dir="ltr" class="mw-content-ltr">PECL client library</span> * [https://github.com/firebase/php-jwt firebase/php-jwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a popular JWT library</span> * [https://sr.ht/~taavi/laravel-socialite-mediawiki/ laravel-socialite-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki driver for [[w:Laravel|Laravel]]'s [https://laravel.com/docs/7.x/socialite Socialite] library.</span> === Python === * [https://github.com/valhallasw/flask-mwoauth flask-mwoauth] – <span lang="en" dir="ltr" class="mw-content-ltr">a Flask blueprint to run OAuth against MediaWiki's Extension:OAuth (See tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Flask_OAuth_tool My first Flask OAuth tool])</span> * [https://github.com/wikimedia/MediaWiki-OAuth MediaWiki-OAuth (mwoauth)] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a on top of [http://requests-oauthlib.readthedocs.org/en/latest/oauth1_workflow.html requests-oauthlib]</span> * [https://github.com/python-social-auth/social-core python-social-auth] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework that includes a [https://github.com/python-social-auth/social-core/blob/master/social_core/backends/mediawiki.py MediaWiki backend] (Example tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Django_OAuth_tool My first Django OAuth tool])</span> * [https://docs.authlib.org/en/latest/index.html authlib] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework to interact with Wikimedia OAuth 2.0 API (Full minimal Django OAuth 2.0 [https://code.basabuuka.org/alpcentaur/wmde_oauth_django_example example])</span> * [https://github.com/jpadilla/pyjwt pyjwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a JWT library</span> === Ruby === * [https://github.com/timwaters/omniauth-mediawiki omniauth-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">a MediaWiki strategy for OmniAuth (also available as a [https://rubygems.org/gems/omniauth-mediawiki gem])</span> === Rust === * [https://crates.io/crates/mediawiki MediaWiki crate] <span lang="en" dir="ltr" class="mw-content-ltr">implements both OAuth1 and OAuth2 login mechanisms.</span> * [https://crates.io/crates/oauth2 oauth2 crate] === Node.js === * [https://www.npmjs.com/package/passport-mediawiki-oauth passport-mediawiki-oauth] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki strategy for the Passport auth framework (which can be used effortlessly as a middleware with Express JS and similar frameworks)</span> * [https://www.npmjs.com/package/oauth-fetch-json oauth-fetch-json] – <span lang="en" dir="ltr" class="mw-content-ltr">library for signing OAuth requests</span> * [https://www.npmjs.com/package/m3api-oauth2 m3api-oauth2] – an extension package for [https://www.npmjs.com/package/m3api m3api], making it easy to make requests authenticated via [[Special:MyLanguage/Help:OAuth|OAuth 2.0]] === Go === * [https://github.com/mrjones/oauth mrjones/oauth] (OAuth 1.0) * [https://pkg.go.dev/golang.org/x/oauth2 golang.org/x/oauth2] <span lang="en" dir="ltr" class="mw-content-ltr">(OAuth 2.0, [https://pkg.go.dev/golang.org/x/oauth2#example-Config example])</span> === Java === * [https://github.com/scribejava/scribejava ScribeJava] <span lang="en" dir="ltr" class="mw-content-ltr">since version 5.5.0 ([https://github.com/scribejava/scribejava/pull/852 pull request])</span> <span id="Example_code"></span> == 코드 예시 == <div lang="en" dir="ltr" class="mw-content-ltr"> === PHP client without using any libraries === </div> [[toollabs:oauth-hello-world|OAuth Hello World]] – <span lang="en" dir="ltr" class="mw-content-ltr">easy to understand demo application written in PHP without any libraries.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === PHP command-line client with RSA keys, using oauthclient-php === </div> <span lang="en" dir="ltr" class="mw-content-ltr">PHP application using classes from the OAuth extension codebase.</span> {{Todo|1=<span lang="en" dir="ltr" class="mw-content-ltr">convert this to actually use oauthclient-php! Probably just a bunch of <code>use</code> declarations.</span>}} <span lang="en" dir="ltr" class="mw-content-ltr">Before Starting:</span> <syntaxhighlight lang="shell-session"> $ openssl genrsa -out appkey.pem 4096 $ openssl rsa -in appkey.pem -pubout > appkey.pub </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">PHP source code</span>}} <syntaxhighlight lang="php"> <?php if ( PHP_SAPI !== 'cli' ) { die( "CLI-only test script\n" ); } /** * A basic client for overall testing */ function wfDebugLog( $method, $msg) { //echo "[$method] $msg\n"; } require 'OAuth.php'; require 'MWOAuthSignatureMethod.php'; $consumerKey = ''; #$consumerSecret = ''; // We don't need this, since we're using RSA, except to validate the /identify call $privateKey = file_get_contents( 'appkey.pem' ); $baseurl = 'http://<wiki>/wiki/Special:OAuth'; $endpoint_req = $baseurl . '/initiate?format=json&oauth_callback=oob'; // format=json makes php a little easier $endpoint_acc = $baseurl . '/token?format=json'; $endpoint_id = $baseurl . '/identify'; $c = new OAuthConsumer( $consumerKey, $privateKey ); // Make sure we sign title and format $parsed = parse_url( $endpoint_req ); $extraSignedParams = array(); parse_str($parsed['query'], $extraSignedParams); $extraSignedParams['title'] = 'Special:OAuth/initiate'; $init_req = OAuthRequest::from_consumer_and_token( $c, // OAuthConsumer for your app NULL, // User token, NULL for calls to initiate "GET", // http method $endpoint_req, // endpoint url (this is signed) $extraSignedParams // extra parameters we want to sign (must include title) ); $rsa_method = new MWOAuthSignatureMethod_RSA_SHA1( new OAuthDataStore(), $privateKey ); $init_req->sign_request( $rsa_method, // OAuthSignatureMethod $c, // OAuthConsumer for your app NULL // User token, NULL for calls to initiate ); echo "Getting request token with: $init_req\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, (string) $init_req ); // Pass OAuth in GET params curl_setopt( $ch, CURLOPT_HTTPGET, true ); curl_setopt( $ch, CURLOPT_HEADER, false ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $requestToken = json_decode( $data ); print "Visit $baseurl/authorize?oauth_token={$requestToken->key}&oauth_consumer_key=$consumerKey\n"; // ACCESS TOKEN print "Enter the verification code:\n"; $fh = fopen( "php://stdin", "r" ); $line = fgets( $fh ); $rc = new OAuthToken( $requestToken->key, $requestToken->secret ); $parsed = parse_url( $endpoint_acc ); parse_str($parsed['query'], $params); $params['oauth_verifier'] = trim($line); $params['title'] = 'Special:OAuth/token'; $acc_req = OAuthRequest::from_consumer_and_token( $c, $rc, "GET", $endpoint_acc, $params ); $acc_req->sign_request($rsa_method, $c, $rc); echo "Calling: $acc_req\n"; unset( $ch ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_acc ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $acc_req->to_header() ) ); // Set the Authorization Header $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $acc = json_decode( $data ); $accessToken = new OAuthToken( $acc->key, $acc->secret ); /** * Insecurely call the api for information about the user. * A MITM can forge a response from the server, so don't rely on this for identity! */ $apiurl = 'http://<wiki>/w/api.php'; $apiParams = array( 'action' => 'query', 'meta' => 'userinfo', 'uiprop' => 'rights', 'format' => 'json', ); $api_req = OAuthRequest::from_consumer_and_token( $c, // Consumer $accessToken, // User Access Token "GET", // HTTP Method $apiurl, // Endpoint url $apiParams // Extra signed parameters ); $api_req->sign_request( $rsa_method, $c, $accessToken ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $apiurl . "?" . http_build_query( $apiParams ) ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $api_req->to_header() ) ); // Authorization header required for api $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; /** * Securely get the identity of the user */ $consumerSecret = ''; $extraSignedParams = array( 'title' => 'Special:OAuth/identify' ); $req = OAuthRequest::from_consumer_and_token( $c, $accessToken, "GET", $endpoint_id, $extraSignedParams ); $req->sign_request( $rsa_method, $c, $accessToken ); echo "Calling: '$endpoint_id'\nHeader: {$req->to_header()}\n\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_id ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $req->to_header() ) ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } $identity = JWT::decode( $data, $consumerSecret ); // Validate the JWT if ( !validateJWT( $identity, $consumerKey, $req->get_parameter( 'oauth_nonce' ) ) ) { print "The JWT did not validate"; } else { print "We got a valid JWT, describing the user as:\n"; print " * Username: {$identity->username}\n"; print " * User's current groups: " . implode( ',', $identity->groups ) . "\n"; print " * User's current rights: " . implode( ',', $identity->rights ) . "\n"; } /** * Validate a JWT, to ensure this isn't a reply, spoof, etc. * @param $identity the decoded JWT * @param $consumerKey your App's Key * @param $nonce the nonce sent with your request, which should be returned */ function validateJWT( $identity, $consumerKey, $nonce ) { $expectedConnonicalServer = 'http://<wiki>'; // Verify the issuer is who we expect (server sends $wgCanonicalServer) if ( $identity->iss !== $expectedConnonicalServer ) { print "Invalid Issuer"; return false; } // Verify we are the intended audience if ( $identity->aud !== $consumerKey ) { print "Invalid Audience"; return false; } // Verify we are within the time limits of the token. // Issued at (iat) should be in the past, // Expiration (exp) should be in the future. $now = time(); if ( $identity->iat > $now || $identity->exp < $now ) { print "Invalid Time"; return false; } // Verify we haven't seen this nonce before, which would indicate a replay attack if ( $identity->nonce !== $nonce ) { print "Invalid Nonce"; return false; } return true; } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Python command-line client using mwoauth === </div> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Python source code</span>}} <syntaxhighlight lang="python"> from mwoauth import ConsumerToken, Handshaker import requests from requests_oauthlib import OAuth1 from six.moves import input # For compatibility between python 2 and 3 # Consruct a "consumer" from the key/secret provided by MediaWiki import config # You'll need to provide this # Create a file called config.py somewhere where it will be found by python, e.g. in the same directory as this script, with the following content (not including the # characters!) # consumer_key = "the consumer token you got when you registered your applicaton" # consumer_secret = "the secret token you got when you registered your application" # For example: # consumer_key = "20bc67da5081a30c736340c493f60d14" # consumer_secret = "af4313371bb2fb38e81fe7d300080085f52849f9" consumer_token = ConsumerToken(config.consumer_key, config.consumer_secret) # Construct handshaker with wiki URI and consumer handshaker = Handshaker("https://en.wikipedia.org/w/index.php", consumer_token) # Step 1: Initialise -- ask MediaWiki for a temporary key/secret for user redirect, request_token = handshaker.initiate() # Step 2: Authorise -- send user to MediaWiki to confirm authorisation print("Point your browser to: %s" % redirect) # response_qs = input("Response query string: ") # Step 3: Complete -- obtain authorised key/secret for "resource owner" access_token = handshaker.complete(request_token, response_qs) # Construct an auth object with the consumer and access tokens auth1 = OAuth1(consumer_token.key, client_secret=consumer_token.secret, resource_owner_key=access_token.key, resource_owner_secret=access_token.secret) # Now, accessing the API on behalf of a user print("Reading top 10 watchlist items") response = requests.get( "https://en.wikipedia.org/w/api.php", params={ 'action': "query", 'list': "watchlist", 'wllimit': 10, 'wlprop': "title|comment", 'format': "json" }, auth=auth1 ) for item in response.json()['query']['watchlist']: print("{title}\t{comment}".format(**item)) </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Python Toolforge tutorial using mwoauth === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> See: </div> [[wikitech:Help:Toolforge/My first Flask OAuth tool]] === Python Toolforge tutorial using authlib (OAuth 2.0) === {{Collapse_top|title=Python source code}} <syntaxhighlight lang="python"> # > requirements.txt # flask==3.1.3 # requests==2.33.1 # authlib==1.7.0 # > config.py OAUTH_ACCESS_TOKEN_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/access_token" OAUTH_API_BASE_URL = "https://commons.wikimedia.org/w/" OAUTH_AUTHORIZE_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/authorize" OAUTH_CODE_CHALLENGE_METHOD = "S256" OAUTH_CONSUMER_KEY = "Y" OAUTH_CONSUMER_SECRET = "Z" OAUTH_SCOPE = "basic editpage" # > app.py from authlib.integrations.flask_client import FlaskOAuth2App, OAuth from flask import Flask, jsonify, redirect, request, session from requests import Response app = Flask() app.config.from_pyfile("config.py") oauth = OAuth(app) oauth.register( name="mediawiki", client_id=app.config["OAUTH_CONSUMER_KEY"], client_secret=app.config["OAUTH_CONSUMER_SECRET"], client_kwargs={ "code_challenge_method": app.config["OAUTH_CODE_CHALLENGE_METHOD"], "scope": app.config["OAUTH_SCOPE"], }, api_base_url=app.config["OAUTH_API_BASE_URL"], access_token_url=app.config["OAUTH_ACCESS_TOKEN_URL"], authorize_url=app.config["OAUTH_AUTHORIZE_URL"], ) oauth_client: FlaskOAuth2App = oauth.create_client("mediawiki") @app.route("/") def index(): return app.send_static_file("index.html") @app.route("/login") def login(): return oauth_client.authorize_redirect() @app.route("/oauth-callback") def auth(): token = oauth_client.authorize_access_token() session["token"] = token return redirect("/") @app.route("/logout") def logout(): session.pop("token", None) session.clear() return redirect("/") @app.route("/user") def user(): response: Response = oauth_client.request( "GET", "rest.php/oauth2/resource/profile", token=session["token"], ) user = response.json() response.raise_for_status() return jsonify(user=user) @app.route("/edit", methods=["POST"]) def edit(): data = request.get_json() pageid = int(data["pageid"]) response: Response = oauth_client.request( "POST", "api.php", token=session["token"], data=dict( format="json", formatversion="2", action="query", pageids=str(pageid), prop="revisions|wbentityusage", rvprop="content", rvslots="*", meta="tokens", ), ) r = response.json() token = r["query"]["tokens"]["csrftoken"] ... </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Go command-line client using mrjones/auth (OAuth 1.0) === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Before you begin: </div> <syntaxhighlight lang="shell-session"> $ go get github.com/mrjones/oauth </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Go source code</span>}} <syntaxhighlight lang="go"> package main import ( "fmt" "os" "github.com/mrjones/oauth" "io/ioutil" "strconv" ) func main() { var consumerKey string = "" var consumerSecret string = "" if len(consumerKey) == 0 || len(consumerSecret) == 0 { os.Exit(1) } c := oauth.NewConsumer( consumerKey, consumerSecret, oauth.ServiceProvider{ RequestTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/initiate", AuthorizeTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/authorize", AccessTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/token", }) c.Debug(true) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/initiate", } c.AdditionalAuthorizationUrlParams = map[string]string{ "oauth_consumer_key": consumerKey, } requestToken, url, err := c.GetRequestTokenAndUrl("oob") if err != nil { fmt.Println( err ) } fmt.Println( "Got token " + requestToken.Token ) fmt.Println("(1) Go to: " + url) fmt.Println("(2) Grant access, you should get back a verification code.") fmt.Println("(3) Enter that verification code here: ") verificationCode := "" fmt.Scanln(&verificationCode) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/token", } accessToken, err := c.AuthorizeToken(requestToken, verificationCode) if err != nil { fmt.Println(err) } fmt.Println( "Got access token " + accessToken.Token ) c.AdditionalParams = map[string]string{} response, err := c.Get( "http://<wiki>/wiki/api.php", map[string]string{ "action": "query", "meta": "userinfo", "uiprop": "rights", "format": "json", }, accessToken) if err != nil { fmt.Println(err) } fmt.Println( "\tResponse Status: '" + response.Status + "'\n" ) fmt.Println( "\tResponse Code: " + strconv.Itoa(response.StatusCode) + "\n" ) bytes, _ := ioutil.ReadAll(response.Body) fmt.Println( "\tResponse Body: " + string(bytes) + "\n" ) } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === JavaScript applications using OAuth 2 === </div> * [https://github.com/wikimedia/apiclient-wiki wikimedia/apiclient-wiki] – <span lang="en" dir="ltr" class="mw-content-ltr">entire application in 520 lines of code</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Full applications using OAuth === </div> * [https://github.com/jdlrobson/weekipedia/blob/master/libs/server/app.js Weekipedia], <span lang="en" dir="ltr" class="mw-content-ltr">A full scale React.js port of the Wikipedia mobile site uses both.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">many [https://toolhub.wikimedia.org/search?keywords__term=oauth Toolforge tools]</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==Notes== </div> <references /> l6fmz7gnxpyczuajnse4nexicd7qyxp Template:Update/de 10 1034319 8364316 8364235 2026-05-03T12:46:59Z FuzzyBot 451990 Updating to match new version of source page 8364316 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |Die '''sachliche Richtigkeit''' von Teilen dieser Seite (die in Bezug auf {{{part|{{{1|}}}}}}) '''kann aufgrund veralteter Informationen beeinträchtigt sein'''. |Teile dieser Seite (die in Bezug auf {{{part|{{{1|}}}}}}) sind '''veraltet'''.}} |{{#if:{{{inaccurate|}}} |Die '''sachliche Richtigkeit''' dieser Seite '''kann aufgrund veralteter Informationen beeinträchtigt sein'''. |Diese Seite ist '''veraltet'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|Sie wurde für eine ältere Version von MediaWiki geschrieben und trifft möglicherweise nicht auf die aktuellste Version zu.}} Wenn du diese Seite überprüft oder aktualisiert hast und dabei entdeckst, dass die Inhalte geeignet sind, entferne bitte diesen Hinweis. {{#ifexist: {{TALKPAGENAME}} |&#32;Siehe die [[{{TALKPAGENAME}}|Diskussionsseite]] für eine mögliche Diskussion darüber. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Letzte Aktualisierung: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= Alternativnamen dieser Vorlage: * {{tlx|outdated}} <span id="Examples"></span> == Beispiele == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == Siehe auch == * {{tl|historical}} == TemplateData == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> l5sg9xym0583h1alti7kni42j6tjsxs Template:Update/pt 10 1034328 8364331 8364250 2026-05-03T12:47:08Z FuzzyBot 451990 Updating to match new version of source page 8364331 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |<span lang="en" dir="ltr" class="mw-content-ltr">The '''factual accuracy''' of parts of this page (those related to {{{part|{{{1|}}}}}}) '''may be compromised due to out-of-date information'''.</span> |<span lang="en" dir="ltr" class="mw-content-ltr">Parts of this page (those related to {{{part|{{{1|}}}}}}) are '''outdated'''.</span>}} |{{#if:{{{inaccurate|}}} |<span lang="en" dir="ltr" class="mw-content-ltr">The '''factual accuracy''' of this page '''may be compromised due to out-of-date information'''.</span> |<span lang="en" dir="ltr" class="mw-content-ltr">This page is '''outdated'''.</span>}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|<span lang="en" dir="ltr" class="mw-content-ltr">It was written for an older version of MediaWiki and may not apply to the most recent version.</span>}} Se verificou ou atualizou esta página e determinou que o conteúdo é adequado, remova este aviso, por favor. {{#ifexist: {{TALKPAGENAME}} |&#32;<span lang="en" dir="ltr" class="mw-content-ltr">See the [[{{TALKPAGENAME}}|talk page]] for a possible discussion on this.</span> }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small><span lang="en" dir="ltr" class="mw-content-ltr">Last update:</span> {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= <div lang="en" dir="ltr" class="mw-content-ltr"> Aliases of this template: </div> * {{tlx|outdated}} <div lang="en" dir="ltr" class="mw-content-ltr"> == Examples == </div> <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == Ver também == * {{tl|historical}} <div lang="en" dir="ltr" class="mw-content-ltr"> == TemplateData == </div> {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> cilxqvuk9b8hwf5ftfs73e6rl034qh6 Manual:Managing data in MediaWiki/ja 100 1061484 8364306 8363590 2026-05-03T12:44:46Z FuzzyBot 451990 Updating to match new version of source page 8364306 wikitext text/x-wiki <languages/> MediaWiki は主に自由形式のテキストと画像を管理するために設計されました。 <span lang="en" dir="ltr" class="mw-content-ltr">A limited amount of structure is available: {{ll|Help:Namespaces|namespaces}}, {{ll|Help:Subpages|subpages}} and {{ll|Help:Categories|categories}} help to group similar pages together, while features like {{ll|Infobox|infoboxes}} and {{ll|Gallery|galleries}} help to structure the contents within each page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, MediaWiki by itself does not truly provide ways to manage structured data: data that can be queried, filtered, and in some cases displayed with visualizations including tables, charts, maps<ref>see also [[Wikimedia Maps]]</ref> and calendars.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For that, a number of dedicated [[Special:MyLanguage/Manual:Extensions|extensions]] exist.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following table describes the extensions that can store the data edited by users in a MediaWiki database, from where it can then be queried. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is not a list of all structured data functionality; the "[[#See also|See also]]" section lists other extensions and features that can be used for storing or displaying structured data. </div> {| class="wikitable" |- ! 機能 ! [[File:20210702_Semantic_MediaWiki_logo_with_wordmark.png|100px]]<br/>[https://www.semantic-mediawiki.org/ Semantic MediaWiki] ! [[File:Wikibase_Suite_Vertical_2x_RGB.png|100px]]<br/>[https://wikiba.se/ Wikibase] ! [[File:Cargo logo.png|50px]]<br/>{{ll|Extension:Cargo|nsp=0}} ! {{ll|Extension:VisualData|VisualData}} !{{ll|Extension:Bucket|Bucket}} ! {{ll|Extension:NeoWiki|NeoWiki}} |- | 主な使用事例 | [[w:Semantic Web|セマンティックウェブ]]標準に基づく、MediaWikiインストール内のデータ管理。 | [[w:Wikidata|ウィキデータ]]および他の編集可能なグラフ データベースの効率化。 | MediaWiki インストレーション内でデータを管理。 | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation based on JSON-schema.</span> |lightweight Lua interface for storing and accessing structured data on wiki pages |Knowledge management system that combines collaborative editing and a [[:en:knowledge_graph|knowledge graph]] |- | アプローチ | データ (プロパティ) は標準のウィキテキスト内でまたはテンプレートによって注釈されます。 データ種別が"reference"の場合、文を用いた項目をプロパティで説明できます。<ref>https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data</ref> | 引数は文を用いた項目を説明するために使います。 | データはデータベース表に保存し、表単位でテンプレートに関連付けされています。 | <span lang="en" dir="ltr" class="mw-content-ltr">Data are stored in a dedicated slot with JSON content model</span> |Data is stored in '''buckets''', which are database tables with specific columns that you can define |Schemas can be defined and applied to wiki pages, stored in a dedicated slot as JSON data. |- | 導入時期 | 2005 | 2012 | 2015 | 2022 <span lang="en" dir="ltr" class="mw-content-ltr">(formerly known as {{ll|Extension:PageProperties|PageProperties}})</span> |2025 |2026 |- | 対応するインストール | 数千から百万未満<ref>https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki</ref> | 数百から1万未満<ref>https://wikiapiary.com/wiki/Extension:WikibaseRepository</ref><ref>https://wikibase.world</ref><ref>https://addshore.com/2024/10/visualizing-wikibase-connections-using-wikibase-world/</ref> | 数百から1万未満<ref>https://wikiapiary.com/wiki/Extension:Cargo</ref> | 利用不可 (新しい拡張機能または不明) | | |- | コミュニティ | 190 人以上の開発者<ref>https://www.openhub.net/p/smw</ref> | 172 人以上の開発者<ref>https://github.com/wikimedia/mediawiki-extensions-Wikibase</ref> | 63 人以上の開発者<ref>https://github.com/wikimedia/mediawiki-extensions-Cargo</ref> | ([[User:Thomas-topway-it|<span lang="en" dir="ltr" class="mw-content-ltr">main developer</span>]]) |[https://weirdgloop.org/discord Weird Gloop's Discord] |[https://echolot-eccch.eu/ ECHOLOT project], [https://professional.wiki/ Professinal Wiki], [https://knowledge.wiki KM-A], [https://bluespice.com/bluespice-galaxy/ BlueSpice Galaxy] |- | ストレージ | MediaWiki のデータベース、Elasticsearch と 5 種類の SPARQL ストレージ<ref>https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore</ref> | MediaWiki のデータベース、Elasticsearch と SPARQL ストレージ (wikidata.org 向け Blazegraph) | MediaWiki のデータベース (別のデータベース)<ref>{{ll|Extension:Cargo/Download and installation#Setting the Cargo database}}</ref> | MediaWiki のデータベース |MediaWiki database (MySQL/MariaDB) |different SPARQL stores, currently Neo4J |- | プロパティの定義 | ウィキ文の入力。 プロパティは自由に設定できます。 既定ではデータ種別ページ、あとで定義が可能。 <span lang="en" dir="ltr" class="mw-content-ltr">Datatypes can be changed any time.</span> | プロパティは使用前に定義する必要があり、簡単には変更できません。<ref>[[d:Help:Data type#Changing datatype]]</ref> | プロパティを使わず、データ表単位であらかじめ定義された (それでいて修正が可能な) フィールド欄一式を使いデータ表を定義。 | <span lang="en" dir="ltr" class="mw-content-ltr">Properties are defined through one or more json-schema defined through a {{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}}</span> |Tables in the Bucket: namespace |Form based schema editing |- | 値の宣言 | インライン (<code><nowiki>[[MyProperty::MyValue]]</nowiki></code>) もしくはテンプレート用。 {{ll|Extension:Page_Forms|Page Forms}} を伴うフォームに基づくデータエントリー | ウィキベースの既定のフォーム型入力インターフェイス。 | テンプレート内、パーサー関数を使用。 {{ll|Extension:Page_Forms|Page Forms}} を伴うフォームに基づくデータ入力。 | <span lang="en" dir="ltr" class="mw-content-ltr">Inline or popup OOUI {{ll|Extension:VisualData/Forms|forms}} automatically generated from JSON-schemas</span> |via Lua call of the <code>bucket.put</code> function |OOUI based form editing |- | 定義済みのデータタイプ | 18<ref>https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes</ref> | 17<ref>[[d:Special:ListDatatypes]]</ref><ref><span lang="en" dir="ltr" class="mw-content-ltr">Some datatypes are defined by other extension: [[Special:MyLanguage/Extension:Math|Math]] and [[Special:MyLanguage/Extension:Score|Score]] both define one datatype, [[Special:MyLanguage/Extension:JsonConfig|JsonConfig]] defines two, [[Special:MyLanguage/Extension:WikibaseLexeme|WikibaseLexeme]] defines three, and Wikibase defines ten.</span></ref> | 18 | <span lang="en" dir="ltr" class="mw-content-ltr">4 (basic JSON-schema types) + 15 string formats</span> | 5 <ref>https://meta.weirdgloop.org/w/Extension:Bucket#Basic_usage</ref> | |- | プロパティの管理 | タイプの定義、要件のスキーマ、[[:ja:オントロジー|オントロジー]]の読み込み | 個別設定もしくはウィキデータからオントロジーを読み込み | プロパティを使わず、データ表単位であらかじめ定義された (それでいて修正が可能な) フィールド欄一式を使いデータ表を定義。 | <span lang="en" dir="ltr" class="mw-content-ltr">through a graphical interface (dedicated {{ll|Extension:VisualData/Schema Builder|SchemaBuilder}})</span> | |through a graphical interface |- | <span lang="en" dir="ltr" class="mw-content-ltr">Page names and internal linking</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Page names are stored with their Q-numbers (displaying labels in available languages). Internal linking must be done to the Q-number; you cannot link to a label.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Schemas are stored in a dedicated namespace and JSON-data in a dedicated slot associated to wiki articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">JSON-data can be accessed through an extension of the wiki interface</span> | |MediaWiki pages can have schemas |- | インラインの問い合わせ | はい、パーサ関数を利用 | いいえ (外部SPARQL問い合わせ); [[phab:T67626|計画中の対策は]]<br/>第三者の拡張機能{{ll|Extension:LinkedWiki|LinkedWiki}}経由でサポート | はい、パーサ関数を利用 | はい、パーサ関数を利用 | |yes, with parser functions via the SQL store |- | 外部への問い合わせ | はい、API または SPARQL を用いて問い合わせ ([[Special:MyLanguage/Extension:RDFIO|RDVIO]] または [[Special:MyLanguage/Extension:LinkedWiki|LinkedWiki]] など特別な拡張機能経由で入手) | はい、SPARQL問合せサービス | はい、API を利用 | はい、API を利用<ref>{{ll|Extension:VisualData/API}}</ref> | API is not yet stable <ref>https://meta.weirdgloop.org/w/Extension:Bucket</ref> |yes, with an API or SPARQL endpoint |- | Result formats<ref>「結果フォーマット」とは当該のウィキが表組みやカレンダー、地図、タイムテーブルなどさまざまな形式でデータ表示する能力 (インラインの問い合わせ結果) を指す。</ref> | ~ 75<ref>https://www.semantic-mediawiki.org/wiki/Help:Result_formats</ref> | 結果表示に定型はありません。データは次により表示される場合があります。 * 問い合わせサービスあるいはその他の外部ツール * on wiki data access via LUA 経由のウィキ内のデータアクセス (問い合わせサポートなし) * {{ll|Extension:LinkedWiki}} - 第三者 | ~ 25<ref>{{ll|Extension:Cargo/Display formats}}</ref> | 12+ (Json, Table, Datatable, Template, Calendar, Carousel, Map, pageid, pagetitle, count, raw, Lua ) <ref>{{ll|Extension:VisualData/Result_formats}}</ref> | | |- | 開発 | [[github:SemanticMediaWiki/SemanticMediaWiki|GitHub]] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Cargo Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/VisualData Gerrit] |[[github:weirdgloop/mediawiki-extensions-Bucket|GitHub]] |[[github:ProfessionalWiki/NeoWiki|GItHub]] |- | 補完する拡張機能 | ~ 40<ref>{{ll|Category:Semantic MediaWiki extensions}}</ref>, e.g. {{ll|Extension:Semantic Result Formats|Semantic Result Formats}}, {{ll|Extension:Semantic Bundle|Semantic Bundle}}, {{ll|Extension:Semantic Scribunto|Semantic Scribunto}} | ~12<ref>{{ll|Category:Wikibase extensions}}</ref>, e.g. {{ll|Extension:Wikibase Repository|Wikibase Repository}}, {{ll|Extension:Wikibase Client|Wikibase Client}}, {{ll|Extension:WikibaseLexeme|WikibaseLexeme}}, [https://wikiba.se/applications/#query-service Query Service] | <span lang="en" dir="ltr" class="mw-content-ltr">2 ([[Special:MyLanguage/Extension:Page Forms|Page Forms]], [[Special:MyLanguage/Extension:Page Schemas|Page Schemas]]). Cargo provides some or all of the functionality of Semantic MediaWiki, Semantic Result Formats, Maps, Semantic Drilldown, Semantic Compound Queries, Semantic Internal Objects and Semantic Scribunto.</span><ref>[[Extension:Cargo/Cargo and Semantic MediaWiki]].</ref> | {{ll|Extension:ContactManager|ContactManager}} |{{ll|Extension:Lua|Lua}} | |} <span id="Alternative_comparisons"></span> == 代替の比較手段 == * {{ll|Extension:Cargo/Cargo and Semantic MediaWiki|2=<span lang="en" dir="ltr" class="mw-content-ltr">Cargo and Semantic MediaWiki</span>}} * <span lang="en" dir="ltr" class="mw-content-ltr">[https://professional.wiki/en/articles/managing-data-in-mediawiki Semantic MediaWiki vs Wikibase vs Cargo] by [https://professional.wiki Professional Wiki]</span> <span id="References"></span> == 脚注 == <references/> <span id="See_also"></span> == 関連項目 == * {{ll|Multi-Content Revisions}} – 同じウィキページにそれぞれ異なる独立したコンテンツ オブジェクトを管理する機能 * {{ll|Extension:WikiDB|WikiDB}} – 意味論的なプロパティにやや似たデータベース機能を提供 * {{ll|Extension:JsonConfig|JsonConfig}} – JSON をウィキページに保存し (表形式ならびに地図データを含む)、Lua 経由でアクセス可能にする。問い合わせサポートなし * {{ll|Extension:External Data|External Data}} – データのアクセス元は外部 URL、ローカル ファイル、SQL、MongoDB データベースのいずれか * {{ll|Structured data across Wikimedia}} – <span lang="en" dir="ltr" class="mw-content-ltr">2021-2023 project for improving structured data support in MediaWiki</span> * {{ll|Category:Data management extensions}} [[Category:MediaWiki Introduction{{#translation:}}]] [[Category:Extension comparisons{{#translation:}}]] 5kbns1vzmovl7xpo6g1kr0510fqt7zs Extension:TimedMediaHandler/VideoJS Player/tr 102 1080523 8364370 8363698 2026-05-03T13:12:21Z FuzzyBot 451990 Updating to match new version of source page 8364370 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Hareket halindeki yeni oynatıcının ekran görüntüsü]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> [https://videojs.com/ VideoJS]'ye dayanmaktadır ve mobil cihazlar ve HTML5 uyumluluğu ile daha modern, daha hızlı bir kullanıcı arayüzüne sahiptir. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Örnek video oynatıcı]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using tab, enter and spacebar keys</span> <span id="Known_issues"></span> == Bilinen sorunlar == Video oynatıcı hala geliştirme aşamasındadır, ancak herhangi bir sorunla karşılaşırsanız, lütfen bunları [[Extension_talk:TimedMediaHandler/VideoJS Player|tartışma sayfasında]] bildirin veya [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]'da dosyalayın <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> irzwod3zuy6s8afch34wh699zduq8kc 8364786 8364370 2026-05-03T23:14:45Z FuzzyBot 451990 Updating to match new version of source page 8364786 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Hareket halindeki yeni oynatıcının ekran görüntüsü]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> [https://videojs.com/ VideoJS]'ye dayanmaktadır ve mobil cihazlar ve HTML5 uyumluluğu ile daha modern, daha hızlı bir kullanıcı arayüzüne sahiptir. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Örnek video oynatıcı]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</span> <span id="Known_issues"></span> == Bilinen sorunlar == Video oynatıcı hala geliştirme aşamasındadır, ancak herhangi bir sorunla karşılaşırsanız, lütfen bunları [[Extension_talk:TimedMediaHandler/VideoJS Player|tartışma sayfasında]] bildirin veya [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]'da dosyalayın <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> td40qdm3g4vgdurmm3t0gciii0jkwdb Translations:Manual:User rights/178/cs 1198 1092764 8364660 3775983 2026-05-03T17:20:55Z Rebulka 17532855 8364660 wikitext text/x-wiki Pokud to {{$1|děláte v rozšíření}}, musíte místo toho použít $2, nebo nejlépe definovat právo v $3. qin005ua6v2brg043u2b8fekr4m11pm Extension:TimedMediaHandler/VideoJS Player/ko 102 1094387 8364364 8363691 2026-05-03T13:12:18Z FuzzyBot 451990 Updating to match new version of source page 8364364 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|동작 중인 새 플레이어의 스크린샷]] '''VideoJS Player'''는 미디어위키용 위키미디어 프로젝트에서의 비디오 플레이어입니다. 이것은 [https://videojs.com/ VideoJS]에 기반해 있으며, 모바일 기기와 HTML5가 호환이 되면서 현대화되고, 빠른 사용자 인터페이스를 가지고 있습니다. <span id="Usage"></span> == 사용법 == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|예시 비디오 플레이어]] [[File:Armstrong Small Step.ogg|thumb|예시 오디오 플레이어]] 오디오 및 비디오 플레이어가 모두 있습니다. 이 페이지에서 두 플레이어의 예시를 볼 수 있습니다. 시작을 하면 비디오와 상호 작용할 때 제어 막대를 보게 됩니다. [[File:VideoJS controlbar.png|frameless|350px]] 왼쪽에서 오른쪽 순서로 컨트롤이 위치합니다: <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;재생/일시정지 제어 * [[File:VideoJS volume control.png|30px|]]&nbsp;음량 제어 * 재생 위치 * 남은 재생 시간 * [[File:VideoJS subtitle control.png|30px|]]&nbsp;자막 언어 선택기와 자막 스타일 컨트롤 * [[File:VideoJS resolution control.png|30px|]]&nbsp;해상도 선택기 * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;선택적 PIP (픽처 인 픽처) 컨트롤 * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;전체 화면 제어 * [[File:VideoJS file description control.png|30px|]]&nbsp;파일 설명 문서로 방문하는 정보 버튼 <span id="Mouse_and_keyboard_controls"></span> === 마우스 및 키보드 제어 === * 미디어 파일의 재생을 시작하려면 섬네일 위의 재생 아이콘을 클릭하십시오. * 파일 설명 문서를 열려면 섬네일에 마우스 오른쪽 버튼 또는 마우스 가운데 버튼을 클릭하십시오 * 플레이어 창 안에서 한 번의 마우스 클릭으로 플레이어를 재생/일시정지합니다 * 전체 화면에 들어가거나 빠져나오려면 플레이어 창을 두 번 클릭하십시오 * 다음의 키보드 컨트롤을 사용할 수 있습니다: *; {{Key press|k}} / {{Key press|Space}} : 미디어를 재생/일시정지 *; {{Key press|f}} : 전체 화면 들어가기/나가기 *; {{Key press|m}} : 음소거 *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * 플레이어는 탭, 엔터, 스페이스바 키를 사용하여 온전히 키보드로 접근 가능합니다 <span id="Known_issues"></span> == 알려진 문제 == 이 비디오 플레이어는 현재 개발 단계이지만 문제를 발견하시면 문제를 [[Extension_talk:TimedMediaHandler/VideoJS Player|토론 문서]]에 보고하거나 [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player 파브리케이터]에 게시해 주십시오. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> r3lfxie383s9zjrxrlbric84ia9hvo8 8364779 8364364 2026-05-03T23:14:42Z FuzzyBot 451990 Updating to match new version of source page 8364779 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|동작 중인 새 플레이어의 스크린샷]] '''VideoJS Player'''는 미디어위키용 위키미디어 프로젝트에서의 비디오 플레이어입니다. 이것은 [https://videojs.com/ VideoJS]에 기반해 있으며, 모바일 기기와 HTML5가 호환이 되면서 현대화되고, 빠른 사용자 인터페이스를 가지고 있습니다. <span id="Usage"></span> == 사용법 == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|예시 비디오 플레이어]] [[File:Armstrong Small Step.ogg|thumb|예시 오디오 플레이어]] 오디오 및 비디오 플레이어가 모두 있습니다. 이 페이지에서 두 플레이어의 예시를 볼 수 있습니다. 시작을 하면 비디오와 상호 작용할 때 제어 막대를 보게 됩니다. [[File:VideoJS controlbar.png|frameless|350px]] 왼쪽에서 오른쪽 순서로 컨트롤이 위치합니다: <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;재생/일시정지 제어 * [[File:VideoJS volume control.png|30px|]]&nbsp;음량 제어 * 재생 위치 * 남은 재생 시간 * [[File:VideoJS subtitle control.png|30px|]]&nbsp;자막 언어 선택기와 자막 스타일 컨트롤 * [[File:VideoJS resolution control.png|30px|]]&nbsp;해상도 선택기 * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;선택적 PIP (픽처 인 픽처) 컨트롤 * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;전체 화면 제어 * [[File:VideoJS file description control.png|30px|]]&nbsp;파일 설명 문서로 방문하는 정보 버튼 <span id="Mouse_and_keyboard_controls"></span> === 마우스 및 키보드 제어 === * 미디어 파일의 재생을 시작하려면 섬네일 위의 재생 아이콘을 클릭하십시오. * 파일 설명 문서를 열려면 섬네일에 마우스 오른쪽 버튼 또는 마우스 가운데 버튼을 클릭하십시오 * 플레이어 창 안에서 한 번의 마우스 클릭으로 플레이어를 재생/일시정지합니다 * 전체 화면에 들어가거나 빠져나오려면 플레이어 창을 두 번 클릭하십시오 * 다음의 키보드 컨트롤을 사용할 수 있습니다: *; {{Key press|k}} / {{Key press|Space}} : 미디어를 재생/일시정지 *; {{Key press|f}} : 전체 화면 들어가기/나가기 *; {{Key press|m}} : 음소거 *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * 플레이어는 탭, 엔터, 스페이스바 키를 사용하여 온전히 키보드로 접근 가능합니다 <span id="Known_issues"></span> == 알려진 문제 == 이 비디오 플레이어는 현재 개발 단계이지만 문제를 발견하시면 문제를 [[Extension_talk:TimedMediaHandler/VideoJS Player|토론 문서]]에 보고하거나 [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player 파브리케이터]에 게시해 주십시오. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> bm8ugrg6ng15yrv2syl8t4cam8srxw2 Help:Extension:ParserFunctions/cs 12 1097064 8365006 8353923 2026-05-04T06:20:06Z FuzzyBot 451990 Updating to match new version of source page 8365006 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} Rozšíření {{ll|Extension:ParserFunctions|nsp=0}} poskytuje další [[Special:MyLanguage/Parser functions|funkce parseru]], které doplňují ty, které jsou již přítomny v jádru MediaWiki. (Podívejte se na stránku {{ll|Help:Magic words#Parser functions}}.) (Může být nakonfigurováno tak, aby poskytovalo další funkce syntaktického analyzátoru pro zpracování řetězců. Tyto řetězcové funkce jsou zdokumentovány {{ll|Extension:ParserFunctions/String functions|někde jinde}}.) Všechny funkce analyzátoru poskytované tímto rozšířením mají podobu: :<code><nowiki>{{</nowiki>'''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=podrobnější manuál o jemnějších bodech fungování vyhodnocování výrazů, včetně některých dalších operátorů, které zde nejsou uvedeny|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Typ ! {{hl1}} | Operátory |- | {{hl2}} | Seskupení (závorky) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Čísla | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | binární operátor <code>'''e'''</code> &nbsp; unární (jednočlenný) <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unární | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binární | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Smyčka | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Logická | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Tato funkce vyhodnocuje matematický výraz a vrací vypočítanou hodnotu. Tato funkce je k dispozici také na stránce {{ll|Extension:Scribunto|nsp=0}} prostřednictvím funkce <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''výraz'' <nowiki>}}</nowiki></code> Základní příklad :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Jaké operátory lze použít, vidíte v tabulce napravo, kde jsou setříděny podle toho, jakou mají priority. Jak fungují se dočtete na {{ll|Manual:Expr parser function syntax}}. Přesnost a formát výsledku, který každý z nich vrací, se liší v závislosti na operačním systému serveru, na kterém se wiki provozuje a na formát čísel má vliv také nastavení jazyka portálu. Při vyhodnocování pomocí [[w:boolean algebra|booleovské algebry]] se nula vyhodnocuje jako {{phpi|false}} a jakákoli nenulová hodnota, kladná nebo záporná, se vyhodnocuje jako {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Prázdný vstupní výraz vrací prázdný řetězec. Neplatné výrazy vracejí jednu z několika chybových zpráv, které lze zachytit pomocí funkce <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' Pořadí sčítání a odčítání operandů před nebo za číslem je smysluplné a lze s ním zacházet jako s kladnou nebo zápornou hodnotou namísto s operandem s chybným vstupem: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Pokud používáte výstup pomocí magických slov, musíte je nejprve naformátovat, abyste odstranili čárky a přeložili číslice. Například <nowiki>{{NUMBEROFUSERS}}</nowiki> vede k {{NUMBEROFUSERS}}, kde chceme {{formatnum:{{NUMBEROFUSERS}}|R}}, které lze získat pomocí <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. To je obzvláště důležité v některých jazycích, kde jsou překládány číslice. Například v bengálštině <nowiki>{{NUMBEROFUSERS}}</nowiki> produkuje ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=Operátor <code>mod</code> dává pro některé hodnoty druhého argumentu špatné výsledky: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (vytvoří prázdný řetězec; měl by být 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Pokud chcete provádět výpočty na základě dat (např. otestovat, zda je aktuální datum a čas po nějakém jiném datu a čase). Nejprve převeďte čas na počet sekund po 1. lednu 1970 (UTC) pomocí <nowiki>{{#time: xNU }}</nowiki>, potom můžete jednoduše přidat a odečíst data jako čísla.}} <span id="Rounding"></span> === Zaokrouhlování === [https://php.net/function.round Rounds] z čísla nalevo na násobek 1/10 zvýšené na mocninu, s exponentem rovným zkrácené hodnotě čísla uvedeného napravo. Chcete-li zaokrouhlit nahoru nebo dolů, použijte jednotné <code>ceil</code> nebo <code>floor</code> resp. {| class="wikitable" ! {{hl1}} | Modelový případ ! {{hl1}} | Výsledek ! {{hl1}} | Metoda zaokrouhlování |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || Poslední číslice je <5, takže nedochází ke zjevnému zaokrouhlování (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || Poslední číslice je ≥5, takže je zaokrouhlena nahoru (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || Výsledek se na poslední číslici opět zaokrouhlí nahoru, což má za následek další zaokrouhlování (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Zaokrouhleno na nejbližší 100, protože záporné hodnoty se zaokrouhlí doleva od desetinné čárky |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Zaokrouhleno na nejbližší setinu, protože kladné hodnoty se zaokrouhlí vpravo od desetinné čárky |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Desetinná čísla v zaokrouhlovacím indexu nezmění výsledek zaokrouhlených |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Desetinná část je zkrácena (odříznuta) |- ! colspan=3 {{hl2}} | Zaokrouhlování na nejbližší celé číslo |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Až na ''nejbližší'' celé číslo, které je nula |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Až na nejbližší celé číslo, které je jedna |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Až na nejbližší celé číslo, které je jedna |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Až na nejbližší celé číslo, které je nula |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Dolů na nejbližší celé číslo, které je záporné |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Dolů na nejbližší celé číslo, které je záporné |- ! colspan=3 {{hl2}} | Zaokrouhlování nahoru nebo dolů ''ceil'' nebo ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Až do dalšího ''většího'' celého čísla, které je jedna |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Až na další ''menší'' číslo, které je nula |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Až do dalšího většího čísla, které je nula |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Až na další menší celé číslo, které je záporné |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || Není zaokrouhleno, protože 1 je již celé číslo<br />{{Warning|1=Interpretováno jako '''(ceil''' 1''')'''/3, ne '''ceil('''1/3''')''', jak byste mohli očekávat}} |- ! colspan=3 {{hl2}} | Zaokrouhlování velkých čísel |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Zaokrouhlení na velmi velké číslo vede k nekonečnu. Jako odpověď je tedy dána původní hodnota bez nekonečna. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Stejné jako výše. |} <span id="Strings"></span> === Řetězce === Výrazy fungují pouze s číselnými hodnotami. Nemohou porovnávat řetězce nebo znaky. K tomu lze použít [[#ifeq]]. :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Tato funkce vyhodnocuje testovaný řetězec a určuje, zda je nebo není prázdný. Testovaný řetězec obsahující pouze mezeru je považován za prázdný. :<syntaxhighlight lang="wikitext" inline>{{#if: testovaný řetězec | hodnota, pokud testovaný řetězec není prázdný | hodnota, pokud je testovaný řetězec prázdný (nebo pouze mezera)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: první parametr | druhý parametr | třetí parametr }}</syntaxhighlight> Tato funkce nejprve otestuje, zda první parametr není prázdný. Pokud není první parametr prázdný, funkce zobrazí druhý argument. Pokud je první parametr prázdný nebo obsahuje pouze prázdná místa (mezery, řádky atd.), zobrazí se třetí argument. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' Testovaný řetězec je vždy interpretován jako čistý text, takže matematické výrazy se nevyhodnocují (viz [[##ifexpr|#ifexpr]]): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' Poslední parametr (false) může být vynechán: :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' Funkce může být vnořena. Chcete-li to provést, vnořte vnitřní funkci <code>#if</code> v její plné podobě namísto parametru uzavírací funkce <code>#if</code>. Je možné až sedm úrovní vnoření. Může to záviset na wiki nebo na omezení paměti. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:testovaný řetězec | hodnota, pokud testovaný řetězec není prázdný |{{#if:testovaný řetězec |hodnota, pokud testovaný řetězec není prázdný |hodnota, pokud je testovaný řetězec prázdný (nebo pouze mezera) }} }} </syntaxhighlight> Parametr můžete také použít jako testovaný řetězec v příkazu <code>#if</code>. Musíte se ovšem ujistit, že za název proměnné přidáte <code>|</code> (symbol pipe, svislítko, svislá čára). (Pokud parametr nemá hodnotu, vyhodnotí se řetězec "<code><nowiki>{{{1}}}</nowiki></code>" jako prázdný.) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Zadali jste text v proměnné 1 |2=Neexistuje žádný text v proměnné 1 }} Více na stránce {{ll|Help:Parser functions in templates}}, kde jsou další příklady této funkce analyzátoru. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Tato syntaktická funkce porovnává dva vstupní řetězce. Určuje, zda jsou totožné a na základě výsledku vrací jeden ze dvou řetězců. Pokud je požadováno další srovnání a výstupní řetězce, zvažte použití přepínače <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Pokud mají oba řetězce platné číselné hodnoty, jsou řetězce porovnávány numericky: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' Jinak je porovnání provedeno jako text. Toto srovnání rozlišuje velká a malá písmena: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(porovnání s podobným příkladem výše, bez uvozovek)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(ve srovnání s podobným příkladem výše, přičemž <code>[[##expr|#expr]]</code> vrací první platné číslo)'' Jako praktický příklad zvažte existující {{ll|Help:Templates|šablonu}} <code>Template:Timer</code>. Pomocí parseru vyberte mezi dvěma standardními časy, krátkým a dlouhým. Parametr bere jako první vstup pro porovnání s "krátkým" řetězcem &ndash; neexistuje žádná konvence pro pořadí, ale je jednodušší jej přečíst, pokud je parametr na prvním místě. Kód šablony je definován jako: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> následující možný výsledek: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Při použití ve funkci analyzátoru musí být všechny značky analyzátoru a další funkce analyzátoru dočasně nahrazeny {{ll|Strip marker|jedinečným kódem}}. To ovlivňuje srovnání: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Pokud jsou porovnávané řetězce zadány jako stejná volání stejné {{ll|Help:Templates|šablony}} obsahující takové značky, pak je podmínka pravdivá, ale v případě dvou šablon s identickým obsahem obsahujících takové značky je nepravdivá. }} {{Warning|1=Srovnání literálu s {{ll|Help:Magic words#Page names|magickými slovy názvu stránky}} může v závislosti na konfiguraci webu selhat. Například <nowiki>{{FULLPAGENAME}}</nowiki>, v závislosti na wiki, může kapitalizovat první písmeno a nahradí všechna podtržítka mezerami. Chcete-li tento problém vyřešit, použijte kouzelné slovo na oba parametry: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Tato funkce vezme vstupní řetězec a vrátí jeden ze dvou výsledků. Funkce se vyhodnotí na <code>true</code>, pokud vstupní řetězec obsahuje objekt HTML s chybou <code>class="error"</code>, generovaný jinými funkcemi analyzátoru, jako jsou <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> a <code>[[##rel2abs|#rel2abs]]</code>, chyby [[Special:MyLanguage/Help:Templates|šablon]], jako jsou smyčky a rekurze a další chyby analyzátoru "failsoft". :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Jeden nebo oba zpětné řetězce lze vynechat. Pokud je řetězec <code>correct</code> (správný) vynechán, je vrácen testovací řetězec <code>test string</code>, pokud není chybný. Pokud je také vynechán řetězec <code>error</code>, vrací se při chybě prázdný řetězec: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Některé chyby mohou způsobit přidání kategorie sledování, použití <code><nowiki>{{#iferror:}}</nowiki></code> nepotlačí přidání kategorie. == #ifexpr == Tato funkce vyhodnocuje matematický výraz a vrací jeden ze dvou řetězců v závislosti na booleovské hodnotě výsledku: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> Vstup <code>expression</code> (výraz) je vyhodnocen přesně jako u <code>[[##expr|#expr]]</code> výše, přičemž jsou k dispozici stejné operátory. Výstup je pak vyhodnocen jako booleovský výraz. Prázdný vstupní výraz je vyhodnocen jako {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Jak bylo uvedeno výše, nula se vyhodnotí jako {{phpi|false}} a jakákoli nenulová hodnota se vyhodnotí jako {{phpi|true}}, takže tato funkce je ekvivalentní funkci používající pouze <code>[[##ifeq|#ifeq]]</code> a <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> s výjimkou prázdného nebo nesprávného vstupního výrazu (chybová zpráva je považována za prázdný řetězec; není rovno nule, takže dostaneme hodnotu <code>value if true</code> (hodnota je pravdivá)). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' porovnání :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Je možné vynechat jednu nebo obě vrácené hodnoty. Žádný výstup není uveden, pokud je příslušná větev ponechána prázdná: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' Podporovány jsou booleovské operátory rovnosti nebo nerovnosti. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Výsledky numerických srovnání s <code>[[##ifexpr|#ifexpr]]</code> se nemusí vždy shodovat s výsledky <code>[[##ifeq|#ifeq]]</code> a <code>[[##switch|#switch]]</code>. Tito dva jsou přesnější než <code>[[##ifexpr|#ifexpr]]</code> a nemusí vrátit ekvivalentní výsledky. Zvažte tato srovnání se změnou poslední číslice: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Protože PHP použité v <code>[[##ifeq|#ifeq]]</code> a <code>[[##switch|#switch]]</code> porovnává dvě čísla typu integer, vrací očekávaný výsledek správně. Zatímco s <code>[[##ifexpr|#ifexpr]]</code> a se stejnými čísly: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' S jinou číslicí je výsledek rovnosti skutečně nesprávný. Toto chování v <code>[[##ifexpr|#ifexpr]]</code> je způsobeno tím, že MediaWiki převádí doslovná čísla ve výrazech na typ float, což u velkých celých čísel, jako jsou tato, zahrnuje zaokrouhlování.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=Viz [[Manual:Checking for page existence|Příručka:Kontrola existence stránky]] pro další metody kontroly, zda stránka existuje s různými omezeními}} Tato funkce vezme vstupní řetězec, interpretuje jej jako název stránky a vrací jednu ze dvou hodnot v závislosti na tom, zda stránka na místní wiki existuje. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> Funkce se vyhodnotí jako {{phpi|true}}, pokud stránka existuje, ať už obsahuje obsah, je jakoby prázdná (obsahuje metadata, jako jsou odkazy na kategorie nebo {{ll|Help:Magic words|kouzelná slova}}, ale obsah je neviditelný), je prázdná nebo je {{ll|Help:Redirects|přesměrovaná}}. Pouze stránky, které jsou znovu propojeny, se vyhodnotí jako {{phpi|false}}, včetně případů, kdy stránka dříve existovala, ale byla smazána. :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' Funkce se vyhodnotí jako {{phpi|true}} pro {{ll|Help:System message|systémové zprávy}}, které byly přizpůsobeny, a pro {{ll|Help:Special pages|speciální stránky}}, které jsou definovány softwarem. :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (protože na této wiki je nainstalováno rozšíření {{ll|Extension:Checkuser|nsp=0}}) | '''doesn't exist''' (protože rozšíření {{ll|Extension:Checkuser|nsp=0}} není na této wiki nainstalováno) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (protože hlášení [[{{ns:8}}:Copyright|Copyright]] bylo upraveno) | '''doesn't exist''' (protože [[{{ns:8}}:Copyright|autorské právo]] nebylo přizpůsobeno) }} Před verzí MediaWiki 1.45, pokud stránka ověřovala cíl pomocí parametru <code>#ifexist:</code>, pak se tato stránka zobrazovala v seznamu [[{{#special:WhatLinksHere}}]] pro cílovou stránku. Takže pokud by kód <code><nowiki>{{#ifexist:Foo }}</nowiki></code> byl zahrnut na této stránce ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] vypíše {{FULLPAGENAME}}. Na wikinách používajících sdílené úložiště médií lze <code>#ifexist:</code> použít ke kontrole, zda byl soubor nahrán do úložiště, ale nikoli do samotné wiki: :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' Pokud byla pro soubor vytvořena stránka místního popisu, výsledkem je '''exists''' pro všechny výše uvedené. <code>#ifexist:</code> nefunguje v odkazech na interwiki. <span id="ifexist_limits"></span> === omezení pro ifexist === <code>#ifexist:</code> je považován za "cennou parserovou funkci". Na libovolnou stránku lze zahrnout pouze omezený počet funkcí (včetně funkcí uvnitř přenesených šablon). Pokud je tento limit překročen, všechny další funkce <code>#ifexist:</code> automaticky vrátí false, ať už cílová stránka existuje nebo ne a stránka je zavedena do kategorie [[:Category:{{MediaWiki:expensive-parserfunction-category}}]]. Název {{ll|Help:Tracking categories|sledované kategorie}} se může lišit v závislosti na jazyce obsahu vaší wiki. Pro některé případy použití je možné emulovat (schopnost napodobovat jeden systém jiným) efekt ifexist s css pomocí selektorů <code>a.new</code> (pro výběr odkazů na neexistující stránky) nebo <code>a:not(.new)</code> (pro výběr odkazů na existující stránky). Navíc, protože počet cenných syntaktických funkcí, které lze použít na jedné stránce, je řízen <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, lze také v případě potřeby zvýšit limit v LocalSettings.php. <span id="ifexist_and_wanted_pages"></span> === ifexist a chybějící stránky === Před verzí MediaWiki 1.45 se stránka, která neexistuje a je testována na použití #ifexist, ocitla na seznamu [[Special:MyLanguage/Manual:WantedPages|Požadované stránky]]. Více najdete na stránce {{phab|T14019}} a v dokumentaci k šabloně [[w:Template:Linkless exists]] najdete jak to lze obejít. == #rel2abs == Tato funkce převede relativní cestu k souboru na absolutní cestu k souboru. :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> V rámci vstupu <code>path</code> je platná následující syntaxe: *<code>.</code> → aktuální úroveň *<code>..</code> → přejde o jednu úroveň výše *<code>/foo</code> → přejde o jednu úroveň dolů do podadresáře /foo Pokud není zadán <code>base path</code>, bude místo toho použit celý název stránky: :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' Neplatná syntaxe, například <code>/.</code> nebo <code>/./</code>, je ignorována. Protože nejsou povoleny více než dvě po sobě jdoucí tečky, lze k oddělení po sobě jdoucích příkazů použít tyto sekvence: :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' Pro podobnou skupinu funkcí viz také [[Special:MyLanguage/Help:Magic words#URL data|Nápověda:Kouzelná slovíčka#URL data]]. Mezi vestavěné funkce analyzátoru patří: 'localurl:', 'fullurl:', 'anchorencode:' atd. == #switch == ''Související stránka: [[w:Help:Switch parser function]]'' Tato funkce porovnává jednu vstupní hodnotu s několika testovacími případy a v případě nalezení shody vrací přidružený řetězec. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Příklady: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <nowiki>#</nowiki>switch se značkami částečného převodu může ovlivnit konfigurační soubor, který umožňuje editoru, který není obeznámen s kódováním šablon, prohlížet a upravovat konfigurovatelné prvky. <span id="Default"></span> === Výchozí === <code>''default result''</code> (výchozí výsledek) je vrácen, pokud žádný řetězec <code>''case''</code> neodpovídá <code>''comparison string'' </code> (srovnávacímu řetězci): :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' V této syntaxi musí být výchozím výsledkem poslední parametr a nesmí obsahovat nezpracované znaménko rovná se (znaménko rovná se bez <code><nowiki>{{}}</nowiki></code>). Pokud ano, bude to považováno za srovnání velkých a malých písmen a pokud se žádné případy neshodují, nezobrazí se žádný text. Důvodem je, že výchozí hodnota nebyla definována (je prázdná). Pokud se však případ shoduje, bude vrácen přidružený řetězec. :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> Alternativně může být výchozí výsledek explicitně deklarován řetězcem <code>''case''</code> z "<code>#default</code>". {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Výchozí výsledky deklarované tímto způsobem mohou být umístěny kdekoli v rámci funkce: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' Pokud je parametr <code>''default''</code> vynechán a nedojde k žádné shodě, nevrací se žádný výsledek <code>''result''</code>: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Výsledky seskupení === Je možné nechat hodnoty 'propadnout', když několik řetězců <code>''case''</code> vrací stejný řetězec <code>''result''</code>. Tím minimalizujeme duplicitu. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Zde se všechny případy 2, 3 a 4 vrátí <code>''result234''</code>; případy 6 a 7 vrátí <code>''result67''</code>. "<code>#default = </code>" v posledním parametru může být ve výše uvedeném případě vynechán. <span id="Use_with_parameters"></span> === Použití s parametry === Funkce může být použita s parametry jako zkušební řetězec. V tomto případě není nutné umístit svislítko za název parametru, protože je velmi nepravděpodobné, že se rozhodnete nastavit případ jako řetězec "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>". (Toto je hodnota, kterou bude parametr přednastaven, pokud svislítko chybí a parametr neexistuje nebo nemá hodnotu. Podívejte se na stránku {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> Ve výše uvedeném případě, pokud se <code><nowiki>{{{1}}}</nowiki></code> rovná <code>foo</code>, funkce vrátí <code>Foo</code>. Pokud se rovná <code>baz</code>, funkce vrátí <code>Baz</code>. Pokud je parametr prázdný nebo neexistuje, vrátí funkce <code>Bar</code>. Stejně jako ve výše uvedené části lze případy kombinovat a získat jediný výsledek. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> Pokud se <code><nowiki>{{{1}}}</nowiki></code> rovná <code>foo</code>, <code>zoo</code> nebo <code>roo</code>, funkce vrátí <code>Foo</code>. Pokud se rovná <code>baz</code>, funkce vrátí <code>Baz</code>. Pokud je parametr prázdný nebo neexistuje, vrátí funkce <code>Bar</code>. Kromě toho lze výchozí výsledek vynechat, pokud si nepřejete nic vracet, pokud hodnota testovacího parametru neodpovídá žádnému z případů. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> V tomto případě funkce vrací prázdný řetězec, pokud neexistuje <code><nowiki>{{{1}}}</nowiki></code> a je rovno <code>foo</code> nebo <code>bar</code>, v tomto případě vrací <code>Foo</code>, respektive <code>Bar</code>. To má stejný účinek jako prohlášení výchozího výsledku za prázdný. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> Pokud se z nějakého důvodu rozhodnete nastavit případ jako "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", funkce vrátí výsledek tohoto případu, pokud parametr neexistuje nebo nemá hodnotu. Parametr by musel existovat a mít jinou hodnotu než řetězec "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", aby vrátil výchozí výsledek funkce. :(pokud <code><nowiki>{{{1}}}</nowiki></code> neexistuje nebo je prázdný): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(když <code><nowiki>{{{1}}}</nowiki></code> má hodnotu "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(když <code><nowiki>{{{1}}}</nowiki></code> má hodnotu "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' V tomto hypotetickém případě budete muset do parametru přidat svislítko (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). <span id="Comparison_behavior"></span> === Srovnávací chování === Stejně jako u <code>[[##ifeq|#ifeq]]</code> je porovnání provedeno číselně, pokud porovnávaný řetězec i řetězec případu jsou číselné nebo jako řetězec citlivý na velikost písmen jinak: :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' Řetězec <code>''case''</code> může být prázdný: :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' Jakmile je nalezena shoda, následující <code>''cases''</code> (případy) jsou ignorovány: :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= Numerická srovnání s přepínačem <code>[[##switch|#switch]]</code> a <code>[[##ifeq|#ifeq]]</code> nejsou ekvivalentní srovnáním ve výrazech (viz také výše): :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <span id="Raw_equal_signs"></span> === Prosté znaky rovná se === Řetězce "Case" nemohou obsahovat nezpracované rovnítko. Chcete-li to obejít, použijte kouzelné slovo [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] nebo nahraďte rovnítko kódem HTML <code><nowiki>&amp;#61;</nowiki></code>. Příklad: {| class="wikitable" ! Napíšete ! Zobrazí se |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=Pro jednoduchý příklad použití této funkce v reálném životě, se podívejte na [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Dva složitější příklady lze nalézt na {{ll|Template:Extension}} a [[w:Template:BOTREQ]]. }} <span id="Replacing_#ifeq"></span> === Nahrazování #ifeq === <code>#switch</code> lze použít ke snížení [[Special:MyLanguage/Help:Expansion depth|hloubky rozšíření]]. Například: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> je ekvivalentní * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> tj. hluboké založení, lineární: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> Na druhou stranu by výměna přepínače mohla být komplikovaná, případně nepraktická pro IF vnořené do obou větví (zobrazeny s alternativami odsazení, odsazené na obou stranách), čímž by se vytvořil plný symetrický strom: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Kód ! {{hl1}} | Popis ! {{hl1}} | Aktuální výstup <br /><small class="noprint">(Pro aktualizaci [{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} vyčistěte mezipaměť této stránky])</small> |- ! {{hl2}} colspan="3"| Rok |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | 4místný rok. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Dvoumístný rok. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1 pokud je to přestupný rok, 0 když ne. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|Vyžaduje PHP verze 5.1.0 a novější a [[rev:45208]].|group=note}} | ISO-8601 rok určeného týdne.{{#tag:ref|Tato hodnota má stejnou hodnotu jako Y, s tou výjimkou, že pokud číslo týdne ISO (W) patří do předchozího nebo příštího roku, použije se tento rok.|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|Pokud poznámka 1 nebude splněna, vydá ''o''.|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Měsíc |- | style="text-align: center;" | <code>n</code> | Číslo měsíce bez doplnění nulou. | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | Měsíční index s doplněním nulou. | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | Zkratka názvu měsíce v jazyce webu. | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | Celý název měsíce v jazyce webu. | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | Vyplňte celý měsíc ve formuláři v [[w:Genitive case|genitivu]] pro jazyky stránek, které rozlišují mezi formáty genitive a [[w:Nominative case|nominative]]. Tato možnost je užitečná pro mnoho [[w:Slavic languages|slovanských jazyků]], jako je polština, ruština, běloruština, čeština, slovenština, slovinština, ukrajinština atd. | style="line-height: 1.6;" | Pro polštinu:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominative (první pád))<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitiv) |- ! {{hl2}} colspan="3"| Den měsíce nebo roku |- | style="text-align: center;" | <code>j</code> | Den v měsíci, bez doplnění nulou. | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | Den v měsíci doplněný nulami | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | Den roku (leden&nbsp;1 = 0).<br />{{note}} Chcete-li získat den ISO roku, přidejte 1. | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Týden a den v týdnu |- | style="text-align: center;" | <code>W</code> | Číslo týdne ISO 8601, doplněné nulou. | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | ISO 8601 den v týdnu (pondělí = 1, neděle = 7). | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | Číslo dne v týdnu (neděle = 0, sobota = 6). | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | Zkratka pro den v týdnu. Zřídka internacionalizován. | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | Celý název dne v týdnu. Zřídka internacionalizován. | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hodina |- | style="text-align: center;" | <code>a</code> | "am" ráno (00:00:00 → 11:59:59), "pm" odpoledne (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Velká verze <code>a</code> výše. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hodina ve 12hodinovém formátu, bez doplnění nulou. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hodina ve 12hodinovém formátu s doplněním nulou. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hodina ve 24hodinovém formátu, bez doplnění nulou. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hodina ve 24hodinovém formátu, s doplněním nulou. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minuty a sekundy |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | Minuty za hodinou s doplněnou nulou. | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | Sekundy za minutou s doplněnou nulou. | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[w:Unix time|Unix čas]]. Sekundy od 1. ledna 1970 00:00:00 GMT. | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Časové pásmo (od [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identifikátor časového pásma. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | Zda je nebo není datum v letním čase. | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Rozdíl oproti greenwichskému času (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Rozdíl oproti Greenwichskému času (GMT) s dvojtečkou | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Zkratka časového pásma. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | Posun časového pásma v sekundách. | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Různé |- | style="text-align: center;" | <code>t</code> | Počet dní v aktuálním měsíci. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | Datum ve formátu ISO 8601, ekvivalent <code>Y-m-d"T"H:i:s+00:00</code>. | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | [[rfc:5322|RFC 5322]] formátované datum, ekvivalentní <code>D, j M Y H:i:s +0000</code>, s názvem dne v týdnu a názvem měsíce - není internacionalizováno. | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Jiné kalendáře než Gregoriánský |- ! {{hl3}} colspan="3" | islámský |- | style="text-align: center;" | <code>xmj</code> | Den v měsíci. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Celé jméno měsíce. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Index měsíce. | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Celý rok. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Íránský (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Počet dní v aktuálním měsíci. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Den v roce. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Den v měsíci. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Celé jméno měsíce. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Index měsíce. | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Celý rok. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Dvoumístný rok. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | hebrejština |- | style="text-align: center;" | <code>xjj</code> | Den v měsíci. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Celé jméno měsíce. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Počet dní v měsíci. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Genitivní forma názvu měsíce. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Číslo měsíce. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Celý rok. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Thajské solární |- | style="text-align: center;" | <code>xkY</code> | Celý rok v [[w:Thai solar calendar|thajském slunečním kalendáři]]. <br />{{note}} Pro roky před rokem 1941 nejsou data v rozmezí Jan-Mar [[w:Thai_solar_calendar#New_year|vypočítána]] správně. | {{#time:xkY}} |- ! {{hl3}} colspan="3" | Minguo/Juche rok |- | style="text-align: center;" | <code>xoY</code> | Celý rok. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | Japonské nengo |- | style="text-align: center;" | <code>xtY</code> | Celý rok. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | Příznaky |- | style="text-align: center;" | <code>xn</code> | Naformátování dalšího číselného kódu jako nezpracovaného čísla ASCII. | V hindském jazyce <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produkuje ०६, 06. |- | style="text-align: center;" | <code>xN</code> | colspan="2" | Jako <code>xn</code>, ale jako přepínaný příznak, který vydrží až do konce řetězce nebo do dalšího zobrazení <code>xN</code> v řetězci. |- | style="text-align: center;" | <code>xr</code> | Naformátujte další číslo jako římskou číslici. Funguje pouze pro čísla do 10 000 <br /> <small>(až 3 000 v předešlých verzích MediaWiki 1.20)</small>. | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | Naformátujte další číslo jako hebrejskou číslici. | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} Tato syntaktická funkce bere datum a nebo čas (v gregoriánském kalendáři) a formátuje ho podle dané syntaxe. Lze určit objekt datum / čas. Výchozí hodnota je hodnota [[Special:MyLanguage/Help:Magic words#Date and time|kouzelného slova]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight>, tj. čas, kdy byla stránka naposledy vykreslena do HTML. :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> Seznam přijatých formátovacích kódů je uveden v tabulce vpravo. Jakýkoli znak ve formátovacím řetězci, který není rozpoznán, je předán nezměněný. To platí také pro mezery (systém je pro interpretaci kódů nepotřebuje). Pokud ve formátovacím řetězci není rozpoznán žádný znak a objekt data/času je bez chyby, je formátovací řetězec vrácen jako výstup. Existují také dva způsoby, jak uniknout znakům uvnitř formátovacího řetězce: # Zpětné lomítko následované znakem formátování je interpretováno jako jediný literálový znak. # Znaky uzavřené ve dvojitých uvozovkách se považují za doslovné znaky a uvozovky se odstraní. Kromě toho je spřežka <code>xx</code> interpretována jako jediné doslovné "x". Vzhledem k tomu, že se seznam formátovacích kódů neustále vyvíjí (s podporou nových kalendářů nebo nových datových polí vypočítaných a formátovaných jinak), měli byste vyhýbat všem doslovným znakům (nejen písmenům ASCII, která se aktuálně používají formátovacími kódy), které je třeba předat nezměněné. Bohužel v současné době není ASCII jednoduchá uvozovka stále uznávána jako jednoduchá alternativa pro označení doslovného textu k aktuálně podporovaným dvojitým uvozovkám ASCII (například dvojité uvozovky jsou povinné pro jiná použití, jako je vymezení hodnot řetězců v JSON, C , C++...) a zpětná lomítka (která musí být escapována také v řetězcových konstantách používaných mnoha jazyky, včetně JSON, C, C++, PHP, JavaScript, Lua). Stále tedy nemůžete vložit žádné doslovné dvojité uvozovky, aniž byste je neuvedli zpětným lomítkem (nebo můžete místo toho použít jiné složené, hranaté nebo čtvercové uvozovky). :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' Objekt <code>''date/time object''</code> může být v jakémkoli formátu akceptovaném funkcí [https://php.net/function.strtotime strtotime()] v PHP. Jsou přijímány jak absolutní (např. <code>20 December 2000</code>), tak relativní (např. <code>+20 hours</code>) a kombinované časy (např. <code>30 July +1 year</code>) časy. :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <code>''language code''</code> (kód jazyka) v [[w:ISO 639-3|ISO 639-3]] (?) umožňuje zobrazení řetězce ve vybraném jazyce :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' Parametr <code>''local''</code> určuje, zda ''objekt datum/čas'' odkazuje na místní časové pásmo nebo UTC. Toto je booleovský parametr: Jeho hodnota je určena přetypováním hodnoty argumentu (pro podrobnosti o tom, jak se řetězec přetypuje na booleovské hodnoty viz [https://php.net/language.types.boolean#language.types.boolean.casting oficiální dokumentace PHP]). {{note|2=reminder|1=Upozorňujeme, že pokud je proměnná {{phpi|$wgLocaltimezone}} nastavena na <code>UTC</code>, není žádný rozdíl ve výstupu, když je <code>local</code> nastaven na <code>true</code> nebo <code>false</code>.}} Podrobnosti viz následující příklady: :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' Pokud jste vypočítali časovou značku Unixu, můžete ji použít při výpočtech data tak, že předběžně čekáte na symbol <code>@</code>. :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= Bez předpony <code>@</code> před číselnými hodnotami časových razítek je výsledkem většinou chyba nebo je to neočekávaná hodnota: :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (správný) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (nepodporovaný formát roku) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (správný) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' (interpretováno jako rok s aktuálním měsícem a dnem v měsíci) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (správný) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' (interpretováno jako rok s aktuálním měsícem a dnem v měsíci) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (správný) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (nepodporovaný formát roku) }} {{Warning|1= Rozsah přijatelného vstupu je 1. ledna 0111 → 31. prosince 9999. Pro roky 100 až 110 je výstup nekonzistentní, Y a přestupné roky jsou jako roky 100-110, r, D, la U jsou jako interpretace těchto let jako 2000-2010. :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> (správný, žádný přestupný rok), ale :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' (špatně, i když 100 je interpretováno jako 2000, protože to je přestupný rok) :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' Čísla roků 0-99 jsou interpretována jako 2000-2069 a 1970-1999, s výjimkou případů, kdy jsou psána ve čtyřmístném formátu s úvodními nulami: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) Den v týdnu je dodáván pro roky 100-110 a od roku 1753, pro roky 111-1752 zobrazuje r-výstup "Unknown" (neznámý) a l-výstup "<>". V důsledku toho se r-výstup nepřijímá jako vstup pro tyto roky. }} Lze zadat úplná nebo částečná absolutní data; funkce "vyplní" části data, které nejsou specifikovány pomocí ''aktuálních'' hodnot: :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= Funkce vyplňování není konzistentní. Některé části jsou vyplněny pomocí aktuálních hodnot, jiné nejsou: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' Vrací aktuální den, v aktuálním roce, v uvedeném měsíci. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' Vrací aktuální den, a v uvedeném roce. To však neplatí, je-li uvedeno obojí: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' Vrací první den uvedeného měsíce. }} Čtyřciferné číslo se vždy interpretuje jako rok, nikdy ne jako hodiny a minuty: <ref>Před rokem 2011 tomu tak nebylo, jak dokládá {{rev|86805}}.</ref> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' Šestimístné číslo je interpretováno jako hodiny, minuty a sekundy, pokud je to možné, ale jinak jako chyba (nikoli například rok a měsíc): :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' Vstup je považován za čas, pravděpodobněji než za rok + měsíc. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' Ačkoli 19:60:09 není platný čas, 196009 není interpretován jako září 1960. Funkce převádějící matematické znaky na data: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' Celková délka formátovacích řetězců <code>#time</code> je omezena na 6000 znaků<ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problém s časovými pásmy ==== Tato funkce syntaktického analyzátoru #time (konkrétně v ''PHP DateTime'') obsahuje chybu, která neumožňuje předávání nečísel jako kompenzace relativního časového pásma. Tento problém se netýká při použití hodinového časového pásma, jako je EDT. Například: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} Indie je však s časovým posunem +5,5 hodiny od UTC a proto použití jejího časového pásma obvykle neumožňuje správný výpočet relativního časového pásma. Co se stane: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} Chcete-li tento problém vyřešit, jednoduše převeďte čas na minuty nebo sekundy, například: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} (Tim Starling, vývojář této funkce, poskytl přesnou syntaxi tohoto řešení.) <span id="#time_format_like_in_signatures"></span> ==== #time formát jako u podpisů ==== Někdy je užitečné vytvořit časové razítko, které vypadá jako automatické časové razítko generované [[Special:MyLanguage/Help:Signatures|podpisy]] v diskuzích na diskusních stránkách. Na wiki v angličtině ji lze vytvořit pomocí: * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == Tato funkce je syntaktická zkratka, která funguje stejně jako <code><nowiki>{{#time: ... }}</nowiki></code> s parametrem <code>local</code> nastaveným na {{phpi|true}}, takže vždy používá preferované časové pásmo uživatele nebo nakonfigurované časové pásmo wiki (jak je nastaveno v {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}) Syntaxe funkce je: :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=Upozorňujeme, že pokud je proměnná {{phpi|$wgLocaltimezone}} nastavena na <code>UTC</code>, není žádný rozdíl ve výstupu, když je <code>local</code> nastaveno na {{phpi|true}} nebo {{phpi|false}}}} [[File:Time-Timel.png|thumb|Příklad použití funkcí analyzátoru #time a #timel ze serveru, kde časové pásmo není UTC]] Podívejte se například na následující příklady: :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|Příklad upozornění od https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid]] {{Warning|1= Uvědomte si, že U pro čas i timel vrátí stejný počet sekund od 1970-01-01 00:00:00 UTC na Wikipedii s odlišným časovým pásmem než UTC (dříve známý jako GMT) :<code>U</code> Unixový čas. Sekundy od 1. ledna 1970 00:00:00 GMT. :<code>Z</code> Posun časového pásma v sekundách. :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == Tato funkce formátuje datum pomocí standardního formátu pro vybraný jazyk, jak je definováno v <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (viz {{Phab|T223772}}). : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=''objekt datum/čas'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=''objekt datum/čas'' |2=''typ formátu'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=''objekt datum/čas'' |2=''typ formátu'' |3=''kód jazyka'' }} Formát ''objektu datum/čas'' je stejný jako u [[#time|#time]]. Pokud je prázdný, použije se čas, kdy byla stránka vykreslena. ''typ formátu'' může být jeden z těchto: ; <code>time</code> : Zobrazí se pouze čas. ; <code>date</code> : Zobrazí se pouze datum. ; <code>both</code> : Zobrazí se čas i datum. ; <code>pretty</code> : Zobrazuje se pouze datum ve zkráceném formátu, který neobsahuje rok. Ne všechny jazyky to podporují.Pokud není podporován, použije se formát "datum". Pokud není zadán ''typ formátu'', zobrazí se čas i datum, jako kdyby bylo zadáno <code>both</code>. Pokud není zadán ''kód jazyka'', použije se jazyk obsahu stránky. Použití <code>#timef</code> místo <code>#time</code> umožňuje šablonám snadněji podporovat více jazyků, protože různé jazyky mají různé způsoby formátování dat. V angličtině je pořadí dne a měsíce řízeno {{wg|AmericanDates}}. Příklady: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == Tato funkce je stejná jako [[#timef|#timef]] kromě toho, že používá místní časové pásmo wiki, jak je nakonfigurováno v {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}. :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == Tato funkce rozdělí nadpis stránky na segmenty na základě lomítek a poté vrátí některé z těchto segmentů jako výstup. : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=jméno stránky |2=počet segmentů pro vrácení |3=první segment pro vrácení }} Pokud není zadán parametr ''počet segmentů k návratu'', je výchozí hodnota "0", která vrací všechny segmenty z prvního segmentu k návratu (včetně). Pokud není zadán parametr ''první segment k návratu'' nebo je "0", bude výchozí hodnota "1": : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Více na stránce <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' Pro obě hodnoty jsou akceptovány záporné hodnoty. Záporné hodnoty pro parametr ''počet segmentů, které se mají vrátit'' ve skutečnosti 'odstraňují' segmenty z konce řetězce. Záporné hodnoty pro ''první segment, který se vrátí'' se překládá jako "začít s tímto segmentem počítáním zprava": : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' Odřízne jeden segment od konce řetězce. Viz též {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' Odřízne všechny 4 segmenty od konce řetězce : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' Odřízne 5 segmentů od konce řetězce (více než existuje) : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' Vrací poslední segment. Viz též {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' Odřízne jeden segment od konce řetězce a poté vrátí druhý segment a dále : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' Začne kopírovat u druhého posledního prvku. Odřízne jeden segment od konce řetězce Před zpracováním je parametr ''pagename'' (jméno stránky) dekódován HTML: Pokud obsahuje některé standardní entity HTML znaků, budou převedeny na prosté znaky (interně kódované pomocí UTF-8, tj. stejné kódování jako na zdrojové stránce MediaWiki pomocí této funkce analyzátoru). : Například jakýkoli výskyt <code>&amp;quot;</code>, <code>&amp;#34;</code> nebo <code>&amp;#x22;</code> v ''pagename'' bude nahrazen <code>"</code>. : Nevykonává se žádné jiné konverze z HTML na prostý text, takže značky HTML zůstanou v tomto počátečním kroku neporušené, i když jsou v názvech stránek neplatné. {{tip| 1= Je známo, že některá magická klíčová slova nebo funkce analyzátoru MediaWiki (například <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> a podobné) vracejí řetězce, které jsou zbytečně kódovány HTML, i když jejich vlastní vstupní parametr nebyl kódován HTML: Funkci syntaktického analyzátoru titulků lze poté použít jako zástupné řešení k převodu těchto vrácených řetězců tak, aby je bylo možné správně zpracovat pomocí některých dalších syntaktických funkcí, které také vezmou název stránky v parametru (například <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>, ale stále s HTML nefungují správně) - kódované vstupní řetězce. This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. Pokud je například aktuální stránka [[commons:Category:Côte-d'Or| Kategorie:Côte-d'Or]], pak: * <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight> a <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> vracejí <code>1</code> (skutečný); (funkce #ifeq analyzátoru provádí HTML dekódování vstupních parametrů). * <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight> a <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> vracejí <code>1</code>; (funkce #switch analyzátoru provede HTML dekódování vstupních parametrů). * <syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight> nebo dokonce <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight>, vrátí všechny <code>1</code>, pokud daná stránka kategorie existuje (funkce #ifexist analyzátoru provede HTML dekódování jejích vstupních parametrů); * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> vrátí nenulové číslo, pokud tato kategorie obsahuje stránky nebo podkategorie, '''ale''': * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, může stále '''bezpodmínečně''' vrátit 0, stejně jako: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> Důvodem tohoto neočekávaného chování je, že u současných verzí MediaWiki existují dvě upozornění: * <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight> nebo dokonce <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''může'' vrátit řetězec skutečně zakódovaný HTML <code>Category:Côte-d&apos;Or</code> a ne očekávaný <code>Category:Côte-d'Or</code> a to: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''bezpodmínečně''' vrací 0 (magické klíčové slovo PAGESINCAT neprovádí žádné dekódování vstupního parametru HTML). Jednoduché řešení používající titulní grafy (které budou i nadále fungovat, pokud budou tato dvě upozornění opravena v novější verzi MediaWiki): * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, že všechny vrátí skutečný počet stránek ve stejné kategorii. }} Poté je, pokud je to možné, dekódovaný ''název stránky'' kanonizovaný do standardního názvu stránky podporovaného MediaWiki: # Všechna podtržítka jsou automaticky nahrazena mezerami: #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' Ne bah_boo, navzdory podtržítku v originálu. # Řetězec je rozdělen maximálně 25krát. Další lomítka jsou ignorována a 25. prvek bude obsahovat zbytek řetězce. Řetězec je také omezen na 255 znaků, protože je považován za [[Special:MyLanguage/Manual:Page table#Schema summary|název stránky]]: #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: Pokud jste z jakéhokoli důvodu potřebovali posunout tuto funkci na její limit, i když je velmi nepravděpodobné, je možné obejít 25 dělený limit volání vnořených funkcí: #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # Nakonec se první dílčí řetězec kapitalizuje podle nastavení velkých písmen v místní wiki (pokud se tento dílčí řetězec také začíná názvem místního jmenného prostoru, je tento název jmenného prostoru také normalizován). #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= Můžete použít #titleparts jako malý "řetězcový analyzátor a převodník", ale zvažte, že vrací první podřetězec s velkým prvním písmenem: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' Pokud je potřeba malá písmena, použijte k ovládání výstupu funkci lc: : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' Chcete-li získat 'správnou' první kapitalizaci podřetězců (velká nebo malá písmena), můžete na začátek řetězce předepsat lomítko. Pro ''vrácení prvního segmentu'' použijte <code>2</code> místo <code>1</code>: : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= Některé znaky, které jsou {{ll|Manual:Page title#Naming restrictions|neplatné v názvu stránky}} způsobí, že #titleparts nebude analyzovat řetězec: : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. Nevytváří očekávané: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. Nefunguje, protože závorky jsou v názvech stránek nezákonné a tato funkce analyzátoru nezpracovává odkazy vložené do jeho vstupního parametru pagename, i když používají syntaxi MediaWiki nebo jakékoli jiné značky HTML nebo MediaWiki. : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". Nefunguje, protože "#" je také v nadpisech stránek nezákonné. }} {{Warning|1= Pokud je některá část názvu pouze "<code>.</code>" nebo "<code>..</code>", #titleparts nebude řetězec analyzovat: : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. Celý řetězec je vrácen. Neprodukuje očekávané: '''one''' }} {{Warning|1= Tato funkce se elegantně nerozkládá, pokud vstup přesáhne 255 bajtů v UTF-8. Pokud je vstupní řetězec 256 bajtů nebo více, je vrácen celý řetězec. }} <span id="String_functions"></span> == Řetězcové funkce == {{Main|Extension:ParserFunctions/String functions}} Rozšíření ParserFunctions volitelně definuje různé funkce řetězce, pokud je <code>$wgPFEnableStringFunctions</code> nastaveno na {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Dokumentaci najdete na vyhrazené podstránce a příklady {{ll|Manual:Performing string operations with parser functions}}. {{Warning |1=V roce 2013 bylo rozhodnuto, že '''tyto funkce nebudou ''nikdy'' povoleny na žádné wiki Wikimedie''', protože jsou neefektivní, když se používají ve velkém měřítku (viz [[phab:T8455]] pro nějakou historii). '''Tyto funkce nefungují na wikinách Wikimedie!'''<br/><br/>Pokud jste zde, abyste něco napsali do projektu Wikimedie, hledáte něco jiného: Pokud má vaše domovská wiki funkce řetězce, pravděpodobně používá {{ll|Extension:Scribunto|Lua}}. Například anglická Wikipedie používá [[w:Module:String|Modul:String]], který dělá některé stejné věci s naprosto odlišnou syntaxí. Existují také jednotlivé [[w:Template:String-handling templates|šablony pro manipulaci s řetězci]]. }} Zde je krátký přehled funkcí [[Module:String]]: * [[w:Module:String#len|&#35;len]] (délka vlákna): <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] (podřetězec): <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] (pozice cíle): <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] (opakovat): <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Obecné problémy == <span id="Substitution"></span> === Náhrady === Funkce syntaktického analyzátoru mohou být [[Special:MyLanguage/Help:Substitution|nahrazeny]] předponou hash (#) znaku <code>'''subst:'''</code>: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → kód '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' bude vložen do wikitextu, protože stránka {{FULLPAGENAME}} existuje. {{Warning|1= Výsledky nahrazovaných funkcí syntaktického analyzátoru nejsou definovány, pokud výrazy obsahují ''ne''nahrazovatelný nestálý kód, jako jsou {{ll|Help:Magic words#Variables|proměnné}} nebo jiné funkce syntaktického analyzátoru. Pro konzistentní výsledky musí být nahrazen veškerý nestálý (volatilní) kód ve vyhodnocovaném výrazu. Viz [[w:Help:Substitution|Nápověda:Záměna]].}} Náhrada nefunguje v rámci {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}. Pro tento účel můžete použít <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code>. <span id="Redirects"></span> === Přesměrování === Zejména [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] by se mohl hodit v {{ll|Help:Redirects|přesměrování}} na stránky obsahující data, ale to nefunguje. <span id="Escaping_pipe_characters"></span> === Únikové znaky svislítka === <span id="In_tables"></span> ==== V tabulkách ==== Funkce analyzátoru změní syntaxi {{ll|Help:Tables|wikitable}} a znaky svislé čáry (<code><nowiki>|</nowiki></code>), přičemž všechny nezpracované znaky svislé čáry budou považovat za oddělovače parametrů. Aby se tomu předešlo, většina wikin používala šablonu [[{{ns:10}}:!]] s obsahem pouze nezpracovaného znaku svislítka (<code><nowiki>|</nowiki></code>), protože MW 1.24 jej nahradila skupinou znaků {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> word}}. Tím se "skryje" svislítko (roura, trubka, svislá čára) před analyzátorem MediaWiki, což zajistí, že se nepoužije, dokud nebudou rozbaleny všechny šablony a proměnné na stránce. Poté bude interpretováno jako řádek tabulky nebo oddělovač sloupců. Alternativně lze použít základní tabulku HTML. I když je to méně intuitivní a více náchylnější k chybám. Můžete také escapovat svislý znak &vert; pro zobrazení jako prostý, neinterpretovaný znak pomocí entity HTML: <code>&amp;#124;</code> nebo <code>&amp;vert;</code> . {| class="wikitable" ! Popis ! Napíšete ! Zobrazí se |- | Znak svislítka jako oddělovač řádků nebo sloupců tabulky | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | Svislítko jako prostý znak | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== Ve voláních šablon ==== Platí stejná ochrana svislítka jako pro následující příklad: <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> Všimli jsme si, že ''text after'' se nezobrazuje, když je přítomno svislítko | těsně před ''sandbox name='', protože ''|sandbox name='' je chybně považováno za parametr šablony ''Documentation'' na stejné úrovni jako ''|content=''. <span id="Stripping_whitespace"></span> === Odstraňování mezer === Mezery, včetně nových řádků, tabulátorů a mezer, jsou odstraněny ze začátku a konce všech parametrů těchto funkcí analyzátoru. Pokud to není žádoucí, lze řetězce porovnávat po uvedení do uvozovek. :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' Chcete-li zabránit oříznutí předcházejících a následujících částí, podívejte se na [[m:Template:If]]. Někteří lidé to dosahují pomocí zápisu <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> místo mezer. :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' Tuto metodu však lze použít k vykreslení pouze '''jednoho''' znaku mezery, protože syntaktický analyzátor potlačuje více znaků mezery v jednom řádku do jednoho znaku. :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} V tomto příkladu se styl <code>white-space: pre</code> používá k vynucení mezery, která má být prohlížečem zachována. Ale ani s ním nejsou mezery zobrazeny. K tomu dochází proto, protože mezery jsou před odesláním do prohlížeče odstraněny softwarem. Toto chování je možné vyřešit nahrazením mezer znaky <code>&amp;#32;</code> (''breakable space''(rozbitný prostor)) nebo znaky <code>&amp;nbsp;</code> (''non-breakable space''(nerozbitný prostor)), protože nejsou měněny softwarem: :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' Pozor, ne všechny parametry jsou si rovny. V ParserFunctions jsou prázdné znaky na začátku a konci vždy odstraněny. V {{ll|Help:Templates|šablonách}} jsou prázdné znaky na začátku a konci odstraněny pro pojmenované parametry a pojmenované nepojmenované parametry, ale ''ne'' z nepojmenovaných parametrů: :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Další funkce parseru == <span id="Case_conversion_functions"></span> === Funkce převodu případu === * '''Malá písmena:''' {{xpdoc|lc: AbC|}} * '''Velká písmena:''' {{xpdoc|uc: AbC|}} * '''První znak malým písmenem:''' {{xpdoc|lcfirst: AbC}} * '''První znak velký:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Kódovací funkce === * '''Kódování URL:''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> zobrazí se jako ---- "{{urlencode: AbC dEf ghi}}" ---- Vnitřní nové řádky se tedy převedou na %0A a vnitřní mezery se převedou na +. <span id="Anchor_encoding"></span> === Kódování kotev === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> zobrazí se jako ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Související odkazy == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – (neúplný) seznam funkcí analyzátoru přidaných jádrem a rozšířeními. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – zejména pro formátování čísel a výplň * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] zastarávající {{ll|Extension:StringFunctions}} * Funkce analyzátoru pro Wikibase (rozšíření, která umožňují Wikidata): [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|Jak používat data na projektech Wikimedia#Funkce Parseru]] <span id="References"></span> == Poznámky pod čarou == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] 0mgjd6jy0lnywzvwdcoiutsp7r9rrfm OAuth/For Developers/tr 0 1109351 8364296 8350300 2026-05-03T12:27:53Z FuzzyBot 451990 Updating to match new version of source page 8364296 wikitext text/x-wiki <languages /> <div lang="en" dir="ltr" class="mw-content-ltr"> This page explains how to develop applications that can integrate with a wiki running {{ll|Extension:OAuth}} (an extension which turns MediaWiki into an [[w:OAuth|OAuth]] server) to securely request permission to act on the user's behalf. </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you are developing a bot or similar application that always uses the same account, you might prefer the simpler [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]].</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> == OAuth in a nutshell == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> OAuth allows an application to request permission from a user to act through that user's wiki account, without knowing the user's password, and without being able to do everything the user could (e.g. the app might be able to edit articles but not delete them, so even users with extended permissions can safely use OAuth-enabled tools). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This happens via the [https://oauth.net/2/ OAuth 2.0] or [https://oauth.net/core/1.0a/ OAuth 1.0a] protocol, and consists of three stages: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">The developer must register the application (often called "consumer" in the OAuth terminology) on the wiki, possibly go through some sort of review process, and will receive some credentials.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">When a user wants to use it, the application must initiate an authorisation process.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will involve sending the user to a special page on the wiki, which will display an authorisation dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the user accepts, the application will receive another set of credentials (which are specific to that user, and can be revoked by the user at any time).</span> # <span lang="en" dir="ltr" class="mw-content-ltr">When the application actually needs to make an action (API request) on the user's behalf, it can combine the credentials received in steps 1 and 2 to sign the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth is a widely used open standard (you can see it on sites like Google or Facebook or GitHub, e.g. when using accounts at those sites to log in elsewhere).</span> {{info|1=<span lang="en" dir="ltr" class="mw-content-ltr">OAuth should not be confused with:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Initiative for Open Authentication|OATH]] (a second-factor authentication protocol family, commonly known as "type the six numbers you see on your mobile app", now enabled on Wikimedia sites)</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:OpenID Connect|OpenID Connect]] (an authentication protocol based on OAuth 2.0, which the OAuth MediaWiki extension partially supports).</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> For a slightly larger nutshell on OAuth 1.0a, see [https://docs.google.com/presentation/d/1537HnwSaSzH-b8hINcz48SNhT8ElAUPC39to0_O1iNA/edit#slide=id.g15105b408d_0_287 these slides]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == OAuth in detail == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The registration is basically the same for OAuth 1.0a and OAuth 2, with the difference being only the presence of a few form fields. The remaining parts differ significantly depending on the OAuth version.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Generally, OAuth 2 is recommended if available in your environment.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Registration === </div> <span lang="en" dir="ltr" class="mw-content-ltr">To register a new OAuth application, submit the form at <code>[[m:Special:OAuthConsumerRegistration/propose|Special:OAuthConsumerRegistration/propose]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Try to give sufficient information about the application for admins and users to decide whether it can be trusted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">URLs to places with more information (such as the application itself, the source code or on-wiki documentation) can be useful.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For OAuth applications to be used on Wikimedia projects, see [[meta:Special:MyLanguage/OAuth app guidelines|app guidelines]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Besides the descriptive ones, the fields have the following meaning:</span> * <code>This consumer is for use only by {{tag|user|open|plain=1}}</code>: <span lang="en" dir="ltr" class="mw-content-ltr">whether you use [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]] (which do not need to be reviewed or authorised but are only usable by yourself).</span> * <code>callback URL</code> (<span lang="en" dir="ltr" class="mw-content-ltr">irrelevant to owner-only consumers</span>): <span lang="en" dir="ltr" class="mw-content-ltr">the URL where the user returns after authorisation is checked against this.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(This is an extra layer of security against an attacker trying to steal credentials during authorisation.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>use as prefix</code> option is enabled, the URL must start with this (the check is dumb so make sure to add at least a <code>/</code> after the domain name), otherwise it must be an exact match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you are developing/testing your local machine, specify [[w:Localhost|Localhost]] in this field (e.g. <code><nowiki>http://localhost:8080/</nowiki></code>).</span> * <code>Applicable project</code> (<span lang="en" dir="ltr" class="mw-content-ltr">for wiki farms only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">project(s) on which to use your application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can limit the application to a single wiki or have it work everywhere.</span> * <code>Types of grants</code> / <code>Applicable grants</code>: <span lang="en" dir="ltr" class="mw-content-ltr">the permissions needed by your application (be conservative). The actual permissions will be an intersection of this and what permissions the user has.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Currently, the user must authorise grouped permissions, not individual ones ([[Phab:T59505|T59505]]).</span> * <code>Allowed IP ranges</code>: <span lang="en" dir="ltr" class="mw-content-ltr">an optional specification of the IP ranges that you use, where OAuth requests not matching this will be rejected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is an extra layer of security against an attacker stealing your application's credentials and trying to impersonate it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> * <code>Public RSA key</code> (<span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">public key used by your application for signing requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can just leave this empty (most applications do) to use a slightly simpler shared-secret mechanism instead.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> <span lang="en" dir="ltr" class="mw-content-ltr">After registration, you'll receive the credentials needed to use OAuth.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to use it immediately with your own user account (this is meant for testing); others will only be able to use it once it is approved by an administrator.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The list of applications (approved or otherwise) is public and can be browsed at <code>[[m:Special:OAuthListConsumers|Special:OAuthListConsumers]]</code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === OAuth 1.0a === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Authorisation ==== </div> [[File:OAuth authorization interface.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Authorisation dialog shown to users</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> When registering the application, you receive two pieces of credentials: the application token (a public ID for the application) and the application secret (sort of like a password). </div> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another set of credentials (these ones specific to that user): the access token and access secret.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">With an RSA key the credentials are slightly different.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is assumed that people choosing to use an RSA key know what they are doing, so this tutorial will assume you have chosen the non-RSA option.</span> </ref> <span lang="en" dir="ltr" class="mw-content-ltr">To get them, you need to go through the authorisation process, which consists of three steps:</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|OAuth/Owner-only consumers|owner-only consumers}} for that.</span> </ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Get a request token from the wiki by sending a GET request to <code>Special:OAuth/initiate</code>, signed with the application key and secret, with the callback URL (where the user will be sent after a successful authorisation) passed as the <code>oauth_callback</code> query parameter (if you have set a constant URL at registration, the value of the parameter ''must'' be <code>oob</code>).</span><ref name="non-nice-url"><span lang="en" dir="ltr" class="mw-content-ltr">Due to [[phab:T59500]] you must currently use a non-nice URL such as <code>en.wikipedia.org/w/index.php?title=Special:OAuth/initiate</code>.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">If you are successful, the response will be a JSON object with <code>token</code> and <code>key</code> fields—the request token and request secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If not, it will have an <code>error</code> field.)</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>Special:OAuth/authorize</code>, with the application token and request token passed as query parameters (<code>oauth_consumer_key</code> and <code>oauth_token</code>, respectively).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>oauth_verifier</code> will contain the verification code that you can use to exchange the request token and secret for the access token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a request to <code>Special:OAuth/token</code><ref name="non-nice-url" /> which includes the <code>oauth_verifier</code> parameter you just received and is signed with the application token and secret and the request token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token/secret (in the same format as the request token/secret in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token and secret is what you'll need to sign API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The request token and secret is not useful anymore and can be discarded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token will remain valid indefinitely, unless the user revokes it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If you prefer not to store it, you can just repeat the authorisation process at any time though.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Applications which only need minimal privileges (have been registered as ''User identity verification only'') can use <code>/authenticate</code> instead of <code>/authorize</code> in step 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This works the same way, but the user will only see the authorisation dialog if they have not authorised this application before; otherwise the authorisation will silently succeed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure, so you don't have to implement it manually—each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Making requests on the user's behalf ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to be signed with the application token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth, with one exception (see next section).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications registered as ''User identity verification only'' cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Identifying the user ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a custom protocol (similar to OpenID Connect) for authenticating the user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send a signed OAuth request to <code>Special:OAuth/identify</code>:</span><ref name="non-nice-url" /> <span lang="en" dir="ltr" class="mw-content-ltr">the response will be a [[w:JSON Web Token|JWT]] (JSON Web Token &ndash; a signed JSON object) including the name of the user, their {{ll|Manual:Central ID|central ID}} (under the key <code>sub</code>) and various other information (such as their user groups and whether they are blocked; also the email address if the application was registered with the right grant type).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is more secure than using the API (e.g. the userinfo module) for authentication, which could be subject to [[w:Man-in-the-middle attack|man-in-the-middle attacks]]; always use this if you need to identify a user!</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also, make sure you properly validate the JWT (there are many libraries which can help with that).</span> <span lang="en" dir="ltr" class="mw-content-ltr">You should check each of the following: the issuer (<code>iss</code>) matches the domain name of the wiki, the audience (<code>aud</code>) matches your application key, the issued-at time (<code>iat</code>) is in the past and reasonably close to current time, the expiration time (<code>exp</code>) is in the future, the nonce (<code>nonce</code>) matches the one you sent in the request.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Signing requests ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Steps 1 and 3 of the authorisation process require signing the request; API requests and <code>Special:OAuth/identify</code> must likewise be signed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The signing process is detailed in [https://oauth.net/core/1.0a/#signing_process section 9 of the OAuth spec], but it is cumbersome to implement by hand and [https://oauth.net/1/ many libraries] are available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find code samples and an overview of how to do it by hand in the {{ll|OAuth/Owner-only_consumers|owner-only consumer}} documentation.</span> (<span lang="en" dir="ltr" class="mw-content-ltr">That is for signing with the consumer token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Modify as appropriate to sign with the consumer token/secret and request token/secret (authorisation step 3) or consumer token/secret only (authorisation step 1).</span>) <div lang="en" dir="ltr" class="mw-content-ltr"> === OAuth 2 === </div> <span id="Authorisation"></span> === Yetkilendirme === <span lang="en" dir="ltr" class="mw-content-ltr">When registering the application, you receive two pieces of credentials: the client application key (a public ID for the application, also called the client ID or consumer key) and the client application secret (a confidential password).</span> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another credential (this one specific to that user): the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To get it, you need to go through the [https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/ the OAuth 2 Authorization Code flow], which consists of two steps:</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See [[Special:MyLanguage/OAuth/Owner-only consumers|owner-only consumers]] for that.</span></ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>oauth2/authorize</code> under the wiki's REST endpoint (usually <code>rest.php</code>), with <code>response_type=code</code> and the consumer key (also called the client application key) as the <code>client_id</code>, possibly a <code>state</code> if you want, and optionally the <code>redirect_uri</code> (if yes, it must be the same as in your application request).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If your consumer is non-confidential, you'll also need to include a [https://www.oauth.com/oauth2-servers/pkce/authorization-request/ PKCE code challenge] (<code>code_challenge</code> and <code>code_challenge_method=S256</code>).</span><ref>PKCE &mdash; Proof Key for Code Exchange</ref> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>code</code> will contain the authorisation code that you can use to fetch the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a POST request to <code>oauth2/access_token</code> under the wiki's REST endpoint (usually <code>rest.php</code>), including <code>grant_type=authorization_code</code>, the <code>code</code> parameter you just received, your client authentication (typically as <code>client_id</code> and, for confidential clients, <code>client_secret</code>), the <code>redirect_uri</code> if and only if you specified it in the previous step (must be the same value for both), and if non-confidential the PKCE <code>code_verifier</code> and <code>code_challenge_method</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token and a refresh token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token is what you'll need to send future API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The refresh token can be used to [https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/ fetch a new access token] if the original access token expires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you prefer not to store either token, you can just repeat the authorisation process at any time.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(Before MediaWiki 1.46, non-confidential clients could only use refresh tokens using their client secret keys, not using their client IDs only, see [[phabricator:T323855|T323855]].)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure so you don't have to implement it manually - each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Making requests on the user's behalf ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to include the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the access token is used to fetch a CSRF token or other tokens, the access token must still be passed (as a header) with requests that use those tokens.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications which need minimal privileges (have been registered as ''User identity verification only'') cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> API requests including <code>rest.php/oauth2/resource/profile</code> must be authenticated with an HTTP Authorization header containing the access token, like: </div> <pre> Authorization: Bearer abcde....6789 </pre> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Identifying the user ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a somewhat incomplete implementation of OpenID Connect for authenticating the user.</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">See [[phab:T254063|T254063]] for details.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send an authenticated OAuth GET request to the <code>oauth2/resource/profile</code> API (MediaWiki's implementation of what the OIDC spec calls the UserInfo endpoint) under the wiki's REST endpoint (usually <code>rest.php</code>); the response will include the name of the user and various other information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that the GET request must use the HTTP <code>Authorization</code> header, not a query string token.</span> * '''sub''' <span lang="en" dir="ltr" class="mw-content-ltr">(central user ID)</span> * '''username''' * '''editcount''' * '''confirmed_email''' * '''blocked''' * '''registered''' * '''groups''' * '''rights''' * '''realname''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> * '''email''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Setting up a development environment == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> You can register an OAuth application on [https://meta.wikimedia.beta.wmflabs.org/wiki/Special:OAuthConsumerRegistration/propose beta meta] and test your code against that. </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you want to improve the extension itself, or debug protocol issues in detail, OAuth is available in the {{ll|MediaWiki-Vagrant}} development environment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Add the <code>oauth</code> role, and your local wiki will be able to authorise OAuth apps.</span> <syntaxhighlight lang="shell-session"> $ vagrant roles enable oauth $ vagrant provision </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Once the code is nearly ready, you can register an OAuth application on the real wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to test it with the same user account used for registering, even before it gets reviewed by admins.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If you are creating an application for Wikimedia projects, consider hosting it at [[Wikitech:Portal:Toolforge|Wikimedia Toolforge]], a free tool forge and hosting platform for Wikimedia-related services. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Security benefits and trade-offs == </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Unlike password-based authentication, the OAuth 1.0 protocol prevents any [[w:Man-in-the-middle attack|man-in-the-middle attack]] even if the wiki does not require HTTPS: all interactions between MediaWiki and the application are signed with either a shared secret (using HMAC-SHA1), or a [[w:Public-key cryptography|public key]] (RSA).</span> <span lang="en" dir="ltr" class="mw-content-ltr">HTTPS is still required for certain steps though (for obtaining the shared secret in the second step of authorisation when not using RSA, and during app registration).</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 2.0 does not involve signing and relies on HTTPS for security.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Actions via OAuth happen under the user's name but will be [[Special:MyLanguage/Manual:Tags|tagged]] with the application's name as well so rogue applications can be identified.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Wiki admins can revoke the application's permissions (and thus bar it from any further action) if needed.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The user can revoke the permission of the application to use that specific user account if they don't like how it works or don't trust it anymore.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Unlike a password change, this is not disruptive for the user.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Sufficiently flexible applications might allow users to circumvent IP blocks (since MediaWiki will see the IP of the application server, not that of the user).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This can be handled the same way proxies are, by trusting XFF headers set by the application (see [[Phab:T159889|T159889]] for some limitations).</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The application secret must be kept secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Submitting it to source control or putting it into user-accessible code (such as mobile app or desktop application; even if it is obfuscated) undermines the security model and will result in admins forcefully disabling the application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Exceptions are made for example applications demoing OAuth usage, if they are explicitly labeled as such and request limited rights.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Libraries == </div> === PHP === * [[oauthclient-php]] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a client library maintained by Wikimedia</span> * [https://php.net/book.oauth OAuth] – <span lang="en" dir="ltr" class="mw-content-ltr">PECL client library</span> * [https://github.com/firebase/php-jwt firebase/php-jwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a popular JWT library</span> * [https://sr.ht/~taavi/laravel-socialite-mediawiki/ laravel-socialite-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki driver for [[w:Laravel|Laravel]]'s [https://laravel.com/docs/7.x/socialite Socialite] library.</span> === Python === * [https://github.com/valhallasw/flask-mwoauth flask-mwoauth] – <span lang="en" dir="ltr" class="mw-content-ltr">a Flask blueprint to run OAuth against MediaWiki's Extension:OAuth (See tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Flask_OAuth_tool My first Flask OAuth tool])</span> * [https://github.com/wikimedia/MediaWiki-OAuth MediaWiki-OAuth (mwoauth)] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a on top of [http://requests-oauthlib.readthedocs.org/en/latest/oauth1_workflow.html requests-oauthlib]</span> * [https://github.com/python-social-auth/social-core python-social-auth] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework that includes a [https://github.com/python-social-auth/social-core/blob/master/social_core/backends/mediawiki.py MediaWiki backend] (Example tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Django_OAuth_tool My first Django OAuth tool])</span> * [https://docs.authlib.org/en/latest/index.html authlib] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework to interact with Wikimedia OAuth 2.0 API (Full minimal Django OAuth 2.0 [https://code.basabuuka.org/alpcentaur/wmde_oauth_django_example example])</span> * [https://github.com/jpadilla/pyjwt pyjwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a JWT library</span> === Ruby === * [https://github.com/timwaters/omniauth-mediawiki omniauth-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">a MediaWiki strategy for OmniAuth (also available as a [https://rubygems.org/gems/omniauth-mediawiki gem])</span> === Rust === * [https://crates.io/crates/mediawiki MediaWiki crate] <span lang="en" dir="ltr" class="mw-content-ltr">implements both OAuth1 and OAuth2 login mechanisms.</span> * [https://crates.io/crates/oauth2 oauth2 crate] === Node.js === * [https://www.npmjs.com/package/passport-mediawiki-oauth passport-mediawiki-oauth] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki strategy for the Passport auth framework (which can be used effortlessly as a middleware with Express JS and similar frameworks)</span> * [https://www.npmjs.com/package/oauth-fetch-json oauth-fetch-json] – <span lang="en" dir="ltr" class="mw-content-ltr">library for signing OAuth requests</span> * [https://www.npmjs.com/package/m3api-oauth2 m3api-oauth2] – an extension package for [https://www.npmjs.com/package/m3api m3api], making it easy to make requests authenticated via [[Special:MyLanguage/Help:OAuth|OAuth 2.0]] === Go === * [https://github.com/mrjones/oauth mrjones/oauth] (OAuth 1.0) * [https://pkg.go.dev/golang.org/x/oauth2 golang.org/x/oauth2] <span lang="en" dir="ltr" class="mw-content-ltr">(OAuth 2.0, [https://pkg.go.dev/golang.org/x/oauth2#example-Config example])</span> === Java === * [https://github.com/scribejava/scribejava ScribeJava] <span lang="en" dir="ltr" class="mw-content-ltr">since version 5.5.0 ([https://github.com/scribejava/scribejava/pull/852 pull request])</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Example code == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === PHP client without using any libraries === </div> [[toollabs:oauth-hello-world|OAuth Hello World]] – <span lang="en" dir="ltr" class="mw-content-ltr">easy to understand demo application written in PHP without any libraries.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === PHP command-line client with RSA keys, using oauthclient-php === </div> <span lang="en" dir="ltr" class="mw-content-ltr">PHP application using classes from the OAuth extension codebase.</span> {{Todo|1=<span lang="en" dir="ltr" class="mw-content-ltr">convert this to actually use oauthclient-php! Probably just a bunch of <code>use</code> declarations.</span>}} <span lang="en" dir="ltr" class="mw-content-ltr">Before Starting:</span> <syntaxhighlight lang="shell-session"> $ openssl genrsa -out appkey.pem 4096 $ openssl rsa -in appkey.pem -pubout > appkey.pub </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">PHP source code</span>}} <syntaxhighlight lang="php"> <?php if ( PHP_SAPI !== 'cli' ) { die( "CLI-only test script\n" ); } /** * A basic client for overall testing */ function wfDebugLog( $method, $msg) { //echo "[$method] $msg\n"; } require 'OAuth.php'; require 'MWOAuthSignatureMethod.php'; $consumerKey = ''; #$consumerSecret = ''; // We don't need this, since we're using RSA, except to validate the /identify call $privateKey = file_get_contents( 'appkey.pem' ); $baseurl = 'http://<wiki>/wiki/Special:OAuth'; $endpoint_req = $baseurl . '/initiate?format=json&oauth_callback=oob'; // format=json makes php a little easier $endpoint_acc = $baseurl . '/token?format=json'; $endpoint_id = $baseurl . '/identify'; $c = new OAuthConsumer( $consumerKey, $privateKey ); // Make sure we sign title and format $parsed = parse_url( $endpoint_req ); $extraSignedParams = array(); parse_str($parsed['query'], $extraSignedParams); $extraSignedParams['title'] = 'Special:OAuth/initiate'; $init_req = OAuthRequest::from_consumer_and_token( $c, // OAuthConsumer for your app NULL, // User token, NULL for calls to initiate "GET", // http method $endpoint_req, // endpoint url (this is signed) $extraSignedParams // extra parameters we want to sign (must include title) ); $rsa_method = new MWOAuthSignatureMethod_RSA_SHA1( new OAuthDataStore(), $privateKey ); $init_req->sign_request( $rsa_method, // OAuthSignatureMethod $c, // OAuthConsumer for your app NULL // User token, NULL for calls to initiate ); echo "Getting request token with: $init_req\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, (string) $init_req ); // Pass OAuth in GET params curl_setopt( $ch, CURLOPT_HTTPGET, true ); curl_setopt( $ch, CURLOPT_HEADER, false ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $requestToken = json_decode( $data ); print "Visit $baseurl/authorize?oauth_token={$requestToken->key}&oauth_consumer_key=$consumerKey\n"; // ACCESS TOKEN print "Enter the verification code:\n"; $fh = fopen( "php://stdin", "r" ); $line = fgets( $fh ); $rc = new OAuthToken( $requestToken->key, $requestToken->secret ); $parsed = parse_url( $endpoint_acc ); parse_str($parsed['query'], $params); $params['oauth_verifier'] = trim($line); $params['title'] = 'Special:OAuth/token'; $acc_req = OAuthRequest::from_consumer_and_token( $c, $rc, "GET", $endpoint_acc, $params ); $acc_req->sign_request($rsa_method, $c, $rc); echo "Calling: $acc_req\n"; unset( $ch ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_acc ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $acc_req->to_header() ) ); // Set the Authorization Header $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $acc = json_decode( $data ); $accessToken = new OAuthToken( $acc->key, $acc->secret ); /** * Insecurely call the api for information about the user. * A MITM can forge a response from the server, so don't rely on this for identity! */ $apiurl = 'http://<wiki>/w/api.php'; $apiParams = array( 'action' => 'query', 'meta' => 'userinfo', 'uiprop' => 'rights', 'format' => 'json', ); $api_req = OAuthRequest::from_consumer_and_token( $c, // Consumer $accessToken, // User Access Token "GET", // HTTP Method $apiurl, // Endpoint url $apiParams // Extra signed parameters ); $api_req->sign_request( $rsa_method, $c, $accessToken ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $apiurl . "?" . http_build_query( $apiParams ) ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $api_req->to_header() ) ); // Authorization header required for api $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; /** * Securely get the identity of the user */ $consumerSecret = ''; $extraSignedParams = array( 'title' => 'Special:OAuth/identify' ); $req = OAuthRequest::from_consumer_and_token( $c, $accessToken, "GET", $endpoint_id, $extraSignedParams ); $req->sign_request( $rsa_method, $c, $accessToken ); echo "Calling: '$endpoint_id'\nHeader: {$req->to_header()}\n\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_id ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $req->to_header() ) ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } $identity = JWT::decode( $data, $consumerSecret ); // Validate the JWT if ( !validateJWT( $identity, $consumerKey, $req->get_parameter( 'oauth_nonce' ) ) ) { print "The JWT did not validate"; } else { print "We got a valid JWT, describing the user as:\n"; print " * Username: {$identity->username}\n"; print " * User's current groups: " . implode( ',', $identity->groups ) . "\n"; print " * User's current rights: " . implode( ',', $identity->rights ) . "\n"; } /** * Validate a JWT, to ensure this isn't a reply, spoof, etc. * @param $identity the decoded JWT * @param $consumerKey your App's Key * @param $nonce the nonce sent with your request, which should be returned */ function validateJWT( $identity, $consumerKey, $nonce ) { $expectedConnonicalServer = 'http://<wiki>'; // Verify the issuer is who we expect (server sends $wgCanonicalServer) if ( $identity->iss !== $expectedConnonicalServer ) { print "Invalid Issuer"; return false; } // Verify we are the intended audience if ( $identity->aud !== $consumerKey ) { print "Invalid Audience"; return false; } // Verify we are within the time limits of the token. // Issued at (iat) should be in the past, // Expiration (exp) should be in the future. $now = time(); if ( $identity->iat > $now || $identity->exp < $now ) { print "Invalid Time"; return false; } // Verify we haven't seen this nonce before, which would indicate a replay attack if ( $identity->nonce !== $nonce ) { print "Invalid Nonce"; return false; } return true; } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Python command-line client using mwoauth === </div> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Python source code</span>}} <syntaxhighlight lang="python"> from mwoauth import ConsumerToken, Handshaker import requests from requests_oauthlib import OAuth1 from six.moves import input # For compatibility between python 2 and 3 # Consruct a "consumer" from the key/secret provided by MediaWiki import config # You'll need to provide this # Create a file called config.py somewhere where it will be found by python, e.g. in the same directory as this script, with the following content (not including the # characters!) # consumer_key = "the consumer token you got when you registered your applicaton" # consumer_secret = "the secret token you got when you registered your application" # For example: # consumer_key = "20bc67da5081a30c736340c493f60d14" # consumer_secret = "af4313371bb2fb38e81fe7d300080085f52849f9" consumer_token = ConsumerToken(config.consumer_key, config.consumer_secret) # Construct handshaker with wiki URI and consumer handshaker = Handshaker("https://en.wikipedia.org/w/index.php", consumer_token) # Step 1: Initialise -- ask MediaWiki for a temporary key/secret for user redirect, request_token = handshaker.initiate() # Step 2: Authorise -- send user to MediaWiki to confirm authorisation print("Point your browser to: %s" % redirect) # response_qs = input("Response query string: ") # Step 3: Complete -- obtain authorised key/secret for "resource owner" access_token = handshaker.complete(request_token, response_qs) # Construct an auth object with the consumer and access tokens auth1 = OAuth1(consumer_token.key, client_secret=consumer_token.secret, resource_owner_key=access_token.key, resource_owner_secret=access_token.secret) # Now, accessing the API on behalf of a user print("Reading top 10 watchlist items") response = requests.get( "https://en.wikipedia.org/w/api.php", params={ 'action': "query", 'list': "watchlist", 'wllimit': 10, 'wlprop': "title|comment", 'format': "json" }, auth=auth1 ) for item in response.json()['query']['watchlist']: print("{title}\t{comment}".format(**item)) </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Python Toolforge tutorial using mwoauth === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> See: </div> [[wikitech:Help:Toolforge/My first Flask OAuth tool]] === Python Toolforge tutorial using authlib (OAuth 2.0) === {{Collapse_top|title=Python source code}} <syntaxhighlight lang="python"> # > requirements.txt # flask==3.1.3 # requests==2.33.1 # authlib==1.7.0 # > config.py OAUTH_ACCESS_TOKEN_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/access_token" OAUTH_API_BASE_URL = "https://commons.wikimedia.org/w/" OAUTH_AUTHORIZE_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/authorize" OAUTH_CODE_CHALLENGE_METHOD = "S256" OAUTH_CONSUMER_KEY = "Y" OAUTH_CONSUMER_SECRET = "Z" OAUTH_SCOPE = "basic editpage" # > app.py from authlib.integrations.flask_client import FlaskOAuth2App, OAuth from flask import Flask, jsonify, redirect, request, session from requests import Response app = Flask() app.config.from_pyfile("config.py") oauth = OAuth(app) oauth.register( name="mediawiki", client_id=app.config["OAUTH_CONSUMER_KEY"], client_secret=app.config["OAUTH_CONSUMER_SECRET"], client_kwargs={ "code_challenge_method": app.config["OAUTH_CODE_CHALLENGE_METHOD"], "scope": app.config["OAUTH_SCOPE"], }, api_base_url=app.config["OAUTH_API_BASE_URL"], access_token_url=app.config["OAUTH_ACCESS_TOKEN_URL"], authorize_url=app.config["OAUTH_AUTHORIZE_URL"], ) oauth_client: FlaskOAuth2App = oauth.create_client("mediawiki") @app.route("/") def index(): return app.send_static_file("index.html") @app.route("/login") def login(): return oauth_client.authorize_redirect() @app.route("/oauth-callback") def auth(): token = oauth_client.authorize_access_token() session["token"] = token return redirect("/") @app.route("/logout") def logout(): session.pop("token", None) session.clear() return redirect("/") @app.route("/user") def user(): response: Response = oauth_client.request( "GET", "rest.php/oauth2/resource/profile", token=session["token"], ) user = response.json() response.raise_for_status() return jsonify(user=user) @app.route("/edit", methods=["POST"]) def edit(): data = request.get_json() pageid = int(data["pageid"]) response: Response = oauth_client.request( "POST", "api.php", token=session["token"], data=dict( format="json", formatversion="2", action="query", pageids=str(pageid), prop="revisions|wbentityusage", rvprop="content", rvslots="*", meta="tokens", ), ) r = response.json() token = r["query"]["tokens"]["csrftoken"] ... </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Go command-line client using mrjones/auth (OAuth 1.0) === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Before you begin: </div> <syntaxhighlight lang="shell-session"> $ go get github.com/mrjones/oauth </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Go source code</span>}} <syntaxhighlight lang="go"> package main import ( "fmt" "os" "github.com/mrjones/oauth" "io/ioutil" "strconv" ) func main() { var consumerKey string = "" var consumerSecret string = "" if len(consumerKey) == 0 || len(consumerSecret) == 0 { os.Exit(1) } c := oauth.NewConsumer( consumerKey, consumerSecret, oauth.ServiceProvider{ RequestTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/initiate", AuthorizeTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/authorize", AccessTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/token", }) c.Debug(true) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/initiate", } c.AdditionalAuthorizationUrlParams = map[string]string{ "oauth_consumer_key": consumerKey, } requestToken, url, err := c.GetRequestTokenAndUrl("oob") if err != nil { fmt.Println( err ) } fmt.Println( "Got token " + requestToken.Token ) fmt.Println("(1) Go to: " + url) fmt.Println("(2) Grant access, you should get back a verification code.") fmt.Println("(3) Enter that verification code here: ") verificationCode := "" fmt.Scanln(&verificationCode) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/token", } accessToken, err := c.AuthorizeToken(requestToken, verificationCode) if err != nil { fmt.Println(err) } fmt.Println( "Got access token " + accessToken.Token ) c.AdditionalParams = map[string]string{} response, err := c.Get( "http://<wiki>/wiki/api.php", map[string]string{ "action": "query", "meta": "userinfo", "uiprop": "rights", "format": "json", }, accessToken) if err != nil { fmt.Println(err) } fmt.Println( "\tResponse Status: '" + response.Status + "'\n" ) fmt.Println( "\tResponse Code: " + strconv.Itoa(response.StatusCode) + "\n" ) bytes, _ := ioutil.ReadAll(response.Body) fmt.Println( "\tResponse Body: " + string(bytes) + "\n" ) } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === JavaScript applications using OAuth 2 === </div> * [https://github.com/wikimedia/apiclient-wiki wikimedia/apiclient-wiki] – <span lang="en" dir="ltr" class="mw-content-ltr">entire application in 520 lines of code</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Full applications using OAuth === </div> * [https://github.com/jdlrobson/weekipedia/blob/master/libs/server/app.js Weekipedia], <span lang="en" dir="ltr" class="mw-content-ltr">A full scale React.js port of the Wikipedia mobile site uses both.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">many [https://toolhub.wikimedia.org/search?keywords__term=oauth Toolforge tools]</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==Notes== </div> <references /> tmnorydzm7kj7kgcm1qwumu7rz3mjf4 Template:Update/id 10 1141071 8364324 8364245 2026-05-03T12:47:04Z FuzzyBot 451990 Updating to match new version of source page 8364324 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |'''Akurasi fakta''' di bagian dari halaman ini (yang berkaitan dengan {{{part|{{{1|}}}}}}) '''mungkin berkurang dikarenakan informasi yang tidak mutakhir'''. |Bagian dari halaman ini (yang berkaitan dengan {{{part|{{{1|}}}}}}) memerlukan '''pemutakhiran informasi'''.}} |{{#if:{{{inaccurate|}}} |'''Akurasi fakta''' dari halaman ini '''mungkin berkurang dikarenakan informasi yang tidak mutakhir'''. |Halaman ini memerlukan '''pemutakhiran informasi'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|Ini ditulis untuk versi lama dari MediaWiki dan mungkin tidak berlaku pada versi yang terkini.}} Jika Anda memeriksa atau memperbarui halaman ini dan merasa isinya cocok, tolong cabut himbauan ini. {{#ifexist: {{TALKPAGENAME}} |&#32;Lihat [[{{TALKPAGENAME}}|halaman pembicaraan]] untuk mencari diskusi mengenai ini. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Pembaruan terakhir: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= Alias dari templat ini: * {{tlx|outdated}} <span id="Examples"></span> == Contoh == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == Lihat pula == * {{tl|historical}} <span id="TemplateData"></span> === DataTemplat === {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> c7jq7tnrt5zvydd9visvn7ijnq94cl9 OAuth/For Developers/pl 0 1147604 8364293 8350298 2026-05-03T12:27:51Z FuzzyBot 451990 Updating to match new version of source page 8364293 wikitext text/x-wiki <languages /> <div lang="en" dir="ltr" class="mw-content-ltr"> This page explains how to develop applications that can integrate with a wiki running {{ll|Extension:OAuth}} (an extension which turns MediaWiki into an [[w:OAuth|OAuth]] server) to securely request permission to act on the user's behalf. </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you are developing a bot or similar application that always uses the same account, you might prefer the simpler [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]].</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> == OAuth in a nutshell == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> OAuth allows an application to request permission from a user to act through that user's wiki account, without knowing the user's password, and without being able to do everything the user could (e.g. the app might be able to edit articles but not delete them, so even users with extended permissions can safely use OAuth-enabled tools). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This happens via the [https://oauth.net/2/ OAuth 2.0] or [https://oauth.net/core/1.0a/ OAuth 1.0a] protocol, and consists of three stages: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">The developer must register the application (often called "consumer" in the OAuth terminology) on the wiki, possibly go through some sort of review process, and will receive some credentials.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">When a user wants to use it, the application must initiate an authorisation process.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will involve sending the user to a special page on the wiki, which will display an authorisation dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the user accepts, the application will receive another set of credentials (which are specific to that user, and can be revoked by the user at any time).</span> # <span lang="en" dir="ltr" class="mw-content-ltr">When the application actually needs to make an action (API request) on the user's behalf, it can combine the credentials received in steps 1 and 2 to sign the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth is a widely used open standard (you can see it on sites like Google or Facebook or GitHub, e.g. when using accounts at those sites to log in elsewhere).</span> {{info|1=<span lang="en" dir="ltr" class="mw-content-ltr">OAuth should not be confused with:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Initiative for Open Authentication|OATH]] (a second-factor authentication protocol family, commonly known as "type the six numbers you see on your mobile app", now enabled on Wikimedia sites)</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:OpenID Connect|OpenID Connect]] (an authentication protocol based on OAuth 2.0, which the OAuth MediaWiki extension partially supports).</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> For a slightly larger nutshell on OAuth 1.0a, see [https://docs.google.com/presentation/d/1537HnwSaSzH-b8hINcz48SNhT8ElAUPC39to0_O1iNA/edit#slide=id.g15105b408d_0_287 these slides]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == OAuth in detail == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The registration is basically the same for OAuth 1.0a and OAuth 2, with the difference being only the presence of a few form fields. The remaining parts differ significantly depending on the OAuth version.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Generally, OAuth 2 is recommended if available in your environment.</span> <span id="Registration"></span> === Rejestracja === <span lang="en" dir="ltr" class="mw-content-ltr">To register a new OAuth application, submit the form at <code>[[m:Special:OAuthConsumerRegistration/propose|Special:OAuthConsumerRegistration/propose]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Try to give sufficient information about the application for admins and users to decide whether it can be trusted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">URLs to places with more information (such as the application itself, the source code or on-wiki documentation) can be useful.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For OAuth applications to be used on Wikimedia projects, see [[meta:Special:MyLanguage/OAuth app guidelines|app guidelines]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Besides the descriptive ones, the fields have the following meaning:</span> * <code>This consumer is for use only by {{tag|user|open|plain=1}}</code>: <span lang="en" dir="ltr" class="mw-content-ltr">whether you use [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]] (which do not need to be reviewed or authorised but are only usable by yourself).</span> * <code>callback URL</code> (<span lang="en" dir="ltr" class="mw-content-ltr">irrelevant to owner-only consumers</span>): <span lang="en" dir="ltr" class="mw-content-ltr">the URL where the user returns after authorisation is checked against this.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(This is an extra layer of security against an attacker trying to steal credentials during authorisation.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>use as prefix</code> option is enabled, the URL must start with this (the check is dumb so make sure to add at least a <code>/</code> after the domain name), otherwise it must be an exact match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you are developing/testing your local machine, specify [[w:Localhost|Localhost]] in this field (e.g. <code><nowiki>http://localhost:8080/</nowiki></code>).</span> * <code>Applicable project</code> (<span lang="en" dir="ltr" class="mw-content-ltr">for wiki farms only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">project(s) on which to use your application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can limit the application to a single wiki or have it work everywhere.</span> * <code>Types of grants</code> / <code>Applicable grants</code>: <span lang="en" dir="ltr" class="mw-content-ltr">the permissions needed by your application (be conservative). The actual permissions will be an intersection of this and what permissions the user has.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Currently, the user must authorise grouped permissions, not individual ones ([[Phab:T59505|T59505]]).</span> * <code>Allowed IP ranges</code>: <span lang="en" dir="ltr" class="mw-content-ltr">an optional specification of the IP ranges that you use, where OAuth requests not matching this will be rejected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is an extra layer of security against an attacker stealing your application's credentials and trying to impersonate it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> * <code>Public RSA key</code> (<span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">public key used by your application for signing requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can just leave this empty (most applications do) to use a slightly simpler shared-secret mechanism instead.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> <span lang="en" dir="ltr" class="mw-content-ltr">After registration, you'll receive the credentials needed to use OAuth.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to use it immediately with your own user account (this is meant for testing); others will only be able to use it once it is approved by an administrator.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The list of applications (approved or otherwise) is public and can be browsed at <code>[[m:Special:OAuthListConsumers|Special:OAuthListConsumers]]</code>. </div> === OAuth 1.0a === <span id="Authorisation"></span> ==== Autoryzacja ==== [[File:OAuth authorization interface.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Authorisation dialog shown to users</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> When registering the application, you receive two pieces of credentials: the application token (a public ID for the application) and the application secret (sort of like a password). </div> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another set of credentials (these ones specific to that user): the access token and access secret.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">With an RSA key the credentials are slightly different.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is assumed that people choosing to use an RSA key know what they are doing, so this tutorial will assume you have chosen the non-RSA option.</span> </ref> <span lang="en" dir="ltr" class="mw-content-ltr">To get them, you need to go through the authorisation process, which consists of three steps:</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|OAuth/Owner-only consumers|owner-only consumers}} for that.</span> </ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Get a request token from the wiki by sending a GET request to <code>Special:OAuth/initiate</code>, signed with the application key and secret, with the callback URL (where the user will be sent after a successful authorisation) passed as the <code>oauth_callback</code> query parameter (if you have set a constant URL at registration, the value of the parameter ''must'' be <code>oob</code>).</span><ref name="non-nice-url"><span lang="en" dir="ltr" class="mw-content-ltr">Due to [[phab:T59500]] you must currently use a non-nice URL such as <code>en.wikipedia.org/w/index.php?title=Special:OAuth/initiate</code>.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">If you are successful, the response will be a JSON object with <code>token</code> and <code>key</code> fields—the request token and request secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If not, it will have an <code>error</code> field.)</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>Special:OAuth/authorize</code>, with the application token and request token passed as query parameters (<code>oauth_consumer_key</code> and <code>oauth_token</code>, respectively).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>oauth_verifier</code> will contain the verification code that you can use to exchange the request token and secret for the access token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a request to <code>Special:OAuth/token</code><ref name="non-nice-url" /> which includes the <code>oauth_verifier</code> parameter you just received and is signed with the application token and secret and the request token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token/secret (in the same format as the request token/secret in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token and secret is what you'll need to sign API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The request token and secret is not useful anymore and can be discarded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token will remain valid indefinitely, unless the user revokes it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If you prefer not to store it, you can just repeat the authorisation process at any time though.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Applications which only need minimal privileges (have been registered as ''User identity verification only'') can use <code>/authenticate</code> instead of <code>/authorize</code> in step 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This works the same way, but the user will only see the authorisation dialog if they have not authorised this application before; otherwise the authorisation will silently succeed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure, so you don't have to implement it manually—each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Making requests on the user's behalf ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to be signed with the application token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth, with one exception (see next section).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications registered as ''User identity verification only'' cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Identifying the user ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a custom protocol (similar to OpenID Connect) for authenticating the user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send a signed OAuth request to <code>Special:OAuth/identify</code>:</span><ref name="non-nice-url" /> <span lang="en" dir="ltr" class="mw-content-ltr">the response will be a [[w:JSON Web Token|JWT]] (JSON Web Token &ndash; a signed JSON object) including the name of the user, their {{ll|Manual:Central ID|central ID}} (under the key <code>sub</code>) and various other information (such as their user groups and whether they are blocked; also the email address if the application was registered with the right grant type).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is more secure than using the API (e.g. the userinfo module) for authentication, which could be subject to [[w:Man-in-the-middle attack|man-in-the-middle attacks]]; always use this if you need to identify a user!</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also, make sure you properly validate the JWT (there are many libraries which can help with that).</span> <span lang="en" dir="ltr" class="mw-content-ltr">You should check each of the following: the issuer (<code>iss</code>) matches the domain name of the wiki, the audience (<code>aud</code>) matches your application key, the issued-at time (<code>iat</code>) is in the past and reasonably close to current time, the expiration time (<code>exp</code>) is in the future, the nonce (<code>nonce</code>) matches the one you sent in the request.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Signing requests ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Steps 1 and 3 of the authorisation process require signing the request; API requests and <code>Special:OAuth/identify</code> must likewise be signed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The signing process is detailed in [https://oauth.net/core/1.0a/#signing_process section 9 of the OAuth spec], but it is cumbersome to implement by hand and [https://oauth.net/1/ many libraries] are available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find code samples and an overview of how to do it by hand in the {{ll|OAuth/Owner-only_consumers|owner-only consumer}} documentation.</span> (<span lang="en" dir="ltr" class="mw-content-ltr">That is for signing with the consumer token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Modify as appropriate to sign with the consumer token/secret and request token/secret (authorisation step 3) or consumer token/secret only (authorisation step 1).</span>) <div lang="en" dir="ltr" class="mw-content-ltr"> === OAuth 2 === </div> <span id="Authorisation"></span> ==== Autoryzacja ==== <span lang="en" dir="ltr" class="mw-content-ltr">When registering the application, you receive two pieces of credentials: the client application key (a public ID for the application, also called the client ID or consumer key) and the client application secret (a confidential password).</span> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another credential (this one specific to that user): the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To get it, you need to go through the [https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/ the OAuth 2 Authorization Code flow], which consists of two steps:</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See [[Special:MyLanguage/OAuth/Owner-only consumers|owner-only consumers]] for that.</span></ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>oauth2/authorize</code> under the wiki's REST endpoint (usually <code>rest.php</code>), with <code>response_type=code</code> and the consumer key (also called the client application key) as the <code>client_id</code>, possibly a <code>state</code> if you want, and optionally the <code>redirect_uri</code> (if yes, it must be the same as in your application request).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If your consumer is non-confidential, you'll also need to include a [https://www.oauth.com/oauth2-servers/pkce/authorization-request/ PKCE code challenge] (<code>code_challenge</code> and <code>code_challenge_method=S256</code>).</span><ref>PKCE &mdash; Proof Key for Code Exchange</ref> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>code</code> will contain the authorisation code that you can use to fetch the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a POST request to <code>oauth2/access_token</code> under the wiki's REST endpoint (usually <code>rest.php</code>), including <code>grant_type=authorization_code</code>, the <code>code</code> parameter you just received, your client authentication (typically as <code>client_id</code> and, for confidential clients, <code>client_secret</code>), the <code>redirect_uri</code> if and only if you specified it in the previous step (must be the same value for both), and if non-confidential the PKCE <code>code_verifier</code> and <code>code_challenge_method</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token and a refresh token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token is what you'll need to send future API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The refresh token can be used to [https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/ fetch a new access token] if the original access token expires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you prefer not to store either token, you can just repeat the authorisation process at any time.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(Before MediaWiki 1.46, non-confidential clients could only use refresh tokens using their client secret keys, not using their client IDs only, see [[phabricator:T323855|T323855]].)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure so you don't have to implement it manually - each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Making requests on the user's behalf ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to include the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the access token is used to fetch a CSRF token or other tokens, the access token must still be passed (as a header) with requests that use those tokens.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications which need minimal privileges (have been registered as ''User identity verification only'') cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> API requests including <code>rest.php/oauth2/resource/profile</code> must be authenticated with an HTTP Authorization header containing the access token, like: </div> <pre> Authorization: Bearer abcde....6789 </pre> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Identifying the user ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a somewhat incomplete implementation of OpenID Connect for authenticating the user.</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">See [[phab:T254063|T254063]] for details.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send an authenticated OAuth GET request to the <code>oauth2/resource/profile</code> API (MediaWiki's implementation of what the OIDC spec calls the UserInfo endpoint) under the wiki's REST endpoint (usually <code>rest.php</code>); the response will include the name of the user and various other information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that the GET request must use the HTTP <code>Authorization</code> header, not a query string token.</span> * '''sub''' <span lang="en" dir="ltr" class="mw-content-ltr">(central user ID)</span> * '''username''' * '''editcount''' * '''confirmed_email''' * '''blocked''' * '''registered''' * '''groups''' * '''rights''' * '''realname''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> * '''email''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Setting up a development environment == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> You can register an OAuth application on [https://meta.wikimedia.beta.wmflabs.org/wiki/Special:OAuthConsumerRegistration/propose beta meta] and test your code against that. </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you want to improve the extension itself, or debug protocol issues in detail, OAuth is available in the {{ll|MediaWiki-Vagrant}} development environment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Add the <code>oauth</code> role, and your local wiki will be able to authorise OAuth apps.</span> <syntaxhighlight lang="shell-session"> $ vagrant roles enable oauth $ vagrant provision </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Once the code is nearly ready, you can register an OAuth application on the real wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to test it with the same user account used for registering, even before it gets reviewed by admins.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If you are creating an application for Wikimedia projects, consider hosting it at [[Wikitech:Portal:Toolforge|Wikimedia Toolforge]], a free tool forge and hosting platform for Wikimedia-related services. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Security benefits and trade-offs == </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Unlike password-based authentication, the OAuth 1.0 protocol prevents any [[w:Man-in-the-middle attack|man-in-the-middle attack]] even if the wiki does not require HTTPS: all interactions between MediaWiki and the application are signed with either a shared secret (using HMAC-SHA1), or a [[w:Public-key cryptography|public key]] (RSA).</span> <span lang="en" dir="ltr" class="mw-content-ltr">HTTPS is still required for certain steps though (for obtaining the shared secret in the second step of authorisation when not using RSA, and during app registration).</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 2.0 does not involve signing and relies on HTTPS for security.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Actions via OAuth happen under the user's name but will be [[Special:MyLanguage/Manual:Tags|tagged]] with the application's name as well so rogue applications can be identified.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Wiki admins can revoke the application's permissions (and thus bar it from any further action) if needed.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The user can revoke the permission of the application to use that specific user account if they don't like how it works or don't trust it anymore.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Unlike a password change, this is not disruptive for the user.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Sufficiently flexible applications might allow users to circumvent IP blocks (since MediaWiki will see the IP of the application server, not that of the user).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This can be handled the same way proxies are, by trusting XFF headers set by the application (see [[Phab:T159889|T159889]] for some limitations).</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The application secret must be kept secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Submitting it to source control or putting it into user-accessible code (such as mobile app or desktop application; even if it is obfuscated) undermines the security model and will result in admins forcefully disabling the application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Exceptions are made for example applications demoing OAuth usage, if they are explicitly labeled as such and request limited rights.</span> <span id="Libraries"></span> == Biblioteki == === PHP === * [[oauthclient-php]] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a client library maintained by Wikimedia</span> * [https://php.net/book.oauth OAuth] – <span lang="en" dir="ltr" class="mw-content-ltr">PECL client library</span> * [https://github.com/firebase/php-jwt firebase/php-jwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a popular JWT library</span> * [https://sr.ht/~taavi/laravel-socialite-mediawiki/ laravel-socialite-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki driver for [[w:Laravel|Laravel]]'s [https://laravel.com/docs/7.x/socialite Socialite] library.</span> === Python === * [https://github.com/valhallasw/flask-mwoauth flask-mwoauth] – <span lang="en" dir="ltr" class="mw-content-ltr">a Flask blueprint to run OAuth against MediaWiki's Extension:OAuth (See tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Flask_OAuth_tool My first Flask OAuth tool])</span> * [https://github.com/wikimedia/MediaWiki-OAuth MediaWiki-OAuth (mwoauth)] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a on top of [http://requests-oauthlib.readthedocs.org/en/latest/oauth1_workflow.html requests-oauthlib]</span> * [https://github.com/python-social-auth/social-core python-social-auth] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework that includes a [https://github.com/python-social-auth/social-core/blob/master/social_core/backends/mediawiki.py MediaWiki backend] (Example tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Django_OAuth_tool My first Django OAuth tool])</span> * [https://docs.authlib.org/en/latest/index.html authlib] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework to interact with Wikimedia OAuth 2.0 API (Full minimal Django OAuth 2.0 [https://code.basabuuka.org/alpcentaur/wmde_oauth_django_example example])</span> * [https://github.com/jpadilla/pyjwt pyjwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a JWT library</span> === Ruby === * [https://github.com/timwaters/omniauth-mediawiki omniauth-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">a MediaWiki strategy for OmniAuth (also available as a [https://rubygems.org/gems/omniauth-mediawiki gem])</span> === Rust === * [https://crates.io/crates/mediawiki MediaWiki crate] <span lang="en" dir="ltr" class="mw-content-ltr">implements both OAuth1 and OAuth2 login mechanisms.</span> * [https://crates.io/crates/oauth2 oauth2 crate] === Node.js === * [https://www.npmjs.com/package/passport-mediawiki-oauth passport-mediawiki-oauth] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki strategy for the Passport auth framework (which can be used effortlessly as a middleware with Express JS and similar frameworks)</span> * [https://www.npmjs.com/package/oauth-fetch-json oauth-fetch-json] – <span lang="en" dir="ltr" class="mw-content-ltr">library for signing OAuth requests</span> * [https://www.npmjs.com/package/m3api-oauth2 m3api-oauth2] – an extension package for [https://www.npmjs.com/package/m3api m3api], making it easy to make requests authenticated via [[Special:MyLanguage/Help:OAuth|OAuth 2.0]] === Go === * [https://github.com/mrjones/oauth mrjones/oauth] (OAuth 1.0) * [https://pkg.go.dev/golang.org/x/oauth2 golang.org/x/oauth2] <span lang="en" dir="ltr" class="mw-content-ltr">(OAuth 2.0, [https://pkg.go.dev/golang.org/x/oauth2#example-Config example])</span> === Java === * [https://github.com/scribejava/scribejava ScribeJava] <span lang="en" dir="ltr" class="mw-content-ltr">since version 5.5.0 ([https://github.com/scribejava/scribejava/pull/852 pull request])</span> <span id="Example_code"></span> == Przykładowy kod == <div lang="en" dir="ltr" class="mw-content-ltr"> === PHP client without using any libraries === </div> [[toollabs:oauth-hello-world|OAuth Hello World]] – <span lang="en" dir="ltr" class="mw-content-ltr">easy to understand demo application written in PHP without any libraries.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === PHP command-line client with RSA keys, using oauthclient-php === </div> <span lang="en" dir="ltr" class="mw-content-ltr">PHP application using classes from the OAuth extension codebase.</span> {{Todo|1=<span lang="en" dir="ltr" class="mw-content-ltr">convert this to actually use oauthclient-php! Probably just a bunch of <code>use</code> declarations.</span>}} <span lang="en" dir="ltr" class="mw-content-ltr">Before Starting:</span> <syntaxhighlight lang="shell-session"> $ openssl genrsa -out appkey.pem 4096 $ openssl rsa -in appkey.pem -pubout > appkey.pub </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">PHP source code</span>}} <syntaxhighlight lang="php"> <?php if ( PHP_SAPI !== 'cli' ) { die( "CLI-only test script\n" ); } /** * A basic client for overall testing */ function wfDebugLog( $method, $msg) { //echo "[$method] $msg\n"; } require 'OAuth.php'; require 'MWOAuthSignatureMethod.php'; $consumerKey = ''; #$consumerSecret = ''; // We don't need this, since we're using RSA, except to validate the /identify call $privateKey = file_get_contents( 'appkey.pem' ); $baseurl = 'http://<wiki>/wiki/Special:OAuth'; $endpoint_req = $baseurl . '/initiate?format=json&oauth_callback=oob'; // format=json makes php a little easier $endpoint_acc = $baseurl . '/token?format=json'; $endpoint_id = $baseurl . '/identify'; $c = new OAuthConsumer( $consumerKey, $privateKey ); // Make sure we sign title and format $parsed = parse_url( $endpoint_req ); $extraSignedParams = array(); parse_str($parsed['query'], $extraSignedParams); $extraSignedParams['title'] = 'Special:OAuth/initiate'; $init_req = OAuthRequest::from_consumer_and_token( $c, // OAuthConsumer for your app NULL, // User token, NULL for calls to initiate "GET", // http method $endpoint_req, // endpoint url (this is signed) $extraSignedParams // extra parameters we want to sign (must include title) ); $rsa_method = new MWOAuthSignatureMethod_RSA_SHA1( new OAuthDataStore(), $privateKey ); $init_req->sign_request( $rsa_method, // OAuthSignatureMethod $c, // OAuthConsumer for your app NULL // User token, NULL for calls to initiate ); echo "Getting request token with: $init_req\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, (string) $init_req ); // Pass OAuth in GET params curl_setopt( $ch, CURLOPT_HTTPGET, true ); curl_setopt( $ch, CURLOPT_HEADER, false ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $requestToken = json_decode( $data ); print "Visit $baseurl/authorize?oauth_token={$requestToken->key}&oauth_consumer_key=$consumerKey\n"; // ACCESS TOKEN print "Enter the verification code:\n"; $fh = fopen( "php://stdin", "r" ); $line = fgets( $fh ); $rc = new OAuthToken( $requestToken->key, $requestToken->secret ); $parsed = parse_url( $endpoint_acc ); parse_str($parsed['query'], $params); $params['oauth_verifier'] = trim($line); $params['title'] = 'Special:OAuth/token'; $acc_req = OAuthRequest::from_consumer_and_token( $c, $rc, "GET", $endpoint_acc, $params ); $acc_req->sign_request($rsa_method, $c, $rc); echo "Calling: $acc_req\n"; unset( $ch ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_acc ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $acc_req->to_header() ) ); // Set the Authorization Header $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $acc = json_decode( $data ); $accessToken = new OAuthToken( $acc->key, $acc->secret ); /** * Insecurely call the api for information about the user. * A MITM can forge a response from the server, so don't rely on this for identity! */ $apiurl = 'http://<wiki>/w/api.php'; $apiParams = array( 'action' => 'query', 'meta' => 'userinfo', 'uiprop' => 'rights', 'format' => 'json', ); $api_req = OAuthRequest::from_consumer_and_token( $c, // Consumer $accessToken, // User Access Token "GET", // HTTP Method $apiurl, // Endpoint url $apiParams // Extra signed parameters ); $api_req->sign_request( $rsa_method, $c, $accessToken ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $apiurl . "?" . http_build_query( $apiParams ) ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $api_req->to_header() ) ); // Authorization header required for api $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; /** * Securely get the identity of the user */ $consumerSecret = ''; $extraSignedParams = array( 'title' => 'Special:OAuth/identify' ); $req = OAuthRequest::from_consumer_and_token( $c, $accessToken, "GET", $endpoint_id, $extraSignedParams ); $req->sign_request( $rsa_method, $c, $accessToken ); echo "Calling: '$endpoint_id'\nHeader: {$req->to_header()}\n\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_id ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $req->to_header() ) ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } $identity = JWT::decode( $data, $consumerSecret ); // Validate the JWT if ( !validateJWT( $identity, $consumerKey, $req->get_parameter( 'oauth_nonce' ) ) ) { print "The JWT did not validate"; } else { print "We got a valid JWT, describing the user as:\n"; print " * Username: {$identity->username}\n"; print " * User's current groups: " . implode( ',', $identity->groups ) . "\n"; print " * User's current rights: " . implode( ',', $identity->rights ) . "\n"; } /** * Validate a JWT, to ensure this isn't a reply, spoof, etc. * @param $identity the decoded JWT * @param $consumerKey your App's Key * @param $nonce the nonce sent with your request, which should be returned */ function validateJWT( $identity, $consumerKey, $nonce ) { $expectedConnonicalServer = 'http://<wiki>'; // Verify the issuer is who we expect (server sends $wgCanonicalServer) if ( $identity->iss !== $expectedConnonicalServer ) { print "Invalid Issuer"; return false; } // Verify we are the intended audience if ( $identity->aud !== $consumerKey ) { print "Invalid Audience"; return false; } // Verify we are within the time limits of the token. // Issued at (iat) should be in the past, // Expiration (exp) should be in the future. $now = time(); if ( $identity->iat > $now || $identity->exp < $now ) { print "Invalid Time"; return false; } // Verify we haven't seen this nonce before, which would indicate a replay attack if ( $identity->nonce !== $nonce ) { print "Invalid Nonce"; return false; } return true; } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Python command-line client using mwoauth === </div> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Python source code</span>}} <syntaxhighlight lang="python"> from mwoauth import ConsumerToken, Handshaker import requests from requests_oauthlib import OAuth1 from six.moves import input # For compatibility between python 2 and 3 # Consruct a "consumer" from the key/secret provided by MediaWiki import config # You'll need to provide this # Create a file called config.py somewhere where it will be found by python, e.g. in the same directory as this script, with the following content (not including the # characters!) # consumer_key = "the consumer token you got when you registered your applicaton" # consumer_secret = "the secret token you got when you registered your application" # For example: # consumer_key = "20bc67da5081a30c736340c493f60d14" # consumer_secret = "af4313371bb2fb38e81fe7d300080085f52849f9" consumer_token = ConsumerToken(config.consumer_key, config.consumer_secret) # Construct handshaker with wiki URI and consumer handshaker = Handshaker("https://en.wikipedia.org/w/index.php", consumer_token) # Step 1: Initialise -- ask MediaWiki for a temporary key/secret for user redirect, request_token = handshaker.initiate() # Step 2: Authorise -- send user to MediaWiki to confirm authorisation print("Point your browser to: %s" % redirect) # response_qs = input("Response query string: ") # Step 3: Complete -- obtain authorised key/secret for "resource owner" access_token = handshaker.complete(request_token, response_qs) # Construct an auth object with the consumer and access tokens auth1 = OAuth1(consumer_token.key, client_secret=consumer_token.secret, resource_owner_key=access_token.key, resource_owner_secret=access_token.secret) # Now, accessing the API on behalf of a user print("Reading top 10 watchlist items") response = requests.get( "https://en.wikipedia.org/w/api.php", params={ 'action': "query", 'list': "watchlist", 'wllimit': 10, 'wlprop': "title|comment", 'format': "json" }, auth=auth1 ) for item in response.json()['query']['watchlist']: print("{title}\t{comment}".format(**item)) </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Python Toolforge tutorial using mwoauth === </div> Zobacz: [[wikitech:Help:Toolforge/My first Flask OAuth tool]] === Python Toolforge tutorial using authlib (OAuth 2.0) === {{Collapse_top|title=Python source code}} <syntaxhighlight lang="python"> # > requirements.txt # flask==3.1.3 # requests==2.33.1 # authlib==1.7.0 # > config.py OAUTH_ACCESS_TOKEN_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/access_token" OAUTH_API_BASE_URL = "https://commons.wikimedia.org/w/" OAUTH_AUTHORIZE_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/authorize" OAUTH_CODE_CHALLENGE_METHOD = "S256" OAUTH_CONSUMER_KEY = "Y" OAUTH_CONSUMER_SECRET = "Z" OAUTH_SCOPE = "basic editpage" # > app.py from authlib.integrations.flask_client import FlaskOAuth2App, OAuth from flask import Flask, jsonify, redirect, request, session from requests import Response app = Flask() app.config.from_pyfile("config.py") oauth = OAuth(app) oauth.register( name="mediawiki", client_id=app.config["OAUTH_CONSUMER_KEY"], client_secret=app.config["OAUTH_CONSUMER_SECRET"], client_kwargs={ "code_challenge_method": app.config["OAUTH_CODE_CHALLENGE_METHOD"], "scope": app.config["OAUTH_SCOPE"], }, api_base_url=app.config["OAUTH_API_BASE_URL"], access_token_url=app.config["OAUTH_ACCESS_TOKEN_URL"], authorize_url=app.config["OAUTH_AUTHORIZE_URL"], ) oauth_client: FlaskOAuth2App = oauth.create_client("mediawiki") @app.route("/") def index(): return app.send_static_file("index.html") @app.route("/login") def login(): return oauth_client.authorize_redirect() @app.route("/oauth-callback") def auth(): token = oauth_client.authorize_access_token() session["token"] = token return redirect("/") @app.route("/logout") def logout(): session.pop("token", None) session.clear() return redirect("/") @app.route("/user") def user(): response: Response = oauth_client.request( "GET", "rest.php/oauth2/resource/profile", token=session["token"], ) user = response.json() response.raise_for_status() return jsonify(user=user) @app.route("/edit", methods=["POST"]) def edit(): data = request.get_json() pageid = int(data["pageid"]) response: Response = oauth_client.request( "POST", "api.php", token=session["token"], data=dict( format="json", formatversion="2", action="query", pageids=str(pageid), prop="revisions|wbentityusage", rvprop="content", rvslots="*", meta="tokens", ), ) r = response.json() token = r["query"]["tokens"]["csrftoken"] ... </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Go command-line client using mrjones/auth (OAuth 1.0) === </div> Zanim zaczniesz: <syntaxhighlight lang="shell-session"> $ go get github.com/mrjones/oauth </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Go source code</span>}} <syntaxhighlight lang="go"> package main import ( "fmt" "os" "github.com/mrjones/oauth" "io/ioutil" "strconv" ) func main() { var consumerKey string = "" var consumerSecret string = "" if len(consumerKey) == 0 || len(consumerSecret) == 0 { os.Exit(1) } c := oauth.NewConsumer( consumerKey, consumerSecret, oauth.ServiceProvider{ RequestTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/initiate", AuthorizeTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/authorize", AccessTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/token", }) c.Debug(true) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/initiate", } c.AdditionalAuthorizationUrlParams = map[string]string{ "oauth_consumer_key": consumerKey, } requestToken, url, err := c.GetRequestTokenAndUrl("oob") if err != nil { fmt.Println( err ) } fmt.Println( "Got token " + requestToken.Token ) fmt.Println("(1) Go to: " + url) fmt.Println("(2) Grant access, you should get back a verification code.") fmt.Println("(3) Enter that verification code here: ") verificationCode := "" fmt.Scanln(&verificationCode) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/token", } accessToken, err := c.AuthorizeToken(requestToken, verificationCode) if err != nil { fmt.Println(err) } fmt.Println( "Got access token " + accessToken.Token ) c.AdditionalParams = map[string]string{} response, err := c.Get( "http://<wiki>/wiki/api.php", map[string]string{ "action": "query", "meta": "userinfo", "uiprop": "rights", "format": "json", }, accessToken) if err != nil { fmt.Println(err) } fmt.Println( "\tResponse Status: '" + response.Status + "'\n" ) fmt.Println( "\tResponse Code: " + strconv.Itoa(response.StatusCode) + "\n" ) bytes, _ := ioutil.ReadAll(response.Body) fmt.Println( "\tResponse Body: " + string(bytes) + "\n" ) } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === JavaScript applications using OAuth 2 === </div> * [https://github.com/wikimedia/apiclient-wiki wikimedia/apiclient-wiki] – <span lang="en" dir="ltr" class="mw-content-ltr">entire application in 520 lines of code</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Full applications using OAuth === </div> * [https://github.com/jdlrobson/weekipedia/blob/master/libs/server/app.js Weekipedia], <span lang="en" dir="ltr" class="mw-content-ltr">A full scale React.js port of the Wikipedia mobile site uses both.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">many [https://toolhub.wikimedia.org/search?keywords__term=oauth Toolforge tools]</span> <span id="Notes"></span> ==Uwagi== <references /> 8rwuc63zxpwte1ows1lrffu9svp13yl OAuth/For Developers/zh 0 1157502 8364297 8350302 2026-05-03T12:27:55Z FuzzyBot 451990 Updating to match new version of source page 8364297 wikitext text/x-wiki <languages /> 此页说明如何开发可与安装了 {{ll|Extension:OAuth}} 的MediaWiki(一个使MediaWiki拥有 [[w:OAuth|OAuth]] 服务器功能的扩展插件)交互的应用程序,以安全地向用户请求代替其操作的权限。 {{Note|1=如果您在開發一隻機器人或一個只使用一個帳號的小型應用程式,你可能會偏好更簡單的[[Special:MyLanguage/OAuth/Owner-only_consumers|僅限擁有者客戶端]]。}} <span id="OAuth_in_a_nutshell"></span> == OAuth简述 == OAuth 允许应用程序向用户请求许可。在不记录用户密码的同时,通过用户的权限进行操作,缺不能随意使用该用户的任意权限(如应用程序可以编辑文章, 却不可以删除它们。这样, 高权限的用户可以放心地使用带有OAuth功能的工具) 上述情况可以通过 [https://oauth.net/2/ OAuth 2.0] 或 [https://oauth.net/core/1.0a/ OAuth 1.0a] 协议授权, 而它由三个階段組成: # <span class="mw-translate-fuzzy"># 开发者必须先在Wiki上注册应用程序(在OAuth术语中常被称为"消费者"), 可能会经过一些审核流程, 随后收到一些凭证。</span> # <span class="mw-translate-fuzzy"># 当用户想要使用它时, 应用程序必须经过授权流程。</span> 这将引导用户至Wiki上的特殊页面,该页面将显示授权对话框。 如果用户同意授权,则应用程序将收到另一组凭据(仅属于该用户,并且可以随时被用户吊销)。 # <span class="mw-translate-fuzzy"># 当应用程序需要代替用户执行操作(通过API请求)时, 它可以使用步骤1和2中收到的凭证对请求进行签名。</span> OAuth是一种广泛使用的开放标准(你可以在Google, Facebook或Github等网站上看到它, 例如使用这些网站的账号登录其他站点时) {{info|1=OAuth不該和以下幾項混淆: * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Initiative for Open Authentication|OATH]] (a second-factor authentication protocol family, commonly known as "type the six numbers you see on your mobile app", now enabled on Wikimedia sites)</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:OpenID Connect|OpenID Connect]] (an authentication protocol based on OAuth 2.0, which the OAuth MediaWiki extension partially supports).</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> For a slightly larger nutshell on OAuth 1.0a, see [https://docs.google.com/presentation/d/1537HnwSaSzH-b8hINcz48SNhT8ElAUPC39to0_O1iNA/edit#slide=id.g15105b408d_0_287 these slides]. </div> <span id="OAuth_in_detail"></span> == OAuth详情 == 在注册时, OAuth 1.0a和OAuth 2的流程基本相同,仅有一些表单项有差异。其余部分视OAuth版本而有很大不同。 <span lang="en" dir="ltr" class="mw-content-ltr">Generally, OAuth 2 is recommended if available in your environment.</span> <span id="Registration"></span> === 注册 === <span lang="en" dir="ltr" class="mw-content-ltr">To register a new OAuth application, submit the form at <code>[[m:Special:OAuthConsumerRegistration/propose|Special:OAuthConsumerRegistration/propose]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Try to give sufficient information about the application for admins and users to decide whether it can be trusted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">URLs to places with more information (such as the application itself, the source code or on-wiki documentation) can be useful.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For OAuth applications to be used on Wikimedia projects, see [[meta:Special:MyLanguage/OAuth app guidelines|app guidelines]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Besides the descriptive ones, the fields have the following meaning:</span> * <code>This consumer is for use only by {{tag|user|open|plain=1}}</code>: <span lang="en" dir="ltr" class="mw-content-ltr">whether you use [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]] (which do not need to be reviewed or authorised but are only usable by yourself).</span> * <code>callback URL</code> (<span lang="en" dir="ltr" class="mw-content-ltr">irrelevant to owner-only consumers</span>): <span lang="en" dir="ltr" class="mw-content-ltr">the URL where the user returns after authorisation is checked against this.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(This is an extra layer of security against an attacker trying to steal credentials during authorisation.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>use as prefix</code> option is enabled, the URL must start with this (the check is dumb so make sure to add at least a <code>/</code> after the domain name), otherwise it must be an exact match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you are developing/testing your local machine, specify [[w:Localhost|Localhost]] in this field (e.g. <code><nowiki>http://localhost:8080/</nowiki></code>).</span> * <code>Applicable project</code> (<span lang="en" dir="ltr" class="mw-content-ltr">for wiki farms only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">project(s) on which to use your application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can limit the application to a single wiki or have it work everywhere.</span> * <code>Types of grants</code> / <code>Applicable grants</code>: <span lang="en" dir="ltr" class="mw-content-ltr">the permissions needed by your application (be conservative). The actual permissions will be an intersection of this and what permissions the user has.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Currently, the user must authorise grouped permissions, not individual ones ([[Phab:T59505|T59505]]).</span> * <code>Allowed IP ranges</code>: <span lang="en" dir="ltr" class="mw-content-ltr">an optional specification of the IP ranges that you use, where OAuth requests not matching this will be rejected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is an extra layer of security against an attacker stealing your application's credentials and trying to impersonate it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> * <code>Public RSA key</code> (<span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">public key used by your application for signing requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can just leave this empty (most applications do) to use a slightly simpler shared-secret mechanism instead.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> <span lang="en" dir="ltr" class="mw-content-ltr">After registration, you'll receive the credentials needed to use OAuth.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to use it immediately with your own user account (this is meant for testing); others will only be able to use it once it is approved by an administrator.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The list of applications (approved or otherwise) is public and can be browsed at <code>[[m:Special:OAuthListConsumers|Special:OAuthListConsumers]]</code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === OAuth 1.0a === </div> <span id="Authorisation"></span> ==== {{LC zh|lang = {{{lang|}}}|type = H|zh-hans = 授权|zh-hant = 授權}} ==== [[File:OAuth authorization interface.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Authorisation dialog shown to users</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> When registering the application, you receive two pieces of credentials: the application token (a public ID for the application) and the application secret (sort of like a password). </div> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another set of credentials (these ones specific to that user): the access token and access secret.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">With an RSA key the credentials are slightly different.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is assumed that people choosing to use an RSA key know what they are doing, so this tutorial will assume you have chosen the non-RSA option.</span> </ref> <span lang="en" dir="ltr" class="mw-content-ltr">To get them, you need to go through the authorisation process, which consists of three steps:</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|OAuth/Owner-only consumers|owner-only consumers}} for that.</span> </ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Get a request token from the wiki by sending a GET request to <code>Special:OAuth/initiate</code>, signed with the application key and secret, with the callback URL (where the user will be sent after a successful authorisation) passed as the <code>oauth_callback</code> query parameter (if you have set a constant URL at registration, the value of the parameter ''must'' be <code>oob</code>).</span><ref name="non-nice-url"><span lang="en" dir="ltr" class="mw-content-ltr">Due to [[phab:T59500]] you must currently use a non-nice URL such as <code>en.wikipedia.org/w/index.php?title=Special:OAuth/initiate</code>.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">If you are successful, the response will be a JSON object with <code>token</code> and <code>key</code> fields—the request token and request secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If not, it will have an <code>error</code> field.)</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>Special:OAuth/authorize</code>, with the application token and request token passed as query parameters (<code>oauth_consumer_key</code> and <code>oauth_token</code>, respectively).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>oauth_verifier</code> will contain the verification code that you can use to exchange the request token and secret for the access token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a request to <code>Special:OAuth/token</code><ref name="non-nice-url" /> which includes the <code>oauth_verifier</code> parameter you just received and is signed with the application token and secret and the request token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token/secret (in the same format as the request token/secret in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token and secret is what you'll need to sign API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The request token and secret is not useful anymore and can be discarded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token will remain valid indefinitely, unless the user revokes it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If you prefer not to store it, you can just repeat the authorisation process at any time though.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Applications which only need minimal privileges (have been registered as ''User identity verification only'') can use <code>/authenticate</code> instead of <code>/authorize</code> in step 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This works the same way, but the user will only see the authorisation dialog if they have not authorised this application before; otherwise the authorisation will silently succeed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure, so you don't have to implement it manually—each step will be a single function call.</span> 参阅下面的示例。 <span id="Making_requests_on_the_user&#039;s_behalf"></span> ==== 作为用户身份执行请求 ==== <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to be signed with the application token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth, with one exception (see next section).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications registered as ''User identity verification only'' cannot use the API at all. </div> <span id="Identifying_the_user"></span> ==== 鉴别用户 ==== <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a custom protocol (similar to OpenID Connect) for authenticating the user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send a signed OAuth request to <code>Special:OAuth/identify</code>:</span><ref name="non-nice-url" /> <span lang="en" dir="ltr" class="mw-content-ltr">the response will be a [[w:JSON Web Token|JWT]] (JSON Web Token &ndash; a signed JSON object) including the name of the user, their {{ll|Manual:Central ID|central ID}} (under the key <code>sub</code>) and various other information (such as their user groups and whether they are blocked; also the email address if the application was registered with the right grant type).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is more secure than using the API (e.g. the userinfo module) for authentication, which could be subject to [[w:Man-in-the-middle attack|man-in-the-middle attacks]]; always use this if you need to identify a user!</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also, make sure you properly validate the JWT (there are many libraries which can help with that).</span> <span lang="en" dir="ltr" class="mw-content-ltr">You should check each of the following: the issuer (<code>iss</code>) matches the domain name of the wiki, the audience (<code>aud</code>) matches your application key, the issued-at time (<code>iat</code>) is in the past and reasonably close to current time, the expiration time (<code>exp</code>) is in the future, the nonce (<code>nonce</code>) matches the one you sent in the request.</span> <span id="Signing_requests"></span> ==== 为请求签名 ==== <span lang="en" dir="ltr" class="mw-content-ltr">Steps 1 and 3 of the authorisation process require signing the request; API requests and <code>Special:OAuth/identify</code> must likewise be signed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The signing process is detailed in [https://oauth.net/core/1.0a/#signing_process section 9 of the OAuth spec], but it is cumbersome to implement by hand and [https://oauth.net/1/ many libraries] are available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find code samples and an overview of how to do it by hand in the {{ll|OAuth/Owner-only_consumers|owner-only consumer}} documentation.</span> (<span lang="en" dir="ltr" class="mw-content-ltr">That is for signing with the consumer token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Modify as appropriate to sign with the consumer token/secret and request token/secret (authorisation step 3) or consumer token/secret only (authorisation step 1).</span>) <div lang="en" dir="ltr" class="mw-content-ltr"> === OAuth 2 === </div> <span id="Authorisation"></span> ==== {{LC zh|lang = {{{lang|}}}|type = H|zh-hans = 授权|zh-hant = 授權}} ==== <span lang="en" dir="ltr" class="mw-content-ltr">When registering the application, you receive two pieces of credentials: the client application key (a public ID for the application, also called the client ID or consumer key) and the client application secret (a confidential password).</span> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another credential (this one specific to that user): the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To get it, you need to go through the [https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/ the OAuth 2 Authorization Code flow], which consists of two steps:</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See [[Special:MyLanguage/OAuth/Owner-only consumers|owner-only consumers]] for that.</span></ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>oauth2/authorize</code> under the wiki's REST endpoint (usually <code>rest.php</code>), with <code>response_type=code</code> and the consumer key (also called the client application key) as the <code>client_id</code>, possibly a <code>state</code> if you want, and optionally the <code>redirect_uri</code> (if yes, it must be the same as in your application request).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If your consumer is non-confidential, you'll also need to include a [https://www.oauth.com/oauth2-servers/pkce/authorization-request/ PKCE code challenge] (<code>code_challenge</code> and <code>code_challenge_method=S256</code>).</span><ref>PKCE &mdash; Proof Key for Code Exchange</ref> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>code</code> will contain the authorisation code that you can use to fetch the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a POST request to <code>oauth2/access_token</code> under the wiki's REST endpoint (usually <code>rest.php</code>), including <code>grant_type=authorization_code</code>, the <code>code</code> parameter you just received, your client authentication (typically as <code>client_id</code> and, for confidential clients, <code>client_secret</code>), the <code>redirect_uri</code> if and only if you specified it in the previous step (must be the same value for both), and if non-confidential the PKCE <code>code_verifier</code> and <code>code_challenge_method</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token and a refresh token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token is what you'll need to send future API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The refresh token can be used to [https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/ fetch a new access token] if the original access token expires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you prefer not to store either token, you can just repeat the authorisation process at any time.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(Before MediaWiki 1.46, non-confidential clients could only use refresh tokens using their client secret keys, not using their client IDs only, see [[phabricator:T323855|T323855]].)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure so you don't have to implement it manually - each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <span id="Making_requests_on_the_user&#039;s_behalf"></span> ==== 作为用户身份执行请求 ==== <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to include the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the access token is used to fetch a CSRF token or other tokens, the access token must still be passed (as a header) with requests that use those tokens.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications which need minimal privileges (have been registered as ''User identity verification only'') cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> API requests including <code>rest.php/oauth2/resource/profile</code> must be authenticated with an HTTP Authorization header containing the access token, like: </div> <pre> Authorization: Bearer abcde....6789 </pre> <span id="Identifying_the_user"></span> ==== 鉴别用户 ==== <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a somewhat incomplete implementation of OpenID Connect for authenticating the user.</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">See [[phab:T254063|T254063]] for details.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send an authenticated OAuth GET request to the <code>oauth2/resource/profile</code> API (MediaWiki's implementation of what the OIDC spec calls the UserInfo endpoint) under the wiki's REST endpoint (usually <code>rest.php</code>); the response will include the name of the user and various other information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that the GET request must use the HTTP <code>Authorization</code> header, not a query string token.</span> * '''sub''' <span lang="en" dir="ltr" class="mw-content-ltr">(central user ID)</span> * '''username''' * '''editcount''' * '''confirmed_email''' * '''blocked''' * '''registered''' * '''groups''' * '''rights''' * '''realname''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> * '''email''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> <span id="Setting_up_a_development_environment"></span> == 配置开发环境 == <div lang="en" dir="ltr" class="mw-content-ltr"> You can register an OAuth application on [https://meta.wikimedia.beta.wmflabs.org/wiki/Special:OAuthConsumerRegistration/propose beta meta] and test your code against that. </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you want to improve the extension itself, or debug protocol issues in detail, OAuth is available in the {{ll|MediaWiki-Vagrant}} development environment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Add the <code>oauth</code> role, and your local wiki will be able to authorise OAuth apps.</span> <syntaxhighlight lang="shell-session"> $ vagrant roles enable oauth $ vagrant provision </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Once the code is nearly ready, you can register an OAuth application on the real wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to test it with the same user account used for registering, even before it gets reviewed by admins.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If you are creating an application for Wikimedia projects, consider hosting it at [[Wikitech:Portal:Toolforge|Wikimedia Toolforge]], a free tool forge and hosting platform for Wikimedia-related services. </div> <span id="Security_benefits_and_trade-offs"></span> == 安全利益和权衡 == * <span lang="en" dir="ltr" class="mw-content-ltr">Unlike password-based authentication, the OAuth 1.0 protocol prevents any [[w:Man-in-the-middle attack|man-in-the-middle attack]] even if the wiki does not require HTTPS: all interactions between MediaWiki and the application are signed with either a shared secret (using HMAC-SHA1), or a [[w:Public-key cryptography|public key]] (RSA).</span> <span lang="en" dir="ltr" class="mw-content-ltr">HTTPS is still required for certain steps though (for obtaining the shared secret in the second step of authorisation when not using RSA, and during app registration).</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 2.0 does not involve signing and relies on HTTPS for security.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Actions via OAuth happen under the user's name but will be [[Special:MyLanguage/Manual:Tags|tagged]] with the application's name as well so rogue applications can be identified.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Wiki admins can revoke the application's permissions (and thus bar it from any further action) if needed.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The user can revoke the permission of the application to use that specific user account if they don't like how it works or don't trust it anymore.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Unlike a password change, this is not disruptive for the user.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Sufficiently flexible applications might allow users to circumvent IP blocks (since MediaWiki will see the IP of the application server, not that of the user).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This can be handled the same way proxies are, by trusting XFF headers set by the application (see [[Phab:T159889|T159889]] for some limitations).</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The application secret must be kept secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Submitting it to source control or putting it into user-accessible code (such as mobile app or desktop application; even if it is obfuscated) undermines the security model and will result in admins forcefully disabling the application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Exceptions are made for example applications demoing OAuth usage, if they are explicitly labeled as such and request limited rights.</span> <span id="Libraries"></span> == 相关库 == === PHP === * [[oauthclient-php]] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a client library maintained by Wikimedia</span> * [https://php.net/book.oauth OAuth] – <span lang="en" dir="ltr" class="mw-content-ltr">PECL client library</span> * [https://github.com/firebase/php-jwt firebase/php-jwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a popular JWT library</span> * [https://sr.ht/~taavi/laravel-socialite-mediawiki/ laravel-socialite-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki driver for [[w:Laravel|Laravel]]'s [https://laravel.com/docs/7.x/socialite Socialite] library.</span> === Python === * [https://github.com/valhallasw/flask-mwoauth flask-mwoauth] – <span lang="en" dir="ltr" class="mw-content-ltr">a Flask blueprint to run OAuth against MediaWiki's Extension:OAuth (See tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Flask_OAuth_tool My first Flask OAuth tool])</span> * [https://github.com/wikimedia/MediaWiki-OAuth MediaWiki-OAuth (mwoauth)] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a on top of [http://requests-oauthlib.readthedocs.org/en/latest/oauth1_workflow.html requests-oauthlib]</span> * [https://github.com/python-social-auth/social-core python-social-auth] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework that includes a [https://github.com/python-social-auth/social-core/blob/master/social_core/backends/mediawiki.py MediaWiki backend] (Example tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Django_OAuth_tool My first Django OAuth tool])</span> * [https://docs.authlib.org/en/latest/index.html authlib] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework to interact with Wikimedia OAuth 2.0 API (Full minimal Django OAuth 2.0 [https://code.basabuuka.org/alpcentaur/wmde_oauth_django_example example])</span> * [https://github.com/jpadilla/pyjwt pyjwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a JWT library</span> === Ruby === * [https://github.com/timwaters/omniauth-mediawiki omniauth-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">a MediaWiki strategy for OmniAuth (also available as a [https://rubygems.org/gems/omniauth-mediawiki gem])</span> === Rust === * [https://crates.io/crates/mediawiki MediaWiki crate] <span lang="en" dir="ltr" class="mw-content-ltr">implements both OAuth1 and OAuth2 login mechanisms.</span> * [https://crates.io/crates/oauth2 oauth2 crate] === Node.js === * [https://www.npmjs.com/package/passport-mediawiki-oauth passport-mediawiki-oauth] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki strategy for the Passport auth framework (which can be used effortlessly as a middleware with Express JS and similar frameworks)</span> * [https://www.npmjs.com/package/oauth-fetch-json oauth-fetch-json] – <span lang="en" dir="ltr" class="mw-content-ltr">library for signing OAuth requests</span> * [https://www.npmjs.com/package/m3api-oauth2 m3api-oauth2] – an extension package for [https://www.npmjs.com/package/m3api m3api], making it easy to make requests authenticated via [[Special:MyLanguage/Help:OAuth|OAuth 2.0]] === Go === * [https://github.com/mrjones/oauth mrjones/oauth] (OAuth 1.0) * [https://pkg.go.dev/golang.org/x/oauth2 golang.org/x/oauth2] <span lang="en" dir="ltr" class="mw-content-ltr">(OAuth 2.0, [https://pkg.go.dev/golang.org/x/oauth2#example-Config example])</span> === Java === * [https://github.com/scribejava/scribejava ScribeJava] <span lang="en" dir="ltr" class="mw-content-ltr">since version 5.5.0 ([https://github.com/scribejava/scribejava/pull/852 pull request])</span> <span id="Example_code"></span> == 示例代码 == <span id="PHP_client_without_using_any_libraries"></span> === 不使用第三方库的PHP项目 === [[toollabs:oauth-hello-world|OAuth Hello World]] – <span lang="en" dir="ltr" class="mw-content-ltr">easy to understand demo application written in PHP without any libraries.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === PHP command-line client with RSA keys, using oauthclient-php === </div> <span lang="en" dir="ltr" class="mw-content-ltr">PHP application using classes from the OAuth extension codebase.</span> {{Todo|1=<span lang="en" dir="ltr" class="mw-content-ltr">convert this to actually use oauthclient-php! Probably just a bunch of <code>use</code> declarations.</span>}} <span lang="en" dir="ltr" class="mw-content-ltr">Before Starting:</span> <syntaxhighlight lang="shell-session"> $ openssl genrsa -out appkey.pem 4096 $ openssl rsa -in appkey.pem -pubout > appkey.pub </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">PHP source code</span>}} <syntaxhighlight lang="php"> <?php if ( PHP_SAPI !== 'cli' ) { die( "CLI-only test script\n" ); } /** * A basic client for overall testing */ function wfDebugLog( $method, $msg) { //echo "[$method] $msg\n"; } require 'OAuth.php'; require 'MWOAuthSignatureMethod.php'; $consumerKey = ''; #$consumerSecret = ''; // We don't need this, since we're using RSA, except to validate the /identify call $privateKey = file_get_contents( 'appkey.pem' ); $baseurl = 'http://<wiki>/wiki/Special:OAuth'; $endpoint_req = $baseurl . '/initiate?format=json&oauth_callback=oob'; // format=json makes php a little easier $endpoint_acc = $baseurl . '/token?format=json'; $endpoint_id = $baseurl . '/identify'; $c = new OAuthConsumer( $consumerKey, $privateKey ); // Make sure we sign title and format $parsed = parse_url( $endpoint_req ); $extraSignedParams = array(); parse_str($parsed['query'], $extraSignedParams); $extraSignedParams['title'] = 'Special:OAuth/initiate'; $init_req = OAuthRequest::from_consumer_and_token( $c, // OAuthConsumer for your app NULL, // User token, NULL for calls to initiate "GET", // http method $endpoint_req, // endpoint url (this is signed) $extraSignedParams // extra parameters we want to sign (must include title) ); $rsa_method = new MWOAuthSignatureMethod_RSA_SHA1( new OAuthDataStore(), $privateKey ); $init_req->sign_request( $rsa_method, // OAuthSignatureMethod $c, // OAuthConsumer for your app NULL // User token, NULL for calls to initiate ); echo "Getting request token with: $init_req\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, (string) $init_req ); // Pass OAuth in GET params curl_setopt( $ch, CURLOPT_HTTPGET, true ); curl_setopt( $ch, CURLOPT_HEADER, false ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $requestToken = json_decode( $data ); print "Visit $baseurl/authorize?oauth_token={$requestToken->key}&oauth_consumer_key=$consumerKey\n"; // ACCESS TOKEN print "Enter the verification code:\n"; $fh = fopen( "php://stdin", "r" ); $line = fgets( $fh ); $rc = new OAuthToken( $requestToken->key, $requestToken->secret ); $parsed = parse_url( $endpoint_acc ); parse_str($parsed['query'], $params); $params['oauth_verifier'] = trim($line); $params['title'] = 'Special:OAuth/token'; $acc_req = OAuthRequest::from_consumer_and_token( $c, $rc, "GET", $endpoint_acc, $params ); $acc_req->sign_request($rsa_method, $c, $rc); echo "Calling: $acc_req\n"; unset( $ch ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_acc ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $acc_req->to_header() ) ); // Set the Authorization Header $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $acc = json_decode( $data ); $accessToken = new OAuthToken( $acc->key, $acc->secret ); /** * Insecurely call the api for information about the user. * A MITM can forge a response from the server, so don't rely on this for identity! */ $apiurl = 'http://<wiki>/w/api.php'; $apiParams = array( 'action' => 'query', 'meta' => 'userinfo', 'uiprop' => 'rights', 'format' => 'json', ); $api_req = OAuthRequest::from_consumer_and_token( $c, // Consumer $accessToken, // User Access Token "GET", // HTTP Method $apiurl, // Endpoint url $apiParams // Extra signed parameters ); $api_req->sign_request( $rsa_method, $c, $accessToken ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $apiurl . "?" . http_build_query( $apiParams ) ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $api_req->to_header() ) ); // Authorization header required for api $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; /** * Securely get the identity of the user */ $consumerSecret = ''; $extraSignedParams = array( 'title' => 'Special:OAuth/identify' ); $req = OAuthRequest::from_consumer_and_token( $c, $accessToken, "GET", $endpoint_id, $extraSignedParams ); $req->sign_request( $rsa_method, $c, $accessToken ); echo "Calling: '$endpoint_id'\nHeader: {$req->to_header()}\n\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_id ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $req->to_header() ) ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } $identity = JWT::decode( $data, $consumerSecret ); // Validate the JWT if ( !validateJWT( $identity, $consumerKey, $req->get_parameter( 'oauth_nonce' ) ) ) { print "The JWT did not validate"; } else { print "We got a valid JWT, describing the user as:\n"; print " * Username: {$identity->username}\n"; print " * User's current groups: " . implode( ',', $identity->groups ) . "\n"; print " * User's current rights: " . implode( ',', $identity->rights ) . "\n"; } /** * Validate a JWT, to ensure this isn't a reply, spoof, etc. * @param $identity the decoded JWT * @param $consumerKey your App's Key * @param $nonce the nonce sent with your request, which should be returned */ function validateJWT( $identity, $consumerKey, $nonce ) { $expectedConnonicalServer = 'http://<wiki>'; // Verify the issuer is who we expect (server sends $wgCanonicalServer) if ( $identity->iss !== $expectedConnonicalServer ) { print "Invalid Issuer"; return false; } // Verify we are the intended audience if ( $identity->aud !== $consumerKey ) { print "Invalid Audience"; return false; } // Verify we are within the time limits of the token. // Issued at (iat) should be in the past, // Expiration (exp) should be in the future. $now = time(); if ( $identity->iat > $now || $identity->exp < $now ) { print "Invalid Time"; return false; } // Verify we haven't seen this nonce before, which would indicate a replay attack if ( $identity->nonce !== $nonce ) { print "Invalid Nonce"; return false; } return true; } </syntaxhighlight> {{Collapse_bottom}} <span id="Python_command-line_client_using_mwoauth"></span> === 使用mwoauth的Python命令行客户端 === {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Python source code</span>}} <syntaxhighlight lang="python"> from mwoauth import ConsumerToken, Handshaker import requests from requests_oauthlib import OAuth1 from six.moves import input # For compatibility between python 2 and 3 # Consruct a "consumer" from the key/secret provided by MediaWiki import config # You'll need to provide this # Create a file called config.py somewhere where it will be found by python, e.g. in the same directory as this script, with the following content (not including the # characters!) # consumer_key = "the consumer token you got when you registered your applicaton" # consumer_secret = "the secret token you got when you registered your application" # For example: # consumer_key = "20bc67da5081a30c736340c493f60d14" # consumer_secret = "af4313371bb2fb38e81fe7d300080085f52849f9" consumer_token = ConsumerToken(config.consumer_key, config.consumer_secret) # Construct handshaker with wiki URI and consumer handshaker = Handshaker("https://en.wikipedia.org/w/index.php", consumer_token) # Step 1: Initialise -- ask MediaWiki for a temporary key/secret for user redirect, request_token = handshaker.initiate() # Step 2: Authorise -- send user to MediaWiki to confirm authorisation print("Point your browser to: %s" % redirect) # response_qs = input("Response query string: ") # Step 3: Complete -- obtain authorised key/secret for "resource owner" access_token = handshaker.complete(request_token, response_qs) # Construct an auth object with the consumer and access tokens auth1 = OAuth1(consumer_token.key, client_secret=consumer_token.secret, resource_owner_key=access_token.key, resource_owner_secret=access_token.secret) # Now, accessing the API on behalf of a user print("Reading top 10 watchlist items") response = requests.get( "https://en.wikipedia.org/w/api.php", params={ 'action': "query", 'list': "watchlist", 'wllimit': 10, 'wlprop': "title|comment", 'format': "json" }, auth=auth1 ) for item in response.json()['query']['watchlist']: print("{title}\t{comment}".format(**item)) </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Python Toolforge tutorial using mwoauth === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> See: </div> [[wikitech:Help:Toolforge/My first Flask OAuth tool]] === Python Toolforge tutorial using authlib (OAuth 2.0) === {{Collapse_top|title=Python source code}} <syntaxhighlight lang="python"> # > requirements.txt # flask==3.1.3 # requests==2.33.1 # authlib==1.7.0 # > config.py OAUTH_ACCESS_TOKEN_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/access_token" OAUTH_API_BASE_URL = "https://commons.wikimedia.org/w/" OAUTH_AUTHORIZE_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/authorize" OAUTH_CODE_CHALLENGE_METHOD = "S256" OAUTH_CONSUMER_KEY = "Y" OAUTH_CONSUMER_SECRET = "Z" OAUTH_SCOPE = "basic editpage" # > app.py from authlib.integrations.flask_client import FlaskOAuth2App, OAuth from flask import Flask, jsonify, redirect, request, session from requests import Response app = Flask() app.config.from_pyfile("config.py") oauth = OAuth(app) oauth.register( name="mediawiki", client_id=app.config["OAUTH_CONSUMER_KEY"], client_secret=app.config["OAUTH_CONSUMER_SECRET"], client_kwargs={ "code_challenge_method": app.config["OAUTH_CODE_CHALLENGE_METHOD"], "scope": app.config["OAUTH_SCOPE"], }, api_base_url=app.config["OAUTH_API_BASE_URL"], access_token_url=app.config["OAUTH_ACCESS_TOKEN_URL"], authorize_url=app.config["OAUTH_AUTHORIZE_URL"], ) oauth_client: FlaskOAuth2App = oauth.create_client("mediawiki") @app.route("/") def index(): return app.send_static_file("index.html") @app.route("/login") def login(): return oauth_client.authorize_redirect() @app.route("/oauth-callback") def auth(): token = oauth_client.authorize_access_token() session["token"] = token return redirect("/") @app.route("/logout") def logout(): session.pop("token", None) session.clear() return redirect("/") @app.route("/user") def user(): response: Response = oauth_client.request( "GET", "rest.php/oauth2/resource/profile", token=session["token"], ) user = response.json() response.raise_for_status() return jsonify(user=user) @app.route("/edit", methods=["POST"]) def edit(): data = request.get_json() pageid = int(data["pageid"]) response: Response = oauth_client.request( "POST", "api.php", token=session["token"], data=dict( format="json", formatversion="2", action="query", pageids=str(pageid), prop="revisions|wbentityusage", rvprop="content", rvslots="*", meta="tokens", ), ) r = response.json() token = r["query"]["tokens"]["csrftoken"] ... </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Go command-line client using mrjones/auth (OAuth 1.0) === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Before you begin: </div> <syntaxhighlight lang="shell-session"> $ go get github.com/mrjones/oauth </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Go source code</span>}} <syntaxhighlight lang="go"> package main import ( "fmt" "os" "github.com/mrjones/oauth" "io/ioutil" "strconv" ) func main() { var consumerKey string = "" var consumerSecret string = "" if len(consumerKey) == 0 || len(consumerSecret) == 0 { os.Exit(1) } c := oauth.NewConsumer( consumerKey, consumerSecret, oauth.ServiceProvider{ RequestTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/initiate", AuthorizeTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/authorize", AccessTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/token", }) c.Debug(true) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/initiate", } c.AdditionalAuthorizationUrlParams = map[string]string{ "oauth_consumer_key": consumerKey, } requestToken, url, err := c.GetRequestTokenAndUrl("oob") if err != nil { fmt.Println( err ) } fmt.Println( "Got token " + requestToken.Token ) fmt.Println("(1) Go to: " + url) fmt.Println("(2) Grant access, you should get back a verification code.") fmt.Println("(3) Enter that verification code here: ") verificationCode := "" fmt.Scanln(&verificationCode) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/token", } accessToken, err := c.AuthorizeToken(requestToken, verificationCode) if err != nil { fmt.Println(err) } fmt.Println( "Got access token " + accessToken.Token ) c.AdditionalParams = map[string]string{} response, err := c.Get( "http://<wiki>/wiki/api.php", map[string]string{ "action": "query", "meta": "userinfo", "uiprop": "rights", "format": "json", }, accessToken) if err != nil { fmt.Println(err) } fmt.Println( "\tResponse Status: '" + response.Status + "'\n" ) fmt.Println( "\tResponse Code: " + strconv.Itoa(response.StatusCode) + "\n" ) bytes, _ := ioutil.ReadAll(response.Body) fmt.Println( "\tResponse Body: " + string(bytes) + "\n" ) } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === JavaScript applications using OAuth 2 === </div> * [https://github.com/wikimedia/apiclient-wiki wikimedia/apiclient-wiki] – <span lang="en" dir="ltr" class="mw-content-ltr">entire application in 520 lines of code</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Full applications using OAuth === </div> * [https://github.com/jdlrobson/weekipedia/blob/master/libs/server/app.js Weekipedia], <span lang="en" dir="ltr" class="mw-content-ltr">A full scale React.js port of the Wikipedia mobile site uses both.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">many [https://toolhub.wikimedia.org/search?keywords__term=oauth Toolforge tools]</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==Notes== </div> <references /> sk8ngg84reiqzcn03t3bbrpfd43d5we OAuth/For Developers/fr 0 1158485 8364289 8350294 2026-05-03T12:27:47Z FuzzyBot 451990 Updating to match new version of source page 8364289 wikitext text/x-wiki <languages /> Cette page explique comment développer des applications pouvant s'intégrer à un wiki en utilisant {{ll|Extension:OAuth}} (une extension qui transforme MediaWiki en serveur [[w:fr:OAuth|OAuth]]) pour demander la permission de manière sécurisée pour agir au nom de l'utilisateur. {{Note|1=Si vous développez un robot ou une application similaire qui utilise toujours le même compte vous pouvez préférer les [[Special:MyLanguage/OAuth/Owner-only_consumers|consommateurs exclusifs]].}} <span id="OAuth_in_a_nutshell"></span> == OAuth en résumé == OAuth permet à une application de demander l'autorisation d'un utilisateur pour agir en utilisant le compte wiki de cet utilisateur, sans connaître son mot de passe, et sans pouvoir faire tout ce que l'utilisateur pouvait faire (par exemple, l'application pourrait être capable de modifier des articles mais ne pas les supprimer, de sorte que même les utilisateurs ayant des droits étendus peuvent utiliser en toute sécurité les outils activés par OAuth). Cela se produit via le protocole [https://oauth.net/2/ OAuth 2.0] ou [https://oauth.net/core/1.0a/ OAuth 1.0a] et se compose de trois étapes : # Le développeur doit enregistrer l'application (souvent appelée "consommateur" dans la terminologie OAuth) sur le wiki, éventuellement passer par un processus de relecture, et recevra les informations d'identification. # Quand l'utilisateur souhaite utiliser l'application celle-ci doit initier un processus d'autorisation. Cela impliquera le renvoi de l'utilisateur sur une page spéciale du wiki, qui affichera un dialogue concernant l'autorisation. Si l'utilisateur accepte, l'application recevra un autre ensemble d'identifiants (qui sont spécifiques à cet utilisateur et peuvent être révoqués par l'utilisateur à tout moment). # Lorsque l'application veut faire une action (requête à l'API) au nom de l'utilisateur, elle peut combiner les informations d'identification reçues aux étapes 1 et 2 pour signer la requête. OAuth est une norme ouverte largement utilisée (vous pouvez la voir sur des sites comme Google ou Facebook ou GitHub, par exemple lorsque vous utilisez des comptes sur ces sites pour vous connecter ailleurs). {{info|1=OAuth ne doit pas être confondu avec : * [[w:fr:Initiative for Open Authentication|OATH]] (une famille de protocoles d'authentification à deux facteurs, connue habituellement comme ''Entrez les six nombres que vous voyez sur votre application mobile'', maintenant activée sur les sites Wikimedia) * [[w:fr:OpenID Connect|OpenID Connect]] (un protocole d'authentification basé sur OAuth 2.0, que l'extension OAuth de MediaWiki prend encharge partiellement). }} Pour un aperçu un peu plus étendu sur OAuth 1.0a, voir [https://docs.google.com/presentation/d/1537HnwSaSzH-b8hINcz48SNhT8ElAUPC39to0_O1iNA/edit#slide=id.g15105b408d_0_287 ce diaporama]. <span id="OAuth_in_detail"></span> == OAuth en détails == L'enregistrement est essentiellement le même pour OAuth 1.0a et OAuth 2, la différence étant que quelques champs de formulaire sont présents. Les autres parties diffèrent de manière significative en fonction de la version de OAuth. Généralement, OAuth 2 est recommandé s'il est disponible dans votre environnement. <span id="Registration"></span> === Enregistrement === Pour enregistrer une nouvelle application OAuth, soumettez le formulaire à <code>[[m:Special:OAuthConsumerRegistration/propose|Special:OAuthConsumerRegistration/propose]]</code>. Essayez de donner suffisamment d'informations à propos de l'application pour que les administrateurs et les utilisateurs puissent décider si elle est digne de confiance. Les URL des endroits où on trouve plus d'informations (comme l'application elle-même, le code source ou la documentation sur le wiki) peuvent être utiles. Pour les applications OAuth à utiliser dans les projets Wikimedia, voir les [[meta:Special:MyLanguage/OAuth app guidelines|règles des applications]]. En plus des descriptions, les champs ont les significations suivantes : * <code>This consumer is for use only by {{tag|user|open|plain=1}}</code>: indique si vous utilisez les [[Special:MyLanguage/OAuth/Owner-only_consumers|consommateurs exclusifs]] (qui ne nécessite pas d'être revu ni autorisé, mais qui n'est utilisable que par vous-même). * <code>callback URL</code> (ne concerne pas les consommateurs exclusifs): URL où l'utilisateur est renvoyé après que l'autorisation correspondante a été vérifiée. (C'est une couche supplémentaire de sécurité contre un attaquant qui essaie de voler les informations durant l'autorisation). Si l'option <code>utiliser en tant que préfixe</code> est activée, l'URL doit commencer par cette valeur (le contrôle est fait pour s'assurer d'avoir ajouté au moins un <code>/</code> après le nom de domaine), sinon la correspondance doit être exacte. Si vous développez ou testez sur votre machine locale, indiquez [[w:fr:Localhost|Localhost]] dans ce champ (e.g. <code><nowiki>http://localhost:8080/</nowiki></code>). * <code>Applicable project</code> (pour les fermes de wikis uniquement): le ou les projets sur lesquels votre application sera utilisée. Vous pouvez limiter l'application à un seul wiki ou la faire fonctionner partout. * <code>Types of grants</code> / <code>Applicable grants</code>: autorisations requises par votre application (soyez conservateur). Les autorisations réelles sont un ET logique entre celles-ci et les droits actuels de l'utilisateur. Actuellement, l'utilisateur doit autoriser les autorisations groupées, et non les autorisations individuelles ([[Phab:T59505|T59505]]). * <code>Allowed IP ranges</code>: spécification facultative des intervalles d'adresses IP que vous utilisez, quand les requêtes OAuth qui ne correspondent pas à celles-ci sont rejetées. C'est une couche supplémentaire de sécurité contre un attaquant qui vole les informations de votre application et essaie de les utiliser. C'est l'un des quelques paramètres que vous pourrez modifier plus tard. * <code>Public RSA key</code> (OAuth 1.0a uniquement): clé publique utilisée par votre application demande pour signer les requêtes. Vous pouvez laisser cela vide (ce que fait la plupart des applications) pour utiliser un mécanisme de partage de secrets légèrement plus simple à la place. C'est l'un des quelques paramètres que vous pourrez modifier ultérieurement. Après l'enregistrement, vous recevrez les informations nécessaires pour utiliser OAuth. Vous pourrez l'utiliser immédiatement avec votre propre compte utilisateur (ceci est fait pour les tests); les autres ne pourront l'utiliser qu'une fois qu'il sera approuvé par un administrateur. La liste des applications (approuvées et autres) est publique et disponible sur <code>[[m:Special:OAuthListConsumers|Special:OAuthListConsumers]]</code>. === OAuth 1.0a === <span id="Authorisation"></span> ==== Autorisation ==== [[File:OAuth authorization interface.png|thumb|Dialogue d'autorisation affiché aux utilisateurs]] Lors de l'enregistrement de l'application, vous recevez deux informations d'identification : le jeton de l'application (identifiant public pour l'application) et le code le secret de l'application (une sorte de mot de passe). Pour pouvoir identifier un utilisateur ou faire des demandes d'API en son nom, vous devez obtenir un autre ensemble de identifiants (ceux-ci étant spécifiques à cet utilisateur) : le jeton d'accès et le code secret d'accès.<ref> Avec une clé RSA, les informations sont légèrement différentes. Il est supposé que les personnes qui choisissent d'utiliser une clé RSA savent ce qu'elles font, donc ce tutoriel supposera que vous avez choisi l'option non RSA. </ref> Pour les obtenir, vous devez passer par le processus d'autorisation, qui consiste en trois étapes :<ref> On l'appelle parfois le flux OAuth à trois pattes. Dans certaines circonstances, une alternative plus simple et à une étape (OAuth à une jambe) est également disponible. Voir les {{ll|OAuth/Owner-only consumers|consommateurs exclusifs}} pour cela. </ref> # Obtenir un jeton de requête du wiki en envoyant une requête GET sur <code>Special:OAuth/initiate</code>, signée avec la clé et le code secret de l'application, avec l'URL de rappel (où l'utilisateur sera redirigé si l'autorisation réussit) passés dans le paramètre <code>oauth_callback</code> de la requête (si vous avez défini une URL constante à l'enregistrement, la valeur du paramètre ''doit'' être <code>oob</code>).<ref name="non-nice-url">Suite à [[phab:T59500]] vous devez actuellement utiliser une URL peu jolie telle que <code>en.wikipedia.org/w/index.php?title=Special:OAuth/initiate</code>.</ref> Si cela fonctionne, la réponse sera un objet JSON avec les champs <code>token</code> (le jeton de la requête) et <code>key</code> (le code secret de la requête). (si ce n'est pas le cas, il aura un champ <code>error</code>). # Demander à l'utilisateur d'autoriser l'application en les envoyant à <code>Special:OAuth/authorize</code>, avec le jeton de l'application et le jeton de la requête passés dans les paramètres de la requête (respectivement <code>oauth_consumer_key</code> et <code>oauth_token</code>). L'utilisateur verra un dialogue sur l'autorisation avec quelques informations de base sur l'application et la liste des droits et pourra décider d'autoriser ou d'annuler. # Si l'utilisateur choisit d'autoriser, il sera redirigé vers l'URL de rappel que vous avez fournie (à l'enregistrement, ou comme paramètre d'URL à l'étape 1). Le paramètre de requête <code>oauth_verifier</code> contiendra le code de vérification que vous pouvez utiliser pour échanger le jeton de la requête avec son code secret contre le jeton d'accès avec son code secret. Pour ce faire, envoyez une demande à <code>Special:OAuth/token</code><ref name="non-nice-url" /> qui inclut le paramètre de <code>oauth_verifier</code> que vous venez de recevoir et qui est signé avec le jeton de l'appliction et son code secret et le jeton de la requête et son code secret. La réponse contiendra le jeton d'accès et son code secret (dans le même format que celui du jeton de la requête et son code secret de l'étape 1). Le jeton d'accès et son code secret sont ce dont vous aurez besoin pour signer les requêtes à l'API. Le jeton de la requête et le code secret ne sont plus utiles et peuvent être effacés. Le jeton d'accès restera valable indéfiniment, à moins que l'utilisateur ne le révoque. (Si vous préférez ne pas le stocker, vous pouvez néanmoins répéter simplement le processus d'autorisation à tout moment). Les applications qui ne nécessitent qu'un nombre minimum de droits (elles ont été enregistrées avec ''Vérification uniquement de l'identité de l'utilisateur'') peuvent utiliser <code>/authenticate</code> au lieu de <code>/authorize</code> à l'étape 2. Cela fonctionne de la même manière, mais l'utilisateur ne verra le dialogue d'autorisation que s'il n'a pas autorisé cette application auparavant; autrement, l'autorisation réussira silencieusement. Il est probable que le langage ou l'environnement que vous utilisez ait une bibliothèque qui prenne en charge cette procédure, donc vous n'avez pas à l'implémenter manuellement &mdash; chaque étape sera un seul appel de fonction. Voir ci-dessous pour les exemples. <span id="Making_requests_on_the_user&#039;s_behalf"></span> ==== Faire des requêtes au nom de l'utilisateur ==== Pour bénéficier de l'autorisation, les requêtes doivent être signées avec le jeton et le code secret de l'application et le jeton et le code secret de l'accès. En cas de succès, le wiki traite la requête comme si elle avait été faite par l'utilisateur qui a donné l'autorisation. Seules les requêtes à l'API peuvent être faites via OAuth, à une seule exception (voir la section suivante). Certains modules de l'API qui n'auraient pas de sens avec OAuth (comme la connexion et la déconnexion), ou qui permettraient l'escalade des privilèges (comme l'API'' centralauthtoken''), sont désactivés. Les applications enregistrées comme ''Vérification uniquement de l'identité de l'utilisateur'' ne peuvent pas utiliser l'API du tout. <span id="Identifying_the_user"></span> ==== Identifier l'utilisateur ==== L'extension OAuth contient un protocole personnalisé (semblable à ''OpenID Connect'') pour authentifier l'utilisateur. Pour utiliser cela, envoyez une requête OAuth signée à <code>Special:OAuth/identify</code> :<ref name="non-nice-url" /> la réponse va être un [[w:fr:JSON Web Token|JWT]] (JSON Web Token &ndash; objet JSON signé) comprenant le nom de l'utilisateur, son {{ll|Manual:Central ID|ID centralisé}} (sous la clé <code>sub</code>) et différentes autres informations (telles que les groupes utilisateur auxquels il appartient et s'il est bloqué; également son adresse courriel si l'application a été enregistrée avec le bon type de privilège). Ceci est plus sûr que d'utiliser l'API (par exemple le module ''userinfo'') pour l'authentification, et qui pourrait être sujet à des attaques par les [[w:fr:Attaque de l'homme du milieu|'''hommes du milieu'']]; utilisez toujours cela si vous avez besoin d'identifier un utilisateur ! Assurez-vous également de valider correctement le JWT (il existe beaucoup de bibliothèques qui peuvent vous aider à cela). Vous devez vérifier chacun des éléments suivants : l'émetteur (<code>iss</code>) correspond au nom de domaine du wiki, le public (<code>aud</code>) correspond à votre clé de votre application, l'heure d'émission (<code>iat</code>) se trouve dans le passé et est raisonnablement proche de l'heure actuelle, l'heure d'expiration (<code>exp</code>) est dans le futur, le nonce (<code>nonce</code>) correspond à celui que vous avez envoyé dans la requête. <span id="Signing_requests"></span> ==== Signer les requêtes ==== Les étapes 1 et 3 du processus d'authorisation nécessitent de signer la requête ; de même les requêtes à l'API et <code>Special:OAuth/identify</code> doivent être signées. Le processus de signature est détaillé dans la [https://oauth.net/core/1.0a/#signing_process section 9 de la spécification OAuth], mais il est fastidieux à mettre en œuvre à la main mais de [https://oauth.net/1/ nombreuses bibliothèques] sont disponibles. Vous trouverez des exemples de code et un aperçu sur la manière de le faire manuellement dans la documentation du {{ll|OAuth/Owner-only_consumers|consommateur exclusif}}. (Ceci permet de signer avec le jeton et le code secret du consommateur, et le jeton d'accès et le code secret. Modifier le cas échéant pour signer avec le jeton et le code secret du consommateur et le jeton et le code secret de la requête (autorisation étape 3) ou uniquement le jeton et le code secret du consommateur (autorisation étape 1).) === OAuth 2 === <span id="Authorisation"></span> ==== Autorisation ==== Lorsque vous enregistrez l'application, vous recevez deux informations d'identification : la clé de l'application cliente (un ID public de l'application, appelé aussi l'ID client ou la clé consommateur) et le mot de passe de l'application cliente (un mot de passe confidentiel). Pour identifier un utilisateur ou pour faire des requêtes à l'API en son nom, vous devez obtenir d'autres informations (spécifiques à l'utilisateur) : le jeton d'accès. Pour l'obtenir vous devez exécuter la [https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/ séquence de code d'autorisation OAuth 2] qui se compose de deux étapes :<ref>Ce processus OAuth est quelques fois dit ''à trois jambes''. Dans certaines circonstances une alternative plus simple en une étape (appelée OAuth ''à une jambe'') est également disponible. Voir les [[Special:MyLanguage/OAuth/Owner-only consumers|consommateurs exclusifs]] pour cela.</ref> # Demandez à l'utilisateur d'autoriser l'application en leur envoyant à <code>oauth2/authorize</code> sur le point d'accès REST du wiki (généralement <code>rest.php</code>), avec <code>response_type=code</code> et la clé consommateur (également appelée clé de l'application cliente) en tant que <code>client_id</code>, éventuellement un <code>state</code> si vous le souhaitez, et optionnellement <code>redirect_uri</code> (si oui, il doit être le même que celui de la requête de l'application). Si votre consommateur n'est pas confidentiel, vous devrez également inclure un [https://www.oauth.com/oauth2-servers/pkce/authorization-request/ défi de code PKCE] (<code>code_challenge</code> et <code>code_challenge_method=S256</code>).<ref>PKCE &mdash; Proof Key for Code Exchange</ref> L'utilisateur verra un dialogue de l'autorisation avec quelques informations de base sur la demande et la liste des droits et pourra décider d'autoriser ou d'annuler. # Si l'utilisateur a choisi d'autoriser, il sera redirigé vers l'URL de rappel que vous avez fournie (à l'enregistrement, ou en tant que paramètre d'URL de l'étape 1). Le paramètre de requête <code>code</code> contiendra le code d'autorisation que vous pouvez utiliser pour récupérer le jeton d'accès. Pour ce faire, envoyez une requête POST à <code>oauth2/access_token</code> sur le point d'accès REST du wiki (généralement <code>rest.php</code>$2), comprenant <code>grant_type=authorization_code</code>, le paramètre <code>code</code> que vous venez de recevoir, l'authentification de votre client (générativement <code>client_id</code> et pour les clients confidentiels, <code>client_secret</code>), <code>redirect_uri</code> si et seulement si vous l'avez spécifié dans la étape précédente (la valeur étant la même pour les deux), et si non confidentielle, les PKCE <code>code_verifier</code> et <code>code_challenge_method</code>. La réponse contiendra le jeton d'accès et un jeton de rafraîchissement. Le jeton d'accès est ce dont vous aurez besoin pour envoyer les futures requêtes à l'API. Le jeton de rafraîchissement peut être utilisé pour [https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/ demander un nouveau jeton d'accès] si le jeton d'accès original a expiré. Si vous préférez ne pas stocker les deux jetons, vous pouvez simplement répéter le processus d'autorisation à tout moment. <span class="mw-translate-fuzzy">(Notez que les clients non confidentiels ne peuvent actuellement utiliser les jetons de rafraîchissement qu'en utilisant leurs clés secrètes de client, et pas en utilisant seulement leur ID de client, voir [[phabricator:T323855|T323855]]).</span> Il est probable que la langue ou l'environnement que vous utilisez aura une bibliothèque pour prendre en charge cette procédure, vous n'aurez donc pas à l'implémenter manuellement - chaque étape sera un seul appel de fonction. Voir ci-dessous pour les exemples. <span id="Making_requests_on_the_user&#039;s_behalf"></span> ==== Faire des requêtes au nom de l'utilisateur ==== Pour tirer parti de l'autorisation, les requêtes doivent inclure le jeton d'accès. En cas de succès, le wiki traite la requête comme si elle avait été faite par l'utilisateur qui a donné l'autorisation. Seules les requêtes à l'API peuvent être faites via OAuth 2. Certains modules de l'API qui n'auraient pas de sens avec OAuth (comme la connexion et la déconnexion), ou qui permettraient l'escalade des privilèges (comme l'API ''centralauthtoken''), sont désactivés. Si le jeton d'accès est utilisé pour obtenir un jeton CSRF ou d'autres jetons, le jeton d'accès doit toujours être passé (en tant qu'entête) avec les requêtes qui utilisent ces jetons. Les applications qui ne nécessitent qu'un nombre minimum de droits (elles ont été enregistrées avec ''Vérification uniquement de l'identité de l'utilisateur'') ne peuvent pas utiliser l'API du tout. Les requêtes à l'API comprenant <code>rest.php/oauth2/resource/profile</code> doivent être authentifiées avec une entête d'autorisation HTTP contenant le jeton d'accès, comme <pre> Authorization: Bearer abcde....6789 </pre> <span id="Identifying_the_user"></span> ==== Identifier l'utilisateur ==== L'extension OAuth comprend une implémentation quelque peu incomplète d'OpenID Connect pour authentifier l'utilisateur.<ref>Voir [[phab:T254063|T254063]] pour les détails.</ref> Pour utiliser cela, envoyez une demande OAuth GET authentifiée à l'API <code>oauth2/resource/profile</code> (implémentation de MediaWiki de ce que les spécifications OIDC appellent le point d'accès ''UserInfo'') sur le point d'accès REST du wiki (généralement <code>rest.php</code>); la réponse comprendra le nom de l'utilisateur et diverses autres informations. Notez que la requête GET doit utiliser l'entête HTTP <code>Authorization</code>, et non pas un jeton de chaîne de requête. * '''sub''' (id centralisé de l'utilisateur) * '''username''' * '''editcount''' * '''confirmed_email''' * '''blocked''' * '''registered''' * '''groups''' * '''rights''' * '''realname''' (uniquement si l'utilisateur a donné l'autorisation) * '''email''' (uniquement si l'utilisateur a donné l'autorisation) <span id="Setting_up_a_development_environment"></span> == Configurer l'environnement de développement == Vous pouvez enregistrer une application OAuth sur [https://meta.wikimedia.beta.wmflabs.org/wiki/Special:OAuthConsumerRegistration/propose meta bêta] et tester votre code avec. Si vous souhaitez améliorer l'extension elle-même, ou déboguer les problèmes de protocole en détails, OAuth est disponible dans l'environnement de développement {{ll|MediaWiki-Vagrant}}. Ajoutez le rôle <code>oauth</code>, et votre wiki locale pourra autoriser les applications OAuth. <syntaxhighlight lang="shell-session"> $ vagrant roles enable oauth $ vagrant provision </syntaxhighlight> Une fois que le code commence à être prêt, vous pouvez enregistrer une application OAuth sur le wiki réel. Vous pourrez la tester avec le même compte utilisateur utilisé pour vous inscrire, avant même qu'elle ne soit relue par les administrateurs. Si vous créez une application pour des projets Wikimedia, pensez à les héberger sur [[Wikitech:Portal:Toolforge|Wikimedia Toolforge]], une forge d'outils gratuite et une plateforme d'hébergement pour les services relatifs à Wikimedia. <span id="Security_benefits_and_trade-offs"></span> == Bénéfices sécuritaires et compromis == * A la différence des authentifications basées sur un mot de passe, le protocole OAuth 1.0 empêche toute [[w:fr:Attaque de l'homme du milieu|attaque de l'''homme du milieu'']] même si le wiki ne nécessite pas HTTPS : toutes les interactions entre MediaWiki et l'application sont signées soit avec un code secret partagé (en utilisant HMAC-SHA1), ou une [[w:fr:Cryptographie asymétrique|clé publique]] (RSA). Cependant, certains étapes nécessitent encore HTTPS (pour obtenir le code secret partagé dans la deuxième étape de l'autorisation lorsque l'on n'utilise pas RSA et lors de l'enregistrement de l'application). OAuth 2.0 n'inclut pas la signature mais ils s'appuie sur HTTPS pour la sécurité. * Les actions via OAuth se déroulent sous le nom de l'utilisateur mais elles sont [[Special:MyLanguage/Manual:Tags|marquées]] également du nom de l'application de sorte à ce que les applications boîteuses puissent être identifiées. Si nécessaire, les administrateurs de Wiki peuvent révoquer les autorisations de l'application (et ainsi empêcher toute action supplémentaire). * L'utilisateur peut révoquer l'autorisation de l'application d'utiliser son compte spécifique s'il n'aime pas son fonctionnement ou ne lui fait plus confiance. Contrairement à un changement du mot de passe, cela ne perturbe pas l'utilisateur. * Des applications suffisamment flexibles pourraient permettre aux utilisateurs de contourner les blocages d'adresse IP (puisque MediaWiki verra l'adresse IP du serveur d'application, et pas celle de l'utilisateur). Cela peut être géré de la même manière que les proxies, en faisant confiance aux entêtes XFF définis par l'application (voir [[Phab:T159889|T159889]] pour certaines limitations). * Le code secret de la demande doit être gardé secret. Soumettre à la gestion des sources, ou rendre le code accessible à l'utilisateur (comme une application mobile ou une application de bureau; même si elle est masquée) nuit au modèle de sécurité et entraînera la désactivation forcée de l'application par les administrateurs. Des exceptions sont faites par exemple pour les applications démontrant l'utilisation de OAuth, si elles sont explicitement étiquetées comme telles et demandent des droits limités. <span id="Libraries"></span> == Bibliothèques == === PHP === * [[oauthclient-php]] – bibliothèque client OAuth 1.0a maintenue par Wikimedia * [https://php.net/book.oauth OAuth] – bibliothèque client PECL * [https://github.com/firebase/php-jwt firebase/php-jwt] – bibliothèque JWT populaire * [https://sr.ht/~taavi/laravel-socialite-mediawiki/ laravel-socialite-mediawiki] – driver MediaWiki pour la bibliothèque [https://laravel.com/docs/7.x/socialite Socialite] de [[w:fr:Laravel|Laravel]]. === Python === * [https://github.com/valhallasw/flask-mwoauth flask-mwoauth] – un modèle cible Flask (''blueprint'') pour exécuter OAuth avec l'Extension:OAuth de MediaWiki (voir le tutoriel : [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Flask_OAuth_tool Mon premier outil Flask OAuth]) * [https://github.com/wikimedia/MediaWiki-OAuth MediaWiki-OAuth (mwoauth)] – OAuth 1.0a par dessus [http://requests-oauthlib.readthedocs.org/en/latest/oauth1_workflow.html requests-oauthlib] * [https://github.com/python-social-auth/social-core python-social-auth] – environnement ''auth'' comprenant un [https://github.com/python-social-auth/social-core/blob/master/social_core/backends/mediawiki.py serveur MediaWiki] (Tutoriel d'exemple : [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Django_OAuth_tool Mon premier outil Django OAuth]) * [https://docs.authlib.org/en/latest/index.html authlib] – environnement d'authentification pour interagir avec l'API OAuth 2.0 de Wikimedia ([https://code.basabuuka.org/alpcentaur/wmde_oauth_django_example exemple] de minimum complet Django OAuth 2.0) * [https://github.com/jpadilla/pyjwt pyjwt] – bibliothèque JWT === Ruby === * [https://github.com/timwaters/omniauth-mediawiki omniauth-mediawiki] – stratégie MediaWiki pour OmniAuth (également disponible sous forme de [https://rubygems.org/gems/omniauth-mediawiki gem]) === Rust === * [https://crates.io/crates/mediawiki MediaWiki crate] implémente les deux mécanismes de connexion OAuth1 et OAuth2. * [https://crates.io/crates/oauth2 oauth2 crate] === Node.js === * [https://www.npmjs.com/package/passport-mediawiki-oauth passport-mediawiki-oauth] – Stratégie MediaWiki pour l'environnement ''auth'' Passeport (utilisable sans effort comme middleware avec Express JS et les environnements similaires) * [https://www.npmjs.com/package/oauth-fetch-json oauth-fetch-json] – bibliothèque pour signer les requêtes OAuth * [https://www.npmjs.com/package/m3api-oauth2 m3api-oauth2] – an extension package for [https://www.npmjs.com/package/m3api m3api], making it easy to make requests authenticated via [[Special:MyLanguage/Help:OAuth|OAuth 2.0]] === Go === * [https://github.com/mrjones/oauth mrjones/oauth] (OAuth 1.0) * [https://pkg.go.dev/golang.org/x/oauth2 golang.org/x/oauth2] ([https://pkg.go.dev/golang.org/x/oauth2#example-Config exemple] OAuth 2.0) === Java === * [https://github.com/scribejava/scribejava ScribeJava] depuis la version 5.5.0 ([https://github.com/scribejava/scribejava/pull/852 requête ''pull'' de tirage]) <span id="Example_code"></span> == Exemple de code == <span id="PHP_client_without_using_any_libraries"></span> === Client PHP sans utiliser de bibliothèque === [[toollabs:oauth-hello-world|OAuth Hello World]] – application de démonstration facile à comprendre et écrite en PHP sans aucune bibliothèque. <span id="PHP_command-line_client_with_RSA_keys,_using_oauthclient-php"></span> === Client PHP en mode ligne de commande avec clés RSA et utilisant ''oauthclient-php'' === Application PHP qui utilise les classes de la base de code de l'extension OAuth. {{Todo|1=convertir ceci pour utiliser actuellement oauthclient-php ! probablement un ensemble de déclarations <code>use</code>.}} Avant de commencer : <syntaxhighlight lang="shell-session"> $ openssl genrsa -out appkey.pem 4096 $ openssl rsa -in appkey.pem -pubout > appkey.pub </syntaxhighlight> {{Collapse_top|title=code source PHP}} <syntaxhighlight lang="php"> <?php if ( PHP_SAPI !== 'cli' ) { die( "CLI-only test script\n" ); } /** * Un client de base pour les tests généraux */ function wfDebugLog( $method, $msg) { //echo "[$method] $msg\n"; } require 'OAuth.php'; require 'MWOAuthSignatureMethod.php'; $consumerKey = ''; #$consumerSecret = ''; // pas utile puisque nous utilisons RSA, sauf pour valider l'identité de l'appel $privateKey = file_get_contents( 'appkey.pem' ); $baseurl = 'http://<wiki>/wiki/Special:OAuth'; $endpoint_req = $baseurl . '/initiate?format=json&oauth_callback=oob'; // format=json rend le PHP un peu plus facile $endpoint_acc = $baseurl . '/token?format=json'; $endpoint_id = $baseurl . '/identify'; $c = new OAuthConsumer( $consumerKey, $privateKey ); // s'assurer de signer le titre et le format $parsed = parse_url( $endpoint_req ); $extraSignedParams = array(); parse_str($parsed['query'], $extraSignedParams); $extraSignedParams['title'] = 'Special:OAuth/initiate'; $init_req = OAuthRequest::from_consumer_and_token( $c, // OAuthConsumer pour votre application NULL, // Jeton utilisateur, NULL pour les appels à initier "GET", // méthode http $endpoint_req, // URL du point d'accès (c'est signé) $extraSignedParams // paramètres supplémentaires à signer (doit inclure le titre) ); $rsa_method = new MWOAuthSignatureMethod_RSA_SHA1( new OAuthDataStore(), $privateKey ); $init_req->sign_request( $rsa_method, // OAuthSignatureMethod $c, // OAuthConsumer de votre application NULL // Jeton utilisateur, NULL pour les appels à initier ); echo "Getting request token with: $init_req\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, (string) $init_req ); // Passer OAuth dans les paramètres du GET curl_setopt( $ch, CURLOPT_HTTPGET, true ); curl_setopt( $ch, CURLOPT_HEADER, false ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $requestToken = json_decode( $data ); print "Visit $baseurl/authorize?oauth_token={$requestToken->key}&oauth_consumer_key=$consumerKey\n"; // JETON D'ACCES print "Enter the verification code:\n"; $fh = fopen( "php://stdin", "r" ); $line = fgets( $fh ); $rc = new OAuthToken( $requestToken->key, $requestToken->secret ); $parsed = parse_url( $endpoint_acc ); parse_str($parsed['query'], $params); $params['oauth_verifier'] = trim($line); $params['title'] = 'Special:OAuth/token'; $acc_req = OAuthRequest::from_consumer_and_token( $c, $rc, "GET", $endpoint_acc, $params ); $acc_req->sign_request($rsa_method, $c, $rc); echo "Calling: $acc_req\n"; unset( $ch ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_acc ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $acc_req->to_header() ) ); // Initialiser l'entête de l'autorisation $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $acc = json_decode( $data ); $accessToken = new OAuthToken( $acc->key, $acc->secret ); /** * Appel non-sécurisé à l'API pour obtenir des informations sur l'utilisateur. * Un MITM peut falsifier une réponse du serveur, alors ne vous fiez pas à cela pour l'identité ! */ $apiurl = 'http://<wiki>/w/api.php'; $apiParams = array( 'action' => 'query', 'meta' => 'userinfo', 'uiprop' => 'rights', 'format' => 'json', ); $api_req = OAuthRequest::from_consumer_and_token( $c, // Consumer $accessToken, // User Access Token "GET", // HTTP Method $apiurl, // Endpoint url $apiParams // Extra signed parameters ); $api_req->sign_request( $rsa_method, $c, $accessToken ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $apiurl . "?" . http_build_query( $apiParams ) ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $api_req->to_header() ) ); // Entête d'autorisation nécessaire pour l'API $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; /** * Obtenir l'identité de l'utilisateur en toute sécurité */ $consumerSecret = ''; $extraSignedParams = array( 'title' => 'Special:OAuth/identify' ); $req = OAuthRequest::from_consumer_and_token( $c, $accessToken, "GET", $endpoint_id, $extraSignedParams ); $req->sign_request( $rsa_method, $c, $accessToken ); echo "Calling: '$endpoint_id'\nHeader: {$req->to_header()}\n\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_id ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $req->to_header() ) ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } $identity = JWT::decode( $data, $consumerSecret ); // Valider le JWT if ( !validateJWT( $identity, $consumerKey, $req->get_parameter( 'oauth_nonce' ) ) ) { print "The JWT did not validate"; } else { print "We got a valid JWT, describing the user as:\n"; print " * Username: {$identity->username}\n"; print " * User's current groups: " . implode( ',', $identity->groups ) . "\n"; print " * User's current rights: " . implode( ',', $identity->rights ) . "\n"; } /** * Valider un JWT, pour s'assurer que ce n'est pas une réponse, une parodie, etc. * @param $identity le JWT décodé * @param $consumerKey la clé de votre application * @param $nonce nonce envoyé avec votre requête et qui sera renvoyé */ function validateJWT( $identity, $consumerKey, $nonce ) { $expectedConnonicalServer = 'http://<wiki>'; // Vérifier que l'émetteur est celui que nous espérions (le serveur envoie $wgCanonicalServer) if ( $identity->iss !== $expectedConnonicalServer ) { print "Invalid Issuer"; return false; } // Vérifier que nous sommes le public prévu if ( $identity->aud !== $consumerKey ) { print "Invalid Audience"; return false; } // Vérifier que nous sommes dans le délai de validité du jeton. // émis le (iat) doit être dans le passé, // l'expiration (exp) doit être dans le futur. $now = time(); if ( $identity->iat > $now || $identity->exp < $now ) { print "Invalid Time"; return false; } // Vérifier que nous n'avons pas déjà vu ce nonce, ce qui indiquerait une attaque répétée if ( $identity->nonce !== $nonce ) { print "Invalid Nonce"; return false; } return true; } </syntaxhighlight> {{Collapse_bottom}} <span id="Python_command-line_client_using_mwoauth"></span> === Client Python en mode ligne de commande utilisant ''mwoauth'' === {{Collapse_top|title=code source Python}} <syntaxhighlight lang="python"> from mwoauth import ConsumerToken, Handshaker import requests from requests_oauthlib import OAuth1 from six.moves import input # Pour la compatibilité avec Python 2 et 3 # Construire un "consommateur" à partir de la clé/code secret fournis par MediaWiki import config # Vous devrez fournir ceci # # Créer un fichier config.py sur un chemin connu de Python (ex: le répertoire de ce script), avec le contenu suivant (sans les caractères # !) # consumer_key = "le jeton consommateur obtenu à l'enregistrement de l'application" # consumer_secret = "le jeton secret obtenu à l'enregistrement de votre application" # Par exemple : # consumer_key = "20bc67da5081a30c736340c493f60d14" # consumer_secret = "af4313371bb2fb38e81fe7d300080085f52849f9" consumer_token = ConsumerToken(config.consumer_key, config.consumer_secret) # Construire la confirmation avec l'URI du wiki et le consommateur handshaker = Handshaker("https://en.wikipedia.org/w/index.php", consumer_token) # Etape 1: initialisation -- demander à MediaWiki les clé/code secret temporaires pour l'utilisateur redirect, request_token = handshaker.initiate() # Etape 2: autorisation -- rediriger l'utilisateur sur MediaWiki pour confirmer l'autorisation print("Point your browser to: %s" % redirect) # response_qs = input("Response query string: ") # Etape 3: terminaison -- obtenir les clé/code secret autorisés pour le "propriétaire de la ressource" access_token = handshaker.complete(request_token, response_qs) # Construire un objet auth avec le consommateur et les jetons d'accès auth1 = OAuth1(consumer_token.key, client_secret=consumer_token.secret, resource_owner_key=access_token.key, resource_owner_secret=access_token.secret) # Accéder maintenant à l'API au nom de l'utilisateur print("Reading top 10 watchlist items") response = requests.get( "https://en.wikipedia.org/w/api.php", params={ 'action': "query", 'list': "watchlist", 'wllimit': 10, 'wlprop': "title|comment", 'format': "json" }, auth=auth1 ) for item in response.json()['query']['watchlist']: print("{title}\t{comment}".format(**item)) </syntaxhighlight> {{Collapse_bottom}} <span id="Python_Toolforge_tutorial_using_mwoauth"></span> === Tutoriel Python Toolforge utilisant ''mwoauth'' === Voir : [[wikitech:Help:Toolforge/My first Flask OAuth tool]] === Python Toolforge tutorial using authlib (OAuth 2.0) === {{Collapse_top|title=Python source code}} <syntaxhighlight lang="python"> # > requirements.txt # flask==3.1.3 # requests==2.33.1 # authlib==1.7.0 # > config.py OAUTH_ACCESS_TOKEN_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/access_token" OAUTH_API_BASE_URL = "https://commons.wikimedia.org/w/" OAUTH_AUTHORIZE_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/authorize" OAUTH_CODE_CHALLENGE_METHOD = "S256" OAUTH_CONSUMER_KEY = "Y" OAUTH_CONSUMER_SECRET = "Z" OAUTH_SCOPE = "basic editpage" # > app.py from authlib.integrations.flask_client import FlaskOAuth2App, OAuth from flask import Flask, jsonify, redirect, request, session from requests import Response app = Flask() app.config.from_pyfile("config.py") oauth = OAuth(app) oauth.register( name="mediawiki", client_id=app.config["OAUTH_CONSUMER_KEY"], client_secret=app.config["OAUTH_CONSUMER_SECRET"], client_kwargs={ "code_challenge_method": app.config["OAUTH_CODE_CHALLENGE_METHOD"], "scope": app.config["OAUTH_SCOPE"], }, api_base_url=app.config["OAUTH_API_BASE_URL"], access_token_url=app.config["OAUTH_ACCESS_TOKEN_URL"], authorize_url=app.config["OAUTH_AUTHORIZE_URL"], ) oauth_client: FlaskOAuth2App = oauth.create_client("mediawiki") @app.route("/") def index(): return app.send_static_file("index.html") @app.route("/login") def login(): return oauth_client.authorize_redirect() @app.route("/oauth-callback") def auth(): token = oauth_client.authorize_access_token() session["token"] = token return redirect("/") @app.route("/logout") def logout(): session.pop("token", None) session.clear() return redirect("/") @app.route("/user") def user(): response: Response = oauth_client.request( "GET", "rest.php/oauth2/resource/profile", token=session["token"], ) user = response.json() response.raise_for_status() return jsonify(user=user) @app.route("/edit", methods=["POST"]) def edit(): data = request.get_json() pageid = int(data["pageid"]) response: Response = oauth_client.request( "POST", "api.php", token=session["token"], data=dict( format="json", formatversion="2", action="query", pageids=str(pageid), prop="revisions|wbentityusage", rvprop="content", rvslots="*", meta="tokens", ), ) r = response.json() token = r["query"]["tokens"]["csrftoken"] ... </syntaxhighlight> {{Collapse_bottom}} <span id="Go_command-line_client_using_mrjones/auth_(OAuth_1.0)"></span> === Client Go en mode ligne de commande utilisant ''mrjones/auth'' (OAuth 1.0) === Avant de commencer : <syntaxhighlight lang="shell-session"> $ go get github.com/mrjones/oauth </syntaxhighlight> {{Collapse_top|title=code source Go}} <syntaxhighlight lang="go"> package main import ( "fmt" "os" "github.com/mrjones/oauth" "io/ioutil" "strconv" ) func main() { var consumerKey string = "" var consumerSecret string = "" if len(consumerKey) == 0 || len(consumerSecret) == 0 { os.Exit(1) } c := oauth.NewConsumer( consumerKey, consumerSecret, oauth.ServiceProvider{ RequestTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/initiate", AuthorizeTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/authorize", AccessTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/token", }) c.Debug(true) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/initiate", } c.AdditionalAuthorizationUrlParams = map[string]string{ "oauth_consumer_key": consumerKey, } requestToken, url, err := c.GetRequestTokenAndUrl("oob") if err != nil { fmt.Println( err ) } fmt.Println( "Got token " + requestToken.Token ) fmt.Println("(1) Go to: " + url) fmt.Println("(2) Grant access, you should get back a verification code.") fmt.Println("(3) Enter that verification code here: ") verificationCode := "" fmt.Scanln(&verificationCode) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/token", } accessToken, err := c.AuthorizeToken(requestToken, verificationCode) if err != nil { fmt.Println(err) } fmt.Println( "Got access token " + accessToken.Token ) c.AdditionalParams = map[string]string{} response, err := c.Get( "http://<wiki>/wiki/api.php", map[string]string{ "action": "query", "meta": "userinfo", "uiprop": "rights", "format": "json", }, accessToken) if err != nil { fmt.Println(err) } fmt.Println( "\tResponse Status: '" + response.Status + "'\n" ) fmt.Println( "\tResponse Code: " + strconv.Itoa(response.StatusCode) + "\n" ) bytes, _ := ioutil.ReadAll(response.Body) fmt.Println( "\tResponse Body: " + string(bytes) + "\n" ) } </syntaxhighlight> {{Collapse_bottom}} <span id="JavaScript_applications_using_OAuth_2"></span> === Applications JavaScript utilisant OAuth 2 === * [https://github.com/wikimedia/apiclient-wiki wikimedia/apiclient-wiki] – application entière sur 520 lignes de code <span id="Full_applications_using_OAuth"></span> === Applications complètes utilisant OAuth === * [https://github.com/jdlrobson/weekipedia/blob/master/libs/server/app.js Weekipedia], un port ''React.js'' à pleine échelle du site mobile Wikipedia utilise les deux. * <span class="mw-translate-fuzzy">Répertoire des [[toollabs:hay/directory/|outils Toolforge]]</span> <span id="Notes"></span> == Notes == <references /> k1tetaidanrab7dwwl2lbuwdzr73u0d Extension:NoTOC/tr 102 1167294 8365107 5910915 2026-05-04T10:21:22Z FuzzyBot 451990 Updating to match new version of source page 8365107 wikitext text/x-wiki <languages /> {{Unmaintained extension|alternative={{ll|Extension:NoTOCModern}}}} {{Extension code in wiki}} {{Extension |status = unmaintained |type1 = parser |type2 = |hook1 = ParserClearState |hook2 = |username = Frantik |author = Andrew Fitzgerald |description = Tüm sayfalarda varsayılan olarak İçindekiler özelliğini kapatır |image = |imagesize = |version = 0.1.1 |update = 2013-12-11 |mediawiki = |php = |license = GPL-2.0-or-later |download = [[#Code|Kod bölümüne]] bakın |needs-updatephp = No |readme = |changelog = |parameters = |tags = |rights = |example = |compatibility = }} '''NoTOC''' uzantısı varsayılan olarak içindekiler tablosunu gizler. <nowiki>__TOC__</nowiki> sihirli kelimesi hala normal olarak kullanılabilir. <span id="Installation"></span> == Kurulum == {{ExtensionInstall |download-link=[[#Code|Kodu dosyalara kopyalayın]] }} <span id="Code"></span> == Kod == ;NoTOC.php <syntaxhighlight lang="php"> <?php /** * NoTOC extension - Turns off the Table of Contents (TOC) by default on all pages * @version 0.1.1 - 2013/12/11 * * @link https://www.mediawiki.org/wiki/Extension:NoTOC Documentation * @link https://www.mediawiki.org/wiki/Extension_talk:NoTOC Support * * @ingroup Extensions * @package MediaWiki * @author Andrew Fitzgerald (Frantik) * @author Karsten Hoffmeyer (Kghbln) * @copyright (C) 2010 Andrew Fitzgerald * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ // check the call if ( !defined( 'MEDIAWIKI' ) ) { die( 'This file is a MediaWiki extension and thus not a valid entry point.' ); } // provide information $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'NoTOC', 'author' => array( 'Andrew Fitzgerald', '...' ), 'url' => 'https://www.mediawiki.org/wiki/Extension:NoTOC', 'descriptionmsg' => 'notoc-desc', 'version' => '0.1.1' ); // show way to files $wgExtensionMessagesFiles['NoTOC'] = dirname( __FILE__ ) . '/NoTOC.i18n.php'; // register hooks $wgHooks['ParserClearState'][] = 'efMWNoTOC'; // perform purpose function efMWNoTOC($parser) { $parser->mShowToc = false; return true; } </syntaxhighlight> ;NoTOC.i18n.php <syntaxhighlight lang="php"> <?php /** * Internationalization file for the NoTOC extension. * * @licence GNU GPL v2+ * @author Karsten Hoffmeyer (Kghbln) */ $messages = array(); /** English * @author Frantik * @author Kghbln */ $messages['en'] = array( 'notoc-desc' => 'Turns off the Table of Contents (TOC) by default on all pages', ); /** Message documentation (Message documentation) * @author Kghbln */ $messages['qqq'] = array( 'notoc-desc' => '{{desc|name=NoTOC|url=https://www.mediawiki.org/wiki/Extension:NoTOC}}', ); /** German (Deutsch) * @author Kghbln */ $messages['de'] = array( 'notoc-desc' => 'Unterdrückt die automatische Generierung des Inhaltsverzeichnisses', ); </syntaxhighlight> <span id="See_also"></span> == Ayrıca bakınız == * {{ll|Extension:ForceTocOnEveryPage}} * {{ll|Extension:DeToc}} - Bu, TOC HTML'yi çıkarmak ve onu kaldırmak veya sayfanın başka bir bölümüne koymak için kullanılabilir. [[Category:TOC extensions{{#translation:}}]] ebf9q8rh6lvuchgvig64q10jko9bmjk Extension:TimedMediaHandler/VideoJS Player/pt-br 102 1173172 8364365 8363693 2026-05-03T13:12:18Z FuzzyBot 451990 Updating to match new version of source page 8364365 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Captura de tela do novo reprodutor em ação]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> É baseado no [https://videojs.com/ VideoJS], e possui uma interface de usuário mais moderno e rápido, com compatibilidade para dispositivos móveis e HTML5. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Exemplo do reprodutor de vídeo]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using tab, enter and spacebar keys</span> <span id="Known_issues"></span> == Problemas conhecidos == O reprodutor de vídeo ainda está em desenvolvimento, mas se você encontrar algum problema, relate-o na [[Extension_talk:TimedMediaHandler/VideoJS Player|página de discussão]] ou arquive-o no [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 4wwulgwtjui6urahwzcihwba4l268io 8364781 8364365 2026-05-03T23:14:43Z FuzzyBot 451990 Updating to match new version of source page 8364781 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Captura de tela do novo reprodutor em ação]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> É baseado no [https://videojs.com/ VideoJS], e possui uma interface de usuário mais moderno e rápido, com compatibilidade para dispositivos móveis e HTML5. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Exemplo do reprodutor de vídeo]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</span> <span id="Known_issues"></span> == Problemas conhecidos == O reprodutor de vídeo ainda está em desenvolvimento, mas se você encontrar algum problema, relate-o na [[Extension_talk:TimedMediaHandler/VideoJS Player|página de discussão]] ou arquive-o no [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> pwel66ew3cd593wajfdxvebqmdo4yq2 Template:Update/doc 10 1176123 8364862 8364199 2026-05-04T03:38:30Z Eduardogobi 1145661 +pt-br 8364862 wikitext text/x-wiki <templatedata> { "params": { "2": { "label": { "cs": "Poslední aktualizace", "en": "Last update", "pt-br": "Última atualização" }, "description": { "en": "Date when the page was last updated.", "cs": "Datum, kdy byla stránka naposledy aktualizována.", "pt-br": "Data da última atualização da página." }, "type": "line" }, "part": { "aliases": [ "1" ], "label": { "en": "Outdated parts", "cs": "Zastaralé části", "pt-br": "Partes desatualizadas" }, "description": { "en": "Textual description of what parts are outdated.", "cs": "Textový popis toho, které části jsou zastaralé.", "pt-br": "Descrição textual de quais partes estão desatualizadas." }, "example": { "en": "installing MediaWiki on Windows 95 systems", "cs": "instalace MediaWiki v systémech Windows 95", "pt-br": "instalar o MediaWiki no Windows 95" } }, "inaccurate": { "label": { "en": "Inaccurate", "cs": "Nepřesné", "pt-br": "Imprecisões" }, "description": { "en": "If it has any non-blank value, it means that the page is not only outdated, but also inaccurate.", "cs": "Pokud má nějakou neprázdnou hodnotu, znamená to, že stránka je nejen zastaralá, ale také nepřesná.", "pt-br": "Se preenchido, significa que a página não somente está desatualizada como também imprecisa." }, "type": "line" }, "reason": { "label": { "en": "Reason", "cs": "Důvod", "pt-br": "Motivo" }, "description": { "en": "Reason why the page is outdated.", "cs": "Důvod, proč je stránka zastaralá.", "pt-br": "Motivo da página estar desatualizada." }, "default": { "en": "It was written for an older version of MediaWiki and may not apply to the most recent version.", "pt-br": "A página foi escrita para uma versão antiga do MediaWiki, e pode não ser aplicável à versão mais recente." } }, "date": { "label": { "en": "Tag date", "cs": "Datum označení", "pt-br": "Data da marcação" }, "description": { "en": "Date when the page was tagged as outdated.", "cs": "Datum, kdy byla stránka označena jako zastaralá.", "pt-br": "Data de marcação da página como desatualizada." }, "type": "line" } } } </templatedata> 8nh53l94qxkxzuibifjam0tjkggz0md Template:Update/sv 10 1177883 8364334 8364254 2026-05-03T12:47:09Z FuzzyBot 451990 Updating to match new version of source page 8364334 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |<span lang="en" dir="ltr" class="mw-content-ltr">The '''factual accuracy''' of parts of this page (those related to {{{part|{{{1|}}}}}}) '''may be compromised due to out-of-date information'''.</span> |Delar av den här sidan (de som relaterar till {{{part|{{{1|}}}}}}) är '''föråldrade'''.}} |{{#if:{{{inaccurate|}}} |<span lang="en" dir="ltr" class="mw-content-ltr">The '''factual accuracy''' of this page '''may be compromised due to out-of-date information'''.</span> |Denna sida är '''inte uppdaterad'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|Den skrevs för en äldre version av MediaWiki och kanske inte gäller för den senaste versionen.}} Har du kontrollerat eller uppdaterat den här sidan och funnit att innehållet är acceptabelt kan du ta bort den här notisen. {{#ifexist: {{TALKPAGENAME}} |&#32;Se [[{{TALKPAGENAME}}|diskussionssidan]] för en potentiell diskussion om det här. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Senast uppdaterad: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= Mallens alias: * {{tlx|outdated}} <span id="Examples"></span> == Exempel == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == Se även == * {{tl|historical}} <span id="TemplateData"></span> == MallData == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> oqxdicryac2awvt547s5d0c668ze4e2 Translations:Help:Subpages/26/pt-br 1198 1180629 8364534 4032714 2026-05-03T16:59:14Z Nerun 899342 8364534 wikitext text/x-wiki Você pode passar parâmetros para isso, por exemplo, $1 9zcs0iugu9u806o1ukfqlc22v6f5pf5 Extension:TimedMediaHandler/VideoJS Player/sv 102 1181446 8364367 8363696 2026-05-03T13:12:20Z FuzzyBot 451990 Updating to match new version of source page 8364367 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Skärmdump på när den nya spelaren används]] '''VideoJS Player''' är videospelaren för MediaWiki på Wikimedias projekt. Den baseras på [https://videojs.com/ VideoJS], och har ett modernt, snabbt gränssnitt med stöd för mobila enheter och HTML5. <span id="Usage"></span> == Användning == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Exempelspelare]] [[File:Armstrong Small Step.ogg|thumb|Exempelljudspelare]] Det finns både en ljud- och videospelare. Det finns exempel på båda spelarna på den här sidan. När den startats får man se en kontrollruta när man interagerar med videon. [[File:VideoJS controlbar.png|frameless|350px]] Kontrollerna från vänster till höger är: <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;Spela/pausa * [[File:VideoJS volume control.png|30px|]]&nbsp;Volym * Uppspelning * Kvarvarande speltid * [[File:VideoJS subtitle control.png|30px|]]&nbsp;Språkväljare och stilalternativ för undertexter * [[File:VideoJS resolution control.png|30px|]]&nbsp;Upplösning * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;Valfri bild-i-bild * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;Helskärm * [[File:VideoJS file description control.png|30px|]]&nbsp;Informationsknapp som tar dig till filsidan <span id="Mouse_and_keyboard_controls"></span> === Mus- och tangentbordskontroll === * Klicka på ikonen för att spela ovanför miniatyren för att spela upp mediefilen. * Högerklicka eller mellanklicka på förhandsvisningen för att öppna filsidan * Spela/pausa spelare genom att klicka med musen inuti spelarens fönster * Dubbelklicka inuti spelarfönstret för att öppna eller stänga helskärmsläge * Följande tangentbordsgenvägar finns: *; {{Key press|k}} / {{Key press|Space}} : Spela/pausa uppspelning av media *; {{Key press|f}} : Öppna/stänga helskärmsläge *; {{Key press|m}} : Stänga av ljudet *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * Spelaren kan helt styras från tangentbordet med tangenterna tab, enter och mellanslag <span id="Known_issues"></span> == Kända problem == Videospelaren utvecklas fortfarande, men om du upplever några problem, får du gärna rapportera dem på [[Extension_talk:TimedMediaHandler/VideoJS Player|diskussionssidan]] eller skicka in dem till [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. <span id="Developers"></span> == Utvecklare == <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> n5zd8neyf2uzfim0g5bc77ot2npu33b 8364784 8364367 2026-05-03T23:14:44Z FuzzyBot 451990 Updating to match new version of source page 8364784 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Skärmdump på när den nya spelaren används]] '''VideoJS Player''' är videospelaren för MediaWiki på Wikimedias projekt. Den baseras på [https://videojs.com/ VideoJS], och har ett modernt, snabbt gränssnitt med stöd för mobila enheter och HTML5. <span id="Usage"></span> == Användning == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Exempelspelare]] [[File:Armstrong Small Step.ogg|thumb|Exempelljudspelare]] Det finns både en ljud- och videospelare. Det finns exempel på båda spelarna på den här sidan. När den startats får man se en kontrollruta när man interagerar med videon. [[File:VideoJS controlbar.png|frameless|350px]] Kontrollerna från vänster till höger är: <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;Spela/pausa * [[File:VideoJS volume control.png|30px|]]&nbsp;Volym * Uppspelning * Kvarvarande speltid * [[File:VideoJS subtitle control.png|30px|]]&nbsp;Språkväljare och stilalternativ för undertexter * [[File:VideoJS resolution control.png|30px|]]&nbsp;Upplösning * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;Valfri bild-i-bild * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;Helskärm * [[File:VideoJS file description control.png|30px|]]&nbsp;Informationsknapp som tar dig till filsidan <span id="Mouse_and_keyboard_controls"></span> === Mus- och tangentbordskontroll === * Klicka på ikonen för att spela ovanför miniatyren för att spela upp mediefilen. * Högerklicka eller mellanklicka på förhandsvisningen för att öppna filsidan * Spela/pausa spelare genom att klicka med musen inuti spelarens fönster * Dubbelklicka inuti spelarfönstret för att öppna eller stänga helskärmsläge * Följande tangentbordsgenvägar finns: *; {{Key press|k}} / {{Key press|Space}} : Spela/pausa uppspelning av media *; {{Key press|f}} : Öppna/stänga helskärmsläge *; {{Key press|m}} : Stänga av ljudet *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * Spelaren kan helt styras från tangentbordet med tangenterna tab, enter och mellanslag <span id="Known_issues"></span> == Kända problem == Videospelaren utvecklas fortfarande, men om du upplever några problem, får du gärna rapportera dem på [[Extension_talk:TimedMediaHandler/VideoJS Player|diskussionssidan]] eller skicka in dem till [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. <span id="Developers"></span> == Utvecklare == <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> myfopppky3b7mxg3gh86oamvjnbyqmw Extension:PageTriage/tr 102 1188850 8365073 8157895 2026-05-04T07:51:37Z FuzzyBot 451990 Updating to match new version of source page 8365073 wikitext text/x-wiki <languages /> {{Extension |templatemode = |status = stable |type1 = special |type2 = interface |newhook1 = |newhook2 = |username = |author = [[User:Kaldari|Ryan Kaldari]], [[User:Bsitu|Benny Situ]] |description = Yeni sayfaların incelenmesini ve onaylanmasını kolaylaştırır |image = Extension-PageTriage Special-NewPagesFeed Screenshot.png |imagesize = 300 |version = |update = |version preview = |update preview = |compatibility policy = rel |mediawiki = |php = |composer = |table1 = pagetriage_page |table2 = pagetriage_page_tags |table3 = pagetriage_tags |download = {{WikimediaDownload|phab=EPTR}} |readme = |changelog = |example = [[wikipedia:Special:NewPagesFeed | Special:NewPagesFeed on the English Wikipedia]] |namespace = |tags = |compatibility = |bugzilla = |phabricator = PageTriage |vagrant-role = }} '''PageTriage''', yeni oluşturulan maddelerin önceliklendirilmesi için zengin özelliklere sahip bir arayüz sağlamayı amaçlayan bir uzantıdır. Yeni maddeleri incelemek, etiketlemek ve geliştirmek için ek işlevler eklerken "yeni sayfa devriyesi" temel işlevinin yerini alması amaçlanmıştır. <span class="mw-translate-fuzzy">Bir [[Special:NewPagesFeed]] sayfası ve "patrol" iznine sahip olanlar için yeni sayfalara bir sayfa iyileştirme araç çubuğu ekler.</span> Wikimedia Vakfı'nın [[Wikimedia_Features_engineering|Özellik Mühendislik ekibi]] tarafından geliştirilmiştir. Ek ayrıntılar için ''[[Page Curation|Page Curation]]'' sayfasına bakın. Önemli bir not, yapılandırma ve kodun bir kısmının İngilizce Vikipedi'nin iş akışlarına özgü olduğu ve şu anda kurulduğu için uzantının uluslararasılaşmasının neredeyse imkansız olduğudur. ([[Phabricator:T50552]] sayfasına bakın.) [[File:Page-Curation-Video.ogv|thumb|An overview of the page curation feature. The interface in the video is outdated but the content remains useful.]] <span id="Installation"></span> <div class="mw-translate-fuzzy"> === Kurulum === </div> [[File:PageTriage-ListView-Whole.png|thumb|Screenshot of Special:NewPagesFeed as it appeared in 2012]] {{ExtensionInstall |db-update=yes |registration=required |localsettings= }} == Checking for successful install == Uzantının gerçekten çalıştığını görmek için: <div class="mw-translate-fuzzy"> * Anonim bir kullanıcı olarak yeni bir taslak sayfası ekleyin. </div> <div class="mw-translate-fuzzy"> * [[Special:NewPagesFeed]] sayfasını ziyaret edin </div> Yeni sayfa "{{int|pagetriage-no-categories}}", "{{int|pagetriage-orphan}}" vb. olarak işaretlenmiş şekilde görünmelidir. Sayfa iyileştirme araç çubuğunu görmek için: * "sysop" iznine sahip bir kullanıcı olarak oturum açın veya "[[Special:MyLanguage/Help:Patrolled_edits|patrol]]" iznine sahip bir grup ekleyin ve bu gruba bir kullanıcı ekleyin ve bu kullanıcı olarak oturum açın. <div class="mw-translate-fuzzy"> * [[Special:NewPagesFeed]] sayfasını ziyaret edin </div> * Şimdi yeni sayfanın yanında bir "{{int|pagetriage-triage}}" düğmesi görmelisiniz. * Bunu tıklayın ve yeni sayfada sayfa iyileştirme araç çubuğunu görmelisiniz. <div lang="en" dir="ltr" class="mw-content-ltr"> == Advanced installation == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Additional extensions === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For full functionality, you'll also need to install some additional extensions, although PageTriage works without them. </div> * {{ll|Extension:Echo|Echo}} - Allows users to receive notifications for things like when an article they created has been marked as reviewed. * {{ll|Extension:ORES|ORES}} - In Special:NewPagesFeed, allows filtering by "predicted class" (<code>articlequality</code>: stub, start, c-class, b-class, good, featured) and "potential issues" (<code>draftquality</code>: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because <code>draftquality</code> needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's [[git:mediawiki/extensions/ORES/+/8bd39f26548d58fa8bf6765e1c23f5e3086f1cd4/extension.json#225|extension.json file]]. * {{ll|Extension:WikiLove|WikiLove}} - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily. === Enabling draft namespace === By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php <syntaxhighlight lang="php" copy> // These three settings are optional, and will enable the Articles-for-Creation mode. $wgPageTriageDraftNamespaceId = 118; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft'; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk'; </syntaxhighlight> When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed. By default pages edited in the draft namespace will be "unsubmitted". Articles in the draft namespace can be submitted for review by adding <nowiki>[[Category:Pending_AfC_submissions]]</nowiki> to the draft page. At which point they will show up under "awaiting review". Note the toolbar controlled by the configuration variable '''$wgPageTriageEnableCurationToolbar''' does not show up in the draft namespace. === Cron jobs === To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: <code>cron/updatePageTriageQueue.php</code> == Manual testing == === Special:NewPagesFeed -> Articles for Creation === * Enable draftspace by following the directions above in the section [[#Enabling draft namespace]]. * In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories: ** Unsubmitted: (no category) ** Awaiting review: Category:Pending AfC submissions ** Under review: Category:Pending AfC submissions being reviewed now ** Declined: Category:Declined AfC submissions Note: The Page Curation toolbar does not display for drafts. === ORES === Enwiki has the [[Extension:ORES|ORES extension]] installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure: * Clone Extension:ORES and add <code>wfLoadExtension( 'ORES' );</code> in <code>LocalSettings.php</code> * Add this to <code>LocalSettings.php</code> <syntaxhighlight lang="php" copy> $wgPageTriageEnableOresFilters = true; $wgOresWikiId = 'enwiki'; $wgOresModels = [ 'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ], 'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'sources' => [ 1 ] ] ]; </syntaxhighlight> * Run <code>php maintenance/run.php ./extensions/ORES/maintenance/BackfillPageTriageQueue.php</code> == Determining if a page is reviewed == === Status codes === There are status codes used to track whether a page is reviewed or not. These are the values given when you query <code>patrol_status</code>, <code>ptrp_reviewed</code>, and <code>ptrl_reviewed</code>: * Unreviewed ** 0 - unreviewed * Reviewed ** 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar) ** 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page) ** 3 - autopatrolled (someone with the <code>autopatrol</code> user right created the page, or moved the page from a non-tracked namespace to a tracked namespace) ** no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job) === Via the API === To check the review status of pages using an API query, you can use <code>api.php?action=query&prop=isreviewed</code>. Sample JavaScript code:<syntaxhighlight lang="js" copy> /** * @param {number} pageID The page ID number. A positive number with no commas. */ async isReviewed(pageID) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', pageids: pageID, } ); return response.query.pages[0].isreviewed; } /** * @param {string} title One title. Can include namespace. Example: User:Test */ async function isReviewed(title) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', titles: title, } ); return response.query.pages[0].isreviewed; } </syntaxhighlight> === Via SQL === To check the review status of pages using an SQL query, you need to query the <code>{{ll|Extension:PageTriage/pagetriage page table|pagetriage_page}}</code> table and the <code>ptrp_reviewed</code> field. Follow the directions in [[#Status codes]] to interpret the values of this field. <syntaxhighlight lang="sql" copy> /* By page_id */ SELECT ptrp_reviewed FROM pagetriage_page WHERE ptrp_page_id = 71318376 /* By page_title and page_namespace */ SELECT ptrp_reviewed FROM pagetriage_page JOIN page ON page_id = ptrp_page_id WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces AND page_namespace = 0 </syntaxhighlight> == SQL == === SQL tables === {| class="wikitable" |+ !Name !Prefix !Description !Old entry deletion strategy !Service classes (when refactoring, SQL queries should be moved to here) !Data classes |- |[[Extension:PageTriage/pagetriage page table|pagetriage_page]] |ptrp_ |The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query <code>ptrp_reviewed > 0</code> in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. |All articles deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. |QueueManager, QueueLookup |QueueRecord |- |[[Extension:PageTriage/pagetriage page tags table|pagetriage_page_tags]] |ptrpt_ |Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the <code>pagetriage_tags</code> table. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. |All article metadata deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status. | | |- |[[Extension:PageTriage/pagetriage tags table|pagetriage_tags]] |ptrt_ |A dictionary of page_tags, and their corresponding ID number. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. | | | |} === pagetriage_page_tags === <code>pagetriage_page_tags</code> data is updated by calling <code>ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata()</code>. This is called in the following hooks: * <code>onPageMoveComplete()</code> - runs when moving a page * <code>onLinksUpdateComplete()</code> - runs when saving an edit * <code>onMarkPatrolledComplete()</code> - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user. ==== List of tags ==== The <code>pagetriage_page_tags</code> are as follows: * Author information ** user_id ** user_name - there's a filter where you can type in their username ** user_editcount ** user_creation_date ** user_autoconfirmed ** user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with <code>MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()</code> ** user_bot ** user_block_status * Deletion tags - will display a black trash can icon if marked for deletion ** afd_status ** blp_prod_status ** csd_status ** prod_status * Special:NewPagesFeed red warning text ** category_count - No categories ** linkcount - Orphan ** reference - No citations ** recreated - Previously deleted ** user_block_status - Blocked * Page information ** page_len - size of article, in bytes ** rev_count - number of edits to the article ** snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article * afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined * copyvio - latest revision ID that has been tagged as a likely copyright violation, if any == PHP == <span id="Extension_configuration"></span> === Uzantı yapılandırması === Uzantı, 'patrol' hakkına dayanmaktadır. Devriye gezintisini yapılandırma hakkında daha fazla bilgi için, bkz. {{ll|Manual:Patrolling}} sayfasına bakın. Aşağıdaki yapılandırma değişkenleri LocalSettings.php dosyanızdan ayarlanabilir: {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">Variable</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Default</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> |- | {{phpi|$wgPageTriageEnableCurationToolbar}} | {{phpi|true}} | [[Special:MyLanguage/Page Curation#User Experience: Curation Toolbar|İyileştirme araç çubuğunu]] devre dışı bırakmak için false olarak ayarlayın (varsayılan true) |- | {{phpi|$wgPageTriageInfiniteScrolling}} | {{phpi|true}} | Yeni sayfa beslemesinde sonsuz kaydırmanın kullanılıp kullanılmayacağı (varsayılan true) |- | {{phpi|$wgPageTriageMaxAge}} |90 | The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true). |- | {{phpi|$wgPageTriageNamespaces}} |NS_MAIN | The namespaces that PageTriage is active in. |- | {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} | {{phpi|false}} | Yeni, incelenmemiş maddelerin noindex olarak ayarlanması gerekiyorsa bunu true olarak ayarlayın. Diğer bir deyişle, incelenene kadar arama motorları tarafından indekslenmemeleri gerekiyor. (varsayılan false) |} Yapılandırma değişkenlerinin tam listesi için [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/extension.json#698|extension.json]] sayfasına bakın. === API === PageTriage, kullanılabilecek aşağıdaki API uç noktalarını ekler: {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">API</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Triggering action</span> |- |pagetriageaction | <span lang="en" dir="ltr" class="mw-content-ltr">Mark a page as reviewed or unreviewed, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to mark a page as reviewed * Using the Page Curation toolbar to mark a page as unreviewed |- |pagetriagelist | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves the list of pages in the queue, and each page's metadata, including their reviewed status.</span> To retrieve one page, you must provide the <code>page_id</code>. To provide multiple pages, you must select one of <code>showreviewed</code>/<code>showunreviewed</code>, and one of <code>showredirs</code>/<code>showdeleted</code>/<code>showothers</code>, or no pages will be returned. |Read | * Loading the Page Curation toolbar (automatically loaded if you have the <code>patrol</code> userright and view a page that is unpatrolled or recently patrolled) * Viewing Special:NewPagesFeed (provides the list of articles) |- |pagetriagestats | <span class="mw-translate-fuzzy">Sıradaki sayfaların sayısı ve en iyi yorumcularla ilgili istatistikleri alır</span> |Read | * Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer) |- |pagetriagetagcopyvio |Mark an article as a potential copyright violation, and logs the action in Special:Log. |Write | * Marking as a copyright violation by a bot with the <code>copyviobot</code> userright |- |pagetriagetagging | <span lang="en" dir="ltr" class="mw-content-ltr">Add clean-up tags or deletion templates to a page, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to place a maintenance tag on an article * Using the Page Curation toolbar to place a deletion tag on an article |} === Special:Log === The following logs are created by the extension: {| class="wikitable" |+ !Special:Log !<code>log_type</code> !<code>log_action</code> !Description !Notes |- |Page curation log |pagetriage-curation |delete, enqueue, reviewed, tag, unreviewed |Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed | |- |Potential copyright violation log |pagetriage-copyvio |insert |Allows a bot to log potential copyright violations |Doesn't display unless you set {{phpi|$wgPageTriageEnableCopyvio}} to true |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Entry points === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The extension's features can be triggered by various actions: </div> {| class="wikitable" |+ !Entry point type !File location !Notes |- |5 APIs |includes/Api/* | |- |1 special page |includes/SpecialNewPagesFeed.php | |- |20 hooks | * includes/Hooks.php * includes/HookHandlers/UndeleteHookHandler.php * includes/HookHandlers/Schema.php | |- |1 cron job |cron/updatePageTriageQueue.php |runs every 48 hours |- |7 maintenance scripts |maintenance/* |need to be run manually |} Here is a list of some actions and the corresponding entry points they trigger: {| class="wikitable" |+ !Action !Entry points used |- |View Main page | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() |- |Save an edit to the Main page | * Hooks.php -> onRevisionFromEditComplete() * Hooks.php -> onPageSaveComplete() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onLinksUpdateComplete() |- |Type in search box, triggering search suggestions | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onApiMain__moduleManager() |- |View Special:NewPagesFeed | * Hooks.php -> onBeforeCreateEchoEvent() * SpecialNewPagesFeed * ApiPageTriageStats * ApiPageTriageList |- |View an unreviewed article while logged in and having the <code>patrol</code> permission. | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onResourceLoaderGetConfigVars() * Hooks.php -> onDefinedTags() * Hooks.php -> onApiMain__moduleManager() * ApiPageTriageList (by <code>page_id</code>) |} ==== Hooks ==== {| class="wikitable" |+ !File !Group !Hook !Actions it performs |- | rowspan="18" |Hooks.php |Move page |[[Manual:Hooks/PageMoveComplete|onPageMoveComplete]] |Changes patrolled status, updates cache, updates metadata in <code>pagetriage_page_tags</code> table. |- | rowspan="3" |Edit page |[[Manual:Hooks/RevisionFromEditComplete|onRevisionFromEditComplete]] |Handles marking '''redirects that flip to articles''' as unreviewed. [[Deferred updates|DeferredUpdate]]. |- |[[Manual:Hooks/PageSaveComplete|onPageSaveComplete]] |Add '''new articles''' to the New Pages Feed and <code>pagetriage_page</code> table. |- |[[Manual:Hooks/LinksUpdateComplete|onLinksUpdateComplete]] |[[Deferred updates|DeferredUpdate]] of metadata / <code>pagetriage_page_tags</code> table. |- |Every page load |[[Manual:Hooks/ArticleViewFooter|onArticleViewFooter]] | * Turn on '''noindex''' for new, unreviewed articles. * Determine whether to load a '''link for autopatrolled users to unpatrol''' their article * Displays the '''Page Curation toolbar''' on recently created pages. * Create '''"Add to New Pages Feed" toolbox link''' for old articles. |- |[[Help:Patrolled edits]] |[[Manual:Hooks/MarkPatrolledComplete|onMarkPatrolledComplete]] |Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage. |- | rowspan="2" |Blocking and unblocking |[[Manual:Hooks/BlockIpComplete|onBlockIpComplete]] | rowspan="2" |Update article metadata / <code>pagetriage_page_tags</code> when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users. |- |[[Manual:Hooks/UnblockUserComplete|onUnblockUserComplete]] |- | |[[Manual:Hooks/ResourceLoaderGetConfigVars|onResourceLoaderGetConfigVars]] |Adjusts some config vars related to draft namespace ID. |- | rowspan="3" |[[Extension:Echo]] |[[Manual:Hooks/BeforeCreateEchoEvent|onBeforeCreateEchoEvent]] | rowspan="3" |Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed. |- |[[Manual:Hooks/EchoGetDefaultNotifiedUsers|onEchoGetDefaultNotifiedUsers]] |- |[[Manual:Hooks/LocalUserCreated|onLocalUserCreated]] |- |[[Extension:ORES]] |[[Manual:Hooks/ORESCheckModels|onORESCheckModels]] |Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio. |- | rowspan="3" |[[Help:Tags]] |[[Manual:Hooks/ListDefinedTags|onListDefinedTags]] | rowspan="3" |Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage". |- |[[Manual:Hooks/ChangeTagsAllowedAdd|onChangeTagsAllowedAdd]] |- |[[Manual:Hooks/ChangeTagsListActive|onChangeTagsListActive]] |- |API |[[Manual:Hooks/ApiMain::moduleManager|onApiMain__moduleManager]] |Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings. |- | rowspan="2" |Delete or undelete page |[[Manual:Hooks/PageDeleteComplete|onPageDeleteComplete]] |If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache. |- |HookHandlers/ UndeleteHookHandler.php |[[Manual:Hooks/ArticleUndelete|onArticleUndelete]] |If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed. |- |HookHandlers/ Schema.php |SQL |[[Manual:Hooks/LoadExtensionSchemaUpdates|onLoadExtensionSchemaUpdates]] | * The code that installs PageTriage's 4 SQL tables when you run <code>php maintenance/run.php update</code>. * Will also alter schemas from previous versions to match the latest schema. * This is also where all the '''pagetriage_tags''' are hard-coded. |} ==== Cron jobs and maintenance scripts ==== {| class="wikitable" |+ !File !What it does !Why run it? When is it useful? ![[phab:T341431|Safe to delete maintenance script?]] |- |cron/updatePageTriageQueue.php |Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". |Keeps the SQL tables from getting too big. | |- |maintenance/cleanupPageTriage.php |Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. |Fix a bug? [[phab:T321982|T321982]] | |- |maintenance/cleanupPageTriageLog.php |Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log |One time conversion of old log entries to modern format? Logs are now always written in the new format. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/6d9105c020c62d648a4ef6be957297bbc8a6d7d2]. |Probably |- |maintenance/cleanupPageTriagePageTags.php |Remove page from <code>pagetriage_page_tags</code> if they are not in <code>pagetriage_page</code> |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/00a752368e00e0d8b29a4908bfc3bab3096268dd]. |Probably |- |maintenance/DeleteAfcStates.php |Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ab2d8d4a2f9d0f4ff981afaee35a85f33edb5e99]. [[phab:T203184#4592953|T203184#4592953]]. |Probably |- |maintenance/FixNominatedForDeletion.php |Set <code>pagetriage_page.ptrp_deleted</code> if the page is has any <code>pagetriage_page_tags</code> related to deletion (e.g. prod_status, blp_prod_status, etc.) |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ff0c433226300aeba692089b5389435d47feef1e]. [[phab:T202582|T202582]]. |Probably |- |maintenance/populateDraftQueue.php |Add missing Draft namespace pages to the AfC triage queue. |Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/59e1fedffcdafc46722d7231011aee194db9ee08]. | |- |maintenance/updateUserMetadata.php |Former cron job. Update expired user metadata in the <code>pagetriage_page_tags</code> table |[https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/92a675a5f1f2e07cee532ec90fc57eee7f2cd49b]. [[phab:T341432|T341432]]. | |} === NOINDEX === NOINDEX refers to the HTML code <code>&lt;meta name="robots" content="noindex"></code>, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode <code><nowiki>__NOINDEX__</nowiki></code>. When {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in <code>includes/Hooks.php</code>, in the <code>onArticleViewFooter()</code> method. ==== First check ==== * First check: Noindex the page if ALL of the following are true: ** {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is turned on ** Page age is less than {{phpi|$wgPageTriageMaxAge}} (set to 90 days on enwiki) ** Page is in <code>pagetriage_page</code> table<ref>Checked by <code>isPageUnreviewed()</code></ref> ** Page is marked as unpatrolled (ptrp_status = 0) ==== Second check ==== * Second check: If the wikitext has the <code><nowiki>__NOINDEX__</nowiki></code> magic word, noindex the page if ALL of the following are true: ** Page age is less than {{phpi|$wgPageTriageMaxNoIndexAge}} (set to 90 days on enwiki) ** If {{phpi|$wgPageTriageMaxNoIndexAge}} is not null, page is in <code>pagetriage_page</code> table<ref>Checked by <code>isNewEnoughToNoIndex()</code>, if it doesn't exit early due to <code>$wgPageTriageMaxNoIndexAge</code> being <code>null</code>.</ref> The main use case for the <nowiki>__NOINDEX__</nowiki> magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See [https://en.wikipedia.org/w/index.php?search=NOINDEX&title=Special:Search&profile=advanced&fulltext=1&ns10=1 this search]. ==== Is the page in the <code>pagetriage_page</code> table? ==== In regards to the requirement "Page is in <code>pagetriage_page</code> table", there are several ways a for a page to get into this table: * Not been deleted by a PageTriage cron job ** One cron job deletes redirects older than {{phpi|$wgPageTriageRedirectAutoreviewAge}} days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them. ** Another cron job deletes reviewed pages after 30 days of being reviewed * In a namespace that PageTriage is configured to patrol * Isn't an article that is so old it predates the installation of PageTriage == JavaScript == === Directory structure === * /modules/ ** ext.pageTriage.article - related to marking an article as reviewed ** ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar ** ext.pageTriage.init - creates a mw.pageTriage object ** ext.pageTriage.newPagesFeed - Special:NewPagesFeed ** ext.pageTriage.sidebarLink - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates ** ext.pageTriage.toolbar - Page Curation toolbar <!--** ext.pageTriage.toolbar - Page Curation toolbar (Vue version)--> ** ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code ** ext.pageTriage.util - Backbone.js models (article, revision, stats) ** external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore <div lang="en" dir="ltr" class="mw-content-ltr"> === Toolbar === </div> The toolbar has three states: <code>maximized</code>, <code>minimized</code>, and <code>hidden</code>. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu. === External libraries === * front end ** old (moving away from) *** [[w:Backbone.js|Backbone.js]] *** [[w:jQuery|jQuery]] *** jQuery Badge *** jQuery Waypoints *** [[w:jQuery UI|jQuery UI]] *** [[w:Mustache (template system)|Mustache (template system)]] *** [[OOUI]] - used in modules/ext.PageTriage.enqueue ([https://codesearch.wmcloud.org/deployed/?q=oojs&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FPageTriage codesearch]) *** [[w:Underscore.js|Underscore.js]] ** new (moving towards) *** Codex *** [[w:Moment.js|Moment.js]] *** Vue Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, [[phab:T208256|we are interested in replacing these front end libraries]], to make the extension easier to maintain. <span id="Client-side_hooks"></span> === İstemci tarafı kancalar === ==== mw.hook ==== * <code>ext.pageTriage.toolbar.ready</code> ==== mw.pageTriage.actionQueue ==== <span class="mw-translate-fuzzy">PageTriage, diğer betiklerin ve araçların onunla bütünleşmesine izin vermek için özel bir eylem kuyruğu sistemi sağlar. Bu, vaatleri kullanması dışında <code>mw.hook</code> ile benzer. Bu, <code>mw.pageTriage.actionQueue</code> modülü kullanılarak yapılır. Nasıl yapılacağına ilişkin belgeler için {{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=kaynak kodu}} içindeki sistem nasıl çalıştığını yorumlara bakın.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is similar to <code>mw.hook</code> except that it uses promises.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done using the <code>mw.pageTriage.actionQueue</code> module.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the comments in the {{tmpl|0={{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=$1}}|source code}} for documentation on how the system works.</span> {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">It is [$1 not currently used by any scripts or gadgets on enwiki], but it is used internally by PageTriage.</span> |1=https://en.wikipedia.org/w/index.php?search=%22actionQueue%22&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1&ns2300=1&ns2301=1&ns2302=1&ns2303=1 }} actionQueue modülü, mw.hook <code>ext.pageTriage.toolbar.ready</code> tetikledikten sonra kullanılabilir. PageTriage, eylem kuyruğu işleyicisine aşağıda belirtilen diğer verilere ek olarak aşağıdaki verileri içeren bir Nesne verecektir: * <code>pageid</code> — İncelenen sayfanın kimliği. * <code>title</code> — Ad alanı dahil sayfanın başlığı. * <code>reviewer</code> — PageTriage kullananların kullanıcı adı. * <code>creator</code> — Sayfayı oluşturan kişinin kullanıcı adı. * <code>reviewed</code> — Sayfanın şu anda incelenmiş olarak işaretlenip işaretlenmeyeceği. <span id="Available_actions"></span> ===== Kullanılabilir eylemler ===== * <code>delete</code> — İnceleyen, bir sayfayı silmek için etiketlediğinde tetiklenir. İşleyiciye verilen veriler ayrıca şunları içerir: ** <code>tags</code> — Sayfaya eklenen tüm şablonların bir nesnesi. Anahtarlar şablon başlığıdır ve değerler, hızlı silme kodu gibi şeyler dahil olmak üzere bir meta veri nesnesidir. * <code>mark</code> — Bir sayfanın inceleme durumu değiştiğinde tetiklenir. Ayrıca şunları içerir: ** <code>note</code> — İnceleyicinin, sayfayı oluşturan kişi için eklediği kişisel mesaj. Bu boş olabilir. * <code>tags</code> — Sayfaya bakım etiketleri eklendiğinde tetiklenir. Ayrıca şunları içerir: ** <code>tags</code> — Sayfaya eklenen tüm şablonların başlıkları dizisi. ** <code>note</code> — İnceleyicinin, sayfayı oluşturan kişi için eklediği kişisel mesaj. Bu boş olabilir. <span id="Example"></span> ===== Örnek ===== Eylem kuyruğunu kullanmak için, yukarıda belirtilen bir eylem başlatıldığında çalıştırılacak bir işlevi kaydedin. PageTriage, sayfayı yenilemek gibi başka bir şey yapmadan önce eşzamansız kodların tamamlanmasını bekler. Örneğin, bir sayfa incelendi olarak işaretlendikten sonra [[Sandbox]] ile düzenlemek için şunu kullanabilirsiniz: <syntaxhighlight lang="javascript"> $( function () { // You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time. mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) { // Listen for the 'mark' action. queue.add( 'mark', function ( data ) { return new mw.Api().edit( 'Sandbox', function ( revision ) { // Replace 'foo' with the note the reviewer left. return revision.content.replace( 'foo', data.note ); } ); } ); } ); } ); </syntaxhighlight> === Where are preferences stored? === Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is <code>userjs-NewPagesFeedFilterOptions</code>. It is set using <code>mw.Api().saveOption()</code> and read using <code>mw.user.options.get()</code>. This data ends up in the SQL <code>user_properties</code> table. Temporary accounts (IP masking) will not be able to store their preferences. == Installation on WMF wikis == This extension was designed for English Wikipedia. There is interest in changing its code and making it more useful to other wikis ([[phab:T50552]]), however this is challenging from a technical perspective and progress is slow. For now, the following are true: * PageTriage is allowed to be installed on other wikis<ref>https://meta.wikimedia.org/w/index.php?title=Limits_to_configuration_changes&diff=prev&oldid=26121135</ref> (although as of 2024 this hasn't happened yet). * The setting <code>$wgPageTriageEnableExtendedFeatures</code> can be set to <code>false</code> to turn off English Wikipedia-specific features such as maintenance tags and deletion tags in the Page Curation toolbar. * There are concerns that the noindex features (controlled by <code>$wgPageTriageNoIndexUnreviewedNewArticles</code> and <code>$wgPageTriageMaxNoIndexAge</code>) create search engine optimization problems, and these noindex features should not be enabled on new wikis without first discussing it with product manager [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]. * Like most other WMF-deployed extensions, PageTriage supports internationalization, and has its interface [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/i18n/|translated into many other languages]]. <span id="See_also"></span> == Ayrıca bakınız == * [[commons:Category:PageTriage extension]] * [[Help:New pages feed]] * [[w:Wikipedia:Page Curation/Help]] == Notes == <references /> {{OnWikimedia}} {{Used by}} [[Category:API extensions{{#translation:}}]] bub871ksib6q8pwhg99bqnd0t5vwv5k Extension:TimedMediaHandler/VideoJS Player/es 102 1225380 8364356 8363684 2026-05-03T13:12:14Z FuzzyBot 451990 Updating to match new version of source page 8364356 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Captura de pantalla del nuevo reproductor en pleno uso]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> Está basado en [https://videojs.com/ VideoJS] y tiene una interfaz de usuario más moderna y rápida con compatibilidad para dispositivos móviles y HTML5. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Ejemplo del Reproductor de vídeo]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using tab, enter and spacebar keys</span> <span id="Known_issues"></span> == Problemas conocidos == El reproductor de video aún está en desarrollo, pero si encuentra algún problema, infórmelo en la [[Extension_talk:TimedMediaHandler/VideoJS Player|página de discusión]] o adjúntelo en [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. <span id="Developers"></span> == Desarrolladores == <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> Abajo hay un ejemplo de uso típico. <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> ana7kpijfzyw1vfl8n1nug2uxqfaw5j 8364772 8364356 2026-05-03T23:14:39Z FuzzyBot 451990 Updating to match new version of source page 8364772 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Captura de pantalla del nuevo reproductor en pleno uso]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> Está basado en [https://videojs.com/ VideoJS] y tiene una interfaz de usuario más moderna y rápida con compatibilidad para dispositivos móviles y HTML5. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Ejemplo del Reproductor de vídeo]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</span> <span id="Known_issues"></span> == Problemas conocidos == El reproductor de video aún está en desarrollo, pero si encuentra algún problema, infórmelo en la [[Extension_talk:TimedMediaHandler/VideoJS Player|página de discusión]] o adjúntelo en [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. <span id="Developers"></span> == Desarrolladores == <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> Abajo hay un ejemplo de uso típico. <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 9t02bfgd070z0tydwl9ht8s1auyohn6 Extension:TimedMediaHandler/VideoJS Player/cy 102 1230085 8364350 8363679 2026-05-03T13:12:12Z FuzzyBot 451990 Updating to match new version of source page 8364350 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Ciplun o'r chwaraewr newydd ar waith]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> Fe'i seiliwyd ar [https://videojs.com/ VideoJS], ac nae ganddo ryngwyneb cyflymach ac mae'n gydnaws a dyfeisiadau symudol a HTML5. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Enghraifft o chwaraewr fideo]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using tab, enter and spacebar keys</span> <span id="Known_issues"></span> ==Problemau== <div lang="en" dir="ltr" class="mw-content-ltr"> The video player is still in development, but if you find any problems, please report these on the [[Extension_talk:TimedMediaHandler/VideoJS Player|talk page]] or file them in [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> csw1lh4s12pcepap7bqsojhpp53abcq 8364766 8364350 2026-05-03T23:14:36Z FuzzyBot 451990 Updating to match new version of source page 8364766 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Ciplun o'r chwaraewr newydd ar waith]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> Fe'i seiliwyd ar [https://videojs.com/ VideoJS], ac nae ganddo ryngwyneb cyflymach ac mae'n gydnaws a dyfeisiadau symudol a HTML5. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Enghraifft o chwaraewr fideo]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</span> <span id="Known_issues"></span> ==Problemau== <div lang="en" dir="ltr" class="mw-content-ltr"> The video player is still in development, but if you find any problems, please report these on the [[Extension_talk:TimedMediaHandler/VideoJS Player|talk page]] or file them in [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> sf0sg1ysj93gp5fsyu685l9ftfkg3eo Template:Update/ar 10 1230874 8364315 8364236 2026-05-03T12:46:59Z FuzzyBot 451990 Updating to match new version of source page 8364315 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |يجوز أن '''دقة حقائق''' أجزاء من هذه الصفحة (تلك المتعلقة بموضوع {{{part|{{{1|}}}}}}) قد أصبحت '''غير دقيقة بسبب وجود معلومات متقادمة'''. |أجزاء من هذه الصفحة (تلك المتعلقة بموضوع {{{part|{{{1|}}}}}}) '''متقادمة'''.}} |{{#if:{{{inaccurate|}}} |يجوز أن '''دقة حقائق''' هذه الصفحة قد أصبحت '''غير دقيقة بسبب وجود معلومات متقادمة'''. |هذه الصفحة '''متقادمة'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|كتبت الصفحة لنسخة قديمة من برمجيات ميدياويكي ويجوز ألا تنطبق على أغلب النسخ الحديثة.}} لو طالعت هذه الصفحة أو حدثتها ووجدت أن المحتوى ملائمًا، يرجى حذف هذا الإشعار. {{#ifexist: {{TALKPAGENAME}} |&#32;طالع [[{{TALKPAGENAME}}|صفحة النقاش]] للاطلاع على نقاش محتمل لهذا الأمر. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>آخر تحديث: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= أسماء مستعارة لهذا القالب: * {{tlx|outdated}} <span id="Examples"></span> == أمثلة == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == انظر أيضا == * {{tl|historical}} <span id="TemplateData"></span> == بيانات القالب (TemplateData) == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> tjorou5z5gdstiowmxnpabj21who73f Extension:DisableAccount/ru 102 1230990 8364849 7799674 2026-05-04T02:59:12Z DaisyFORTY 18213621 8364849 wikitext text/x-wiki <languages /> {{Extension |name = DisableAccount |status = stable |type1 = special page |type2 = user access |hook1 = |username = Werdna |author = Andrew Garrett |description = Allows administrators to disable individual accounts. |image = Disable account extension.JPG |imagesize = 240 |version = |update = continuous updates |mediawiki = |php = |license = |download = {{WikimediaDownload}} |needs-updatephp = No |parameters = |tags = |rights = disableaccount |example = |compatibility = |CheckUsageNameOverride = Disable Account |phabricator = mediawiki-extensions-disableaccount }} Расширение '''DisableAccount''' позволяет администраторам отключать учётные записи участников. Отключение учётной записи с помощью этого расширения удалит пароль и адрес электронной почты с аккаунта, а также переместит его в группу неактивых (inactive) участников. Это действие невозможно отменить без помощи системного администратора. <span class="mw-translate-fuzzy">Для того, чтобы обратно включить таким образом отключённый аккаунт, удалите его из группы неактивных участников и заново установите на нём пароль с помощью [[$1|changePassword.php]].</span> <span id="Installation"></span> ==Установка== {{ExtensionInstall |registration=required |localsettings=$wgGroupPermissions['bureaucrat']['disableaccount'] = true; }} <span class="mw-translate-fuzzy">Действие на второй строке в примере выше выдаёт право <code>disableaccount</code> участникам в группе <code>bureaucrat</code>. Вы можете заменить $3 в $4 на нужную вам группу участников по вашему желанию. Это право не должно выдаваться группам, назначаемым автоматически или имеющим большое количество членов.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Replace <code>bureaucrat</code> in the LocalSettings.php lines with the appropriate other user group, if you wish to use a different configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The permission should not be given to user groups that are automatically assigned or widely populated.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{Ll|Extension:EditAccount|EditAccount}} sw6gu40kvw53i0qhlk2hu42uwrj7s7d 8364851 8364849 2026-05-04T02:59:29Z DaisyFORTY 18213621 8364851 wikitext text/x-wiki <languages /> {{Extension |name = DisableAccount |status = stable |type1 = special page |type2 = user access |hook1 = |username = Werdna |author = Andrew Garrett |description = Allows administrators to disable individual accounts. |image = Disable account extension.JPG |imagesize = 240 |version = |update = continuous updates |mediawiki = |php = |license = |download = {{WikimediaDownload}} |needs-updatephp = No |parameters = |tags = |rights = disableaccount |example = |compatibility = |CheckUsageNameOverride = Disable Account |phabricator = mediawiki-extensions-disableaccount }} Расширение '''DisableAccount''' позволяет администраторам отключать учётные записи участников. Отключение учётной записи с помощью этого расширения удалит пароль и адрес электронной почты с аккаунта, а также переместит его в группу неактивых (inactive) участников. Это действие невозможно отменить без помощи системного администратора. Для того, чтобы обратно включить таким образом отключённый аккаунт, удалите его из группы неактивных участников и заново установите на нём пароль с помощью {{ll|Manual:changePassword.php|changePassword.php}}. <span id="Installation"></span> ==Установка== {{ExtensionInstall |registration=required |localsettings=$wgGroupPermissions['bureaucrat']['disableaccount'] = true; }} <span class="mw-translate-fuzzy">Действие на второй строке в примере выше выдаёт право <code>disableaccount</code> участникам в группе <code>bureaucrat</code>. Вы можете заменить $3 в $4 на нужную вам группу участников по вашему желанию. Это право не должно выдаваться группам, назначаемым автоматически или имеющим большое количество членов.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Replace <code>bureaucrat</code> in the LocalSettings.php lines with the appropriate other user group, if you wish to use a different configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The permission should not be given to user groups that are automatically assigned or widely populated.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{Ll|Extension:EditAccount|EditAccount}} tdcpn354y1gw6h9l1yzfqtcz5pbew9p 8364853 8364851 2026-05-04T03:00:37Z DaisyFORTY 18213621 Created page with "Вы можете заменить $3 в $4 на нужную вам группу участников по вашему желанию." 8364853 wikitext text/x-wiki <languages /> {{Extension |name = DisableAccount |status = stable |type1 = special page |type2 = user access |hook1 = |username = Werdna |author = Andrew Garrett |description = Allows administrators to disable individual accounts. |image = Disable account extension.JPG |imagesize = 240 |version = |update = continuous updates |mediawiki = |php = |license = |download = {{WikimediaDownload}} |needs-updatephp = No |parameters = |tags = |rights = disableaccount |example = |compatibility = |CheckUsageNameOverride = Disable Account |phabricator = mediawiki-extensions-disableaccount }} Расширение '''DisableAccount''' позволяет администраторам отключать учётные записи участников. Отключение учётной записи с помощью этого расширения удалит пароль и адрес электронной почты с аккаунта, а также переместит его в группу неактивых (inactive) участников. Это действие невозможно отменить без помощи системного администратора. Для того, чтобы обратно включить таким образом отключённый аккаунт, удалите его из группы неактивных участников и заново установите на нём пароль с помощью {{ll|Manual:changePassword.php|changePassword.php}}. <span id="Installation"></span> ==Установка== {{ExtensionInstall |registration=required |localsettings=$wgGroupPermissions['bureaucrat']['disableaccount'] = true; }} <span class="mw-translate-fuzzy">Действие на второй строке в примере выше выдаёт право <code>disableaccount</code> участникам в группе <code>bureaucrat</code>. Вы можете заменить $3 в $4 на нужную вам группу участников по вашему желанию. Это право не должно выдаваться группам, назначаемым автоматически или имеющим большое количество членов.</span> Вы можете заменить <code>bureaucrat</code> в LocalSettings.php на нужную вам группу участников по вашему желанию. <span lang="en" dir="ltr" class="mw-content-ltr">The permission should not be given to user groups that are automatically assigned or widely populated.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{Ll|Extension:EditAccount|EditAccount}} n0tbruy4koujyo55mb966w7vgf56aae 8364855 8364853 2026-05-04T03:00:48Z DaisyFORTY 18213621 Created page with "Это право не должно выдаваться группам, назначаемым автоматически или имеющим большое количество членов." 8364855 wikitext text/x-wiki <languages /> {{Extension |name = DisableAccount |status = stable |type1 = special page |type2 = user access |hook1 = |username = Werdna |author = Andrew Garrett |description = Allows administrators to disable individual accounts. |image = Disable account extension.JPG |imagesize = 240 |version = |update = continuous updates |mediawiki = |php = |license = |download = {{WikimediaDownload}} |needs-updatephp = No |parameters = |tags = |rights = disableaccount |example = |compatibility = |CheckUsageNameOverride = Disable Account |phabricator = mediawiki-extensions-disableaccount }} Расширение '''DisableAccount''' позволяет администраторам отключать учётные записи участников. Отключение учётной записи с помощью этого расширения удалит пароль и адрес электронной почты с аккаунта, а также переместит его в группу неактивых (inactive) участников. Это действие невозможно отменить без помощи системного администратора. Для того, чтобы обратно включить таким образом отключённый аккаунт, удалите его из группы неактивных участников и заново установите на нём пароль с помощью {{ll|Manual:changePassword.php|changePassword.php}}. <span id="Installation"></span> ==Установка== {{ExtensionInstall |registration=required |localsettings=$wgGroupPermissions['bureaucrat']['disableaccount'] = true; }} <span class="mw-translate-fuzzy">Действие на второй строке в примере выше выдаёт право <code>disableaccount</code> участникам в группе <code>bureaucrat</code>. Вы можете заменить $3 в $4 на нужную вам группу участников по вашему желанию. Это право не должно выдаваться группам, назначаемым автоматически или имеющим большое количество членов.</span> Вы можете заменить <code>bureaucrat</code> в LocalSettings.php на нужную вам группу участников по вашему желанию. Это право не должно выдаваться группам, назначаемым автоматически или имеющим большое количество членов. <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{Ll|Extension:EditAccount|EditAccount}} 464dnl67la8jw2scx0sz9jn65768teq 8364857 8364855 2026-05-04T03:00:58Z DaisyFORTY 18213621 8364857 wikitext text/x-wiki <languages /> {{Extension |name = DisableAccount |status = stable |type1 = special page |type2 = user access |hook1 = |username = Werdna |author = Andrew Garrett |description = Allows administrators to disable individual accounts. |image = Disable account extension.JPG |imagesize = 240 |version = |update = continuous updates |mediawiki = |php = |license = |download = {{WikimediaDownload}} |needs-updatephp = No |parameters = |tags = |rights = disableaccount |example = |compatibility = |CheckUsageNameOverride = Disable Account |phabricator = mediawiki-extensions-disableaccount }} Расширение '''DisableAccount''' позволяет администраторам отключать учётные записи участников. Отключение учётной записи с помощью этого расширения удалит пароль и адрес электронной почты с аккаунта, а также переместит его в группу неактивых (inactive) участников. Это действие невозможно отменить без помощи системного администратора. Для того, чтобы обратно включить таким образом отключённый аккаунт, удалите его из группы неактивных участников и заново установите на нём пароль с помощью {{ll|Manual:changePassword.php|changePassword.php}}. <span id="Installation"></span> ==Установка== {{ExtensionInstall |registration=required |localsettings=$wgGroupPermissions['bureaucrat']['disableaccount'] = true; }} Действие на второй строке в примере выше выдаёт право <code>disableaccount</code> участникам в группе <code>bureaucrat</code>. Вы можете заменить <code>bureaucrat</code> в LocalSettings.php на нужную вам группу участников по вашему желанию. Это право не должно выдаваться группам, назначаемым автоматически или имеющим большое количество членов. <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{Ll|Extension:EditAccount|EditAccount}} dwzcotq9k4z6dew6h8x4itewmszwsya 8364859 8364857 2026-05-04T03:01:04Z DaisyFORTY 18213621 Created page with "== См. также ==" 8364859 wikitext text/x-wiki <languages /> {{Extension |name = DisableAccount |status = stable |type1 = special page |type2 = user access |hook1 = |username = Werdna |author = Andrew Garrett |description = Allows administrators to disable individual accounts. |image = Disable account extension.JPG |imagesize = 240 |version = |update = continuous updates |mediawiki = |php = |license = |download = {{WikimediaDownload}} |needs-updatephp = No |parameters = |tags = |rights = disableaccount |example = |compatibility = |CheckUsageNameOverride = Disable Account |phabricator = mediawiki-extensions-disableaccount }} Расширение '''DisableAccount''' позволяет администраторам отключать учётные записи участников. Отключение учётной записи с помощью этого расширения удалит пароль и адрес электронной почты с аккаунта, а также переместит его в группу неактивых (inactive) участников. Это действие невозможно отменить без помощи системного администратора. Для того, чтобы обратно включить таким образом отключённый аккаунт, удалите его из группы неактивных участников и заново установите на нём пароль с помощью {{ll|Manual:changePassword.php|changePassword.php}}. <span id="Installation"></span> ==Установка== {{ExtensionInstall |registration=required |localsettings=$wgGroupPermissions['bureaucrat']['disableaccount'] = true; }} Действие на второй строке в примере выше выдаёт право <code>disableaccount</code> участникам в группе <code>bureaucrat</code>. Вы можете заменить <code>bureaucrat</code> в LocalSettings.php на нужную вам группу участников по вашему желанию. Это право не должно выдаваться группам, назначаемым автоматически или имеющим большое количество членов. <span id="See_also"></span> == См. также == * {{Ll|Extension:EditAccount|EditAccount}} jjxp0r2hcr84m7l1m0qauywe89nnkna Translations:Extension:DisableAccount/1/ru 1198 1230999 8364848 4193503 2026-05-04T02:59:11Z DaisyFORTY 18213621 8364848 wikitext text/x-wiki Расширение $1 позволяет администраторам отключать учётные записи участников. sfeoqcds8iloxrfrfx9l1yhxwrt4sh4 Translations:Extension:DisableAccount/4/ru 1198 1231006 8364856 4193517 2026-05-04T03:00:57Z DaisyFORTY 18213621 8364856 wikitext text/x-wiki Действие на второй строке в примере выше выдаёт право $1 участникам в группе $2. m3t5se3ly6o96vbrmghtkrzglo0xq7y Translations:Extension:DisableAccount/6/ru 1198 1231449 8364850 4195300 2026-05-04T02:59:28Z DaisyFORTY 18213621 8364850 wikitext text/x-wiki Для того, чтобы обратно включить таким образом отключённый аккаунт, удалите его из группы неактивных участников и заново установите на нём пароль с помощью $2. fj1ggpr072524b8fnrcolanargu5cza Manual:Managing data in MediaWiki/id 100 1234526 8364303 8363589 2026-05-03T12:44:44Z FuzzyBot 451990 Updating to match new version of source page 8364303 wikitext text/x-wiki <languages/> MediaWiki dirancang untuk mengelola teks dan gambar bentuk bebas. Struktur yang tersedia terbatas: {{ll|Help:Namespaces|ruang nama}}, {{ll|Help:Subpages|subhalaman}}, dan {{ll|Help:Categories|kategori}} membantu mengelompokkan halaman-halaman serupa menjadi satu, sementara fitur-fitur seperti {{ll|Infobox|kotak info}} dan {{ll|Gallery|galeri}} membantu menyusun isi dalam setiap halaman. Namun, MediaWiki sendiri tidak benar-benar menyediakan cara untuk mengelola data terstruktur: data yang dapat dikueri, disaring, dan dalam beberapa kasus ditampilkan dengan visualisasi termasuk tabel, bagan, peta<ref>lihat juga [[Wikimedia Maps]]</ref> dan kalender. Untuk itu, terdapat sejumlah [[Special:MyLanguage/Manual:Extensions|pengaya]] khusus. Tabel berikut menerangkan pengaya yang dapat menyimpan data yang disunting oleh pengguna dalam pengkalan data MediaWiki, yang kemudian dapat digunakan untuk dikueri. Ini bukan daftar semua fungsionalitas data terstruktur; bagian "[[#See also|Lihat juga]]" mencantumkan pengaya dan fitur lain yang dapat digunakan untuk menyimpan atau menampilkan data terstruktur. {| class="wikitable" |- ! Fitur ! [[File:20210702_Semantic_MediaWiki_logo_with_wordmark.png|100px]]<br/>[https://www.semantic-mediawiki.org/ Semantic MediaWiki] ! [[File:Wikibase_Suite_Vertical_2x_RGB.png|100px]]<br/>[https://wikiba.se/ Wikibase] ! [[File:Cargo logo.png|50px]]<br/>{{ll|Extension:Cargo|nsp=0}} ! {{ll|Extension:VisualData|VisualData}} !{{ll|Extension:Bucket|Bucket}} ! {{ll|Extension:NeoWiki|NeoWiki}} |- | Kasus penggunaan utama | Mengelola data dalam pemasangan MediaWiki, berdasarkan standar [[w:Semantic Web|Web Semantik]]. | Memberdayakan [[w:Wikidata|Wikidata]] dan pangkalan data grafik lain yang dapat diedit. | Mengelola data dalam pemasangan MediaWiki. | Mengelola data dalam pemasangan MediaWiki berdasarkan skema JSON. |lightweight Lua interface for storing and accessing structured data on wiki pages |Knowledge management system that combines collaborative editing and a [[:en:knowledge_graph|knowledge graph]] |- | Pendekatan | Data (properti) dianotasi dalam teks wiki biasa atau dengan templat. Dengan jenis data "referensi", properti dapat digunakan untuk menerangkan butir menggunakan pernyataan.<ref>https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data</ref> | Properti ditakrifkan dan digunakan untuk menerangkan Butir menggunakan pernyataan. | Data disimpan dalam tabel-tabel pangkalan data, dengan setiap tabel bersesuaian dengan suatu templat. | Data disimpan dalam slot khusus dengan model isi JSON |Data is stored in '''buckets''', which are database tables with specific columns that you can define |Schemas can be defined and applied to wiki pages, stored in a dedicated slot as JSON data. |- | Tersedia sejak | 2005 | 2012 | 2015 | 2022 (sebelumnya dikenal sebagai {{ll|Extension:PageProperties|PageProperties}}) |2025 |2026 |- | Pemasangan menyala | 1000-an<ref>https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki</ref> | 100-an<ref>https://wikiapiary.com/wiki/Extension:WikibaseRepository</ref><ref>https://wikibase.world</ref><ref>https://addshore.com/2024/10/visualizing-wikibase-connections-using-wikibase-world/</ref> | 100-an<ref>https://wikiapiary.com/wiki/Extension:Cargo</ref> | n/a (pengaya baru atau tak diketahui) | | |- | Komunitas | 190+ pengembang<ref>https://www.openhub.net/p/smw</ref> | 172+ pengembang<ref>https://github.com/wikimedia/mediawiki-extensions-Wikibase</ref> | 63+ pengembang<ref>https://github.com/wikimedia/mediawiki-extensions-Cargo</ref> | ([[User:Thomas-topway-it|pengembang utama]]) |[https://weirdgloop.org/discord Weird Gloop's Discord] |[https://echolot-eccch.eu/ ECHOLOT project], [https://professional.wiki/ Professinal Wiki], [https://knowledge.wiki KM-A], [https://bluespice.com/bluespice-galaxy/ BlueSpice Galaxy] |- | Penyimpanan | Pangkalan data MediaWiki, Elasticsearch, 5 penyimpanan SPARQL berbeda<ref>https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore</ref> | Pangkalan data MediaWiki, Elasticsearch, penyimpanan SPARQL (Blazegraph untuk wikidata.org) | Pangkalan data MediaWiki (atau sebuah pangkalan data terpisah)<ref>{{ll|Extension:Cargo/Download and installation#Setting the Cargo database}}</ref> | Pangkalan data MediaWiki |MediaWiki database (MySQL/MariaDB) |different SPARQL stores, currently Neo4J |- | Takrif properti | Dengan mengetik teks wiki. Properti dapat diciptakan secara bebas. Ini akan menggunakan jenis data halaman secara bawan dan bisa ditakrifkan kemudian. Jenis data dapat diubah kapan saja. | Properti harus ditakrifkan sebelum penggunaan dan tidak dapat diubah dengan mudah.<ref>[[d:Help:Data type#Changing datatype]]</ref> | Alih-alih menggunakan properti, tabel data ditakrifkan dengan seperangkat bidang yang telah ditentukan sebelumnya (tetapi dapat dikonfigurasi ulang) per tabel. | Properti ditakrifkan melalui satu atau lebih skema json yang ditakrifkan melalui {{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}} |Tables in the Bucket: namespace |Form based schema editing |- | Deklarasi nilai | Dalam teks (<code><nowiki>[[MyProperty::MyValue]]</nowiki></code>) atau dengan templat. Entri data berbasis isian dengan {{ll|Extension:Page_Forms|Page Forms}}. | Antarmuka masukan seperti isian bawaan Wikibase. | Dengan fungsi pengurai dalam templat. Entri data berbasis isian dengan {{ll|Extension:Page_Forms|Page Forms}}. | OOUI sebaris atau sembulan {{ll|Extension:VisualData/Forms|forms}} secara otomatis dibuat dari skema JSON |via Lua call of the <code>bucket.put</code> function |OOUI based form editing |- | Jenis data yang telah ditakrifkan sebelumnya | 18<ref>https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes</ref> | 17<ref>[[d:Special:ListDatatypes]]</ref><ref>Beberapa jenis data ditakrifkan dengan pengaya lain: [[Special:MyLanguage/Extension:Math|Math]] dan [[Special:MyLanguage/Extension:Score|Score]] keduanya menakrifkan satu jenis data, [[Special:MyLanguage/Extension:JsonConfig|JsonConfig]] menakrifkan dua, [[Special:MyLanguage/Extension:WikibaseLexeme|WikibaseLexeme]] menakrifkan tiga, dan Wikibase menakrifkan sepuluh.</ref> | 18 | 4 (jenis skema JSON dasar) + 15 format untaian | 5 <ref>https://meta.weirdgloop.org/w/Extension:Bucket#Basic_usage</ref> | |- | Pengelolaan properti | takrif jenis, skema pewatas, impor ontologi | buatan sendiri, atau impor ontologi Wikidata | Alih-alih menggunakan properti, tabel data ditakrifkan dengan seperangkat bidang yang telah ditentukan sebelumnya (tetapi dapat dikonfigurasi ulang) per tabel. | melalui antarmuka grafis (khusus {{ll|Extension:VisualData/Schema Builder|SchemaBuilder}}) | |through a graphical interface |- | Nama halaman dan penautan dalam | Halaman mempunyai nama normal dan dapat ditautkan dengan namanya. | Nama halaman disimpan dengan nomor Q-nya (menampilkan label dalam bahasa yang tersedia). Penautan dalam harus dilakukan ke nomor Q; Anda tidak dapat menautkan ke label. | Halaman mempunyai nama normal dan dapat ditautkan dengan namanya. | Skema disimpan dalam ruang nama khusus dan data JSON dalam slot khusus yang dikaitkan dengan artikel wiki. Data JSON dapat diakses melalui pengaya antarmuka wiki | |MediaWiki pages can have schemas |- | Kueri sebaris | ya, dengan fungsi pengurai | tidak (kueri SPARQL luar); [[phab:T67626|direncanakan]]<br/>didukung lewat pengaya pihak ketiga {{ll|Extension:LinkedWiki|LinkedWiki}} | ya, dengan fungsi pengurai | ya, dengan fungsi pengurai | |yes, with parser functions via the SQL store |- | Kueri luar | ya, dengan API atau kueri SPARQL (tersedia melalui pengaya khusus seperti [[Special:MyLanguage/Extension:RDFIO|RDFIO]] dan [[Special:MyLanguage/Extension:LinkedWiki|LinkedWiki]]) | ya, dengan jasa SPARQL Query | ya, dengan API | ya, dengan API<ref>{{ll|Extension:VisualData/API}}</ref> | API is not yet stable <ref>https://meta.weirdgloop.org/w/Extension:Bucket</ref> |yes, with an API or SPARQL endpoint |- | Format hasil<ref>"Format hasil" artinya kemampuan wiki menampilkan data (hasil kueri dalam teks) dalam berbagai format, misalnya tabel, kalender, peta, linimasa, dll.</ref> | ~ 75<ref>https://www.semantic-mediawiki.org/wiki/Help:Result_formats</ref> | tak ada tampilan hasil asli; data dapat divisualisasi lewat: * Jasa Kueri atau perkakas luar lainnya * pada akses data wiki lewat LUA (tak ada dukungan kueri) * {{ll|Extension:LinkedWiki}} - pihak ketiga | ~ 25<ref>{{ll|Extension:Cargo/Display formats}}</ref> | 12+ (Json, Table, Datatable, Template, Calendar, Carousel, Map, pageid, pagetitle, count, raw, Lua ) <ref>{{ll|Extension:VisualData/Result_formats}}</ref> | | |- | Pengembangan | [[github:SemanticMediaWiki/SemanticMediaWiki|GitHub]] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Cargo Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/VisualData Gerrit] |[[github:weirdgloop/mediawiki-extensions-Bucket|GitHub]] |[[github:ProfessionalWiki/NeoWiki|GItHub]] |- | Pengaya pelengkap | ~ 40<ref>{{ll|Category:Semantic MediaWiki extensions}}</ref>, e.g. {{ll|Extension:Semantic Result Formats|Semantic Result Formats}}, {{ll|Extension:Semantic Bundle|Semantic Bundle}}, {{ll|Extension:Semantic Scribunto|Semantic Scribunto}} | ~12<ref>{{ll|Category:Wikibase extensions}}</ref>, e.g. {{ll|Extension:Wikibase Repository|Wikibase Repository}}, {{ll|Extension:Wikibase Client|Wikibase Client}}, {{ll|Extension:WikibaseLexeme|WikibaseLexeme}}, [https://wikiba.se/applications/#query-service Query Service] | 2 ([[Special:MyLanguage/Extension:Page Forms|Page Forms]], [[Special:MyLanguage/Extension:Page Schemas|Page Schemas]]). Cargo menyediakan sebagian atau seluruh fungsionalitas Semantic MediaWiki, Format Hasil Semantik, Peta, Pengeboran Data Semantik, Kueri Gabungan Semantik, Objek Internal Semantik, dan Semantic Scribunto.<ref>[[Extension:Cargo/Cargo and Semantic MediaWiki]].</ref> | {{ll|Extension:ContactManager|ContactManager}} |{{ll|Extension:Lua|Lua}} | |} <span id="Alternative_comparisons"></span> == Perbandingan alternatif == * {{ll|Extension:Cargo/Cargo and Semantic MediaWiki|2=Cargo dan Semantic MediaWiki}} * [https://professional.wiki/en/articles/managing-data-in-mediawiki Semantic MediaWiki vs Wikibase vs Cargo] oleh [https://professional.wiki Professional Wiki] <span id="References"></span> == Sumber acuan == <references/> <span id="See_also"></span> == Lihat pula == * {{ll|Multi-Content Revisions}} – Kemampuan untuk mengelola berbagai objek isi mandiri di halaman wiki yang sama * {{ll|Extension:WikiDB|WikiDB}} – Menyediakan fitur pangkalan data, agak mirip dengan properti semantik * {{ll|Extension:JsonConfig|JsonConfig}} – menyimpan JSON (termasuk data tabular dan peta) di halaman wiki, dan mengizinkan akses melalui Lua; tak ada dukungan query * {{ll|Extension:External Data|External Data}} – mengakses data dari URL, berkas setempat, dan pangkalan data SQL atau MongoDB * {{ll|Structured data across Wikimedia}} – Proyek 2021-2023 untuk memperbagus dukungan data terstruktur di MediaWiki * {{ll|Category:Data management extensions}} [[Category:MediaWiki Introduction{{#translation:}}]] [[Category:Extension comparisons{{#translation:}}]] g6fulgs8w0jzyybg5c277djn8f5pctb Extension:TimedMediaHandler/VideoJS Player/ro 102 1260163 8364366 8363694 2026-05-03T13:12:19Z FuzzyBot 451990 Updating to match new version of source page 8364366 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Noul video player în acțiune]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> Acesta utilizează [https://videojs.com/ VideoJS] și are o interfață mai modernă și mai rapidă, care este compatibilă cu dispozitivele mobile și cu HTML5. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Un exemplu]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using tab, enter and spacebar keys</span> <span id="Known_issues"></span> == Probleme cunoscute == Video player-ul este în curs de dezvoltare, așa că dacă găsiți vreo problemă cu acesta, vă rugăm să o raportați pe [[Extension_talk:TimedMediaHandler/VideoJS Player|pagina de discuție]] sau să completați formularul de pe [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> ommved3g0c0w1vm9pnfo7jbgwzey7o7 8364782 8364366 2026-05-03T23:14:43Z FuzzyBot 451990 Updating to match new version of source page 8364782 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Noul video player în acțiune]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> Acesta utilizează [https://videojs.com/ VideoJS] și are o interfață mai modernă și mai rapidă, care este compatibilă cu dispozitivele mobile și cu HTML5. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Un exemplu]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</span> <span id="Known_issues"></span> == Probleme cunoscute == Video player-ul este în curs de dezvoltare, așa că dacă găsiți vreo problemă cu acesta, vă rugăm să o raportați pe [[Extension_talk:TimedMediaHandler/VideoJS Player|pagina de discuție]] sau să completați formularul de pe [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 3gf22001je0cfcxncc59j2hsz4hn16d Template:Update/lt 10 1280285 8364329 8364247 2026-05-03T12:47:06Z FuzzyBot 451990 Updating to match new version of source page 8364329 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |<span lang="en" dir="ltr" class="mw-content-ltr">The '''factual accuracy''' of parts of this page (those related to {{{part|{{{1|}}}}}}) '''may be compromised due to out-of-date information'''.</span> |<span lang="en" dir="ltr" class="mw-content-ltr">Parts of this page (those related to {{{part|{{{1|}}}}}}) are '''outdated'''.</span>}} |{{#if:{{{inaccurate|}}} |<span lang="en" dir="ltr" class="mw-content-ltr">The '''factual accuracy''' of this page '''may be compromised due to out-of-date information'''.</span> |<span lang="en" dir="ltr" class="mw-content-ltr">This page is '''outdated'''.</span>}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|<span lang="en" dir="ltr" class="mw-content-ltr">It was written for an older version of MediaWiki and may not apply to the most recent version.</span>}} <span lang="en" dir="ltr" class="mw-content-ltr">If you have checked or updated this page and found the content to be suitable, please remove this notice.</span> {{#ifexist: {{TALKPAGENAME}} |&#32;<span lang="en" dir="ltr" class="mw-content-ltr">See the [[{{TALKPAGENAME}}|talk page]] for a possible discussion on this.</span> }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Paskutinį kartą atnaujinta: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= <div lang="en" dir="ltr" class="mw-content-ltr"> Aliases of this template: </div> * {{tlx|outdated}} <span id="Examples"></span> == Pavyzdžiai == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == Taip pat skaitykite == * {{tl|historical}} == TemplateData == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> 4dmtsag7u59p11dljy3h0kfend9b6wr Extension:TimedMediaHandler/VideoJS Player/ru 102 1286108 8364368 8363695 2026-05-03T13:12:20Z FuzzyBot 451990 Updating to match new version of source page 8364368 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Скриншот нового проигрывателя]] '''VideoJS Player''' — видеоплеер для MediaWiki в проектах Викимедиа. Он базируется на [https://videojs.com/ VideoJS] и имеет более современный, быстрый пользовательский интерфейс с поддержкой мобильных устройств и HTML5. <span id="Usage"></span> == Использование == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Пример видеоплеера]] [[File:Armstrong Small Step.ogg|thumb|Пример аудиоплеера]] Одновременно аудио- и видеоплеер. Вы можете найти примеры обоих плееров на этой странице. После запуска при взаимодействии с видео вы увидите панель управления. [[File:VideoJS controlbar.png|frameless|350px]] Кнопки управления в перечислении слева направо: <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;Воспроизведение/пауза * [[File:VideoJS volume control.png|30px|]]&nbsp;Управление громкостью * Пимпочка позиции при воспроизведении * Оставшееся время воспроизведения * [[File:VideoJS subtitle control.png|30px|]]&nbsp;Выбор языка субтитров и контроллеры стиля субтитров * [[File:VideoJS resolution control.png|30px|]]&nbsp;Селектор разрешения * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;Управление опциональным «Картинка-в-картинке» * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;Управление полноэкранным режимом * [[File:VideoJS file description control.png|30px|]]&nbsp;Инфо-кнопка, которая перенаправляет на страницу описания файла <span id="Mouse_and_keyboard_controls"></span> === Управление мышкой и клавиатурой === * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * Дважды щелкните на окно проигрывателя, чтобы войти или выйти из полноэкранного режима * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : Войти/Покинуть полноэкранный режим *; {{Key press|m}} : Заглушить звук *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using tab, enter and spacebar keys</span> <span id="Known_issues"></span> == Известные проблемы == Видеоплеер все еще находится в разработке, но если вы обнаружите какие-либо проблемы, сообщите о них на [[Extension_talk:TimedMediaHandler/VideoJS Player|странице обсуждения]] или сохраните их в [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Фабрикаторе]. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> mpsj888yge9gndaaez8h327duryocvi 8364783 8364368 2026-05-03T23:14:44Z FuzzyBot 451990 Updating to match new version of source page 8364783 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Скриншот нового проигрывателя]] '''VideoJS Player''' — видеоплеер для MediaWiki в проектах Викимедиа. Он базируется на [https://videojs.com/ VideoJS] и имеет более современный, быстрый пользовательский интерфейс с поддержкой мобильных устройств и HTML5. <span id="Usage"></span> == Использование == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Пример видеоплеера]] [[File:Armstrong Small Step.ogg|thumb|Пример аудиоплеера]] Одновременно аудио- и видеоплеер. Вы можете найти примеры обоих плееров на этой странице. После запуска при взаимодействии с видео вы увидите панель управления. [[File:VideoJS controlbar.png|frameless|350px]] Кнопки управления в перечислении слева направо: <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;Воспроизведение/пауза * [[File:VideoJS volume control.png|30px|]]&nbsp;Управление громкостью * Пимпочка позиции при воспроизведении * Оставшееся время воспроизведения * [[File:VideoJS subtitle control.png|30px|]]&nbsp;Выбор языка субтитров и контроллеры стиля субтитров * [[File:VideoJS resolution control.png|30px|]]&nbsp;Селектор разрешения * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;Управление опциональным «Картинка-в-картинке» * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;Управление полноэкранным режимом * [[File:VideoJS file description control.png|30px|]]&nbsp;Инфо-кнопка, которая перенаправляет на страницу описания файла <span id="Mouse_and_keyboard_controls"></span> === Управление мышкой и клавиатурой === * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * Дважды щелкните на окно проигрывателя, чтобы войти или выйти из полноэкранного режима * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : Войти/Покинуть полноэкранный режим *; {{Key press|m}} : Заглушить звук *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</span> <span id="Known_issues"></span> == Известные проблемы == Видеоплеер все еще находится в разработке, но если вы обнаружите какие-либо проблемы, сообщите о них на [[Extension_talk:TimedMediaHandler/VideoJS Player|странице обсуждения]] или сохраните их в [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Фабрикаторе]. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> oegq99zjwdt91m96711gmikbzdv1dx1 Extension:TimedMediaHandler/VideoJS Player/fa 102 1315609 8364358 8363685 2026-05-03T13:12:15Z FuzzyBot 451990 Updating to match new version of source page 8364358 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|نما‌گرفتی از پخش‌کننده‌ی جدید در حال کار]] <div class="mw-translate-fuzzy"> '''پخش‌کنندهٔ ویدئو جی‌اس''' جایگزین پخش‌کننده ویدئو برای مدیاویکی است و به زودی جایگزین پخش‌کنندهٔ ویدیوی قدیمی که در پروژه‌های ویکی‌مدیا ارائه شده است خواهد شد. </div> این برنامه مبتنی بر [https://videojs.com/ ویدئو جی‌اس] است و دارای واسط کاربری مدرن تر و سریعتر با سازگاری برای دستگاه‌های تلفن همراه و اچ‌تی‌ام‌ال۵ است. <span id="Usage"></span> == استفاده == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|نمونه‌ی پخش‌کننده‌ی ویدئو]] [[File:Armstrong Small Step.ogg|thumb|نمونه‌ی پخش‌کننده‌ی صوت]] این یک پخش‌کنندهٔ صوتی و تصویری است. می‌توانید نمونه‌هایی از هر دو پخش‌کننده را در این صفحه بیابید. پس از راه‌اندازی، هنگام تعامل با ویدئو، یک نوار کنترل را مشاهده خواهید کرد. [[File:VideoJS controlbar.png|frameless|350px]] کنترل‌ها به ترتیب از چپ به راست عبارتند از: <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;کنترل پخش/مکث * [[File:VideoJS volume control.png|30px|]]&nbsp;کنترل صدا * موقعیت پخش * زمان پخش باقی‌مانده * [[File:VideoJS subtitle control.png|30px|]]&nbsp;انتخابگر زبان زیرنویس و کنترل‌های سبک زیرنویس * [[File:VideoJS resolution control.png|30px|]]&nbsp;انتخابگر وضوح * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;کنترل اختیاری تصویر-در-تصویر * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;کنترل تمام‌صفحه * [[File:VideoJS file description control.png|30px|]]&nbsp;دکمه اطلاعات برای بردن شما به صفحه توضیحات پرونده <span id="Mouse_and_keyboard_controls"></span> === کنترل‌های ماوس و صفحه‌کلید === * روی نماد پخش بر روی تصویرک کلیک کنید تا پخش پرونده رسانه‌ای آغاز شود. * روی تصویرک کلیک‌راست یا کلیک‌وسط کنید تا صفحه توضیحات پرونده باز شود * پخش/مکث پخش‌کننده با یک کلیک ماوس در داخل پنجرهٔ پخش‌کننده * برای ورود یا خروج از حالت تمام‌صفحه، روی پنجره پخش‌کننده دوبار کلیک کنید * کنترل‌های صفحه‌کلید زیر در دسترس هستند: *; {{Key press|k}} / {{Key press|Space}} : پخش/مکث بازپخش رسانه *; {{Key press|f}} : وارد/ترک تمام‌صفحه شوید *; {{Key press|m}} : قطع صدا *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * پخش‌کننده با استفاده از کلیدهای تب، اینتر و فاصله به طور کامل از طریق صفحه‌کلید قابل دسترس است <span id="Known_issues"></span> == مشکلات شناخته‌شده == پخش کننده‌ی ویدیو هنوز در حال توسعه است ، اما اگر مشکلی پیدا کردید ، لطفاً این موارد را در [[Extension_talk:TimedMediaHandler/VideoJS Player|صفحه بحث]] گزارش دهید یا آنها را در [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator] بایگانی کنید. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> kgn2wowi9t0bn52k7c9krao45qju7bd 8364773 8364358 2026-05-03T23:14:39Z FuzzyBot 451990 Updating to match new version of source page 8364773 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|نما‌گرفتی از پخش‌کننده‌ی جدید در حال کار]] <div class="mw-translate-fuzzy"> '''پخش‌کنندهٔ ویدئو جی‌اس''' جایگزین پخش‌کننده ویدئو برای مدیاویکی است و به زودی جایگزین پخش‌کنندهٔ ویدیوی قدیمی که در پروژه‌های ویکی‌مدیا ارائه شده است خواهد شد. </div> این برنامه مبتنی بر [https://videojs.com/ ویدئو جی‌اس] است و دارای واسط کاربری مدرن تر و سریعتر با سازگاری برای دستگاه‌های تلفن همراه و اچ‌تی‌ام‌ال۵ است. <span id="Usage"></span> == استفاده == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|نمونه‌ی پخش‌کننده‌ی ویدئو]] [[File:Armstrong Small Step.ogg|thumb|نمونه‌ی پخش‌کننده‌ی صوت]] این یک پخش‌کنندهٔ صوتی و تصویری است. می‌توانید نمونه‌هایی از هر دو پخش‌کننده را در این صفحه بیابید. پس از راه‌اندازی، هنگام تعامل با ویدئو، یک نوار کنترل را مشاهده خواهید کرد. [[File:VideoJS controlbar.png|frameless|350px]] کنترل‌ها به ترتیب از چپ به راست عبارتند از: <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;کنترل پخش/مکث * [[File:VideoJS volume control.png|30px|]]&nbsp;کنترل صدا * موقعیت پخش * زمان پخش باقی‌مانده * [[File:VideoJS subtitle control.png|30px|]]&nbsp;انتخابگر زبان زیرنویس و کنترل‌های سبک زیرنویس * [[File:VideoJS resolution control.png|30px|]]&nbsp;انتخابگر وضوح * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;کنترل اختیاری تصویر-در-تصویر * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;کنترل تمام‌صفحه * [[File:VideoJS file description control.png|30px|]]&nbsp;دکمه اطلاعات برای بردن شما به صفحه توضیحات پرونده <span id="Mouse_and_keyboard_controls"></span> === کنترل‌های ماوس و صفحه‌کلید === * روی نماد پخش بر روی تصویرک کلیک کنید تا پخش پرونده رسانه‌ای آغاز شود. * روی تصویرک کلیک‌راست یا کلیک‌وسط کنید تا صفحه توضیحات پرونده باز شود * پخش/مکث پخش‌کننده با یک کلیک ماوس در داخل پنجرهٔ پخش‌کننده * برای ورود یا خروج از حالت تمام‌صفحه، روی پنجره پخش‌کننده دوبار کلیک کنید * کنترل‌های صفحه‌کلید زیر در دسترس هستند: *; {{Key press|k}} / {{Key press|Space}} : پخش/مکث بازپخش رسانه *; {{Key press|f}} : وارد/ترک تمام‌صفحه شوید *; {{Key press|m}} : قطع صدا *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * پخش‌کننده با استفاده از کلیدهای تب، اینتر و فاصله به طور کامل از طریق صفحه‌کلید قابل دسترس است <span id="Known_issues"></span> == مشکلات شناخته‌شده == پخش کننده‌ی ویدیو هنوز در حال توسعه است ، اما اگر مشکلی پیدا کردید ، لطفاً این موارد را در [[Extension_talk:TimedMediaHandler/VideoJS Player|صفحه بحث]] گزارش دهید یا آنها را در [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator] بایگانی کنید. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> plc949hoosc57yxo5gtki66eh4kjel4 Extension:TimedMediaHandler/VideoJS Player/vi 102 1342263 8364371 8363700 2026-05-03T13:12:22Z FuzzyBot 451990 Updating to match new version of source page 8364371 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Ảnh chụp màn hình của trình phát mới đang hoạt động]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> Nó dựa trên [https://videojs.com/ VideoJS] và có giao diện hiện đại hơn, nhanh hơn và tương thích trên các thiết bị di động và HTML5. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Trình phát video mẫu]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using tab, enter and spacebar keys</span> <span id="Known_issues"></span> == Các vấn đề đã biết == Trình phát video vẫn đang được phát triển. Nếu bạn phát hiện lỗi, xin vui lòng báo cáo tại [[Extension_talk:TimedMediaHandler/VideoJS Player|trang thảo luận]] hoặc [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> gug83jlmwpt0sqj7gmg71a9twyeb3d8 8364788 8364371 2026-05-03T23:14:46Z FuzzyBot 451990 Updating to match new version of source page 8364788 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Ảnh chụp màn hình của trình phát mới đang hoạt động]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> Nó dựa trên [https://videojs.com/ VideoJS] và có giao diện hiện đại hơn, nhanh hơn và tương thích trên các thiết bị di động và HTML5. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Trình phát video mẫu]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</span> <span id="Known_issues"></span> == Các vấn đề đã biết == Trình phát video vẫn đang được phát triển. Nếu bạn phát hiện lỗi, xin vui lòng báo cáo tại [[Extension_talk:TimedMediaHandler/VideoJS Player|trang thảo luận]] hoặc [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> a47ajsa44q2xf4494hx10vcjky901lr Extension:TimedMediaHandler/VideoJS Player/it 102 1342416 8364361 8363689 2026-05-03T13:12:17Z FuzzyBot 451990 Updating to match new version of source page 8364361 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|L'immagine del nuovo lettore in azione]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> Esso è basato su [https://videojs.com/ VideoJS],ed è più moderno, una interfaccia utente rapida con la compatibilità dei telefoni mobile e HTML5 <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Esempio di riproduttore di video]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using tab, enter and spacebar keys</span> <span id="Known_issues"></span> == Problemi noti == Il lettore video è ancora in fase di sviluppo, ma se riscontri problemi, segnalali sulle [[Extension_talk:TimedMediaHandler/VideoJS Player|discussioni]] o archiviali in [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator] <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> dep9e88do1gdr55aoco7moynx1j9qa5 8364777 8364361 2026-05-03T23:14:41Z FuzzyBot 451990 Updating to match new version of source page 8364777 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|L'immagine del nuovo lettore in azione]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> Esso è basato su [https://videojs.com/ VideoJS],ed è più moderno, una interfaccia utente rapida con la compatibilità dei telefoni mobile e HTML5 <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Esempio di riproduttore di video]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</span> <span id="Known_issues"></span> == Problemi noti == Il lettore video è ancora in fase di sviluppo, ma se riscontri problemi, segnalali sulle [[Extension_talk:TimedMediaHandler/VideoJS Player|discussioni]] o archiviali in [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator] <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 217cuv1yrdefe5478d4r7pp8tp0zwde Extension:LookupUser/en 102 1344221 8364792 6707357 2026-05-03T23:53:08Z FuzzyBot 451990 Updating to match new version of source page 8364792 wikitext text/x-wiki <languages/> {{Warning |1=This extension may pose serious security and/or privacy risks! Users with access to this extension can view the preferences of any other user, which is usually considered private information. While this extension does not give access to account passwords, it does give access to private data such as real names, email addresses, and other information that could be easily abused. Therefore, do NOT grant access to any user unless they are 100% trustworthy. It is recommended that access be restricted to bureaucrats or higher groups. We are not responsible for any security or privacy leaks. }} {{Extension |status=stable |image=LookupUser.png |type1=special |description=Allows to retrieve information about a user such as email address and ID |username=Tim Starling |license = GPL-2.0-or-later |mediawiki=1.46+ |version=1.5.2 |update=2018-07-14 |download={{WikimediaDownload|LookupUser|phab=ELOU}} |needs-updatephp =No |hook1=ContributionsToolLinks |rights=lookupuser |phabricator=LookupUser }} The '''LookupUser''' extension allows to retrieve information about a user such as email address, user ID and the user preferences, i.e. everything that the user has specified in their [[Special:MyLanguage/Help:Preferences|preferences]]. This extension also displays the last time a user either made a login, or any edit, which it lists as the "User record last touched:" time and date element of its log. (This will be displayed as UTC even if you've set a custom time zone/the server's time zone is different.) == Installation == {{ExtensionInstall |registration=required |localsettings= // Who can use Special:LookupUser? // If you want that sysops can use it: #$wgGroupPermissions['*']['lookupuser'] = false; #$wgGroupPermissions['sysop']['lookupuser'] = true; // Or, do you want a new user group for this. // (users with the 'userrights' right can add users to this group only bureaucrats by default) $wgGroupPermissions['*']['lookupuser'] = false; $wgGroupPermissions['lookupuser']['lookupuser'] = true; }} == Usage == The extension is accessed via the "Special:LookupUser" page. {{Used by}} dr266oijhi9ps87yxc5ew2tk5dk641b 8364801 8364792 2026-05-04T00:10:34Z FuzzyBot 451990 Updating to match new version of source page 8364801 wikitext text/x-wiki <languages/> {{Warning |1=This extension may pose serious security and/or privacy risks! Users with access to this extension can view the preferences of any other user, which is usually considered private information. While this extension does not give access to account passwords, it does give access to private data such as real names, email addresses, and other information that could be easily abused. Therefore, do NOT grant access to any user unless they are 100% trustworthy. It is recommended that access be restricted to bureaucrats or higher groups. We are not responsible for any security or privacy leaks. }} {{Extension |status=stable |image=LookupUser.png |type1=special |description=Allows to retrieve information about a user such as email address and ID |username=Tim Starling |license = GPL-2.0-or-later |mediawiki=1.46+ ([[phab:T416793]]) |version=1.5.2 |update=2018-07-14 |download={{WikimediaDownload|LookupUser|phab=ELOU}} |needs-updatephp =No |hook1=ContributionsToolLinks |rights=lookupuser |phabricator=LookupUser }} The '''LookupUser''' extension allows to retrieve information about a user such as email address, user ID and the user preferences, i.e. everything that the user has specified in their [[Special:MyLanguage/Help:Preferences|preferences]]. This extension also displays the last time a user either made a login, or any edit, which it lists as the "User record last touched:" time and date element of its log. (This will be displayed as UTC even if you've set a custom time zone/the server's time zone is different.) == Installation == {{ExtensionInstall |registration=required |localsettings= // Who can use Special:LookupUser? // If you want that sysops can use it: #$wgGroupPermissions['*']['lookupuser'] = false; #$wgGroupPermissions['sysop']['lookupuser'] = true; // Or, do you want a new user group for this. // (users with the 'userrights' right can add users to this group only bureaucrats by default) $wgGroupPermissions['*']['lookupuser'] = false; $wgGroupPermissions['lookupuser']['lookupuser'] = true; }} == Usage == The extension is accessed via the "Special:LookupUser" page. {{Used by}} j8ot6pp818z8k7z4kco7rycaziaiifs Extension:LookupUser/ja 102 1344223 8364795 6707361 2026-05-03T23:53:10Z FuzzyBot 451990 Updating to match new version of source page 8364795 wikitext text/x-wiki <languages/> {{Warning |1=この拡張機能は、セキュリティおよび/またはプライバシーの重大なリスクをもたらす可能性があります。 この拡張機能にアクセスした利用者は、通常個人情報とみなされる他の利用者の個人設定を閲覧できます。 この拡張機能では、アカウントのパスワードにアクセスすることはできませんが、本名やメールアドレスなど、悪用されやすい個人情報にアクセスすることは可能です。 したがって、100%信頼できる利用者でない限り、アクセスを許可'''しないでください'''。 アクセスはビューロクラット以上のグループに限定することが推奨されます。 個人情報が流出したとしても開発者は責任を負いません。 }} {{Extension |status=stable |image=LookupUser.png |type1=special |description=メールアドレスや ID など、利用者に関する情報を取得できるようにする |username=Tim Starling |license = GPL-2.0-or-later |mediawiki=1.46+ |version=1.5.2 |update=2018-07-14 |download={{WikimediaDownload|LookupUser|phab=ELOU}} |needs-updatephp =No |hook1=ContributionsToolLinks |rights=lookupuser |phabricator=LookupUser }} '''LookupUser''' 拡張機能では、メールアドレス、利用者ID、利用者の個人設定、つまり利用者が[[Special:MyLanguage/Help:Preferences|個人設定]]で指定したすべての情報を取得できます。 この拡張機能では、利用者が最後にログインまたは編集を行った日時も表示されます。この日時は、記録の「User record last touched:」という日時の要素で表示されます。 (カスタムタイムゾーンを設定した場合やサーバーのタイムゾーンが異なる場合でもUTCとして表示されます)。 <span id="Installation"></span> == インストール == {{ExtensionInstall |registration=required |localsettings= // 誰が Special:LookupUser を使うことができるか。 // 管理者に使用可能にしたいなら、 #$wgGroupPermissions['*']['lookupuser'] = false; #$wgGroupPermissions['sysop']['lookupuser'] = true; // か、新しい利用者グループに設定したい場合。 // (「userrights」権限を持つ利用者は、既定ではビューロクラットのみこのグループに利用者を追加できます) $wgGroupPermissions['*']['lookupuser'] = false; $wgGroupPermissions['lookupuser']['lookupuser'] = true; }} <span id="Usage"></span> == 使用法 == 拡張機能は「Special:LookupUser」ページでアクセスします。 {{Used by}} ksg9yuq3jkr9gl0wmlhjva3wjg0bewj 8364804 8364795 2026-05-04T00:10:35Z FuzzyBot 451990 Updating to match new version of source page 8364804 wikitext text/x-wiki <languages/> {{Warning |1=この拡張機能は、セキュリティおよび/またはプライバシーの重大なリスクをもたらす可能性があります。 この拡張機能にアクセスした利用者は、通常個人情報とみなされる他の利用者の個人設定を閲覧できます。 この拡張機能では、アカウントのパスワードにアクセスすることはできませんが、本名やメールアドレスなど、悪用されやすい個人情報にアクセスすることは可能です。 したがって、100%信頼できる利用者でない限り、アクセスを許可'''しないでください'''。 アクセスはビューロクラット以上のグループに限定することが推奨されます。 個人情報が流出したとしても開発者は責任を負いません。 }} {{Extension |status=stable |image=LookupUser.png |type1=special |description=メールアドレスや ID など、利用者に関する情報を取得できるようにする |username=Tim Starling |license = GPL-2.0-or-later |mediawiki=1.46+ ([[phab:T416793]]) |version=1.5.2 |update=2018-07-14 |download={{WikimediaDownload|LookupUser|phab=ELOU}} |needs-updatephp =No |hook1=ContributionsToolLinks |rights=lookupuser |phabricator=LookupUser }} '''LookupUser''' 拡張機能では、メールアドレス、利用者ID、利用者の個人設定、つまり利用者が[[Special:MyLanguage/Help:Preferences|個人設定]]で指定したすべての情報を取得できます。 この拡張機能では、利用者が最後にログインまたは編集を行った日時も表示されます。この日時は、記録の「User record last touched:」という日時の要素で表示されます。 (カスタムタイムゾーンを設定した場合やサーバーのタイムゾーンが異なる場合でもUTCとして表示されます)。 <span id="Installation"></span> == インストール == {{ExtensionInstall |registration=required |localsettings= // 誰が Special:LookupUser を使うことができるか。 // 管理者に使用可能にしたいなら、 #$wgGroupPermissions['*']['lookupuser'] = false; #$wgGroupPermissions['sysop']['lookupuser'] = true; // か、新しい利用者グループに設定したい場合。 // (「userrights」権限を持つ利用者は、既定ではビューロクラットのみこのグループに利用者を追加できます) $wgGroupPermissions['*']['lookupuser'] = false; $wgGroupPermissions['lookupuser']['lookupuser'] = true; }} <span id="Usage"></span> == 使用法 == 拡張機能は「Special:LookupUser」ページでアクセスします。 {{Used by}} diutgmk42r5fc1u2qv2jm9if28lzlhi Extension:LookupUser/pl 102 1345759 8364796 6707360 2026-05-03T23:53:11Z FuzzyBot 451990 Updating to match new version of source page 8364796 wikitext text/x-wiki <languages/> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">This extension may pose serious security and/or privacy risks!</span> <span lang="en" dir="ltr" class="mw-content-ltr">Users with access to this extension can view the preferences of any other user, which is usually considered private information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">While this extension does not give access to account passwords, it does give access to private data such as real names, email addresses, and other information that could be easily abused.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Therefore, do NOT grant access to any user unless they are 100% trustworthy.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is recommended that access be restricted to bureaucrats or higher groups.</span> <span lang="en" dir="ltr" class="mw-content-ltr">We are not responsible for any security or privacy leaks.</span> }} {{Extension |status=stable |image=LookupUser.png |type1=special |description=<span lang="en" dir="ltr" class="mw-content-ltr">Allows to retrieve information about a user such as email address and ID</span> |username=Tim Starling |license = GPL-2.0-or-later |mediawiki=1.46+ |version=1.5.2 |update=2018-07-14 |download={{WikimediaDownload|LookupUser|phab=ELOU}} |needs-updatephp =No |hook1=ContributionsToolLinks |rights=lookupuser |phabricator=LookupUser }} <div lang="en" dir="ltr" class="mw-content-ltr"> The '''LookupUser''' extension allows to retrieve information about a user such as email address, user ID and the user preferences, i.e. everything that the user has specified in their [[Special:MyLanguage/Help:Preferences|preferences]]. </div> <span lang="en" dir="ltr" class="mw-content-ltr">This extension also displays the last time a user either made a login, or any edit, which it lists as the "User record last touched:" time and date element of its log.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(This will be displayed as UTC even if you've set a custom time zone/the server's time zone is different.)</span> <span id="Installation"></span> == Instalacja == {{ExtensionInstall |registration=required |localsettings= // Who can use Special:LookupUser? // If you want that sysops can use it: #$wgGroupPermissions['*']['lookupuser'] = false; #$wgGroupPermissions['sysop']['lookupuser'] = true; // Or, do you want a new user group for this. // (users with the 'userrights' right can add users to this group only bureaucrats by default) $wgGroupPermissions['*']['lookupuser'] = false; $wgGroupPermissions['lookupuser']['lookupuser'] = true; }} <span id="Usage"></span> == Użycie == <div lang="en" dir="ltr" class="mw-content-ltr"> The extension is accessed via the "Special:LookupUser" page. </div> {{Used by}} c54tesguoayr1omjdicd2599waul85j 8364805 8364796 2026-05-04T00:10:36Z FuzzyBot 451990 Updating to match new version of source page 8364805 wikitext text/x-wiki <languages/> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">This extension may pose serious security and/or privacy risks!</span> <span lang="en" dir="ltr" class="mw-content-ltr">Users with access to this extension can view the preferences of any other user, which is usually considered private information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">While this extension does not give access to account passwords, it does give access to private data such as real names, email addresses, and other information that could be easily abused.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Therefore, do NOT grant access to any user unless they are 100% trustworthy.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is recommended that access be restricted to bureaucrats or higher groups.</span> <span lang="en" dir="ltr" class="mw-content-ltr">We are not responsible for any security or privacy leaks.</span> }} {{Extension |status=stable |image=LookupUser.png |type1=special |description=<span lang="en" dir="ltr" class="mw-content-ltr">Allows to retrieve information about a user such as email address and ID</span> |username=Tim Starling |license = GPL-2.0-or-later |mediawiki=1.46+ ([[phab:T416793]]) |version=1.5.2 |update=2018-07-14 |download={{WikimediaDownload|LookupUser|phab=ELOU}} |needs-updatephp =No |hook1=ContributionsToolLinks |rights=lookupuser |phabricator=LookupUser }} <div lang="en" dir="ltr" class="mw-content-ltr"> The '''LookupUser''' extension allows to retrieve information about a user such as email address, user ID and the user preferences, i.e. everything that the user has specified in their [[Special:MyLanguage/Help:Preferences|preferences]]. </div> <span lang="en" dir="ltr" class="mw-content-ltr">This extension also displays the last time a user either made a login, or any edit, which it lists as the "User record last touched:" time and date element of its log.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(This will be displayed as UTC even if you've set a custom time zone/the server's time zone is different.)</span> <span id="Installation"></span> == Instalacja == {{ExtensionInstall |registration=required |localsettings= // Who can use Special:LookupUser? // If you want that sysops can use it: #$wgGroupPermissions['*']['lookupuser'] = false; #$wgGroupPermissions['sysop']['lookupuser'] = true; // Or, do you want a new user group for this. // (users with the 'userrights' right can add users to this group only bureaucrats by default) $wgGroupPermissions['*']['lookupuser'] = false; $wgGroupPermissions['lookupuser']['lookupuser'] = true; }} <span id="Usage"></span> == Użycie == <div lang="en" dir="ltr" class="mw-content-ltr"> The extension is accessed via the "Special:LookupUser" page. </div> {{Used by}} 9h5u2xxmkvbzvnm77yxaq6ybesmlkum Extension:LookupUser/fr 102 1346407 8364794 6707359 2026-05-03T23:53:10Z FuzzyBot 451990 Updating to match new version of source page 8364794 wikitext text/x-wiki <languages/> {{Warning |1=Cette extension peut poser de sérieux risques pour la sécurité et/ou la vie privée ! Les utilisateurs ayant accès à cette extension peuvent afficher les préférences de tout autre utilisateur, ce qui est généralement considéré comme des informations privées. Bien que cette extension ne donne pas accès aux mots de passe de compte, elle donne accès à des données privées telles que les noms réels, les adresses e-mail et d'autres informations qui pourraient être facilement abusées. Par conséquent, n'accordez PAS l'accès à un utilisateur à moins qu'il ne soit 100% digne de confiance. Il est recommandé de limiter l'accès aux fonctionnaires ou aux groupes supérieurs. Nous ne sommes pas responsables des fuites de sécurité ou de confidentialité. }} {{Extension |status=stable |image=LookupUser.png |type1=special |description=Permet de récupérer des informations sur un utilisateur, telles que l'adresse de messagerie et l'ID |username=Tim Starling |license = GPL-2.0-or-later |mediawiki=1.46+ |version=1.5.2 |update=2018-07-14 |download={{WikimediaDownload|LookupUser|phab=ELOU}} |needs-updatephp =No |hook1=ContributionsToolLinks |rights=lookupuser |phabricator=LookupUser }} L'extension '''LookupUser''' permet de récupérer des informations sur un utilisateur telles que l'adresse de messagerie, l'ID utilisateur et les préférences utilisateur, c'est-à-dire tout ce que l'utilisateur a spécifié dans ses [[Special:MyLanguage/Help:Preferences|préférences]]. Cette extension affiche également la dernière fois qu'un utilisateur a effectué une connexion, ou toute modification, qu'il liste comme l'élément "Enregistrement utilisateur touché en dernier : " heure et date de son journal. (Ceci s'affichera sous la forme UTC même si vous avez défini un fuseau horaire personnalisé/si le fuseau horaire du serveur est différent.) == Installation == {{ExtensionInstall |registration=required |localsettings= // Qui peut utiliser Special:LookupUser ? // Si vous voulez que sysops puisse l'utiliser : #$wgGroupPermissions['*']['lookupuser'] = false; #$wgGroupPermissions['sysop']['lookupuser'] = true; // Ou voulez-vous un nouveau groupe d'utilisateurs pour cela ? // (les utilisateurs disposant de droits d'utilisateur peuvent ajouter des utilisateurs à ce groupe uniquement par défaut les bureaucrates) $wgGroupPermissions['*']['lookupuser'] = false; $wgGroupPermissions['lookupuser']['lookupuser'] = true; }} <span id="Usage"></span> == Utilisation == L'extension est accessible via la page "Special:LookupUser". {{Used by}} ayrpjk66e2ec1gq1cainis6oiav1gnh 8364803 8364794 2026-05-04T00:10:35Z FuzzyBot 451990 Updating to match new version of source page 8364803 wikitext text/x-wiki <languages/> {{Warning |1=Cette extension peut poser de sérieux risques pour la sécurité et/ou la vie privée ! Les utilisateurs ayant accès à cette extension peuvent afficher les préférences de tout autre utilisateur, ce qui est généralement considéré comme des informations privées. Bien que cette extension ne donne pas accès aux mots de passe de compte, elle donne accès à des données privées telles que les noms réels, les adresses e-mail et d'autres informations qui pourraient être facilement abusées. Par conséquent, n'accordez PAS l'accès à un utilisateur à moins qu'il ne soit 100% digne de confiance. Il est recommandé de limiter l'accès aux fonctionnaires ou aux groupes supérieurs. Nous ne sommes pas responsables des fuites de sécurité ou de confidentialité. }} {{Extension |status=stable |image=LookupUser.png |type1=special |description=Permet de récupérer des informations sur un utilisateur, telles que l'adresse de messagerie et l'ID |username=Tim Starling |license = GPL-2.0-or-later |mediawiki=1.46+ ([[phab:T416793]]) |version=1.5.2 |update=2018-07-14 |download={{WikimediaDownload|LookupUser|phab=ELOU}} |needs-updatephp =No |hook1=ContributionsToolLinks |rights=lookupuser |phabricator=LookupUser }} L'extension '''LookupUser''' permet de récupérer des informations sur un utilisateur telles que l'adresse de messagerie, l'ID utilisateur et les préférences utilisateur, c'est-à-dire tout ce que l'utilisateur a spécifié dans ses [[Special:MyLanguage/Help:Preferences|préférences]]. Cette extension affiche également la dernière fois qu'un utilisateur a effectué une connexion, ou toute modification, qu'il liste comme l'élément "Enregistrement utilisateur touché en dernier : " heure et date de son journal. (Ceci s'affichera sous la forme UTC même si vous avez défini un fuseau horaire personnalisé/si le fuseau horaire du serveur est différent.) == Installation == {{ExtensionInstall |registration=required |localsettings= // Qui peut utiliser Special:LookupUser ? // Si vous voulez que sysops puisse l'utiliser : #$wgGroupPermissions['*']['lookupuser'] = false; #$wgGroupPermissions['sysop']['lookupuser'] = true; // Ou voulez-vous un nouveau groupe d'utilisateurs pour cela ? // (les utilisateurs disposant de droits d'utilisateur peuvent ajouter des utilisateurs à ce groupe uniquement par défaut les bureaucrates) $wgGroupPermissions['*']['lookupuser'] = false; $wgGroupPermissions['lookupuser']['lookupuser'] = true; }} <span id="Usage"></span> == Utilisation == L'extension est accessible via la page "Special:LookupUser". {{Used by}} kd2da1mjbnri8gq55gn9wu7csnqdxro Help:Extension:ParserFunctions/hi 12 1376266 8365016 8353932 2026-05-04T06:20:33Z FuzzyBot 451990 Updating to match new version of source page 8365016 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span class="mw-translate-fuzzy">{{ll|Extension:ParserFunctions|nsp=0}} एक्सटेंशन मीडियाविकि में पहले से ही मौजूद "{{$2|जादूई शब्दों}}" के विकल्प के रूप में ग्यारह अतिरिक्त [[Special:MyLanguage/Parser functions|पार्सर फंक्शन्स]] प्रदान करता है।</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> (इसे स्ट्रिंग्स को संभालने के लिए अतिरिक्त पार्सर फंक्शन्स देने के लिए कॉन्फिगर किया जा सकता है; इन स्ट्रिंग फंक्शन्स को {{ll|Extension:ParserFunctions/String functions|कहीं और}} प्रलेखित किया गया है।) इस एक्सटेंशन द्वारा प्रदान किए गए सभी पार्सर फ़ंक्शन इस प्रारूप के हैं: :<code><nowiki>{{</nowiki>'''#functionname''': ''तर्क 1'' | ''तर्क 2'' | ''तर्क 3''... <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | प्रकार ! {{hl1}} | ऑपरेटर्स |- | {{hl2}} | वर्गीकरण (कोष्ठक) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | संख्याएँ | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | बाइनरी ऑपरेटर <code>'''e'''</code> &nbsp; यूनरी <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | यूनरी | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | बाइनरी | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | दौर | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | तर्क | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} यह फ़ंक्शन किसी गणितीय प्रकटीकरण का विवेचन करके अनुमानित मूल्य लौटाता है। यह फ़ंक्शन <code>mw.ext.ParserFunctions.expr</code> फ़ंक्शन के ज़रिए {{ll|Extension:Scribunto|nsp=0}} में भी उपलब्ध है। :<code><nowiki>{{#expr:</nowiki> ''एक्सप्रेशन'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The available operators are listed to the right, in order of precedence. See {{ll|Manual:Expr parser function syntax}} for more details of the function of each operator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> When evaluating using [[w:boolean algebra|boolean algebra]], zero evaluates to {{phpi|false}}, and any nonzero value, positive or negative, evaluates to {{phpi|true}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code>[[##iferror|#iferror]]</code> function: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Rounding === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Test case</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Result</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Method of rounding</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is < 5, so no apparent rounding occurs</span> (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is ≥ 5, so it is rounded up</span> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to the nearest integer</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the ''nearest'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding up or down with ''ceil'' and ''floor''</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next ''larger'' integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next ''smaller'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next larger integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next smaller integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Not rounded, since 1 already is an integer</span><br />{{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect</span>}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Strings === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: test string | value if test string is not empty | value if test string is empty (or only white space)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: first parameter | second parameter | third parameter }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Example: </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Year</span> |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">4-digit year.</span> | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Month</span> |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour</span> |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Minutes and seconds</span> |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] hjzr9on1hqbed5rgr7jaiew4xonzr37 Extension:WhoIsWatching/en 102 1381372 8364407 6771225 2026-05-03T14:58:52Z FuzzyBot 451990 Updating to match new version of source page 8364407 wikitext text/x-wiki <languages/> {{Extension |name = Who Is Watching |status = stable |type1 = special |type2 = database |type3 = parser function |author = * [[User:Gri6507|Paul Grinberg]], * [[User:Siebrand|Siebrand Mazeland]], * [[User:MarkAHershberger|Mark Hershberger]] |image = |license = GPL-2.0-only |version = 0.13.0 |update = 2019-08-04 |mediawiki = 1.43+ |download = {{WikimediaDownload}} |readme = [https://github.com/wikimedia/mediawiki-extensions-WhoIsWatching/blob/master/README.mediawiki README.mediawiki] |changelog = |compatibility policy = master |description = Find out who is watching a particular page, and add others to watchlist for that page. |parameters= * $whoiswatching_nametype * $whoiswatching_allowaddingpeople * $whoiswatching_showifzero * $whoiswatching_showwatchingusers * $whoiswatching_maxPicklistUsers |rights = * addpagetoanywatchlist * seepagewatchers |example = [http://ec.europa.eu/eurostat/statistics-explained/index.php?title=Special:WhoIsWatching&ns=&page=Transport_accident_statistics http://ec.europa.eu/eurostat/] |phabricator = MediaWiki-extensions-WhoIsWatching }} The '''WhoIsWatching''' extension allows to find out who is watching a particular page, and add others to watchlist for that page. == Rationale == Even though this notion goes against Wikipedia and Wikimedia [[w:Wikipedia:Watchlist#Privacy of watchlists|privacy policy]], some wikis may actually like to see which of its users are watching particular pages. This extension provides just such an interface at the bottom of every page. Additionally, this extension has an option to allow any user to add any page to any other user's watch list. == Installation == Make sure that {{ll|Extension:Echo}} is installed as it is a prerequisite for this extension to work. {{ExtensionInstall |registration=required |localsettings = # $whoiswatching_nametype = "RealName"; # $whoiswatching_allowaddingpeople = false; # $whoiswatching_showifzero = true; # $whoiswatching_showwatchingusers = false; # $whoiswatching_maxPicklistUsers = 10; # $wgGroupPermissions['sysop']['addpagetoanywatchlist'] = true; # $wgGroupPermissions['sysop']['seepagewatchers'] = true; }} == Configuration == You can simply start using the extension without changing anything else. The only additional configuration that is currently possible for the extension defines how to display the names of the users watching the pages. In <code>SpecialWhoIsWatching.php</code>, there is <syntaxhighlight lang="php"> # Set the following to either 'UserName' or 'RealName' to change how watching users are displayed. $whoiswatching_nametype = 'RealName'; </syntaxhighlight> As the comment implies, depending on the value of this variable, you can display either the real names of the watching users or their wiki usernames. The reason some wiki's may want to switch over to the 'UserName' mode is if they do not require their members to have a valid real name. Another configurable option in the extension is the ability to switch on/off the option to allow any user to add any page to any other user's watch list. This is done in <code>SpecialWhoIsWatching.php</code>, where there is <syntaxhighlight lang="php"> # Set true if you don't want to use permissions and users are allowed to add to other user's watchlists. $whoiswatching_allowaddingpeople = true; </syntaxhighlight> It is also possible to only display the count of watching people if the count is greater than zero. This is done in <code>SpecialWhoIsWatching.php</code>, where there is <syntaxhighlight lang="php"> # Set to true if you want people with permission to see 0 if no one is watching the page. $whoiswatching_showifzero = true; </syntaxhighlight> Finally, newer versions of this extension, while we attempt to be backward compatible, allow you to use permissions instead of global variables. <syntaxhighlight lang="php"> # Set to true if you don't want to use permissions. $whoiswatching_showwatchingusers = true; </syntaxhighlight> By default, users in the sysop group have permission to see page watchers and add pages to anyone's watchlist. You can grant these permissions to logged in users, too, or any group you think needs it. <syntaxhighlight lang="php"> # Give all logged in users full access. $wgGroupPermissions['user']['addpagetoanywatchlist'] = true; $wgGroupPermissions['user']['seepagewatchers'] = true; </syntaxhighlight> == Usage == {{tmpl|0=This extension also provides the <code>{{#whoiswatching:$1}}</code> parser function showing the number of watching users of <code>$1</code> plus providing a link to <code>Special:WhoIsWatching/$1</code>. |1=Some Page }} This can be used with skins not supporting footer links or to create the WhoIsWatching link somewhere in a wiki page. == Known issues == The first time after a you submit a request to remove a page from the users watchlist, the user is still shown on the form. To get around this it is disabled and displayed with a red strikethrough. {{Used by}} [[Category:Notification extensions{{#translation:}}]] [[Category:WatchArticle extensions{{#translation:}}]] [[Category:Watchlist extensions{{#translation:}}]] g4jzbixdt2u4t5c8cqv31nos3ejlby7 Extension:WhoIsWatching/ja 102 1381374 8364412 6771230 2026-05-03T14:58:55Z FuzzyBot 451990 Updating to match new version of source page 8364412 wikitext text/x-wiki <languages/> {{Extension |name = Who Is Watching |status = stable |type1 = special |type2 = database |type3 = parser function |author = * [[User:Gri6507|Paul Grinberg]], * [[User:Siebrand|Siebrand Mazeland]], * [[User:MarkAHershberger|Mark Hershberger]] |image = |license = GPL-2.0-only |version = 0.13.0 |update = 2019-08-04 |mediawiki = 1.43+ |download = {{WikimediaDownload}} |readme = [https://github.com/wikimedia/mediawiki-extensions-WhoIsWatching/blob/master/README.mediawiki README.mediawiki] |changelog = |compatibility policy = master |description = Find out who is watching a particular page, and add others to watchlist for that page. |parameters= * $whoiswatching_nametype * $whoiswatching_allowaddingpeople * $whoiswatching_showifzero * $whoiswatching_showwatchingusers * $whoiswatching_maxPicklistUsers |rights = * addpagetoanywatchlist * seepagewatchers |example = [http://ec.europa.eu/eurostat/statistics-explained/index.php?title=Special:WhoIsWatching&ns=&page=Transport_accident_statistics http://ec.europa.eu/eurostat/] |phabricator = MediaWiki-extensions-WhoIsWatching }} '''WhoIsWatching'''拡張機能は、特定のページを見ている人を調べたり、そのページのウォッチリストに他の人を追加したりすることができます。 <div lang="en" dir="ltr" class="mw-content-ltr"> == Rationale == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Even though this notion goes against Wikipedia and Wikimedia [[w:Wikipedia:Watchlist#Privacy of watchlists|privacy policy]], some wikis may actually like to see which of its users are watching particular pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This extension provides just such an interface at the bottom of every page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally, this extension has an option to allow any user to add any page to any other user's watch list.</span> <span id="Installation"></span> == インストール == <div lang="en" dir="ltr" class="mw-content-ltr"> Make sure that {{ll|Extension:Echo}} is installed as it is a prerequisite for this extension to work. </div> {{ExtensionInstall |registration=required |localsettings = # $whoiswatching_nametype = "RealName"; # $whoiswatching_allowaddingpeople = false; # $whoiswatching_showifzero = true; # $whoiswatching_showwatchingusers = false; # $whoiswatching_maxPicklistUsers = 10; # $wgGroupPermissions['sysop']['addpagetoanywatchlist'] = true; # $wgGroupPermissions['sysop']['seepagewatchers'] = true; }} <span id="Configuration"></span> == 設定 == <span lang="en" dir="ltr" class="mw-content-ltr">You can simply start using the extension without changing anything else.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The only additional configuration that is currently possible for the extension defines how to display the names of the users watching the pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In <code>SpecialWhoIsWatching.php</code>, there is</span> <syntaxhighlight lang="php"> # Set the following to either 'UserName' or 'RealName' to change how watching users are displayed. $whoiswatching_nametype = 'RealName'; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">As the comment implies, depending on the value of this variable, you can display either the real names of the watching users or their wiki usernames.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason some wiki's may want to switch over to the 'UserName' mode is if they do not require their members to have a valid real name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Another configurable option in the extension is the ability to switch on/off the option to allow any user to add any page to any other user's watch list.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done in <code>SpecialWhoIsWatching.php</code>, where there is</span> <syntaxhighlight lang="php"> # Set true if you don't want to use permissions and users are allowed to add to other user's watchlists. $whoiswatching_allowaddingpeople = true; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">It is also possible to only display the count of watching people if the count is greater than zero.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done in <code>SpecialWhoIsWatching.php</code>, where there is</span> <syntaxhighlight lang="php"> # Set to true if you want people with permission to see 0 if no one is watching the page. $whoiswatching_showifzero = true; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Finally, newer versions of this extension, while we attempt to be backward compatible, allow you to use permissions instead of global variables.</span> <syntaxhighlight lang="php"> # Set to true if you don't want to use permissions. $whoiswatching_showwatchingusers = true; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">By default, users in the sysop group have permission to see page watchers and add pages to anyone's watchlist.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can grant these permissions to logged in users, too, or any group you think needs it.</span> <syntaxhighlight lang="php"> # Give all logged in users full access. $wgGroupPermissions['user']['addpagetoanywatchlist'] = true; $wgGroupPermissions['user']['seepagewatchers'] = true; </syntaxhighlight> <span id="Usage"></span> == 使用法 == {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">This extension also provides the <code>{{#whoiswatching:$1}}</code> parser function showing the number of watching users of <code>$1</code> plus providing a link to <code>Special:WhoIsWatching/$1</code>.</span> |1=ページ名 }} <span lang="en" dir="ltr" class="mw-content-ltr">This can be used with skins not supporting footer links or to create the WhoIsWatching link somewhere in a wiki page.</span> <span id="Known_issues"></span> == 既知の問題点 == <span lang="en" dir="ltr" class="mw-content-ltr">The first time after a you submit a request to remove a page from the users watchlist, the user is still shown on the form.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To get around this it is disabled and displayed with a red strikethrough.</span> {{Used by}} [[Category:Notification extensions{{#translation:}}]] [[Category:WatchArticle extensions{{#translation:}}]] [[Category:Watchlist extensions{{#translation:}}]] 0s7icxs2y5enusi2l3ptgrll7wgfpy4 Extension:WhoIsWatching/pl 102 1386900 8364411 6844566 2026-05-03T14:58:55Z FuzzyBot 451990 Updating to match new version of source page 8364411 wikitext text/x-wiki <languages/> {{Extension |name = Who Is Watching |status = stable |type1 = special |type2 = database |type3 = parser function |author = * [[User:Gri6507|Paul Grinberg]], * [[User:Siebrand|Siebrand Mazeland]], * [[User:MarkAHershberger|Mark Hershberger]] |image = |license = GPL-2.0-only |version = 0.13.0 |update = 2019-08-04 |mediawiki = 1.43+ |download = {{WikimediaDownload}} |readme = [https://github.com/wikimedia/mediawiki-extensions-WhoIsWatching/blob/master/README.mediawiki README.mediawiki] |changelog = |compatibility policy = master |description = Find out who is watching a particular page, and add others to watchlist for that page. |parameters= * $whoiswatching_nametype * $whoiswatching_allowaddingpeople * $whoiswatching_showifzero * $whoiswatching_showwatchingusers * $whoiswatching_maxPicklistUsers |rights = * addpagetoanywatchlist * seepagewatchers |example = [http://ec.europa.eu/eurostat/statistics-explained/index.php?title=Special:WhoIsWatching&ns=&page=Transport_accident_statistics http://ec.europa.eu/eurostat/] |phabricator = MediaWiki-extensions-WhoIsWatching }} <span lang="en" dir="ltr" class="mw-content-ltr">The '''WhoIsWatching''' extension allows to find out who is watching a particular page, and add others to watchlist for that page.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Rationale == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Even though this notion goes against Wikipedia and Wikimedia [[w:Wikipedia:Watchlist#Privacy of watchlists|privacy policy]], some wikis may actually like to see which of its users are watching particular pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This extension provides just such an interface at the bottom of every page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally, this extension has an option to allow any user to add any page to any other user's watch list.</span> <span id="Installation"></span> == Instalacja == <div lang="en" dir="ltr" class="mw-content-ltr"> Make sure that {{ll|Extension:Echo}} is installed as it is a prerequisite for this extension to work. </div> {{ExtensionInstall |registration=required |localsettings = # $whoiswatching_nametype = "RealName"; # $whoiswatching_allowaddingpeople = false; # $whoiswatching_showifzero = true; # $whoiswatching_showwatchingusers = false; # $whoiswatching_maxPicklistUsers = 10; # $wgGroupPermissions['sysop']['addpagetoanywatchlist'] = true; # $wgGroupPermissions['sysop']['seepagewatchers'] = true; }} <span id="Configuration"></span> == Konfiguracja == <span lang="en" dir="ltr" class="mw-content-ltr">You can simply start using the extension without changing anything else.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The only additional configuration that is currently possible for the extension defines how to display the names of the users watching the pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In <code>SpecialWhoIsWatching.php</code>, there is</span> <syntaxhighlight lang="php"> # Set the following to either 'UserName' or 'RealName' to change how watching users are displayed. $whoiswatching_nametype = 'RealName'; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">As the comment implies, depending on the value of this variable, you can display either the real names of the watching users or their wiki usernames.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason some wiki's may want to switch over to the 'UserName' mode is if they do not require their members to have a valid real name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Another configurable option in the extension is the ability to switch on/off the option to allow any user to add any page to any other user's watch list.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done in <code>SpecialWhoIsWatching.php</code>, where there is</span> <syntaxhighlight lang="php"> # Set true if you don't want to use permissions and users are allowed to add to other user's watchlists. $whoiswatching_allowaddingpeople = true; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">It is also possible to only display the count of watching people if the count is greater than zero.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done in <code>SpecialWhoIsWatching.php</code>, where there is</span> <syntaxhighlight lang="php"> # Set to true if you want people with permission to see 0 if no one is watching the page. $whoiswatching_showifzero = true; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Finally, newer versions of this extension, while we attempt to be backward compatible, allow you to use permissions instead of global variables.</span> <syntaxhighlight lang="php"> # Set to true if you don't want to use permissions. $whoiswatching_showwatchingusers = true; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">By default, users in the sysop group have permission to see page watchers and add pages to anyone's watchlist.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can grant these permissions to logged in users, too, or any group you think needs it.</span> <syntaxhighlight lang="php"> # Give all logged in users full access. $wgGroupPermissions['user']['addpagetoanywatchlist'] = true; $wgGroupPermissions['user']['seepagewatchers'] = true; </syntaxhighlight> <span id="Usage"></span> == Użycie == {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">This extension also provides the <code>{{#whoiswatching:$1}}</code> parser function showing the number of watching users of <code>$1</code> plus providing a link to <code>Special:WhoIsWatching/$1</code>.</span> |1=<span lang="en" dir="ltr" class="mw-content-ltr">Some Page</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">This can be used with skins not supporting footer links or to create the WhoIsWatching link somewhere in a wiki page.</span> <span id="Known_issues"></span> == Znane problemy == <span lang="en" dir="ltr" class="mw-content-ltr">The first time after a you submit a request to remove a page from the users watchlist, the user is still shown on the form.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To get around this it is disabled and displayed with a red strikethrough.</span> {{Used by}} [[Category:Notification extensions{{#translation:}}]] [[Category:WatchArticle extensions{{#translation:}}]] [[Category:Watchlist extensions{{#translation:}}]] 4ls1vdoewvrdo9zvz17j9z6shooe7m1 Extension:TimedMediaHandler/VideoJS Player/ar 102 1411051 8364352 8363678 2026-05-03T13:12:12Z FuzzyBot 451990 Updating to match new version of source page 8364352 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|<span lang="en" dir="ltr" class="mw-content-ltr">Screenshot of the VideoJS player in action</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is based on [https://videojs.com/ VideoJS], and has a modern, fast user interface with compatibility with mobile devices and HTML5. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|<span lang="en" dir="ltr" class="mw-content-ltr">Example video player</span>]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using tab, enter and spacebar keys</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Known issues == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The video player is still in development, but if you find any problems, please report these on the [[Extension_talk:TimedMediaHandler/VideoJS Player|talk page]] or file them in [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> bj2r02ir2ntixamcmlb9vhupidzhzkv 8364767 8364352 2026-05-03T23:14:36Z FuzzyBot 451990 Updating to match new version of source page 8364767 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|<span lang="en" dir="ltr" class="mw-content-ltr">Screenshot of the VideoJS player in action</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is based on [https://videojs.com/ VideoJS], and has a modern, fast user interface with compatibility with mobile devices and HTML5. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|<span lang="en" dir="ltr" class="mw-content-ltr">Example video player</span>]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Known issues == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The video player is still in development, but if you find any problems, please report these on the [[Extension_talk:TimedMediaHandler/VideoJS Player|talk page]] or file them in [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 7y1929gcuen1hy2rh7kxynl59afxd19 Category:Special Pages/vi 14 1413229 8364465 6658690 2026-05-03T15:49:58Z Hiyuune 17854348 Created page with "* Xem: $1" 8364465 wikitext text/x-wiki <languages /> * Xem: {{ll|Help:Special pages}} [[Category:MediaWiki components{{#translation:}}]] 3t9wx0tbb83b9csyv67t9p3vzbwq6ah Manual:Managing data in MediaWiki/cs 100 1414539 8364300 8363585 2026-05-03T12:44:41Z FuzzyBot 451990 Updating to match new version of source page 8364300 wikitext text/x-wiki <languages/> MediaWiki byla navržena tak, aby spravovala převážně volně formátovaný text a obrázky. K dispozici je omezené množství struktur: {{ll|Help:Namespaces|namespaces}}, {{ll|Help:Subpages|subpages}} a {{ll|Help:Categories|categories}} pomáhají seskupit podobné stránky, zatímco funkce jako {{ll|Infobox|infoboxes}} a { {ll|Gallery|galleries}} pomáhají strukturovat obsah na každé stránce. MediaWiki však sama o sobě skutečně neposkytuje způsoby, jak spravovat strukturovaná data: Data, která lze dotazovat, filtrovat a v některých případech zobrazovat pomocí vizualizací včetně tabulek, grafů, map<ref>viz také [[Wikimedia Maps]]</ref> a kalendáře. K tomu existuje řada vyhrazených [[Special:MyLanguage/Manual:Extensions|rozšíření]]. Následující tabulka popisuje rozšíření, která mohou ukládat data upravovaná uživateli v databázi MediaWiki, odkud je lze následně vyhledávat. Toto není seznam všech funkcí strukturovaných dat. Sekce "[[#See also|Viz také]]" uvádí další rozšíření a funkce, které lze použít pro ukládání nebo zobrazování strukturovaných dat. {| class="wikitable" |- ! Funkce ! [[File:20210702_Semantic_MediaWiki_logo_with_wordmark.png|100px]]<br/>[https://www.semantic-mediawiki.org/ Semantic MediaWiki] ! [[File:Wikibase_Suite_Vertical_2x_RGB.png|100px]]<br/>[https://wikiba.se/ Wikibase] ! [[File:Cargo logo.png|50px]]<br/>{{ll|Extension:Cargo|nsp=0}} ! {{ll|Extension:VisualData|VisualData}} !{{ll|Extension:Bucket|Bucket}} ! {{ll|Extension:NeoWiki|NeoWiki}} |- | Hlavní případ použití | Správa dat v rámci instalace MediaWiki na základě standardů [[w:Semantic Web|Sémantického webu]]. | Zdroj [[w:Wikidata|Wikidata]] a další editovatelné databáze grafů. | Správa dat v rámci instalace MediaWiki. | Správa dat v rámci instalace MediaWiki na základě schéma JSON. |lightweight Lua interface for storing and accessing structured data on wiki pages |Knowledge management system that combines collaborative editing and a [[:en:knowledge_graph|knowledge graph]] |- | Přístup | Data (vlastnosti) jsou anotovány v běžném wikitextu nebo pomocí šablon. S datovým typem "reference" lze vlastnosti použít k popisu položek pomocí příkazů.<ref>https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data</ref> | Vlastnosti jsou definovány a používány k popisu položek pomocí příkazů. | Data jsou uložena v databázových tabulkách, přičemž každá tabulka odpovídá šabloně. | Data jsou uložena ve vyhrazeném slotu s modelem obsahu JSON |Data is stored in '''buckets''', which are database tables with specific columns that you can define |Schemas can be defined and applied to wiki pages, stored in a dedicated slot as JSON data. |- | K dispozici od | 2005 | 2012 | 2015 | 2022 (dříve známý jako {{ll|Extension:PageProperties|PageProperties}}) |2025 |2026 |- | Aktivní instalace | 1000<ref>https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki</ref> | 100<ref>https://wikiapiary.com/wiki/Extension:WikibaseRepository</ref><ref>https://wikibase.world</ref><ref>https://addshore.com/2024/10/visualizing-wikibase-connections-using-wikibase-world/</ref> | 100<ref>https://wikiapiary.com/wiki/Extension:Cargo</ref> | n/a (nové rozšíření nebo neznámé) | | |- | Komunita | 190 + vývojáři<ref>https://www.openhub.net/p/smw</ref> | 172 + vývojáři<ref>https://github.com/wikimedia/mediawiki-extensions-Wikibase</ref> | 63 + vývojáři<ref>https://github.com/wikimedia/mediawiki-extensions-Cargo</ref> | ([[User:Thomas-topway-it|hlavní vývojář]]) |[https://weirdgloop.org/discord Weird Gloop's Discord] |[https://echolot-eccch.eu/ ECHOLOT project], [https://professional.wiki/ Professinal Wiki], [https://knowledge.wiki KM-A], [https://bluespice.com/bluespice-galaxy/ BlueSpice Galaxy] |- | Úložný prostor | Databáze MediaWiki, Elasticsearch, 5 různých úložných prostorů SPARQL<ref>https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore</ref> | Databáze MediaWiki, Elasticsearch, úložný prostor SPARQL (Blazegraph pro wikidata.org) | Databáze MediaWiki (nebo samostatná databáze)<ref>{{ll|Extension:Cargo/Download and installation#Setting the Cargo database}}</ref> | Databáze MediaWiki |MediaWiki database (MySQL/MariaDB) |different SPARQL stores, currently Neo4J |- | Definice vlastnosti | Zadáním wikitextu. Vlastnosti lze vymýšlet volně. Ve výchozím nastavení budou mít stránku datového typu a lze je definovat později. Datové typy lze kdykoli změnit. | Vlastnosti musí být definovány před použitím a nelze je snadno měnit.<ref>[[d:Help:Data type#Changing datatype]]</ref> | Místo použití vlastností jsou datové tabulky definovány s předem určenou (ale překonfigurovatelnou) sadou polí pomocí tabulky. | Vlastnosti jsou definovány prostřednictvím jednoho nebo více schémat json definovaných prostřednictvím {{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}} |Tables in the Bucket: namespace |Form based schema editing |- | Deklarace hodnoty | Inline (<code><nowiki>[[MyProperty::MyValue]]</nowiki></code>) nebo pomocí šablon. Zadávání dat na základě formuláře s {{ll|Extension:Page_Forms|Page Forms}}. | Wikibase výchozí vstupní rozhraní podobné formuláři. | S funkcemi analyzátoru v šablonách. Zadávání dat na základě formuláře s {{ll|Extension:Page_Forms|Page Forms}}. | Vložené nebo vyskakovací OOUI {{ll|Extension:VisualData/Forms|forms}} automaticky generované ze schémat JSON |via Lua call of the <code>bucket.put</code> function |OOUI based form editing |- | Předdefinované datové typy | 18<ref>https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes</ref> | 17<ref>[[d:Special:ListDatatypes]]</ref><ref>Některé datové typy jsou definovány jiným rozšířením: [[Special:MyLanguage/Extension:Math|Math]] a [[Special:MyLanguage/Extension:Score|Score]] oba definují jeden datový typ, [[Special:MyLanguage/Extension:JsonConfig|JsonConfig]] definuje dva, [[Special:MyLanguage/Extension:WikibaseLexeme|WikibaseLexeme]] definuje tři a Wikibase definuje deset.</ref> | 18 | 4 (základní typy schémat JSON) + 15 formátů řetězců | 5 <ref>https://meta.weirdgloop.org/w/Extension:Bucket#Basic_usage</ref> | |- | Správa vlastností | definice typů, schémata omezení, import ontologie | vlastní nebo import ontologie Wikidat | Místo použití vlastností jsou datové tabulky definovány s předem určenou (ale překonfigurovatelnou) sadou polí na tabulku. | prostřednictvím grafického rozhraní (vyhrazeno {{ll|Extension:VisualData/Schema Builder|SchemaBuilder}}) | |through a graphical interface |- | Názvy stránek a vnitřní propojení | Stránky mají normální názvy a lze na ně odkazovat jejich názvy. | Názvy stránek jsou uloženy s jejich Q-čísly (zobrazení štítků v dostupných jazycích). Vnitřní propojení musí být provedeno na Q-číslo. Nemůžete odkazovat na štítek. | Stránky mají normální názvy a lze na ně odkazovat jejich názvy. | Schémata jsou uložena ve vyhrazeném jmenném prostoru a data JSON ve vyhrazeném slotu spojeném s články wiki. K datům JSON lze přistupovat prostřednictvím rozšíření rozhraní wiki | |MediaWiki pages can have schemas |- | Inline dotazy | ano, s funkcemi parseru | ne (externí dotazy SPARQL); [[phab:T67626|plánované]]<br/>podporováno prostřednictvím rozšíření třetí strany {{ll|Extension:LinkedWiki|LinkedWiki}} | ano, s funkcemi parseru | ano, s funkcemi parseru | |yes, with parser functions via the SQL store |- | Externí dotazování | ano, s dotazováním API nebo SPARQL (dostupné prostřednictvím speciálních rozšíření, jako jsou [[Special:MyLanguage/Extension:RDFIO|RDFIO]] a [[Special:MyLanguage/Extension:LinkedWiki|LinkedWiki]]) | ano, s SPARQL Query service | ano, s API | ano, s API<ref>{{ll|Extension:VisualData/API}}</ref> | API is not yet stable <ref>https://meta.weirdgloop.org/w/Extension:Bucket</ref> |yes, with an API or SPARQL endpoint |- | Formáty výsledků<ref>"Formáty výsledků" znamenají schopnost wiki zobrazovat data (výsledky vloženého dotazu) v různých formátech, např. tabulky, kalendáře, mapy, časové osy atd.</ref> | ~ 75<ref>https://www.semantic-mediawiki.org/wiki/Help:Result_formats</ref> | žádné zobrazení nativních výsledků. Data lze zobrazit pomocí: * Query Service nebo jiné externí nástroje * přístup k datům na wiki přes LUA (bez podpory dotazů) * {{ll|Extension:LinkedWiki}} - třetí strana | ~ 25<ref>{{ll|Extension:Cargo/Display formats}}</ref> | 12+ (Json, Table, Datatable, Template, Calendar, Carousel, Map, pageid, pagetitle, count, raw, Lua ) <ref>{{ll|Extension:VisualData/Result_formats}}</ref> | | |- | Vývoj | [[github:SemanticMediaWiki/SemanticMediaWiki|GitHub]] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Cargo Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/VisualData Gerrit] |[[github:weirdgloop/mediawiki-extensions-Bucket|GitHub]] |[[github:ProfessionalWiki/NeoWiki|GItHub]] |- | Doplňková rozšíření | ~ 40<ref>{{ll|Category:Semantic MediaWiki extensions}}</ref>, e.g. {{ll|Extension:Semantic Result Formats|Semantic Result Formats}}, {{ll|Extension:Semantic Bundle|Semantic Bundle}}, {{ll|Extension:Semantic Scribunto|Semantic Scribunto}} | ~12<ref>{{ll|Category:Wikibase extensions}}</ref>, e.g. {{ll|Extension:Wikibase Repository|Wikibase Repository}}, {{ll|Extension:Wikibase Client|Wikibase Client}}, {{ll|Extension:WikibaseLexeme|WikibaseLexeme}}, [https://wikiba.se/applications/#query-service Query Service] | 2 ([[Special:MyLanguage/Extension:Page Forms|Formuláře stránek]], [[Special:MyLanguage/Extension:Page Schemas|Schémata stránek]]). Cargo poskytuje některé nebo všechny funkce sémantické MediaWiki, formáty sémantických výsledků, mapy, sémantický rozbor, sémantické složené dotazy, sémantické interní objekty a sémantické Scribunto.<ref>[[Extension:Cargo/Cargo and Semantic MediaWiki]].</ref> | {{ll|Extension:ContactManager|ContactManager}} |{{ll|Extension:Lua|Lua}} | |} <span id="Alternative_comparisons"></span> == Alternativní přirovnání == * {{ll|Extension:Cargo/Cargo and Semantic MediaWiki|2=Cargo a sémantická MediaWiki}} * [https://professional.wiki/en/articles/managing-data-in-mediawiki Semantic MediaWiki vs Wikibase vs Cargo] od [https://professional.wiki Professional Wiki] <span id="References"></span> == Poznámky pod čarou == <references/> <span id="See_also"></span> == Související odkazy == * {{ll|Multi-Content Revisions}} – schopnost spravovat různé nezávislé objekty obsahu na stejné stránce wiki * {{ll|Extension:WikiDB|WikiDB}} – poskytuje databázové funkce, poněkud podobné sémantickým (významovým) vlastnostem. * {{ll|Extension:JsonConfig|JsonConfig}} – schopnost spravovat různé nezávislé objekty obsahu na stejné stránce wiki změnou technologie na back-endu MediaWiki. * {{ll|Extension:External Data|External Data}} – přístup k datům z externí adresy URL, místního souboru a databáze SQL nebo MongoDB * {{ll|Structured data across Wikimedia}} – projekt 2021–2023 pro zlepšení podpory strukturovaných dat v MediaWiki * {{ll|Category:Data management extensions}} [[Category:MediaWiki Introduction{{#translation:}}]] [[Category:Extension comparisons{{#translation:}}]] dzwyebvdye9xst0dl8zgja6uqob34kt Extension:NoTOC/ru 102 1425951 8365106 5910914 2026-05-04T10:21:21Z FuzzyBot 451990 Updating to match new version of source page 8365106 wikitext text/x-wiki <languages /> {{Unmaintained extension|alternative={{ll|Extension:NoTOCModern}}}} {{Extension code in wiki}} {{Extension |status = unmaintained |type1 = parser |type2 = |hook1 = ParserClearState |hook2 = |username = Frantik |author = Andrew Fitzgerald |description = <span lang="en" dir="ltr" class="mw-content-ltr">Turns off Table of Contents by default on all pages</span> |image = |imagesize = |version = 0.1.1 |update = 2013-12-11 |mediawiki = |php = |license = GPL-2.0-or-later |download = <span lang="en" dir="ltr" class="mw-content-ltr">See the [[#Code|code section]]</span> |needs-updatephp = No |readme = |changelog = |parameters = |tags = |rights = |example = |compatibility = }} Расширение '''NoTOC''' скрывает содержание по умолчанию. <span lang="en" dir="ltr" class="mw-content-ltr">The magic word <nowiki>__TOC__</nowiki> can still be used normally.</span> <span id="Installation"></span> ==Установка== {{ExtensionInstall |download-link=[[#Code|<span lang="en" dir="ltr" class="mw-content-ltr">Copy the code into files</span>]] }} <span id="Code"></span> == Код == ;NoTOC.php <syntaxhighlight lang="php"> <?php /** * NoTOC extension - Turns off the Table of Contents (TOC) by default on all pages * @version 0.1.1 - 2013/12/11 * * @link https://www.mediawiki.org/wiki/Extension:NoTOC Documentation * @link https://www.mediawiki.org/wiki/Extension_talk:NoTOC Support * * @ingroup Extensions * @package MediaWiki * @author Andrew Fitzgerald (Frantik) * @author Karsten Hoffmeyer (Kghbln) * @copyright (C) 2010 Andrew Fitzgerald * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ // check the call if ( !defined( 'MEDIAWIKI' ) ) { die( 'This file is a MediaWiki extension and thus not a valid entry point.' ); } // provide information $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'NoTOC', 'author' => array( 'Andrew Fitzgerald', '...' ), 'url' => 'https://www.mediawiki.org/wiki/Extension:NoTOC', 'descriptionmsg' => 'notoc-desc', 'version' => '0.1.1' ); // show way to files $wgExtensionMessagesFiles['NoTOC'] = dirname( __FILE__ ) . '/NoTOC.i18n.php'; // register hooks $wgHooks['ParserClearState'][] = 'efMWNoTOC'; // perform purpose function efMWNoTOC($parser) { $parser->mShowToc = false; return true; } </syntaxhighlight> ;NoTOC.i18n.php <syntaxhighlight lang="php"> <?php /** * Internationalization file for the NoTOC extension. * * @licence GNU GPL v2+ * @author Karsten Hoffmeyer (Kghbln) */ $messages = array(); /** English * @author Frantik * @author Kghbln */ $messages['en'] = array( 'notoc-desc' => 'Turns off the Table of Contents (TOC) by default on all pages', ); /** Message documentation (Message documentation) * @author Kghbln */ $messages['qqq'] = array( 'notoc-desc' => '{{desc|name=NoTOC|url=https://www.mediawiki.org/wiki/Extension:NoTOC}}', ); /** German (Deutsch) * @author Kghbln */ $messages['de'] = array( 'notoc-desc' => 'Unterdrückt die automatische Generierung des Inhaltsverzeichnisses', ); </syntaxhighlight> <span id="See_also"></span> == См. также == * {{ll|Extension:ForceTocOnEveryPage}} * {{ll|Extension:DeToc}} - <span lang="en" dir="ltr" class="mw-content-ltr">This can be used to extract TOC HTML and to remove it or put it in some other section of the page.</span> [[Category:TOC extensions{{#translation:}}]] hfm32g7kbxm4yzs67e3f0kcgdwyc2n8 Extension:PageTriage/ru 102 1425967 8365072 8157894 2026-05-04T07:51:37Z FuzzyBot 451990 Updating to match new version of source page 8365072 wikitext text/x-wiki <languages /> {{Extension |templatemode = |status = stable |type1 = special |type2 = interface |newhook1 = |newhook2 = |username = |author = [[User:Kaldari|Ryan Kaldari]], [[User:Bsitu|Benny Situ]] |description = Упрощает рассмотрение и утверждение новых страниц |image = Extension-PageTriage Special-NewPagesFeed Screenshot.png |imagesize = 300 |version = |update = |version preview = |update preview = |compatibility policy = rel |mediawiki = |php = |composer = |table1 = pagetriage_page |table2 = pagetriage_page_tags |table3 = pagetriage_tags |download = {{WikimediaDownload|phab=EPTR}} |readme = |changelog = |example = [[wikipedia:Special:NewPagesFeed | Special:NewPagesFeed on the English Wikipedia]] |namespace = |tags = |compatibility = |bugzilla = |phabricator = PageTriage |vagrant-role = }} '''PageTriage''' — это расширение, которое предоставляет многофункциональный интерфейс для сортировки недавно созданных статей. Оно предназначено для замены основной функции ''патрулирования новых страниц'' и добавления дополнительных возможностей для просмотра, пометки и улучшения новых статей. Оно добавляет страницу Special:NewPagesFeed и панель управления новыми страницами для участников с правом 'patrol'. Расширение разработано [[Wikimedia_Features_engineering|командой Features Engineering]] Фонда Викимедиа. Дополнительные сведения см. в разделе ''[[Page Curation|Курирование страниц]]''. Важно отметить, что некоторые настройки и код специфичны для англоязычной Википедии, и в нынешнем виде расширение практически невозможно интернационализировать. (См. [[Phabricator:T50552]].) [[File:Page-Curation-Video.ogv|thumb|An overview of the page curation feature. The interface in the video is outdated but the content remains useful.]] <span id="Installation"></span> == Установка == [[File:PageTriage-ListView-Whole.png|thumb|Screenshot of Special:NewPagesFeed as it appeared in 2012]] {{ExtensionInstall |db-update=yes |registration=required |localsettings= }} == Checking for successful install == <div lang="en" dir="ltr" class="mw-content-ltr"> To actually see the extension working: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Create a new page containing just a few sentences of text as an anonymous user. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Visit Special:NewPagesFeed </div> <span lang="en" dir="ltr" class="mw-content-ltr">The new page should appear, flagged as "{{int|pagetriage-no-categories}}", "{{int|pagetriage-orphan}}", etc.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To see the page curation toolbar:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Login as a user with the 'sysop' permission, or add a group with the "[[Special:MyLanguage/Help:Patrolled_edits|patrol]]" permission, and add some user to that group, and login as that user. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Visit Special:NewPagesFeed </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Now you should see a "{{int|pagetriage-triage}}" button next to the new page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Click this and you should see the page curation toolbar on the new page. </div> <span id="Advanced_installation"></span> == Расширенная установка == <div lang="en" dir="ltr" class="mw-content-ltr"> === Additional extensions === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For full functionality, you'll also need to install some additional extensions, although PageTriage works without them. </div> * {{ll|Extension:Echo|Echo}} - Allows users to receive notifications for things like when an article they created has been marked as reviewed. * {{ll|Extension:ORES|ORES}} - In Special:NewPagesFeed, allows filtering by "predicted class" (<code>articlequality</code>: stub, start, c-class, b-class, good, featured) and "potential issues" (<code>draftquality</code>: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because <code>draftquality</code> needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's [[git:mediawiki/extensions/ORES/+/8bd39f26548d58fa8bf6765e1c23f5e3086f1cd4/extension.json#225|extension.json file]]. * {{ll|Extension:WikiLove|WikiLove}} - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily. === Enabling draft namespace === By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php <syntaxhighlight lang="php" copy> // These three settings are optional, and will enable the Articles-for-Creation mode. $wgPageTriageDraftNamespaceId = 118; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft'; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk'; </syntaxhighlight> When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed. By default pages edited in the draft namespace will be "unsubmitted". Articles in the draft namespace can be submitted for review by adding <nowiki>[[Category:Pending_AfC_submissions]]</nowiki> to the draft page. At which point they will show up under "awaiting review". Note the toolbar controlled by the configuration variable '''$wgPageTriageEnableCurationToolbar''' does not show up in the draft namespace. === Cron jobs === To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: <code>cron/updatePageTriageQueue.php</code> == Manual testing == === Special:NewPagesFeed -> Articles for Creation === * Enable draftspace by following the directions above in the section [[#Enabling draft namespace]]. * In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories: ** Unsubmitted: (no category) ** Awaiting review: Category:Pending AfC submissions ** Under review: Category:Pending AfC submissions being reviewed now ** Declined: Category:Declined AfC submissions Note: The Page Curation toolbar does not display for drafts. === ORES === Enwiki has the [[Extension:ORES|ORES extension]] installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure: * Clone Extension:ORES and add <code>wfLoadExtension( 'ORES' );</code> in <code>LocalSettings.php</code> * Add this to <code>LocalSettings.php</code> <syntaxhighlight lang="php" copy> $wgPageTriageEnableOresFilters = true; $wgOresWikiId = 'enwiki'; $wgOresModels = [ 'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ], 'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'sources' => [ 1 ] ] ]; </syntaxhighlight> * Run <code>php maintenance/run.php ./extensions/ORES/maintenance/BackfillPageTriageQueue.php</code> == Determining if a page is reviewed == === Status codes === There are status codes used to track whether a page is reviewed or not. These are the values given when you query <code>patrol_status</code>, <code>ptrp_reviewed</code>, and <code>ptrl_reviewed</code>: * Unreviewed ** 0 - unreviewed * Reviewed ** 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar) ** 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page) ** 3 - autopatrolled (someone with the <code>autopatrol</code> user right created the page, or moved the page from a non-tracked namespace to a tracked namespace) ** no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job) === Via the API === To check the review status of pages using an API query, you can use <code>api.php?action=query&prop=isreviewed</code>. Sample JavaScript code:<syntaxhighlight lang="js" copy> /** * @param {number} pageID The page ID number. A positive number with no commas. */ async isReviewed(pageID) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', pageids: pageID, } ); return response.query.pages[0].isreviewed; } /** * @param {string} title One title. Can include namespace. Example: User:Test */ async function isReviewed(title) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', titles: title, } ); return response.query.pages[0].isreviewed; } </syntaxhighlight> === Via SQL === To check the review status of pages using an SQL query, you need to query the <code>{{ll|Extension:PageTriage/pagetriage page table|pagetriage_page}}</code> table and the <code>ptrp_reviewed</code> field. Follow the directions in [[#Status codes]] to interpret the values of this field. <syntaxhighlight lang="sql" copy> /* By page_id */ SELECT ptrp_reviewed FROM pagetriage_page WHERE ptrp_page_id = 71318376 /* By page_title and page_namespace */ SELECT ptrp_reviewed FROM pagetriage_page JOIN page ON page_id = ptrp_page_id WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces AND page_namespace = 0 </syntaxhighlight> == SQL == === SQL tables === {| class="wikitable" |+ !Name !Prefix !Description !Old entry deletion strategy !Service classes (when refactoring, SQL queries should be moved to here) !Data classes |- |[[Extension:PageTriage/pagetriage page table|pagetriage_page]] |ptrp_ |The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query <code>ptrp_reviewed > 0</code> in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. |All articles deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. |QueueManager, QueueLookup |QueueRecord |- |[[Extension:PageTriage/pagetriage page tags table|pagetriage_page_tags]] |ptrpt_ |Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the <code>pagetriage_tags</code> table. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. |All article metadata deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status. | | |- |[[Extension:PageTriage/pagetriage tags table|pagetriage_tags]] |ptrt_ |A dictionary of page_tags, and their corresponding ID number. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. | | | |} === pagetriage_page_tags === <code>pagetriage_page_tags</code> data is updated by calling <code>ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata()</code>. This is called in the following hooks: * <code>onPageMoveComplete()</code> - runs when moving a page * <code>onLinksUpdateComplete()</code> - runs when saving an edit * <code>onMarkPatrolledComplete()</code> - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user. ==== List of tags ==== The <code>pagetriage_page_tags</code> are as follows: * Author information ** user_id ** user_name - there's a filter where you can type in their username ** user_editcount ** user_creation_date ** user_autoconfirmed ** user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with <code>MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()</code> ** user_bot ** user_block_status * Deletion tags - will display a black trash can icon if marked for deletion ** afd_status ** blp_prod_status ** csd_status ** prod_status * Special:NewPagesFeed red warning text ** category_count - No categories ** linkcount - Orphan ** reference - No citations ** recreated - Previously deleted ** user_block_status - Blocked * Page information ** page_len - size of article, in bytes ** rev_count - number of edits to the article ** snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article * afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined * copyvio - latest revision ID that has been tagged as a likely copyright violation, if any == PHP == <div lang="en" dir="ltr" class="mw-content-ltr"> === Extension configuration === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The extension is based on the 'patrol' right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For more information about configuring patrolling, see {{ll|Manual:Patrolling}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following configuration variables can be set from your LocalSettings.php file: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">Variable</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Default</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> |- | {{phpi|$wgPageTriageEnableCurationToolbar}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set to false to disable the [[Special:MyLanguage/Page Curation#User Experience: Curation Toolbar|curation toolbar]]</span> |- | {{phpi|$wgPageTriageInfiniteScrolling}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not to use infinite scrolling in the new pages feed</span> |- | {{phpi|$wgPageTriageMaxAge}} |90 | The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true). |- | {{phpi|$wgPageTriageNamespaces}} |NS_MAIN | The namespaces that PageTriage is active in. |- | {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} | {{phpi|false}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set this to true if new, unreviewed articles should be set to noindex.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In other words, if they should not be indexed by search engines until they are reviewed.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> See [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/extension.json#698|extension.json]] for the full list of config variables. </div> === API === <div lang="en" dir="ltr" class="mw-content-ltr"> PageTriage adds the following API endpoints which can be used: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">API</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Triggering action</span> |- |pagetriageaction | <span lang="en" dir="ltr" class="mw-content-ltr">Mark a page as reviewed or unreviewed, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to mark a page as reviewed * Using the Page Curation toolbar to mark a page as unreviewed |- |pagetriagelist | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves the list of pages in the queue, and each page's metadata, including their reviewed status.</span> To retrieve one page, you must provide the <code>page_id</code>. To provide multiple pages, you must select one of <code>showreviewed</code>/<code>showunreviewed</code>, and one of <code>showredirs</code>/<code>showdeleted</code>/<code>showothers</code>, or no pages will be returned. |Read | * Loading the Page Curation toolbar (automatically loaded if you have the <code>patrol</code> userright and view a page that is unpatrolled or recently patrolled) * Viewing Special:NewPagesFeed (provides the list of articles) |- |pagetriagestats | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves stats about the number of pages in the queue for use in the header of Special:NewPagesFeed.</span> |Read | * Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer) |- |pagetriagetagcopyvio |Mark an article as a potential copyright violation, and logs the action in Special:Log. |Write | * Marking as a copyright violation by a bot with the <code>copyviobot</code> userright |- |pagetriagetagging | <span lang="en" dir="ltr" class="mw-content-ltr">Add clean-up tags or deletion templates to a page, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to place a maintenance tag on an article * Using the Page Curation toolbar to place a deletion tag on an article |} === Special:Log === The following logs are created by the extension: {| class="wikitable" |+ !Special:Log !<code>log_type</code> !<code>log_action</code> !Description !Notes |- |Page curation log |pagetriage-curation |delete, enqueue, reviewed, tag, unreviewed |Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed | |- |Potential copyright violation log |pagetriage-copyvio |insert |Allows a bot to log potential copyright violations |Doesn't display unless you set {{phpi|$wgPageTriageEnableCopyvio}} to true |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Entry points === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The extension's features can be triggered by various actions: </div> {| class="wikitable" |+ !Entry point type !File location !Notes |- |5 APIs |includes/Api/* | |- |1 special page |includes/SpecialNewPagesFeed.php | |- |20 hooks | * includes/Hooks.php * includes/HookHandlers/UndeleteHookHandler.php * includes/HookHandlers/Schema.php | |- |1 cron job |cron/updatePageTriageQueue.php |runs every 48 hours |- |7 maintenance scripts |maintenance/* |need to be run manually |} Here is a list of some actions and the corresponding entry points they trigger: {| class="wikitable" |+ !Action !Entry points used |- |View Main page | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() |- |Save an edit to the Main page | * Hooks.php -> onRevisionFromEditComplete() * Hooks.php -> onPageSaveComplete() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onLinksUpdateComplete() |- |Type in search box, triggering search suggestions | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onApiMain__moduleManager() |- |View Special:NewPagesFeed | * Hooks.php -> onBeforeCreateEchoEvent() * SpecialNewPagesFeed * ApiPageTriageStats * ApiPageTriageList |- |View an unreviewed article while logged in and having the <code>patrol</code> permission. | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onResourceLoaderGetConfigVars() * Hooks.php -> onDefinedTags() * Hooks.php -> onApiMain__moduleManager() * ApiPageTriageList (by <code>page_id</code>) |} ==== Hooks ==== {| class="wikitable" |+ !File !Group !Hook !Actions it performs |- | rowspan="18" |Hooks.php |Move page |[[Manual:Hooks/PageMoveComplete|onPageMoveComplete]] |Changes patrolled status, updates cache, updates metadata in <code>pagetriage_page_tags</code> table. |- | rowspan="3" |Edit page |[[Manual:Hooks/RevisionFromEditComplete|onRevisionFromEditComplete]] |Handles marking '''redirects that flip to articles''' as unreviewed. [[Deferred updates|DeferredUpdate]]. |- |[[Manual:Hooks/PageSaveComplete|onPageSaveComplete]] |Add '''new articles''' to the New Pages Feed and <code>pagetriage_page</code> table. |- |[[Manual:Hooks/LinksUpdateComplete|onLinksUpdateComplete]] |[[Deferred updates|DeferredUpdate]] of metadata / <code>pagetriage_page_tags</code> table. |- |Every page load |[[Manual:Hooks/ArticleViewFooter|onArticleViewFooter]] | * Turn on '''noindex''' for new, unreviewed articles. * Determine whether to load a '''link for autopatrolled users to unpatrol''' their article * Displays the '''Page Curation toolbar''' on recently created pages. * Create '''"Add to New Pages Feed" toolbox link''' for old articles. |- |[[Help:Patrolled edits]] |[[Manual:Hooks/MarkPatrolledComplete|onMarkPatrolledComplete]] |Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage. |- | rowspan="2" |Blocking and unblocking |[[Manual:Hooks/BlockIpComplete|onBlockIpComplete]] | rowspan="2" |Update article metadata / <code>pagetriage_page_tags</code> when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users. |- |[[Manual:Hooks/UnblockUserComplete|onUnblockUserComplete]] |- | |[[Manual:Hooks/ResourceLoaderGetConfigVars|onResourceLoaderGetConfigVars]] |Adjusts some config vars related to draft namespace ID. |- | rowspan="3" |[[Extension:Echo]] |[[Manual:Hooks/BeforeCreateEchoEvent|onBeforeCreateEchoEvent]] | rowspan="3" |Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed. |- |[[Manual:Hooks/EchoGetDefaultNotifiedUsers|onEchoGetDefaultNotifiedUsers]] |- |[[Manual:Hooks/LocalUserCreated|onLocalUserCreated]] |- |[[Extension:ORES]] |[[Manual:Hooks/ORESCheckModels|onORESCheckModels]] |Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio. |- | rowspan="3" |[[Help:Tags]] |[[Manual:Hooks/ListDefinedTags|onListDefinedTags]] | rowspan="3" |Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage". |- |[[Manual:Hooks/ChangeTagsAllowedAdd|onChangeTagsAllowedAdd]] |- |[[Manual:Hooks/ChangeTagsListActive|onChangeTagsListActive]] |- |API |[[Manual:Hooks/ApiMain::moduleManager|onApiMain__moduleManager]] |Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings. |- | rowspan="2" |Delete or undelete page |[[Manual:Hooks/PageDeleteComplete|onPageDeleteComplete]] |If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache. |- |HookHandlers/ UndeleteHookHandler.php |[[Manual:Hooks/ArticleUndelete|onArticleUndelete]] |If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed. |- |HookHandlers/ Schema.php |SQL |[[Manual:Hooks/LoadExtensionSchemaUpdates|onLoadExtensionSchemaUpdates]] | * The code that installs PageTriage's 4 SQL tables when you run <code>php maintenance/run.php update</code>. * Will also alter schemas from previous versions to match the latest schema. * This is also where all the '''pagetriage_tags''' are hard-coded. |} ==== Cron jobs and maintenance scripts ==== {| class="wikitable" |+ !File !What it does !Why run it? When is it useful? ![[phab:T341431|Safe to delete maintenance script?]] |- |cron/updatePageTriageQueue.php |Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". |Keeps the SQL tables from getting too big. | |- |maintenance/cleanupPageTriage.php |Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. |Fix a bug? [[phab:T321982|T321982]] | |- |maintenance/cleanupPageTriageLog.php |Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log |One time conversion of old log entries to modern format? Logs are now always written in the new format. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/6d9105c020c62d648a4ef6be957297bbc8a6d7d2]. |Probably |- |maintenance/cleanupPageTriagePageTags.php |Remove page from <code>pagetriage_page_tags</code> if they are not in <code>pagetriage_page</code> |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/00a752368e00e0d8b29a4908bfc3bab3096268dd]. |Probably |- |maintenance/DeleteAfcStates.php |Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ab2d8d4a2f9d0f4ff981afaee35a85f33edb5e99]. [[phab:T203184#4592953|T203184#4592953]]. |Probably |- |maintenance/FixNominatedForDeletion.php |Set <code>pagetriage_page.ptrp_deleted</code> if the page is has any <code>pagetriage_page_tags</code> related to deletion (e.g. prod_status, blp_prod_status, etc.) |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ff0c433226300aeba692089b5389435d47feef1e]. [[phab:T202582|T202582]]. |Probably |- |maintenance/populateDraftQueue.php |Add missing Draft namespace pages to the AfC triage queue. |Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/59e1fedffcdafc46722d7231011aee194db9ee08]. | |- |maintenance/updateUserMetadata.php |Former cron job. Update expired user metadata in the <code>pagetriage_page_tags</code> table |[https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/92a675a5f1f2e07cee532ec90fc57eee7f2cd49b]. [[phab:T341432|T341432]]. | |} === NOINDEX === NOINDEX refers to the HTML code <code>&lt;meta name="robots" content="noindex"></code>, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode <code><nowiki>__NOINDEX__</nowiki></code>. When {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in <code>includes/Hooks.php</code>, in the <code>onArticleViewFooter()</code> method. ==== First check ==== * First check: Noindex the page if ALL of the following are true: ** {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is turned on ** Page age is less than {{phpi|$wgPageTriageMaxAge}} (set to 90 days on enwiki) ** Page is in <code>pagetriage_page</code> table<ref>Checked by <code>isPageUnreviewed()</code></ref> ** Page is marked as unpatrolled (ptrp_status = 0) ==== Second check ==== * Second check: If the wikitext has the <code><nowiki>__NOINDEX__</nowiki></code> magic word, noindex the page if ALL of the following are true: ** Page age is less than {{phpi|$wgPageTriageMaxNoIndexAge}} (set to 90 days on enwiki) ** If {{phpi|$wgPageTriageMaxNoIndexAge}} is not null, page is in <code>pagetriage_page</code> table<ref>Checked by <code>isNewEnoughToNoIndex()</code>, if it doesn't exit early due to <code>$wgPageTriageMaxNoIndexAge</code> being <code>null</code>.</ref> The main use case for the <nowiki>__NOINDEX__</nowiki> magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See [https://en.wikipedia.org/w/index.php?search=NOINDEX&title=Special:Search&profile=advanced&fulltext=1&ns10=1 this search]. ==== Is the page in the <code>pagetriage_page</code> table? ==== In regards to the requirement "Page is in <code>pagetriage_page</code> table", there are several ways a for a page to get into this table: * Not been deleted by a PageTriage cron job ** One cron job deletes redirects older than {{phpi|$wgPageTriageRedirectAutoreviewAge}} days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them. ** Another cron job deletes reviewed pages after 30 days of being reviewed * In a namespace that PageTriage is configured to patrol * Isn't an article that is so old it predates the installation of PageTriage == JavaScript == === Directory structure === * /modules/ ** ext.pageTriage.article - related to marking an article as reviewed ** ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar ** ext.pageTriage.init - creates a mw.pageTriage object ** ext.pageTriage.newPagesFeed - Special:NewPagesFeed ** ext.pageTriage.sidebarLink - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates ** ext.pageTriage.toolbar - Page Curation toolbar <!--** ext.pageTriage.toolbar - Page Curation toolbar (Vue version)--> ** ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code ** ext.pageTriage.util - Backbone.js models (article, revision, stats) ** external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore <div lang="en" dir="ltr" class="mw-content-ltr"> === Toolbar === </div> The toolbar has three states: <code>maximized</code>, <code>minimized</code>, and <code>hidden</code>. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu. === External libraries === * front end ** old (moving away from) *** [[w:Backbone.js|Backbone.js]] *** [[w:jQuery|jQuery]] *** jQuery Badge *** jQuery Waypoints *** [[w:jQuery UI|jQuery UI]] *** [[w:Mustache (template system)|Mustache (template system)]] *** [[OOUI]] - used in modules/ext.PageTriage.enqueue ([https://codesearch.wmcloud.org/deployed/?q=oojs&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FPageTriage codesearch]) *** [[w:Underscore.js|Underscore.js]] ** new (moving towards) *** Codex *** [[w:Moment.js|Moment.js]] *** Vue Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, [[phab:T208256|we are interested in replacing these front end libraries]], to make the extension easier to maintain. <div lang="en" dir="ltr" class="mw-content-ltr"> === Client-side hooks === </div> ==== mw.hook ==== * <code>ext.pageTriage.toolbar.ready</code> ==== mw.pageTriage.actionQueue ==== <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage provides a specialised action queue system to allow other scripts and gadgets to integrate with it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is similar to <code>mw.hook</code> except that it uses promises.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done using the <code>mw.pageTriage.actionQueue</code> module.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the comments in the {{tmpl|0={{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=$1}}|source code}} for documentation on how the system works.</span> {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">It is [$1 not currently used by any scripts or gadgets on enwiki], but it is used internally by PageTriage.</span> |1=https://en.wikipedia.org/w/index.php?search=%22actionQueue%22&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1&ns2300=1&ns2301=1&ns2302=1&ns2303=1 }} <span lang="en" dir="ltr" class="mw-content-ltr">The actionQueue module is available after the mw.hook <code>ext.pageTriage.toolbar.ready</code> fires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage will give the action queue handler an Object with the following data, in addition to other data as noted below:</span> * <code>pageid</code> — <span lang="en" dir="ltr" class="mw-content-ltr">ID of the page being reviewed.</span> * <code>title</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Title of the page, including namespace.</span> * <code>reviewer</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of who is using PageTriage.</span> * <code>creator</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of the creator of the page.</span> * <code>reviewed</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the page is currently or will be marked as reviewed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ===== Available actions ===== </div> * <code>delete</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the reviewer tags a page for deletion. The data given to the handler also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An object of all the templates added to the page. The keys are the template title, and the values are an object of metadata, including things like the speedy deletion code.</span> * <code>mark</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the review status of a page is changed. Also includes:</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> * <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when maintenance tags are added to the page. Also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An array of the titles of all templates that were added to the page.</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> <span id="Example"></span> ===== Пример ===== <div lang="en" dir="ltr" class="mw-content-ltr"> To use the action queue, register a function to be ran when an aforementioned action is fired. PageTriage will wait for any asynchronous code to complete before doing anything else, such as refreshing the page. For example, to edit [[Sandbox]] after a page has been marked as reviewed, you could use: </div> <syntaxhighlight lang="javascript"> $( function () { // You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time. mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) { // Listen for the 'mark' action. queue.add( 'mark', function ( data ) { return new mw.Api().edit( 'Sandbox', function ( revision ) { // Replace 'foo' with the note the reviewer left. return revision.content.replace( 'foo', data.note ); } ); } ); } ); } ); </syntaxhighlight> === Where are preferences stored? === Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is <code>userjs-NewPagesFeedFilterOptions</code>. It is set using <code>mw.Api().saveOption()</code> and read using <code>mw.user.options.get()</code>. This data ends up in the SQL <code>user_properties</code> table. Temporary accounts (IP masking) will not be able to store their preferences. == Installation on WMF wikis == This extension was designed for English Wikipedia. There is interest in changing its code and making it more useful to other wikis ([[phab:T50552]]), however this is challenging from a technical perspective and progress is slow. For now, the following are true: * PageTriage is allowed to be installed on other wikis<ref>https://meta.wikimedia.org/w/index.php?title=Limits_to_configuration_changes&diff=prev&oldid=26121135</ref> (although as of 2024 this hasn't happened yet). * The setting <code>$wgPageTriageEnableExtendedFeatures</code> can be set to <code>false</code> to turn off English Wikipedia-specific features such as maintenance tags and deletion tags in the Page Curation toolbar. * There are concerns that the noindex features (controlled by <code>$wgPageTriageNoIndexUnreviewedNewArticles</code> and <code>$wgPageTriageMaxNoIndexAge</code>) create search engine optimization problems, and these noindex features should not be enabled on new wikis without first discussing it with product manager [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]. * Like most other WMF-deployed extensions, PageTriage supports internationalization, and has its interface [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/i18n/|translated into many other languages]]. <span id="See_also"></span> == См. также == * [[commons:Category:PageTriage extension]] * [[Help:New pages feed]] * [[w:Wikipedia:Page Curation/Help]] == Notes == <references /> {{OnWikimedia}} {{Used by}} [[Category:API extensions{{#translation:}}]] pz5qw4ysfuchy8gkeznjuslb0ucmtht Manual:Managing data in MediaWiki/ru 100 1427035 8364310 8363595 2026-05-03T12:44:49Z FuzzyBot 451990 Updating to match new version of source page 8364310 wikitext text/x-wiki <languages/> <span class="mw-translate-fuzzy">MediaWiki была разработана для управления в основном текстовой информацией, и она делает это очень хорошо.</span> <span lang="en" dir="ltr" class="mw-content-ltr">A limited amount of structure is available: {{ll|Help:Namespaces|namespaces}}, {{ll|Help:Subpages|subpages}} and {{ll|Help:Categories|categories}} help to group similar pages together, while features like {{ll|Infobox|infoboxes}} and {{ll|Gallery|galleries}} help to structure the contents within each page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, MediaWiki by itself does not truly provide ways to manage structured data: data that can be queried, filtered, and in some cases displayed with visualizations including tables, charts, maps<ref>see also [[Wikimedia Maps]]</ref> and calendars.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For that, a number of dedicated [[Special:MyLanguage/Manual:Extensions|extensions]] exist.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following table describes the extensions that can store the data edited by users in a MediaWiki database, from where it can then be queried. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is not a list of all structured data functionality; the "[[#See also|See also]]" section lists other extensions and features that can be used for storing or displaying structured data. </div> {| class="wikitable" |- ! Особенность ! [[File:20210702_Semantic_MediaWiki_logo_with_wordmark.png|100px]]<br/>[https://www.semantic-mediawiki.org/ Semantic MediaWiki] ! [[File:Wikibase_Suite_Vertical_2x_RGB.png|100px]]<br/>[https://wikiba.se/ Wikibase] ! [[File:Cargo logo.png|50px]]<br/>{{ll|Extension:Cargo|nsp=0}} ! {{ll|Extension:VisualData|VisualData}} !{{ll|Extension:Bucket|Bucket}} ! {{ll|Extension:NeoWiki|NeoWiki}} |- | Основной вариант использования | Управление данными в рамках установленной MediaWiki на основе стандартов [[w:Semantic Web|Semantic Web]]. | <span class="mw-translate-fuzzy">Подпитка от [[w:ru:Wikidata|Wikidata]].</span> | Управление данными в рамках установленной MediaWiki. | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation based on JSON-schema.</span> |lightweight Lua interface for storing and accessing structured data on wiki pages |Knowledge management system that combines collaborative editing and a [[:en:knowledge_graph|knowledge graph]] |- | Подход | Данные (свойства) аннотируются в обычном викитексте или по шаблонам. С типом данных "reference"(ссылка/примечание) свойства могут использоваться для описания элементов с помощью утверждений.<ref>https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data</ref> | Свойства определяются и используются для описания элементов с помощью утверждений. | Данные хранятся в таблицах базы данных, причем каждая таблица соответствует шаблону. | <span lang="en" dir="ltr" class="mw-content-ltr">Data are stored in a dedicated slot with JSON content model</span> |Data is stored in '''buckets''', which are database tables with specific columns that you can define |Schemas can be defined and applied to wiki pages, stored in a dedicated slot as JSON data. |- | Доступно с | 2005 | 2012 | 2015 | 2022 <span lang="en" dir="ltr" class="mw-content-ltr">(formerly known as {{ll|Extension:PageProperties|PageProperties}})</span> |2025 |2026 |- | Активные установки | 1000 сайтов<ref>https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki</ref> | 100 сайтов<ref>https://wikiapiary.com/wiki/Extension:WikibaseRepository</ref><ref>https://wikibase.world</ref><ref>https://addshore.com/2024/10/visualizing-wikibase-connections-using-wikibase-world/</ref> | 100 сайтов<ref>https://wikiapiary.com/wiki/Extension:Cargo</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">n/a (new extension or unknown)</span> | | |- | Сообщество | 190+ разработчиков<ref>https://www.openhub.net/p/smw</ref> | 172+ разработчиков<ref>https://github.com/wikimedia/mediawiki-extensions-Wikibase</ref> | 63+ разработчиков<ref>https://github.com/wikimedia/mediawiki-extensions-Cargo</ref> | ([[User:Thomas-topway-it|<span lang="en" dir="ltr" class="mw-content-ltr">main developer</span>]]) |[https://weirdgloop.org/discord Weird Gloop's Discord] |[https://echolot-eccch.eu/ ECHOLOT project], [https://professional.wiki/ Professinal Wiki], [https://knowledge.wiki KM-A], [https://bluespice.com/bluespice-galaxy/ BlueSpice Galaxy] |- | Хранилище | База данных MediaWiki, Elasticsearch, 5 различных хранилищ SPARQL<ref>https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore</ref> | База данных MediaWiki, Elasticsearch, хранилище SPARQL (Blazegraph для wikidata.org) | База данных MediaWiki (или отдельная база данных)<ref>{{ll|Extension:Cargo/Download and installation#Setting the Cargo database}}</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database</span> |MediaWiki database (MySQL/MariaDB) |different SPARQL stores, currently Neo4J |- | Определение свойства | Набором викитекста. Свойства можно задавать свободно. По умолчанию они будут иметь тип страницы и могут быть определены позже. <span lang="en" dir="ltr" class="mw-content-ltr">Datatypes can be changed any time.</span> | Свойства должны быть определены перед использованием и не могут быть легко изменены.<ref>[[d:Help:Data type#Changing datatype]]</ref> | Вместо использования свойств, таблицы данных определяются с заранее определенным (но реконфигурируемым) набором полей для каждой таблицы. | <span lang="en" dir="ltr" class="mw-content-ltr">Properties are defined through one or more json-schema defined through a {{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}}</span> |Tables in the Bucket: namespace |Form based schema editing |- | Объявление значения | Встроенный (<code><nowiki>[[Мое свойство::мое значение]]</nowiki></code>) или с помощью шаблонов. Ввод данных на основе формы от {{ll|Extension:Page_Forms|Page Forms}}. | Викибаза по умолчанию похожа на форму интерфейса ввода. | С функциями парсера в шаблонах. Ввод данных на основе формы от {{ll|Extension:Page_Forms|Page Forms}}. | <span lang="en" dir="ltr" class="mw-content-ltr">Inline or popup OOUI {{ll|Extension:VisualData/Forms|forms}} automatically generated from JSON-schemas</span> |via Lua call of the <code>bucket.put</code> function |OOUI based form editing |- | Предопределенные типы данных | 18<ref>https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes</ref> | 17<ref>[[d:Special:ListDatatypes]]</ref><ref><span lang="en" dir="ltr" class="mw-content-ltr">Some datatypes are defined by other extension: [[Special:MyLanguage/Extension:Math|Math]] and [[Special:MyLanguage/Extension:Score|Score]] both define one datatype, [[Special:MyLanguage/Extension:JsonConfig|JsonConfig]] defines two, [[Special:MyLanguage/Extension:WikibaseLexeme|WikibaseLexeme]] defines three, and Wikibase defines ten.</span></ref> | 18 | <span lang="en" dir="ltr" class="mw-content-ltr">4 (basic JSON-schema types) + 15 string formats</span> | 5 <ref>https://meta.weirdgloop.org/w/Extension:Bucket#Basic_usage</ref> | |- | Управление свойствами | определения типов, схемы ограничений, импорт онтологий | пользовательские или импорт онтологии Викиданных | Вместо использования свойств, таблицы данных определяются с заранее определенным (но реконфигурируемым) набором полей для каждой таблицы. | <span lang="en" dir="ltr" class="mw-content-ltr">through a graphical interface (dedicated {{ll|Extension:VisualData/Schema Builder|SchemaBuilder}})</span> | |through a graphical interface |- | <span lang="en" dir="ltr" class="mw-content-ltr">Page names and internal linking</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Page names are stored with their Q-numbers (displaying labels in available languages). Internal linking must be done to the Q-number; you cannot link to a label.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Schemas are stored in a dedicated namespace and JSON-data in a dedicated slot associated to wiki articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">JSON-data can be accessed through an extension of the wiki interface</span> | |MediaWiki pages can have schemas |- | Встроенные запросы | да, с функцией парсера | нет (внешние запросы SPARQL); [[phab:T67626|планируется]]<br/>поддержка через стороннее расширение {{ll|Extension:LinkedWiki|LinkedWiki}} | да, с функцией парсера | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | |yes, with parser functions via the SQL store |- | Внешний запрос | <span class="mw-translate-fuzzy">да, через API или запросами SPARQL (доступно через специальные расширения, такие как [[Extension:RDFIO/ru|RDFIO]] и [[Extension:LinkedWiki/ru|LinkedWiki]])</span> | да, со службой запросов SPARQL | да, с API | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with an API</span><ref>{{ll|Extension:VisualData/API}}</ref> | API is not yet stable <ref>https://meta.weirdgloop.org/w/Extension:Bucket</ref> |yes, with an API or SPARQL endpoint |- | Форматы результата<ref>"Форматы результата" означают способность вики отображать данные (результаты встроенного запроса) в различных форматах, например. таблицы, календари, карты, временные шкалы и т. д.</ref> | ~ 75<ref>https://www.semantic-mediawiki.org/wiki/Help:Result_formats</ref> | нет собственного отображения результатов; данные могут быть визуализированы с помощью: * Служба запросов или другие внешние инструменты * при доступе к данным вики через LUA (без поддержки запросов) * {{ll|Extension:LinkedWiki}} - третья сторона | ~ 25<ref>{{ll|Extension:Cargo/Display formats}}</ref> | 12+ (Json, Table, Datatable, Template, Calendar, Carousel, Map, pageid, pagetitle, count, raw, Lua ) <ref>{{ll|Extension:VisualData/Result_formats}}</ref> | | |- | Разработка | [[github:SemanticMediaWiki/SemanticMediaWiki|GitHub]] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Cargo Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/VisualData Gerrit] |[[github:weirdgloop/mediawiki-extensions-Bucket|GitHub]] |[[github:ProfessionalWiki/NeoWiki|GItHub]] |- | Дополнительные расширения | ~ 40<ref>{{ll|Category:Semantic MediaWiki extensions}}</ref>, e.g. {{ll|Extension:Semantic Result Formats|Semantic Result Formats}}, {{ll|Extension:Semantic Bundle|Semantic Bundle}}, {{ll|Extension:Semantic Scribunto|Semantic Scribunto}} | ~12<ref>{{ll|Category:Wikibase extensions}}</ref>, e.g. {{ll|Extension:Wikibase Repository|Wikibase Repository}}, {{ll|Extension:Wikibase Client|Wikibase Client}}, {{ll|Extension:WikibaseLexeme|WikibaseLexeme}}, [https://wikiba.se/applications/#query-service Query Service] | <span lang="en" dir="ltr" class="mw-content-ltr">2 ([[Special:MyLanguage/Extension:Page Forms|Page Forms]], [[Special:MyLanguage/Extension:Page Schemas|Page Schemas]]). Cargo provides some or all of the functionality of Semantic MediaWiki, Semantic Result Formats, Maps, Semantic Drilldown, Semantic Compound Queries, Semantic Internal Objects and Semantic Scribunto.</span><ref>[[Extension:Cargo/Cargo and Semantic MediaWiki]].</ref> | {{ll|Extension:ContactManager|ContactManager}} |{{ll|Extension:Lua|Lua}} | |} <span id="Alternative_comparisons"></span> == Альтернативные сравнения == * {{ll|Extension:Cargo/Cargo and Semantic MediaWiki|2=Cargo и Semantic MediaWiki}} * <span lang="en" dir="ltr" class="mw-content-ltr">[https://professional.wiki/en/articles/managing-data-in-mediawiki Semantic MediaWiki vs Wikibase vs Cargo] by [https://professional.wiki Professional Wiki]</span> <span id="References"></span> == Примечания == <references/> <span id="See_also"></span> == См. также == * {{ll|Multi-Content Revisions}} – <span class="mw-translate-fuzzy">Возможность управлять различными независимыми объектами контента на одной и той же вики-странице за счет изменения технологии серверной части MediaWiki.</span> * {{ll|Extension:WikiDB|WikiDB}} – Предоставляет функции базы данных, в чем-то похожие на семантические свойства. * {{ll|Extension:JsonConfig|JsonConfig}} – хранит JSON (включая табличные и картографические данные) на вики-страницах и разрешать доступ к ним через Lua; нет поддержки запросов * {{ll|Extension:External Data|External Data}} – <span class="mw-translate-fuzzy">доступ к данным из внешнего URL-адреса, локального файла и базы данных SQL или MongoDB (которая может содержать данные с веб-сайтов, отличных от MediaWiki)</span> * {{ll|Structured data across Wikimedia}} – <span lang="en" dir="ltr" class="mw-content-ltr">2021-2023 project for improving structured data support in MediaWiki</span> * {{ll|Category:Data management extensions}} [[Category:MediaWiki Introduction{{#translation:}}]] [[Category:Extension comparisons{{#translation:}}]] 77qwjfdvie1kmr024iwsi7sod8kil9y Extension:NoTOC/de 102 1427631 8365100 5910909 2026-05-04T10:21:17Z FuzzyBot 451990 Updating to match new version of source page 8365100 wikitext text/x-wiki <languages /> {{Unmaintained extension|alternative={{ll|Extension:NoTOCModern}}}} {{Extension code in wiki}} {{Extension |status = unmaintained |type1 = parser |type2 = |hook1 = ParserClearState |hook2 = |username = Frantik |author = Andrew Fitzgerald |description = Schaltet auf allen Seiten standardmäßig das Inhaltsverzeichnis aus |image = |imagesize = |version = 0.1.1 |update = 2013-12-11 |mediawiki = |php = |license = GPL-2.0-or-later |download = Siehe den [[#Code|Code-Abschnitt]] |needs-updatephp = No |readme = |changelog = |parameters = |tags = |rights = |example = |compatibility = }} <span lang="en" dir="ltr" class="mw-content-ltr">The '''NoTOC''' extension hides the table of contents by default.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The magic word <nowiki>__TOC__</nowiki> can still be used normally.</span> <span id="Installation"></span> == Installation == {{ExtensionInstall |download-link=[[#Code|<span lang="en" dir="ltr" class="mw-content-ltr">Copy the code into files</span>]] }} ==Code== ;NoTOC.php <syntaxhighlight lang="php"> <?php /** * NoTOC extension - Turns off the Table of Contents (TOC) by default on all pages * @version 0.1.1 - 2013/12/11 * * @link https://www.mediawiki.org/wiki/Extension:NoTOC Documentation * @link https://www.mediawiki.org/wiki/Extension_talk:NoTOC Support * * @ingroup Extensions * @package MediaWiki * @author Andrew Fitzgerald (Frantik) * @author Karsten Hoffmeyer (Kghbln) * @copyright (C) 2010 Andrew Fitzgerald * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ // check the call if ( !defined( 'MEDIAWIKI' ) ) { die( 'This file is a MediaWiki extension and thus not a valid entry point.' ); } // provide information $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'NoTOC', 'author' => array( 'Andrew Fitzgerald', '...' ), 'url' => 'https://www.mediawiki.org/wiki/Extension:NoTOC', 'descriptionmsg' => 'notoc-desc', 'version' => '0.1.1' ); // show way to files $wgExtensionMessagesFiles['NoTOC'] = dirname( __FILE__ ) . '/NoTOC.i18n.php'; // register hooks $wgHooks['ParserClearState'][] = 'efMWNoTOC'; // perform purpose function efMWNoTOC($parser) { $parser->mShowToc = false; return true; } </syntaxhighlight> ;NoTOC.i18n.php <syntaxhighlight lang="php"> <?php /** * Internationalization file for the NoTOC extension. * * @licence GNU GPL v2+ * @author Karsten Hoffmeyer (Kghbln) */ $messages = array(); /** English * @author Frantik * @author Kghbln */ $messages['en'] = array( 'notoc-desc' => 'Turns off the Table of Contents (TOC) by default on all pages', ); /** Message documentation (Message documentation) * @author Kghbln */ $messages['qqq'] = array( 'notoc-desc' => '{{desc|name=NoTOC|url=https://www.mediawiki.org/wiki/Extension:NoTOC}}', ); /** German (Deutsch) * @author Kghbln */ $messages['de'] = array( 'notoc-desc' => 'Unterdrückt die automatische Generierung des Inhaltsverzeichnisses', ); </syntaxhighlight> <span id="See_also"></span> == Siehe auch == * {{ll|Extension:ForceTocOnEveryPage}} * {{ll|Extension:DeToc}} - <span lang="en" dir="ltr" class="mw-content-ltr">This can be used to extract TOC HTML and to remove it or put it in some other section of the page.</span> [[Category:TOC extensions{{#translation:}}]] q1gxz7ppich1wbu0wncxfpr36apstwq Extension:PageTriage/de 102 1427643 8365065 8157886 2026-05-04T07:51:31Z FuzzyBot 451990 Updating to match new version of source page 8365065 wikitext text/x-wiki <languages /> {{Extension |templatemode = |status = stable |type1 = special |type2 = interface |newhook1 = |newhook2 = |username = |author = [[User:Kaldari|Ryan Kaldari]], [[User:Bsitu|Benny Situ]] |description = Erleichtert die Überprüfung und Genehmigung neuer Seiten |image = Extension-PageTriage Special-NewPagesFeed Screenshot.png |imagesize = 300 |version = |update = |version preview = |update preview = |compatibility policy = rel |mediawiki = |php = |composer = |table1 = pagetriage_page |table2 = pagetriage_page_tags |table3 = pagetriage_tags |download = {{WikimediaDownload|phab=EPTR}} |readme = |changelog = |example = [[wikipedia:Special:NewPagesFeed | Special:NewPagesFeed on the English Wikipedia]] |namespace = |tags = |compatibility = |bugzilla = |phabricator = PageTriage |vagrant-role = }} <span lang="en" dir="ltr" class="mw-content-ltr">'''PageTriage''' is an extension that aims to provide a feature-rich interface for triaging newly-created articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is intended to replace the ''new page patrol'' core function while adding additional functionality for reviewing, tagging, and improving new articles.</span> Es fügt die Seite Special:NewPagesFeed und eine Seitenkurationswerkzeugleiste zu neuen Seiten für diejenigen mit der "patrol"-Erlaubnis hinzu. <span lang="en" dir="ltr" class="mw-content-ltr">It was developed by the Wikimedia Foundation's [[Wikimedia_Features_engineering|Features Engineering team]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">For additional details see ''[[Page Curation|Page Curation]]''.</span> Eine wichtige Anmerkung ist, dass einige der Konfigurationen und Code spezifisch für die Workflows der englischsprachigen Wikipedia sind und die Erweiterung so, wie sie jetzt aufgebaut ist, praktisch unmöglich internationalisiert werden kann. (Siehe [[Phabricator:T50552]].) [[File:Page-Curation-Video.ogv|thumb|An overview of the page curation feature. The interface in the video is outdated but the content remains useful.]] == Installation == [[File:PageTriage-ListView-Whole.png|thumb|Screenshot of Special:NewPagesFeed as it appeared in 2012]] {{ExtensionInstall |db-update=yes |registration=required |localsettings= }} == Checking for successful install == Um die Erweiterung in Aktion zu sehen: * Erstellen Sie eine neue Seite mit nur wenigen Sätzen Text als anonymer Benutzer. * Besuche [[Special:NewPagesFeed|Spezial:Seitenprüfung]] Die neue Seite sollte angezeigt werden mit der Markierung "{{int|pagetriage-no-categories}}", "{{int|pagetriage-orphan}}" usw. <span lang="en" dir="ltr" class="mw-content-ltr">To see the page curation toolbar:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Login as a user with the 'sysop' permission, or add a group with the "[[Special:MyLanguage/Help:Patrolled_edits|patrol]]" permission, and add some user to that group, and login as that user. </div> <div class="mw-translate-fuzzy"> * Besuche [[Special:NewPagesFeed|Spezial:Seitenprüfung]] </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Now you should see a "{{int|pagetriage-triage}}" button next to the new page. </div> * Klicken Sie hier und Sie sehen die Toolbar für die Kuration der Seiten auf der neuen Seite. <span id="Advanced_installation"></span> == Erweiterte Installation == <div lang="en" dir="ltr" class="mw-content-ltr"> === Additional extensions === </div> Für die volle Funktionalität müssen Sie auch einige zusätzliche Erweiterungen installieren, obwohl PageTriage ohne sie funktioniert. * {{ll|Extension:Echo|Echo}} - Allows users to receive notifications for things like when an article they created has been marked as reviewed. * {{ll|Extension:ORES|ORES}} - In Special:NewPagesFeed, allows filtering by "predicted class" (<code>articlequality</code>: stub, start, c-class, b-class, good, featured) and "potential issues" (<code>draftquality</code>: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because <code>draftquality</code> needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's [[git:mediawiki/extensions/ORES/+/8bd39f26548d58fa8bf6765e1c23f5e3086f1cd4/extension.json#225|extension.json file]]. * {{ll|Extension:WikiLove|WikiLove}} - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily. === Enabling draft namespace === By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php <syntaxhighlight lang="php" copy> // These three settings are optional, and will enable the Articles-for-Creation mode. $wgPageTriageDraftNamespaceId = 118; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft'; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk'; </syntaxhighlight> When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed. By default pages edited in the draft namespace will be "unsubmitted". Articles in the draft namespace can be submitted for review by adding <nowiki>[[Category:Pending_AfC_submissions]]</nowiki> to the draft page. At which point they will show up under "awaiting review". Note the toolbar controlled by the configuration variable '''$wgPageTriageEnableCurationToolbar''' does not show up in the draft namespace. === Cron jobs === To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: <code>cron/updatePageTriageQueue.php</code> == Manual testing == === Special:NewPagesFeed -> Articles for Creation === * Enable draftspace by following the directions above in the section [[#Enabling draft namespace]]. * In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories: ** Unsubmitted: (no category) ** Awaiting review: Category:Pending AfC submissions ** Under review: Category:Pending AfC submissions being reviewed now ** Declined: Category:Declined AfC submissions Note: The Page Curation toolbar does not display for drafts. === ORES === Enwiki has the [[Extension:ORES|ORES extension]] installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure: * Clone Extension:ORES and add <code>wfLoadExtension( 'ORES' );</code> in <code>LocalSettings.php</code> * Add this to <code>LocalSettings.php</code> <syntaxhighlight lang="php" copy> $wgPageTriageEnableOresFilters = true; $wgOresWikiId = 'enwiki'; $wgOresModels = [ 'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ], 'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'sources' => [ 1 ] ] ]; </syntaxhighlight> * Run <code>php maintenance/run.php ./extensions/ORES/maintenance/BackfillPageTriageQueue.php</code> == Determining if a page is reviewed == === Status codes === There are status codes used to track whether a page is reviewed or not. These are the values given when you query <code>patrol_status</code>, <code>ptrp_reviewed</code>, and <code>ptrl_reviewed</code>: * Unreviewed ** 0 - unreviewed * Reviewed ** 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar) ** 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page) ** 3 - autopatrolled (someone with the <code>autopatrol</code> user right created the page, or moved the page from a non-tracked namespace to a tracked namespace) ** no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job) === Via the API === To check the review status of pages using an API query, you can use <code>api.php?action=query&prop=isreviewed</code>. Sample JavaScript code:<syntaxhighlight lang="js" copy> /** * @param {number} pageID The page ID number. A positive number with no commas. */ async isReviewed(pageID) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', pageids: pageID, } ); return response.query.pages[0].isreviewed; } /** * @param {string} title One title. Can include namespace. Example: User:Test */ async function isReviewed(title) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', titles: title, } ); return response.query.pages[0].isreviewed; } </syntaxhighlight> === Via SQL === To check the review status of pages using an SQL query, you need to query the <code>{{ll|Extension:PageTriage/pagetriage page table|pagetriage_page}}</code> table and the <code>ptrp_reviewed</code> field. Follow the directions in [[#Status codes]] to interpret the values of this field. <syntaxhighlight lang="sql" copy> /* By page_id */ SELECT ptrp_reviewed FROM pagetriage_page WHERE ptrp_page_id = 71318376 /* By page_title and page_namespace */ SELECT ptrp_reviewed FROM pagetriage_page JOIN page ON page_id = ptrp_page_id WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces AND page_namespace = 0 </syntaxhighlight> == SQL == === SQL tables === {| class="wikitable" |+ !Name !Prefix !Description !Old entry deletion strategy !Service classes (when refactoring, SQL queries should be moved to here) !Data classes |- |[[Extension:PageTriage/pagetriage page table|pagetriage_page]] |ptrp_ |The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query <code>ptrp_reviewed > 0</code> in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. |All articles deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. |QueueManager, QueueLookup |QueueRecord |- |[[Extension:PageTriage/pagetriage page tags table|pagetriage_page_tags]] |ptrpt_ |Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the <code>pagetriage_tags</code> table. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. |All article metadata deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status. | | |- |[[Extension:PageTriage/pagetriage tags table|pagetriage_tags]] |ptrt_ |A dictionary of page_tags, and their corresponding ID number. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. | | | |} === pagetriage_page_tags === <code>pagetriage_page_tags</code> data is updated by calling <code>ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata()</code>. This is called in the following hooks: * <code>onPageMoveComplete()</code> - runs when moving a page * <code>onLinksUpdateComplete()</code> - runs when saving an edit * <code>onMarkPatrolledComplete()</code> - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user. ==== List of tags ==== The <code>pagetriage_page_tags</code> are as follows: * Author information ** user_id ** user_name - there's a filter where you can type in their username ** user_editcount ** user_creation_date ** user_autoconfirmed ** user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with <code>MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()</code> ** user_bot ** user_block_status * Deletion tags - will display a black trash can icon if marked for deletion ** afd_status ** blp_prod_status ** csd_status ** prod_status * Special:NewPagesFeed red warning text ** category_count - No categories ** linkcount - Orphan ** reference - No citations ** recreated - Previously deleted ** user_block_status - Blocked * Page information ** page_len - size of article, in bytes ** rev_count - number of edits to the article ** snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article * afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined * copyvio - latest revision ID that has been tagged as a likely copyright violation, if any == PHP == <span id="Extension_configuration"></span> === Erweiterungskonfiguration === Die Erweiterung beruht auf dem "patrol"-Userright. Weitere Informationen zur Konfiguration von Kontrollen siehe $patrouiling. Die folgenden Konfigurationsvariablen können in der LocalSettings.php-Datei eingestellt werden: {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">Variable</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Default</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> |- | {{phpi|$wgPageTriageEnableCurationToolbar}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set to false to disable the [[Special:MyLanguage/Page Curation#User Experience: Curation Toolbar|curation toolbar]]</span> |- | {{phpi|$wgPageTriageInfiniteScrolling}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not to use infinite scrolling in the new pages feed</span> |- | {{phpi|$wgPageTriageMaxAge}} |90 | The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true). |- | {{phpi|$wgPageTriageNamespaces}} |NS_MAIN | The namespaces that PageTriage is active in. |- | {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} | {{phpi|false}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set this to true if new, unreviewed articles should be set to noindex.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In other words, if they should not be indexed by search engines until they are reviewed.</span> |} Siehe [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/extension.json#698|extension.json]] für die volle Liste von Konfigurationsvariablen === API === <div lang="en" dir="ltr" class="mw-content-ltr"> PageTriage adds the following API endpoints which can be used: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">API</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Triggering action</span> |- |pagetriageaction | <span lang="en" dir="ltr" class="mw-content-ltr">Mark a page as reviewed or unreviewed, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to mark a page as reviewed * Using the Page Curation toolbar to mark a page as unreviewed |- |pagetriagelist | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves the list of pages in the queue, and each page's metadata, including their reviewed status.</span> To retrieve one page, you must provide the <code>page_id</code>. To provide multiple pages, you must select one of <code>showreviewed</code>/<code>showunreviewed</code>, and one of <code>showredirs</code>/<code>showdeleted</code>/<code>showothers</code>, or no pages will be returned. |Read | * Loading the Page Curation toolbar (automatically loaded if you have the <code>patrol</code> userright and view a page that is unpatrolled or recently patrolled) * Viewing Special:NewPagesFeed (provides the list of articles) |- |pagetriagestats | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves stats about the number of pages in the queue for use in the header of Special:NewPagesFeed.</span> |Read | * Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer) |- |pagetriagetagcopyvio |Mark an article as a potential copyright violation, and logs the action in Special:Log. |Write | * Marking as a copyright violation by a bot with the <code>copyviobot</code> userright |- |pagetriagetagging | <span lang="en" dir="ltr" class="mw-content-ltr">Add clean-up tags or deletion templates to a page, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to place a maintenance tag on an article * Using the Page Curation toolbar to place a deletion tag on an article |} === Special:Log === The following logs are created by the extension: {| class="wikitable" |+ !Special:Log !<code>log_type</code> !<code>log_action</code> !Description !Notes |- |Page curation log |pagetriage-curation |delete, enqueue, reviewed, tag, unreviewed |Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed | |- |Potential copyright violation log |pagetriage-copyvio |insert |Allows a bot to log potential copyright violations |Doesn't display unless you set {{phpi|$wgPageTriageEnableCopyvio}} to true |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Entry points === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The extension's features can be triggered by various actions: </div> {| class="wikitable" |+ !Entry point type !File location !Notes |- |5 APIs |includes/Api/* | |- |1 special page |includes/SpecialNewPagesFeed.php | |- |20 hooks | * includes/Hooks.php * includes/HookHandlers/UndeleteHookHandler.php * includes/HookHandlers/Schema.php | |- |1 cron job |cron/updatePageTriageQueue.php |runs every 48 hours |- |7 maintenance scripts |maintenance/* |need to be run manually |} Here is a list of some actions and the corresponding entry points they trigger: {| class="wikitable" |+ !Action !Entry points used |- |View Main page | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() |- |Save an edit to the Main page | * Hooks.php -> onRevisionFromEditComplete() * Hooks.php -> onPageSaveComplete() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onLinksUpdateComplete() |- |Type in search box, triggering search suggestions | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onApiMain__moduleManager() |- |View Special:NewPagesFeed | * Hooks.php -> onBeforeCreateEchoEvent() * SpecialNewPagesFeed * ApiPageTriageStats * ApiPageTriageList |- |View an unreviewed article while logged in and having the <code>patrol</code> permission. | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onResourceLoaderGetConfigVars() * Hooks.php -> onDefinedTags() * Hooks.php -> onApiMain__moduleManager() * ApiPageTriageList (by <code>page_id</code>) |} ==== Hooks ==== {| class="wikitable" |+ !File !Group !Hook !Actions it performs |- | rowspan="18" |Hooks.php |Move page |[[Manual:Hooks/PageMoveComplete|onPageMoveComplete]] |Changes patrolled status, updates cache, updates metadata in <code>pagetriage_page_tags</code> table. |- | rowspan="3" |Edit page |[[Manual:Hooks/RevisionFromEditComplete|onRevisionFromEditComplete]] |Handles marking '''redirects that flip to articles''' as unreviewed. [[Deferred updates|DeferredUpdate]]. |- |[[Manual:Hooks/PageSaveComplete|onPageSaveComplete]] |Add '''new articles''' to the New Pages Feed and <code>pagetriage_page</code> table. |- |[[Manual:Hooks/LinksUpdateComplete|onLinksUpdateComplete]] |[[Deferred updates|DeferredUpdate]] of metadata / <code>pagetriage_page_tags</code> table. |- |Every page load |[[Manual:Hooks/ArticleViewFooter|onArticleViewFooter]] | * Turn on '''noindex''' for new, unreviewed articles. * Determine whether to load a '''link for autopatrolled users to unpatrol''' their article * Displays the '''Page Curation toolbar''' on recently created pages. * Create '''"Add to New Pages Feed" toolbox link''' for old articles. |- |[[Help:Patrolled edits]] |[[Manual:Hooks/MarkPatrolledComplete|onMarkPatrolledComplete]] |Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage. |- | rowspan="2" |Blocking and unblocking |[[Manual:Hooks/BlockIpComplete|onBlockIpComplete]] | rowspan="2" |Update article metadata / <code>pagetriage_page_tags</code> when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users. |- |[[Manual:Hooks/UnblockUserComplete|onUnblockUserComplete]] |- | |[[Manual:Hooks/ResourceLoaderGetConfigVars|onResourceLoaderGetConfigVars]] |Adjusts some config vars related to draft namespace ID. |- | rowspan="3" |[[Extension:Echo]] |[[Manual:Hooks/BeforeCreateEchoEvent|onBeforeCreateEchoEvent]] | rowspan="3" |Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed. |- |[[Manual:Hooks/EchoGetDefaultNotifiedUsers|onEchoGetDefaultNotifiedUsers]] |- |[[Manual:Hooks/LocalUserCreated|onLocalUserCreated]] |- |[[Extension:ORES]] |[[Manual:Hooks/ORESCheckModels|onORESCheckModels]] |Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio. |- | rowspan="3" |[[Help:Tags]] |[[Manual:Hooks/ListDefinedTags|onListDefinedTags]] | rowspan="3" |Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage". |- |[[Manual:Hooks/ChangeTagsAllowedAdd|onChangeTagsAllowedAdd]] |- |[[Manual:Hooks/ChangeTagsListActive|onChangeTagsListActive]] |- |API |[[Manual:Hooks/ApiMain::moduleManager|onApiMain__moduleManager]] |Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings. |- | rowspan="2" |Delete or undelete page |[[Manual:Hooks/PageDeleteComplete|onPageDeleteComplete]] |If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache. |- |HookHandlers/ UndeleteHookHandler.php |[[Manual:Hooks/ArticleUndelete|onArticleUndelete]] |If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed. |- |HookHandlers/ Schema.php |SQL |[[Manual:Hooks/LoadExtensionSchemaUpdates|onLoadExtensionSchemaUpdates]] | * The code that installs PageTriage's 4 SQL tables when you run <code>php maintenance/run.php update</code>. * Will also alter schemas from previous versions to match the latest schema. * This is also where all the '''pagetriage_tags''' are hard-coded. |} ==== Cron jobs and maintenance scripts ==== {| class="wikitable" |+ !File !What it does !Why run it? When is it useful? ![[phab:T341431|Safe to delete maintenance script?]] |- |cron/updatePageTriageQueue.php |Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". |Keeps the SQL tables from getting too big. | |- |maintenance/cleanupPageTriage.php |Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. |Fix a bug? [[phab:T321982|T321982]] | |- |maintenance/cleanupPageTriageLog.php |Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log |One time conversion of old log entries to modern format? Logs are now always written in the new format. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/6d9105c020c62d648a4ef6be957297bbc8a6d7d2]. |Probably |- |maintenance/cleanupPageTriagePageTags.php |Remove page from <code>pagetriage_page_tags</code> if they are not in <code>pagetriage_page</code> |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/00a752368e00e0d8b29a4908bfc3bab3096268dd]. |Probably |- |maintenance/DeleteAfcStates.php |Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ab2d8d4a2f9d0f4ff981afaee35a85f33edb5e99]. [[phab:T203184#4592953|T203184#4592953]]. |Probably |- |maintenance/FixNominatedForDeletion.php |Set <code>pagetriage_page.ptrp_deleted</code> if the page is has any <code>pagetriage_page_tags</code> related to deletion (e.g. prod_status, blp_prod_status, etc.) |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ff0c433226300aeba692089b5389435d47feef1e]. [[phab:T202582|T202582]]. |Probably |- |maintenance/populateDraftQueue.php |Add missing Draft namespace pages to the AfC triage queue. |Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/59e1fedffcdafc46722d7231011aee194db9ee08]. | |- |maintenance/updateUserMetadata.php |Former cron job. Update expired user metadata in the <code>pagetriage_page_tags</code> table |[https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/92a675a5f1f2e07cee532ec90fc57eee7f2cd49b]. [[phab:T341432|T341432]]. | |} === NOINDEX === NOINDEX refers to the HTML code <code>&lt;meta name="robots" content="noindex"></code>, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode <code><nowiki>__NOINDEX__</nowiki></code>. When {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in <code>includes/Hooks.php</code>, in the <code>onArticleViewFooter()</code> method. ==== First check ==== * First check: Noindex the page if ALL of the following are true: ** {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is turned on ** Page age is less than {{phpi|$wgPageTriageMaxAge}} (set to 90 days on enwiki) ** Page is in <code>pagetriage_page</code> table<ref>Checked by <code>isPageUnreviewed()</code></ref> ** Page is marked as unpatrolled (ptrp_status = 0) ==== Second check ==== * Second check: If the wikitext has the <code><nowiki>__NOINDEX__</nowiki></code> magic word, noindex the page if ALL of the following are true: ** Page age is less than {{phpi|$wgPageTriageMaxNoIndexAge}} (set to 90 days on enwiki) ** If {{phpi|$wgPageTriageMaxNoIndexAge}} is not null, page is in <code>pagetriage_page</code> table<ref>Checked by <code>isNewEnoughToNoIndex()</code>, if it doesn't exit early due to <code>$wgPageTriageMaxNoIndexAge</code> being <code>null</code>.</ref> The main use case for the <nowiki>__NOINDEX__</nowiki> magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See [https://en.wikipedia.org/w/index.php?search=NOINDEX&title=Special:Search&profile=advanced&fulltext=1&ns10=1 this search]. ==== Is the page in the <code>pagetriage_page</code> table? ==== In regards to the requirement "Page is in <code>pagetriage_page</code> table", there are several ways a for a page to get into this table: * Not been deleted by a PageTriage cron job ** One cron job deletes redirects older than {{phpi|$wgPageTriageRedirectAutoreviewAge}} days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them. ** Another cron job deletes reviewed pages after 30 days of being reviewed * In a namespace that PageTriage is configured to patrol * Isn't an article that is so old it predates the installation of PageTriage == JavaScript == === Directory structure === * /modules/ ** ext.pageTriage.article - related to marking an article as reviewed ** ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar ** ext.pageTriage.init - creates a mw.pageTriage object ** ext.pageTriage.newPagesFeed - Special:NewPagesFeed ** ext.pageTriage.sidebarLink - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates ** ext.pageTriage.toolbar - Page Curation toolbar <!--** ext.pageTriage.toolbar - Page Curation toolbar (Vue version)--> ** ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code ** ext.pageTriage.util - Backbone.js models (article, revision, stats) ** external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore <div lang="en" dir="ltr" class="mw-content-ltr"> === Toolbar === </div> The toolbar has three states: <code>maximized</code>, <code>minimized</code>, and <code>hidden</code>. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu. === External libraries === * front end ** old (moving away from) *** [[w:Backbone.js|Backbone.js]] *** [[w:jQuery|jQuery]] *** jQuery Badge *** jQuery Waypoints *** [[w:jQuery UI|jQuery UI]] *** [[w:Mustache (template system)|Mustache (template system)]] *** [[OOUI]] - used in modules/ext.PageTriage.enqueue ([https://codesearch.wmcloud.org/deployed/?q=oojs&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FPageTriage codesearch]) *** [[w:Underscore.js|Underscore.js]] ** new (moving towards) *** Codex *** [[w:Moment.js|Moment.js]] *** Vue Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, [[phab:T208256|we are interested in replacing these front end libraries]], to make the extension easier to maintain. <div lang="en" dir="ltr" class="mw-content-ltr"> === Client-side hooks === </div> ==== mw.hook ==== * <code>ext.pageTriage.toolbar.ready</code> ==== mw.pageTriage.actionQueue ==== <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage provides a specialised action queue system to allow other scripts and gadgets to integrate with it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is similar to <code>mw.hook</code> except that it uses promises.</span> Das wird erledigt mithilfe des Moduls <code>mw.pageTriage.actionQueue</code>. <span lang="en" dir="ltr" class="mw-content-ltr">See the comments in the {{tmpl|0={{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=$1}}|source code}} for documentation on how the system works.</span> {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">It is [$1 not currently used by any scripts or gadgets on enwiki], but it is used internally by PageTriage.</span> |1=https://en.wikipedia.org/w/index.php?search=%22actionQueue%22&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1&ns2300=1&ns2301=1&ns2302=1&ns2303=1 }} <span lang="en" dir="ltr" class="mw-content-ltr">The actionQueue module is available after the mw.hook <code>ext.pageTriage.toolbar.ready</code> fires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage will give the action queue handler an Object with the following data, in addition to other data as noted below:</span> * <code>pageid</code> — <span lang="en" dir="ltr" class="mw-content-ltr">ID of the page being reviewed.</span> * <code>title</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Title of the page, including namespace.</span> * <code>reviewer</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of who is using PageTriage.</span> * <code>creator</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of the creator of the page.</span> * <code>reviewed</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the page is currently or will be marked as reviewed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ===== Available actions ===== </div> * <code>delete</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the reviewer tags a page for deletion. The data given to the handler also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An object of all the templates added to the page. The keys are the template title, and the values are an object of metadata, including things like the speedy deletion code.</span> * <code>mark</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the review status of a page is changed. Also includes:</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> * <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when maintenance tags are added to the page. Also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An array of the titles of all templates that were added to the page.</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> <span id="Example"></span> ===== Beispiel ===== <div lang="en" dir="ltr" class="mw-content-ltr"> To use the action queue, register a function to be ran when an aforementioned action is fired. PageTriage will wait for any asynchronous code to complete before doing anything else, such as refreshing the page. For example, to edit [[Sandbox]] after a page has been marked as reviewed, you could use: </div> <syntaxhighlight lang="javascript"> $( function () { // You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time. mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) { // Listen for the 'mark' action. queue.add( 'mark', function ( data ) { return new mw.Api().edit( 'Sandbox', function ( revision ) { // Replace 'foo' with the note the reviewer left. return revision.content.replace( 'foo', data.note ); } ); } ); } ); } ); </syntaxhighlight> === Where are preferences stored? === Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is <code>userjs-NewPagesFeedFilterOptions</code>. It is set using <code>mw.Api().saveOption()</code> and read using <code>mw.user.options.get()</code>. This data ends up in the SQL <code>user_properties</code> table. Temporary accounts (IP masking) will not be able to store their preferences. == Installation on WMF wikis == This extension was designed for English Wikipedia. There is interest in changing its code and making it more useful to other wikis ([[phab:T50552]]), however this is challenging from a technical perspective and progress is slow. For now, the following are true: * PageTriage is allowed to be installed on other wikis<ref>https://meta.wikimedia.org/w/index.php?title=Limits_to_configuration_changes&diff=prev&oldid=26121135</ref> (although as of 2024 this hasn't happened yet). * The setting <code>$wgPageTriageEnableExtendedFeatures</code> can be set to <code>false</code> to turn off English Wikipedia-specific features such as maintenance tags and deletion tags in the Page Curation toolbar. * There are concerns that the noindex features (controlled by <code>$wgPageTriageNoIndexUnreviewedNewArticles</code> and <code>$wgPageTriageMaxNoIndexAge</code>) create search engine optimization problems, and these noindex features should not be enabled on new wikis without first discussing it with product manager [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]. * Like most other WMF-deployed extensions, PageTriage supports internationalization, and has its interface [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/i18n/|translated into many other languages]]. <span id="See_also"></span> == Siehe auch == * [[commons:Category:PageTriage extension]] * [[Help:New pages feed]] * [[w:Wikipedia:Page Curation/Help]] == Notes == <references /> {{OnWikimedia}} {{Used by}} [[Category:API extensions{{#translation:}}]] 2fjeeedle9ea6yy0kyfkjn97xuk658t Manual:Managing data in MediaWiki/de 100 1429389 8364299 8363584 2026-05-03T12:44:41Z FuzzyBot 451990 Updating to match new version of source page 8364299 wikitext text/x-wiki <languages/> <span class="mw-translate-fuzzy">MediaWiki wurde entwickelt, um vor allem Text zu verwalten und kann dies auch sehr gut.</span> <span lang="en" dir="ltr" class="mw-content-ltr">A limited amount of structure is available: {{ll|Help:Namespaces|namespaces}}, {{ll|Help:Subpages|subpages}} and {{ll|Help:Categories|categories}} help to group similar pages together, while features like {{ll|Infobox|infoboxes}} and {{ll|Gallery|galleries}} help to structure the contents within each page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, MediaWiki by itself does not truly provide ways to manage structured data: data that can be queried, filtered, and in some cases displayed with visualizations including tables, charts, maps<ref>see also [[Wikimedia Maps]]</ref> and calendars.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For that, a number of dedicated [[Special:MyLanguage/Manual:Extensions|extensions]] exist.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following table describes the extensions that can store the data edited by users in a MediaWiki database, from where it can then be queried. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is not a list of all structured data functionality; the "[[#See also|See also]]" section lists other extensions and features that can be used for storing or displaying structured data. </div> {| class="wikitable" |- ! Funktion ! [[File:20210702_Semantic_MediaWiki_logo_with_wordmark.png|100px]]<br/>[https://www.semantic-mediawiki.org/ Semantic MediaWiki] ! [[File:Wikibase_Suite_Vertical_2x_RGB.png|100px]]<br/>[https://wikiba.se/ Wikibase] ! [[File:Cargo logo.png|50px]]<br/>{{ll|Extension:Cargo|nsp=0}} ! {{ll|Extension:VisualData|VisualData}} !{{ll|Extension:Bucket|Bucket}} ! {{ll|Extension:NeoWiki|NeoWiki}} |- | <span lang="en" dir="ltr" class="mw-content-ltr">Main usecase</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation, based on [[w:Semantic Web|Semantic Web]] standards.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Powering [[w:Wikidata|Wikidata]] and other editable graph databases.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation based on JSON-schema.</span> |lightweight Lua interface for storing and accessing structured data on wiki pages |Knowledge management system that combines collaborative editing and a [[:en:knowledge_graph|knowledge graph]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Approach</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data (properties) are annotated within regular wikitext or by templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">With the datatype "reference", properties can be used to describe items using statements.</span><ref>https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties are defined and used to describe Items using statements.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data is stored in database tables, with each table corresponding to a template.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data are stored in a dedicated slot with JSON content model</span> |Data is stored in '''buckets''', which are database tables with specific columns that you can define |Schemas can be defined and applied to wiki pages, stored in a dedicated slot as JSON data. |- | <span lang="en" dir="ltr" class="mw-content-ltr">Available since</span> | 2005 | 2012 | 2015 | 2022 <span lang="en" dir="ltr" class="mw-content-ltr">(formerly known as {{ll|Extension:PageProperties|PageProperties}})</span> |2025 |2026 |- | <span lang="en" dir="ltr" class="mw-content-ltr">Active installations</span> | <span lang="en" dir="ltr" class="mw-content-ltr">1000s</span><ref>https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">100s</span><ref>https://wikiapiary.com/wiki/Extension:WikibaseRepository</ref><ref>https://wikibase.world</ref><ref>https://addshore.com/2024/10/visualizing-wikibase-connections-using-wikibase-world/</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">100s</span><ref>https://wikiapiary.com/wiki/Extension:Cargo</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">n/a (new extension or unknown)</span> | | |- | Gemeinschaft | 190+ Entwickler<ref>https://www.openhub.net/p/smw</ref> | 172+ Entwickler<ref>https://github.com/wikimedia/mediawiki-extensions-Wikibase</ref> | 63+ Entwickler<ref>https://github.com/wikimedia/mediawiki-extensions-Cargo</ref> | ([[User:Thomas-topway-it|<span lang="en" dir="ltr" class="mw-content-ltr">main developer</span>]]) |[https://weirdgloop.org/discord Weird Gloop's Discord] |[https://echolot-eccch.eu/ ECHOLOT project], [https://professional.wiki/ Professinal Wiki], [https://knowledge.wiki KM-A], [https://bluespice.com/bluespice-galaxy/ BlueSpice Galaxy] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Storage</span> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database, Elasticsearch, 5 different SPARQL stores</span><ref>https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database, Elasticsearch, SPARQL store (Blazegraph for wikidata.org)</span> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database (or a separate database)</span><ref>{{ll|Extension:Cargo/Download and installation#Setting the Cargo database}}</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database</span> |MediaWiki database (MySQL/MariaDB) |different SPARQL stores, currently Neo4J |- | <span lang="en" dir="ltr" class="mw-content-ltr">Property definition</span> | <span lang="en" dir="ltr" class="mw-content-ltr">By typing wikitext.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Properties can be invented freely.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will be of datatype page by default and can be defined later.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Datatypes can be changed any time.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties have to be defined before usage and can not be changed easily.</span><ref>[[d:Help:Data type#Changing datatype]]</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties are defined through one or more json-schema defined through a {{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}}</span> |Tables in the Bucket: namespace |Form based schema editing |- | <span lang="en" dir="ltr" class="mw-content-ltr">Value declaration</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Inline (<code><nowiki>[[MyProperty::MyValue]]</nowiki></code>) or with templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Form-based data entry with {{ll|Extension:Page_Forms|Page Forms}}.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Wikibase default form-like input interface.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">With parser functions in templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Form-based data entry with {{ll|Extension:Page_Forms|Page Forms}}.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Inline or popup OOUI {{ll|Extension:VisualData/Forms|forms}} automatically generated from JSON-schemas</span> |via Lua call of the <code>bucket.put</code> function |OOUI based form editing |- | <span lang="en" dir="ltr" class="mw-content-ltr">Predefined data types</span> | 18<ref>https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes</ref> | 17<ref>[[d:Special:ListDatatypes]]</ref><ref><span lang="en" dir="ltr" class="mw-content-ltr">Some datatypes are defined by other extension: [[Special:MyLanguage/Extension:Math|Math]] and [[Special:MyLanguage/Extension:Score|Score]] both define one datatype, [[Special:MyLanguage/Extension:JsonConfig|JsonConfig]] defines two, [[Special:MyLanguage/Extension:WikibaseLexeme|WikibaseLexeme]] defines three, and Wikibase defines ten.</span></ref> | 18 | <span lang="en" dir="ltr" class="mw-content-ltr">4 (basic JSON-schema types) + 15 string formats</span> | 5 <ref>https://meta.weirdgloop.org/w/Extension:Bucket#Basic_usage</ref> | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Property management</span> | <span lang="en" dir="ltr" class="mw-content-ltr">type definitions, constraint schemas, ontology import</span> | <span lang="en" dir="ltr" class="mw-content-ltr">custom, or import of Wikidata ontology</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">through a graphical interface (dedicated {{ll|Extension:VisualData/Schema Builder|SchemaBuilder}})</span> | |through a graphical interface |- | <span lang="en" dir="ltr" class="mw-content-ltr">Page names and internal linking</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Page names are stored with their Q-numbers (displaying labels in available languages). Internal linking must be done to the Q-number; you cannot link to a label.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Schemas are stored in a dedicated namespace and JSON-data in a dedicated slot associated to wiki articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">JSON-data can be accessed through an extension of the wiki interface</span> | |MediaWiki pages can have schemas |- | <span lang="en" dir="ltr" class="mw-content-ltr">Inline queries</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | <span lang="en" dir="ltr" class="mw-content-ltr">no (external SPARQL queries);</span> [[phab:T67626|<span lang="en" dir="ltr" class="mw-content-ltr">planned</span>]]<br/><span lang="en" dir="ltr" class="mw-content-ltr">supported via third-party extension {{ll|Extension:LinkedWiki|LinkedWiki}}</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | |yes, with parser functions via the SQL store |- | <span lang="en" dir="ltr" class="mw-content-ltr">External querying</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with either an API or SPARQL querying (available through special extensions such as [[Special:MyLanguage/Extension:RDFIO|RDFIO]] and [[Special:MyLanguage/Extension:LinkedWiki|LinkedWiki]])</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with SPARQL Query service</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with an API</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with an API</span><ref>{{ll|Extension:VisualData/API}}</ref> | API is not yet stable <ref>https://meta.weirdgloop.org/w/Extension:Bucket</ref> |yes, with an API or SPARQL endpoint |- | <span lang="en" dir="ltr" class="mw-content-ltr">Result formats<ref>"Result formats" mean the ability of the wiki to display data (results of an inline query) in various formats, e.g. tables, calendars, maps, timelines, etc.</ref></span> | ~ 75<ref>https://www.semantic-mediawiki.org/wiki/Help:Result_formats</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">no native result display; data may be visualized via:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Query Service or other external tools </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * on wiki data access via LUA (no query support) </div> * {{ll|Extension:LinkedWiki}} - <span lang="en" dir="ltr" class="mw-content-ltr">third-party</span> | <span lang="en" dir="ltr" class="mw-content-ltr">~ 25</span><ref>{{ll|Extension:Cargo/Display formats}}</ref> | 12+ (Json, Table, Datatable, Template, Calendar, Carousel, Map, pageid, pagetitle, count, raw, Lua ) <ref>{{ll|Extension:VisualData/Result_formats}}</ref> | | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Development</span> | [[github:SemanticMediaWiki/SemanticMediaWiki|GitHub]] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Cargo Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/VisualData Gerrit] |[[github:weirdgloop/mediawiki-extensions-Bucket|GitHub]] |[[github:ProfessionalWiki/NeoWiki|GItHub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Complementary extensions</span> | ~ 40<ref>{{ll|Category:Semantic MediaWiki extensions}}</ref>, e.g. {{ll|Extension:Semantic Result Formats|Semantic Result Formats}}, {{ll|Extension:Semantic Bundle|Semantic Bundle}}, {{ll|Extension:Semantic Scribunto|Semantic Scribunto}} | ~12<ref>{{ll|Category:Wikibase extensions}}</ref>, e.g. {{ll|Extension:Wikibase Repository|Wikibase Repository}}, {{ll|Extension:Wikibase Client|Wikibase Client}}, {{ll|Extension:WikibaseLexeme|WikibaseLexeme}}, [https://wikiba.se/applications/#query-service Query Service] | <span lang="en" dir="ltr" class="mw-content-ltr">2 ([[Special:MyLanguage/Extension:Page Forms|Page Forms]], [[Special:MyLanguage/Extension:Page Schemas|Page Schemas]]). Cargo provides some or all of the functionality of Semantic MediaWiki, Semantic Result Formats, Maps, Semantic Drilldown, Semantic Compound Queries, Semantic Internal Objects and Semantic Scribunto.</span><ref>[[Extension:Cargo/Cargo and Semantic MediaWiki]].</ref> | {{ll|Extension:ContactManager|ContactManager}} |{{ll|Extension:Lua|Lua}} | |} <div lang="en" dir="ltr" class="mw-content-ltr"> == Alternative comparisons == </div> * {{ll|Extension:Cargo/Cargo and Semantic MediaWiki|2=<span lang="en" dir="ltr" class="mw-content-ltr">Cargo and Semantic MediaWiki</span>}} * <span lang="en" dir="ltr" class="mw-content-ltr">[https://professional.wiki/en/articles/managing-data-in-mediawiki Semantic MediaWiki vs Wikibase vs Cargo] by [https://professional.wiki Professional Wiki]</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references/> <span id="See_also"></span> == Siehe auch == * {{ll|Multi-Content Revisions}} – <span lang="en" dir="ltr" class="mw-content-ltr">Ability to manage different independent content objects on the same wiki page</span> * {{ll|Extension:WikiDB|WikiDB}} – <span lang="en" dir="ltr" class="mw-content-ltr">Provides database features, somewhat similar to semantic properties</span> * {{ll|Extension:JsonConfig|JsonConfig}} – <span lang="en" dir="ltr" class="mw-content-ltr">store JSON (including tabular and map data) in wiki pages, and allow accessing them via Lua; no query support</span> * {{ll|Extension:External Data|External Data}} – <span lang="en" dir="ltr" class="mw-content-ltr">access data from external URL, local file, and SQL or MongoDB database</span> * {{ll|Structured data across Wikimedia}} – <span lang="en" dir="ltr" class="mw-content-ltr">2021-2023 project for improving structured data support in MediaWiki</span> * {{ll|Category:Data management extensions}} [[Category:MediaWiki Introduction{{#translation:}}]] [[Category:Extension comparisons{{#translation:}}]] 9w5g10cw0nzsaadcn7quo15s5g47kv0 Extension:WhoIsWatching/fr 102 1432449 8364409 6771228 2026-05-03T14:58:53Z FuzzyBot 451990 Updating to match new version of source page 8364409 wikitext text/x-wiki <languages/> {{Extension |name = Who Is Watching |status = stable |type1 = special |type2 = database |type3 = parser function |author = * [[User:Gri6507|Paul Grinberg]], * [[User:Siebrand|Siebrand Mazeland]], * [[User:MarkAHershberger|Mark Hershberger]] |image = |license = GPL-2.0-only |version = 0.13.0 |update = 2019-08-04 |mediawiki = 1.43+ |download = {{WikimediaDownload}} |readme = [https://github.com/wikimedia/mediawiki-extensions-WhoIsWatching/blob/master/README.mediawiki README.mediawiki] |changelog = |compatibility policy = master |description = Find out who is watching a particular page, and add others to watchlist for that page. |parameters= * $whoiswatching_nametype * $whoiswatching_allowaddingpeople * $whoiswatching_showifzero * $whoiswatching_showwatchingusers * $whoiswatching_maxPicklistUsers |rights = * addpagetoanywatchlist * seepagewatchers |example = [http://ec.europa.eu/eurostat/statistics-explained/index.php?title=Special:WhoIsWatching&ns=&page=Transport_accident_statistics http://ec.europa.eu/eurostat/] |phabricator = MediaWiki-extensions-WhoIsWatching }} L’extension '''WhoIsWatching''' permet de savoir qui regarde une page particulière, et d’ajouter d’autres à la liste de surveillance pour cette page. <div lang="en" dir="ltr" class="mw-content-ltr"> == Rationale == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Even though this notion goes against Wikipedia and Wikimedia [[w:Wikipedia:Watchlist#Privacy of watchlists|privacy policy]], some wikis may actually like to see which of its users are watching particular pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This extension provides just such an interface at the bottom of every page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally, this extension has an option to allow any user to add any page to any other user's watch list.</span> == Installation == <div lang="en" dir="ltr" class="mw-content-ltr"> Make sure that {{ll|Extension:Echo}} is installed as it is a prerequisite for this extension to work. </div> {{ExtensionInstall |registration=required |localsettings = # $whoiswatching_nametype = "RealName"; # $whoiswatching_allowaddingpeople = false; # $whoiswatching_showifzero = true; # $whoiswatching_showwatchingusers = false; # $whoiswatching_maxPicklistUsers = 10; # $wgGroupPermissions['sysop']['addpagetoanywatchlist'] = true; # $wgGroupPermissions['sysop']['seepagewatchers'] = true; }} == Configuration == <span lang="en" dir="ltr" class="mw-content-ltr">You can simply start using the extension without changing anything else.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The only additional configuration that is currently possible for the extension defines how to display the names of the users watching the pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In <code>SpecialWhoIsWatching.php</code>, there is</span> <syntaxhighlight lang="php"> # Set the following to either 'UserName' or 'RealName' to change how watching users are displayed. $whoiswatching_nametype = 'RealName'; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">As the comment implies, depending on the value of this variable, you can display either the real names of the watching users or their wiki usernames.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason some wiki's may want to switch over to the 'UserName' mode is if they do not require their members to have a valid real name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Another configurable option in the extension is the ability to switch on/off the option to allow any user to add any page to any other user's watch list.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done in <code>SpecialWhoIsWatching.php</code>, where there is</span> <syntaxhighlight lang="php"> # Set true if you don't want to use permissions and users are allowed to add to other user's watchlists. $whoiswatching_allowaddingpeople = true; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">It is also possible to only display the count of watching people if the count is greater than zero.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done in <code>SpecialWhoIsWatching.php</code>, where there is</span> <syntaxhighlight lang="php"> # Set to true if you want people with permission to see 0 if no one is watching the page. $whoiswatching_showifzero = true; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Finally, newer versions of this extension, while we attempt to be backward compatible, allow you to use permissions instead of global variables.</span> <syntaxhighlight lang="php"> # Set to true if you don't want to use permissions. $whoiswatching_showwatchingusers = true; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">By default, users in the sysop group have permission to see page watchers and add pages to anyone's watchlist.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can grant these permissions to logged in users, too, or any group you think needs it.</span> <syntaxhighlight lang="php"> # Give all logged in users full access. $wgGroupPermissions['user']['addpagetoanywatchlist'] = true; $wgGroupPermissions['user']['seepagewatchers'] = true; </syntaxhighlight> <span id="Usage"></span> == Utilisation == {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">This extension also provides the <code>{{#whoiswatching:$1}}</code> parser function showing the number of watching users of <code>$1</code> plus providing a link to <code>Special:WhoIsWatching/$1</code>.</span> |1=<span lang="en" dir="ltr" class="mw-content-ltr">Some Page</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">This can be used with skins not supporting footer links or to create the WhoIsWatching link somewhere in a wiki page.</span> <span id="Known_issues"></span> == Problèmes connus == <span lang="en" dir="ltr" class="mw-content-ltr">The first time after a you submit a request to remove a page from the users watchlist, the user is still shown on the form.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To get around this it is disabled and displayed with a red strikethrough.</span> {{Used by}} [[Category:Notification extensions{{#translation:}}]] [[Category:WatchArticle extensions{{#translation:}}]] [[Category:Watchlist extensions{{#translation:}}]] 60xa74uiuifvge53rxbepus8p1vefoy Extension:WhoIsWatching/de 102 1438015 8364406 6771227 2026-05-03T14:58:52Z FuzzyBot 451990 Updating to match new version of source page 8364406 wikitext text/x-wiki <languages/> {{Extension |name = Who Is Watching |status = stable |type1 = special |type2 = database |type3 = parser function |author = * [[User:Gri6507|Paul Grinberg]], * [[User:Siebrand|Siebrand Mazeland]], * [[User:MarkAHershberger|Mark Hershberger]] |image = |license = GPL-2.0-only |version = 0.13.0 |update = 2019-08-04 |mediawiki = 1.43+ |download = {{WikimediaDownload}} |readme = [https://github.com/wikimedia/mediawiki-extensions-WhoIsWatching/blob/master/README.mediawiki README.mediawiki] |changelog = |compatibility policy = master |description = Find out who is watching a particular page, and add others to watchlist for that page. |parameters= * $whoiswatching_nametype * $whoiswatching_allowaddingpeople * $whoiswatching_showifzero * $whoiswatching_showwatchingusers * $whoiswatching_maxPicklistUsers |rights = * addpagetoanywatchlist * seepagewatchers |example = [http://ec.europa.eu/eurostat/statistics-explained/index.php?title=Special:WhoIsWatching&ns=&page=Transport_accident_statistics http://ec.europa.eu/eurostat/] |phabricator = MediaWiki-extensions-WhoIsWatching }} <span lang="en" dir="ltr" class="mw-content-ltr">The '''WhoIsWatching''' extension allows to find out who is watching a particular page, and add others to watchlist for that page.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Rationale == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Even though this notion goes against Wikipedia and Wikimedia [[w:Wikipedia:Watchlist#Privacy of watchlists|privacy policy]], some wikis may actually like to see which of its users are watching particular pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This extension provides just such an interface at the bottom of every page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally, this extension has an option to allow any user to add any page to any other user's watch list.</span> == Installation == <div lang="en" dir="ltr" class="mw-content-ltr"> Make sure that {{ll|Extension:Echo}} is installed as it is a prerequisite for this extension to work. </div> {{ExtensionInstall |registration=required |localsettings = # $whoiswatching_nametype = "RealName"; # $whoiswatching_allowaddingpeople = false; # $whoiswatching_showifzero = true; # $whoiswatching_showwatchingusers = false; # $whoiswatching_maxPicklistUsers = 10; # $wgGroupPermissions['sysop']['addpagetoanywatchlist'] = true; # $wgGroupPermissions['sysop']['seepagewatchers'] = true; }} <span id="Configuration"></span> == Konfiguration == <span lang="en" dir="ltr" class="mw-content-ltr">You can simply start using the extension without changing anything else.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The only additional configuration that is currently possible for the extension defines how to display the names of the users watching the pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In <code>SpecialWhoIsWatching.php</code>, there is</span> <syntaxhighlight lang="php"> # Set the following to either 'UserName' or 'RealName' to change how watching users are displayed. $whoiswatching_nametype = 'RealName'; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">As the comment implies, depending on the value of this variable, you can display either the real names of the watching users or their wiki usernames.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The reason some wiki's may want to switch over to the 'UserName' mode is if they do not require their members to have a valid real name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Another configurable option in the extension is the ability to switch on/off the option to allow any user to add any page to any other user's watch list.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done in <code>SpecialWhoIsWatching.php</code>, where there is</span> <syntaxhighlight lang="php"> # Set true if you don't want to use permissions and users are allowed to add to other user's watchlists. $whoiswatching_allowaddingpeople = true; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">It is also possible to only display the count of watching people if the count is greater than zero.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done in <code>SpecialWhoIsWatching.php</code>, where there is</span> <syntaxhighlight lang="php"> # Set to true if you want people with permission to see 0 if no one is watching the page. $whoiswatching_showifzero = true; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Finally, newer versions of this extension, while we attempt to be backward compatible, allow you to use permissions instead of global variables.</span> <syntaxhighlight lang="php"> # Set to true if you don't want to use permissions. $whoiswatching_showwatchingusers = true; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">By default, users in the sysop group have permission to see page watchers and add pages to anyone's watchlist.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can grant these permissions to logged in users, too, or any group you think needs it.</span> <syntaxhighlight lang="php"> # Give all logged in users full access. $wgGroupPermissions['user']['addpagetoanywatchlist'] = true; $wgGroupPermissions['user']['seepagewatchers'] = true; </syntaxhighlight> <span id="Usage"></span> == Verwendung == {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">This extension also provides the <code>{{#whoiswatching:$1}}</code> parser function showing the number of watching users of <code>$1</code> plus providing a link to <code>Special:WhoIsWatching/$1</code>.</span> |1=<span lang="en" dir="ltr" class="mw-content-ltr">Some Page</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">This can be used with skins not supporting footer links or to create the WhoIsWatching link somewhere in a wiki page.</span> <span id="Known_issues"></span> == Bekannte Probleme == <span lang="en" dir="ltr" class="mw-content-ltr">The first time after a you submit a request to remove a page from the users watchlist, the user is still shown on the form.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To get around this it is disabled and displayed with a red strikethrough.</span> {{Used by}} [[Category:Notification extensions{{#translation:}}]] [[Category:WatchArticle extensions{{#translation:}}]] [[Category:Watchlist extensions{{#translation:}}]] g2q51cwcsb85n2p5erlthcazpnr1yys Extension:LookupUser/de 102 1438269 8364793 6707358 2026-05-03T23:53:08Z FuzzyBot 451990 Updating to match new version of source page 8364793 wikitext text/x-wiki <languages/> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">This extension may pose serious security and/or privacy risks!</span> <span lang="en" dir="ltr" class="mw-content-ltr">Users with access to this extension can view the preferences of any other user, which is usually considered private information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">While this extension does not give access to account passwords, it does give access to private data such as real names, email addresses, and other information that could be easily abused.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Therefore, do NOT grant access to any user unless they are 100% trustworthy.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is recommended that access be restricted to bureaucrats or higher groups.</span> <span lang="en" dir="ltr" class="mw-content-ltr">We are not responsible for any security or privacy leaks.</span> }} {{Extension |status=stable |image=LookupUser.png |type1=special |description=<span lang="en" dir="ltr" class="mw-content-ltr">Allows to retrieve information about a user such as email address and ID</span> |username=Tim Starling |license = GPL-2.0-or-later |mediawiki=1.46+ |version=1.5.2 |update=2018-07-14 |download={{WikimediaDownload|LookupUser|phab=ELOU}} |needs-updatephp =No |hook1=ContributionsToolLinks |rights=lookupuser |phabricator=LookupUser }} <div lang="en" dir="ltr" class="mw-content-ltr"> The '''LookupUser''' extension allows to retrieve information about a user such as email address, user ID and the user preferences, i.e. everything that the user has specified in their [[Special:MyLanguage/Help:Preferences|preferences]]. </div> <span lang="en" dir="ltr" class="mw-content-ltr">This extension also displays the last time a user either made a login, or any edit, which it lists as the "User record last touched:" time and date element of its log.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(This will be displayed as UTC even if you've set a custom time zone/the server's time zone is different.)</span> == Installation == {{ExtensionInstall |registration=required |localsettings= // Who can use Special:LookupUser? // If you want that sysops can use it: #$wgGroupPermissions['*']['lookupuser'] = false; #$wgGroupPermissions['sysop']['lookupuser'] = true; // Or, do you want a new user group for this. // (users with the 'userrights' right can add users to this group only bureaucrats by default) $wgGroupPermissions['*']['lookupuser'] = false; $wgGroupPermissions['lookupuser']['lookupuser'] = true; }} <span id="Usage"></span> == Verwendung == <div lang="en" dir="ltr" class="mw-content-ltr"> The extension is accessed via the "Special:LookupUser" page. </div> {{Used by}} qlmml5m7dr25rxcbk0v4o7tvj3fbafm 8364800 8364793 2026-05-04T00:10:33Z FuzzyBot 451990 Updating to match new version of source page 8364800 wikitext text/x-wiki <languages/> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">This extension may pose serious security and/or privacy risks!</span> <span lang="en" dir="ltr" class="mw-content-ltr">Users with access to this extension can view the preferences of any other user, which is usually considered private information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">While this extension does not give access to account passwords, it does give access to private data such as real names, email addresses, and other information that could be easily abused.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Therefore, do NOT grant access to any user unless they are 100% trustworthy.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is recommended that access be restricted to bureaucrats or higher groups.</span> <span lang="en" dir="ltr" class="mw-content-ltr">We are not responsible for any security or privacy leaks.</span> }} {{Extension |status=stable |image=LookupUser.png |type1=special |description=<span lang="en" dir="ltr" class="mw-content-ltr">Allows to retrieve information about a user such as email address and ID</span> |username=Tim Starling |license = GPL-2.0-or-later |mediawiki=1.46+ ([[phab:T416793]]) |version=1.5.2 |update=2018-07-14 |download={{WikimediaDownload|LookupUser|phab=ELOU}} |needs-updatephp =No |hook1=ContributionsToolLinks |rights=lookupuser |phabricator=LookupUser }} <div lang="en" dir="ltr" class="mw-content-ltr"> The '''LookupUser''' extension allows to retrieve information about a user such as email address, user ID and the user preferences, i.e. everything that the user has specified in their [[Special:MyLanguage/Help:Preferences|preferences]]. </div> <span lang="en" dir="ltr" class="mw-content-ltr">This extension also displays the last time a user either made a login, or any edit, which it lists as the "User record last touched:" time and date element of its log.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(This will be displayed as UTC even if you've set a custom time zone/the server's time zone is different.)</span> == Installation == {{ExtensionInstall |registration=required |localsettings= // Who can use Special:LookupUser? // If you want that sysops can use it: #$wgGroupPermissions['*']['lookupuser'] = false; #$wgGroupPermissions['sysop']['lookupuser'] = true; // Or, do you want a new user group for this. // (users with the 'userrights' right can add users to this group only bureaucrats by default) $wgGroupPermissions['*']['lookupuser'] = false; $wgGroupPermissions['lookupuser']['lookupuser'] = true; }} <span id="Usage"></span> == Verwendung == <div lang="en" dir="ltr" class="mw-content-ltr"> The extension is accessed via the "Special:LookupUser" page. </div> {{Used by}} 28vl07bjcgr067be7cyc8avm8etyien Manual:Managing data in MediaWiki/uk 100 1449983 8364311 8363596 2026-05-03T12:44:49Z FuzzyBot 451990 Updating to match new version of source page 8364311 wikitext text/x-wiki <languages/> <span class="mw-translate-fuzzy">MediaWiki була розроблена для керування переважно текстовою інформацією, і вона робить це дуже добре.</span> <span lang="en" dir="ltr" class="mw-content-ltr">A limited amount of structure is available: {{ll|Help:Namespaces|namespaces}}, {{ll|Help:Subpages|subpages}} and {{ll|Help:Categories|categories}} help to group similar pages together, while features like {{ll|Infobox|infoboxes}} and {{ll|Gallery|galleries}} help to structure the contents within each page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, MediaWiki by itself does not truly provide ways to manage structured data: data that can be queried, filtered, and in some cases displayed with visualizations including tables, charts, maps<ref>see also [[Wikimedia Maps]]</ref> and calendars.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For that, a number of dedicated [[Special:MyLanguage/Manual:Extensions|extensions]] exist.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following table describes the extensions that can store the data edited by users in a MediaWiki database, from where it can then be queried. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is not a list of all structured data functionality; the "[[#See also|See also]]" section lists other extensions and features that can be used for storing or displaying structured data. </div> {| class="wikitable" |- ! <span lang="en" dir="ltr" class="mw-content-ltr">Feature</span> ! [[File:20210702_Semantic_MediaWiki_logo_with_wordmark.png|100px]]<br/>[https://www.semantic-mediawiki.org/ Semantic MediaWiki] ! [[File:Wikibase_Suite_Vertical_2x_RGB.png|100px]]<br/>[https://wikiba.se/ Wikibase] ! [[File:Cargo logo.png|50px]]<br/>{{ll|Extension:Cargo|nsp=0}} ! {{ll|Extension:VisualData|VisualData}} !{{ll|Extension:Bucket|Bucket}} ! {{ll|Extension:NeoWiki|NeoWiki}} |- | <span lang="en" dir="ltr" class="mw-content-ltr">Main usecase</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation, based on [[w:Semantic Web|Semantic Web]] standards.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Powering [[w:Wikidata|Wikidata]] and other editable graph databases.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation based on JSON-schema.</span> |lightweight Lua interface for storing and accessing structured data on wiki pages |Knowledge management system that combines collaborative editing and a [[:en:knowledge_graph|knowledge graph]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Approach</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data (properties) are annotated within regular wikitext or by templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">With the datatype "reference", properties can be used to describe items using statements.</span><ref>https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties are defined and used to describe Items using statements.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data is stored in database tables, with each table corresponding to a template.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data are stored in a dedicated slot with JSON content model</span> |Data is stored in '''buckets''', which are database tables with specific columns that you can define |Schemas can be defined and applied to wiki pages, stored in a dedicated slot as JSON data. |- | <span lang="en" dir="ltr" class="mw-content-ltr">Available since</span> | 2005 | 2012 | 2015 | 2022 <span lang="en" dir="ltr" class="mw-content-ltr">(formerly known as {{ll|Extension:PageProperties|PageProperties}})</span> |2025 |2026 |- | <span lang="en" dir="ltr" class="mw-content-ltr">Active installations</span> | <span lang="en" dir="ltr" class="mw-content-ltr">1000s</span><ref>https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">100s</span><ref>https://wikiapiary.com/wiki/Extension:WikibaseRepository</ref><ref>https://wikibase.world</ref><ref>https://addshore.com/2024/10/visualizing-wikibase-connections-using-wikibase-world/</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">100s</span><ref>https://wikiapiary.com/wiki/Extension:Cargo</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">n/a (new extension or unknown)</span> | | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Community</span> | <span lang="en" dir="ltr" class="mw-content-ltr">190+ developers</span><ref>https://www.openhub.net/p/smw</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">172+ developers</span><ref>https://github.com/wikimedia/mediawiki-extensions-Wikibase</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">63+ developers</span><ref>https://github.com/wikimedia/mediawiki-extensions-Cargo</ref> | ([[User:Thomas-topway-it|<span lang="en" dir="ltr" class="mw-content-ltr">main developer</span>]]) |[https://weirdgloop.org/discord Weird Gloop's Discord] |[https://echolot-eccch.eu/ ECHOLOT project], [https://professional.wiki/ Professinal Wiki], [https://knowledge.wiki KM-A], [https://bluespice.com/bluespice-galaxy/ BlueSpice Galaxy] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Storage</span> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database, Elasticsearch, 5 different SPARQL stores</span><ref>https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database, Elasticsearch, SPARQL store (Blazegraph for wikidata.org)</span> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database (or a separate database)</span><ref>{{ll|Extension:Cargo/Download and installation#Setting the Cargo database}}</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database</span> |MediaWiki database (MySQL/MariaDB) |different SPARQL stores, currently Neo4J |- | <span lang="en" dir="ltr" class="mw-content-ltr">Property definition</span> | <span lang="en" dir="ltr" class="mw-content-ltr">By typing wikitext.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Properties can be invented freely.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will be of datatype page by default and can be defined later.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Datatypes can be changed any time.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties have to be defined before usage and can not be changed easily.</span><ref>[[d:Help:Data type#Changing datatype]]</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties are defined through one or more json-schema defined through a {{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}}</span> |Tables in the Bucket: namespace |Form based schema editing |- | <span lang="en" dir="ltr" class="mw-content-ltr">Value declaration</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Inline (<code><nowiki>[[MyProperty::MyValue]]</nowiki></code>) or with templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Form-based data entry with {{ll|Extension:Page_Forms|Page Forms}}.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Wikibase default form-like input interface.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">With parser functions in templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Form-based data entry with {{ll|Extension:Page_Forms|Page Forms}}.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Inline or popup OOUI {{ll|Extension:VisualData/Forms|forms}} automatically generated from JSON-schemas</span> |via Lua call of the <code>bucket.put</code> function |OOUI based form editing |- | <span lang="en" dir="ltr" class="mw-content-ltr">Predefined data types</span> | 18<ref>https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes</ref> | 17<ref>[[d:Special:ListDatatypes]]</ref><ref><span lang="en" dir="ltr" class="mw-content-ltr">Some datatypes are defined by other extension: [[Special:MyLanguage/Extension:Math|Math]] and [[Special:MyLanguage/Extension:Score|Score]] both define one datatype, [[Special:MyLanguage/Extension:JsonConfig|JsonConfig]] defines two, [[Special:MyLanguage/Extension:WikibaseLexeme|WikibaseLexeme]] defines three, and Wikibase defines ten.</span></ref> | 18 | <span lang="en" dir="ltr" class="mw-content-ltr">4 (basic JSON-schema types) + 15 string formats</span> | 5 <ref>https://meta.weirdgloop.org/w/Extension:Bucket#Basic_usage</ref> | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Property management</span> | <span lang="en" dir="ltr" class="mw-content-ltr">type definitions, constraint schemas, ontology import</span> | <span lang="en" dir="ltr" class="mw-content-ltr">custom, or import of Wikidata ontology</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">through a graphical interface (dedicated {{ll|Extension:VisualData/Schema Builder|SchemaBuilder}})</span> | |through a graphical interface |- | <span lang="en" dir="ltr" class="mw-content-ltr">Page names and internal linking</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Page names are stored with their Q-numbers (displaying labels in available languages). Internal linking must be done to the Q-number; you cannot link to a label.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Schemas are stored in a dedicated namespace and JSON-data in a dedicated slot associated to wiki articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">JSON-data can be accessed through an extension of the wiki interface</span> | |MediaWiki pages can have schemas |- | <span lang="en" dir="ltr" class="mw-content-ltr">Inline queries</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | <span lang="en" dir="ltr" class="mw-content-ltr">no (external SPARQL queries);</span> [[phab:T67626|<span lang="en" dir="ltr" class="mw-content-ltr">planned</span>]]<br/><span lang="en" dir="ltr" class="mw-content-ltr">supported via third-party extension {{ll|Extension:LinkedWiki|LinkedWiki}}</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | |yes, with parser functions via the SQL store |- | <span lang="en" dir="ltr" class="mw-content-ltr">External querying</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with either an API or SPARQL querying (available through special extensions such as [[Special:MyLanguage/Extension:RDFIO|RDFIO]] and [[Special:MyLanguage/Extension:LinkedWiki|LinkedWiki]])</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with SPARQL Query service</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with an API</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with an API</span><ref>{{ll|Extension:VisualData/API}}</ref> | API is not yet stable <ref>https://meta.weirdgloop.org/w/Extension:Bucket</ref> |yes, with an API or SPARQL endpoint |- | <span lang="en" dir="ltr" class="mw-content-ltr">Result formats<ref>"Result formats" mean the ability of the wiki to display data (results of an inline query) in various formats, e.g. tables, calendars, maps, timelines, etc.</ref></span> | ~ 75<ref>https://www.semantic-mediawiki.org/wiki/Help:Result_formats</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">no native result display; data may be visualized via:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Query Service or other external tools </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * on wiki data access via LUA (no query support) </div> * {{ll|Extension:LinkedWiki}} - <span lang="en" dir="ltr" class="mw-content-ltr">third-party</span> | <span lang="en" dir="ltr" class="mw-content-ltr">~ 25</span><ref>{{ll|Extension:Cargo/Display formats}}</ref> | 12+ (Json, Table, Datatable, Template, Calendar, Carousel, Map, pageid, pagetitle, count, raw, Lua ) <ref>{{ll|Extension:VisualData/Result_formats}}</ref> | | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Development</span> | [[github:SemanticMediaWiki/SemanticMediaWiki|GitHub]] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Cargo Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/VisualData Gerrit] |[[github:weirdgloop/mediawiki-extensions-Bucket|GitHub]] |[[github:ProfessionalWiki/NeoWiki|GItHub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Complementary extensions</span> | ~ 40<ref>{{ll|Category:Semantic MediaWiki extensions}}</ref>, e.g. {{ll|Extension:Semantic Result Formats|Semantic Result Formats}}, {{ll|Extension:Semantic Bundle|Semantic Bundle}}, {{ll|Extension:Semantic Scribunto|Semantic Scribunto}} | ~12<ref>{{ll|Category:Wikibase extensions}}</ref>, e.g. {{ll|Extension:Wikibase Repository|Wikibase Repository}}, {{ll|Extension:Wikibase Client|Wikibase Client}}, {{ll|Extension:WikibaseLexeme|WikibaseLexeme}}, [https://wikiba.se/applications/#query-service Query Service] | <span lang="en" dir="ltr" class="mw-content-ltr">2 ([[Special:MyLanguage/Extension:Page Forms|Page Forms]], [[Special:MyLanguage/Extension:Page Schemas|Page Schemas]]). Cargo provides some or all of the functionality of Semantic MediaWiki, Semantic Result Formats, Maps, Semantic Drilldown, Semantic Compound Queries, Semantic Internal Objects and Semantic Scribunto.</span><ref>[[Extension:Cargo/Cargo and Semantic MediaWiki]].</ref> | {{ll|Extension:ContactManager|ContactManager}} |{{ll|Extension:Lua|Lua}} | |} <div lang="en" dir="ltr" class="mw-content-ltr"> == Alternative comparisons == </div> * {{ll|Extension:Cargo/Cargo and Semantic MediaWiki|2=<span lang="en" dir="ltr" class="mw-content-ltr">Cargo and Semantic MediaWiki</span>}} * <span lang="en" dir="ltr" class="mw-content-ltr">[https://professional.wiki/en/articles/managing-data-in-mediawiki Semantic MediaWiki vs Wikibase vs Cargo] by [https://professional.wiki Professional Wiki]</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references/> <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{ll|Multi-Content Revisions}} – <span lang="en" dir="ltr" class="mw-content-ltr">Ability to manage different independent content objects on the same wiki page</span> * {{ll|Extension:WikiDB|WikiDB}} – <span lang="en" dir="ltr" class="mw-content-ltr">Provides database features, somewhat similar to semantic properties</span> * {{ll|Extension:JsonConfig|JsonConfig}} – <span lang="en" dir="ltr" class="mw-content-ltr">store JSON (including tabular and map data) in wiki pages, and allow accessing them via Lua; no query support</span> * {{ll|Extension:External Data|External Data}} – <span lang="en" dir="ltr" class="mw-content-ltr">access data from external URL, local file, and SQL or MongoDB database</span> * {{ll|Structured data across Wikimedia}} – <span lang="en" dir="ltr" class="mw-content-ltr">2021-2023 project for improving structured data support in MediaWiki</span> * {{ll|Category:Data management extensions}} [[Category:MediaWiki Introduction{{#translation:}}]] [[Category:Extension comparisons{{#translation:}}]] pk6zae9digvi2qnxmsndx79acqpsyik Manual:Managing data in MediaWiki/it 100 1464447 8364304 8363588 2026-05-03T12:44:44Z FuzzyBot 451990 Updating to match new version of source page 8364304 wikitext text/x-wiki <languages/> <span class="mw-translate-fuzzy">MediaWiki era disegnata per gestire informazioni testuali in genere e lo fa molto bene.</span> <span lang="en" dir="ltr" class="mw-content-ltr">A limited amount of structure is available: {{ll|Help:Namespaces|namespaces}}, {{ll|Help:Subpages|subpages}} and {{ll|Help:Categories|categories}} help to group similar pages together, while features like {{ll|Infobox|infoboxes}} and {{ll|Gallery|galleries}} help to structure the contents within each page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, MediaWiki by itself does not truly provide ways to manage structured data: data that can be queried, filtered, and in some cases displayed with visualizations including tables, charts, maps<ref>see also [[Wikimedia Maps]]</ref> and calendars.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For that, a number of dedicated [[Special:MyLanguage/Manual:Extensions|extensions]] exist.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following table describes the extensions that can store the data edited by users in a MediaWiki database, from where it can then be queried. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is not a list of all structured data functionality; the "[[#See also|See also]]" section lists other extensions and features that can be used for storing or displaying structured data. </div> {| class="wikitable" |- ! <span lang="en" dir="ltr" class="mw-content-ltr">Feature</span> ! [[File:20210702_Semantic_MediaWiki_logo_with_wordmark.png|100px]]<br/>[https://www.semantic-mediawiki.org/ Semantic MediaWiki] ! [[File:Wikibase_Suite_Vertical_2x_RGB.png|100px]]<br/>[https://wikiba.se/ Wikibase] ! [[File:Cargo logo.png|50px]]<br/>{{ll|Extension:Cargo|nsp=0}} ! {{ll|Extension:VisualData|VisualData}} !{{ll|Extension:Bucket|Bucket}} ! {{ll|Extension:NeoWiki|NeoWiki}} |- | <span lang="en" dir="ltr" class="mw-content-ltr">Main usecase</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation, based on [[w:Semantic Web|Semantic Web]] standards.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Powering [[w:Wikidata|Wikidata]] and other editable graph databases.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation based on JSON-schema.</span> |lightweight Lua interface for storing and accessing structured data on wiki pages |Knowledge management system that combines collaborative editing and a [[:en:knowledge_graph|knowledge graph]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Approach</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data (properties) are annotated within regular wikitext or by templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">With the datatype "reference", properties can be used to describe items using statements.</span><ref>https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties are defined and used to describe Items using statements.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data is stored in database tables, with each table corresponding to a template.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data are stored in a dedicated slot with JSON content model</span> |Data is stored in '''buckets''', which are database tables with specific columns that you can define |Schemas can be defined and applied to wiki pages, stored in a dedicated slot as JSON data. |- | <span lang="en" dir="ltr" class="mw-content-ltr">Available since</span> | 2005 | 2012 | 2015 | 2022 <span lang="en" dir="ltr" class="mw-content-ltr">(formerly known as {{ll|Extension:PageProperties|PageProperties}})</span> |2025 |2026 |- | <span lang="en" dir="ltr" class="mw-content-ltr">Active installations</span> | <span lang="en" dir="ltr" class="mw-content-ltr">1000s</span><ref>https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">100s</span><ref>https://wikiapiary.com/wiki/Extension:WikibaseRepository</ref><ref>https://wikibase.world</ref><ref>https://addshore.com/2024/10/visualizing-wikibase-connections-using-wikibase-world/</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">100s</span><ref>https://wikiapiary.com/wiki/Extension:Cargo</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">n/a (new extension or unknown)</span> | | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Community</span> | <span lang="en" dir="ltr" class="mw-content-ltr">190+ developers</span><ref>https://www.openhub.net/p/smw</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">172+ developers</span><ref>https://github.com/wikimedia/mediawiki-extensions-Wikibase</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">63+ developers</span><ref>https://github.com/wikimedia/mediawiki-extensions-Cargo</ref> | ([[User:Thomas-topway-it|<span lang="en" dir="ltr" class="mw-content-ltr">main developer</span>]]) |[https://weirdgloop.org/discord Weird Gloop's Discord] |[https://echolot-eccch.eu/ ECHOLOT project], [https://professional.wiki/ Professinal Wiki], [https://knowledge.wiki KM-A], [https://bluespice.com/bluespice-galaxy/ BlueSpice Galaxy] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Storage</span> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database, Elasticsearch, 5 different SPARQL stores</span><ref>https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database, Elasticsearch, SPARQL store (Blazegraph for wikidata.org)</span> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database (or a separate database)</span><ref>{{ll|Extension:Cargo/Download and installation#Setting the Cargo database}}</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database</span> |MediaWiki database (MySQL/MariaDB) |different SPARQL stores, currently Neo4J |- | <span lang="en" dir="ltr" class="mw-content-ltr">Property definition</span> | <span lang="en" dir="ltr" class="mw-content-ltr">By typing wikitext.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Properties can be invented freely.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will be of datatype page by default and can be defined later.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Datatypes can be changed any time.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties have to be defined before usage and can not be changed easily.</span><ref>[[d:Help:Data type#Changing datatype]]</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties are defined through one or more json-schema defined through a {{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}}</span> |Tables in the Bucket: namespace |Form based schema editing |- | <span lang="en" dir="ltr" class="mw-content-ltr">Value declaration</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Inline (<code><nowiki>[[MyProperty::MyValue]]</nowiki></code>) or with templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Form-based data entry with {{ll|Extension:Page_Forms|Page Forms}}.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Wikibase default form-like input interface.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">With parser functions in templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Form-based data entry with {{ll|Extension:Page_Forms|Page Forms}}.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Inline or popup OOUI {{ll|Extension:VisualData/Forms|forms}} automatically generated from JSON-schemas</span> |via Lua call of the <code>bucket.put</code> function |OOUI based form editing |- | <span lang="en" dir="ltr" class="mw-content-ltr">Predefined data types</span> | 18<ref>https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes</ref> | 17<ref>[[d:Special:ListDatatypes]]</ref><ref><span lang="en" dir="ltr" class="mw-content-ltr">Some datatypes are defined by other extension: [[Special:MyLanguage/Extension:Math|Math]] and [[Special:MyLanguage/Extension:Score|Score]] both define one datatype, [[Special:MyLanguage/Extension:JsonConfig|JsonConfig]] defines two, [[Special:MyLanguage/Extension:WikibaseLexeme|WikibaseLexeme]] defines three, and Wikibase defines ten.</span></ref> | 18 | <span lang="en" dir="ltr" class="mw-content-ltr">4 (basic JSON-schema types) + 15 string formats</span> | 5 <ref>https://meta.weirdgloop.org/w/Extension:Bucket#Basic_usage</ref> | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Property management</span> | <span lang="en" dir="ltr" class="mw-content-ltr">type definitions, constraint schemas, ontology import</span> | <span lang="en" dir="ltr" class="mw-content-ltr">custom, or import of Wikidata ontology</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">through a graphical interface (dedicated {{ll|Extension:VisualData/Schema Builder|SchemaBuilder}})</span> | |through a graphical interface |- | <span lang="en" dir="ltr" class="mw-content-ltr">Page names and internal linking</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Page names are stored with their Q-numbers (displaying labels in available languages). Internal linking must be done to the Q-number; you cannot link to a label.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Schemas are stored in a dedicated namespace and JSON-data in a dedicated slot associated to wiki articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">JSON-data can be accessed through an extension of the wiki interface</span> | |MediaWiki pages can have schemas |- | <span lang="en" dir="ltr" class="mw-content-ltr">Inline queries</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | <span lang="en" dir="ltr" class="mw-content-ltr">no (external SPARQL queries);</span> [[phab:T67626|<span lang="en" dir="ltr" class="mw-content-ltr">planned</span>]]<br/><span lang="en" dir="ltr" class="mw-content-ltr">supported via third-party extension {{ll|Extension:LinkedWiki|LinkedWiki}}</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | |yes, with parser functions via the SQL store |- | <span lang="en" dir="ltr" class="mw-content-ltr">External querying</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with either an API or SPARQL querying (available through special extensions such as [[Special:MyLanguage/Extension:RDFIO|RDFIO]] and [[Special:MyLanguage/Extension:LinkedWiki|LinkedWiki]])</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with SPARQL Query service</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with an API</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with an API</span><ref>{{ll|Extension:VisualData/API}}</ref> | API is not yet stable <ref>https://meta.weirdgloop.org/w/Extension:Bucket</ref> |yes, with an API or SPARQL endpoint |- | <span lang="en" dir="ltr" class="mw-content-ltr">Result formats<ref>"Result formats" mean the ability of the wiki to display data (results of an inline query) in various formats, e.g. tables, calendars, maps, timelines, etc.</ref></span> | ~ 75<ref>https://www.semantic-mediawiki.org/wiki/Help:Result_formats</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">no native result display; data may be visualized via:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Query Service or other external tools </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * on wiki data access via LUA (no query support) </div> * {{ll|Extension:LinkedWiki}} - <span lang="en" dir="ltr" class="mw-content-ltr">third-party</span> | <span lang="en" dir="ltr" class="mw-content-ltr">~ 25</span><ref>{{ll|Extension:Cargo/Display formats}}</ref> | 12+ (Json, Table, Datatable, Template, Calendar, Carousel, Map, pageid, pagetitle, count, raw, Lua ) <ref>{{ll|Extension:VisualData/Result_formats}}</ref> | | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Development</span> | [[github:SemanticMediaWiki/SemanticMediaWiki|GitHub]] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Cargo Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/VisualData Gerrit] |[[github:weirdgloop/mediawiki-extensions-Bucket|GitHub]] |[[github:ProfessionalWiki/NeoWiki|GItHub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Complementary extensions</span> | ~ 40<ref>{{ll|Category:Semantic MediaWiki extensions}}</ref>, e.g. {{ll|Extension:Semantic Result Formats|Semantic Result Formats}}, {{ll|Extension:Semantic Bundle|Semantic Bundle}}, {{ll|Extension:Semantic Scribunto|Semantic Scribunto}} | ~12<ref>{{ll|Category:Wikibase extensions}}</ref>, e.g. {{ll|Extension:Wikibase Repository|Wikibase Repository}}, {{ll|Extension:Wikibase Client|Wikibase Client}}, {{ll|Extension:WikibaseLexeme|WikibaseLexeme}}, [https://wikiba.se/applications/#query-service Query Service] | <span lang="en" dir="ltr" class="mw-content-ltr">2 ([[Special:MyLanguage/Extension:Page Forms|Page Forms]], [[Special:MyLanguage/Extension:Page Schemas|Page Schemas]]). Cargo provides some or all of the functionality of Semantic MediaWiki, Semantic Result Formats, Maps, Semantic Drilldown, Semantic Compound Queries, Semantic Internal Objects and Semantic Scribunto.</span><ref>[[Extension:Cargo/Cargo and Semantic MediaWiki]].</ref> | {{ll|Extension:ContactManager|ContactManager}} |{{ll|Extension:Lua|Lua}} | |} <div lang="en" dir="ltr" class="mw-content-ltr"> == Alternative comparisons == </div> * {{ll|Extension:Cargo/Cargo and Semantic MediaWiki|2=<span lang="en" dir="ltr" class="mw-content-ltr">Cargo and Semantic MediaWiki</span>}} * <span lang="en" dir="ltr" class="mw-content-ltr">[https://professional.wiki/en/articles/managing-data-in-mediawiki Semantic MediaWiki vs Wikibase vs Cargo] by [https://professional.wiki Professional Wiki]</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references/> <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{ll|Multi-Content Revisions}} – <span lang="en" dir="ltr" class="mw-content-ltr">Ability to manage different independent content objects on the same wiki page</span> * {{ll|Extension:WikiDB|WikiDB}} – <span lang="en" dir="ltr" class="mw-content-ltr">Provides database features, somewhat similar to semantic properties</span> * {{ll|Extension:JsonConfig|JsonConfig}} – <span lang="en" dir="ltr" class="mw-content-ltr">store JSON (including tabular and map data) in wiki pages, and allow accessing them via Lua; no query support</span> * {{ll|Extension:External Data|External Data}} – <span lang="en" dir="ltr" class="mw-content-ltr">access data from external URL, local file, and SQL or MongoDB database</span> * {{ll|Structured data across Wikimedia}} – <span lang="en" dir="ltr" class="mw-content-ltr">2021-2023 project for improving structured data support in MediaWiki</span> * {{ll|Category:Data management extensions}} [[Category:MediaWiki Introduction{{#translation:}}]] [[Category:Extension comparisons{{#translation:}}]] qr0i48vvq2l5n7zkvyjswobl2ct5c24 Extension:TimedMediaHandler/VideoJS Player/be 102 1467641 8364351 8363680 2026-05-03T13:12:12Z FuzzyBot 451990 Updating to match new version of source page 8364351 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Скрыншот новага прайгравальніка]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> Ён заснаваны на [$URL VideoJS] і валодае больш сучасным, хуткім карыстацкім інтэрфейсам з падтрымкай для мабільных прылад і HTML5. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Прыклад прайгравальніка]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using tab, enter and spacebar keys</span> <span id="Known_issues"></span> == Вядомыя праблемы == Відэаплэер ўсё яшчэ знаходзіцца ў распрацоўцы, але калі вы выявіце якія-небудзь праблемы, паведаміце пра іх на [[Extension_talk:TimedMediaHandler/VideoJS Player / старонцы абмеркавання]] або захавайце іх у [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> epj40xyu8xzto92q3n0unxclw4czr6o 8364768 8364351 2026-05-03T23:14:36Z FuzzyBot 451990 Updating to match new version of source page 8364768 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Скрыншот новага прайгравальніка]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> Ён заснаваны на [$URL VideoJS] і валодае больш сучасным, хуткім карыстацкім інтэрфейсам з падтрымкай для мабільных прылад і HTML5. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Прыклад прайгравальніка]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</span> <span id="Known_issues"></span> == Вядомыя праблемы == Відэаплэер ўсё яшчэ знаходзіцца ў распрацоўцы, але калі вы выявіце якія-небудзь праблемы, паведаміце пра іх на [[Extension_talk:TimedMediaHandler/VideoJS Player / старонцы абмеркавання]] або захавайце іх у [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 3na9d9m9fm0xusghxo5snjs76oo9i42 OAuth/For Developers/nan 0 1481016 8364292 8350297 2026-05-03T12:27:50Z FuzzyBot 451990 Updating to match new version of source page 8364292 wikitext text/x-wiki <languages /> <div lang="en" dir="ltr" class="mw-content-ltr"> This page explains how to develop applications that can integrate with a wiki running {{ll|Extension:OAuth}} (an extension which turns MediaWiki into an [[w:OAuth|OAuth]] server) to securely request permission to act on the user's behalf. </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you are developing a bot or similar application that always uses the same account, you might prefer the simpler [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]].</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> == OAuth in a nutshell == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> OAuth allows an application to request permission from a user to act through that user's wiki account, without knowing the user's password, and without being able to do everything the user could (e.g. the app might be able to edit articles but not delete them, so even users with extended permissions can safely use OAuth-enabled tools). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This happens via the [https://oauth.net/2/ OAuth 2.0] or [https://oauth.net/core/1.0a/ OAuth 1.0a] protocol, and consists of three stages: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">The developer must register the application (often called "consumer" in the OAuth terminology) on the wiki, possibly go through some sort of review process, and will receive some credentials.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">When a user wants to use it, the application must initiate an authorisation process.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will involve sending the user to a special page on the wiki, which will display an authorisation dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the user accepts, the application will receive another set of credentials (which are specific to that user, and can be revoked by the user at any time).</span> # <span lang="en" dir="ltr" class="mw-content-ltr">When the application actually needs to make an action (API request) on the user's behalf, it can combine the credentials received in steps 1 and 2 to sign the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth is a widely used open standard (you can see it on sites like Google or Facebook or GitHub, e.g. when using accounts at those sites to log in elsewhere).</span> {{info|1=<span lang="en" dir="ltr" class="mw-content-ltr">OAuth should not be confused with:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Initiative for Open Authentication|OATH]] (a second-factor authentication protocol family, commonly known as "type the six numbers you see on your mobile app", now enabled on Wikimedia sites)</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:OpenID Connect|OpenID Connect]] (an authentication protocol based on OAuth 2.0, which the OAuth MediaWiki extension partially supports).</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> For a slightly larger nutshell on OAuth 1.0a, see [https://docs.google.com/presentation/d/1537HnwSaSzH-b8hINcz48SNhT8ElAUPC39to0_O1iNA/edit#slide=id.g15105b408d_0_287 these slides]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == OAuth in detail == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The registration is basically the same for OAuth 1.0a and OAuth 2, with the difference being only the presence of a few form fields. The remaining parts differ significantly depending on the OAuth version.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Generally, OAuth 2 is recommended if available in your environment.</span> <span id="Registration"></span> === Tsù-tsheh === <span lang="en" dir="ltr" class="mw-content-ltr">To register a new OAuth application, submit the form at <code>[[m:Special:OAuthConsumerRegistration/propose|Special:OAuthConsumerRegistration/propose]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Try to give sufficient information about the application for admins and users to decide whether it can be trusted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">URLs to places with more information (such as the application itself, the source code or on-wiki documentation) can be useful.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For OAuth applications to be used on Wikimedia projects, see [[meta:Special:MyLanguage/OAuth app guidelines|app guidelines]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Besides the descriptive ones, the fields have the following meaning:</span> * <code>This consumer is for use only by {{tag|user|open|plain=1}}</code>: <span lang="en" dir="ltr" class="mw-content-ltr">whether you use [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]] (which do not need to be reviewed or authorised but are only usable by yourself).</span> * <code>callback URL</code> (<span lang="en" dir="ltr" class="mw-content-ltr">irrelevant to owner-only consumers</span>): <span lang="en" dir="ltr" class="mw-content-ltr">the URL where the user returns after authorisation is checked against this.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(This is an extra layer of security against an attacker trying to steal credentials during authorisation.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>use as prefix</code> option is enabled, the URL must start with this (the check is dumb so make sure to add at least a <code>/</code> after the domain name), otherwise it must be an exact match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you are developing/testing your local machine, specify [[w:Localhost|Localhost]] in this field (e.g. <code><nowiki>http://localhost:8080/</nowiki></code>).</span> * <code>Applicable project</code> (<span lang="en" dir="ltr" class="mw-content-ltr">for wiki farms only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">project(s) on which to use your application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can limit the application to a single wiki or have it work everywhere.</span> * <code>Types of grants</code> / <code>Applicable grants</code>: <span lang="en" dir="ltr" class="mw-content-ltr">the permissions needed by your application (be conservative). The actual permissions will be an intersection of this and what permissions the user has.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Currently, the user must authorise grouped permissions, not individual ones ([[Phab:T59505|T59505]]).</span> * <code>Allowed IP ranges</code>: <span lang="en" dir="ltr" class="mw-content-ltr">an optional specification of the IP ranges that you use, where OAuth requests not matching this will be rejected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is an extra layer of security against an attacker stealing your application's credentials and trying to impersonate it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> * <code>Public RSA key</code> (<span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">public key used by your application for signing requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can just leave this empty (most applications do) to use a slightly simpler shared-secret mechanism instead.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> <span lang="en" dir="ltr" class="mw-content-ltr">After registration, you'll receive the credentials needed to use OAuth.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to use it immediately with your own user account (this is meant for testing); others will only be able to use it once it is approved by an administrator.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The list of applications (approved or otherwise) is public and can be browsed at <code>[[m:Special:OAuthListConsumers|Special:OAuthListConsumers]]</code>. </div> === OAuth 1.0a === <span id="Authorisation"></span> ==== Siū-kuân ==== [[File:OAuth authorization interface.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Authorisation dialog shown to users</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> When registering the application, you receive two pieces of credentials: the application token (a public ID for the application) and the application secret (sort of like a password). </div> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another set of credentials (these ones specific to that user): the access token and access secret.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">With an RSA key the credentials are slightly different.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is assumed that people choosing to use an RSA key know what they are doing, so this tutorial will assume you have chosen the non-RSA option.</span> </ref> <span lang="en" dir="ltr" class="mw-content-ltr">To get them, you need to go through the authorisation process, which consists of three steps:</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|OAuth/Owner-only consumers|owner-only consumers}} for that.</span> </ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Get a request token from the wiki by sending a GET request to <code>Special:OAuth/initiate</code>, signed with the application key and secret, with the callback URL (where the user will be sent after a successful authorisation) passed as the <code>oauth_callback</code> query parameter (if you have set a constant URL at registration, the value of the parameter ''must'' be <code>oob</code>).</span><ref name="non-nice-url"><span lang="en" dir="ltr" class="mw-content-ltr">Due to [[phab:T59500]] you must currently use a non-nice URL such as <code>en.wikipedia.org/w/index.php?title=Special:OAuth/initiate</code>.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">If you are successful, the response will be a JSON object with <code>token</code> and <code>key</code> fields—the request token and request secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If not, it will have an <code>error</code> field.)</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>Special:OAuth/authorize</code>, with the application token and request token passed as query parameters (<code>oauth_consumer_key</code> and <code>oauth_token</code>, respectively).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>oauth_verifier</code> will contain the verification code that you can use to exchange the request token and secret for the access token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a request to <code>Special:OAuth/token</code><ref name="non-nice-url" /> which includes the <code>oauth_verifier</code> parameter you just received and is signed with the application token and secret and the request token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token/secret (in the same format as the request token/secret in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token and secret is what you'll need to sign API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The request token and secret is not useful anymore and can be discarded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token will remain valid indefinitely, unless the user revokes it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If you prefer not to store it, you can just repeat the authorisation process at any time though.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Applications which only need minimal privileges (have been registered as ''User identity verification only'') can use <code>/authenticate</code> instead of <code>/authorize</code> in step 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This works the same way, but the user will only see the authorisation dialog if they have not authorised this application before; otherwise the authorisation will silently succeed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure, so you don't have to implement it manually—each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Making requests on the user's behalf ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to be signed with the application token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth, with one exception (see next section).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications registered as ''User identity verification only'' cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Identifying the user ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a custom protocol (similar to OpenID Connect) for authenticating the user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send a signed OAuth request to <code>Special:OAuth/identify</code>:</span><ref name="non-nice-url" /> <span lang="en" dir="ltr" class="mw-content-ltr">the response will be a [[w:JSON Web Token|JWT]] (JSON Web Token &ndash; a signed JSON object) including the name of the user, their {{ll|Manual:Central ID|central ID}} (under the key <code>sub</code>) and various other information (such as their user groups and whether they are blocked; also the email address if the application was registered with the right grant type).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is more secure than using the API (e.g. the userinfo module) for authentication, which could be subject to [[w:Man-in-the-middle attack|man-in-the-middle attacks]]; always use this if you need to identify a user!</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also, make sure you properly validate the JWT (there are many libraries which can help with that).</span> <span lang="en" dir="ltr" class="mw-content-ltr">You should check each of the following: the issuer (<code>iss</code>) matches the domain name of the wiki, the audience (<code>aud</code>) matches your application key, the issued-at time (<code>iat</code>) is in the past and reasonably close to current time, the expiration time (<code>exp</code>) is in the future, the nonce (<code>nonce</code>) matches the one you sent in the request.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Signing requests ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Steps 1 and 3 of the authorisation process require signing the request; API requests and <code>Special:OAuth/identify</code> must likewise be signed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The signing process is detailed in [https://oauth.net/core/1.0a/#signing_process section 9 of the OAuth spec], but it is cumbersome to implement by hand and [https://oauth.net/1/ many libraries] are available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find code samples and an overview of how to do it by hand in the {{ll|OAuth/Owner-only_consumers|owner-only consumer}} documentation.</span> (<span lang="en" dir="ltr" class="mw-content-ltr">That is for signing with the consumer token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Modify as appropriate to sign with the consumer token/secret and request token/secret (authorisation step 3) or consumer token/secret only (authorisation step 1).</span>) === OAuth 2 === <span id="Authorisation"></span> ==== Siū-kuân ==== <span lang="en" dir="ltr" class="mw-content-ltr">When registering the application, you receive two pieces of credentials: the client application key (a public ID for the application, also called the client ID or consumer key) and the client application secret (a confidential password).</span> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another credential (this one specific to that user): the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To get it, you need to go through the [https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/ the OAuth 2 Authorization Code flow], which consists of two steps:</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See [[Special:MyLanguage/OAuth/Owner-only consumers|owner-only consumers]] for that.</span></ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>oauth2/authorize</code> under the wiki's REST endpoint (usually <code>rest.php</code>), with <code>response_type=code</code> and the consumer key (also called the client application key) as the <code>client_id</code>, possibly a <code>state</code> if you want, and optionally the <code>redirect_uri</code> (if yes, it must be the same as in your application request).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If your consumer is non-confidential, you'll also need to include a [https://www.oauth.com/oauth2-servers/pkce/authorization-request/ PKCE code challenge] (<code>code_challenge</code> and <code>code_challenge_method=S256</code>).</span><ref>PKCE &mdash; Proof Key for Code Exchange</ref> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>code</code> will contain the authorisation code that you can use to fetch the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a POST request to <code>oauth2/access_token</code> under the wiki's REST endpoint (usually <code>rest.php</code>), including <code>grant_type=authorization_code</code>, the <code>code</code> parameter you just received, your client authentication (typically as <code>client_id</code> and, for confidential clients, <code>client_secret</code>), the <code>redirect_uri</code> if and only if you specified it in the previous step (must be the same value for both), and if non-confidential the PKCE <code>code_verifier</code> and <code>code_challenge_method</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token and a refresh token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token is what you'll need to send future API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The refresh token can be used to [https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/ fetch a new access token] if the original access token expires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you prefer not to store either token, you can just repeat the authorisation process at any time.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(Before MediaWiki 1.46, non-confidential clients could only use refresh tokens using their client secret keys, not using their client IDs only, see [[phabricator:T323855|T323855]].)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure so you don't have to implement it manually - each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Making requests on the user's behalf ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to include the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the access token is used to fetch a CSRF token or other tokens, the access token must still be passed (as a header) with requests that use those tokens.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications which need minimal privileges (have been registered as ''User identity verification only'') cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> API requests including <code>rest.php/oauth2/resource/profile</code> must be authenticated with an HTTP Authorization header containing the access token, like: </div> <pre> Authorization: Bearer abcde....6789 </pre> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Identifying the user ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a somewhat incomplete implementation of OpenID Connect for authenticating the user.</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">See [[phab:T254063|T254063]] for details.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send an authenticated OAuth GET request to the <code>oauth2/resource/profile</code> API (MediaWiki's implementation of what the OIDC spec calls the UserInfo endpoint) under the wiki's REST endpoint (usually <code>rest.php</code>); the response will include the name of the user and various other information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that the GET request must use the HTTP <code>Authorization</code> header, not a query string token.</span> * '''sub''' <span lang="en" dir="ltr" class="mw-content-ltr">(central user ID)</span> * '''username''' * '''editcount''' * '''confirmed_email''' * '''blocked''' * '''registered''' * '''groups''' * '''rights''' * '''realname''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> * '''email''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Setting up a development environment == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> You can register an OAuth application on [https://meta.wikimedia.beta.wmflabs.org/wiki/Special:OAuthConsumerRegistration/propose beta meta] and test your code against that. </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you want to improve the extension itself, or debug protocol issues in detail, OAuth is available in the {{ll|MediaWiki-Vagrant}} development environment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Add the <code>oauth</code> role, and your local wiki will be able to authorise OAuth apps.</span> <syntaxhighlight lang="shell-session"> $ vagrant roles enable oauth $ vagrant provision </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Once the code is nearly ready, you can register an OAuth application on the real wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to test it with the same user account used for registering, even before it gets reviewed by admins.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If you are creating an application for Wikimedia projects, consider hosting it at [[Wikitech:Portal:Toolforge|Wikimedia Toolforge]], a free tool forge and hosting platform for Wikimedia-related services. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Security benefits and trade-offs == </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Unlike password-based authentication, the OAuth 1.0 protocol prevents any [[w:Man-in-the-middle attack|man-in-the-middle attack]] even if the wiki does not require HTTPS: all interactions between MediaWiki and the application are signed with either a shared secret (using HMAC-SHA1), or a [[w:Public-key cryptography|public key]] (RSA).</span> <span lang="en" dir="ltr" class="mw-content-ltr">HTTPS is still required for certain steps though (for obtaining the shared secret in the second step of authorisation when not using RSA, and during app registration).</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 2.0 does not involve signing and relies on HTTPS for security.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Actions via OAuth happen under the user's name but will be [[Special:MyLanguage/Manual:Tags|tagged]] with the application's name as well so rogue applications can be identified.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Wiki admins can revoke the application's permissions (and thus bar it from any further action) if needed.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The user can revoke the permission of the application to use that specific user account if they don't like how it works or don't trust it anymore.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Unlike a password change, this is not disruptive for the user.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Sufficiently flexible applications might allow users to circumvent IP blocks (since MediaWiki will see the IP of the application server, not that of the user).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This can be handled the same way proxies are, by trusting XFF headers set by the application (see [[Phab:T159889|T159889]] for some limitations).</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The application secret must be kept secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Submitting it to source control or putting it into user-accessible code (such as mobile app or desktop application; even if it is obfuscated) undermines the security model and will result in admins forcefully disabling the application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Exceptions are made for example applications demoing OAuth usage, if they are explicitly labeled as such and request limited rights.</span> <span id="Libraries"></span> == Tsu-liāu-khòo == === PHP === * [[oauthclient-php]] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a client library maintained by Wikimedia</span> * [https://php.net/book.oauth OAuth] – <span lang="en" dir="ltr" class="mw-content-ltr">PECL client library</span> * [https://github.com/firebase/php-jwt firebase/php-jwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a popular JWT library</span> * [https://sr.ht/~taavi/laravel-socialite-mediawiki/ laravel-socialite-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki driver for [[w:Laravel|Laravel]]'s [https://laravel.com/docs/7.x/socialite Socialite] library.</span> === Python === * [https://github.com/valhallasw/flask-mwoauth flask-mwoauth] – <span lang="en" dir="ltr" class="mw-content-ltr">a Flask blueprint to run OAuth against MediaWiki's Extension:OAuth (See tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Flask_OAuth_tool My first Flask OAuth tool])</span> * [https://github.com/wikimedia/MediaWiki-OAuth MediaWiki-OAuth (mwoauth)] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a on top of [http://requests-oauthlib.readthedocs.org/en/latest/oauth1_workflow.html requests-oauthlib]</span> * [https://github.com/python-social-auth/social-core python-social-auth] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework that includes a [https://github.com/python-social-auth/social-core/blob/master/social_core/backends/mediawiki.py MediaWiki backend] (Example tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Django_OAuth_tool My first Django OAuth tool])</span> * [https://docs.authlib.org/en/latest/index.html authlib] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework to interact with Wikimedia OAuth 2.0 API (Full minimal Django OAuth 2.0 [https://code.basabuuka.org/alpcentaur/wmde_oauth_django_example example])</span> * [https://github.com/jpadilla/pyjwt pyjwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a JWT library</span> === Ruby === * [https://github.com/timwaters/omniauth-mediawiki omniauth-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">a MediaWiki strategy for OmniAuth (also available as a [https://rubygems.org/gems/omniauth-mediawiki gem])</span> === Rust === * [https://crates.io/crates/mediawiki MediaWiki crate] <span lang="en" dir="ltr" class="mw-content-ltr">implements both OAuth1 and OAuth2 login mechanisms.</span> * [https://crates.io/crates/oauth2 oauth2 crate] === Node.js === * [https://www.npmjs.com/package/passport-mediawiki-oauth passport-mediawiki-oauth] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki strategy for the Passport auth framework (which can be used effortlessly as a middleware with Express JS and similar frameworks)</span> * [https://www.npmjs.com/package/oauth-fetch-json oauth-fetch-json] – <span lang="en" dir="ltr" class="mw-content-ltr">library for signing OAuth requests</span> * [https://www.npmjs.com/package/m3api-oauth2 m3api-oauth2] – an extension package for [https://www.npmjs.com/package/m3api m3api], making it easy to make requests authenticated via [[Special:MyLanguage/Help:OAuth|OAuth 2.0]] === Go === * [https://github.com/mrjones/oauth mrjones/oauth] (OAuth 1.0) * [https://pkg.go.dev/golang.org/x/oauth2 golang.org/x/oauth2] <span lang="en" dir="ltr" class="mw-content-ltr">(OAuth 2.0, [https://pkg.go.dev/golang.org/x/oauth2#example-Config example])</span> === Java === * [https://github.com/scribejava/scribejava ScribeJava] <span lang="en" dir="ltr" class="mw-content-ltr">since version 5.5.0 ([https://github.com/scribejava/scribejava/pull/852 pull request])</span> <span id="Example_code"></span> == Sī-lē tāi-bé == <span id="PHP_client_without_using_any_libraries"></span> === Bô sú-iōng jīm-hô tsu-liāu-khòo ê PHP kheh-hōo-tuan === [[toollabs:oauth-hello-world|OAuth Hello World]] – <span lang="en" dir="ltr" class="mw-content-ltr">easy to understand demo application written in PHP without any libraries.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === PHP command-line client with RSA keys, using oauthclient-php === </div> <span lang="en" dir="ltr" class="mw-content-ltr">PHP application using classes from the OAuth extension codebase.</span> {{Todo|1=<span lang="en" dir="ltr" class="mw-content-ltr">convert this to actually use oauthclient-php! Probably just a bunch of <code>use</code> declarations.</span>}} <span lang="en" dir="ltr" class="mw-content-ltr">Before Starting:</span> <syntaxhighlight lang="shell-session"> $ openssl genrsa -out appkey.pem 4096 $ openssl rsa -in appkey.pem -pubout > appkey.pub </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">PHP source code</span>}} <syntaxhighlight lang="php"> <?php if ( PHP_SAPI !== 'cli' ) { die( "CLI-only test script\n" ); } /** * A basic client for overall testing */ function wfDebugLog( $method, $msg) { //echo "[$method] $msg\n"; } require 'OAuth.php'; require 'MWOAuthSignatureMethod.php'; $consumerKey = ''; #$consumerSecret = ''; // We don't need this, since we're using RSA, except to validate the /identify call $privateKey = file_get_contents( 'appkey.pem' ); $baseurl = 'http://<wiki>/wiki/Special:OAuth'; $endpoint_req = $baseurl . '/initiate?format=json&oauth_callback=oob'; // format=json makes php a little easier $endpoint_acc = $baseurl . '/token?format=json'; $endpoint_id = $baseurl . '/identify'; $c = new OAuthConsumer( $consumerKey, $privateKey ); // Make sure we sign title and format $parsed = parse_url( $endpoint_req ); $extraSignedParams = array(); parse_str($parsed['query'], $extraSignedParams); $extraSignedParams['title'] = 'Special:OAuth/initiate'; $init_req = OAuthRequest::from_consumer_and_token( $c, // OAuthConsumer for your app NULL, // User token, NULL for calls to initiate "GET", // http method $endpoint_req, // endpoint url (this is signed) $extraSignedParams // extra parameters we want to sign (must include title) ); $rsa_method = new MWOAuthSignatureMethod_RSA_SHA1( new OAuthDataStore(), $privateKey ); $init_req->sign_request( $rsa_method, // OAuthSignatureMethod $c, // OAuthConsumer for your app NULL // User token, NULL for calls to initiate ); echo "Getting request token with: $init_req\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, (string) $init_req ); // Pass OAuth in GET params curl_setopt( $ch, CURLOPT_HTTPGET, true ); curl_setopt( $ch, CURLOPT_HEADER, false ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $requestToken = json_decode( $data ); print "Visit $baseurl/authorize?oauth_token={$requestToken->key}&oauth_consumer_key=$consumerKey\n"; // ACCESS TOKEN print "Enter the verification code:\n"; $fh = fopen( "php://stdin", "r" ); $line = fgets( $fh ); $rc = new OAuthToken( $requestToken->key, $requestToken->secret ); $parsed = parse_url( $endpoint_acc ); parse_str($parsed['query'], $params); $params['oauth_verifier'] = trim($line); $params['title'] = 'Special:OAuth/token'; $acc_req = OAuthRequest::from_consumer_and_token( $c, $rc, "GET", $endpoint_acc, $params ); $acc_req->sign_request($rsa_method, $c, $rc); echo "Calling: $acc_req\n"; unset( $ch ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_acc ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $acc_req->to_header() ) ); // Set the Authorization Header $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $acc = json_decode( $data ); $accessToken = new OAuthToken( $acc->key, $acc->secret ); /** * Insecurely call the api for information about the user. * A MITM can forge a response from the server, so don't rely on this for identity! */ $apiurl = 'http://<wiki>/w/api.php'; $apiParams = array( 'action' => 'query', 'meta' => 'userinfo', 'uiprop' => 'rights', 'format' => 'json', ); $api_req = OAuthRequest::from_consumer_and_token( $c, // Consumer $accessToken, // User Access Token "GET", // HTTP Method $apiurl, // Endpoint url $apiParams // Extra signed parameters ); $api_req->sign_request( $rsa_method, $c, $accessToken ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $apiurl . "?" . http_build_query( $apiParams ) ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $api_req->to_header() ) ); // Authorization header required for api $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; /** * Securely get the identity of the user */ $consumerSecret = ''; $extraSignedParams = array( 'title' => 'Special:OAuth/identify' ); $req = OAuthRequest::from_consumer_and_token( $c, $accessToken, "GET", $endpoint_id, $extraSignedParams ); $req->sign_request( $rsa_method, $c, $accessToken ); echo "Calling: '$endpoint_id'\nHeader: {$req->to_header()}\n\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_id ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $req->to_header() ) ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } $identity = JWT::decode( $data, $consumerSecret ); // Validate the JWT if ( !validateJWT( $identity, $consumerKey, $req->get_parameter( 'oauth_nonce' ) ) ) { print "The JWT did not validate"; } else { print "We got a valid JWT, describing the user as:\n"; print " * Username: {$identity->username}\n"; print " * User's current groups: " . implode( ',', $identity->groups ) . "\n"; print " * User's current rights: " . implode( ',', $identity->rights ) . "\n"; } /** * Validate a JWT, to ensure this isn't a reply, spoof, etc. * @param $identity the decoded JWT * @param $consumerKey your App's Key * @param $nonce the nonce sent with your request, which should be returned */ function validateJWT( $identity, $consumerKey, $nonce ) { $expectedConnonicalServer = 'http://<wiki>'; // Verify the issuer is who we expect (server sends $wgCanonicalServer) if ( $identity->iss !== $expectedConnonicalServer ) { print "Invalid Issuer"; return false; } // Verify we are the intended audience if ( $identity->aud !== $consumerKey ) { print "Invalid Audience"; return false; } // Verify we are within the time limits of the token. // Issued at (iat) should be in the past, // Expiration (exp) should be in the future. $now = time(); if ( $identity->iat > $now || $identity->exp < $now ) { print "Invalid Time"; return false; } // Verify we haven't seen this nonce before, which would indicate a replay attack if ( $identity->nonce !== $nonce ) { print "Invalid Nonce"; return false; } return true; } </syntaxhighlight> {{Collapse_bottom}} <span id="Python_command-line_client_using_mwoauth"></span> === Sú-iōng mwoauth ê Python bīng-līng hâng kheh-hōo-tuan === {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Python source code</span>}} <syntaxhighlight lang="python"> from mwoauth import ConsumerToken, Handshaker import requests from requests_oauthlib import OAuth1 from six.moves import input # For compatibility between python 2 and 3 # Consruct a "consumer" from the key/secret provided by MediaWiki import config # You'll need to provide this # Create a file called config.py somewhere where it will be found by python, e.g. in the same directory as this script, with the following content (not including the # characters!) # consumer_key = "the consumer token you got when you registered your applicaton" # consumer_secret = "the secret token you got when you registered your application" # For example: # consumer_key = "20bc67da5081a30c736340c493f60d14" # consumer_secret = "af4313371bb2fb38e81fe7d300080085f52849f9" consumer_token = ConsumerToken(config.consumer_key, config.consumer_secret) # Construct handshaker with wiki URI and consumer handshaker = Handshaker("https://en.wikipedia.org/w/index.php", consumer_token) # Step 1: Initialise -- ask MediaWiki for a temporary key/secret for user redirect, request_token = handshaker.initiate() # Step 2: Authorise -- send user to MediaWiki to confirm authorisation print("Point your browser to: %s" % redirect) # response_qs = input("Response query string: ") # Step 3: Complete -- obtain authorised key/secret for "resource owner" access_token = handshaker.complete(request_token, response_qs) # Construct an auth object with the consumer and access tokens auth1 = OAuth1(consumer_token.key, client_secret=consumer_token.secret, resource_owner_key=access_token.key, resource_owner_secret=access_token.secret) # Now, accessing the API on behalf of a user print("Reading top 10 watchlist items") response = requests.get( "https://en.wikipedia.org/w/api.php", params={ 'action': "query", 'list': "watchlist", 'wllimit': 10, 'wlprop': "title|comment", 'format': "json" }, auth=auth1 ) for item in response.json()['query']['watchlist']: print("{title}\t{comment}".format(**item)) </syntaxhighlight> {{Collapse_bottom}} <span id="Python_Toolforge_tutorial_using_mwoauth"></span> === Sú-iōng mwoauth ê Python Toolforge kàu-tîng === Tsham-ua̍t: [[wikitech:Help:Toolforge/My first Flask OAuth tool]] === Python Toolforge tutorial using authlib (OAuth 2.0) === {{Collapse_top|title=Python source code}} <syntaxhighlight lang="python"> # > requirements.txt # flask==3.1.3 # requests==2.33.1 # authlib==1.7.0 # > config.py OAUTH_ACCESS_TOKEN_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/access_token" OAUTH_API_BASE_URL = "https://commons.wikimedia.org/w/" OAUTH_AUTHORIZE_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/authorize" OAUTH_CODE_CHALLENGE_METHOD = "S256" OAUTH_CONSUMER_KEY = "Y" OAUTH_CONSUMER_SECRET = "Z" OAUTH_SCOPE = "basic editpage" # > app.py from authlib.integrations.flask_client import FlaskOAuth2App, OAuth from flask import Flask, jsonify, redirect, request, session from requests import Response app = Flask() app.config.from_pyfile("config.py") oauth = OAuth(app) oauth.register( name="mediawiki", client_id=app.config["OAUTH_CONSUMER_KEY"], client_secret=app.config["OAUTH_CONSUMER_SECRET"], client_kwargs={ "code_challenge_method": app.config["OAUTH_CODE_CHALLENGE_METHOD"], "scope": app.config["OAUTH_SCOPE"], }, api_base_url=app.config["OAUTH_API_BASE_URL"], access_token_url=app.config["OAUTH_ACCESS_TOKEN_URL"], authorize_url=app.config["OAUTH_AUTHORIZE_URL"], ) oauth_client: FlaskOAuth2App = oauth.create_client("mediawiki") @app.route("/") def index(): return app.send_static_file("index.html") @app.route("/login") def login(): return oauth_client.authorize_redirect() @app.route("/oauth-callback") def auth(): token = oauth_client.authorize_access_token() session["token"] = token return redirect("/") @app.route("/logout") def logout(): session.pop("token", None) session.clear() return redirect("/") @app.route("/user") def user(): response: Response = oauth_client.request( "GET", "rest.php/oauth2/resource/profile", token=session["token"], ) user = response.json() response.raise_for_status() return jsonify(user=user) @app.route("/edit", methods=["POST"]) def edit(): data = request.get_json() pageid = int(data["pageid"]) response: Response = oauth_client.request( "POST", "api.php", token=session["token"], data=dict( format="json", formatversion="2", action="query", pageids=str(pageid), prop="revisions|wbentityusage", rvprop="content", rvslots="*", meta="tokens", ), ) r = response.json() token = r["query"]["tokens"]["csrftoken"] ... </syntaxhighlight> {{Collapse_bottom}} <span id="Go_command-line_client_using_mrjones/auth_(OAuth_1.0)"></span> <div class="mw-translate-fuzzy"> === Sú-iōng mrjones/auth ê bīng-līng tsip-hîng kheh-hōo tuan === </div> Teh lí khai-sí tsìn-tsîng: <syntaxhighlight lang="shell-session"> $ go get github.com/mrjones/oauth </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Go source code</span>}} <syntaxhighlight lang="go"> package main import ( "fmt" "os" "github.com/mrjones/oauth" "io/ioutil" "strconv" ) func main() { var consumerKey string = "" var consumerSecret string = "" if len(consumerKey) == 0 || len(consumerSecret) == 0 { os.Exit(1) } c := oauth.NewConsumer( consumerKey, consumerSecret, oauth.ServiceProvider{ RequestTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/initiate", AuthorizeTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/authorize", AccessTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/token", }) c.Debug(true) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/initiate", } c.AdditionalAuthorizationUrlParams = map[string]string{ "oauth_consumer_key": consumerKey, } requestToken, url, err := c.GetRequestTokenAndUrl("oob") if err != nil { fmt.Println( err ) } fmt.Println( "Got token " + requestToken.Token ) fmt.Println("(1) Go to: " + url) fmt.Println("(2) Grant access, you should get back a verification code.") fmt.Println("(3) Enter that verification code here: ") verificationCode := "" fmt.Scanln(&verificationCode) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/token", } accessToken, err := c.AuthorizeToken(requestToken, verificationCode) if err != nil { fmt.Println(err) } fmt.Println( "Got access token " + accessToken.Token ) c.AdditionalParams = map[string]string{} response, err := c.Get( "http://<wiki>/wiki/api.php", map[string]string{ "action": "query", "meta": "userinfo", "uiprop": "rights", "format": "json", }, accessToken) if err != nil { fmt.Println(err) } fmt.Println( "\tResponse Status: '" + response.Status + "'\n" ) fmt.Println( "\tResponse Code: " + strconv.Itoa(response.StatusCode) + "\n" ) bytes, _ := ioutil.ReadAll(response.Body) fmt.Println( "\tResponse Body: " + string(bytes) + "\n" ) } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === JavaScript applications using OAuth 2 === </div> * [https://github.com/wikimedia/apiclient-wiki wikimedia/apiclient-wiki] – <span lang="en" dir="ltr" class="mw-content-ltr">entire application in 520 lines of code</span> <span id="Full_applications_using_OAuth"></span> === Sú-iōng OAuth ê uân-tsíng ìng-iōng thîng-sū === * [https://github.com/jdlrobson/weekipedia/blob/master/libs/server/app.js Weekipedia], <span lang="en" dir="ltr" class="mw-content-ltr">A full scale React.js port of the Wikipedia mobile site uses both.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">many [https://toolhub.wikimedia.org/search?keywords__term=oauth Toolforge tools]</span> <span id="Notes"></span> == Tsù-kái == <references /> ehmys8bleaahyw341eed1rq553tkfwn Extension:TimedMediaHandler/VideoJS Player/eo 102 1481495 8364355 8363683 2026-05-03T13:12:14Z FuzzyBot 451990 Updating to match new version of source page 8364355 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Ekranfoto de la nova videoludilo en ago]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> Ĝi estas bazita sur [https://videojs.com/ VideoJS] kaj havas pli modernan, pli rapida uzanta fasado kun kongrueco por moveblaj aparatoj kaj HTML5. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|<span lang="en" dir="ltr" class="mw-content-ltr">Example video player</span>]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using tab, enter and spacebar keys</span> <span id="Known_issues"></span> == Konataj problemoj == La videa ludisto estas ankoraŭ en evoluado, sed se vi trovas ajnajn problemojn, bonvolu raporti ĉi tiujn sur la [[Extension_talk:TimedMediaHandler/VideoJS Player|parolada paĝo]] aŭ registri ilin en [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 4i5qfmn4301llzduvrj3zqu8mko6kef 8364771 8364355 2026-05-03T23:14:38Z FuzzyBot 451990 Updating to match new version of source page 8364771 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Ekranfoto de la nova videoludilo en ago]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> Ĝi estas bazita sur [https://videojs.com/ VideoJS] kaj havas pli modernan, pli rapida uzanta fasado kun kongrueco por moveblaj aparatoj kaj HTML5. <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|<span lang="en" dir="ltr" class="mw-content-ltr">Example video player</span>]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</span> <span id="Known_issues"></span> == Konataj problemoj == La videa ludisto estas ankoraŭ en evoluado, sed se vi trovas ajnajn problemojn, bonvolu raporti ĉi tiujn sur la [[Extension_talk:TimedMediaHandler/VideoJS Player|parolada paĝo]] aŭ registri ilin en [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> elbpir2eu24hfx251n22jhdgo9ma10a Translations:Help:Extension:Translate/Validators/55/en 1198 1483487 8364871 5001278 2026-05-04T04:02:44Z FuzzyBot 451990 Importing a new version from external source 8364871 wikitext text/x-wiki If $1 is specified '''as a string''', it is used as the regex. 3ifr5ozgfph8rdz7t9ttppnrf3meg8s Translations:Help:Extension:Translate/Validators/61/en 1198 1483493 8364872 5001284 2026-05-04T04:02:44Z FuzzyBot 451990 Importing a new version from external source 8364872 wikitext text/x-wiki If $1 is specified '''as an associative array (see example #2)''', see below for further details. kgvqnrw0qj9ng9w9oufr5qylujo8mnz Help:Extension:Translate/Validators/en 12 1483606 8364873 6038827 2026-05-04T04:02:48Z FuzzyBot 451990 Updating to match new version of source page 8364873 wikitext text/x-wiki <languages/> {{Extension-Translate}} Translatable strings often contain markup that should be retained as-is in the translation. Typing that markup can be slow and difficult because special characters are common. Translate extension can provide translators a button clicking on which inserts the piece of markup into the translation to the current cursor position. In addition, if a translation is missing that specific markup, the Translate extension can either warn the translator or simply reject the translation, since such markup is usually mandatory to display the messages properly to the end user. For example in the string, <blockquote>''Adapted by %{name} from a work by %{original}''</blockquote> there are two insertables - <code>%{name}</code> and <code>%{original}</code>. If the translator does not add them to their translation, the end user using the software will not see a proper message. The <code>MessageValidator</code> framework has been added with the intent of helping with validating translations. Validators run on the translated message and based on the configuration, a warning or error message is shown to the translator. Translations with warnings can still be saved, but ones that have error cannot. Only a user with <code>translate-manage</code> permission can save translations that have errors. When configuring a validator, a regex is defined to identify markup that is mandatory. The validator can also be marked as insertable, in which case a button will be displayed to the translator to add that markup into the translation. Adding a custom validators is still possible and will be needed for more specialized validations. == Configuration == Following is a summarized validator configuration, <syntaxhighlight lang="yaml" line="1" start="1"> VALIDATORS: # Example 1 - id: InsertableRegex enforce: true insertable: true params: /\$[a-z0-9]+/ keymatch: - 'untranslated' # Matches key untranslated directly - type: 'wildcard' pattern: '*translated*' # Matches any key that has the translated in it # Example 2 - id: InsertableRegex insertable: true params: regex: /(?<pre>\[)[^]]+(?<post>\]\([^)]+\))/ display: $pre $post pre: $pre post: $post # Example 3 - class: MathJaxMessageValidator enforce: true # Example 4 - id: BraceBalance </syntaxhighlight> In the example above, # <code>InsertableRegex</code> is a bundled validator that can accept a custom regex and run validations. # <code>MathJaxMessageValidator</code> is a custom validator class. # <code>BraceBalance</code> is another bundled validator. <code>VALIDATORS</code> uses an array format. Lets look at the various parameters being used here in each array item, === Parameters === {| class="wikitable" ! Property ! Type ! Description |- |id | string | Incase a bundled / pre-provided validator is being used, the ID of the validator. ''Required if <code>class</code> is not specified.'' |- |class | string | If a custom validator is being used, then use this option instead of <code>id</code>. Specifies the name of the validator class. See '''example #3''' in the above config. The <code>AUTOLOAD</code> option can be used to load the class. ''Required if <code>id</code> is not specified.'' |- |enforce | boolean | Whether the validator should be enforced. If set to true, and a translation fails validation, an error will be displayed which must be fixed in order to save the translation. |- |insertable | boolean | Whether the validator should also be an insertable. |- |keymatch | array | With this option it is possible to limit certain validations to certain messages. Keymatch is an array with each option being either a '''string''' or a '''prototype.''' If it is a string, a direct comparison with the message key is done. See '''example #1''' in the above config. |- |keymatch[i].type | string | Type is either ''regex'' or ''wildcard''. This is the approach that will be used to check if the message key matches a given pattern. |- |keymatch[i].pattern | string | Pattern is a string that will be used for matching. |- |params | string / associative array | If <code>params</code> is specified '''as a string''', it is used as the regex. See '''example #1''' In this case if insertable is true, # <code>display</code> is the first value from the regex match. # <code>pre</code> is also the first value from the regex match. # <code>post</code> is left empty. If <code>params</code> is specified '''as an associative array (see example #2)''', see below for further details. |- |params.regex | string | The regex to be used for validator. Must use named captures. When specifying named captures, do not use the <code>$</code> symbol in the name. In '''example #2''', two named captures are used - <code>pre</code> and <code>post</code>. |- |params.display | string | Mandatory value. The display value for the insertable. Named captures prefixed with $ are used here. See '''example #2'''. |- |params.pre | string | The pre value for the insertable. Value inserted before the cursor position. Named captures prefixed with $ are used here. If not specified, is set to the display value. See '''example #2'''. |- |params.post | string | The post value for the insertable. Value inserted after the cursor position. Named captures prefixed with $ are used here. See '''example #2'''. If not specified, defaults to an empty string. |} === Pre-provided / Bundled validators === Following is a list of bundled validators, ==== BraceBalance ==== ID: <code>BraceBalance</code> Ensures that the number of open braces / brackets, matches the number of closed braces / brackets in the translation. For example, the following translations would pass, * <code><nowiki>{{ }}</nowiki></code> * <code>[ ]</code> whereas, the following would fail, * <code>[ ]]</code> * <code><nowiki>{{ }</nowiki></code> This validator cannot be marked as insertable. ==== EscapeCharacter ==== ID: <code>EscapeCharacter</code> The validator ensures that only the specified escape character are present in a translation. The allowed escape characters can be specified when adding the validator, and can only include, * <code>\t</code> * <code>\n</code> * <code>\'</code> * <code>\"</code> * <code>\f</code> * <code>\r</code> * <code>\a</code> * <code>\b</code> * <code>\\</code> This validator is not insertable. ==== GettextNewline ==== ID: <code>GettextNewline</code> This works specifically for GetText based message groups. Ensures that the translation has the same number of newlines as the source message at the beginning and end of the string. ==== GettextPlural ==== ID: <code>GettextPlural</code> This works specifically on GetText based message groups. Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL:GETTEXT|one|many}} bar</nowiki></code>, the translation must contain it as well. Based on the language this also checks if the translation has the correct number of plural forms. For example, English has two, but Hebrew has four. ==== InsertableRegex ==== ID: <code>InsertableRegex</code> A generic reusable validator that can be used to specify custom validations and insertables. For example, take the following configuration where the validator is marked as insertable and enforced, <syntaxhighlight lang="yaml"> - id: InsertableRegex enforce: true insertable: true params: "/\$[a-zA-Z0-9]+/" </syntaxhighlight> Given the following source message - ''Hello $name. My name is $myName.'' that is being translated, the translation must have the parameters - ''$name'' and ''$myName''. They will also be displayed as insertables to make it easier for translators to use them in the translation. An absence of these parameters will cause an error to be displayed to the translator. ==== InsertableRubyVariable ==== ID: <code>InsertableRubyVariable</code> This is a validator that matches ruby variables in the translations. Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>%{[a-zA-Z_]+}</code>. This validator is insertable. Example: <code>%{abc}</code> ==== IosVariable ==== ID: <code>IosVariable</code> An insertable variable validator for Ios. Regex is used [https://github.com/dcordero/Rubustrings/blob/61d477bffbb318ca3ffed9c2afc49ec301931d93/lib/rubustrings/action.rb#L91 from this Rubustrings source]. This validator is insertable. Example: <code>%@</code> ==== MatchSet ==== ID: <code>MatchSet</code> Ensures that the translation is present in the list of values. Also takes a parameter - <code>caseSensitive</code> that can be either true (''default'') or false. For example the following configuration, the validator will validate the message with key - <code>html.dir</code> and ensure that the values for it can either be ''ltr'' or ''rtl''. Note that LTR or RTL will not be valid values, since <code>caseSensitive</code> is true by default. <syntaxhighlight lang="yaml" line="1" start="1"> - id: MatchSet enforce: true keymatch: - html.dir params: values: - ltr - rtl </syntaxhighlight> ==== MediaWikiLink ==== ID: <code>MediaWikiLink</code> Checks if the translation uses links that are discouraged. Valid links are those that link to Special: pages, <code><nowiki>{{ns:special}}:</nowiki></code> or project pages trough MediaWiki messages like <code><nowiki>{{MediaWiki:helppage-url}}:</nowiki></code>. Also links in the definition are allowed. ==== MediaWikiPageName ==== ID: <code>MediaWikiPageName</code> Ensures that if the source / definition contains a namespace such as <code><nowiki>{{ns:project}}:hello</nowiki></code> the translations made do not try to translate the namespaces itself. ==== MediaWikiParameter ==== ID: <code>MediaWikiParameter</code> This is a validator that matches wiki parameters in the translations. Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>/\$[1-9]/</code>. This validator is insertable. Example: <code>$1</code>, <code>$2</code>. ==== MediaWikiPlural ==== ID: <code>MediaWikiPlural</code> Ensures that if the source / definition contains a <code><nowiki>{{PLURAL:$1|message|messages}}</nowiki></code>, the translation should also have it. It can also be used as an insertable. Based on the language this also checks if the translation has the correct number of plural forms. For example, English has two, but Hebrew has three. ==== MediaWikiTimeList ==== ID: <code>MediaWikiTimeList</code> Provides validations for expiry options and IP block options specified in the MediaWiki core. These are usually in the format, <syntaxhighlight lang="text"> indefinite:indefinite,3 hours:3 hours,12 hours:12 hours,24 hours:24 hours,31 hours:31 hours,36 hours:36 hours,48 hours:48 hours,60 hours:60 hours,72 hours:72 hours,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,2 years:2 years,3 years:3 years,infinite:indefinite </syntaxhighlight> The validations ensure that the translations have the exact same number of key-value pairs. These validations are run only on messages with keys, # protect-expiry-options # ipboptions ==== Newline ==== ID: <code>Newline</code> Ensures that the translation has the same number of newlines as the source / definition message at the ''beginning of the string''. This validator is not insertable. ==== NotEmpty ==== ID: <code>NotEmpty</code> Ensures that the translation has some content, and that content is not just whitespace. This validator is not insertable. ==== NumericalParameter ==== ID: <code>NumericalParameter</code> This validator matches numerical parameters by using the following regex: <code>/\$\d+/</code>. This validator is insertable. Example: <code>$33</code>, <code>$1</code> etc. ==== Printf ==== ID: <code>Printf</code> This validator checks for missing and unknown printf formatting characters in translations. This validator is insertable. Example: <code>%2$f</code>, <code>%d</code> etc. ==== PythonInterpolation ==== ID: <code>PythonInterpolation</code> This validator matches python string interpolation variables by using the following regex: <code>/\%(?:\([a-zA-Z0-9]*?\))?[diouxXeEfFgGcrs]/U</code>. This validator is insertable. Example: <code>%s</code>, <code>%(name)s</code> ==== Replacement ==== ID: <code>Replacement</code> Checks if a translation is using the <code>search</code> string, and instead suggests the translator to use the string mentioned under <code>replacement</code>. This validator is not insertable. <syntaxhighlight lang="yaml" line="1"> - id: Replacement enforce: true params: search: '{{PLURAL:' replace: '{PLURAL:' </syntaxhighlight> ==== SmartFormatPlural ==== ID: <code>SmartFormatPlural</code> This works specifically on [https://github.com/axuno/SmartFormat SmartFormat] based message groups. Ensures that if the source / definition contains a plural in the format - <code>{1:test|tests}{0:message|messages}</code>, the translation must contain it as well. Based on the language this also checks if the translation has the correct number of plural forms. For example, English has two, but Hebrew has four. ==== UnicodePlural ==== ID: <code>UnicodePlural</code> Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL|one=one|many}} bar</nowiki></code>, the translation must contain it as well. Based on the language this also checks if the translation has the correct number of plural forms. For example, English has two, but Hebrew has three. == User interface == The user interface has been updated to differentiate between errors and warnings. [[File:Translate-validation-err-warning.png|thumb|345x345px|alt=|A warning and error shown on top of a translation]] During translation, if an error is noticed with the translation, the '''Save translation''' button is disabled unless the user who is translating has <code>translate-manage</code> permission. Additionally validation is also done on the server when the user is saving the translation. This will still allow users who have the <code>translate-manage</code> permission to save the translation even if it has errors. == Custom validators == Certain complicated validations might still require a custom validator to be written. Custom validators must implement the <code>MediaWiki\Extensions\Translate\Validation\MessageValidator</code> interface [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/MessageValidator.php]. Below is an example of a custom validator, <syntaxhighlight lang="php" line="1" start="1"> <?php // Filename: Validator.php use MediaWiki\Extensions\Translate\Validation\MessageValidator; use MediaWiki\Extensions\Translate\Validation\ValidationIssue; use MediaWiki\Extensions\Translate\Validation\ValidationIssues; /** * My Custom Validator */ class MyCustomValidator implements MessageValidator { public function getIssues( TMessage $message, string $targetLanguage ): ValidationIssues { $issues = new ValidationIssues(); // Validation code goes here. Push ValidationIssue into the ValidationIssues. E.g.: $issue = new ValidationIssue( 'value-not-present', // type 'invalid', // sub-type 'translate-checks-value-not-present', // message key [ // message params [ 'PLAIN-PARAMS', $this->possibleValues ], [ 'COUNT', count( $this->possibleValues ) ] ] ); $issues->add( $issue ); return $issues; } } </syntaxhighlight> Also see the following classes, # <code>ValidationIssues</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssues.php # <code>ValidationIssue</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssue.php The add the custom validator in the configuration file, <syntaxhighlight lang="yaml"> VALIDATORS: - class: MyCustomValidator enforce: true AUTOLOAD: MyCustomValidator: Validator.php </syntaxhighlight> ejhva80bzv3edea9svg1do4ku8w45va Help:Extension:Translate/Validators/ja 12 1483608 8364867 6818020 2026-05-04T04:00:29Z Shirayuki 472859 Created page with "Keymatch は配列で、各オプションは'''文字列'''または'''プロトタイプ'''のいずれかです。文字列の場合、メッセージ キーとの直接比較が行われます。" 8364867 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳対象の文字列は、翻訳結果でもそのまま保持されるべきマークアップを含むことがよくあります。 マークアップは特殊な文字を多く含むため、タイプするのが低速・困難になる場合があります。 Translate 拡張機能は、翻訳者がボタンをクリックすると、現在のカーソル位置にマークアップの一部が挿入されるようにすることができます。 さらに、翻訳に特定のマークアップが欠けている場合、Translate 拡張機能は翻訳者に警告するか、または翻訳を拒否できます。これは、エンド ユーザーにメッセージを正しく表示するためには、通常、このようなマークアップが必須だからです。 例えば、<blockquote>''Adapted by %{name} from a work by %{original}''</blockquote> という文字列の中には、<code>%{name}</code> と <code>%{original}</code> という 2 つの挿入可能な文字列が存在します。 翻訳者がこれらを追加して翻訳しないと、ソフトウェアを使用するエンド ユーザーには適切なメッセージが表示されません。 翻訳の検証を支援する目的で、<code>MessageValidator</code> フレームワークが追加されました。 翻訳されたメッセージに対してバリデーターが実行され、設定に基づいて警告またはエラー メッセージが翻訳者に表示されます。 警告がある翻訳は保存できますが、エラーがある翻訳は保存できません。 <code>translate-manage</code> の権限がある利用者のみが、エラーのある翻訳を保存できます。 バリデーターを設定する際、必須となるマークアップを識別するための正規表現を定義します。 バリデーターは挿入可能としてマークすることもでき、その場合はそのマークアップを翻訳に追加するためのボタンが翻訳者に表示されます。 カスタム バリデーターを追加でき、これはより専門的な検証をするために必要となります。 <span id="Configuration"></span> == 設定 == 以下はバリデーターの設定の要約です。 <syntaxhighlight lang="yaml" line="1" start="1"> VALIDATORS: # 例 1 - id: InsertableRegex enforce: true insertable: true params: /\$[a-z0-9]+/ keymatch: - 'untranslated' # 翻訳されていないキーに直接マッチする - type: 'wildcard' pattern: '*translated*' # 翻訳されたものが含まれるキーにマッチする # 例 2 - id: InsertableRegex insertable: true params: regex: /(?<pre>\[)[^]]+(?<post>\]\([^)]+\))/ display: $pre $post pre: $pre post: $post # 例 3 - class: MathJaxMessageValidator enforce: true # 例 4 - id: BraceBalance </syntaxhighlight> 上記の例では: # <code>InsertableRegex</code> は、カスタム正規表現を受け取って検証を実行できる同梱されているバリデーターです。 # <code>MathJaxMessageValidator</code> はカスタム バリデーター クラスです。 # <code>BraceBalance</code> は別の同梱されているバリデーターです。 <code>VALIDATORS</code> は配列の書式を使用します。 ここで、各配列の項目で使用されているさまざまなパラメーターを見てみましょう。 <span id="Parameters"></span> === パラメーター === {| class="wikitable" ! プロパティ ! 型 ! 説明 |- |id | 文字列 | 同梱/提供済みのバリデーターを使用する場合は、バリデーターの ID を指定します。 '''<code>class</code> が指定されていない場合は必須です。''' |- |class | 文字列 | カスタム バリデーターを使用する場合は、<code>id</code> の代わりにこのオプションを使用します。 バリデーター クラスの名前を指定します。 上記の設定の'''例 3''' を参照。 <code>AUTOLOAD</code> オプションを使用すると、クラスを読み込めます。 '''<code>id</code> が指定されていない場合は必須です。''' |- |enforce | 真偽値 | バリデータを強制するかどうか。 true に設定すると翻訳は検証されずエラーを表示しますので、修正しないと訳文を保存できません。 |- |insertable | 真偽値 | バリデータも挿入可能にするかどうか |- |keymatch | 配列 | このオプションは特定のメッセージに対する特定のバリデータ処理(認証)に制限をかけます。 Keymatch は配列で、各オプションは'''文字列'''または'''プロトタイプ'''のいずれかです。文字列の場合、メッセージ キーとの直接比較が行われます。 上記の設定の'''例 1''' を参照。 |- |keymatch[i].type | 文字列 | タイプは ''regex'' か ''wildcard'' の片方。 この方法はメッセージ キーが特定のパターンと一致するかどうか調べるために使います。 |- |keymatch[i].pattern | 文字列 | パターンとはマッチングに用いる文字列のこと。 |- |params | 文字列 / 連想配列 | <span lang="en" dir="ltr" class="mw-content-ltr">If params is specified '''as a string''', it is used as the regex.</span> '''例 1''' を参照 <div lang="en" dir="ltr" class="mw-content-ltr"> In this case if insertable is true, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>display</code> is the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>pre</code> is also the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>post</code> is left empty.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If params is specified '''as an associative array (see example #2)''', see below for further details. </div> |- |params.regex | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The regex to be used for validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Must use named captures.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When specifying named captures, do not use the <code>$</code> symbol in the name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In '''example #2''', two named captures are used - <code>pre</code> and <code>post</code>.</span> |- |params.display | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">Mandatory value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The display value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> '''例 2''' を参照。 |- |params.pre | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The pre value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted before the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, is set to the display value.</span> '''例 2''' を参照。 |- |params.post | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The post value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted after the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> '''例 2''' を参照。 <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, defaults to an empty string.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Pre-provided / Bundled validators === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a list of bundled validators, </div> ==== BraceBalance ==== ID: <code>BraceBalance</code> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the number of open braces / brackets, matches the number of closed braces / brackets in the translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, the following translations would pass, </div> * <code><nowiki>{{ }}</nowiki></code> * <code>[ ]</code> <span lang="en" dir="ltr" class="mw-content-ltr">whereas, the following would fail,</span> * <code>[ ]]</code> * <code><nowiki>{{ }</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator cannot be marked as insertable.</span> ==== EscapeCharacter ==== ID: <code>EscapeCharacter</code> <div lang="en" dir="ltr" class="mw-content-ltr"> The validator ensures that only the specified escape character are present in a translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The allowed escape characters can be specified when adding the validator, and can only include, </div> * <code>\t</code> * <code>\n</code> * <code>\'</code> * <code>\"</code> * <code>\f</code> * <code>\r</code> * <code>\a</code> * <code>\b</code> * <code>\\</code> このバリデーターは挿入可能ではありません。 ==== GettextNewline ==== ID: <code>GettextNewline</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically for GetText based message groups. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the translation has the same number of newlines as the source message at the beginning and end of the string. </div> ==== GettextPlural ==== ID: <code>GettextPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on GetText based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL:GETTEXT|one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== InsertableRegex ==== ID: <code>InsertableRegex</code> <div lang="en" dir="ltr" class="mw-content-ltr"> A generic reusable validator that can be used to specify custom validations and insertables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, take the following configuration where the validator is marked as insertable and enforced, </div> <syntaxhighlight lang="yaml"> - id: InsertableRegex enforce: true insertable: true params: "/\$[a-zA-Z0-9]+/" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Given the following source message - ''Hello $name. My name is $myName.'' that is being translated, the translation must have the parameters - ''$name'' and ''$myName''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will also be displayed as insertables to make it easier for translators to use them in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An absence of these parameters will cause an error to be displayed to the translator.</span> ==== InsertableRubyVariable ==== ID: <code>InsertableRubyVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches ruby variables in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>%{[a-zA-Z_]+}</code>.</span> このバリデーターは挿入可能です。 例: <code>%{abc}</code> ==== IosVariable ==== ID: <code>IosVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">An insertable variable validator for Ios.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Regex is used [https://github.com/dcordero/Rubustrings/blob/61d477bffbb318ca3ffed9c2afc49ec301931d93/lib/rubustrings/action.rb#L91 from this Rubustrings source].</span> このバリデーターは挿入可能です。 例: <code>%@</code> ==== MatchSet ==== ID: <code>MatchSet</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation is present in the list of values.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also takes a parameter - <code>caseSensitive</code> that can be either true (''default'') or false.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the following configuration, the validator will validate the message with key - <code>html.dir</code> and ensure that the values for it can either be ''ltr'' or ''rtl''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that LTR or RTL will not be valid values, since <code>caseSensitive</code> is true by default.</span> <syntaxhighlight lang="yaml" line="1" start="1"> - id: MatchSet enforce: true keymatch: - html.dir params: values: - ltr - rtl </syntaxhighlight> ==== MediaWikiLink ==== ID: <code>MediaWikiLink</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if the translation uses links that are discouraged.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Valid links are those that link to Special: pages, <code><nowiki>{{ns:special}}:</nowiki></code> or project pages trough MediaWiki messages like <code><nowiki>{{MediaWiki:helppage-url}}:</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also links in the definition are allowed.</span> ==== MediaWikiPageName ==== ID: <code>MediaWikiPageName</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a namespace such as <code><nowiki>{{ns:project}}:hello</nowiki></code> the translations made do not try to translate the namespaces itself.</span> ==== MediaWikiParameter ==== ID: <code>MediaWikiParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches wiki parameters in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>/\$[1-9]/</code>.</span> このバリデーターは挿入可能です。 例: <code>$1</code>, <code>$2</code>. ==== MediaWikiPlural ==== ID: <code>MediaWikiPlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a <code><nowiki>{{PLURAL:$1|message|messages}}</nowiki></code>, the translation should also have it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It can also be used as an insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 3 個あります。 ==== MediaWikiTimeList ==== ID: <code>MediaWikiTimeList</code> <span lang="en" dir="ltr" class="mw-content-ltr">Provides validations for expiry options and IP block options specified in the MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These are usually in the format,</span> <syntaxhighlight lang="text"> indefinite:indefinite,3 hours:3 hours,12 hours:12 hours,24 hours:24 hours,31 hours:31 hours,36 hours:36 hours,48 hours:48 hours,60 hours:60 hours,72 hours:72 hours,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,2 years:2 years,3 years:3 years,infinite:indefinite </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The validations ensure that the translations have the exact same number of key-value pairs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These validations are run only on messages with keys,</span> # protect-expiry-options # ipboptions ==== Newline ==== ID: <code>Newline</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has the same number of newlines as the source / definition message at the ''beginning of the string''.</span> このバリデーターは挿入可能ではありません。 ==== NotEmpty ==== ID: <code>NotEmpty</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has some content, and that content is not just whitespace.</span> このバリデーターは挿入可能ではありません。 ==== NumericalParameter ==== ID: <code>NumericalParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches numerical parameters by using the following regex: <code>/\$\d+/</code>.</span> このバリデーターは挿入可能です。 例: <code>$33</code>, <code>$1</code> etc. ==== Printf ==== ID: <code>Printf</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator checks for missing and unknown printf formatting characters in translations.</span> このバリデーターは挿入可能です。 例: <code>%2$f</code>, <code>%d</code> etc. ==== PythonInterpolation ==== ID: <code>PythonInterpolation</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches python string interpolation variables by using the following regex: <code>/\%(?:\([a-zA-Z0-9]*?\))?[diouxXeEfFgGcrs]/U</code>.</span> このバリデーターは挿入可能です。 例: <code>%s</code>, <code>%(name)s</code> ==== Replacement ==== ID: <code>Replacement</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if a translation is using the <code>search</code> string, and instead suggests the translator to use the string mentioned under <code>replacement</code>.</span> このバリデーターは挿入可能ではありません。 <syntaxhighlight lang="yaml" line="1"> - id: Replacement enforce: true params: search: '{{PLURAL:' replace: '{PLURAL:' </syntaxhighlight> ==== SmartFormatPlural ==== ID: <code>SmartFormatPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on [https://github.com/axuno/SmartFormat SmartFormat] based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code>{1:test|tests}{0:message|messages}</code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 4 個あります。 ==== UnicodePlural ==== ID: <code>UnicodePlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL|one=one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 3 個あります。 <div lang="en" dir="ltr" class="mw-content-ltr"> == User interface == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The user interface has been updated to differentiate between errors and warnings.</span> [[File:Translate-validation-err-warning.png|thumb|345x345px|alt=|<span lang="en" dir="ltr" class="mw-content-ltr">A warning and error shown on top of a translation</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> During translation, if an error is noticed with the translation, the '''Save translation''' button is disabled unless the user who is translating has <code>translate-manage</code> permission. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally validation is also done on the server when the user is saving the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will still allow users who have the <code>translate-manage</code> permission to save the translation even if it has errors.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Custom validators == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Certain complicated validations might still require a custom validator to be written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Custom validators must implement the <code>MediaWiki\Extensions\Translate\Validation\MessageValidator</code> interface [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/MessageValidator.php].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Below is an example of a custom validator, </div> <syntaxhighlight lang="php" line="1" start="1"> <?php // Filename: Validator.php use MediaWiki\Extensions\Translate\Validation\MessageValidator; use MediaWiki\Extensions\Translate\Validation\ValidationIssue; use MediaWiki\Extensions\Translate\Validation\ValidationIssues; /** * My Custom Validator */ class MyCustomValidator implements MessageValidator { public function getIssues( TMessage $message, string $targetLanguage ): ValidationIssues { $issues = new ValidationIssues(); // Validation code goes here. ValidationIssueをValidationIssuesにプッシュ。 例: $issue = new ValidationIssue( 'value-not-present', // タイプ 'invalid', // サブタイプ 'translate-checks-value-not-present', // メッセージ キー [ // メッセージ パラメータ [ 'PLAIN-PARAMS', $this->possibleValues ], [ 'COUNT', count( $this->possibleValues ) ] ] ); $issues->add( $issue ); return $issues; } } </syntaxhighlight> また以下のクラスを参照し、 # <code>ValidationIssues</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssues.php # <code>ValidationIssue</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssue.php カスタム バリデータを設定ファイルに追加するには、 <syntaxhighlight lang="yaml"> VALIDATORS: - class: MyCustomValidator enforce: true AUTOLOAD: MyCustomValidator: Validator.php </syntaxhighlight> rnls8rwq7kncm9zm9d80mhz3qgbf8fr 8364869 8364867 2026-05-04T04:01:08Z Shirayuki 472859 Created page with "パラメーターが'''文字列として'''指定されている場合、それは正規表現として使用されます。" 8364869 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳対象の文字列は、翻訳結果でもそのまま保持されるべきマークアップを含むことがよくあります。 マークアップは特殊な文字を多く含むため、タイプするのが低速・困難になる場合があります。 Translate 拡張機能は、翻訳者がボタンをクリックすると、現在のカーソル位置にマークアップの一部が挿入されるようにすることができます。 さらに、翻訳に特定のマークアップが欠けている場合、Translate 拡張機能は翻訳者に警告するか、または翻訳を拒否できます。これは、エンド ユーザーにメッセージを正しく表示するためには、通常、このようなマークアップが必須だからです。 例えば、<blockquote>''Adapted by %{name} from a work by %{original}''</blockquote> という文字列の中には、<code>%{name}</code> と <code>%{original}</code> という 2 つの挿入可能な文字列が存在します。 翻訳者がこれらを追加して翻訳しないと、ソフトウェアを使用するエンド ユーザーには適切なメッセージが表示されません。 翻訳の検証を支援する目的で、<code>MessageValidator</code> フレームワークが追加されました。 翻訳されたメッセージに対してバリデーターが実行され、設定に基づいて警告またはエラー メッセージが翻訳者に表示されます。 警告がある翻訳は保存できますが、エラーがある翻訳は保存できません。 <code>translate-manage</code> の権限がある利用者のみが、エラーのある翻訳を保存できます。 バリデーターを設定する際、必須となるマークアップを識別するための正規表現を定義します。 バリデーターは挿入可能としてマークすることもでき、その場合はそのマークアップを翻訳に追加するためのボタンが翻訳者に表示されます。 カスタム バリデーターを追加でき、これはより専門的な検証をするために必要となります。 <span id="Configuration"></span> == 設定 == 以下はバリデーターの設定の要約です。 <syntaxhighlight lang="yaml" line="1" start="1"> VALIDATORS: # 例 1 - id: InsertableRegex enforce: true insertable: true params: /\$[a-z0-9]+/ keymatch: - 'untranslated' # 翻訳されていないキーに直接マッチする - type: 'wildcard' pattern: '*translated*' # 翻訳されたものが含まれるキーにマッチする # 例 2 - id: InsertableRegex insertable: true params: regex: /(?<pre>\[)[^]]+(?<post>\]\([^)]+\))/ display: $pre $post pre: $pre post: $post # 例 3 - class: MathJaxMessageValidator enforce: true # 例 4 - id: BraceBalance </syntaxhighlight> 上記の例では: # <code>InsertableRegex</code> は、カスタム正規表現を受け取って検証を実行できる同梱されているバリデーターです。 # <code>MathJaxMessageValidator</code> はカスタム バリデーター クラスです。 # <code>BraceBalance</code> は別の同梱されているバリデーターです。 <code>VALIDATORS</code> は配列の書式を使用します。 ここで、各配列の項目で使用されているさまざまなパラメーターを見てみましょう。 <span id="Parameters"></span> === パラメーター === {| class="wikitable" ! プロパティ ! 型 ! 説明 |- |id | 文字列 | 同梱/提供済みのバリデーターを使用する場合は、バリデーターの ID を指定します。 '''<code>class</code> が指定されていない場合は必須です。''' |- |class | 文字列 | カスタム バリデーターを使用する場合は、<code>id</code> の代わりにこのオプションを使用します。 バリデーター クラスの名前を指定します。 上記の設定の'''例 3''' を参照。 <code>AUTOLOAD</code> オプションを使用すると、クラスを読み込めます。 '''<code>id</code> が指定されていない場合は必須です。''' |- |enforce | 真偽値 | バリデータを強制するかどうか。 true に設定すると翻訳は検証されずエラーを表示しますので、修正しないと訳文を保存できません。 |- |insertable | 真偽値 | バリデータも挿入可能にするかどうか |- |keymatch | 配列 | このオプションは特定のメッセージに対する特定のバリデータ処理(認証)に制限をかけます。 Keymatch は配列で、各オプションは'''文字列'''または'''プロトタイプ'''のいずれかです。文字列の場合、メッセージ キーとの直接比較が行われます。 上記の設定の'''例 1''' を参照。 |- |keymatch[i].type | 文字列 | タイプは ''regex'' か ''wildcard'' の片方。 この方法はメッセージ キーが特定のパターンと一致するかどうか調べるために使います。 |- |keymatch[i].pattern | 文字列 | パターンとはマッチングに用いる文字列のこと。 |- |params | 文字列 / 連想配列 | パラメーターが'''文字列として'''指定されている場合、それは正規表現として使用されます。 '''例 1''' を参照 <div lang="en" dir="ltr" class="mw-content-ltr"> In this case if insertable is true, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>display</code> is the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>pre</code> is also the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>post</code> is left empty.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If params is specified '''as an associative array (see example #2)''', see below for further details. </div> |- |params.regex | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The regex to be used for validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Must use named captures.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When specifying named captures, do not use the <code>$</code> symbol in the name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In '''example #2''', two named captures are used - <code>pre</code> and <code>post</code>.</span> |- |params.display | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">Mandatory value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The display value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> '''例 2''' を参照。 |- |params.pre | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The pre value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted before the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, is set to the display value.</span> '''例 2''' を参照。 |- |params.post | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The post value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted after the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> '''例 2''' を参照。 <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, defaults to an empty string.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Pre-provided / Bundled validators === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a list of bundled validators, </div> ==== BraceBalance ==== ID: <code>BraceBalance</code> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the number of open braces / brackets, matches the number of closed braces / brackets in the translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, the following translations would pass, </div> * <code><nowiki>{{ }}</nowiki></code> * <code>[ ]</code> <span lang="en" dir="ltr" class="mw-content-ltr">whereas, the following would fail,</span> * <code>[ ]]</code> * <code><nowiki>{{ }</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator cannot be marked as insertable.</span> ==== EscapeCharacter ==== ID: <code>EscapeCharacter</code> <div lang="en" dir="ltr" class="mw-content-ltr"> The validator ensures that only the specified escape character are present in a translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The allowed escape characters can be specified when adding the validator, and can only include, </div> * <code>\t</code> * <code>\n</code> * <code>\'</code> * <code>\"</code> * <code>\f</code> * <code>\r</code> * <code>\a</code> * <code>\b</code> * <code>\\</code> このバリデーターは挿入可能ではありません。 ==== GettextNewline ==== ID: <code>GettextNewline</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically for GetText based message groups. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the translation has the same number of newlines as the source message at the beginning and end of the string. </div> ==== GettextPlural ==== ID: <code>GettextPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on GetText based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL:GETTEXT|one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== InsertableRegex ==== ID: <code>InsertableRegex</code> <div lang="en" dir="ltr" class="mw-content-ltr"> A generic reusable validator that can be used to specify custom validations and insertables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, take the following configuration where the validator is marked as insertable and enforced, </div> <syntaxhighlight lang="yaml"> - id: InsertableRegex enforce: true insertable: true params: "/\$[a-zA-Z0-9]+/" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Given the following source message - ''Hello $name. My name is $myName.'' that is being translated, the translation must have the parameters - ''$name'' and ''$myName''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will also be displayed as insertables to make it easier for translators to use them in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An absence of these parameters will cause an error to be displayed to the translator.</span> ==== InsertableRubyVariable ==== ID: <code>InsertableRubyVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches ruby variables in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>%{[a-zA-Z_]+}</code>.</span> このバリデーターは挿入可能です。 例: <code>%{abc}</code> ==== IosVariable ==== ID: <code>IosVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">An insertable variable validator for Ios.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Regex is used [https://github.com/dcordero/Rubustrings/blob/61d477bffbb318ca3ffed9c2afc49ec301931d93/lib/rubustrings/action.rb#L91 from this Rubustrings source].</span> このバリデーターは挿入可能です。 例: <code>%@</code> ==== MatchSet ==== ID: <code>MatchSet</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation is present in the list of values.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also takes a parameter - <code>caseSensitive</code> that can be either true (''default'') or false.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the following configuration, the validator will validate the message with key - <code>html.dir</code> and ensure that the values for it can either be ''ltr'' or ''rtl''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that LTR or RTL will not be valid values, since <code>caseSensitive</code> is true by default.</span> <syntaxhighlight lang="yaml" line="1" start="1"> - id: MatchSet enforce: true keymatch: - html.dir params: values: - ltr - rtl </syntaxhighlight> ==== MediaWikiLink ==== ID: <code>MediaWikiLink</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if the translation uses links that are discouraged.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Valid links are those that link to Special: pages, <code><nowiki>{{ns:special}}:</nowiki></code> or project pages trough MediaWiki messages like <code><nowiki>{{MediaWiki:helppage-url}}:</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also links in the definition are allowed.</span> ==== MediaWikiPageName ==== ID: <code>MediaWikiPageName</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a namespace such as <code><nowiki>{{ns:project}}:hello</nowiki></code> the translations made do not try to translate the namespaces itself.</span> ==== MediaWikiParameter ==== ID: <code>MediaWikiParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches wiki parameters in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>/\$[1-9]/</code>.</span> このバリデーターは挿入可能です。 例: <code>$1</code>, <code>$2</code>. ==== MediaWikiPlural ==== ID: <code>MediaWikiPlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a <code><nowiki>{{PLURAL:$1|message|messages}}</nowiki></code>, the translation should also have it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It can also be used as an insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 3 個あります。 ==== MediaWikiTimeList ==== ID: <code>MediaWikiTimeList</code> <span lang="en" dir="ltr" class="mw-content-ltr">Provides validations for expiry options and IP block options specified in the MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These are usually in the format,</span> <syntaxhighlight lang="text"> indefinite:indefinite,3 hours:3 hours,12 hours:12 hours,24 hours:24 hours,31 hours:31 hours,36 hours:36 hours,48 hours:48 hours,60 hours:60 hours,72 hours:72 hours,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,2 years:2 years,3 years:3 years,infinite:indefinite </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The validations ensure that the translations have the exact same number of key-value pairs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These validations are run only on messages with keys,</span> # protect-expiry-options # ipboptions ==== Newline ==== ID: <code>Newline</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has the same number of newlines as the source / definition message at the ''beginning of the string''.</span> このバリデーターは挿入可能ではありません。 ==== NotEmpty ==== ID: <code>NotEmpty</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has some content, and that content is not just whitespace.</span> このバリデーターは挿入可能ではありません。 ==== NumericalParameter ==== ID: <code>NumericalParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches numerical parameters by using the following regex: <code>/\$\d+/</code>.</span> このバリデーターは挿入可能です。 例: <code>$33</code>, <code>$1</code> etc. ==== Printf ==== ID: <code>Printf</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator checks for missing and unknown printf formatting characters in translations.</span> このバリデーターは挿入可能です。 例: <code>%2$f</code>, <code>%d</code> etc. ==== PythonInterpolation ==== ID: <code>PythonInterpolation</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches python string interpolation variables by using the following regex: <code>/\%(?:\([a-zA-Z0-9]*?\))?[diouxXeEfFgGcrs]/U</code>.</span> このバリデーターは挿入可能です。 例: <code>%s</code>, <code>%(name)s</code> ==== Replacement ==== ID: <code>Replacement</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if a translation is using the <code>search</code> string, and instead suggests the translator to use the string mentioned under <code>replacement</code>.</span> このバリデーターは挿入可能ではありません。 <syntaxhighlight lang="yaml" line="1"> - id: Replacement enforce: true params: search: '{{PLURAL:' replace: '{PLURAL:' </syntaxhighlight> ==== SmartFormatPlural ==== ID: <code>SmartFormatPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on [https://github.com/axuno/SmartFormat SmartFormat] based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code>{1:test|tests}{0:message|messages}</code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 4 個あります。 ==== UnicodePlural ==== ID: <code>UnicodePlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL|one=one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 3 個あります。 <div lang="en" dir="ltr" class="mw-content-ltr"> == User interface == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The user interface has been updated to differentiate between errors and warnings.</span> [[File:Translate-validation-err-warning.png|thumb|345x345px|alt=|<span lang="en" dir="ltr" class="mw-content-ltr">A warning and error shown on top of a translation</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> During translation, if an error is noticed with the translation, the '''Save translation''' button is disabled unless the user who is translating has <code>translate-manage</code> permission. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally validation is also done on the server when the user is saving the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will still allow users who have the <code>translate-manage</code> permission to save the translation even if it has errors.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Custom validators == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Certain complicated validations might still require a custom validator to be written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Custom validators must implement the <code>MediaWiki\Extensions\Translate\Validation\MessageValidator</code> interface [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/MessageValidator.php].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Below is an example of a custom validator, </div> <syntaxhighlight lang="php" line="1" start="1"> <?php // Filename: Validator.php use MediaWiki\Extensions\Translate\Validation\MessageValidator; use MediaWiki\Extensions\Translate\Validation\ValidationIssue; use MediaWiki\Extensions\Translate\Validation\ValidationIssues; /** * My Custom Validator */ class MyCustomValidator implements MessageValidator { public function getIssues( TMessage $message, string $targetLanguage ): ValidationIssues { $issues = new ValidationIssues(); // Validation code goes here. ValidationIssueをValidationIssuesにプッシュ。 例: $issue = new ValidationIssue( 'value-not-present', // タイプ 'invalid', // サブタイプ 'translate-checks-value-not-present', // メッセージ キー [ // メッセージ パラメータ [ 'PLAIN-PARAMS', $this->possibleValues ], [ 'COUNT', count( $this->possibleValues ) ] ] ); $issues->add( $issue ); return $issues; } } </syntaxhighlight> また以下のクラスを参照し、 # <code>ValidationIssues</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssues.php # <code>ValidationIssue</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssue.php カスタム バリデータを設定ファイルに追加するには、 <syntaxhighlight lang="yaml"> VALIDATORS: - class: MyCustomValidator enforce: true AUTOLOAD: MyCustomValidator: Validator.php </syntaxhighlight> fjqaxemobsjuxy56g7nf8qkw9sf0jax 8364878 8364869 2026-05-04T04:02:51Z FuzzyBot 451990 Updating to match new version of source page 8364878 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳対象の文字列は、翻訳結果でもそのまま保持されるべきマークアップを含むことがよくあります。 マークアップは特殊な文字を多く含むため、タイプするのが低速・困難になる場合があります。 Translate 拡張機能は、翻訳者がボタンをクリックすると、現在のカーソル位置にマークアップの一部が挿入されるようにすることができます。 さらに、翻訳に特定のマークアップが欠けている場合、Translate 拡張機能は翻訳者に警告するか、または翻訳を拒否できます。これは、エンド ユーザーにメッセージを正しく表示するためには、通常、このようなマークアップが必須だからです。 例えば、<blockquote>''Adapted by %{name} from a work by %{original}''</blockquote> という文字列の中には、<code>%{name}</code> と <code>%{original}</code> という 2 つの挿入可能な文字列が存在します。 翻訳者がこれらを追加して翻訳しないと、ソフトウェアを使用するエンド ユーザーには適切なメッセージが表示されません。 翻訳の検証を支援する目的で、<code>MessageValidator</code> フレームワークが追加されました。 翻訳されたメッセージに対してバリデーターが実行され、設定に基づいて警告またはエラー メッセージが翻訳者に表示されます。 警告がある翻訳は保存できますが、エラーがある翻訳は保存できません。 <code>translate-manage</code> の権限がある利用者のみが、エラーのある翻訳を保存できます。 バリデーターを設定する際、必須となるマークアップを識別するための正規表現を定義します。 バリデーターは挿入可能としてマークすることもでき、その場合はそのマークアップを翻訳に追加するためのボタンが翻訳者に表示されます。 カスタム バリデーターを追加でき、これはより専門的な検証をするために必要となります。 <span id="Configuration"></span> == 設定 == 以下はバリデーターの設定の要約です。 <syntaxhighlight lang="yaml" line="1" start="1"> VALIDATORS: # 例 1 - id: InsertableRegex enforce: true insertable: true params: /\$[a-z0-9]+/ keymatch: - 'untranslated' # 翻訳されていないキーに直接マッチする - type: 'wildcard' pattern: '*translated*' # 翻訳されたものが含まれるキーにマッチする # 例 2 - id: InsertableRegex insertable: true params: regex: /(?<pre>\[)[^]]+(?<post>\]\([^)]+\))/ display: $pre $post pre: $pre post: $post # 例 3 - class: MathJaxMessageValidator enforce: true # 例 4 - id: BraceBalance </syntaxhighlight> 上記の例では: # <code>InsertableRegex</code> は、カスタム正規表現を受け取って検証を実行できる同梱されているバリデーターです。 # <code>MathJaxMessageValidator</code> はカスタム バリデーター クラスです。 # <code>BraceBalance</code> は別の同梱されているバリデーターです。 <code>VALIDATORS</code> は配列の書式を使用します。 ここで、各配列の項目で使用されているさまざまなパラメーターを見てみましょう。 <span id="Parameters"></span> === パラメーター === {| class="wikitable" ! プロパティ ! 型 ! 説明 |- |id | 文字列 | 同梱/提供済みのバリデーターを使用する場合は、バリデーターの ID を指定します。 '''<code>class</code> が指定されていない場合は必須です。''' |- |class | 文字列 | カスタム バリデーターを使用する場合は、<code>id</code> の代わりにこのオプションを使用します。 バリデーター クラスの名前を指定します。 上記の設定の'''例 3''' を参照。 <code>AUTOLOAD</code> オプションを使用すると、クラスを読み込めます。 '''<code>id</code> が指定されていない場合は必須です。''' |- |enforce | 真偽値 | バリデータを強制するかどうか。 true に設定すると翻訳は検証されずエラーを表示しますので、修正しないと訳文を保存できません。 |- |insertable | 真偽値 | バリデータも挿入可能にするかどうか |- |keymatch | 配列 | このオプションは特定のメッセージに対する特定のバリデータ処理(認証)に制限をかけます。 Keymatch は配列で、各オプションは'''文字列'''または'''プロトタイプ'''のいずれかです。文字列の場合、メッセージ キーとの直接比較が行われます。 上記の設定の'''例 1''' を参照。 |- |keymatch[i].type | 文字列 | タイプは ''regex'' か ''wildcard'' の片方。 この方法はメッセージ キーが特定のパターンと一致するかどうか調べるために使います。 |- |keymatch[i].pattern | 文字列 | パターンとはマッチングに用いる文字列のこと。 |- |params | 文字列 / 連想配列 | パラメーターが'''文字列として'''指定されている場合、それは正規表現として使用されます。 '''例 1''' を参照 <div lang="en" dir="ltr" class="mw-content-ltr"> In this case if insertable is true, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>display</code> is the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>pre</code> is also the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>post</code> is left empty.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If <code>params</code> is specified '''as an associative array (see example #2)''', see below for further details.</span> |- |params.regex | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The regex to be used for validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Must use named captures.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When specifying named captures, do not use the <code>$</code> symbol in the name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In '''example #2''', two named captures are used - <code>pre</code> and <code>post</code>.</span> |- |params.display | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">Mandatory value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The display value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> '''例 2''' を参照。 |- |params.pre | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The pre value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted before the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, is set to the display value.</span> '''例 2''' を参照。 |- |params.post | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The post value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted after the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> '''例 2''' を参照。 <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, defaults to an empty string.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Pre-provided / Bundled validators === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a list of bundled validators, </div> ==== BraceBalance ==== ID: <code>BraceBalance</code> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the number of open braces / brackets, matches the number of closed braces / brackets in the translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, the following translations would pass, </div> * <code><nowiki>{{ }}</nowiki></code> * <code>[ ]</code> <span lang="en" dir="ltr" class="mw-content-ltr">whereas, the following would fail,</span> * <code>[ ]]</code> * <code><nowiki>{{ }</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator cannot be marked as insertable.</span> ==== EscapeCharacter ==== ID: <code>EscapeCharacter</code> <div lang="en" dir="ltr" class="mw-content-ltr"> The validator ensures that only the specified escape character are present in a translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The allowed escape characters can be specified when adding the validator, and can only include, </div> * <code>\t</code> * <code>\n</code> * <code>\'</code> * <code>\"</code> * <code>\f</code> * <code>\r</code> * <code>\a</code> * <code>\b</code> * <code>\\</code> このバリデーターは挿入可能ではありません。 ==== GettextNewline ==== ID: <code>GettextNewline</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically for GetText based message groups. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the translation has the same number of newlines as the source message at the beginning and end of the string. </div> ==== GettextPlural ==== ID: <code>GettextPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on GetText based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL:GETTEXT|one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== InsertableRegex ==== ID: <code>InsertableRegex</code> <div lang="en" dir="ltr" class="mw-content-ltr"> A generic reusable validator that can be used to specify custom validations and insertables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, take the following configuration where the validator is marked as insertable and enforced, </div> <syntaxhighlight lang="yaml"> - id: InsertableRegex enforce: true insertable: true params: "/\$[a-zA-Z0-9]+/" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Given the following source message - ''Hello $name. My name is $myName.'' that is being translated, the translation must have the parameters - ''$name'' and ''$myName''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will also be displayed as insertables to make it easier for translators to use them in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An absence of these parameters will cause an error to be displayed to the translator.</span> ==== InsertableRubyVariable ==== ID: <code>InsertableRubyVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches ruby variables in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>%{[a-zA-Z_]+}</code>.</span> このバリデーターは挿入可能です。 例: <code>%{abc}</code> ==== IosVariable ==== ID: <code>IosVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">An insertable variable validator for Ios.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Regex is used [https://github.com/dcordero/Rubustrings/blob/61d477bffbb318ca3ffed9c2afc49ec301931d93/lib/rubustrings/action.rb#L91 from this Rubustrings source].</span> このバリデーターは挿入可能です。 例: <code>%@</code> ==== MatchSet ==== ID: <code>MatchSet</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation is present in the list of values.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also takes a parameter - <code>caseSensitive</code> that can be either true (''default'') or false.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the following configuration, the validator will validate the message with key - <code>html.dir</code> and ensure that the values for it can either be ''ltr'' or ''rtl''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that LTR or RTL will not be valid values, since <code>caseSensitive</code> is true by default.</span> <syntaxhighlight lang="yaml" line="1" start="1"> - id: MatchSet enforce: true keymatch: - html.dir params: values: - ltr - rtl </syntaxhighlight> ==== MediaWikiLink ==== ID: <code>MediaWikiLink</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if the translation uses links that are discouraged.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Valid links are those that link to Special: pages, <code><nowiki>{{ns:special}}:</nowiki></code> or project pages trough MediaWiki messages like <code><nowiki>{{MediaWiki:helppage-url}}:</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also links in the definition are allowed.</span> ==== MediaWikiPageName ==== ID: <code>MediaWikiPageName</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a namespace such as <code><nowiki>{{ns:project}}:hello</nowiki></code> the translations made do not try to translate the namespaces itself.</span> ==== MediaWikiParameter ==== ID: <code>MediaWikiParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches wiki parameters in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>/\$[1-9]/</code>.</span> このバリデーターは挿入可能です。 例: <code>$1</code>, <code>$2</code>. ==== MediaWikiPlural ==== ID: <code>MediaWikiPlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a <code><nowiki>{{PLURAL:$1|message|messages}}</nowiki></code>, the translation should also have it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It can also be used as an insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 3 個あります。 ==== MediaWikiTimeList ==== ID: <code>MediaWikiTimeList</code> <span lang="en" dir="ltr" class="mw-content-ltr">Provides validations for expiry options and IP block options specified in the MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These are usually in the format,</span> <syntaxhighlight lang="text"> indefinite:indefinite,3 hours:3 hours,12 hours:12 hours,24 hours:24 hours,31 hours:31 hours,36 hours:36 hours,48 hours:48 hours,60 hours:60 hours,72 hours:72 hours,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,2 years:2 years,3 years:3 years,infinite:indefinite </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The validations ensure that the translations have the exact same number of key-value pairs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These validations are run only on messages with keys,</span> # protect-expiry-options # ipboptions ==== Newline ==== ID: <code>Newline</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has the same number of newlines as the source / definition message at the ''beginning of the string''.</span> このバリデーターは挿入可能ではありません。 ==== NotEmpty ==== ID: <code>NotEmpty</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has some content, and that content is not just whitespace.</span> このバリデーターは挿入可能ではありません。 ==== NumericalParameter ==== ID: <code>NumericalParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches numerical parameters by using the following regex: <code>/\$\d+/</code>.</span> このバリデーターは挿入可能です。 例: <code>$33</code>, <code>$1</code> etc. ==== Printf ==== ID: <code>Printf</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator checks for missing and unknown printf formatting characters in translations.</span> このバリデーターは挿入可能です。 例: <code>%2$f</code>, <code>%d</code> etc. ==== PythonInterpolation ==== ID: <code>PythonInterpolation</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches python string interpolation variables by using the following regex: <code>/\%(?:\([a-zA-Z0-9]*?\))?[diouxXeEfFgGcrs]/U</code>.</span> このバリデーターは挿入可能です。 例: <code>%s</code>, <code>%(name)s</code> ==== Replacement ==== ID: <code>Replacement</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if a translation is using the <code>search</code> string, and instead suggests the translator to use the string mentioned under <code>replacement</code>.</span> このバリデーターは挿入可能ではありません。 <syntaxhighlight lang="yaml" line="1"> - id: Replacement enforce: true params: search: '{{PLURAL:' replace: '{PLURAL:' </syntaxhighlight> ==== SmartFormatPlural ==== ID: <code>SmartFormatPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on [https://github.com/axuno/SmartFormat SmartFormat] based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code>{1:test|tests}{0:message|messages}</code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 4 個あります。 ==== UnicodePlural ==== ID: <code>UnicodePlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL|one=one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 3 個あります。 <div lang="en" dir="ltr" class="mw-content-ltr"> == User interface == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The user interface has been updated to differentiate between errors and warnings.</span> [[File:Translate-validation-err-warning.png|thumb|345x345px|alt=|<span lang="en" dir="ltr" class="mw-content-ltr">A warning and error shown on top of a translation</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> During translation, if an error is noticed with the translation, the '''Save translation''' button is disabled unless the user who is translating has <code>translate-manage</code> permission. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally validation is also done on the server when the user is saving the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will still allow users who have the <code>translate-manage</code> permission to save the translation even if it has errors.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Custom validators == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Certain complicated validations might still require a custom validator to be written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Custom validators must implement the <code>MediaWiki\Extensions\Translate\Validation\MessageValidator</code> interface [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/MessageValidator.php].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Below is an example of a custom validator, </div> <syntaxhighlight lang="php" line="1" start="1"> <?php // Filename: Validator.php use MediaWiki\Extensions\Translate\Validation\MessageValidator; use MediaWiki\Extensions\Translate\Validation\ValidationIssue; use MediaWiki\Extensions\Translate\Validation\ValidationIssues; /** * My Custom Validator */ class MyCustomValidator implements MessageValidator { public function getIssues( TMessage $message, string $targetLanguage ): ValidationIssues { $issues = new ValidationIssues(); // Validation code goes here. ValidationIssueをValidationIssuesにプッシュ。 例: $issue = new ValidationIssue( 'value-not-present', // タイプ 'invalid', // サブタイプ 'translate-checks-value-not-present', // メッセージ キー [ // メッセージ パラメータ [ 'PLAIN-PARAMS', $this->possibleValues ], [ 'COUNT', count( $this->possibleValues ) ] ] ); $issues->add( $issue ); return $issues; } } </syntaxhighlight> また以下のクラスを参照し、 # <code>ValidationIssues</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssues.php # <code>ValidationIssue</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssue.php カスタム バリデータを設定ファイルに追加するには、 <syntaxhighlight lang="yaml"> VALIDATORS: - class: MyCustomValidator enforce: true AUTOLOAD: MyCustomValidator: Validator.php </syntaxhighlight> t5oxjfs15axevrno5x67rsmvi9i5694 8364883 8364878 2026-05-04T04:03:15Z Shirayuki 472859 8364883 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳対象の文字列は、翻訳結果でもそのまま保持されるべきマークアップを含むことがよくあります。 マークアップは特殊な文字を多く含むため、タイプするのが低速・困難になる場合があります。 Translate 拡張機能は、翻訳者がボタンをクリックすると、現在のカーソル位置にマークアップの一部が挿入されるようにすることができます。 さらに、翻訳に特定のマークアップが欠けている場合、Translate 拡張機能は翻訳者に警告するか、または翻訳を拒否できます。これは、エンド ユーザーにメッセージを正しく表示するためには、通常、このようなマークアップが必須だからです。 例えば、<blockquote>''Adapted by %{name} from a work by %{original}''</blockquote> という文字列の中には、<code>%{name}</code> と <code>%{original}</code> という 2 つの挿入可能な文字列が存在します。 翻訳者がこれらを追加して翻訳しないと、ソフトウェアを使用するエンド ユーザーには適切なメッセージが表示されません。 翻訳の検証を支援する目的で、<code>MessageValidator</code> フレームワークが追加されました。 翻訳されたメッセージに対してバリデーターが実行され、設定に基づいて警告またはエラー メッセージが翻訳者に表示されます。 警告がある翻訳は保存できますが、エラーがある翻訳は保存できません。 <code>translate-manage</code> の権限がある利用者のみが、エラーのある翻訳を保存できます。 バリデーターを設定する際、必須となるマークアップを識別するための正規表現を定義します。 バリデーターは挿入可能としてマークすることもでき、その場合はそのマークアップを翻訳に追加するためのボタンが翻訳者に表示されます。 カスタム バリデーターを追加でき、これはより専門的な検証をするために必要となります。 <span id="Configuration"></span> == 設定 == 以下はバリデーターの設定の要約です。 <syntaxhighlight lang="yaml" line="1" start="1"> VALIDATORS: # 例 1 - id: InsertableRegex enforce: true insertable: true params: /\$[a-z0-9]+/ keymatch: - 'untranslated' # 翻訳されていないキーに直接マッチする - type: 'wildcard' pattern: '*translated*' # 翻訳されたものが含まれるキーにマッチする # 例 2 - id: InsertableRegex insertable: true params: regex: /(?<pre>\[)[^]]+(?<post>\]\([^)]+\))/ display: $pre $post pre: $pre post: $post # 例 3 - class: MathJaxMessageValidator enforce: true # 例 4 - id: BraceBalance </syntaxhighlight> 上記の例では: # <code>InsertableRegex</code> は、カスタム正規表現を受け取って検証を実行できる同梱されているバリデーターです。 # <code>MathJaxMessageValidator</code> はカスタム バリデーター クラスです。 # <code>BraceBalance</code> は別の同梱されているバリデーターです。 <code>VALIDATORS</code> は配列の書式を使用します。 ここで、各配列の項目で使用されているさまざまなパラメーターを見てみましょう。 <span id="Parameters"></span> === パラメーター === {| class="wikitable" ! プロパティ ! 型 ! 説明 |- |id | 文字列 | 同梱/提供済みのバリデーターを使用する場合は、バリデーターの ID を指定します。 '''<code>class</code> が指定されていない場合は必須です。''' |- |class | 文字列 | カスタム バリデーターを使用する場合は、<code>id</code> の代わりにこのオプションを使用します。 バリデーター クラスの名前を指定します。 上記の設定の'''例 3''' を参照。 <code>AUTOLOAD</code> オプションを使用すると、クラスを読み込めます。 '''<code>id</code> が指定されていない場合は必須です。''' |- |enforce | 真偽値 | バリデータを強制するかどうか。 true に設定すると翻訳は検証されずエラーを表示しますので、修正しないと訳文を保存できません。 |- |insertable | 真偽値 | バリデータも挿入可能にするかどうか |- |keymatch | 配列 | このオプションは特定のメッセージに対する特定のバリデータ処理(認証)に制限をかけます。 Keymatch は配列で、各オプションは'''文字列'''または'''プロトタイプ'''のいずれかです。文字列の場合、メッセージ キーとの直接比較が行われます。 上記の設定の'''例 1''' を参照。 |- |keymatch[i].type | 文字列 | タイプは ''regex'' か ''wildcard'' の片方。 この方法はメッセージ キーが特定のパターンと一致するかどうか調べるために使います。 |- |keymatch[i].pattern | 文字列 | パターンとはマッチングに用いる文字列のこと。 |- |params | 文字列 / 連想配列 | パラメーターが'''文字列として'''指定されている場合、それは正規表現として使用されます。 '''例 1''' を参照 <div lang="en" dir="ltr" class="mw-content-ltr"> In this case if insertable is true, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>display</code> is the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>pre</code> is also the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>post</code> is left empty.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If <code>params</code> is specified '''as an associative array (see example #2)''', see below for further details.</span> |- |params.regex | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The regex to be used for validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Must use named captures.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When specifying named captures, do not use the <code>$</code> symbol in the name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In '''example #2''', two named captures are used - <code>pre</code> and <code>post</code>.</span> |- |params.display | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">Mandatory value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The display value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> '''例 2''' を参照。 |- |params.pre | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The pre value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted before the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, is set to the display value.</span> '''例 2''' を参照。 |- |params.post | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The post value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted after the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> '''例 2''' を参照。 <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, defaults to an empty string.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Pre-provided / Bundled validators === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a list of bundled validators, </div> ==== BraceBalance ==== ID: <code>BraceBalance</code> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the number of open braces / brackets, matches the number of closed braces / brackets in the translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, the following translations would pass, </div> * <code><nowiki>{{ }}</nowiki></code> * <code>[ ]</code> <span lang="en" dir="ltr" class="mw-content-ltr">whereas, the following would fail,</span> * <code>[ ]]</code> * <code><nowiki>{{ }</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator cannot be marked as insertable.</span> ==== EscapeCharacter ==== ID: <code>EscapeCharacter</code> <div lang="en" dir="ltr" class="mw-content-ltr"> The validator ensures that only the specified escape character are present in a translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The allowed escape characters can be specified when adding the validator, and can only include, </div> * <code>\t</code> * <code>\n</code> * <code>\'</code> * <code>\"</code> * <code>\f</code> * <code>\r</code> * <code>\a</code> * <code>\b</code> * <code>\\</code> このバリデーターは挿入可能ではありません。 ==== GettextNewline ==== ID: <code>GettextNewline</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically for GetText based message groups. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the translation has the same number of newlines as the source message at the beginning and end of the string. </div> ==== GettextPlural ==== ID: <code>GettextPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on GetText based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL:GETTEXT|one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== InsertableRegex ==== ID: <code>InsertableRegex</code> <div lang="en" dir="ltr" class="mw-content-ltr"> A generic reusable validator that can be used to specify custom validations and insertables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, take the following configuration where the validator is marked as insertable and enforced, </div> <syntaxhighlight lang="yaml"> - id: InsertableRegex enforce: true insertable: true params: "/\$[a-zA-Z0-9]+/" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Given the following source message - ''Hello $name. My name is $myName.'' that is being translated, the translation must have the parameters - ''$name'' and ''$myName''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will also be displayed as insertables to make it easier for translators to use them in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An absence of these parameters will cause an error to be displayed to the translator.</span> ==== InsertableRubyVariable ==== ID: <code>InsertableRubyVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches ruby variables in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>%{[a-zA-Z_]+}</code>.</span> このバリデーターは挿入可能です。 例: <code>%{abc}</code> ==== IosVariable ==== ID: <code>IosVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">An insertable variable validator for Ios.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Regex is used [https://github.com/dcordero/Rubustrings/blob/61d477bffbb318ca3ffed9c2afc49ec301931d93/lib/rubustrings/action.rb#L91 from this Rubustrings source].</span> このバリデーターは挿入可能です。 例: <code>%@</code> ==== MatchSet ==== ID: <code>MatchSet</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation is present in the list of values.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also takes a parameter - <code>caseSensitive</code> that can be either true (''default'') or false.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the following configuration, the validator will validate the message with key - <code>html.dir</code> and ensure that the values for it can either be ''ltr'' or ''rtl''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that LTR or RTL will not be valid values, since <code>caseSensitive</code> is true by default.</span> <syntaxhighlight lang="yaml" line="1" start="1"> - id: MatchSet enforce: true keymatch: - html.dir params: values: - ltr - rtl </syntaxhighlight> ==== MediaWikiLink ==== ID: <code>MediaWikiLink</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if the translation uses links that are discouraged.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Valid links are those that link to Special: pages, <code><nowiki>{{ns:special}}:</nowiki></code> or project pages trough MediaWiki messages like <code><nowiki>{{MediaWiki:helppage-url}}:</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also links in the definition are allowed.</span> ==== MediaWikiPageName ==== ID: <code>MediaWikiPageName</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a namespace such as <code><nowiki>{{ns:project}}:hello</nowiki></code> the translations made do not try to translate the namespaces itself.</span> ==== MediaWikiParameter ==== ID: <code>MediaWikiParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches wiki parameters in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>/\$[1-9]/</code>.</span> このバリデーターは挿入可能です。 例: <code>$1</code>, <code>$2</code>. ==== MediaWikiPlural ==== ID: <code>MediaWikiPlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a <code><nowiki>{{PLURAL:$1|message|messages}}</nowiki></code>, the translation should also have it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It can also be used as an insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 3 個あります。 ==== MediaWikiTimeList ==== ID: <code>MediaWikiTimeList</code> <span lang="en" dir="ltr" class="mw-content-ltr">Provides validations for expiry options and IP block options specified in the MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These are usually in the format,</span> <syntaxhighlight lang="text"> indefinite:indefinite,3 hours:3 hours,12 hours:12 hours,24 hours:24 hours,31 hours:31 hours,36 hours:36 hours,48 hours:48 hours,60 hours:60 hours,72 hours:72 hours,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,2 years:2 years,3 years:3 years,infinite:indefinite </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The validations ensure that the translations have the exact same number of key-value pairs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These validations are run only on messages with keys,</span> # protect-expiry-options # ipboptions ==== Newline ==== ID: <code>Newline</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has the same number of newlines as the source / definition message at the ''beginning of the string''.</span> このバリデーターは挿入可能ではありません。 ==== NotEmpty ==== ID: <code>NotEmpty</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has some content, and that content is not just whitespace.</span> このバリデーターは挿入可能ではありません。 ==== NumericalParameter ==== ID: <code>NumericalParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches numerical parameters by using the following regex: <code>/\$\d+/</code>.</span> このバリデーターは挿入可能です。 例: <code>$33</code>, <code>$1</code> etc. ==== Printf ==== ID: <code>Printf</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator checks for missing and unknown printf formatting characters in translations.</span> このバリデーターは挿入可能です。 例: <code>%2$f</code>, <code>%d</code> etc. ==== PythonInterpolation ==== ID: <code>PythonInterpolation</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches python string interpolation variables by using the following regex: <code>/\%(?:\([a-zA-Z0-9]*?\))?[diouxXeEfFgGcrs]/U</code>.</span> このバリデーターは挿入可能です。 例: <code>%s</code>, <code>%(name)s</code> ==== Replacement ==== ID: <code>Replacement</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if a translation is using the <code>search</code> string, and instead suggests the translator to use the string mentioned under <code>replacement</code>.</span> このバリデーターは挿入可能ではありません。 <syntaxhighlight lang="yaml" line="1"> - id: Replacement enforce: true params: search: '{{PLURAL:' replace: '{PLURAL:' </syntaxhighlight> ==== SmartFormatPlural ==== ID: <code>SmartFormatPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on [https://github.com/axuno/SmartFormat SmartFormat] based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code>{1:test|tests}{0:message|messages}</code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 4 個あります。 ==== UnicodePlural ==== ID: <code>UnicodePlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL|one=one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 3 個あります。 <div lang="en" dir="ltr" class="mw-content-ltr"> == User interface == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The user interface has been updated to differentiate between errors and warnings.</span> [[File:Translate-validation-err-warning.png|thumb|345x345px|alt=|<span lang="en" dir="ltr" class="mw-content-ltr">A warning and error shown on top of a translation</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> During translation, if an error is noticed with the translation, the '''Save translation''' button is disabled unless the user who is translating has <code>translate-manage</code> permission. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally validation is also done on the server when the user is saving the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will still allow users who have the <code>translate-manage</code> permission to save the translation even if it has errors.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Custom validators == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Certain complicated validations might still require a custom validator to be written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Custom validators must implement the <code>MediaWiki\Extensions\Translate\Validation\MessageValidator</code> interface [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/MessageValidator.php].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Below is an example of a custom validator, </div> <syntaxhighlight lang="php" line="1" start="1"> <?php // Filename: Validator.php use MediaWiki\Extensions\Translate\Validation\MessageValidator; use MediaWiki\Extensions\Translate\Validation\ValidationIssue; use MediaWiki\Extensions\Translate\Validation\ValidationIssues; /** * My Custom Validator */ class MyCustomValidator implements MessageValidator { public function getIssues( TMessage $message, string $targetLanguage ): ValidationIssues { $issues = new ValidationIssues(); // Validation code goes here. ValidationIssueをValidationIssuesにプッシュ。 例: $issue = new ValidationIssue( 'value-not-present', // タイプ 'invalid', // サブタイプ 'translate-checks-value-not-present', // メッセージ キー [ // メッセージ パラメーター [ 'PLAIN-PARAMS', $this->possibleValues ], [ 'COUNT', count( $this->possibleValues ) ] ] ); $issues->add( $issue ); return $issues; } } </syntaxhighlight> また以下のクラスを参照し、 # <code>ValidationIssues</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssues.php # <code>ValidationIssue</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssue.php カスタム バリデータを設定ファイルに追加するには、 <syntaxhighlight lang="yaml"> VALIDATORS: - class: MyCustomValidator enforce: true AUTOLOAD: MyCustomValidator: Validator.php </syntaxhighlight> c9k0igjdko0tk009ovd0tbldm5kfrik 8364885 8364883 2026-05-04T04:04:53Z Shirayuki 472859 update 8364885 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳対象の文字列は、翻訳結果でもそのまま保持されるべきマークアップを含むことがよくあります。 マークアップは特殊な文字を多く含むため、タイプするのが低速・困難になる場合があります。 Translate 拡張機能は、翻訳者がボタンをクリックすると、現在のカーソル位置にマークアップの一部が挿入されるようにすることができます。 さらに、翻訳に特定のマークアップが欠けている場合、Translate 拡張機能は翻訳者に警告するか、または翻訳を拒否できます。これは、エンド ユーザーにメッセージを正しく表示するためには、通常、このようなマークアップが必須だからです。 例えば、<blockquote>''Adapted by %{name} from a work by %{original}''</blockquote> という文字列の中には、<code>%{name}</code> と <code>%{original}</code> という 2 つの挿入可能な文字列が存在します。 翻訳者がこれらを追加して翻訳しないと、ソフトウェアを使用するエンド ユーザーには適切なメッセージが表示されません。 翻訳の検証を支援する目的で、<code>MessageValidator</code> フレームワークが追加されました。 翻訳されたメッセージに対してバリデーターが実行され、設定に基づいて警告またはエラー メッセージが翻訳者に表示されます。 警告がある翻訳は保存できますが、エラーがある翻訳は保存できません。 <code>translate-manage</code> の権限がある利用者のみが、エラーのある翻訳を保存できます。 バリデーターを設定する際、必須となるマークアップを識別するための正規表現を定義します。 バリデーターは挿入可能としてマークすることもでき、その場合はそのマークアップを翻訳に追加するためのボタンが翻訳者に表示されます。 カスタム バリデーターを追加でき、これはより専門的な検証をするために必要となります。 <span id="Configuration"></span> == 設定 == 以下はバリデーターの設定の要約です。 <syntaxhighlight lang="yaml" line="1" start="1"> VALIDATORS: # 例 1 - id: InsertableRegex enforce: true insertable: true params: /\$[a-z0-9]+/ keymatch: - 'untranslated' # 翻訳されていないキーに直接マッチする - type: 'wildcard' pattern: '*translated*' # 翻訳されたものが含まれるキーにマッチする # 例 2 - id: InsertableRegex insertable: true params: regex: /(?<pre>\[)[^]]+(?<post>\]\([^)]+\))/ display: $pre $post pre: $pre post: $post # 例 3 - class: MathJaxMessageValidator enforce: true # 例 4 - id: BraceBalance </syntaxhighlight> 上記の例では: # <code>InsertableRegex</code> は、カスタム正規表現を受け取って検証を実行できる同梱されているバリデーターです。 # <code>MathJaxMessageValidator</code> はカスタム バリデーター クラスです。 # <code>BraceBalance</code> は別の同梱されているバリデーターです。 <code>VALIDATORS</code> は配列の書式を使用します。 ここで、各配列の項目で使用されているさまざまなパラメーターを見てみましょう。 <span id="Parameters"></span> === パラメーター === {| class="wikitable" ! プロパティ ! 型 ! 説明 |- |id | 文字列 | 同梱/提供済みのバリデーターを使用する場合は、バリデーターの ID を指定します。 '''<code>class</code> が指定されていない場合は必須です。''' |- |class | 文字列 | カスタム バリデーターを使用する場合は、<code>id</code> の代わりにこのオプションを使用します。 バリデーター クラスの名前を指定します。 上記の設定の'''例 3''' を参照。 <code>AUTOLOAD</code> オプションを使用すると、クラスを読み込めます。 '''<code>id</code> が指定されていない場合は必須です。''' |- |enforce | 真偽値 | バリデータを強制するかどうか。 true に設定すると翻訳は検証されずエラーを表示しますので、修正しないと訳文を保存できません。 |- |insertable | 真偽値 | バリデータも挿入可能にするかどうか |- |keymatch | 配列 | このオプションは特定のメッセージに対する特定のバリデータ処理(認証)に制限をかけます。 Keymatch は配列で、各オプションは'''文字列'''または'''プロトタイプ'''のいずれかです。文字列の場合、メッセージ キーとの直接比較が行われます。 上記の設定の'''例 1''' を参照。 |- |keymatch[i].type | 文字列 | タイプは ''regex'' か ''wildcard'' の片方。 この方法はメッセージ キーが特定のパターンと一致するかどうか調べるために使います。 |- |keymatch[i].pattern | 文字列 | パターンとはマッチングに用いる文字列のこと。 |- |params | 文字列 / 連想配列 | <code>params</code> が'''文字列として'''指定されている場合、それは正規表現として使用されます。 '''例 1''' を参照 <div lang="en" dir="ltr" class="mw-content-ltr"> In this case if insertable is true, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>display</code> is the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>pre</code> is also the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>post</code> is left empty.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If <code>params</code> is specified '''as an associative array (see example #2)''', see below for further details.</span> |- |params.regex | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The regex to be used for validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Must use named captures.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When specifying named captures, do not use the <code>$</code> symbol in the name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In '''example #2''', two named captures are used - <code>pre</code> and <code>post</code>.</span> |- |params.display | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">Mandatory value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The display value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> '''例 2''' を参照。 |- |params.pre | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The pre value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted before the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, is set to the display value.</span> '''例 2''' を参照。 |- |params.post | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The post value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted after the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> '''例 2''' を参照。 <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, defaults to an empty string.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Pre-provided / Bundled validators === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a list of bundled validators, </div> ==== BraceBalance ==== ID: <code>BraceBalance</code> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the number of open braces / brackets, matches the number of closed braces / brackets in the translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, the following translations would pass, </div> * <code><nowiki>{{ }}</nowiki></code> * <code>[ ]</code> <span lang="en" dir="ltr" class="mw-content-ltr">whereas, the following would fail,</span> * <code>[ ]]</code> * <code><nowiki>{{ }</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator cannot be marked as insertable.</span> ==== EscapeCharacter ==== ID: <code>EscapeCharacter</code> <div lang="en" dir="ltr" class="mw-content-ltr"> The validator ensures that only the specified escape character are present in a translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The allowed escape characters can be specified when adding the validator, and can only include, </div> * <code>\t</code> * <code>\n</code> * <code>\'</code> * <code>\"</code> * <code>\f</code> * <code>\r</code> * <code>\a</code> * <code>\b</code> * <code>\\</code> このバリデーターは挿入可能ではありません。 ==== GettextNewline ==== ID: <code>GettextNewline</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically for GetText based message groups. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the translation has the same number of newlines as the source message at the beginning and end of the string. </div> ==== GettextPlural ==== ID: <code>GettextPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on GetText based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL:GETTEXT|one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== InsertableRegex ==== ID: <code>InsertableRegex</code> <div lang="en" dir="ltr" class="mw-content-ltr"> A generic reusable validator that can be used to specify custom validations and insertables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, take the following configuration where the validator is marked as insertable and enforced, </div> <syntaxhighlight lang="yaml"> - id: InsertableRegex enforce: true insertable: true params: "/\$[a-zA-Z0-9]+/" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Given the following source message - ''Hello $name. My name is $myName.'' that is being translated, the translation must have the parameters - ''$name'' and ''$myName''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will also be displayed as insertables to make it easier for translators to use them in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An absence of these parameters will cause an error to be displayed to the translator.</span> ==== InsertableRubyVariable ==== ID: <code>InsertableRubyVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches ruby variables in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>%{[a-zA-Z_]+}</code>.</span> このバリデーターは挿入可能です。 例: <code>%{abc}</code> ==== IosVariable ==== ID: <code>IosVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">An insertable variable validator for Ios.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Regex is used [https://github.com/dcordero/Rubustrings/blob/61d477bffbb318ca3ffed9c2afc49ec301931d93/lib/rubustrings/action.rb#L91 from this Rubustrings source].</span> このバリデーターは挿入可能です。 例: <code>%@</code> ==== MatchSet ==== ID: <code>MatchSet</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation is present in the list of values.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also takes a parameter - <code>caseSensitive</code> that can be either true (''default'') or false.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the following configuration, the validator will validate the message with key - <code>html.dir</code> and ensure that the values for it can either be ''ltr'' or ''rtl''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that LTR or RTL will not be valid values, since <code>caseSensitive</code> is true by default.</span> <syntaxhighlight lang="yaml" line="1" start="1"> - id: MatchSet enforce: true keymatch: - html.dir params: values: - ltr - rtl </syntaxhighlight> ==== MediaWikiLink ==== ID: <code>MediaWikiLink</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if the translation uses links that are discouraged.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Valid links are those that link to Special: pages, <code><nowiki>{{ns:special}}:</nowiki></code> or project pages trough MediaWiki messages like <code><nowiki>{{MediaWiki:helppage-url}}:</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also links in the definition are allowed.</span> ==== MediaWikiPageName ==== ID: <code>MediaWikiPageName</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a namespace such as <code><nowiki>{{ns:project}}:hello</nowiki></code> the translations made do not try to translate the namespaces itself.</span> ==== MediaWikiParameter ==== ID: <code>MediaWikiParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches wiki parameters in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>/\$[1-9]/</code>.</span> このバリデーターは挿入可能です。 例: <code>$1</code>, <code>$2</code>. ==== MediaWikiPlural ==== ID: <code>MediaWikiPlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a <code><nowiki>{{PLURAL:$1|message|messages}}</nowiki></code>, the translation should also have it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It can also be used as an insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 3 個あります。 ==== MediaWikiTimeList ==== ID: <code>MediaWikiTimeList</code> <span lang="en" dir="ltr" class="mw-content-ltr">Provides validations for expiry options and IP block options specified in the MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These are usually in the format,</span> <syntaxhighlight lang="text"> indefinite:indefinite,3 hours:3 hours,12 hours:12 hours,24 hours:24 hours,31 hours:31 hours,36 hours:36 hours,48 hours:48 hours,60 hours:60 hours,72 hours:72 hours,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,2 years:2 years,3 years:3 years,infinite:indefinite </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The validations ensure that the translations have the exact same number of key-value pairs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These validations are run only on messages with keys,</span> # protect-expiry-options # ipboptions ==== Newline ==== ID: <code>Newline</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has the same number of newlines as the source / definition message at the ''beginning of the string''.</span> このバリデーターは挿入可能ではありません。 ==== NotEmpty ==== ID: <code>NotEmpty</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has some content, and that content is not just whitespace.</span> このバリデーターは挿入可能ではありません。 ==== NumericalParameter ==== ID: <code>NumericalParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches numerical parameters by using the following regex: <code>/\$\d+/</code>.</span> このバリデーターは挿入可能です。 例: <code>$33</code>, <code>$1</code> etc. ==== Printf ==== ID: <code>Printf</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator checks for missing and unknown printf formatting characters in translations.</span> このバリデーターは挿入可能です。 例: <code>%2$f</code>, <code>%d</code> etc. ==== PythonInterpolation ==== ID: <code>PythonInterpolation</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches python string interpolation variables by using the following regex: <code>/\%(?:\([a-zA-Z0-9]*?\))?[diouxXeEfFgGcrs]/U</code>.</span> このバリデーターは挿入可能です。 例: <code>%s</code>, <code>%(name)s</code> ==== Replacement ==== ID: <code>Replacement</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if a translation is using the <code>search</code> string, and instead suggests the translator to use the string mentioned under <code>replacement</code>.</span> このバリデーターは挿入可能ではありません。 <syntaxhighlight lang="yaml" line="1"> - id: Replacement enforce: true params: search: '{{PLURAL:' replace: '{PLURAL:' </syntaxhighlight> ==== SmartFormatPlural ==== ID: <code>SmartFormatPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on [https://github.com/axuno/SmartFormat SmartFormat] based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code>{1:test|tests}{0:message|messages}</code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 4 個あります。 ==== UnicodePlural ==== ID: <code>UnicodePlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL|one=one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 3 個あります。 <div lang="en" dir="ltr" class="mw-content-ltr"> == User interface == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The user interface has been updated to differentiate between errors and warnings.</span> [[File:Translate-validation-err-warning.png|thumb|345x345px|alt=|<span lang="en" dir="ltr" class="mw-content-ltr">A warning and error shown on top of a translation</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> During translation, if an error is noticed with the translation, the '''Save translation''' button is disabled unless the user who is translating has <code>translate-manage</code> permission. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally validation is also done on the server when the user is saving the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will still allow users who have the <code>translate-manage</code> permission to save the translation even if it has errors.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Custom validators == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Certain complicated validations might still require a custom validator to be written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Custom validators must implement the <code>MediaWiki\Extensions\Translate\Validation\MessageValidator</code> interface [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/MessageValidator.php].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Below is an example of a custom validator, </div> <syntaxhighlight lang="php" line="1" start="1"> <?php // Filename: Validator.php use MediaWiki\Extensions\Translate\Validation\MessageValidator; use MediaWiki\Extensions\Translate\Validation\ValidationIssue; use MediaWiki\Extensions\Translate\Validation\ValidationIssues; /** * My Custom Validator */ class MyCustomValidator implements MessageValidator { public function getIssues( TMessage $message, string $targetLanguage ): ValidationIssues { $issues = new ValidationIssues(); // Validation code goes here. ValidationIssueをValidationIssuesにプッシュ。 例: $issue = new ValidationIssue( 'value-not-present', // タイプ 'invalid', // サブタイプ 'translate-checks-value-not-present', // メッセージ キー [ // メッセージ パラメーター [ 'PLAIN-PARAMS', $this->possibleValues ], [ 'COUNT', count( $this->possibleValues ) ] ] ); $issues->add( $issue ); return $issues; } } </syntaxhighlight> また以下のクラスを参照し、 # <code>ValidationIssues</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssues.php # <code>ValidationIssue</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssue.php カスタム バリデータを設定ファイルに追加するには、 <syntaxhighlight lang="yaml"> VALIDATORS: - class: MyCustomValidator enforce: true AUTOLOAD: MyCustomValidator: Validator.php </syntaxhighlight> 010smp60xwpcrz7fpu50251yjb33so3 8364887 8364885 2026-05-04T04:05:14Z Shirayuki 472859 Created page with "$1 が'''連想配列として (例 #2 を参照)''' 指定されている場合は、詳細は以下を参照してください。" 8364887 wikitext text/x-wiki <languages/> {{Extension-Translate}} 翻訳対象の文字列は、翻訳結果でもそのまま保持されるべきマークアップを含むことがよくあります。 マークアップは特殊な文字を多く含むため、タイプするのが低速・困難になる場合があります。 Translate 拡張機能は、翻訳者がボタンをクリックすると、現在のカーソル位置にマークアップの一部が挿入されるようにすることができます。 さらに、翻訳に特定のマークアップが欠けている場合、Translate 拡張機能は翻訳者に警告するか、または翻訳を拒否できます。これは、エンド ユーザーにメッセージを正しく表示するためには、通常、このようなマークアップが必須だからです。 例えば、<blockquote>''Adapted by %{name} from a work by %{original}''</blockquote> という文字列の中には、<code>%{name}</code> と <code>%{original}</code> という 2 つの挿入可能な文字列が存在します。 翻訳者がこれらを追加して翻訳しないと、ソフトウェアを使用するエンド ユーザーには適切なメッセージが表示されません。 翻訳の検証を支援する目的で、<code>MessageValidator</code> フレームワークが追加されました。 翻訳されたメッセージに対してバリデーターが実行され、設定に基づいて警告またはエラー メッセージが翻訳者に表示されます。 警告がある翻訳は保存できますが、エラーがある翻訳は保存できません。 <code>translate-manage</code> の権限がある利用者のみが、エラーのある翻訳を保存できます。 バリデーターを設定する際、必須となるマークアップを識別するための正規表現を定義します。 バリデーターは挿入可能としてマークすることもでき、その場合はそのマークアップを翻訳に追加するためのボタンが翻訳者に表示されます。 カスタム バリデーターを追加でき、これはより専門的な検証をするために必要となります。 <span id="Configuration"></span> == 設定 == 以下はバリデーターの設定の要約です。 <syntaxhighlight lang="yaml" line="1" start="1"> VALIDATORS: # 例 1 - id: InsertableRegex enforce: true insertable: true params: /\$[a-z0-9]+/ keymatch: - 'untranslated' # 翻訳されていないキーに直接マッチする - type: 'wildcard' pattern: '*translated*' # 翻訳されたものが含まれるキーにマッチする # 例 2 - id: InsertableRegex insertable: true params: regex: /(?<pre>\[)[^]]+(?<post>\]\([^)]+\))/ display: $pre $post pre: $pre post: $post # 例 3 - class: MathJaxMessageValidator enforce: true # 例 4 - id: BraceBalance </syntaxhighlight> 上記の例では: # <code>InsertableRegex</code> は、カスタム正規表現を受け取って検証を実行できる同梱されているバリデーターです。 # <code>MathJaxMessageValidator</code> はカスタム バリデーター クラスです。 # <code>BraceBalance</code> は別の同梱されているバリデーターです。 <code>VALIDATORS</code> は配列の書式を使用します。 ここで、各配列の項目で使用されているさまざまなパラメーターを見てみましょう。 <span id="Parameters"></span> === パラメーター === {| class="wikitable" ! プロパティ ! 型 ! 説明 |- |id | 文字列 | 同梱/提供済みのバリデーターを使用する場合は、バリデーターの ID を指定します。 '''<code>class</code> が指定されていない場合は必須です。''' |- |class | 文字列 | カスタム バリデーターを使用する場合は、<code>id</code> の代わりにこのオプションを使用します。 バリデーター クラスの名前を指定します。 上記の設定の'''例 3''' を参照。 <code>AUTOLOAD</code> オプションを使用すると、クラスを読み込めます。 '''<code>id</code> が指定されていない場合は必須です。''' |- |enforce | 真偽値 | バリデータを強制するかどうか。 true に設定すると翻訳は検証されずエラーを表示しますので、修正しないと訳文を保存できません。 |- |insertable | 真偽値 | バリデータも挿入可能にするかどうか |- |keymatch | 配列 | このオプションは特定のメッセージに対する特定のバリデータ処理(認証)に制限をかけます。 Keymatch は配列で、各オプションは'''文字列'''または'''プロトタイプ'''のいずれかです。文字列の場合、メッセージ キーとの直接比較が行われます。 上記の設定の'''例 1''' を参照。 |- |keymatch[i].type | 文字列 | タイプは ''regex'' か ''wildcard'' の片方。 この方法はメッセージ キーが特定のパターンと一致するかどうか調べるために使います。 |- |keymatch[i].pattern | 文字列 | パターンとはマッチングに用いる文字列のこと。 |- |params | 文字列 / 連想配列 | <code>params</code> が'''文字列として'''指定されている場合、それは正規表現として使用されます。 '''例 1''' を参照 <div lang="en" dir="ltr" class="mw-content-ltr"> In this case if insertable is true, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>display</code> is the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>pre</code> is also the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>post</code> is left empty.</span> <code>params</code> が'''連想配列として (例 #2 を参照)''' 指定されている場合は、詳細は以下を参照してください。 |- |params.regex | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The regex to be used for validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Must use named captures.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When specifying named captures, do not use the <code>$</code> symbol in the name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In '''example #2''', two named captures are used - <code>pre</code> and <code>post</code>.</span> |- |params.display | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">Mandatory value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The display value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> '''例 2''' を参照。 |- |params.pre | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The pre value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted before the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, is set to the display value.</span> '''例 2''' を参照。 |- |params.post | 文字列 | <span lang="en" dir="ltr" class="mw-content-ltr">The post value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted after the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> '''例 2''' を参照。 <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, defaults to an empty string.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Pre-provided / Bundled validators === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a list of bundled validators, </div> ==== BraceBalance ==== ID: <code>BraceBalance</code> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the number of open braces / brackets, matches the number of closed braces / brackets in the translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, the following translations would pass, </div> * <code><nowiki>{{ }}</nowiki></code> * <code>[ ]</code> <span lang="en" dir="ltr" class="mw-content-ltr">whereas, the following would fail,</span> * <code>[ ]]</code> * <code><nowiki>{{ }</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator cannot be marked as insertable.</span> ==== EscapeCharacter ==== ID: <code>EscapeCharacter</code> <div lang="en" dir="ltr" class="mw-content-ltr"> The validator ensures that only the specified escape character are present in a translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The allowed escape characters can be specified when adding the validator, and can only include, </div> * <code>\t</code> * <code>\n</code> * <code>\'</code> * <code>\"</code> * <code>\f</code> * <code>\r</code> * <code>\a</code> * <code>\b</code> * <code>\\</code> このバリデーターは挿入可能ではありません。 ==== GettextNewline ==== ID: <code>GettextNewline</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically for GetText based message groups. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the translation has the same number of newlines as the source message at the beginning and end of the string. </div> ==== GettextPlural ==== ID: <code>GettextPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on GetText based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL:GETTEXT|one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== InsertableRegex ==== ID: <code>InsertableRegex</code> <div lang="en" dir="ltr" class="mw-content-ltr"> A generic reusable validator that can be used to specify custom validations and insertables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, take the following configuration where the validator is marked as insertable and enforced, </div> <syntaxhighlight lang="yaml"> - id: InsertableRegex enforce: true insertable: true params: "/\$[a-zA-Z0-9]+/" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Given the following source message - ''Hello $name. My name is $myName.'' that is being translated, the translation must have the parameters - ''$name'' and ''$myName''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will also be displayed as insertables to make it easier for translators to use them in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An absence of these parameters will cause an error to be displayed to the translator.</span> ==== InsertableRubyVariable ==== ID: <code>InsertableRubyVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches ruby variables in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>%{[a-zA-Z_]+}</code>.</span> このバリデーターは挿入可能です。 例: <code>%{abc}</code> ==== IosVariable ==== ID: <code>IosVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">An insertable variable validator for Ios.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Regex is used [https://github.com/dcordero/Rubustrings/blob/61d477bffbb318ca3ffed9c2afc49ec301931d93/lib/rubustrings/action.rb#L91 from this Rubustrings source].</span> このバリデーターは挿入可能です。 例: <code>%@</code> ==== MatchSet ==== ID: <code>MatchSet</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation is present in the list of values.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also takes a parameter - <code>caseSensitive</code> that can be either true (''default'') or false.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the following configuration, the validator will validate the message with key - <code>html.dir</code> and ensure that the values for it can either be ''ltr'' or ''rtl''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that LTR or RTL will not be valid values, since <code>caseSensitive</code> is true by default.</span> <syntaxhighlight lang="yaml" line="1" start="1"> - id: MatchSet enforce: true keymatch: - html.dir params: values: - ltr - rtl </syntaxhighlight> ==== MediaWikiLink ==== ID: <code>MediaWikiLink</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if the translation uses links that are discouraged.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Valid links are those that link to Special: pages, <code><nowiki>{{ns:special}}:</nowiki></code> or project pages trough MediaWiki messages like <code><nowiki>{{MediaWiki:helppage-url}}:</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also links in the definition are allowed.</span> ==== MediaWikiPageName ==== ID: <code>MediaWikiPageName</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a namespace such as <code><nowiki>{{ns:project}}:hello</nowiki></code> the translations made do not try to translate the namespaces itself.</span> ==== MediaWikiParameter ==== ID: <code>MediaWikiParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches wiki parameters in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>/\$[1-9]/</code>.</span> このバリデーターは挿入可能です。 例: <code>$1</code>, <code>$2</code>. ==== MediaWikiPlural ==== ID: <code>MediaWikiPlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a <code><nowiki>{{PLURAL:$1|message|messages}}</nowiki></code>, the translation should also have it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It can also be used as an insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 3 個あります。 ==== MediaWikiTimeList ==== ID: <code>MediaWikiTimeList</code> <span lang="en" dir="ltr" class="mw-content-ltr">Provides validations for expiry options and IP block options specified in the MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These are usually in the format,</span> <syntaxhighlight lang="text"> indefinite:indefinite,3 hours:3 hours,12 hours:12 hours,24 hours:24 hours,31 hours:31 hours,36 hours:36 hours,48 hours:48 hours,60 hours:60 hours,72 hours:72 hours,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,2 years:2 years,3 years:3 years,infinite:indefinite </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The validations ensure that the translations have the exact same number of key-value pairs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These validations are run only on messages with keys,</span> # protect-expiry-options # ipboptions ==== Newline ==== ID: <code>Newline</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has the same number of newlines as the source / definition message at the ''beginning of the string''.</span> このバリデーターは挿入可能ではありません。 ==== NotEmpty ==== ID: <code>NotEmpty</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has some content, and that content is not just whitespace.</span> このバリデーターは挿入可能ではありません。 ==== NumericalParameter ==== ID: <code>NumericalParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches numerical parameters by using the following regex: <code>/\$\d+/</code>.</span> このバリデーターは挿入可能です。 例: <code>$33</code>, <code>$1</code> etc. ==== Printf ==== ID: <code>Printf</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator checks for missing and unknown printf formatting characters in translations.</span> このバリデーターは挿入可能です。 例: <code>%2$f</code>, <code>%d</code> etc. ==== PythonInterpolation ==== ID: <code>PythonInterpolation</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches python string interpolation variables by using the following regex: <code>/\%(?:\([a-zA-Z0-9]*?\))?[diouxXeEfFgGcrs]/U</code>.</span> このバリデーターは挿入可能です。 例: <code>%s</code>, <code>%(name)s</code> ==== Replacement ==== ID: <code>Replacement</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if a translation is using the <code>search</code> string, and instead suggests the translator to use the string mentioned under <code>replacement</code>.</span> このバリデーターは挿入可能ではありません。 <syntaxhighlight lang="yaml" line="1"> - id: Replacement enforce: true params: search: '{{PLURAL:' replace: '{PLURAL:' </syntaxhighlight> ==== SmartFormatPlural ==== ID: <code>SmartFormatPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on [https://github.com/axuno/SmartFormat SmartFormat] based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code>{1:test|tests}{0:message|messages}</code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 4 個あります。 ==== UnicodePlural ==== ID: <code>UnicodePlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL|one=one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> 例えば、英語には 2 個、ヘブライ語には 3 個あります。 <div lang="en" dir="ltr" class="mw-content-ltr"> == User interface == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The user interface has been updated to differentiate between errors and warnings.</span> [[File:Translate-validation-err-warning.png|thumb|345x345px|alt=|<span lang="en" dir="ltr" class="mw-content-ltr">A warning and error shown on top of a translation</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> During translation, if an error is noticed with the translation, the '''Save translation''' button is disabled unless the user who is translating has <code>translate-manage</code> permission. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally validation is also done on the server when the user is saving the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will still allow users who have the <code>translate-manage</code> permission to save the translation even if it has errors.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Custom validators == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Certain complicated validations might still require a custom validator to be written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Custom validators must implement the <code>MediaWiki\Extensions\Translate\Validation\MessageValidator</code> interface [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/MessageValidator.php].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Below is an example of a custom validator, </div> <syntaxhighlight lang="php" line="1" start="1"> <?php // Filename: Validator.php use MediaWiki\Extensions\Translate\Validation\MessageValidator; use MediaWiki\Extensions\Translate\Validation\ValidationIssue; use MediaWiki\Extensions\Translate\Validation\ValidationIssues; /** * My Custom Validator */ class MyCustomValidator implements MessageValidator { public function getIssues( TMessage $message, string $targetLanguage ): ValidationIssues { $issues = new ValidationIssues(); // Validation code goes here. ValidationIssueをValidationIssuesにプッシュ。 例: $issue = new ValidationIssue( 'value-not-present', // タイプ 'invalid', // サブタイプ 'translate-checks-value-not-present', // メッセージ キー [ // メッセージ パラメーター [ 'PLAIN-PARAMS', $this->possibleValues ], [ 'COUNT', count( $this->possibleValues ) ] ] ); $issues->add( $issue ); return $issues; } } </syntaxhighlight> また以下のクラスを参照し、 # <code>ValidationIssues</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssues.php # <code>ValidationIssue</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssue.php カスタム バリデータを設定ファイルに追加するには、 <syntaxhighlight lang="yaml"> VALIDATORS: - class: MyCustomValidator enforce: true AUTOLOAD: MyCustomValidator: Validator.php </syntaxhighlight> hzunyxaqa57qj22ihz16x1t7hdn9lpe Help:Extension:Translate/Validators/fi 12 1483638 8364877 6038829 2026-05-04T04:02:50Z FuzzyBot 451990 Updating to match new version of source page 8364877 wikitext text/x-wiki <languages/> {{Extension-Translate}} <span lang="en" dir="ltr" class="mw-content-ltr">Translatable strings often contain markup that should be retained as-is in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Typing that markup can be slow and difficult because special characters are common.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Translate extension can provide translators a button clicking on which inserts the piece of markup into the translation to the current cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In addition, if a translation is missing that specific markup, the Translate extension can either warn the translator or simply reject the translation, since such markup is usually mandatory to display the messages properly to the end user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example in the string, <blockquote>''Adapted by %{name} from a work by %{original}''</blockquote> there are two insertables - <code>%{name}</code> and <code>%{original}</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the translator does not add them to their translation, the end user using the software will not see a proper message.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>MessageValidator</code> framework has been added with the intent of helping with validating translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Validators run on the translated message and based on the configuration, a warning or error message is shown to the translator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Translations with warnings can still be saved, but ones that have error cannot.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only a user with <code>translate-manage</code> permission can save translations that have errors.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When configuring a validator, a regex is defined to identify markup that is mandatory.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The validator can also be marked as insertable, in which case a button will be displayed to the translator to add that markup into the translation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Adding a custom validators is still possible and will be needed for more specialized validations. </div> <span id="Configuration"></span> == Kokoonpano == <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a summarized validator configuration, </div> <syntaxhighlight lang="yaml" line="1" start="1"> VALIDATORS: # Esimerkki 1 - id: InsertableRegex enforce: true insertable: true params: /\$[a-z0-9]+/ keymatch: - 'untranslated' # Matches key untranslated directly - type: 'wildcard' pattern: '*translated*' # Matches any key that has the translated in it # Esimerkki 2 - id: InsertableRegex insertable: true params: regex: /(?<pre>\[)[^]]+(?<post>\]\([^)]+\))/ display: $pre $post pre: $pre post: $post # Esimerkki 3 - class: MathJaxMessageValidator enforce: true # Esimerkki 4 - id: BraceBalance </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In the example above, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>InsertableRegex</code> is a bundled validator that can accept a custom regex and run validations.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>MathJaxMessageValidator</code> is a custom validator class.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>BraceBalance</code> is another bundled validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr"><code>VALIDATORS</code> uses an array format.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Lets look at the various parameters being used here in each array item,</span> <span id="Parameters"></span> === Parametrit === {| class="wikitable" ! Ominaisuus ! Tyyppi ! Kuvaus |- |id | merkkijono | <span lang="en" dir="ltr" class="mw-content-ltr">Incase a bundled / pre-provided validator is being used, the ID of the validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">''Required if <code>class</code> is not specified.''</span> |- |class | merkkijono | <span lang="en" dir="ltr" class="mw-content-ltr">If a custom validator is being used, then use this option instead of <code>id</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Specifies the name of the validator class.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #3''' in the above config.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>AUTOLOAD</code> option can be used to load the class.</span> <span lang="en" dir="ltr" class="mw-content-ltr">''Required if <code>id</code> is not specified.''</span> |- |enforce | <span lang="en" dir="ltr" class="mw-content-ltr">boolean</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether the validator should be enforced.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If set to true, and a translation fails validation, an error will be displayed which must be fixed in order to save the translation.</span> |- |insertable | <span lang="en" dir="ltr" class="mw-content-ltr">boolean</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether the validator should also be an insertable.</span> |- |keymatch | joukko | <span lang="en" dir="ltr" class="mw-content-ltr">With this option it is possible to limit certain validations to certain messages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Keymatch is an array with each option being either a '''string''' or a '''prototype.''' If it is a string, a direct comparison with the message key is done.</span> Katso '''esimerkki #1''' yllä olevassa kokoonpanossa. |- |keymatch[i].type | merkkijono | <span lang="en" dir="ltr" class="mw-content-ltr">Type is either ''regex'' or ''wildcard''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is the approach that will be used to check if the message key matches a given pattern.</span> |- |keymatch[i].pattern | merkkijono | <span lang="en" dir="ltr" class="mw-content-ltr">Pattern is a string that will be used for matching.</span> |- |params | <span lang="en" dir="ltr" class="mw-content-ltr">string / associative array</span> | <span lang="en" dir="ltr" class="mw-content-ltr">If <code>params</code> is specified '''as a string''', it is used as the regex.</span> Katso '''esimerkki #1''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this case if insertable is true, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>display</code> is the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>pre</code> is also the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>post</code> is left empty.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If <code>params</code> is specified '''as an associative array (see example #2)''', see below for further details.</span> |- |params.regex | merkkijono | <span lang="en" dir="ltr" class="mw-content-ltr">The regex to be used for validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Must use named captures.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When specifying named captures, do not use the <code>$</code> symbol in the name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In '''example #2''', two named captures are used - <code>pre</code> and <code>post</code>.</span> |- |params.display | merkkijono | <span lang="en" dir="ltr" class="mw-content-ltr">Mandatory value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The display value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> Katso '''esimerkki #2'''. |- |params.pre | merkkijono | <span lang="en" dir="ltr" class="mw-content-ltr">The pre value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted before the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, is set to the display value.</span> Katso '''esimerkki #2'''. |- |params.post | merkkijono | <span lang="en" dir="ltr" class="mw-content-ltr">The post value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted after the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #2'''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, defaults to an empty string.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Pre-provided / Bundled validators === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a list of bundled validators, </div> ==== BraceBalance ==== ID: <code>BraceBalance</code> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the number of open braces / brackets, matches the number of closed braces / brackets in the translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, the following translations would pass, </div> * <code><nowiki>{{ }}</nowiki></code> * <code>[ ]</code> <span lang="en" dir="ltr" class="mw-content-ltr">whereas, the following would fail,</span> * <code>[ ]]</code> * <code><nowiki>{{ }</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator cannot be marked as insertable.</span> ==== EscapeCharacter ==== ID: <code>EscapeCharacter</code> <div lang="en" dir="ltr" class="mw-content-ltr"> The validator ensures that only the specified escape character are present in a translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The allowed escape characters can be specified when adding the validator, and can only include, </div> * <code>\t</code> * <code>\n</code> * <code>\'</code> * <code>\"</code> * <code>\f</code> * <code>\r</code> * <code>\a</code> * <code>\b</code> * <code>\\</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> ==== GettextNewline ==== ID: <code>GettextNewline</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically for GetText based message groups. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the translation has the same number of newlines as the source message at the beginning and end of the string. </div> ==== GettextPlural ==== ID: <code>GettextPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on GetText based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL:GETTEXT|one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== InsertableRegex ==== ID: <code>InsertableRegex</code> <div lang="en" dir="ltr" class="mw-content-ltr"> A generic reusable validator that can be used to specify custom validations and insertables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, take the following configuration where the validator is marked as insertable and enforced, </div> <syntaxhighlight lang="yaml"> - id: InsertableRegex enforce: true insertable: true params: "/\$[a-zA-Z0-9]+/" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Given the following source message - ''Hello $name. My name is $myName.'' that is being translated, the translation must have the parameters - ''$name'' and ''$myName''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will also be displayed as insertables to make it easier for translators to use them in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An absence of these parameters will cause an error to be displayed to the translator.</span> ==== InsertableRubyVariable ==== ID: <code>InsertableRubyVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches ruby variables in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>%{[a-zA-Z_]+}</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> Esimerkki: <code>%{abc}</code> ==== IosVariable ==== ID: <code>IosVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">An insertable variable validator for Ios.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Regex is used [https://github.com/dcordero/Rubustrings/blob/61d477bffbb318ca3ffed9c2afc49ec301931d93/lib/rubustrings/action.rb#L91 from this Rubustrings source].</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> Esimerkki: <code>%@</code> ==== MatchSet ==== ID: <code>MatchSet</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation is present in the list of values.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also takes a parameter - <code>caseSensitive</code> that can be either true (''default'') or false.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the following configuration, the validator will validate the message with key - <code>html.dir</code> and ensure that the values for it can either be ''ltr'' or ''rtl''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that LTR or RTL will not be valid values, since <code>caseSensitive</code> is true by default.</span> <syntaxhighlight lang="yaml" line="1" start="1"> - id: MatchSet enforce: true keymatch: - html.dir params: values: - ltr - rtl </syntaxhighlight> ==== MediaWikiLink ==== ID: <code>MediaWikiLink</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if the translation uses links that are discouraged.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Valid links are those that link to Special: pages, <code><nowiki>{{ns:special}}:</nowiki></code> or project pages trough MediaWiki messages like <code><nowiki>{{MediaWiki:helppage-url}}:</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also links in the definition are allowed.</span> ==== MediaWikiPageName ==== ID: <code>MediaWikiPageName</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a namespace such as <code><nowiki>{{ns:project}}:hello</nowiki></code> the translations made do not try to translate the namespaces itself.</span> ==== MediaWikiParameter ==== ID: <code>MediaWikiParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches wiki parameters in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>/\$[1-9]/</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> Esimerkki: <code>$1</code>, <code>$2</code>. ==== MediaWikiPlural ==== ID: <code>MediaWikiPlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a <code><nowiki>{{PLURAL:$1|message|messages}}</nowiki></code>, the translation should also have it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It can also be used as an insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has three.</span> ==== MediaWikiTimeList ==== ID: <code>MediaWikiTimeList</code> <span lang="en" dir="ltr" class="mw-content-ltr">Provides validations for expiry options and IP block options specified in the MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These are usually in the format,</span> <syntaxhighlight lang="text"> indefinite:indefinite,3 hours:3 hours,12 hours:12 hours,24 hours:24 hours,31 hours:31 hours,36 hours:36 hours,48 hours:48 hours,60 hours:60 hours,72 hours:72 hours,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,2 years:2 years,3 years:3 years,infinite:indefinite </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The validations ensure that the translations have the exact same number of key-value pairs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These validations are run only on messages with keys,</span> # protect-expiry-options # ipboptions ==== Newline ==== ID: <code>Newline</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has the same number of newlines as the source / definition message at the ''beginning of the string''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> ==== NotEmpty ==== ID: <code>NotEmpty</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has some content, and that content is not just whitespace.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> ==== NumericalParameter ==== ID: <code>NumericalParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches numerical parameters by using the following regex: <code>/\$\d+/</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> Esimerkki: <code>$33</code>, <code>$1</code> etc. ==== Printf ==== ID: <code>Printf</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator checks for missing and unknown printf formatting characters in translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> Esimerkki: <code>%2$f</code>, <code>%d</code> etc. ==== PythonInterpolation ==== ID: <code>PythonInterpolation</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches python string interpolation variables by using the following regex: <code>/\%(?:\([a-zA-Z0-9]*?\))?[diouxXeEfFgGcrs]/U</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> Esimerkki: <code>%s</code>, <code>%(name)s</code> ==== Replacement ==== ID: <code>Replacement</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if a translation is using the <code>search</code> string, and instead suggests the translator to use the string mentioned under <code>replacement</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> <syntaxhighlight lang="yaml" line="1"> - id: Replacement enforce: true params: search: '{{PLURAL:' replace: '{PLURAL:' </syntaxhighlight> ==== SmartFormatPlural ==== ID: <code>SmartFormatPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on [https://github.com/axuno/SmartFormat SmartFormat] based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code>{1:test|tests}{0:message|messages}</code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== UnicodePlural ==== ID: <code>UnicodePlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL|one=one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has three.</span> <span id="User_interface"></span> == Käyttöliittymä == <span lang="en" dir="ltr" class="mw-content-ltr">The user interface has been updated to differentiate between errors and warnings.</span> [[File:Translate-validation-err-warning.png|thumb|345x345px|alt=|<span lang="en" dir="ltr" class="mw-content-ltr">A warning and error shown on top of a translation</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> During translation, if an error is noticed with the translation, the '''Save translation''' button is disabled unless the user who is translating has <code>translate-manage</code> permission. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally validation is also done on the server when the user is saving the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will still allow users who have the <code>translate-manage</code> permission to save the translation even if it has errors.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Custom validators == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Certain complicated validations might still require a custom validator to be written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Custom validators must implement the <code>MediaWiki\Extensions\Translate\Validation\MessageValidator</code> interface [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/MessageValidator.php].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Below is an example of a custom validator, </div> <syntaxhighlight lang="php" line="1" start="1"> <?php // Filename: Validator.php use MediaWiki\Extensions\Translate\Validation\MessageValidator; use MediaWiki\Extensions\Translate\Validation\ValidationIssue; use MediaWiki\Extensions\Translate\Validation\ValidationIssues; /** * My Custom Validator */ class MyCustomValidator implements MessageValidator { public function getIssues( TMessage $message, string $targetLanguage ): ValidationIssues { $issues = new ValidationIssues(); // Validation code goes here. Push ValidationIssue into the ValidationIssues. E.g.: $issue = new ValidationIssue( 'value-not-present', // tyyppi 'invalid', // sub-type 'translate-checks-value-not-present', // viestin avain [ // viestin parametrit [ 'PLAIN-PARAMS', $this->possibleValues ], [ 'COUNT', count( $this->possibleValues ) ] ] ); $issues->add( $issue ); return $issues; } } </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Also see the following classes,</span> # <code>ValidationIssues</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssues.php # <code>ValidationIssue</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssue.php <span lang="en" dir="ltr" class="mw-content-ltr">The add the custom validator in the configuration file,</span> <syntaxhighlight lang="yaml"> VALIDATORS: - class: MyCustomValidator enforce: true AUTOLOAD: MyCustomValidator: Validator.php </syntaxhighlight> kloqe72p8ic3hagqrxa8i77a9ic9vdj Help:Extension:ParserFunctions/sk 12 1487988 8365031 8353947 2026-05-04T06:21:21Z FuzzyBot 451990 Updating to match new version of source page 8365031 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span lang="en" dir="ltr" class="mw-content-ltr">The {{ll|Extension:ParserFunctions|nsp=0}} extension provides additional [[Special:MyLanguage/Parser functions|parser functions]] to supplement those already present in MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">(It ''may'' be configured to provide additional parser functions for string handling; these are only available to non-Wikimedia Foundation wikis hence these string functions are documented {{ll|Extension:ParserFunctions/String functions|elsewhere}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">All the parser functions provided by this extension take the form:</span> :<code><nowiki>{{</nowiki><span lang="en" dir="ltr" class="mw-content-ltr">'''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ...</span> <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Operators</span> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Grouping (parentheses)</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Numbers</span> | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | <span lang="en" dir="ltr" class="mw-content-ltr">binary operator</span> <code>'''e'''</code> &nbsp; <span lang="en" dir="ltr" class="mw-content-ltr">unary</span> <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Unary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Binary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Round</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Logic</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} <span lang="en" dir="ltr" class="mw-content-ltr">This function evaluates a mathematical expression and returns the calculated value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This function is also available in {{ll|Extension:Scribunto|nsp=0}} via the <code>mw.ext.ParserFunctions.expr</code> function.</span> :<code><nowiki>{{#expr:</nowiki> ''<span lang="en" dir="ltr" class="mw-content-ltr">expression</span>'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The available operators are listed to the right, in order of precedence. See {{ll|Manual:Expr parser function syntax}} for more details of the function of each operator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> When evaluating using [[w:boolean algebra|boolean algebra]], zero evaluates to {{phpi|false}}, and any nonzero value, positive or negative, evaluates to {{phpi|true}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code>[[##iferror|#iferror]]</code> function: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Rounding === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Test case</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Result</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Method of rounding</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is < 5, so no apparent rounding occurs</span> (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is ≥ 5, so it is rounded up</span> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to the nearest integer</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the ''nearest'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding up or down with ''ceil'' and ''floor''</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next ''larger'' integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next ''smaller'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next larger integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next smaller integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Not rounded, since 1 already is an integer</span><br />{{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect</span>}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Strings === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: test string | value if test string is not empty | value if test string is empty (or only white space)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: first parameter | second parameter | third parameter }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' porovnání :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Example: </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Year</span> |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">4-digit year.</span> | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Month</span> |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour</span> |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Minutes and seconds</span> |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] r5b5j6jxxeayvgov1l97uai934cdisq Extension:TimedMediaHandler/VideoJS Player/th 102 1488002 8364369 8363697 2026-05-03T13:12:20Z FuzzyBot 451990 Updating to match new version of source page 8364369 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|ภาพหน้าจอของตัวเล่นใหม่ในการดำเนินการ]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> มันขึ้นอยู่กับ [https://videojs.com/ VideoJS]และมีส่วนต่อประสานผู้ใช้ที่ทันสมัยและเร็วขึ้นพร้อมความเข้ากันได้กับอุปกรณ์มือถือและ HTML5 <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|ตัวอย่างเครื่องเล่นวิดีโอ]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using tab, enter and spacebar keys</span> <span id="Known_issues"></span> == ปัญหาที่ทราบ == เครื่องเล่นวิดีโอยังอยู่ในระหว่างการพัฒนา แต่หากคุณพบปัญหาใดๆ โปรดรายงานปัญหาเหล่านี้ใน [[Extension_talk:TimedMediaHandler/VideoJS Player|หน้าพูดคุย]] หรือไฟล์นั้นใน [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator] <span id="Developers"></span> == นักพัฒนา == <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> bu2unkh6ipx2ymz4s7f9e502mh5rfp2 8364785 8364369 2026-05-03T23:14:45Z FuzzyBot 451990 Updating to match new version of source page 8364785 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|ภาพหน้าจอของตัวเล่นใหม่ในการดำเนินการ]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> มันขึ้นอยู่กับ [https://videojs.com/ VideoJS]และมีส่วนต่อประสานผู้ใช้ที่ทันสมัยและเร็วขึ้นพร้อมความเข้ากันได้กับอุปกรณ์มือถือและ HTML5 <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|ตัวอย่างเครื่องเล่นวิดีโอ]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</span> <span id="Known_issues"></span> == ปัญหาที่ทราบ == เครื่องเล่นวิดีโอยังอยู่ในระหว่างการพัฒนา แต่หากคุณพบปัญหาใดๆ โปรดรายงานปัญหาเหล่านี้ใน [[Extension_talk:TimedMediaHandler/VideoJS Player|หน้าพูดคุย]] หรือไฟล์นั้นใน [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator] <span id="Developers"></span> == นักพัฒนา == <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 6345dsw9yl3z0ikgw940o7dzoy3lbyn Just make it a user preference/ja 0 1502221 8364921 8192109 2026-05-04T05:20:30Z ~2026-27097-75 18368095 Created page with "Je n" 8364921 wikitext text/x-wiki <languages/> {{essay}} <span lang="en" dir="ltr" class="mw-content-ltr">We editors often request "Just make it a user preference", and similar. This list/essay aims to summarize some of the complexities of that idea, listing its problems and benefits.</span> __TOC__ <div lang="en" dir="ltr" class="mw-content-ltr"> == Problems== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Every additional user-preference: </div> # Je n ## <span lang="en" dir="ltr" class="mw-content-ltr">Increases the likelihood of bugs (either now or in the future)</span> ## <span lang="en" dir="ltr" class="mw-content-ltr">Increases the long-term code-maintenance task</span> ## <span lang="en" dir="ltr" class="mw-content-ltr">Increases the quantity of variations that ought to be tested, in both automated and manual code checks - each variation adds exponential new combinations</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the complexity of the Special:Preferences tabs for users (hence making everything a bit more difficult to find)</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the UI translation backlog</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the already overwhelming documentation</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds new rows to the user-properties database table, which is already too large ({{phab|T54777}})</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the quantity of things that need to be considered, when contemplating any ''additional'' new features in the same feature-set</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Makes it harder to diagnose bugs</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Must avoid [[Special:MyLanguage/Manual:Cache|cache]] fragmentation</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Hence, developers/designers/managers/etc are very hesitant to just make a new user preference every time [frequently!] that somebody asks for one. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Benefits == </div> <span lang="en" dir="ltr" class="mw-content-ltr">That said, I (and many of us) adore preferences, and I consider Firefox's <code>about:config</code> page to be generally DoingItRight™ as far as power-users are concerned.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">However it really needs some built-in documentation. I previously used [https://web.archive.org/web/20070406020621/http://preferential.mozdev.org/preferences.html an extension] which added helpful annotations about each option to the page, but it stopped being maintained.</span> </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> I've written a bit more about this in a section at [[Talk:Requests for comment/Redesign user preferences#An Ode to Options, A Paean to Preferences|Talk:RfC/Redesign user preferences]], which I'll copy below: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === An Ode to Options, A Paean to Preferences, A Serenade to Settings, A Cry for Configuration === </div> {| class="rquote floatright" style="border-collapse:collapse; border-style:none; float:right; margin:0.5em 0.75em; width:33%" |- style="text-align:left; vertical-align:top;" | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; width:0.5em;"| “ | style="padding:0 10px;"| :<span lang="en" dir="ltr" class="mw-content-ltr">&lt;Alice> Make the first question: "Do you want to use the default settings or customize?"</span> :<span lang="en" dir="ltr" class="mw-content-ltr">&lt;Bob> every nerd worth his or her salt answers "customize"</span> | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; text-align:right; vertical-align:bottom; width:0.5em;"| ” |- | class="rquotecite" colspan="3" style="padding-top:10px;"| <p style="font-size:smaller; line-height:1em; text-align:right">&mdash;<span lang="en" dir="ltr" class="mw-content-ltr">Two staff developers on IRC, discussing improvements to the MediaWiki-software installation process and documentation. ~2014.</span></p> |} <span lang="en" dir="ltr" class="mw-content-ltr">I want to see our Special:Preferences menu become better organized, so that it can '''grow''', with all the tweaks and power-tools that some editors need permanently available – I.e. The things the various overlapping communities have built over the last 20+ years, and continue to create and refine – So that newcomers can find what they're looking for without being overwhelmed, and so that new power-users can find the brilliant tools they didn't know they wanted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When I sign up for a new website, I immediately go to the settings menu to see: What things I can turn on, and what I might want to turn off (either now, or in the future).</span> {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">When I install a new program, operating system, or game,$1 I immediately look through the Toolbar and the Preferences/Options menu.</span> |1=<ref>[https://www.youtube.com/embed/BVbQF0Ubz48?start=66&end=85&version=3&modestbranding=1 - "So let's start with the options"] - Bayonetta review (Youtube)</ref> }} <span lang="en" dir="ltr" class="mw-content-ltr">They tell me a lot about the software, e.g.:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Technical vocabulary (concepts, keywords, and groupings),</span> * <span lang="en" dir="ltr" class="mw-content-ltr">which settings the developers thought were "useful enough to include, but not crucial enough to set as default",</span> * <span lang="en" dir="ltr" class="mw-content-ltr">which options the specialized-power-users might need, that I might want to investigate or use once I become proficient with the basics.</span> ---- {| class="rquote floatright" style="border-collapse:collapse; border-style:none; float:right; margin:0.5em 0.75em; width:33%" |- style="text-align:left; vertical-align:top;" | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; width:0.5em;"| “ | style="padding:0 10px;"| :<span lang="en" dir="ltr" class="mw-content-ltr">One way to make complex systems easy to use is to remove the functionality. But that isn't really solving the problem, is it?</span> | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; text-align:right; vertical-align:bottom; width:0.5em;"| ” |- | class="rquotecite" colspan="3" style="padding-top:10px;"| <p style="font-size:smaller; line-height:1em; text-align:right">&mdash; @MrAlanCooper[https://twitter.com/MrAlanCooper/status/487258306201653249]</p> |} <div lang="en" dir="ltr" class="mw-content-ltr"> This wiki endeavour, requires tools that are as complicated as Photoshop or Autocad, ''for many editors'' but not all. Newcomers often need something simple, as do casual-editors. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> We need something like Photoshop for power-users, as well as something like MS Paint for the newcomers and casual editors. </div> * <span lang="en" dir="ltr" class="mw-content-ltr">MS Paint is great! It's Welcoming, and easy to learn via experimenting, and easy to create simple (sometimes even [https://www.youtube.com/watch?v=MGOLqU8AZpo complex]) projects in!</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Photoshop is great! A dense abundance of menus, and a profusion of tiny and detailed-metadata, for those who need it! For those who spend many hours every day, for many years, working ''hard'' within it.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> We want and need both ends of the spectrum, and a migration path for users to slowly learn about bits of the complexity without being overwhelmed. </div> <span id="Footnotes"></span> == 脚注 == <references /> <div lang="en" dir="ltr" class="mw-content-ltr"> == Further reading == </div> * [https://www.nytimes.com/2022/06/09/technology/phone-new-features.html <span lang="en" dir="ltr" class="mw-content-ltr">"You Won’t Use That Cool Feature. So why do all these settings even exist?"</span>] <span lang="en" dir="ltr" class="mw-content-ltr">at ''The New York Times''</span> *:"''<span lang="en" dir="ltr" class="mw-content-ltr">[…] three culprits behind ever-growing features. […] Second, products with many millions of users must appeal to people with widely different needs. […]</span>''" * [https://archive.uie.com/brainsparks/2011/09/14/do-users-change-their-settings/ <span lang="en" dir="ltr" class="mw-content-ltr">"Less than 5% of the users we surveyed had changed any settings at all."</span>] <span lang="en" dir="ltr" class="mw-content-ltr">Study results from Jared Spool</span> *:"''<span lang="en" dir="ltr" class="mw-content-ltr">[…] We also asked our participants for background information, like age and occupation, to see if that made a difference. It didn’t, except one category of people who almost always changed their settings: programmers and designers. They often had changed more than 40% (and some had changed as much as 80%) of the options in the program. […]</span>''" 9dnhiajvud480tf9urb6l3r26ik6ho3 8364923 8364921 2026-05-04T05:20:31Z ~2026-27097-75 18368095 Created page with "Kit" 8364923 wikitext text/x-wiki <languages/> {{essay}} <span lang="en" dir="ltr" class="mw-content-ltr">We editors often request "Just make it a user preference", and similar. This list/essay aims to summarize some of the complexities of that idea, listing its problems and benefits.</span> __TOC__ <div lang="en" dir="ltr" class="mw-content-ltr"> == Problems== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Every additional user-preference: </div> # Je n ## Kit ## <span lang="en" dir="ltr" class="mw-content-ltr">Increases the long-term code-maintenance task</span> ## <span lang="en" dir="ltr" class="mw-content-ltr">Increases the quantity of variations that ought to be tested, in both automated and manual code checks - each variation adds exponential new combinations</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the complexity of the Special:Preferences tabs for users (hence making everything a bit more difficult to find)</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the UI translation backlog</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the already overwhelming documentation</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds new rows to the user-properties database table, which is already too large ({{phab|T54777}})</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the quantity of things that need to be considered, when contemplating any ''additional'' new features in the same feature-set</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Makes it harder to diagnose bugs</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Must avoid [[Special:MyLanguage/Manual:Cache|cache]] fragmentation</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Hence, developers/designers/managers/etc are very hesitant to just make a new user preference every time [frequently!] that somebody asks for one. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Benefits == </div> <span lang="en" dir="ltr" class="mw-content-ltr">That said, I (and many of us) adore preferences, and I consider Firefox's <code>about:config</code> page to be generally DoingItRight™ as far as power-users are concerned.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">However it really needs some built-in documentation. I previously used [https://web.archive.org/web/20070406020621/http://preferential.mozdev.org/preferences.html an extension] which added helpful annotations about each option to the page, but it stopped being maintained.</span> </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> I've written a bit more about this in a section at [[Talk:Requests for comment/Redesign user preferences#An Ode to Options, A Paean to Preferences|Talk:RfC/Redesign user preferences]], which I'll copy below: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === An Ode to Options, A Paean to Preferences, A Serenade to Settings, A Cry for Configuration === </div> {| class="rquote floatright" style="border-collapse:collapse; border-style:none; float:right; margin:0.5em 0.75em; width:33%" |- style="text-align:left; vertical-align:top;" | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; width:0.5em;"| “ | style="padding:0 10px;"| :<span lang="en" dir="ltr" class="mw-content-ltr">&lt;Alice> Make the first question: "Do you want to use the default settings or customize?"</span> :<span lang="en" dir="ltr" class="mw-content-ltr">&lt;Bob> every nerd worth his or her salt answers "customize"</span> | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; text-align:right; vertical-align:bottom; width:0.5em;"| ” |- | class="rquotecite" colspan="3" style="padding-top:10px;"| <p style="font-size:smaller; line-height:1em; text-align:right">&mdash;<span lang="en" dir="ltr" class="mw-content-ltr">Two staff developers on IRC, discussing improvements to the MediaWiki-software installation process and documentation. ~2014.</span></p> |} <span lang="en" dir="ltr" class="mw-content-ltr">I want to see our Special:Preferences menu become better organized, so that it can '''grow''', with all the tweaks and power-tools that some editors need permanently available – I.e. The things the various overlapping communities have built over the last 20+ years, and continue to create and refine – So that newcomers can find what they're looking for without being overwhelmed, and so that new power-users can find the brilliant tools they didn't know they wanted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When I sign up for a new website, I immediately go to the settings menu to see: What things I can turn on, and what I might want to turn off (either now, or in the future).</span> {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">When I install a new program, operating system, or game,$1 I immediately look through the Toolbar and the Preferences/Options menu.</span> |1=<ref>[https://www.youtube.com/embed/BVbQF0Ubz48?start=66&end=85&version=3&modestbranding=1 - "So let's start with the options"] - Bayonetta review (Youtube)</ref> }} <span lang="en" dir="ltr" class="mw-content-ltr">They tell me a lot about the software, e.g.:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Technical vocabulary (concepts, keywords, and groupings),</span> * <span lang="en" dir="ltr" class="mw-content-ltr">which settings the developers thought were "useful enough to include, but not crucial enough to set as default",</span> * <span lang="en" dir="ltr" class="mw-content-ltr">which options the specialized-power-users might need, that I might want to investigate or use once I become proficient with the basics.</span> ---- {| class="rquote floatright" style="border-collapse:collapse; border-style:none; float:right; margin:0.5em 0.75em; width:33%" |- style="text-align:left; vertical-align:top;" | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; width:0.5em;"| “ | style="padding:0 10px;"| :<span lang="en" dir="ltr" class="mw-content-ltr">One way to make complex systems easy to use is to remove the functionality. But that isn't really solving the problem, is it?</span> | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; text-align:right; vertical-align:bottom; width:0.5em;"| ” |- | class="rquotecite" colspan="3" style="padding-top:10px;"| <p style="font-size:smaller; line-height:1em; text-align:right">&mdash; @MrAlanCooper[https://twitter.com/MrAlanCooper/status/487258306201653249]</p> |} <div lang="en" dir="ltr" class="mw-content-ltr"> This wiki endeavour, requires tools that are as complicated as Photoshop or Autocad, ''for many editors'' but not all. Newcomers often need something simple, as do casual-editors. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> We need something like Photoshop for power-users, as well as something like MS Paint for the newcomers and casual editors. </div> * <span lang="en" dir="ltr" class="mw-content-ltr">MS Paint is great! It's Welcoming, and easy to learn via experimenting, and easy to create simple (sometimes even [https://www.youtube.com/watch?v=MGOLqU8AZpo complex]) projects in!</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Photoshop is great! A dense abundance of menus, and a profusion of tiny and detailed-metadata, for those who need it! For those who spend many hours every day, for many years, working ''hard'' within it.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> We want and need both ends of the spectrum, and a migration path for users to slowly learn about bits of the complexity without being overwhelmed. </div> <span id="Footnotes"></span> == 脚注 == <references /> <div lang="en" dir="ltr" class="mw-content-ltr"> == Further reading == </div> * [https://www.nytimes.com/2022/06/09/technology/phone-new-features.html <span lang="en" dir="ltr" class="mw-content-ltr">"You Won’t Use That Cool Feature. So why do all these settings even exist?"</span>] <span lang="en" dir="ltr" class="mw-content-ltr">at ''The New York Times''</span> *:"''<span lang="en" dir="ltr" class="mw-content-ltr">[…] three culprits behind ever-growing features. […] Second, products with many millions of users must appeal to people with widely different needs. […]</span>''" * [https://archive.uie.com/brainsparks/2011/09/14/do-users-change-their-settings/ <span lang="en" dir="ltr" class="mw-content-ltr">"Less than 5% of the users we surveyed had changed any settings at all."</span>] <span lang="en" dir="ltr" class="mw-content-ltr">Study results from Jared Spool</span> *:"''<span lang="en" dir="ltr" class="mw-content-ltr">[…] We also asked our participants for background information, like age and occupation, to see if that made a difference. It didn’t, except one category of people who almost always changed their settings: programmers and designers. They often had changed more than 40% (and some had changed as much as 80%) of the options in the program. […]</span>''" g9wlswvsqp24jwd8t7wlrth5vm9bh49 8364925 8364923 2026-05-04T05:20:44Z ~2026-27097-75 18368095 Jktlglhjg’g’f’gktt’g’thhgntjttttnt 8364925 wikitext text/x-wiki <languages/> {{essay}} <span lang="en" dir="ltr" class="mw-content-ltr">We editors often request "Just make it a user preference", and similar. This list/essay aims to summarize some of the complexities of that idea, listing its problems and benefits.</span> __TOC__ <div lang="en" dir="ltr" class="mw-content-ltr"> == Problems== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Every additional user-preference: </div> # Je n ## Kit ## <span lang="en" dir="ltr" class="mw-content-ltr">Increases the long-term code-maintenance task</span> ## KO g’nyn # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the complexity of the Special:Preferences tabs for users (hence making everything a bit more difficult to find)</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the UI translation backlog</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the already overwhelming documentation</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds new rows to the user-properties database table, which is already too large ({{phab|T54777}})</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the quantity of things that need to be considered, when contemplating any ''additional'' new features in the same feature-set</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Makes it harder to diagnose bugs</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Must avoid [[Special:MyLanguage/Manual:Cache|cache]] fragmentation</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Hence, developers/designers/managers/etc are very hesitant to just make a new user preference every time [frequently!] that somebody asks for one. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Benefits == </div> <span lang="en" dir="ltr" class="mw-content-ltr">That said, I (and many of us) adore preferences, and I consider Firefox's <code>about:config</code> page to be generally DoingItRight™ as far as power-users are concerned.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">However it really needs some built-in documentation. I previously used [https://web.archive.org/web/20070406020621/http://preferential.mozdev.org/preferences.html an extension] which added helpful annotations about each option to the page, but it stopped being maintained.</span> </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> I've written a bit more about this in a section at [[Talk:Requests for comment/Redesign user preferences#An Ode to Options, A Paean to Preferences|Talk:RfC/Redesign user preferences]], which I'll copy below: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === An Ode to Options, A Paean to Preferences, A Serenade to Settings, A Cry for Configuration === </div> {| class="rquote floatright" style="border-collapse:collapse; border-style:none; float:right; margin:0.5em 0.75em; width:33%" |- style="text-align:left; vertical-align:top;" | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; width:0.5em;"| “ | style="padding:0 10px;"| :<span lang="en" dir="ltr" class="mw-content-ltr">&lt;Alice> Make the first question: "Do you want to use the default settings or customize?"</span> :<span lang="en" dir="ltr" class="mw-content-ltr">&lt;Bob> every nerd worth his or her salt answers "customize"</span> | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; text-align:right; vertical-align:bottom; width:0.5em;"| ” |- | class="rquotecite" colspan="3" style="padding-top:10px;"| <p style="font-size:smaller; line-height:1em; text-align:right">&mdash;<span lang="en" dir="ltr" class="mw-content-ltr">Two staff developers on IRC, discussing improvements to the MediaWiki-software installation process and documentation. ~2014.</span></p> |} <span lang="en" dir="ltr" class="mw-content-ltr">I want to see our Special:Preferences menu become better organized, so that it can '''grow''', with all the tweaks and power-tools that some editors need permanently available – I.e. The things the various overlapping communities have built over the last 20+ years, and continue to create and refine – So that newcomers can find what they're looking for without being overwhelmed, and so that new power-users can find the brilliant tools they didn't know they wanted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When I sign up for a new website, I immediately go to the settings menu to see: What things I can turn on, and what I might want to turn off (either now, or in the future).</span> {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">When I install a new program, operating system, or game,$1 I immediately look through the Toolbar and the Preferences/Options menu.</span> |1=<ref>[https://www.youtube.com/embed/BVbQF0Ubz48?start=66&end=85&version=3&modestbranding=1 - "So let's start with the options"] - Bayonetta review (Youtube)</ref> }} <span lang="en" dir="ltr" class="mw-content-ltr">They tell me a lot about the software, e.g.:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Technical vocabulary (concepts, keywords, and groupings),</span> * <span lang="en" dir="ltr" class="mw-content-ltr">which settings the developers thought were "useful enough to include, but not crucial enough to set as default",</span> * <span lang="en" dir="ltr" class="mw-content-ltr">which options the specialized-power-users might need, that I might want to investigate or use once I become proficient with the basics.</span> ---- {| class="rquote floatright" style="border-collapse:collapse; border-style:none; float:right; margin:0.5em 0.75em; width:33%" |- style="text-align:left; vertical-align:top;" | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; width:0.5em;"| “ | style="padding:0 10px;"| :<span lang="en" dir="ltr" class="mw-content-ltr">One way to make complex systems easy to use is to remove the functionality. But that isn't really solving the problem, is it?</span> | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; text-align:right; vertical-align:bottom; width:0.5em;"| ” |- | class="rquotecite" colspan="3" style="padding-top:10px;"| <p style="font-size:smaller; line-height:1em; text-align:right">&mdash; @MrAlanCooper[https://twitter.com/MrAlanCooper/status/487258306201653249]</p> |} <div lang="en" dir="ltr" class="mw-content-ltr"> This wiki endeavour, requires tools that are as complicated as Photoshop or Autocad, ''for many editors'' but not all. Newcomers often need something simple, as do casual-editors. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> We need something like Photoshop for power-users, as well as something like MS Paint for the newcomers and casual editors. </div> * <span lang="en" dir="ltr" class="mw-content-ltr">MS Paint is great! It's Welcoming, and easy to learn via experimenting, and easy to create simple (sometimes even [https://www.youtube.com/watch?v=MGOLqU8AZpo complex]) projects in!</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Photoshop is great! A dense abundance of menus, and a profusion of tiny and detailed-metadata, for those who need it! For those who spend many hours every day, for many years, working ''hard'' within it.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> We want and need both ends of the spectrum, and a migration path for users to slowly learn about bits of the complexity without being overwhelmed. </div> <span id="Footnotes"></span> == 脚注 == <references /> <div lang="en" dir="ltr" class="mw-content-ltr"> == Further reading == </div> * [https://www.nytimes.com/2022/06/09/technology/phone-new-features.html <span lang="en" dir="ltr" class="mw-content-ltr">"You Won’t Use That Cool Feature. So why do all these settings even exist?"</span>] <span lang="en" dir="ltr" class="mw-content-ltr">at ''The New York Times''</span> *:"''<span lang="en" dir="ltr" class="mw-content-ltr">[…] three culprits behind ever-growing features. […] Second, products with many millions of users must appeal to people with widely different needs. […]</span>''" * [https://archive.uie.com/brainsparks/2011/09/14/do-users-change-their-settings/ <span lang="en" dir="ltr" class="mw-content-ltr">"Less than 5% of the users we surveyed had changed any settings at all."</span>] <span lang="en" dir="ltr" class="mw-content-ltr">Study results from Jared Spool</span> *:"''<span lang="en" dir="ltr" class="mw-content-ltr">[…] We also asked our participants for background information, like age and occupation, to see if that made a difference. It didn’t, except one category of people who almost always changed their settings: programmers and designers. They often had changed more than 40% (and some had changed as much as 80%) of the options in the program. […]</span>''" mma6gb66n2mze7klxwyybgbzwcsfjci 8365124 8364925 2026-05-04T10:53:15Z Clump 81610 Not a translation: Mass deletion of pages added by [[Special:Contributions/~2026-27097-75|~2026-27097-75]] 8365124 wikitext text/x-wiki <languages/> {{essay}} <span lang="en" dir="ltr" class="mw-content-ltr">We editors often request "Just make it a user preference", and similar. This list/essay aims to summarize some of the complexities of that idea, listing its problems and benefits.</span> __TOC__ <div lang="en" dir="ltr" class="mw-content-ltr"> == Problems== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Every additional user-preference: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the complexity of the [core/extension] code,</span> ## <span lang="en" dir="ltr" class="mw-content-ltr">Increases the likelihood of bugs (either now or in the future)</span> ## <span lang="en" dir="ltr" class="mw-content-ltr">Increases the long-term code-maintenance task</span> ## KO g’nyn # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the complexity of the Special:Preferences tabs for users (hence making everything a bit more difficult to find)</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the UI translation backlog</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the already overwhelming documentation</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds new rows to the user-properties database table, which is already too large ({{phab|T54777}})</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the quantity of things that need to be considered, when contemplating any ''additional'' new features in the same feature-set</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Makes it harder to diagnose bugs</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Must avoid [[Special:MyLanguage/Manual:Cache|cache]] fragmentation</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Hence, developers/designers/managers/etc are very hesitant to just make a new user preference every time [frequently!] that somebody asks for one. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Benefits == </div> <span lang="en" dir="ltr" class="mw-content-ltr">That said, I (and many of us) adore preferences, and I consider Firefox's <code>about:config</code> page to be generally DoingItRight™ as far as power-users are concerned.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">However it really needs some built-in documentation. I previously used [https://web.archive.org/web/20070406020621/http://preferential.mozdev.org/preferences.html an extension] which added helpful annotations about each option to the page, but it stopped being maintained.</span> </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> I've written a bit more about this in a section at [[Talk:Requests for comment/Redesign user preferences#An Ode to Options, A Paean to Preferences|Talk:RfC/Redesign user preferences]], which I'll copy below: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === An Ode to Options, A Paean to Preferences, A Serenade to Settings, A Cry for Configuration === </div> {| class="rquote floatright" style="border-collapse:collapse; border-style:none; float:right; margin:0.5em 0.75em; width:33%" |- style="text-align:left; vertical-align:top;" | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; width:0.5em;"| “ | style="padding:0 10px;"| :<span lang="en" dir="ltr" class="mw-content-ltr">&lt;Alice> Make the first question: "Do you want to use the default settings or customize?"</span> :<span lang="en" dir="ltr" class="mw-content-ltr">&lt;Bob> every nerd worth his or her salt answers "customize"</span> | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; text-align:right; vertical-align:bottom; width:0.5em;"| ” |- | class="rquotecite" colspan="3" style="padding-top:10px;"| <p style="font-size:smaller; line-height:1em; text-align:right">&mdash;<span lang="en" dir="ltr" class="mw-content-ltr">Two staff developers on IRC, discussing improvements to the MediaWiki-software installation process and documentation. ~2014.</span></p> |} <span lang="en" dir="ltr" class="mw-content-ltr">I want to see our Special:Preferences menu become better organized, so that it can '''grow''', with all the tweaks and power-tools that some editors need permanently available – I.e. The things the various overlapping communities have built over the last 20+ years, and continue to create and refine – So that newcomers can find what they're looking for without being overwhelmed, and so that new power-users can find the brilliant tools they didn't know they wanted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When I sign up for a new website, I immediately go to the settings menu to see: What things I can turn on, and what I might want to turn off (either now, or in the future).</span> {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">When I install a new program, operating system, or game,$1 I immediately look through the Toolbar and the Preferences/Options menu.</span> |1=<ref>[https://www.youtube.com/embed/BVbQF0Ubz48?start=66&end=85&version=3&modestbranding=1 - "So let's start with the options"] - Bayonetta review (Youtube)</ref> }} <span lang="en" dir="ltr" class="mw-content-ltr">They tell me a lot about the software, e.g.:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Technical vocabulary (concepts, keywords, and groupings),</span> * <span lang="en" dir="ltr" class="mw-content-ltr">which settings the developers thought were "useful enough to include, but not crucial enough to set as default",</span> * <span lang="en" dir="ltr" class="mw-content-ltr">which options the specialized-power-users might need, that I might want to investigate or use once I become proficient with the basics.</span> ---- {| class="rquote floatright" style="border-collapse:collapse; border-style:none; float:right; margin:0.5em 0.75em; width:33%" |- style="text-align:left; vertical-align:top;" | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; width:0.5em;"| “ | style="padding:0 10px;"| :<span lang="en" dir="ltr" class="mw-content-ltr">One way to make complex systems easy to use is to remove the functionality. But that isn't really solving the problem, is it?</span> | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; text-align:right; vertical-align:bottom; width:0.5em;"| ” |- | class="rquotecite" colspan="3" style="padding-top:10px;"| <p style="font-size:smaller; line-height:1em; text-align:right">&mdash; @MrAlanCooper[https://twitter.com/MrAlanCooper/status/487258306201653249]</p> |} <div lang="en" dir="ltr" class="mw-content-ltr"> This wiki endeavour, requires tools that are as complicated as Photoshop or Autocad, ''for many editors'' but not all. Newcomers often need something simple, as do casual-editors. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> We need something like Photoshop for power-users, as well as something like MS Paint for the newcomers and casual editors. </div> * <span lang="en" dir="ltr" class="mw-content-ltr">MS Paint is great! It's Welcoming, and easy to learn via experimenting, and easy to create simple (sometimes even [https://www.youtube.com/watch?v=MGOLqU8AZpo complex]) projects in!</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Photoshop is great! A dense abundance of menus, and a profusion of tiny and detailed-metadata, for those who need it! For those who spend many hours every day, for many years, working ''hard'' within it.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> We want and need both ends of the spectrum, and a migration path for users to slowly learn about bits of the complexity without being overwhelmed. </div> <span id="Footnotes"></span> == 脚注 == <references /> <div lang="en" dir="ltr" class="mw-content-ltr"> == Further reading == </div> * [https://www.nytimes.com/2022/06/09/technology/phone-new-features.html <span lang="en" dir="ltr" class="mw-content-ltr">"You Won’t Use That Cool Feature. So why do all these settings even exist?"</span>] <span lang="en" dir="ltr" class="mw-content-ltr">at ''The New York Times''</span> *:"''<span lang="en" dir="ltr" class="mw-content-ltr">[…] three culprits behind ever-growing features. […] Second, products with many millions of users must appeal to people with widely different needs. […]</span>''" * [https://archive.uie.com/brainsparks/2011/09/14/do-users-change-their-settings/ <span lang="en" dir="ltr" class="mw-content-ltr">"Less than 5% of the users we surveyed had changed any settings at all."</span>] <span lang="en" dir="ltr" class="mw-content-ltr">Study results from Jared Spool</span> *:"''<span lang="en" dir="ltr" class="mw-content-ltr">[…] We also asked our participants for background information, like age and occupation, to see if that made a difference. It didn’t, except one category of people who almost always changed their settings: programmers and designers. They often had changed more than 40% (and some had changed as much as 80%) of the options in the program. […]</span>''" skha4j1oboivozfbfpeenqeyyur2qcm 8365125 8365124 2026-05-04T10:53:15Z Clump 81610 Not a translation: Mass deletion of pages added by [[Special:Contributions/~2026-27097-75|~2026-27097-75]] 8365125 wikitext text/x-wiki <languages/> {{essay}} <span lang="en" dir="ltr" class="mw-content-ltr">We editors often request "Just make it a user preference", and similar. This list/essay aims to summarize some of the complexities of that idea, listing its problems and benefits.</span> __TOC__ <div lang="en" dir="ltr" class="mw-content-ltr"> == Problems== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Every additional user-preference: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the complexity of the [core/extension] code,</span> ## <span lang="en" dir="ltr" class="mw-content-ltr">Increases the likelihood of bugs (either now or in the future)</span> ## <span lang="en" dir="ltr" class="mw-content-ltr">Increases the long-term code-maintenance task</span> ## <span lang="en" dir="ltr" class="mw-content-ltr">Increases the quantity of variations that ought to be tested, in both automated and manual code checks - each variation adds exponential new combinations</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the complexity of the Special:Preferences tabs for users (hence making everything a bit more difficult to find)</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the UI translation backlog</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the already overwhelming documentation</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds new rows to the user-properties database table, which is already too large ({{phab|T54777}})</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Adds to the quantity of things that need to be considered, when contemplating any ''additional'' new features in the same feature-set</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Makes it harder to diagnose bugs</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Must avoid [[Special:MyLanguage/Manual:Cache|cache]] fragmentation</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Hence, developers/designers/managers/etc are very hesitant to just make a new user preference every time [frequently!] that somebody asks for one. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Benefits == </div> <span lang="en" dir="ltr" class="mw-content-ltr">That said, I (and many of us) adore preferences, and I consider Firefox's <code>about:config</code> page to be generally DoingItRight™ as far as power-users are concerned.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">However it really needs some built-in documentation. I previously used [https://web.archive.org/web/20070406020621/http://preferential.mozdev.org/preferences.html an extension] which added helpful annotations about each option to the page, but it stopped being maintained.</span> </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> I've written a bit more about this in a section at [[Talk:Requests for comment/Redesign user preferences#An Ode to Options, A Paean to Preferences|Talk:RfC/Redesign user preferences]], which I'll copy below: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === An Ode to Options, A Paean to Preferences, A Serenade to Settings, A Cry for Configuration === </div> {| class="rquote floatright" style="border-collapse:collapse; border-style:none; float:right; margin:0.5em 0.75em; width:33%" |- style="text-align:left; vertical-align:top;" | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; width:0.5em;"| “ | style="padding:0 10px;"| :<span lang="en" dir="ltr" class="mw-content-ltr">&lt;Alice> Make the first question: "Do you want to use the default settings or customize?"</span> :<span lang="en" dir="ltr" class="mw-content-ltr">&lt;Bob> every nerd worth his or her salt answers "customize"</span> | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; text-align:right; vertical-align:bottom; width:0.5em;"| ” |- | class="rquotecite" colspan="3" style="padding-top:10px;"| <p style="font-size:smaller; line-height:1em; text-align:right">&mdash;<span lang="en" dir="ltr" class="mw-content-ltr">Two staff developers on IRC, discussing improvements to the MediaWiki-software installation process and documentation. ~2014.</span></p> |} <span lang="en" dir="ltr" class="mw-content-ltr">I want to see our Special:Preferences menu become better organized, so that it can '''grow''', with all the tweaks and power-tools that some editors need permanently available – I.e. The things the various overlapping communities have built over the last 20+ years, and continue to create and refine – So that newcomers can find what they're looking for without being overwhelmed, and so that new power-users can find the brilliant tools they didn't know they wanted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When I sign up for a new website, I immediately go to the settings menu to see: What things I can turn on, and what I might want to turn off (either now, or in the future).</span> {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">When I install a new program, operating system, or game,$1 I immediately look through the Toolbar and the Preferences/Options menu.</span> |1=<ref>[https://www.youtube.com/embed/BVbQF0Ubz48?start=66&end=85&version=3&modestbranding=1 - "So let's start with the options"] - Bayonetta review (Youtube)</ref> }} <span lang="en" dir="ltr" class="mw-content-ltr">They tell me a lot about the software, e.g.:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Technical vocabulary (concepts, keywords, and groupings),</span> * <span lang="en" dir="ltr" class="mw-content-ltr">which settings the developers thought were "useful enough to include, but not crucial enough to set as default",</span> * <span lang="en" dir="ltr" class="mw-content-ltr">which options the specialized-power-users might need, that I might want to investigate or use once I become proficient with the basics.</span> ---- {| class="rquote floatright" style="border-collapse:collapse; border-style:none; float:right; margin:0.5em 0.75em; width:33%" |- style="text-align:left; vertical-align:top;" | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; width:0.5em;"| “ | style="padding:0 10px;"| :<span lang="en" dir="ltr" class="mw-content-ltr">One way to make complex systems easy to use is to remove the functionality. But that isn't really solving the problem, is it?</span> | style="color:#b2b7f2; font-size:2em; font-family:'Times New Roman',serif; font-weight:bold; padding:4px 2px 2px; text-align:right; vertical-align:bottom; width:0.5em;"| ” |- | class="rquotecite" colspan="3" style="padding-top:10px;"| <p style="font-size:smaller; line-height:1em; text-align:right">&mdash; @MrAlanCooper[https://twitter.com/MrAlanCooper/status/487258306201653249]</p> |} <div lang="en" dir="ltr" class="mw-content-ltr"> This wiki endeavour, requires tools that are as complicated as Photoshop or Autocad, ''for many editors'' but not all. Newcomers often need something simple, as do casual-editors. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> We need something like Photoshop for power-users, as well as something like MS Paint for the newcomers and casual editors. </div> * <span lang="en" dir="ltr" class="mw-content-ltr">MS Paint is great! It's Welcoming, and easy to learn via experimenting, and easy to create simple (sometimes even [https://www.youtube.com/watch?v=MGOLqU8AZpo complex]) projects in!</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Photoshop is great! A dense abundance of menus, and a profusion of tiny and detailed-metadata, for those who need it! For those who spend many hours every day, for many years, working ''hard'' within it.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> We want and need both ends of the spectrum, and a migration path for users to slowly learn about bits of the complexity without being overwhelmed. </div> <span id="Footnotes"></span> == 脚注 == <references /> <div lang="en" dir="ltr" class="mw-content-ltr"> == Further reading == </div> * [https://www.nytimes.com/2022/06/09/technology/phone-new-features.html <span lang="en" dir="ltr" class="mw-content-ltr">"You Won’t Use That Cool Feature. So why do all these settings even exist?"</span>] <span lang="en" dir="ltr" class="mw-content-ltr">at ''The New York Times''</span> *:"''<span lang="en" dir="ltr" class="mw-content-ltr">[…] three culprits behind ever-growing features. […] Second, products with many millions of users must appeal to people with widely different needs. […]</span>''" * [https://archive.uie.com/brainsparks/2011/09/14/do-users-change-their-settings/ <span lang="en" dir="ltr" class="mw-content-ltr">"Less than 5% of the users we surveyed had changed any settings at all."</span>] <span lang="en" dir="ltr" class="mw-content-ltr">Study results from Jared Spool</span> *:"''<span lang="en" dir="ltr" class="mw-content-ltr">[…] We also asked our participants for background information, like age and occupation, to see if that made a difference. It didn’t, except one category of people who almost always changed their settings: programmers and designers. They often had changed more than 40% (and some had changed as much as 80%) of the options in the program. […]</span>''" 57nfnxltbo5ftw52kid97gsq52udren Translations:Extension:TimedMediaHandler/VideoJS Player/47/en 1198 1504121 8364765 5070929 2026-05-03T23:14:35Z FuzzyBot 451990 Importing a new version from external source 8364765 wikitext text/x-wiki The player is fully keyboard accessible using {{$1|Tab}}, {{$1|Enter}} and {{$1|Space}} keys qbtl59k0taylu6ih9ol900qcokf1ws5 OAuth/For Developers/cs 0 1506469 8364287 8360844 2026-05-03T12:27:44Z FuzzyBot 451990 Updating to match new version of source page 8364287 wikitext text/x-wiki <languages /> Tato stránka vysvětluje, jak vyvíjet aplikace, které mohou integrovat wiki s {{ll|Extension:OAuth}} (rozšíření, které změní MediaWiki na [[w:cs:OAuth|OAuth]] server) k bezpečnému vyžádání povolení ke konání na jméno uživatele. {{Note|1=Pokud vyvíjíte robota nebo podobnou aplikaci, která vždy používá stejný účet, můžete dát přednost jednodušším [[Special:MyLanguage/OAuth/Owner-only_consumers|uživatelům pouze pro vlastníky]].}} <span id="OAuth_in_a_nutshell"></span> == OAuth ve zkratce == OAuth umožňuje aplikaci požádat uživatele o povolení k akci prostřednictvím jeho wiki účtu, aniž by znala heslo uživatele a aniž by mohla dělat vše, co by uživatel mohl (např. aplikace by mohla upravovat články, ale ne je mazat, takže i uživatelé s rozšířenými oprávněními mohou bezpečně používat nástroje s povoleným OAuth). To se děje prostřednictvím protokolu [https://oauth.net/2/ OAuth 2.0] nebo [https://oauth.net/core/1.0a/ OAuth 1.0a] a skládá se ze tří fází: # Vývojář musí aplikaci (v terminologii OAuth často nazývanou "spotřebitel") zaregistrovat na wiki, případně projít nějakým procesem kontroly a obdržet nějaké přihlašovací údaje. # Když ji chce uživatel použít, aplikace musí zahájit proces autorizace. To bude zahrnovat odeslání uživatele na speciální stránku na wiki, která zobrazí autorizační dialog. Pokud uživatel žádost přijme, aplikace obdrží další sadu přihlašovacích údajů (které jsou specifické pro daného uživatele a uživatel je může kdykoli odvolat). # Když aplikace skutečně potřebuje provést akci (požadavek API) jménem uživatele, může zkombinovat přihlašovací údaje přijaté v krocích 1 a 2 k podepsání požadavku. OAuth je široce používaný otevřený standard (můžete se s ním setkat na stránkách jako Google, Facebook nebo GitHub, např. při použití účtů na těchto stránkách k přihlášení jinde). {{info|1=OAuth by se neměl zaměňovat s: * [[w:Initiative for Open Authentication|OATH]] (rodina protokolů pro dvoufaktorové ověřování, běžně známá jako "zadejte šest čísel, která vidíte v mobilní aplikaci", nyní povolená na stránkách Wikimedie) * [[w:OpenID Connect|OpenID Connect]] (autentizační protokol založený na OAuth 2.0, který rozšíření OAuth MediaWiki částečně podporuje). }} Pro trochu podrobnější informace o OAuth 1.0a viz [https://docs.google.com/presentation/d/1537HnwSaSzH-b8hINcz48SNhT8ElAUPC39to0_O1iNA/edit#slide=id.g15105b408d_0_287 tyto slejdy]. <span id="OAuth_in_detail"></span> == OAuth podrobně == Registrace je v podstatě stejná pro OAuth 1.0a a OAuth 2, rozdíl je pouze v přítomnosti několika polí formuláře. Zbývající části se výrazně liší v závislosti na verzi OAuth. Obecně se doporučuje OAuth 2, pokud je ve vašem prostředí k dispozici. <span id="Registration"></span> === Registrace === Chcete-li zaregistrovat novou aplikaci OAuth, odešlete formulář na adrese <code>[[m:Special:OAuthConsumerRegistration/propose|Special:OAuthConsumerRegistration/propose]]</code>. Snažte se poskytnout dostatek informací o aplikaci, aby se administrátoři a uživatelé mohli rozhodnout, zda je aplikace důvěryhodná. Užitečné mohou být URL adresy míst s více informacemi (například samotná aplikace, zdrojový kód nebo dokumentace na wiki). Pro použití aplikací OAuth v projektech Wikimedie viz [[meta:Special:MyLanguage/OAuth app guidelines|pokyny pro aplikace]]. Kromě popisných mají pole následující význam: * <code>This consumer is for use only by {{tag|user|open|plain=1}}</code>: Zda používáte [[Special:MyLanguage/OAuth/Owner-only_consumers|spotřebitele pouze pro vlastníky]] (které není nutné kontrolovat ani autorizovat, ale můžete je použít pouze vy). * <code>callback URL</code> (irelevantní pro spotřebitele pouze s vlastníkem): URL adresa, na kterou se uživatel po autorizaci vrátí, se podle toho kontroluje. (Toto je další vrstva zabezpečení proti útočníkovi, který se během autorizace pokusí ukrást přihlašovací údaje.) Pokud je povolena možnost <code>použít jako prefix</code>, musí URL začínat tímto kódem (kontrola je hloupá, proto se ujistěte, že za název domény přidáte alespoň znak <code>/</code>), jinak se musí jednat o přesnou shodu. Pokud vyvíjíte/testujete svůj lokální počítač, zadejte do tohoto pole [[w:Localhost|Localhost]] (např. <code><nowiki>http://localhost:8080/</nowiki></code>). * <code>Applicable project</code> (pouze pro wiki farmy): Projekt(y), na kterých chcete vaši aplikaci použít. Aplikaci můžete omezit na jednu wiki stránku nebo ji nechat fungovat všude. * <code>Types of grants</code> / <code>Applicable grants</code>: Oprávnění potřebná pro vaši aplikaci (buďte konzervativní). Skutečná oprávnění budou průnikem těchto údajů a oprávnění, která má uživatel. V současné době musí uživatel autorizovat seskupená oprávnění, nikoli individuální ([[Phab:T59505|T59505]]). * <code>Allowed IP ranges</code>: Volitelné zadání rozsahů IP adres, které používáte, kde budou požadavky OAuth, které se tomuto rozsahu neshodují, odmítnuty. Toto je další vrstva zabezpečení proti útočníkovi, který ukradne přihlašovací údaje vaší aplikace a pokusí se ji zosobnit. Toto je jedno z mála nastavení, které budete moci později změnit. * <code>Public RSA key</code> (pouze OAuth 1.0a): Veřejný klíč používaný vaší aplikací k podepisování požadavků. Toto pole můžete nechat prázdné (většina aplikací to dělá) a použít místo toho o něco jednodušší mechanismus sdíleného tajného klíče. Toto je jedno z mála nastavení, které budete moci později změnit. Po registraci obdržíte přihlašovací údaje potřebné k používání OAuth. Budete jej moci používat okamžitě se svým vlastním uživatelským účtem (toto je určeno pro testování). Ostatní jej budou moci používat až po schválení administrátorem. Seznam žádostí (schválených i neschválených) je veřejný a lze si ho prohlédnout na <code>[[m:Special:OAuthListConsumers|Special:OAuthListConsumers]]</code>. === OAuth 1.0a === <span id="Authorisation"></span> ==== Autorizace ==== [[File:OAuth authorization interface.png|thumb|Autorizační dialog zobrazený uživatelům]] Při registraci aplikace obdržíte dva přihlašovací údaje: token aplikace (veřejné ID aplikace) a tajný kód aplikace (něco jako heslo). Abyste mohli identifikovat uživatele nebo zadávat požadavky API jeho jménem, ​​potřebujete další sadu přihlašovacích údajů (ty specifické pro daného uživatele): přístupový token a přístupový tajný klíč.<ref> S klíčem RSA se přihlašovací údaje mírně liší. Předpokládá se, že lidé, kteří se rozhodnou použít klíč RSA, vědí, co dělají, takže tento tutoriál bude předpokládat, že jste zvolili možnost bez RSA. </ref> Abyste je získali, musíte projít autorizačním procesem, který se skládá ze tří kroků:<ref> Tomu se někdy říká tříkrokový OAuth tok. Za určitých okolností je k dispozici i jednodušší, jednokroková alternativa (jednokrokový OAuth). Viz {{ll|OAuth/Owner-only consumers|spotřebitelé pouze pro vlastníky}}. </ref> # Získejte token požadavku z wiki odesláním požadavku GET na adresu <code>Special:OAuth/initiate</code>, podepsaného klíčem aplikace a tajným kódem, s URL adresou zpětného volání (kam bude uživatel odeslán po úspěšné autorizaci) předanou jako parametr dotazu <code>oauth_callback</code> (pokud jste při registraci nastavili konstantní URL, hodnota parametru ''musí'' být <code>oob</code>).<ref name="non-nice-url">Kvůli [[phab:T59500]] musíte aktuálně použít nepěknou URL adresu, například <code>en.wikipedia.org/w/index.php?title=Special:OAuth/initiate</code>.</ref> Pokud budete úspěšní, odpovědí bude objekt JSON s poli <code>token</code> a <code>key</code> – token požadavku a tajný kód požadavku. (Pokud ne, bude tam pole s hodnotou <code>error</code>.) # Požádejte uživatele o autorizaci aplikace odesláním adresy <code>Special:OAuth/authorize</code>, přičemž token aplikace a token požadavku budou předány jako parametry dotazu (<code>oauth_consumer_key</code> a <code>oauth_token</code>, respektive). Uživateli se zobrazí autorizační dialog s některými základními informacemi o žádosti a seznamem grantů a může se rozhodnout, zda žádost autorizuje nebo zruší. # Pokud se uživatel rozhodne pro autorizaci, bude přesměrován na URL adresu zpětného volání, kterou jste zadali (při registraci nebo jako parametr URL v kroku 1). Parametr dotazu s názvem <code>oauth_verifier</code> bude obsahovat ověřovací kód, který můžete použít k výměně tokenu požadavku a tajného klíče za token a tajný klíč přístupu. Chcete-li to provést, odešlete požadavek na adresu <code>Special:OAuth/token</code><ref name="non-nice-url" />, který obsahuje parametr <code>oauth_verifier</code>, který jste právě obdrželi, a je podepsaný tokenem a tajemstvím aplikace a tokenem a tajemstvím požadavku. Odpověď bude obsahovat přístupový token/tajný kód (ve stejném formátu jako token/tajný kód požadavku v kroku 1). Přístupový token a tajný klíč budete potřebovat k podepisování požadavků API. Token požadavku a tajný kód již nejsou užitečné a lze je zahodit. Přístupový token zůstane platný neomezeně dlouho, dokud jej uživatel nezruší. (Pokud si jej nepřejete ukládat, můžete proces autorizace kdykoli zopakovat.) Aplikace, které potřebují pouze minimální oprávnění (byly registrovány jako ''Pouze ověření identity uživatele''), mohou v kroku 2 použít hodnotu <code>/authenticate</code> místo <code>/authorize</code>. Funguje to stejným způsobem, ale uživatel uvidí autorizační dialog pouze v případě, že tuto aplikaci dříve neautorizoval. Jinak autorizace proběhne bez dalšího hlášení. Je pravděpodobné, že jakýkoli jazyk/framework, který používáte, bude mít knihovnu pro podporu tohoto postupu, takže jej nebudete muset implementovat ručně – každý krok bude voláním jediné funkce. Příklady viz níže. <span id="Making_requests_on_the_user&#039;s_behalf"></span> ==== Podávání požadavků jménem uživatele ==== Aby bylo možné využít autorizaci, musí být požadavky podepsány aplikačním tokenem/tajným identifikátorem a přístupovým tokenem/tajným identifikátorem. Po úspěšném dokončení bude wiki s požadavkem zacházet, jako by jej podal autorizující uživatel. Prostřednictvím OAuth lze provádět pouze požadavky API, s jednou výjimkou (viz další část). Některé moduly API, které by nedávaly smysl s OAuth (například přihlášení/odhlášení) nebo by umožňovaly eskalaci oprávnění (například centralauthtoken API), jsou zakázány. Aplikace registrované pouze jako ''Ověření identity uživatele'' nemohou API vůbec používat. <span id="Identifying_the_user"></span> ==== Identifikace uživatele ==== Rozšíření OAuth obsahuje vlastní protokol (podobný OpenID Connect) pro ověřování uživatele. Chcete-li to použít, odešlete podepsaný požadavek OAuth na adresu <code>Special:OAuth/identify</code>:<ref name="non-nice-url" /> Odpovědí bude [[w:JSON Web Token|JWT]] (JSON Web Token – podepsaný objekt JSON) obsahující jméno uživatele, jeho {{ll|Manual:Central ID|centrální ID}} (pod klíčem <code>sub</code>) a různé další informace (například uživatelské skupiny a zda jsou blokováni. Také e-mailovou adresu, pokud byla aplikace registrována se správným typem grantu). Toto je bezpečnější než použití API (např. modulu userinfo) pro ověřování, které by mohlo být vystaveno [[w:Man-in-the-middle attack|útokům typu "člověk uprostřed"]]. Vždy to použijte, pokud potřebujete identifikovat uživatele! Také se ujistěte, že jste správně ověřili JWT (existuje mnoho knihoven, které s tím mohou pomoci). Měli byste zkontrolovat všechny následující položky: vydavatel (<code>iss</code>) odpovídá názvu domény wiki, cílová skupina (<code>aud</code>) odpovídá klíči vaší aplikace, čas vydání (<code>iat</code>) je v minulosti a dostatečně blízko aktuálnímu času, čas vypršení platnosti (<code>exp</code>) je v budoucnosti, nonce (<code>nonce</code>) odpovídá číslu, které jste odeslali v požadavku. <span id="Signing_requests"></span> ==== Žádosti o podpis ==== Kroky 1 a 3 autorizačního procesu vyžadují podepsání požadavku. Požadavky API a <code>Special:OAuth/identify</code> musí být rovněž podepsány. Proces podepisování je podrobně popsán v [https://oauth.net/core/1.0a/#signing_process sekce 9 specifikace OAuth], ale jeho ruční implementace je těžkopádná a k dispozici je [https://oauth.net/1/ mnoho knihoven]. Ukázky kódu a přehled, jak to provést ručně, naleznete v dokumentaci {{ll|OAuth/Owner-only_consumers|spotřebitel pouze pro vlastníky}}. (To je pro podepisování s tokenem/tajným klíčem spotřebitele a tokenem/tajným klíčem přístupu. V případě potřeby upravte podepisování pomocí tokenu/tajného identifikátoru spotřebitele a vyžádání tokenu/tajného identifikátoru (autorizační krok 3) nebo pouze pomocí tokenu/tajného identifikátoru spotřebitele (autorizační krok 1).) === OAuth 2 === <span id="Authorisation"></span> ==== Autorizace ==== Při registraci aplikace obdržíte dva přihlašovací údaje: klíč klientské aplikace (veřejné ID aplikace, nazývané také ID klienta nebo klíč spotřebitele) a tajný klíč klientské aplikace (důvěrné heslo). Abyste mohli identifikovat uživatele nebo zadávat požadavky API jeho jménem, ​​potřebujete další přihlašovací údaje (tentokrát specifické pro daného uživatele): přístupový token. Abyste jej získali, musíte projít postupem [https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/ tok autorizačního kódu OAuth 2], který se skládá ze dvou kroků:<ref>Tomu se někdy říká tříkrokový OAuth tok. Za určitých okolností je k dispozici i jednodušší, jednokroková alternativa (jednokrokový OAuth). Viz [[Special:MyLanguage/OAuth/Owner-only consumers|spotřebitelé pouze pro vlastníky]].</ref> # Požádejte uživatele o autorizaci aplikace odesláním na adresu <code>oauth2/authorize</code> pod REST endpointem wiki (obvykle <code>rest.php</code>), přičemž <code>response_type=code</code> a klíč zákazníka (nazývaný také klíč klientské aplikace) budou <code>client_id</code>, případně <code>state</code>, pokud chcete, a volitelně <code>redirect_uri</code> (pokud ano, musí být stejný jako v požadavku vaší aplikace). Pokud váš zákazník není důvěrný, budete muset zahrnout také [https://www.oauth.com/oauth2-servers/pkce/authorization-request/ výzvu ke kódu PKCE] (<code>code_challenge</code> a <code>code_challenge_method=S256</code>).<ref>PKCE &mdash; Proof Key for Code Exchange</ref> Uživateli se zobrazí autorizační dialog s některými základními informacemi o žádosti a seznamem grantů a může se rozhodnout, zda žádost autorizuje nebo zruší. # Pokud se uživatel rozhodne pro autorizaci, bude přesměrován na URL adresu zpětného volání, kterou jste zadali (při registraci nebo jako parametr URL v kroku 1). Parametr dotazu s názvem <code>code</code> bude obsahovat autorizační kód, který můžete použít k načtení přístupového tokenu. Chcete-li to provést, odešlete POST požadavek na <code>oauth2/access_token</code> pod REST endpointem wiki (obvykle <code>rest.php</code>), včetně <code>grant_type=authorization_code</code>, parametru <code>code</code>, který jste právě obdrželi, ověření klienta (obvykle <code>client_id</code> a pro důvěrné klienty <code>client_secret</code>), <code>redirect_uri</code> pouze tehdy, pokud jste jej zadali v předchozím kroku (musí mít stejnou hodnotu pro oba), a pokud se nejedná o důvěrný parametr, PKCE <code>code_verifier</code> a <code>code_challenge_method</code>. Odpověď bude obsahovat přístupový token a token pro obnovení. Přístupový token budete potřebovat k odesílání budoucích požadavků API. Token obnovení lze použít k [https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/ načtení nového přístupového tokenu], pokud platnost původního přístupového tokenu vyprší. Pokud si nepřejete ukládat žádný z tokenů, můžete proces autorizace kdykoli zopakovat. (Před verzí MediaWiki 1.46 mohli nedůvěrní klienti používat obnovovací tokeny pouze pomocí tajných klíčů klientů, nikoli pouze pomocí svých klientských ID, viz [[phabricator:T323855|T323855]].) Je pravděpodobné, že jakýkoli jazyk/framework, který používáte, bude mít knihovnu pro podporu tohoto postupu, takže jej nebudete muset implementovat ručně - každý krok bude voláním jediné funkce. Příklady viz níže. <span id="Making_requests_on_the_user&#039;s_behalf"></span> ==== Podávání požadavků jménem uživatele ==== Aby bylo možné využít autorizaci, musí požadavky obsahovat přístupový token. Po úspěšném dokončení bude wiki s požadavkem zacházet, jako by jej podal autorizující uživatel. Prostřednictvím OAuth 2 lze provádět pouze požadavky API. Některé moduly API, které by nedávaly smysl s OAuth (například přihlášení/odhlášení) nebo by umožňovaly eskalaci oprávnění (například centralauthtoken API), jsou zakázány. Pokud se přístupový token používá k načtení tokenu CSRF nebo jiných tokenů, musí být přístupový token stále předán (jako hlavička) s požadavky, které tyto tokeny používají. Aplikace, které vyžadují minimální oprávnění (byly registrovány jako ''Pouze ověření identity uživatele''), nemohou API vůbec používat. Požadavky API včetně <code>rest.php/oauth2/resource/profile</code> musí být ověřeny pomocí autorizační hlavičky HTTP obsahující přístupový token, například <pre> Authorization: Bearer abcde....6789 </pre> <span id="Identifying_the_user"></span> ==== Identifikace uživatele ==== Rozšíření OAuth obsahuje poněkud neúplnou implementaci OpenID Connect pro ověřování uživatele.<ref>Další podrobnosti najdete na stránce [[phab:T254063|T254063]].</ref> Chcete-li to použít, odešlete ověřený požadavek OAuth GET na API <code>oauth2/resource/profile</code> (implementace MediaWiki toho, co specifikace OIDC nazývá UserInfo enpoint) pod REST endpointem wiki (obvykle <code>rest.php</code>). Odpověď bude obsahovat jméno uživatele a různé další informace. V požadavku GET musí být použita hlavička HTTP <code>Authorization</code>, nikoli token řetězce dotazu. * '''sub''' (centrální ID uživatele) * '''username''' * '''editcount''' * '''confirmed_email''' * '''blocked''' * '''registered''' * '''groups''' * '''rights''' * '''realname''' (pouze pokud uživatel udělil oprávnění) * '''email''' (pouze pokud uživatel udělil oprávnění) <span id="Setting_up_a_development_environment"></span> == Nastavení vývojového prostředí == Můžete si zaregistrovat OAuth aplikaci na [https://meta.wikimedia.beta.wmflabs.org/wiki/Special:OAuthConsumerRegistration/propose beta meta] a otestovat svůj kód na ní. Pokud chcete vylepšit samotné rozšíření nebo detailně ladit problémy s protokolem, je OAuth k dispozici ve vývojovém prostředí {{ll|MediaWiki-Vagrant}}. Přidejte roli <code>oauth</code> a vaše lokální wiki bude moci autorizovat aplikace OAuth. <syntaxhighlight lang="shell-session"> $ vagrant roles enable oauth $ vagrant provision </syntaxhighlight> Jakmile je kód téměř hotový, můžete zaregistrovat OAuth aplikaci na skutečné wiki. Budete si to moci otestovat se stejným uživatelským účtem, který jste použili k registraci, a to ještě předtím, než to zkontrolují administrátoři. Pokud vytváříte aplikaci pro projekty Wikimedie, zvažte její hostování na [[Wikitech:Portal:Toolforge|Wikimedia Toolforge]], což je bezplatná platforma pro tvorbu nástrojů a hostování služeb souvisejících s Wikimedií. <span id="Security_benefits_and_trade-offs"></span> == Bezpečnostní výhody a nevýhody == * Na rozdíl od ověřování založeného na hesle zabraňuje protokol OAuth 1.0 jakémukoli [[w:Man-in-the-middle attack|útok typu "man-in-the-middle"]], i když wiki nevyžaduje HTTPS: Všechny interakce mezi MediaWiki a aplikací jsou podepsány buď sdíleným tajným klíčem (pomocí HMAC-SHA1), nebo [[w:Public-key cryptography|veřejným klíčem]] (RSA). HTTPS je však pro určité kroky stále vyžadován (pro získání sdíleného tajného klíče ve druhém kroku autorizace, když se nepoužívá RSA, a během registrace aplikace). OAuth 2.0 nezahrnuje podepisování a pro zabezpečení se spoléhá na HTTPS. * Akce přes OAuth probíhají pod jménem uživatele, ale budou označeny také názvem aplikace, aby bylo možné identifikovat podvodné aplikace. Správci wiki mohou v případě potřeby odebrat oprávnění aplikace (a tím jí zakázat jakoukoli další akci). * Uživatel může aplikaci odvolat oprávnění k používání daného uživatelského účtu, pokud se mu nelíbí, jak aplikace funguje, nebo pokud jí již nedůvěřuje. Na rozdíl od změny hesla to pro uživatele neruší. * Dostatečně flexibilní aplikace by mohly uživatelům umožnit obejít blokování IP adres (protože MediaWiki uvidí IP adresu aplikačního serveru, nikoli uživatele). Toto lze řešit stejným způsobem jako proxy, tedy důvěřováním hlavičkám XFF nastaveným aplikací (viz [[Phab:T159889|T159889]] pro některá omezení). * Tajemství aplikace musí zůstat tajné. Odeslání do správy zdrojového kódu nebo jeho vložení do uživatelsky přístupného kódu (například mobilní aplikace nebo desktopové aplikace. I když je obfuskovaný) podkopává bezpečnostní model a povede k tomu, že administrátoři aplikaci násilně deaktivují. Výjimky jsou například pro aplikace demonstrující použití OAuth, pokud jsou jako takové explicitně označeny a požadují omezená práva. <span id="Libraries"></span> == Knihovny == === PHP === * [[oauthclient-php]] – klientská knihovna OAuth 1.0a spravovaná Wikimedií * [https://php.net/book.oauth OAuth] – klientská knihovna PECL * [https://github.com/firebase/php-jwt firebase/php-jwt] – populární knihovna JWT * [https://sr.ht/~taavi/laravel-socialite-mediawiki/ laravel-socialite-mediawiki] – ovladač MediaWiki pro [[:en:Laravel|Laravel]] knihovnu [https://laravel.com/docs/7.x/socialite Socialite]. === Python === * [https://github.com/valhallasw/flask-mwoauth flask-mwoauth] – plán Flasku pro spuštění OAuth s rozšířením MediaWiki:OAuth (viz tutoriál: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Flask_OAuth_tool Můj první nástroj Flask OAuth]) * [https://github.com/wikimedia/MediaWiki-OAuth MediaWiki-OAuth (mwoauth)] – OAuth 1.0a nad [http://requests-oauthlib.readthedocs.org/en/latest/oauth1_workflow.html požadavky oauthlib] * [https://github.com/python-social-auth/social-core python-social-auth] – autentizační framework, který zahrnuje [https://github.com/python-social-auth/social-core/blob/master/social_core/backends/mediawiki.py MediaWiki backend] (Příklad tutoriálu: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Django_OAuth_tool Můj první nástroj Django OAuth]) * [https://docs.authlib.org/en/latest/index.html authlib] – autorizační framework pro interakci s Wikimedia OAuth 2.0 API (plná minimální verze Django OAuth 2.0 [příklad https://code.basabuuka.org/alpcentaur/wmde_oauth_django_example]) * [https://github.com/jpadilla/pyjwt pyjwt] – knihovna JWT === Ruby === * [https://github.com/timwaters/omniauth-mediawiki omniauth-mediawiki] – strategie MediaWiki pro OmniAuth (dostupná také jako [https://rubygems.org/gems/omniauth-mediawiki gem]) === Rust === * [https://crates.io/crates/mediawiki MediaWiki crate] implementuje přihlašovací mechanismy OAuth1 i OAuth2. * [https://crates.io/crates/oauth2 oauth2 crate] === Node.js === * [https://www.npmjs.com/package/passport-mediawiki-oauth passport-mediawiki-oauth] – strategie MediaWiki pro framework Passport auth (který lze bez námahy použít jako middleware s Express JS a podobnými frameworky) * [https://www.npmjs.com/package/oauth-fetch-json oauth-fetch-json] – knihovna pro podepisování požadavků OAuth * [https://www.npmjs.com/package/m3api-oauth2 m3api-oauth2] – an extension package for [https://www.npmjs.com/package/m3api m3api], making it easy to make requests authenticated via [[Special:MyLanguage/Help:OAuth|OAuth 2.0]] === Go === * [https://github.com/mrjones/oauth mrjones/oauth] (OAuth 1.0) * [https://pkg.go.dev/golang.org/x/oauth2 golang.org/x/oauth2] (OAuth 2.0, [https://pkg.go.dev/golang.org/x/oauth2#example-Config příklad]) === Java === * [https://github.com/scribejava/scribejava ScribeJava] od verze 5.5.0 ([https://github.com/scribejava/scribejava/pull/852 žádost o změnu]) <span id="Example_code"></span> == Příklad kódu == <span id="PHP_client_without_using_any_libraries"></span> === PHP klient bez použití knihoven === [[toollabs:oauth-hello-world|OAuth Hello World]] – snadno srozumitelná demo aplikace napsaná v PHP bez jakýchkoli knihoven. <span id="PHP_command-line_client_with_RSA_keys,_using_oauthclient-php"></span> === Klient příkazového řádku PHP s klíči RSA, používající oauthclient-php === PHP aplikace využívající třídy z kódové základny rozšíření OAuth. {{Todo|1=převeďte to tak, aby skutečně používalo oauthclient-php! Pravděpodobně jen spoustu deklarací <code>use</code>.}} Před zahájením: <syntaxhighlight lang="shell-session"> $ openssl genrsa -out appkey.pem 4096 $ openssl rsa -in appkey.pem -pubout > appkey.pub </syntaxhighlight> {{Collapse_top|title=Zdrojový kód PHP}} <syntaxhighlight lang="php"> <?php if ( PHP_SAPI !== 'cli' ) { die( "CLI-only test script\n" ); } /** * Základní klient pro celkové testování */ function wfDebugLog( $method, $msg) { //echo "[$method] $msg\n"; } require 'OAuth.php'; require 'MWOAuthSignatureMethod.php'; $consumerKey = ''; #$consumerSecret = ''; // To nepotřebujeme, protože používáme RSA, s výjimkou ověření volání /identifikace. $privateKey = file_get_contents( 'appkey.pem' ); $baseurl = 'http://<wiki>/wiki/Special:OAuth'; $endpoint_req = $baseurl . '/initiate?format=json&oauth_callback=oob'; // format=json trochu zjednodušuje PHP $endpoint_acc = $baseurl . '/token?format=json'; $endpoint_id = $baseurl . '/identify'; $c = new OAuthConsumer( $consumerKey, $privateKey ); // Ujistěte se, že podepíšeme název a formát $parsed = parse_url( $endpoint_req ); $extraSignedParams = array(); parse_str($parsed['query'], $extraSignedParams); $extraSignedParams['title'] = 'Special:OAuth/initiate'; $init_req = OAuthRequest::from_consumer_and_token( $c, // OAuthConsumer pro vaši aplikaci NULL, // Uživatelský token, NULL pro zahájení volání "GET", // metoda http $endpoint_req, // URL koncového bodu (toto je podepsáno) $extraSignedParams // další parametry, které chceme podepsat (musí obsahovat název) ); $rsa_method = new MWOAuthSignatureMethod_RSA_SHA1( new OAuthDataStore(), $privateKey ); $init_req->sign_request( $rsa_method, // OAuthSignatureMethod $c, // OAuthConsumer pro vaši aplikaci NULL // Uživatelský token, NULL pro zahájení volání ); echo "Getting request token with: $init_req\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, (string) $init_req ); // Předat OAuth v parametrech GET curl_setopt( $ch, CURLOPT_HTTPGET, true ); curl_setopt( $ch, CURLOPT_HEADER, false ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $requestToken = json_decode( $data ); print "Visit $baseurl/authorize?oauth_token={$requestToken->key}&oauth_consumer_key=$consumerKey\n"; // PŘÍSTUPOVÝ TOKEN print "Enter the verification code:\n"; $fh = fopen( "php://stdin", "r" ); $line = fgets( $fh ); $rc = new OAuthToken( $requestToken->key, $requestToken->secret ); $parsed = parse_url( $endpoint_acc ); parse_str($parsed['query'], $params); $params['oauth_verifier'] = trim($line); $params['title'] = 'Special:OAuth/token'; $acc_req = OAuthRequest::from_consumer_and_token( $c, $rc, "GET", $endpoint_acc, $params ); $acc_req->sign_request($rsa_method, $c, $rc); echo "Calling: $acc_req\n"; unset( $ch ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_acc ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $acc_req->to_header() ) ); // Nastavení autorizační hlavičky $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $acc = json_decode( $data ); $accessToken = new OAuthToken( $acc->key, $acc->secret ); /** * Nezabezpečeně volat API pro informace o uživateli. * MITM může zfalšovat odpověď ze serveru, takže se na to pro identifikaci nespoléhejte! */ $apiurl = 'http://<wiki>/w/api.php'; $apiParams = array( 'action' => 'query', 'meta' => 'userinfo', 'uiprop' => 'rights', 'format' => 'json', ); $api_req = OAuthRequest::from_consumer_and_token( $c, // Consumer $accessToken, // User Access Token "GET", // HTTP Method $apiurl, // Endpoint url $apiParams // Extra signed parameters ); $api_req->sign_request( $rsa_method, $c, $accessToken ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $apiurl . "?" . http_build_query( $apiParams ) ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $api_req->to_header() ) ); // Autorizační hlavička vyžadovaná pro API $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; /** * Bezpečně získejte identitu uživatele */ $consumerSecret = ''; $extraSignedParams = array( 'title' => 'Special:OAuth/identify' ); $req = OAuthRequest::from_consumer_and_token( $c, $accessToken, "GET", $endpoint_id, $extraSignedParams ); $req->sign_request( $rsa_method, $c, $accessToken ); echo "Calling: '$endpoint_id'\nHeader: {$req->to_header()}\n\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_id ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $req->to_header() ) ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } $identity = JWT::decode( $data, $consumerSecret ); // Ověření JWT if ( !validateJWT( $identity, $consumerKey, $req->get_parameter( 'oauth_nonce' ) ) ) { print "The JWT did not validate"; } else { print "We got a valid JWT, describing the user as:\n"; print " * Username: {$identity->username}\n"; print " * User's current groups: " . implode( ',', $identity->groups ) . "\n"; print " * User's current rights: " . implode( ',', $identity->rights ) . "\n"; } /** * Ověřte JWT, abyste se ujistili, že se nejedná o odpověď, parodii atd. * @param $identity dekódovaný JWT * @param $consumerKey klíč vaší aplikace * @param $nonce jednorázový kód odeslaný s vaší žádostí, který by měl být vrácen */ function validateJWT( $identity, $consumerKey, $nonce ) { $expectedConnonicalServer = 'http://<wiki>'; // Ověřte, zda je vydavatel očekáván (server odešle $wgCanonicalServer). if ( $identity->iss !== $expectedConnonicalServer ) { print "Invalid Issuer"; return false; } // Ověřte, zda jsme cílovou skupinou if ( $identity->aud !== $consumerKey ) { print "Invalid Audience"; return false; } // Ověřte, zda jsme v časových limitech tokenu. // Vydáno v (iat) by mělo být v minulosti, // Datum vypršení platnosti (exp) by mělo být v budoucnosti. $now = time(); if ( $identity->iat > $now || $identity->exp < $now ) { print "Invalid Time"; return false; } // Ověřte, že jsme tento jednorázový výskyt ještě neviděli, což by naznačovalo útok opakovaným přehráním. if ( $identity->nonce !== $nonce ) { print "Invalid Nonce"; return false; } return true; } </syntaxhighlight> {{Collapse_bottom}} <span id="Python_command-line_client_using_mwoauth"></span> === Klient příkazového řádku Pythonu používající mwoauth === {{Collapse_top|title=Zdrojový kód Pythonu}} <syntaxhighlight lang="python"> from mwoauth import ConsumerToken, Handshaker import requests from requests_oauthlib import OAuth1 from six.moves import input # Pro kompatibilitu mezi Pythonem 2 a 3 # Vytvořte "spotřebitele" z klíče/tajného klíče poskytnutého MediaWiki import config # Budete muset toto poskytnout # Vytvořte soubor s názvem config.py někde, kde ho Python najde, např. ve stejném adresáři jako tento skript, s následujícím obsahem (bez znaků #!). # consumer_key = "Spotřebitelský token, který jste získali při registraci aplikace" # consumer_secret = "Tajný token, který jste získali při registraci aplikace" # Například: # consumer_key = "20bc67da5081a30c736340c493f60d14" # consumer_secret = "af4313371bb2fb38e81fe7d300080085f52849f9" consumer_token = ConsumerToken(config.consumer_key, config.consumer_secret) # Vytvořte handshaker s wiki URI a spotřebitelem handshaker = Handshaker("https://en.wikipedia.org/w/index.php", consumer_token) # Krok 1: Inicializace -- požádejte MediaWiki o dočasný klíč/tajný kód pro uživatele redirect, request_token = handshaker.initiate() # Krok 2: Autorizace -- odešlete uživatele na MediaWiki k potvrzení autorizace print("Point your browser to: %s" % redirect) # response_qs = input("Response query string: ") # Krok 3: Dokončení – získání autorizovaného klíče/tajného klíče pro "vlastníka zdroje" access_token = handshaker.complete(request_token, response_qs) # Vytvořte objekt auth s tokeny pro příjemce a přístup. auth1 = OAuth1(consumer_token.key, client_secret=consumer_token.secret, resource_owner_key=access_token.key, resource_owner_secret=access_token.secret) # Nyní přístup k API jménem uživatele print("Reading top 10 watchlist items") response = requests.get( "https://en.wikipedia.org/w/api.php", params={ 'action': "query", 'list': "watchlist", 'wllimit': 10, 'wlprop': "title|comment", 'format': "json" }, auth=auth1 ) for item in response.json()['query']['watchlist']: print("{title}\t{comment}".format(**item)) </syntaxhighlight> {{Collapse_bottom}} <span id="Python_Toolforge_tutorial_using_mwoauth"></span> === Výukový program Python Toolforge s použitím mwoauth === Více vám řekneː [[wikitech:Help:Toolforge/My first Flask OAuth tool]] === Python Toolforge tutorial using authlib (OAuth 2.0) === {{Collapse_top|title=Python source code}} <syntaxhighlight lang="python"> # > requirements.txt # flask==3.1.3 # requests==2.33.1 # authlib==1.7.0 # > config.py OAUTH_ACCESS_TOKEN_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/access_token" OAUTH_API_BASE_URL = "https://commons.wikimedia.org/w/" OAUTH_AUTHORIZE_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/authorize" OAUTH_CODE_CHALLENGE_METHOD = "S256" OAUTH_CONSUMER_KEY = "Y" OAUTH_CONSUMER_SECRET = "Z" OAUTH_SCOPE = "basic editpage" # > app.py from authlib.integrations.flask_client import FlaskOAuth2App, OAuth from flask import Flask, jsonify, redirect, request, session from requests import Response app = Flask() app.config.from_pyfile("config.py") oauth = OAuth(app) oauth.register( name="mediawiki", client_id=app.config["OAUTH_CONSUMER_KEY"], client_secret=app.config["OAUTH_CONSUMER_SECRET"], client_kwargs={ "code_challenge_method": app.config["OAUTH_CODE_CHALLENGE_METHOD"], "scope": app.config["OAUTH_SCOPE"], }, api_base_url=app.config["OAUTH_API_BASE_URL"], access_token_url=app.config["OAUTH_ACCESS_TOKEN_URL"], authorize_url=app.config["OAUTH_AUTHORIZE_URL"], ) oauth_client: FlaskOAuth2App = oauth.create_client("mediawiki") @app.route("/") def index(): return app.send_static_file("index.html") @app.route("/login") def login(): return oauth_client.authorize_redirect() @app.route("/oauth-callback") def auth(): token = oauth_client.authorize_access_token() session["token"] = token return redirect("/") @app.route("/logout") def logout(): session.pop("token", None) session.clear() return redirect("/") @app.route("/user") def user(): response: Response = oauth_client.request( "GET", "rest.php/oauth2/resource/profile", token=session["token"], ) user = response.json() response.raise_for_status() return jsonify(user=user) @app.route("/edit", methods=["POST"]) def edit(): data = request.get_json() pageid = int(data["pageid"]) response: Response = oauth_client.request( "POST", "api.php", token=session["token"], data=dict( format="json", formatversion="2", action="query", pageids=str(pageid), prop="revisions|wbentityusage", rvprop="content", rvslots="*", meta="tokens", ), ) r = response.json() token = r["query"]["tokens"]["csrftoken"] ... </syntaxhighlight> {{Collapse_bottom}} <span id="Go_command-line_client_using_mrjones/auth_(OAuth_1.0)"></span> === Klient příkazového řádku Go s použitím mrjones/auth (OAuth 1.0) === Než začnete: <syntaxhighlight lang="shell-session"> $ go get github.com/mrjones/oauth </syntaxhighlight> {{Collapse_top|title=Zdrojový kód Go}} <syntaxhighlight lang="go"> package main import ( "fmt" "os" "github.com/mrjones/oauth" "io/ioutil" "strconv" ) func main() { var consumerKey string = "" var consumerSecret string = "" if len(consumerKey) == 0 || len(consumerSecret) == 0 { os.Exit(1) } c := oauth.NewConsumer( consumerKey, consumerSecret, oauth.ServiceProvider{ RequestTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/initiate", AuthorizeTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/authorize", AccessTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/token", }) c.Debug(true) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/initiate", } c.AdditionalAuthorizationUrlParams = map[string]string{ "oauth_consumer_key": consumerKey, } requestToken, url, err := c.GetRequestTokenAndUrl("oob") if err != nil { fmt.Println( err ) } fmt.Println( "Got token " + requestToken.Token ) fmt.Println("(1) Go to: " + url) fmt.Println("(2) Grant access, you should get back a verification code.") fmt.Println("(3) Enter that verification code here: ") verificationCode := "" fmt.Scanln(&verificationCode) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/token", } accessToken, err := c.AuthorizeToken(requestToken, verificationCode) if err != nil { fmt.Println(err) } fmt.Println( "Got access token " + accessToken.Token ) c.AdditionalParams = map[string]string{} response, err := c.Get( "http://<wiki>/wiki/api.php", map[string]string{ "action": "query", "meta": "userinfo", "uiprop": "rights", "format": "json", }, accessToken) if err != nil { fmt.Println(err) } fmt.Println( "\tResponse Status: '" + response.Status + "'\n" ) fmt.Println( "\tResponse Code: " + strconv.Itoa(response.StatusCode) + "\n" ) bytes, _ := ioutil.ReadAll(response.Body) fmt.Println( "\tResponse Body: " + string(bytes) + "\n" ) } </syntaxhighlight> {{Collapse_bottom}} <span id="JavaScript_applications_using_OAuth_2"></span> === JavaScriptové aplikace používající OAuth 2 === * [https://github.com/wikimedia/apiclient-wiki wikimedia/apiclient-wiki] – celá aplikace v 520 řádcích kódu <span id="Full_applications_using_OAuth"></span> === Plné aplikace používající OAuth === * [https://github.com/jdlrobson/weekipedia/blob/master/libs/server/app.js Weekipedia], plnohodnotný port React.js mobilní verze Wikipedie používá oba. * Mnoho [https://toolhub.wikimedia.org/search?keywords__term=oauth nástrojů Toolforge] <span id="Notes"></span> ==Poznámky pod čarou== <references /> lt6nw3gaph8f5k0wmlo430hp5wk3g2n Extension:TimedMediaHandler/VideoJS Player/fi 102 1506963 8364357 8363687 2026-05-03T13:12:15Z FuzzyBot 451990 Updating to match new version of source page 8364357 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|<span lang="en" dir="ltr" class="mw-content-ltr">Screenshot of the VideoJS player in action</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is based on [https://videojs.com/ VideoJS], and has a modern, fast user interface with compatibility with mobile devices and HTML5. </div> <span id="Usage"></span> == Käyttö == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|<span lang="en" dir="ltr" class="mw-content-ltr">Example video player</span>]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using tab, enter and spacebar keys</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Known issues == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The video player is still in development, but if you find any problems, please report these on the [[Extension_talk:TimedMediaHandler/VideoJS Player|talk page]] or file them in [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> d59q4s5feetg7jp4codhaofsza2sl8r 8364774 8364357 2026-05-03T23:14:39Z FuzzyBot 451990 Updating to match new version of source page 8364774 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|<span lang="en" dir="ltr" class="mw-content-ltr">Screenshot of the VideoJS player in action</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is based on [https://videojs.com/ VideoJS], and has a modern, fast user interface with compatibility with mobile devices and HTML5. </div> <span id="Usage"></span> == Käyttö == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|<span lang="en" dir="ltr" class="mw-content-ltr">Example video player</span>]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Known issues == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The video player is still in development, but if you find any problems, please report these on the [[Extension_talk:TimedMediaHandler/VideoJS Player|talk page]] or file them in [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 7i6q6k3kjagx89254at1o4bhq2b9mno Help:Extension:Translate/Validators/fa 12 1509804 8364875 6197407 2026-05-04T04:02:49Z FuzzyBot 451990 Updating to match new version of source page 8364875 wikitext text/x-wiki <languages/> {{Extension-Translate}} <span lang="en" dir="ltr" class="mw-content-ltr">Translatable strings often contain markup that should be retained as-is in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Typing that markup can be slow and difficult because special characters are common.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Translate extension can provide translators a button clicking on which inserts the piece of markup into the translation to the current cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In addition, if a translation is missing that specific markup, the Translate extension can either warn the translator or simply reject the translation, since such markup is usually mandatory to display the messages properly to the end user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example in the string, <blockquote>''Adapted by %{name} from a work by %{original}''</blockquote> there are two insertables - <code>%{name}</code> and <code>%{original}</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the translator does not add them to their translation, the end user using the software will not see a proper message.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>MessageValidator</code> framework has been added with the intent of helping with validating translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Validators run on the translated message and based on the configuration, a warning or error message is shown to the translator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Translations with warnings can still be saved, but ones that have error cannot.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only a user with <code>translate-manage</code> permission can save translations that have errors.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When configuring a validator, a regex is defined to identify markup that is mandatory.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The validator can also be marked as insertable, in which case a button will be displayed to the translator to add that markup into the translation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Adding a custom validators is still possible and will be needed for more specialized validations. </div> <span id="Configuration"></span> == پیکربندی == <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a summarized validator configuration, </div> <syntaxhighlight lang="yaml" line="1" start="1"> VALIDATORS: # Example 1 - id: InsertableRegex enforce: true insertable: true params: /\$[a-z0-9]+/ keymatch: - 'untranslated' # Matches key untranslated directly - type: 'wildcard' pattern: '*translated*' # Matches any key that has the translated in it # Example 2 - id: InsertableRegex insertable: true params: regex: /(?<pre>\[)[^]]+(?<post>\]\([^)]+\))/ display: $pre $post pre: $pre post: $post # Example 3 - class: MathJaxMessageValidator enforce: true # Example 4 - id: BraceBalance </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In the example above, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>InsertableRegex</code> is a bundled validator that can accept a custom regex and run validations.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>MathJaxMessageValidator</code> is a custom validator class.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>BraceBalance</code> is another bundled validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr"><code>VALIDATORS</code> uses an array format.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Lets look at the various parameters being used here in each array item,</span> <span id="Parameters"></span> === مؤلفه‌ها === {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Property</span> ! نوع ! توضیحات |- |id | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Incase a bundled / pre-provided validator is being used, the ID of the validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">''Required if <code>class</code> is not specified.''</span> |- |class | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">If a custom validator is being used, then use this option instead of <code>id</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Specifies the name of the validator class.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #3''' in the above config.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>AUTOLOAD</code> option can be used to load the class.</span> <span lang="en" dir="ltr" class="mw-content-ltr">''Required if <code>id</code> is not specified.''</span> |- |enforce | <span lang="en" dir="ltr" class="mw-content-ltr">boolean</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether the validator should be enforced.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If set to true, and a translation fails validation, an error will be displayed which must be fixed in order to save the translation.</span> |- |insertable | <span lang="en" dir="ltr" class="mw-content-ltr">boolean</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether the validator should also be an insertable.</span> |- |keymatch | <span lang="en" dir="ltr" class="mw-content-ltr">array</span> | <span lang="en" dir="ltr" class="mw-content-ltr">With this option it is possible to limit certain validations to certain messages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Keymatch is an array with each option being either a '''string''' or a '''prototype.''' If it is a string, a direct comparison with the message key is done.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #1''' in the above config.</span> |- |keymatch[i].type | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Type is either ''regex'' or ''wildcard''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is the approach that will be used to check if the message key matches a given pattern.</span> |- |keymatch[i].pattern | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pattern is a string that will be used for matching.</span> |- |params | <span lang="en" dir="ltr" class="mw-content-ltr">string / associative array</span> | <span lang="en" dir="ltr" class="mw-content-ltr">If <code>params</code> is specified '''as a string''', it is used as the regex.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #1'''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case if insertable is true, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>display</code> is the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>pre</code> is also the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>post</code> is left empty.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If <code>params</code> is specified '''as an associative array (see example #2)''', see below for further details.</span> |- |params.regex | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">The regex to be used for validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Must use named captures.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When specifying named captures, do not use the <code>$</code> symbol in the name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In '''example #2''', two named captures are used - <code>pre</code> and <code>post</code>.</span> |- |params.display | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Mandatory value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The display value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #2'''.</span> |- |params.pre | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">The pre value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted before the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, is set to the display value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #2'''.</span> |- |params.post | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">The post value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted after the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #2'''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, defaults to an empty string.</span> |} <span id="Pre-provided_/_Bundled_validators"></span> === از پیش ارائه‌شده / تأییدکنندگان همراه === <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a list of bundled validators, </div> ==== BraceBalance ==== ID: <code>BraceBalance</code> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the number of open braces / brackets, matches the number of closed braces / brackets in the translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, the following translations would pass, </div> * <code><nowiki>{{ }}</nowiki></code> * <code>[ ]</code> <span lang="en" dir="ltr" class="mw-content-ltr">whereas, the following would fail,</span> * <code>[ ]]</code> * <code><nowiki>{{ }</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator cannot be marked as insertable.</span> ==== EscapeCharacter ==== ID: <code>EscapeCharacter</code> <div lang="en" dir="ltr" class="mw-content-ltr"> The validator ensures that only the specified escape character are present in a translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The allowed escape characters can be specified when adding the validator, and can only include, </div> * <code>\t</code> * <code>\n</code> * <code>\'</code> * <code>\"</code> * <code>\f</code> * <code>\r</code> * <code>\a</code> * <code>\b</code> * <code>\\</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> ==== GettextNewline ==== ID: <code>GettextNewline</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically for GetText based message groups. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the translation has the same number of newlines as the source message at the beginning and end of the string. </div> ==== GettextPlural ==== ID: <code>GettextPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on GetText based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL:GETTEXT|one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== InsertableRegex ==== ID: <code>InsertableRegex</code> <div lang="en" dir="ltr" class="mw-content-ltr"> A generic reusable validator that can be used to specify custom validations and insertables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, take the following configuration where the validator is marked as insertable and enforced, </div> <syntaxhighlight lang="yaml"> - id: InsertableRegex enforce: true insertable: true params: "/\$[a-zA-Z0-9]+/" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Given the following source message - ''Hello $name. My name is $myName.'' that is being translated, the translation must have the parameters - ''$name'' and ''$myName''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will also be displayed as insertables to make it easier for translators to use them in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An absence of these parameters will cause an error to be displayed to the translator.</span> ==== InsertableRubyVariable ==== ID: <code>InsertableRubyVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches ruby variables in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>%{[a-zA-Z_]+}</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>%{abc}</code> ==== IosVariable ==== ID: <code>IosVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">An insertable variable validator for Ios.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Regex is used [https://github.com/dcordero/Rubustrings/blob/61d477bffbb318ca3ffed9c2afc49ec301931d93/lib/rubustrings/action.rb#L91 from this Rubustrings source].</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>%@</code> ==== MatchSet ==== ID: <code>MatchSet</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation is present in the list of values.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also takes a parameter - <code>caseSensitive</code> that can be either true (''default'') or false.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the following configuration, the validator will validate the message with key - <code>html.dir</code> and ensure that the values for it can either be ''ltr'' or ''rtl''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that LTR or RTL will not be valid values, since <code>caseSensitive</code> is true by default.</span> <syntaxhighlight lang="yaml" line="1" start="1"> - id: MatchSet enforce: true keymatch: - html.dir params: values: - ltr - rtl </syntaxhighlight> ==== MediaWikiLink ==== ID: <code>MediaWikiLink</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if the translation uses links that are discouraged.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Valid links are those that link to Special: pages, <code><nowiki>{{ns:special}}:</nowiki></code> or project pages trough MediaWiki messages like <code><nowiki>{{MediaWiki:helppage-url}}:</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also links in the definition are allowed.</span> ==== MediaWikiPageName ==== ID: <code>MediaWikiPageName</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a namespace such as <code><nowiki>{{ns:project}}:hello</nowiki></code> the translations made do not try to translate the namespaces itself.</span> ==== MediaWikiParameter ==== ID: <code>MediaWikiParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches wiki parameters in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>/\$[1-9]/</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>$1</code>, <code>$2</code>. ==== MediaWikiPlural ==== ID: <code>MediaWikiPlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a <code><nowiki>{{PLURAL:$1|message|messages}}</nowiki></code>, the translation should also have it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It can also be used as an insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has three.</span> ==== MediaWikiTimeList ==== ID: <code>MediaWikiTimeList</code> <span lang="en" dir="ltr" class="mw-content-ltr">Provides validations for expiry options and IP block options specified in the MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These are usually in the format,</span> <syntaxhighlight lang="text"> indefinite:indefinite,3 hours:3 hours,12 hours:12 hours,24 hours:24 hours,31 hours:31 hours,36 hours:36 hours,48 hours:48 hours,60 hours:60 hours,72 hours:72 hours,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,2 years:2 years,3 years:3 years,infinite:indefinite </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The validations ensure that the translations have the exact same number of key-value pairs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These validations are run only on messages with keys,</span> # protect-expiry-options # ipboptions ==== Newline ==== ID: <code>Newline</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has the same number of newlines as the source / definition message at the ''beginning of the string''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> ==== NotEmpty ==== ID: <code>NotEmpty</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has some content, and that content is not just whitespace.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> ==== NumericalParameter ==== ID: <code>NumericalParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches numerical parameters by using the following regex: <code>/\$\d+/</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>$33</code>, <code>$1</code> etc. ==== Printf ==== ID: <code>Printf</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator checks for missing and unknown printf formatting characters in translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>%2$f</code>, <code>%d</code> etc. ==== PythonInterpolation ==== ID: <code>PythonInterpolation</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches python string interpolation variables by using the following regex: <code>/\%(?:\([a-zA-Z0-9]*?\))?[diouxXeEfFgGcrs]/U</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>%s</code>, <code>%(name)s</code> ==== Replacement ==== ID: <code>Replacement</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if a translation is using the <code>search</code> string, and instead suggests the translator to use the string mentioned under <code>replacement</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> <syntaxhighlight lang="yaml" line="1"> - id: Replacement enforce: true params: search: '{{PLURAL:' replace: '{PLURAL:' </syntaxhighlight> ==== SmartFormatPlural ==== ID: <code>SmartFormatPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on [https://github.com/axuno/SmartFormat SmartFormat] based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code>{1:test|tests}{0:message|messages}</code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== UnicodePlural ==== ID: <code>UnicodePlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL|one=one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has three.</span> <span id="User_interface"></span> == رابط کاربری == <span lang="en" dir="ltr" class="mw-content-ltr">The user interface has been updated to differentiate between errors and warnings.</span> [[File:Translate-validation-err-warning.png|thumb|345x345px|alt=|<span lang="en" dir="ltr" class="mw-content-ltr">A warning and error shown on top of a translation</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> During translation, if an error is noticed with the translation, the '''Save translation''' button is disabled unless the user who is translating has <code>translate-manage</code> permission. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally validation is also done on the server when the user is saving the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will still allow users who have the <code>translate-manage</code> permission to save the translation even if it has errors.</span> <span id="Custom_validators"></span> == تأییدکنندگان غیررسمی == <span lang="en" dir="ltr" class="mw-content-ltr">Certain complicated validations might still require a custom validator to be written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Custom validators must implement the <code>MediaWiki\Extensions\Translate\Validation\MessageValidator</code> interface [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/MessageValidator.php].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Below is an example of a custom validator, </div> <syntaxhighlight lang="php" line="1" start="1"> <?php // Filename: Validator.php use MediaWiki\Extensions\Translate\Validation\MessageValidator; use MediaWiki\Extensions\Translate\Validation\ValidationIssue; use MediaWiki\Extensions\Translate\Validation\ValidationIssues; /** * My Custom Validator */ class MyCustomValidator implements MessageValidator { public function getIssues( TMessage $message, string $targetLanguage ): ValidationIssues { $issues = new ValidationIssues(); // Validation code goes here. Push ValidationIssue into the ValidationIssues. E.g.: $issue = new ValidationIssue( 'value-not-present', // type 'invalid', // sub-type 'translate-checks-value-not-present', // message key [ // message params [ 'PLAIN-PARAMS', $this->possibleValues ], [ 'COUNT', count( $this->possibleValues ) ] ] ); $issues->add( $issue ); return $issues; } } </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Also see the following classes,</span> # <code>ValidationIssues</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssues.php # <code>ValidationIssue</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssue.php <span lang="en" dir="ltr" class="mw-content-ltr">The add the custom validator in the configuration file,</span> <syntaxhighlight lang="yaml"> VALIDATORS: - class: MyCustomValidator enforce: true AUTOLOAD: MyCustomValidator: Validator.php </syntaxhighlight> klb5xw6q8jy1ty7axjpojf67x7f8aw2 Extension:PageTriage/pl 102 1511123 8365070 8157892 2026-05-04T07:51:35Z FuzzyBot 451990 Updating to match new version of source page 8365070 wikitext text/x-wiki <languages /> {{Extension |templatemode = |status = stable |type1 = special |type2 = interface |newhook1 = |newhook2 = |username = |author = [[User:Kaldari|Ryan Kaldari]], [[User:Bsitu|Benny Situ]] |description = <span lang="en" dir="ltr" class="mw-content-ltr">Facilitates reviewing and approving new pages</span> |image = Extension-PageTriage Special-NewPagesFeed Screenshot.png |imagesize = 300 |version = |update = |version preview = |update preview = |compatibility policy = rel |mediawiki = |php = |composer = |table1 = pagetriage_page |table2 = pagetriage_page_tags |table3 = pagetriage_tags |download = {{WikimediaDownload|phab=EPTR}} |readme = |changelog = |example = [[wikipedia:Special:NewPagesFeed | Special:NewPagesFeed on the English Wikipedia]] |namespace = |tags = |compatibility = |bugzilla = |phabricator = PageTriage |vagrant-role = }} <span lang="en" dir="ltr" class="mw-content-ltr">'''PageTriage''' is an extension that aims to provide a feature-rich interface for triaging newly-created articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is intended to replace the ''new page patrol'' core function while adding additional functionality for reviewing, tagging, and improving new articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It adds a Special:NewPagesFeed page, and a page curation toolbar to new pages for those with the 'patrol' permission.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It was developed by the Wikimedia Foundation's [[Wikimedia_Features_engineering|Features Engineering team]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">For additional details see ''[[Page Curation|Page Curation]]''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An important note is that some of the configuration and code is specific to the English-language Wikipedia's workflows and as it's constructed now the extension is pretty much impossible to internationalise.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See [[Phabricator:T50552]].)</span> [[File:Page-Curation-Video.ogv|thumb|An overview of the page curation feature. The interface in the video is outdated but the content remains useful.]] <span id="Installation"></span> == Instalacja == [[File:PageTriage-ListView-Whole.png|thumb|Screenshot of Special:NewPagesFeed as it appeared in 2012]] {{ExtensionInstall |db-update=yes |registration=required |localsettings= }} == Checking for successful install == <div lang="en" dir="ltr" class="mw-content-ltr"> To actually see the extension working: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Create a new page containing just a few sentences of text as an anonymous user. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Visit Special:NewPagesFeed </div> <span lang="en" dir="ltr" class="mw-content-ltr">The new page should appear, flagged as "{{int|pagetriage-no-categories}}", "{{int|pagetriage-orphan}}", etc.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To see the page curation toolbar:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Login as a user with the 'sysop' permission, or add a group with the "[[Special:MyLanguage/Help:Patrolled_edits|patrol]]" permission, and add some user to that group, and login as that user. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Visit Special:NewPagesFeed </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Now you should see a "{{int|pagetriage-triage}}" button next to the new page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Click this and you should see the page curation toolbar on the new page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Advanced installation == </div> <span id="Additional_extensions"></span> === Dodatkowe rozszerzenia === <div lang="en" dir="ltr" class="mw-content-ltr"> For full functionality, you'll also need to install some additional extensions, although PageTriage works without them. </div> * {{ll|Extension:Echo|Echo}} - Allows users to receive notifications for things like when an article they created has been marked as reviewed. * {{ll|Extension:ORES|ORES}} - In Special:NewPagesFeed, allows filtering by "predicted class" (<code>articlequality</code>: stub, start, c-class, b-class, good, featured) and "potential issues" (<code>draftquality</code>: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because <code>draftquality</code> needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's [[git:mediawiki/extensions/ORES/+/8bd39f26548d58fa8bf6765e1c23f5e3086f1cd4/extension.json#225|extension.json file]]. * {{ll|Extension:WikiLove|WikiLove}} - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily. === Enabling draft namespace === By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php <syntaxhighlight lang="php" copy> // These three settings are optional, and will enable the Articles-for-Creation mode. $wgPageTriageDraftNamespaceId = 118; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft'; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk'; </syntaxhighlight> When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed. By default pages edited in the draft namespace will be "unsubmitted". Articles in the draft namespace can be submitted for review by adding <nowiki>[[Category:Pending_AfC_submissions]]</nowiki> to the draft page. At which point they will show up under "awaiting review". Note the toolbar controlled by the configuration variable '''$wgPageTriageEnableCurationToolbar''' does not show up in the draft namespace. === Cron jobs === To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: <code>cron/updatePageTriageQueue.php</code> == Manual testing == === Special:NewPagesFeed -> Articles for Creation === * Enable draftspace by following the directions above in the section [[#Enabling draft namespace]]. * In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories: ** Unsubmitted: (no category) ** Awaiting review: Category:Pending AfC submissions ** Under review: Category:Pending AfC submissions being reviewed now ** Declined: Category:Declined AfC submissions Note: The Page Curation toolbar does not display for drafts. === ORES === Enwiki has the [[Extension:ORES|ORES extension]] installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure: * Clone Extension:ORES and add <code>wfLoadExtension( 'ORES' );</code> in <code>LocalSettings.php</code> * Add this to <code>LocalSettings.php</code> <syntaxhighlight lang="php" copy> $wgPageTriageEnableOresFilters = true; $wgOresWikiId = 'enwiki'; $wgOresModels = [ 'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ], 'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'sources' => [ 1 ] ] ]; </syntaxhighlight> * Run <code>php maintenance/run.php ./extensions/ORES/maintenance/BackfillPageTriageQueue.php</code> == Determining if a page is reviewed == === Status codes === There are status codes used to track whether a page is reviewed or not. These are the values given when you query <code>patrol_status</code>, <code>ptrp_reviewed</code>, and <code>ptrl_reviewed</code>: * Unreviewed ** 0 - unreviewed * Reviewed ** 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar) ** 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page) ** 3 - autopatrolled (someone with the <code>autopatrol</code> user right created the page, or moved the page from a non-tracked namespace to a tracked namespace) ** no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job) === Via the API === To check the review status of pages using an API query, you can use <code>api.php?action=query&prop=isreviewed</code>. Sample JavaScript code:<syntaxhighlight lang="js" copy> /** * @param {number} pageID The page ID number. A positive number with no commas. */ async isReviewed(pageID) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', pageids: pageID, } ); return response.query.pages[0].isreviewed; } /** * @param {string} title One title. Can include namespace. Example: User:Test */ async function isReviewed(title) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', titles: title, } ); return response.query.pages[0].isreviewed; } </syntaxhighlight> === Via SQL === To check the review status of pages using an SQL query, you need to query the <code>{{ll|Extension:PageTriage/pagetriage page table|pagetriage_page}}</code> table and the <code>ptrp_reviewed</code> field. Follow the directions in [[#Status codes]] to interpret the values of this field. <syntaxhighlight lang="sql" copy> /* By page_id */ SELECT ptrp_reviewed FROM pagetriage_page WHERE ptrp_page_id = 71318376 /* By page_title and page_namespace */ SELECT ptrp_reviewed FROM pagetriage_page JOIN page ON page_id = ptrp_page_id WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces AND page_namespace = 0 </syntaxhighlight> == SQL == === SQL tables === {| class="wikitable" |+ !Name !Prefix !Description !Old entry deletion strategy !Service classes (when refactoring, SQL queries should be moved to here) !Data classes |- |[[Extension:PageTriage/pagetriage page table|pagetriage_page]] |ptrp_ |The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query <code>ptrp_reviewed > 0</code> in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. |All articles deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. |QueueManager, QueueLookup |QueueRecord |- |[[Extension:PageTriage/pagetriage page tags table|pagetriage_page_tags]] |ptrpt_ |Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the <code>pagetriage_tags</code> table. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. |All article metadata deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status. | | |- |[[Extension:PageTriage/pagetriage tags table|pagetriage_tags]] |ptrt_ |A dictionary of page_tags, and their corresponding ID number. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. | | | |} === pagetriage_page_tags === <code>pagetriage_page_tags</code> data is updated by calling <code>ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata()</code>. This is called in the following hooks: * <code>onPageMoveComplete()</code> - runs when moving a page * <code>onLinksUpdateComplete()</code> - runs when saving an edit * <code>onMarkPatrolledComplete()</code> - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user. ==== List of tags ==== The <code>pagetriage_page_tags</code> are as follows: * Author information ** user_id ** user_name - there's a filter where you can type in their username ** user_editcount ** user_creation_date ** user_autoconfirmed ** user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with <code>MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()</code> ** user_bot ** user_block_status * Deletion tags - will display a black trash can icon if marked for deletion ** afd_status ** blp_prod_status ** csd_status ** prod_status * Special:NewPagesFeed red warning text ** category_count - No categories ** linkcount - Orphan ** reference - No citations ** recreated - Previously deleted ** user_block_status - Blocked * Page information ** page_len - size of article, in bytes ** rev_count - number of edits to the article ** snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article * afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined * copyvio - latest revision ID that has been tagged as a likely copyright violation, if any == PHP == <div lang="en" dir="ltr" class="mw-content-ltr"> === Extension configuration === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The extension is based on the 'patrol' right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For more information about configuring patrolling, see {{ll|Manual:Patrolling}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following configuration variables can be set from your LocalSettings.php file: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">Variable</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Default</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> |- | {{phpi|$wgPageTriageEnableCurationToolbar}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set to false to disable the [[Special:MyLanguage/Page Curation#User Experience: Curation Toolbar|curation toolbar]]</span> |- | {{phpi|$wgPageTriageInfiniteScrolling}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not to use infinite scrolling in the new pages feed</span> |- | {{phpi|$wgPageTriageMaxAge}} |90 | The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true). |- | {{phpi|$wgPageTriageNamespaces}} |NS_MAIN | The namespaces that PageTriage is active in. |- | {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} | {{phpi|false}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set this to true if new, unreviewed articles should be set to noindex.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In other words, if they should not be indexed by search engines until they are reviewed.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> See [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/extension.json#698|extension.json]] for the full list of config variables. </div> === API === <div lang="en" dir="ltr" class="mw-content-ltr"> PageTriage adds the following API endpoints which can be used: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">API</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Triggering action</span> |- |pagetriageaction | <span lang="en" dir="ltr" class="mw-content-ltr">Mark a page as reviewed or unreviewed, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to mark a page as reviewed * Using the Page Curation toolbar to mark a page as unreviewed |- |pagetriagelist | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves the list of pages in the queue, and each page's metadata, including their reviewed status.</span> To retrieve one page, you must provide the <code>page_id</code>. To provide multiple pages, you must select one of <code>showreviewed</code>/<code>showunreviewed</code>, and one of <code>showredirs</code>/<code>showdeleted</code>/<code>showothers</code>, or no pages will be returned. |Read | * Loading the Page Curation toolbar (automatically loaded if you have the <code>patrol</code> userright and view a page that is unpatrolled or recently patrolled) * Viewing Special:NewPagesFeed (provides the list of articles) |- |pagetriagestats | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves stats about the number of pages in the queue for use in the header of Special:NewPagesFeed.</span> |Read | * Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer) |- |pagetriagetagcopyvio |Mark an article as a potential copyright violation, and logs the action in Special:Log. |Write | * Marking as a copyright violation by a bot with the <code>copyviobot</code> userright |- |pagetriagetagging | <span lang="en" dir="ltr" class="mw-content-ltr">Add clean-up tags or deletion templates to a page, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to place a maintenance tag on an article * Using the Page Curation toolbar to place a deletion tag on an article |} === Special:Log === The following logs are created by the extension: {| class="wikitable" |+ !Special:Log !<code>log_type</code> !<code>log_action</code> !Description !Notes |- |Page curation log |pagetriage-curation |delete, enqueue, reviewed, tag, unreviewed |Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed | |- |Potential copyright violation log |pagetriage-copyvio |insert |Allows a bot to log potential copyright violations |Doesn't display unless you set {{phpi|$wgPageTriageEnableCopyvio}} to true |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Entry points === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The extension's features can be triggered by various actions: </div> {| class="wikitable" |+ !Entry point type !File location !Notes |- |5 APIs |includes/Api/* | |- |1 special page |includes/SpecialNewPagesFeed.php | |- |20 hooks | * includes/Hooks.php * includes/HookHandlers/UndeleteHookHandler.php * includes/HookHandlers/Schema.php | |- |1 cron job |cron/updatePageTriageQueue.php |runs every 48 hours |- |7 maintenance scripts |maintenance/* |need to be run manually |} Here is a list of some actions and the corresponding entry points they trigger: {| class="wikitable" |+ !Action !Entry points used |- |View Main page | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() |- |Save an edit to the Main page | * Hooks.php -> onRevisionFromEditComplete() * Hooks.php -> onPageSaveComplete() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onLinksUpdateComplete() |- |Type in search box, triggering search suggestions | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onApiMain__moduleManager() |- |View Special:NewPagesFeed | * Hooks.php -> onBeforeCreateEchoEvent() * SpecialNewPagesFeed * ApiPageTriageStats * ApiPageTriageList |- |View an unreviewed article while logged in and having the <code>patrol</code> permission. | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onResourceLoaderGetConfigVars() * Hooks.php -> onDefinedTags() * Hooks.php -> onApiMain__moduleManager() * ApiPageTriageList (by <code>page_id</code>) |} ==== Hooks ==== {| class="wikitable" |+ !File !Group !Hook !Actions it performs |- | rowspan="18" |Hooks.php |Move page |[[Manual:Hooks/PageMoveComplete|onPageMoveComplete]] |Changes patrolled status, updates cache, updates metadata in <code>pagetriage_page_tags</code> table. |- | rowspan="3" |Edit page |[[Manual:Hooks/RevisionFromEditComplete|onRevisionFromEditComplete]] |Handles marking '''redirects that flip to articles''' as unreviewed. [[Deferred updates|DeferredUpdate]]. |- |[[Manual:Hooks/PageSaveComplete|onPageSaveComplete]] |Add '''new articles''' to the New Pages Feed and <code>pagetriage_page</code> table. |- |[[Manual:Hooks/LinksUpdateComplete|onLinksUpdateComplete]] |[[Deferred updates|DeferredUpdate]] of metadata / <code>pagetriage_page_tags</code> table. |- |Every page load |[[Manual:Hooks/ArticleViewFooter|onArticleViewFooter]] | * Turn on '''noindex''' for new, unreviewed articles. * Determine whether to load a '''link for autopatrolled users to unpatrol''' their article * Displays the '''Page Curation toolbar''' on recently created pages. * Create '''"Add to New Pages Feed" toolbox link''' for old articles. |- |[[Help:Patrolled edits]] |[[Manual:Hooks/MarkPatrolledComplete|onMarkPatrolledComplete]] |Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage. |- | rowspan="2" |Blocking and unblocking |[[Manual:Hooks/BlockIpComplete|onBlockIpComplete]] | rowspan="2" |Update article metadata / <code>pagetriage_page_tags</code> when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users. |- |[[Manual:Hooks/UnblockUserComplete|onUnblockUserComplete]] |- | |[[Manual:Hooks/ResourceLoaderGetConfigVars|onResourceLoaderGetConfigVars]] |Adjusts some config vars related to draft namespace ID. |- | rowspan="3" |[[Extension:Echo]] |[[Manual:Hooks/BeforeCreateEchoEvent|onBeforeCreateEchoEvent]] | rowspan="3" |Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed. |- |[[Manual:Hooks/EchoGetDefaultNotifiedUsers|onEchoGetDefaultNotifiedUsers]] |- |[[Manual:Hooks/LocalUserCreated|onLocalUserCreated]] |- |[[Extension:ORES]] |[[Manual:Hooks/ORESCheckModels|onORESCheckModels]] |Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio. |- | rowspan="3" |[[Help:Tags]] |[[Manual:Hooks/ListDefinedTags|onListDefinedTags]] | rowspan="3" |Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage". |- |[[Manual:Hooks/ChangeTagsAllowedAdd|onChangeTagsAllowedAdd]] |- |[[Manual:Hooks/ChangeTagsListActive|onChangeTagsListActive]] |- |API |[[Manual:Hooks/ApiMain::moduleManager|onApiMain__moduleManager]] |Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings. |- | rowspan="2" |Delete or undelete page |[[Manual:Hooks/PageDeleteComplete|onPageDeleteComplete]] |If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache. |- |HookHandlers/ UndeleteHookHandler.php |[[Manual:Hooks/ArticleUndelete|onArticleUndelete]] |If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed. |- |HookHandlers/ Schema.php |SQL |[[Manual:Hooks/LoadExtensionSchemaUpdates|onLoadExtensionSchemaUpdates]] | * The code that installs PageTriage's 4 SQL tables when you run <code>php maintenance/run.php update</code>. * Will also alter schemas from previous versions to match the latest schema. * This is also where all the '''pagetriage_tags''' are hard-coded. |} ==== Cron jobs and maintenance scripts ==== {| class="wikitable" |+ !File !What it does !Why run it? When is it useful? ![[phab:T341431|Safe to delete maintenance script?]] |- |cron/updatePageTriageQueue.php |Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". |Keeps the SQL tables from getting too big. | |- |maintenance/cleanupPageTriage.php |Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. |Fix a bug? [[phab:T321982|T321982]] | |- |maintenance/cleanupPageTriageLog.php |Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log |One time conversion of old log entries to modern format? Logs are now always written in the new format. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/6d9105c020c62d648a4ef6be957297bbc8a6d7d2]. |Probably |- |maintenance/cleanupPageTriagePageTags.php |Remove page from <code>pagetriage_page_tags</code> if they are not in <code>pagetriage_page</code> |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/00a752368e00e0d8b29a4908bfc3bab3096268dd]. |Probably |- |maintenance/DeleteAfcStates.php |Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ab2d8d4a2f9d0f4ff981afaee35a85f33edb5e99]. [[phab:T203184#4592953|T203184#4592953]]. |Probably |- |maintenance/FixNominatedForDeletion.php |Set <code>pagetriage_page.ptrp_deleted</code> if the page is has any <code>pagetriage_page_tags</code> related to deletion (e.g. prod_status, blp_prod_status, etc.) |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ff0c433226300aeba692089b5389435d47feef1e]. [[phab:T202582|T202582]]. |Probably |- |maintenance/populateDraftQueue.php |Add missing Draft namespace pages to the AfC triage queue. |Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/59e1fedffcdafc46722d7231011aee194db9ee08]. | |- |maintenance/updateUserMetadata.php |Former cron job. Update expired user metadata in the <code>pagetriage_page_tags</code> table |[https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/92a675a5f1f2e07cee532ec90fc57eee7f2cd49b]. [[phab:T341432|T341432]]. | |} === NOINDEX === NOINDEX refers to the HTML code <code>&lt;meta name="robots" content="noindex"></code>, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode <code><nowiki>__NOINDEX__</nowiki></code>. When {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in <code>includes/Hooks.php</code>, in the <code>onArticleViewFooter()</code> method. ==== First check ==== * First check: Noindex the page if ALL of the following are true: ** {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is turned on ** Page age is less than {{phpi|$wgPageTriageMaxAge}} (set to 90 days on enwiki) ** Page is in <code>pagetriage_page</code> table<ref>Checked by <code>isPageUnreviewed()</code></ref> ** Page is marked as unpatrolled (ptrp_status = 0) ==== Second check ==== * Second check: If the wikitext has the <code><nowiki>__NOINDEX__</nowiki></code> magic word, noindex the page if ALL of the following are true: ** Page age is less than {{phpi|$wgPageTriageMaxNoIndexAge}} (set to 90 days on enwiki) ** If {{phpi|$wgPageTriageMaxNoIndexAge}} is not null, page is in <code>pagetriage_page</code> table<ref>Checked by <code>isNewEnoughToNoIndex()</code>, if it doesn't exit early due to <code>$wgPageTriageMaxNoIndexAge</code> being <code>null</code>.</ref> The main use case for the <nowiki>__NOINDEX__</nowiki> magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See [https://en.wikipedia.org/w/index.php?search=NOINDEX&title=Special:Search&profile=advanced&fulltext=1&ns10=1 this search]. ==== Is the page in the <code>pagetriage_page</code> table? ==== In regards to the requirement "Page is in <code>pagetriage_page</code> table", there are several ways a for a page to get into this table: * Not been deleted by a PageTriage cron job ** One cron job deletes redirects older than {{phpi|$wgPageTriageRedirectAutoreviewAge}} days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them. ** Another cron job deletes reviewed pages after 30 days of being reviewed * In a namespace that PageTriage is configured to patrol * Isn't an article that is so old it predates the installation of PageTriage == JavaScript == === Directory structure === * /modules/ ** ext.pageTriage.article - related to marking an article as reviewed ** ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar ** ext.pageTriage.init - creates a mw.pageTriage object ** ext.pageTriage.newPagesFeed - Special:NewPagesFeed ** ext.pageTriage.sidebarLink - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates ** ext.pageTriage.toolbar - Page Curation toolbar <!--** ext.pageTriage.toolbar - Page Curation toolbar (Vue version)--> ** ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code ** ext.pageTriage.util - Backbone.js models (article, revision, stats) ** external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore <div lang="en" dir="ltr" class="mw-content-ltr"> === Toolbar === </div> The toolbar has three states: <code>maximized</code>, <code>minimized</code>, and <code>hidden</code>. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu. === External libraries === * front end ** old (moving away from) *** [[w:Backbone.js|Backbone.js]] *** [[w:jQuery|jQuery]] *** jQuery Badge *** jQuery Waypoints *** [[w:jQuery UI|jQuery UI]] *** [[w:Mustache (template system)|Mustache (template system)]] *** [[OOUI]] - used in modules/ext.PageTriage.enqueue ([https://codesearch.wmcloud.org/deployed/?q=oojs&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FPageTriage codesearch]) *** [[w:Underscore.js|Underscore.js]] ** new (moving towards) *** Codex *** [[w:Moment.js|Moment.js]] *** Vue Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, [[phab:T208256|we are interested in replacing these front end libraries]], to make the extension easier to maintain. <div lang="en" dir="ltr" class="mw-content-ltr"> === Client-side hooks === </div> ==== mw.hook ==== * <code>ext.pageTriage.toolbar.ready</code> ==== mw.pageTriage.actionQueue ==== <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage provides a specialised action queue system to allow other scripts and gadgets to integrate with it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is similar to <code>mw.hook</code> except that it uses promises.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done using the <code>mw.pageTriage.actionQueue</code> module.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the comments in the {{tmpl|0={{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=$1}}|source code}} for documentation on how the system works.</span> {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">It is [$1 not currently used by any scripts or gadgets on enwiki], but it is used internally by PageTriage.</span> |1=https://en.wikipedia.org/w/index.php?search=%22actionQueue%22&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1&ns2300=1&ns2301=1&ns2302=1&ns2303=1 }} <span lang="en" dir="ltr" class="mw-content-ltr">The actionQueue module is available after the mw.hook <code>ext.pageTriage.toolbar.ready</code> fires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage will give the action queue handler an Object with the following data, in addition to other data as noted below:</span> * <code>pageid</code> — <span lang="en" dir="ltr" class="mw-content-ltr">ID of the page being reviewed.</span> * <code>title</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Title of the page, including namespace.</span> * <code>reviewer</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of who is using PageTriage.</span> * <code>creator</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of the creator of the page.</span> * <code>reviewed</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the page is currently or will be marked as reviewed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ===== Available actions ===== </div> * <code>delete</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the reviewer tags a page for deletion. The data given to the handler also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An object of all the templates added to the page. The keys are the template title, and the values are an object of metadata, including things like the speedy deletion code.</span> * <code>mark</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the review status of a page is changed. Also includes:</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> * <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when maintenance tags are added to the page. Also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An array of the titles of all templates that were added to the page.</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> <span id="Example"></span> ===== Przykład ===== <div lang="en" dir="ltr" class="mw-content-ltr"> To use the action queue, register a function to be ran when an aforementioned action is fired. PageTriage will wait for any asynchronous code to complete before doing anything else, such as refreshing the page. For example, to edit [[Sandbox]] after a page has been marked as reviewed, you could use: </div> <syntaxhighlight lang="javascript"> $( function () { // You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time. mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) { // Listen for the 'mark' action. queue.add( 'mark', function ( data ) { return new mw.Api().edit( 'Sandbox', function ( revision ) { // Replace 'foo' with the note the reviewer left. return revision.content.replace( 'foo', data.note ); } ); } ); } ); } ); </syntaxhighlight> === Where are preferences stored? === Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is <code>userjs-NewPagesFeedFilterOptions</code>. It is set using <code>mw.Api().saveOption()</code> and read using <code>mw.user.options.get()</code>. This data ends up in the SQL <code>user_properties</code> table. Temporary accounts (IP masking) will not be able to store their preferences. == Installation on WMF wikis == This extension was designed for English Wikipedia. There is interest in changing its code and making it more useful to other wikis ([[phab:T50552]]), however this is challenging from a technical perspective and progress is slow. For now, the following are true: * PageTriage is allowed to be installed on other wikis<ref>https://meta.wikimedia.org/w/index.php?title=Limits_to_configuration_changes&diff=prev&oldid=26121135</ref> (although as of 2024 this hasn't happened yet). * The setting <code>$wgPageTriageEnableExtendedFeatures</code> can be set to <code>false</code> to turn off English Wikipedia-specific features such as maintenance tags and deletion tags in the Page Curation toolbar. * There are concerns that the noindex features (controlled by <code>$wgPageTriageNoIndexUnreviewedNewArticles</code> and <code>$wgPageTriageMaxNoIndexAge</code>) create search engine optimization problems, and these noindex features should not be enabled on new wikis without first discussing it with product manager [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]. * Like most other WMF-deployed extensions, PageTriage supports internationalization, and has its interface [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/i18n/|translated into many other languages]]. <span id="See_also"></span> == Zobacz też == * [[commons:Category:PageTriage extension]] * [[Help:New pages feed]] * [[w:Wikipedia:Page Curation/Help]] == Notes == <references /> {{OnWikimedia}} {{Used by}} [[Category:API extensions{{#translation:}}]] cdhu5sumlvhmf2w946s5d3xw2927q7q Template:Update/fi 10 1514697 8364321 8364240 2026-05-03T12:47:02Z FuzzyBot 451990 Updating to match new version of source page 8364321 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |<span lang="en" dir="ltr" class="mw-content-ltr">The '''factual accuracy''' of parts of this page (those related to {{{part|{{{1|}}}}}}) '''may be compromised due to out-of-date information'''.</span> |Osat tästä sivusta (aiheeseen {{{part|{{{1|}}}}}} liittyvät) ovat '''vanhentuneita'''.}} |{{#if:{{{inaccurate|}}} |<span lang="en" dir="ltr" class="mw-content-ltr">The '''factual accuracy''' of this page '''may be compromised due to out-of-date information'''.</span> |Tämä sivu on '''vanhentunut'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|Se ole kirjoitettu MediaWikin vanhemmalle versiolle eikä välttämättä päde uusimpaan versioon.}} <span lang="en" dir="ltr" class="mw-content-ltr">If you have checked or updated this page and found the content to be suitable, please remove this notice.</span> {{#ifexist: {{TALKPAGENAME}} |&#32;<span lang="en" dir="ltr" class="mw-content-ltr">See the [[{{TALKPAGENAME}}|talk page]] for a possible discussion on this.</span> }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Viimeisin päivitys: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= <div lang="en" dir="ltr" class="mw-content-ltr"> Aliases of this template: </div> * {{tlx|outdated}} <span id="Examples"></span> == Esimerkkejä == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == Katso myös == * {{tl|historical}} == TemplateData == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> 84rhoc78hrzs2syn3ja0g19b1tyvd16 Help:Extension:Translate/Validators/de 12 1550816 8364874 6038825 2026-05-04T04:02:48Z FuzzyBot 451990 Updating to match new version of source page 8364874 wikitext text/x-wiki <languages/> {{Extension-Translate}} <span lang="en" dir="ltr" class="mw-content-ltr">Translatable strings often contain markup that should be retained as-is in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Typing that markup can be slow and difficult because special characters are common.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Translate extension can provide translators a button clicking on which inserts the piece of markup into the translation to the current cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In addition, if a translation is missing that specific markup, the Translate extension can either warn the translator or simply reject the translation, since such markup is usually mandatory to display the messages properly to the end user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example in the string, <blockquote>''Adapted by %{name} from a work by %{original}''</blockquote> there are two insertables - <code>%{name}</code> and <code>%{original}</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the translator does not add them to their translation, the end user using the software will not see a proper message.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>MessageValidator</code> framework has been added with the intent of helping with validating translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Validators run on the translated message and based on the configuration, a warning or error message is shown to the translator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Translations with warnings can still be saved, but ones that have error cannot.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only a user with <code>translate-manage</code> permission can save translations that have errors.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When configuring a validator, a regex is defined to identify markup that is mandatory.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The validator can also be marked as insertable, in which case a button will be displayed to the translator to add that markup into the translation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Adding a custom validators is still possible and will be needed for more specialized validations. </div> <span id="Configuration"></span> == Konfiguration == <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a summarized validator configuration, </div> <syntaxhighlight lang="yaml" line="1" start="1"> VALIDATORS: # Beispiel 1 - id: InsertableRegex enforce: true insertable: true params: /\$[a-z0-9]+/ keymatch: - 'untranslated' # Matches key untranslated directly - type: 'wildcard' pattern: '*translated*' # Matches any key that has the translated in it # Beispiel 2 - id: InsertableRegex insertable: true params: regex: /(?<pre>\[)[^]]+(?<post>\]\([^)]+\))/ display: $pre $post pre: $pre post: $post # Beispiel 3 - class: MathJaxMessageValidator enforce: true # Beispiel 4 - id: BraceBalance </syntaxhighlight> Im Beispiel oben, # <span lang="en" dir="ltr" class="mw-content-ltr"><code>InsertableRegex</code> is a bundled validator that can accept a custom regex and run validations.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>MathJaxMessageValidator</code> is a custom validator class.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>BraceBalance</code> is another bundled validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr"><code>VALIDATORS</code> uses an array format.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Lets look at the various parameters being used here in each array item,</span> <span id="Parameters"></span> === Parameter === {| class="wikitable" ! Eigenschaft ! Typ ! Beschreibung |- |id | Zeichenkette | <span lang="en" dir="ltr" class="mw-content-ltr">Incase a bundled / pre-provided validator is being used, the ID of the validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">''Required if <code>class</code> is not specified.''</span> |- |class | Zeichenkette | <span lang="en" dir="ltr" class="mw-content-ltr">If a custom validator is being used, then use this option instead of <code>id</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Specifies the name of the validator class.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #3''' in the above config.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>AUTOLOAD</code> option can be used to load the class.</span> <span lang="en" dir="ltr" class="mw-content-ltr">''Required if <code>id</code> is not specified.''</span> |- |enforce | Wahrheitswert | <span lang="en" dir="ltr" class="mw-content-ltr">Whether the validator should be enforced.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If set to true, and a translation fails validation, an error will be displayed which must be fixed in order to save the translation.</span> |- |insertable | Wahrheitswert | <span lang="en" dir="ltr" class="mw-content-ltr">Whether the validator should also be an insertable.</span> |- |keymatch | Array | <span lang="en" dir="ltr" class="mw-content-ltr">With this option it is possible to limit certain validations to certain messages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Keymatch is an array with each option being either a '''string''' or a '''prototype.''' If it is a string, a direct comparison with the message key is done.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #1''' in the above config.</span> |- |keymatch[i].type | Zeichenkette | <span lang="en" dir="ltr" class="mw-content-ltr">Type is either ''regex'' or ''wildcard''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is the approach that will be used to check if the message key matches a given pattern.</span> |- |keymatch[i].pattern | Zeichenkette | <span lang="en" dir="ltr" class="mw-content-ltr">Pattern is a string that will be used for matching.</span> |- |params | <span lang="en" dir="ltr" class="mw-content-ltr">string / associative array</span> | <span lang="en" dir="ltr" class="mw-content-ltr">If <code>params</code> is specified '''as a string''', it is used as the regex.</span> Siehe '''Beispiel #1'''. <div lang="en" dir="ltr" class="mw-content-ltr"> In this case if insertable is true, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>display</code> is the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>pre</code> is also the first value from the regex match.</span> # <code>post</code> wird leer gelassen. <span lang="en" dir="ltr" class="mw-content-ltr">If <code>params</code> is specified '''as an associative array (see example #2)''', see below for further details.</span> |- |params.regex | Zeichenkette | <span lang="en" dir="ltr" class="mw-content-ltr">The regex to be used for validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Must use named captures.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When specifying named captures, do not use the <code>$</code> symbol in the name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In '''example #2''', two named captures are used - <code>pre</code> and <code>post</code>.</span> |- |params.display | Zeichenkette | <span lang="en" dir="ltr" class="mw-content-ltr">Mandatory value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The display value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> Siehe '''Beispiel #2'''. |- |params.pre | Zeichenkette | <span lang="en" dir="ltr" class="mw-content-ltr">The pre value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted before the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, is set to the display value.</span> Siehe '''Beispiel #2'''. |- |params.post | Zeichenkette | <span lang="en" dir="ltr" class="mw-content-ltr">The post value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted after the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> Siehe '''Beispiel #2'''. <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, defaults to an empty string.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Pre-provided / Bundled validators === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a list of bundled validators, </div> ==== BraceBalance ==== ID: <code>BraceBalance</code> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the number of open braces / brackets, matches the number of closed braces / brackets in the translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, the following translations would pass, </div> * <code><nowiki>{{ }}</nowiki></code> * <code>[ ]</code> <span lang="en" dir="ltr" class="mw-content-ltr">whereas, the following would fail,</span> * <code>[ ]]</code> * <code><nowiki>{{ }</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator cannot be marked as insertable.</span> ==== EscapeCharacter ==== ID: <code>EscapeCharacter</code> <div lang="en" dir="ltr" class="mw-content-ltr"> The validator ensures that only the specified escape character are present in a translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The allowed escape characters can be specified when adding the validator, and can only include, </div> * <code>\t</code> * <code>\n</code> * <code>\'</code> * <code>\"</code> * <code>\f</code> * <code>\r</code> * <code>\a</code> * <code>\b</code> * <code>\\</code> Dieser Validator ist nicht einsetzbar. ==== GettextNewline ==== ID: <code>GettextNewline</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically for GetText based message groups. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the translation has the same number of newlines as the source message at the beginning and end of the string. </div> ==== GettextPlural ==== ID: <code>GettextPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on GetText based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL:GETTEXT|one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== InsertableRegex ==== ID: <code>InsertableRegex</code> <div lang="en" dir="ltr" class="mw-content-ltr"> A generic reusable validator that can be used to specify custom validations and insertables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, take the following configuration where the validator is marked as insertable and enforced, </div> <syntaxhighlight lang="yaml"> - id: InsertableRegex enforce: true insertable: true params: "/\$[a-zA-Z0-9]+/" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Given the following source message - ''Hello $name. My name is $myName.'' that is being translated, the translation must have the parameters - ''$name'' and ''$myName''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will also be displayed as insertables to make it easier for translators to use them in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An absence of these parameters will cause an error to be displayed to the translator.</span> ==== InsertableRubyVariable ==== ID: <code>InsertableRubyVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches ruby variables in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>%{[a-zA-Z_]+}</code>.</span> Dieser Validator ist einsetzbar. Beispiel: <code>%{abc}</code> ==== IosVariable ==== ID: <code>IosVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">An insertable variable validator for Ios.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Regex is used [https://github.com/dcordero/Rubustrings/blob/61d477bffbb318ca3ffed9c2afc49ec301931d93/lib/rubustrings/action.rb#L91 from this Rubustrings source].</span> Dieser Validator ist einsetzbar. Beispiel: <code>%@</code> ==== MatchSet ==== ID: <code>MatchSet</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation is present in the list of values.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also takes a parameter - <code>caseSensitive</code> that can be either true (''default'') or false.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the following configuration, the validator will validate the message with key - <code>html.dir</code> and ensure that the values for it can either be ''ltr'' or ''rtl''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that LTR or RTL will not be valid values, since <code>caseSensitive</code> is true by default.</span> <syntaxhighlight lang="yaml" line="1" start="1"> - id: MatchSet enforce: true keymatch: - html.dir params: values: - ltr - rtl </syntaxhighlight> ==== MediaWikiLink ==== ID: <code>MediaWikiLink</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if the translation uses links that are discouraged.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Valid links are those that link to Special: pages, <code><nowiki>{{ns:special}}:</nowiki></code> or project pages trough MediaWiki messages like <code><nowiki>{{MediaWiki:helppage-url}}:</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also links in the definition are allowed.</span> ==== MediaWikiPageName ==== ID: <code>MediaWikiPageName</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a namespace such as <code><nowiki>{{ns:project}}:hello</nowiki></code> the translations made do not try to translate the namespaces itself.</span> ==== MediaWikiParameter ==== ID: <code>MediaWikiParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches wiki parameters in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>/\$[1-9]/</code>.</span> Dieser Validator ist einsetzbar. Beispiel: <code>$1</code>, <code>$2</code>. ==== MediaWikiPlural ==== ID: <code>MediaWikiPlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a <code><nowiki>{{PLURAL:$1|message|messages}}</nowiki></code>, the translation should also have it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It can also be used as an insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has three.</span> ==== MediaWikiTimeList ==== ID: <code>MediaWikiTimeList</code> <span lang="en" dir="ltr" class="mw-content-ltr">Provides validations for expiry options and IP block options specified in the MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These are usually in the format,</span> <syntaxhighlight lang="text"> indefinite:indefinite,3 hours:3 hours,12 hours:12 hours,24 hours:24 hours,31 hours:31 hours,36 hours:36 hours,48 hours:48 hours,60 hours:60 hours,72 hours:72 hours,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,2 years:2 years,3 years:3 years,infinite:indefinite </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The validations ensure that the translations have the exact same number of key-value pairs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These validations are run only on messages with keys,</span> # protect-expiry-options # ipboptions ==== Newline ==== ID: <code>Newline</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has the same number of newlines as the source / definition message at the ''beginning of the string''.</span> Dieser Validator ist nicht einsetzbar. ==== NotEmpty ==== ID: <code>NotEmpty</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has some content, and that content is not just whitespace.</span> Dieser Validator ist nicht einsetzbar. ==== NumericalParameter ==== ID: <code>NumericalParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches numerical parameters by using the following regex: <code>/\$\d+/</code>.</span> Dieser Validator ist einsetzbar. Beispiel: <code>$33</code>, <code>$1</code> etc. ==== Printf ==== ID: <code>Printf</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator checks for missing and unknown printf formatting characters in translations.</span> Dieser Validator ist einsetzbar. Beispiel: <code>%2$f</code>, <code>%d</code> etc. ==== PythonInterpolation ==== ID: <code>PythonInterpolation</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches python string interpolation variables by using the following regex: <code>/\%(?:\([a-zA-Z0-9]*?\))?[diouxXeEfFgGcrs]/U</code>.</span> Dieser Validator ist einsetzbar. Beispiel: <code>%s</code>, <code>%(name)s</code> ==== Replacement ==== ID: <code>Replacement</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if a translation is using the <code>search</code> string, and instead suggests the translator to use the string mentioned under <code>replacement</code>.</span> Dieser Validator ist nicht einsetzbar. <syntaxhighlight lang="yaml" line="1"> - id: Replacement enforce: true params: search: '{{PLURAL:' replace: '{PLURAL:' </syntaxhighlight> ==== SmartFormatPlural ==== ID: <code>SmartFormatPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on [https://github.com/axuno/SmartFormat SmartFormat] based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code>{1:test|tests}{0:message|messages}</code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== UnicodePlural ==== ID: <code>UnicodePlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL|one=one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has three.</span> <span id="User_interface"></span> == Benutzeroberfläche == <span lang="en" dir="ltr" class="mw-content-ltr">The user interface has been updated to differentiate between errors and warnings.</span> [[File:Translate-validation-err-warning.png|thumb|345x345px|alt=|<span lang="en" dir="ltr" class="mw-content-ltr">A warning and error shown on top of a translation</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> During translation, if an error is noticed with the translation, the '''Save translation''' button is disabled unless the user who is translating has <code>translate-manage</code> permission. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally validation is also done on the server when the user is saving the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will still allow users who have the <code>translate-manage</code> permission to save the translation even if it has errors.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Custom validators == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Certain complicated validations might still require a custom validator to be written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Custom validators must implement the <code>MediaWiki\Extensions\Translate\Validation\MessageValidator</code> interface [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/MessageValidator.php].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Below is an example of a custom validator, </div> <syntaxhighlight lang="php" line="1" start="1"> <?php // Filename: Validator.php use MediaWiki\Extensions\Translate\Validation\MessageValidator; use MediaWiki\Extensions\Translate\Validation\ValidationIssue; use MediaWiki\Extensions\Translate\Validation\ValidationIssues; /** * My Custom Validator */ class MyCustomValidator implements MessageValidator { public function getIssues( TMessage $message, string $targetLanguage ): ValidationIssues { $issues = new ValidationIssues(); // Validation code goes here. Push ValidationIssue into the ValidationIssues. z.B.: $issue = new ValidationIssue( 'value-not-present', // Typ 'invalid', // Subtyp 'translate-checks-value-not-present', // message key [ // message params [ 'PLAIN-PARAMS', $this->possibleValues ], [ 'COUNT', count( $this->possibleValues ) ] ] ); $issues->add( $issue ); return $issues; } } </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Also see the following classes,</span> # <code>ValidationIssues</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssues.php # <code>ValidationIssue</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssue.php <span lang="en" dir="ltr" class="mw-content-ltr">The add the custom validator in the configuration file,</span> <syntaxhighlight lang="yaml"> VALIDATORS: - class: MyCustomValidator enforce: true AUTOLOAD: MyCustomValidator: Validator.php </syntaxhighlight> iydfwl48o2k67o515f7st7h4owiktud Help:Extension:Translate/Validators/tr 12 1557223 8364879 6038832 2026-05-04T04:02:51Z FuzzyBot 451990 Updating to match new version of source page 8364879 wikitext text/x-wiki <languages/> {{Extension-Translate}} <span lang="en" dir="ltr" class="mw-content-ltr">Translatable strings often contain markup that should be retained as-is in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Typing that markup can be slow and difficult because special characters are common.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Translate extension can provide translators a button clicking on which inserts the piece of markup into the translation to the current cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In addition, if a translation is missing that specific markup, the Translate extension can either warn the translator or simply reject the translation, since such markup is usually mandatory to display the messages properly to the end user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example in the string, <blockquote>''Adapted by %{name} from a work by %{original}''</blockquote> there are two insertables - <code>%{name}</code> and <code>%{original}</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the translator does not add them to their translation, the end user using the software will not see a proper message.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>MessageValidator</code> framework has been added with the intent of helping with validating translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Validators run on the translated message and based on the configuration, a warning or error message is shown to the translator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Translations with warnings can still be saved, but ones that have error cannot.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only a user with <code>translate-manage</code> permission can save translations that have errors.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When configuring a validator, a regex is defined to identify markup that is mandatory.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The validator can also be marked as insertable, in which case a button will be displayed to the translator to add that markup into the translation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Adding a custom validators is still possible and will be needed for more specialized validations. </div> <span id="Configuration"></span> == Yapılandırma == <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a summarized validator configuration, </div> <syntaxhighlight lang="yaml" line="1" start="1"> VALIDATORS: # Örnek 1 - id: InsertableRegex enforce: true insertable: true params: /\$[a-z0-9]+/ keymatch: - 'untranslated' # Matches key untranslated directly - type: 'wildcard' pattern: '*translated*' # Matches any key that has the translated in it # Örnek 2 - id: InsertableRegex insertable: true params: regex: /(?<pre>\[)[^]]+(?<post>\]\([^)]+\))/ display: $pre $post pre: $pre post: $post # Örnek 3 - class: MathJaxMessageValidator enforce: true # Örnek 4 - id: BraceBalance </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In the example above, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>InsertableRegex</code> is a bundled validator that can accept a custom regex and run validations.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>MathJaxMessageValidator</code> is a custom validator class.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>BraceBalance</code> is another bundled validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr"><code>VALIDATORS</code> uses an array format.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Lets look at the various parameters being used here in each array item,</span> <span id="Parameters"></span> === Parametreler === {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Property</span> ! Tür ! Açıklama |- |id | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Incase a bundled / pre-provided validator is being used, the ID of the validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">''Required if <code>class</code> is not specified.''</span> |- |class | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">If a custom validator is being used, then use this option instead of <code>id</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Specifies the name of the validator class.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #3''' in the above config.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>AUTOLOAD</code> option can be used to load the class.</span> <span lang="en" dir="ltr" class="mw-content-ltr">''Required if <code>id</code> is not specified.''</span> |- |enforce | <span lang="en" dir="ltr" class="mw-content-ltr">boolean</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether the validator should be enforced.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If set to true, and a translation fails validation, an error will be displayed which must be fixed in order to save the translation.</span> |- |insertable | <span lang="en" dir="ltr" class="mw-content-ltr">boolean</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether the validator should also be an insertable.</span> |- |keymatch | <span lang="en" dir="ltr" class="mw-content-ltr">array</span> | <span lang="en" dir="ltr" class="mw-content-ltr">With this option it is possible to limit certain validations to certain messages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Keymatch is an array with each option being either a '''string''' or a '''prototype.''' If it is a string, a direct comparison with the message key is done.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #1''' in the above config.</span> |- |keymatch[i].type | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Type is either ''regex'' or ''wildcard''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is the approach that will be used to check if the message key matches a given pattern.</span> |- |keymatch[i].pattern | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pattern is a string that will be used for matching.</span> |- |params | <span lang="en" dir="ltr" class="mw-content-ltr">string / associative array</span> | <span lang="en" dir="ltr" class="mw-content-ltr">If <code>params</code> is specified '''as a string''', it is used as the regex.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #1'''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case if insertable is true, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>display</code> is the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>pre</code> is also the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>post</code> is left empty.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If <code>params</code> is specified '''as an associative array (see example #2)''', see below for further details.</span> |- |params.regex | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">The regex to be used for validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Must use named captures.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When specifying named captures, do not use the <code>$</code> symbol in the name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In '''example #2''', two named captures are used - <code>pre</code> and <code>post</code>.</span> |- |params.display | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Mandatory value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The display value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #2'''.</span> |- |params.pre | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">The pre value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted before the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, is set to the display value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #2'''.</span> |- |params.post | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">The post value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted after the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #2'''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, defaults to an empty string.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Pre-provided / Bundled validators === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a list of bundled validators, </div> ==== BraceBalance ==== ID: <code>BraceBalance</code> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the number of open braces / brackets, matches the number of closed braces / brackets in the translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, the following translations would pass, </div> * <code><nowiki>{{ }}</nowiki></code> * <code>[ ]</code> <span lang="en" dir="ltr" class="mw-content-ltr">whereas, the following would fail,</span> * <code>[ ]]</code> * <code><nowiki>{{ }</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator cannot be marked as insertable.</span> ==== EscapeCharacter ==== ID: <code>EscapeCharacter</code> <div lang="en" dir="ltr" class="mw-content-ltr"> The validator ensures that only the specified escape character are present in a translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The allowed escape characters can be specified when adding the validator, and can only include, </div> * <code>\t</code> * <code>\n</code> * <code>\'</code> * <code>\"</code> * <code>\f</code> * <code>\r</code> * <code>\a</code> * <code>\b</code> * <code>\\</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> ==== GettextNewline ==== ID: <code>GettextNewline</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically for GetText based message groups. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the translation has the same number of newlines as the source message at the beginning and end of the string. </div> ==== GettextPlural ==== ID: <code>GettextPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on GetText based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL:GETTEXT|one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== InsertableRegex ==== ID: <code>InsertableRegex</code> <div lang="en" dir="ltr" class="mw-content-ltr"> A generic reusable validator that can be used to specify custom validations and insertables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, take the following configuration where the validator is marked as insertable and enforced, </div> <syntaxhighlight lang="yaml"> - id: InsertableRegex enforce: true insertable: true params: "/\$[a-zA-Z0-9]+/" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Given the following source message - ''Hello $name. My name is $myName.'' that is being translated, the translation must have the parameters - ''$name'' and ''$myName''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will also be displayed as insertables to make it easier for translators to use them in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An absence of these parameters will cause an error to be displayed to the translator.</span> ==== InsertableRubyVariable ==== ID: <code>InsertableRubyVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches ruby variables in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>%{[a-zA-Z_]+}</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> Örnek: <code>%{abc}</code> ==== IosVariable ==== ID: <code>IosVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">An insertable variable validator for Ios.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Regex is used [https://github.com/dcordero/Rubustrings/blob/61d477bffbb318ca3ffed9c2afc49ec301931d93/lib/rubustrings/action.rb#L91 from this Rubustrings source].</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> Örnek: <code>%@</code> ==== MatchSet ==== ID: <code>MatchSet</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation is present in the list of values.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also takes a parameter - <code>caseSensitive</code> that can be either true (''default'') or false.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the following configuration, the validator will validate the message with key - <code>html.dir</code> and ensure that the values for it can either be ''ltr'' or ''rtl''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that LTR or RTL will not be valid values, since <code>caseSensitive</code> is true by default.</span> <syntaxhighlight lang="yaml" line="1" start="1"> - id: MatchSet enforce: true keymatch: - html.dir params: values: - ltr - rtl </syntaxhighlight> ==== MediaWikiLink ==== ID: <code>MediaWikiLink</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if the translation uses links that are discouraged.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Valid links are those that link to Special: pages, <code><nowiki>{{ns:special}}:</nowiki></code> or project pages trough MediaWiki messages like <code><nowiki>{{MediaWiki:helppage-url}}:</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also links in the definition are allowed.</span> ==== MediaWikiPageName ==== ID: <code>MediaWikiPageName</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a namespace such as <code><nowiki>{{ns:project}}:hello</nowiki></code> the translations made do not try to translate the namespaces itself.</span> ==== MediaWikiParameter ==== ID: <code>MediaWikiParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches wiki parameters in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>/\$[1-9]/</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> Örnek: <code>$1</code>, <code>$2</code>. ==== MediaWikiPlural ==== ID: <code>MediaWikiPlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a <code><nowiki>{{PLURAL:$1|message|messages}}</nowiki></code>, the translation should also have it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It can also be used as an insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has three.</span> ==== MediaWikiTimeList ==== ID: <code>MediaWikiTimeList</code> <span lang="en" dir="ltr" class="mw-content-ltr">Provides validations for expiry options and IP block options specified in the MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These are usually in the format,</span> <syntaxhighlight lang="text"> indefinite:indefinite,3 hours:3 hours,12 hours:12 hours,24 hours:24 hours,31 hours:31 hours,36 hours:36 hours,48 hours:48 hours,60 hours:60 hours,72 hours:72 hours,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,2 years:2 years,3 years:3 years,infinite:indefinite </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The validations ensure that the translations have the exact same number of key-value pairs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These validations are run only on messages with keys,</span> # protect-expiry-options # ipboptions ==== Newline ==== ID: <code>Newline</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has the same number of newlines as the source / definition message at the ''beginning of the string''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> ==== NotEmpty ==== ID: <code>NotEmpty</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has some content, and that content is not just whitespace.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> ==== NumericalParameter ==== ID: <code>NumericalParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches numerical parameters by using the following regex: <code>/\$\d+/</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> Örnek: <code>$33</code>, <code>$1</code> etc. ==== Printf ==== ID: <code>Printf</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator checks for missing and unknown printf formatting characters in translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> Örnek: <code>%2$f</code>, <code>%d</code> etc. ==== PythonInterpolation ==== ID: <code>PythonInterpolation</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches python string interpolation variables by using the following regex: <code>/\%(?:\([a-zA-Z0-9]*?\))?[diouxXeEfFgGcrs]/U</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> Örnek: <code>%s</code>, <code>%(name)s</code> ==== Replacement ==== ID: <code>Replacement</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if a translation is using the <code>search</code> string, and instead suggests the translator to use the string mentioned under <code>replacement</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> <syntaxhighlight lang="yaml" line="1"> - id: Replacement enforce: true params: search: '{{PLURAL:' replace: '{PLURAL:' </syntaxhighlight> ==== SmartFormatPlural ==== ID: <code>SmartFormatPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on [https://github.com/axuno/SmartFormat SmartFormat] based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code>{1:test|tests}{0:message|messages}</code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== UnicodePlural ==== ID: <code>UnicodePlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL|one=one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has three.</span> <span id="User_interface"></span> == Kullanıcı arayüzü == <span lang="en" dir="ltr" class="mw-content-ltr">The user interface has been updated to differentiate between errors and warnings.</span> [[File:Translate-validation-err-warning.png|thumb|345x345px|alt=|<span lang="en" dir="ltr" class="mw-content-ltr">A warning and error shown on top of a translation</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> During translation, if an error is noticed with the translation, the '''Save translation''' button is disabled unless the user who is translating has <code>translate-manage</code> permission. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally validation is also done on the server when the user is saving the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will still allow users who have the <code>translate-manage</code> permission to save the translation even if it has errors.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Custom validators == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Certain complicated validations might still require a custom validator to be written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Custom validators must implement the <code>MediaWiki\Extensions\Translate\Validation\MessageValidator</code> interface [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/MessageValidator.php].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Below is an example of a custom validator, </div> <syntaxhighlight lang="php" line="1" start="1"> <?php // Filename: Validator.php use MediaWiki\Extensions\Translate\Validation\MessageValidator; use MediaWiki\Extensions\Translate\Validation\ValidationIssue; use MediaWiki\Extensions\Translate\Validation\ValidationIssues; /** * My Custom Validator */ class MyCustomValidator implements MessageValidator { public function getIssues( TMessage $message, string $targetLanguage ): ValidationIssues { $issues = new ValidationIssues(); // Validation code goes here. Push ValidationIssue into the ValidationIssues. Ör.: $issue = new ValidationIssue( 'value-not-present', // type 'invalid', // sub-type 'translate-checks-value-not-present', // message key [ // message params [ 'PLAIN-PARAMS', $this->possibleValues ], [ 'COUNT', count( $this->possibleValues ) ] ] ); $issues->add( $issue ); return $issues; } } </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Also see the following classes,</span> # <code>ValidationIssues</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssues.php # <code>ValidationIssue</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssue.php <span lang="en" dir="ltr" class="mw-content-ltr">The add the custom validator in the configuration file,</span> <syntaxhighlight lang="yaml"> VALIDATORS: - class: MyCustomValidator enforce: true AUTOLOAD: MyCustomValidator: Validator.php </syntaxhighlight> b4skbu30dvy9m10rpu06xxvchljfw3o Help:Extension:Translate/Validators/fr 12 1562346 8364876 6197408 2026-05-04T04:02:50Z FuzzyBot 451990 Updating to match new version of source page 8364876 wikitext text/x-wiki <languages/> {{Extension-Translate}} <span lang="en" dir="ltr" class="mw-content-ltr">Translatable strings often contain markup that should be retained as-is in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Typing that markup can be slow and difficult because special characters are common.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Translate extension can provide translators a button clicking on which inserts the piece of markup into the translation to the current cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In addition, if a translation is missing that specific markup, the Translate extension can either warn the translator or simply reject the translation, since such markup is usually mandatory to display the messages properly to the end user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example in the string, <blockquote>''Adapted by %{name} from a work by %{original}''</blockquote> there are two insertables - <code>%{name}</code> and <code>%{original}</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the translator does not add them to their translation, the end user using the software will not see a proper message.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>MessageValidator</code> framework has been added with the intent of helping with validating translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Validators run on the translated message and based on the configuration, a warning or error message is shown to the translator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Translations with warnings can still be saved, but ones that have error cannot.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only a user with <code>translate-manage</code> permission can save translations that have errors.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When configuring a validator, a regex is defined to identify markup that is mandatory.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The validator can also be marked as insertable, in which case a button will be displayed to the translator to add that markup into the translation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Adding a custom validators is still possible and will be needed for more specialized validations. </div> == Configuration == <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a summarized validator configuration, </div> <syntaxhighlight lang="yaml" line="1" start="1"> VALIDATORS: # Example 1 - id: InsertableRegex enforce: true insertable: true params: /\$[a-z0-9]+/ keymatch: - 'untranslated' # Matches key untranslated directly - type: 'wildcard' pattern: '*translated*' # Matches any key that has the translated in it # Example 2 - id: InsertableRegex insertable: true params: regex: /(?<pre>\[)[^]]+(?<post>\]\([^)]+\))/ display: $pre $post pre: $pre post: $post # Example 3 - class: MathJaxMessageValidator enforce: true # Example 4 - id: BraceBalance </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In the example above, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>InsertableRegex</code> is a bundled validator that can accept a custom regex and run validations.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>MathJaxMessageValidator</code> is a custom validator class.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>BraceBalance</code> is another bundled validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr"><code>VALIDATORS</code> uses an array format.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Lets look at the various parameters being used here in each array item,</span> <span id="Parameters"></span> === Paramètres === {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Property</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> |- |id | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Incase a bundled / pre-provided validator is being used, the ID of the validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">''Required if <code>class</code> is not specified.''</span> |- |class | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">If a custom validator is being used, then use this option instead of <code>id</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Specifies the name of the validator class.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #3''' in the above config.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>AUTOLOAD</code> option can be used to load the class.</span> <span lang="en" dir="ltr" class="mw-content-ltr">''Required if <code>id</code> is not specified.''</span> |- |enforce | <span lang="en" dir="ltr" class="mw-content-ltr">boolean</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether the validator should be enforced.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If set to true, and a translation fails validation, an error will be displayed which must be fixed in order to save the translation.</span> |- |insertable | <span lang="en" dir="ltr" class="mw-content-ltr">boolean</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether the validator should also be an insertable.</span> |- |keymatch | <span lang="en" dir="ltr" class="mw-content-ltr">array</span> | <span lang="en" dir="ltr" class="mw-content-ltr">With this option it is possible to limit certain validations to certain messages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Keymatch is an array with each option being either a '''string''' or a '''prototype.''' If it is a string, a direct comparison with the message key is done.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #1''' in the above config.</span> |- |keymatch[i].type | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Type is either ''regex'' or ''wildcard''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is the approach that will be used to check if the message key matches a given pattern.</span> |- |keymatch[i].pattern | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pattern is a string that will be used for matching.</span> |- |params | <span lang="en" dir="ltr" class="mw-content-ltr">string / associative array</span> | <span lang="en" dir="ltr" class="mw-content-ltr">If <code>params</code> is specified '''as a string''', it is used as the regex.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #1'''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case if insertable is true, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>display</code> is the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>pre</code> is also the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>post</code> is left empty.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If <code>params</code> is specified '''as an associative array (see example #2)''', see below for further details.</span> |- |params.regex | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">The regex to be used for validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Must use named captures.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When specifying named captures, do not use the <code>$</code> symbol in the name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In '''example #2''', two named captures are used - <code>pre</code> and <code>post</code>.</span> |- |params.display | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Mandatory value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The display value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #2'''.</span> |- |params.pre | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">The pre value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted before the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, is set to the display value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #2'''.</span> |- |params.post | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">The post value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted after the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #2'''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, defaults to an empty string.</span> |} <span id="Pre-provided_/_Bundled_validators"></span> === Valideurs préfournis ou embarqués === <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a list of bundled validators, </div> ==== BraceBalance ==== ID: <code>BraceBalance</code> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the number of open braces / brackets, matches the number of closed braces / brackets in the translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, the following translations would pass, </div> * <code><nowiki>{{ }}</nowiki></code> * <code>[ ]</code> <span lang="en" dir="ltr" class="mw-content-ltr">whereas, the following would fail,</span> * <code>[ ]]</code> * <code><nowiki>{{ }</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator cannot be marked as insertable.</span> ==== EscapeCharacter ==== ID: <code>EscapeCharacter</code> <div lang="en" dir="ltr" class="mw-content-ltr"> The validator ensures that only the specified escape character are present in a translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The allowed escape characters can be specified when adding the validator, and can only include, </div> * <code>\t</code> * <code>\n</code> * <code>\'</code> * <code>\"</code> * <code>\f</code> * <code>\r</code> * <code>\a</code> * <code>\b</code> * <code>\\</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> ==== GettextNewline ==== ID: <code>GettextNewline</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically for GetText based message groups. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the translation has the same number of newlines as the source message at the beginning and end of the string. </div> ==== GettextPlural ==== ID: <code>GettextPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on GetText based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL:GETTEXT|one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== InsertableRegex ==== ID: <code>InsertableRegex</code> <div lang="en" dir="ltr" class="mw-content-ltr"> A generic reusable validator that can be used to specify custom validations and insertables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, take the following configuration where the validator is marked as insertable and enforced, </div> <syntaxhighlight lang="yaml"> - id: InsertableRegex enforce: true insertable: true params: "/\$[a-zA-Z0-9]+/" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Given the following source message - ''Hello $name. My name is $myName.'' that is being translated, the translation must have the parameters - ''$name'' and ''$myName''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will also be displayed as insertables to make it easier for translators to use them in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An absence of these parameters will cause an error to be displayed to the translator.</span> ==== InsertableRubyVariable ==== ID: <code>InsertableRubyVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches ruby variables in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>%{[a-zA-Z_]+}</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>%{abc}</code> ==== IosVariable ==== ID: <code>IosVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">An insertable variable validator for Ios.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Regex is used [https://github.com/dcordero/Rubustrings/blob/61d477bffbb318ca3ffed9c2afc49ec301931d93/lib/rubustrings/action.rb#L91 from this Rubustrings source].</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>%@</code> ==== MatchSet ==== ID: <code>MatchSet</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation is present in the list of values.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also takes a parameter - <code>caseSensitive</code> that can be either true (''default'') or false.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the following configuration, the validator will validate the message with key - <code>html.dir</code> and ensure that the values for it can either be ''ltr'' or ''rtl''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that LTR or RTL will not be valid values, since <code>caseSensitive</code> is true by default.</span> <syntaxhighlight lang="yaml" line="1" start="1"> - id: MatchSet enforce: true keymatch: - html.dir params: values: - ltr - rtl </syntaxhighlight> ==== MediaWikiLink ==== ID: <code>MediaWikiLink</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if the translation uses links that are discouraged.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Valid links are those that link to Special: pages, <code><nowiki>{{ns:special}}:</nowiki></code> or project pages trough MediaWiki messages like <code><nowiki>{{MediaWiki:helppage-url}}:</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also links in the definition are allowed.</span> ==== MediaWikiPageName ==== ID: <code>MediaWikiPageName</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a namespace such as <code><nowiki>{{ns:project}}:hello</nowiki></code> the translations made do not try to translate the namespaces itself.</span> ==== MediaWikiParameter ==== ID: <code>MediaWikiParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches wiki parameters in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>/\$[1-9]/</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>$1</code>, <code>$2</code>. ==== MediaWikiPlural ==== ID: <code>MediaWikiPlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a <code><nowiki>{{PLURAL:$1|message|messages}}</nowiki></code>, the translation should also have it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It can also be used as an insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has three.</span> ==== MediaWikiTimeList ==== ID: <code>MediaWikiTimeList</code> <span lang="en" dir="ltr" class="mw-content-ltr">Provides validations for expiry options and IP block options specified in the MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These are usually in the format,</span> <syntaxhighlight lang="text"> indefinite:indefinite,3 hours:3 hours,12 hours:12 hours,24 hours:24 hours,31 hours:31 hours,36 hours:36 hours,48 hours:48 hours,60 hours:60 hours,72 hours:72 hours,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,2 years:2 years,3 years:3 years,infinite:indefinite </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The validations ensure that the translations have the exact same number of key-value pairs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These validations are run only on messages with keys,</span> # protect-expiry-options # ipboptions ==== Newline ==== ID: <code>Newline</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has the same number of newlines as the source / definition message at the ''beginning of the string''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> ==== NotEmpty ==== ID: <code>NotEmpty</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has some content, and that content is not just whitespace.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> ==== NumericalParameter ==== ID: <code>NumericalParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches numerical parameters by using the following regex: <code>/\$\d+/</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>$33</code>, <code>$1</code> etc. ==== Printf ==== ID: <code>Printf</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator checks for missing and unknown printf formatting characters in translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>%2$f</code>, <code>%d</code> etc. ==== PythonInterpolation ==== ID: <code>PythonInterpolation</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches python string interpolation variables by using the following regex: <code>/\%(?:\([a-zA-Z0-9]*?\))?[diouxXeEfFgGcrs]/U</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>%s</code>, <code>%(name)s</code> ==== Replacement ==== ID: <code>Replacement</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if a translation is using the <code>search</code> string, and instead suggests the translator to use the string mentioned under <code>replacement</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> <syntaxhighlight lang="yaml" line="1"> - id: Replacement enforce: true params: search: '{{PLURAL:' replace: '{PLURAL:' </syntaxhighlight> ==== SmartFormatPlural ==== ID: <code>SmartFormatPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on [https://github.com/axuno/SmartFormat SmartFormat] based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code>{1:test|tests}{0:message|messages}</code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== UnicodePlural ==== ID: <code>UnicodePlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL|one=one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has three.</span> <span id="User_interface"></span> == Interface utilisateur == <span lang="en" dir="ltr" class="mw-content-ltr">The user interface has been updated to differentiate between errors and warnings.</span> [[File:Translate-validation-err-warning.png|thumb|345x345px|alt=|<span lang="en" dir="ltr" class="mw-content-ltr">A warning and error shown on top of a translation</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> During translation, if an error is noticed with the translation, the '''Save translation''' button is disabled unless the user who is translating has <code>translate-manage</code> permission. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally validation is also done on the server when the user is saving the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will still allow users who have the <code>translate-manage</code> permission to save the translation even if it has errors.</span> <span id="Custom_validators"></span> == Valideurs personnalisés == <span lang="en" dir="ltr" class="mw-content-ltr">Certain complicated validations might still require a custom validator to be written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Custom validators must implement the <code>MediaWiki\Extensions\Translate\Validation\MessageValidator</code> interface [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/MessageValidator.php].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Below is an example of a custom validator, </div> <syntaxhighlight lang="php" line="1" start="1"> <?php // Filename: Validator.php use MediaWiki\Extensions\Translate\Validation\MessageValidator; use MediaWiki\Extensions\Translate\Validation\ValidationIssue; use MediaWiki\Extensions\Translate\Validation\ValidationIssues; /** * My Custom Validator */ class MyCustomValidator implements MessageValidator { public function getIssues( TMessage $message, string $targetLanguage ): ValidationIssues { $issues = new ValidationIssues(); // Validation code goes here. Push ValidationIssue into the ValidationIssues. E.g.: $issue = new ValidationIssue( 'value-not-present', // type 'invalid', // sub-type 'translate-checks-value-not-present', // message key [ // message params [ 'PLAIN-PARAMS', $this->possibleValues ], [ 'COUNT', count( $this->possibleValues ) ] ] ); $issues->add( $issue ); return $issues; } } </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Also see the following classes,</span> # <code>ValidationIssues</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssues.php # <code>ValidationIssue</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssue.php <span lang="en" dir="ltr" class="mw-content-ltr">The add the custom validator in the configuration file,</span> <syntaxhighlight lang="yaml"> VALIDATORS: - class: MyCustomValidator enforce: true AUTOLOAD: MyCustomValidator: Validator.php </syntaxhighlight> 9owkv073w2j8oauq2hb39a12oa0f5lu Help:Extension:ParserFunctions/yo 12 1562889 8365039 8353955 2026-05-04T06:21:45Z FuzzyBot 451990 Updating to match new version of source page 8365039 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span lang="en" dir="ltr" class="mw-content-ltr">The {{ll|Extension:ParserFunctions|nsp=0}} extension provides additional [[Special:MyLanguage/Parser functions|parser functions]] to supplement those already present in MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">(It ''may'' be configured to provide additional parser functions for string handling; these are only available to non-Wikimedia Foundation wikis hence these string functions are documented {{ll|Extension:ParserFunctions/String functions|elsewhere}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">All the parser functions provided by this extension take the form:</span> :<code><nowiki>{{</nowiki><span lang="en" dir="ltr" class="mw-content-ltr">'''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ...</span> <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Operators</span> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Grouping (parentheses)</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Numbers</span> | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | <span lang="en" dir="ltr" class="mw-content-ltr">binary operator</span> <code>'''e'''</code> &nbsp; <span lang="en" dir="ltr" class="mw-content-ltr">unary</span> <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Unary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Binary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Round</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Logic</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} <span lang="en" dir="ltr" class="mw-content-ltr">This function evaluates a mathematical expression and returns the calculated value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This function is also available in {{ll|Extension:Scribunto|nsp=0}} via the <code>mw.ext.ParserFunctions.expr</code> function.</span> :<code><nowiki>{{#expr:</nowiki> ''<span lang="en" dir="ltr" class="mw-content-ltr">expression</span>'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The available operators are listed to the right, in order of precedence. See {{ll|Manual:Expr parser function syntax}} for more details of the function of each operator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> When evaluating using [[w:boolean algebra|boolean algebra]], zero evaluates to {{phpi|false}}, and any nonzero value, positive or negative, evaluates to {{phpi|true}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code>[[##iferror|#iferror]]</code> function: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Rounding === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Test case</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Result</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Method of rounding</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is < 5, so no apparent rounding occurs</span> (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is ≥ 5, so it is rounded up</span> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to the nearest integer</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the ''nearest'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding up or down with ''ceil'' and ''floor''</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next ''larger'' integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next ''smaller'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next larger integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next smaller integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Not rounded, since 1 already is an integer</span><br />{{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect</span>}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Strings === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: test string | value if test string is not empty | value if test string is empty (or only white space)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: first parameter | second parameter | third parameter }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' Iṣẹ naa le jẹ itẹ-ẹiyẹ. Lati ṣe bẹ, itẹ-ẹiyẹ iṣẹ inu <code>#if</code> ni fọọmu kikun ni aaye paramita ti iṣẹ <code>#if</code> ti o paade. Titi di ipele meje ti itẹ-ẹiyẹ ṣee ṣe, botilẹjẹpe iyẹn le dale lori wiki tabi opin iranti kan. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:okun igbeyewo | iye ti okun idanwo ko ba ṣofo |{{#if:test string |value if test string is not empty |iye ti okun idanwo ba ṣofo (tabi aaye funfun nikan) }} }} </syntaxhighlight> <span class="mw-translate-fuzzy">O tun le lo paramita kan bi okun idanwo ninu alaye <code>#if</code> rẹ. O nilo lati rii daju pe o ṣafikun $1 (aami paipu) lẹhin orukọ oniyipada naa.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> (Nitorina ti paramita naa ko ba ni iye, o ṣe iṣiro si okun ti o ṣofo dipo okun “<code><nowiki>{{{1}}}</nowiki></code>”.) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Example: </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Year</span> |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">4-digit year.</span> | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Month</span> |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour</span> |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Minutes and seconds</span> |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → koodu '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' yoo fi sii ni wikitext niwon oju-iwe {{FULLPAGENAME}} wa. {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> Eyi 'fipamọ' paipu lati parser MediaWiki, ni idaniloju pe ko ṣe akiyesi rẹ titi ti gbogbo awọn awoṣe ati awọn oniyipada lori oju-iwe kan ti fẹ sii. Lẹhinna yoo tumọ bi ila tabili tabi iyapa ọwọn. Ni omiiran, sintasi tabili tabili HTML aise le ṣee lo, botilẹjẹpe eyi ko ni oye ati diẹ sii jẹ aṣiṣe. <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] klx9iv3kuixrihz8pzgsosi6tmhcxzn OAuth/For Developers/uz 0 1582253 8364295 8350301 2026-05-03T12:27:53Z FuzzyBot 451990 Updating to match new version of source page 8364295 wikitext text/x-wiki <languages /> Bu sahifada foydalanuvchi nomidan ma'lumotlariga kira olishi uchun xavfsiz ruxsat soʻrash maqsadida {{ll|Extension:OAuth}} (MediaWiki-ni [[w:OAuth|OAuth]] serveriga aylantiruvchi kengaytma) ishlaydigan wiki bilan integratsiyalasha oladigan ilovalarni qanday ishlab chiqish tushuntiriladi. {{Note|1=<span class="mw-translate-fuzzy">Agar siz bot yoki shunga oʻxshash dastur ishlab chiqayotgan boʻlsangiz, foydalanuvchilar doim bir xil akkauntidan hisobiga kirishini osonlashtirishingiz mumkin.</span>}} <span id="OAuth_in_a_nutshell"></span> == OAuth haqida qisqacha == <div lang="en" dir="ltr" class="mw-content-ltr"> OAuth allows an application to request permission from a user to act through that user's wiki account, without knowing the user's password, and without being able to do everything the user could (e.g. the app might be able to edit articles but not delete them, so even users with extended permissions can safely use OAuth-enabled tools). </div> <div class="mw-translate-fuzzy"> Bu [https://oauth.net/2/ OAuth 2.0] yoki [https://oauth.net/core/1.0a/ OAuth 1.0a] protokoli orqali sodir bo'ladi va uchta komponentdan iborat: </div> # <span class="mw-translate-fuzzy"># Ishlab chiquvchi ilovani (koʻpincha OAuth terminologiyasida “isteʼmolchi” deb ataladi) viki-da roʻyxatdan oʻtkazishi, ehtimol qandaydir koʻrib chiqish jarayonidan oʻtishi va baʼzi hisob maʼlumotlarini olishi kerak.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">When a user wants to use it, the application must initiate an authorisation process.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will involve sending the user to a special page on the wiki, which will display an authorisation dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the user accepts, the application will receive another set of credentials (which are specific to that user, and can be revoked by the user at any time).</span> # <span lang="en" dir="ltr" class="mw-content-ltr">When the application actually needs to make an action (API request) on the user's behalf, it can combine the credentials received in steps 1 and 2 to sign the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth is a widely used open standard (you can see it on sites like Google or Facebook or GitHub, e.g. when using accounts at those sites to log in elsewhere).</span> {{info|1=<span lang="en" dir="ltr" class="mw-content-ltr">OAuth should not be confused with:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Initiative for Open Authentication|OATH]] (a second-factor authentication protocol family, commonly known as "type the six numbers you see on your mobile app", now enabled on Wikimedia sites)</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:OpenID Connect|OpenID Connect]] (an authentication protocol based on OAuth 2.0, which the OAuth MediaWiki extension partially supports).</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> For a slightly larger nutshell on OAuth 1.0a, see [https://docs.google.com/presentation/d/1537HnwSaSzH-b8hINcz48SNhT8ElAUPC39to0_O1iNA/edit#slide=id.g15105b408d_0_287 these slides]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == OAuth in detail == </div> Ro'yxatdan o'tish OAuth 1.0a va OAuth 2 uchun asosan bir xil, farq faqat bir nechta forma maydonlarining mavjudligida. Qolgan qismlar OAuth versiyasiga qarab sezilarli darajada farqlanadi. <span lang="en" dir="ltr" class="mw-content-ltr">Generally, OAuth 2 is recommended if available in your environment.</span> <span id="Registration"></span> === Roʻyxatga olish === <span lang="en" dir="ltr" class="mw-content-ltr">To register a new OAuth application, submit the form at <code>[[m:Special:OAuthConsumerRegistration/propose|Special:OAuthConsumerRegistration/propose]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Try to give sufficient information about the application for admins and users to decide whether it can be trusted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">URLs to places with more information (such as the application itself, the source code or on-wiki documentation) can be useful.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For OAuth applications to be used on Wikimedia projects, see [[meta:Special:MyLanguage/OAuth app guidelines|app guidelines]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Besides the descriptive ones, the fields have the following meaning:</span> * <code>This consumer is for use only by {{tag|user|open|plain=1}}</code>: <span lang="en" dir="ltr" class="mw-content-ltr">whether you use [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]] (which do not need to be reviewed or authorised but are only usable by yourself).</span> * <code>callback URL</code> (<span lang="en" dir="ltr" class="mw-content-ltr">irrelevant to owner-only consumers</span>): <span lang="en" dir="ltr" class="mw-content-ltr">the URL where the user returns after authorisation is checked against this.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(This is an extra layer of security against an attacker trying to steal credentials during authorisation.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>use as prefix</code> option is enabled, the URL must start with this (the check is dumb so make sure to add at least a <code>/</code> after the domain name), otherwise it must be an exact match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you are developing/testing your local machine, specify [[w:Localhost|Localhost]] in this field (e.g. <code><nowiki>http://localhost:8080/</nowiki></code>).</span> * <code>Applicable project</code> (<span lang="en" dir="ltr" class="mw-content-ltr">for wiki farms only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">project(s) on which to use your application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can limit the application to a single wiki or have it work everywhere.</span> * <code>Types of grants</code> / <code>Applicable grants</code>: <span lang="en" dir="ltr" class="mw-content-ltr">the permissions needed by your application (be conservative). The actual permissions will be an intersection of this and what permissions the user has.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Currently, the user must authorise grouped permissions, not individual ones ([[Phab:T59505|T59505]]).</span> * <code>Allowed IP ranges</code>: <span lang="en" dir="ltr" class="mw-content-ltr">an optional specification of the IP ranges that you use, where OAuth requests not matching this will be rejected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is an extra layer of security against an attacker stealing your application's credentials and trying to impersonate it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> * <code>Public RSA key</code> (<span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">public key used by your application for signing requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can just leave this empty (most applications do) to use a slightly simpler shared-secret mechanism instead.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> <span lang="en" dir="ltr" class="mw-content-ltr">After registration, you'll receive the credentials needed to use OAuth.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to use it immediately with your own user account (this is meant for testing); others will only be able to use it once it is approved by an administrator.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The list of applications (approved or otherwise) is public and can be browsed at <code>[[m:Special:OAuthListConsumers|Special:OAuthListConsumers]]</code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === OAuth 1.0a === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Authorisation ==== </div> [[File:OAuth authorization interface.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Authorisation dialog shown to users</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> When registering the application, you receive two pieces of credentials: the application token (a public ID for the application) and the application secret (sort of like a password). </div> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another set of credentials (these ones specific to that user): the access token and access secret.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">With an RSA key the credentials are slightly different.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is assumed that people choosing to use an RSA key know what they are doing, so this tutorial will assume you have chosen the non-RSA option.</span> </ref> <span lang="en" dir="ltr" class="mw-content-ltr">To get them, you need to go through the authorisation process, which consists of three steps:</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|OAuth/Owner-only consumers|owner-only consumers}} for that.</span> </ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Get a request token from the wiki by sending a GET request to <code>Special:OAuth/initiate</code>, signed with the application key and secret, with the callback URL (where the user will be sent after a successful authorisation) passed as the <code>oauth_callback</code> query parameter (if you have set a constant URL at registration, the value of the parameter ''must'' be <code>oob</code>).</span><ref name="non-nice-url"><span lang="en" dir="ltr" class="mw-content-ltr">Due to [[phab:T59500]] you must currently use a non-nice URL such as <code>en.wikipedia.org/w/index.php?title=Special:OAuth/initiate</code>.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">If you are successful, the response will be a JSON object with <code>token</code> and <code>key</code> fields—the request token and request secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If not, it will have an <code>error</code> field.)</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>Special:OAuth/authorize</code>, with the application token and request token passed as query parameters (<code>oauth_consumer_key</code> and <code>oauth_token</code>, respectively).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>oauth_verifier</code> will contain the verification code that you can use to exchange the request token and secret for the access token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a request to <code>Special:OAuth/token</code><ref name="non-nice-url" /> which includes the <code>oauth_verifier</code> parameter you just received and is signed with the application token and secret and the request token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token/secret (in the same format as the request token/secret in step 1).</span> Kirish tokeni va siri API soʻrovlarini imzolash uchun kerak boʻladigan narsadir. Ruxsat tokeni va siri endi foydali emas va oʻchirib tashlash mumkin. <span lang="en" dir="ltr" class="mw-content-ltr">The access token will remain valid indefinitely, unless the user revokes it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If you prefer not to store it, you can just repeat the authorisation process at any time though.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Applications which only need minimal privileges (have been registered as ''User identity verification only'') can use <code>/authenticate</code> instead of <code>/authorize</code> in step 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This works the same way, but the user will only see the authorisation dialog if they have not authorised this application before; otherwise the authorisation will silently succeed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure, so you don't have to implement it manually—each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Making requests on the user's behalf ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to be signed with the application token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth, with one exception (see next section).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications registered as ''User identity verification only'' cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Identifying the user ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a custom protocol (similar to OpenID Connect) for authenticating the user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send a signed OAuth request to <code>Special:OAuth/identify</code>:</span><ref name="non-nice-url" /> <span lang="en" dir="ltr" class="mw-content-ltr">the response will be a [[w:JSON Web Token|JWT]] (JSON Web Token &ndash; a signed JSON object) including the name of the user, their {{ll|Manual:Central ID|central ID}} (under the key <code>sub</code>) and various other information (such as their user groups and whether they are blocked; also the email address if the application was registered with the right grant type).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is more secure than using the API (e.g. the userinfo module) for authentication, which could be subject to [[w:Man-in-the-middle attack|man-in-the-middle attacks]]; always use this if you need to identify a user!</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also, make sure you properly validate the JWT (there are many libraries which can help with that).</span> <span lang="en" dir="ltr" class="mw-content-ltr">You should check each of the following: the issuer (<code>iss</code>) matches the domain name of the wiki, the audience (<code>aud</code>) matches your application key, the issued-at time (<code>iat</code>) is in the past and reasonably close to current time, the expiration time (<code>exp</code>) is in the future, the nonce (<code>nonce</code>) matches the one you sent in the request.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Signing requests ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Steps 1 and 3 of the authorisation process require signing the request; API requests and <code>Special:OAuth/identify</code> must likewise be signed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The signing process is detailed in [https://oauth.net/core/1.0a/#signing_process section 9 of the OAuth spec], but it is cumbersome to implement by hand and [https://oauth.net/1/ many libraries] are available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find code samples and an overview of how to do it by hand in the {{ll|OAuth/Owner-only_consumers|owner-only consumer}} documentation.</span> (<span lang="en" dir="ltr" class="mw-content-ltr">That is for signing with the consumer token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Modify as appropriate to sign with the consumer token/secret and request token/secret (authorisation step 3) or consumer token/secret only (authorisation step 1).</span>) === OAuth 2 === <span id="Authorisation"></span> === Ruxsat === <span lang="en" dir="ltr" class="mw-content-ltr">When registering the application, you receive two pieces of credentials: the client application key (a public ID for the application, also called the client ID or consumer key) and the client application secret (a confidential password).</span> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another credential (this one specific to that user): the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To get it, you need to go through the [https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/ the OAuth 2 Authorization Code flow], which consists of two steps:</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See [[Special:MyLanguage/OAuth/Owner-only consumers|owner-only consumers]] for that.</span></ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>oauth2/authorize</code> under the wiki's REST endpoint (usually <code>rest.php</code>), with <code>response_type=code</code> and the consumer key (also called the client application key) as the <code>client_id</code>, possibly a <code>state</code> if you want, and optionally the <code>redirect_uri</code> (if yes, it must be the same as in your application request).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If your consumer is non-confidential, you'll also need to include a [https://www.oauth.com/oauth2-servers/pkce/authorization-request/ PKCE code challenge] (<code>code_challenge</code> and <code>code_challenge_method=S256</code>).</span><ref>PKCE &mdash; Proof Key for Code Exchange</ref> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>code</code> will contain the authorisation code that you can use to fetch the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a POST request to <code>oauth2/access_token</code> under the wiki's REST endpoint (usually <code>rest.php</code>), including <code>grant_type=authorization_code</code>, the <code>code</code> parameter you just received, your client authentication (typically as <code>client_id</code> and, for confidential clients, <code>client_secret</code>), the <code>redirect_uri</code> if and only if you specified it in the previous step (must be the same value for both), and if non-confidential the PKCE <code>code_verifier</code> and <code>code_challenge_method</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token and a refresh token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token is what you'll need to send future API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The refresh token can be used to [https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/ fetch a new access token] if the original access token expires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you prefer not to store either token, you can just repeat the authorisation process at any time.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(Before MediaWiki 1.46, non-confidential clients could only use refresh tokens using their client secret keys, not using their client IDs only, see [[phabricator:T323855|T323855]].)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure so you don't have to implement it manually - each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <span id="Making_requests_on_the_user&#039;s_behalf"></span> ==== Foydalanuvchilar nomidan so'rov yuborish ==== <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to include the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the access token is used to fetch a CSRF token or other tokens, the access token must still be passed (as a header) with requests that use those tokens.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications which need minimal privileges (have been registered as ''User identity verification only'') cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> API requests including <code>rest.php/oauth2/resource/profile</code> must be authenticated with an HTTP Authorization header containing the access token, like: </div> <pre> Authorization: Bearer abcde....6789 </pre> <span id="Identifying_the_user"></span> ==== Foydalanuvchini aniqlash ==== <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a somewhat incomplete implementation of OpenID Connect for authenticating the user.</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">See [[phab:T254063|T254063]] for details.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send an authenticated OAuth GET request to the <code>oauth2/resource/profile</code> API (MediaWiki's implementation of what the OIDC spec calls the UserInfo endpoint) under the wiki's REST endpoint (usually <code>rest.php</code>); the response will include the name of the user and various other information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that the GET request must use the HTTP <code>Authorization</code> header, not a query string token.</span> * '''sub''' <span lang="en" dir="ltr" class="mw-content-ltr">(central user ID)</span> * '''username''' * '''editcount''' * '''confirmed_email''' * '''blocked''' * '''registered''' * '''groups''' * '''rights''' * '''realname''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> * '''email''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Setting up a development environment == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> You can register an OAuth application on [https://meta.wikimedia.beta.wmflabs.org/wiki/Special:OAuthConsumerRegistration/propose beta meta] and test your code against that. </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you want to improve the extension itself, or debug protocol issues in detail, OAuth is available in the {{ll|MediaWiki-Vagrant}} development environment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Add the <code>oauth</code> role, and your local wiki will be able to authorise OAuth apps.</span> <syntaxhighlight lang="shell-session"> $ vagrant roles enable oauth $ vagrant provision </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Once the code is nearly ready, you can register an OAuth application on the real wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to test it with the same user account used for registering, even before it gets reviewed by admins.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If you are creating an application for Wikimedia projects, consider hosting it at [[Wikitech:Portal:Toolforge|Wikimedia Toolforge]], a free tool forge and hosting platform for Wikimedia-related services. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Security benefits and trade-offs == </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Unlike password-based authentication, the OAuth 1.0 protocol prevents any [[w:Man-in-the-middle attack|man-in-the-middle attack]] even if the wiki does not require HTTPS: all interactions between MediaWiki and the application are signed with either a shared secret (using HMAC-SHA1), or a [[w:Public-key cryptography|public key]] (RSA).</span> <span lang="en" dir="ltr" class="mw-content-ltr">HTTPS is still required for certain steps though (for obtaining the shared secret in the second step of authorisation when not using RSA, and during app registration).</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 2.0 does not involve signing and relies on HTTPS for security.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Actions via OAuth happen under the user's name but will be [[Special:MyLanguage/Manual:Tags|tagged]] with the application's name as well so rogue applications can be identified.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Wiki admins can revoke the application's permissions (and thus bar it from any further action) if needed.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The user can revoke the permission of the application to use that specific user account if they don't like how it works or don't trust it anymore.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Unlike a password change, this is not disruptive for the user.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Sufficiently flexible applications might allow users to circumvent IP blocks (since MediaWiki will see the IP of the application server, not that of the user).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This can be handled the same way proxies are, by trusting XFF headers set by the application (see [[Phab:T159889|T159889]] for some limitations).</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The application secret must be kept secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Submitting it to source control or putting it into user-accessible code (such as mobile app or desktop application; even if it is obfuscated) undermines the security model and will result in admins forcefully disabling the application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Exceptions are made for example applications demoing OAuth usage, if they are explicitly labeled as such and request limited rights.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Libraries == </div> === PHP === * [[oauthclient-php]] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a client library maintained by Wikimedia</span> * [https://php.net/book.oauth OAuth] – <span lang="en" dir="ltr" class="mw-content-ltr">PECL client library</span> * [https://github.com/firebase/php-jwt firebase/php-jwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a popular JWT library</span> * [https://sr.ht/~taavi/laravel-socialite-mediawiki/ laravel-socialite-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki driver for [[w:Laravel|Laravel]]'s [https://laravel.com/docs/7.x/socialite Socialite] library.</span> === Python === * [https://github.com/valhallasw/flask-mwoauth flask-mwoauth] – <span lang="en" dir="ltr" class="mw-content-ltr">a Flask blueprint to run OAuth against MediaWiki's Extension:OAuth (See tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Flask_OAuth_tool My first Flask OAuth tool])</span> * [https://github.com/wikimedia/MediaWiki-OAuth MediaWiki-OAuth (mwoauth)] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a on top of [http://requests-oauthlib.readthedocs.org/en/latest/oauth1_workflow.html requests-oauthlib]</span> * [https://github.com/python-social-auth/social-core python-social-auth] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework that includes a [https://github.com/python-social-auth/social-core/blob/master/social_core/backends/mediawiki.py MediaWiki backend] (Example tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Django_OAuth_tool My first Django OAuth tool])</span> * [https://docs.authlib.org/en/latest/index.html authlib] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework to interact with Wikimedia OAuth 2.0 API (Full minimal Django OAuth 2.0 [https://code.basabuuka.org/alpcentaur/wmde_oauth_django_example example])</span> * [https://github.com/jpadilla/pyjwt pyjwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a JWT library</span> === Ruby === * [https://github.com/timwaters/omniauth-mediawiki omniauth-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">a MediaWiki strategy for OmniAuth (also available as a [https://rubygems.org/gems/omniauth-mediawiki gem])</span> === Rust === * [https://crates.io/crates/mediawiki MediaWiki crate] <span lang="en" dir="ltr" class="mw-content-ltr">implements both OAuth1 and OAuth2 login mechanisms.</span> * [https://crates.io/crates/oauth2 oauth2 crate] === Node.js === * [https://www.npmjs.com/package/passport-mediawiki-oauth passport-mediawiki-oauth] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki strategy for the Passport auth framework (which can be used effortlessly as a middleware with Express JS and similar frameworks)</span> * [https://www.npmjs.com/package/oauth-fetch-json oauth-fetch-json] – <span lang="en" dir="ltr" class="mw-content-ltr">library for signing OAuth requests</span> * [https://www.npmjs.com/package/m3api-oauth2 m3api-oauth2] – an extension package for [https://www.npmjs.com/package/m3api m3api], making it easy to make requests authenticated via [[Special:MyLanguage/Help:OAuth|OAuth 2.0]] === Go === * [https://github.com/mrjones/oauth mrjones/oauth] (OAuth 1.0) * [https://pkg.go.dev/golang.org/x/oauth2 golang.org/x/oauth2] <span lang="en" dir="ltr" class="mw-content-ltr">(OAuth 2.0, [https://pkg.go.dev/golang.org/x/oauth2#example-Config example])</span> === Java === * [https://github.com/scribejava/scribejava ScribeJava] <span lang="en" dir="ltr" class="mw-content-ltr">since version 5.5.0 ([https://github.com/scribejava/scribejava/pull/852 pull request])</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Example code == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === PHP client without using any libraries === </div> [[toollabs:oauth-hello-world|OAuth Hello World]] – <span lang="en" dir="ltr" class="mw-content-ltr">easy to understand demo application written in PHP without any libraries.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === PHP command-line client with RSA keys, using oauthclient-php === </div> <span lang="en" dir="ltr" class="mw-content-ltr">PHP application using classes from the OAuth extension codebase.</span> {{Todo|1=<span lang="en" dir="ltr" class="mw-content-ltr">convert this to actually use oauthclient-php! Probably just a bunch of <code>use</code> declarations.</span>}} <span lang="en" dir="ltr" class="mw-content-ltr">Before Starting:</span> <syntaxhighlight lang="shell-session"> $ openssl genrsa -out appkey.pem 4096 $ openssl rsa -in appkey.pem -pubout > appkey.pub </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">PHP source code</span>}} <syntaxhighlight lang="php"> <?php if ( PHP_SAPI !== 'cli' ) { die( "CLI-only test script\n" ); } /** * A basic client for overall testing */ function wfDebugLog( $method, $msg) { //echo "[$method] $msg\n"; } require 'OAuth.php'; require 'MWOAuthSignatureMethod.php'; $consumerKey = ''; #$consumerSecret = ''; // We don't need this, since we're using RSA, except to validate the /identify call $privateKey = file_get_contents( 'appkey.pem' ); $baseurl = 'http://<wiki>/wiki/Special:OAuth'; $endpoint_req = $baseurl . '/initiate?format=json&oauth_callback=oob'; // format=json makes php a little easier $endpoint_acc = $baseurl . '/token?format=json'; $endpoint_id = $baseurl . '/identify'; $c = new OAuthConsumer( $consumerKey, $privateKey ); // Make sure we sign title and format $parsed = parse_url( $endpoint_req ); $extraSignedParams = array(); parse_str($parsed['query'], $extraSignedParams); $extraSignedParams['title'] = 'Special:OAuth/initiate'; $init_req = OAuthRequest::from_consumer_and_token( $c, // OAuthConsumer for your app NULL, // User token, NULL for calls to initiate "GET", // http method $endpoint_req, // endpoint url (this is signed) $extraSignedParams // extra parameters we want to sign (must include title) ); $rsa_method = new MWOAuthSignatureMethod_RSA_SHA1( new OAuthDataStore(), $privateKey ); $init_req->sign_request( $rsa_method, // OAuthSignatureMethod $c, // OAuthConsumer for your app NULL // User token, NULL for calls to initiate ); echo "Getting request token with: $init_req\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, (string) $init_req ); // Pass OAuth in GET params curl_setopt( $ch, CURLOPT_HTTPGET, true ); curl_setopt( $ch, CURLOPT_HEADER, false ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $requestToken = json_decode( $data ); print "Visit $baseurl/authorize?oauth_token={$requestToken->key}&oauth_consumer_key=$consumerKey\n"; // ACCESS TOKEN print "Enter the verification code:\n"; $fh = fopen( "php://stdin", "r" ); $line = fgets( $fh ); $rc = new OAuthToken( $requestToken->key, $requestToken->secret ); $parsed = parse_url( $endpoint_acc ); parse_str($parsed['query'], $params); $params['oauth_verifier'] = trim($line); $params['title'] = 'Special:OAuth/token'; $acc_req = OAuthRequest::from_consumer_and_token( $c, $rc, "GET", $endpoint_acc, $params ); $acc_req->sign_request($rsa_method, $c, $rc); echo "Calling: $acc_req\n"; unset( $ch ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_acc ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $acc_req->to_header() ) ); // Set the Authorization Header $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $acc = json_decode( $data ); $accessToken = new OAuthToken( $acc->key, $acc->secret ); /** * Insecurely call the api for information about the user. * A MITM can forge a response from the server, so don't rely on this for identity! */ $apiurl = 'http://<wiki>/w/api.php'; $apiParams = array( 'action' => 'query', 'meta' => 'userinfo', 'uiprop' => 'rights', 'format' => 'json', ); $api_req = OAuthRequest::from_consumer_and_token( $c, // Consumer $accessToken, // User Access Token "GET", // HTTP Method $apiurl, // Endpoint url $apiParams // Extra signed parameters ); $api_req->sign_request( $rsa_method, $c, $accessToken ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $apiurl . "?" . http_build_query( $apiParams ) ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $api_req->to_header() ) ); // Authorization header required for api $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; /** * Securely get the identity of the user */ $consumerSecret = ''; $extraSignedParams = array( 'title' => 'Special:OAuth/identify' ); $req = OAuthRequest::from_consumer_and_token( $c, $accessToken, "GET", $endpoint_id, $extraSignedParams ); $req->sign_request( $rsa_method, $c, $accessToken ); echo "Calling: '$endpoint_id'\nHeader: {$req->to_header()}\n\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_id ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $req->to_header() ) ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } $identity = JWT::decode( $data, $consumerSecret ); // Validate the JWT if ( !validateJWT( $identity, $consumerKey, $req->get_parameter( 'oauth_nonce' ) ) ) { print "The JWT did not validate"; } else { print "We got a valid JWT, describing the user as:\n"; print " * Username: {$identity->username}\n"; print " * User's current groups: " . implode( ',', $identity->groups ) . "\n"; print " * User's current rights: " . implode( ',', $identity->rights ) . "\n"; } /** * Validate a JWT, to ensure this isn't a reply, spoof, etc. * @param $identity the decoded JWT * @param $consumerKey your App's Key * @param $nonce the nonce sent with your request, which should be returned */ function validateJWT( $identity, $consumerKey, $nonce ) { $expectedConnonicalServer = 'http://<wiki>'; // Verify the issuer is who we expect (server sends $wgCanonicalServer) if ( $identity->iss !== $expectedConnonicalServer ) { print "Invalid Issuer"; return false; } // Verify we are the intended audience if ( $identity->aud !== $consumerKey ) { print "Invalid Audience"; return false; } // Verify we are within the time limits of the token. // Issued at (iat) should be in the past, // Expiration (exp) should be in the future. $now = time(); if ( $identity->iat > $now || $identity->exp < $now ) { print "Invalid Time"; return false; } // Verify we haven't seen this nonce before, which would indicate a replay attack if ( $identity->nonce !== $nonce ) { print "Invalid Nonce"; return false; } return true; } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Python command-line client using mwoauth === </div> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Python source code</span>}} <syntaxhighlight lang="python"> from mwoauth import ConsumerToken, Handshaker import requests from requests_oauthlib import OAuth1 from six.moves import input # For compatibility between python 2 and 3 # Consruct a "consumer" from the key/secret provided by MediaWiki import config # You'll need to provide this # Create a file called config.py somewhere where it will be found by python, e.g. in the same directory as this script, with the following content (not including the # characters!) # consumer_key = "the consumer token you got when you registered your applicaton" # consumer_secret = "the secret token you got when you registered your application" # For example: # consumer_key = "20bc67da5081a30c736340c493f60d14" # consumer_secret = "af4313371bb2fb38e81fe7d300080085f52849f9" consumer_token = ConsumerToken(config.consumer_key, config.consumer_secret) # Construct handshaker with wiki URI and consumer handshaker = Handshaker("https://en.wikipedia.org/w/index.php", consumer_token) # Step 1: Initialise -- ask MediaWiki for a temporary key/secret for user redirect, request_token = handshaker.initiate() # Step 2: Authorise -- send user to MediaWiki to confirm authorisation print("Point your browser to: %s" % redirect) # response_qs = input("Response query string: ") # Step 3: Complete -- obtain authorised key/secret for "resource owner" access_token = handshaker.complete(request_token, response_qs) # Construct an auth object with the consumer and access tokens auth1 = OAuth1(consumer_token.key, client_secret=consumer_token.secret, resource_owner_key=access_token.key, resource_owner_secret=access_token.secret) # Now, accessing the API on behalf of a user print("Reading top 10 watchlist items") response = requests.get( "https://en.wikipedia.org/w/api.php", params={ 'action': "query", 'list': "watchlist", 'wllimit': 10, 'wlprop': "title|comment", 'format': "json" }, auth=auth1 ) for item in response.json()['query']['watchlist']: print("{title}\t{comment}".format(**item)) </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Python Toolforge tutorial using mwoauth === </div> Qarang: [[wikitech:Help:Toolforge/My first Flask OAuth tool]] === Python Toolforge tutorial using authlib (OAuth 2.0) === {{Collapse_top|title=Python source code}} <syntaxhighlight lang="python"> # > requirements.txt # flask==3.1.3 # requests==2.33.1 # authlib==1.7.0 # > config.py OAUTH_ACCESS_TOKEN_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/access_token" OAUTH_API_BASE_URL = "https://commons.wikimedia.org/w/" OAUTH_AUTHORIZE_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/authorize" OAUTH_CODE_CHALLENGE_METHOD = "S256" OAUTH_CONSUMER_KEY = "Y" OAUTH_CONSUMER_SECRET = "Z" OAUTH_SCOPE = "basic editpage" # > app.py from authlib.integrations.flask_client import FlaskOAuth2App, OAuth from flask import Flask, jsonify, redirect, request, session from requests import Response app = Flask() app.config.from_pyfile("config.py") oauth = OAuth(app) oauth.register( name="mediawiki", client_id=app.config["OAUTH_CONSUMER_KEY"], client_secret=app.config["OAUTH_CONSUMER_SECRET"], client_kwargs={ "code_challenge_method": app.config["OAUTH_CODE_CHALLENGE_METHOD"], "scope": app.config["OAUTH_SCOPE"], }, api_base_url=app.config["OAUTH_API_BASE_URL"], access_token_url=app.config["OAUTH_ACCESS_TOKEN_URL"], authorize_url=app.config["OAUTH_AUTHORIZE_URL"], ) oauth_client: FlaskOAuth2App = oauth.create_client("mediawiki") @app.route("/") def index(): return app.send_static_file("index.html") @app.route("/login") def login(): return oauth_client.authorize_redirect() @app.route("/oauth-callback") def auth(): token = oauth_client.authorize_access_token() session["token"] = token return redirect("/") @app.route("/logout") def logout(): session.pop("token", None) session.clear() return redirect("/") @app.route("/user") def user(): response: Response = oauth_client.request( "GET", "rest.php/oauth2/resource/profile", token=session["token"], ) user = response.json() response.raise_for_status() return jsonify(user=user) @app.route("/edit", methods=["POST"]) def edit(): data = request.get_json() pageid = int(data["pageid"]) response: Response = oauth_client.request( "POST", "api.php", token=session["token"], data=dict( format="json", formatversion="2", action="query", pageids=str(pageid), prop="revisions|wbentityusage", rvprop="content", rvslots="*", meta="tokens", ), ) r = response.json() token = r["query"]["tokens"]["csrftoken"] ... </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Go command-line client using mrjones/auth (OAuth 1.0) === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Before you begin: </div> <syntaxhighlight lang="shell-session"> $ go get github.com/mrjones/oauth </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Go source code</span>}} <syntaxhighlight lang="go"> package main import ( "fmt" "os" "github.com/mrjones/oauth" "io/ioutil" "strconv" ) func main() { var consumerKey string = "" var consumerSecret string = "" if len(consumerKey) == 0 || len(consumerSecret) == 0 { os.Exit(1) } c := oauth.NewConsumer( consumerKey, consumerSecret, oauth.ServiceProvider{ RequestTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/initiate", AuthorizeTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/authorize", AccessTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/token", }) c.Debug(true) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/initiate", } c.AdditionalAuthorizationUrlParams = map[string]string{ "oauth_consumer_key": consumerKey, } requestToken, url, err := c.GetRequestTokenAndUrl("oob") if err != nil { fmt.Println( err ) } fmt.Println( "Got token " + requestToken.Token ) fmt.Println("(1) Go to: " + url) fmt.Println("(2) Grant access, you should get back a verification code.") fmt.Println("(3) Enter that verification code here: ") verificationCode := "" fmt.Scanln(&verificationCode) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/token", } accessToken, err := c.AuthorizeToken(requestToken, verificationCode) if err != nil { fmt.Println(err) } fmt.Println( "Got access token " + accessToken.Token ) c.AdditionalParams = map[string]string{} response, err := c.Get( "http://<wiki>/wiki/api.php", map[string]string{ "action": "query", "meta": "userinfo", "uiprop": "rights", "format": "json", }, accessToken) if err != nil { fmt.Println(err) } fmt.Println( "\tResponse Status: '" + response.Status + "'\n" ) fmt.Println( "\tResponse Code: " + strconv.Itoa(response.StatusCode) + "\n" ) bytes, _ := ioutil.ReadAll(response.Body) fmt.Println( "\tResponse Body: " + string(bytes) + "\n" ) } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === JavaScript applications using OAuth 2 === </div> * [https://github.com/wikimedia/apiclient-wiki wikimedia/apiclient-wiki] – <span lang="en" dir="ltr" class="mw-content-ltr">entire application in 520 lines of code</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Full applications using OAuth === </div> * [https://github.com/jdlrobson/weekipedia/blob/master/libs/server/app.js Weekipedia], <span lang="en" dir="ltr" class="mw-content-ltr">A full scale React.js port of the Wikipedia mobile site uses both.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">many [https://toolhub.wikimedia.org/search?keywords__term=oauth Toolforge tools]</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==Notes== </div> <references /> cxv3tqcj78rmv3rm7n24mg35oniu1gx Template:Update/de-formal 10 1583903 8364317 8364237 2026-05-03T12:47:01Z FuzzyBot 451990 Updating to match new version of source page 8364317 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |Die '''sachliche Richtigkeit''' von Teilen dieser Seite (die in Bezug auf {{{part|{{{1|}}}}}}) '''kann aufgrund veralteter Informationen beeinträchtigt sein'''. |Teile dieser Seite (die in Bezug auf {{{part|{{{1|}}}}}}) sind '''veraltet'''.}} |{{#if:{{{inaccurate|}}} |Die '''sachliche Richtigkeit''' dieser Seite '''kann aufgrund veralteter Informationen beeinträchtigt sein'''. |Diese Seite ist '''veraltet'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|Sie wurde für eine ältere Version von MediaWiki geschrieben und trifft möglicherweise nicht auf die aktuellste Version zu.}} Wenn Sie diese Seite überprüft oder aktualisiert haben und dabei entdecken, dass die Inhalte geeignet sind, entfernen Sie bitte diesen Hinweis. {{#ifexist: {{TALKPAGENAME}} |&#32;Sehen Sie die [[{{TALKPAGENAME}}|Diskussionsseite]] für eine mögliche Diskussion darüber. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Letzte Aktualisierung: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= Alternativnamen dieser Vorlage: * {{tlx|outdated}} <span id="Examples"></span> == Beispiele == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == Siehe auch == * {{tl|historical}} == TemplateData == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> dqbvzf609yym9kdjj79hxfc89vkdmdn Extension:PageTriage/pt-br 102 1604321 8365074 8157893 2026-05-04T07:51:36Z FuzzyBot 451990 Updating to match new version of source page 8365074 wikitext text/x-wiki <languages /> {{Extension |templatemode = |status = stable |type1 = special |type2 = interface |newhook1 = |newhook2 = |username = |author = [[User:Kaldari|Ryan Kaldari]], [[User:Bsitu|Benny Situ]] |description = <span lang="en" dir="ltr" class="mw-content-ltr">Facilitates reviewing and approving new pages</span> |image = Extension-PageTriage Special-NewPagesFeed Screenshot.png |imagesize = 300 |version = |update = |version preview = |update preview = |compatibility policy = rel |mediawiki = |php = |composer = |table1 = pagetriage_page |table2 = pagetriage_page_tags |table3 = pagetriage_tags |download = {{WikimediaDownload|phab=EPTR}} |readme = |changelog = |example = [[wikipedia:Special:NewPagesFeed | Special:NewPagesFeed on the English Wikipedia]] |namespace = |tags = |compatibility = |bugzilla = |phabricator = PageTriage |vagrant-role = }} <span lang="en" dir="ltr" class="mw-content-ltr">'''PageTriage''' is an extension that aims to provide a feature-rich interface for triaging newly-created articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is intended to replace the ''new page patrol'' core function while adding additional functionality for reviewing, tagging, and improving new articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It adds a Special:NewPagesFeed page, and a page curation toolbar to new pages for those with the 'patrol' permission.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It was developed by the Wikimedia Foundation's [[Wikimedia_Features_engineering|Features Engineering team]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">For additional details see ''[[Page Curation|Page Curation]]''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An important note is that some of the configuration and code is specific to the English-language Wikipedia's workflows and as it's constructed now the extension is pretty much impossible to internationalise.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See [[Phabricator:T50552]].)</span> [[File:Page-Curation-Video.ogv|thumb|An overview of the page curation feature. The interface in the video is outdated but the content remains useful.]] <div lang="en" dir="ltr" class="mw-content-ltr"> == Installation == </div> [[File:PageTriage-ListView-Whole.png|thumb|Screenshot of Special:NewPagesFeed as it appeared in 2012]] {{ExtensionInstall |db-update=yes |registration=required |localsettings= }} == Checking for successful install == <div lang="en" dir="ltr" class="mw-content-ltr"> To actually see the extension working: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Create a new page containing just a few sentences of text as an anonymous user. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Visit Special:NewPagesFeed </div> <span lang="en" dir="ltr" class="mw-content-ltr">The new page should appear, flagged as "{{int|pagetriage-no-categories}}", "{{int|pagetriage-orphan}}", etc.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To see the page curation toolbar:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Login as a user with the 'sysop' permission, or add a group with the "[[Special:MyLanguage/Help:Patrolled_edits|patrol]]" permission, and add some user to that group, and login as that user. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Visit Special:NewPagesFeed </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Now you should see a "{{int|pagetriage-triage}}" button next to the new page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Click this and you should see the page curation toolbar on the new page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Advanced installation == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Additional extensions === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For full functionality, you'll also need to install some additional extensions, although PageTriage works without them. </div> * {{ll|Extension:Echo|Echo}} - Allows users to receive notifications for things like when an article they created has been marked as reviewed. * {{ll|Extension:ORES|ORES}} - In Special:NewPagesFeed, allows filtering by "predicted class" (<code>articlequality</code>: stub, start, c-class, b-class, good, featured) and "potential issues" (<code>draftquality</code>: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because <code>draftquality</code> needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's [[git:mediawiki/extensions/ORES/+/8bd39f26548d58fa8bf6765e1c23f5e3086f1cd4/extension.json#225|extension.json file]]. * {{ll|Extension:WikiLove|WikiLove}} - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily. === Enabling draft namespace === By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php <syntaxhighlight lang="php" copy> // These three settings are optional, and will enable the Articles-for-Creation mode. $wgPageTriageDraftNamespaceId = 118; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft'; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk'; </syntaxhighlight> When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed. By default pages edited in the draft namespace will be "unsubmitted". Articles in the draft namespace can be submitted for review by adding <nowiki>[[Category:Pending_AfC_submissions]]</nowiki> to the draft page. At which point they will show up under "awaiting review". Note the toolbar controlled by the configuration variable '''$wgPageTriageEnableCurationToolbar''' does not show up in the draft namespace. === Cron jobs === To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: <code>cron/updatePageTriageQueue.php</code> == Manual testing == === Special:NewPagesFeed -> Articles for Creation === * Enable draftspace by following the directions above in the section [[#Enabling draft namespace]]. * In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories: ** Unsubmitted: (no category) ** Awaiting review: Category:Pending AfC submissions ** Under review: Category:Pending AfC submissions being reviewed now ** Declined: Category:Declined AfC submissions Note: The Page Curation toolbar does not display for drafts. === ORES === Enwiki has the [[Extension:ORES|ORES extension]] installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure: * Clone Extension:ORES and add <code>wfLoadExtension( 'ORES' );</code> in <code>LocalSettings.php</code> * Add this to <code>LocalSettings.php</code> <syntaxhighlight lang="php" copy> $wgPageTriageEnableOresFilters = true; $wgOresWikiId = 'enwiki'; $wgOresModels = [ 'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ], 'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'sources' => [ 1 ] ] ]; </syntaxhighlight> * Run <code>php maintenance/run.php ./extensions/ORES/maintenance/BackfillPageTriageQueue.php</code> == Determining if a page is reviewed == === Status codes === There are status codes used to track whether a page is reviewed or not. These are the values given when you query <code>patrol_status</code>, <code>ptrp_reviewed</code>, and <code>ptrl_reviewed</code>: * Unreviewed ** 0 - unreviewed * Reviewed ** 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar) ** 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page) ** 3 - autopatrolled (someone with the <code>autopatrol</code> user right created the page, or moved the page from a non-tracked namespace to a tracked namespace) ** no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job) === Via the API === To check the review status of pages using an API query, you can use <code>api.php?action=query&prop=isreviewed</code>. Sample JavaScript code:<syntaxhighlight lang="js" copy> /** * @param {number} pageID The page ID number. A positive number with no commas. */ async isReviewed(pageID) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', pageids: pageID, } ); return response.query.pages[0].isreviewed; } /** * @param {string} title One title. Can include namespace. Example: User:Test */ async function isReviewed(title) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', titles: title, } ); return response.query.pages[0].isreviewed; } </syntaxhighlight> === Via SQL === To check the review status of pages using an SQL query, you need to query the <code>{{ll|Extension:PageTriage/pagetriage page table|pagetriage_page}}</code> table and the <code>ptrp_reviewed</code> field. Follow the directions in [[#Status codes]] to interpret the values of this field. <syntaxhighlight lang="sql" copy> /* By page_id */ SELECT ptrp_reviewed FROM pagetriage_page WHERE ptrp_page_id = 71318376 /* By page_title and page_namespace */ SELECT ptrp_reviewed FROM pagetriage_page JOIN page ON page_id = ptrp_page_id WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces AND page_namespace = 0 </syntaxhighlight> == SQL == === SQL tables === {| class="wikitable" |+ !Name !Prefix !Description !Old entry deletion strategy !Service classes (when refactoring, SQL queries should be moved to here) !Data classes |- |[[Extension:PageTriage/pagetriage page table|pagetriage_page]] |ptrp_ |The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query <code>ptrp_reviewed > 0</code> in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. |All articles deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. |QueueManager, QueueLookup |QueueRecord |- |[[Extension:PageTriage/pagetriage page tags table|pagetriage_page_tags]] |ptrpt_ |Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the <code>pagetriage_tags</code> table. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. |All article metadata deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status. | | |- |[[Extension:PageTriage/pagetriage tags table|pagetriage_tags]] |ptrt_ |A dictionary of page_tags, and their corresponding ID number. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. | | | |} === pagetriage_page_tags === <code>pagetriage_page_tags</code> data is updated by calling <code>ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata()</code>. This is called in the following hooks: * <code>onPageMoveComplete()</code> - runs when moving a page * <code>onLinksUpdateComplete()</code> - runs when saving an edit * <code>onMarkPatrolledComplete()</code> - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user. ==== List of tags ==== The <code>pagetriage_page_tags</code> are as follows: * Author information ** user_id ** user_name - there's a filter where you can type in their username ** user_editcount ** user_creation_date ** user_autoconfirmed ** user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with <code>MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()</code> ** user_bot ** user_block_status * Deletion tags - will display a black trash can icon if marked for deletion ** afd_status ** blp_prod_status ** csd_status ** prod_status * Special:NewPagesFeed red warning text ** category_count - No categories ** linkcount - Orphan ** reference - No citations ** recreated - Previously deleted ** user_block_status - Blocked * Page information ** page_len - size of article, in bytes ** rev_count - number of edits to the article ** snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article * afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined * copyvio - latest revision ID that has been tagged as a likely copyright violation, if any == PHP == <div lang="en" dir="ltr" class="mw-content-ltr"> === Extension configuration === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The extension is based on the 'patrol' right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For more information about configuring patrolling, see {{ll|Manual:Patrolling}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following configuration variables can be set from your LocalSettings.php file: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">Variable</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Default</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> |- | {{phpi|$wgPageTriageEnableCurationToolbar}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set to false to disable the [[Special:MyLanguage/Page Curation#User Experience: Curation Toolbar|curation toolbar]]</span> |- | {{phpi|$wgPageTriageInfiniteScrolling}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not to use infinite scrolling in the new pages feed</span> |- | {{phpi|$wgPageTriageMaxAge}} |90 | The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true). |- | {{phpi|$wgPageTriageNamespaces}} |NS_MAIN | The namespaces that PageTriage is active in. |- | {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} | {{phpi|false}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set this to true if new, unreviewed articles should be set to noindex.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In other words, if they should not be indexed by search engines until they are reviewed.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> See [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/extension.json#698|extension.json]] for the full list of config variables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === API === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> PageTriage adds the following API endpoints which can be used: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">API</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Triggering action</span> |- |pagetriageaction | <span class="mw-translate-fuzzy">Marcar uma página como revisada ou não revisada.</span> |Write | * Using the Page Curation toolbar to mark a page as reviewed * Using the Page Curation toolbar to mark a page as unreviewed |- |pagetriagelist | Recupera a lista de páginas na fila, e os metadados de cada página, incluindo seu status revisado. To retrieve one page, you must provide the <code>page_id</code>. To provide multiple pages, you must select one of <code>showreviewed</code>/<code>showunreviewed</code>, and one of <code>showredirs</code>/<code>showdeleted</code>/<code>showothers</code>, or no pages will be returned. |Read | * Loading the Page Curation toolbar (automatically loaded if you have the <code>patrol</code> userright and view a page that is unpatrolled or recently patrolled) * Viewing Special:NewPagesFeed (provides the list of articles) |- |pagetriagestats | <span class="mw-translate-fuzzy">Recolhe as estatísticas sobre o número de páginas na fila e os principais revisores.</span> |Read | * Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer) |- |pagetriagetagcopyvio |Mark an article as a potential copyright violation, and logs the action in Special:Log. |Write | * Marking as a copyright violation by a bot with the <code>copyviobot</code> userright |- |pagetriagetagging | <span class="mw-translate-fuzzy">Adicionar tags de limpeza ou modelos de exclusão a uma página.</span> |Write | * Using the Page Curation toolbar to place a maintenance tag on an article * Using the Page Curation toolbar to place a deletion tag on an article |} === Special:Log === The following logs are created by the extension: {| class="wikitable" |+ !Special:Log !<code>log_type</code> !<code>log_action</code> !Description !Notes |- |Page curation log |pagetriage-curation |delete, enqueue, reviewed, tag, unreviewed |Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed | |- |Potential copyright violation log |pagetriage-copyvio |insert |Allows a bot to log potential copyright violations |Doesn't display unless you set {{phpi|$wgPageTriageEnableCopyvio}} to true |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Entry points === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The extension's features can be triggered by various actions: </div> {| class="wikitable" |+ !Entry point type !File location !Notes |- |5 APIs |includes/Api/* | |- |1 special page |includes/SpecialNewPagesFeed.php | |- |20 hooks | * includes/Hooks.php * includes/HookHandlers/UndeleteHookHandler.php * includes/HookHandlers/Schema.php | |- |1 cron job |cron/updatePageTriageQueue.php |runs every 48 hours |- |7 maintenance scripts |maintenance/* |need to be run manually |} Here is a list of some actions and the corresponding entry points they trigger: {| class="wikitable" |+ !Action !Entry points used |- |View Main page | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() |- |Save an edit to the Main page | * Hooks.php -> onRevisionFromEditComplete() * Hooks.php -> onPageSaveComplete() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onLinksUpdateComplete() |- |Type in search box, triggering search suggestions | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onApiMain__moduleManager() |- |View Special:NewPagesFeed | * Hooks.php -> onBeforeCreateEchoEvent() * SpecialNewPagesFeed * ApiPageTriageStats * ApiPageTriageList |- |View an unreviewed article while logged in and having the <code>patrol</code> permission. | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onResourceLoaderGetConfigVars() * Hooks.php -> onDefinedTags() * Hooks.php -> onApiMain__moduleManager() * ApiPageTriageList (by <code>page_id</code>) |} ==== Hooks ==== {| class="wikitable" |+ !File !Group !Hook !Actions it performs |- | rowspan="18" |Hooks.php |Move page |[[Manual:Hooks/PageMoveComplete|onPageMoveComplete]] |Changes patrolled status, updates cache, updates metadata in <code>pagetriage_page_tags</code> table. |- | rowspan="3" |Edit page |[[Manual:Hooks/RevisionFromEditComplete|onRevisionFromEditComplete]] |Handles marking '''redirects that flip to articles''' as unreviewed. [[Deferred updates|DeferredUpdate]]. |- |[[Manual:Hooks/PageSaveComplete|onPageSaveComplete]] |Add '''new articles''' to the New Pages Feed and <code>pagetriage_page</code> table. |- |[[Manual:Hooks/LinksUpdateComplete|onLinksUpdateComplete]] |[[Deferred updates|DeferredUpdate]] of metadata / <code>pagetriage_page_tags</code> table. |- |Every page load |[[Manual:Hooks/ArticleViewFooter|onArticleViewFooter]] | * Turn on '''noindex''' for new, unreviewed articles. * Determine whether to load a '''link for autopatrolled users to unpatrol''' their article * Displays the '''Page Curation toolbar''' on recently created pages. * Create '''"Add to New Pages Feed" toolbox link''' for old articles. |- |[[Help:Patrolled edits]] |[[Manual:Hooks/MarkPatrolledComplete|onMarkPatrolledComplete]] |Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage. |- | rowspan="2" |Blocking and unblocking |[[Manual:Hooks/BlockIpComplete|onBlockIpComplete]] | rowspan="2" |Update article metadata / <code>pagetriage_page_tags</code> when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users. |- |[[Manual:Hooks/UnblockUserComplete|onUnblockUserComplete]] |- | |[[Manual:Hooks/ResourceLoaderGetConfigVars|onResourceLoaderGetConfigVars]] |Adjusts some config vars related to draft namespace ID. |- | rowspan="3" |[[Extension:Echo]] |[[Manual:Hooks/BeforeCreateEchoEvent|onBeforeCreateEchoEvent]] | rowspan="3" |Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed. |- |[[Manual:Hooks/EchoGetDefaultNotifiedUsers|onEchoGetDefaultNotifiedUsers]] |- |[[Manual:Hooks/LocalUserCreated|onLocalUserCreated]] |- |[[Extension:ORES]] |[[Manual:Hooks/ORESCheckModels|onORESCheckModels]] |Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio. |- | rowspan="3" |[[Help:Tags]] |[[Manual:Hooks/ListDefinedTags|onListDefinedTags]] | rowspan="3" |Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage". |- |[[Manual:Hooks/ChangeTagsAllowedAdd|onChangeTagsAllowedAdd]] |- |[[Manual:Hooks/ChangeTagsListActive|onChangeTagsListActive]] |- |API |[[Manual:Hooks/ApiMain::moduleManager|onApiMain__moduleManager]] |Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings. |- | rowspan="2" |Delete or undelete page |[[Manual:Hooks/PageDeleteComplete|onPageDeleteComplete]] |If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache. |- |HookHandlers/ UndeleteHookHandler.php |[[Manual:Hooks/ArticleUndelete|onArticleUndelete]] |If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed. |- |HookHandlers/ Schema.php |SQL |[[Manual:Hooks/LoadExtensionSchemaUpdates|onLoadExtensionSchemaUpdates]] | * The code that installs PageTriage's 4 SQL tables when you run <code>php maintenance/run.php update</code>. * Will also alter schemas from previous versions to match the latest schema. * This is also where all the '''pagetriage_tags''' are hard-coded. |} ==== Cron jobs and maintenance scripts ==== {| class="wikitable" |+ !File !What it does !Why run it? When is it useful? ![[phab:T341431|Safe to delete maintenance script?]] |- |cron/updatePageTriageQueue.php |Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". |Keeps the SQL tables from getting too big. | |- |maintenance/cleanupPageTriage.php |Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. |Fix a bug? [[phab:T321982|T321982]] | |- |maintenance/cleanupPageTriageLog.php |Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log |One time conversion of old log entries to modern format? Logs are now always written in the new format. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/6d9105c020c62d648a4ef6be957297bbc8a6d7d2]. |Probably |- |maintenance/cleanupPageTriagePageTags.php |Remove page from <code>pagetriage_page_tags</code> if they are not in <code>pagetriage_page</code> |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/00a752368e00e0d8b29a4908bfc3bab3096268dd]. |Probably |- |maintenance/DeleteAfcStates.php |Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ab2d8d4a2f9d0f4ff981afaee35a85f33edb5e99]. [[phab:T203184#4592953|T203184#4592953]]. |Probably |- |maintenance/FixNominatedForDeletion.php |Set <code>pagetriage_page.ptrp_deleted</code> if the page is has any <code>pagetriage_page_tags</code> related to deletion (e.g. prod_status, blp_prod_status, etc.) |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ff0c433226300aeba692089b5389435d47feef1e]. [[phab:T202582|T202582]]. |Probably |- |maintenance/populateDraftQueue.php |Add missing Draft namespace pages to the AfC triage queue. |Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/59e1fedffcdafc46722d7231011aee194db9ee08]. | |- |maintenance/updateUserMetadata.php |Former cron job. Update expired user metadata in the <code>pagetriage_page_tags</code> table |[https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/92a675a5f1f2e07cee532ec90fc57eee7f2cd49b]. [[phab:T341432|T341432]]. | |} === NOINDEX === NOINDEX refers to the HTML code <code>&lt;meta name="robots" content="noindex"></code>, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode <code><nowiki>__NOINDEX__</nowiki></code>. When {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in <code>includes/Hooks.php</code>, in the <code>onArticleViewFooter()</code> method. ==== First check ==== * First check: Noindex the page if ALL of the following are true: ** {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is turned on ** Page age is less than {{phpi|$wgPageTriageMaxAge}} (set to 90 days on enwiki) ** Page is in <code>pagetriage_page</code> table<ref>Checked by <code>isPageUnreviewed()</code></ref> ** Page is marked as unpatrolled (ptrp_status = 0) ==== Second check ==== * Second check: If the wikitext has the <code><nowiki>__NOINDEX__</nowiki></code> magic word, noindex the page if ALL of the following are true: ** Page age is less than {{phpi|$wgPageTriageMaxNoIndexAge}} (set to 90 days on enwiki) ** If {{phpi|$wgPageTriageMaxNoIndexAge}} is not null, page is in <code>pagetriage_page</code> table<ref>Checked by <code>isNewEnoughToNoIndex()</code>, if it doesn't exit early due to <code>$wgPageTriageMaxNoIndexAge</code> being <code>null</code>.</ref> The main use case for the <nowiki>__NOINDEX__</nowiki> magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See [https://en.wikipedia.org/w/index.php?search=NOINDEX&title=Special:Search&profile=advanced&fulltext=1&ns10=1 this search]. ==== Is the page in the <code>pagetriage_page</code> table? ==== In regards to the requirement "Page is in <code>pagetriage_page</code> table", there are several ways a for a page to get into this table: * Not been deleted by a PageTriage cron job ** One cron job deletes redirects older than {{phpi|$wgPageTriageRedirectAutoreviewAge}} days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them. ** Another cron job deletes reviewed pages after 30 days of being reviewed * In a namespace that PageTriage is configured to patrol * Isn't an article that is so old it predates the installation of PageTriage == JavaScript == === Directory structure === * /modules/ ** ext.pageTriage.article - related to marking an article as reviewed ** ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar ** ext.pageTriage.init - creates a mw.pageTriage object ** ext.pageTriage.newPagesFeed - Special:NewPagesFeed ** ext.pageTriage.sidebarLink - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates ** ext.pageTriage.toolbar - Page Curation toolbar <!--** ext.pageTriage.toolbar - Page Curation toolbar (Vue version)--> ** ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code ** ext.pageTriage.util - Backbone.js models (article, revision, stats) ** external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore <div lang="en" dir="ltr" class="mw-content-ltr"> === Toolbar === </div> The toolbar has three states: <code>maximized</code>, <code>minimized</code>, and <code>hidden</code>. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu. === External libraries === * front end ** old (moving away from) *** [[w:Backbone.js|Backbone.js]] *** [[w:jQuery|jQuery]] *** jQuery Badge *** jQuery Waypoints *** [[w:jQuery UI|jQuery UI]] *** [[w:Mustache (template system)|Mustache (template system)]] *** [[OOUI]] - used in modules/ext.PageTriage.enqueue ([https://codesearch.wmcloud.org/deployed/?q=oojs&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FPageTriage codesearch]) *** [[w:Underscore.js|Underscore.js]] ** new (moving towards) *** Codex *** [[w:Moment.js|Moment.js]] *** Vue Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, [[phab:T208256|we are interested in replacing these front end libraries]], to make the extension easier to maintain. <div lang="en" dir="ltr" class="mw-content-ltr"> === Client-side hooks === </div> ==== mw.hook ==== * <code>ext.pageTriage.toolbar.ready</code> ==== mw.pageTriage.actionQueue ==== <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage provides a specialised action queue system to allow other scripts and gadgets to integrate with it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is similar to <code>mw.hook</code> except that it uses promises.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done using the <code>mw.pageTriage.actionQueue</code> module.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the comments in the {{tmpl|0={{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=$1}}|source code}} for documentation on how the system works.</span> {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">It is [$1 not currently used by any scripts or gadgets on enwiki], but it is used internally by PageTriage.</span> |1=https://en.wikipedia.org/w/index.php?search=%22actionQueue%22&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1&ns2300=1&ns2301=1&ns2302=1&ns2303=1 }} <span lang="en" dir="ltr" class="mw-content-ltr">The actionQueue module is available after the mw.hook <code>ext.pageTriage.toolbar.ready</code> fires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage will give the action queue handler an Object with the following data, in addition to other data as noted below:</span> * <code>pageid</code> — <span lang="en" dir="ltr" class="mw-content-ltr">ID of the page being reviewed.</span> * <code>title</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Title of the page, including namespace.</span> * <code>reviewer</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of who is using PageTriage.</span> * <code>creator</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of the creator of the page.</span> * <code>reviewed</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the page is currently or will be marked as reviewed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ===== Available actions ===== </div> * <code>delete</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the reviewer tags a page for deletion. The data given to the handler also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An object of all the templates added to the page. The keys are the template title, and the values are an object of metadata, including things like the speedy deletion code.</span> * <code>mark</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the review status of a page is changed. Also includes:</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> * <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when maintenance tags are added to the page. Also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An array of the titles of all templates that were added to the page.</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ===== Example ===== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To use the action queue, register a function to be ran when an aforementioned action is fired. PageTriage will wait for any asynchronous code to complete before doing anything else, such as refreshing the page. For example, to edit [[Sandbox]] after a page has been marked as reviewed, you could use: </div> <syntaxhighlight lang="javascript"> $( function () { // You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time. mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) { // Listen for the 'mark' action. queue.add( 'mark', function ( data ) { return new mw.Api().edit( 'Sandbox', function ( revision ) { // Replace 'foo' with the note the reviewer left. return revision.content.replace( 'foo', data.note ); } ); } ); } ); } ); </syntaxhighlight> === Where are preferences stored? === Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is <code>userjs-NewPagesFeedFilterOptions</code>. It is set using <code>mw.Api().saveOption()</code> and read using <code>mw.user.options.get()</code>. This data ends up in the SQL <code>user_properties</code> table. Temporary accounts (IP masking) will not be able to store their preferences. == Installation on WMF wikis == This extension was designed for English Wikipedia. There is interest in changing its code and making it more useful to other wikis ([[phab:T50552]]), however this is challenging from a technical perspective and progress is slow. For now, the following are true: * PageTriage is allowed to be installed on other wikis<ref>https://meta.wikimedia.org/w/index.php?title=Limits_to_configuration_changes&diff=prev&oldid=26121135</ref> (although as of 2024 this hasn't happened yet). * The setting <code>$wgPageTriageEnableExtendedFeatures</code> can be set to <code>false</code> to turn off English Wikipedia-specific features such as maintenance tags and deletion tags in the Page Curation toolbar. * There are concerns that the noindex features (controlled by <code>$wgPageTriageNoIndexUnreviewedNewArticles</code> and <code>$wgPageTriageMaxNoIndexAge</code>) create search engine optimization problems, and these noindex features should not be enabled on new wikis without first discussing it with product manager [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]. * Like most other WMF-deployed extensions, PageTriage supports internationalization, and has its interface [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/i18n/|translated into many other languages]]. <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * [[commons:Category:PageTriage extension]] * [[Help:New pages feed]] * [[w:Wikipedia:Page Curation/Help]] == Notes == <references /> {{OnWikimedia}} {{Used by}} [[Category:API extensions{{#translation:}}]] 7a3shn0ajby49betjtuwg1tagpmnu5y OAuth/For Developers/de 0 1610550 8364286 8350290 2026-05-03T12:27:43Z FuzzyBot 451990 Updating to match new version of source page 8364286 wikitext text/x-wiki <languages /> <div lang="en" dir="ltr" class="mw-content-ltr"> This page explains how to develop applications that can integrate with a wiki running {{ll|Extension:OAuth}} (an extension which turns MediaWiki into an [[w:OAuth|OAuth]] server) to securely request permission to act on the user's behalf. </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you are developing a bot or similar application that always uses the same account, you might prefer the simpler [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]].</span>}} <span id="OAuth_in_a_nutshell"></span> == OAuth kurz zusammengefasst == <div lang="en" dir="ltr" class="mw-content-ltr"> OAuth allows an application to request permission from a user to act through that user's wiki account, without knowing the user's password, and without being able to do everything the user could (e.g. the app might be able to edit articles but not delete them, so even users with extended permissions can safely use OAuth-enabled tools). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This happens via the [https://oauth.net/2/ OAuth 2.0] or [https://oauth.net/core/1.0a/ OAuth 1.0a] protocol, and consists of three stages: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">The developer must register the application (often called "consumer" in the OAuth terminology) on the wiki, possibly go through some sort of review process, and will receive some credentials.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">When a user wants to use it, the application must initiate an authorisation process.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will involve sending the user to a special page on the wiki, which will display an authorisation dialog.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the user accepts, the application will receive another set of credentials (which are specific to that user, and can be revoked by the user at any time).</span> # <span lang="en" dir="ltr" class="mw-content-ltr">When the application actually needs to make an action (API request) on the user's behalf, it can combine the credentials received in steps 1 and 2 to sign the request.</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth is a widely used open standard (you can see it on sites like Google or Facebook or GitHub, e.g. when using accounts at those sites to log in elsewhere).</span> {{info|1=<span lang="en" dir="ltr" class="mw-content-ltr">OAuth should not be confused with:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Initiative for Open Authentication|OATH]] (a second-factor authentication protocol family, commonly known as "type the six numbers you see on your mobile app", now enabled on Wikimedia sites)</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[w:OpenID Connect|OpenID Connect]] (an authentication protocol based on OAuth 2.0, which the OAuth MediaWiki extension partially supports).</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> For a slightly larger nutshell on OAuth 1.0a, see [https://docs.google.com/presentation/d/1537HnwSaSzH-b8hINcz48SNhT8ElAUPC39to0_O1iNA/edit#slide=id.g15105b408d_0_287 these slides]. </div> <span id="OAuth_in_detail"></span> == OAuth im Detail == <span lang="en" dir="ltr" class="mw-content-ltr">The registration is basically the same for OAuth 1.0a and OAuth 2, with the difference being only the presence of a few form fields. The remaining parts differ significantly depending on the OAuth version.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Generally, OAuth 2 is recommended if available in your environment.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Registration === </div> <span lang="en" dir="ltr" class="mw-content-ltr">To register a new OAuth application, submit the form at <code>[[m:Special:OAuthConsumerRegistration/propose|Special:OAuthConsumerRegistration/propose]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Try to give sufficient information about the application for admins and users to decide whether it can be trusted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">URLs to places with more information (such as the application itself, the source code or on-wiki documentation) can be useful.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For OAuth applications to be used on Wikimedia projects, see [[meta:Special:MyLanguage/OAuth app guidelines|app guidelines]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Besides the descriptive ones, the fields have the following meaning:</span> * <code>This consumer is for use only by {{tag|user|open|plain=1}}</code>: <span lang="en" dir="ltr" class="mw-content-ltr">whether you use [[Special:MyLanguage/OAuth/Owner-only_consumers|owner-only consumers]] (which do not need to be reviewed or authorised but are only usable by yourself).</span> * <code>callback URL</code> (<span lang="en" dir="ltr" class="mw-content-ltr">irrelevant to owner-only consumers</span>): <span lang="en" dir="ltr" class="mw-content-ltr">the URL where the user returns after authorisation is checked against this.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(This is an extra layer of security against an attacker trying to steal credentials during authorisation.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>use as prefix</code> option is enabled, the URL must start with this (the check is dumb so make sure to add at least a <code>/</code> after the domain name), otherwise it must be an exact match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you are developing/testing your local machine, specify [[w:Localhost|Localhost]] in this field (e.g. <code><nowiki>http://localhost:8080/</nowiki></code>).</span> * <code>Applicable project</code> (<span lang="en" dir="ltr" class="mw-content-ltr">for wiki farms only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">project(s) on which to use your application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can limit the application to a single wiki or have it work everywhere.</span> * <code>Types of grants</code> / <code>Applicable grants</code>: <span lang="en" dir="ltr" class="mw-content-ltr">the permissions needed by your application (be conservative). The actual permissions will be an intersection of this and what permissions the user has.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Currently, the user must authorise grouped permissions, not individual ones ([[Phab:T59505|T59505]]).</span> * <code>Allowed IP ranges</code>: <span lang="en" dir="ltr" class="mw-content-ltr">an optional specification of the IP ranges that you use, where OAuth requests not matching this will be rejected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is an extra layer of security against an attacker stealing your application's credentials and trying to impersonate it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> * <code>Public RSA key</code> (<span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a only</span>): <span lang="en" dir="ltr" class="mw-content-ltr">public key used by your application for signing requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can just leave this empty (most applications do) to use a slightly simpler shared-secret mechanism instead.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is one of the few settings that you'll be able to change later.</span> <span lang="en" dir="ltr" class="mw-content-ltr">After registration, you'll receive the credentials needed to use OAuth.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to use it immediately with your own user account (this is meant for testing); others will only be able to use it once it is approved by an administrator.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The list of applications (approved or otherwise) is public and can be browsed at <code>[[m:Special:OAuthListConsumers|Special:OAuthListConsumers]]</code>. </div> === OAuth 1.0a === <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Authorisation ==== </div> [[File:OAuth authorization interface.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Authorisation dialog shown to users</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> When registering the application, you receive two pieces of credentials: the application token (a public ID for the application) and the application secret (sort of like a password). </div> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another set of credentials (these ones specific to that user): the access token and access secret.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">With an RSA key the credentials are slightly different.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is assumed that people choosing to use an RSA key know what they are doing, so this tutorial will assume you have chosen the non-RSA option.</span> </ref> <span lang="en" dir="ltr" class="mw-content-ltr">To get them, you need to go through the authorisation process, which consists of three steps:</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|OAuth/Owner-only consumers|owner-only consumers}} for that.</span> </ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Get a request token from the wiki by sending a GET request to <code>Special:OAuth/initiate</code>, signed with the application key and secret, with the callback URL (where the user will be sent after a successful authorisation) passed as the <code>oauth_callback</code> query parameter (if you have set a constant URL at registration, the value of the parameter ''must'' be <code>oob</code>).</span><ref name="non-nice-url"><span lang="en" dir="ltr" class="mw-content-ltr">Due to [[phab:T59500]] you must currently use a non-nice URL such as <code>en.wikipedia.org/w/index.php?title=Special:OAuth/initiate</code>.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">If you are successful, the response will be a JSON object with <code>token</code> and <code>key</code> fields—the request token and request secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If not, it will have an <code>error</code> field.)</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>Special:OAuth/authorize</code>, with the application token and request token passed as query parameters (<code>oauth_consumer_key</code> and <code>oauth_token</code>, respectively).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>oauth_verifier</code> will contain the verification code that you can use to exchange the request token and secret for the access token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a request to <code>Special:OAuth/token</code><ref name="non-nice-url" /> which includes the <code>oauth_verifier</code> parameter you just received and is signed with the application token and secret and the request token and secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token/secret (in the same format as the request token/secret in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token and secret is what you'll need to sign API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The request token and secret is not useful anymore and can be discarded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token will remain valid indefinitely, unless the user revokes it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(If you prefer not to store it, you can just repeat the authorisation process at any time though.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Applications which only need minimal privileges (have been registered as ''User identity verification only'') can use <code>/authenticate</code> instead of <code>/authorize</code> in step 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This works the same way, but the user will only see the authorisation dialog if they have not authorised this application before; otherwise the authorisation will silently succeed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure, so you don't have to implement it manually—each step will be a single function call.</span> Siehe unten für Beispiele. <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Making requests on the user's behalf ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to be signed with the application token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth, with one exception (see next section).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications registered as ''User identity verification only'' cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Identifying the user ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a custom protocol (similar to OpenID Connect) for authenticating the user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send a signed OAuth request to <code>Special:OAuth/identify</code>:</span><ref name="non-nice-url" /> <span lang="en" dir="ltr" class="mw-content-ltr">the response will be a [[w:JSON Web Token|JWT]] (JSON Web Token &ndash; a signed JSON object) including the name of the user, their {{ll|Manual:Central ID|central ID}} (under the key <code>sub</code>) and various other information (such as their user groups and whether they are blocked; also the email address if the application was registered with the right grant type).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is more secure than using the API (e.g. the userinfo module) for authentication, which could be subject to [[w:Man-in-the-middle attack|man-in-the-middle attacks]]; always use this if you need to identify a user!</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also, make sure you properly validate the JWT (there are many libraries which can help with that).</span> <span lang="en" dir="ltr" class="mw-content-ltr">You should check each of the following: the issuer (<code>iss</code>) matches the domain name of the wiki, the audience (<code>aud</code>) matches your application key, the issued-at time (<code>iat</code>) is in the past and reasonably close to current time, the expiration time (<code>exp</code>) is in the future, the nonce (<code>nonce</code>) matches the one you sent in the request.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Signing requests ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Steps 1 and 3 of the authorisation process require signing the request; API requests and <code>Special:OAuth/identify</code> must likewise be signed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The signing process is detailed in [https://oauth.net/core/1.0a/#signing_process section 9 of the OAuth spec], but it is cumbersome to implement by hand and [https://oauth.net/1/ many libraries] are available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find code samples and an overview of how to do it by hand in the {{ll|OAuth/Owner-only_consumers|owner-only consumer}} documentation.</span> (<span lang="en" dir="ltr" class="mw-content-ltr">That is for signing with the consumer token/secret and access token/secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Modify as appropriate to sign with the consumer token/secret and request token/secret (authorisation step 3) or consumer token/secret only (authorisation step 1).</span>) === OAuth 2 === <span id="Authorisation"></span> === Autorisation === <span lang="en" dir="ltr" class="mw-content-ltr">When registering the application, you receive two pieces of credentials: the client application key (a public ID for the application, also called the client ID or consumer key) and the client application secret (a confidential password).</span> <span lang="en" dir="ltr" class="mw-content-ltr">To be able to identify a user or make API requests in their name, you need to get another credential (this one specific to that user): the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To get it, you need to go through the [https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code/ the OAuth 2 Authorization Code flow], which consists of two steps:</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">This is sometimes called three-legged OAuth flow. In certain circumstances a simpler, one-step alternative (one-legged OAuth) is also available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See [[Special:MyLanguage/OAuth/Owner-only consumers|owner-only consumers]] for that.</span></ref> # <span lang="en" dir="ltr" class="mw-content-ltr">Ask the user to authorise the application by sending them to <code>oauth2/authorize</code> under the wiki's REST endpoint (usually <code>rest.php</code>), with <code>response_type=code</code> and the consumer key (also called the client application key) as the <code>client_id</code>, possibly a <code>state</code> if you want, and optionally the <code>redirect_uri</code> (if yes, it must be the same as in your application request).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If your consumer is non-confidential, you'll also need to include a [https://www.oauth.com/oauth2-servers/pkce/authorization-request/ PKCE code challenge] (<code>code_challenge</code> and <code>code_challenge_method=S256</code>).</span><ref>PKCE &mdash; Proof Key for Code Exchange</ref> <span lang="en" dir="ltr" class="mw-content-ltr">The user will see an authorisation dialog with some basic information about the application and the list of grants, and can decide to authorise or cancel.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">If the user did choose to authorise, they will be redirected to the callback URL you have given (at registration, or as a URL parameter in step 1).</span> <span lang="en" dir="ltr" class="mw-content-ltr">A query parameter called <code>code</code> will contain the authorisation code that you can use to fetch the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To do this, send a POST request to <code>oauth2/access_token</code> under the wiki's REST endpoint (usually <code>rest.php</code>), including <code>grant_type=authorization_code</code>, the <code>code</code> parameter you just received, your client authentication (typically as <code>client_id</code> and, for confidential clients, <code>client_secret</code>), the <code>redirect_uri</code> if and only if you specified it in the previous step (must be the same value for both), and if non-confidential the PKCE <code>code_verifier</code> and <code>code_challenge_method</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The response will contain the access token and a refresh token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access token is what you'll need to send future API requests.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The refresh token can be used to [https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/ fetch a new access token] if the original access token expires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If you prefer not to store either token, you can just repeat the authorisation process at any time.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(Before MediaWiki 1.46, non-confidential clients could only use refresh tokens using their client secret keys, not using their client IDs only, see [[phabricator:T323855|T323855]].)</span> <span lang="en" dir="ltr" class="mw-content-ltr">Chances are whatever language/framework you are using will have a library to support this procedure so you don't have to implement it manually - each step will be a single function call.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See below for examples.</span> <span id="Making_requests_on_the_user&#039;s_behalf"></span> Anfragen im Namen des Benutzers stellen <span lang="en" dir="ltr" class="mw-content-ltr">To take advantage of the authorisation, requests have to include the access token.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When that's successfully done, the wiki will treat the request as if it was made by the authorising user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only API requests can be made via OAuth 2.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Certain API modules which would not make sense with OAuth (such as login/logout) or would allow privilege escalation (such as the centralauthtoken API) are disabled.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the access token is used to fetch a CSRF token or other tokens, the access token must still be passed (as a header) with requests that use those tokens.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Applications which need minimal privileges (have been registered as ''User identity verification only'') cannot use the API at all. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> API requests including <code>rest.php/oauth2/resource/profile</code> must be authenticated with an HTTP Authorization header containing the access token, like: </div> <pre> Authorization: Bearer abcde....6789 </pre> <span id="Identifying_the_user"></span> Identifizierung des Benutzers <span lang="en" dir="ltr" class="mw-content-ltr">The OAuth extension includes a somewhat incomplete implementation of OpenID Connect for authenticating the user.</span><ref><span lang="en" dir="ltr" class="mw-content-ltr">See [[phab:T254063|T254063]] for details.</span></ref> <span lang="en" dir="ltr" class="mw-content-ltr">To use this, send an authenticated OAuth GET request to the <code>oauth2/resource/profile</code> API (MediaWiki's implementation of what the OIDC spec calls the UserInfo endpoint) under the wiki's REST endpoint (usually <code>rest.php</code>); the response will include the name of the user and various other information.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that the GET request must use the HTTP <code>Authorization</code> header, not a query string token.</span> * '''sub''' <span lang="en" dir="ltr" class="mw-content-ltr">(central user ID)</span> * '''username''' * '''editcount''' * '''confirmed_email''' * '''blocked''' * '''registered''' * '''groups''' * '''rights''' * '''realname''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> * '''email''' <span lang="en" dir="ltr" class="mw-content-ltr">(only if user granted permission)</span> <span id="Setting_up_a_development_environment"></span> Eine Entwicklungsumgebung aufsetzen <div lang="en" dir="ltr" class="mw-content-ltr"> You can register an OAuth application on [https://meta.wikimedia.beta.wmflabs.org/wiki/Special:OAuthConsumerRegistration/propose beta meta] and test your code against that. </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you want to improve the extension itself, or debug protocol issues in detail, OAuth is available in the {{ll|MediaWiki-Vagrant}} development environment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Add the <code>oauth</code> role, and your local wiki will be able to authorise OAuth apps.</span> <syntaxhighlight lang="shell-session"> $ vagrant roles enable oauth $ vagrant provision </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Once the code is nearly ready, you can register an OAuth application on the real wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You will be able to test it with the same user account used for registering, even before it gets reviewed by admins.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If you are creating an application for Wikimedia projects, consider hosting it at [[Wikitech:Portal:Toolforge|Wikimedia Toolforge]], a free tool forge and hosting platform for Wikimedia-related services. </div> <span id="Security_benefits_and_trade-offs"></span> Sicherheitsleistungen und Kompromisse * <span lang="en" dir="ltr" class="mw-content-ltr">Unlike password-based authentication, the OAuth 1.0 protocol prevents any [[w:Man-in-the-middle attack|man-in-the-middle attack]] even if the wiki does not require HTTPS: all interactions between MediaWiki and the application are signed with either a shared secret (using HMAC-SHA1), or a [[w:Public-key cryptography|public key]] (RSA).</span> <span lang="en" dir="ltr" class="mw-content-ltr">HTTPS is still required for certain steps though (for obtaining the shared secret in the second step of authorisation when not using RSA, and during app registration).</span> <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 2.0 does not involve signing and relies on HTTPS for security.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Actions via OAuth happen under the user's name but will be [[Special:MyLanguage/Manual:Tags|tagged]] with the application's name as well so rogue applications can be identified.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Wiki admins can revoke the application's permissions (and thus bar it from any further action) if needed.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The user can revoke the permission of the application to use that specific user account if they don't like how it works or don't trust it anymore.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Unlike a password change, this is not disruptive for the user.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Sufficiently flexible applications might allow users to circumvent IP blocks (since MediaWiki will see the IP of the application server, not that of the user).</span> <span lang="en" dir="ltr" class="mw-content-ltr">This can be handled the same way proxies are, by trusting XFF headers set by the application (see [[Phab:T159889|T159889]] for some limitations).</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The application secret must be kept secret.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Submitting it to source control or putting it into user-accessible code (such as mobile app or desktop application; even if it is obfuscated) undermines the security model and will result in admins forcefully disabling the application.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Exceptions are made for example applications demoing OAuth usage, if they are explicitly labeled as such and request limited rights.</span> <span id="Libraries"></span> == Bibliotheken == === PHP === * [[oauthclient-php]] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a client library maintained by Wikimedia</span> * [https://php.net/book.oauth OAuth] – <span lang="en" dir="ltr" class="mw-content-ltr">PECL client library</span> * [https://github.com/firebase/php-jwt firebase/php-jwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a popular JWT library</span> * [https://sr.ht/~taavi/laravel-socialite-mediawiki/ laravel-socialite-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki driver for [[w:Laravel|Laravel]]'s [https://laravel.com/docs/7.x/socialite Socialite] library.</span> === Python === * [https://github.com/valhallasw/flask-mwoauth flask-mwoauth] – <span lang="en" dir="ltr" class="mw-content-ltr">a Flask blueprint to run OAuth against MediaWiki's Extension:OAuth (See tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Flask_OAuth_tool My first Flask OAuth tool])</span> * [https://github.com/wikimedia/MediaWiki-OAuth MediaWiki-OAuth (mwoauth)] – <span lang="en" dir="ltr" class="mw-content-ltr">OAuth 1.0a on top of [http://requests-oauthlib.readthedocs.org/en/latest/oauth1_workflow.html requests-oauthlib]</span> * [https://github.com/python-social-auth/social-core python-social-auth] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework that includes a [https://github.com/python-social-auth/social-core/blob/master/social_core/backends/mediawiki.py MediaWiki backend] (Example tutorial: [https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/My_first_Django_OAuth_tool My first Django OAuth tool])</span> * [https://docs.authlib.org/en/latest/index.html authlib] – <span lang="en" dir="ltr" class="mw-content-ltr">auth framework to interact with Wikimedia OAuth 2.0 API (Full minimal Django OAuth 2.0 [https://code.basabuuka.org/alpcentaur/wmde_oauth_django_example example])</span> * [https://github.com/jpadilla/pyjwt pyjwt] – <span lang="en" dir="ltr" class="mw-content-ltr">a JWT library</span> === Ruby === * [https://github.com/timwaters/omniauth-mediawiki omniauth-mediawiki] – <span lang="en" dir="ltr" class="mw-content-ltr">a MediaWiki strategy for OmniAuth (also available as a [https://rubygems.org/gems/omniauth-mediawiki gem])</span> === Rust === * [https://crates.io/crates/mediawiki MediaWiki crate] <span lang="en" dir="ltr" class="mw-content-ltr">implements both OAuth1 and OAuth2 login mechanisms.</span> * [https://crates.io/crates/oauth2 oauth2 crate] === Node.js === * [https://www.npmjs.com/package/passport-mediawiki-oauth passport-mediawiki-oauth] – <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki strategy for the Passport auth framework (which can be used effortlessly as a middleware with Express JS and similar frameworks)</span> * [https://www.npmjs.com/package/oauth-fetch-json oauth-fetch-json] – <span lang="en" dir="ltr" class="mw-content-ltr">library for signing OAuth requests</span> * [https://www.npmjs.com/package/m3api-oauth2 m3api-oauth2] – an extension package for [https://www.npmjs.com/package/m3api m3api], making it easy to make requests authenticated via [[Special:MyLanguage/Help:OAuth|OAuth 2.0]] === Go === * [https://github.com/mrjones/oauth mrjones/oauth] (OAuth 1.0) * [https://pkg.go.dev/golang.org/x/oauth2 golang.org/x/oauth2] <span lang="en" dir="ltr" class="mw-content-ltr">(OAuth 2.0, [https://pkg.go.dev/golang.org/x/oauth2#example-Config example])</span> === Java === * [https://github.com/scribejava/scribejava ScribeJava] <span lang="en" dir="ltr" class="mw-content-ltr">since version 5.5.0 ([https://github.com/scribejava/scribejava/pull/852 pull request])</span> <span id="Example_code"></span> == Beispielcode == <span id="PHP_client_without_using_any_libraries"></span> PHP Client ohne Bibliotheken zu nutzen [[toollabs:oauth-hello-world|OAuth Hello World]] – <span lang="en" dir="ltr" class="mw-content-ltr">easy to understand demo application written in PHP without any libraries.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === PHP command-line client with RSA keys, using oauthclient-php === </div> <span lang="en" dir="ltr" class="mw-content-ltr">PHP application using classes from the OAuth extension codebase.</span> {{Todo|1=<span lang="en" dir="ltr" class="mw-content-ltr">convert this to actually use oauthclient-php! Probably just a bunch of <code>use</code> declarations.</span>}} <span lang="en" dir="ltr" class="mw-content-ltr">Before Starting:</span> <syntaxhighlight lang="shell-session"> $ openssl genrsa -out appkey.pem 4096 $ openssl rsa -in appkey.pem -pubout > appkey.pub </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">PHP source code</span>}} <syntaxhighlight lang="php"> <?php if ( PHP_SAPI !== 'cli' ) { die( "CLI-only test script\n" ); } /** * A basic client for overall testing */ function wfDebugLog( $method, $msg) { //echo "[$method] $msg\n"; } require 'OAuth.php'; require 'MWOAuthSignatureMethod.php'; $consumerKey = ''; #$consumerSecret = ''; // We don't need this, since we're using RSA, except to validate the /identify call $privateKey = file_get_contents( 'appkey.pem' ); $baseurl = 'http://<wiki>/wiki/Special:OAuth'; $endpoint_req = $baseurl . '/initiate?format=json&oauth_callback=oob'; // format=json makes php a little easier $endpoint_acc = $baseurl . '/token?format=json'; $endpoint_id = $baseurl . '/identify'; $c = new OAuthConsumer( $consumerKey, $privateKey ); // Make sure we sign title and format $parsed = parse_url( $endpoint_req ); $extraSignedParams = array(); parse_str($parsed['query'], $extraSignedParams); $extraSignedParams['title'] = 'Special:OAuth/initiate'; $init_req = OAuthRequest::from_consumer_and_token( $c, // OAuthConsumer for your app NULL, // User token, NULL for calls to initiate "GET", // http method $endpoint_req, // endpoint url (this is signed) $extraSignedParams // extra parameters we want to sign (must include title) ); $rsa_method = new MWOAuthSignatureMethod_RSA_SHA1( new OAuthDataStore(), $privateKey ); $init_req->sign_request( $rsa_method, // OAuthSignatureMethod $c, // OAuthConsumer for your app NULL // User token, NULL for calls to initiate ); echo "Getting request token with: $init_req\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, (string) $init_req ); // Pass OAuth in GET params curl_setopt( $ch, CURLOPT_HTTPGET, true ); curl_setopt( $ch, CURLOPT_HEADER, false ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $requestToken = json_decode( $data ); print "Visit $baseurl/authorize?oauth_token={$requestToken->key}&oauth_consumer_key=$consumerKey\n"; // ACCESS TOKEN print "Enter the verification code:\n"; $fh = fopen( "php://stdin", "r" ); $line = fgets( $fh ); $rc = new OAuthToken( $requestToken->key, $requestToken->secret ); $parsed = parse_url( $endpoint_acc ); parse_str($parsed['query'], $params); $params['oauth_verifier'] = trim($line); $params['title'] = 'Special:OAuth/token'; $acc_req = OAuthRequest::from_consumer_and_token( $c, $rc, "GET", $endpoint_acc, $params ); $acc_req->sign_request($rsa_method, $c, $rc); echo "Calling: $acc_req\n"; unset( $ch ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_acc ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $acc_req->to_header() ) ); // Set the Authorization Header $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; $acc = json_decode( $data ); $accessToken = new OAuthToken( $acc->key, $acc->secret ); /** * Insecurely call the api for information about the user. * A MITM can forge a response from the server, so don't rely on this for identity! */ $apiurl = 'http://<wiki>/w/api.php'; $apiParams = array( 'action' => 'query', 'meta' => 'userinfo', 'uiprop' => 'rights', 'format' => 'json', ); $api_req = OAuthRequest::from_consumer_and_token( $c, // Consumer $accessToken, // User Access Token "GET", // HTTP Method $apiurl, // Endpoint url $apiParams // Extra signed parameters ); $api_req->sign_request( $rsa_method, $c, $accessToken ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $apiurl . "?" . http_build_query( $apiParams ) ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $api_req->to_header() ) ); // Authorization header required for api $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } echo "Returned: $data\n\n"; /** * Securely get the identity of the user */ $consumerSecret = ''; $extraSignedParams = array( 'title' => 'Special:OAuth/identify' ); $req = OAuthRequest::from_consumer_and_token( $c, $accessToken, "GET", $endpoint_id, $extraSignedParams ); $req->sign_request( $rsa_method, $c, $accessToken ); echo "Calling: '$endpoint_id'\nHeader: {$req->to_header()}\n\n"; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $endpoint_id ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $req->to_header() ) ); $data = curl_exec( $ch ); if( !$data ) { 'Curl error: ' . curl_error( $ch ); } $identity = JWT::decode( $data, $consumerSecret ); // Validate the JWT if ( !validateJWT( $identity, $consumerKey, $req->get_parameter( 'oauth_nonce' ) ) ) { print "The JWT did not validate"; } else { print "We got a valid JWT, describing the user as:\n"; print " * Username: {$identity->username}\n"; print " * User's current groups: " . implode( ',', $identity->groups ) . "\n"; print " * User's current rights: " . implode( ',', $identity->rights ) . "\n"; } /** * Validate a JWT, to ensure this isn't a reply, spoof, etc. * @param $identity the decoded JWT * @param $consumerKey your App's Key * @param $nonce the nonce sent with your request, which should be returned */ function validateJWT( $identity, $consumerKey, $nonce ) { $expectedConnonicalServer = 'http://<wiki>'; // Verify the issuer is who we expect (server sends $wgCanonicalServer) if ( $identity->iss !== $expectedConnonicalServer ) { print "Invalid Issuer"; return false; } // Verify we are the intended audience if ( $identity->aud !== $consumerKey ) { print "Invalid Audience"; return false; } // Verify we are within the time limits of the token. // Issued at (iat) should be in the past, // Expiration (exp) should be in the future. $now = time(); if ( $identity->iat > $now || $identity->exp < $now ) { print "Invalid Time"; return false; } // Verify we haven't seen this nonce before, which would indicate a replay attack if ( $identity->nonce !== $nonce ) { print "Invalid Nonce"; return false; } return true; } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Python command-line client using mwoauth === </div> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Python source code</span>}} <syntaxhighlight lang="python"> from mwoauth import ConsumerToken, Handshaker import requests from requests_oauthlib import OAuth1 from six.moves import input # For compatibility between python 2 and 3 # Consruct a "consumer" from the key/secret provided by MediaWiki import config # You'll need to provide this # Create a file called config.py somewhere where it will be found by python, e.g. in the same directory as this script, with the following content (not including the # characters!) # consumer_key = "the consumer token you got when you registered your applicaton" # consumer_secret = "the secret token you got when you registered your application" # For example: # consumer_key = "20bc67da5081a30c736340c493f60d14" # consumer_secret = "af4313371bb2fb38e81fe7d300080085f52849f9" consumer_token = ConsumerToken(config.consumer_key, config.consumer_secret) # Construct handshaker with wiki URI and consumer handshaker = Handshaker("https://en.wikipedia.org/w/index.php", consumer_token) # Step 1: Initialise -- ask MediaWiki for a temporary key/secret for user redirect, request_token = handshaker.initiate() # Step 2: Authorise -- send user to MediaWiki to confirm authorisation print("Point your browser to: %s" % redirect) # response_qs = input("Response query string: ") # Step 3: Complete -- obtain authorised key/secret for "resource owner" access_token = handshaker.complete(request_token, response_qs) # Construct an auth object with the consumer and access tokens auth1 = OAuth1(consumer_token.key, client_secret=consumer_token.secret, resource_owner_key=access_token.key, resource_owner_secret=access_token.secret) # Now, accessing the API on behalf of a user print("Reading top 10 watchlist items") response = requests.get( "https://en.wikipedia.org/w/api.php", params={ 'action': "query", 'list': "watchlist", 'wllimit': 10, 'wlprop': "title|comment", 'format': "json" }, auth=auth1 ) for item in response.json()['query']['watchlist']: print("{title}\t{comment}".format(**item)) </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Python Toolforge tutorial using mwoauth === </div> Siehe: [[wikitech:Help:Toolforge/My first Flask OAuth tool]] === Python Toolforge tutorial using authlib (OAuth 2.0) === {{Collapse_top|title=Python source code}} <syntaxhighlight lang="python"> # > requirements.txt # flask==3.1.3 # requests==2.33.1 # authlib==1.7.0 # > config.py OAUTH_ACCESS_TOKEN_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/access_token" OAUTH_API_BASE_URL = "https://commons.wikimedia.org/w/" OAUTH_AUTHORIZE_URL = "https://commons.wikimedia.org/w/rest.php/oauth2/authorize" OAUTH_CODE_CHALLENGE_METHOD = "S256" OAUTH_CONSUMER_KEY = "Y" OAUTH_CONSUMER_SECRET = "Z" OAUTH_SCOPE = "basic editpage" # > app.py from authlib.integrations.flask_client import FlaskOAuth2App, OAuth from flask import Flask, jsonify, redirect, request, session from requests import Response app = Flask() app.config.from_pyfile("config.py") oauth = OAuth(app) oauth.register( name="mediawiki", client_id=app.config["OAUTH_CONSUMER_KEY"], client_secret=app.config["OAUTH_CONSUMER_SECRET"], client_kwargs={ "code_challenge_method": app.config["OAUTH_CODE_CHALLENGE_METHOD"], "scope": app.config["OAUTH_SCOPE"], }, api_base_url=app.config["OAUTH_API_BASE_URL"], access_token_url=app.config["OAUTH_ACCESS_TOKEN_URL"], authorize_url=app.config["OAUTH_AUTHORIZE_URL"], ) oauth_client: FlaskOAuth2App = oauth.create_client("mediawiki") @app.route("/") def index(): return app.send_static_file("index.html") @app.route("/login") def login(): return oauth_client.authorize_redirect() @app.route("/oauth-callback") def auth(): token = oauth_client.authorize_access_token() session["token"] = token return redirect("/") @app.route("/logout") def logout(): session.pop("token", None) session.clear() return redirect("/") @app.route("/user") def user(): response: Response = oauth_client.request( "GET", "rest.php/oauth2/resource/profile", token=session["token"], ) user = response.json() response.raise_for_status() return jsonify(user=user) @app.route("/edit", methods=["POST"]) def edit(): data = request.get_json() pageid = int(data["pageid"]) response: Response = oauth_client.request( "POST", "api.php", token=session["token"], data=dict( format="json", formatversion="2", action="query", pageids=str(pageid), prop="revisions|wbentityusage", rvprop="content", rvslots="*", meta="tokens", ), ) r = response.json() token = r["query"]["tokens"]["csrftoken"] ... </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Go command-line client using mrjones/auth (OAuth 1.0) === </div> Bevor du beginnst: <syntaxhighlight lang="shell-session"> $ go get github.com/mrjones/oauth </syntaxhighlight> {{Collapse_top|title=<span lang="en" dir="ltr" class="mw-content-ltr">Go source code</span>}} <syntaxhighlight lang="go"> package main import ( "fmt" "os" "github.com/mrjones/oauth" "io/ioutil" "strconv" ) func main() { var consumerKey string = "" var consumerSecret string = "" if len(consumerKey) == 0 || len(consumerSecret) == 0 { os.Exit(1) } c := oauth.NewConsumer( consumerKey, consumerSecret, oauth.ServiceProvider{ RequestTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/initiate", AuthorizeTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/authorize", AccessTokenUrl: "http://<wiki>/wiki/index.php/Special:OAuth/token", }) c.Debug(true) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/initiate", } c.AdditionalAuthorizationUrlParams = map[string]string{ "oauth_consumer_key": consumerKey, } requestToken, url, err := c.GetRequestTokenAndUrl("oob") if err != nil { fmt.Println( err ) } fmt.Println( "Got token " + requestToken.Token ) fmt.Println("(1) Go to: " + url) fmt.Println("(2) Grant access, you should get back a verification code.") fmt.Println("(3) Enter that verification code here: ") verificationCode := "" fmt.Scanln(&verificationCode) c.AdditionalParams = map[string]string{ "title": "Special:OAuth/token", } accessToken, err := c.AuthorizeToken(requestToken, verificationCode) if err != nil { fmt.Println(err) } fmt.Println( "Got access token " + accessToken.Token ) c.AdditionalParams = map[string]string{} response, err := c.Get( "http://<wiki>/wiki/api.php", map[string]string{ "action": "query", "meta": "userinfo", "uiprop": "rights", "format": "json", }, accessToken) if err != nil { fmt.Println(err) } fmt.Println( "\tResponse Status: '" + response.Status + "'\n" ) fmt.Println( "\tResponse Code: " + strconv.Itoa(response.StatusCode) + "\n" ) bytes, _ := ioutil.ReadAll(response.Body) fmt.Println( "\tResponse Body: " + string(bytes) + "\n" ) } </syntaxhighlight> {{Collapse_bottom}} <div lang="en" dir="ltr" class="mw-content-ltr"> === JavaScript applications using OAuth 2 === </div> * [https://github.com/wikimedia/apiclient-wiki wikimedia/apiclient-wiki] – <span lang="en" dir="ltr" class="mw-content-ltr">entire application in 520 lines of code</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Full applications using OAuth === </div> * [https://github.com/jdlrobson/weekipedia/blob/master/libs/server/app.js Weekipedia], <span lang="en" dir="ltr" class="mw-content-ltr">A full scale React.js port of the Wikipedia mobile site uses both.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">many [https://toolhub.wikimedia.org/search?keywords__term=oauth Toolforge tools]</span> <span id="Notes"></span> == Anmerkungen == <references /> gn4i7g6dxkyr5av7dso73wpl32gyy7s Extension:PageTriage/ban 102 1633705 8365063 8157884 2026-05-04T07:51:29Z FuzzyBot 451990 Updating to match new version of source page 8365063 wikitext text/x-wiki <languages /> {{Extension |templatemode = |status = stable |type1 = special |type2 = interface |newhook1 = |newhook2 = |username = |author = [[User:Kaldari|Ryan Kaldari]], [[User:Bsitu|Benny Situ]] |description = <span lang="en" dir="ltr" class="mw-content-ltr">Facilitates reviewing and approving new pages</span> |image = Extension-PageTriage Special-NewPagesFeed Screenshot.png |imagesize = 300 |version = |update = |version preview = |update preview = |compatibility policy = rel |mediawiki = |php = |composer = |table1 = pagetriage_page |table2 = pagetriage_page_tags |table3 = pagetriage_tags |download = {{WikimediaDownload|phab=EPTR}} |readme = |changelog = |example = [[wikipedia:Special:NewPagesFeed | Special:NewPagesFeed on the English Wikipedia]] |namespace = |tags = |compatibility = |bugzilla = |phabricator = PageTriage |vagrant-role = }} <span lang="en" dir="ltr" class="mw-content-ltr">'''PageTriage''' is an extension that aims to provide a feature-rich interface for triaging newly-created articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is intended to replace the ''new page patrol'' core function while adding additional functionality for reviewing, tagging, and improving new articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It adds a Special:NewPagesFeed page, and a page curation toolbar to new pages for those with the 'patrol' permission.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It was developed by the Wikimedia Foundation's [[Wikimedia_Features_engineering|Features Engineering team]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">For additional details see ''[[Page Curation|Page Curation]]''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An important note is that some of the configuration and code is specific to the English-language Wikipedia's workflows and as it's constructed now the extension is pretty much impossible to internationalise.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See [[Phabricator:T50552]].)</span> [[File:Page-Curation-Video.ogv|thumb|An overview of the page curation feature. The interface in the video is outdated but the content remains useful.]] <div lang="en" dir="ltr" class="mw-content-ltr"> == Installation == </div> [[File:PageTriage-ListView-Whole.png|thumb|Screenshot of Special:NewPagesFeed as it appeared in 2012]] {{ExtensionInstall |db-update=yes |registration=required |localsettings= }} == Checking for successful install == <div lang="en" dir="ltr" class="mw-content-ltr"> To actually see the extension working: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Create a new page containing just a few sentences of text as an anonymous user. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Visit Special:NewPagesFeed </div> <span lang="en" dir="ltr" class="mw-content-ltr">The new page should appear, flagged as "{{int|pagetriage-no-categories}}", "{{int|pagetriage-orphan}}", etc.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To see the page curation toolbar:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Login as a user with the 'sysop' permission, or add a group with the "[[Special:MyLanguage/Help:Patrolled_edits|patrol]]" permission, and add some user to that group, and login as that user. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Visit Special:NewPagesFeed </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Now you should see a "{{int|pagetriage-triage}}" button next to the new page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Click this and you should see the page curation toolbar on the new page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Advanced installation == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Additional extensions === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For full functionality, you'll also need to install some additional extensions, although PageTriage works without them. </div> * {{ll|Extension:Echo|Echo}} - Allows users to receive notifications for things like when an article they created has been marked as reviewed. * {{ll|Extension:ORES|ORES}} - In Special:NewPagesFeed, allows filtering by "predicted class" (<code>articlequality</code>: stub, start, c-class, b-class, good, featured) and "potential issues" (<code>draftquality</code>: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because <code>draftquality</code> needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's [[git:mediawiki/extensions/ORES/+/8bd39f26548d58fa8bf6765e1c23f5e3086f1cd4/extension.json#225|extension.json file]]. * {{ll|Extension:WikiLove|WikiLove}} - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily. === Enabling draft namespace === By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php <syntaxhighlight lang="php" copy> // These three settings are optional, and will enable the Articles-for-Creation mode. $wgPageTriageDraftNamespaceId = 118; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft'; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk'; </syntaxhighlight> When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed. By default pages edited in the draft namespace will be "unsubmitted". Articles in the draft namespace can be submitted for review by adding <nowiki>[[Category:Pending_AfC_submissions]]</nowiki> to the draft page. At which point they will show up under "awaiting review". Note the toolbar controlled by the configuration variable '''$wgPageTriageEnableCurationToolbar''' does not show up in the draft namespace. === Cron jobs === To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: <code>cron/updatePageTriageQueue.php</code> == Manual testing == === Special:NewPagesFeed -> Articles for Creation === * Enable draftspace by following the directions above in the section [[#Enabling draft namespace]]. * In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories: ** Unsubmitted: (no category) ** Awaiting review: Category:Pending AfC submissions ** Under review: Category:Pending AfC submissions being reviewed now ** Declined: Category:Declined AfC submissions Note: The Page Curation toolbar does not display for drafts. === ORES === Enwiki has the [[Extension:ORES|ORES extension]] installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure: * Clone Extension:ORES and add <code>wfLoadExtension( 'ORES' );</code> in <code>LocalSettings.php</code> * Add this to <code>LocalSettings.php</code> <syntaxhighlight lang="php" copy> $wgPageTriageEnableOresFilters = true; $wgOresWikiId = 'enwiki'; $wgOresModels = [ 'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ], 'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'sources' => [ 1 ] ] ]; </syntaxhighlight> * Run <code>php maintenance/run.php ./extensions/ORES/maintenance/BackfillPageTriageQueue.php</code> == Determining if a page is reviewed == === Status codes === There are status codes used to track whether a page is reviewed or not. These are the values given when you query <code>patrol_status</code>, <code>ptrp_reviewed</code>, and <code>ptrl_reviewed</code>: * Unreviewed ** 0 - unreviewed * Reviewed ** 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar) ** 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page) ** 3 - autopatrolled (someone with the <code>autopatrol</code> user right created the page, or moved the page from a non-tracked namespace to a tracked namespace) ** no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job) === Via the API === To check the review status of pages using an API query, you can use <code>api.php?action=query&prop=isreviewed</code>. Sample JavaScript code:<syntaxhighlight lang="js" copy> /** * @param {number} pageID The page ID number. A positive number with no commas. */ async isReviewed(pageID) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', pageids: pageID, } ); return response.query.pages[0].isreviewed; } /** * @param {string} title One title. Can include namespace. Example: User:Test */ async function isReviewed(title) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', titles: title, } ); return response.query.pages[0].isreviewed; } </syntaxhighlight> === Via SQL === To check the review status of pages using an SQL query, you need to query the <code>{{ll|Extension:PageTriage/pagetriage page table|pagetriage_page}}</code> table and the <code>ptrp_reviewed</code> field. Follow the directions in [[#Status codes]] to interpret the values of this field. <syntaxhighlight lang="sql" copy> /* By page_id */ SELECT ptrp_reviewed FROM pagetriage_page WHERE ptrp_page_id = 71318376 /* By page_title and page_namespace */ SELECT ptrp_reviewed FROM pagetriage_page JOIN page ON page_id = ptrp_page_id WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces AND page_namespace = 0 </syntaxhighlight> == SQL == === SQL tables === {| class="wikitable" |+ !Name !Prefix !Description !Old entry deletion strategy !Service classes (when refactoring, SQL queries should be moved to here) !Data classes |- |[[Extension:PageTriage/pagetriage page table|pagetriage_page]] |ptrp_ |The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query <code>ptrp_reviewed > 0</code> in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. |All articles deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. |QueueManager, QueueLookup |QueueRecord |- |[[Extension:PageTriage/pagetriage page tags table|pagetriage_page_tags]] |ptrpt_ |Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the <code>pagetriage_tags</code> table. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. |All article metadata deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status. | | |- |[[Extension:PageTriage/pagetriage tags table|pagetriage_tags]] |ptrt_ |A dictionary of page_tags, and their corresponding ID number. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. | | | |} === pagetriage_page_tags === <code>pagetriage_page_tags</code> data is updated by calling <code>ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata()</code>. This is called in the following hooks: * <code>onPageMoveComplete()</code> - runs when moving a page * <code>onLinksUpdateComplete()</code> - runs when saving an edit * <code>onMarkPatrolledComplete()</code> - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user. ==== List of tags ==== The <code>pagetriage_page_tags</code> are as follows: * Author information ** user_id ** user_name - there's a filter where you can type in their username ** user_editcount ** user_creation_date ** user_autoconfirmed ** user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with <code>MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()</code> ** user_bot ** user_block_status * Deletion tags - will display a black trash can icon if marked for deletion ** afd_status ** blp_prod_status ** csd_status ** prod_status * Special:NewPagesFeed red warning text ** category_count - No categories ** linkcount - Orphan ** reference - No citations ** recreated - Previously deleted ** user_block_status - Blocked * Page information ** page_len - size of article, in bytes ** rev_count - number of edits to the article ** snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article * afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined * copyvio - latest revision ID that has been tagged as a likely copyright violation, if any == PHP == <div lang="en" dir="ltr" class="mw-content-ltr"> === Extension configuration === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The extension is based on the 'patrol' right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For more information about configuring patrolling, see {{ll|Manual:Patrolling}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following configuration variables can be set from your LocalSettings.php file: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">Variable</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Default</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> |- | {{phpi|$wgPageTriageEnableCurationToolbar}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set to false to disable the [[Special:MyLanguage/Page Curation#User Experience: Curation Toolbar|curation toolbar]]</span> |- | {{phpi|$wgPageTriageInfiniteScrolling}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not to use infinite scrolling in the new pages feed</span> |- | {{phpi|$wgPageTriageMaxAge}} |90 | The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true). |- | {{phpi|$wgPageTriageNamespaces}} |NS_MAIN | The namespaces that PageTriage is active in. |- | {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} | {{phpi|false}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set this to true if new, unreviewed articles should be set to noindex.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In other words, if they should not be indexed by search engines until they are reviewed.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> See [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/extension.json#698|extension.json]] for the full list of config variables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === API === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> PageTriage adds the following API endpoints which can be used: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">API</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Triggering action</span> |- |pagetriageaction | <span lang="en" dir="ltr" class="mw-content-ltr">Mark a page as reviewed or unreviewed, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to mark a page as reviewed * Using the Page Curation toolbar to mark a page as unreviewed |- |pagetriagelist | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves the list of pages in the queue, and each page's metadata, including their reviewed status.</span> To retrieve one page, you must provide the <code>page_id</code>. To provide multiple pages, you must select one of <code>showreviewed</code>/<code>showunreviewed</code>, and one of <code>showredirs</code>/<code>showdeleted</code>/<code>showothers</code>, or no pages will be returned. |Read | * Loading the Page Curation toolbar (automatically loaded if you have the <code>patrol</code> userright and view a page that is unpatrolled or recently patrolled) * Viewing Special:NewPagesFeed (provides the list of articles) |- |pagetriagestats | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves stats about the number of pages in the queue for use in the header of Special:NewPagesFeed.</span> |Read | * Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer) |- |pagetriagetagcopyvio |Mark an article as a potential copyright violation, and logs the action in Special:Log. |Write | * Marking as a copyright violation by a bot with the <code>copyviobot</code> userright |- |pagetriagetagging | <span lang="en" dir="ltr" class="mw-content-ltr">Add clean-up tags or deletion templates to a page, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to place a maintenance tag on an article * Using the Page Curation toolbar to place a deletion tag on an article |} === Special:Log === The following logs are created by the extension: {| class="wikitable" |+ !Special:Log !<code>log_type</code> !<code>log_action</code> !Description !Notes |- |Page curation log |pagetriage-curation |delete, enqueue, reviewed, tag, unreviewed |Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed | |- |Potential copyright violation log |pagetriage-copyvio |insert |Allows a bot to log potential copyright violations |Doesn't display unless you set {{phpi|$wgPageTriageEnableCopyvio}} to true |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Entry points === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The extension's features can be triggered by various actions: </div> {| class="wikitable" |+ !Entry point type !File location !Notes |- |5 APIs |includes/Api/* | |- |1 special page |includes/SpecialNewPagesFeed.php | |- |20 hooks | * includes/Hooks.php * includes/HookHandlers/UndeleteHookHandler.php * includes/HookHandlers/Schema.php | |- |1 cron job |cron/updatePageTriageQueue.php |runs every 48 hours |- |7 maintenance scripts |maintenance/* |need to be run manually |} Here is a list of some actions and the corresponding entry points they trigger: {| class="wikitable" |+ !Action !Entry points used |- |View Main page | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() |- |Save an edit to the Main page | * Hooks.php -> onRevisionFromEditComplete() * Hooks.php -> onPageSaveComplete() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onLinksUpdateComplete() |- |Type in search box, triggering search suggestions | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onApiMain__moduleManager() |- |View Special:NewPagesFeed | * Hooks.php -> onBeforeCreateEchoEvent() * SpecialNewPagesFeed * ApiPageTriageStats * ApiPageTriageList |- |View an unreviewed article while logged in and having the <code>patrol</code> permission. | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onResourceLoaderGetConfigVars() * Hooks.php -> onDefinedTags() * Hooks.php -> onApiMain__moduleManager() * ApiPageTriageList (by <code>page_id</code>) |} ==== Hooks ==== {| class="wikitable" |+ !File !Group !Hook !Actions it performs |- | rowspan="18" |Hooks.php |Move page |[[Manual:Hooks/PageMoveComplete|onPageMoveComplete]] |Changes patrolled status, updates cache, updates metadata in <code>pagetriage_page_tags</code> table. |- | rowspan="3" |Edit page |[[Manual:Hooks/RevisionFromEditComplete|onRevisionFromEditComplete]] |Handles marking '''redirects that flip to articles''' as unreviewed. [[Deferred updates|DeferredUpdate]]. |- |[[Manual:Hooks/PageSaveComplete|onPageSaveComplete]] |Add '''new articles''' to the New Pages Feed and <code>pagetriage_page</code> table. |- |[[Manual:Hooks/LinksUpdateComplete|onLinksUpdateComplete]] |[[Deferred updates|DeferredUpdate]] of metadata / <code>pagetriage_page_tags</code> table. |- |Every page load |[[Manual:Hooks/ArticleViewFooter|onArticleViewFooter]] | * Turn on '''noindex''' for new, unreviewed articles. * Determine whether to load a '''link for autopatrolled users to unpatrol''' their article * Displays the '''Page Curation toolbar''' on recently created pages. * Create '''"Add to New Pages Feed" toolbox link''' for old articles. |- |[[Help:Patrolled edits]] |[[Manual:Hooks/MarkPatrolledComplete|onMarkPatrolledComplete]] |Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage. |- | rowspan="2" |Blocking and unblocking |[[Manual:Hooks/BlockIpComplete|onBlockIpComplete]] | rowspan="2" |Update article metadata / <code>pagetriage_page_tags</code> when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users. |- |[[Manual:Hooks/UnblockUserComplete|onUnblockUserComplete]] |- | |[[Manual:Hooks/ResourceLoaderGetConfigVars|onResourceLoaderGetConfigVars]] |Adjusts some config vars related to draft namespace ID. |- | rowspan="3" |[[Extension:Echo]] |[[Manual:Hooks/BeforeCreateEchoEvent|onBeforeCreateEchoEvent]] | rowspan="3" |Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed. |- |[[Manual:Hooks/EchoGetDefaultNotifiedUsers|onEchoGetDefaultNotifiedUsers]] |- |[[Manual:Hooks/LocalUserCreated|onLocalUserCreated]] |- |[[Extension:ORES]] |[[Manual:Hooks/ORESCheckModels|onORESCheckModels]] |Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio. |- | rowspan="3" |[[Help:Tags]] |[[Manual:Hooks/ListDefinedTags|onListDefinedTags]] | rowspan="3" |Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage". |- |[[Manual:Hooks/ChangeTagsAllowedAdd|onChangeTagsAllowedAdd]] |- |[[Manual:Hooks/ChangeTagsListActive|onChangeTagsListActive]] |- |API |[[Manual:Hooks/ApiMain::moduleManager|onApiMain__moduleManager]] |Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings. |- | rowspan="2" |Delete or undelete page |[[Manual:Hooks/PageDeleteComplete|onPageDeleteComplete]] |If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache. |- |HookHandlers/ UndeleteHookHandler.php |[[Manual:Hooks/ArticleUndelete|onArticleUndelete]] |If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed. |- |HookHandlers/ Schema.php |SQL |[[Manual:Hooks/LoadExtensionSchemaUpdates|onLoadExtensionSchemaUpdates]] | * The code that installs PageTriage's 4 SQL tables when you run <code>php maintenance/run.php update</code>. * Will also alter schemas from previous versions to match the latest schema. * This is also where all the '''pagetriage_tags''' are hard-coded. |} ==== Cron jobs and maintenance scripts ==== {| class="wikitable" |+ !File !What it does !Why run it? When is it useful? ![[phab:T341431|Safe to delete maintenance script?]] |- |cron/updatePageTriageQueue.php |Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". |Keeps the SQL tables from getting too big. | |- |maintenance/cleanupPageTriage.php |Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. |Fix a bug? [[phab:T321982|T321982]] | |- |maintenance/cleanupPageTriageLog.php |Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log |One time conversion of old log entries to modern format? Logs are now always written in the new format. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/6d9105c020c62d648a4ef6be957297bbc8a6d7d2]. |Probably |- |maintenance/cleanupPageTriagePageTags.php |Remove page from <code>pagetriage_page_tags</code> if they are not in <code>pagetriage_page</code> |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/00a752368e00e0d8b29a4908bfc3bab3096268dd]. |Probably |- |maintenance/DeleteAfcStates.php |Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ab2d8d4a2f9d0f4ff981afaee35a85f33edb5e99]. [[phab:T203184#4592953|T203184#4592953]]. |Probably |- |maintenance/FixNominatedForDeletion.php |Set <code>pagetriage_page.ptrp_deleted</code> if the page is has any <code>pagetriage_page_tags</code> related to deletion (e.g. prod_status, blp_prod_status, etc.) |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ff0c433226300aeba692089b5389435d47feef1e]. [[phab:T202582|T202582]]. |Probably |- |maintenance/populateDraftQueue.php |Add missing Draft namespace pages to the AfC triage queue. |Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/59e1fedffcdafc46722d7231011aee194db9ee08]. | |- |maintenance/updateUserMetadata.php |Former cron job. Update expired user metadata in the <code>pagetriage_page_tags</code> table |[https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/92a675a5f1f2e07cee532ec90fc57eee7f2cd49b]. [[phab:T341432|T341432]]. | |} === NOINDEX === NOINDEX refers to the HTML code <code>&lt;meta name="robots" content="noindex"></code>, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode <code><nowiki>__NOINDEX__</nowiki></code>. When {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in <code>includes/Hooks.php</code>, in the <code>onArticleViewFooter()</code> method. ==== First check ==== * First check: Noindex the page if ALL of the following are true: ** {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is turned on ** Page age is less than {{phpi|$wgPageTriageMaxAge}} (set to 90 days on enwiki) ** Page is in <code>pagetriage_page</code> table<ref>Checked by <code>isPageUnreviewed()</code></ref> ** Page is marked as unpatrolled (ptrp_status = 0) ==== Second check ==== * Second check: If the wikitext has the <code><nowiki>__NOINDEX__</nowiki></code> magic word, noindex the page if ALL of the following are true: ** Page age is less than {{phpi|$wgPageTriageMaxNoIndexAge}} (set to 90 days on enwiki) ** If {{phpi|$wgPageTriageMaxNoIndexAge}} is not null, page is in <code>pagetriage_page</code> table<ref>Checked by <code>isNewEnoughToNoIndex()</code>, if it doesn't exit early due to <code>$wgPageTriageMaxNoIndexAge</code> being <code>null</code>.</ref> The main use case for the <nowiki>__NOINDEX__</nowiki> magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See [https://en.wikipedia.org/w/index.php?search=NOINDEX&title=Special:Search&profile=advanced&fulltext=1&ns10=1 this search]. ==== Is the page in the <code>pagetriage_page</code> table? ==== In regards to the requirement "Page is in <code>pagetriage_page</code> table", there are several ways a for a page to get into this table: * Not been deleted by a PageTriage cron job ** One cron job deletes redirects older than {{phpi|$wgPageTriageRedirectAutoreviewAge}} days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them. ** Another cron job deletes reviewed pages after 30 days of being reviewed * In a namespace that PageTriage is configured to patrol * Isn't an article that is so old it predates the installation of PageTriage == JavaScript == === Directory structure === * /modules/ ** ext.pageTriage.article - related to marking an article as reviewed ** ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar ** ext.pageTriage.init - creates a mw.pageTriage object ** ext.pageTriage.newPagesFeed - Special:NewPagesFeed ** ext.pageTriage.sidebarLink - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates ** ext.pageTriage.toolbar - Page Curation toolbar <!--** ext.pageTriage.toolbar - Page Curation toolbar (Vue version)--> ** ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code ** ext.pageTriage.util - Backbone.js models (article, revision, stats) ** external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore <div lang="en" dir="ltr" class="mw-content-ltr"> === Toolbar === </div> The toolbar has three states: <code>maximized</code>, <code>minimized</code>, and <code>hidden</code>. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu. === External libraries === * front end ** old (moving away from) *** [[w:Backbone.js|Backbone.js]] *** [[w:jQuery|jQuery]] *** jQuery Badge *** jQuery Waypoints *** [[w:jQuery UI|jQuery UI]] *** [[w:Mustache (template system)|Mustache (template system)]] *** [[OOUI]] - used in modules/ext.PageTriage.enqueue ([https://codesearch.wmcloud.org/deployed/?q=oojs&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FPageTriage codesearch]) *** [[w:Underscore.js|Underscore.js]] ** new (moving towards) *** Codex *** [[w:Moment.js|Moment.js]] *** Vue Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, [[phab:T208256|we are interested in replacing these front end libraries]], to make the extension easier to maintain. <div lang="en" dir="ltr" class="mw-content-ltr"> === Client-side hooks === </div> ==== mw.hook ==== * <code>ext.pageTriage.toolbar.ready</code> ==== mw.pageTriage.actionQueue ==== <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage provides a specialised action queue system to allow other scripts and gadgets to integrate with it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is similar to <code>mw.hook</code> except that it uses promises.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done using the <code>mw.pageTriage.actionQueue</code> module.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the comments in the {{tmpl|0={{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=$1}}|source code}} for documentation on how the system works.</span> {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">It is [$1 not currently used by any scripts or gadgets on enwiki], but it is used internally by PageTriage.</span> |1=https://en.wikipedia.org/w/index.php?search=%22actionQueue%22&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1&ns2300=1&ns2301=1&ns2302=1&ns2303=1 }} <span lang="en" dir="ltr" class="mw-content-ltr">The actionQueue module is available after the mw.hook <code>ext.pageTriage.toolbar.ready</code> fires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage will give the action queue handler an Object with the following data, in addition to other data as noted below:</span> * <code>pageid</code> — <span lang="en" dir="ltr" class="mw-content-ltr">ID of the page being reviewed.</span> * <code>title</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Title of the page, including namespace.</span> * <code>reviewer</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of who is using PageTriage.</span> * <code>creator</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of the creator of the page.</span> * <code>reviewed</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the page is currently or will be marked as reviewed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ===== Available actions ===== </div> * <code>delete</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the reviewer tags a page for deletion. The data given to the handler also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An object of all the templates added to the page. The keys are the template title, and the values are an object of metadata, including things like the speedy deletion code.</span> * <code>mark</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the review status of a page is changed. Also includes:</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> * <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when maintenance tags are added to the page. Also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An array of the titles of all templates that were added to the page.</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ===== Example ===== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To use the action queue, register a function to be ran when an aforementioned action is fired. PageTriage will wait for any asynchronous code to complete before doing anything else, such as refreshing the page. For example, to edit [[Sandbox]] after a page has been marked as reviewed, you could use: </div> <syntaxhighlight lang="javascript"> $( function () { // You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time. mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) { // Listen for the 'mark' action. queue.add( 'mark', function ( data ) { return new mw.Api().edit( 'Sandbox', function ( revision ) { // Replace 'foo' with the note the reviewer left. return revision.content.replace( 'foo', data.note ); } ); } ); } ); } ); </syntaxhighlight> === Where are preferences stored? === Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is <code>userjs-NewPagesFeedFilterOptions</code>. It is set using <code>mw.Api().saveOption()</code> and read using <code>mw.user.options.get()</code>. This data ends up in the SQL <code>user_properties</code> table. Temporary accounts (IP masking) will not be able to store their preferences. == Installation on WMF wikis == This extension was designed for English Wikipedia. There is interest in changing its code and making it more useful to other wikis ([[phab:T50552]]), however this is challenging from a technical perspective and progress is slow. For now, the following are true: * PageTriage is allowed to be installed on other wikis<ref>https://meta.wikimedia.org/w/index.php?title=Limits_to_configuration_changes&diff=prev&oldid=26121135</ref> (although as of 2024 this hasn't happened yet). * The setting <code>$wgPageTriageEnableExtendedFeatures</code> can be set to <code>false</code> to turn off English Wikipedia-specific features such as maintenance tags and deletion tags in the Page Curation toolbar. * There are concerns that the noindex features (controlled by <code>$wgPageTriageNoIndexUnreviewedNewArticles</code> and <code>$wgPageTriageMaxNoIndexAge</code>) create search engine optimization problems, and these noindex features should not be enabled on new wikis without first discussing it with product manager [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]. * Like most other WMF-deployed extensions, PageTriage supports internationalization, and has its interface [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/i18n/|translated into many other languages]]. <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * [[commons:Category:PageTriage extension]] * [[Help:New pages feed]] * [[w:Wikipedia:Page Curation/Help]] == Notes == <references /> {{OnWikimedia}} {{Used by}} [[Category:API extensions{{#translation:}}]] tk1dmybqu2evt0489i11jref1e7vl8k Extension:LookupUser/cs 102 1633839 8364791 6707356 2026-05-03T23:53:08Z FuzzyBot 451990 Updating to match new version of source page 8364791 wikitext text/x-wiki <languages/> {{Warning |1=Toto rozšíření může představovat vážná rizika pro bezpečnost a/nebo soukromí! Uživatelé s přístupem k tomuto rozšíření mohou zobrazit předvolby jakéhokoli jiného uživatele, což je obvykle považováno za soukromé informace. I když toto rozšíření neumožňuje přístup k heslům účtů, poskytuje přístup k soukromým údajům, jako jsou skutečná jména, emailové adresy a další informace, které by mohly být snadno zneužity. Neudělujte proto přístup žádnému uživateli, pokud není 100 % důvěryhodný. Doporučuje se, aby byl přístup omezen na byrokraty nebo vyšší skupiny. Neneseme odpovědnost za žádné úniky zabezpečení nebo soukromí. }} {{Extension |status=stable |image=LookupUser.png |type1=special |description=Umožňuje získat informace o uživateli, jako je emailová adresa a ID |username=Tim Starling |license = GPL-2.0-or-later |mediawiki=1.46+ |version=1.5.2 |update=2018-07-14 |download={{WikimediaDownload|LookupUser|phab=ELOU}} |needs-updatephp =No |hook1=ContributionsToolLinks |rights=lookupuser |phabricator=LookupUser }} Rozšíření '''LookupUser''' umožňuje získat informace o uživateli, jako je emailová adresa, ID uživatele a uživatelské preference, tzn. vše, co uživatel zadal ve svých [[Special:MyLanguage/Help:Preferences|předvolbách]]. Toto rozšíření také zobrazuje čas a datum posledního přihlášení uživatele nebo jakoukoli úpravu, kterou uvádí jako prvek času a data "Záznam uživatele, kterého se naposledy dotkl:". (Toto se zobrazí jako UTC, i když jste nastavili vlastní časové pásmo/časové pásmo serveru je jiné.) <span id="Installation"></span> == Instalace == {{ExtensionInstall |registration=required |localsettings= // Kdo může používat Special:LookupUser? // Pokud chcete, aby to sysops mohli použít: #$wgGroupPermissions['*']['lookupuser'] = false; #$wgGroupPermissions['sysop']['lookupuser'] = true; // Nebo pro to chcete novou skupinu uživatelů. // (uživatele s 'uživatelskými právy' mohou ve výchozím nastavení přidávat do této skupiny pouze byrokraté) $wgGroupPermissions['*']['lookupuser'] = false; $wgGroupPermissions['lookupuser']['lookupuser'] = true; }} <span id="Usage"></span> == Použití == Rozšíření je přístupné přes stránku "Special:LookupUser". {{Used by}} 8kiegk9iuykugxgjms1agiv9ag8gz2n 8364802 8364791 2026-05-04T00:10:34Z FuzzyBot 451990 Updating to match new version of source page 8364802 wikitext text/x-wiki <languages/> {{Warning |1=Toto rozšíření může představovat vážná rizika pro bezpečnost a/nebo soukromí! Uživatelé s přístupem k tomuto rozšíření mohou zobrazit předvolby jakéhokoli jiného uživatele, což je obvykle považováno za soukromé informace. I když toto rozšíření neumožňuje přístup k heslům účtů, poskytuje přístup k soukromým údajům, jako jsou skutečná jména, emailové adresy a další informace, které by mohly být snadno zneužity. Neudělujte proto přístup žádnému uživateli, pokud není 100 % důvěryhodný. Doporučuje se, aby byl přístup omezen na byrokraty nebo vyšší skupiny. Neneseme odpovědnost za žádné úniky zabezpečení nebo soukromí. }} {{Extension |status=stable |image=LookupUser.png |type1=special |description=Umožňuje získat informace o uživateli, jako je emailová adresa a ID |username=Tim Starling |license = GPL-2.0-or-later |mediawiki=1.46+ ([[phab:T416793]]) |version=1.5.2 |update=2018-07-14 |download={{WikimediaDownload|LookupUser|phab=ELOU}} |needs-updatephp =No |hook1=ContributionsToolLinks |rights=lookupuser |phabricator=LookupUser }} Rozšíření '''LookupUser''' umožňuje získat informace o uživateli, jako je emailová adresa, ID uživatele a uživatelské preference, tzn. vše, co uživatel zadal ve svých [[Special:MyLanguage/Help:Preferences|předvolbách]]. Toto rozšíření také zobrazuje čas a datum posledního přihlášení uživatele nebo jakoukoli úpravu, kterou uvádí jako prvek času a data "Záznam uživatele, kterého se naposledy dotkl:". (Toto se zobrazí jako UTC, i když jste nastavili vlastní časové pásmo/časové pásmo serveru je jiné.) <span id="Installation"></span> == Instalace == {{ExtensionInstall |registration=required |localsettings= // Kdo může používat Special:LookupUser? // Pokud chcete, aby to sysops mohli použít: #$wgGroupPermissions['*']['lookupuser'] = false; #$wgGroupPermissions['sysop']['lookupuser'] = true; // Nebo pro to chcete novou skupinu uživatelů. // (uživatele s 'uživatelskými právy' mohou ve výchozím nastavení přidávat do této skupiny pouze byrokraté) $wgGroupPermissions['*']['lookupuser'] = false; $wgGroupPermissions['lookupuser']['lookupuser'] = true; }} <span id="Usage"></span> == Použití == Rozšíření je přístupné přes stránku "Special:LookupUser". {{Used by}} tcsd3nvip79m1c9mzjwl2w04dzkbqg7 Template:Update/hi 10 1656002 8364322 8364242 2026-05-03T12:47:03Z FuzzyBot 451990 Updating to match new version of source page 8364322 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |इस पृष्ठ के हिस्सों की '''तथ्यात्मक सटीकता''' (जिनके संबंध का विषय है {{{part|{{{1|}}}}}}) को '''कालग्रस्त जानकारी से खतरा हो सकता है'''। |इस पृष्ठ के कुछ हिस्से (जिनके संबंध का विषय है {{{part|{{{1|}}}}}}) '''कालग्रस्त''' हैं।}} |{{#if:{{{inaccurate|}}} |इस पृष्ठ की '''तथ्यात्मक सटीकता''' को '''कालग्रस्त जानकारी से खतरा हो सकता है'''। |यह पृष्ठ '''कालग्रस्त''' है।}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|इसे मीडियाविकि के किसी पुराने संस्करण के लिए लिखा गया था और शायद यह मीडियाविकि के नवीनतम संस्करण पर लागू न हो।}} अगर आपने इस पृष्ठ को जाँचा है और आपको पता लगा है कि सामग्री सही है, कृपया इस सूचना को हटा दें। {{#ifexist: {{TALKPAGENAME}} |&#32;इस बारे में संभवतः एक चर्चा [[{{TALKPAGENAME}}|वार्ता पृष्ठ]] पर है। }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>अंतिम अपडेट: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= इस साँचे के उपनाम: * {{tlx|outdated}} <span id="Examples"></span> == उदाहरण == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == ये भी देखें == * {{tl|historical}} == TemplateData == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> ia4szen9dye2rqvyv33rizrhwdk9qo3 Translations:Help:Extension:Translate/Components/53/ja 1198 1668079 8364838 5546743 2026-05-04T02:39:19Z Shirayuki 472859 fix 8364838 wikitext text/x-wiki メッセージ集は、メッセージ群のメッセージ一覧へのアクセスを提供します。 8k93ussfymiwhvz66nm0ov7nyalqjf1 Translations:Help:Extension:Translate/Components/57/ja 1198 1668083 8364840 5546751 2026-05-04T02:41:35Z Shirayuki 472859 8364840 wikitext text/x-wiki これにより、異なる名前空間にメッセージを持つメッセージ群を含む集約群の作成が防止されます。 jncdcugsby6m0rkpgsra2c4wlft64dk Translations:Help:Extension:Translate/Components/58/ja 1198 1668084 8364846 5546753 2026-05-04T02:53:16Z Shirayuki 472859 fix 8364846 wikitext text/x-wiki 以下は、メッセージ集を使用してメッセージ群 ''core'' のフィンランド語のすべての翻訳を読み込み、そのうち最初の 10 件を出力する方法の短い例です: otrdrb0me78vnx5gv1kbhu6rkdsre9m Extension:PageTriage/ar 102 1671506 8365064 8157883 2026-05-04T07:51:29Z FuzzyBot 451990 Updating to match new version of source page 8365064 wikitext text/x-wiki <languages /> {{Extension |templatemode = |status = stable |type1 = special |type2 = interface |newhook1 = |newhook2 = |username = |author = [[User:Kaldari|Ryan Kaldari]], [[User:Bsitu|Benny Situ]] |description = يسهل مراجعة واعتماد الصفحات الجديدة |image = Extension-PageTriage Special-NewPagesFeed Screenshot.png |imagesize = 300 |version = |update = |version preview = |update preview = |compatibility policy = rel |mediawiki = |php = |composer = |table1 = pagetriage_page |table2 = pagetriage_page_tags |table3 = pagetriage_tags |download = {{WikimediaDownload|phab=EPTR}} |readme = |changelog = |example = [[wikipedia:Special:NewPagesFeed | Special:NewPagesFeed on the English Wikipedia]] |namespace = |tags = |compatibility = |bugzilla = |phabricator = PageTriage |vagrant-role = }} '''PageTriage''' هو امتداد يهدف إلى توفير واجهة غنية بالميزات لفرز المقالات التي جرى إنشاؤها حديثًا. الغرض منه هو استبدال الوظيفة الأساسية "مراجعة الصفحة الجديدة" مع إضافة وظائف إضافية لمراجعة المقالات الجديدة ووضع وسوم عليها وتحسينها. <span class="mw-translate-fuzzy">يضيف صفحة [[Special:NewPagesFeed]]، وشريط أدوات تنظيم الصفحة إلى الصفحات الجديدة لمن لديهم صلاحية "المراجعة".</span> قام [[Wikimedia_Features_engineering|فريق هندسة الميزات (Features Engineering team)]] التابع لمؤسسة ويكيميديا بتطويره. طالع ''[[Page Curation|Page Curation]]'' لمزيد من التفاصيل. ملاحظة مهمة هي أن بعض الإعدادات والكود خاص بسير عمل ويكيبيديا باللغة الإنجليزية، ووفقًا لوضعه الحالي، فمن المستحيل إلى حد كبير تدويل (استخدامه في اللغات الأخرى) هذا الامتداد! (طالع [[Phabricator:T50552]].) [[File:Page-Curation-Video.ogv|thumb|An overview of the page curation feature. The interface in the video is outdated but the content remains useful.]] <span id="Installation"></span> <div class="mw-translate-fuzzy"> === التنصيب === </div> [[File:PageTriage-ListView-Whole.png|thumb|Screenshot of Special:NewPagesFeed as it appeared in 2012]] {{ExtensionInstall |db-update=yes |registration=required |localsettings= }} == Checking for successful install == لرؤية الامتداد يعمل بالفعل: * أضف صفحة كعب stub page جديدة كمستخدم مجهول. <div class="mw-translate-fuzzy"> * افتح [[Special:NewPagesFeed]] </div> يجب أن تظهر الصفحة الجديدة، وبها وسوم مثل "{{int|pagetriage-no-categories}}"، "{{int|pagetriage-orphan}}"، إلخ. لمشاهدة شريط أدوات تنظيم الصفحة: <div lang="en" dir="ltr" class="mw-content-ltr"> * Login as a user with the 'sysop' permission, or add a group with the "[[Special:MyLanguage/Help:Patrolled_edits|patrol]]" permission, and add some user to that group, and login as that user. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Visit Special:NewPagesFeed </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Now you should see a "{{int|pagetriage-triage}}" button next to the new page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Click this and you should see the page curation toolbar on the new page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Advanced installation == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Additional extensions === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For full functionality, you'll also need to install some additional extensions, although PageTriage works without them. </div> * {{ll|Extension:Echo|Echo}} - Allows users to receive notifications for things like when an article they created has been marked as reviewed. * {{ll|Extension:ORES|ORES}} - In Special:NewPagesFeed, allows filtering by "predicted class" (<code>articlequality</code>: stub, start, c-class, b-class, good, featured) and "potential issues" (<code>draftquality</code>: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because <code>draftquality</code> needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's [[git:mediawiki/extensions/ORES/+/8bd39f26548d58fa8bf6765e1c23f5e3086f1cd4/extension.json#225|extension.json file]]. * {{ll|Extension:WikiLove|WikiLove}} - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily. === Enabling draft namespace === By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php <syntaxhighlight lang="php" copy> // These three settings are optional, and will enable the Articles-for-Creation mode. $wgPageTriageDraftNamespaceId = 118; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft'; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk'; </syntaxhighlight> When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed. By default pages edited in the draft namespace will be "unsubmitted". Articles in the draft namespace can be submitted for review by adding <nowiki>[[Category:Pending_AfC_submissions]]</nowiki> to the draft page. At which point they will show up under "awaiting review". Note the toolbar controlled by the configuration variable '''$wgPageTriageEnableCurationToolbar''' does not show up in the draft namespace. === Cron jobs === To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: <code>cron/updatePageTriageQueue.php</code> == Manual testing == === Special:NewPagesFeed -> Articles for Creation === * Enable draftspace by following the directions above in the section [[#Enabling draft namespace]]. * In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories: ** Unsubmitted: (no category) ** Awaiting review: Category:Pending AfC submissions ** Under review: Category:Pending AfC submissions being reviewed now ** Declined: Category:Declined AfC submissions Note: The Page Curation toolbar does not display for drafts. === ORES === Enwiki has the [[Extension:ORES|ORES extension]] installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure: * Clone Extension:ORES and add <code>wfLoadExtension( 'ORES' );</code> in <code>LocalSettings.php</code> * Add this to <code>LocalSettings.php</code> <syntaxhighlight lang="php" copy> $wgPageTriageEnableOresFilters = true; $wgOresWikiId = 'enwiki'; $wgOresModels = [ 'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ], 'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'sources' => [ 1 ] ] ]; </syntaxhighlight> * Run <code>php maintenance/run.php ./extensions/ORES/maintenance/BackfillPageTriageQueue.php</code> == Determining if a page is reviewed == === Status codes === There are status codes used to track whether a page is reviewed or not. These are the values given when you query <code>patrol_status</code>, <code>ptrp_reviewed</code>, and <code>ptrl_reviewed</code>: * Unreviewed ** 0 - unreviewed * Reviewed ** 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar) ** 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page) ** 3 - autopatrolled (someone with the <code>autopatrol</code> user right created the page, or moved the page from a non-tracked namespace to a tracked namespace) ** no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job) === Via the API === To check the review status of pages using an API query, you can use <code>api.php?action=query&prop=isreviewed</code>. Sample JavaScript code:<syntaxhighlight lang="js" copy> /** * @param {number} pageID The page ID number. A positive number with no commas. */ async isReviewed(pageID) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', pageids: pageID, } ); return response.query.pages[0].isreviewed; } /** * @param {string} title One title. Can include namespace. Example: User:Test */ async function isReviewed(title) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', titles: title, } ); return response.query.pages[0].isreviewed; } </syntaxhighlight> === Via SQL === To check the review status of pages using an SQL query, you need to query the <code>{{ll|Extension:PageTriage/pagetriage page table|pagetriage_page}}</code> table and the <code>ptrp_reviewed</code> field. Follow the directions in [[#Status codes]] to interpret the values of this field. <syntaxhighlight lang="sql" copy> /* By page_id */ SELECT ptrp_reviewed FROM pagetriage_page WHERE ptrp_page_id = 71318376 /* By page_title and page_namespace */ SELECT ptrp_reviewed FROM pagetriage_page JOIN page ON page_id = ptrp_page_id WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces AND page_namespace = 0 </syntaxhighlight> == SQL == === SQL tables === {| class="wikitable" |+ !Name !Prefix !Description !Old entry deletion strategy !Service classes (when refactoring, SQL queries should be moved to here) !Data classes |- |[[Extension:PageTriage/pagetriage page table|pagetriage_page]] |ptrp_ |The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query <code>ptrp_reviewed > 0</code> in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. |All articles deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. |QueueManager, QueueLookup |QueueRecord |- |[[Extension:PageTriage/pagetriage page tags table|pagetriage_page_tags]] |ptrpt_ |Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the <code>pagetriage_tags</code> table. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. |All article metadata deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status. | | |- |[[Extension:PageTriage/pagetriage tags table|pagetriage_tags]] |ptrt_ |A dictionary of page_tags, and their corresponding ID number. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. | | | |} === pagetriage_page_tags === <code>pagetriage_page_tags</code> data is updated by calling <code>ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata()</code>. This is called in the following hooks: * <code>onPageMoveComplete()</code> - runs when moving a page * <code>onLinksUpdateComplete()</code> - runs when saving an edit * <code>onMarkPatrolledComplete()</code> - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user. ==== List of tags ==== The <code>pagetriage_page_tags</code> are as follows: * Author information ** user_id ** user_name - there's a filter where you can type in their username ** user_editcount ** user_creation_date ** user_autoconfirmed ** user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with <code>MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()</code> ** user_bot ** user_block_status * Deletion tags - will display a black trash can icon if marked for deletion ** afd_status ** blp_prod_status ** csd_status ** prod_status * Special:NewPagesFeed red warning text ** category_count - No categories ** linkcount - Orphan ** reference - No citations ** recreated - Previously deleted ** user_block_status - Blocked * Page information ** page_len - size of article, in bytes ** rev_count - number of edits to the article ** snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article * afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined * copyvio - latest revision ID that has been tagged as a likely copyright violation, if any == PHP == <div lang="en" dir="ltr" class="mw-content-ltr"> === Extension configuration === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The extension is based on the 'patrol' right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For more information about configuring patrolling, see {{ll|Manual:Patrolling}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following configuration variables can be set from your LocalSettings.php file: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">Variable</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Default</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> |- | {{phpi|$wgPageTriageEnableCurationToolbar}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set to false to disable the [[Special:MyLanguage/Page Curation#User Experience: Curation Toolbar|curation toolbar]]</span> |- | {{phpi|$wgPageTriageInfiniteScrolling}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not to use infinite scrolling in the new pages feed</span> |- | {{phpi|$wgPageTriageMaxAge}} |90 | The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true). |- | {{phpi|$wgPageTriageNamespaces}} |NS_MAIN | The namespaces that PageTriage is active in. |- | {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} | {{phpi|false}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set this to true if new, unreviewed articles should be set to noindex.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In other words, if they should not be indexed by search engines until they are reviewed.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> See [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/extension.json#698|extension.json]] for the full list of config variables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === API === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> PageTriage adds the following API endpoints which can be used: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">API</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Triggering action</span> |- |pagetriageaction | <span lang="en" dir="ltr" class="mw-content-ltr">Mark a page as reviewed or unreviewed, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to mark a page as reviewed * Using the Page Curation toolbar to mark a page as unreviewed |- |pagetriagelist | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves the list of pages in the queue, and each page's metadata, including their reviewed status.</span> To retrieve one page, you must provide the <code>page_id</code>. To provide multiple pages, you must select one of <code>showreviewed</code>/<code>showunreviewed</code>, and one of <code>showredirs</code>/<code>showdeleted</code>/<code>showothers</code>, or no pages will be returned. |Read | * Loading the Page Curation toolbar (automatically loaded if you have the <code>patrol</code> userright and view a page that is unpatrolled or recently patrolled) * Viewing Special:NewPagesFeed (provides the list of articles) |- |pagetriagestats | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves stats about the number of pages in the queue for use in the header of Special:NewPagesFeed.</span> |Read | * Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer) |- |pagetriagetagcopyvio |Mark an article as a potential copyright violation, and logs the action in Special:Log. |Write | * Marking as a copyright violation by a bot with the <code>copyviobot</code> userright |- |pagetriagetagging | <span lang="en" dir="ltr" class="mw-content-ltr">Add clean-up tags or deletion templates to a page, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to place a maintenance tag on an article * Using the Page Curation toolbar to place a deletion tag on an article |} === Special:Log === The following logs are created by the extension: {| class="wikitable" |+ !Special:Log !<code>log_type</code> !<code>log_action</code> !Description !Notes |- |Page curation log |pagetriage-curation |delete, enqueue, reviewed, tag, unreviewed |Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed | |- |Potential copyright violation log |pagetriage-copyvio |insert |Allows a bot to log potential copyright violations |Doesn't display unless you set {{phpi|$wgPageTriageEnableCopyvio}} to true |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Entry points === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The extension's features can be triggered by various actions: </div> {| class="wikitable" |+ !Entry point type !File location !Notes |- |5 APIs |includes/Api/* | |- |1 special page |includes/SpecialNewPagesFeed.php | |- |20 hooks | * includes/Hooks.php * includes/HookHandlers/UndeleteHookHandler.php * includes/HookHandlers/Schema.php | |- |1 cron job |cron/updatePageTriageQueue.php |runs every 48 hours |- |7 maintenance scripts |maintenance/* |need to be run manually |} Here is a list of some actions and the corresponding entry points they trigger: {| class="wikitable" |+ !Action !Entry points used |- |View Main page | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() |- |Save an edit to the Main page | * Hooks.php -> onRevisionFromEditComplete() * Hooks.php -> onPageSaveComplete() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onLinksUpdateComplete() |- |Type in search box, triggering search suggestions | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onApiMain__moduleManager() |- |View Special:NewPagesFeed | * Hooks.php -> onBeforeCreateEchoEvent() * SpecialNewPagesFeed * ApiPageTriageStats * ApiPageTriageList |- |View an unreviewed article while logged in and having the <code>patrol</code> permission. | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onResourceLoaderGetConfigVars() * Hooks.php -> onDefinedTags() * Hooks.php -> onApiMain__moduleManager() * ApiPageTriageList (by <code>page_id</code>) |} ==== Hooks ==== {| class="wikitable" |+ !File !Group !Hook !Actions it performs |- | rowspan="18" |Hooks.php |Move page |[[Manual:Hooks/PageMoveComplete|onPageMoveComplete]] |Changes patrolled status, updates cache, updates metadata in <code>pagetriage_page_tags</code> table. |- | rowspan="3" |Edit page |[[Manual:Hooks/RevisionFromEditComplete|onRevisionFromEditComplete]] |Handles marking '''redirects that flip to articles''' as unreviewed. [[Deferred updates|DeferredUpdate]]. |- |[[Manual:Hooks/PageSaveComplete|onPageSaveComplete]] |Add '''new articles''' to the New Pages Feed and <code>pagetriage_page</code> table. |- |[[Manual:Hooks/LinksUpdateComplete|onLinksUpdateComplete]] |[[Deferred updates|DeferredUpdate]] of metadata / <code>pagetriage_page_tags</code> table. |- |Every page load |[[Manual:Hooks/ArticleViewFooter|onArticleViewFooter]] | * Turn on '''noindex''' for new, unreviewed articles. * Determine whether to load a '''link for autopatrolled users to unpatrol''' their article * Displays the '''Page Curation toolbar''' on recently created pages. * Create '''"Add to New Pages Feed" toolbox link''' for old articles. |- |[[Help:Patrolled edits]] |[[Manual:Hooks/MarkPatrolledComplete|onMarkPatrolledComplete]] |Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage. |- | rowspan="2" |Blocking and unblocking |[[Manual:Hooks/BlockIpComplete|onBlockIpComplete]] | rowspan="2" |Update article metadata / <code>pagetriage_page_tags</code> when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users. |- |[[Manual:Hooks/UnblockUserComplete|onUnblockUserComplete]] |- | |[[Manual:Hooks/ResourceLoaderGetConfigVars|onResourceLoaderGetConfigVars]] |Adjusts some config vars related to draft namespace ID. |- | rowspan="3" |[[Extension:Echo]] |[[Manual:Hooks/BeforeCreateEchoEvent|onBeforeCreateEchoEvent]] | rowspan="3" |Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed. |- |[[Manual:Hooks/EchoGetDefaultNotifiedUsers|onEchoGetDefaultNotifiedUsers]] |- |[[Manual:Hooks/LocalUserCreated|onLocalUserCreated]] |- |[[Extension:ORES]] |[[Manual:Hooks/ORESCheckModels|onORESCheckModels]] |Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio. |- | rowspan="3" |[[Help:Tags]] |[[Manual:Hooks/ListDefinedTags|onListDefinedTags]] | rowspan="3" |Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage". |- |[[Manual:Hooks/ChangeTagsAllowedAdd|onChangeTagsAllowedAdd]] |- |[[Manual:Hooks/ChangeTagsListActive|onChangeTagsListActive]] |- |API |[[Manual:Hooks/ApiMain::moduleManager|onApiMain__moduleManager]] |Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings. |- | rowspan="2" |Delete or undelete page |[[Manual:Hooks/PageDeleteComplete|onPageDeleteComplete]] |If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache. |- |HookHandlers/ UndeleteHookHandler.php |[[Manual:Hooks/ArticleUndelete|onArticleUndelete]] |If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed. |- |HookHandlers/ Schema.php |SQL |[[Manual:Hooks/LoadExtensionSchemaUpdates|onLoadExtensionSchemaUpdates]] | * The code that installs PageTriage's 4 SQL tables when you run <code>php maintenance/run.php update</code>. * Will also alter schemas from previous versions to match the latest schema. * This is also where all the '''pagetriage_tags''' are hard-coded. |} ==== Cron jobs and maintenance scripts ==== {| class="wikitable" |+ !File !What it does !Why run it? When is it useful? ![[phab:T341431|Safe to delete maintenance script?]] |- |cron/updatePageTriageQueue.php |Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". |Keeps the SQL tables from getting too big. | |- |maintenance/cleanupPageTriage.php |Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. |Fix a bug? [[phab:T321982|T321982]] | |- |maintenance/cleanupPageTriageLog.php |Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log |One time conversion of old log entries to modern format? Logs are now always written in the new format. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/6d9105c020c62d648a4ef6be957297bbc8a6d7d2]. |Probably |- |maintenance/cleanupPageTriagePageTags.php |Remove page from <code>pagetriage_page_tags</code> if they are not in <code>pagetriage_page</code> |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/00a752368e00e0d8b29a4908bfc3bab3096268dd]. |Probably |- |maintenance/DeleteAfcStates.php |Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ab2d8d4a2f9d0f4ff981afaee35a85f33edb5e99]. [[phab:T203184#4592953|T203184#4592953]]. |Probably |- |maintenance/FixNominatedForDeletion.php |Set <code>pagetriage_page.ptrp_deleted</code> if the page is has any <code>pagetriage_page_tags</code> related to deletion (e.g. prod_status, blp_prod_status, etc.) |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ff0c433226300aeba692089b5389435d47feef1e]. [[phab:T202582|T202582]]. |Probably |- |maintenance/populateDraftQueue.php |Add missing Draft namespace pages to the AfC triage queue. |Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/59e1fedffcdafc46722d7231011aee194db9ee08]. | |- |maintenance/updateUserMetadata.php |Former cron job. Update expired user metadata in the <code>pagetriage_page_tags</code> table |[https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/92a675a5f1f2e07cee532ec90fc57eee7f2cd49b]. [[phab:T341432|T341432]]. | |} === NOINDEX === NOINDEX refers to the HTML code <code>&lt;meta name="robots" content="noindex"></code>, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode <code><nowiki>__NOINDEX__</nowiki></code>. When {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in <code>includes/Hooks.php</code>, in the <code>onArticleViewFooter()</code> method. ==== First check ==== * First check: Noindex the page if ALL of the following are true: ** {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is turned on ** Page age is less than {{phpi|$wgPageTriageMaxAge}} (set to 90 days on enwiki) ** Page is in <code>pagetriage_page</code> table<ref>Checked by <code>isPageUnreviewed()</code></ref> ** Page is marked as unpatrolled (ptrp_status = 0) ==== Second check ==== * Second check: If the wikitext has the <code><nowiki>__NOINDEX__</nowiki></code> magic word, noindex the page if ALL of the following are true: ** Page age is less than {{phpi|$wgPageTriageMaxNoIndexAge}} (set to 90 days on enwiki) ** If {{phpi|$wgPageTriageMaxNoIndexAge}} is not null, page is in <code>pagetriage_page</code> table<ref>Checked by <code>isNewEnoughToNoIndex()</code>, if it doesn't exit early due to <code>$wgPageTriageMaxNoIndexAge</code> being <code>null</code>.</ref> The main use case for the <nowiki>__NOINDEX__</nowiki> magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See [https://en.wikipedia.org/w/index.php?search=NOINDEX&title=Special:Search&profile=advanced&fulltext=1&ns10=1 this search]. ==== Is the page in the <code>pagetriage_page</code> table? ==== In regards to the requirement "Page is in <code>pagetriage_page</code> table", there are several ways a for a page to get into this table: * Not been deleted by a PageTriage cron job ** One cron job deletes redirects older than {{phpi|$wgPageTriageRedirectAutoreviewAge}} days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them. ** Another cron job deletes reviewed pages after 30 days of being reviewed * In a namespace that PageTriage is configured to patrol * Isn't an article that is so old it predates the installation of PageTriage == JavaScript == === Directory structure === * /modules/ ** ext.pageTriage.article - related to marking an article as reviewed ** ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar ** ext.pageTriage.init - creates a mw.pageTriage object ** ext.pageTriage.newPagesFeed - Special:NewPagesFeed ** ext.pageTriage.sidebarLink - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates ** ext.pageTriage.toolbar - Page Curation toolbar <!--** ext.pageTriage.toolbar - Page Curation toolbar (Vue version)--> ** ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code ** ext.pageTriage.util - Backbone.js models (article, revision, stats) ** external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore <div lang="en" dir="ltr" class="mw-content-ltr"> === Toolbar === </div> The toolbar has three states: <code>maximized</code>, <code>minimized</code>, and <code>hidden</code>. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu. === External libraries === * front end ** old (moving away from) *** [[w:Backbone.js|Backbone.js]] *** [[w:jQuery|jQuery]] *** jQuery Badge *** jQuery Waypoints *** [[w:jQuery UI|jQuery UI]] *** [[w:Mustache (template system)|Mustache (template system)]] *** [[OOUI]] - used in modules/ext.PageTriage.enqueue ([https://codesearch.wmcloud.org/deployed/?q=oojs&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FPageTriage codesearch]) *** [[w:Underscore.js|Underscore.js]] ** new (moving towards) *** Codex *** [[w:Moment.js|Moment.js]] *** Vue Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, [[phab:T208256|we are interested in replacing these front end libraries]], to make the extension easier to maintain. <div lang="en" dir="ltr" class="mw-content-ltr"> === Client-side hooks === </div> ==== mw.hook ==== * <code>ext.pageTriage.toolbar.ready</code> ==== mw.pageTriage.actionQueue ==== <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage provides a specialised action queue system to allow other scripts and gadgets to integrate with it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is similar to <code>mw.hook</code> except that it uses promises.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done using the <code>mw.pageTriage.actionQueue</code> module.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the comments in the {{tmpl|0={{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=$1}}|source code}} for documentation on how the system works.</span> {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">It is [$1 not currently used by any scripts or gadgets on enwiki], but it is used internally by PageTriage.</span> |1=https://en.wikipedia.org/w/index.php?search=%22actionQueue%22&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1&ns2300=1&ns2301=1&ns2302=1&ns2303=1 }} <span lang="en" dir="ltr" class="mw-content-ltr">The actionQueue module is available after the mw.hook <code>ext.pageTriage.toolbar.ready</code> fires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage will give the action queue handler an Object with the following data, in addition to other data as noted below:</span> * <code>pageid</code> — <span lang="en" dir="ltr" class="mw-content-ltr">ID of the page being reviewed.</span> * <code>title</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Title of the page, including namespace.</span> * <code>reviewer</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of who is using PageTriage.</span> * <code>creator</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of the creator of the page.</span> * <code>reviewed</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the page is currently or will be marked as reviewed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ===== Available actions ===== </div> * <code>delete</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the reviewer tags a page for deletion. The data given to the handler also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An object of all the templates added to the page. The keys are the template title, and the values are an object of metadata, including things like the speedy deletion code.</span> * <code>mark</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the review status of a page is changed. Also includes:</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> * <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when maintenance tags are added to the page. Also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An array of the titles of all templates that were added to the page.</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ===== Example ===== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To use the action queue, register a function to be ran when an aforementioned action is fired. PageTriage will wait for any asynchronous code to complete before doing anything else, such as refreshing the page. For example, to edit [[Sandbox]] after a page has been marked as reviewed, you could use: </div> <syntaxhighlight lang="javascript"> $( function () { // You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time. mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) { // Listen for the 'mark' action. queue.add( 'mark', function ( data ) { return new mw.Api().edit( 'Sandbox', function ( revision ) { // Replace 'foo' with the note the reviewer left. return revision.content.replace( 'foo', data.note ); } ); } ); } ); } ); </syntaxhighlight> === Where are preferences stored? === Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is <code>userjs-NewPagesFeedFilterOptions</code>. It is set using <code>mw.Api().saveOption()</code> and read using <code>mw.user.options.get()</code>. This data ends up in the SQL <code>user_properties</code> table. Temporary accounts (IP masking) will not be able to store their preferences. == Installation on WMF wikis == This extension was designed for English Wikipedia. There is interest in changing its code and making it more useful to other wikis ([[phab:T50552]]), however this is challenging from a technical perspective and progress is slow. For now, the following are true: * PageTriage is allowed to be installed on other wikis<ref>https://meta.wikimedia.org/w/index.php?title=Limits_to_configuration_changes&diff=prev&oldid=26121135</ref> (although as of 2024 this hasn't happened yet). * The setting <code>$wgPageTriageEnableExtendedFeatures</code> can be set to <code>false</code> to turn off English Wikipedia-specific features such as maintenance tags and deletion tags in the Page Curation toolbar. * There are concerns that the noindex features (controlled by <code>$wgPageTriageNoIndexUnreviewedNewArticles</code> and <code>$wgPageTriageMaxNoIndexAge</code>) create search engine optimization problems, and these noindex features should not be enabled on new wikis without first discussing it with product manager [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]. * Like most other WMF-deployed extensions, PageTriage supports internationalization, and has its interface [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/i18n/|translated into many other languages]]. <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * [[commons:Category:PageTriage extension]] * [[Help:New pages feed]] * [[w:Wikipedia:Page Curation/Help]] == Notes == <references /> {{OnWikimedia}} {{Used by}} [[Category:API extensions{{#translation:}}]] f213bpha8p4x4ho8reo69cenpw59u1i Extension:LookupUser/ru 102 1708017 8364797 6707363 2026-05-03T23:53:12Z FuzzyBot 451990 Updating to match new version of source page 8364797 wikitext text/x-wiki <languages/> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">This extension may pose serious security and/or privacy risks!</span> Пользователи с доступом к этому расширению могут просматривать настройки любого другого пользователя, которые обычно считаются личной информацией. <span lang="en" dir="ltr" class="mw-content-ltr">While this extension does not give access to account passwords, it does give access to private data such as real names, email addresses, and other information that could be easily abused.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Therefore, do NOT grant access to any user unless they are 100% trustworthy.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is recommended that access be restricted to bureaucrats or higher groups.</span> Мы не несём ответственности за какие-либо утечки безопасности или конфиденциальной информации. }} {{Extension |status=stable |image=LookupUser.png |type1=special |description=<span lang="en" dir="ltr" class="mw-content-ltr">Allows to retrieve information about a user such as email address and ID</span> |username=Tim Starling |license = GPL-2.0-or-later |mediawiki=1.46+ |version=1.5.2 |update=2018-07-14 |download={{WikimediaDownload|LookupUser|phab=ELOU}} |needs-updatephp =No |hook1=ContributionsToolLinks |rights=lookupuser |phabricator=LookupUser }} <div lang="en" dir="ltr" class="mw-content-ltr"> The '''LookupUser''' extension allows to retrieve information about a user such as email address, user ID and the user preferences, i.e. everything that the user has specified in their [[Special:MyLanguage/Help:Preferences|preferences]]. </div> <span lang="en" dir="ltr" class="mw-content-ltr">This extension also displays the last time a user either made a login, or any edit, which it lists as the "User record last touched:" time and date element of its log.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(This will be displayed as UTC even if you've set a custom time zone/the server's time zone is different.)</span> <span id="Installation"></span> == Установка == {{ExtensionInstall |registration=required |localsettings= // Who can use Special:LookupUser? // Если вы хотите, чтобы её могли использовать администраторы: #$wgGroupPermissions['*']['lookupuser'] = false; #$wgGroupPermissions['sysop']['lookupuser'] = true; // Or, do you want a new user group for this. // (users with the 'userrights' right can add users to this group only bureaucrats by default) $wgGroupPermissions['*']['lookupuser'] = false; $wgGroupPermissions['lookupuser']['lookupuser'] = true; }} <span id="Usage"></span> == Использование == <div lang="en" dir="ltr" class="mw-content-ltr"> The extension is accessed via the "Special:LookupUser" page. </div> {{Used by}} pis0zhvpxwkkto2imf800yxlqxzdfyw 8364806 8364797 2026-05-04T00:10:37Z FuzzyBot 451990 Updating to match new version of source page 8364806 wikitext text/x-wiki <languages/> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">This extension may pose serious security and/or privacy risks!</span> Пользователи с доступом к этому расширению могут просматривать настройки любого другого пользователя, которые обычно считаются личной информацией. <span lang="en" dir="ltr" class="mw-content-ltr">While this extension does not give access to account passwords, it does give access to private data such as real names, email addresses, and other information that could be easily abused.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Therefore, do NOT grant access to any user unless they are 100% trustworthy.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is recommended that access be restricted to bureaucrats or higher groups.</span> Мы не несём ответственности за какие-либо утечки безопасности или конфиденциальной информации. }} {{Extension |status=stable |image=LookupUser.png |type1=special |description=<span lang="en" dir="ltr" class="mw-content-ltr">Allows to retrieve information about a user such as email address and ID</span> |username=Tim Starling |license = GPL-2.0-or-later |mediawiki=1.46+ ([[phab:T416793]]) |version=1.5.2 |update=2018-07-14 |download={{WikimediaDownload|LookupUser|phab=ELOU}} |needs-updatephp =No |hook1=ContributionsToolLinks |rights=lookupuser |phabricator=LookupUser }} <div lang="en" dir="ltr" class="mw-content-ltr"> The '''LookupUser''' extension allows to retrieve information about a user such as email address, user ID and the user preferences, i.e. everything that the user has specified in their [[Special:MyLanguage/Help:Preferences|preferences]]. </div> <span lang="en" dir="ltr" class="mw-content-ltr">This extension also displays the last time a user either made a login, or any edit, which it lists as the "User record last touched:" time and date element of its log.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(This will be displayed as UTC even if you've set a custom time zone/the server's time zone is different.)</span> <span id="Installation"></span> == Установка == {{ExtensionInstall |registration=required |localsettings= // Who can use Special:LookupUser? // Если вы хотите, чтобы её могли использовать администраторы: #$wgGroupPermissions['*']['lookupuser'] = false; #$wgGroupPermissions['sysop']['lookupuser'] = true; // Or, do you want a new user group for this. // (users with the 'userrights' right can add users to this group only bureaucrats by default) $wgGroupPermissions['*']['lookupuser'] = false; $wgGroupPermissions['lookupuser']['lookupuser'] = true; }} <span id="Usage"></span> == Использование == <div lang="en" dir="ltr" class="mw-content-ltr"> The extension is accessed via the "Special:LookupUser" page. </div> {{Used by}} h4yalz9jj3x7q4sazrmmyqkp9ogo76a Template:Extension/popularity.json 10 1724901 8364415 8363184 2026-05-03T15:14:23Z Bawolff bot 13724180 Resyncing from WikiApiary and Graphite 8364415 json application/json { "extensions": { "3D": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 816 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 103 } }, "PluggableSSO": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 113 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 269 } }, "PhpHighlight": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "PhpTags": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 99 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 280 } }, "PhpTagsFunctions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 54 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 321 } }, "PhpTagsSMW": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "PhpTagsStorage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "PhpTagsWidgets": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 19 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 356 } }, "PhpTagsWiki": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 27 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 348 } }, "PictureGame": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 25 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 350 } }, "PipeEscape": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 91 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 287 } }, "PlaceNewSection": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "PluggableAuth": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 15453 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 1 } }, "Poem": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 663 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 119 }, "siteCount": 10039, "siteCountRank": 10, "siteCountStandalone": 1660 }, "Phonos": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 91 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 287 } }, "Poll": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 47 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 328 } }, "PollNY": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 40 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 335 } }, "Polyglot": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 91 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 287 } }, "PopcornEditor": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "PopupAlerts": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 33 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 342 } }, "Popups": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4246 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 17 }, "siteCount": 947, "siteCountRank": 282, "siteCountStandalone": 216 }, "PreToClip": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 273 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 200 } }, "PreferencesList": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "Prezi": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "PrincePDF": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 10 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 365 } }, "PrivateDomains": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 17 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 358 } }, "PrivatePageProtection": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 38 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 337 } }, "PhotoSwipe": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 24 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 351 } }, "PhabTaskGraph": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 372 } }, "ProofreadPage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 434 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 152 } }, "PageViewInfo": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 382 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 162 }, "siteCount": 867, "siteCountRank": 295, "siteCountStandalone": 13 }, "PageLanguage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 34 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 341 } }, "PageMagic": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "PageNameFormula": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "PageNotice": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 393 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 159 } }, "PageOwnership": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 379 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 163 } }, "PagePermissions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 167 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 238 } }, "PagePopups": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "PagePort": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "PageProperties": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 483 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 141 } }, "PageSchemas": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 267 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 201 } }, "PageTools": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 51 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 324 } }, "PageTriage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 192 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 227 } }, "PageViewInfoGA": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "Petition": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 9 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 366 } }, "PagedTiffHandler": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 310 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 181 }, "siteCount": 922, "siteCountRank": 261, "siteCountStandalone": 49 }, "PagesList": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 119 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 264 } }, "PaginateText": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 372 } }, "PanScroll": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "ParentPage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 12 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 363 } }, "ParserFunctions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5239 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 10 }, "siteCount": 15766, "siteCountRank": 1, "siteCountStandalone": 6479 }, "ParserMigration": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 106 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 273 } }, "PasswordlessLogin": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 15 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 360 } }, "Patroller": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 80 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 297 } }, "PdfHandler": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2658 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 32 }, "siteCount": 3441, "siteCountRank": 185, "siteCountStandalone": 904 }, "PerPageLanguage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 39 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 336 } }, "PerPageLicense": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "PronunciationRecording": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 372 } }, "Prop": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "PageImages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1670 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 54 }, "siteCount": 2271, "siteCountRank": 190, "siteCountStandalone": 309 }, "Report": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 86 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 291 } }, "RefreshSpecial": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 42 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 333 }, "siteCount": 1215, "siteCountRank": 229, "siteCountStandalone": 12 }, "RegexBlock": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 43 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 332 }, "siteCount": 1100, "siteCountRank": 254, "siteCountStandalone": 1 }, "RegexFun": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 81 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 296 } }, "RegexFunctions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 207 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 219 } }, "RegularTooltips": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 138 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 252 } }, "RelMicroformat": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 372 } }, "RelatedArticles": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 964 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 86 } }, "RelatedSites": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 6 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 369 } }, "Renameuser": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1640 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 56 }, "siteCount": 2451, "siteCountRank": 182, "siteCountStandalone": 1579 }, "ReplaceSet": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 38 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 337 } }, "ReplaceText": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1419 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 66 } }, "ReportIncident": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "Recoin": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "RevisionSlider": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 990 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 85 }, "siteCount": 957, "siteCountRank": 262, "siteCountStandalone": 32 }, "RightFunctions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 84 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 293 } }, "S5SlideShow": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "SVGEdit": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 100 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 279 } }, "SacredText": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 15 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 360 } }, "SafeDelete": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 13 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 362 } }, "Sanctions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 372 } }, "SandboxLink": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 703 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 112 } }, "Sarcasm": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 6 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 369 } }, "SaveSpinner": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 94 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 285 } }, "Score": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 293 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 191 }, "siteCount": 918, "siteCountRank": 266, "siteCountStandalone": 19 }, "Screenplay": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 15 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 360 } }, "RedirectManager": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 51 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 324 } }, "ReassignEdits": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "PropertySuggester": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 38 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 337 } }, "QuickSurveys": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 61 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 314 } }, "ProtectSite": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 118 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 265 } }, "ProtectionIndicator": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 37 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 338 } }, "PurgeClickThrough": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "Push": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 59 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 316 } }, "PushAll": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 30 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 345 } }, "PushToWatch": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 13 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 362 } }, "PwnedPasswords": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "Quantcast": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "QuickGV": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "QuickInstantCommons": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 534 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 135 } }, "QuickResponse": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 372 } }, "QuickSearchLookup": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 43 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 332 } }, "Quiz": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 410 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 155 } }, "Realnames": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 288 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 194 } }, "QuizGame": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 37 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 338 } }, "RSS": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 734 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 108 }, "siteCount": 1561, "siteCountRank": 202, "siteCountStandalone": 196 }, "RandomArea": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 19 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 356 } }, "RandomGameUnit": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "RandomImage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 187 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 229 }, "siteCount": 5812, "siteCountRank": 32, "siteCountStandalone": 98 }, "RandomImageByCategory": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 64 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 311 } }, "RandomInCategory": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 75 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 301 } }, "RandomPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 41 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 334 } }, "RandomSelection": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 411 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 154 }, "siteCount": 7190, "siteCountRank": 19, "siteCountStandalone": 165 }, "ReadAloud": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 21 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 354 } }, "ReadingLists": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 82 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 295 }, "siteCount": 859, "siteCountRank": 305, "siteCountStandalone": 2 }, "RealMe": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 102 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 277 } }, "PageInCat": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 65 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 310 } }, "PageForms": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1564 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 61 } }, "ScrollableTables": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "MultiBoilerplate": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 304 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 184 } }, "MobileFrontendContentProvider": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 14 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 361 } }, "Model": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 6 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 369 } }, "Monstranto": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "MontserratFont": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 20 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 355 } }, "Mpdf": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 482 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 142 } }, "MsCalendar": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 690 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 115 } }, "MsCatSelect": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 218 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 217 } }, "MsInsert": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 58 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 317 } }, "MsLinks": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 228 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 212 } }, "MsUpload": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3593 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 23 }, "siteCount": 6278, "siteCountRank": 28, "siteCountStandalone": 451 }, "MsWikiEditor": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 97 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 282 } }, "MultiLanguageManager": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 96 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 283 } }, "MobileDetect": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 602 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 126 } }, "MultiMail": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "MultiMaps": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 122 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 262 } }, "MultimediaPlayer": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 89 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 288 } }, "MultimediaViewer": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2111 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 46 }, "siteCount": 1926, "siteCountRank": 195, "siteCountStandalone": 719 }, "MusicBrainzAuth": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "MyVariables": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 463 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 147 } }, "NCBITaxonomyLookup": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "NSFileRepo": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 187 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 229 } }, "NamespaceHTML": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 68 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 307 } }, "NamespacePaths": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 22 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 353 } }, "NamespacePopups": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "NamespaceRelations": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 36 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 339 } }, "MobileFrontend": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 10676 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 5 }, "siteCount": 9025, "siteCountRank": 12, "siteCountStandalone": 962 }, "MobileApp": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 552 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 133 }, "siteCount": 909, "siteCountRank": 267, "siteCountStandalone": 34 }, "NativeSvgHandler": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2426 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 35 } }, "MediaSpoiler": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "Maintenance": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 244 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 209 }, "siteCount": 1327, "siteCountRank": 222, "siteCountStandalone": 103 }, "MaintenanceShell": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 224 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 214 } }, "MapSources": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 50 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 325 } }, "MarkAsHelpful": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "MassEditRegex": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 590 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 130 } }, "MassMessage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 564 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 132 }, "siteCount": 1039, "siteCountRank": 257, "siteCountStandalone": 29 }, "MassMessageEmail": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 38 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 337 } }, "Math": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3380 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 24 }, "siteCount": 7934, "siteCountRank": 18, "siteCountStandalone": 719 }, "MathSearch": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "MediaFunctions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 56 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 319 } }, "MediaModeration": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 62 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 313 }, "siteCount": 908, "siteCountRank": 292, "siteCountStandalone": 0 }, "MediaSearch": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 122 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 262 } }, "MediaUploader": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 194 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 226 } }, "MixedNamespaceSearchSuggestions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 94 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 285 } }, "MediaWikiChat": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 298 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 188 } }, "MediaWikiFarm": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 163 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 240 } }, "MenuEditor": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 179 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 234 } }, "MergeArticles": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "MessageCommons": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 }, "siteCount": 1141, "siteCountRank": 239, "siteCountStandalone": 2 }, "MetaMaster": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 64 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 311 } }, "Metadata": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 39 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 336 } }, "MetricsPlatform": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "MiniInvite": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "MinimumNameLength": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 14 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 361 } }, "MintyDocs": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 14 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 361 } }, "MissedPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 32 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 343 } }, "NamespaceSidebar": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "NaturalLanguageList": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "PageExchange": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 372 } }, "OpenLayers": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 113 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 269 } }, "OOJSPlus": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1332 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 67 } }, "OOJsUIAjaxLogin": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 17 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 358 } }, "ORES": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 98 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 281 } }, "OdbcDatabase": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 10 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 365 } }, "OnlineStatus": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "OnlineStatusBar": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 17 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 358 } }, "OnlyRecentRecentChanges": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "OpenBadges": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 26 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 349 } }, "OpenGraphMeta": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 486 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 140 }, "siteCount": 5841, "siteCountRank": 30, "siteCountStandalone": 128 }, "OpenID": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "OpenIDConnect": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3089 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 30 } }, "OpenJsCad": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "OpenStackManager": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "OAuthAuthentication": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "OrphanedTalkPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 38 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 337 } }, "OurWorldInData": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "PCRGUIInserts": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 60 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 315 } }, "PDFCreator": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "PDFEmbed": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 97 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 282 } }, "PGFTikZ": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 12 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 363 } }, "PageAssessments": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 103 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 276 } }, "PageAuthors": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 69 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 306 } }, "PageCheckout": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 9 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 366 } }, "PageCreationNotif": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "PageDisqus": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 26 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 349 } }, "PageEncryption": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 25 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 350 } }, "OAuthRateLimiter": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "OAuth": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1102 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 77 }, "siteCount": 982, "siteCountRank": 246, "siteCountStandalone": 28 }, "NavigationTiming": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 50 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 325 }, "siteCount": 846, "siteCountRank": 308, "siteCountStandalone": 0 }, "Newsletter": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 129 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 257 } }, "NaylorAMS": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "NearbyPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 179 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 234 } }, "Negref": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "NetworkAuth": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 135 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 255 } }, "NetworkSession": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "NewSignupPage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 87 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 290 }, "siteCount": 1176, "siteCountRank": 232, "siteCountStandalone": 15 }, "NewUserActions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "NewUserMessage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 176 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 235 } }, "NewUserNotif": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 85 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 292 } }, "NewestPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 908 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 89 } }, "NewsBox": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 82 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 295 }, "siteCount": 1139, "siteCountRank": 242, "siteCountStandalone": 0 }, "NewsTicker": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 29 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 346 } }, "NoBogusUserpages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "OATHAuth": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1012 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 83 }, "siteCount": 1459, "siteCountRank": 205, "siteCountStandalone": 416 }, "NoCat": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 22 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 353 } }, "NoTitle": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1192 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 71 } }, "NotebookViewer": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 27 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 348 } }, "NotesLink": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "NotifyMe": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "Nuke": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1432 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 65 }, "siteCount": 12649, "siteCountRank": 5, "siteCountStandalone": 4014 }, "NukeDPL": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 63 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 312 } }, "NumberFormat": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 124 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 261 } }, "NumberHeadings": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 29 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 346 } }, "NumberOfWikis": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 372 }, "siteCount": 1139, "siteCountRank": 241, "siteCountStandalone": 0 }, "Numbertext": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 30 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 345 } }, "NumerAlpha": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 62 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 313 } }, "Scribunto": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7308 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 8 }, "siteCount": 8789, "siteCountRank": 11, "siteCountStandalone": 665 }, "SearchExtraNS": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 75 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 301 } }, "MagicNumberedHeadings": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 28 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 347 } }, "VikiTitleIcon": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "UserStatus": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 16 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 359 } }, "UserThrottle": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "UserVerification": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 34 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 341 } }, "VECancelButton": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "VEForAll": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 158 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 243 } }, "VIKI": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 21 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 354 } }, "Variables": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1740 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 52 }, "siteCount": 1808, "siteCountRank": 201, "siteCountStandalone": 695 }, "VersionCompare": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 372 } }, "Video": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 330 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 174 } }, "Views": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "VikiSemanticTitle": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "VipsScaler": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 142 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 250 }, "siteCount": 1811, "siteCountRank": 203, "siteCountStandalone": 15 }, "UserPageViewTracker": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 296 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 189 } }, "VisualData": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 191 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 228 } }, "VisualEditor": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 9055 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 6 }, "siteCount": 7436, "siteCountRank": 17, "siteCountStandalone": 601 }, "VisualEditorPlus": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 102 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 277 } }, "VoteNY": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 280 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 198 } }, "VueJsPlus": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 16 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 359 } }, "VueTest": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 16 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 359 } }, "WSOAuth": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1079 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 78 } }, "WantedPagesFromNS": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 28 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 347 } }, "WarnNotRecentlyUpdated": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "WatchAnalytics": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 53 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 322 } }, "WatchSubpages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "WebAuthn": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 163 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 240 }, "siteCount": 915, "siteCountRank": 291, "siteCountStandalone": 2 }, "UserProtect": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 99 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 280 } }, "UserPageEditProtection": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 89 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 288 } }, "WebDAV": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 68 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 307 } }, "UnlinkedWikibase": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 42 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 333 } }, "TweetANew": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "TwitterCards": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 46 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 329 }, "siteCount": 5686, "siteCountRank": 60, "siteCountStandalone": 20 }, "TwitterLogin": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "TwitterTag": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 119 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 264 } }, "TwoColConflict": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 315 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 180 }, "siteCount": 944, "siteCountRank": 268, "siteCountStandalone": 12 }, "UIFeedback": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "UILangCode": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "UnCaptcha": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "UnblockMe": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 40 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 335 } }, "UnicodeConverter": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "UnifiedTaskOverview": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 18 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 357 } }, "UniversalLanguageSelector": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2409 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 36 }, "siteCount": 1237, "siteCountRank": 215, "siteCountStandalone": 251 }, "UnusedRedirects": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 63 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 312 } }, "UserOptionStats": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "UpdateMediaWiki": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 30 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 345 } }, "UploadBlacklist": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "UploadWizard": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2172 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 45 } }, "UploadsLink": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 65 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 310 } }, "UrlGetParameters": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 244 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 209 } }, "UrlShortener": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 447 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 149 }, "siteCount": 872, "siteCountRank": 276, "siteCountStandalone": 5 }, "UseResource": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 20 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 355 } }, "UserAgreement": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 57 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 318 } }, "UserExport": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 168 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 237 } }, "UserFunctions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 361 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 167 } }, "UserGroups": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 309 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 182 } }, "UserMerge": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4420 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 15 }, "siteCount": 888, "siteCountRank": 260, "siteCountStandalone": 622 }, "WebChat": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 129 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 257 } }, "WebDAVClientIntegration": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "TranslationNotifications": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 59 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 316 } }, "WindowsAzureStorage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 62 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 313 } }, "WikimediaApiPortalOAuth": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 21 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 354 } }, "WikimediaBadges": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 49 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 326 } }, "WikimediaCampaignEvents": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "WikimediaEditorTasks": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "WikimediaEvents": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 199 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 223 }, "siteCount": 851, "siteCountRank": 307, "siteCountStandalone": 3 }, "WikimediaIncubator": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "WikimediaMaintenance": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 32 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 343 } }, "WikimediaMessages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 223 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 215 }, "siteCount": 933, "siteCountRank": 264, "siteCountStandalone": 22 }, "Wikisource": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 61 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 314 } }, "Wikispeech": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 82 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 295 } }, "WikispeechSpeechDataCollector": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "Wikistories": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 20 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 355 } }, "Workflows": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 122 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 262 } }, "Wikidata": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 0 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 375 } }, "XAnalytics": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 28 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 347 }, "siteCount": 844, "siteCountRank": 304, "siteCountStandalone": 0 }, "XSL": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 19 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 356 } }, "XenForoAuth": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 9 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 366 } }, "YetAnotherKeywords": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 20 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 355 } }, "YotpoReviews": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "YouTube": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2869 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 31 }, "siteCount": 1633, "siteCountRank": 204, "siteCountStandalone": 307 }, "ZoomableImages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 27 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 348 } }, "cldr": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 824 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 101 } }, "examples": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 246 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 208 } }, "googleAnalytics": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1069 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 80 } }, "intersection": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2315 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 40 } }, "timeline": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 798 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 106 } }, "WikidataPageBanner": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 405 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 156 } }, "WikibaseStatementUpdater": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "WebToolsManager": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 30 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 345 } }, "WikiLambda": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 61 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 314 } }, "WhiteSpace": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "WhitelistPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 106 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 273 } }, "WhoIsWatching": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 126 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 259 } }, "Whoops": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "WhosOnline": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 280 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 198 } }, "Widgets": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2197 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 43 }, "siteCount": 996, "siteCountRank": 207, "siteCountStandalone": 561 }, "WikEdDiff": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 37 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 338 } }, "WikiApiary": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "WikiArticleFeeds": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 20 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 355 } }, "WikiCategoryTagCloud": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 315 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 180 } }, "WikiEditor": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7996 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 7 }, "siteCount": 13753, "siteCountRank": 4, "siteCountStandalone": 5064 }, "WikiForum": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 281 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 197 } }, "WikiLove": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 225 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 213 } }, "WikibaseQualityConstraints": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 73 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 302 } }, "WikiLovesMonuments": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "WikiSEO": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1127 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 73 } }, "WikiShare": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 62 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 313 } }, "WikiTextLoggedInOut": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 57 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 318 } }, "WikiToLDAP": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "WikiVideos": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 155 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 244 } }, "Wikibase": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2223 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 41 } }, "WikibaseCirrusSearch": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 139 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 251 } }, "WikibaseLexeme": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 186 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 230 } }, "WikibaseLexemeCirrusSearch": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 22 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 353 } }, "WikibaseManifest": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 24 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 351 } }, "WikibaseMediaInfo": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 75 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 301 } }, "TrustedXFF": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 42 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 333 }, "siteCount": 868, "siteCountRank": 274, "siteCountStandalone": 2 }, "TranslateSvg": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "SearchParserFunction": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 10 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 365 } }, "SimpleTasks": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 83 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 294 } }, "ShowRealUsernames": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 120 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 263 } }, "SideBarMenu": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 192 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 227 } }, "SidebarDonateBox": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 31 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 344 } }, "SignWritingMediaWikiPlugin": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 14 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 361 } }, "SimSigCompanion": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "SimilarEditors": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "SimpleBlogPage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 14 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 361 } }, "SimpleCalendar": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 328 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 175 } }, "SimpleChanges": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 200 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 222 } }, "SimpleSAMLphp": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1532 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 62 } }, "SimpleSort": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 13 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 362 } }, "SiteMatrix": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 80 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 297 }, "siteCount": 897, "siteCountRank": 272, "siteCountStandalone": 7 }, "ShoutWikiAds": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 104 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 275 } }, "SiteMetrics": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 55 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 320 } }, "SiteSettings": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 9 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 366 } }, "SkinPerNamespace": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 16 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 359 } }, "SkinPerPage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 53 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 322 } }, "SlimboxThumbs": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 69 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 306 } }, "SmiteSpam": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 82 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 295 } }, "SocialLogin": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 13 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 362 } }, "SocialProfile": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1249 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 69 } }, "Sofa": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "SoftRedirector": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "SoftwareVersion": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 15 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 360 }, "siteCount": 6841, "siteCountRank": 24, "siteCountStandalone": 9 }, "SoundManager2Button": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 57 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 318 } }, "ShowMe": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 21 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 354 } }, "ShoutWikiAPI": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "SpamDiffTool": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 372 } }, "SemanticACL": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 275 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 199 } }, "SearchStats": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 26 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 349 } }, "SearchThumbs": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 70 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 305 } }, "SearchVue": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 55 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 320 } }, "SectionAnchors": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 21 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 354 } }, "SectionDisqus": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "SecureAuth": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "SecureHTML": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 31 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 344 } }, "SecureLinkFixer": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 361 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 167 }, "siteCount": 1070, "siteCountRank": 259, "siteCountStandalone": 106 }, "SecurePoll": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 204 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 220 }, "siteCount": 889, "siteCountRank": 269, "siteCountStandalone": 25 }, "SecurityApi": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "SelectCategory": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 196 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 225 } }, "SelectTag": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 372 } }, "SemanticBundle": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 67 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 308 } }, "ShortUrl": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 294 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 190 } }, "SemanticGenealogy": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 35 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 340 } }, "SemanticImageInput": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 28 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 347 } }, "SemanticInternalObjects": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 97 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 282 } }, "SemanticPageSeries": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "SemanticRESTAPI": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 14 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 361 } }, "SemanticRating": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 116 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 267 } }, "SemanticWebBrowser": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 21 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 354 } }, "SendGrid": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 92 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 286 } }, "Sentry": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "Share": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 75 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 301 } }, "SharedHelpPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 }, "siteCount": 1139, "siteCountRank": 244, "siteCountStandalone": 0 }, "Shibboleth": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 52 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 323 } }, "SpamBlacklist": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 720 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 110 }, "siteCount": 4350, "siteCountRank": 180, "siteCountStandalone": 1017 }, "SpamRegex": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 38 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 337 }, "siteCount": 1106, "siteCountRank": 252, "siteCountStandalone": 5 }, "Translate": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1652 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 55 } }, "Theme": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 400 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 158 }, "siteCount": 1202, "siteCountRank": 228, "siteCountStandalone": 22 }, "TEI": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 45 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 330 } }, "TableTools": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 16 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 359 } }, "Tabs": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 999 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 84 } }, "TalkBelow": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "TemplateData": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3270 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 27 }, "siteCount": 6971, "siteCountRank": 54, "siteCountStandalone": 293 }, "TemplateSandbox": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 604 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 125 }, "siteCount": 1040, "siteCountRank": 233, "siteCountStandalone": 70 }, "TemplateStyles": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 13069 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 3 }, "siteCount": 1977, "siteCountRank": 199, "siteCountStandalone": 115 }, "TemplateWizard": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1486 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 63 }, "siteCount": 907, "siteCountRank": 293, "siteCountStandalone": 31 }, "TextExtracts": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1449 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 64 }, "siteCount": 2046, "siteCountRank": 188, "siteCountStandalone": 523 }, "TextScroller": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 27 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 348 } }, "Thanks": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 674 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 117 }, "siteCount": 2442, "siteCountRank": 192, "siteCountStandalone": 142 }, "TheWikipediaLibrary": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 33 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 342 }, "siteCount": 928, "siteCountRank": 286, "siteCountStandalone": 0 }, "ThrottleOverride": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 16 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 359 } }, "SwiftMailer": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 168 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 237 } }, "TimeMachine": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 50 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 325 } }, "TimedMediaHandler": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2368 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 38 }, "siteCount": 1290, "siteCountRank": 208, "siteCountStandalone": 133 }, "TimelineTable": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 67 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 308 } }, "TinyMCE": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1072 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 79 } }, "TitleBlacklist": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 614 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 124 } }, "TitleIcon": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 180 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 233 } }, "TitleKey": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 838 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 97 } }, "TocTree": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1570 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 60 } }, "Toolhub": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 12 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 363 } }, "Tooltip": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 160 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 242 } }, "TopTenPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 202 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 221 } }, "TorBlock": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 448 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 148 }, "siteCount": 1149, "siteCountRank": 224, "siteCountStandalone": 102 }, "SyntaxHighlight_GeSHi": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4029 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 19 } }, "Survey": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 40 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 335 } }, "Spark": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "StandardWikitext": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "SparkPost": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "Special404": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 30 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 345 } }, "SpecialNamespaces": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 71 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 304 } }, "SpellingApi": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 15 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 360 } }, "SpellingDictionary": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "SphinxSearch": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 232 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 210 } }, "SplitPrivateWiki": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 372 } }, "SportsTeams": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "StaffEdits": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 9 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 366 }, "siteCount": 1176, "siteCountRank": 245, "siteCountStandalone": 0 }, "StaffPowers": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 32 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 343 }, "siteCount": 6569, "siteCountRank": 58, "siteCountStandalone": 8 }, "StalkerLog": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 20 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 355 } }, "StandardDialogs": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 25 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 350 } }, "StarterWiki": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "Sudo": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 42 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 333 } }, "StatCounter": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 17 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 358 } }, "StickToThatLanguage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "StickyTOC": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 57 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 318 } }, "StopForumSpam": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 891 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 91 } }, "StringFunctionsEscaped": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 13 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 362 } }, "StructuredNavigation": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 20 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 355 } }, "SubPageList3": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 403 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 157 } }, "SubnetCalc": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "SubpageFun": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 134 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 256 } }, "SubpageNavigation": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 161 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 241 } }, "SubpageSortkey": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 14 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 361 } }, "SubpageWatchlist": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "Mailgun": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 41 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 334 } }, "MagicNoCache": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 444 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 150 } }, "AControlImageLink": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 63 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 312 } }, "CategoryLockdown": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 225 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 213 } }, "BrickipediaExtra": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "Buggy": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "BulkBlock": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 38 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 337 } }, "CIForms": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 284 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 195 } }, "CSS": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1887 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 50 } }, "Calendar": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 175 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 236 } }, "CampaignEvents": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 72 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 303 } }, "Campaigns": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 40 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 335 }, "siteCount": 863, "siteCountRank": 275, "siteCountStandalone": 0 }, "Capiunto": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 546 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 134 } }, "Cargo": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 818 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 102 } }, "CategoryExplorer": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 116 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 267 } }, "CategorySortHeaders": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 84 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 293 } }, "BounceHandler": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 46 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 329 }, "siteCount": 847, "siteCountRank": 296, "siteCountStandalone": 5 }, "CategoryTagSorter": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 86 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 291 } }, "CategoryTests": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 82 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 295 } }, "CategoryTree": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4138 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 18 }, "siteCount": 10554, "siteCountRank": 9, "siteCountStandalone": 2091 }, "CategoryWatch": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 76 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 300 } }, "CentralAuth": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 593 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 129 } }, "CentralLogging": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "CentralNotice": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 476 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 143 }, "siteCount": 1012, "siteCountRank": 231, "siteCountStandalone": 34 }, "Challenge": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "ChangeAuthor": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 46 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 329 } }, "CharInsert": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1281 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 68 }, "siteCount": 9224, "siteCountRank": 14, "siteCountStandalone": 822 }, "Chart": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 85 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 292 } }, "CheckUser": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2614 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 33 }, "siteCount": 9118, "siteCountRank": 13, "siteCountStandalone": 713 }, "BreadCrumbs2": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 709 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 111 } }, "BoilerPlate": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 209 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 218 } }, "Checkpoint": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 13 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 362 } }, "BlueSpiceUEModulePDF": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 31 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 344 } }, "BlueSpiceSocialRating": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "BlueSpiceSocialResolve": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "BlueSpiceSocialTags": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "BlueSpiceSocialTimelineUpdate": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "BlueSpiceSocialTopics": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "BlueSpiceSocialWatch": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 9 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 366 } }, "BlueSpiceSocialWikiPage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "BlueSpiceSubPageTree": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 22 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 353 } }, "BlueSpiceTagCloud": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 55 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 320 } }, "BlueSpiceUEModuleBookPDF": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 28 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 347 } }, "BlueSpiceUEModuleDOCX": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 14 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 361 } }, "BlueSpiceUEModuleHTML": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "BlueSpiceUEModulePDFRecursive": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 16 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 359 } }, "BlueSpiceWikiFarm": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "BlueSpiceUEModulePDFSubpages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 16 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 359 } }, "BlueSpiceUEModuleTable2Excel": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 23 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 352 } }, "BlueSpiceUniversalExport": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 138 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 252 } }, "BlueSpiceUsageTracker": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 9 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 366 } }, "BlueSpiceUserInfo": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 17 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 358 } }, "BlueSpiceUserManager": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 690 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 115 } }, "BlueSpiceUserSidebar": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 51 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 324 } }, "BlueSpiceVisualDiff": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 38 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 337 } }, "BlueSpiceVisualEditorConnector": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 108 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 272 } }, "BlueSpiceWatchList": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 19 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 356 } }, "BlueSpiceWhoIsOnline": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 17 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 358 } }, "BlueSpiceWikiExplorer": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 31 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 344 } }, "Checklists": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 120 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 263 } }, "ChessBrowser": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 14 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 361 } }, "BlueSpiceSocialMicroBlog": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 6 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 369 } }, "CosmosProfile": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "ContactPage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 664 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 118 } }, "ContainerFilter": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 39 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 336 } }, "ContentDroplets": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 50 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 325 } }, "ContentStabilization": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 51 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 324 } }, "ContentTransfer": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 72 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 303 } }, "ContentTranslation": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 320 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 179 } }, "ContributionCredits": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 97 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 282 } }, "ContributionScores": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 829 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 100 } }, "ContributionsList": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 17 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 358 } }, "Contributors": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 63 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 312 } }, "CookieConsent": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "CookieWarning": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 882 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 93 }, "siteCount": 985, "siteCountRank": 258, "siteCountStandalone": 125 }, "CountDownClock": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 104 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 275 } }, "ConfirmEdit": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2178 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 44 }, "siteCount": 957, "siteCountRank": 278, "siteCountStandalone": 36 }, "CrawlableAllPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "CreateAPage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 96 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 283 } }, "CreatePage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 600 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 128 }, "siteCount": 5685, "siteCountRank": 35, "siteCountStandalone": 29 }, "CreatePageUw": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 532 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 136 } }, "CreateRedirect": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 139 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 251 } }, "CreateUserPage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 259 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 204 } }, "CreatedPagesList": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 86 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 291 } }, "CreditsSource": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 17 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 358 } }, "DPLforum": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 148 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 248 }, "siteCount": 5794, "siteCountRank": 31, "siteCountStandalone": 62 }, "DarkMode": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3303 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 25 } }, "Dashiki": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 48 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 327 } }, "DataTable2": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 112 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 270 } }, "ContactManager": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 14 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 361 } }, "ConfirmAccount": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2360 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 39 }, "siteCount": 953, "siteCountRank": 279, "siteCountStandalone": 793 }, "CirrusSearch": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4394 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 16 }, "siteCount": 1226, "siteCountRank": 213, "siteCountStandalone": 106 }, "CognitiveProcessDesigner": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 629 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 122 } }, "Cite": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5183 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 11 }, "siteCount": 14146, "siteCountRank": 2, "siteCountStandalone": 5013 }, "CiteDrawer": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 32 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 343 } }, "CiteThisPage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 850 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 96 }, "siteCount": 1524, "siteCountRank": 197, "siteCountStandalone": 508 }, "Citoid": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 96 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 283 }, "siteCount": 848, "siteCountRank": 299, "siteCountStandalone": 3 }, "CleanChanges": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 512 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 139 } }, "CloneDiff": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 6 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 369 } }, "CloseWikis": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 9 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 366 } }, "CloudflarePurge": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 26 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 349 } }, "CodeEditor": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1952 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 49 }, "siteCount": 8385, "siteCountRank": 16, "siteCountStandalone": 754 }, "CodeMirror": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3706 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 22 }, "siteCount": 6549, "siteCountRank": 64, "siteCountStandalone": 73 }, "CodeReview": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "Cognate": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "CollabPads": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 14 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 361 } }, "ConfigManager": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 23 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 352 } }, "CollaborationKit": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 20 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 355 } }, "CollapsibleSections": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 430 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 153 } }, "CollapsibleVector": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1110 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 76 } }, "Collection": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1579 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 58 }, "siteCount": 1174, "siteCountRank": 219, "siteCountStandalone": 135 }, "CommentStreams": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 469 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 144 } }, "Commentbox": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 63 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 312 } }, "Comments": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 897 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 90 } }, "CommonMessages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 22 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 353 } }, "CommonsMetadata": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 831 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 99 }, "siteCount": 1055, "siteCountRank": 247, "siteCountStandalone": 73 }, "CommunityConfiguration": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 34 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 341 } }, "CommunityConfigurationExample": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "CommunityRequests": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "BlueSpiceSocialProfile": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 22 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 353 } }, "BlueSpiceSocialComments": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "DateDiff": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 27 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 348 } }, "AuthorProtect": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 112 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 270 } }, "ArticleCreationWorkflow": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 158 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 243 } }, "ArticleFeedbackv5": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 291 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 192 } }, "ArticleIndex": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 24 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 351 } }, "ArticleMetaDescription": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 88 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 289 }, "siteCount": 6846, "siteCountRank": 23, "siteCountStandalone": 12 }, "ArticlePlaceholder": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 22 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 353 } }, "ArticleRatings": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 25 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 350 } }, "ArticleSummaries": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "ArticleToCategory2": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 103 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 276 } }, "AtMentions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 76 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 300 } }, "Athena": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 32 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 343 } }, "Auth_remoteuser": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3876 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 21 } }, "AutoCategoriseUploads": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 28 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 347 } }, "ArrayFunctions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 76 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 300 } }, "AutoCreateCategoryPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 324 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 177 } }, "AutoGallery": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 138 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 252 } }, "AutoModerator": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 25 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 350 } }, "Awesomeness": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 48 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 327 } }, "Babel": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 957 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 88 }, "siteCount": 2416, "siteCountRank": 193, "siteCountStandalone": 199 }, "BatchUserRights": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 18 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 357 } }, "BetaFeatures": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 868 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 95 }, "siteCount": 1031, "siteCountRank": 248, "siteCountStandalone": 54 }, "BibManager": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 57 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 318 } }, "BiblioPlus": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 47 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 328 } }, "BlockInactive": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 20 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 355 } }, "BlogPage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 229 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 211 } }, "BlueSpiceAbout": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 33 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 342 } }, "Arrays": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 692 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 114 } }, "ApprovedRevs": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 659 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 121 } }, "BlueSpiceArticlePreviewCapture": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 10 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 365 } }, "AddMessages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 117 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 266 } }, "AIEditingAssistant": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 59 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 316 } }, "AJAXPoll": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 341 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 171 } }, "AbsenteeLandlord": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 168 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 237 } }, "AbuseFilter": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1753 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 51 }, "siteCount": 2939, "siteCountRank": 186, "siteCountStandalone": 377 }, "AbuseFilterBypass": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 145 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 249 } }, "AccessControl": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 521 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 138 } }, "AccountInfo": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 183 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 232 } }, "AchievementBadges": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 36 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 339 } }, "Acrolinx": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 29 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 346 } }, "ActiveAbstract": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 46 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 329 } }, "AdManager": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 80 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 297 } }, "AddHTMLMetaAndTitle": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 400 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 158 } }, "AddPersonalUrls": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 129 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 257 } }, "ApiFeatureUsage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 153 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 245 }, "siteCount": 847, "siteCountRank": 303, "siteCountStandalone": 3 }, "AddThis": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 43 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 332 } }, "Adiutor": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 40 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 335 } }, "AdminLinks": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 964 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 86 } }, "AdvancedMeta": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 185 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 231 } }, "AdvancedSearch": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1596 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 57 }, "siteCount": 887, "siteCountRank": 288, "siteCountStandalone": 21 }, "AjaxShowEditors": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 46 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 329 } }, "AkismetKlik": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "AllTimeZones": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 50 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 325 } }, "Analytics": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 82 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 295 } }, "AnchorHandler": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 48 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 327 } }, "AnonPrivacy": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 101 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 278 } }, "AntiSpoof": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 878 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 94 }, "siteCount": 2598, "siteCountRank": 191, "siteCountStandalone": 145 }, "BlueSpiceArticleInfo": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 18 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 357 } }, "BlueSpiceAuthors": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 29 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 346 } }, "BlueSpiceSocialBlog": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "BlueSpicePrivacy": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 106 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 273 } }, "BlueSpiceMultiUpload": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 27 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 348 } }, "BlueSpiceNSFileRepoConnector": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "BlueSpiceNamespaceCSS": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 19 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 356 } }, "BlueSpiceNamespaceManager": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 283 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 196 } }, "BlueSpicePageAccess": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 49 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 326 } }, "BlueSpicePageAssignments": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 34 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 341 } }, "BlueSpicePageFormsConnector": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 16 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 359 } }, "BlueSpicePageTemplates": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 299 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 187 } }, "BlueSpicePageVersion": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 372 } }, "BlueSpicePagesVisited": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 24 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 351 } }, "BlueSpicePermissionManager": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 523 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 137 } }, "BlueSpicePlayer": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 14 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 361 } }, "BlueSpiceProDistributionConnector": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 6 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 369 } }, "BlueSpiceInterWikiLinks": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 26 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 349 } }, "BlueSpiceQrCode": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 21 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 354 } }, "BlueSpiceRSSFeeder": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 10 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 365 } }, "BlueSpiceRating": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 18 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 357 } }, "BlueSpiceReadConfirmation": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 38 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 337 } }, "BlueSpiceReaders": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 9 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 366 } }, "BlueSpiceReminder": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 66 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 309 } }, "BlueSpiceSMWConnector": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 23 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 352 } }, "BlueSpiceSaferEdit": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 30 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 345 } }, "BlueSpiceSignHere": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "BlueSpiceSmartList": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 22 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 353 } }, "BlueSpiceSocial": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 29 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 346 } }, "BlueSpiceSocialArticleActions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "BlueSpiceInterwikiSearch": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "BlueSpiceInstanceStatus": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "BlueSpiceAvatars": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 153 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 245 } }, "BlueSpiceExpiry": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 36 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 339 } }, "BlueSpiceBookshelf": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 209 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 218 } }, "BlueSpiceCategoryCheck": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 23 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 352 } }, "BlueSpiceCategoryManager": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 186 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 230 } }, "BlueSpiceChecklist": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 247 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 207 } }, "BlueSpiceConfigManager": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 118 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 265 } }, "BlueSpiceContextMenu": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 45 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 330 } }, "BlueSpiceCountThings": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 17 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 358 } }, "BlueSpiceCustomMenu": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 54 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 321 } }, "BlueSpiceDashboards": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 101 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 278 } }, "BlueSpiceDistributionConnector": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 38 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 337 } }, "BlueSpiceEchoConnector": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 23 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 352 } }, "BlueSpiceEmoticons": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 73 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 302 } }, "BlueSpiceExportTables": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 110 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 271 } }, "BlueSpiceInsertTemplate": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 28 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 347 } }, "BlueSpiceExtendedFilelist": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 34 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 341 } }, "BlueSpiceExtendedSearch": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 265 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 202 } }, "BlueSpiceExtendedStatistics": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 125 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 260 } }, "BlueSpiceFilterableTables": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 244 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 209 } }, "BlueSpiceFlaggedRevsConnector": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "BlueSpiceFoundation": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2532 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 34 } }, "BlueSpiceGroupManager": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 352 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 169 } }, "BlueSpiceHideTitle": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 34 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 341 } }, "BlueSpiceInsertCategory": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 34 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 341 } }, "BlueSpiceInsertFile": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 71 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 304 } }, "BlueSpiceInsertLink": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 36 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 339 } }, "BlueSpiceInsertMagic": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 22 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 353 } }, "DataTransfer": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 437 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 151 } }, "DateTimeTools": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 60 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 315 } }, "MagicLinkAuthentication": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "IPInfo": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 166 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 239 }, "siteCount": 871, "siteCountRank": 297, "siteCountStandalone": 1 }, "HidePrefix": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 223 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 215 } }, "HierarchyBuilder": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 101 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 278 } }, "HighlightjsIntegration": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 15 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 360 } }, "HitCounters": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1976 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 48 } }, "HoneyPot": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 27 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 348 } }, "HostStats": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 19 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 356 } }, "HotCat": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 30 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 345 } }, "HoverGallery": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 115 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 268 } }, "Hreflang": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 372 } }, "Html2Wiki": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 223 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 215 } }, "I18nTags": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 26 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 349 } }, "IPReputation": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "HelpCommons": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "IframePage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 354 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 168 } }, "ImageCompare": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "ImageMap": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1122 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 74 }, "siteCount": 10714, "siteCountRank": 8, "siteCountStandalone": 2441 }, "ImageMapEdit": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 53 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 322 } }, "ImageRating": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 20 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 355 } }, "ImageSuggestions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 23 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 352 } }, "ImageTweaks": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 10 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 365 } }, "ImapAuthorization": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 15 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 360 } }, "ImportArticles": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 58 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 317 } }, "ImportFreeImages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 20 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 355 } }, "ImportOfficeFiles": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 200 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 222 } }, "ImportUsers": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 183 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 232 } }, "HelpPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 17 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 358 } }, "HeaderTabs": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 616 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 123 } }, "InlineCategorizer": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 10 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 365 } }, "Gravatar": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 58 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 317 } }, "GoogleDocTag": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 60 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 315 } }, "GoogleDocs4MW": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 199 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 223 }, "siteCount": 1173, "siteCountRank": 230, "siteCountStandalone": 15 }, "GoogleGeocode": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "GoogleLogin": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 963 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 87 } }, "GoogleNewsSitemap": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 96 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 283 } }, "GooglePlaces": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "GoogleSiteSearch": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 139 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 251 } }, "GoogleTagManager": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 85 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 292 }, "siteCount": 5867, "siteCountRank": 115, "siteCountStandalone": 9 }, "GoogleTranslate": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 66 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 309 } }, "Graph": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 801 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 105 }, "siteCount": 884, "siteCountRank": 281, "siteCountStandalone": 29 }, "GraphQL": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 19 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 356 } }, "GraphViz": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 6 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 369 } }, "GroupWhitelist": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 25 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 350 } }, "HeaderFooter": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 283 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 196 } }, "GroupsSidebar": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 60 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 315 } }, "GrowthExperiments": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 85 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 292 } }, "GuidedTour": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 136 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 254 }, "siteCount": 893, "siteCountRank": 265, "siteCountStandalone": 16 }, "HAWelcome": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 22 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 353 } }, "HSTS": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 37 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 338 } }, "HTMLPurifier": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 78 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 298 } }, "HTMLTags": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 250 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 206 } }, "HTMLTemplates": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 15 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 360 } }, "HTMLets": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 204 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 220 } }, "HashTables": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 24 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 351 } }, "Hashtags": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "HeadScript": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1112 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 75 } }, "Inbox": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 43 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 332 } }, "InlineComments": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 59 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 316 } }, "GoogleCustomWikiSearch": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 126 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 259 } }, "LocalisationUpdate": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 709 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 111 }, "siteCount": 883, "siteCountRank": 223, "siteCountStandalone": 603 }, "Lingo": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 463 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 147 } }, "LinkCards": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 16 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 359 } }, "LinkFilter": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 6 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 369 } }, "LinkSuggest": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 265 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 202 } }, "LinkSuggest2": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "LinkTarget": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 336 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 172 } }, "Link_Attributes": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 46 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 329 } }, "LinkedWiki": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 72 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 303 } }, "Linter": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 767 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 107 }, "siteCount": 884, "siteCountRank": 294, "siteCountStandalone": 19 }, "LiquidThreads": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 86 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 291 } }, "Listings": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 6 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 369 } }, "LiveChat": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 32 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 343 } }, "LockAuthor": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 54 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 321 } }, "LegalLogin": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 24 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 351 } }, "LockDownEnglishPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "Lockdown": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5036 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 12 } }, "LogEntry": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "LoginNotify": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 327 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 176 }, "siteCount": 904, "siteCountRank": 277, "siteCountStandalone": 15 }, "LogoFunctions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 69 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 306 } }, "LookupUser": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 289 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 193 } }, "LoopFunctions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 126 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 259 } }, "Loops": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 802 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 104 } }, "MP3MediaHandler": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 374 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 164 } }, "MWVersionInfo": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "MachineVision": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "MadLib": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "LibraryCheckout": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "LdapAuthentication": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1572 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 59 } }, "InputBox": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3285 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 26 }, "siteCount": 10897, "siteCountRank": 7, "siteCountStandalone": 2338 }, "JsonData": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 13 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 362 } }, "Insider": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "InteractiveBlockMessage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "Interlanguage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 27 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 348 } }, "Interwiki": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1131 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 72 }, "siteCount": 4768, "siteCountRank": 181, "siteCountStandalone": 1041 }, "InterwikiExtracts": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 70 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 305 } }, "InterwikiSorting": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 75 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 301 }, "siteCount": 852, "siteCountRank": 306, "siteCountStandalone": 4 }, "InviteSignup": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 220 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 216 } }, "JSBreadCrumbs": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 572 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 131 } }, "JWTAuth": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 22 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 353 } }, "Josa": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 34 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 341 } }, "Json5Config": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 10 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 365 } }, "JsonConfig": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3252 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 28 }, "siteCount": 897, "siteCountRank": 263, "siteCountStandalone": 47 }, "Kartographer": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 885 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 92 }, "siteCount": 898, "siteCountRank": 289, "siteCountStandalone": 36 }, "LastUserLogin": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 465 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 146 } }, "LDAPAuthentication2": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 13958 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 2 } }, "LDAPAuthorization": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7209 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 9 } }, "LDAPGroups": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4804 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 13 } }, "LDAPProvider": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 12534 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 4 } }, "LDAPSyncAll": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 693 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 113 } }, "LDAPUserInfo": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4493 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 14 } }, "LabeledSectionTransclusion": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3102 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 29 } }, "LandingCheck": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 9 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 366 } }, "LanguageSelector": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 347 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 170 } }, "LanguageTag": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 13 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 362 } }, "LanguageTool": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 28 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 347 } }, "LastModified": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 300 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 186 } }, "GoogleDocCreator": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "GoogleAuthenticator": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 12 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 363 } }, "DebugMode": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "EmailAuth": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 17 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 358 } }, "EasyWiki": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 20 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 355 } }, "Echo": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2386 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 37 }, "siteCount": 2698, "siteCountRank": 187, "siteCountStandalone": 263 }, "EditAccount": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 601 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 127 } }, "EditNotify": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 95 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 284 } }, "EditSimilar": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 13 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 362 } }, "EditSubpages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 37 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 338 } }, "EditUser": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 64 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 311 } }, "Editcount": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 392 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 160 }, "siteCount": 1518, "siteCountRank": 209, "siteCountStandalone": 131 }, "EditcountAdditions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 20 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 355 }, "siteCount": 933, "siteCountRank": 284, "siteCountStandalone": 0 }, "Elastica": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3995 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 20 }, "siteCount": 1235, "siteCountRank": 212, "siteCountStandalone": 114 }, "ElectronPdfService": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 332 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 173 }, "siteCount": 857, "siteCountRank": 301, "siteCountStandalone": 4 }, "EmailAuthorization": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 119 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 264 } }, "DynamicSidebar": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1043 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 81 } }, "EmailCapture": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 16 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 359 } }, "EmailDeletedPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 372 } }, "EmailDiff": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 14 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 361 } }, "EmailNotifications": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 28 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 347 } }, "EmergencyCaptcha": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "EncryptedUploads": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "EnhanceContactForm": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 15 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 360 }, "siteCount": 1204, "siteCountRank": 236, "siteCountStandalone": 9 }, "EnhancedStandardUIs": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "EnhancedUpload": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 302 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 185 } }, "EntitySchema": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 112 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 270 } }, "ErrorHandler": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "EtherpadLite": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 16 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 359 } }, "EImage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 9 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 366 } }, "DynamicPageListEngine": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 129 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 257 } }, "EventLogging": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 682 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 116 }, "siteCount": 1078, "siteCountRank": 221, "siteCountStandalone": 43 }, "DiscordRCFeed": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 55 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 320 } }, "DebugTemplates": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 28 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 347 } }, "DeleteBatch": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1192 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 71 } }, "DeleteOwn": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 6 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 369 } }, "DeletePagesForGood": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 202 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 221 } }, "DeleteUserPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 9 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 366 } }, "Description2": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 661 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 120 } }, "DeviceMapLogCapture": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 7 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 368 } }, "Diagnosis": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "DidYouKnow": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 31 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 344 } }, "DisableAccount": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 323 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 178 } }, "DisableSpecialPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "Disambiguator": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2532 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 34 }, "siteCount": 6730, "siteCountRank": 55, "siteCountStandalone": 85 }, "Discourse": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "DynamicPageList": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 305 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 183 } }, "DiscussionThreading": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 148 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 248 } }, "DiscussionTools": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1024 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 82 }, "siteCount": 930, "siteCountRank": 285, "siteCountStandalone": 11 }, "DismissableSiteNotice": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 590 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 130 }, "siteCount": 2711, "siteCountRank": 189, "siteCountStandalone": 200 }, "DisplayTitle": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 723 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 109 } }, "DisqusTag": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "DocBookExport": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 253 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 205 } }, "DonationInterface": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 39 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 336 } }, "DoubleWiki": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 11 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 364 } }, "Drafts": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 262 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 203 } }, "DrawioEditor": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2209 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 42 } }, "DumpsOnDemand": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 77 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 299 }, "siteCount": 5645, "siteCountRank": 37, "siteCountStandalone": 8 }, "Duplicator": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 31 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 344 } }, "EventBus": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 104 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 275 }, "siteCount": 858, "siteCountRank": 298, "siteCountStandalone": 4 }, "EventSimulator": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 2 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 373 } }, "GoogleAnalyticsTopPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 370 } }, "GitGadgets": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "FundraiserLandingPage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 16 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 359 } }, "FundraisingEmailUnsubscribe": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "FundraisingTranslateWorkflow": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 3 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 372 } }, "GPGMail": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "Gadgets": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1689 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 53 }, "siteCount": 4145, "siteCountRank": 177, "siteCountStandalone": 1189 }, "Genealogy": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 128 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 258 } }, "GenerateMochaConfig": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "GeoCrumbs": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 105 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 274 } }, "GeoData": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1979 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 47 } }, "GeoGebra": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 62 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 313 } }, "GettingStarted": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 27 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 348 } }, "Git2Pages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 13 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 362 } }, "GlobalBlocking": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 466 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 145 }, "siteCount": 1015, "siteCountRank": 251, "siteCountStandalone": 12 }, "FormatDates": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "GlobalContribs": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "GlobalContributions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 374 } }, "GlobalCssJs": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 198 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 224 } }, "GlobalNotice": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 18 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 357 }, "siteCount": 1155, "siteCountRank": 235, "siteCountStandalone": 2 }, "GlobalPreferences": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 179 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 234 }, "siteCount": 1303, "siteCountRank": 214, "siteCountStandalone": 4 }, "GlobalUsage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 151 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 246 }, "siteCount": 964, "siteCountRank": 249, "siteCountStandalone": 16 }, "GlobalUserGroups": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 22 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 353 }, "siteCount": 5646, "siteCountRank": 39, "siteCountStandalone": 9 }, "GlobalUserPage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 218 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 217 }, "siteCount": 2011, "siteCountRank": 198, "siteCountStandalone": 0 }, "GlobalUserrights": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 59 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 316 }, "siteCount": 1216, "siteCountRank": 216, "siteCountStandalone": 3 }, "GlobalWatchlist": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 29 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 346 }, "siteCount": 5392, "siteCountRank": 49, "siteCountStandalone": 10 }, "GoogleAdSense": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 387 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 161 } }, "GoogleAnalyticsMetrics": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 44 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 331 } }, "Forms": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 112 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 270 } }, "FormWizard": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 31 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 344 } }, "EventStreamConfig": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 150 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 247 }, "siteCount": 993, "siteCountRank": 271, "siteCountStandalone": 15 }, "Figures": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 137 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 253 } }, "Expressions": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 14 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 361 } }, "ExtJSBase": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1223 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 70 } }, "ExtensionDistributor": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 371 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 165 } }, "ExternalArticles": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 29 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 346 } }, "ExternalData": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 368 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 166 } }, "ExternalGuidance": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 38 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 337 } }, "ExternalLinkConfirm": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 9 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 366 } }, "ExtraLanguageLink": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 4 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 371 } }, "FacetedCategory": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 18 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 357 } }, "FanBoxes": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 32 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 343 } }, "Favorites": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 160 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 242 } }, "FeaturedFeeds": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 179 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 234 }, "siteCount": 876, "siteCountRank": 273, "siteCountStandalone": 13 }, "FileAnnotations": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 32 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 343 } }, "Form": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 108 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 272 } }, "FileExporter": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 137 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 253 }, "siteCount": 867, "siteCountRank": 302, "siteCountStandalone": 4 }, "FileImporter": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 315 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 180 } }, "FileSystemImageServer": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 10 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 365 } }, "FilterListUsers": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 367 } }, "FilterSpecialPages": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 45 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 330 } }, "FixedHeaderTable": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 18 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 357 } }, "FlaggedRevs": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 801 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 105 } }, "FlexDiagrams": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 31 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 344 } }, "FlexiSkin": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 64 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 311 } }, "FlickrAPI": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 32 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 343 } }, "Flow": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 833 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 98 } }, "ForcePreview": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 55 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 320 } }, "wikihiero": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 368 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 166 } }, "SyntaxHighlight": { "siteCount": 11760, "siteCountRank": 6, "siteCountStandalone": 3206 }, "EasyTimeline": { "siteCount": 7989, "siteCountRank": 15, "siteCountStandalone": 133 }, "Labeled_Section_Transclusion": { "siteCount": 6919, "siteCountRank": 20, "siteCountStandalone": 251 }, "EmbedVideo": { "siteCount": 7623, "siteCountRank": 21, "siteCountStandalone": 1427 }, "Sitemap": { "siteCount": 6853, "siteCountRank": 22, "siteCountStandalone": 9 }, "InterwikiDispatcher": { "siteCount": 6844, "siteCountRank": 25, "siteCountStandalone": 9 }, "StaffSig": { "siteCount": 6836, "siteCountRank": 26, "siteCountStandalone": 8 }, "LookupContribs": { "siteCount": 6796, "siteCountRank": 27, "siteCountStandalone": 8 }, "Maps": { "siteCount": 6478, "siteCountRank": 29, "siteCountStandalone": 594 }, "Tabber": { "siteCount": 5787, "siteCountRank": 33, "siteCountStandalone": 107 }, "Phalanx": { "siteCount": 5703, "siteCountRank": 34, "siteCountStandalone": 22 }, "PoolCounter": { "siteCount": 6513, "siteCountRank": 36, "siteCountStandalone": 11 }, "Track": { "siteCount": 5700, "siteCountRank": 38, "siteCountStandalone": 9 }, "Piggyback": { "siteCount": 5648, "siteCountRank": 40, "siteCountStandalone": 9 }, "WikiAnalytics": { "siteCount": 5646, "siteCountRank": 41, "siteCountStandalone": 9 }, "AdEngine": { "siteCount": 5646, "siteCountRank": 42, "siteCountStandalone": 8 }, "QuickTools": { "siteCount": 5648, "siteCountRank": 43, "siteCountStandalone": 9 }, "AnalyticsEngine": { "siteCount": 5649, "siteCountRank": 44, "siteCountStandalone": 9 }, "Unsubscribe": { "siteCount": 5649, "siteCountRank": 45, "siteCountStandalone": 9 }, "Activity": { "siteCount": 5455, "siteCountRank": 46, "siteCountStandalone": 10 }, "CategorySelect": { "siteCount": 5649, "siteCountRank": 47, "siteCountStandalone": 9 }, "CategoryBlueLinks": { "siteCount": 5416, "siteCountRank": 48, "siteCountStandalone": 6 }, "SharedHelp": { "siteCount": 5374, "siteCountRank": 50, "siteCountStandalone": 6 }, "ArticleComments": { "siteCount": 5269, "siteCountRank": 51, "siteCountStandalone": 31 }, "Validator": { "siteCount": 7130, "siteCountRank": 52, "siteCountStandalone": 1051 }, "Vector": { "siteCount": 6792, "siteCountRank": 53, "siteCountStandalone": 3778 }, "ParserHooks": { "siteCount": 6698, "siteCountRank": 56, "siteCountStandalone": 576 }, "Parsoid": { "siteCount": 6616, "siteCountRank": 57, "siteCountStandalone": 61 }, "Lightbox": { "siteCount": 5645, "siteCountRank": 59, "siteCountStandalone": 9 }, "RSS Pie": { "siteCount": 5729, "siteCountRank": 61, "siteCountStandalone": 12 }, "CreateNewWiki": { "siteCount": 5647, "siteCountRank": 62, "siteCountStandalone": 9 }, "AdminDashboard": { "siteCount": 5645, "siteCountRank": 63, "siteCountStandalone": 8 }, "CLDR": { "siteCount": 6625, "siteCountRank": 65, "siteCountStandalone": 114 }, "FounderProgressBar": { "siteCount": 4555, "siteCountRank": 66, "siteCountStandalone": 2 }, "ReCaptchaNoCaptcha": { "siteCount": 6060, "siteCountRank": 67, "siteCountStandalone": 342 }, "FandomGrants": { "siteCount": 6236, "siteCountRank": 68, "siteCountStandalone": 7 }, "FandomAuth": { "siteCount": 6150, "siteCountRank": 69, "siteCountStandalone": 7 }, "Sitenotice": { "siteCount": 5981, "siteCountRank": 70, "siteCountStandalone": 8 }, "FandomEmbedVideo": { "siteCount": 5977, "siteCountRank": 71, "siteCountStandalone": 7 }, "WatchedPage": { "siteCount": 5977, "siteCountRank": 72, "siteCountStandalone": 7 }, "SilverSurferLoader": { "siteCount": 5960, "siteCountRank": 73, "siteCountStandalone": 8 }, "UncrawlableUrl": { "siteCount": 5960, "siteCountRank": 74, "siteCountStandalone": 8 }, "FallbackFontAdjustments": { "siteCount": 5951, "siteCountRank": 75, "siteCountStandalone": 8 }, "ThemeDesignerNext": { "siteCount": 5940, "siteCountRank": 76, "siteCountStandalone": 8 }, "SpecialBlock": { "siteCount": 5940, "siteCountRank": 77, "siteCountStandalone": 8 }, "RedisCache": { "siteCount": 5910, "siteCountRank": 78, "siteCountStandalone": 8 }, "Reverb": { "siteCount": 5910, "siteCountRank": 79, "siteCountStandalone": 8 }, "Twiggy": { "siteCount": 5910, "siteCountRank": 80, "siteCountStandalone": 8 }, "SpecialUpload": { "siteCount": 5908, "siteCountRank": 81, "siteCountStandalone": 8 }, "MessageCachePerformance": { "siteCount": 5876, "siteCountRank": 82, "siteCountStandalone": 9 }, "Hide": { "siteCount": 5874, "siteCountRank": 83, "siteCountStandalone": 9 }, "RecommendationTiles": { "siteCount": 5873, "siteCountRank": 84, "siteCountStandalone": 8 }, "SpotifyTag": { "siteCount": 5873, "siteCountRank": 85, "siteCountStandalone": 8 }, "UserRename": { "siteCount": 5873, "siteCountRank": 86, "siteCountStandalone": 8 }, "Listusers": { "siteCount": 5873, "siteCountRank": 87, "siteCountStandalone": 8 }, "FeedsAndPosts": { "siteCount": 5873, "siteCountRank": 88, "siteCountStandalone": 8 }, "DesignSystem-i18n": { "siteCount": 5873, "siteCountRank": 89, "siteCountStandalone": 8 }, "FandomAPI": { "siteCount": 5873, "siteCountRank": 90, "siteCountStandalone": 8 }, "UserRights": { "siteCount": 5873, "siteCountRank": 91, "siteCountStandalone": 8 }, "SpecialChangeFandomEmail": { "siteCount": 5873, "siteCountRank": 92, "siteCountStandalone": 8 }, "MercuryApi": { "siteCount": 5873, "siteCountRank": 93, "siteCountStandalone": 8 }, "MessageOverrides": { "siteCount": 5873, "siteCountRank": 94, "siteCountStandalone": 8 }, "LuaLibraries": { "siteCount": 5873, "siteCountRank": 95, "siteCountStandalone": 8 }, "SeoTweaks": { "siteCount": 5873, "siteCountRank": 96, "siteCountStandalone": 8 }, "Sailthru": { "siteCount": 5873, "siteCountRank": 97, "siteCountStandalone": 8 }, "UserProfileActivity": { "siteCount": 5873, "siteCountRank": 98, "siteCountStandalone": 8 }, "MapsTracking": { "siteCount": 5873, "siteCountRank": 99, "siteCountStandalone": 8 }, "StablePageIdStorage": { "siteCount": 5873, "siteCountRank": 100, "siteCountStandalone": 8 }, "InterwikiEdit": { "siteCount": 5873, "siteCountRank": 101, "siteCountStandalone": 8 }, "Banner Notifications": { "siteCount": 5873, "siteCountRank": 102, "siteCountStandalone": 8 }, "LocalSitemapPage": { "siteCount": 5873, "siteCountRank": 103, "siteCountStandalone": 8 }, "PortableInfobox": { "siteCount": 5873, "siteCountRank": 104, "siteCountStandalone": 8 }, "UnifiedSearch": { "siteCount": 5873, "siteCountRank": 105, "siteCountStandalone": 8 }, "WikiDescription": { "siteCount": 5873, "siteCountRank": 106, "siteCountStandalone": 8 }, "ContactPageRedirects": { "siteCount": 5873, "siteCountRank": 107, "siteCountStandalone": 8 }, "DataWarehouse": { "siteCount": 5873, "siteCountRank": 108, "siteCountStandalone": 8 }, "FacebookTags": { "siteCount": 5873, "siteCountRank": 109, "siteCountStandalone": 8 }, "UserProfile": { "siteCount": 5873, "siteCountRank": 110, "siteCountStandalone": 8 }, "UpdateSpecialPagesScheduler": { "siteCount": 5873, "siteCountRank": 111, "siteCountStandalone": 8 }, "DesignSystem": { "siteCount": 5871, "siteCountRank": 112, "siteCountStandalone": 8 }, "FandomProtectSite": { "siteCount": 5871, "siteCountRank": 113, "siteCountStandalone": 8 }, "JWPlayerTag": { "siteCount": 5868, "siteCountRank": 114, "siteCountStandalone": 7 }, "ContentReview": { "siteCount": 5865, "siteCountRank": 116, "siteCountStandalone": 7 }, "PerformanceMonitoring": { "siteCount": 5863, "siteCountRank": 117, "siteCountStandalone": 8 }, "Pages": { "siteCount": 5863, "siteCountRank": 118, "siteCountStandalone": 8 }, "MultiTasks": { "siteCount": 5863, "siteCountRank": 119, "siteCountStandalone": 8 }, "GlobalShortcuts": { "siteCount": 5863, "siteCountRank": 120, "siteCountStandalone": 8 }, "FandomImageReview": { "siteCount": 5863, "siteCountRank": 121, "siteCountStandalone": 8 }, "CityList": { "siteCount": 5863, "siteCountRank": 122, "siteCountStandalone": 8 }, "FastlyInsights": { "siteCount": 5863, "siteCountRank": 123, "siteCountStandalone": 8 }, "Nirvana": { "siteCount": 5863, "siteCountRank": 124, "siteCountStandalone": 8 }, "ArticleExporter": { "siteCount": 5863, "siteCountRank": 125, "siteCountStandalone": 8 }, "TagsReport": { "siteCount": 5863, "siteCountRank": 126, "siteCountStandalone": 8 }, "ListGlobalUsers": { "siteCount": 5863, "siteCountRank": 127, "siteCountStandalone": 8 }, "ImageServing": { "siteCount": 5863, "siteCountRank": 128, "siteCountStandalone": 8 }, "HTTPSSupport": { "siteCount": 5863, "siteCountRank": 129, "siteCountStandalone": 8 }, "CoppaTool global tasks": { "siteCount": 5863, "siteCountRank": 130, "siteCountStandalone": 8 }, "Content Security Policy": { "siteCount": 5863, "siteCountRank": 131, "siteCountStandalone": 8 }, "RobotsTxt": { "siteCount": 5863, "siteCountRank": 132, "siteCountStandalone": 8 }, "GlobalLuaModules": { "siteCount": 5863, "siteCountRank": 133, "siteCountStandalone": 8 }, "MultiLookup": { "siteCount": 5863, "siteCountRank": 134, "siteCountStandalone": 8 }, "FandomStyles": { "siteCount": 5861, "siteCountRank": 135, "siteCountStandalone": 8 }, "License": { "siteCount": 5861, "siteCountRank": 136, "siteCountStandalone": 8 }, "FandomScripts": { "siteCount": 5861, "siteCountRank": 137, "siteCountStandalone": 8 }, "ArticleInterlang": { "siteCount": 5861, "siteCountRank": 138, "siteCountStandalone": 8 }, "MobileImageGallery": { "siteCount": 5861, "siteCountRank": 139, "siteCountStandalone": 8 }, "NSDefine": { "siteCount": 5860, "siteCountRank": 140, "siteCountStandalone": 8 }, "FandomVisualEditor": { "siteCount": 5859, "siteCountRank": 141, "siteCountStandalone": 8 }, "GlobalCSSJS": { "siteCount": 5859, "siteCountRank": 142, "siteCountStandalone": 8 }, "ArticleVideo": { "siteCount": 5858, "siteCountRank": 143, "siteCountStandalone": 7 }, "FounderEmails": { "siteCount": 5857, "siteCountRank": 144, "siteCountStandalone": 8 }, "Announcements": { "siteCount": 5680, "siteCountRank": 145, "siteCountStandalone": 8 }, "Slider": { "siteCount": 5333, "siteCountRank": 146, "siteCountStandalone": 3 }, "Email": { "siteCount": 5571, "siteCountRank": 147, "siteCountStandalone": 7 }, "CloseMyAccount": { "siteCount": 5529, "siteCountRank": 148, "siteCountStandalone": 5 }, "UserPreferencesV2": { "siteCount": 5539, "siteCountRank": 149, "siteCountStandalone": 6 }, "CuratedContent": { "siteCount": 5539, "siteCountRank": 150, "siteCountStandalone": 6 }, "DownloadYourData": { "siteCount": 5647, "siteCountRank": 151, "siteCountStandalone": 8 }, "Paginator": { "siteCount": 5539, "siteCountRank": 152, "siteCountStandalone": 6 }, "WikiaBar": { "siteCount": 5539, "siteCountRank": 153, "siteCountStandalone": 6 }, "SpecialWithoutimages": { "siteCount": 5570, "siteCountRank": 154, "siteCountStandalone": 6 }, "CanonicalHref": { "siteCount": 5607, "siteCountRank": 155, "siteCountStandalone": 9 }, "Privacy": { "siteCount": 5524, "siteCountRank": 156, "siteCountStandalone": 4 }, "Auth": { "siteCount": 5537, "siteCountRank": 157, "siteCountStandalone": 6 }, "Thumbnails": { "siteCount": 5496, "siteCountRank": 158, "siteCountStandalone": 3 }, "Insights": { "siteCount": 5563, "siteCountRank": 159, "siteCountStandalone": 5 }, "MainPageTag": { "siteCount": 5514, "siteCountRank": 160, "siteCountStandalone": 5 }, "PortableInfoboxBuilder": { "siteCount": 5610, "siteCountRank": 161, "siteCountStandalone": 6 }, "SeoLinkHrefLang": { "siteCount": 5593, "siteCountRank": 162, "siteCountStandalone": 5 }, "DiscussionMaintenance": { "siteCount": 5593, "siteCountRank": 163, "siteCountStandalone": 5 }, "UploadNewImages": { "siteCount": 5593, "siteCountRank": 164, "siteCountStandalone": 5 }, "TemplateClassification": { "siteCount": 5593, "siteCountRank": 165, "siteCountStandalone": 5 }, "PhotoGallery": { "siteCount": 5593, "siteCountRank": 166, "siteCountStandalone": 5 }, "TimeAgoMessaging": { "siteCount": 5593, "siteCountRank": 167, "siteCountStandalone": 5 }, "VisitSource": { "siteCount": 5593, "siteCountRank": 168, "siteCountStandalone": 5 }, "CommunityPage": { "siteCount": 5590, "siteCountRank": 169, "siteCountStandalone": 5 }, "FilePageRedirect": { "siteCount": 5583, "siteCountRank": 170, "siteCountStandalone": 5 }, "CategoryPage": { "siteCount": 5583, "siteCountRank": 171, "siteCountStandalone": 5 }, "AutoMainPageFixer": { "siteCount": 5583, "siteCountRank": 172, "siteCountStandalone": 5 }, "FandomVideo": { "siteCount": 5583, "siteCountRank": 173, "siteCountStandalone": 5 }, "SpecialCSS": { "siteCount": 5583, "siteCountRank": 174, "siteCountStandalone": 5 }, "DiscussionPermissions": { "siteCount": 5574, "siteCountRank": 175, "siteCountStandalone": 5 }, "DiscussionModeration": { "siteCount": 5574, "siteCountRank": 176, "siteCountStandalone": 5 }, "Twitter Tag": { "siteCount": 5285, "siteCountRank": 178, "siteCountStandalone": 6 }, "Blogs": { "siteCount": 5352, "siteCountRank": 179, "siteCountStandalone": 5 }, "ForumRedirect": { "siteCount": 4592, "siteCountRank": 183, "siteCountStandalone": 3 }, "MessageWall": { "siteCount": 4511, "siteCountRank": 184, "siteCountStandalone": 3 }, "Google_Analytics_Integration": { "siteCount": 988, "siteCountRank": 194, "siteCountStandalone": 735 }, "WikiHiero": { "siteCount": 1468, "siteCountRank": 196, "siteCountStandalone": 37 }, "Replace_Text": { "siteCount": 1638, "siteCountRank": 200, "siteCountStandalone": 1033 }, "Achievements": { "siteCount": 1080, "siteCountRank": 206, "siteCountStandalone": 4 }, "Newest_Pages": { "siteCount": 1370, "siteCountRank": 210, "siteCountStandalone": 133 }, "QuestyCaptcha": { "siteCount": 1332, "siteCountRank": 211, "siteCountStandalone": 1063 }, "Wiki Category Tag Cloud": { "siteCount": 1247, "siteCountRank": 217, "siteCountStandalone": 61 }, "Piwik Integration": { "siteCount": 1216, "siteCountRank": 218, "siteCountStandalone": 60 }, "TalkNotifications": { "siteCount": 1358, "siteCountRank": 220, "siteCountStandalone": 5 }, "AJAX_Poll": { "siteCount": 1240, "siteCountRank": 225, "siteCountStandalone": 30 }, "Nimbus": { "siteCount": 1180, "siteCountRank": 226, "siteCountStandalone": 8 }, "User_Merge_and_Delete": { "siteCount": 1236, "siteCountRank": 227, "siteCountStandalone": 1083 }, "Semantic MediaWiki": { "siteCount": 1209, "siteCountRank": 234, "siteCountStandalone": 972 }, "EmailCheck": { "siteCount": 1160, "siteCountRank": 237, "siteCountStandalone": 0 }, "Multiple Lookup": { "siteCount": 1139, "siteCountRank": 238, "siteCountStandalone": 0 }, "MyInfo": { "siteCount": 1139, "siteCountRank": 240, "siteCountStandalone": 0 }, "ProblemReports": { "siteCount": 1139, "siteCountRank": 243, "siteCountStandalone": 0 }, "ShoutWiki_API": { "siteCount": 1115, "siteCountRank": 250, "siteCountStandalone": 0 }, "FancyCaptcha": { "siteCount": 1137, "siteCountRank": 253, "siteCountStandalone": 50 }, "Add_User_ID_Into_Preferences": { "siteCount": 1146, "siteCountRank": 255, "siteCountStandalone": 0 }, "LastMeasure": { "siteCount": 1145, "siteCountRank": 256, "siteCountStandalone": 0 }, "SimpleMathJax": { "siteCount": 909, "siteCountRank": 270, "siteCountStandalone": 100 }, "ShoutWiki_Ads": { "siteCount": 942, "siteCountRank": 280, "siteCountStandalone": 14 }, "WikibaseClient": { "siteCount": 945, "siteCountRank": 283, "siteCountStandalone": 13 }, "ShoutWiki Library": { "siteCount": 927, "siteCountRank": 287, "siteCountStandalone": 0 }, "Abuse Filter Bypass": { "siteCount": 915, "siteCountRank": 290, "siteCountStandalone": 1 }, "3d": { "siteCount": 859, "siteCountRank": 300, "siteCountStandalone": 5 }, "Gamepress": { "siteCount": 845, "siteCountRank": 309, "siteCountStandalone": 2 }, "Bouquet": { "siteCount": 843, "siteCountRank": 310, "siteCountStandalone": 4 } }, "skins": { "2018": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 145 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 33 } }, "Timeless": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1995 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 3 }, "siteCount": 2938, "siteCountRank": 13, "siteCountDefault": 165 }, "MonoBook": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1357 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 6 }, "siteCount": 13681, "siteCountRank": 1, "siteCountDefault": 1860 }, "Nimbus": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 189 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 25 }, "siteCount": 1260, "siteCountRank": 18, "siteCountDefault": 27 }, "Nostalgia": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 239 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 23 }, "siteCount": 5434, "siteCountRank": 5, "siteCountDefault": 1 }, "Pivot": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 871 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 8 }, "siteCount": 34, "siteCountRank": 51, "siteCountDefault": 24 }, "Poncho": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 647 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 11 }, "siteCount": 7, "siteCountRank": 115, "siteCountDefault": 2 }, "Reflection": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 22 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 46 } }, "Refreshed": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 636 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 12 }, "siteCount": 41, "siteCountRank": 42, "siteCountDefault": 19 }, "Schulenburg": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 23 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 45 } }, "Splash": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 363 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 19 }, "siteCount": 4, "siteCountRank": 86, "siteCountDefault": 2 }, "Tempo": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 137 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 34 }, "siteCount": 4, "siteCountRank": 175, "siteCountDefault": 0 }, "Truglass": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 48 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 43 }, "siteCount": 1235, "siteCountRank": 19, "siteCountDefault": 1 }, "Mirage": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 145 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 33 }, "siteCount": 9, "siteCountRank": 109, "siteCountDefault": 0 }, "TuleapSkin": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 16 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 48 } }, "Vector": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 8327 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 1 }, "siteCount": 14010, "siteCountRank": 2, "siteCountDefault": 5943 }, "WMAU": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 152 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 32 }, "siteCount": 13, "siteCountRank": 90, "siteCountDefault": 1 }, "WPtouch": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 196 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 24 }, "siteCount": 165, "siteCountRank": 30, "siteCountDefault": 5 }, "WikimediaApiPortal": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 113 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 38 } }, "WoOgLeShades": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 136 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 35 } }, "apex": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 485 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 14 } }, "erudite": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 471 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 16 } }, "mediawiki_strapping": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 113 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 38 } }, "p2wiki": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 55 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 42 } }, "shared": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 6 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 50 } }, "Modern": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1676 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 4 }, "siteCount": 10913, "siteCountRank": 3, "siteCountDefault": 238 }, "MinervaNeue": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 5527 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 2 }, "siteCount": 2388, "siteCountRank": 14, "siteCountDefault": 11 }, "Aether": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 168 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 29 }, "siteCount": 6, "siteCountRank": 136, "siteCountDefault": 5 }, "Dusk": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 154 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 31 }, "siteCount": 461, "siteCountRank": 21, "siteCountDefault": 2 }, "Amethyst": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 179 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 28 } }, "Anisa": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 403 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 17 }, "siteCount": 23, "siteCountRank": 73, "siteCountDefault": 2 }, "BlueSky": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 364 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 18 }, "siteCount": 5, "siteCountRank": 92, "siteCountDefault": 2 }, "BlueSpiceCalumma": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 475 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 15 } }, "BlueSpiceDiscovery": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 186 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 26 } }, "Bouquet": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 123 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 37 }, "siteCount": 862, "siteCountRank": 24, "siteCountDefault": 0 }, "Cavendish": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 196 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 24 }, "siteCount": 173, "siteCountRank": 29, "siteCountDefault": 19 }, "CologneBlue": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1506 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 5 }, "siteCount": 6863, "siteCountRank": 4, "siteCountDefault": 9 }, "Cosmos": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 1275 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 7 }, "siteCount": 25, "siteCountRank": 71, "siteCountDefault": 2 }, "DeskMessMirrored": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 104 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 39 }, "siteCount": 861, "siteCountRank": 25, "siteCountDefault": 0 }, "DuskToDawn": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 299 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 22 }, "siteCount": 861, "siteCountRank": 23, "siteCountDefault": 0 }, "Metrolook": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 542 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 13 }, "siteCount": 87, "siteCountRank": 35, "siteCountDefault": 27 }, "Empty": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 25 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 44 } }, "Example": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 185 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 27 }, "siteCount": 7, "siteCountRank": 93, "siteCountDefault": 0 }, "Foreground": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 844 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 9 }, "siteCount": 312, "siteCountRank": 27, "siteCountDefault": 150 }, "Freo": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 15 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 49 } }, "Gamepress": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 739 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 10 }, "siteCount": 873, "siteCountRank": 22, "siteCountDefault": 1 }, "GreyStuff": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 130 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 36 }, "siteCount": 35, "siteCountRank": 58, "siteCountDefault": 1 }, "GuMaxDD": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 65 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 41 }, "siteCount": 115, "siteCountRank": 37, "siteCountDefault": 11 }, "HasSomeColours": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 313 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 21 }, "siteCount": 23, "siteCountRank": 74, "siteCountDefault": 1 }, "Mask": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 167 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 30 }, "siteCount": 3, "siteCountRank": 133, "siteCountDefault": 0 }, "Material": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 339 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 20 }, "siteCount": 7, "siteCountRank": 126, "siteCountDefault": 1 }, "MediaWikiWordpressThemes": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 18 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 47 } }, "webplatform": { "downloads": { "1w": 0, "4w": 0, "13w": 0, "1y": 0, "20y": 96 }, "downloadsRank": { "1w": 1, "4w": 1, "13w": 1, "1y": 1, "20y": 40 } }, "Standard": { "siteCount": 5390, "siteCountRank": 6, "siteCountDefault": 0 }, "Simple": { "siteCount": 5370, "siteCountRank": 7, "siteCountDefault": 0 }, "MySkin": { "siteCount": 5369, "siteCountRank": 8, "siteCountDefault": 1 }, "Chick": { "siteCount": 5365, "siteCountRank": 9, "siteCountDefault": 2 }, "FandomDesktop": { "siteCount": 5068, "siteCountRank": 10, "siteCountDefault": 5030 }, "Mobileve": { "siteCount": 4893, "siteCountRank": 11, "siteCountDefault": 0 }, "Cologne Blue": { "siteCount": 2774, "siteCountRank": 12, "siteCountDefault": 38 }, "Monaco": { "siteCount": 1499, "siteCountRank": 15, "siteCountDefault": 216 }, "Vector (2022)": { "siteCount": 1351, "siteCountRank": 16, "siteCountDefault": 146 }, "Vector legacy (2010)": { "siteCount": 1344, "siteCountRank": 17, "siteCountDefault": 1110 }, "Aurora": { "siteCount": 30, "siteCountRank": 20, "siteCountDefault": 7 }, "Minerva": { "siteCount": 472, "siteCountRank": 26, "siteCountDefault": 0 }, "Chameleon": { "siteCount": 243, "siteCountRank": 28, "siteCountDefault": 195 }, "AdBird": { "siteCount": 158, "siteCountRank": 31, "siteCountDefault": 148 }, "Erudite": { "siteCount": 122, "siteCountRank": 32, "siteCountDefault": 23 }, "Bootstrap": { "siteCount": 140, "siteCountRank": 33, "siteCountDefault": 37 }, "Oasis": { "siteCount": 40, "siteCountRank": 34, "siteCountDefault": 11 }, "GuMax": { "siteCount": 115, "siteCountRank": 36, "siteCountDefault": 9 }, "Tweeki": { "siteCount": 87, "siteCountRank": 38, "siteCountDefault": 32 }, "Citizen": { "siteCount": 29, "siteCountRank": 39, "siteCountDefault": 12 }, "DarkVector": { "siteCount": 50, "siteCountRank": 40, "siteCountDefault": 9 }, "Strapping": { "siteCount": 75, "siteCountRank": 41, "siteCountDefault": 23 }, "BootstrapMediaWiki": { "siteCount": 27, "siteCountRank": 43, "siteCountDefault": 20 }, "GMWFreeBlue": { "siteCount": 63, "siteCountRank": 44, "siteCountDefault": 5 }, "Pixeled": { "siteCount": 63, "siteCountRank": 45, "siteCountDefault": 3 }, "CavendishMW": { "siteCount": 57, "siteCountRank": 46, "siteCountDefault": 10 }, "Medik": { "siteCount": 56, "siteCountRank": 47, "siteCountDefault": 26 }, "Hydra": { "siteCount": 55, "siteCountRank": 48, "siteCountDefault": 36 }, "GMWFreeGreen": { "siteCount": 54, "siteCountRank": 49, "siteCountDefault": 0 }, "Hydra Dark": { "siteCount": 52, "siteCountRank": 50, "siteCountDefault": 52 }, "GMWFreeRed": { "siteCount": 47, "siteCountRank": 52, "siteCountDefault": 0 }, "Index": { "siteCount": 46, "siteCountRank": 53, "siteCountDefault": 0 }, "Roundedblue": { "siteCount": 43, "siteCountRank": 54, "siteCountDefault": 0 }, "MistyLook": { "siteCount": 40, "siteCountRank": 55, "siteCountDefault": 2 }, "WikiaMobile": { "siteCount": 28, "siteCountRank": 56, "siteCountDefault": 0 }, "Bootstrapskin": { "siteCount": 25, "siteCountRank": 57, "siteCountDefault": 16 }, "Digilern": { "siteCount": 31, "siteCountRank": 59, "siteCountDefault": 0 }, "Zum": { "siteCount": 31, "siteCountRank": 60, "siteCountDefault": 0 }, "Fratman enhanced": { "siteCount": 30, "siteCountRank": 61, "siteCountDefault": 3 }, "GuMaxVN": { "siteCount": 29, "siteCountRank": 62, "siteCountDefault": 1 }, "Img auth": { "siteCount": 28, "siteCountRank": 63, "siteCountDefault": 0 }, "Opensearch desc": { "siteCount": 28, "siteCountRank": 64, "siteCountDefault": 0 }, "Api": { "siteCount": 28, "siteCountRank": 65, "siteCountDefault": 0 }, "Profileinfo": { "siteCount": 28, "siteCountRank": 66, "siteCountDefault": 0 }, "Thumb handler": { "siteCount": 28, "siteCountRank": 67, "siteCountDefault": 0 }, "Thumb": { "siteCount": 28, "siteCountRank": 68, "siteCountDefault": 0 }, "Load": { "siteCount": 28, "siteCountRank": 69, "siteCountDefault": 0 }, "BlueSpiceSkin": { "siteCount": 5, "siteCountRank": 70, "siteCountDefault": 4 }, "Darwin": { "siteCount": 24, "siteCountRank": 72, "siteCountDefault": 16 }, "MediaWiki Bootstrap": { "siteCount": 21, "siteCountRank": 75, "siteCountDefault": 11 }, "Apex": { "siteCount": 14, "siteCountRank": 76, "siteCountDefault": 4 }, "StrappingAds3": { "siteCount": 13, "siteCountRank": 77, "siteCountDefault": 13 }, "BentoFluid": { "siteCount": 19, "siteCountRank": 78, "siteCountDefault": 0 }, "KindofBlue": { "siteCount": 18, "siteCountRank": 79, "siteCountDefault": 1 }, "Ipbwiki skin": { "siteCount": 18, "siteCountRank": 80, "siteCountDefault": 0 }, "LocalSettings": { "siteCount": 18, "siteCountRank": 81, "siteCountDefault": 0 }, "TwentyTen": { "siteCount": 18, "siteCountRank": 82, "siteCountDefault": 3 }, "Bento": { "siteCount": 17, "siteCountRank": 83, "siteCountDefault": 0 }, "Ipbwiki skin monobook": { "siteCount": 17, "siteCountRank": 84, "siteCountDefault": 0 }, "Clean": { "siteCount": 15, "siteCountRank": 85, "siteCountDefault": 5 }, "Cppreference2": { "siteCount": 14, "siteCountRank": 87, "siteCountDefault": 0 }, "Cppreference": { "siteCount": 14, "siteCountRank": 88, "siteCountDefault": 0 }, "Filament": { "siteCount": 13, "siteCountRank": 89, "siteCountDefault": 3 }, "GuMaxV": { "siteCount": 13, "siteCountRank": 91, "siteCountDefault": 1 }, "FusionForge": { "siteCount": 12, "siteCountRank": 94, "siteCountDefault": 0 }, "Flatbox": { "siteCount": 11, "siteCountRank": 95, "siteCountDefault": 0 }, "Darkvector": { "siteCount": 10, "siteCountRank": 96, "siteCountDefault": 3 }, "Toro": { "siteCount": 10, "siteCountRank": 97, "siteCountDefault": 0 }, "BlueBird": { "siteCount": 10, "siteCountRank": 98, "siteCountDefault": 0 }, "Test": { "siteCount": 10, "siteCountRank": 99, "siteCountDefault": 0 }, "OntoSkin3": { "siteCount": 10, "siteCountRank": 100, "siteCountDefault": 0 }, "Bookjive": { "siteCount": 9, "siteCountRank": 101, "siteCountDefault": 0 }, "GumaxDD2": { "siteCount": 3, "siteCountRank": 102, "siteCountDefault": 0 }, "Bluwiki skin": { "siteCount": 9, "siteCountRank": 103, "siteCountDefault": 1 }, "VectorWikanda": { "siteCount": 9, "siteCountRank": 104, "siteCountDefault": 9 }, "GuMaxDDCustom2": { "siteCount": 3, "siteCountRank": 105, "siteCountDefault": 0 }, "ScratchWikiSkin": { "siteCount": 9, "siteCountRank": 106, "siteCountDefault": 9 }, "Liberty": { "siteCount": 9, "siteCountRank": 107, "siteCountDefault": 7 }, "Otago": { "siteCount": 9, "siteCountRank": 108, "siteCountDefault": 0 }, "GuMaxDDCustom": { "siteCount": 3, "siteCountRank": 110, "siteCountDefault": 0 }, "Cavendish-MW": { "siteCount": 8, "siteCountRank": 111, "siteCountDefault": 6 }, "AMP": { "siteCount": 8, "siteCountRank": 112, "siteCountDefault": 0 }, "VbMediaWikiVector": { "siteCount": 8, "siteCountRank": 113, "siteCountDefault": 0 }, "Wptouch": { "siteCount": 3, "siteCountRank": 114, "siteCountDefault": 0 }, "Codex": { "siteCount": 8, "siteCountRank": 116, "siteCountDefault": 3 }, "VbMediaWikiForum": { "siteCount": 8, "siteCountRank": 117, "siteCountDefault": 0 }, "Evelution": { "siteCount": 8, "siteCountRank": 118, "siteCountDefault": 0 }, "IWiki": { "siteCount": 8, "siteCountRank": 119, "siteCountDefault": 0 }, "Ancestris": { "siteCount": 8, "siteCountRank": 120, "siteCountDefault": 0 }, "VbGORE": { "siteCount": 8, "siteCountRank": 121, "siteCountDefault": 2 }, "Minit": { "siteCount": 7, "siteCountRank": 122, "siteCountDefault": 2 }, "Uncyclopedia": { "siteCount": 7, "siteCountRank": 123, "siteCountDefault": 0 }, "Ycgu max": { "siteCount": 6, "siteCountRank": 124, "siteCountDefault": 1 }, "Li": { "siteCount": 7, "siteCountRank": 125, "siteCountDefault": 0 }, "Современное": { "siteCount": 4, "siteCountRank": 127, "siteCountDefault": 0 }, "Wowwiki": { "siteCount": 7, "siteCountRank": 128, "siteCountDefault": 0 }, "Векторное": { "siteCount": 4, "siteCountRank": 129, "siteCountDefault": 3 }, "Gumax": { "siteCount": 7, "siteCountRank": 130, "siteCountDefault": 0 }, "Monobook": { "siteCount": 2, "siteCountRank": 131, "siteCountDefault": 0 }, "Naturkunde": { "siteCount": 7, "siteCountRank": 132, "siteCountDefault": 6 }, "Blue Sky": { "siteCount": 3, "siteCountRank": 134, "siteCountDefault": 1 }, "CoC": { "siteCount": 6, "siteCountRank": 135, "siteCountDefault": 0 }, "Blueprint": { "siteCount": 3, "siteCountRank": 137, "siteCountDefault": 0 }, "BlueSpice": { "siteCount": 6, "siteCountRank": 138, "siteCountDefault": 0 }, "ArchLinux": { "siteCount": 5, "siteCountRank": 139, "siteCountDefault": 2 }, "Femiwiki": { "siteCount": 5, "siteCountRank": 140, "siteCountDefault": 1 }, "Snap!": { "siteCount": 6, "siteCountRank": 141, "siteCountDefault": 0 }, "DuoBook2": { "siteCount": 6, "siteCountRank": 142, "siteCountDefault": 6 }, "Kölnisch Blau": { "siteCount": 3, "siteCountRank": 143, "siteCountDefault": 0 }, "LyricsMinimal": { "siteCount": 6, "siteCountRank": 144, "siteCountDefault": 0 }, "DeepSea": { "siteCount": 6, "siteCountRank": 145, "siteCountDefault": 0 }, "K8JuniorSkin": { "siteCount": 5, "siteCountRank": 146, "siteCountDefault": 0 }, "CustisRu": { "siteCount": 5, "siteCountRank": 147, "siteCountDefault": 1 }, "Wikin": { "siteCount": 5, "siteCountRank": 148, "siteCountDefault": 0 }, "RilPoint": { "siteCount": 5, "siteCountRank": 149, "siteCountDefault": 0 }, "IPhone": { "siteCount": 5, "siteCountRank": 150, "siteCountDefault": 0 }, "AbiJuniorSkin": { "siteCount": 5, "siteCountRank": 151, "siteCountDefault": 0 }, "Moderne": { "siteCount": 4, "siteCountRank": 152, "siteCountDefault": 0 }, "NoLeftVector": { "siteCount": 5, "siteCountRank": 153, "siteCountDefault": 0 }, "SmfCurve": { "siteCount": 5, "siteCountRank": 154, "siteCountDefault": 1 }, "PureCss": { "siteCount": 5, "siteCountRank": 155, "siteCountDefault": 0 }, "K6JuniorSkin": { "siteCount": 5, "siteCountRank": 156, "siteCountDefault": 0 }, "Metin2Theme": { "siteCount": 5, "siteCountRank": 157, "siteCountDefault": 5 }, "Analyticstracking": { "siteCount": 5, "siteCountRank": 158, "siteCountDefault": 0 }, "Counter": { "siteCount": 3, "siteCountRank": 159, "siteCountDefault": 0 }, "BootstrapExtension": { "siteCount": 5, "siteCountRank": 160, "siteCountDefault": 0 }, "MonoBook2": { "siteCount": 5, "siteCountRank": 161, "siteCountDefault": 0 }, "CleanMonobook": { "siteCount": 5, "siteCountRank": 162, "siteCountDefault": 0 }, "MainJuniorSkin": { "siteCount": 5, "siteCountRank": 163, "siteCountDefault": 0 }, "Rilgrey 01": { "siteCount": 5, "siteCountRank": 164, "siteCountDefault": 0 }, "Guifi": { "siteCount": 3, "siteCountRank": 165, "siteCountDefault": 3 }, "CleanVector": { "siteCount": 5, "siteCountRank": 166, "siteCountDefault": 0 }, "Dgraph": { "siteCount": 5, "siteCountRank": 167, "siteCountDefault": 2 }, "K10JuniorSkin": { "siteCount": 5, "siteCountRank": 168, "siteCountDefault": 0 }, "Marsupi": { "siteCount": 3, "siteCountRank": 169, "siteCountDefault": 0 }, "Moderno": { "siteCount": 4, "siteCountRank": 170, "siteCountDefault": 0 }, "MIP": { "siteCount": 4, "siteCountRank": 171, "siteCountDefault": 0 }, "MonoBookFusionForge": { "siteCount": 4, "siteCountRank": 172, "siteCountDefault": 4 }, "Vector1": { "siteCount": 4, "siteCountRank": 173, "siteCountDefault": 0 }, "CavendishMWC": { "siteCount": 4, "siteCountRank": 174, "siteCountDefault": 0 }, "Moderna": { "siteCount": 4, "siteCountRank": 176, "siteCountDefault": 0 }, "GeoGebra": { "siteCount": 4, "siteCountRank": 177, "siteCountDefault": 4 }, "BlueLL": { "siteCount": 4, "siteCountRank": 178, "siteCountDefault": 1 }, "WikiToLearn": { "siteCount": 4, "siteCountRank": 179, "siteCountDefault": 4 }, "Cubun": { "siteCount": 4, "siteCountRank": 180, "siteCountDefault": 0 }, "Bootstrapskinmini": { "siteCount": 4, "siteCountRank": 181, "siteCountDefault": 0 }, "Alexandria": { "siteCount": 4, "siteCountRank": 182, "siteCountDefault": 0 }, "StealthNinja": { "siteCount": 4, "siteCountRank": 183, "siteCountDefault": 4 }, "AniMonaco": { "siteCount": 4, "siteCountRank": 184, "siteCountDefault": 1 }, "WebPlatform": { "siteCount": 4, "siteCountRank": 185, "siteCountDefault": 1 }, "Onyx": { "siteCount": 4, "siteCountRank": 186, "siteCountDefault": 0 }, "Drupal": { "siteCount": 4, "siteCountRank": 187, "siteCountDefault": 0 }, "Booty": { "siteCount": 4, "siteCountRank": 188, "siteCountDefault": 2 }, "AdSense": { "siteCount": 4, "siteCountRank": 189, "siteCountDefault": 0 }, "Andys": { "siteCount": 4, "siteCountRank": 190, "siteCountDefault": 0 }, "Fratman": { "siteCount": 4, "siteCountRank": 191, "siteCountDefault": 2 }, "Wikiade": { "siteCount": 4, "siteCountRank": 192, "siteCountDefault": 0 }, "WordPress": { "siteCount": 4, "siteCountRank": 193, "siteCountDefault": 0 }, "Bluespicediscovery": { "siteCount": 4, "siteCountRank": 194, "siteCountDefault": 4 }, "Daddio": { "siteCount": 3, "siteCountRank": 195, "siteCountDefault": 1 }, "Iswiki": { "siteCount": 4, "siteCountRank": 196, "siteCountDefault": 0 }, "MonoBook-original": { "siteCount": 4, "siteCountRank": 197, "siteCountDefault": 0 }, "DarkCosmos": { "siteCount": 4, "siteCountRank": 198, "siteCountDefault": 1 }, "Кёльнская тоска": { "siteCount": 4, "siteCountRank": 199, "siteCountDefault": 0 }, "AdSense Bottom": { "siteCount": 4, "siteCountRank": 200, "siteCountDefault": 0 }, "Grepolis Skin": { "siteCount": 4, "siteCountRank": 201, "siteCountDefault": 4 }, "Argonne": { "siteCount": 3, "siteCountRank": 202, "siteCountDefault": 0 }, "MonoBook bak": { "siteCount": 3, "siteCountRank": 203, "siteCountDefault": 0 }, "TK Skin": { "siteCount": 3, "siteCountRank": 204, "siteCountDefault": 3 }, "Studentlink": { "siteCount": 3, "siteCountRank": 205, "siteCountDefault": 0 }, "Sturmkrieg": { "siteCount": 3, "siteCountRank": 206, "siteCountDefault": 0 }, "Klaus": { "siteCount": 3, "siteCountRank": 207, "siteCountDefault": 3 }, "Beth": { "siteCount": 3, "siteCountRank": 208, "siteCountDefault": 0 }, "Vector ori": { "siteCount": 3, "siteCountRank": 209, "siteCountDefault": 0 }, "Lakeus": { "siteCount": 3, "siteCountRank": 210, "siteCountDefault": 0 }, "StellarBook": { "siteCount": 3, "siteCountRank": 211, "siteCountDefault": 0 }, "VectorIcubeTeam": { "siteCount": 3, "siteCountRank": 212, "siteCountDefault": 3 }, "Osmfoundation": { "siteCount": 3, "siteCountRank": 213, "siteCountDefault": 1 }, "Labcs": { "siteCount": 3, "siteCountRank": 214, "siteCountDefault": 0 }, "Slate": { "siteCount": 3, "siteCountRank": 215, "siteCountDefault": 1 }, "Mirlo": { "siteCount": 3, "siteCountRank": 216, "siteCountDefault": 3 }, "Clean and blue": { "siteCount": 3, "siteCountRank": 217, "siteCountDefault": 0 }, "Netbar": { "siteCount": 3, "siteCountRank": 218, "siteCountDefault": 0 }, "Fedora": { "siteCount": 3, "siteCountRank": 219, "siteCountDefault": 2 }, "Contenttranslation": { "siteCount": 3, "siteCountRank": 220, "siteCountDefault": 0 }, "Lcrc": { "siteCount": 3, "siteCountRank": 221, "siteCountDefault": 0 }, "Helena": { "siteCount": 3, "siteCountRank": 222, "siteCountDefault": 3 }, "MonoBook-test": { "siteCount": 3, "siteCountRank": 223, "siteCountDefault": 0 }, "Tribalwars": { "siteCount": 3, "siteCountRank": 224, "siteCountDefault": 2 }, "Q Author": { "siteCount": 3, "siteCountRank": 225, "siteCountDefault": 0 }, "Purple": { "siteCount": 3, "siteCountRank": 226, "siteCountDefault": 0 }, "Bootstrapmediawiki": { "siteCount": 3, "siteCountRank": 227, "siteCountDefault": 0 }, "MCS": { "siteCount": 3, "siteCountRank": 228, "siteCountDefault": 0 }, "Q Default Skin": { "siteCount": 3, "siteCountRank": 229, "siteCountDefault": 2 }, "VectorV2": { "siteCount": 3, "siteCountRank": 230, "siteCountDefault": 1 }, "Bleu de Cologne": { "siteCount": 3, "siteCountRank": 231, "siteCountDefault": 0 }, "RedIRIS": { "siteCount": 2, "siteCountRank": 232, "siteCountDefault": 2 }, "GreenSolutions": { "siteCount": 3, "siteCountRank": 233, "siteCountDefault": 0 }, "Prescient": { "siteCount": 3, "siteCountRank": 234, "siteCountDefault": 0 }, "Nostale": { "siteCount": 3, "siteCountRank": 235, "siteCountDefault": 0 }, "IndoEuropean": { "siteCount": 3, "siteCountRank": 236, "siteCountDefault": 0 }, "Chicago": { "siteCount": 3, "siteCountRank": 237, "siteCountDefault": 1 }, "Globus2": { "siteCount": 3, "siteCountRank": 238, "siteCountDefault": 0 }, "Hadron": { "siteCount": 3, "siteCountRank": 239, "siteCountDefault": 3 }, "XLKnowledge": { "siteCount": 3, "siteCountRank": 240, "siteCountDefault": 1 }, "ⓌⓞⓄⓖⓁⓔⓈⓗⓐⓓⓔⓢ": { "siteCount": 3, "siteCountRank": 241, "siteCountDefault": 1 }, "Impro": { "siteCount": 3, "siteCountRank": 242, "siteCountDefault": 0 }, "Snap! Wiki Skin": { "siteCount": 3, "siteCountRank": 243, "siteCountDefault": 0 }, "DBSSkin": { "siteCount": 3, "siteCountRank": 244, "siteCountDefault": 3 }, "Seed": { "siteCount": 3, "siteCountRank": 245, "siteCountDefault": 0 }, "Vector2": { "siteCount": 3, "siteCountRank": 246, "siteCountDefault": 0 }, "CarbonGreen": { "siteCount": 3, "siteCountRank": 247, "siteCountDefault": 1 }, "WebMedia": { "siteCount": 3, "siteCountRank": 248, "siteCountDefault": 0 }, "Freifunk": { "siteCount": 2, "siteCountRank": 249, "siteCountDefault": 0 }, "NostaleNew": { "siteCount": 2, "siteCountRank": 250, "siteCountDefault": 1 }, "Campfire": { "siteCount": 3, "siteCountRank": 251, "siteCountDefault": 0 }, "Cosmochips": { "siteCount": 3, "siteCountRank": 252, "siteCountDefault": 0 }, "Waze": { "siteCount": 3, "siteCountRank": 253, "siteCountDefault": 3 }, "科隆香水蓝": { "siteCount": 3, "siteCountRank": 254, "siteCountDefault": 1 }, "Linus": { "siteCount": 3, "siteCountRank": 255, "siteCountDefault": 3 }, "Carbon": { "siteCount": 3, "siteCountRank": 256, "siteCountDefault": 1 }, "Translatum": { "siteCount": 3, "siteCountRank": 257, "siteCountDefault": 3 }, "Naiad": { "siteCount": 3, "siteCountRank": 258, "siteCountDefault": 0 }, "Quartz": { "siteCount": 3, "siteCountRank": 259, "siteCountDefault": 0 }, "BlueSpiceLinkTank": { "siteCount": 3, "siteCountRank": 260, "siteCountDefault": 3 }, "Embed": { "siteCount": 3, "siteCountRank": 261, "siteCountDefault": 0 }, "Monospec": { "siteCount": 2, "siteCountRank": 262, "siteCountDefault": 0 }, "FedericoDark": { "siteCount": 2, "siteCountRank": 263, "siteCountDefault": 0 }, "CbpTranscription": { "siteCount": 2, "siteCountRank": 264, "siteCountDefault": 1 }, "UESP Vector": { "siteCount": 2, "siteCountRank": 265, "siteCountDefault": 0 }, "Mistylook": { "siteCount": 2, "siteCountRank": 266, "siteCountDefault": 1 }, "Stanfordmodern1": { "siteCount": 2, "siteCountRank": 267, "siteCountDefault": 1 }, "RoundedBlue": { "siteCount": 2, "siteCountRank": 268, "siteCountDefault": 1 }, "Mobile": { "siteCount": 2, "siteCountRank": 269, "siteCountDefault": 0 }, "SSP24": { "siteCount": 2, "siteCountRank": 270, "siteCountDefault": 0 }, "Copy of MonoBook": { "siteCount": 2, "siteCountRank": 271, "siteCountDefault": 0 }, "Blender": { "siteCount": 2, "siteCountRank": 272, "siteCountDefault": 0 }, "Forum": { "siteCount": 2, "siteCountRank": 273, "siteCountDefault": 0 }, "LCARS": { "siteCount": 2, "siteCountRank": 274, "siteCountDefault": 1 }, "SGuMax": { "siteCount": 2, "siteCountRank": 275, "siteCountDefault": 0 }, "Isms": { "siteCount": 2, "siteCountRank": 276, "siteCountDefault": 0 }, "モダン": { "siteCount": 2, "siteCountRank": 277, "siteCountDefault": 0 }, "Nama2": { "siteCount": 2, "siteCountRank": 278, "siteCountDefault": 0 }, "Vector-foundation": { "siteCount": 2, "siteCountRank": 279, "siteCountDefault": 0 }, "Kiwitic": { "siteCount": 2, "siteCountRank": 280, "siteCountDefault": 1 }, "Iphone": { "siteCount": 2, "siteCountRank": 281, "siteCountDefault": 0 }, "Golarion": { "siteCount": 2, "siteCountRank": 282, "siteCountDefault": 2 }, "Spin": { "siteCount": 2, "siteCountRank": 283, "siteCountDefault": 0 }, "Azul colonial": { "siteCount": 2, "siteCountRank": 284, "siteCountDefault": 0 }, "Egypt": { "siteCount": 2, "siteCountRank": 285, "siteCountDefault": 0 }, "MonoBoo-prenamechangek": { "siteCount": 2, "siteCountRank": 286, "siteCountDefault": 0 }, "Mesto": { "siteCount": 2, "siteCountRank": 287, "siteCountDefault": 2 }, "Adsense": { "siteCount": 2, "siteCountRank": 288, "siteCountDefault": 0 }, "Hacken": { "siteCount": 2, "siteCountRank": 289, "siteCountDefault": 1 }, "Shakepeers": { "siteCount": 2, "siteCountRank": 290, "siteCountDefault": 1 }, "Wrench": { "siteCount": 2, "siteCountRank": 291, "siteCountDefault": 0 }, "Hub": { "siteCount": 2, "siteCountRank": 292, "siteCountDefault": 0 }, "Expo": { "siteCount": 2, "siteCountRank": 293, "siteCountDefault": 0 }, "Vector (bac)": { "siteCount": 2, "siteCountRank": 294, "siteCountDefault": 0 }, "モノブック": { "siteCount": 2, "siteCountRank": 295, "siteCountDefault": 0 }, "Gmo": { "siteCount": 2, "siteCountRank": 296, "siteCountDefault": 0 }, "SnapHouston": { "siteCount": 2, "siteCountRank": 297, "siteCountDefault": 0 }, "Wilmaonline": { "siteCount": 2, "siteCountRank": 298, "siteCountDefault": 0 }, "Igem": { "siteCount": 2, "siteCountRank": 299, "siteCountDefault": 2 }, "Vadzimart": { "siteCount": 2, "siteCountRank": 300, "siteCountDefault": 0 }, "GrassRoots": { "siteCount": 2, "siteCountRank": 301, "siteCountDefault": 0 }, "Pilod": { "siteCount": 2, "siteCountRank": 302, "siteCountDefault": 0 }, "Caucho": { "siteCount": 2, "siteCountRank": 303, "siteCountDefault": 0 }, "Bootstrapmini": { "siteCount": 2, "siteCountRank": 304, "siteCountDefault": 0 } } } jlzdjhcy6v3ilyzed6nvlh3ep9ihcf0 Translations:Growth/Communities/How to configure the mentors' list/98/cs 1198 1747506 8364424 5795668 2026-05-03T15:27:05Z Rebulka 17532855 8364424 wikitext text/x-wiki Po zaregistrování vám systém začne přiřazovat nové mentorované. toxmvmmti3rudeywwqja5hdsdc3xtn5 Translations:Growth/Communities/How to configure the mentors' list/99/cs 1198 1747516 8364428 5795624 2026-05-03T15:27:31Z Rebulka 17532855 8364428 wikitext text/x-wiki Nováčci vás také začnou kontaktovat přímo na vaší diskusní stránce. mhglc4fogpx9ymtnh6dro5svwo94rjr Manual:Managing data in MediaWiki/nl 100 1749753 8364307 8363593 2026-05-03T12:44:46Z FuzzyBot 451990 Updating to match new version of source page 8364307 wikitext text/x-wiki <languages/> MediaWiki is ontworpen om vooral informatie is tekstvorm en afbeeldingen te beheren. Er is een beperkte hoeveelheid structuur beschikbaar: {{ll|Help:Namespaces|namespaces}}, {{ll|Help:Subpages|subpagina's}} en {{ll|Help:Categories|categorieën}} helpen om vergelijkbare pagina's te groeperen, terwijl functies zoals {{ll|Infobox|infoboxen}} en {{ll|Gallery|galerijen}} helpen om de inhoud binnen elke pagina te structureren. MediaWiki zelf biedt echter niet echt manieren om gestructureerde gegevens te beheren: gegevens die kunnen worden opgevraagd, gefilterd en in sommige gevallen kunnen worden weergegeven met visualisaties zoals tabellen, grafieken, kaarten<ref>Zie ook [[Wikimedia Maps]]</ref> en kalenders. Daarvoor bestaan er een aantal speciale [[Special:MyLanguage/Manual:Extensions|extensies]]. De volgende tabel beschrijft de extensies die de door gebruikers bewerkte gegevens kunnen opslaan in een MediaWiki-database, waar deze vervolgens kunnen worden gebruikt in een query. Dit is geen opsomming van alle functionaliteit van gestructureerde gegevens; De sectie "[[#See also|Zie ook]]" bevat andere extensies en functies die kunnen worden gebruikt voor het opslaan of weergeven van gestructureerde gegevens. {| class="wikitable" |- ! Functie ! [[File:20210702_Semantic_MediaWiki_logo_with_wordmark.png|100px]]<br/>[https://www.semantic-mediawiki.org/ Semantic MediaWiki] ! [[File:Wikibase_Suite_Vertical_2x_RGB.png|100px]]<br/>[https://wikiba.se/ Wikibase] ! [[File:Cargo logo.png|50px]]<br/>{{ll|Extension:Cargo|nsp=0}} ! {{ll|Extension:VisualData|VisualData}} !{{ll|Extension:Bucket|Bucket}} ! {{ll|Extension:NeoWiki|NeoWiki}} |- | Belangrijkste doel | Het beheren van gegevens van een MediaWiki installatie, gebaseerd op [[w:Semantic Web|Semantische Web]] standaarden. | Leveren aan [[w:Wikidata|Wikidata]] en andere bewerkbare grafiekdatabases. | Het beheren van gegevens in een MediaWiki installatie. | Het beheren van gegevens binnen een MediaWiki installatie op basis van een json-schema. |lightweight Lua interface for storing and accessing structured data on wiki pages |Knowledge management system that combines collaborative editing and a [[:en:knowledge_graph|knowledge graph]] |- | Aanpak | Gegevens (properties) worden uitgelegd binnen reguliere wikitext of met sjablonen. Met het datatype "reference" kunnen properties worden gebruikt om items te beschrijven met gebruik van statements.<ref>https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data</ref> | Eigenschappen (properties) worden gedefinieerd en gebruikt om items te beschrijven met behulp van opdrachten. | Gegevens worden opgeslagen in databasetabellen, waarbij elke tabel overeenkomt met een sjabloon. | Gegevens worden opgeslagen in een speciaal slot met json-inhoudsmodel |Data is stored in '''buckets''', which are database tables with specific columns that you can define |Schemas can be defined and applied to wiki pages, stored in a dedicated slot as JSON data. |- | Beschikbaar sinds | 2005 | 2012 | 2015 | 2022 (eerder bekend als {{ll|Extension:PageProperties|PageProperties}}) |2025 |2026 |- | Actieve installaties | circa 1000<ref>https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki</ref> | circa 100<ref>https://wikiapiary.com/wiki/Extension:WikibaseRepository</ref><ref>https://wikibase.world</ref><ref>https://addshore.com/2024/10/visualizing-wikibase-connections-using-wikibase-world/</ref> | circa 100<ref>https://wikiapiary.com/wiki/Extension:Cargo</ref> | N.v.t. (nieuwe extensie of onbekend) | | |- | Gemeenschap | 190+ ontwikkelaars<ref>https://www.openhub.net/p/smw</ref> | 172+ ontwikkelaars<ref>https://github.com/wikimedia/mediawiki-extensions-Wikibase</ref> | 63+ ontwikkelaars<ref>https://github.com/wikimedia/mediawiki-extensions-Cargo</ref> | ([[User:Thomas-topway-it|hoofdontwikkelaar]]) |[https://weirdgloop.org/discord Weird Gloop's Discord] |[https://echolot-eccch.eu/ ECHOLOT project], [https://professional.wiki/ Professinal Wiki], [https://knowledge.wiki KM-A], [https://bluespice.com/bluespice-galaxy/ BlueSpice Galaxy] |- | Opslag | MediaWiki database, Elasticsearch, 5 verschillende SPARQL winkels<ref>https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore</ref> | MediaWiki database, Elasticsearch, SPARQL store (Blazegraph voor wikidata.org) | MediaWiki database (of een aparte database)<ref>{{ll|Extension:Cargo/Download and installation#Setting the Cargo database}}</ref> | MediaWiki database |MediaWiki database (MySQL/MariaDB) |different SPARQL stores, currently Neo4J |- | Eigenschap definitie | Door het tikken van wikitext. Eigenschappen kunnen vrijelijk worden bedacht. Ze zijn standaard van het gegevenstype 'page' en kunnen later worden gedefinieerd. Datatypes kunnen altijd gewijzigd worden. | Properties (eigenschappen) moeten voor gebruik worden gedefinieerd en kunnen niet gemakkelijk worden gewijzigd.<ref>[[d:Help:Data type#Changing datatype]]</ref> | In plaats van properties te gebruiken, worden gegevenstabellen gedefinieerd met een vooraf bepaalde (maar opnieuw configureerbare) set velden per tabel. | Eigenschappen worden gedefinieerd via een of meer json-schema's gedefinieerd met een {{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}} |Tables in the Bucket: namespace |Form based schema editing |- | Waarde declaratie | Inline (<code><nowiki>[[MyProperty::MyValue]]</nowiki></code>) of met sjablonen. Formulier-gebaseerd data-invoer met {{ll|Extension:Page_Forms|Page Forms}}. | Wikibase standaard formulier-achtige invoerinterface. | Met parserfuncties in sjablonen. Formulier-gebaseerd data-invoer met {{ll|Extension:Page_Forms|Page Forms}}. | Inline of popup OOUI {{ll|Extension:VisualData/Forms|forms}} automatisch gegenereerd uit json-schema's |via Lua call of the <code>bucket.put</code> function |OOUI based form editing |- | Voorgedefinieerde data-types | 18<ref>https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes</ref> | 17<ref>[[d:Special:ListDatatypes]]</ref><ref>Sommige gegevenstypen worden gedefinieerd door een extensie: [[Special:MyLanguage/Extension:Math|Math]] en [[Special:MyLanguage/Extension:Score|Score]] beide definiëren één datatype, [[Special:MyLanguage/Extension:JsonConfig|JsonConfig]] definieert er twee, [[Special:MyLanguage/Extension:WikibaseLexeme|WikibaseLexeme]] definieert er drie, en Wikibase definieert er zelfs tien.</ref> | 18 | 4 (basis json-schema-typen) + 15 stringformaten | 5 <ref>https://meta.weirdgloop.org/w/Extension:Bucket#Basic_usage</ref> | |- | Property beheer | type definitis, constraint-schema's, concepten importeren | aangepast of importeer Wikidata concept (ontology) | In plaats van properties te gebruiken, worden gegevenstabellen gedefinieerd met een vooraf bepaalde (maar opnieuw configureerbare) set velden per tabel. | via een grafische interface ({{ll|Extension:VisualData/Schema Builder|SchemaBuilder}}) | |through a graphical interface |- | Pagina-namen en intern linken | Pagina's hebben een normale naam en er kan op naam gelinkt worden. | Paginanamen worden opgeslagen met hun Q-nummers (met labels in beschikbare talen). Er moet intern gelinkt worden aan het Q-nummer; U kunt geen koppeling maken naar een label. | Pagina's hebben een normale naam en er kan op naam gelinkt worden. | Schema's worden opgeslagen in een daarvoor bedoelde namespace en JSON-gegevens in een slot die gekoppeld is aan wiki-artikelen. JSON-gegevens kunnen worden benaderd via een extensie van de wiki-interface | |MediaWiki pages can have schemas |- | Inline queries | ja, met parserfuncties | nee (externe SPARQL queries); [[phab:T67626|gepland]]<br/>ondersteund met third-party extensie {{ll|Extension:LinkedWiki|LinkedWiki}} | ja, met parserfuncties | ja, met parserfuncties | |yes, with parser functions via the SQL store |- | Externe opvraging met een query | ja, met een API- of SPARQL-query (beschikbaar via speciale extensies zoals [[Special:MyLanguage/Extension:RDFIO|RDFIO]] en [[Special:MyLanguage/Extension:LinkedWiki|LinkedWiki]]) | ja, met SPARQL Query service | ja, met een API | ja, met een API<ref>{{ll|Extension:VisualData/API}}</ref> | API is not yet stable <ref>https://meta.weirdgloop.org/w/Extension:Bucket</ref> |yes, with an API or SPARQL endpoint |- | Resultaatindelingen <ref>"Resultaatindelingen" betekent de mogelijkheid van de wiki om gegevens (resultaten van een inline query) in verschillende indelingen weer te geven, bijvoorbeeld tabellen, kalenders, kaarten, tijdlijnen, enz.</ref> | ~ 75<ref>https://www.semantic-mediawiki.org/wiki/Help:Result_formats</ref> | geen interne weergave resultaat; gegevens kunnen weergegeven worden metː * Query Service of andere externe hulpmiddelen * met wiki gegevenstoegang via LUA (geen query ondersteuning) * {{ll|Extension:LinkedWiki}} - third-party | ~ 25<ref>{{ll|Extension:Cargo/Display formats}}</ref> | 12+ (Json, Table, Datatable, Template, Calendar, Carousel, Map, pageid, pagetitle, count, raw, Lua ) <ref>{{ll|Extension:VisualData/Result_formats}}</ref> | | |- | Ontwikkeling | [[github:SemanticMediaWiki/SemanticMediaWiki|GitHub]] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Cargo Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/VisualData Gerrit] |[[github:weirdgloop/mediawiki-extensions-Bucket|GitHub]] |[[github:ProfessionalWiki/NeoWiki|GItHub]] |- | Complementaire extensies | ~ 40<ref>{{ll|Category:Semantic MediaWiki extensions}}</ref>, e.g. {{ll|Extension:Semantic Result Formats|Semantic Result Formats}}, {{ll|Extension:Semantic Bundle|Semantic Bundle}}, {{ll|Extension:Semantic Scribunto|Semantic Scribunto}} | ~12<ref>{{ll|Category:Wikibase extensions}}</ref>, e.g. {{ll|Extension:Wikibase Repository|Wikibase Repository}}, {{ll|Extension:Wikibase Client|Wikibase Client}}, {{ll|Extension:WikibaseLexeme|WikibaseLexeme}}, [https://wikiba.se/applications/#query-service Query Service] | 2 ([[Special:MyLanguage/Extension:Page Forms|Paginaformulieren]], [[Special:MyLanguage/Extension:Page Schemas|Paginaschema's]]). Cargo biedt een deel of alle functionaliteit van Semantic MediaWiki, Semantic Result Formats, Maps, Semantic Drilldown, Semantic Compound Queries, Semantic Internal Objects en Semantic Scribunto.<ref>[[Extension:Cargo/Cargo and Semantic MediaWiki]].</ref> | {{ll|Extension:ContactManager|ContactManager}} |{{ll|Extension:Lua|Lua}} | |} <span id="Alternative_comparisons"></span> == Alternatieve vergelijkingen== * {{ll|Extension:Cargo/Cargo and Semantic MediaWiki|2=Cargo en semantische MediaWiki}} * [https://professional.wiki/en/articles/managing-data-in-mediawiki Semantic MediaWiki versus Wikibase versus Cargo] door [https://professional.wiki Professional Wiki] <span id="References"></span> == Referenties == <references/> <span id="See_also"></span> == Zie ook == * {{ll|Multi-Content Revisions}} – Mogelijkheid om verschillende onafhankelijke inhoudsobjecten op dezelfde wikipagina te beheren * {{ll|Extension:WikiDB|WikiDB}} – Biedt databasefuncties die enigszins lijken op semantische eigenschappen. * {{ll|Extension:JsonConfig|JsonConfig}} – JSON (inclusief tabel- en kaartgegevens) op te slaan in wikipagina's en toegang via Lua toe te staan; Geen query-ondersteuning * {{ll|Extension:External Data|External Data}} – toegang tot gegevens van externe URL, lokaal bestand en SQL- of MongoDB-database * {{ll|Structured data across Wikimedia}} – project (2021-2023) voor het verbeteren van gestructureerde data-ondersteuning in MediaWiki * {{ll|Category:Data management extensions}} [[Category:MediaWiki Introduction{{#translation:}}]] [[Category:Extension comparisons{{#translation:}}]] 7gmcvmfmdxmlyguxcpol1k8zcrvn9a2 Template:Update/nb 10 1795331 8364327 8364248 2026-05-03T12:47:06Z FuzzyBot 451990 Updating to match new version of source page 8364327 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |<span lang="en" dir="ltr" class="mw-content-ltr">The '''factual accuracy''' of parts of this page (those related to {{{part|{{{1|}}}}}}) '''may be compromised due to out-of-date information'''.</span> |Deler av denne siden (relatert til {{{part|{{{1|}}}}}}) er '''utdaterte'''.}} |{{#if:{{{inaccurate|}}} |<span lang="en" dir="ltr" class="mw-content-ltr">The '''factual accuracy''' of this page '''may be compromised due to out-of-date information'''.</span> |Denne siden er '''utdatert'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|Den var skrevet for en eldre utgave av MediaWiki og det kan hende at den ikke gjelder for den nyeste versjonen.}} Om du har sjekket eller oppdatert denne siden og mener den er akseptabel, fjern denne merknaden. {{#ifexist: {{TALKPAGENAME}} |&#32;Se [[{{TALKPAGENAME}}|diskusjonssiden]] for en mulig diskusjon om dette. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Siste oppdatering: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= <div lang="en" dir="ltr" class="mw-content-ltr"> Aliases of this template: </div> * {{tlx|outdated}} <div lang="en" dir="ltr" class="mw-content-ltr"> == Examples == </div> <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{tl|historical}} <div lang="en" dir="ltr" class="mw-content-ltr"> == TemplateData == </div> {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> b04j7kpqtk9995eri4o0a7o5tiu5gby Help:Extension:ParserFunctions/be-tarask 12 1802175 8365002 8353919 2026-05-04T06:19:52Z FuzzyBot 451990 Updating to match new version of source page 8365002 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span class="mw-translate-fuzzy">Пашырэньне {{ll|Extension:ParserFunctions|nsp=0}} прадастаўляе адзінаццаць дадатковых [[Special:MyLanguage/Parser functions|функцыяў аналізатара]] для падтрымкі „{{$2|магічных словаў}}“, якія ўжо існуюць у MediaWiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> (Яго ''можна'' наладзіць на стварэньне дадатковых функцыяў аналізатару працы з радкамі; такія радковыя функцыя апісаныя {{ll|Extension:ParserFunctions/String functions|ў іншым месцы}}.) Усе функцыі аналізатара, прадстаўленыя гэтым пашырэньнем, маюць такую форму: :<code><nowiki>{{</nowiki>'''#назва_функцыі''': ''аргумэнт 1'' | ''аргумэнт 2'' | ''аргумэнт 3'' … <nowiki>}}</nowiki></code> == #expr == {{for|1=падрабязьнейшы дапаможнік па тонкіх пунктах таго, як працуе ацэнвальнік выразаў, уключаючы некаторыя дадатковыя апэратары, не апісаныя тут|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Тып ! {{hl1}} | Апэратары |- | {{hl2}} | Групаваньне (дужкі) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Лічбы | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | бінарны апэратар <code>'''e'''</code> &nbsp; адзінарны <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Адзінарны | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Бінарны | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Акругленьне | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Лёгіка | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Гэтая функцыя ацэньвае матэматычны выраз і вяртае разьлічанае значэньне. Гэтая функцыя даступная таксама ў {{ll|Extension:Scribunto|nsp=0}} праз функцыю <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''выраз'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Даступныя апэратары пералічаныя справа ў парадку прыярытэту. Падрабязьней пра функцыянаваньне кожнага апэратара глядзіце {{ll|Manual:Expr parser function syntax}}. Дакладнасьць і фармат вяртанага выніку будуць залежаць ад апэрацыйнай сыстэмы сэрвэра, на якім запушчаная вікі, і ад лічбавага фармату мовы сайту. Пры разьліках [[w:boolean algebra|булевая альгебры]] нуль азначае {{phpi|false}}, а любое ненулявое значэньне, дадатнае і адмоўнае, азначае {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Пусты выраз на ўваходзе вяртае пусты радок. Хібныя выразы вяртаюць адну зь некалькіх магчымых памылак, якія можна адлавіць з дапамогай функцыі <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' Парадак даданьня і адыманьня апэрандаў да ці пасьля ліку мае значэньне і можа разглядацца як дадатнае ці станоўчае значэньне замест апэранда з памылковым уводам: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Заўважце, што калі вы карыстаецеся вывадам магічных словаў, іх трэба выкарыстоўваць без фарматаваньня, каб выдаліць коскі і перакласьці лічбы. Напрыклад, <nowiki>{{NUMBEROFUSERS}}</nowiki> вяртае {{NUMBEROFUSERS}}, дзе мы хочам {{formatnum:{{NUMBEROFUSERS}}|R}}, якую можна атрымаць праз <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Гэта асабліва істотна ў некаторых мовах, дзе лічбы перакладаюцца. <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Rounding === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Test case</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Result</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Method of rounding</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is < 5, so no apparent rounding occurs</span> (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is ≥ 5, so it is rounded up</span> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to the nearest integer</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the ''nearest'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding up or down with ''ceil'' and ''floor''</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next ''larger'' integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next ''smaller'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next larger integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next smaller integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Not rounded, since 1 already is an integer</span><br />{{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect</span>}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Strings === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: test string | value if test string is not empty | value if test string is empty (or only white space)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: first parameter | second parameter | third parameter }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''<span lang="en" dir="ltr" class="mw-content-ltr">See also:</span> [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Example: </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Year</span> |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">4-digit year.</span> | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Month</span> |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour</span> |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Minutes and seconds</span> |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">See also <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>.</span> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See also {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}.</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <span id="References"></span> == Крыніцы == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] 20tmbgfu5rryi57bq2niuj6sgftaxkx Help:Extension:Translate/Validators/zh 12 1820106 8364880 6197409 2026-05-04T04:02:52Z FuzzyBot 451990 Updating to match new version of source page 8364880 wikitext text/x-wiki <languages/> {{Extension-Translate}} <span lang="en" dir="ltr" class="mw-content-ltr">Translatable strings often contain markup that should be retained as-is in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Typing that markup can be slow and difficult because special characters are common.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Translate extension can provide translators a button clicking on which inserts the piece of markup into the translation to the current cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In addition, if a translation is missing that specific markup, the Translate extension can either warn the translator or simply reject the translation, since such markup is usually mandatory to display the messages properly to the end user.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example in the string, <blockquote>''Adapted by %{name} from a work by %{original}''</blockquote> there are two insertables - <code>%{name}</code> and <code>%{original}</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the translator does not add them to their translation, the end user using the software will not see a proper message.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>MessageValidator</code> framework has been added with the intent of helping with validating translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Validators run on the translated message and based on the configuration, a warning or error message is shown to the translator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Translations with warnings can still be saved, but ones that have error cannot.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only a user with <code>translate-manage</code> permission can save translations that have errors.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When configuring a validator, a regex is defined to identify markup that is mandatory.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The validator can also be marked as insertable, in which case a button will be displayed to the translator to add that markup into the translation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Adding a custom validators is still possible and will be needed for more specialized validations. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Configuration == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a summarized validator configuration, </div> <syntaxhighlight lang="yaml" line="1" start="1"> VALIDATORS: # Example 1 - id: InsertableRegex enforce: true insertable: true params: /\$[a-z0-9]+/ keymatch: - 'untranslated' # Matches key untranslated directly - type: 'wildcard' pattern: '*translated*' # Matches any key that has the translated in it # Example 2 - id: InsertableRegex insertable: true params: regex: /(?<pre>\[)[^]]+(?<post>\]\([^)]+\))/ display: $pre $post pre: $pre post: $post # Example 3 - class: MathJaxMessageValidator enforce: true # Example 4 - id: BraceBalance </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In the example above, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>InsertableRegex</code> is a bundled validator that can accept a custom regex and run validations.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>MathJaxMessageValidator</code> is a custom validator class.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>BraceBalance</code> is another bundled validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr"><code>VALIDATORS</code> uses an array format.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Lets look at the various parameters being used here in each array item,</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Parameters === </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Property</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> |- |id | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Incase a bundled / pre-provided validator is being used, the ID of the validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">''Required if <code>class</code> is not specified.''</span> |- |class | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">If a custom validator is being used, then use this option instead of <code>id</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Specifies the name of the validator class.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #3''' in the above config.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>AUTOLOAD</code> option can be used to load the class.</span> <span lang="en" dir="ltr" class="mw-content-ltr">''Required if <code>id</code> is not specified.''</span> |- |enforce | <span lang="en" dir="ltr" class="mw-content-ltr">boolean</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether the validator should be enforced.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If set to true, and a translation fails validation, an error will be displayed which must be fixed in order to save the translation.</span> |- |insertable | <span lang="en" dir="ltr" class="mw-content-ltr">boolean</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether the validator should also be an insertable.</span> |- |keymatch | <span lang="en" dir="ltr" class="mw-content-ltr">array</span> | <span lang="en" dir="ltr" class="mw-content-ltr">With this option it is possible to limit certain validations to certain messages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Keymatch is an array with each option being either a '''string''' or a '''prototype.''' If it is a string, a direct comparison with the message key is done.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #1''' in the above config.</span> |- |keymatch[i].type | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Type is either ''regex'' or ''wildcard''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is the approach that will be used to check if the message key matches a given pattern.</span> |- |keymatch[i].pattern | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pattern is a string that will be used for matching.</span> |- |params | <span lang="en" dir="ltr" class="mw-content-ltr">string / associative array</span> | <span lang="en" dir="ltr" class="mw-content-ltr">If <code>params</code> is specified '''as a string''', it is used as the regex.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #1'''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case if insertable is true, </div> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>display</code> is the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>pre</code> is also the first value from the regex match.</span> # <span lang="en" dir="ltr" class="mw-content-ltr"><code>post</code> is left empty.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If <code>params</code> is specified '''as an associative array (see example #2)''', see below for further details.</span> |- |params.regex | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">The regex to be used for validator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Must use named captures.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When specifying named captures, do not use the <code>$</code> symbol in the name.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In '''example #2''', two named captures are used - <code>pre</code> and <code>post</code>.</span> |- |params.display | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Mandatory value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The display value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #2'''.</span> |- |params.pre | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">The pre value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted before the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, is set to the display value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #2'''.</span> |- |params.post | <span lang="en" dir="ltr" class="mw-content-ltr">string</span> | <span lang="en" dir="ltr" class="mw-content-ltr">The post value for the insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Value inserted after the cursor position.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Named captures prefixed with $ are used here.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See '''example #2'''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If not specified, defaults to an empty string.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Pre-provided / Bundled validators === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Following is a list of bundled validators, </div> ==== BraceBalance ==== ID: <code>BraceBalance</code> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the number of open braces / brackets, matches the number of closed braces / brackets in the translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, the following translations would pass, </div> * <code><nowiki>{{ }}</nowiki></code> * <code>[ ]</code> <span lang="en" dir="ltr" class="mw-content-ltr">whereas, the following would fail,</span> * <code>[ ]]</code> * <code><nowiki>{{ }</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator cannot be marked as insertable.</span> ==== EscapeCharacter ==== ID: <code>EscapeCharacter</code> <div lang="en" dir="ltr" class="mw-content-ltr"> The validator ensures that only the specified escape character are present in a translation. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The allowed escape characters can be specified when adding the validator, and can only include, </div> * <code>\t</code> * <code>\n</code> * <code>\'</code> * <code>\"</code> * <code>\f</code> * <code>\r</code> * <code>\a</code> * <code>\b</code> * <code>\\</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> ==== GettextNewline ==== ID: <code>GettextNewline</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically for GetText based message groups. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Ensures that the translation has the same number of newlines as the source message at the beginning and end of the string. </div> ==== GettextPlural ==== ID: <code>GettextPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on GetText based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL:GETTEXT|one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== InsertableRegex ==== ID: <code>InsertableRegex</code> <div lang="en" dir="ltr" class="mw-content-ltr"> A generic reusable validator that can be used to specify custom validations and insertables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example, take the following configuration where the validator is marked as insertable and enforced, </div> <syntaxhighlight lang="yaml"> - id: InsertableRegex enforce: true insertable: true params: "/\$[a-zA-Z0-9]+/" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Given the following source message - ''Hello $name. My name is $myName.'' that is being translated, the translation must have the parameters - ''$name'' and ''$myName''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will also be displayed as insertables to make it easier for translators to use them in the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An absence of these parameters will cause an error to be displayed to the translator.</span> ==== InsertableRubyVariable ==== ID: <code>InsertableRubyVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches ruby variables in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>%{[a-zA-Z_]+}</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>%{abc}</code> ==== IosVariable ==== ID: <code>IosVariable</code> <span lang="en" dir="ltr" class="mw-content-ltr">An insertable variable validator for Ios.</span> 使用Regex [https://github.com/dcordero/Rubustrings/blob/61d477bffbb318ca3ffed9c2afc49ec301931d93/lib/rubustrings/action.rb#L91 来自此 Rubustrings 源]。 <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>%@</code> ==== MatchSet ==== ID: <code>MatchSet</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation is present in the list of values.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also takes a parameter - <code>caseSensitive</code> that can be either true (''default'') or false.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example the following configuration, the validator will validate the message with key - <code>html.dir</code> and ensure that the values for it can either be ''ltr'' or ''rtl''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note that LTR or RTL will not be valid values, since <code>caseSensitive</code> is true by default.</span> <syntaxhighlight lang="yaml" line="1" start="1"> - id: MatchSet enforce: true keymatch: - html.dir params: values: - ltr - rtl </syntaxhighlight> ==== MediaWikiLink ==== ID: <code>MediaWikiLink</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if the translation uses links that are discouraged.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Valid links are those that link to Special: pages, <code><nowiki>{{ns:special}}:</nowiki></code> or project pages trough MediaWiki messages like <code><nowiki>{{MediaWiki:helppage-url}}:</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Also links in the definition are allowed.</span> ==== MediaWikiPageName ==== ID: <code>MediaWikiPageName</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a namespace such as <code><nowiki>{{ns:project}}:hello</nowiki></code> the translations made do not try to translate the namespaces itself.</span> ==== MediaWikiParameter ==== ID: <code>MediaWikiParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This is a validator that matches wiki parameters in the translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Internally it extends <code>InsertableRegexValidator</code> and uses the following regex - <code>/\$[1-9]/</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>$1</code>, <code>$2</code>. ==== MediaWikiPlural ==== ID: <code>MediaWikiPlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a <code><nowiki>{{PLURAL:$1|message|messages}}</nowiki></code>, the translation should also have it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It can also be used as an insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has three.</span> ==== MediaWikiTimeList ==== ID: <code>MediaWikiTimeList</code> <span lang="en" dir="ltr" class="mw-content-ltr">Provides validations for expiry options and IP block options specified in the MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These are usually in the format,</span> <syntaxhighlight lang="text"> indefinite:indefinite,3 hours:3 hours,12 hours:12 hours,24 hours:24 hours,31 hours:31 hours,36 hours:36 hours,48 hours:48 hours,60 hours:60 hours,72 hours:72 hours,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,2 years:2 years,3 years:3 years,infinite:indefinite </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The validations ensure that the translations have the exact same number of key-value pairs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These validations are run only on messages with keys,</span> # protect-expiry-options # ipboptions ==== Newline ==== ID: <code>Newline</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has the same number of newlines as the source / definition message at the ''beginning of the string''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> ==== NotEmpty ==== ID: <code>NotEmpty</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that the translation has some content, and that content is not just whitespace.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> ==== NumericalParameter ==== ID: <code>NumericalParameter</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches numerical parameters by using the following regex: <code>/\$\d+/</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>$33</code>, <code>$1</code> etc. ==== Printf ==== ID: <code>Printf</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator checks for missing and unknown printf formatting characters in translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>%2$f</code>, <code>%d</code> etc. ==== PythonInterpolation ==== ID: <code>PythonInterpolation</code> <span lang="en" dir="ltr" class="mw-content-ltr">This validator matches python string interpolation variables by using the following regex: <code>/\%(?:\([a-zA-Z0-9]*?\))?[diouxXeEfFgGcrs]/U</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is insertable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <code>%s</code>, <code>%(name)s</code> ==== Replacement ==== ID: <code>Replacement</code> <span lang="en" dir="ltr" class="mw-content-ltr">Checks if a translation is using the <code>search</code> string, and instead suggests the translator to use the string mentioned under <code>replacement</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This validator is not insertable.</span> <syntaxhighlight lang="yaml" line="1"> - id: Replacement enforce: true params: search: '{{PLURAL:' replace: '{PLURAL:' </syntaxhighlight> ==== SmartFormatPlural ==== ID: <code>SmartFormatPlural</code> <div lang="en" dir="ltr" class="mw-content-ltr"> This works specifically on [https://github.com/axuno/SmartFormat SmartFormat] based message groups. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code>{1:test|tests}{0:message|messages}</code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has four.</span> ==== UnicodePlural ==== ID: <code>UnicodePlural</code> <span lang="en" dir="ltr" class="mw-content-ltr">Ensures that if the source / definition contains a plural in the format - <code><nowiki>foo {{PLURAL|one=one|many}} bar</nowiki></code>, the translation must contain it as well.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the language this also checks if the translation has the correct number of plural forms.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, English has two, but Hebrew has three.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == User interface == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The user interface has been updated to differentiate between errors and warnings.</span> [[File:Translate-validation-err-warning.png|thumb|345x345px|alt=|<span lang="en" dir="ltr" class="mw-content-ltr">A warning and error shown on top of a translation</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> During translation, if an error is noticed with the translation, the '''Save translation''' button is disabled unless the user who is translating has <code>translate-manage</code> permission. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally validation is also done on the server when the user is saving the translation.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will still allow users who have the <code>translate-manage</code> permission to save the translation even if it has errors.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Custom validators == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Certain complicated validations might still require a custom validator to be written.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Custom validators must implement the <code>MediaWiki\Extensions\Translate\Validation\MessageValidator</code> interface [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/MessageValidator.php].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Below is an example of a custom validator, </div> <syntaxhighlight lang="php" line="1" start="1"> <?php // Filename: Validator.php use MediaWiki\Extensions\Translate\Validation\MessageValidator; use MediaWiki\Extensions\Translate\Validation\ValidationIssue; use MediaWiki\Extensions\Translate\Validation\ValidationIssues; /** * My Custom Validator */ class MyCustomValidator implements MessageValidator { public function getIssues( TMessage $message, string $targetLanguage ): ValidationIssues { $issues = new ValidationIssues(); // Validation code goes here. Push ValidationIssue into the ValidationIssues. E.g.: $issue = new ValidationIssue( 'value-not-present', // type 'invalid', // sub-type 'translate-checks-value-not-present', // message key [ // message params [ 'PLAIN-PARAMS', $this->possibleValues ], [ 'COUNT', count( $this->possibleValues ) ] ] ); $issues->add( $issue ); return $issues; } } </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Also see the following classes,</span> # <code>ValidationIssues</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssues.php # <code>ValidationIssue</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssue.php <span lang="en" dir="ltr" class="mw-content-ltr">The add the custom validator in the configuration file,</span> <syntaxhighlight lang="yaml"> VALIDATORS: - class: MyCustomValidator enforce: true AUTOLOAD: MyCustomValidator: Validator.php </syntaxhighlight> 8cg0pyjzgb5jyhbql70dys8a0j0cmga Template:Update/vi 10 1833919 8364335 8364256 2026-05-03T12:47:11Z FuzzyBot 451990 Updating to match new version of source page 8364335 wikitext text/x-wiki <noinclude> <languages/> </noinclude>{{ambox | name = Update | subst = <includeonly>{{subst:substcheck}}</includeonly> | type = content | class = ambox-Update | image = [[File:Gnome-appointment-soon.svg|45px|link=]] | text = {{#if:{{{part|{{{1|}}}}}} |{{#if:{{{inaccurate|}}} |'''Độ chính xác thực tế''' của các phần của trang này (những phần liên quan đến {{{part|{{{1|}}}}}}) '''có thể bị ảnh hưởng do thông tin lỗi thời'''. |Các phần của trang này (những phần liên quan đến {{{part|{{{1|}}}}}}) đã '''lỗi thời'''.}} |{{#if:{{{inaccurate|}}} |'''Độ chính xác thực tế''' của các phần của trang này (những phần liên quan đến $2) '''có thể bị ảnh hưởng do thông tin lỗi thời'''. |Trang này đã '''lỗi thời'''.}} }} <div class="hide-when-compact" style="display:inline;">{{#if:{{{reason|}}}|{{{reason}}}|Trang này được viết cho phiên bản MediaWiki cũ hơn và có thể không áp dụng cho phiên bản mới nhất.}} Nếu bạn đã kiểm tra hoặc cập nhật trang này và thấy nội dung phù hợp, vui lòng xóa thông báo này. {{#ifexist: {{TALKPAGENAME}} |&#32;Xem [[{{TALKPAGENAME}}|trang thảo luận]] để có thể thảo luận về vấn đề này. }} {{#if:{{{date|}}}|<small>''({{{date}}})''</small>}} {{#if:{{{2|}}} |<br /><small>Cập nhật mới nhất: {{{2}}}</small> }}</div> }}<includeonly>{{#if: {{{nocat|}}}||[[Category:Outdated pages{{#translation:}}]]}}</includeonly><noinclude> {{Documentation|content= Cú pháp của bản mẫu này: * {{tlx|outdated}} <span id="Examples"></span> == Ví dụ == <pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} }} </pre> {{Update |part={{{part}}} |inaccurate={{{inaccurate}}} |reason={{{reason}}} |date={{{date}}} |2={{{2}}} |nocat=yes }} <span id="See_also"></span> == Xem thêm == * {{tl|historical}} <span id="TemplateData"></span> == Dữ liệu bản mẫu == {{Update/doc}} }} [[Category:Alert templates{{#translation:}}|{{PAGENAME}}]] [[Category:Header templates{{#translation:}}|{{PAGENAME}}]] </noinclude> 6z0mu2wjju1kd2ig6lpr1fpo4l1tk5i Talk pages project/Replying/de 0 1840583 8365061 8256365 2026-05-04T07:48:04Z ~2026-26830-81 18368164 Created page with "Hkvlgd dmn cm up wa N cz£jvla A sn bank cm bi Vn" 8365061 wikitext text/x-wiki <languages/> {{Wikimedia engineering project information | name = Diskussionsseiten | description = <span lang="en" dir="ltr" class="mw-content-ltr">Help contributors respond to comments on talk pages more easily.</span> | start = 2019-09-30 | end = | group = {{ll|Editing}} | lead = [[User:ESanders (WMF)|Ed Sanders]] | EPM = [[User:PPelberg (WMF)|Peter Pelberg]] (product), [[User:VPuffetMichel (WMF)|Valerie Puffet-Michel]] (engineering) | team = [[User:Bartosz Dziewoński (WMF)|Bartosz Dziewoński]], [[User:DChan (WMF)|David Chan]], [[User:DLynch (WMF)|David Lynch]], [[User:EAkinloose_(WMF)|Esther Akinloose]], [[User:Mvolz (WMF)|Marielle Volz]], [[User:RYasmeen (WMF)|Rummana Yasmeen]], [[User:JKlein (WMF)|Jess Klein]], [[User:Whatamidoing (WMF)|Sherry Snyder]] | Phabricator = DiscussionTools | updates = | progress = | previous = | next = | backlog = | projectpage = | display = {{{display|}}} }} <span lang="en" dir="ltr" class="mw-content-ltr">This page talks about the [[Special:MyLanguage/Editing team|Editing Team's]] work to improve contributors' workflows for replying to comments on [[:en:Help:Talk pages|talk pages]], across Wikipedia's [[w:Wikipedia:Namespace|16 talk namespaces]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">This new workflow for replying to specific comments is intended to make participating productively on talk pages easier and more intuitive for [[Special:MyLanguage/Talk pages project/Glossary|Junior]] and [[Special:MyLanguage/Talk pages project/Glossary|Senior Contributors]].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This initiative sits within our team's [[Special:MyLanguage/Talk pages project|larger effort]] to help contributors work together more effectively. To accomplish this, we will build upon existing community conventions to evolve talk pages. It is our intention to evolve talk pages in a way that gives experienced contributors more leverage to coordinate their work and connect with other editors, while making communicating on-wiki more accessible and intuitive for newer contributors. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To participate in and follow this project's development, we recommend [https://www.mediawiki.org/w/index.php?title=Talk_pages_project/Replying&action=watch adding this page to your watchlist]. We will use this page to do things like: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">''Share potential designs and ask for feedback about them''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''Test prototypes''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''Post updates about this feature's development''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''Ask and invite questions about any part of this project (e.g., measurement, deployments, etc.)''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == What it is == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The reply tool is an extra button that appears at the end of a post on a talk page. When you click on it, it opens a reply form that makes replying to that post easier to do correctly. It indents correctly, helps ping correctly, and automatically signs correctly for you, among other things. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:DiscussionTools#Reply tool}} and {{ll|Talk pages project/Feature summary#Reply tool}} (screenshots!). </div> <span id="Technical_information"></span> == Technische Informationen == <div lang="en" dir="ltr" class="mw-content-ltr"> The replying feature is implemented via the [[Special:MyLanguage/Extension:DiscussionTools|DiscussionTools extension]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Troubleshooting information is available at {{ll|Help:DiscussionTools/Why can't I reply to this comment?}} </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Status updates == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''This section contains updates about the project's development.'' </div> === {{ymd|2023|7|13}} === [[File:Dtcheck.png|alt=Screenshot of https://dtcheck.toolforge.org/|thumb|250x250px|<nowiki>https://dtcheck.toolforge.org/</nowiki>]] <div lang="en" dir="ltr" class="mw-content-ltr"> The scale of the Reply Tool's usage has grown beyond what the current architecture of [https://dtcheck.toolforge.org/dtstats.html dtcheck.toolforge.org/dtstats] can sustain. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Absent of there being a clear need for the Editing Team to invest in updating dtcheck to cope with the volume of edits people are using the Reply Tool to make, '''we will [[:en:Sunset_(computing)|sunset]] the feature on September 1, 2023'''. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Please comment on [[phab:T341821|T341821]] if you see reasons why disabling [https://dtcheck.toolforge.org/dtstats.html dtcheck] would be disruptive for you. </div> [[File:2M barnstar.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">A gold star with the number {{formatnum:2000000}}</span>|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">As of early {{date|2022|10}}, more than {{formatnum:2000000}} new comments have been posted through the Reply tool.</span>]] === {{date|2022|5|27}} === [[File:Reply Tool new comment indicator.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">A screenshot showing the design of the new comment indicator that appears in the Reply Tool when someone publishes a comment while you are drafting a reply.</span>|thumb|338x338px|<span lang="en" dir="ltr" class="mw-content-ltr">New comment indicator in the Reply Tool.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> As of 19 May, a new experience is live for the new comment indicator that appears in the Reply Tool when someone publishes a comment while you are drafting a reply. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The Editing Team would like to acknowledge [[User:BKots-WMF|Beta Kots]] for the work she did in leading the design of this improvement. </div> [[File:Badge 1m.png|alt=Star with text|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">In early April 2022, the one millionth comment was posted with the Reply tool.</span>]] === {{date|2022|3|9}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Scaling'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> On Monday, 7 March 2022, the Reply Tool became available to everyone (logged in and out) on desktop at English Wikipedia (en.wiki). ''[[phab:T296645|Details about this deployment can be found in Phabricator]].'' </div> === {{date|2022|2|18}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Scaling'' </div> <span lang="en" dir="ltr" class="mw-content-ltr">As of today, the Reply Tool is available to everyone (logged in and out) on desktop at all Wikimedia wikis except for en.wiki ([[phab:T296645|T296645]]), fi.wiki ([[phab:T297533|T297533]]), and ru.wiki ([[phab:T297410|T297410]]).</span> <span lang="en" dir="ltr" class="mw-content-ltr">''You can see the full list of what {{ll|Talk pages project}} features are available at what wikis by visiting {{ll|Talk pages project/Deployment Status}}.''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Notifications about New Comments'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The team is working on introducing functionality that will alert you, in real-time, when someone posts a new comment in the discussion you are using the Reply Tool within. ''[[Talk:Talk pages project/Replying/2022#h-Prototype_Feedback:_Automatic_Edit_Conflict_Improvements-2022-02-12T01:28:00.000Z|Instructions for how to try the prototype and share feedback about it can be found here]].'' </div> [[File:Badge 700k.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">Star with the text "700,000"</span>|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">The 700,000th use of the Reply tool happened in January 2022. By the first week of February, more than 750,000 comments had been posted with the Reply tool.</span>]] === {{ymd|2021|12|7}} === [[File:Badge 500k.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">Star with the text "500,000"</span>|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">The 500,000th use of the Reply tool happened in December 2021.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Scaling'' </div> <span lang="en" dir="ltr" class="mw-content-ltr">Today, 7 December, the Reply Tool became available by default on desktop to everyone — logged in and out – at [[Special:MyLanguage/MediaWiki|MediaWiki.org]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can try the tool on [[Talk:Talk pages project/Usability]].</span> === {{ymd|2021|11|17}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Scaling'' </div> Hkvlgd dmn cm up wa N cz£jvla A sn bank cm bi Vn === {{ymd|2021|10|29}} === [[File:450k-star.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">Star with the text "450,000"</span>|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">The 450,000th post was made in October 2021.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Scaling'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> On Monday, 25 October, the Reply Tool became available by default on desktop to everyone—logged in and out–at the [[w:fr:Wikipédia:Accueil principal|French Wikipedia]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> [[phab:T294169|Conversations are ongoing]] with volunteers about also offering the Reply Tool as an on-by-default feature at the English, Finnish, and German-language Wikipedias. </div> === {{ymd|2021|10|15}} === [[File:Convert to wikitext nudge.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">Screenshot showing new functionality that enables you to preserve text formatting when pasting content into the Reply Tool's Source mode.</span>|thumb|325x325px|<span lang="en" dir="ltr" class="mw-content-ltr">New functionality that enables you to preserve text formatting when pasting content into the Reply Tool's Source mode.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''New functionality'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Starting next week, you will gain the ability to preserve text formatting when pasting content into the Reply Tool's Source mode. </div> === {{ymd|2021|9|30}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Scaling'' </div> [[File:DTCheck.png|thumb|272x272px|<span lang="en" dir="ltr" class="mw-content-ltr">A screenshot showing "dtcheck" a tool for seeing how the Reply Tool is being used at the Wikimedia Wikis it is available at. ''More information about the tool can be on GitHub here: https://github.com/MatmaRex/dtcheck<nowiki/>.''</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> Today, 30 September, the Reply Tool became available as an on-by-default feature at all [[meta:Wikimedia wikis|Wikimedia Wikis]] ''except'' the projects listed here: </div> * {{int|project-localized-name-enwiki}} * {{int|project-localized-name-fiwiki}} * {{int|project-localized-name-frwiki}} * {{int|project-localized-name-ruwiki}} * {{int|project-localized-name-dewiki}} * {{int|project-localized-name-commonswiki}} * {{int|project-localized-name-metawiki}} * {{int|project-localized-name-mediawikiwiki}} <div lang="en" dir="ltr" class="mw-content-ltr"> In the coming weeks, we will start conversations with volunteers at the wikis listed above about the prospect of offering the Reply Tool as an on-by default feature there as well. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In the meantime, you can see how often people are using the Reply Tool to publish talk page comments by visiting https://dtcheck.toolforge.org/dtstats.html. </div> === {{ymd|2021|8|31}} === [[File:300k-star.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">A star with the text "300,000"</span>|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">By the end of August 2021, more than 300,000 comments had been posted with the Reply tool.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Scaling'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Today, 31 August, the Reply Tool became available as an on-by-default feature at 21 new Wikipedias: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Spanish (eswiki), Italian (itwiki), Japanese (jawiki), Persian (fawiki), Polish (plwiki), Hebrew (hewiki), Dutch (nlwiki), Hindi (hiwiki), Korean (kowiki), Vietnamese (viwiki), Thai (thwiki), Portuguese (ptwiki), Bengali (bnwiki), Egyptian (arzwiki), Swahili (swwiki), Chinese (zhwiki), Ukrainian (ukwiki), Indonesia (idwiki), Amharic (amwiki), Oromo (omwiki), Afrikaans (afwiki). </div> === {{ymd|2021|8|6}} === [[File:Daily Reply Tool Edits.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">A chart showing the number of edits people have used the Reply Tool to make each day.</span>|thumb|332x332px|<span lang="en" dir="ltr" class="mw-content-ltr">To date, people have used the Reply Tool to make ~250,000 edits. [https://superset.wikimedia.org/r/636 Source]</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Usage'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To date, people have used the Reply Tool to post 250,000+ talk page comments. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''New toolbar in Source mode'' </div> <span lang="en" dir="ltr" class="mw-content-ltr">Yesterday, 5 August, the Source mode toolbar that was introduced as an opt-in setting in May, became available to all people who have the Reply Tool enabled '''by default'''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note: you can still turn this toolbar off if you would like within {{ll|Help:Preferences|Special:Preferences}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Offering the Reply Tool by default at more projects'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In the coming weeks, we expect to be able to resume plans with offering the Reply Tool as a default-on feature for all users at all projects. Once the next set of wikis where the Reply Tool will be offered by default is finalized, we will post an update to this page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For context, plans to offer the Reply Tool more broadly had been stalled while we worked with the [[Special:MyLanguage/Wikimedia Performance Team|Performance]] and Data Persistence Teams on [[phab:T280599|infrastructure enhancements]] to ensure the Reply Tool continues to function as expected at this larger scale. </div> === {{ymd|2021|5|13}} === [[File:Screenshot of DiscussionTools toolbar in source.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">A screenshot showing the new toolbar that can be enabled in the Reply Tool's Source mode.</span>|thumb|320x320px|<span lang="en" dir="ltr" class="mw-content-ltr">A screenshot showing the new toolbar that can be enabled in the Reply Tool's Source mode.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''New toolbar in Source mode'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As of Tuesday, 11 May, you can enable a toolbar within the Reply Tool's Source mode. This toolbar introduces easier ways for pinging other people and inserting links into the comments you are drafting. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To start, this new mode is being offered as an '''opt-in''' preference. You can enable it by taking the following steps </div> # <span lang="en" dir="ltr" class="mw-content-ltr">Ensure you have the Reply Tool enabled</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Visit <code>Special:Preferences#mw-prefsection-editing</code></span> # <span lang="en" dir="ltr" class="mw-content-ltr">Locate the <code>Discussion pages</code> section</span> # <span lang="en" dir="ltr" class="mw-content-ltr">"Check" the checkbox next to the setting that reads: <code>Enable experimental tools in the quick replying and quick topic adding features' source modes</code></span> # <span lang="en" dir="ltr" class="mw-content-ltr">Click <code>Save</code></span> # ✅ <span lang="en" dir="ltr" class="mw-content-ltr">You are done. You should now see the new toolbar whenever you open the Reply Tool's Source mode</span> === {{ymd|2021|4|23}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''A/B test results'' </div> [[File:Reply Tool A-B test comment completion.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">Percent of Junior Contributors that completed at least one comment attempt on a talk page during the AB test.</span> |thumb|296x296px|<span lang="en" dir="ltr" class="mw-content-ltr"><nowiki>Percent of Junior Contributors that completed at least one comment attempt on a talk page during the AB test. | </nowiki>[https://wikimedia-research.github.io/Reply-tools-analysis-2021/ Source]</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> The results are in from the A/B test of the Reply Tool that ran from [[#12 February 2021|11 February]] through [[#16 March 2021|10 March]] on 22 Wikipedias. What follows are the conclusions we are drawing from these results and the steps we are taking next. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Conclusions''' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">The Reply Tool '''decreases disruption''':</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">There was a '''79.5% decrease in the revert rate''' of comments Junior Contributors made with the Reply Tool compared to comments Junior Contributors made with page editing.</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">There was no significant increase in the number of Junior Contributors who were blocked after publishing a comment with the Reply Tool</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The Reply Tool causes Junior Contributors to have '''more success publishing comments''' :</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">'''72.9% of Junior Contributors''' who opened the Reply Tool were able to publish at least one comment during the A/B test compared to 27.6% of Junior Contributors who attempted a comment using page editing. This amounts to a '''160% increase in the comment completion rate of Junior Contributors''' who used the Reply Tool during the test than those who used page editing.</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">Junior contributors using the Reply Tool are '''7.2 times more likely''' to publish a comment they start than Junior Contributors using page editing.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ''The full report can be found here: [https://wikimedia-research.github.io/Reply-tools-analysis-2021/ Reply Tool AB Test Report].'' </div> '''Nächste Schritte''' <span lang="en" dir="ltr" class="mw-content-ltr">Considering the A/B test [https://wikimedia-research.github.io/Reply-tools-analysis-2021/ has shown] the Reply Tool causes a greater percentage of Junior Contributors to publish a comment without a significant increase in disruption, we will proceed with the plan we shared in [[phab:T252057|T252057]] to begin making the Reply Tool available as an opt-out preference at all Wikimedia projects.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The sequence and timing of these deployments will be finalized in [[phab:T280388|T280388]].</span> === {{ymd|2021|3|23}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Deployments'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> 23 March, the Reply and the New Discussion Tools will be available as an opt-in beta feature at the German Wikipedia, so it will be at all [[:en:Wikipedia:Wikimedia sister projects|Wikimedia Sister Projects]] from 23 March. </div> === {{ymd|2021|3|16}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''A/B Test'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> On 10-March, the Reply Tool A/B test finished. We are now analyzing the data and expect to have results for you to review in the next four to six weeks. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Deployments'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Yesterday, 16-March, the Reply and the New Discussion Tools became available as an opt-in beta feature at the English and Russian Wikipedias and all [[:en:Wikipedia:Wikimedia sister projects|Wikimedia Sister Projects]] (except German Wikipedia). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Note: you can review how and where all {{ll|Talk pages project}} features are available here: {{ll|Talk pages project#Active initiatives}}.'' </div> === {{ymd|2021|2|12}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''A/B Test'' </div> <span lang="en" dir="ltr" class="mw-content-ltr">On 11 February, an A/B test of the Reply Tool started at 22 Wikipedias (full list [[Special:MyLanguage/Talk pages project#Active initiatives|here]]).</span> <span lang="en" dir="ltr" class="mw-content-ltr">During this test, 50% of all editors at the Wikipedias included in the test will have the Reply tool automatically enabled, and 50% will not.</span> <span lang="en" dir="ltr" class="mw-content-ltr">People at these wikis will still be able to turn the tool on or off in [[Special:Preferences]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The results of this test will help the team decide whether people benefit enough from the tool for it to ''begin'' being made available by default, at all projects.</span> <span lang="en" dir="ltr" class="mw-content-ltr">We expect to have results to share in 2-3 months.</span> === {{ymd|2021|1|22}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Engagement metrics'' </div> [[File:Junior Contributor Reply Tool and full page edit completion rate.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Completion rates for comments made with the Reply tool and full-page wikitext editing. ''Details and limitations are in this [https://nbviewer.jupyter.org/github/wikimedia-research/Discussion-tools-analysis-2020/blob/master/Engagement-Metrics/Reply-Tool-Workflow-Engagement-Metrics.ipynb#Reply-Tool-(Wikitext-and-VE)-vs-Full-Page-Wikitext report].''</span>|266x266px]] <div lang="en" dir="ltr" class="mw-content-ltr"> On 5 January 2021, the team completed an analysis of the first ~2.5 months of Reply Tool usage at the three wikis where it is available by default (Arabic, Czech and Hungarian). The findings are encouraging, tho not conclusive considering the limited sample size. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A notable finding from this analysis: the '''edit completion rate for Junior Contributors using the Reply Tool is 4x higher''' than the edit completion rate for people using full-page wikitext editing. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''You can review these findings in more detail by reading the [[#Metrics|Metrics]] section below and/or reviewing the full report: [https://nbviewer.jupyter.org/github/wikimedia-research/Discussion-tools-analysis-2020/blob/master/Engagement-Metrics/Reply-Tool-Workflow-Engagement-Metrics.ipynb#Reply-Tool-(Wikitext-and-VE)-vs-Full-Page-Wikitext Reply Tool workflow engagement metrics].'' </div> === {{ymd|2020|12|17}} === <div lang="en" dir="ltr" class="mw-content-ltr"> Completion rates for comments made with the Reply tool and full-page wikitext editing. Details and limitations are in this [https://nbviewer.jupyter.org/github/wikimedia-research/Discussion-tools-analysis-2020/blob/master/Engagement-Metrics/Reply-Tool-Workflow-Engagement-Metrics.ipynb#Reply-Tool-(Wikitext-and-VE)-vs-Full-Page-Wikitext report]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''A/B Test'' </div> <span lang="en" dir="ltr" class="mw-content-ltr">We have decided the key metric we will use to compare the A/B test's <code>control</code> and <code>test</code> groups will be the rate at which people in either group publish the comments they initiate.</span> <span lang="en" dir="ltr" class="mw-content-ltr">''More information in can be found in the [[#Metrics|Metrics]] section below and in Phabricator here: [[phab:T252057|T252057]].''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> It is important to note that we are '''not considering''' notable ''positive'' changes in the rates at which people start and continue participating on talk pages as well as the rates at which people are participating on talk pages in disruptive ways as prerequisites for the Reply Tool being made available to all people, at all wikis, as an opt-out user preference. We've come to think this for the following reasons: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Evidence ''to date'' suggests the Reply Tool is having the intended short-term impact: Junior and Senior Contributors have an easier time participating in existing conversations.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">We assume notable changes in the rates at which people start and continue participating on talk pages will likely get expressed over a longer period of time (read: they will not be detectable during the course of the upcoming A/B test).</span> === {{ymd|2020|12|2}} === [[File:50K Edit Star.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">A barnstar</span>|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">By the end of November 2020, more than 50,000 replies had been posted with the Reply tool.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Measuring engagement'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The team is analyzing the Reply Tool usage data from the Arabic, Czech and Hungarian Wikipedias, where the tool has been available as an opt-out feature since 24-September-2020. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This analysis will help us determine whether people, across experience levels, are having success using the Reply Tool and whether people are using the tool in ways that disrupts others. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> We will post the results of this analysis in the [[#Metrics|Metrics]] section below (see: "'''Analysis 2: Engagement'''"). You can expect these results to be posted no later than January, 2021. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Evaluating impact'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The team is preparing to run an A/B test to evaluate the impact the Reply Tool has had on how people use talk pages. This test will help the team decide whether we should move forward with plans to offer the tool to all people, at all wikis, as an opt-out user preference. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> More details about the test can be found in the [[#Metrics|Metrics]] section below (see: "'''Analysis 3: Impact'''"). </div> === {{ymd|2020|11|4}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Deployment planning'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Today, 4-November, the Reply Tool became available as an ''opt-in'' Beta Feature at an additional ~250 Wikipedias. This means the Reply Tool is now available as either a Beta Feature or opt-out user preference at all Wikipedias '''except''' for the following projects: English, Finnish, Gan, German, Inuktitut, Kazakh, Kurdish, Russian, Tajik, and Uzbek. </div> === {{ymd|2020|10|28}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Deployment planning'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In the coming weeks, we are planning to offer the Reply Tool as an ''opt-in'' Beta Feature at all remaining Wikipedias '''except''' for the following projects: English, Gan, German, Inuktitut, Kazakh, Kurdish, Russian, Tajik, and Uzbek. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An exact date has not yet been set. Once it has, we will announce it on this page and in [[metawiki:Special:MyLanguage/Tech/News|Tech/News]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Note: the above was also mentioned in this week's Tech/News. See: [[metawiki:Special:MyLanguage/Tech/News/2020/44|Tech/News/2020/44]].'' </div> === {{ymd|2020|10|16}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Deployment'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> On Wednesday, 14-October, the Reply Tool became available as an opt-in Beta Feature at an additional 30 projects. The objective of this deployment is to ensure the Reply Tool is usable and useful for editors at Wikipedias that write in languages/scripts with unique characteristics (e.g. long words, unusual font sizing, many diacrtics, rare fonts, etc.). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''The full list of projects where the Reply Tool is currently available can be found here: {{ll|Talk pages project#Active initiatives}}.'' </div> === {{ymd|2020|9|25}} === [[File:25K Edit Star.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">As of September 2020, more than 25,000 comments have been posted with the Reply tool.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Deployment'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> On Thursday, 24-September, the Reply Tool became available to ''all users'' (logged in and out) at the following Wikipedias: Arabic, Czech and Hungarian. This deployment marks the first time the tool is available to people who have not enabled the feature in Beta Features or appended <code>?dtenable=1</code> to the URL of the talk page they are viewing. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The primary goal of this deployment is to understand whether contributors, across experience levels, are having success using the feature and finding it valuable. ''You can find more details about how we think about the deployment process here: [[#Step 3: User Preference (opt-out)|Deployment process]].'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> You can see the kinds of edits people at the Arabic, Czech and Hungarian Wikipedias are making with the Reply Tool by filtering [[Special:MyLanguage/Help:Recent changes|Recent Changes]]: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Arabic: https://w.wiki/dgV</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Czech: https://w.wiki/dT7</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Hungarian: https://w.wiki/dT6</span> === {{ymd|2020|9|14}} === [[File:Reply Tool- custom edit summary implementation.png|thumb|275x275px|<span lang="en" dir="ltr" class="mw-content-ltr">'''Custom edit summary implementation'''</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Custom edit summaries'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> By the end of Thursday, 17-September-2020, anyone using the Reply Tool on a production wiki will be able to customize the edit summary that accompanies the comments they post with the Reply Tool. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This functionality can be accessed by clicking the <code>Advanced</code> link that will appear beneath the text input area (see the "Custom edit summary implementation" screenshot). </div> === {{ymd|2020|8|28}} === [[File:Reply Tool custom edit summary.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">A screenshot showing an approach for incorporating custom edit summary functionality into the Reply Tool.</span>|thumb|238x238px|<span lang="en" dir="ltr" class="mw-content-ltr">'''Custom edit summary design:''' a screenshot showing an approach for incorporating custom edit summary functionality into the Reply Tool.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Custom edit summaries'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Inspired by the feedback volunteers have shared <sup>[[Talk:Talk pages project/Replying/2020/06#h-Does_not_show_or_offer_to_change_the_edit_summary-2020-06-01T16:30:00.000Z|[i]]][[Talk:Talk pages project/Replying/2020/06#h-V2_Feedback:_Pelagic-2020-06-02T21:57:00.000Z|[ii]]][[Talk:Talk pages project/Replying/2020/07#h-Allow_to_change_edit_summary-2020-07-17T15:44:00.000Z|[iii]]][[Talk:Talk pages project/Replying/2020/08#h-Edit_summary-2020-08-23T18:54:00.000Z|[iv]]]</sup>, the Reply Tool will soon offer people the ability to customize the edit summaries that accompany comments posted with it. </div> <span lang="en" dir="ltr" class="mw-content-ltr">As part of implementing the custom edit summary functionality, we created a technical prototype.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">The prototype linked above implements – what we currently understand to be – the core custom edit summary functionality. It intentionally is <u>not opinionated</u> about interface polish/presentation.</span> </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> You can try the prototype by visiting this page: https://patchdemo.wmflabs.org/wikis/23fd7e0b373b74aceaf8ddec1d82ab09/w/index.php/Talk:Main_Page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If there are comments and/or questions that the prototype brings to mind, we would value you sharing them on the talk page here: [[Talk:Talk pages project/Replying/2020/08#h-Prototype:_custom_edit_summaries-2020-08-27T02:18:00.000Z]]. </div> === {{ymd|2020|8|7}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Deployment'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">On 6-August-2020, the Reply Tool became available as a Beta Feature at the following Wikipedias: Catalan, Chinese, Czech, Georgian, Korean, Serbian, Sorani Kurdish and Swedish.</span> === {{ymd|2020|7|31}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Metrics'' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">Earlier this week, the team completed an analysis that looked at how people on our four partner wikis have used the Reply tool between 31-March-2020 and 30-June-2020.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">The key question we were trying to answer with this analysis was: ''Do the people who have tried the tool find it valuable?''</span> *<span lang="en" dir="ltr" class="mw-content-ltr">In summary, we are confident that people who tried the Reply tool do find the tool valuable.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * ''You can read more detail about this analysis in the [[#Metrics|Metrics]] section below.'' </div> === {{ymd|2020|7|22}} === [[File:A screenshot comparing versions of visual mode's toolbar.png|thumb|362x362px|<span lang="en" dir="ltr" class="mw-content-ltr">A screenshot comparing two locations of the visual mode's text tools.</span>]] *<span lang="en" dir="ltr" class="mw-content-ltr">Metrics: the team is analyzing how people on our partner wikis have used the Reply Tool between 31-March-2020 and 30-June-2020. You can expect findings to be posted in the [[#Metrics|Metrics]] section below in the next two weeks.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Refinements: in response to the [[#Version 2.0 prototype|usability tests]] we ran in June, the team is working on a series of refinements/enhancements to the tool. These are listed below along with the conversations where we are discussing these enhancements:</span> **<span lang="en" dir="ltr" class="mw-content-ltr">Support for custom edit summaries: [https://www.mediawiki.org/w/index.php?title=Talk%3ATalk%20pages%20project/Replying/2020/04#c-PPelberg_%28WMF%29-2020-07-15T23%3A17%3A00.000Z-PPelberg_%28WMF%29-2020-06-26T23%3A57%3A00.000Z Talk:Talk pages project/Replying/2020/04#h-Design_feedback:_version_2.0_mockups-2020-04-04T00:15:00.000Z].</span> **<span lang="en" dir="ltr" class="mw-content-ltr">Adjustments to the toolbar: [[Talk:Talk pages project/Replying/2020/07#h-Adjustments_to_visual_mode's_toolbar-2020-07-17T01:12:00.000Z]]</span> === {{ymd|2020|6|26}} === [[File:TalkPages-Reply-v2.0.png|thumb|420x420px|<span lang="en" dir="ltr" class="mw-content-ltr">'''Mockup:''' this mockup shows a proposed design for version 2.0 of the new Replying feature. To see the design that has currently been implemented see the "Design" section below: [[#Version%201.0|#Version 1.0]].</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 2.0 usability test findings'' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">To evaluate whether the new features introduced in version 2.0 of the Replying tool are intuitive to Junior and Senior Contributors, we ran two usability tests that asked test participants to complete a series of tasks.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">These test findings are now available for you to review: [[#Version 2.0 prototype (usertesting.com + mediawiki.org)|Version 2.0 prototype (usertesting.com + mediawiki.org)]].</span> === {{ymd|2020|6|17}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 2.0 deployment'' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">Today, 17-June-2020, [[#Version 2.0|Version 2.0]] of the Reply tool became available in the following places:</span> **<span lang="en" dir="ltr" class="mw-content-ltr">Version 2.0 is now available as a Beta Feature on our partner Wikipedias (Arabic, Dutch, French and Hungarian).</span> **<span lang="en" dir="ltr" class="mw-content-ltr">Version 2.0 is now available for testing on all wikis by adding the following parameter to any talk page URL: <code>?dtenable=1</code>.</span> === {{ymd|2020|6|5}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 2.0 testing and deployment'' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">Usability tests being run on MediaWiki.org, at usertesting.com and on our four partner Wikipedias (Arabic, Dutch, French and Hungarian) are ongoing.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Once these tests are complete, findings will be summarized and posted to the [[#Usability testing|Usability testing]] section below.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 1.0 deployment'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">[[#Version%201.0|Version 1.0]] of the tool is now available for testing as a Beta Feature on [[Special:MyLanguage/MediaWiki|MediaWiki.org]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">To turn it on, visit [[Special:Preferences|Beta Features]] in your preferences and make sure the box next to "Discussion tools" is checked (☑️).</span> === {{ymd|2020|5|26}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 2.0 testing'' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">'''Version 2.0 of the Reply tool is ready for testing'''. It introduces functionality for pinging other people by typing @ and writing and styling comments in a new visual mode.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">You can find instructions for how to try the new version of the Reply tool here: [[Talk pages project/replying/prototype testing#Reply_tool_version_2.0|'''Version 2.0 test instructions''']].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 2.0 deployment'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">As of today, Version 2.0 of the Reply tool is available to everyone at our partner Wikipedias (Arabic, Dutch, French and Hungarian) via a custom URL.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">To try Version 2.0 of tool at these wikis, add the following text to any URL where the Reply tool is already available: <code>?dtvisual=1</code>.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Once we have evidence this new version is working as expected, it will become available as a Beta Feature on our partner wikis.</span> === {{ymd|2020|5|1}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 1.0 deployment'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">For ~4 weeks, [[#Version%201.0|Version 1.0]] of the new Replying tool has been available as a Beta Feature on our partner wikis.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">In line with [[#Step 2: Beta Feature|Step 2]] of our [[#Deployment|deployment process]], we have been focused on making sure the Reply tool is available on pages where discussions happen ''outside'' of talk namespaces. To this end...</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">You can now use the Reply tool on any page where the <code><nowiki>__NEWSECTIONLINK__</nowiki></code> syntax is present.</span> *** <span lang="en" dir="ltr" class="mw-content-ltr">''This means people can now use the Reply tool on pages like Dutch Wikipedia's [[:nl:Wikipedia:De_kroeg|The Pub]]. You can see the comments people are posting there by reviewing these [https://nl.wikipedia.org/wiki/Speciaal:RecenteWijzigingen?hidebots=1&hidecategorization=1&hideWikibase=1&tagfilter=discussiontools-reply&limit=500&days=14&urlversion=2 Recent Changes].''</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">Within the next week, the Reply tool will be available on in all namespaces where the [[Special:MyLanguage/Manual:$wgExtraSignatureNamespaces|Signature button]] is present.</span> *** <span lang="en" dir="ltr" class="mw-content-ltr">''This will mean you can use the Reply tool on pages without needing the "New section" tab to be available as well. This will be especially helpful on pages like French Wikipedia's [[:fr:Wikipédia:Le_Bistro|Le Bistro]], where conversations are transcluded from other pages.''</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">You can now use the Reply tool to reply to comments transcluded from another page.</span> *** <span lang="en" dir="ltr" class="mw-content-ltr">This means it is now possible to use the Reply tool on pages like the Dutch Wikipedia's page for discussing article deletions ([[:nl:Wikipedia:Te_beoordelen_pagina's|Wikipedia:Te_beoordelen pagina]]).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 2.0 development'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Our two areas of focus right now related to Version 2.0 are: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">Implementing an easy way to @-mention/ping other people.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Making it possible to switch back and forth between the source and visual text input modes.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Thank you to [[User:Pbsouthwood|Pbsouthwood]], [[User:Pelagic|Pelagic]], [[User:Samat|Samat]] and [[User:TheDJ|TheDJ]] for the efforts you have made offering [[Talk:Talk pages project/Replying/2020/04#h-Design_feedback:_version_2.0_mockups-2020-04-04T00:15:00.000Z|design feedback]] about the [[#Version 2.0|version 2.0 mockups]].'' </div> === {{ymd|2020|4|3}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 2.0 designs'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">We have designs ready for [[#Version%202.0|Version 2.0]] of the new Replying tool that we would value your feedback on.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">If you have any thoughts or questions, please post them on the talk page here: [[Talk:Talk pages project/Replying/2020/04#h-Design_feedback:_version_2.0_mockups-2020-04-04T00:15:00.000Z|Design feedback: version 2.0 mockups]].</span> === {{ymd|2020|3|31}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 1.0 deployment'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Today, [[#Version 1.0|Version 1.0]] of the new Replying tool became available as a Beta Feature on the following [[Special:MyLanguage/Talk pages project/Glossary|partner wikis]]: '''Arabic''', '''Dutch''', '''French''' and '''Hungarian'''.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">To ensure the new tool works in ways people expect, we will work together with volunteers at these four Wikipedias over the next couple of weeks to monitor how the feature is being used before deciding deploying it to more people on these as an opt-out user Preference.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">You can learn more about our deployment process below: [[#Step%202:%20Beta%20Feature|Deployment process]].</span> === {{ymd|2020|3|26}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 1.0 deployment'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Version 1.0 of the Replying feature is currently being tested. Assuming the QA process does not surface any critical issues, the new replying tool will be available as a [[Special:MyLanguage/Beta Features|Beta Feature]] on the Arabic, Dutch, French and Hungarian Wikipedias as soon as next week.</span> === {{ymd|2020|3|13}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 1.0 deployment'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">The deployment of the new replying workflow as a [[Special:MyLanguage/Beta Features|Beta Feature]] on Arabic, Dutch, French and Hungarian Wikipedias will be '''delayed for an unspecified amount of time'''. The team will share an update on this page as soon as a new date is set.</span> === {{ymd|2020|3|12}} === <div lang="en" dir="ltr" class="mw-content-ltr"> '''Active''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 1.0 deployment'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">On '''Monday, 16-March-2020''', the team is planning to deploy Version 1.0 of the new workflow for replying to specific comments on talk pages as a [[Special:MyLanguage/Beta Features|Beta Feature]] on the following Wikipedias: Arabic, Dutch, French and Hungarian.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">You can read more about how this deployment decision was made below: [[#Deploying%20Version%201.0%20as%20a%20Beta%20Feature%20to%20partner%20wikis|Deploying Version 1.0 as a Beta Feature to partner wikis]].</span> * <span lang="en" dir="ltr" class="mw-content-ltr">If there are issues you think should be fixed that have not yet been prioritized, please mention something on the talk page: [[Talk:Talk pages project/replying]].</span> ''<span lang="en" dir="ltr" class="mw-content-ltr">Note: the team is especially interested in links to examples where using the Replying tool disrupts content elsewhere on the talk page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This Phabricator task is a good example of the kind of "disruption" we have in mind: [[phab:T246481]].</span>'' <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 2.0 development'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">The team continues to develop the new functionality that will be introduced in [[#Version%202.0|Version 2.0]]. Functionality like drafting comments using a rich text/visual editing mode.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Recently completed''' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">''Version 1.0 instrumentation'': The team recently completed implementing and testing the instrumentation that will help them evaluate whether contributors are having success using the new Replying feature and whether contributors are using the tool in ways that could be negatively impacting the experience of others.</span> === {{ymd|2020|2|28}} === <div lang="en" dir="ltr" class="mw-content-ltr"> '''Active''' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">''Version 1.0 deployment:'' The team is working to resolve the highest priority issues that surfaced during the initial deployment. Once this is complete, the feature will be deployed as a [[Special:MyLanguage/Beta Features|Beta Feature]] to four target Wikipedias: [[:ar:الصفحة_الرئيسية|Arabic]], [[:nl:Hoofdpagina|Dutch]], [[:fr:Wikipédia:Accueil_principal|French]], and [[:hu:Kezdőlap|Hungarian]]. Before this happens, contributors to these wikis will be notified.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''Version 2.0 designs:'' The team is working on the designs for version 2.0. You can see an early iteration of the designs here: [[#Version 2.0]].</span> ** ''<span lang="en" dir="ltr" class="mw-content-ltr">Note: the team will formally ask for feedback on these designs in the coming weeks by starting a new discussion thread on the [[Talk:Talk pages project/replying|talk page]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Although, if you have feedback to share before then, the team would value you sharing it on the [[Talk:Talk pages project/replying|talk page]]''.</span>'' <div lang="en" dir="ltr" class="mw-content-ltr"> '''Recently completed''' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">''Version 1.0 deployment:'' on '''Tuesday, 18-February''', Version 1.0 of the feature became live via a custom URL for testing in production, on four Wikipedias: Arabic, French, Dutch and Hungarian.</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">We, along with many of you (thank you!), have been testing the feature extensively to make sure it appears where it should and behaves how we expect. You can read and add to the conversations where people are sharing feedback in these places: [[Talk:Talk pages project/replying|MediaWiki]], [[:ar:ويكيبيديا:الميدان/تقنية#%D8%A3%D8%AF%D8%A7%D8%A9_%D8%A7%D9%84%D8%B1%D8%AF%D8%8C_%D8%B5%D9%81%D8%AD%D8%A7%D8%AA_%D8%A7%D9%84%D9%86%D9%82%D8%A7%D8%B4|Arabic Wikipedia]], [[:nl:Wikipedia:De_kroeg#Update_on_new_Discussion_Tools|Dutch Wikipedia]], [[:fr:Discussion_Projet:Outils_de_discussion|French Wikipedia]] and [[:hu:Wikipédia:Konzultáció_a_vitalapokról_és_a_közösségi_kommunikációról|Hungarian Wikipedia]].</span> *<span lang="en" dir="ltr" class="mw-content-ltr">''Deployment status and process'': the team published information about why, how and where the Replying feature is and will be deployed here: [[#Deployment]].</span> === {{ymd|2020|2|17}} === <div lang="en" dir="ltr" class="mw-content-ltr"> '''Active''' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">''Version 1.0 deployment:'' this week, the team will deploy version 1.0 of the new replying workflow to the first set of production Wikipedias (Arabic, Dutch, French and Hungarian). For the time being, the new feature will only be accessible using a [[:en:Query_string|custom URL]]. This way, the team can safely test the feature without impacting anybody else's experience. If this testing goes well, the feature will then be deployed as an opt-in [[Special:MyLanguage/Beta Features|Beta Feature]].</span> *<span lang="en" dir="ltr" class="mw-content-ltr">''Version 2.0'': the team is working on the design of the next iteration of the feature. If you would like to review and add your feedback on the latest design, please review this {{ll|Phabricator}} task: [[phab:T235593|T235593]].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Recently completed''' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Finalized the list of features that will be included in the next iteration of the feature. You can review the list of features that are planned here: [[#Versions]].</span> === {{ymd|2020|1|24}} === <div lang="en" dir="ltr" class="mw-content-ltr"> '''Active''' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Finishing development of version 1.0 ahead of the team's planned deployment of the new replying workflow to four wikis, beginning as an opt-in [[Special:MyLanguage/Beta Features|Beta Feature]], in mid- to late-February.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Adding instrumentation to the new replying workflow. This will enable the team to measure how contributors are engaging with the workflow once it is deployed and determine whether adjustments need to be made to make it more intuitive.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Recently completed''' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Finalized the user interface for version 1.0 of the feature, including how real time previewing will look and function. You can see a mockup for what it will look like once version 1.0 of the feature is deployed here: [[:File:New replying mockup (v1.0).png|File:New replying mockup (v1.0)]].</span> ==={{ymd|2019|12|17}}=== <div lang="en" dir="ltr" class="mw-content-ltr"> '''Active''' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">''Prototype:'' the team is running an on-wiki user test of version 1.0 of the prototype. We would value you trying it out! To try the prototype and participate in the test, please visit: [[Special:MyLanguage/Talk pages project/replying/prototype testing#Version 1.0 prototype test|'''Prototype version 1.0 usability test''']]</span> *<span lang="en" dir="ltr" class="mw-content-ltr">''Measurement:'' the team is drafting a plan for how we intend to measure the quantitative impact of the improved workflow for replying to specific comments.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Recently completed''' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">''User testing:'' the team recently completed two user tests. Both tests involved people familiar with Wikipedia and who have little or no experience participating on Wikipedia talk pages. The first test was meant to identify the challenges people face when trying to participate on talk pages using the existing experience. The second test is meant to identify usability issues with version 1.0 of the prototype for the improved workflow for replying to specific comments. Read more about these tests below: [[#User testing|'''User testing''']].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Objectives == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This work is intended to make participating ''productively'' on talk pages easier and more intuitive for contributors. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Easier" means more experienced contributors can participate in existing discussions with less effort, and "intuitive" means newer contributors do not need specialized knowledge to figure out how to add their thoughts to a conversation. Said in a different way: as a result of this work, both newer and more experienced contributors should report the workflow for participating in existing discussions to be "obvious" and "approachable." </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is important to note the mention of "participating productively" in the first paragraph of this section. We appreciate it is not enough to build tools that simply encourage contributors to "talk more"; they need to encourage people to work together to help improve the project they are discussing. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> While we are still defining how to measure the impact of this feature, a key part of this work will involve figuring out how to understand the impact this new affordance has had on the quality of discussions on the talk pages it is deployed to. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Impact == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''This section discusses the three quantitative analyses we have planned to evaluate the usefulness, usability and impact of the Reply Tool. These analyses are discussed in detail below.'' </div> <onlyinclude> <div lang="en" dir="ltr" class="mw-content-ltr"> === Analysis 3: Impact === </div> [[File:Reply Tool A-B test comment completion.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">Percent of Junior Contributors that completed at least one comment attempt on a talk page during the AB test.</span> |thumb|296x296px|<span lang="en" dir="ltr" class="mw-content-ltr"><nowiki>Percent of Junior Contributors that completed at least one comment attempt on a talk page during the AB test. | </nowiki>[https://wikimedia-research.github.io/Reply-tools-analysis-2021/ Source]</span>]] [[File:Reply Tool A-B test revert rate.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">The percent of comments made by Junior Contributors on talk pages that were reverted within 48 hours of being published.</span>|thumb|299x299px|<span lang="en" dir="ltr" class="mw-content-ltr"><nowiki>The percent of comments made by Junior Contributors on talk pages that were reverted within 48 hours of being published. | </nowiki>[https://wikimedia-research.github.io/Reply-tools-analysis-2021/ Source]</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> In this last analysis, we sought to learn two things: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">Does the Reply Tool cause Junior Contributors to be more successful publishing comments on talk pages?</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Does the Reply Tool cause more disruption to other volunteers?</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To answer the questions above, we ran an A/B test of the Reply Tool from [[#12 February 2021|11 February]] through [[#16 March 2021|10 March]] on 22 Wikipedias. The results from this test can be found in the "Findings" section below. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Timing'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This analysis was completed on 23-April-2021. The A/B test ran from 11-Febraury-2021 through 10-March-2021. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Conclusions'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The clear evidence that shows the Reply Tool causes a greater percentage of Junior Contributors to publish a comment without a significant increase in disruption, signals to the team that it would benefit all Wikimedia Projects and volunteers to have the Reply Tool made available as an opt-out preference. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Findings'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The data below included logged-in users who had not previously interacted with the Reply Tool (defined as users whose <code>discussiontools-editmode</code> preference was empty). </div> *<span lang="en" dir="ltr" class="mw-content-ltr">'''72.9% of Junior Contributors''' who had access to the Reply Tool were able to publish at least one comment during the A/B test compared to 27.6% of Junior Contributors who did NOT have access to the Reply Tool.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Junior contributors were '''7.2 times more likely''' to publish a comment than junior contributors using page editing.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">There was a '''79.5% decrease in the revert rate''' of comments Junior Contributors made with the Reply Tool compared to comments Junior Contributors made with page editing.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Report'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> You can review the full analysis results here: https://wikimedia-research.github.io/Reply-tools-analysis-2021/<nowiki/>/. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Analysis 2: Engagement === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The next analysis we did was needed to help determine whether people, across experience levels, were having success using the Reply Tool and whether people were using the tool in ways that degrades the experiences of others. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This analysis's findings were used to decide whether the Reply Tool is functioning well enough for its impact on user behavior to be tested via a larger-scale (read: at wikis beyond our partner wikis) A/B test. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Timing'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This analysis was completed on 5-January-2021 </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Conclusions'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The high rate at which people who used the Reply Tool to publish the comments they started writing, combined with the lack of clear evidence of disruption, led the team to think the Reply Tool was ready to be tested at a larger scale via an A/B test. More details below. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Findings'' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">The edit completion rate for Junior Contributors using the Reply Tool is 4x higher than the edit completion rate for people using full-page wikitext editing. [https://nbviewer.jupyter.org/github/wikimedia-research/Discussion-tools-analysis-2020/blob/master/Engagement-Metrics/Reply-Tool-Workflow-Engagement-Metrics.ipynb#Reply-Tool-(Wikitext-and-VE)-vs-Full-Page-Wikitext Source]</span> *<span lang="en" dir="ltr" class="mw-content-ltr">People who have made <1,000 cumulative edits, are between 32% and 510% more likely to publish edits with the Reply Tool (across modes) than they are with full page wikitext talk page editing. [https://nbviewer.jupyter.org/github/wikimedia-research/Discussion-tools-analysis-2020/blob/master/Engagement-Metrics/Reply-Tool-Workflow-Engagement-Metrics.ipynb#Reply-Tool-(Wikitext-and-VE)-vs-Full-Page-Wikitext Source]</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><1% of comments Junior Contributors post with the Reply Tool are reverted within 48 hours, across wikis (this number is higher for Senior Contributors ). [https://nbviewer.jupyter.org/github/wikimedia-research/Discussion-tools-analysis-2020/blob/master/Engagement-Metrics/Reply-Tool-Workflow-Engagement-Metrics.ipynb#By-Wiki-and-Experience-level Source]</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Analysis 1: Adoption === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In this first analysis, we sought to learn whether people at the Arabic, Dutch, French and Hungarian Wikipedias, where the Reply Tool had been available as a Beta Feature since 31-March-2020, were finding the tool valuable. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To determine the extent to which people were "finding the tool valuable" we looked at how frequently people were using the tool (as measured by the number of distinct days they use it on) and how intensely people were using the tool (as measured by the total number of edits they make with the Reply Tool and the percentage of total talk page edits they used the Reply Tool to make). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Understanding the above helped us determine the tool was ready to be made available as an opt-out feature at these wikis and made available as an opt-in Beta Feature at others. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Timing'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This analysis was completed on 28-July-2020. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Findings'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The data below included people who have used the Reply Tool as a Beta Feature at the Arabic, Dutch, French and Hungarian Wikipedias, between 31-March and 30-June-2020: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">'''328 people''' posted at least one comment using the Reply Tool</span> *<span lang="en" dir="ltr" class="mw-content-ltr">'''69.5% of people''' posted ≥ 2 comments with the Reply Tool</span> *<span lang="en" dir="ltr" class="mw-content-ltr">'''61.3% of people''' posted a comment using the Reply Tool on ≥ 2 distinct days</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">A "distinct day" was defined as a distinct calendar day. Therefore, some of these edits may have occurred 24 hours apart and some may have occurred only a few hours apart depending on what time of day the edit was made.</span> </ref> *<span lang="en" dir="ltr" class="mw-content-ltr">'''23.6% of people''' used the Reply Tool to make over half of their talk page edits</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">This data is a bit noisy in so far as there are some edits that cannot be made with the Reply Tool (e.g. starting a new section, editing existing content, etc.) and the software is not currently able to differentiate between comments and other talk page edits.</span> </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Report'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> You can review the full analysis results in this [[:en:Project Jupyter#Jupyter%20Notebook|Jupyter notebook]]: https://nbviewer.jupyter.org/github/wikimedia-research/Reply-tools-analysis-2021/blob/master/Adoption-Metrics/Replying-Tool-Adoption-Metrics.ipynb. </div> </onlyinclude> <span id="Background"></span> == Hintergrund == <div lang="en" dir="ltr" class="mw-content-ltr"> This year, the [[Special:MyLanguage/Editing team|Editing Team]] is committed to improving how contributors communicate and collaborate on Wikipedia, using talk pages. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For talk pages to be valuable, contributors need to intuitively know how to participate in the conversations that happen on them. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The trouble is – as [[Special:MyLanguage/Flow/Moderated Testing, November, 2014: talk pages and Flow#Findings: Tasks on Talk Pages|previous user testing]], the [[Special:MyLanguage/Talk pages consultation 2019/Phase 1 report|Talk Page Consultation]] and the [https://docs.google.com/presentation/d/1GF1CgDNBOnWorqGFXvvbHJmgBDnGlgszaEIIG98tKLs/edit#slide=id.g618b5fa040_1_44 team's research] uncovered – contributors, across experience levels, find replying to specific comments on Talk pages to be challenging. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Specifically, the team's research has found: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">More experienced contributors find it difficult to locate the specific comment they are wanting to reply to when participating in long, multi-person conversations, within big blocks of wikitext.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Newer contributors report not being sure how to reply to a conversation, regardless of its length or complexity.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In exploring an affordance for replying to specific comments on talk pages, we are striving to make participating ''productively'' on talk pages easier and more intuitive. We think doing so will help newer contributors understand and use talk pages as places to communicate with others and help more senior contributors collaborate more efficiently. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Challenges == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> One part of building new features is codifying social conventions in software. In this context, "conventions" could mean deciding what character the software should use for automatically indenting or outdenting replies. "Conventions" could also mean deciding how the software should represent the first comment in a discussion in wikitext: ''Is there a linebreak between the reply and the original comment? Is the reply added to the line immediately following the original comment in the discussion? Is there another way this comment should be represented?'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is unlikely all communities will answer these questions in the same way. This means the software needs to be built in a flexible enough way to accommodate these different preferences. This is possible, although it adds complexity to the design and development processes. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Design == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To increase the likelihood this enhancement is useful for contributors across experience levels, we have broken down the improvements we have planned into a series of releases. These different releases are outlined in more detail in the "[[#Versions|Versions]]" section below. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Also below are the latest iteration for the designs we are planning to implement in Version 1.0. If you have thoughts about anything included in this section, we would value you sharing them on the talk page: [[Talk:Talk pages project/replying]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''❗️Please consider the features included below as drafts and expect them to evolve as we learn new things.'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Versions === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Version 1.0 ==== </div> [[File:New replying mockup (v1.0).png|thumb|535x535px|<span lang="en" dir="ltr" class="mw-content-ltr">'''Version 1.0:''' a mockup showing version 1.0 of the new workflow for replying to specific comments on talk pages.</span>|alt=]] <div lang="en" dir="ltr" class="mw-content-ltr"> This version will introduce the basic reply functionality to validate the core workflow. This version will likely include the following features: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">An affordance for replying to specific comments</span> * <span lang="en" dir="ltr" class="mw-content-ltr">A text box for composing replies using wikitext</span> * <span lang="en" dir="ltr" class="mw-content-ltr">A way for signatures to be appended to comments, automatically</span> * <span lang="en" dir="ltr" class="mw-content-ltr">A way for those comments to be indented or outdented, automatically</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can try a prototype of version 1.0 of the new replying workflow here: https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Talk:Cats. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A mockup showing how version 1.0 will likely look once it is deployed can be seen in this screenshot: [[:File:New replying mockup (v1.0).png|File:New replying mockup (v1.0).png]] </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Version 2.0 ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Assuming version 1.0, and any smaller releases that follow, helps us to validate and refine the core replying functionality, version 2.0 will ''likely'' include enhancements to make it easier and intuitive for Junior Contributors to draft and post their replies. This version will ''likely'' include the addition of the following features: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Opt-in/out of watching the talk page as part of the replying workflow</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Populating the reply text input with instructional text to make it clear who you are responding to.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Drafting and formatting replies using a rich text editor</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Switching between "rich text" and "source" writing modes while preserving any content contributors have already written</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Mentioning/notifying specific users in a conversation without needing to know about or interact with wikitext</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Editing a specific comment</span> **<span lang="en" dir="ltr" class="mw-content-ltr">''Note: It is '''not likely''' editing a specific comment will be included in the initial release of version 2.0. This is due to the technical complexity involved with implementing this functionality. You can learn more about this "technical complexity" and the initial implementation we have planned in Phabricator here: [[phab:T245225|T245225]].''</span> <gallery mode="slideshow"> File:TalkPages-Reply-v2.0.png|<span lang="en" dir="ltr" class="mw-content-ltr">'''Version 2.0 overview:''' a mockup showing how version 2.0 of the new replying workflow could look.</span> File:Reply-v2-Visual.png|<span lang="en" dir="ltr" class="mw-content-ltr">'''Version 2.0. (visual):''' an annotated mockup showing the new Replying feature's visual text input mode.</span> File:Reply-V2-Source.png|<span lang="en" dir="ltr" class="mw-content-ltr">'''Version 2.0 (source):''' an annotated mockup showing the new Replying feature's source (read: wikitext) text input mode.</span> </gallery> <div lang="en" dir="ltr" class="mw-content-ltr"> == Deployment == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''This section contains information about how and where the Replying feature is and will be deployed.'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ===Deployment status=== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To see what projects the Reply Tool is available, please visit: {{ll|Talk pages project#Active initiatives}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Deployment decisions === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deploying Version 1.0 as a Beta Feature to partner wikis''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> On Monday, 16-March-2020, the team is planning to deploy Version 1.0 of the new workflow for replying to specific comments on talk pages as a Beta Feature on the following Wikipedias: Arabic, Dutch, French and Hungarian. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This decision is the outcome of the team being confident in the following: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">Reply links are available in the places (read: talk pages, across namespaces) where people expect them to be.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">The core parts of the Replying workflow (e.g. writing a comment, previewing a comment, formatting a comment, discarding a comment and publishing a comment) are working in the ways people expect.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">The Replying workflow is not disrupting existing talk page content.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This confidence is based on the team and volunteers testing the new Replying workflow on '''>75 different talk pages''' in '''three talk namespaces''' on the '''4 Wikipedias''' where the feature will be deployed. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This testing proved necessary for identifying and resolving issues related to the core parts of the replying workflow. Issues like: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">The replying text box remaining after cancelling a reply: [[phab:T245574]].</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Reply links appearing after list items that were ''not'' comments: [[phab:T245692]] (thank you, [https://www.mediawiki.org/w/index.php?title=User:Bdijkstra User:Bdijkstra]).</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Reply links ''not'' appearing after comments that contained signatures with an invisible Unicode character: [[phab:T245784]].</span> *<span lang="en" dir="ltr" class="mw-content-ltr">The reply tool not working in Safari: [[phab:T245781]].</span> *<span lang="en" dir="ltr" class="mw-content-ltr">The reply tool removing a page from your watchlist: [[phab:T245579]] (thank you, [https://www.mediawiki.org/w/index.php?title=User:Tacsipacsi User:Tacsipacsi]).</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Broken and incomplete table syntax causing page corruption: [[phab:T246481]].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This testing was also important for identifying additional use cases the team is actively working to provide support for. Use cases like being able to reply to comments transcluded from a subpage. For more details on this work, see this Phabricator task: [[phab:T245694]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ===Deployment process === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The deployment of this feature will happen in four steps. These four steps are described below. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Before the team decides to move on to the next step in the deployment process, they will do two things: </div> #<span lang="en" dir="ltr" class="mw-content-ltr">Make contributors affected by the next planned deployment aware of where to test the version of the feature the team is planning to deploy, how the feature will be deployed and what informed the deployment decision. ''Announcements containing this information will be posted as [[#Status_updates|updates]] on this [[Special:MyLanguage/Talk_pages_project/replying|project page]] and publicly on all wikis affected by the planned deployment.''</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Invite contributors to share their input about the next deployment the team is planning. ''Contributors will be invited to share their input about the next deployment on [[Talk:Talk_pages_project/replying|the talk page]] and on pages where the deployment is announced.''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ====Step 1: Beta cluster==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deployment goal''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The goal of this step in the deployment process is to answer these questions: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">''Do contributors find replying to comments using the feature intuitive?''</span> *<span lang="en" dir="ltr" class="mw-content-ltr">''Are any parts of the workflow broken (e.g. writing and formatting a reply, cancelling a reply, previewing a reply, publishing a reply)?''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deployment details''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To make sure the feature behaves in ways contributors expect, new versions of the feature will be deployed to the [[Special:MyLanguage/Beta_Cluster|Beta Cluster]]. This way, contributors will be able to safely experiment with new versions of the Replying feature without needing to worry about affecting existing content or contributors. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ====Step 2: Beta Feature==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deployment goal''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The goal of this step in the deployment process is to answer these questions: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">''Is the feature available where it should be?''</span> *<span lang="en" dir="ltr" class="mw-content-ltr">''Does the feature affect existing talk page content in unintended ways?''</span> *<span lang="en" dir="ltr" class="mw-content-ltr">''Are there any issues that prevent contributors from being able to respond to comments?''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deployment details''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To make sure the feature behaves in ways contributor expect on ''production'' wikis before exposing the feature to a large number of people, the feature will be deployed as a '''[[Special:MyLanguage/Beta_Features|Beta Feature.]]''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Step 3: User Preference (opt-out) ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deployment goal''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The goal of this step in the deployment process is to answer these questions: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">''Are people able to successfully post replies using the feature?''</span> *<span lang="en" dir="ltr" class="mw-content-ltr">''Is the feature having any unintended affects (e.g. encouraging disruptive talk page comments edits)?''</span> *<span lang="en" dir="ltr" class="mw-content-ltr">''Are people finding the feature valuable?''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deployment details''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To determine whether a broad range of people are having success using the feature and are finding it valuable, the feature will be deployed as an '''[[:en:Opt-out|opt-out]] [[Special:MyLanguage/Manual:User_preferences|User Preference]].''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ====Step 4: A/B test ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deployment goal''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The goal of this step in the deployment process is to understand whether the feature had the impact it was intended to have. To determine this, we will use this deployment step to answer: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">''Does the new replying feature make it easier and more intuitive for Junior and Senior Contributors to respond to specific comments on Wikipedia talk pages?''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deployment details''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To determine whether the feature had the impact it was intended to have, the team will run an A/B test on a to-be-determined set of wikis. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''The team is finalizing the details of this A/B test.'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ====Step 5: All wikis==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If evidence from the previous 4 deployment steps suggests the new Replying feature makes replying to specific comments on talk pages easier and more intuitive for Junior and Senior Contributors, it will be deployed to all remaining Wikipedias. Determining how and when the feature is deployed depends on the team, along with volunteers from those wikis, being confident the feature works reliably and in ways people expect it to. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Usability testing == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''This section contains information about user testing the team conducts to ensure the revised experience works in ways contributors expect.'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Version 2.0 prototype === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To evaluate whether the new features introduced in version 2.0 of the Replying tool are intuitive to Junior and Senior Contributors, we ran two usability tests that asked test participants to complete a series of tasks: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">One test recruited '''[[Special:MyLanguage/Talk pages project/Glossary|Junior Contributors]]''' (read: people familiar with reading Wikipedia and who have little-to-no experience using Wikipedia talk pages) via usertesting.com.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">One test recruited '''[[Special:MyLanguage/Talk pages project/Glossary|Senior Contributors]]''' (read: people who have experience using Wikipedia talk pages) via MediaWiki.org.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Overall, these tests demonstrated the majority of Junior and Senior Contributors were successful in using Version 2.0 of the Reply tool to write, format and publish comments on Wikipedia talk pages. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''You can learn about the overall impressions people had, the key areas for improvement and next steps below.'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Overal impressions''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Senior Contributors described the tool as well-balanced and expressed appreciation for the new automatic pinging feature. Here are a few noteworthy comments: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">''"I can insert a link to an [sic] user page inserting an @, after which a list of usernames pops up. That is nice."''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''"...this [pinging] is a game changer."''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''"Nice tool for both beginners and experienced users."''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''"Good tool, simple to use, it's good for what it's made for."''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Junior Contributors who were able to find the Reply tool successfully completed the tasks they were asked to and described the tool as being intuitive and straightforward to use. </div> <span lang="en" dir="ltr" class="mw-content-ltr">With this said, when peoples' focus moved from the Reply tool to the broader talk page, they became confused and uncertain about "where" they were and what they ought to do.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">Junior Contributors not recognizing talk pages as places to communicate with other editors is a finding that continues to surface<sup>[[Special:MyLanguage/Talk pages project/New discussion#Usability%20testing|[1]]]</sup> and something we plan to address later in the {{ll|Talk pages project}}.</span> </ref> <span lang="en" dir="ltr" class="mw-content-ltr">Here are a few comments we thought were noteworthy:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''"It was pretty straightforward. streamlined process here i like the fact that it's very stripped down and doesn't feel data intense.so not overwhelming by any stretch of the imagination. the colors are pleasing to the eye... simple to navigate interface. Overall it works the way i'd expect it to."''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''"I'm a little confused about what User talk: Alice is..."''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''"Doesn't look like the sort of usual messaging interface you might see on a website."''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Task analysis''' </div> <span lang="en" dir="ltr" class="mw-content-ltr">The table below shows whether participants in each test group were able to complete the following tasks with Version 2.0 of the Reply tool.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">These test findings were compiled on 10-June-2020.</span> </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> You can review the broader themes these tests helped our team identify in the "Key themes" section below. </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Task description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Junior Contributors</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Senior Contributors</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Identify''' the way to reply to a comment on the talk page</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">9/10 were successful</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">13/13 were successful</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Type''' a comment using the new visual mode</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">9/10 were successful</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">13/13 were successful</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Format''' the content they had written using the visual mode's formatting tools</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">8/10 were successful</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">13/13 were successful</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Ping''' someone who has already commented in the section they are commenting in</span> |⚠️ <span lang="en" dir="ltr" class="mw-content-ltr">6/10 were successful</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">10/13 were successful</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Ping''' someone who has ''not'' already commented in the section they are commenting in</span> |⚠️ <span lang="en" dir="ltr" class="mw-content-ltr">7/10 were successful</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">10/13 were successful</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Remove''' one of the pings they created</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">8/10 were successful</span> |⚠️<span lang="en" dir="ltr" class="mw-content-ltr">9/13 were successful</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Review''' how the comment they wrote will appear in wikitext ''before'' publishing</span> | <span lang="en" dir="ltr" class="mw-content-ltr">''Not asked''</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">13/13 were successful</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Publish''' the comment they wrote</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">9/10 were successful</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">13/13 were successful</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Locate''' the comment they published</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">9/10 were successful</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">13/13 were successful</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> '''Areas for improvement''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> These are the broader areas for improvement that surfaced through these usability tests. You can review how we plan to address these themes in the "Next steps" section below. </div> # <span lang="en" dir="ltr" class="mw-content-ltr">The tool's two modes: visual and source:</span> #* <span lang="en" dir="ltr" class="mw-content-ltr">Some Senior Contributors were surprised to learn when viewing a diff that the visual mode automatically signed the comment they posted.</span> #* <span lang="en" dir="ltr" class="mw-content-ltr">Some Junior Contributors did not find the difference between the visual and source modes to be clear.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Pinging</span> #* <span lang="en" dir="ltr" class="mw-content-ltr">Some Senior Contributors said they would not have known the pinging feature was available had they not been instructed to try it.</span> #* <span lang="en" dir="ltr" class="mw-content-ltr">Some Senior Contributors wondered whether Junior Contributors would be confused by the normal link inspector that is presented when a ping within a drafted comment is selected.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Commenting in long threads</span> #* <span lang="en" dir="ltr" class="mw-content-ltr">Senior Contributors found it can be easy to "lose the tool" when trying to comment in a conversation and/or on a page with many comments.</span> #** <span lang="en" dir="ltr" class="mw-content-ltr">An example: when trying to respond to a comment that has many existing replies, it can be difficult to simultaneously look at the comment you are responding to and the comment you are drafting using the Reply tool.</span> #* <span lang="en" dir="ltr" class="mw-content-ltr">Senior Contributors found the tools within the visual mode hard to "reach" when working on a large screen and when writing a lengthier comment.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Edit summaries</span> #* <span lang="en" dir="ltr" class="mw-content-ltr">Some Senior Contributors wondered whether supports for custom edit summaries would be added.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Next steps''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To address the issues and opportunities these two usability tests surfaced, the team will be working on improvements to make the following come true; </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Contributors, across experience levels, can easily mention/ping another person in the comment they are writing.</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">''Example improvement: adding an icon to the visual mode's toolbar that communicates there is a feature for pinging people.''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Contributors, across experience levels, know how the tool's two input modes function and how they relate to one another.</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">''Example improvement: revising what the visual / source modes are called and how prominently they appear in the interface.''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Contributors, across experience levels, find the tool well suited for commenting in talk page conversations, regardless of how many conversations (read: sections) and comments they contain.</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">''Example improvement: revising where the text input area appears on the page and how it behaves when the page is scrolled.''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can track the progress we make on the areas above by watching this page and/or by reading this Phabricator workboard: [[phab:project/view/4546/|phab:Reply tool version 2.0]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Version 1.0 prototype=== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To see how the version 1.0 prototype affected [[Special:MyLanguage/Talk_pages_project/Glossary|Junior Contributors']] experience replying in conversations on talk pages, the team ran a control test with [https://www.nngroup.com/articles/why-you-only-need-to-test-with-5-users/ 5 participants] on [https://office.wikimedia.org/wiki/UserTesting.com usertesting.com]. You can review the test findings below. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ====How were we testing? ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This usability test was run on [https://www.usertesting.com/ usertesting.com] with 5 participants who were each screened to ensure they were technically advanced web users who have used Wikipedia before. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In order to compare the revised replying workflow to the [[#What did we find?|existing workflow]], each test participant was asked to complete the same tasks on a desktop computer, while narrating their experience: </div> #<span lang="en" dir="ltr" class="mw-content-ltr">Navigate to an existing discussion happening on a test wiki talk page</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Draft and publish a response in that discussion</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Locate their published response on the talk page</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Navigate to the talk page's history page and locate the reply they had just posted</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Start drafting another reply, but discard it before publishing</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ====What did we find?==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Overall, the prototype seems to have improved Junior/newer contributors' experiences replying in an existing conversations. On average, it took participants using the prototype half the time to publish a reply compared to the time it took them in the [[#Existing_reply_experience:_13-Dec-2019|previous test]], using full page editing. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Task completion </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''✅All participants''' were able to locate the specific discussion on the talk page they were being instructed to reply to</span> * <span lang="en" dir="ltr" class="mw-content-ltr">'''✅All participants''' successfully composed and published a reply in an existing discussion</span> * <span lang="en" dir="ltr" class="mw-content-ltr">'''✅All participants''' properly indented and signed their comments</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">''Note: the tool does this for them automatically.''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">'''✅All participants''' were able to locate their published response on the talk page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">'''✅All participants''' were able to find the talk page history page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">'''❌1 out of 5 participants''' was able to quickly locate the edit they had just made on the talk page's history page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">'''✅All participants''' were able to cancel their second reply before publishing it</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Results </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The prototype seems to have made it easier for Junior/newer contributors to reply to existing conversations on talk pages. Test participants used phrases like, "straight-forward," "no-problem whatsoever," and "really easy" to describe their experiences. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> With this said, there are still parts of the replying workflow participants found difficult that could be improved: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">Making it easier to visually distinguish between different replies in a discussion</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Making it easier to identify who the author of a comment is and who they are responding to</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Making the "Reply" call to action easier to discover</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Revising the automatically generated edit summary to make it easier for contributors to identify their reply on the History page.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> More details can be found in this ticket on Phabricator: [[phab:T236921#5744471|T236921#5744471]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Next steps''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The team will decide if and when to make the improvements mentioned above (e.g. making it easier to visually distinguish between different replies in a discussion) and do further testing with more experienced contributors (this has started here: [[Special:MyLanguage/Talk_pages_project/replying/prototype_testing#Version_1.0_prototype_test|Version 1.0 prototype test]]). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ===Existing reply experience=== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To identify the challenges [[Special:MyLanguage/Talk_pages_project/Glossary|Junior Contributors]] face when trying to participate in conversations on talk pages, the team ran a control test of the existing (full page) editing workflow. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ====How were we testing?==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This usability test was run on [https://www.usertesting.com/ usertesting.com] with [https://www.nngroup.com/articles/why-you-only-need-to-test-with-5-users/ 5 participants] who were each screened to ensure they were technically advanced web users who have used Wikipedia in some capacity before. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Each test participant was asked to do the following tasks on a desktop computer, while narrating their experience: </div> #<span lang="en" dir="ltr" class="mw-content-ltr">Navigate to an existing discussion happening on a test wiki talk page</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Draft and publish a response in that discussion</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Locate their published response on the talk page</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Start drafting another reply, but discard it before publishing</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Navigate to the talk page's history page and locate the reply they had just posted</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ====What did we find?==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Below is a summary of our findings from this user test. More details can be found in this ticket on Phabricator: [[phab:T239175#5723843|T239175#5723843]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Task completion </div> *<span lang="en" dir="ltr" class="mw-content-ltr">'''✅All participants''' were able to locate the specific discussion on the talk page they were being instructed to reply to</span> *<span lang="en" dir="ltr" class="mw-content-ltr">'''✅All participants''' successfully composed and published a reply in an existing discussion</span> *<span lang="en" dir="ltr" class="mw-content-ltr">❌'''0 out of 5 participants''' properly indented and signed their comments</span> *<span lang="en" dir="ltr" class="mw-content-ltr">❌'''1 out of 5 participants''' noticed they had not signed their comments</span> **<span lang="en" dir="ltr" class="mw-content-ltr">''This one person remarked, "I probably should have put my user name, but i didn't".''</span> *<span lang="en" dir="ltr" class="mw-content-ltr">'''3 out of 5 participants''' were able to locate their published response on the talk page.</span> **<span lang="en" dir="ltr" class="mw-content-ltr">''Note: it took several participants multiple minutes to do this''</span> *<span lang="en" dir="ltr" class="mw-content-ltr">'''✅4 out of 5 participants''' were able to find the talk page history page and locate the reply they had just posted</span> *<span lang="en" dir="ltr" class="mw-content-ltr">'''✅4 out of 5 participants''' were able to cancel their second reply before publishing it</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Results </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This test highlighted an important tension many Junior Contributors seem to face: they finish the task they set out to complete without realizing they might have done so incorrectly. And if they do realize they have made a mistake, they are not equipped to fix it because the proper conventions are not intuitive enough for them to understand. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Next steps''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The team will be doing two things in response to this test: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">The team will be doing additional testing in different namespaces and languages (see: [[Special:MyLanguage/Talk_pages_project/Updates#Partner_wikis|Partner wikis]]).</span> *<span lang="en" dir="ltr" class="mw-content-ltr">We will run a usability test of the prototype with contributors, across experience levels, to see how it affects their experiences replying to comments on talk pages.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == History == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Many projects have, and are, working to improve contributors' experiences with talk pages. This project is better off for their existence. Some of the projects the team continues to learn from are listed on the [[Special:MyLanguage/Talk pages project#References|main project page]] and below. If there is a project you think we should be aware of, please boldly add it here. </div> * [[:ru:Участник:Jack_who_built_the_house/Удобные_дискуссии|<span lang="en" dir="ltr" class="mw-content-ltr">Convenient Discussions</span>]] * [[m:Special:MyLanguage/Collaboration/Flow_satisfaction_survey/Report|<span lang="en" dir="ltr" class="mw-content-ltr">Flow satisfaction survey</span>]] * {{ll|Flow/Moderated Testing, November, 2014: talk pages and Flow|2=<span lang="en" dir="ltr" class="mw-content-ltr">Moderated Testing, November 2014: talk pages and Flow</span>}} * [[w:User_talk:Enterprisey/reply-link|<span lang="en" dir="ltr" class="mw-content-ltr">Reply-link</span>]] * {{ll|Talk pages consultation 2019|2=<span lang="en" dir="ltr" class="mw-content-ltr">Talk pages consultation</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> == Glossary == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The [[Special:MyLanguage/Talk pages project/Glossary|Talk pages project glossary]] is intended to help us all communicate about talk pages more effectively by making sure we have a shared understanding about the words we use in our discussions and documentation throughout the project. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * <span lang="en" dir="ltr" class="mw-content-ltr">https://quarry.wmflabs.org/query/48614 – Counting the number of times editors use the Reply tool</span> <references/> [[Category:Talk pages project{{#translation:}}]] bcbyhh5qbddl2tynzcbfke92ydhrhwk 8365119 8365061 2026-05-04T10:49:32Z Clump 81610 Not a translation 8365119 wikitext text/x-wiki <languages/> {{Wikimedia engineering project information | name = Diskussionsseiten | description = <span lang="en" dir="ltr" class="mw-content-ltr">Help contributors respond to comments on talk pages more easily.</span> | start = 2019-09-30 | end = | group = {{ll|Editing}} | lead = [[User:ESanders (WMF)|Ed Sanders]] | EPM = [[User:PPelberg (WMF)|Peter Pelberg]] (product), [[User:VPuffetMichel (WMF)|Valerie Puffet-Michel]] (engineering) | team = [[User:Bartosz Dziewoński (WMF)|Bartosz Dziewoński]], [[User:DChan (WMF)|David Chan]], [[User:DLynch (WMF)|David Lynch]], [[User:EAkinloose_(WMF)|Esther Akinloose]], [[User:Mvolz (WMF)|Marielle Volz]], [[User:RYasmeen (WMF)|Rummana Yasmeen]], [[User:JKlein (WMF)|Jess Klein]], [[User:Whatamidoing (WMF)|Sherry Snyder]] | Phabricator = DiscussionTools | updates = | progress = | previous = | next = | backlog = | projectpage = | display = {{{display|}}} }} <span lang="en" dir="ltr" class="mw-content-ltr">This page talks about the [[Special:MyLanguage/Editing team|Editing Team's]] work to improve contributors' workflows for replying to comments on [[:en:Help:Talk pages|talk pages]], across Wikipedia's [[w:Wikipedia:Namespace|16 talk namespaces]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">This new workflow for replying to specific comments is intended to make participating productively on talk pages easier and more intuitive for [[Special:MyLanguage/Talk pages project/Glossary|Junior]] and [[Special:MyLanguage/Talk pages project/Glossary|Senior Contributors]].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This initiative sits within our team's [[Special:MyLanguage/Talk pages project|larger effort]] to help contributors work together more effectively. To accomplish this, we will build upon existing community conventions to evolve talk pages. It is our intention to evolve talk pages in a way that gives experienced contributors more leverage to coordinate their work and connect with other editors, while making communicating on-wiki more accessible and intuitive for newer contributors. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To participate in and follow this project's development, we recommend [https://www.mediawiki.org/w/index.php?title=Talk_pages_project/Replying&action=watch adding this page to your watchlist]. We will use this page to do things like: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">''Share potential designs and ask for feedback about them''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''Test prototypes''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''Post updates about this feature's development''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''Ask and invite questions about any part of this project (e.g., measurement, deployments, etc.)''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == What it is == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The reply tool is an extra button that appears at the end of a post on a talk page. When you click on it, it opens a reply form that makes replying to that post easier to do correctly. It indents correctly, helps ping correctly, and automatically signs correctly for you, among other things. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:DiscussionTools#Reply tool}} and {{ll|Talk pages project/Feature summary#Reply tool}} (screenshots!). </div> <span id="Technical_information"></span> == Technische Informationen == <div lang="en" dir="ltr" class="mw-content-ltr"> The replying feature is implemented via the [[Special:MyLanguage/Extension:DiscussionTools|DiscussionTools extension]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Troubleshooting information is available at {{ll|Help:DiscussionTools/Why can't I reply to this comment?}} </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Status updates == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''This section contains updates about the project's development.'' </div> === {{ymd|2023|7|13}} === [[File:Dtcheck.png|alt=Screenshot of https://dtcheck.toolforge.org/|thumb|250x250px|<nowiki>https://dtcheck.toolforge.org/</nowiki>]] <div lang="en" dir="ltr" class="mw-content-ltr"> The scale of the Reply Tool's usage has grown beyond what the current architecture of [https://dtcheck.toolforge.org/dtstats.html dtcheck.toolforge.org/dtstats] can sustain. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Absent of there being a clear need for the Editing Team to invest in updating dtcheck to cope with the volume of edits people are using the Reply Tool to make, '''we will [[:en:Sunset_(computing)|sunset]] the feature on September 1, 2023'''. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Please comment on [[phab:T341821|T341821]] if you see reasons why disabling [https://dtcheck.toolforge.org/dtstats.html dtcheck] would be disruptive for you. </div> [[File:2M barnstar.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">A gold star with the number {{formatnum:2000000}}</span>|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">As of early {{date|2022|10}}, more than {{formatnum:2000000}} new comments have been posted through the Reply tool.</span>]] === {{date|2022|5|27}} === [[File:Reply Tool new comment indicator.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">A screenshot showing the design of the new comment indicator that appears in the Reply Tool when someone publishes a comment while you are drafting a reply.</span>|thumb|338x338px|<span lang="en" dir="ltr" class="mw-content-ltr">New comment indicator in the Reply Tool.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> As of 19 May, a new experience is live for the new comment indicator that appears in the Reply Tool when someone publishes a comment while you are drafting a reply. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The Editing Team would like to acknowledge [[User:BKots-WMF|Beta Kots]] for the work she did in leading the design of this improvement. </div> [[File:Badge 1m.png|alt=Star with text|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">In early April 2022, the one millionth comment was posted with the Reply tool.</span>]] === {{date|2022|3|9}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Scaling'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> On Monday, 7 March 2022, the Reply Tool became available to everyone (logged in and out) on desktop at English Wikipedia (en.wiki). ''[[phab:T296645|Details about this deployment can be found in Phabricator]].'' </div> === {{date|2022|2|18}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Scaling'' </div> <span lang="en" dir="ltr" class="mw-content-ltr">As of today, the Reply Tool is available to everyone (logged in and out) on desktop at all Wikimedia wikis except for en.wiki ([[phab:T296645|T296645]]), fi.wiki ([[phab:T297533|T297533]]), and ru.wiki ([[phab:T297410|T297410]]).</span> <span lang="en" dir="ltr" class="mw-content-ltr">''You can see the full list of what {{ll|Talk pages project}} features are available at what wikis by visiting {{ll|Talk pages project/Deployment Status}}.''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Notifications about New Comments'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The team is working on introducing functionality that will alert you, in real-time, when someone posts a new comment in the discussion you are using the Reply Tool within. ''[[Talk:Talk pages project/Replying/2022#h-Prototype_Feedback:_Automatic_Edit_Conflict_Improvements-2022-02-12T01:28:00.000Z|Instructions for how to try the prototype and share feedback about it can be found here]].'' </div> [[File:Badge 700k.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">Star with the text "700,000"</span>|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">The 700,000th use of the Reply tool happened in January 2022. By the first week of February, more than 750,000 comments had been posted with the Reply tool.</span>]] === {{ymd|2021|12|7}} === [[File:Badge 500k.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">Star with the text "500,000"</span>|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">The 500,000th use of the Reply tool happened in December 2021.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Scaling'' </div> <span lang="en" dir="ltr" class="mw-content-ltr">Today, 7 December, the Reply Tool became available by default on desktop to everyone — logged in and out – at [[Special:MyLanguage/MediaWiki|MediaWiki.org]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can try the tool on [[Talk:Talk pages project/Usability]].</span> === {{ymd|2021|11|17}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Scaling'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Today, 17 November, the Reply Tool became available by default on desktop to everyone — logged in and out – at [[commons:Main page|Commons]]. </div> === {{ymd|2021|10|29}} === [[File:450k-star.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">Star with the text "450,000"</span>|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">The 450,000th post was made in October 2021.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Scaling'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> On Monday, 25 October, the Reply Tool became available by default on desktop to everyone—logged in and out–at the [[w:fr:Wikipédia:Accueil principal|French Wikipedia]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> [[phab:T294169|Conversations are ongoing]] with volunteers about also offering the Reply Tool as an on-by-default feature at the English, Finnish, and German-language Wikipedias. </div> === {{ymd|2021|10|15}} === [[File:Convert to wikitext nudge.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">Screenshot showing new functionality that enables you to preserve text formatting when pasting content into the Reply Tool's Source mode.</span>|thumb|325x325px|<span lang="en" dir="ltr" class="mw-content-ltr">New functionality that enables you to preserve text formatting when pasting content into the Reply Tool's Source mode.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''New functionality'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Starting next week, you will gain the ability to preserve text formatting when pasting content into the Reply Tool's Source mode. </div> === {{ymd|2021|9|30}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Scaling'' </div> [[File:DTCheck.png|thumb|272x272px|<span lang="en" dir="ltr" class="mw-content-ltr">A screenshot showing "dtcheck" a tool for seeing how the Reply Tool is being used at the Wikimedia Wikis it is available at. ''More information about the tool can be on GitHub here: https://github.com/MatmaRex/dtcheck<nowiki/>.''</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> Today, 30 September, the Reply Tool became available as an on-by-default feature at all [[meta:Wikimedia wikis|Wikimedia Wikis]] ''except'' the projects listed here: </div> * {{int|project-localized-name-enwiki}} * {{int|project-localized-name-fiwiki}} * {{int|project-localized-name-frwiki}} * {{int|project-localized-name-ruwiki}} * {{int|project-localized-name-dewiki}} * {{int|project-localized-name-commonswiki}} * {{int|project-localized-name-metawiki}} * {{int|project-localized-name-mediawikiwiki}} <div lang="en" dir="ltr" class="mw-content-ltr"> In the coming weeks, we will start conversations with volunteers at the wikis listed above about the prospect of offering the Reply Tool as an on-by default feature there as well. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In the meantime, you can see how often people are using the Reply Tool to publish talk page comments by visiting https://dtcheck.toolforge.org/dtstats.html. </div> === {{ymd|2021|8|31}} === [[File:300k-star.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">A star with the text "300,000"</span>|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">By the end of August 2021, more than 300,000 comments had been posted with the Reply tool.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Scaling'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Today, 31 August, the Reply Tool became available as an on-by-default feature at 21 new Wikipedias: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Spanish (eswiki), Italian (itwiki), Japanese (jawiki), Persian (fawiki), Polish (plwiki), Hebrew (hewiki), Dutch (nlwiki), Hindi (hiwiki), Korean (kowiki), Vietnamese (viwiki), Thai (thwiki), Portuguese (ptwiki), Bengali (bnwiki), Egyptian (arzwiki), Swahili (swwiki), Chinese (zhwiki), Ukrainian (ukwiki), Indonesia (idwiki), Amharic (amwiki), Oromo (omwiki), Afrikaans (afwiki). </div> === {{ymd|2021|8|6}} === [[File:Daily Reply Tool Edits.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">A chart showing the number of edits people have used the Reply Tool to make each day.</span>|thumb|332x332px|<span lang="en" dir="ltr" class="mw-content-ltr">To date, people have used the Reply Tool to make ~250,000 edits. [https://superset.wikimedia.org/r/636 Source]</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Usage'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To date, people have used the Reply Tool to post 250,000+ talk page comments. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''New toolbar in Source mode'' </div> <span lang="en" dir="ltr" class="mw-content-ltr">Yesterday, 5 August, the Source mode toolbar that was introduced as an opt-in setting in May, became available to all people who have the Reply Tool enabled '''by default'''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note: you can still turn this toolbar off if you would like within {{ll|Help:Preferences|Special:Preferences}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Offering the Reply Tool by default at more projects'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In the coming weeks, we expect to be able to resume plans with offering the Reply Tool as a default-on feature for all users at all projects. Once the next set of wikis where the Reply Tool will be offered by default is finalized, we will post an update to this page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For context, plans to offer the Reply Tool more broadly had been stalled while we worked with the [[Special:MyLanguage/Wikimedia Performance Team|Performance]] and Data Persistence Teams on [[phab:T280599|infrastructure enhancements]] to ensure the Reply Tool continues to function as expected at this larger scale. </div> === {{ymd|2021|5|13}} === [[File:Screenshot of DiscussionTools toolbar in source.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">A screenshot showing the new toolbar that can be enabled in the Reply Tool's Source mode.</span>|thumb|320x320px|<span lang="en" dir="ltr" class="mw-content-ltr">A screenshot showing the new toolbar that can be enabled in the Reply Tool's Source mode.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''New toolbar in Source mode'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As of Tuesday, 11 May, you can enable a toolbar within the Reply Tool's Source mode. This toolbar introduces easier ways for pinging other people and inserting links into the comments you are drafting. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To start, this new mode is being offered as an '''opt-in''' preference. You can enable it by taking the following steps </div> # <span lang="en" dir="ltr" class="mw-content-ltr">Ensure you have the Reply Tool enabled</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Visit <code>Special:Preferences#mw-prefsection-editing</code></span> # <span lang="en" dir="ltr" class="mw-content-ltr">Locate the <code>Discussion pages</code> section</span> # <span lang="en" dir="ltr" class="mw-content-ltr">"Check" the checkbox next to the setting that reads: <code>Enable experimental tools in the quick replying and quick topic adding features' source modes</code></span> # <span lang="en" dir="ltr" class="mw-content-ltr">Click <code>Save</code></span> # ✅ <span lang="en" dir="ltr" class="mw-content-ltr">You are done. You should now see the new toolbar whenever you open the Reply Tool's Source mode</span> === {{ymd|2021|4|23}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''A/B test results'' </div> [[File:Reply Tool A-B test comment completion.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">Percent of Junior Contributors that completed at least one comment attempt on a talk page during the AB test.</span> |thumb|296x296px|<span lang="en" dir="ltr" class="mw-content-ltr"><nowiki>Percent of Junior Contributors that completed at least one comment attempt on a talk page during the AB test. | </nowiki>[https://wikimedia-research.github.io/Reply-tools-analysis-2021/ Source]</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> The results are in from the A/B test of the Reply Tool that ran from [[#12 February 2021|11 February]] through [[#16 March 2021|10 March]] on 22 Wikipedias. What follows are the conclusions we are drawing from these results and the steps we are taking next. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Conclusions''' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">The Reply Tool '''decreases disruption''':</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">There was a '''79.5% decrease in the revert rate''' of comments Junior Contributors made with the Reply Tool compared to comments Junior Contributors made with page editing.</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">There was no significant increase in the number of Junior Contributors who were blocked after publishing a comment with the Reply Tool</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The Reply Tool causes Junior Contributors to have '''more success publishing comments''' :</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">'''72.9% of Junior Contributors''' who opened the Reply Tool were able to publish at least one comment during the A/B test compared to 27.6% of Junior Contributors who attempted a comment using page editing. This amounts to a '''160% increase in the comment completion rate of Junior Contributors''' who used the Reply Tool during the test than those who used page editing.</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">Junior contributors using the Reply Tool are '''7.2 times more likely''' to publish a comment they start than Junior Contributors using page editing.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ''The full report can be found here: [https://wikimedia-research.github.io/Reply-tools-analysis-2021/ Reply Tool AB Test Report].'' </div> '''Nächste Schritte''' <span lang="en" dir="ltr" class="mw-content-ltr">Considering the A/B test [https://wikimedia-research.github.io/Reply-tools-analysis-2021/ has shown] the Reply Tool causes a greater percentage of Junior Contributors to publish a comment without a significant increase in disruption, we will proceed with the plan we shared in [[phab:T252057|T252057]] to begin making the Reply Tool available as an opt-out preference at all Wikimedia projects.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The sequence and timing of these deployments will be finalized in [[phab:T280388|T280388]].</span> === {{ymd|2021|3|23}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Deployments'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> 23 March, the Reply and the New Discussion Tools will be available as an opt-in beta feature at the German Wikipedia, so it will be at all [[:en:Wikipedia:Wikimedia sister projects|Wikimedia Sister Projects]] from 23 March. </div> === {{ymd|2021|3|16}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''A/B Test'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> On 10-March, the Reply Tool A/B test finished. We are now analyzing the data and expect to have results for you to review in the next four to six weeks. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Deployments'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Yesterday, 16-March, the Reply and the New Discussion Tools became available as an opt-in beta feature at the English and Russian Wikipedias and all [[:en:Wikipedia:Wikimedia sister projects|Wikimedia Sister Projects]] (except German Wikipedia). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Note: you can review how and where all {{ll|Talk pages project}} features are available here: {{ll|Talk pages project#Active initiatives}}.'' </div> === {{ymd|2021|2|12}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''A/B Test'' </div> <span lang="en" dir="ltr" class="mw-content-ltr">On 11 February, an A/B test of the Reply Tool started at 22 Wikipedias (full list [[Special:MyLanguage/Talk pages project#Active initiatives|here]]).</span> <span lang="en" dir="ltr" class="mw-content-ltr">During this test, 50% of all editors at the Wikipedias included in the test will have the Reply tool automatically enabled, and 50% will not.</span> <span lang="en" dir="ltr" class="mw-content-ltr">People at these wikis will still be able to turn the tool on or off in [[Special:Preferences]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The results of this test will help the team decide whether people benefit enough from the tool for it to ''begin'' being made available by default, at all projects.</span> <span lang="en" dir="ltr" class="mw-content-ltr">We expect to have results to share in 2-3 months.</span> === {{ymd|2021|1|22}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Engagement metrics'' </div> [[File:Junior Contributor Reply Tool and full page edit completion rate.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Completion rates for comments made with the Reply tool and full-page wikitext editing. ''Details and limitations are in this [https://nbviewer.jupyter.org/github/wikimedia-research/Discussion-tools-analysis-2020/blob/master/Engagement-Metrics/Reply-Tool-Workflow-Engagement-Metrics.ipynb#Reply-Tool-(Wikitext-and-VE)-vs-Full-Page-Wikitext report].''</span>|266x266px]] <div lang="en" dir="ltr" class="mw-content-ltr"> On 5 January 2021, the team completed an analysis of the first ~2.5 months of Reply Tool usage at the three wikis where it is available by default (Arabic, Czech and Hungarian). The findings are encouraging, tho not conclusive considering the limited sample size. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A notable finding from this analysis: the '''edit completion rate for Junior Contributors using the Reply Tool is 4x higher''' than the edit completion rate for people using full-page wikitext editing. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''You can review these findings in more detail by reading the [[#Metrics|Metrics]] section below and/or reviewing the full report: [https://nbviewer.jupyter.org/github/wikimedia-research/Discussion-tools-analysis-2020/blob/master/Engagement-Metrics/Reply-Tool-Workflow-Engagement-Metrics.ipynb#Reply-Tool-(Wikitext-and-VE)-vs-Full-Page-Wikitext Reply Tool workflow engagement metrics].'' </div> === {{ymd|2020|12|17}} === <div lang="en" dir="ltr" class="mw-content-ltr"> Completion rates for comments made with the Reply tool and full-page wikitext editing. Details and limitations are in this [https://nbviewer.jupyter.org/github/wikimedia-research/Discussion-tools-analysis-2020/blob/master/Engagement-Metrics/Reply-Tool-Workflow-Engagement-Metrics.ipynb#Reply-Tool-(Wikitext-and-VE)-vs-Full-Page-Wikitext report]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''A/B Test'' </div> <span lang="en" dir="ltr" class="mw-content-ltr">We have decided the key metric we will use to compare the A/B test's <code>control</code> and <code>test</code> groups will be the rate at which people in either group publish the comments they initiate.</span> <span lang="en" dir="ltr" class="mw-content-ltr">''More information in can be found in the [[#Metrics|Metrics]] section below and in Phabricator here: [[phab:T252057|T252057]].''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> It is important to note that we are '''not considering''' notable ''positive'' changes in the rates at which people start and continue participating on talk pages as well as the rates at which people are participating on talk pages in disruptive ways as prerequisites for the Reply Tool being made available to all people, at all wikis, as an opt-out user preference. We've come to think this for the following reasons: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Evidence ''to date'' suggests the Reply Tool is having the intended short-term impact: Junior and Senior Contributors have an easier time participating in existing conversations.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">We assume notable changes in the rates at which people start and continue participating on talk pages will likely get expressed over a longer period of time (read: they will not be detectable during the course of the upcoming A/B test).</span> === {{ymd|2020|12|2}} === [[File:50K Edit Star.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">A barnstar</span>|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">By the end of November 2020, more than 50,000 replies had been posted with the Reply tool.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Measuring engagement'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The team is analyzing the Reply Tool usage data from the Arabic, Czech and Hungarian Wikipedias, where the tool has been available as an opt-out feature since 24-September-2020. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This analysis will help us determine whether people, across experience levels, are having success using the Reply Tool and whether people are using the tool in ways that disrupts others. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> We will post the results of this analysis in the [[#Metrics|Metrics]] section below (see: "'''Analysis 2: Engagement'''"). You can expect these results to be posted no later than January, 2021. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Evaluating impact'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The team is preparing to run an A/B test to evaluate the impact the Reply Tool has had on how people use talk pages. This test will help the team decide whether we should move forward with plans to offer the tool to all people, at all wikis, as an opt-out user preference. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> More details about the test can be found in the [[#Metrics|Metrics]] section below (see: "'''Analysis 3: Impact'''"). </div> === {{ymd|2020|11|4}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Deployment planning'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Today, 4-November, the Reply Tool became available as an ''opt-in'' Beta Feature at an additional ~250 Wikipedias. This means the Reply Tool is now available as either a Beta Feature or opt-out user preference at all Wikipedias '''except''' for the following projects: English, Finnish, Gan, German, Inuktitut, Kazakh, Kurdish, Russian, Tajik, and Uzbek. </div> === {{ymd|2020|10|28}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Deployment planning'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In the coming weeks, we are planning to offer the Reply Tool as an ''opt-in'' Beta Feature at all remaining Wikipedias '''except''' for the following projects: English, Gan, German, Inuktitut, Kazakh, Kurdish, Russian, Tajik, and Uzbek. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An exact date has not yet been set. Once it has, we will announce it on this page and in [[metawiki:Special:MyLanguage/Tech/News|Tech/News]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Note: the above was also mentioned in this week's Tech/News. See: [[metawiki:Special:MyLanguage/Tech/News/2020/44|Tech/News/2020/44]].'' </div> === {{ymd|2020|10|16}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Deployment'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> On Wednesday, 14-October, the Reply Tool became available as an opt-in Beta Feature at an additional 30 projects. The objective of this deployment is to ensure the Reply Tool is usable and useful for editors at Wikipedias that write in languages/scripts with unique characteristics (e.g. long words, unusual font sizing, many diacrtics, rare fonts, etc.). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''The full list of projects where the Reply Tool is currently available can be found here: {{ll|Talk pages project#Active initiatives}}.'' </div> === {{ymd|2020|9|25}} === [[File:25K Edit Star.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">As of September 2020, more than 25,000 comments have been posted with the Reply tool.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Deployment'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> On Thursday, 24-September, the Reply Tool became available to ''all users'' (logged in and out) at the following Wikipedias: Arabic, Czech and Hungarian. This deployment marks the first time the tool is available to people who have not enabled the feature in Beta Features or appended <code>?dtenable=1</code> to the URL of the talk page they are viewing. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The primary goal of this deployment is to understand whether contributors, across experience levels, are having success using the feature and finding it valuable. ''You can find more details about how we think about the deployment process here: [[#Step 3: User Preference (opt-out)|Deployment process]].'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> You can see the kinds of edits people at the Arabic, Czech and Hungarian Wikipedias are making with the Reply Tool by filtering [[Special:MyLanguage/Help:Recent changes|Recent Changes]]: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Arabic: https://w.wiki/dgV</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Czech: https://w.wiki/dT7</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Hungarian: https://w.wiki/dT6</span> === {{ymd|2020|9|14}} === [[File:Reply Tool- custom edit summary implementation.png|thumb|275x275px|<span lang="en" dir="ltr" class="mw-content-ltr">'''Custom edit summary implementation'''</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Custom edit summaries'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> By the end of Thursday, 17-September-2020, anyone using the Reply Tool on a production wiki will be able to customize the edit summary that accompanies the comments they post with the Reply Tool. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This functionality can be accessed by clicking the <code>Advanced</code> link that will appear beneath the text input area (see the "Custom edit summary implementation" screenshot). </div> === {{ymd|2020|8|28}} === [[File:Reply Tool custom edit summary.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">A screenshot showing an approach for incorporating custom edit summary functionality into the Reply Tool.</span>|thumb|238x238px|<span lang="en" dir="ltr" class="mw-content-ltr">'''Custom edit summary design:''' a screenshot showing an approach for incorporating custom edit summary functionality into the Reply Tool.</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Custom edit summaries'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Inspired by the feedback volunteers have shared <sup>[[Talk:Talk pages project/Replying/2020/06#h-Does_not_show_or_offer_to_change_the_edit_summary-2020-06-01T16:30:00.000Z|[i]]][[Talk:Talk pages project/Replying/2020/06#h-V2_Feedback:_Pelagic-2020-06-02T21:57:00.000Z|[ii]]][[Talk:Talk pages project/Replying/2020/07#h-Allow_to_change_edit_summary-2020-07-17T15:44:00.000Z|[iii]]][[Talk:Talk pages project/Replying/2020/08#h-Edit_summary-2020-08-23T18:54:00.000Z|[iv]]]</sup>, the Reply Tool will soon offer people the ability to customize the edit summaries that accompany comments posted with it. </div> <span lang="en" dir="ltr" class="mw-content-ltr">As part of implementing the custom edit summary functionality, we created a technical prototype.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">The prototype linked above implements – what we currently understand to be – the core custom edit summary functionality. It intentionally is <u>not opinionated</u> about interface polish/presentation.</span> </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> You can try the prototype by visiting this page: https://patchdemo.wmflabs.org/wikis/23fd7e0b373b74aceaf8ddec1d82ab09/w/index.php/Talk:Main_Page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If there are comments and/or questions that the prototype brings to mind, we would value you sharing them on the talk page here: [[Talk:Talk pages project/Replying/2020/08#h-Prototype:_custom_edit_summaries-2020-08-27T02:18:00.000Z]]. </div> === {{ymd|2020|8|7}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Deployment'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">On 6-August-2020, the Reply Tool became available as a Beta Feature at the following Wikipedias: Catalan, Chinese, Czech, Georgian, Korean, Serbian, Sorani Kurdish and Swedish.</span> === {{ymd|2020|7|31}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Metrics'' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">Earlier this week, the team completed an analysis that looked at how people on our four partner wikis have used the Reply tool between 31-March-2020 and 30-June-2020.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">The key question we were trying to answer with this analysis was: ''Do the people who have tried the tool find it valuable?''</span> *<span lang="en" dir="ltr" class="mw-content-ltr">In summary, we are confident that people who tried the Reply tool do find the tool valuable.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * ''You can read more detail about this analysis in the [[#Metrics|Metrics]] section below.'' </div> === {{ymd|2020|7|22}} === [[File:A screenshot comparing versions of visual mode's toolbar.png|thumb|362x362px|<span lang="en" dir="ltr" class="mw-content-ltr">A screenshot comparing two locations of the visual mode's text tools.</span>]] *<span lang="en" dir="ltr" class="mw-content-ltr">Metrics: the team is analyzing how people on our partner wikis have used the Reply Tool between 31-March-2020 and 30-June-2020. You can expect findings to be posted in the [[#Metrics|Metrics]] section below in the next two weeks.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Refinements: in response to the [[#Version 2.0 prototype|usability tests]] we ran in June, the team is working on a series of refinements/enhancements to the tool. These are listed below along with the conversations where we are discussing these enhancements:</span> **<span lang="en" dir="ltr" class="mw-content-ltr">Support for custom edit summaries: [https://www.mediawiki.org/w/index.php?title=Talk%3ATalk%20pages%20project/Replying/2020/04#c-PPelberg_%28WMF%29-2020-07-15T23%3A17%3A00.000Z-PPelberg_%28WMF%29-2020-06-26T23%3A57%3A00.000Z Talk:Talk pages project/Replying/2020/04#h-Design_feedback:_version_2.0_mockups-2020-04-04T00:15:00.000Z].</span> **<span lang="en" dir="ltr" class="mw-content-ltr">Adjustments to the toolbar: [[Talk:Talk pages project/Replying/2020/07#h-Adjustments_to_visual_mode's_toolbar-2020-07-17T01:12:00.000Z]]</span> === {{ymd|2020|6|26}} === [[File:TalkPages-Reply-v2.0.png|thumb|420x420px|<span lang="en" dir="ltr" class="mw-content-ltr">'''Mockup:''' this mockup shows a proposed design for version 2.0 of the new Replying feature. To see the design that has currently been implemented see the "Design" section below: [[#Version%201.0|#Version 1.0]].</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 2.0 usability test findings'' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">To evaluate whether the new features introduced in version 2.0 of the Replying tool are intuitive to Junior and Senior Contributors, we ran two usability tests that asked test participants to complete a series of tasks.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">These test findings are now available for you to review: [[#Version 2.0 prototype (usertesting.com + mediawiki.org)|Version 2.0 prototype (usertesting.com + mediawiki.org)]].</span> === {{ymd|2020|6|17}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 2.0 deployment'' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">Today, 17-June-2020, [[#Version 2.0|Version 2.0]] of the Reply tool became available in the following places:</span> **<span lang="en" dir="ltr" class="mw-content-ltr">Version 2.0 is now available as a Beta Feature on our partner Wikipedias (Arabic, Dutch, French and Hungarian).</span> **<span lang="en" dir="ltr" class="mw-content-ltr">Version 2.0 is now available for testing on all wikis by adding the following parameter to any talk page URL: <code>?dtenable=1</code>.</span> === {{ymd|2020|6|5}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 2.0 testing and deployment'' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">Usability tests being run on MediaWiki.org, at usertesting.com and on our four partner Wikipedias (Arabic, Dutch, French and Hungarian) are ongoing.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Once these tests are complete, findings will be summarized and posted to the [[#Usability testing|Usability testing]] section below.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 1.0 deployment'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">[[#Version%201.0|Version 1.0]] of the tool is now available for testing as a Beta Feature on [[Special:MyLanguage/MediaWiki|MediaWiki.org]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">To turn it on, visit [[Special:Preferences|Beta Features]] in your preferences and make sure the box next to "Discussion tools" is checked (☑️).</span> === {{ymd|2020|5|26}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 2.0 testing'' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">'''Version 2.0 of the Reply tool is ready for testing'''. It introduces functionality for pinging other people by typing @ and writing and styling comments in a new visual mode.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">You can find instructions for how to try the new version of the Reply tool here: [[Talk pages project/replying/prototype testing#Reply_tool_version_2.0|'''Version 2.0 test instructions''']].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 2.0 deployment'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">As of today, Version 2.0 of the Reply tool is available to everyone at our partner Wikipedias (Arabic, Dutch, French and Hungarian) via a custom URL.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">To try Version 2.0 of tool at these wikis, add the following text to any URL where the Reply tool is already available: <code>?dtvisual=1</code>.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Once we have evidence this new version is working as expected, it will become available as a Beta Feature on our partner wikis.</span> === {{ymd|2020|5|1}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 1.0 deployment'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">For ~4 weeks, [[#Version%201.0|Version 1.0]] of the new Replying tool has been available as a Beta Feature on our partner wikis.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">In line with [[#Step 2: Beta Feature|Step 2]] of our [[#Deployment|deployment process]], we have been focused on making sure the Reply tool is available on pages where discussions happen ''outside'' of talk namespaces. To this end...</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">You can now use the Reply tool on any page where the <code><nowiki>__NEWSECTIONLINK__</nowiki></code> syntax is present.</span> *** <span lang="en" dir="ltr" class="mw-content-ltr">''This means people can now use the Reply tool on pages like Dutch Wikipedia's [[:nl:Wikipedia:De_kroeg|The Pub]]. You can see the comments people are posting there by reviewing these [https://nl.wikipedia.org/wiki/Speciaal:RecenteWijzigingen?hidebots=1&hidecategorization=1&hideWikibase=1&tagfilter=discussiontools-reply&limit=500&days=14&urlversion=2 Recent Changes].''</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">Within the next week, the Reply tool will be available on in all namespaces where the [[Special:MyLanguage/Manual:$wgExtraSignatureNamespaces|Signature button]] is present.</span> *** <span lang="en" dir="ltr" class="mw-content-ltr">''This will mean you can use the Reply tool on pages without needing the "New section" tab to be available as well. This will be especially helpful on pages like French Wikipedia's [[:fr:Wikipédia:Le_Bistro|Le Bistro]], where conversations are transcluded from other pages.''</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">You can now use the Reply tool to reply to comments transcluded from another page.</span> *** <span lang="en" dir="ltr" class="mw-content-ltr">This means it is now possible to use the Reply tool on pages like the Dutch Wikipedia's page for discussing article deletions ([[:nl:Wikipedia:Te_beoordelen_pagina's|Wikipedia:Te_beoordelen pagina]]).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 2.0 development'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Our two areas of focus right now related to Version 2.0 are: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">Implementing an easy way to @-mention/ping other people.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Making it possible to switch back and forth between the source and visual text input modes.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Thank you to [[User:Pbsouthwood|Pbsouthwood]], [[User:Pelagic|Pelagic]], [[User:Samat|Samat]] and [[User:TheDJ|TheDJ]] for the efforts you have made offering [[Talk:Talk pages project/Replying/2020/04#h-Design_feedback:_version_2.0_mockups-2020-04-04T00:15:00.000Z|design feedback]] about the [[#Version 2.0|version 2.0 mockups]].'' </div> === {{ymd|2020|4|3}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 2.0 designs'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">We have designs ready for [[#Version%202.0|Version 2.0]] of the new Replying tool that we would value your feedback on.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">If you have any thoughts or questions, please post them on the talk page here: [[Talk:Talk pages project/Replying/2020/04#h-Design_feedback:_version_2.0_mockups-2020-04-04T00:15:00.000Z|Design feedback: version 2.0 mockups]].</span> === {{ymd|2020|3|31}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 1.0 deployment'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Today, [[#Version 1.0|Version 1.0]] of the new Replying tool became available as a Beta Feature on the following [[Special:MyLanguage/Talk pages project/Glossary|partner wikis]]: '''Arabic''', '''Dutch''', '''French''' and '''Hungarian'''.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">To ensure the new tool works in ways people expect, we will work together with volunteers at these four Wikipedias over the next couple of weeks to monitor how the feature is being used before deciding deploying it to more people on these as an opt-out user Preference.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">You can learn more about our deployment process below: [[#Step%202:%20Beta%20Feature|Deployment process]].</span> === {{ymd|2020|3|26}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 1.0 deployment'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Version 1.0 of the Replying feature is currently being tested. Assuming the QA process does not surface any critical issues, the new replying tool will be available as a [[Special:MyLanguage/Beta Features|Beta Feature]] on the Arabic, Dutch, French and Hungarian Wikipedias as soon as next week.</span> === {{ymd|2020|3|13}} === <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 1.0 deployment'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">The deployment of the new replying workflow as a [[Special:MyLanguage/Beta Features|Beta Feature]] on Arabic, Dutch, French and Hungarian Wikipedias will be '''delayed for an unspecified amount of time'''. The team will share an update on this page as soon as a new date is set.</span> === {{ymd|2020|3|12}} === <div lang="en" dir="ltr" class="mw-content-ltr"> '''Active''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 1.0 deployment'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">On '''Monday, 16-March-2020''', the team is planning to deploy Version 1.0 of the new workflow for replying to specific comments on talk pages as a [[Special:MyLanguage/Beta Features|Beta Feature]] on the following Wikipedias: Arabic, Dutch, French and Hungarian.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">You can read more about how this deployment decision was made below: [[#Deploying%20Version%201.0%20as%20a%20Beta%20Feature%20to%20partner%20wikis|Deploying Version 1.0 as a Beta Feature to partner wikis]].</span> * <span lang="en" dir="ltr" class="mw-content-ltr">If there are issues you think should be fixed that have not yet been prioritized, please mention something on the talk page: [[Talk:Talk pages project/replying]].</span> ''<span lang="en" dir="ltr" class="mw-content-ltr">Note: the team is especially interested in links to examples where using the Replying tool disrupts content elsewhere on the talk page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This Phabricator task is a good example of the kind of "disruption" we have in mind: [[phab:T246481]].</span>'' <div lang="en" dir="ltr" class="mw-content-ltr"> ''Version 2.0 development'' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">The team continues to develop the new functionality that will be introduced in [[#Version%202.0|Version 2.0]]. Functionality like drafting comments using a rich text/visual editing mode.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Recently completed''' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">''Version 1.0 instrumentation'': The team recently completed implementing and testing the instrumentation that will help them evaluate whether contributors are having success using the new Replying feature and whether contributors are using the tool in ways that could be negatively impacting the experience of others.</span> === {{ymd|2020|2|28}} === <div lang="en" dir="ltr" class="mw-content-ltr"> '''Active''' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">''Version 1.0 deployment:'' The team is working to resolve the highest priority issues that surfaced during the initial deployment. Once this is complete, the feature will be deployed as a [[Special:MyLanguage/Beta Features|Beta Feature]] to four target Wikipedias: [[:ar:الصفحة_الرئيسية|Arabic]], [[:nl:Hoofdpagina|Dutch]], [[:fr:Wikipédia:Accueil_principal|French]], and [[:hu:Kezdőlap|Hungarian]]. Before this happens, contributors to these wikis will be notified.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''Version 2.0 designs:'' The team is working on the designs for version 2.0. You can see an early iteration of the designs here: [[#Version 2.0]].</span> ** ''<span lang="en" dir="ltr" class="mw-content-ltr">Note: the team will formally ask for feedback on these designs in the coming weeks by starting a new discussion thread on the [[Talk:Talk pages project/replying|talk page]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Although, if you have feedback to share before then, the team would value you sharing it on the [[Talk:Talk pages project/replying|talk page]]''.</span>'' <div lang="en" dir="ltr" class="mw-content-ltr"> '''Recently completed''' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">''Version 1.0 deployment:'' on '''Tuesday, 18-February''', Version 1.0 of the feature became live via a custom URL for testing in production, on four Wikipedias: Arabic, French, Dutch and Hungarian.</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">We, along with many of you (thank you!), have been testing the feature extensively to make sure it appears where it should and behaves how we expect. You can read and add to the conversations where people are sharing feedback in these places: [[Talk:Talk pages project/replying|MediaWiki]], [[:ar:ويكيبيديا:الميدان/تقنية#%D8%A3%D8%AF%D8%A7%D8%A9_%D8%A7%D9%84%D8%B1%D8%AF%D8%8C_%D8%B5%D9%81%D8%AD%D8%A7%D8%AA_%D8%A7%D9%84%D9%86%D9%82%D8%A7%D8%B4|Arabic Wikipedia]], [[:nl:Wikipedia:De_kroeg#Update_on_new_Discussion_Tools|Dutch Wikipedia]], [[:fr:Discussion_Projet:Outils_de_discussion|French Wikipedia]] and [[:hu:Wikipédia:Konzultáció_a_vitalapokról_és_a_közösségi_kommunikációról|Hungarian Wikipedia]].</span> *<span lang="en" dir="ltr" class="mw-content-ltr">''Deployment status and process'': the team published information about why, how and where the Replying feature is and will be deployed here: [[#Deployment]].</span> === {{ymd|2020|2|17}} === <div lang="en" dir="ltr" class="mw-content-ltr"> '''Active''' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">''Version 1.0 deployment:'' this week, the team will deploy version 1.0 of the new replying workflow to the first set of production Wikipedias (Arabic, Dutch, French and Hungarian). For the time being, the new feature will only be accessible using a [[:en:Query_string|custom URL]]. This way, the team can safely test the feature without impacting anybody else's experience. If this testing goes well, the feature will then be deployed as an opt-in [[Special:MyLanguage/Beta Features|Beta Feature]].</span> *<span lang="en" dir="ltr" class="mw-content-ltr">''Version 2.0'': the team is working on the design of the next iteration of the feature. If you would like to review and add your feedback on the latest design, please review this {{ll|Phabricator}} task: [[phab:T235593|T235593]].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Recently completed''' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Finalized the list of features that will be included in the next iteration of the feature. You can review the list of features that are planned here: [[#Versions]].</span> === {{ymd|2020|1|24}} === <div lang="en" dir="ltr" class="mw-content-ltr"> '''Active''' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Finishing development of version 1.0 ahead of the team's planned deployment of the new replying workflow to four wikis, beginning as an opt-in [[Special:MyLanguage/Beta Features|Beta Feature]], in mid- to late-February.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Adding instrumentation to the new replying workflow. This will enable the team to measure how contributors are engaging with the workflow once it is deployed and determine whether adjustments need to be made to make it more intuitive.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Recently completed''' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Finalized the user interface for version 1.0 of the feature, including how real time previewing will look and function. You can see a mockup for what it will look like once version 1.0 of the feature is deployed here: [[:File:New replying mockup (v1.0).png|File:New replying mockup (v1.0)]].</span> ==={{ymd|2019|12|17}}=== <div lang="en" dir="ltr" class="mw-content-ltr"> '''Active''' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">''Prototype:'' the team is running an on-wiki user test of version 1.0 of the prototype. We would value you trying it out! To try the prototype and participate in the test, please visit: [[Special:MyLanguage/Talk pages project/replying/prototype testing#Version 1.0 prototype test|'''Prototype version 1.0 usability test''']]</span> *<span lang="en" dir="ltr" class="mw-content-ltr">''Measurement:'' the team is drafting a plan for how we intend to measure the quantitative impact of the improved workflow for replying to specific comments.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Recently completed''' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">''User testing:'' the team recently completed two user tests. Both tests involved people familiar with Wikipedia and who have little or no experience participating on Wikipedia talk pages. The first test was meant to identify the challenges people face when trying to participate on talk pages using the existing experience. The second test is meant to identify usability issues with version 1.0 of the prototype for the improved workflow for replying to specific comments. Read more about these tests below: [[#User testing|'''User testing''']].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Objectives == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This work is intended to make participating ''productively'' on talk pages easier and more intuitive for contributors. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Easier" means more experienced contributors can participate in existing discussions with less effort, and "intuitive" means newer contributors do not need specialized knowledge to figure out how to add their thoughts to a conversation. Said in a different way: as a result of this work, both newer and more experienced contributors should report the workflow for participating in existing discussions to be "obvious" and "approachable." </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is important to note the mention of "participating productively" in the first paragraph of this section. We appreciate it is not enough to build tools that simply encourage contributors to "talk more"; they need to encourage people to work together to help improve the project they are discussing. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> While we are still defining how to measure the impact of this feature, a key part of this work will involve figuring out how to understand the impact this new affordance has had on the quality of discussions on the talk pages it is deployed to. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Impact == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''This section discusses the three quantitative analyses we have planned to evaluate the usefulness, usability and impact of the Reply Tool. These analyses are discussed in detail below.'' </div> <onlyinclude> <div lang="en" dir="ltr" class="mw-content-ltr"> === Analysis 3: Impact === </div> [[File:Reply Tool A-B test comment completion.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">Percent of Junior Contributors that completed at least one comment attempt on a talk page during the AB test.</span> |thumb|296x296px|<span lang="en" dir="ltr" class="mw-content-ltr"><nowiki>Percent of Junior Contributors that completed at least one comment attempt on a talk page during the AB test. | </nowiki>[https://wikimedia-research.github.io/Reply-tools-analysis-2021/ Source]</span>]] [[File:Reply Tool A-B test revert rate.png|alt=<span lang="en" dir="ltr" class="mw-content-ltr">The percent of comments made by Junior Contributors on talk pages that were reverted within 48 hours of being published.</span>|thumb|299x299px|<span lang="en" dir="ltr" class="mw-content-ltr"><nowiki>The percent of comments made by Junior Contributors on talk pages that were reverted within 48 hours of being published. | </nowiki>[https://wikimedia-research.github.io/Reply-tools-analysis-2021/ Source]</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> In this last analysis, we sought to learn two things: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">Does the Reply Tool cause Junior Contributors to be more successful publishing comments on talk pages?</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Does the Reply Tool cause more disruption to other volunteers?</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To answer the questions above, we ran an A/B test of the Reply Tool from [[#12 February 2021|11 February]] through [[#16 March 2021|10 March]] on 22 Wikipedias. The results from this test can be found in the "Findings" section below. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Timing'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This analysis was completed on 23-April-2021. The A/B test ran from 11-Febraury-2021 through 10-March-2021. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Conclusions'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The clear evidence that shows the Reply Tool causes a greater percentage of Junior Contributors to publish a comment without a significant increase in disruption, signals to the team that it would benefit all Wikimedia Projects and volunteers to have the Reply Tool made available as an opt-out preference. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Findings'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The data below included logged-in users who had not previously interacted with the Reply Tool (defined as users whose <code>discussiontools-editmode</code> preference was empty). </div> *<span lang="en" dir="ltr" class="mw-content-ltr">'''72.9% of Junior Contributors''' who had access to the Reply Tool were able to publish at least one comment during the A/B test compared to 27.6% of Junior Contributors who did NOT have access to the Reply Tool.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Junior contributors were '''7.2 times more likely''' to publish a comment than junior contributors using page editing.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">There was a '''79.5% decrease in the revert rate''' of comments Junior Contributors made with the Reply Tool compared to comments Junior Contributors made with page editing.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Report'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> You can review the full analysis results here: https://wikimedia-research.github.io/Reply-tools-analysis-2021/<nowiki/>/. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Analysis 2: Engagement === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The next analysis we did was needed to help determine whether people, across experience levels, were having success using the Reply Tool and whether people were using the tool in ways that degrades the experiences of others. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This analysis's findings were used to decide whether the Reply Tool is functioning well enough for its impact on user behavior to be tested via a larger-scale (read: at wikis beyond our partner wikis) A/B test. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Timing'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This analysis was completed on 5-January-2021 </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Conclusions'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The high rate at which people who used the Reply Tool to publish the comments they started writing, combined with the lack of clear evidence of disruption, led the team to think the Reply Tool was ready to be tested at a larger scale via an A/B test. More details below. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Findings'' </div> *<span lang="en" dir="ltr" class="mw-content-ltr">The edit completion rate for Junior Contributors using the Reply Tool is 4x higher than the edit completion rate for people using full-page wikitext editing. [https://nbviewer.jupyter.org/github/wikimedia-research/Discussion-tools-analysis-2020/blob/master/Engagement-Metrics/Reply-Tool-Workflow-Engagement-Metrics.ipynb#Reply-Tool-(Wikitext-and-VE)-vs-Full-Page-Wikitext Source]</span> *<span lang="en" dir="ltr" class="mw-content-ltr">People who have made <1,000 cumulative edits, are between 32% and 510% more likely to publish edits with the Reply Tool (across modes) than they are with full page wikitext talk page editing. [https://nbviewer.jupyter.org/github/wikimedia-research/Discussion-tools-analysis-2020/blob/master/Engagement-Metrics/Reply-Tool-Workflow-Engagement-Metrics.ipynb#Reply-Tool-(Wikitext-and-VE)-vs-Full-Page-Wikitext Source]</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><1% of comments Junior Contributors post with the Reply Tool are reverted within 48 hours, across wikis (this number is higher for Senior Contributors ). [https://nbviewer.jupyter.org/github/wikimedia-research/Discussion-tools-analysis-2020/blob/master/Engagement-Metrics/Reply-Tool-Workflow-Engagement-Metrics.ipynb#By-Wiki-and-Experience-level Source]</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Analysis 1: Adoption === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In this first analysis, we sought to learn whether people at the Arabic, Dutch, French and Hungarian Wikipedias, where the Reply Tool had been available as a Beta Feature since 31-March-2020, were finding the tool valuable. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To determine the extent to which people were "finding the tool valuable" we looked at how frequently people were using the tool (as measured by the number of distinct days they use it on) and how intensely people were using the tool (as measured by the total number of edits they make with the Reply Tool and the percentage of total talk page edits they used the Reply Tool to make). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Understanding the above helped us determine the tool was ready to be made available as an opt-out feature at these wikis and made available as an opt-in Beta Feature at others. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Timing'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This analysis was completed on 28-July-2020. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Findings'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The data below included people who have used the Reply Tool as a Beta Feature at the Arabic, Dutch, French and Hungarian Wikipedias, between 31-March and 30-June-2020: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">'''328 people''' posted at least one comment using the Reply Tool</span> *<span lang="en" dir="ltr" class="mw-content-ltr">'''69.5% of people''' posted ≥ 2 comments with the Reply Tool</span> *<span lang="en" dir="ltr" class="mw-content-ltr">'''61.3% of people''' posted a comment using the Reply Tool on ≥ 2 distinct days</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">A "distinct day" was defined as a distinct calendar day. Therefore, some of these edits may have occurred 24 hours apart and some may have occurred only a few hours apart depending on what time of day the edit was made.</span> </ref> *<span lang="en" dir="ltr" class="mw-content-ltr">'''23.6% of people''' used the Reply Tool to make over half of their talk page edits</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">This data is a bit noisy in so far as there are some edits that cannot be made with the Reply Tool (e.g. starting a new section, editing existing content, etc.) and the software is not currently able to differentiate between comments and other talk page edits.</span> </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ''Report'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> You can review the full analysis results in this [[:en:Project Jupyter#Jupyter%20Notebook|Jupyter notebook]]: https://nbviewer.jupyter.org/github/wikimedia-research/Reply-tools-analysis-2021/blob/master/Adoption-Metrics/Replying-Tool-Adoption-Metrics.ipynb. </div> </onlyinclude> <span id="Background"></span> == Hintergrund == <div lang="en" dir="ltr" class="mw-content-ltr"> This year, the [[Special:MyLanguage/Editing team|Editing Team]] is committed to improving how contributors communicate and collaborate on Wikipedia, using talk pages. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For talk pages to be valuable, contributors need to intuitively know how to participate in the conversations that happen on them. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The trouble is – as [[Special:MyLanguage/Flow/Moderated Testing, November, 2014: talk pages and Flow#Findings: Tasks on Talk Pages|previous user testing]], the [[Special:MyLanguage/Talk pages consultation 2019/Phase 1 report|Talk Page Consultation]] and the [https://docs.google.com/presentation/d/1GF1CgDNBOnWorqGFXvvbHJmgBDnGlgszaEIIG98tKLs/edit#slide=id.g618b5fa040_1_44 team's research] uncovered – contributors, across experience levels, find replying to specific comments on Talk pages to be challenging. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Specifically, the team's research has found: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">More experienced contributors find it difficult to locate the specific comment they are wanting to reply to when participating in long, multi-person conversations, within big blocks of wikitext.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Newer contributors report not being sure how to reply to a conversation, regardless of its length or complexity.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In exploring an affordance for replying to specific comments on talk pages, we are striving to make participating ''productively'' on talk pages easier and more intuitive. We think doing so will help newer contributors understand and use talk pages as places to communicate with others and help more senior contributors collaborate more efficiently. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Challenges == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> One part of building new features is codifying social conventions in software. In this context, "conventions" could mean deciding what character the software should use for automatically indenting or outdenting replies. "Conventions" could also mean deciding how the software should represent the first comment in a discussion in wikitext: ''Is there a linebreak between the reply and the original comment? Is the reply added to the line immediately following the original comment in the discussion? Is there another way this comment should be represented?'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is unlikely all communities will answer these questions in the same way. This means the software needs to be built in a flexible enough way to accommodate these different preferences. This is possible, although it adds complexity to the design and development processes. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Design == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To increase the likelihood this enhancement is useful for contributors across experience levels, we have broken down the improvements we have planned into a series of releases. These different releases are outlined in more detail in the "[[#Versions|Versions]]" section below. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Also below are the latest iteration for the designs we are planning to implement in Version 1.0. If you have thoughts about anything included in this section, we would value you sharing them on the talk page: [[Talk:Talk pages project/replying]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''❗️Please consider the features included below as drafts and expect them to evolve as we learn new things.'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Versions === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Version 1.0 ==== </div> [[File:New replying mockup (v1.0).png|thumb|535x535px|<span lang="en" dir="ltr" class="mw-content-ltr">'''Version 1.0:''' a mockup showing version 1.0 of the new workflow for replying to specific comments on talk pages.</span>|alt=]] <div lang="en" dir="ltr" class="mw-content-ltr"> This version will introduce the basic reply functionality to validate the core workflow. This version will likely include the following features: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">An affordance for replying to specific comments</span> * <span lang="en" dir="ltr" class="mw-content-ltr">A text box for composing replies using wikitext</span> * <span lang="en" dir="ltr" class="mw-content-ltr">A way for signatures to be appended to comments, automatically</span> * <span lang="en" dir="ltr" class="mw-content-ltr">A way for those comments to be indented or outdented, automatically</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can try a prototype of version 1.0 of the new replying workflow here: https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Talk:Cats. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A mockup showing how version 1.0 will likely look once it is deployed can be seen in this screenshot: [[:File:New replying mockup (v1.0).png|File:New replying mockup (v1.0).png]] </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Version 2.0 ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Assuming version 1.0, and any smaller releases that follow, helps us to validate and refine the core replying functionality, version 2.0 will ''likely'' include enhancements to make it easier and intuitive for Junior Contributors to draft and post their replies. This version will ''likely'' include the addition of the following features: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Opt-in/out of watching the talk page as part of the replying workflow</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Populating the reply text input with instructional text to make it clear who you are responding to.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Drafting and formatting replies using a rich text editor</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Switching between "rich text" and "source" writing modes while preserving any content contributors have already written</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Mentioning/notifying specific users in a conversation without needing to know about or interact with wikitext</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Editing a specific comment</span> **<span lang="en" dir="ltr" class="mw-content-ltr">''Note: It is '''not likely''' editing a specific comment will be included in the initial release of version 2.0. This is due to the technical complexity involved with implementing this functionality. You can learn more about this "technical complexity" and the initial implementation we have planned in Phabricator here: [[phab:T245225|T245225]].''</span> <gallery mode="slideshow"> File:TalkPages-Reply-v2.0.png|<span lang="en" dir="ltr" class="mw-content-ltr">'''Version 2.0 overview:''' a mockup showing how version 2.0 of the new replying workflow could look.</span> File:Reply-v2-Visual.png|<span lang="en" dir="ltr" class="mw-content-ltr">'''Version 2.0. (visual):''' an annotated mockup showing the new Replying feature's visual text input mode.</span> File:Reply-V2-Source.png|<span lang="en" dir="ltr" class="mw-content-ltr">'''Version 2.0 (source):''' an annotated mockup showing the new Replying feature's source (read: wikitext) text input mode.</span> </gallery> <div lang="en" dir="ltr" class="mw-content-ltr"> == Deployment == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''This section contains information about how and where the Replying feature is and will be deployed.'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ===Deployment status=== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To see what projects the Reply Tool is available, please visit: {{ll|Talk pages project#Active initiatives}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Deployment decisions === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deploying Version 1.0 as a Beta Feature to partner wikis''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> On Monday, 16-March-2020, the team is planning to deploy Version 1.0 of the new workflow for replying to specific comments on talk pages as a Beta Feature on the following Wikipedias: Arabic, Dutch, French and Hungarian. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This decision is the outcome of the team being confident in the following: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">Reply links are available in the places (read: talk pages, across namespaces) where people expect them to be.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">The core parts of the Replying workflow (e.g. writing a comment, previewing a comment, formatting a comment, discarding a comment and publishing a comment) are working in the ways people expect.</span> *<span lang="en" dir="ltr" class="mw-content-ltr">The Replying workflow is not disrupting existing talk page content.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This confidence is based on the team and volunteers testing the new Replying workflow on '''>75 different talk pages''' in '''three talk namespaces''' on the '''4 Wikipedias''' where the feature will be deployed. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This testing proved necessary for identifying and resolving issues related to the core parts of the replying workflow. Issues like: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">The replying text box remaining after cancelling a reply: [[phab:T245574]].</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Reply links appearing after list items that were ''not'' comments: [[phab:T245692]] (thank you, [https://www.mediawiki.org/w/index.php?title=User:Bdijkstra User:Bdijkstra]).</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Reply links ''not'' appearing after comments that contained signatures with an invisible Unicode character: [[phab:T245784]].</span> *<span lang="en" dir="ltr" class="mw-content-ltr">The reply tool not working in Safari: [[phab:T245781]].</span> *<span lang="en" dir="ltr" class="mw-content-ltr">The reply tool removing a page from your watchlist: [[phab:T245579]] (thank you, [https://www.mediawiki.org/w/index.php?title=User:Tacsipacsi User:Tacsipacsi]).</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Broken and incomplete table syntax causing page corruption: [[phab:T246481]].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This testing was also important for identifying additional use cases the team is actively working to provide support for. Use cases like being able to reply to comments transcluded from a subpage. For more details on this work, see this Phabricator task: [[phab:T245694]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ===Deployment process === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The deployment of this feature will happen in four steps. These four steps are described below. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Before the team decides to move on to the next step in the deployment process, they will do two things: </div> #<span lang="en" dir="ltr" class="mw-content-ltr">Make contributors affected by the next planned deployment aware of where to test the version of the feature the team is planning to deploy, how the feature will be deployed and what informed the deployment decision. ''Announcements containing this information will be posted as [[#Status_updates|updates]] on this [[Special:MyLanguage/Talk_pages_project/replying|project page]] and publicly on all wikis affected by the planned deployment.''</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Invite contributors to share their input about the next deployment the team is planning. ''Contributors will be invited to share their input about the next deployment on [[Talk:Talk_pages_project/replying|the talk page]] and on pages where the deployment is announced.''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ====Step 1: Beta cluster==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deployment goal''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The goal of this step in the deployment process is to answer these questions: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">''Do contributors find replying to comments using the feature intuitive?''</span> *<span lang="en" dir="ltr" class="mw-content-ltr">''Are any parts of the workflow broken (e.g. writing and formatting a reply, cancelling a reply, previewing a reply, publishing a reply)?''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deployment details''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To make sure the feature behaves in ways contributors expect, new versions of the feature will be deployed to the [[Special:MyLanguage/Beta_Cluster|Beta Cluster]]. This way, contributors will be able to safely experiment with new versions of the Replying feature without needing to worry about affecting existing content or contributors. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ====Step 2: Beta Feature==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deployment goal''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The goal of this step in the deployment process is to answer these questions: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">''Is the feature available where it should be?''</span> *<span lang="en" dir="ltr" class="mw-content-ltr">''Does the feature affect existing talk page content in unintended ways?''</span> *<span lang="en" dir="ltr" class="mw-content-ltr">''Are there any issues that prevent contributors from being able to respond to comments?''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deployment details''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To make sure the feature behaves in ways contributor expect on ''production'' wikis before exposing the feature to a large number of people, the feature will be deployed as a '''[[Special:MyLanguage/Beta_Features|Beta Feature.]]''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Step 3: User Preference (opt-out) ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deployment goal''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The goal of this step in the deployment process is to answer these questions: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">''Are people able to successfully post replies using the feature?''</span> *<span lang="en" dir="ltr" class="mw-content-ltr">''Is the feature having any unintended affects (e.g. encouraging disruptive talk page comments edits)?''</span> *<span lang="en" dir="ltr" class="mw-content-ltr">''Are people finding the feature valuable?''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deployment details''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To determine whether a broad range of people are having success using the feature and are finding it valuable, the feature will be deployed as an '''[[:en:Opt-out|opt-out]] [[Special:MyLanguage/Manual:User_preferences|User Preference]].''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ====Step 4: A/B test ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deployment goal''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The goal of this step in the deployment process is to understand whether the feature had the impact it was intended to have. To determine this, we will use this deployment step to answer: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">''Does the new replying feature make it easier and more intuitive for Junior and Senior Contributors to respond to specific comments on Wikipedia talk pages?''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Deployment details''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To determine whether the feature had the impact it was intended to have, the team will run an A/B test on a to-be-determined set of wikis. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''The team is finalizing the details of this A/B test.'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ====Step 5: All wikis==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If evidence from the previous 4 deployment steps suggests the new Replying feature makes replying to specific comments on talk pages easier and more intuitive for Junior and Senior Contributors, it will be deployed to all remaining Wikipedias. Determining how and when the feature is deployed depends on the team, along with volunteers from those wikis, being confident the feature works reliably and in ways people expect it to. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Usability testing == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''This section contains information about user testing the team conducts to ensure the revised experience works in ways contributors expect.'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Version 2.0 prototype === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To evaluate whether the new features introduced in version 2.0 of the Replying tool are intuitive to Junior and Senior Contributors, we ran two usability tests that asked test participants to complete a series of tasks: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">One test recruited '''[[Special:MyLanguage/Talk pages project/Glossary|Junior Contributors]]''' (read: people familiar with reading Wikipedia and who have little-to-no experience using Wikipedia talk pages) via usertesting.com.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">One test recruited '''[[Special:MyLanguage/Talk pages project/Glossary|Senior Contributors]]''' (read: people who have experience using Wikipedia talk pages) via MediaWiki.org.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Overall, these tests demonstrated the majority of Junior and Senior Contributors were successful in using Version 2.0 of the Reply tool to write, format and publish comments on Wikipedia talk pages. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ''You can learn about the overall impressions people had, the key areas for improvement and next steps below.'' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Overal impressions''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Senior Contributors described the tool as well-balanced and expressed appreciation for the new automatic pinging feature. Here are a few noteworthy comments: </div> * <span lang="en" dir="ltr" class="mw-content-ltr">''"I can insert a link to an [sic] user page inserting an @, after which a list of usernames pops up. That is nice."''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''"...this [pinging] is a game changer."''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''"Nice tool for both beginners and experienced users."''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''"Good tool, simple to use, it's good for what it's made for."''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Junior Contributors who were able to find the Reply tool successfully completed the tasks they were asked to and described the tool as being intuitive and straightforward to use. </div> <span lang="en" dir="ltr" class="mw-content-ltr">With this said, when peoples' focus moved from the Reply tool to the broader talk page, they became confused and uncertain about "where" they were and what they ought to do.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">Junior Contributors not recognizing talk pages as places to communicate with other editors is a finding that continues to surface<sup>[[Special:MyLanguage/Talk pages project/New discussion#Usability%20testing|[1]]]</sup> and something we plan to address later in the {{ll|Talk pages project}}.</span> </ref> <span lang="en" dir="ltr" class="mw-content-ltr">Here are a few comments we thought were noteworthy:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''"It was pretty straightforward. streamlined process here i like the fact that it's very stripped down and doesn't feel data intense.so not overwhelming by any stretch of the imagination. the colors are pleasing to the eye... simple to navigate interface. Overall it works the way i'd expect it to."''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''"I'm a little confused about what User talk: Alice is..."''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">''"Doesn't look like the sort of usual messaging interface you might see on a website."''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Task analysis''' </div> <span lang="en" dir="ltr" class="mw-content-ltr">The table below shows whether participants in each test group were able to complete the following tasks with Version 2.0 of the Reply tool.</span><ref> <span lang="en" dir="ltr" class="mw-content-ltr">These test findings were compiled on 10-June-2020.</span> </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> You can review the broader themes these tests helped our team identify in the "Key themes" section below. </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Task description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Junior Contributors</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Senior Contributors</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Identify''' the way to reply to a comment on the talk page</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">9/10 were successful</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">13/13 were successful</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Type''' a comment using the new visual mode</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">9/10 were successful</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">13/13 were successful</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Format''' the content they had written using the visual mode's formatting tools</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">8/10 were successful</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">13/13 were successful</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Ping''' someone who has already commented in the section they are commenting in</span> |⚠️ <span lang="en" dir="ltr" class="mw-content-ltr">6/10 were successful</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">10/13 were successful</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Ping''' someone who has ''not'' already commented in the section they are commenting in</span> |⚠️ <span lang="en" dir="ltr" class="mw-content-ltr">7/10 were successful</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">10/13 were successful</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Remove''' one of the pings they created</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">8/10 were successful</span> |⚠️<span lang="en" dir="ltr" class="mw-content-ltr">9/13 were successful</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Review''' how the comment they wrote will appear in wikitext ''before'' publishing</span> | <span lang="en" dir="ltr" class="mw-content-ltr">''Not asked''</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">13/13 were successful</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Publish''' the comment they wrote</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">9/10 were successful</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">13/13 were successful</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">'''Locate''' the comment they published</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">9/10 were successful</span> |✅<span lang="en" dir="ltr" class="mw-content-ltr">13/13 were successful</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> '''Areas for improvement''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> These are the broader areas for improvement that surfaced through these usability tests. You can review how we plan to address these themes in the "Next steps" section below. </div> # <span lang="en" dir="ltr" class="mw-content-ltr">The tool's two modes: visual and source:</span> #* <span lang="en" dir="ltr" class="mw-content-ltr">Some Senior Contributors were surprised to learn when viewing a diff that the visual mode automatically signed the comment they posted.</span> #* <span lang="en" dir="ltr" class="mw-content-ltr">Some Junior Contributors did not find the difference between the visual and source modes to be clear.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Pinging</span> #* <span lang="en" dir="ltr" class="mw-content-ltr">Some Senior Contributors said they would not have known the pinging feature was available had they not been instructed to try it.</span> #* <span lang="en" dir="ltr" class="mw-content-ltr">Some Senior Contributors wondered whether Junior Contributors would be confused by the normal link inspector that is presented when a ping within a drafted comment is selected.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Commenting in long threads</span> #* <span lang="en" dir="ltr" class="mw-content-ltr">Senior Contributors found it can be easy to "lose the tool" when trying to comment in a conversation and/or on a page with many comments.</span> #** <span lang="en" dir="ltr" class="mw-content-ltr">An example: when trying to respond to a comment that has many existing replies, it can be difficult to simultaneously look at the comment you are responding to and the comment you are drafting using the Reply tool.</span> #* <span lang="en" dir="ltr" class="mw-content-ltr">Senior Contributors found the tools within the visual mode hard to "reach" when working on a large screen and when writing a lengthier comment.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Edit summaries</span> #* <span lang="en" dir="ltr" class="mw-content-ltr">Some Senior Contributors wondered whether supports for custom edit summaries would be added.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Next steps''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To address the issues and opportunities these two usability tests surfaced, the team will be working on improvements to make the following come true; </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Contributors, across experience levels, can easily mention/ping another person in the comment they are writing.</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">''Example improvement: adding an icon to the visual mode's toolbar that communicates there is a feature for pinging people.''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Contributors, across experience levels, know how the tool's two input modes function and how they relate to one another.</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">''Example improvement: revising what the visual / source modes are called and how prominently they appear in the interface.''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Contributors, across experience levels, find the tool well suited for commenting in talk page conversations, regardless of how many conversations (read: sections) and comments they contain.</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">''Example improvement: revising where the text input area appears on the page and how it behaves when the page is scrolled.''</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can track the progress we make on the areas above by watching this page and/or by reading this Phabricator workboard: [[phab:project/view/4546/|phab:Reply tool version 2.0]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Version 1.0 prototype=== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To see how the version 1.0 prototype affected [[Special:MyLanguage/Talk_pages_project/Glossary|Junior Contributors']] experience replying in conversations on talk pages, the team ran a control test with [https://www.nngroup.com/articles/why-you-only-need-to-test-with-5-users/ 5 participants] on [https://office.wikimedia.org/wiki/UserTesting.com usertesting.com]. You can review the test findings below. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ====How were we testing? ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This usability test was run on [https://www.usertesting.com/ usertesting.com] with 5 participants who were each screened to ensure they were technically advanced web users who have used Wikipedia before. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In order to compare the revised replying workflow to the [[#What did we find?|existing workflow]], each test participant was asked to complete the same tasks on a desktop computer, while narrating their experience: </div> #<span lang="en" dir="ltr" class="mw-content-ltr">Navigate to an existing discussion happening on a test wiki talk page</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Draft and publish a response in that discussion</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Locate their published response on the talk page</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Navigate to the talk page's history page and locate the reply they had just posted</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Start drafting another reply, but discard it before publishing</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ====What did we find?==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Overall, the prototype seems to have improved Junior/newer contributors' experiences replying in an existing conversations. On average, it took participants using the prototype half the time to publish a reply compared to the time it took them in the [[#Existing_reply_experience:_13-Dec-2019|previous test]], using full page editing. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Task completion </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''✅All participants''' were able to locate the specific discussion on the talk page they were being instructed to reply to</span> * <span lang="en" dir="ltr" class="mw-content-ltr">'''✅All participants''' successfully composed and published a reply in an existing discussion</span> * <span lang="en" dir="ltr" class="mw-content-ltr">'''✅All participants''' properly indented and signed their comments</span> ** <span lang="en" dir="ltr" class="mw-content-ltr">''Note: the tool does this for them automatically.''</span> * <span lang="en" dir="ltr" class="mw-content-ltr">'''✅All participants''' were able to locate their published response on the talk page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">'''✅All participants''' were able to find the talk page history page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">'''❌1 out of 5 participants''' was able to quickly locate the edit they had just made on the talk page's history page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">'''✅All participants''' were able to cancel their second reply before publishing it</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Results </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The prototype seems to have made it easier for Junior/newer contributors to reply to existing conversations on talk pages. Test participants used phrases like, "straight-forward," "no-problem whatsoever," and "really easy" to describe their experiences. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> With this said, there are still parts of the replying workflow participants found difficult that could be improved: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">Making it easier to visually distinguish between different replies in a discussion</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Making it easier to identify who the author of a comment is and who they are responding to</span> *<span lang="en" dir="ltr" class="mw-content-ltr">Making the "Reply" call to action easier to discover</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Revising the automatically generated edit summary to make it easier for contributors to identify their reply on the History page.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> More details can be found in this ticket on Phabricator: [[phab:T236921#5744471|T236921#5744471]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Next steps''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The team will decide if and when to make the improvements mentioned above (e.g. making it easier to visually distinguish between different replies in a discussion) and do further testing with more experienced contributors (this has started here: [[Special:MyLanguage/Talk_pages_project/replying/prototype_testing#Version_1.0_prototype_test|Version 1.0 prototype test]]). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ===Existing reply experience=== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To identify the challenges [[Special:MyLanguage/Talk_pages_project/Glossary|Junior Contributors]] face when trying to participate in conversations on talk pages, the team ran a control test of the existing (full page) editing workflow. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ====How were we testing?==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This usability test was run on [https://www.usertesting.com/ usertesting.com] with [https://www.nngroup.com/articles/why-you-only-need-to-test-with-5-users/ 5 participants] who were each screened to ensure they were technically advanced web users who have used Wikipedia in some capacity before. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Each test participant was asked to do the following tasks on a desktop computer, while narrating their experience: </div> #<span lang="en" dir="ltr" class="mw-content-ltr">Navigate to an existing discussion happening on a test wiki talk page</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Draft and publish a response in that discussion</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Locate their published response on the talk page</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Start drafting another reply, but discard it before publishing</span> #<span lang="en" dir="ltr" class="mw-content-ltr">Navigate to the talk page's history page and locate the reply they had just posted</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ====What did we find?==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Below is a summary of our findings from this user test. More details can be found in this ticket on Phabricator: [[phab:T239175#5723843|T239175#5723843]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Task completion </div> *<span lang="en" dir="ltr" class="mw-content-ltr">'''✅All participants''' were able to locate the specific discussion on the talk page they were being instructed to reply to</span> *<span lang="en" dir="ltr" class="mw-content-ltr">'''✅All participants''' successfully composed and published a reply in an existing discussion</span> *<span lang="en" dir="ltr" class="mw-content-ltr">❌'''0 out of 5 participants''' properly indented and signed their comments</span> *<span lang="en" dir="ltr" class="mw-content-ltr">❌'''1 out of 5 participants''' noticed they had not signed their comments</span> **<span lang="en" dir="ltr" class="mw-content-ltr">''This one person remarked, "I probably should have put my user name, but i didn't".''</span> *<span lang="en" dir="ltr" class="mw-content-ltr">'''3 out of 5 participants''' were able to locate their published response on the talk page.</span> **<span lang="en" dir="ltr" class="mw-content-ltr">''Note: it took several participants multiple minutes to do this''</span> *<span lang="en" dir="ltr" class="mw-content-ltr">'''✅4 out of 5 participants''' were able to find the talk page history page and locate the reply they had just posted</span> *<span lang="en" dir="ltr" class="mw-content-ltr">'''✅4 out of 5 participants''' were able to cancel their second reply before publishing it</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Results </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This test highlighted an important tension many Junior Contributors seem to face: they finish the task they set out to complete without realizing they might have done so incorrectly. And if they do realize they have made a mistake, they are not equipped to fix it because the proper conventions are not intuitive enough for them to understand. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Next steps''' </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The team will be doing two things in response to this test: </div> *<span lang="en" dir="ltr" class="mw-content-ltr">The team will be doing additional testing in different namespaces and languages (see: [[Special:MyLanguage/Talk_pages_project/Updates#Partner_wikis|Partner wikis]]).</span> *<span lang="en" dir="ltr" class="mw-content-ltr">We will run a usability test of the prototype with contributors, across experience levels, to see how it affects their experiences replying to comments on talk pages.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == History == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Many projects have, and are, working to improve contributors' experiences with talk pages. This project is better off for their existence. Some of the projects the team continues to learn from are listed on the [[Special:MyLanguage/Talk pages project#References|main project page]] and below. If there is a project you think we should be aware of, please boldly add it here. </div> * [[:ru:Участник:Jack_who_built_the_house/Удобные_дискуссии|<span lang="en" dir="ltr" class="mw-content-ltr">Convenient Discussions</span>]] * [[m:Special:MyLanguage/Collaboration/Flow_satisfaction_survey/Report|<span lang="en" dir="ltr" class="mw-content-ltr">Flow satisfaction survey</span>]] * {{ll|Flow/Moderated Testing, November, 2014: talk pages and Flow|2=<span lang="en" dir="ltr" class="mw-content-ltr">Moderated Testing, November 2014: talk pages and Flow</span>}} * [[w:User_talk:Enterprisey/reply-link|<span lang="en" dir="ltr" class="mw-content-ltr">Reply-link</span>]] * {{ll|Talk pages consultation 2019|2=<span lang="en" dir="ltr" class="mw-content-ltr">Talk pages consultation</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> == Glossary == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The [[Special:MyLanguage/Talk pages project/Glossary|Talk pages project glossary]] is intended to help us all communicate about talk pages more effectively by making sure we have a shared understanding about the words we use in our discussions and documentation throughout the project. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * <span lang="en" dir="ltr" class="mw-content-ltr">https://quarry.wmflabs.org/query/48614 – Counting the number of times editors use the Reply tool</span> <references/> [[Category:Talk pages project{{#translation:}}]] awobn47ghlbqnyqxublajeih759ec4j Help:Content translation/Translating/Translation quality/ca 12 1847573 8364671 8362224 2026-05-03T19:16:54Z Pallares 373182 Created page with "En alguns casos, els usuaris encara poden publicar, però la pàgina resultant es pot afegir a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi." 8364671 wikitext text/x-wiki <languages/> {{PD Help Page}} A l'hora de crear una traducció, és fonamental revisar els continguts abans de publicar-los. Cal assegurar-se que el contingut produït no alteri el significat original de manera no desitjada i comprovar que es llegeix amb naturalitat en l'idioma de destinació. La [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|traducció automàtica inicial]] proporcionada ajuda a accelerar el procés de traducció amb un punt de partida útil, però l'eina anima els usuaris a revisar i editar significativament el contingut inicial. Es dediquen diversos mecanismes per garantir que els traductors editin les traduccions inicials adequadament. L'editor de traduccions fa un seguiment de quina quantitat de la traducció inicial ha estat modificada per l'usuari i defineix diferents límits que o bé: impedeixen la publicació o adverteixen els usuaris perquè els animin a revisar més els continguts. D'aquesta manera, l'eina permet als usuaris fer un bon ús d'una traducció automàtica inicial, alhora que evita la creació de resultats poc revisats i de baixa qualitat. A continuació es presenten més detalls sobre com funcionen aquests límits, com es poden ajustar a les necessitats de cada idioma i com mesurar la qualitat del contingut produït amb l'eina. <span id="Limits_to_encourage_reviewing_the_translation"></span> == Límits per fomentar la revisió de la traducció == L'eina de '''traducció de contingut''' [https://github.com/wikimedia/mediawiki-extensions-ContentTranslation/blob/master/doc/MTAbuseCalculation.md mesura el percentatge de modificacions] que els usuaris fan a [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|la traducció automàtica inicial proporcionada]]. D'aquesta manera, el sistema sap quantes paraules s'han afegit, eliminat o modificat de la traducció inicial. Les mesures es fan a dos nivells diferents: per a cada paràgraf i per a tota la traducció. S'apliquen límits diferents a cada nivell, tal com es detalla a continuació. <span id="Limits_for_the_whole_translation"></span> === Límits per a tota la traducció === [[File:Cx-limits-publish.png|alt=|thumb|400x400px|Es mostra un error en intentar publicar una traducció amb massa traducció automàtica sense modificar. Aquest llindar es va ajustar per a l'indonesi a partir dels comentaris dels seus editors.]] La publicació és bloquejada si l'95% o més de tot el document consisteix en contingut sense modificar i traduït automàticament. Aquest límit impedeix traduccions automàtiques gairebé en brut i evita actes de vandalisme evidents. També impedeix que els usuaris simplement afegeixin contingut sense editar la part de traducció automàtica. Com es detalla a continuació, aquest límit es pot ajustar per a cada idioma. <span id="Limits_for_each_paragraph"></span> === Límits per a cada paràgraf === [[File:Cx-limits-paragraph.png|alt=|thumb|400x400px|Avís mostrat per a un paràgraf específic on la traducció automàtica sense modificar supera els límits]] També es mesura el percentatge de modificacions de l'usuari per a cada paràgraf. Un paràgraf es considera problemàtic quan conté més del 85% de la traducció automàtica inicial (o, en copiar el contingut del document font, conté més del 60% de contingut sense modificar). L'editor de traducció mostrarà un avís per cada paràgraf que es consideri problemàtic, animant l'usuari a fer més edicions. En alguns casos, els usuaris encara poden publicar, però la pàgina resultant es pot afegir a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. En altres casos, és possible que els usuaris no tinguin permís per publicar en absolut. Els següents són alguns dels factors que es tenen en compte per determinar si es permet o no que els usuaris publiquin (alguns dels quals encara estan en desenvolupament): * '''El nombre de paràgrafs problemàtics.''' Els usuaris no poden publicar traduccions amb 50 o més paràgrafs problemàtics. Es permet la publicació de traduccions amb menys de 50 paràgrafs problemàtics, però les que tinguin entre 10 i 49 paràgrafs problemàtics s'afegiran a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Traduccions suprimides anteriorment.''' Per evitar problemes recurrents, l'eina identifica els usuaris les traduccions publicades dels quals s'han suprimit en els darrers 30 dies i imposa límits molt més estrictes als seus esforços de traducció posteriors. Per als usuaris d'aquesta classe, s'impedeix la publicació de les traduccions amb 10 paràgrafs problemàtics o més, mentre que les que tenen 9 paràgrafs problemàtics o menys s'afegeixen a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Confirmació de l'usuari.''' Es considera un llindar menys estricte per als paràgrafs que un usuari marca com a resolts, que es considera un senyal que l'usuari ha revisat i confirmat l'estat de la traducció. Per als paràgrafs on es mostra l'avís de contingut sense modificar, però l'usuari el marca com a resolt, s'aplica un llindar menys estricte (acceptant el 95% de la traducció automàtica o el 75% del contingut original). Això proporcionarà una manera d'adaptar-se als casos en què la traducció automàtica ha estat excepcionalment bona, però alhora evitar un possible abús de la funció (és a dir, no seguir cegament la confirmació d'un usuari). <span id="Contents_not_affected_by_the_limits"></span> === Contingut no afectat pels límits === No s'espera que part del contingut s'editi significativament i, per tant, no es té en compte a l'hora d'aplicar els límits descrits anteriorment. Els títols de secció, les cites o la llista de referències molt curts s'exclouen de la revisió. Altrament, els usuaris podrien rebre avisos enganyosos sobre la traducció de contingut que no s'hauria de traduir, com ara títols de llibres que apareixen a les referències o altres noms propis. <span id="Limits_on_the_mobile_experience"></span> == Límits de l'experiència mòbil == <span lang="en" dir="ltr" class="mw-content-ltr">For the mobile experience the initial set of limits follow a simpler approach.</span> <span lang="en" dir="ltr" class="mw-content-ltr">At the moment, only the overall percentage of unmodified machine translation for the whole translation is considered.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On mobile, the whole translation consist of just one section of the article.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In particular, a warning is shown when the percentage of unmodified machine translation is over 85% for the whole section, and publishing is prevented when the percentage of unmodified machine translation is over 95%.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Feedback on how the limits system work on the mobile context would be very useful to determine how to evolve this initial approach.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Publication of fast unreviewed translations === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Campaigns and contests can result in spikes of translations where some user unfamiliar with the community policies may focus on making many translations and not pay enough attention to review their contents.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In order to emphasize quality over quantity, a mechanism has been defined to limit the publication of fast unreviewed translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">After a user translates a large article, the next translation can only be started after some time has passed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The waiting period estimation considers 1 minute per paragraph up to 10 minutes. That is:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">For articles with 10 paragraphs or less, we want to make sure that users spent at least N minutes (one minute per paragraph) translating it.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">For articles with more than 10 paragraphs we want to make sure that users spent at least 10 minutes translating it.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This has been [[phab:T331023|applied on mobile initially]] since it is a space with less activity, and after measuring the impact we'll consider expanding it to desktop too. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Adjusting the limits == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The limits described above provide a set of general mechanisms, but they may need adjustment depending on the particular needs of each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on initial evaluation, the amount of modification needed to initial machine translation can range from 10% to 70%, depending on the language pair.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On some wikis, the default limits may be too strict, generating unnecessary noise or preventing perfectly valid translations from being published.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On other wikis, the limits may not be strict enough, allowing the publication of translations that have not been edited enough.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the different thresholds allows each wiki to tailor the tool's limits according to its particular needs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Feedback from native speakers is essential in properly adjusting the limits imposed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the current limits don't seem to work well based on your experience in creating or reviewing translations, please [[Talk:Content translation|share your feedback]], and we can explore how to better adjust them.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When providing feedback about adjusting the thresholds, we recommend that you first create several example translations (make sure to [[Special:MyLanguage/Help:Content translation/Publishing|check the publishing options]] if your test is not intended to be published as regular content).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When testing how the limits work for your language, it is useful to keep in mind the following:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check for both cases.''' Make sure to check how the limits work for both: translations where the content has not been edited enough, versus where it has been edited enough. </div> <span lang="en" dir="ltr" class="mw-content-ltr">In this way, you can more easily find the right balance for the tool's limits feature.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Checking only one type of problem can lead to moving the thresholds too far in the opposite direction.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check different content.''' Content in our wikis is highly diverse, and machine translation may work much better for some cases compared to others. </div> <span lang="en" dir="ltr" class="mw-content-ltr">For example, content that is full of numeric data or technical names may require less editing by users than content with more descriptive text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Make sure to test by translating of a variety of different article types, of varying lengths, with disparate content.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Prepare to iterate.''' Adjusting the thresholds is an iterative process. </div> <span lang="en" dir="ltr" class="mw-content-ltr">It may require custom adjustments to the thresholds or that you improve your general approach.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In any case, after each change, further testing may be needed to verify the improvements made.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the limits in collaboration with editors has proven to be effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, initial results show that the Indonesian community was able to significantly reduce the number of problematic translations they were receiving by restricting the publication of translations with more than 70% of unmodified machine translation content.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Similar adjustments have been made for Telugu and Assamese language wikis.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There is no automatic tool that is infallible, and these limits are not an exception.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The process of content review by the community is still essential, but these limits provide communities with a tool to reduce the number of translations they have to focus on, making the review process much more effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please [[Talk:Content translation|share your feedback]] and we can explore how to better adjust them.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Tracking potentially unreviewed translations == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A [[Special:TrackingCategories|tracking category]] with the name "cx-unreviewed-translation-category" is provided for communities to easily find articles that have been published with some content exceeding the recommended limits. </div> <span lang="en" dir="ltr" class="mw-content-ltr">You can find this category in the list of tracking categories on each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Using it, you can track articles that passed the limits preventing publication, but that still had some paragraphs that were edited less than expected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example [[:id:Kategori:Halaman_dengan_terjemahan_tak_tertinjau|the Indonesian Wikipedia's category]] includes articles that have less than 40% of machine translation overall, but which have some paragraphs with more than 80% of unmodified machine translation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Measuring translation quality == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Evaluating content quality automatically is not trivial.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Deletion ratios provide a useful measure for estimating whether the content created was good enough for the community involved not to delete it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the analysis of deletion ratios, articles that are created as translations are [[Special:MyLanguage/Content translation/Deletion statistics comparison|less likely to be deleted]] when compared with articles created from scratch.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This suggests that it may not be practical to set the limits for participation through translating much higher than those set for other ways of article creation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Find published translations === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Content translation adds a ''contenttranslation'' edit tag to the published translations. This allows communities the ability to use Recent changes, and similar tools, to focus on pages created using the translation tool.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In addition, [[Special:MyLanguage/Content translation/Published translations|data on published translations]] and [https://language-reportcard.wmflabs.org/cx2/#mt-engines the statistics for machine translation use] are available for anyone to analyze.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Inspect a specific translation === </div> [[File:Translation debugger example.webm|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Translation debugger example</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">The [https://cxdebugger.toolforge.org/ Translation debugger] is a tool that allows the inspection of some metadata for a given translation, including the percentage of machine translation used for the whole document, and the translation service used for each paragraph.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For specific types of content such as templates, the Content Translation Server API [https://cxdebugger.toolforge.org/templates.html can be queried to check how templates will be transferred across languages].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Other limits based on user expertise == </div> [[File:Cx-limits-user-expertise.png|alt=|thumb|400x400px|<span lang="en" dir="ltr" class="mw-content-ltr">Error showing a publishing restriction based on the user expertise.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This example is based on the decision of the English Wikipedia community to limit publishing directly to the mainspace to extended autoconfirmed users only.</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">Some wikis have implemented other restrictions for translating based on the user rights as a way to reduce the creation of low-quality translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, [[w:Wikipedia:Content translation tool|English Wikipedia requires users to be extended confirmed]], which means they need to make 500 edits on English Wikipedia before they are allowed to publish a translation as an article.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Newer editors can still publish translated articles in the <code>{{ns:2}}:</code> or <code>Draft:</code> namespaces, and then [[Special:MyLanguage/Help:Moving a page|move the article]] to the mainspace.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This restriction was created before the system of limits described in this page was available, and it is not the recommended approach to encourage the creation of good quality translations. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Before adding restrictions that do not take into account the content created, consider going through the process of adjusting the limits of unmodified content as described above.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The limits can be made as strict as needed to prevent low-quality translations, while still allowing publication by editors making good translations.</span> [[Category:Extension help{{#translation:}}]] iy1rzzjbpl7y3p3p1hgqdeklxasulcj 8364675 8364671 2026-05-03T19:17:52Z Pallares 373182 Created page with "Per a l'experiència mòbil, el conjunt inicial de límits segueix un enfocament més senzill." 8364675 wikitext text/x-wiki <languages/> {{PD Help Page}} A l'hora de crear una traducció, és fonamental revisar els continguts abans de publicar-los. Cal assegurar-se que el contingut produït no alteri el significat original de manera no desitjada i comprovar que es llegeix amb naturalitat en l'idioma de destinació. La [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|traducció automàtica inicial]] proporcionada ajuda a accelerar el procés de traducció amb un punt de partida útil, però l'eina anima els usuaris a revisar i editar significativament el contingut inicial. Es dediquen diversos mecanismes per garantir que els traductors editin les traduccions inicials adequadament. L'editor de traduccions fa un seguiment de quina quantitat de la traducció inicial ha estat modificada per l'usuari i defineix diferents límits que o bé: impedeixen la publicació o adverteixen els usuaris perquè els animin a revisar més els continguts. D'aquesta manera, l'eina permet als usuaris fer un bon ús d'una traducció automàtica inicial, alhora que evita la creació de resultats poc revisats i de baixa qualitat. A continuació es presenten més detalls sobre com funcionen aquests límits, com es poden ajustar a les necessitats de cada idioma i com mesurar la qualitat del contingut produït amb l'eina. <span id="Limits_to_encourage_reviewing_the_translation"></span> == Límits per fomentar la revisió de la traducció == L'eina de '''traducció de contingut''' [https://github.com/wikimedia/mediawiki-extensions-ContentTranslation/blob/master/doc/MTAbuseCalculation.md mesura el percentatge de modificacions] que els usuaris fan a [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|la traducció automàtica inicial proporcionada]]. D'aquesta manera, el sistema sap quantes paraules s'han afegit, eliminat o modificat de la traducció inicial. Les mesures es fan a dos nivells diferents: per a cada paràgraf i per a tota la traducció. S'apliquen límits diferents a cada nivell, tal com es detalla a continuació. <span id="Limits_for_the_whole_translation"></span> === Límits per a tota la traducció === [[File:Cx-limits-publish.png|alt=|thumb|400x400px|Es mostra un error en intentar publicar una traducció amb massa traducció automàtica sense modificar. Aquest llindar es va ajustar per a l'indonesi a partir dels comentaris dels seus editors.]] La publicació és bloquejada si l'95% o més de tot el document consisteix en contingut sense modificar i traduït automàticament. Aquest límit impedeix traduccions automàtiques gairebé en brut i evita actes de vandalisme evidents. També impedeix que els usuaris simplement afegeixin contingut sense editar la part de traducció automàtica. Com es detalla a continuació, aquest límit es pot ajustar per a cada idioma. <span id="Limits_for_each_paragraph"></span> === Límits per a cada paràgraf === [[File:Cx-limits-paragraph.png|alt=|thumb|400x400px|Avís mostrat per a un paràgraf específic on la traducció automàtica sense modificar supera els límits]] També es mesura el percentatge de modificacions de l'usuari per a cada paràgraf. Un paràgraf es considera problemàtic quan conté més del 85% de la traducció automàtica inicial (o, en copiar el contingut del document font, conté més del 60% de contingut sense modificar). L'editor de traducció mostrarà un avís per cada paràgraf que es consideri problemàtic, animant l'usuari a fer més edicions. En alguns casos, els usuaris encara poden publicar, però la pàgina resultant es pot afegir a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. En altres casos, és possible que els usuaris no tinguin permís per publicar en absolut. Els següents són alguns dels factors que es tenen en compte per determinar si es permet o no que els usuaris publiquin (alguns dels quals encara estan en desenvolupament): * '''El nombre de paràgrafs problemàtics.''' Els usuaris no poden publicar traduccions amb 50 o més paràgrafs problemàtics. Es permet la publicació de traduccions amb menys de 50 paràgrafs problemàtics, però les que tinguin entre 10 i 49 paràgrafs problemàtics s'afegiran a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Traduccions suprimides anteriorment.''' Per evitar problemes recurrents, l'eina identifica els usuaris les traduccions publicades dels quals s'han suprimit en els darrers 30 dies i imposa límits molt més estrictes als seus esforços de traducció posteriors. Per als usuaris d'aquesta classe, s'impedeix la publicació de les traduccions amb 10 paràgrafs problemàtics o més, mentre que les que tenen 9 paràgrafs problemàtics o menys s'afegeixen a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Confirmació de l'usuari.''' Es considera un llindar menys estricte per als paràgrafs que un usuari marca com a resolts, que es considera un senyal que l'usuari ha revisat i confirmat l'estat de la traducció. Per als paràgrafs on es mostra l'avís de contingut sense modificar, però l'usuari el marca com a resolt, s'aplica un llindar menys estricte (acceptant el 95% de la traducció automàtica o el 75% del contingut original). Això proporcionarà una manera d'adaptar-se als casos en què la traducció automàtica ha estat excepcionalment bona, però alhora evitar un possible abús de la funció (és a dir, no seguir cegament la confirmació d'un usuari). <span id="Contents_not_affected_by_the_limits"></span> === Contingut no afectat pels límits === No s'espera que part del contingut s'editi significativament i, per tant, no es té en compte a l'hora d'aplicar els límits descrits anteriorment. Els títols de secció, les cites o la llista de referències molt curts s'exclouen de la revisió. Altrament, els usuaris podrien rebre avisos enganyosos sobre la traducció de contingut que no s'hauria de traduir, com ara títols de llibres que apareixen a les referències o altres noms propis. <span id="Limits_on_the_mobile_experience"></span> == Límits de l'experiència mòbil == Per a l'experiència mòbil, el conjunt inicial de límits segueix un enfocament més senzill. <span lang="en" dir="ltr" class="mw-content-ltr">At the moment, only the overall percentage of unmodified machine translation for the whole translation is considered.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On mobile, the whole translation consist of just one section of the article.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In particular, a warning is shown when the percentage of unmodified machine translation is over 85% for the whole section, and publishing is prevented when the percentage of unmodified machine translation is over 95%.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Feedback on how the limits system work on the mobile context would be very useful to determine how to evolve this initial approach.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Publication of fast unreviewed translations === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Campaigns and contests can result in spikes of translations where some user unfamiliar with the community policies may focus on making many translations and not pay enough attention to review their contents.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In order to emphasize quality over quantity, a mechanism has been defined to limit the publication of fast unreviewed translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">After a user translates a large article, the next translation can only be started after some time has passed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The waiting period estimation considers 1 minute per paragraph up to 10 minutes. That is:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">For articles with 10 paragraphs or less, we want to make sure that users spent at least N minutes (one minute per paragraph) translating it.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">For articles with more than 10 paragraphs we want to make sure that users spent at least 10 minutes translating it.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This has been [[phab:T331023|applied on mobile initially]] since it is a space with less activity, and after measuring the impact we'll consider expanding it to desktop too. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Adjusting the limits == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The limits described above provide a set of general mechanisms, but they may need adjustment depending on the particular needs of each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on initial evaluation, the amount of modification needed to initial machine translation can range from 10% to 70%, depending on the language pair.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On some wikis, the default limits may be too strict, generating unnecessary noise or preventing perfectly valid translations from being published.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On other wikis, the limits may not be strict enough, allowing the publication of translations that have not been edited enough.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the different thresholds allows each wiki to tailor the tool's limits according to its particular needs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Feedback from native speakers is essential in properly adjusting the limits imposed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the current limits don't seem to work well based on your experience in creating or reviewing translations, please [[Talk:Content translation|share your feedback]], and we can explore how to better adjust them.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When providing feedback about adjusting the thresholds, we recommend that you first create several example translations (make sure to [[Special:MyLanguage/Help:Content translation/Publishing|check the publishing options]] if your test is not intended to be published as regular content).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When testing how the limits work for your language, it is useful to keep in mind the following:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check for both cases.''' Make sure to check how the limits work for both: translations where the content has not been edited enough, versus where it has been edited enough. </div> <span lang="en" dir="ltr" class="mw-content-ltr">In this way, you can more easily find the right balance for the tool's limits feature.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Checking only one type of problem can lead to moving the thresholds too far in the opposite direction.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check different content.''' Content in our wikis is highly diverse, and machine translation may work much better for some cases compared to others. </div> <span lang="en" dir="ltr" class="mw-content-ltr">For example, content that is full of numeric data or technical names may require less editing by users than content with more descriptive text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Make sure to test by translating of a variety of different article types, of varying lengths, with disparate content.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Prepare to iterate.''' Adjusting the thresholds is an iterative process. </div> <span lang="en" dir="ltr" class="mw-content-ltr">It may require custom adjustments to the thresholds or that you improve your general approach.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In any case, after each change, further testing may be needed to verify the improvements made.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the limits in collaboration with editors has proven to be effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, initial results show that the Indonesian community was able to significantly reduce the number of problematic translations they were receiving by restricting the publication of translations with more than 70% of unmodified machine translation content.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Similar adjustments have been made for Telugu and Assamese language wikis.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There is no automatic tool that is infallible, and these limits are not an exception.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The process of content review by the community is still essential, but these limits provide communities with a tool to reduce the number of translations they have to focus on, making the review process much more effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please [[Talk:Content translation|share your feedback]] and we can explore how to better adjust them.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Tracking potentially unreviewed translations == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A [[Special:TrackingCategories|tracking category]] with the name "cx-unreviewed-translation-category" is provided for communities to easily find articles that have been published with some content exceeding the recommended limits. </div> <span lang="en" dir="ltr" class="mw-content-ltr">You can find this category in the list of tracking categories on each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Using it, you can track articles that passed the limits preventing publication, but that still had some paragraphs that were edited less than expected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example [[:id:Kategori:Halaman_dengan_terjemahan_tak_tertinjau|the Indonesian Wikipedia's category]] includes articles that have less than 40% of machine translation overall, but which have some paragraphs with more than 80% of unmodified machine translation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Measuring translation quality == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Evaluating content quality automatically is not trivial.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Deletion ratios provide a useful measure for estimating whether the content created was good enough for the community involved not to delete it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the analysis of deletion ratios, articles that are created as translations are [[Special:MyLanguage/Content translation/Deletion statistics comparison|less likely to be deleted]] when compared with articles created from scratch.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This suggests that it may not be practical to set the limits for participation through translating much higher than those set for other ways of article creation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Find published translations === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Content translation adds a ''contenttranslation'' edit tag to the published translations. This allows communities the ability to use Recent changes, and similar tools, to focus on pages created using the translation tool.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In addition, [[Special:MyLanguage/Content translation/Published translations|data on published translations]] and [https://language-reportcard.wmflabs.org/cx2/#mt-engines the statistics for machine translation use] are available for anyone to analyze.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Inspect a specific translation === </div> [[File:Translation debugger example.webm|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Translation debugger example</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">The [https://cxdebugger.toolforge.org/ Translation debugger] is a tool that allows the inspection of some metadata for a given translation, including the percentage of machine translation used for the whole document, and the translation service used for each paragraph.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For specific types of content such as templates, the Content Translation Server API [https://cxdebugger.toolforge.org/templates.html can be queried to check how templates will be transferred across languages].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Other limits based on user expertise == </div> [[File:Cx-limits-user-expertise.png|alt=|thumb|400x400px|<span lang="en" dir="ltr" class="mw-content-ltr">Error showing a publishing restriction based on the user expertise.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This example is based on the decision of the English Wikipedia community to limit publishing directly to the mainspace to extended autoconfirmed users only.</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">Some wikis have implemented other restrictions for translating based on the user rights as a way to reduce the creation of low-quality translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, [[w:Wikipedia:Content translation tool|English Wikipedia requires users to be extended confirmed]], which means they need to make 500 edits on English Wikipedia before they are allowed to publish a translation as an article.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Newer editors can still publish translated articles in the <code>{{ns:2}}:</code> or <code>Draft:</code> namespaces, and then [[Special:MyLanguage/Help:Moving a page|move the article]] to the mainspace.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This restriction was created before the system of limits described in this page was available, and it is not the recommended approach to encourage the creation of good quality translations. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Before adding restrictions that do not take into account the content created, consider going through the process of adjusting the limits of unmodified content as described above.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The limits can be made as strict as needed to prevent low-quality translations, while still allowing publication by editors making good translations.</span> [[Category:Extension help{{#translation:}}]] qpzvectoun3q904xz0ca1gu48wevoo1 8364679 8364675 2026-05-03T19:18:18Z Pallares 373182 Created page with "De moment, només es considera el percentatge global de traducció automàtica sense modificacions per a tota la traducció." 8364679 wikitext text/x-wiki <languages/> {{PD Help Page}} A l'hora de crear una traducció, és fonamental revisar els continguts abans de publicar-los. Cal assegurar-se que el contingut produït no alteri el significat original de manera no desitjada i comprovar que es llegeix amb naturalitat en l'idioma de destinació. La [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|traducció automàtica inicial]] proporcionada ajuda a accelerar el procés de traducció amb un punt de partida útil, però l'eina anima els usuaris a revisar i editar significativament el contingut inicial. Es dediquen diversos mecanismes per garantir que els traductors editin les traduccions inicials adequadament. L'editor de traduccions fa un seguiment de quina quantitat de la traducció inicial ha estat modificada per l'usuari i defineix diferents límits que o bé: impedeixen la publicació o adverteixen els usuaris perquè els animin a revisar més els continguts. D'aquesta manera, l'eina permet als usuaris fer un bon ús d'una traducció automàtica inicial, alhora que evita la creació de resultats poc revisats i de baixa qualitat. A continuació es presenten més detalls sobre com funcionen aquests límits, com es poden ajustar a les necessitats de cada idioma i com mesurar la qualitat del contingut produït amb l'eina. <span id="Limits_to_encourage_reviewing_the_translation"></span> == Límits per fomentar la revisió de la traducció == L'eina de '''traducció de contingut''' [https://github.com/wikimedia/mediawiki-extensions-ContentTranslation/blob/master/doc/MTAbuseCalculation.md mesura el percentatge de modificacions] que els usuaris fan a [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|la traducció automàtica inicial proporcionada]]. D'aquesta manera, el sistema sap quantes paraules s'han afegit, eliminat o modificat de la traducció inicial. Les mesures es fan a dos nivells diferents: per a cada paràgraf i per a tota la traducció. S'apliquen límits diferents a cada nivell, tal com es detalla a continuació. <span id="Limits_for_the_whole_translation"></span> === Límits per a tota la traducció === [[File:Cx-limits-publish.png|alt=|thumb|400x400px|Es mostra un error en intentar publicar una traducció amb massa traducció automàtica sense modificar. Aquest llindar es va ajustar per a l'indonesi a partir dels comentaris dels seus editors.]] La publicació és bloquejada si l'95% o més de tot el document consisteix en contingut sense modificar i traduït automàticament. Aquest límit impedeix traduccions automàtiques gairebé en brut i evita actes de vandalisme evidents. També impedeix que els usuaris simplement afegeixin contingut sense editar la part de traducció automàtica. Com es detalla a continuació, aquest límit es pot ajustar per a cada idioma. <span id="Limits_for_each_paragraph"></span> === Límits per a cada paràgraf === [[File:Cx-limits-paragraph.png|alt=|thumb|400x400px|Avís mostrat per a un paràgraf específic on la traducció automàtica sense modificar supera els límits]] També es mesura el percentatge de modificacions de l'usuari per a cada paràgraf. Un paràgraf es considera problemàtic quan conté més del 85% de la traducció automàtica inicial (o, en copiar el contingut del document font, conté més del 60% de contingut sense modificar). L'editor de traducció mostrarà un avís per cada paràgraf que es consideri problemàtic, animant l'usuari a fer més edicions. En alguns casos, els usuaris encara poden publicar, però la pàgina resultant es pot afegir a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. En altres casos, és possible que els usuaris no tinguin permís per publicar en absolut. Els següents són alguns dels factors que es tenen en compte per determinar si es permet o no que els usuaris publiquin (alguns dels quals encara estan en desenvolupament): * '''El nombre de paràgrafs problemàtics.''' Els usuaris no poden publicar traduccions amb 50 o més paràgrafs problemàtics. Es permet la publicació de traduccions amb menys de 50 paràgrafs problemàtics, però les que tinguin entre 10 i 49 paràgrafs problemàtics s'afegiran a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Traduccions suprimides anteriorment.''' Per evitar problemes recurrents, l'eina identifica els usuaris les traduccions publicades dels quals s'han suprimit en els darrers 30 dies i imposa límits molt més estrictes als seus esforços de traducció posteriors. Per als usuaris d'aquesta classe, s'impedeix la publicació de les traduccions amb 10 paràgrafs problemàtics o més, mentre que les que tenen 9 paràgrafs problemàtics o menys s'afegeixen a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Confirmació de l'usuari.''' Es considera un llindar menys estricte per als paràgrafs que un usuari marca com a resolts, que es considera un senyal que l'usuari ha revisat i confirmat l'estat de la traducció. Per als paràgrafs on es mostra l'avís de contingut sense modificar, però l'usuari el marca com a resolt, s'aplica un llindar menys estricte (acceptant el 95% de la traducció automàtica o el 75% del contingut original). Això proporcionarà una manera d'adaptar-se als casos en què la traducció automàtica ha estat excepcionalment bona, però alhora evitar un possible abús de la funció (és a dir, no seguir cegament la confirmació d'un usuari). <span id="Contents_not_affected_by_the_limits"></span> === Contingut no afectat pels límits === No s'espera que part del contingut s'editi significativament i, per tant, no es té en compte a l'hora d'aplicar els límits descrits anteriorment. Els títols de secció, les cites o la llista de referències molt curts s'exclouen de la revisió. Altrament, els usuaris podrien rebre avisos enganyosos sobre la traducció de contingut que no s'hauria de traduir, com ara títols de llibres que apareixen a les referències o altres noms propis. <span id="Limits_on_the_mobile_experience"></span> == Límits de l'experiència mòbil == Per a l'experiència mòbil, el conjunt inicial de límits segueix un enfocament més senzill. De moment, només es considera el percentatge global de traducció automàtica sense modificacions per a tota la traducció. <span lang="en" dir="ltr" class="mw-content-ltr">On mobile, the whole translation consist of just one section of the article.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In particular, a warning is shown when the percentage of unmodified machine translation is over 85% for the whole section, and publishing is prevented when the percentage of unmodified machine translation is over 95%.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Feedback on how the limits system work on the mobile context would be very useful to determine how to evolve this initial approach.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Publication of fast unreviewed translations === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Campaigns and contests can result in spikes of translations where some user unfamiliar with the community policies may focus on making many translations and not pay enough attention to review their contents.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In order to emphasize quality over quantity, a mechanism has been defined to limit the publication of fast unreviewed translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">After a user translates a large article, the next translation can only be started after some time has passed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The waiting period estimation considers 1 minute per paragraph up to 10 minutes. That is:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">For articles with 10 paragraphs or less, we want to make sure that users spent at least N minutes (one minute per paragraph) translating it.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">For articles with more than 10 paragraphs we want to make sure that users spent at least 10 minutes translating it.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This has been [[phab:T331023|applied on mobile initially]] since it is a space with less activity, and after measuring the impact we'll consider expanding it to desktop too. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Adjusting the limits == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The limits described above provide a set of general mechanisms, but they may need adjustment depending on the particular needs of each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on initial evaluation, the amount of modification needed to initial machine translation can range from 10% to 70%, depending on the language pair.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On some wikis, the default limits may be too strict, generating unnecessary noise or preventing perfectly valid translations from being published.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On other wikis, the limits may not be strict enough, allowing the publication of translations that have not been edited enough.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the different thresholds allows each wiki to tailor the tool's limits according to its particular needs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Feedback from native speakers is essential in properly adjusting the limits imposed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the current limits don't seem to work well based on your experience in creating or reviewing translations, please [[Talk:Content translation|share your feedback]], and we can explore how to better adjust them.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When providing feedback about adjusting the thresholds, we recommend that you first create several example translations (make sure to [[Special:MyLanguage/Help:Content translation/Publishing|check the publishing options]] if your test is not intended to be published as regular content).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When testing how the limits work for your language, it is useful to keep in mind the following:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check for both cases.''' Make sure to check how the limits work for both: translations where the content has not been edited enough, versus where it has been edited enough. </div> <span lang="en" dir="ltr" class="mw-content-ltr">In this way, you can more easily find the right balance for the tool's limits feature.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Checking only one type of problem can lead to moving the thresholds too far in the opposite direction.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check different content.''' Content in our wikis is highly diverse, and machine translation may work much better for some cases compared to others. </div> <span lang="en" dir="ltr" class="mw-content-ltr">For example, content that is full of numeric data or technical names may require less editing by users than content with more descriptive text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Make sure to test by translating of a variety of different article types, of varying lengths, with disparate content.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Prepare to iterate.''' Adjusting the thresholds is an iterative process. </div> <span lang="en" dir="ltr" class="mw-content-ltr">It may require custom adjustments to the thresholds or that you improve your general approach.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In any case, after each change, further testing may be needed to verify the improvements made.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the limits in collaboration with editors has proven to be effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, initial results show that the Indonesian community was able to significantly reduce the number of problematic translations they were receiving by restricting the publication of translations with more than 70% of unmodified machine translation content.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Similar adjustments have been made for Telugu and Assamese language wikis.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There is no automatic tool that is infallible, and these limits are not an exception.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The process of content review by the community is still essential, but these limits provide communities with a tool to reduce the number of translations they have to focus on, making the review process much more effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please [[Talk:Content translation|share your feedback]] and we can explore how to better adjust them.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Tracking potentially unreviewed translations == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A [[Special:TrackingCategories|tracking category]] with the name "cx-unreviewed-translation-category" is provided for communities to easily find articles that have been published with some content exceeding the recommended limits. </div> <span lang="en" dir="ltr" class="mw-content-ltr">You can find this category in the list of tracking categories on each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Using it, you can track articles that passed the limits preventing publication, but that still had some paragraphs that were edited less than expected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example [[:id:Kategori:Halaman_dengan_terjemahan_tak_tertinjau|the Indonesian Wikipedia's category]] includes articles that have less than 40% of machine translation overall, but which have some paragraphs with more than 80% of unmodified machine translation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Measuring translation quality == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Evaluating content quality automatically is not trivial.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Deletion ratios provide a useful measure for estimating whether the content created was good enough for the community involved not to delete it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the analysis of deletion ratios, articles that are created as translations are [[Special:MyLanguage/Content translation/Deletion statistics comparison|less likely to be deleted]] when compared with articles created from scratch.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This suggests that it may not be practical to set the limits for participation through translating much higher than those set for other ways of article creation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Find published translations === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Content translation adds a ''contenttranslation'' edit tag to the published translations. This allows communities the ability to use Recent changes, and similar tools, to focus on pages created using the translation tool.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In addition, [[Special:MyLanguage/Content translation/Published translations|data on published translations]] and [https://language-reportcard.wmflabs.org/cx2/#mt-engines the statistics for machine translation use] are available for anyone to analyze.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Inspect a specific translation === </div> [[File:Translation debugger example.webm|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Translation debugger example</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">The [https://cxdebugger.toolforge.org/ Translation debugger] is a tool that allows the inspection of some metadata for a given translation, including the percentage of machine translation used for the whole document, and the translation service used for each paragraph.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For specific types of content such as templates, the Content Translation Server API [https://cxdebugger.toolforge.org/templates.html can be queried to check how templates will be transferred across languages].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Other limits based on user expertise == </div> [[File:Cx-limits-user-expertise.png|alt=|thumb|400x400px|<span lang="en" dir="ltr" class="mw-content-ltr">Error showing a publishing restriction based on the user expertise.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This example is based on the decision of the English Wikipedia community to limit publishing directly to the mainspace to extended autoconfirmed users only.</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">Some wikis have implemented other restrictions for translating based on the user rights as a way to reduce the creation of low-quality translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, [[w:Wikipedia:Content translation tool|English Wikipedia requires users to be extended confirmed]], which means they need to make 500 edits on English Wikipedia before they are allowed to publish a translation as an article.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Newer editors can still publish translated articles in the <code>{{ns:2}}:</code> or <code>Draft:</code> namespaces, and then [[Special:MyLanguage/Help:Moving a page|move the article]] to the mainspace.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This restriction was created before the system of limits described in this page was available, and it is not the recommended approach to encourage the creation of good quality translations. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Before adding restrictions that do not take into account the content created, consider going through the process of adjusting the limits of unmodified content as described above.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The limits can be made as strict as needed to prevent low-quality translations, while still allowing publication by editors making good translations.</span> [[Category:Extension help{{#translation:}}]] tr04qb9kp7u5t908qk2p2wl214jvry1 8364682 8364679 2026-05-03T19:18:50Z Pallares 373182 Created page with "En particular, es mostra un avís quan el percentatge de traducció automàtica sense modificacions és superior al 85% per a tota la secció, i s'impedeix la publicació quan el percentatge de traducció automàtica sense modificacions és superior al 95%" 8364682 wikitext text/x-wiki <languages/> {{PD Help Page}} A l'hora de crear una traducció, és fonamental revisar els continguts abans de publicar-los. Cal assegurar-se que el contingut produït no alteri el significat original de manera no desitjada i comprovar que es llegeix amb naturalitat en l'idioma de destinació. La [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|traducció automàtica inicial]] proporcionada ajuda a accelerar el procés de traducció amb un punt de partida útil, però l'eina anima els usuaris a revisar i editar significativament el contingut inicial. Es dediquen diversos mecanismes per garantir que els traductors editin les traduccions inicials adequadament. L'editor de traduccions fa un seguiment de quina quantitat de la traducció inicial ha estat modificada per l'usuari i defineix diferents límits que o bé: impedeixen la publicació o adverteixen els usuaris perquè els animin a revisar més els continguts. D'aquesta manera, l'eina permet als usuaris fer un bon ús d'una traducció automàtica inicial, alhora que evita la creació de resultats poc revisats i de baixa qualitat. A continuació es presenten més detalls sobre com funcionen aquests límits, com es poden ajustar a les necessitats de cada idioma i com mesurar la qualitat del contingut produït amb l'eina. <span id="Limits_to_encourage_reviewing_the_translation"></span> == Límits per fomentar la revisió de la traducció == L'eina de '''traducció de contingut''' [https://github.com/wikimedia/mediawiki-extensions-ContentTranslation/blob/master/doc/MTAbuseCalculation.md mesura el percentatge de modificacions] que els usuaris fan a [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|la traducció automàtica inicial proporcionada]]. D'aquesta manera, el sistema sap quantes paraules s'han afegit, eliminat o modificat de la traducció inicial. Les mesures es fan a dos nivells diferents: per a cada paràgraf i per a tota la traducció. S'apliquen límits diferents a cada nivell, tal com es detalla a continuació. <span id="Limits_for_the_whole_translation"></span> === Límits per a tota la traducció === [[File:Cx-limits-publish.png|alt=|thumb|400x400px|Es mostra un error en intentar publicar una traducció amb massa traducció automàtica sense modificar. Aquest llindar es va ajustar per a l'indonesi a partir dels comentaris dels seus editors.]] La publicació és bloquejada si l'95% o més de tot el document consisteix en contingut sense modificar i traduït automàticament. Aquest límit impedeix traduccions automàtiques gairebé en brut i evita actes de vandalisme evidents. També impedeix que els usuaris simplement afegeixin contingut sense editar la part de traducció automàtica. Com es detalla a continuació, aquest límit es pot ajustar per a cada idioma. <span id="Limits_for_each_paragraph"></span> === Límits per a cada paràgraf === [[File:Cx-limits-paragraph.png|alt=|thumb|400x400px|Avís mostrat per a un paràgraf específic on la traducció automàtica sense modificar supera els límits]] També es mesura el percentatge de modificacions de l'usuari per a cada paràgraf. Un paràgraf es considera problemàtic quan conté més del 85% de la traducció automàtica inicial (o, en copiar el contingut del document font, conté més del 60% de contingut sense modificar). L'editor de traducció mostrarà un avís per cada paràgraf que es consideri problemàtic, animant l'usuari a fer més edicions. En alguns casos, els usuaris encara poden publicar, però la pàgina resultant es pot afegir a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. En altres casos, és possible que els usuaris no tinguin permís per publicar en absolut. Els següents són alguns dels factors que es tenen en compte per determinar si es permet o no que els usuaris publiquin (alguns dels quals encara estan en desenvolupament): * '''El nombre de paràgrafs problemàtics.''' Els usuaris no poden publicar traduccions amb 50 o més paràgrafs problemàtics. Es permet la publicació de traduccions amb menys de 50 paràgrafs problemàtics, però les que tinguin entre 10 i 49 paràgrafs problemàtics s'afegiran a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Traduccions suprimides anteriorment.''' Per evitar problemes recurrents, l'eina identifica els usuaris les traduccions publicades dels quals s'han suprimit en els darrers 30 dies i imposa límits molt més estrictes als seus esforços de traducció posteriors. Per als usuaris d'aquesta classe, s'impedeix la publicació de les traduccions amb 10 paràgrafs problemàtics o més, mentre que les que tenen 9 paràgrafs problemàtics o menys s'afegeixen a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Confirmació de l'usuari.''' Es considera un llindar menys estricte per als paràgrafs que un usuari marca com a resolts, que es considera un senyal que l'usuari ha revisat i confirmat l'estat de la traducció. Per als paràgrafs on es mostra l'avís de contingut sense modificar, però l'usuari el marca com a resolt, s'aplica un llindar menys estricte (acceptant el 95% de la traducció automàtica o el 75% del contingut original). Això proporcionarà una manera d'adaptar-se als casos en què la traducció automàtica ha estat excepcionalment bona, però alhora evitar un possible abús de la funció (és a dir, no seguir cegament la confirmació d'un usuari). <span id="Contents_not_affected_by_the_limits"></span> === Contingut no afectat pels límits === No s'espera que part del contingut s'editi significativament i, per tant, no es té en compte a l'hora d'aplicar els límits descrits anteriorment. Els títols de secció, les cites o la llista de referències molt curts s'exclouen de la revisió. Altrament, els usuaris podrien rebre avisos enganyosos sobre la traducció de contingut que no s'hauria de traduir, com ara títols de llibres que apareixen a les referències o altres noms propis. <span id="Limits_on_the_mobile_experience"></span> == Límits de l'experiència mòbil == Per a l'experiència mòbil, el conjunt inicial de límits segueix un enfocament més senzill. De moment, només es considera el percentatge global de traducció automàtica sense modificacions per a tota la traducció. <span lang="en" dir="ltr" class="mw-content-ltr">On mobile, the whole translation consist of just one section of the article.</span> En particular, es mostra un avís quan el percentatge de traducció automàtica sense modificacions és superior al 85% per a tota la secció, i s'impedeix la publicació quan el percentatge de traducció automàtica sense modificacions és superior al 95% <span lang="en" dir="ltr" class="mw-content-ltr">Feedback on how the limits system work on the mobile context would be very useful to determine how to evolve this initial approach.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Publication of fast unreviewed translations === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Campaigns and contests can result in spikes of translations where some user unfamiliar with the community policies may focus on making many translations and not pay enough attention to review their contents.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In order to emphasize quality over quantity, a mechanism has been defined to limit the publication of fast unreviewed translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">After a user translates a large article, the next translation can only be started after some time has passed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The waiting period estimation considers 1 minute per paragraph up to 10 minutes. That is:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">For articles with 10 paragraphs or less, we want to make sure that users spent at least N minutes (one minute per paragraph) translating it.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">For articles with more than 10 paragraphs we want to make sure that users spent at least 10 minutes translating it.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This has been [[phab:T331023|applied on mobile initially]] since it is a space with less activity, and after measuring the impact we'll consider expanding it to desktop too. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Adjusting the limits == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The limits described above provide a set of general mechanisms, but they may need adjustment depending on the particular needs of each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on initial evaluation, the amount of modification needed to initial machine translation can range from 10% to 70%, depending on the language pair.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On some wikis, the default limits may be too strict, generating unnecessary noise or preventing perfectly valid translations from being published.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On other wikis, the limits may not be strict enough, allowing the publication of translations that have not been edited enough.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the different thresholds allows each wiki to tailor the tool's limits according to its particular needs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Feedback from native speakers is essential in properly adjusting the limits imposed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the current limits don't seem to work well based on your experience in creating or reviewing translations, please [[Talk:Content translation|share your feedback]], and we can explore how to better adjust them.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When providing feedback about adjusting the thresholds, we recommend that you first create several example translations (make sure to [[Special:MyLanguage/Help:Content translation/Publishing|check the publishing options]] if your test is not intended to be published as regular content).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When testing how the limits work for your language, it is useful to keep in mind the following:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check for both cases.''' Make sure to check how the limits work for both: translations where the content has not been edited enough, versus where it has been edited enough. </div> <span lang="en" dir="ltr" class="mw-content-ltr">In this way, you can more easily find the right balance for the tool's limits feature.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Checking only one type of problem can lead to moving the thresholds too far in the opposite direction.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check different content.''' Content in our wikis is highly diverse, and machine translation may work much better for some cases compared to others. </div> <span lang="en" dir="ltr" class="mw-content-ltr">For example, content that is full of numeric data or technical names may require less editing by users than content with more descriptive text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Make sure to test by translating of a variety of different article types, of varying lengths, with disparate content.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Prepare to iterate.''' Adjusting the thresholds is an iterative process. </div> <span lang="en" dir="ltr" class="mw-content-ltr">It may require custom adjustments to the thresholds or that you improve your general approach.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In any case, after each change, further testing may be needed to verify the improvements made.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the limits in collaboration with editors has proven to be effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, initial results show that the Indonesian community was able to significantly reduce the number of problematic translations they were receiving by restricting the publication of translations with more than 70% of unmodified machine translation content.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Similar adjustments have been made for Telugu and Assamese language wikis.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There is no automatic tool that is infallible, and these limits are not an exception.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The process of content review by the community is still essential, but these limits provide communities with a tool to reduce the number of translations they have to focus on, making the review process much more effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please [[Talk:Content translation|share your feedback]] and we can explore how to better adjust them.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Tracking potentially unreviewed translations == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A [[Special:TrackingCategories|tracking category]] with the name "cx-unreviewed-translation-category" is provided for communities to easily find articles that have been published with some content exceeding the recommended limits. </div> <span lang="en" dir="ltr" class="mw-content-ltr">You can find this category in the list of tracking categories on each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Using it, you can track articles that passed the limits preventing publication, but that still had some paragraphs that were edited less than expected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example [[:id:Kategori:Halaman_dengan_terjemahan_tak_tertinjau|the Indonesian Wikipedia's category]] includes articles that have less than 40% of machine translation overall, but which have some paragraphs with more than 80% of unmodified machine translation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Measuring translation quality == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Evaluating content quality automatically is not trivial.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Deletion ratios provide a useful measure for estimating whether the content created was good enough for the community involved not to delete it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the analysis of deletion ratios, articles that are created as translations are [[Special:MyLanguage/Content translation/Deletion statistics comparison|less likely to be deleted]] when compared with articles created from scratch.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This suggests that it may not be practical to set the limits for participation through translating much higher than those set for other ways of article creation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Find published translations === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Content translation adds a ''contenttranslation'' edit tag to the published translations. This allows communities the ability to use Recent changes, and similar tools, to focus on pages created using the translation tool.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In addition, [[Special:MyLanguage/Content translation/Published translations|data on published translations]] and [https://language-reportcard.wmflabs.org/cx2/#mt-engines the statistics for machine translation use] are available for anyone to analyze.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Inspect a specific translation === </div> [[File:Translation debugger example.webm|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Translation debugger example</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">The [https://cxdebugger.toolforge.org/ Translation debugger] is a tool that allows the inspection of some metadata for a given translation, including the percentage of machine translation used for the whole document, and the translation service used for each paragraph.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For specific types of content such as templates, the Content Translation Server API [https://cxdebugger.toolforge.org/templates.html can be queried to check how templates will be transferred across languages].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Other limits based on user expertise == </div> [[File:Cx-limits-user-expertise.png|alt=|thumb|400x400px|<span lang="en" dir="ltr" class="mw-content-ltr">Error showing a publishing restriction based on the user expertise.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This example is based on the decision of the English Wikipedia community to limit publishing directly to the mainspace to extended autoconfirmed users only.</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">Some wikis have implemented other restrictions for translating based on the user rights as a way to reduce the creation of low-quality translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, [[w:Wikipedia:Content translation tool|English Wikipedia requires users to be extended confirmed]], which means they need to make 500 edits on English Wikipedia before they are allowed to publish a translation as an article.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Newer editors can still publish translated articles in the <code>{{ns:2}}:</code> or <code>Draft:</code> namespaces, and then [[Special:MyLanguage/Help:Moving a page|move the article]] to the mainspace.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This restriction was created before the system of limits described in this page was available, and it is not the recommended approach to encourage the creation of good quality translations. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Before adding restrictions that do not take into account the content created, consider going through the process of adjusting the limits of unmodified content as described above.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The limits can be made as strict as needed to prevent low-quality translations, while still allowing publication by editors making good translations.</span> [[Category:Extension help{{#translation:}}]] ld855kzmkk0wzkl54xfnnv8obrbg11s 8364686 8364682 2026-05-03T19:19:18Z Pallares 373182 Created page with "=== Publicació de traduccions ràpides sense revisar ===" 8364686 wikitext text/x-wiki <languages/> {{PD Help Page}} A l'hora de crear una traducció, és fonamental revisar els continguts abans de publicar-los. Cal assegurar-se que el contingut produït no alteri el significat original de manera no desitjada i comprovar que es llegeix amb naturalitat en l'idioma de destinació. La [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|traducció automàtica inicial]] proporcionada ajuda a accelerar el procés de traducció amb un punt de partida útil, però l'eina anima els usuaris a revisar i editar significativament el contingut inicial. Es dediquen diversos mecanismes per garantir que els traductors editin les traduccions inicials adequadament. L'editor de traduccions fa un seguiment de quina quantitat de la traducció inicial ha estat modificada per l'usuari i defineix diferents límits que o bé: impedeixen la publicació o adverteixen els usuaris perquè els animin a revisar més els continguts. D'aquesta manera, l'eina permet als usuaris fer un bon ús d'una traducció automàtica inicial, alhora que evita la creació de resultats poc revisats i de baixa qualitat. A continuació es presenten més detalls sobre com funcionen aquests límits, com es poden ajustar a les necessitats de cada idioma i com mesurar la qualitat del contingut produït amb l'eina. <span id="Limits_to_encourage_reviewing_the_translation"></span> == Límits per fomentar la revisió de la traducció == L'eina de '''traducció de contingut''' [https://github.com/wikimedia/mediawiki-extensions-ContentTranslation/blob/master/doc/MTAbuseCalculation.md mesura el percentatge de modificacions] que els usuaris fan a [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|la traducció automàtica inicial proporcionada]]. D'aquesta manera, el sistema sap quantes paraules s'han afegit, eliminat o modificat de la traducció inicial. Les mesures es fan a dos nivells diferents: per a cada paràgraf i per a tota la traducció. S'apliquen límits diferents a cada nivell, tal com es detalla a continuació. <span id="Limits_for_the_whole_translation"></span> === Límits per a tota la traducció === [[File:Cx-limits-publish.png|alt=|thumb|400x400px|Es mostra un error en intentar publicar una traducció amb massa traducció automàtica sense modificar. Aquest llindar es va ajustar per a l'indonesi a partir dels comentaris dels seus editors.]] La publicació és bloquejada si l'95% o més de tot el document consisteix en contingut sense modificar i traduït automàticament. Aquest límit impedeix traduccions automàtiques gairebé en brut i evita actes de vandalisme evidents. També impedeix que els usuaris simplement afegeixin contingut sense editar la part de traducció automàtica. Com es detalla a continuació, aquest límit es pot ajustar per a cada idioma. <span id="Limits_for_each_paragraph"></span> === Límits per a cada paràgraf === [[File:Cx-limits-paragraph.png|alt=|thumb|400x400px|Avís mostrat per a un paràgraf específic on la traducció automàtica sense modificar supera els límits]] També es mesura el percentatge de modificacions de l'usuari per a cada paràgraf. Un paràgraf es considera problemàtic quan conté més del 85% de la traducció automàtica inicial (o, en copiar el contingut del document font, conté més del 60% de contingut sense modificar). L'editor de traducció mostrarà un avís per cada paràgraf que es consideri problemàtic, animant l'usuari a fer més edicions. En alguns casos, els usuaris encara poden publicar, però la pàgina resultant es pot afegir a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. En altres casos, és possible que els usuaris no tinguin permís per publicar en absolut. Els següents són alguns dels factors que es tenen en compte per determinar si es permet o no que els usuaris publiquin (alguns dels quals encara estan en desenvolupament): * '''El nombre de paràgrafs problemàtics.''' Els usuaris no poden publicar traduccions amb 50 o més paràgrafs problemàtics. Es permet la publicació de traduccions amb menys de 50 paràgrafs problemàtics, però les que tinguin entre 10 i 49 paràgrafs problemàtics s'afegiran a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Traduccions suprimides anteriorment.''' Per evitar problemes recurrents, l'eina identifica els usuaris les traduccions publicades dels quals s'han suprimit en els darrers 30 dies i imposa límits molt més estrictes als seus esforços de traducció posteriors. Per als usuaris d'aquesta classe, s'impedeix la publicació de les traduccions amb 10 paràgrafs problemàtics o més, mentre que les que tenen 9 paràgrafs problemàtics o menys s'afegeixen a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Confirmació de l'usuari.''' Es considera un llindar menys estricte per als paràgrafs que un usuari marca com a resolts, que es considera un senyal que l'usuari ha revisat i confirmat l'estat de la traducció. Per als paràgrafs on es mostra l'avís de contingut sense modificar, però l'usuari el marca com a resolt, s'aplica un llindar menys estricte (acceptant el 95% de la traducció automàtica o el 75% del contingut original). Això proporcionarà una manera d'adaptar-se als casos en què la traducció automàtica ha estat excepcionalment bona, però alhora evitar un possible abús de la funció (és a dir, no seguir cegament la confirmació d'un usuari). <span id="Contents_not_affected_by_the_limits"></span> === Contingut no afectat pels límits === No s'espera que part del contingut s'editi significativament i, per tant, no es té en compte a l'hora d'aplicar els límits descrits anteriorment. Els títols de secció, les cites o la llista de referències molt curts s'exclouen de la revisió. Altrament, els usuaris podrien rebre avisos enganyosos sobre la traducció de contingut que no s'hauria de traduir, com ara títols de llibres que apareixen a les referències o altres noms propis. <span id="Limits_on_the_mobile_experience"></span> == Límits de l'experiència mòbil == Per a l'experiència mòbil, el conjunt inicial de límits segueix un enfocament més senzill. De moment, només es considera el percentatge global de traducció automàtica sense modificacions per a tota la traducció. <span lang="en" dir="ltr" class="mw-content-ltr">On mobile, the whole translation consist of just one section of the article.</span> En particular, es mostra un avís quan el percentatge de traducció automàtica sense modificacions és superior al 85% per a tota la secció, i s'impedeix la publicació quan el percentatge de traducció automàtica sense modificacions és superior al 95% <span lang="en" dir="ltr" class="mw-content-ltr">Feedback on how the limits system work on the mobile context would be very useful to determine how to evolve this initial approach.</span> <span id="Publication_of_fast_unreviewed_translations"></span> === Publicació de traduccions ràpides sense revisar === <span lang="en" dir="ltr" class="mw-content-ltr">Campaigns and contests can result in spikes of translations where some user unfamiliar with the community policies may focus on making many translations and not pay enough attention to review their contents.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In order to emphasize quality over quantity, a mechanism has been defined to limit the publication of fast unreviewed translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">After a user translates a large article, the next translation can only be started after some time has passed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The waiting period estimation considers 1 minute per paragraph up to 10 minutes. That is:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">For articles with 10 paragraphs or less, we want to make sure that users spent at least N minutes (one minute per paragraph) translating it.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">For articles with more than 10 paragraphs we want to make sure that users spent at least 10 minutes translating it.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This has been [[phab:T331023|applied on mobile initially]] since it is a space with less activity, and after measuring the impact we'll consider expanding it to desktop too. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Adjusting the limits == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The limits described above provide a set of general mechanisms, but they may need adjustment depending on the particular needs of each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on initial evaluation, the amount of modification needed to initial machine translation can range from 10% to 70%, depending on the language pair.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On some wikis, the default limits may be too strict, generating unnecessary noise or preventing perfectly valid translations from being published.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On other wikis, the limits may not be strict enough, allowing the publication of translations that have not been edited enough.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the different thresholds allows each wiki to tailor the tool's limits according to its particular needs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Feedback from native speakers is essential in properly adjusting the limits imposed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the current limits don't seem to work well based on your experience in creating or reviewing translations, please [[Talk:Content translation|share your feedback]], and we can explore how to better adjust them.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When providing feedback about adjusting the thresholds, we recommend that you first create several example translations (make sure to [[Special:MyLanguage/Help:Content translation/Publishing|check the publishing options]] if your test is not intended to be published as regular content).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When testing how the limits work for your language, it is useful to keep in mind the following:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check for both cases.''' Make sure to check how the limits work for both: translations where the content has not been edited enough, versus where it has been edited enough. </div> <span lang="en" dir="ltr" class="mw-content-ltr">In this way, you can more easily find the right balance for the tool's limits feature.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Checking only one type of problem can lead to moving the thresholds too far in the opposite direction.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check different content.''' Content in our wikis is highly diverse, and machine translation may work much better for some cases compared to others. </div> <span lang="en" dir="ltr" class="mw-content-ltr">For example, content that is full of numeric data or technical names may require less editing by users than content with more descriptive text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Make sure to test by translating of a variety of different article types, of varying lengths, with disparate content.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Prepare to iterate.''' Adjusting the thresholds is an iterative process. </div> <span lang="en" dir="ltr" class="mw-content-ltr">It may require custom adjustments to the thresholds or that you improve your general approach.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In any case, after each change, further testing may be needed to verify the improvements made.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the limits in collaboration with editors has proven to be effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, initial results show that the Indonesian community was able to significantly reduce the number of problematic translations they were receiving by restricting the publication of translations with more than 70% of unmodified machine translation content.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Similar adjustments have been made for Telugu and Assamese language wikis.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There is no automatic tool that is infallible, and these limits are not an exception.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The process of content review by the community is still essential, but these limits provide communities with a tool to reduce the number of translations they have to focus on, making the review process much more effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please [[Talk:Content translation|share your feedback]] and we can explore how to better adjust them.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Tracking potentially unreviewed translations == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A [[Special:TrackingCategories|tracking category]] with the name "cx-unreviewed-translation-category" is provided for communities to easily find articles that have been published with some content exceeding the recommended limits. </div> <span lang="en" dir="ltr" class="mw-content-ltr">You can find this category in the list of tracking categories on each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Using it, you can track articles that passed the limits preventing publication, but that still had some paragraphs that were edited less than expected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example [[:id:Kategori:Halaman_dengan_terjemahan_tak_tertinjau|the Indonesian Wikipedia's category]] includes articles that have less than 40% of machine translation overall, but which have some paragraphs with more than 80% of unmodified machine translation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Measuring translation quality == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Evaluating content quality automatically is not trivial.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Deletion ratios provide a useful measure for estimating whether the content created was good enough for the community involved not to delete it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the analysis of deletion ratios, articles that are created as translations are [[Special:MyLanguage/Content translation/Deletion statistics comparison|less likely to be deleted]] when compared with articles created from scratch.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This suggests that it may not be practical to set the limits for participation through translating much higher than those set for other ways of article creation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Find published translations === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Content translation adds a ''contenttranslation'' edit tag to the published translations. This allows communities the ability to use Recent changes, and similar tools, to focus on pages created using the translation tool.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In addition, [[Special:MyLanguage/Content translation/Published translations|data on published translations]] and [https://language-reportcard.wmflabs.org/cx2/#mt-engines the statistics for machine translation use] are available for anyone to analyze.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Inspect a specific translation === </div> [[File:Translation debugger example.webm|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Translation debugger example</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">The [https://cxdebugger.toolforge.org/ Translation debugger] is a tool that allows the inspection of some metadata for a given translation, including the percentage of machine translation used for the whole document, and the translation service used for each paragraph.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For specific types of content such as templates, the Content Translation Server API [https://cxdebugger.toolforge.org/templates.html can be queried to check how templates will be transferred across languages].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Other limits based on user expertise == </div> [[File:Cx-limits-user-expertise.png|alt=|thumb|400x400px|<span lang="en" dir="ltr" class="mw-content-ltr">Error showing a publishing restriction based on the user expertise.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This example is based on the decision of the English Wikipedia community to limit publishing directly to the mainspace to extended autoconfirmed users only.</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">Some wikis have implemented other restrictions for translating based on the user rights as a way to reduce the creation of low-quality translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, [[w:Wikipedia:Content translation tool|English Wikipedia requires users to be extended confirmed]], which means they need to make 500 edits on English Wikipedia before they are allowed to publish a translation as an article.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Newer editors can still publish translated articles in the <code>{{ns:2}}:</code> or <code>Draft:</code> namespaces, and then [[Special:MyLanguage/Help:Moving a page|move the article]] to the mainspace.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This restriction was created before the system of limits described in this page was available, and it is not the recommended approach to encourage the creation of good quality translations. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Before adding restrictions that do not take into account the content created, consider going through the process of adjusting the limits of unmodified content as described above.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The limits can be made as strict as needed to prevent low-quality translations, while still allowing publication by editors making good translations.</span> [[Category:Extension help{{#translation:}}]] jjfj411vm595wo3uxhigpuc51d2nxwm 8364691 8364686 2026-05-03T19:19:53Z Pallares 373182 Created page with "Per tal de prioritzar la qualitat per sobre de la quantitat, s'ha definit un mecanisme per limitar la publicació de traduccions ràpides no revisades." 8364691 wikitext text/x-wiki <languages/> {{PD Help Page}} A l'hora de crear una traducció, és fonamental revisar els continguts abans de publicar-los. Cal assegurar-se que el contingut produït no alteri el significat original de manera no desitjada i comprovar que es llegeix amb naturalitat en l'idioma de destinació. La [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|traducció automàtica inicial]] proporcionada ajuda a accelerar el procés de traducció amb un punt de partida útil, però l'eina anima els usuaris a revisar i editar significativament el contingut inicial. Es dediquen diversos mecanismes per garantir que els traductors editin les traduccions inicials adequadament. L'editor de traduccions fa un seguiment de quina quantitat de la traducció inicial ha estat modificada per l'usuari i defineix diferents límits que o bé: impedeixen la publicació o adverteixen els usuaris perquè els animin a revisar més els continguts. D'aquesta manera, l'eina permet als usuaris fer un bon ús d'una traducció automàtica inicial, alhora que evita la creació de resultats poc revisats i de baixa qualitat. A continuació es presenten més detalls sobre com funcionen aquests límits, com es poden ajustar a les necessitats de cada idioma i com mesurar la qualitat del contingut produït amb l'eina. <span id="Limits_to_encourage_reviewing_the_translation"></span> == Límits per fomentar la revisió de la traducció == L'eina de '''traducció de contingut''' [https://github.com/wikimedia/mediawiki-extensions-ContentTranslation/blob/master/doc/MTAbuseCalculation.md mesura el percentatge de modificacions] que els usuaris fan a [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|la traducció automàtica inicial proporcionada]]. D'aquesta manera, el sistema sap quantes paraules s'han afegit, eliminat o modificat de la traducció inicial. Les mesures es fan a dos nivells diferents: per a cada paràgraf i per a tota la traducció. S'apliquen límits diferents a cada nivell, tal com es detalla a continuació. <span id="Limits_for_the_whole_translation"></span> === Límits per a tota la traducció === [[File:Cx-limits-publish.png|alt=|thumb|400x400px|Es mostra un error en intentar publicar una traducció amb massa traducció automàtica sense modificar. Aquest llindar es va ajustar per a l'indonesi a partir dels comentaris dels seus editors.]] La publicació és bloquejada si l'95% o més de tot el document consisteix en contingut sense modificar i traduït automàticament. Aquest límit impedeix traduccions automàtiques gairebé en brut i evita actes de vandalisme evidents. També impedeix que els usuaris simplement afegeixin contingut sense editar la part de traducció automàtica. Com es detalla a continuació, aquest límit es pot ajustar per a cada idioma. <span id="Limits_for_each_paragraph"></span> === Límits per a cada paràgraf === [[File:Cx-limits-paragraph.png|alt=|thumb|400x400px|Avís mostrat per a un paràgraf específic on la traducció automàtica sense modificar supera els límits]] També es mesura el percentatge de modificacions de l'usuari per a cada paràgraf. Un paràgraf es considera problemàtic quan conté més del 85% de la traducció automàtica inicial (o, en copiar el contingut del document font, conté més del 60% de contingut sense modificar). L'editor de traducció mostrarà un avís per cada paràgraf que es consideri problemàtic, animant l'usuari a fer més edicions. En alguns casos, els usuaris encara poden publicar, però la pàgina resultant es pot afegir a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. En altres casos, és possible que els usuaris no tinguin permís per publicar en absolut. Els següents són alguns dels factors que es tenen en compte per determinar si es permet o no que els usuaris publiquin (alguns dels quals encara estan en desenvolupament): * '''El nombre de paràgrafs problemàtics.''' Els usuaris no poden publicar traduccions amb 50 o més paràgrafs problemàtics. Es permet la publicació de traduccions amb menys de 50 paràgrafs problemàtics, però les que tinguin entre 10 i 49 paràgrafs problemàtics s'afegiran a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Traduccions suprimides anteriorment.''' Per evitar problemes recurrents, l'eina identifica els usuaris les traduccions publicades dels quals s'han suprimit en els darrers 30 dies i imposa límits molt més estrictes als seus esforços de traducció posteriors. Per als usuaris d'aquesta classe, s'impedeix la publicació de les traduccions amb 10 paràgrafs problemàtics o més, mentre que les que tenen 9 paràgrafs problemàtics o menys s'afegeixen a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Confirmació de l'usuari.''' Es considera un llindar menys estricte per als paràgrafs que un usuari marca com a resolts, que es considera un senyal que l'usuari ha revisat i confirmat l'estat de la traducció. Per als paràgrafs on es mostra l'avís de contingut sense modificar, però l'usuari el marca com a resolt, s'aplica un llindar menys estricte (acceptant el 95% de la traducció automàtica o el 75% del contingut original). Això proporcionarà una manera d'adaptar-se als casos en què la traducció automàtica ha estat excepcionalment bona, però alhora evitar un possible abús de la funció (és a dir, no seguir cegament la confirmació d'un usuari). <span id="Contents_not_affected_by_the_limits"></span> === Contingut no afectat pels límits === No s'espera que part del contingut s'editi significativament i, per tant, no es té en compte a l'hora d'aplicar els límits descrits anteriorment. Els títols de secció, les cites o la llista de referències molt curts s'exclouen de la revisió. Altrament, els usuaris podrien rebre avisos enganyosos sobre la traducció de contingut que no s'hauria de traduir, com ara títols de llibres que apareixen a les referències o altres noms propis. <span id="Limits_on_the_mobile_experience"></span> == Límits de l'experiència mòbil == Per a l'experiència mòbil, el conjunt inicial de límits segueix un enfocament més senzill. De moment, només es considera el percentatge global de traducció automàtica sense modificacions per a tota la traducció. <span lang="en" dir="ltr" class="mw-content-ltr">On mobile, the whole translation consist of just one section of the article.</span> En particular, es mostra un avís quan el percentatge de traducció automàtica sense modificacions és superior al 85% per a tota la secció, i s'impedeix la publicació quan el percentatge de traducció automàtica sense modificacions és superior al 95% <span lang="en" dir="ltr" class="mw-content-ltr">Feedback on how the limits system work on the mobile context would be very useful to determine how to evolve this initial approach.</span> <span id="Publication_of_fast_unreviewed_translations"></span> === Publicació de traduccions ràpides sense revisar === <span lang="en" dir="ltr" class="mw-content-ltr">Campaigns and contests can result in spikes of translations where some user unfamiliar with the community policies may focus on making many translations and not pay enough attention to review their contents.</span> Per tal de prioritzar la qualitat per sobre de la quantitat, s'ha definit un mecanisme per limitar la publicació de traduccions ràpides no revisades. <span lang="en" dir="ltr" class="mw-content-ltr">After a user translates a large article, the next translation can only be started after some time has passed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The waiting period estimation considers 1 minute per paragraph up to 10 minutes. That is:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">For articles with 10 paragraphs or less, we want to make sure that users spent at least N minutes (one minute per paragraph) translating it.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">For articles with more than 10 paragraphs we want to make sure that users spent at least 10 minutes translating it.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This has been [[phab:T331023|applied on mobile initially]] since it is a space with less activity, and after measuring the impact we'll consider expanding it to desktop too. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Adjusting the limits == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The limits described above provide a set of general mechanisms, but they may need adjustment depending on the particular needs of each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on initial evaluation, the amount of modification needed to initial machine translation can range from 10% to 70%, depending on the language pair.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On some wikis, the default limits may be too strict, generating unnecessary noise or preventing perfectly valid translations from being published.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On other wikis, the limits may not be strict enough, allowing the publication of translations that have not been edited enough.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the different thresholds allows each wiki to tailor the tool's limits according to its particular needs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Feedback from native speakers is essential in properly adjusting the limits imposed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the current limits don't seem to work well based on your experience in creating or reviewing translations, please [[Talk:Content translation|share your feedback]], and we can explore how to better adjust them.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When providing feedback about adjusting the thresholds, we recommend that you first create several example translations (make sure to [[Special:MyLanguage/Help:Content translation/Publishing|check the publishing options]] if your test is not intended to be published as regular content).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When testing how the limits work for your language, it is useful to keep in mind the following:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check for both cases.''' Make sure to check how the limits work for both: translations where the content has not been edited enough, versus where it has been edited enough. </div> <span lang="en" dir="ltr" class="mw-content-ltr">In this way, you can more easily find the right balance for the tool's limits feature.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Checking only one type of problem can lead to moving the thresholds too far in the opposite direction.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check different content.''' Content in our wikis is highly diverse, and machine translation may work much better for some cases compared to others. </div> <span lang="en" dir="ltr" class="mw-content-ltr">For example, content that is full of numeric data or technical names may require less editing by users than content with more descriptive text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Make sure to test by translating of a variety of different article types, of varying lengths, with disparate content.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Prepare to iterate.''' Adjusting the thresholds is an iterative process. </div> <span lang="en" dir="ltr" class="mw-content-ltr">It may require custom adjustments to the thresholds or that you improve your general approach.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In any case, after each change, further testing may be needed to verify the improvements made.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the limits in collaboration with editors has proven to be effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, initial results show that the Indonesian community was able to significantly reduce the number of problematic translations they were receiving by restricting the publication of translations with more than 70% of unmodified machine translation content.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Similar adjustments have been made for Telugu and Assamese language wikis.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There is no automatic tool that is infallible, and these limits are not an exception.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The process of content review by the community is still essential, but these limits provide communities with a tool to reduce the number of translations they have to focus on, making the review process much more effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please [[Talk:Content translation|share your feedback]] and we can explore how to better adjust them.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Tracking potentially unreviewed translations == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A [[Special:TrackingCategories|tracking category]] with the name "cx-unreviewed-translation-category" is provided for communities to easily find articles that have been published with some content exceeding the recommended limits. </div> <span lang="en" dir="ltr" class="mw-content-ltr">You can find this category in the list of tracking categories on each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Using it, you can track articles that passed the limits preventing publication, but that still had some paragraphs that were edited less than expected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example [[:id:Kategori:Halaman_dengan_terjemahan_tak_tertinjau|the Indonesian Wikipedia's category]] includes articles that have less than 40% of machine translation overall, but which have some paragraphs with more than 80% of unmodified machine translation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Measuring translation quality == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Evaluating content quality automatically is not trivial.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Deletion ratios provide a useful measure for estimating whether the content created was good enough for the community involved not to delete it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the analysis of deletion ratios, articles that are created as translations are [[Special:MyLanguage/Content translation/Deletion statistics comparison|less likely to be deleted]] when compared with articles created from scratch.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This suggests that it may not be practical to set the limits for participation through translating much higher than those set for other ways of article creation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Find published translations === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Content translation adds a ''contenttranslation'' edit tag to the published translations. This allows communities the ability to use Recent changes, and similar tools, to focus on pages created using the translation tool.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In addition, [[Special:MyLanguage/Content translation/Published translations|data on published translations]] and [https://language-reportcard.wmflabs.org/cx2/#mt-engines the statistics for machine translation use] are available for anyone to analyze.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Inspect a specific translation === </div> [[File:Translation debugger example.webm|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Translation debugger example</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">The [https://cxdebugger.toolforge.org/ Translation debugger] is a tool that allows the inspection of some metadata for a given translation, including the percentage of machine translation used for the whole document, and the translation service used for each paragraph.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For specific types of content such as templates, the Content Translation Server API [https://cxdebugger.toolforge.org/templates.html can be queried to check how templates will be transferred across languages].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Other limits based on user expertise == </div> [[File:Cx-limits-user-expertise.png|alt=|thumb|400x400px|<span lang="en" dir="ltr" class="mw-content-ltr">Error showing a publishing restriction based on the user expertise.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This example is based on the decision of the English Wikipedia community to limit publishing directly to the mainspace to extended autoconfirmed users only.</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">Some wikis have implemented other restrictions for translating based on the user rights as a way to reduce the creation of low-quality translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, [[w:Wikipedia:Content translation tool|English Wikipedia requires users to be extended confirmed]], which means they need to make 500 edits on English Wikipedia before they are allowed to publish a translation as an article.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Newer editors can still publish translated articles in the <code>{{ns:2}}:</code> or <code>Draft:</code> namespaces, and then [[Special:MyLanguage/Help:Moving a page|move the article]] to the mainspace.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This restriction was created before the system of limits described in this page was available, and it is not the recommended approach to encourage the creation of good quality translations. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Before adding restrictions that do not take into account the content created, consider going through the process of adjusting the limits of unmodified content as described above.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The limits can be made as strict as needed to prevent low-quality translations, while still allowing publication by editors making good translations.</span> [[Category:Extension help{{#translation:}}]] bo95xssdh8jhpt7mewmd6edp5qmq2o2 8364697 8364691 2026-05-03T19:20:50Z Pallares 373182 Created page with "L'estimació del període d'espera considera 1 minut per paràgraf fins a un màxim de 10 minuts. És a dir:" 8364697 wikitext text/x-wiki <languages/> {{PD Help Page}} A l'hora de crear una traducció, és fonamental revisar els continguts abans de publicar-los. Cal assegurar-se que el contingut produït no alteri el significat original de manera no desitjada i comprovar que es llegeix amb naturalitat en l'idioma de destinació. La [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|traducció automàtica inicial]] proporcionada ajuda a accelerar el procés de traducció amb un punt de partida útil, però l'eina anima els usuaris a revisar i editar significativament el contingut inicial. Es dediquen diversos mecanismes per garantir que els traductors editin les traduccions inicials adequadament. L'editor de traduccions fa un seguiment de quina quantitat de la traducció inicial ha estat modificada per l'usuari i defineix diferents límits que o bé: impedeixen la publicació o adverteixen els usuaris perquè els animin a revisar més els continguts. D'aquesta manera, l'eina permet als usuaris fer un bon ús d'una traducció automàtica inicial, alhora que evita la creació de resultats poc revisats i de baixa qualitat. A continuació es presenten més detalls sobre com funcionen aquests límits, com es poden ajustar a les necessitats de cada idioma i com mesurar la qualitat del contingut produït amb l'eina. <span id="Limits_to_encourage_reviewing_the_translation"></span> == Límits per fomentar la revisió de la traducció == L'eina de '''traducció de contingut''' [https://github.com/wikimedia/mediawiki-extensions-ContentTranslation/blob/master/doc/MTAbuseCalculation.md mesura el percentatge de modificacions] que els usuaris fan a [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|la traducció automàtica inicial proporcionada]]. D'aquesta manera, el sistema sap quantes paraules s'han afegit, eliminat o modificat de la traducció inicial. Les mesures es fan a dos nivells diferents: per a cada paràgraf i per a tota la traducció. S'apliquen límits diferents a cada nivell, tal com es detalla a continuació. <span id="Limits_for_the_whole_translation"></span> === Límits per a tota la traducció === [[File:Cx-limits-publish.png|alt=|thumb|400x400px|Es mostra un error en intentar publicar una traducció amb massa traducció automàtica sense modificar. Aquest llindar es va ajustar per a l'indonesi a partir dels comentaris dels seus editors.]] La publicació és bloquejada si l'95% o més de tot el document consisteix en contingut sense modificar i traduït automàticament. Aquest límit impedeix traduccions automàtiques gairebé en brut i evita actes de vandalisme evidents. També impedeix que els usuaris simplement afegeixin contingut sense editar la part de traducció automàtica. Com es detalla a continuació, aquest límit es pot ajustar per a cada idioma. <span id="Limits_for_each_paragraph"></span> === Límits per a cada paràgraf === [[File:Cx-limits-paragraph.png|alt=|thumb|400x400px|Avís mostrat per a un paràgraf específic on la traducció automàtica sense modificar supera els límits]] També es mesura el percentatge de modificacions de l'usuari per a cada paràgraf. Un paràgraf es considera problemàtic quan conté més del 85% de la traducció automàtica inicial (o, en copiar el contingut del document font, conté més del 60% de contingut sense modificar). L'editor de traducció mostrarà un avís per cada paràgraf que es consideri problemàtic, animant l'usuari a fer més edicions. En alguns casos, els usuaris encara poden publicar, però la pàgina resultant es pot afegir a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. En altres casos, és possible que els usuaris no tinguin permís per publicar en absolut. Els següents són alguns dels factors que es tenen en compte per determinar si es permet o no que els usuaris publiquin (alguns dels quals encara estan en desenvolupament): * '''El nombre de paràgrafs problemàtics.''' Els usuaris no poden publicar traduccions amb 50 o més paràgrafs problemàtics. Es permet la publicació de traduccions amb menys de 50 paràgrafs problemàtics, però les que tinguin entre 10 i 49 paràgrafs problemàtics s'afegiran a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Traduccions suprimides anteriorment.''' Per evitar problemes recurrents, l'eina identifica els usuaris les traduccions publicades dels quals s'han suprimit en els darrers 30 dies i imposa límits molt més estrictes als seus esforços de traducció posteriors. Per als usuaris d'aquesta classe, s'impedeix la publicació de les traduccions amb 10 paràgrafs problemàtics o més, mentre que les que tenen 9 paràgrafs problemàtics o menys s'afegeixen a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Confirmació de l'usuari.''' Es considera un llindar menys estricte per als paràgrafs que un usuari marca com a resolts, que es considera un senyal que l'usuari ha revisat i confirmat l'estat de la traducció. Per als paràgrafs on es mostra l'avís de contingut sense modificar, però l'usuari el marca com a resolt, s'aplica un llindar menys estricte (acceptant el 95% de la traducció automàtica o el 75% del contingut original). Això proporcionarà una manera d'adaptar-se als casos en què la traducció automàtica ha estat excepcionalment bona, però alhora evitar un possible abús de la funció (és a dir, no seguir cegament la confirmació d'un usuari). <span id="Contents_not_affected_by_the_limits"></span> === Contingut no afectat pels límits === No s'espera que part del contingut s'editi significativament i, per tant, no es té en compte a l'hora d'aplicar els límits descrits anteriorment. Els títols de secció, les cites o la llista de referències molt curts s'exclouen de la revisió. Altrament, els usuaris podrien rebre avisos enganyosos sobre la traducció de contingut que no s'hauria de traduir, com ara títols de llibres que apareixen a les referències o altres noms propis. <span id="Limits_on_the_mobile_experience"></span> == Límits de l'experiència mòbil == Per a l'experiència mòbil, el conjunt inicial de límits segueix un enfocament més senzill. De moment, només es considera el percentatge global de traducció automàtica sense modificacions per a tota la traducció. <span lang="en" dir="ltr" class="mw-content-ltr">On mobile, the whole translation consist of just one section of the article.</span> En particular, es mostra un avís quan el percentatge de traducció automàtica sense modificacions és superior al 85% per a tota la secció, i s'impedeix la publicació quan el percentatge de traducció automàtica sense modificacions és superior al 95% <span lang="en" dir="ltr" class="mw-content-ltr">Feedback on how the limits system work on the mobile context would be very useful to determine how to evolve this initial approach.</span> <span id="Publication_of_fast_unreviewed_translations"></span> === Publicació de traduccions ràpides sense revisar === <span lang="en" dir="ltr" class="mw-content-ltr">Campaigns and contests can result in spikes of translations where some user unfamiliar with the community policies may focus on making many translations and not pay enough attention to review their contents.</span> Per tal de prioritzar la qualitat per sobre de la quantitat, s'ha definit un mecanisme per limitar la publicació de traduccions ràpides no revisades. <span lang="en" dir="ltr" class="mw-content-ltr">After a user translates a large article, the next translation can only be started after some time has passed.</span> L'estimació del període d'espera considera 1 minut per paràgraf fins a un màxim de 10 minuts. És a dir: * <span lang="en" dir="ltr" class="mw-content-ltr">For articles with 10 paragraphs or less, we want to make sure that users spent at least N minutes (one minute per paragraph) translating it.</span> * Per als articles amb més de 10 paràgrafs, volem assegurar-nos que els usuaris hagin dedicat almenys 10 minuts a traduir-los. <div lang="en" dir="ltr" class="mw-content-ltr"> This has been [[phab:T331023|applied on mobile initially]] since it is a space with less activity, and after measuring the impact we'll consider expanding it to desktop too. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Adjusting the limits == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The limits described above provide a set of general mechanisms, but they may need adjustment depending on the particular needs of each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on initial evaluation, the amount of modification needed to initial machine translation can range from 10% to 70%, depending on the language pair.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On some wikis, the default limits may be too strict, generating unnecessary noise or preventing perfectly valid translations from being published.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On other wikis, the limits may not be strict enough, allowing the publication of translations that have not been edited enough.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the different thresholds allows each wiki to tailor the tool's limits according to its particular needs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Feedback from native speakers is essential in properly adjusting the limits imposed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the current limits don't seem to work well based on your experience in creating or reviewing translations, please [[Talk:Content translation|share your feedback]], and we can explore how to better adjust them.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When providing feedback about adjusting the thresholds, we recommend that you first create several example translations (make sure to [[Special:MyLanguage/Help:Content translation/Publishing|check the publishing options]] if your test is not intended to be published as regular content).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When testing how the limits work for your language, it is useful to keep in mind the following:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check for both cases.''' Make sure to check how the limits work for both: translations where the content has not been edited enough, versus where it has been edited enough. </div> <span lang="en" dir="ltr" class="mw-content-ltr">In this way, you can more easily find the right balance for the tool's limits feature.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Checking only one type of problem can lead to moving the thresholds too far in the opposite direction.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check different content.''' Content in our wikis is highly diverse, and machine translation may work much better for some cases compared to others. </div> <span lang="en" dir="ltr" class="mw-content-ltr">For example, content that is full of numeric data or technical names may require less editing by users than content with more descriptive text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Make sure to test by translating of a variety of different article types, of varying lengths, with disparate content.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Prepare to iterate.''' Adjusting the thresholds is an iterative process. </div> <span lang="en" dir="ltr" class="mw-content-ltr">It may require custom adjustments to the thresholds or that you improve your general approach.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In any case, after each change, further testing may be needed to verify the improvements made.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the limits in collaboration with editors has proven to be effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, initial results show that the Indonesian community was able to significantly reduce the number of problematic translations they were receiving by restricting the publication of translations with more than 70% of unmodified machine translation content.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Similar adjustments have been made for Telugu and Assamese language wikis.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There is no automatic tool that is infallible, and these limits are not an exception.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The process of content review by the community is still essential, but these limits provide communities with a tool to reduce the number of translations they have to focus on, making the review process much more effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please [[Talk:Content translation|share your feedback]] and we can explore how to better adjust them.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Tracking potentially unreviewed translations == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A [[Special:TrackingCategories|tracking category]] with the name "cx-unreviewed-translation-category" is provided for communities to easily find articles that have been published with some content exceeding the recommended limits. </div> <span lang="en" dir="ltr" class="mw-content-ltr">You can find this category in the list of tracking categories on each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Using it, you can track articles that passed the limits preventing publication, but that still had some paragraphs that were edited less than expected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example [[:id:Kategori:Halaman_dengan_terjemahan_tak_tertinjau|the Indonesian Wikipedia's category]] includes articles that have less than 40% of machine translation overall, but which have some paragraphs with more than 80% of unmodified machine translation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Measuring translation quality == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Evaluating content quality automatically is not trivial.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Deletion ratios provide a useful measure for estimating whether the content created was good enough for the community involved not to delete it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the analysis of deletion ratios, articles that are created as translations are [[Special:MyLanguage/Content translation/Deletion statistics comparison|less likely to be deleted]] when compared with articles created from scratch.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This suggests that it may not be practical to set the limits for participation through translating much higher than those set for other ways of article creation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Find published translations === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Content translation adds a ''contenttranslation'' edit tag to the published translations. This allows communities the ability to use Recent changes, and similar tools, to focus on pages created using the translation tool.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In addition, [[Special:MyLanguage/Content translation/Published translations|data on published translations]] and [https://language-reportcard.wmflabs.org/cx2/#mt-engines the statistics for machine translation use] are available for anyone to analyze.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Inspect a specific translation === </div> [[File:Translation debugger example.webm|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Translation debugger example</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">The [https://cxdebugger.toolforge.org/ Translation debugger] is a tool that allows the inspection of some metadata for a given translation, including the percentage of machine translation used for the whole document, and the translation service used for each paragraph.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For specific types of content such as templates, the Content Translation Server API [https://cxdebugger.toolforge.org/templates.html can be queried to check how templates will be transferred across languages].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Other limits based on user expertise == </div> [[File:Cx-limits-user-expertise.png|alt=|thumb|400x400px|<span lang="en" dir="ltr" class="mw-content-ltr">Error showing a publishing restriction based on the user expertise.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This example is based on the decision of the English Wikipedia community to limit publishing directly to the mainspace to extended autoconfirmed users only.</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">Some wikis have implemented other restrictions for translating based on the user rights as a way to reduce the creation of low-quality translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, [[w:Wikipedia:Content translation tool|English Wikipedia requires users to be extended confirmed]], which means they need to make 500 edits on English Wikipedia before they are allowed to publish a translation as an article.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Newer editors can still publish translated articles in the <code>{{ns:2}}:</code> or <code>Draft:</code> namespaces, and then [[Special:MyLanguage/Help:Moving a page|move the article]] to the mainspace.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This restriction was created before the system of limits described in this page was available, and it is not the recommended approach to encourage the creation of good quality translations. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Before adding restrictions that do not take into account the content created, consider going through the process of adjusting the limits of unmodified content as described above.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The limits can be made as strict as needed to prevent low-quality translations, while still allowing publication by editors making good translations.</span> [[Category:Extension help{{#translation:}}]] kwy3vhidvfepg8e2z356d0v9d5v50zd 8364700 8364697 2026-05-03T19:21:53Z Pallares 373182 Created page with "Això s'ha [[$1|aplicat inicialment al mòbil]], ja que és un espai amb menys activitat, i després de mesurar l'impacte considerarem expandir-ho també a l'escriptori." 8364700 wikitext text/x-wiki <languages/> {{PD Help Page}} A l'hora de crear una traducció, és fonamental revisar els continguts abans de publicar-los. Cal assegurar-se que el contingut produït no alteri el significat original de manera no desitjada i comprovar que es llegeix amb naturalitat en l'idioma de destinació. La [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|traducció automàtica inicial]] proporcionada ajuda a accelerar el procés de traducció amb un punt de partida útil, però l'eina anima els usuaris a revisar i editar significativament el contingut inicial. Es dediquen diversos mecanismes per garantir que els traductors editin les traduccions inicials adequadament. L'editor de traduccions fa un seguiment de quina quantitat de la traducció inicial ha estat modificada per l'usuari i defineix diferents límits que o bé: impedeixen la publicació o adverteixen els usuaris perquè els animin a revisar més els continguts. D'aquesta manera, l'eina permet als usuaris fer un bon ús d'una traducció automàtica inicial, alhora que evita la creació de resultats poc revisats i de baixa qualitat. A continuació es presenten més detalls sobre com funcionen aquests límits, com es poden ajustar a les necessitats de cada idioma i com mesurar la qualitat del contingut produït amb l'eina. <span id="Limits_to_encourage_reviewing_the_translation"></span> == Límits per fomentar la revisió de la traducció == L'eina de '''traducció de contingut''' [https://github.com/wikimedia/mediawiki-extensions-ContentTranslation/blob/master/doc/MTAbuseCalculation.md mesura el percentatge de modificacions] que els usuaris fan a [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|la traducció automàtica inicial proporcionada]]. D'aquesta manera, el sistema sap quantes paraules s'han afegit, eliminat o modificat de la traducció inicial. Les mesures es fan a dos nivells diferents: per a cada paràgraf i per a tota la traducció. S'apliquen límits diferents a cada nivell, tal com es detalla a continuació. <span id="Limits_for_the_whole_translation"></span> === Límits per a tota la traducció === [[File:Cx-limits-publish.png|alt=|thumb|400x400px|Es mostra un error en intentar publicar una traducció amb massa traducció automàtica sense modificar. Aquest llindar es va ajustar per a l'indonesi a partir dels comentaris dels seus editors.]] La publicació és bloquejada si l'95% o més de tot el document consisteix en contingut sense modificar i traduït automàticament. Aquest límit impedeix traduccions automàtiques gairebé en brut i evita actes de vandalisme evidents. També impedeix que els usuaris simplement afegeixin contingut sense editar la part de traducció automàtica. Com es detalla a continuació, aquest límit es pot ajustar per a cada idioma. <span id="Limits_for_each_paragraph"></span> === Límits per a cada paràgraf === [[File:Cx-limits-paragraph.png|alt=|thumb|400x400px|Avís mostrat per a un paràgraf específic on la traducció automàtica sense modificar supera els límits]] També es mesura el percentatge de modificacions de l'usuari per a cada paràgraf. Un paràgraf es considera problemàtic quan conté més del 85% de la traducció automàtica inicial (o, en copiar el contingut del document font, conté més del 60% de contingut sense modificar). L'editor de traducció mostrarà un avís per cada paràgraf que es consideri problemàtic, animant l'usuari a fer més edicions. En alguns casos, els usuaris encara poden publicar, però la pàgina resultant es pot afegir a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. En altres casos, és possible que els usuaris no tinguin permís per publicar en absolut. Els següents són alguns dels factors que es tenen en compte per determinar si es permet o no que els usuaris publiquin (alguns dels quals encara estan en desenvolupament): * '''El nombre de paràgrafs problemàtics.''' Els usuaris no poden publicar traduccions amb 50 o més paràgrafs problemàtics. Es permet la publicació de traduccions amb menys de 50 paràgrafs problemàtics, però les que tinguin entre 10 i 49 paràgrafs problemàtics s'afegiran a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Traduccions suprimides anteriorment.''' Per evitar problemes recurrents, l'eina identifica els usuaris les traduccions publicades dels quals s'han suprimit en els darrers 30 dies i imposa límits molt més estrictes als seus esforços de traducció posteriors. Per als usuaris d'aquesta classe, s'impedeix la publicació de les traduccions amb 10 paràgrafs problemàtics o més, mentre que les que tenen 9 paràgrafs problemàtics o menys s'afegeixen a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Confirmació de l'usuari.''' Es considera un llindar menys estricte per als paràgrafs que un usuari marca com a resolts, que es considera un senyal que l'usuari ha revisat i confirmat l'estat de la traducció. Per als paràgrafs on es mostra l'avís de contingut sense modificar, però l'usuari el marca com a resolt, s'aplica un llindar menys estricte (acceptant el 95% de la traducció automàtica o el 75% del contingut original). Això proporcionarà una manera d'adaptar-se als casos en què la traducció automàtica ha estat excepcionalment bona, però alhora evitar un possible abús de la funció (és a dir, no seguir cegament la confirmació d'un usuari). <span id="Contents_not_affected_by_the_limits"></span> === Contingut no afectat pels límits === No s'espera que part del contingut s'editi significativament i, per tant, no es té en compte a l'hora d'aplicar els límits descrits anteriorment. Els títols de secció, les cites o la llista de referències molt curts s'exclouen de la revisió. Altrament, els usuaris podrien rebre avisos enganyosos sobre la traducció de contingut que no s'hauria de traduir, com ara títols de llibres que apareixen a les referències o altres noms propis. <span id="Limits_on_the_mobile_experience"></span> == Límits de l'experiència mòbil == Per a l'experiència mòbil, el conjunt inicial de límits segueix un enfocament més senzill. De moment, només es considera el percentatge global de traducció automàtica sense modificacions per a tota la traducció. <span lang="en" dir="ltr" class="mw-content-ltr">On mobile, the whole translation consist of just one section of the article.</span> En particular, es mostra un avís quan el percentatge de traducció automàtica sense modificacions és superior al 85% per a tota la secció, i s'impedeix la publicació quan el percentatge de traducció automàtica sense modificacions és superior al 95% <span lang="en" dir="ltr" class="mw-content-ltr">Feedback on how the limits system work on the mobile context would be very useful to determine how to evolve this initial approach.</span> <span id="Publication_of_fast_unreviewed_translations"></span> === Publicació de traduccions ràpides sense revisar === <span lang="en" dir="ltr" class="mw-content-ltr">Campaigns and contests can result in spikes of translations where some user unfamiliar with the community policies may focus on making many translations and not pay enough attention to review their contents.</span> Per tal de prioritzar la qualitat per sobre de la quantitat, s'ha definit un mecanisme per limitar la publicació de traduccions ràpides no revisades. <span lang="en" dir="ltr" class="mw-content-ltr">After a user translates a large article, the next translation can only be started after some time has passed.</span> L'estimació del període d'espera considera 1 minut per paràgraf fins a un màxim de 10 minuts. És a dir: * <span lang="en" dir="ltr" class="mw-content-ltr">For articles with 10 paragraphs or less, we want to make sure that users spent at least N minutes (one minute per paragraph) translating it.</span> * Per als articles amb més de 10 paràgrafs, volem assegurar-nos que els usuaris hagin dedicat almenys 10 minuts a traduir-los. Això s'ha [[phab:T331023|aplicat inicialment al mòbil]], ja que és un espai amb menys activitat, i després de mesurar l'impacte considerarem expandir-ho també a l'escriptori. <div lang="en" dir="ltr" class="mw-content-ltr"> == Adjusting the limits == </div> <span lang="en" dir="ltr" class="mw-content-ltr">The limits described above provide a set of general mechanisms, but they may need adjustment depending on the particular needs of each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on initial evaluation, the amount of modification needed to initial machine translation can range from 10% to 70%, depending on the language pair.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On some wikis, the default limits may be too strict, generating unnecessary noise or preventing perfectly valid translations from being published.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On other wikis, the limits may not be strict enough, allowing the publication of translations that have not been edited enough.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the different thresholds allows each wiki to tailor the tool's limits according to its particular needs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Feedback from native speakers is essential in properly adjusting the limits imposed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the current limits don't seem to work well based on your experience in creating or reviewing translations, please [[Talk:Content translation|share your feedback]], and we can explore how to better adjust them.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When providing feedback about adjusting the thresholds, we recommend that you first create several example translations (make sure to [[Special:MyLanguage/Help:Content translation/Publishing|check the publishing options]] if your test is not intended to be published as regular content).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When testing how the limits work for your language, it is useful to keep in mind the following:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check for both cases.''' Make sure to check how the limits work for both: translations where the content has not been edited enough, versus where it has been edited enough. </div> <span lang="en" dir="ltr" class="mw-content-ltr">In this way, you can more easily find the right balance for the tool's limits feature.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Checking only one type of problem can lead to moving the thresholds too far in the opposite direction.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check different content.''' Content in our wikis is highly diverse, and machine translation may work much better for some cases compared to others. </div> <span lang="en" dir="ltr" class="mw-content-ltr">For example, content that is full of numeric data or technical names may require less editing by users than content with more descriptive text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Make sure to test by translating of a variety of different article types, of varying lengths, with disparate content.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Prepare to iterate.''' Adjusting the thresholds is an iterative process. </div> <span lang="en" dir="ltr" class="mw-content-ltr">It may require custom adjustments to the thresholds or that you improve your general approach.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In any case, after each change, further testing may be needed to verify the improvements made.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the limits in collaboration with editors has proven to be effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, initial results show that the Indonesian community was able to significantly reduce the number of problematic translations they were receiving by restricting the publication of translations with more than 70% of unmodified machine translation content.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Similar adjustments have been made for Telugu and Assamese language wikis.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There is no automatic tool that is infallible, and these limits are not an exception.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The process of content review by the community is still essential, but these limits provide communities with a tool to reduce the number of translations they have to focus on, making the review process much more effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please [[Talk:Content translation|share your feedback]] and we can explore how to better adjust them.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Tracking potentially unreviewed translations == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A [[Special:TrackingCategories|tracking category]] with the name "cx-unreviewed-translation-category" is provided for communities to easily find articles that have been published with some content exceeding the recommended limits. </div> <span lang="en" dir="ltr" class="mw-content-ltr">You can find this category in the list of tracking categories on each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Using it, you can track articles that passed the limits preventing publication, but that still had some paragraphs that were edited less than expected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example [[:id:Kategori:Halaman_dengan_terjemahan_tak_tertinjau|the Indonesian Wikipedia's category]] includes articles that have less than 40% of machine translation overall, but which have some paragraphs with more than 80% of unmodified machine translation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Measuring translation quality == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Evaluating content quality automatically is not trivial.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Deletion ratios provide a useful measure for estimating whether the content created was good enough for the community involved not to delete it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the analysis of deletion ratios, articles that are created as translations are [[Special:MyLanguage/Content translation/Deletion statistics comparison|less likely to be deleted]] when compared with articles created from scratch.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This suggests that it may not be practical to set the limits for participation through translating much higher than those set for other ways of article creation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Find published translations === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Content translation adds a ''contenttranslation'' edit tag to the published translations. This allows communities the ability to use Recent changes, and similar tools, to focus on pages created using the translation tool.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In addition, [[Special:MyLanguage/Content translation/Published translations|data on published translations]] and [https://language-reportcard.wmflabs.org/cx2/#mt-engines the statistics for machine translation use] are available for anyone to analyze.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Inspect a specific translation === </div> [[File:Translation debugger example.webm|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Translation debugger example</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">The [https://cxdebugger.toolforge.org/ Translation debugger] is a tool that allows the inspection of some metadata for a given translation, including the percentage of machine translation used for the whole document, and the translation service used for each paragraph.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For specific types of content such as templates, the Content Translation Server API [https://cxdebugger.toolforge.org/templates.html can be queried to check how templates will be transferred across languages].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Other limits based on user expertise == </div> [[File:Cx-limits-user-expertise.png|alt=|thumb|400x400px|<span lang="en" dir="ltr" class="mw-content-ltr">Error showing a publishing restriction based on the user expertise.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This example is based on the decision of the English Wikipedia community to limit publishing directly to the mainspace to extended autoconfirmed users only.</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">Some wikis have implemented other restrictions for translating based on the user rights as a way to reduce the creation of low-quality translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, [[w:Wikipedia:Content translation tool|English Wikipedia requires users to be extended confirmed]], which means they need to make 500 edits on English Wikipedia before they are allowed to publish a translation as an article.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Newer editors can still publish translated articles in the <code>{{ns:2}}:</code> or <code>Draft:</code> namespaces, and then [[Special:MyLanguage/Help:Moving a page|move the article]] to the mainspace.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This restriction was created before the system of limits described in this page was available, and it is not the recommended approach to encourage the creation of good quality translations. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Before adding restrictions that do not take into account the content created, consider going through the process of adjusting the limits of unmodified content as described above.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The limits can be made as strict as needed to prevent low-quality translations, while still allowing publication by editors making good translations.</span> [[Category:Extension help{{#translation:}}]] lx4e1i29vfck7rx1toaksscgna7n0iv 8364704 8364700 2026-05-03T19:22:09Z Pallares 373182 Created page with "== Ajustant els límits ==" 8364704 wikitext text/x-wiki <languages/> {{PD Help Page}} A l'hora de crear una traducció, és fonamental revisar els continguts abans de publicar-los. Cal assegurar-se que el contingut produït no alteri el significat original de manera no desitjada i comprovar que es llegeix amb naturalitat en l'idioma de destinació. La [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|traducció automàtica inicial]] proporcionada ajuda a accelerar el procés de traducció amb un punt de partida útil, però l'eina anima els usuaris a revisar i editar significativament el contingut inicial. Es dediquen diversos mecanismes per garantir que els traductors editin les traduccions inicials adequadament. L'editor de traduccions fa un seguiment de quina quantitat de la traducció inicial ha estat modificada per l'usuari i defineix diferents límits que o bé: impedeixen la publicació o adverteixen els usuaris perquè els animin a revisar més els continguts. D'aquesta manera, l'eina permet als usuaris fer un bon ús d'una traducció automàtica inicial, alhora que evita la creació de resultats poc revisats i de baixa qualitat. A continuació es presenten més detalls sobre com funcionen aquests límits, com es poden ajustar a les necessitats de cada idioma i com mesurar la qualitat del contingut produït amb l'eina. <span id="Limits_to_encourage_reviewing_the_translation"></span> == Límits per fomentar la revisió de la traducció == L'eina de '''traducció de contingut''' [https://github.com/wikimedia/mediawiki-extensions-ContentTranslation/blob/master/doc/MTAbuseCalculation.md mesura el percentatge de modificacions] que els usuaris fan a [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|la traducció automàtica inicial proporcionada]]. D'aquesta manera, el sistema sap quantes paraules s'han afegit, eliminat o modificat de la traducció inicial. Les mesures es fan a dos nivells diferents: per a cada paràgraf i per a tota la traducció. S'apliquen límits diferents a cada nivell, tal com es detalla a continuació. <span id="Limits_for_the_whole_translation"></span> === Límits per a tota la traducció === [[File:Cx-limits-publish.png|alt=|thumb|400x400px|Es mostra un error en intentar publicar una traducció amb massa traducció automàtica sense modificar. Aquest llindar es va ajustar per a l'indonesi a partir dels comentaris dels seus editors.]] La publicació és bloquejada si l'95% o més de tot el document consisteix en contingut sense modificar i traduït automàticament. Aquest límit impedeix traduccions automàtiques gairebé en brut i evita actes de vandalisme evidents. També impedeix que els usuaris simplement afegeixin contingut sense editar la part de traducció automàtica. Com es detalla a continuació, aquest límit es pot ajustar per a cada idioma. <span id="Limits_for_each_paragraph"></span> === Límits per a cada paràgraf === [[File:Cx-limits-paragraph.png|alt=|thumb|400x400px|Avís mostrat per a un paràgraf específic on la traducció automàtica sense modificar supera els límits]] També es mesura el percentatge de modificacions de l'usuari per a cada paràgraf. Un paràgraf es considera problemàtic quan conté més del 85% de la traducció automàtica inicial (o, en copiar el contingut del document font, conté més del 60% de contingut sense modificar). L'editor de traducció mostrarà un avís per cada paràgraf que es consideri problemàtic, animant l'usuari a fer més edicions. En alguns casos, els usuaris encara poden publicar, però la pàgina resultant es pot afegir a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. En altres casos, és possible que els usuaris no tinguin permís per publicar en absolut. Els següents són alguns dels factors que es tenen en compte per determinar si es permet o no que els usuaris publiquin (alguns dels quals encara estan en desenvolupament): * '''El nombre de paràgrafs problemàtics.''' Els usuaris no poden publicar traduccions amb 50 o més paràgrafs problemàtics. Es permet la publicació de traduccions amb menys de 50 paràgrafs problemàtics, però les que tinguin entre 10 i 49 paràgrafs problemàtics s'afegiran a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Traduccions suprimides anteriorment.''' Per evitar problemes recurrents, l'eina identifica els usuaris les traduccions publicades dels quals s'han suprimit en els darrers 30 dies i imposa límits molt més estrictes als seus esforços de traducció posteriors. Per als usuaris d'aquesta classe, s'impedeix la publicació de les traduccions amb 10 paràgrafs problemàtics o més, mentre que les que tenen 9 paràgrafs problemàtics o menys s'afegeixen a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Confirmació de l'usuari.''' Es considera un llindar menys estricte per als paràgrafs que un usuari marca com a resolts, que es considera un senyal que l'usuari ha revisat i confirmat l'estat de la traducció. Per als paràgrafs on es mostra l'avís de contingut sense modificar, però l'usuari el marca com a resolt, s'aplica un llindar menys estricte (acceptant el 95% de la traducció automàtica o el 75% del contingut original). Això proporcionarà una manera d'adaptar-se als casos en què la traducció automàtica ha estat excepcionalment bona, però alhora evitar un possible abús de la funció (és a dir, no seguir cegament la confirmació d'un usuari). <span id="Contents_not_affected_by_the_limits"></span> === Contingut no afectat pels límits === No s'espera que part del contingut s'editi significativament i, per tant, no es té en compte a l'hora d'aplicar els límits descrits anteriorment. Els títols de secció, les cites o la llista de referències molt curts s'exclouen de la revisió. Altrament, els usuaris podrien rebre avisos enganyosos sobre la traducció de contingut que no s'hauria de traduir, com ara títols de llibres que apareixen a les referències o altres noms propis. <span id="Limits_on_the_mobile_experience"></span> == Límits de l'experiència mòbil == Per a l'experiència mòbil, el conjunt inicial de límits segueix un enfocament més senzill. De moment, només es considera el percentatge global de traducció automàtica sense modificacions per a tota la traducció. <span lang="en" dir="ltr" class="mw-content-ltr">On mobile, the whole translation consist of just one section of the article.</span> En particular, es mostra un avís quan el percentatge de traducció automàtica sense modificacions és superior al 85% per a tota la secció, i s'impedeix la publicació quan el percentatge de traducció automàtica sense modificacions és superior al 95% <span lang="en" dir="ltr" class="mw-content-ltr">Feedback on how the limits system work on the mobile context would be very useful to determine how to evolve this initial approach.</span> <span id="Publication_of_fast_unreviewed_translations"></span> === Publicació de traduccions ràpides sense revisar === <span lang="en" dir="ltr" class="mw-content-ltr">Campaigns and contests can result in spikes of translations where some user unfamiliar with the community policies may focus on making many translations and not pay enough attention to review their contents.</span> Per tal de prioritzar la qualitat per sobre de la quantitat, s'ha definit un mecanisme per limitar la publicació de traduccions ràpides no revisades. <span lang="en" dir="ltr" class="mw-content-ltr">After a user translates a large article, the next translation can only be started after some time has passed.</span> L'estimació del període d'espera considera 1 minut per paràgraf fins a un màxim de 10 minuts. És a dir: * <span lang="en" dir="ltr" class="mw-content-ltr">For articles with 10 paragraphs or less, we want to make sure that users spent at least N minutes (one minute per paragraph) translating it.</span> * Per als articles amb més de 10 paràgrafs, volem assegurar-nos que els usuaris hagin dedicat almenys 10 minuts a traduir-los. Això s'ha [[phab:T331023|aplicat inicialment al mòbil]], ja que és un espai amb menys activitat, i després de mesurar l'impacte considerarem expandir-ho també a l'escriptori. <span id="Adjusting_the_limits"></span> == Ajustant els límits == <span lang="en" dir="ltr" class="mw-content-ltr">The limits described above provide a set of general mechanisms, but they may need adjustment depending on the particular needs of each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on initial evaluation, the amount of modification needed to initial machine translation can range from 10% to 70%, depending on the language pair.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On some wikis, the default limits may be too strict, generating unnecessary noise or preventing perfectly valid translations from being published.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On other wikis, the limits may not be strict enough, allowing the publication of translations that have not been edited enough.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the different thresholds allows each wiki to tailor the tool's limits according to its particular needs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Feedback from native speakers is essential in properly adjusting the limits imposed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the current limits don't seem to work well based on your experience in creating or reviewing translations, please [[Talk:Content translation|share your feedback]], and we can explore how to better adjust them.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When providing feedback about adjusting the thresholds, we recommend that you first create several example translations (make sure to [[Special:MyLanguage/Help:Content translation/Publishing|check the publishing options]] if your test is not intended to be published as regular content).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When testing how the limits work for your language, it is useful to keep in mind the following:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check for both cases.''' Make sure to check how the limits work for both: translations where the content has not been edited enough, versus where it has been edited enough. </div> <span lang="en" dir="ltr" class="mw-content-ltr">In this way, you can more easily find the right balance for the tool's limits feature.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Checking only one type of problem can lead to moving the thresholds too far in the opposite direction.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check different content.''' Content in our wikis is highly diverse, and machine translation may work much better for some cases compared to others. </div> <span lang="en" dir="ltr" class="mw-content-ltr">For example, content that is full of numeric data or technical names may require less editing by users than content with more descriptive text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Make sure to test by translating of a variety of different article types, of varying lengths, with disparate content.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Prepare to iterate.''' Adjusting the thresholds is an iterative process. </div> <span lang="en" dir="ltr" class="mw-content-ltr">It may require custom adjustments to the thresholds or that you improve your general approach.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In any case, after each change, further testing may be needed to verify the improvements made.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the limits in collaboration with editors has proven to be effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, initial results show that the Indonesian community was able to significantly reduce the number of problematic translations they were receiving by restricting the publication of translations with more than 70% of unmodified machine translation content.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Similar adjustments have been made for Telugu and Assamese language wikis.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There is no automatic tool that is infallible, and these limits are not an exception.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The process of content review by the community is still essential, but these limits provide communities with a tool to reduce the number of translations they have to focus on, making the review process much more effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please [[Talk:Content translation|share your feedback]] and we can explore how to better adjust them.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Tracking potentially unreviewed translations == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A [[Special:TrackingCategories|tracking category]] with the name "cx-unreviewed-translation-category" is provided for communities to easily find articles that have been published with some content exceeding the recommended limits. </div> <span lang="en" dir="ltr" class="mw-content-ltr">You can find this category in the list of tracking categories on each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Using it, you can track articles that passed the limits preventing publication, but that still had some paragraphs that were edited less than expected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example [[:id:Kategori:Halaman_dengan_terjemahan_tak_tertinjau|the Indonesian Wikipedia's category]] includes articles that have less than 40% of machine translation overall, but which have some paragraphs with more than 80% of unmodified machine translation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Measuring translation quality == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Evaluating content quality automatically is not trivial.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Deletion ratios provide a useful measure for estimating whether the content created was good enough for the community involved not to delete it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the analysis of deletion ratios, articles that are created as translations are [[Special:MyLanguage/Content translation/Deletion statistics comparison|less likely to be deleted]] when compared with articles created from scratch.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This suggests that it may not be practical to set the limits for participation through translating much higher than those set for other ways of article creation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Find published translations === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Content translation adds a ''contenttranslation'' edit tag to the published translations. This allows communities the ability to use Recent changes, and similar tools, to focus on pages created using the translation tool.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In addition, [[Special:MyLanguage/Content translation/Published translations|data on published translations]] and [https://language-reportcard.wmflabs.org/cx2/#mt-engines the statistics for machine translation use] are available for anyone to analyze.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Inspect a specific translation === </div> [[File:Translation debugger example.webm|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Translation debugger example</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">The [https://cxdebugger.toolforge.org/ Translation debugger] is a tool that allows the inspection of some metadata for a given translation, including the percentage of machine translation used for the whole document, and the translation service used for each paragraph.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For specific types of content such as templates, the Content Translation Server API [https://cxdebugger.toolforge.org/templates.html can be queried to check how templates will be transferred across languages].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Other limits based on user expertise == </div> [[File:Cx-limits-user-expertise.png|alt=|thumb|400x400px|<span lang="en" dir="ltr" class="mw-content-ltr">Error showing a publishing restriction based on the user expertise.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This example is based on the decision of the English Wikipedia community to limit publishing directly to the mainspace to extended autoconfirmed users only.</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">Some wikis have implemented other restrictions for translating based on the user rights as a way to reduce the creation of low-quality translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, [[w:Wikipedia:Content translation tool|English Wikipedia requires users to be extended confirmed]], which means they need to make 500 edits on English Wikipedia before they are allowed to publish a translation as an article.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Newer editors can still publish translated articles in the <code>{{ns:2}}:</code> or <code>Draft:</code> namespaces, and then [[Special:MyLanguage/Help:Moving a page|move the article]] to the mainspace.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This restriction was created before the system of limits described in this page was available, and it is not the recommended approach to encourage the creation of good quality translations. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Before adding restrictions that do not take into account the content created, consider going through the process of adjusting the limits of unmodified content as described above.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The limits can be made as strict as needed to prevent low-quality translations, while still allowing publication by editors making good translations.</span> [[Category:Extension help{{#translation:}}]] 7xa61rnxiok2p9rbz6ikobnuryc2ssz 8364708 8364704 2026-05-03T19:22:36Z Pallares 373182 Created page with "Els límits descrits anteriorment proporcionen un conjunt de mecanismes generals, però poden necessitar ajustaments en funció de les necessitats particulars de cada wiki." 8364708 wikitext text/x-wiki <languages/> {{PD Help Page}} A l'hora de crear una traducció, és fonamental revisar els continguts abans de publicar-los. Cal assegurar-se que el contingut produït no alteri el significat original de manera no desitjada i comprovar que es llegeix amb naturalitat en l'idioma de destinació. La [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|traducció automàtica inicial]] proporcionada ajuda a accelerar el procés de traducció amb un punt de partida útil, però l'eina anima els usuaris a revisar i editar significativament el contingut inicial. Es dediquen diversos mecanismes per garantir que els traductors editin les traduccions inicials adequadament. L'editor de traduccions fa un seguiment de quina quantitat de la traducció inicial ha estat modificada per l'usuari i defineix diferents límits que o bé: impedeixen la publicació o adverteixen els usuaris perquè els animin a revisar més els continguts. D'aquesta manera, l'eina permet als usuaris fer un bon ús d'una traducció automàtica inicial, alhora que evita la creació de resultats poc revisats i de baixa qualitat. A continuació es presenten més detalls sobre com funcionen aquests límits, com es poden ajustar a les necessitats de cada idioma i com mesurar la qualitat del contingut produït amb l'eina. <span id="Limits_to_encourage_reviewing_the_translation"></span> == Límits per fomentar la revisió de la traducció == L'eina de '''traducció de contingut''' [https://github.com/wikimedia/mediawiki-extensions-ContentTranslation/blob/master/doc/MTAbuseCalculation.md mesura el percentatge de modificacions] que els usuaris fan a [[Special:MyLanguage/Help:Content translation/Translating/Initial machine translation|la traducció automàtica inicial proporcionada]]. D'aquesta manera, el sistema sap quantes paraules s'han afegit, eliminat o modificat de la traducció inicial. Les mesures es fan a dos nivells diferents: per a cada paràgraf i per a tota la traducció. S'apliquen límits diferents a cada nivell, tal com es detalla a continuació. <span id="Limits_for_the_whole_translation"></span> === Límits per a tota la traducció === [[File:Cx-limits-publish.png|alt=|thumb|400x400px|Es mostra un error en intentar publicar una traducció amb massa traducció automàtica sense modificar. Aquest llindar es va ajustar per a l'indonesi a partir dels comentaris dels seus editors.]] La publicació és bloquejada si l'95% o més de tot el document consisteix en contingut sense modificar i traduït automàticament. Aquest límit impedeix traduccions automàtiques gairebé en brut i evita actes de vandalisme evidents. També impedeix que els usuaris simplement afegeixin contingut sense editar la part de traducció automàtica. Com es detalla a continuació, aquest límit es pot ajustar per a cada idioma. <span id="Limits_for_each_paragraph"></span> === Límits per a cada paràgraf === [[File:Cx-limits-paragraph.png|alt=|thumb|400x400px|Avís mostrat per a un paràgraf específic on la traducció automàtica sense modificar supera els límits]] També es mesura el percentatge de modificacions de l'usuari per a cada paràgraf. Un paràgraf es considera problemàtic quan conté més del 85% de la traducció automàtica inicial (o, en copiar el contingut del document font, conté més del 60% de contingut sense modificar). L'editor de traducció mostrarà un avís per cada paràgraf que es consideri problemàtic, animant l'usuari a fer més edicions. En alguns casos, els usuaris encara poden publicar, però la pàgina resultant es pot afegir a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. En altres casos, és possible que els usuaris no tinguin permís per publicar en absolut. Els següents són alguns dels factors que es tenen en compte per determinar si es permet o no que els usuaris publiquin (alguns dels quals encara estan en desenvolupament): * '''El nombre de paràgrafs problemàtics.''' Els usuaris no poden publicar traduccions amb 50 o més paràgrafs problemàtics. Es permet la publicació de traduccions amb menys de 50 paràgrafs problemàtics, però les que tinguin entre 10 i 49 paràgrafs problemàtics s'afegiran a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Traduccions suprimides anteriorment.''' Per evitar problemes recurrents, l'eina identifica els usuaris les traduccions publicades dels quals s'han suprimit en els darrers 30 dies i imposa límits molt més estrictes als seus esforços de traducció posteriors. Per als usuaris d'aquesta classe, s'impedeix la publicació de les traduccions amb 10 paràgrafs problemàtics o més, mentre que les que tenen 9 paràgrafs problemàtics o menys s'afegeixen a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. * '''Confirmació de l'usuari.''' Es considera un llindar menys estricte per als paràgrafs que un usuari marca com a resolts, que es considera un senyal que l'usuari ha revisat i confirmat l'estat de la traducció. Per als paràgrafs on es mostra l'avís de contingut sense modificar, però l'usuari el marca com a resolt, s'aplica un llindar menys estricte (acceptant el 95% de la traducció automàtica o el 75% del contingut original). Això proporcionarà una manera d'adaptar-se als casos en què la traducció automàtica ha estat excepcionalment bona, però alhora evitar un possible abús de la funció (és a dir, no seguir cegament la confirmació d'un usuari). <span id="Contents_not_affected_by_the_limits"></span> === Contingut no afectat pels límits === No s'espera que part del contingut s'editi significativament i, per tant, no es té en compte a l'hora d'aplicar els límits descrits anteriorment. Els títols de secció, les cites o la llista de referències molt curts s'exclouen de la revisió. Altrament, els usuaris podrien rebre avisos enganyosos sobre la traducció de contingut que no s'hauria de traduir, com ara títols de llibres que apareixen a les referències o altres noms propis. <span id="Limits_on_the_mobile_experience"></span> == Límits de l'experiència mòbil == Per a l'experiència mòbil, el conjunt inicial de límits segueix un enfocament més senzill. De moment, només es considera el percentatge global de traducció automàtica sense modificacions per a tota la traducció. <span lang="en" dir="ltr" class="mw-content-ltr">On mobile, the whole translation consist of just one section of the article.</span> En particular, es mostra un avís quan el percentatge de traducció automàtica sense modificacions és superior al 85% per a tota la secció, i s'impedeix la publicació quan el percentatge de traducció automàtica sense modificacions és superior al 95% <span lang="en" dir="ltr" class="mw-content-ltr">Feedback on how the limits system work on the mobile context would be very useful to determine how to evolve this initial approach.</span> <span id="Publication_of_fast_unreviewed_translations"></span> === Publicació de traduccions ràpides sense revisar === <span lang="en" dir="ltr" class="mw-content-ltr">Campaigns and contests can result in spikes of translations where some user unfamiliar with the community policies may focus on making many translations and not pay enough attention to review their contents.</span> Per tal de prioritzar la qualitat per sobre de la quantitat, s'ha definit un mecanisme per limitar la publicació de traduccions ràpides no revisades. <span lang="en" dir="ltr" class="mw-content-ltr">After a user translates a large article, the next translation can only be started after some time has passed.</span> L'estimació del període d'espera considera 1 minut per paràgraf fins a un màxim de 10 minuts. És a dir: * <span lang="en" dir="ltr" class="mw-content-ltr">For articles with 10 paragraphs or less, we want to make sure that users spent at least N minutes (one minute per paragraph) translating it.</span> * Per als articles amb més de 10 paràgrafs, volem assegurar-nos que els usuaris hagin dedicat almenys 10 minuts a traduir-los. Això s'ha [[phab:T331023|aplicat inicialment al mòbil]], ja que és un espai amb menys activitat, i després de mesurar l'impacte considerarem expandir-ho també a l'escriptori. <span id="Adjusting_the_limits"></span> == Ajustant els límits == Els límits descrits anteriorment proporcionen un conjunt de mecanismes generals, però poden necessitar ajustaments en funció de les necessitats particulars de cada wiki. <span lang="en" dir="ltr" class="mw-content-ltr">Based on initial evaluation, the amount of modification needed to initial machine translation can range from 10% to 70%, depending on the language pair.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On some wikis, the default limits may be too strict, generating unnecessary noise or preventing perfectly valid translations from being published.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On other wikis, the limits may not be strict enough, allowing the publication of translations that have not been edited enough.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the different thresholds allows each wiki to tailor the tool's limits according to its particular needs.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Feedback from native speakers is essential in properly adjusting the limits imposed.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the current limits don't seem to work well based on your experience in creating or reviewing translations, please [[Talk:Content translation|share your feedback]], and we can explore how to better adjust them.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When providing feedback about adjusting the thresholds, we recommend that you first create several example translations (make sure to [[Special:MyLanguage/Help:Content translation/Publishing|check the publishing options]] if your test is not intended to be published as regular content).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When testing how the limits work for your language, it is useful to keep in mind the following:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check for both cases.''' Make sure to check how the limits work for both: translations where the content has not been edited enough, versus where it has been edited enough. </div> <span lang="en" dir="ltr" class="mw-content-ltr">In this way, you can more easily find the right balance for the tool's limits feature.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Checking only one type of problem can lead to moving the thresholds too far in the opposite direction.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Check different content.''' Content in our wikis is highly diverse, and machine translation may work much better for some cases compared to others. </div> <span lang="en" dir="ltr" class="mw-content-ltr">For example, content that is full of numeric data or technical names may require less editing by users than content with more descriptive text.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Make sure to test by translating of a variety of different article types, of varying lengths, with disparate content.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * '''Prepare to iterate.''' Adjusting the thresholds is an iterative process. </div> <span lang="en" dir="ltr" class="mw-content-ltr">It may require custom adjustments to the thresholds or that you improve your general approach.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In any case, after each change, further testing may be needed to verify the improvements made.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Adjusting the limits in collaboration with editors has proven to be effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, initial results show that the Indonesian community was able to significantly reduce the number of problematic translations they were receiving by restricting the publication of translations with more than 70% of unmodified machine translation content.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Similar adjustments have been made for Telugu and Assamese language wikis.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There is no automatic tool that is infallible, and these limits are not an exception.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The process of content review by the community is still essential, but these limits provide communities with a tool to reduce the number of translations they have to focus on, making the review process much more effective.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Please [[Talk:Content translation|share your feedback]] and we can explore how to better adjust them.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Tracking potentially unreviewed translations == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> A [[Special:TrackingCategories|tracking category]] with the name "cx-unreviewed-translation-category" is provided for communities to easily find articles that have been published with some content exceeding the recommended limits. </div> <span lang="en" dir="ltr" class="mw-content-ltr">You can find this category in the list of tracking categories on each wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Using it, you can track articles that passed the limits preventing publication, but that still had some paragraphs that were edited less than expected.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example [[:id:Kategori:Halaman_dengan_terjemahan_tak_tertinjau|the Indonesian Wikipedia's category]] includes articles that have less than 40% of machine translation overall, but which have some paragraphs with more than 80% of unmodified machine translation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Measuring translation quality == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Evaluating content quality automatically is not trivial.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Deletion ratios provide a useful measure for estimating whether the content created was good enough for the community involved not to delete it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Based on the analysis of deletion ratios, articles that are created as translations are [[Special:MyLanguage/Content translation/Deletion statistics comparison|less likely to be deleted]] when compared with articles created from scratch.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This suggests that it may not be practical to set the limits for participation through translating much higher than those set for other ways of article creation.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Find published translations === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Content translation adds a ''contenttranslation'' edit tag to the published translations. This allows communities the ability to use Recent changes, and similar tools, to focus on pages created using the translation tool.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In addition, [[Special:MyLanguage/Content translation/Published translations|data on published translations]] and [https://language-reportcard.wmflabs.org/cx2/#mt-engines the statistics for machine translation use] are available for anyone to analyze.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Inspect a specific translation === </div> [[File:Translation debugger example.webm|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Translation debugger example</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">The [https://cxdebugger.toolforge.org/ Translation debugger] is a tool that allows the inspection of some metadata for a given translation, including the percentage of machine translation used for the whole document, and the translation service used for each paragraph.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For specific types of content such as templates, the Content Translation Server API [https://cxdebugger.toolforge.org/templates.html can be queried to check how templates will be transferred across languages].</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Other limits based on user expertise == </div> [[File:Cx-limits-user-expertise.png|alt=|thumb|400x400px|<span lang="en" dir="ltr" class="mw-content-ltr">Error showing a publishing restriction based on the user expertise.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This example is based on the decision of the English Wikipedia community to limit publishing directly to the mainspace to extended autoconfirmed users only.</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">Some wikis have implemented other restrictions for translating based on the user rights as a way to reduce the creation of low-quality translations.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, [[w:Wikipedia:Content translation tool|English Wikipedia requires users to be extended confirmed]], which means they need to make 500 edits on English Wikipedia before they are allowed to publish a translation as an article.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Newer editors can still publish translated articles in the <code>{{ns:2}}:</code> or <code>Draft:</code> namespaces, and then [[Special:MyLanguage/Help:Moving a page|move the article]] to the mainspace.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> This restriction was created before the system of limits described in this page was available, and it is not the recommended approach to encourage the creation of good quality translations. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Before adding restrictions that do not take into account the content created, consider going through the process of adjusting the limits of unmodified content as described above.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The limits can be made as strict as needed to prevent low-quality translations, while still allowing publication by editors making good translations.</span> [[Category:Extension help{{#translation:}}]] 3uuoojg2sqbkbyaithtveqnksy43ek5 Extension:PageTriage/dtp 102 1873349 8365066 8157887 2026-05-04T07:51:31Z FuzzyBot 451990 Updating to match new version of source page 8365066 wikitext text/x-wiki <languages /> {{Extension |templatemode = |status = stable |type1 = special |type2 = interface |newhook1 = |newhook2 = |username = |author = [[User:Kaldari|Ryan Kaldari]], [[User:Bsitu|Benny Situ]] |description = <span lang="en" dir="ltr" class="mw-content-ltr">Facilitates reviewing and approving new pages</span> |image = Extension-PageTriage Special-NewPagesFeed Screenshot.png |imagesize = 300 |version = |update = |version preview = |update preview = |compatibility policy = rel |mediawiki = |php = |composer = |table1 = pagetriage_page |table2 = pagetriage_page_tags |table3 = pagetriage_tags |download = {{WikimediaDownload|phab=EPTR}} |readme = |changelog = |example = [[wikipedia:Special:NewPagesFeed | Special:NewPagesFeed on the English Wikipedia]] |namespace = |tags = |compatibility = |bugzilla = |phabricator = PageTriage |vagrant-role = }} <span lang="en" dir="ltr" class="mw-content-ltr">'''PageTriage''' is an extension that aims to provide a feature-rich interface for triaging newly-created articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is intended to replace the ''new page patrol'' core function while adding additional functionality for reviewing, tagging, and improving new articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It adds a Special:NewPagesFeed page, and a page curation toolbar to new pages for those with the 'patrol' permission.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It was developed by the Wikimedia Foundation's [[Wikimedia_Features_engineering|Features Engineering team]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">For additional details see ''[[Page Curation|Page Curation]]''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An important note is that some of the configuration and code is specific to the English-language Wikipedia's workflows and as it's constructed now the extension is pretty much impossible to internationalise.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See [[Phabricator:T50552]].)</span> [[File:Page-Curation-Video.ogv|thumb|An overview of the page curation feature. The interface in the video is outdated but the content remains useful.]] <span id="Installation"></span> == Papadakat == [[File:PageTriage-ListView-Whole.png|thumb|Screenshot of Special:NewPagesFeed as it appeared in 2012]] {{ExtensionInstall |db-update=yes |registration=required |localsettings= }} == Checking for successful install == <div lang="en" dir="ltr" class="mw-content-ltr"> To actually see the extension working: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Create a new page containing just a few sentences of text as an anonymous user. </div> * Tombului Special:NewPagesFeed <span lang="en" dir="ltr" class="mw-content-ltr">The new page should appear, flagged as "{{int|pagetriage-no-categories}}", "{{int|pagetriage-orphan}}", etc.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To see the page curation toolbar:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Login as a user with the 'sysop' permission, or add a group with the "[[Special:MyLanguage/Help:Patrolled_edits|patrol]]" permission, and add some user to that group, and login as that user. </div> * Tombului Special:NewPagesFeed <div lang="en" dir="ltr" class="mw-content-ltr"> * Now you should see a "{{int|pagetriage-triage}}" button next to the new page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Click this and you should see the page curation toolbar on the new page. </div> <span id="Advanced_installation"></span> == Padakatan nokoburu == <div lang="en" dir="ltr" class="mw-content-ltr"> === Additional extensions === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For full functionality, you'll also need to install some additional extensions, although PageTriage works without them. </div> * {{ll|Extension:Echo|Echo}} - Allows users to receive notifications for things like when an article they created has been marked as reviewed. * {{ll|Extension:ORES|ORES}} - In Special:NewPagesFeed, allows filtering by "predicted class" (<code>articlequality</code>: stub, start, c-class, b-class, good, featured) and "potential issues" (<code>draftquality</code>: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because <code>draftquality</code> needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's [[git:mediawiki/extensions/ORES/+/8bd39f26548d58fa8bf6765e1c23f5e3086f1cd4/extension.json#225|extension.json file]]. * {{ll|Extension:WikiLove|WikiLove}} - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily. === Enabling draft namespace === By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php <syntaxhighlight lang="php" copy> // These three settings are optional, and will enable the Articles-for-Creation mode. $wgPageTriageDraftNamespaceId = 118; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft'; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk'; </syntaxhighlight> When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed. By default pages edited in the draft namespace will be "unsubmitted". Articles in the draft namespace can be submitted for review by adding <nowiki>[[Category:Pending_AfC_submissions]]</nowiki> to the draft page. At which point they will show up under "awaiting review". Note the toolbar controlled by the configuration variable '''$wgPageTriageEnableCurationToolbar''' does not show up in the draft namespace. === Cron jobs === To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: <code>cron/updatePageTriageQueue.php</code> == Manual testing == === Special:NewPagesFeed -> Articles for Creation === * Enable draftspace by following the directions above in the section [[#Enabling draft namespace]]. * In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories: ** Unsubmitted: (no category) ** Awaiting review: Category:Pending AfC submissions ** Under review: Category:Pending AfC submissions being reviewed now ** Declined: Category:Declined AfC submissions Note: The Page Curation toolbar does not display for drafts. === ORES === Enwiki has the [[Extension:ORES|ORES extension]] installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure: * Clone Extension:ORES and add <code>wfLoadExtension( 'ORES' );</code> in <code>LocalSettings.php</code> * Add this to <code>LocalSettings.php</code> <syntaxhighlight lang="php" copy> $wgPageTriageEnableOresFilters = true; $wgOresWikiId = 'enwiki'; $wgOresModels = [ 'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ], 'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'sources' => [ 1 ] ] ]; </syntaxhighlight> * Run <code>php maintenance/run.php ./extensions/ORES/maintenance/BackfillPageTriageQueue.php</code> == Determining if a page is reviewed == === Status codes === There are status codes used to track whether a page is reviewed or not. These are the values given when you query <code>patrol_status</code>, <code>ptrp_reviewed</code>, and <code>ptrl_reviewed</code>: * Unreviewed ** 0 - unreviewed * Reviewed ** 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar) ** 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page) ** 3 - autopatrolled (someone with the <code>autopatrol</code> user right created the page, or moved the page from a non-tracked namespace to a tracked namespace) ** no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job) === Via the API === To check the review status of pages using an API query, you can use <code>api.php?action=query&prop=isreviewed</code>. Sample JavaScript code:<syntaxhighlight lang="js" copy> /** * @param {number} pageID The page ID number. A positive number with no commas. */ async isReviewed(pageID) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', pageids: pageID, } ); return response.query.pages[0].isreviewed; } /** * @param {string} title One title. Can include namespace. Example: User:Test */ async function isReviewed(title) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', titles: title, } ); return response.query.pages[0].isreviewed; } </syntaxhighlight> === Via SQL === To check the review status of pages using an SQL query, you need to query the <code>{{ll|Extension:PageTriage/pagetriage page table|pagetriage_page}}</code> table and the <code>ptrp_reviewed</code> field. Follow the directions in [[#Status codes]] to interpret the values of this field. <syntaxhighlight lang="sql" copy> /* By page_id */ SELECT ptrp_reviewed FROM pagetriage_page WHERE ptrp_page_id = 71318376 /* By page_title and page_namespace */ SELECT ptrp_reviewed FROM pagetriage_page JOIN page ON page_id = ptrp_page_id WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces AND page_namespace = 0 </syntaxhighlight> == SQL == === SQL tables === {| class="wikitable" |+ !Name !Prefix !Description !Old entry deletion strategy !Service classes (when refactoring, SQL queries should be moved to here) !Data classes |- |[[Extension:PageTriage/pagetriage page table|pagetriage_page]] |ptrp_ |The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query <code>ptrp_reviewed > 0</code> in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. |All articles deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. |QueueManager, QueueLookup |QueueRecord |- |[[Extension:PageTriage/pagetriage page tags table|pagetriage_page_tags]] |ptrpt_ |Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the <code>pagetriage_tags</code> table. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. |All article metadata deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status. | | |- |[[Extension:PageTriage/pagetriage tags table|pagetriage_tags]] |ptrt_ |A dictionary of page_tags, and their corresponding ID number. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. | | | |} === pagetriage_page_tags === <code>pagetriage_page_tags</code> data is updated by calling <code>ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata()</code>. This is called in the following hooks: * <code>onPageMoveComplete()</code> - runs when moving a page * <code>onLinksUpdateComplete()</code> - runs when saving an edit * <code>onMarkPatrolledComplete()</code> - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user. ==== List of tags ==== The <code>pagetriage_page_tags</code> are as follows: * Author information ** user_id ** user_name - there's a filter where you can type in their username ** user_editcount ** user_creation_date ** user_autoconfirmed ** user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with <code>MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()</code> ** user_bot ** user_block_status * Deletion tags - will display a black trash can icon if marked for deletion ** afd_status ** blp_prod_status ** csd_status ** prod_status * Special:NewPagesFeed red warning text ** category_count - No categories ** linkcount - Orphan ** reference - No citations ** recreated - Previously deleted ** user_block_status - Blocked * Page information ** page_len - size of article, in bytes ** rev_count - number of edits to the article ** snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article * afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined * copyvio - latest revision ID that has been tagged as a likely copyright violation, if any == PHP == <div lang="en" dir="ltr" class="mw-content-ltr"> === Extension configuration === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The extension is based on the 'patrol' right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For more information about configuring patrolling, see {{ll|Manual:Patrolling}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following configuration variables can be set from your LocalSettings.php file: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">Variable</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Default</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> |- | {{phpi|$wgPageTriageEnableCurationToolbar}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set to false to disable the [[Special:MyLanguage/Page Curation#User Experience: Curation Toolbar|curation toolbar]]</span> |- | {{phpi|$wgPageTriageInfiniteScrolling}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not to use infinite scrolling in the new pages feed</span> |- | {{phpi|$wgPageTriageMaxAge}} |90 | The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true). |- | {{phpi|$wgPageTriageNamespaces}} |NS_MAIN | The namespaces that PageTriage is active in. |- | {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} | {{phpi|false}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set this to true if new, unreviewed articles should be set to noindex.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In other words, if they should not be indexed by search engines until they are reviewed.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> See [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/extension.json#698|extension.json]] for the full list of config variables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === API === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> PageTriage adds the following API endpoints which can be used: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">API</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Triggering action</span> |- |pagetriageaction | <span lang="en" dir="ltr" class="mw-content-ltr">Mark a page as reviewed or unreviewed, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to mark a page as reviewed * Using the Page Curation toolbar to mark a page as unreviewed |- |pagetriagelist | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves the list of pages in the queue, and each page's metadata, including their reviewed status.</span> To retrieve one page, you must provide the <code>page_id</code>. To provide multiple pages, you must select one of <code>showreviewed</code>/<code>showunreviewed</code>, and one of <code>showredirs</code>/<code>showdeleted</code>/<code>showothers</code>, or no pages will be returned. |Read | * Loading the Page Curation toolbar (automatically loaded if you have the <code>patrol</code> userright and view a page that is unpatrolled or recently patrolled) * Viewing Special:NewPagesFeed (provides the list of articles) |- |pagetriagestats | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves stats about the number of pages in the queue for use in the header of Special:NewPagesFeed.</span> |Read | * Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer) |- |pagetriagetagcopyvio |Mark an article as a potential copyright violation, and logs the action in Special:Log. |Write | * Marking as a copyright violation by a bot with the <code>copyviobot</code> userright |- |pagetriagetagging | <span lang="en" dir="ltr" class="mw-content-ltr">Add clean-up tags or deletion templates to a page, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to place a maintenance tag on an article * Using the Page Curation toolbar to place a deletion tag on an article |} === Special:Log === The following logs are created by the extension: {| class="wikitable" |+ !Special:Log !<code>log_type</code> !<code>log_action</code> !Description !Notes |- |Page curation log |pagetriage-curation |delete, enqueue, reviewed, tag, unreviewed |Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed | |- |Potential copyright violation log |pagetriage-copyvio |insert |Allows a bot to log potential copyright violations |Doesn't display unless you set {{phpi|$wgPageTriageEnableCopyvio}} to true |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Entry points === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The extension's features can be triggered by various actions: </div> {| class="wikitable" |+ !Entry point type !File location !Notes |- |5 APIs |includes/Api/* | |- |1 special page |includes/SpecialNewPagesFeed.php | |- |20 hooks | * includes/Hooks.php * includes/HookHandlers/UndeleteHookHandler.php * includes/HookHandlers/Schema.php | |- |1 cron job |cron/updatePageTriageQueue.php |runs every 48 hours |- |7 maintenance scripts |maintenance/* |need to be run manually |} Here is a list of some actions and the corresponding entry points they trigger: {| class="wikitable" |+ !Action !Entry points used |- |View Main page | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() |- |Save an edit to the Main page | * Hooks.php -> onRevisionFromEditComplete() * Hooks.php -> onPageSaveComplete() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onLinksUpdateComplete() |- |Type in search box, triggering search suggestions | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onApiMain__moduleManager() |- |View Special:NewPagesFeed | * Hooks.php -> onBeforeCreateEchoEvent() * SpecialNewPagesFeed * ApiPageTriageStats * ApiPageTriageList |- |View an unreviewed article while logged in and having the <code>patrol</code> permission. | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onResourceLoaderGetConfigVars() * Hooks.php -> onDefinedTags() * Hooks.php -> onApiMain__moduleManager() * ApiPageTriageList (by <code>page_id</code>) |} ==== Hooks ==== {| class="wikitable" |+ !File !Group !Hook !Actions it performs |- | rowspan="18" |Hooks.php |Move page |[[Manual:Hooks/PageMoveComplete|onPageMoveComplete]] |Changes patrolled status, updates cache, updates metadata in <code>pagetriage_page_tags</code> table. |- | rowspan="3" |Edit page |[[Manual:Hooks/RevisionFromEditComplete|onRevisionFromEditComplete]] |Handles marking '''redirects that flip to articles''' as unreviewed. [[Deferred updates|DeferredUpdate]]. |- |[[Manual:Hooks/PageSaveComplete|onPageSaveComplete]] |Add '''new articles''' to the New Pages Feed and <code>pagetriage_page</code> table. |- |[[Manual:Hooks/LinksUpdateComplete|onLinksUpdateComplete]] |[[Deferred updates|DeferredUpdate]] of metadata / <code>pagetriage_page_tags</code> table. |- |Every page load |[[Manual:Hooks/ArticleViewFooter|onArticleViewFooter]] | * Turn on '''noindex''' for new, unreviewed articles. * Determine whether to load a '''link for autopatrolled users to unpatrol''' their article * Displays the '''Page Curation toolbar''' on recently created pages. * Create '''"Add to New Pages Feed" toolbox link''' for old articles. |- |[[Help:Patrolled edits]] |[[Manual:Hooks/MarkPatrolledComplete|onMarkPatrolledComplete]] |Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage. |- | rowspan="2" |Blocking and unblocking |[[Manual:Hooks/BlockIpComplete|onBlockIpComplete]] | rowspan="2" |Update article metadata / <code>pagetriage_page_tags</code> when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users. |- |[[Manual:Hooks/UnblockUserComplete|onUnblockUserComplete]] |- | |[[Manual:Hooks/ResourceLoaderGetConfigVars|onResourceLoaderGetConfigVars]] |Adjusts some config vars related to draft namespace ID. |- | rowspan="3" |[[Extension:Echo]] |[[Manual:Hooks/BeforeCreateEchoEvent|onBeforeCreateEchoEvent]] | rowspan="3" |Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed. |- |[[Manual:Hooks/EchoGetDefaultNotifiedUsers|onEchoGetDefaultNotifiedUsers]] |- |[[Manual:Hooks/LocalUserCreated|onLocalUserCreated]] |- |[[Extension:ORES]] |[[Manual:Hooks/ORESCheckModels|onORESCheckModels]] |Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio. |- | rowspan="3" |[[Help:Tags]] |[[Manual:Hooks/ListDefinedTags|onListDefinedTags]] | rowspan="3" |Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage". |- |[[Manual:Hooks/ChangeTagsAllowedAdd|onChangeTagsAllowedAdd]] |- |[[Manual:Hooks/ChangeTagsListActive|onChangeTagsListActive]] |- |API |[[Manual:Hooks/ApiMain::moduleManager|onApiMain__moduleManager]] |Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings. |- | rowspan="2" |Delete or undelete page |[[Manual:Hooks/PageDeleteComplete|onPageDeleteComplete]] |If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache. |- |HookHandlers/ UndeleteHookHandler.php |[[Manual:Hooks/ArticleUndelete|onArticleUndelete]] |If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed. |- |HookHandlers/ Schema.php |SQL |[[Manual:Hooks/LoadExtensionSchemaUpdates|onLoadExtensionSchemaUpdates]] | * The code that installs PageTriage's 4 SQL tables when you run <code>php maintenance/run.php update</code>. * Will also alter schemas from previous versions to match the latest schema. * This is also where all the '''pagetriage_tags''' are hard-coded. |} ==== Cron jobs and maintenance scripts ==== {| class="wikitable" |+ !File !What it does !Why run it? When is it useful? ![[phab:T341431|Safe to delete maintenance script?]] |- |cron/updatePageTriageQueue.php |Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". |Keeps the SQL tables from getting too big. | |- |maintenance/cleanupPageTriage.php |Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. |Fix a bug? [[phab:T321982|T321982]] | |- |maintenance/cleanupPageTriageLog.php |Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log |One time conversion of old log entries to modern format? Logs are now always written in the new format. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/6d9105c020c62d648a4ef6be957297bbc8a6d7d2]. |Probably |- |maintenance/cleanupPageTriagePageTags.php |Remove page from <code>pagetriage_page_tags</code> if they are not in <code>pagetriage_page</code> |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/00a752368e00e0d8b29a4908bfc3bab3096268dd]. |Probably |- |maintenance/DeleteAfcStates.php |Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ab2d8d4a2f9d0f4ff981afaee35a85f33edb5e99]. [[phab:T203184#4592953|T203184#4592953]]. |Probably |- |maintenance/FixNominatedForDeletion.php |Set <code>pagetriage_page.ptrp_deleted</code> if the page is has any <code>pagetriage_page_tags</code> related to deletion (e.g. prod_status, blp_prod_status, etc.) |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ff0c433226300aeba692089b5389435d47feef1e]. [[phab:T202582|T202582]]. |Probably |- |maintenance/populateDraftQueue.php |Add missing Draft namespace pages to the AfC triage queue. |Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/59e1fedffcdafc46722d7231011aee194db9ee08]. | |- |maintenance/updateUserMetadata.php |Former cron job. Update expired user metadata in the <code>pagetriage_page_tags</code> table |[https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/92a675a5f1f2e07cee532ec90fc57eee7f2cd49b]. [[phab:T341432|T341432]]. | |} === NOINDEX === NOINDEX refers to the HTML code <code>&lt;meta name="robots" content="noindex"></code>, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode <code><nowiki>__NOINDEX__</nowiki></code>. When {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in <code>includes/Hooks.php</code>, in the <code>onArticleViewFooter()</code> method. ==== First check ==== * First check: Noindex the page if ALL of the following are true: ** {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is turned on ** Page age is less than {{phpi|$wgPageTriageMaxAge}} (set to 90 days on enwiki) ** Page is in <code>pagetriage_page</code> table<ref>Checked by <code>isPageUnreviewed()</code></ref> ** Page is marked as unpatrolled (ptrp_status = 0) ==== Second check ==== * Second check: If the wikitext has the <code><nowiki>__NOINDEX__</nowiki></code> magic word, noindex the page if ALL of the following are true: ** Page age is less than {{phpi|$wgPageTriageMaxNoIndexAge}} (set to 90 days on enwiki) ** If {{phpi|$wgPageTriageMaxNoIndexAge}} is not null, page is in <code>pagetriage_page</code> table<ref>Checked by <code>isNewEnoughToNoIndex()</code>, if it doesn't exit early due to <code>$wgPageTriageMaxNoIndexAge</code> being <code>null</code>.</ref> The main use case for the <nowiki>__NOINDEX__</nowiki> magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See [https://en.wikipedia.org/w/index.php?search=NOINDEX&title=Special:Search&profile=advanced&fulltext=1&ns10=1 this search]. ==== Is the page in the <code>pagetriage_page</code> table? ==== In regards to the requirement "Page is in <code>pagetriage_page</code> table", there are several ways a for a page to get into this table: * Not been deleted by a PageTriage cron job ** One cron job deletes redirects older than {{phpi|$wgPageTriageRedirectAutoreviewAge}} days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them. ** Another cron job deletes reviewed pages after 30 days of being reviewed * In a namespace that PageTriage is configured to patrol * Isn't an article that is so old it predates the installation of PageTriage == JavaScript == === Directory structure === * /modules/ ** ext.pageTriage.article - related to marking an article as reviewed ** ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar ** ext.pageTriage.init - creates a mw.pageTriage object ** ext.pageTriage.newPagesFeed - Special:NewPagesFeed ** ext.pageTriage.sidebarLink - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates ** ext.pageTriage.toolbar - Page Curation toolbar <!--** ext.pageTriage.toolbar - Page Curation toolbar (Vue version)--> ** ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code ** ext.pageTriage.util - Backbone.js models (article, revision, stats) ** external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore <div lang="en" dir="ltr" class="mw-content-ltr"> === Toolbar === </div> The toolbar has three states: <code>maximized</code>, <code>minimized</code>, and <code>hidden</code>. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu. === External libraries === * front end ** old (moving away from) *** [[w:Backbone.js|Backbone.js]] *** [[w:jQuery|jQuery]] *** jQuery Badge *** jQuery Waypoints *** [[w:jQuery UI|jQuery UI]] *** [[w:Mustache (template system)|Mustache (template system)]] *** [[OOUI]] - used in modules/ext.PageTriage.enqueue ([https://codesearch.wmcloud.org/deployed/?q=oojs&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FPageTriage codesearch]) *** [[w:Underscore.js|Underscore.js]] ** new (moving towards) *** Codex *** [[w:Moment.js|Moment.js]] *** Vue Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, [[phab:T208256|we are interested in replacing these front end libraries]], to make the extension easier to maintain. <div lang="en" dir="ltr" class="mw-content-ltr"> === Client-side hooks === </div> ==== mw.hook ==== * <code>ext.pageTriage.toolbar.ready</code> ==== mw.pageTriage.actionQueue ==== <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage provides a specialised action queue system to allow other scripts and gadgets to integrate with it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is similar to <code>mw.hook</code> except that it uses promises.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done using the <code>mw.pageTriage.actionQueue</code> module.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the comments in the {{tmpl|0={{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=$1}}|source code}} for documentation on how the system works.</span> {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">It is [$1 not currently used by any scripts or gadgets on enwiki], but it is used internally by PageTriage.</span> |1=https://en.wikipedia.org/w/index.php?search=%22actionQueue%22&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1&ns2300=1&ns2301=1&ns2302=1&ns2303=1 }} <span lang="en" dir="ltr" class="mw-content-ltr">The actionQueue module is available after the mw.hook <code>ext.pageTriage.toolbar.ready</code> fires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage will give the action queue handler an Object with the following data, in addition to other data as noted below:</span> * <code>pageid</code> — <span lang="en" dir="ltr" class="mw-content-ltr">ID of the page being reviewed.</span> * <code>title</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Title of the page, including namespace.</span> * <code>reviewer</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of who is using PageTriage.</span> * <code>creator</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of the creator of the page.</span> * <code>reviewed</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the page is currently or will be marked as reviewed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ===== Available actions ===== </div> * <code>delete</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the reviewer tags a page for deletion. The data given to the handler also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An object of all the templates added to the page. The keys are the template title, and the values are an object of metadata, including things like the speedy deletion code.</span> * <code>mark</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the review status of a page is changed. Also includes:</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> * <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when maintenance tags are added to the page. Also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An array of the titles of all templates that were added to the page.</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ===== Example ===== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To use the action queue, register a function to be ran when an aforementioned action is fired. PageTriage will wait for any asynchronous code to complete before doing anything else, such as refreshing the page. For example, to edit [[Sandbox]] after a page has been marked as reviewed, you could use: </div> <syntaxhighlight lang="javascript"> $( function () { // You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time. mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) { // Listen for the 'mark' action. queue.add( 'mark', function ( data ) { return new mw.Api().edit( 'Sandbox', function ( revision ) { // Replace 'foo' with the note the reviewer left. return revision.content.replace( 'foo', data.note ); } ); } ); } ); } ); </syntaxhighlight> === Where are preferences stored? === Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is <code>userjs-NewPagesFeedFilterOptions</code>. It is set using <code>mw.Api().saveOption()</code> and read using <code>mw.user.options.get()</code>. This data ends up in the SQL <code>user_properties</code> table. Temporary accounts (IP masking) will not be able to store their preferences. == Installation on WMF wikis == This extension was designed for English Wikipedia. There is interest in changing its code and making it more useful to other wikis ([[phab:T50552]]), however this is challenging from a technical perspective and progress is slow. For now, the following are true: * PageTriage is allowed to be installed on other wikis<ref>https://meta.wikimedia.org/w/index.php?title=Limits_to_configuration_changes&diff=prev&oldid=26121135</ref> (although as of 2024 this hasn't happened yet). * The setting <code>$wgPageTriageEnableExtendedFeatures</code> can be set to <code>false</code> to turn off English Wikipedia-specific features such as maintenance tags and deletion tags in the Page Curation toolbar. * There are concerns that the noindex features (controlled by <code>$wgPageTriageNoIndexUnreviewedNewArticles</code> and <code>$wgPageTriageMaxNoIndexAge</code>) create search engine optimization problems, and these noindex features should not be enabled on new wikis without first discussing it with product manager [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]. * Like most other WMF-deployed extensions, PageTriage supports internationalization, and has its interface [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/i18n/|translated into many other languages]]. <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * [[commons:Category:PageTriage extension]] * [[Help:New pages feed]] * [[w:Wikipedia:Page Curation/Help]] == Notes == <references /> {{OnWikimedia}} {{Used by}} [[Category:API extensions{{#translation:}}]] jj9sxql5wg0aqkf9mn5nfecx7vquj8t Translations:Help:VisualEditor/User guide/Citation templates/42/ja 1198 1882756 8364972 6254605 2026-05-04T05:44:18Z TzrZzz 18352707 8364972 wikitext text/x-wiki === $1 引用テンプレートで脚注を追加する === rc34nigwc31s4ci4zbtpoabdm6l3f8f Translations:Help:VisualEditor/User guide/Citation templates/61/ja 1198 1882757 8364970 6254613 2026-05-04T05:43:13Z TzrZzz 18352707 8364970 wikitext text/x-wiki それまでにない欄を追加するには、ショートカットの $2 を入力、小型エディター下部の「$1」を押します。 34a789a05pj0hs2rxxsy06fmp4gohq2 Translations:Help:VisualEditor/User guide/Citation templates/66/ja 1198 1882766 8364960 6254635 2026-05-04T05:37:12Z TzrZzz 18352707 8364960 wikitext text/x-wiki (ご利用のローカルウィキでこのメニューに引用テンプレートを追加する手順は、 $1 をご参照ください。) fhpa5n60sl0qhzcg9ggxsr2svh4yjp3 User:Ollie Hyde (WMDE)/Integration with JetBrains IDEs 2 1887513 8365092 8364232 2026-05-04T09:42:31Z Revibot 1724693 Bot: Fixing double redirect from [[User:Ollie Shotton (WMDE)/Drafts/Integration with JetBrains IDEs]] to [[User:Ollie Hyde (WMDE)/Drafts/Integration with JetBrains IDEs]] 8365092 wikitext text/x-wiki #REDIRECT [[User:Ollie Hyde (WMDE)/Drafts/Integration with JetBrains IDEs]] pyq5kp0ykbktt28scmokezgrfstjhkb Manual:Managing data in MediaWiki/dtp 100 1907425 8364298 8363583 2026-05-03T12:44:41Z FuzzyBot 451990 Updating to match new version of source page 8364298 wikitext text/x-wiki <languages/> <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki was designed to manage mostly free-form text and images.</span> <span lang="en" dir="ltr" class="mw-content-ltr">A limited amount of structure is available: {{ll|Help:Namespaces|namespaces}}, {{ll|Help:Subpages|subpages}} and {{ll|Help:Categories|categories}} help to group similar pages together, while features like {{ll|Infobox|infoboxes}} and {{ll|Gallery|galleries}} help to structure the contents within each page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, MediaWiki by itself does not truly provide ways to manage structured data: data that can be queried, filtered, and in some cases displayed with visualizations including tables, charts, maps<ref>see also [[Wikimedia Maps]]</ref> and calendars.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For that, a number of dedicated [[Special:MyLanguage/Manual:Extensions|extensions]] exist.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following table describes the extensions that can store the data edited by users in a MediaWiki database, from where it can then be queried. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is not a list of all structured data functionality; the "[[#See also|See also]]" section lists other extensions and features that can be used for storing or displaying structured data. </div> {| class="wikitable" |- ! <span lang="en" dir="ltr" class="mw-content-ltr">Feature</span> ! [[File:20210702_Semantic_MediaWiki_logo_with_wordmark.png|100px]]<br/>[https://www.semantic-mediawiki.org/ Semantic MediaWiki] ! [[File:Wikibase_Suite_Vertical_2x_RGB.png|100px]]<br/>[https://wikiba.se/ Wikibase] ! [[File:Cargo logo.png|50px]]<br/>{{ll|Extension:Cargo|nsp=0}} ! {{ll|Extension:VisualData|VisualData}} !{{ll|Extension:Bucket|Bucket}} ! {{ll|Extension:NeoWiki|NeoWiki}} |- | <span lang="en" dir="ltr" class="mw-content-ltr">Main usecase</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation, based on [[w:Semantic Web|Semantic Web]] standards.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Powering [[w:Wikidata|Wikidata]] and other editable graph databases.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation.</span> | Manarampas data suang do MediaWiki padakatan tumanud do json-schema. |lightweight Lua interface for storing and accessing structured data on wiki pages |Knowledge management system that combines collaborative editing and a [[:en:knowledge_graph|knowledge graph]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Approach</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data (properties) are annotated within regular wikitext or by templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">With the datatype "reference", properties can be used to describe items using statements.</span><ref>https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties are defined and used to describe Items using statements.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data is stored in database tables, with each table corresponding to a template.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data are stored in a dedicated slot with JSON content model</span> |Data is stored in '''buckets''', which are database tables with specific columns that you can define |Schemas can be defined and applied to wiki pages, stored in a dedicated slot as JSON data. |- | <span lang="en" dir="ltr" class="mw-content-ltr">Available since</span> | 2005 | 2012 | 2015 | 2022 (Diguulu otututnan sabaagi {{ll|Extension:PageProperties|PageProperties}}) |2025 |2026 |- | <span lang="en" dir="ltr" class="mw-content-ltr">Active installations</span> | <span lang="en" dir="ltr" class="mw-content-ltr">1000s</span><ref>https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">100s</span><ref>https://wikiapiary.com/wiki/Extension:WikibaseRepository</ref><ref>https://wikibase.world</ref><ref>https://addshore.com/2024/10/visualizing-wikibase-connections-using-wikibase-world/</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">100s</span><ref>https://wikiapiary.com/wiki/Extension:Cargo</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">n/a (new extension or unknown)</span> | | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Community</span> | <span lang="en" dir="ltr" class="mw-content-ltr">190+ developers</span><ref>https://www.openhub.net/p/smw</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">172+ developers</span><ref>https://github.com/wikimedia/mediawiki-extensions-Wikibase</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">63+ developers</span><ref>https://github.com/wikimedia/mediawiki-extensions-Cargo</ref> | ([[User:Thomas-topway-it|Momomoburu tagayo]]) |[https://weirdgloop.org/discord Weird Gloop's Discord] |[https://echolot-eccch.eu/ ECHOLOT project], [https://professional.wiki/ Professinal Wiki], [https://knowledge.wiki KM-A], [https://bluespice.com/bluespice-galaxy/ BlueSpice Galaxy] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Storage</span> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database, Elasticsearch, 5 different SPARQL stores</span><ref>https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database, Elasticsearch, SPARQL store (Blazegraph for wikidata.org)</span> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database (or a separate database)</span><ref>{{ll|Extension:Cargo/Download and installation#Setting the Cargo database}}</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database</span> |MediaWiki database (MySQL/MariaDB) |different SPARQL stores, currently Neo4J |- | <span lang="en" dir="ltr" class="mw-content-ltr">Property definition</span> | <span lang="en" dir="ltr" class="mw-content-ltr">By typing wikitext.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Properties can be invented freely.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will be of datatype page by default and can be defined later.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Datatypes can be changed any time.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties have to be defined before usage and can not be changed easily.</span><ref>[[d:Help:Data type#Changing datatype]]</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties are defined through one or more json-schema defined through a {{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}}</span> |Tables in the Bucket: namespace |Form based schema editing |- | <span lang="en" dir="ltr" class="mw-content-ltr">Value declaration</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Inline (<code><nowiki>[[MyProperty::MyValue]]</nowiki></code>) or with templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Form-based data entry with {{ll|Extension:Page_Forms|Page Forms}}.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Wikibase default form-like input interface.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">With parser functions in templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Form-based data entry with {{ll|Extension:Page_Forms|Page Forms}}.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Inline or popup OOUI {{ll|Extension:VisualData/Forms|forms}} automatically generated from JSON-schemas</span> |via Lua call of the <code>bucket.put</code> function |OOUI based form editing |- | <span lang="en" dir="ltr" class="mw-content-ltr">Predefined data types</span> | 18<ref>https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes</ref> | 17<ref>[[d:Special:ListDatatypes]]</ref><ref><span lang="en" dir="ltr" class="mw-content-ltr">Some datatypes are defined by other extension: [[Special:MyLanguage/Extension:Math|Math]] and [[Special:MyLanguage/Extension:Score|Score]] both define one datatype, [[Special:MyLanguage/Extension:JsonConfig|JsonConfig]] defines two, [[Special:MyLanguage/Extension:WikibaseLexeme|WikibaseLexeme]] defines three, and Wikibase defines ten.</span></ref> | 18 | <span lang="en" dir="ltr" class="mw-content-ltr">4 (basic JSON-schema types) + 15 string formats</span> | 5 <ref>https://meta.weirdgloop.org/w/Extension:Bucket#Basic_usage</ref> | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Property management</span> | <span lang="en" dir="ltr" class="mw-content-ltr">type definitions, constraint schemas, ontology import</span> | <span lang="en" dir="ltr" class="mw-content-ltr">custom, or import of Wikidata ontology</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">through a graphical interface (dedicated {{ll|Extension:VisualData/Schema Builder|SchemaBuilder}})</span> | |through a graphical interface |- | <span lang="en" dir="ltr" class="mw-content-ltr">Page names and internal linking</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Page names are stored with their Q-numbers (displaying labels in available languages). Internal linking must be done to the Q-number; you cannot link to a label.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Schemas are stored in a dedicated namespace and JSON-data in a dedicated slot associated to wiki articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">JSON-data can be accessed through an extension of the wiki interface</span> | |MediaWiki pages can have schemas |- | <span lang="en" dir="ltr" class="mw-content-ltr">Inline queries</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | <span lang="en" dir="ltr" class="mw-content-ltr">no (external SPARQL queries);</span> [[phab:T67626|<span lang="en" dir="ltr" class="mw-content-ltr">planned</span>]]<br/><span lang="en" dir="ltr" class="mw-content-ltr">supported via third-party extension {{ll|Extension:LinkedWiki|LinkedWiki}}</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | Hooh, miampai guno parser | |yes, with parser functions via the SQL store |- | <span lang="en" dir="ltr" class="mw-content-ltr">External querying</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with either an API or SPARQL querying (available through special extensions such as [[Special:MyLanguage/Extension:RDFIO|RDFIO]] and [[Special:MyLanguage/Extension:LinkedWiki|LinkedWiki]])</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with SPARQL Query service</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with an API</span> | Hooh, miampai API<ref>{{ll|Extension:VisualData/API}}</ref> | API is not yet stable <ref>https://meta.weirdgloop.org/w/Extension:Bucket</ref> |yes, with an API or SPARQL endpoint |- | <span lang="en" dir="ltr" class="mw-content-ltr">Result formats<ref>"Result formats" mean the ability of the wiki to display data (results of an inline query) in various formats, e.g. tables, calendars, maps, timelines, etc.</ref></span> | ~ 75<ref>https://www.semantic-mediawiki.org/wiki/Help:Result_formats</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">no native result display; data may be visualized via:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Query Service or other external tools </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * on wiki data access via LUA (no query support) </div> * {{ll|Extension:LinkedWiki}} - <span lang="en" dir="ltr" class="mw-content-ltr">third-party</span> | <span lang="en" dir="ltr" class="mw-content-ltr">~ 25</span><ref>{{ll|Extension:Cargo/Display formats}}</ref> | 12+ (Json, Table, Datatable, Template, Calendar, Carousel, Map, pageid, pagetitle, count, raw, Lua ) <ref>{{ll|Extension:VisualData/Result_formats}}</ref> | | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Development</span> | [[github:SemanticMediaWiki/SemanticMediaWiki|GitHub]] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Cargo Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/VisualData Gerrit] |[[github:weirdgloop/mediawiki-extensions-Bucket|GitHub]] |[[github:ProfessionalWiki/NeoWiki|GItHub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Complementary extensions</span> | ~ 40<ref>{{ll|Category:Semantic MediaWiki extensions}}</ref>, e.g. {{ll|Extension:Semantic Result Formats|Semantic Result Formats}}, {{ll|Extension:Semantic Bundle|Semantic Bundle}}, {{ll|Extension:Semantic Scribunto|Semantic Scribunto}} | ~12<ref>{{ll|Category:Wikibase extensions}}</ref>, e.g. {{ll|Extension:Wikibase Repository|Wikibase Repository}}, {{ll|Extension:Wikibase Client|Wikibase Client}}, {{ll|Extension:WikibaseLexeme|WikibaseLexeme}}, [https://wikiba.se/applications/#query-service Query Service] | <span lang="en" dir="ltr" class="mw-content-ltr">2 ([[Special:MyLanguage/Extension:Page Forms|Page Forms]], [[Special:MyLanguage/Extension:Page Schemas|Page Schemas]]). Cargo provides some or all of the functionality of Semantic MediaWiki, Semantic Result Formats, Maps, Semantic Drilldown, Semantic Compound Queries, Semantic Internal Objects and Semantic Scribunto.</span><ref>[[Extension:Cargo/Cargo and Semantic MediaWiki]].</ref> | {{ll|Extension:ContactManager|ContactManager}} |{{ll|Extension:Lua|Lua}} | |} <div lang="en" dir="ltr" class="mw-content-ltr"> == Alternative comparisons == </div> * {{ll|Extension:Cargo/Cargo and Semantic MediaWiki|2=<span lang="en" dir="ltr" class="mw-content-ltr">Cargo and Semantic MediaWiki</span>}} * <span lang="en" dir="ltr" class="mw-content-ltr">[https://professional.wiki/en/articles/managing-data-in-mediawiki Semantic MediaWiki vs Wikibase vs Cargo] by [https://professional.wiki Professional Wiki]</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references/> <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{ll|Multi-Content Revisions}} – <span lang="en" dir="ltr" class="mw-content-ltr">Ability to manage different independent content objects on the same wiki page</span> * {{ll|Extension:WikiDB|WikiDB}} – <span lang="en" dir="ltr" class="mw-content-ltr">Provides database features, somewhat similar to semantic properties</span> * {{ll|Extension:JsonConfig|JsonConfig}} – <span lang="en" dir="ltr" class="mw-content-ltr">store JSON (including tabular and map data) in wiki pages, and allow accessing them via Lua; no query support</span> * {{ll|Extension:External Data|External Data}} – <span lang="en" dir="ltr" class="mw-content-ltr">access data from external URL, local file, and SQL or MongoDB database</span> * {{ll|Structured data across Wikimedia}} – <span lang="en" dir="ltr" class="mw-content-ltr">2021-2023 project for improving structured data support in MediaWiki</span> * {{ll|Category:Data management extensions}} [[Category:MediaWiki Introduction{{#translation:}}]] [[Category:Extension comparisons{{#translation:}}]] poxylt5axag62jsm2w5j50lpnmji4tm Manual:Managing data in MediaWiki/my 100 1908968 8364305 8363591 2026-05-03T12:44:46Z FuzzyBot 451990 Updating to match new version of source page 8364305 wikitext text/x-wiki <languages/> <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki was designed to manage mostly free-form text and images.</span> <span lang="en" dir="ltr" class="mw-content-ltr">A limited amount of structure is available: {{ll|Help:Namespaces|namespaces}}, {{ll|Help:Subpages|subpages}} and {{ll|Help:Categories|categories}} help to group similar pages together, while features like {{ll|Infobox|infoboxes}} and {{ll|Gallery|galleries}} help to structure the contents within each page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, MediaWiki by itself does not truly provide ways to manage structured data: data that can be queried, filtered, and in some cases displayed with visualizations including tables, charts, maps<ref>see also [[Wikimedia Maps]]</ref> and calendars.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For that, a number of dedicated [[Special:MyLanguage/Manual:Extensions|extensions]] exist.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following table describes the extensions that can store the data edited by users in a MediaWiki database, from where it can then be queried. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is not a list of all structured data functionality; the "[[#See also|See also]]" section lists other extensions and features that can be used for storing or displaying structured data. </div> {| class="wikitable" |- ! <span lang="en" dir="ltr" class="mw-content-ltr">Feature</span> ! [[File:20210702_Semantic_MediaWiki_logo_with_wordmark.png|100px]]<br/>[https://www.semantic-mediawiki.org/ Semantic MediaWiki] ! [[File:Wikibase_Suite_Vertical_2x_RGB.png|100px]]<br/>[https://wikiba.se/ Wikibase] ! [[File:Cargo logo.png|50px]]<br/>{{ll|Extension:Cargo|nsp=0}} ! {{ll|Extension:VisualData|VisualData}} !{{ll|Extension:Bucket|Bucket}} ! {{ll|Extension:NeoWiki|NeoWiki}} |- | <span lang="en" dir="ltr" class="mw-content-ltr">Main usecase</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation, based on [[w:Semantic Web|Semantic Web]] standards.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Powering [[w:Wikidata|Wikidata]] and other editable graph databases.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation based on JSON-schema.</span> |lightweight Lua interface for storing and accessing structured data on wiki pages |Knowledge management system that combines collaborative editing and a [[:en:knowledge_graph|knowledge graph]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Approach</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data (properties) are annotated within regular wikitext or by templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">With the datatype "reference", properties can be used to describe items using statements.</span><ref>https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties are defined and used to describe Items using statements.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data is stored in database tables, with each table corresponding to a template.</span> | json content model နဲ့ သီးသန့် slot တစ်ခုမှာ ဒေတာကို သိမ်းထားတယ်။ |Data is stored in '''buckets''', which are database tables with specific columns that you can define |Schemas can be defined and applied to wiki pages, stored in a dedicated slot as JSON data. |- | <span lang="en" dir="ltr" class="mw-content-ltr">Available since</span> | 2005 | 2012 | 2015 | 2022 <span lang="en" dir="ltr" class="mw-content-ltr">(formerly known as {{ll|Extension:PageProperties|PageProperties}})</span> |2025 |2026 |- | <span lang="en" dir="ltr" class="mw-content-ltr">Active installations</span> | <span lang="en" dir="ltr" class="mw-content-ltr">1000s</span><ref>https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">100s</span><ref>https://wikiapiary.com/wiki/Extension:WikibaseRepository</ref><ref>https://wikibase.world</ref><ref>https://addshore.com/2024/10/visualizing-wikibase-connections-using-wikibase-world/</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">100s</span><ref>https://wikiapiary.com/wiki/Extension:Cargo</ref> | n/a (သစ်တိုးချဲ့ခြင်း သို့မဟုတ် မသိရသေးခြင်း) | | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Community</span> | <span lang="en" dir="ltr" class="mw-content-ltr">190+ developers</span><ref>https://www.openhub.net/p/smw</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">172+ developers</span><ref>https://github.com/wikimedia/mediawiki-extensions-Wikibase</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">63+ developers</span><ref>https://github.com/wikimedia/mediawiki-extensions-Cargo</ref> | ([[User:Thomas-topway-it|<span lang="en" dir="ltr" class="mw-content-ltr">main developer</span>]]) |[https://weirdgloop.org/discord Weird Gloop's Discord] |[https://echolot-eccch.eu/ ECHOLOT project], [https://professional.wiki/ Professinal Wiki], [https://knowledge.wiki KM-A], [https://bluespice.com/bluespice-galaxy/ BlueSpice Galaxy] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Storage</span> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database, Elasticsearch, 5 different SPARQL stores</span><ref>https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database, Elasticsearch, SPARQL store (Blazegraph for wikidata.org)</span> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database (or a separate database)</span><ref>{{ll|Extension:Cargo/Download and installation#Setting the Cargo database}}</ref> | MediaWiki ဒေတာဘေ့စ် |MediaWiki database (MySQL/MariaDB) |different SPARQL stores, currently Neo4J |- | <span lang="en" dir="ltr" class="mw-content-ltr">Property definition</span> | <span lang="en" dir="ltr" class="mw-content-ltr">By typing wikitext.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Properties can be invented freely.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will be of datatype page by default and can be defined later.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Datatypes can be changed any time.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties have to be defined before usage and can not be changed easily.</span><ref>[[d:Help:Data type#Changing datatype]]</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties are defined through one or more json-schema defined through a {{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}}</span> |Tables in the Bucket: namespace |Form based schema editing |- | <span lang="en" dir="ltr" class="mw-content-ltr">Value declaration</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Inline (<code><nowiki>[[MyProperty::MyValue]]</nowiki></code>) or with templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Form-based data entry with {{ll|Extension:Page_Forms|Page Forms}}.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Wikibase default form-like input interface.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">With parser functions in templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Form-based data entry with {{ll|Extension:Page_Forms|Page Forms}}.</span> | json-schemes များမှ အလိုအလျောက်ထုတ်လုပ်သော Inline သို့မဟုတ် Popup OOUI {{ll|Extension:VisualData/Forms|forms}} |via Lua call of the <code>bucket.put</code> function |OOUI based form editing |- | <span lang="en" dir="ltr" class="mw-content-ltr">Predefined data types</span> | 18<ref>https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes</ref> | 17<ref>[[d:Special:ListDatatypes]]</ref><ref><span lang="en" dir="ltr" class="mw-content-ltr">Some datatypes are defined by other extension: [[Special:MyLanguage/Extension:Math|Math]] and [[Special:MyLanguage/Extension:Score|Score]] both define one datatype, [[Special:MyLanguage/Extension:JsonConfig|JsonConfig]] defines two, [[Special:MyLanguage/Extension:WikibaseLexeme|WikibaseLexeme]] defines three, and Wikibase defines ten.</span></ref> | 18 | 4 (အခြေခံ json-schema အမျိုးအစားများ) + 15 string format များ | 5 <ref>https://meta.weirdgloop.org/w/Extension:Bucket#Basic_usage</ref> | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Property management</span> | <span lang="en" dir="ltr" class="mw-content-ltr">type definitions, constraint schemas, ontology import</span> | <span lang="en" dir="ltr" class="mw-content-ltr">custom, or import of Wikidata ontology</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table.</span> | ဂရပ်ဖစ် အင်တာဖေ့စ်မှတစ်ဆင့် ({{ll|Extension:VisualData/Schema Builder|SchemaBuilder}}) ကို ရည်စူးထားသည် | |through a graphical interface |- | <span lang="en" dir="ltr" class="mw-content-ltr">Page names and internal linking</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Page names are stored with their Q-numbers (displaying labels in available languages). Internal linking must be done to the Q-number; you cannot link to a label.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Schemas are stored in a dedicated namespace and JSON-data in a dedicated slot associated to wiki articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">JSON-data can be accessed through an extension of the wiki interface</span> | |MediaWiki pages can have schemas |- | <span lang="en" dir="ltr" class="mw-content-ltr">Inline queries</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | <span lang="en" dir="ltr" class="mw-content-ltr">no (external SPARQL queries);</span> [[phab:T67626|<span lang="en" dir="ltr" class="mw-content-ltr">planned</span>]]<br/><span lang="en" dir="ltr" class="mw-content-ltr">supported via third-party extension {{ll|Extension:LinkedWiki|LinkedWiki}}</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | |yes, with parser functions via the SQL store |- | <span lang="en" dir="ltr" class="mw-content-ltr">External querying</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with either an API or SPARQL querying (available through special extensions such as [[Special:MyLanguage/Extension:RDFIO|RDFIO]] and [[Special:MyLanguage/Extension:LinkedWiki|LinkedWiki]])</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with SPARQL Query service</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with an API</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with an API</span><ref>{{ll|Extension:VisualData/API}}</ref> | API is not yet stable <ref>https://meta.weirdgloop.org/w/Extension:Bucket</ref> |yes, with an API or SPARQL endpoint |- | <span lang="en" dir="ltr" class="mw-content-ltr">Result formats<ref>"Result formats" mean the ability of the wiki to display data (results of an inline query) in various formats, e.g. tables, calendars, maps, timelines, etc.</ref></span> | ~ 75<ref>https://www.semantic-mediawiki.org/wiki/Help:Result_formats</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">no native result display; data may be visualized via:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Query Service or other external tools </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * on wiki data access via LUA (no query support) </div> * {{ll|Extension:LinkedWiki}} - <span lang="en" dir="ltr" class="mw-content-ltr">third-party</span> | <span lang="en" dir="ltr" class="mw-content-ltr">~ 25</span><ref>{{ll|Extension:Cargo/Display formats}}</ref> | 12+ (Json, Table, Datatable, Template, Calendar, Carousel, Map, pageid, pagetitle, count, raw, Lua ) <ref>{{ll|Extension:VisualData/Result_formats}}</ref> | | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Development</span> | [[github:SemanticMediaWiki/SemanticMediaWiki|GitHub]] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Cargo Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/VisualData Gerrit] |[[github:weirdgloop/mediawiki-extensions-Bucket|GitHub]] |[[github:ProfessionalWiki/NeoWiki|GItHub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Complementary extensions</span> | ~ 40<ref>{{ll|Category:Semantic MediaWiki extensions}}</ref>, e.g. {{ll|Extension:Semantic Result Formats|Semantic Result Formats}}, {{ll|Extension:Semantic Bundle|Semantic Bundle}}, {{ll|Extension:Semantic Scribunto|Semantic Scribunto}} | ~12<ref>{{ll|Category:Wikibase extensions}}</ref>, e.g. {{ll|Extension:Wikibase Repository|Wikibase Repository}}, {{ll|Extension:Wikibase Client|Wikibase Client}}, {{ll|Extension:WikibaseLexeme|WikibaseLexeme}}, [https://wikiba.se/applications/#query-service Query Service] | <span lang="en" dir="ltr" class="mw-content-ltr">2 ([[Special:MyLanguage/Extension:Page Forms|Page Forms]], [[Special:MyLanguage/Extension:Page Schemas|Page Schemas]]). Cargo provides some or all of the functionality of Semantic MediaWiki, Semantic Result Formats, Maps, Semantic Drilldown, Semantic Compound Queries, Semantic Internal Objects and Semantic Scribunto.</span><ref>[[Extension:Cargo/Cargo and Semantic MediaWiki]].</ref> | {{ll|Extension:ContactManager|ContactManager}} |{{ll|Extension:Lua|Lua}} | |} <div lang="en" dir="ltr" class="mw-content-ltr"> == Alternative comparisons == </div> * {{ll|Extension:Cargo/Cargo and Semantic MediaWiki|2=<span lang="en" dir="ltr" class="mw-content-ltr">Cargo and Semantic MediaWiki</span>}} * <span lang="en" dir="ltr" class="mw-content-ltr">[https://professional.wiki/en/articles/managing-data-in-mediawiki Semantic MediaWiki vs Wikibase vs Cargo] by [https://professional.wiki Professional Wiki]</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references/> <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * {{ll|Multi-Content Revisions}} – <span lang="en" dir="ltr" class="mw-content-ltr">Ability to manage different independent content objects on the same wiki page</span> * {{ll|Extension:WikiDB|WikiDB}} – <span lang="en" dir="ltr" class="mw-content-ltr">Provides database features, somewhat similar to semantic properties</span> * {{ll|Extension:JsonConfig|JsonConfig}} – <span lang="en" dir="ltr" class="mw-content-ltr">store JSON (including tabular and map data) in wiki pages, and allow accessing them via Lua; no query support</span> * {{ll|Extension:External Data|External Data}} – <span lang="en" dir="ltr" class="mw-content-ltr">access data from external URL, local file, and SQL or MongoDB database</span> * {{ll|Structured data across Wikimedia}} – <span lang="en" dir="ltr" class="mw-content-ltr">2021-2023 project for improving structured data support in MediaWiki</span> * {{ll|Category:Data management extensions}} [[Category:MediaWiki Introduction{{#translation:}}]] [[Category:Extension comparisons{{#translation:}}]] rcl9ps8q842btwkzyoi2kx32f5xtzc0 Manual:Managing data in MediaWiki/pl 100 1909405 8364308 8363592 2026-05-03T12:44:47Z FuzzyBot 451990 Updating to match new version of source page 8364308 wikitext text/x-wiki <languages/> <span class="mw-translate-fuzzy">MediaWiki zostało zaprojektowane, aby zarządzać głównie informacjami tekstowymi i robi to bardzo dobrze.</span> <span lang="en" dir="ltr" class="mw-content-ltr">A limited amount of structure is available: {{ll|Help:Namespaces|namespaces}}, {{ll|Help:Subpages|subpages}} and {{ll|Help:Categories|categories}} help to group similar pages together, while features like {{ll|Infobox|infoboxes}} and {{ll|Gallery|galleries}} help to structure the contents within each page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, MediaWiki by itself does not truly provide ways to manage structured data: data that can be queried, filtered, and in some cases displayed with visualizations including tables, charts, maps<ref>see also [[Wikimedia Maps]]</ref> and calendars.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For that, a number of dedicated [[Special:MyLanguage/Manual:Extensions|extensions]] exist.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following table describes the extensions that can store the data edited by users in a MediaWiki database, from where it can then be queried. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is not a list of all structured data functionality; the "[[#See also|See also]]" section lists other extensions and features that can be used for storing or displaying structured data. </div> {| class="wikitable" |- ! Funkcja ! [[File:20210702_Semantic_MediaWiki_logo_with_wordmark.png|100px]]<br/>[https://www.semantic-mediawiki.org/ Semantic MediaWiki] ! [[File:Wikibase_Suite_Vertical_2x_RGB.png|100px]]<br/>[https://wikiba.se/ Wikibase] ! [[File:Cargo logo.png|50px]]<br/>{{ll|Extension:Cargo|nsp=0}} ! {{ll|Extension:VisualData|VisualData}} !{{ll|Extension:Bucket|Bucket}} ! {{ll|Extension:NeoWiki|NeoWiki}} |- | Główny przypadek użytkowy | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation, based on [[w:Semantic Web|Semantic Web]] standards.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Powering [[w:Wikidata|Wikidata]] and other editable graph databases.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Managing data within a MediaWiki installation based on JSON-schema.</span> |lightweight Lua interface for storing and accessing structured data on wiki pages |Knowledge management system that combines collaborative editing and a [[:en:knowledge_graph|knowledge graph]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Approach</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data (properties) are annotated within regular wikitext or by templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">With the datatype "reference", properties can be used to describe items using statements.</span><ref>https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties are defined and used to describe Items using statements.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data is stored in database tables, with each table corresponding to a template.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Data are stored in a dedicated slot with JSON content model</span> |Data is stored in '''buckets''', which are database tables with specific columns that you can define |Schemas can be defined and applied to wiki pages, stored in a dedicated slot as JSON data. |- | <span lang="en" dir="ltr" class="mw-content-ltr">Available since</span> | 2005 | 2012 | 2015 | 2022 <span lang="en" dir="ltr" class="mw-content-ltr">(formerly known as {{ll|Extension:PageProperties|PageProperties}})</span> |2025 |2026 |- | <span lang="en" dir="ltr" class="mw-content-ltr">Active installations</span> | <span lang="en" dir="ltr" class="mw-content-ltr">1000s</span><ref>https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">100s</span><ref>https://wikiapiary.com/wiki/Extension:WikibaseRepository</ref><ref>https://wikibase.world</ref><ref>https://addshore.com/2024/10/visualizing-wikibase-connections-using-wikibase-world/</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">100s</span><ref>https://wikiapiary.com/wiki/Extension:Cargo</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">n/a (new extension or unknown)</span> | | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Community</span> | <span lang="en" dir="ltr" class="mw-content-ltr">190+ developers</span><ref>https://www.openhub.net/p/smw</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">172+ developers</span><ref>https://github.com/wikimedia/mediawiki-extensions-Wikibase</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">63+ developers</span><ref>https://github.com/wikimedia/mediawiki-extensions-Cargo</ref> | ([[User:Thomas-topway-it|<span lang="en" dir="ltr" class="mw-content-ltr">main developer</span>]]) |[https://weirdgloop.org/discord Weird Gloop's Discord] |[https://echolot-eccch.eu/ ECHOLOT project], [https://professional.wiki/ Professinal Wiki], [https://knowledge.wiki KM-A], [https://bluespice.com/bluespice-galaxy/ BlueSpice Galaxy] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Storage</span> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database, Elasticsearch, 5 different SPARQL stores</span><ref>https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database, Elasticsearch, SPARQL store (Blazegraph for wikidata.org)</span> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database (or a separate database)</span><ref>{{ll|Extension:Cargo/Download and installation#Setting the Cargo database}}</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki database</span> |MediaWiki database (MySQL/MariaDB) |different SPARQL stores, currently Neo4J |- | <span lang="en" dir="ltr" class="mw-content-ltr">Property definition</span> | <span lang="en" dir="ltr" class="mw-content-ltr">By typing wikitext.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Properties can be invented freely.</span> <span lang="en" dir="ltr" class="mw-content-ltr">They will be of datatype page by default and can be defined later.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Datatypes can be changed any time.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties have to be defined before usage and can not be changed easily.</span><ref>[[d:Help:Data type#Changing datatype]]</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Properties are defined through one or more json-schema defined through a {{ll|Extension:VisualData/Schema_Builder|SchemaBuilder}}</span> |Tables in the Bucket: namespace |Form based schema editing |- | <span lang="en" dir="ltr" class="mw-content-ltr">Value declaration</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Inline (<code><nowiki>[[MyProperty::MyValue]]</nowiki></code>) or with templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Form-based data entry with {{ll|Extension:Page_Forms|Page Forms}}.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Wikibase default form-like input interface.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">With parser functions in templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Form-based data entry with {{ll|Extension:Page_Forms|Page Forms}}.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Inline or popup OOUI {{ll|Extension:VisualData/Forms|forms}} automatically generated from JSON-schemas</span> |via Lua call of the <code>bucket.put</code> function |OOUI based form editing |- | <span lang="en" dir="ltr" class="mw-content-ltr">Predefined data types</span> | 18<ref>https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes</ref> | 17<ref>[[d:Special:ListDatatypes]]</ref><ref><span lang="en" dir="ltr" class="mw-content-ltr">Some datatypes are defined by other extension: [[Special:MyLanguage/Extension:Math|Math]] and [[Special:MyLanguage/Extension:Score|Score]] both define one datatype, [[Special:MyLanguage/Extension:JsonConfig|JsonConfig]] defines two, [[Special:MyLanguage/Extension:WikibaseLexeme|WikibaseLexeme]] defines three, and Wikibase defines ten.</span></ref> | 18 | <span lang="en" dir="ltr" class="mw-content-ltr">4 (basic JSON-schema types) + 15 string formats</span> | 5 <ref>https://meta.weirdgloop.org/w/Extension:Bucket#Basic_usage</ref> | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Property management</span> | <span lang="en" dir="ltr" class="mw-content-ltr">type definitions, constraint schemas, ontology import</span> | <span lang="en" dir="ltr" class="mw-content-ltr">custom, or import of Wikidata ontology</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">through a graphical interface (dedicated {{ll|Extension:VisualData/Schema Builder|SchemaBuilder}})</span> | |through a graphical interface |- | <span lang="en" dir="ltr" class="mw-content-ltr">Page names and internal linking</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Page names are stored with their Q-numbers (displaying labels in available languages). Internal linking must be done to the Q-number; you cannot link to a label.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Pages have normal names and can be linked to with their names.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Schemas are stored in a dedicated namespace and JSON-data in a dedicated slot associated to wiki articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">JSON-data can be accessed through an extension of the wiki interface</span> | |MediaWiki pages can have schemas |- | <span lang="en" dir="ltr" class="mw-content-ltr">Inline queries</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | <span lang="en" dir="ltr" class="mw-content-ltr">no (external SPARQL queries);</span> [[phab:T67626|<span lang="en" dir="ltr" class="mw-content-ltr">planned</span>]]<br/><span lang="en" dir="ltr" class="mw-content-ltr">supported via third-party extension {{ll|Extension:LinkedWiki|LinkedWiki}}</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with parser functions</span> | |yes, with parser functions via the SQL store |- | <span lang="en" dir="ltr" class="mw-content-ltr">External querying</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with either an API or SPARQL querying (available through special extensions such as [[Special:MyLanguage/Extension:RDFIO|RDFIO]] and [[Special:MyLanguage/Extension:LinkedWiki|LinkedWiki]])</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with SPARQL Query service</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with an API</span> | <span lang="en" dir="ltr" class="mw-content-ltr">yes, with an API</span><ref>{{ll|Extension:VisualData/API}}</ref> | API is not yet stable <ref>https://meta.weirdgloop.org/w/Extension:Bucket</ref> |yes, with an API or SPARQL endpoint |- | <span lang="en" dir="ltr" class="mw-content-ltr">Result formats<ref>"Result formats" mean the ability of the wiki to display data (results of an inline query) in various formats, e.g. tables, calendars, maps, timelines, etc.</ref></span> | ~ 75<ref>https://www.semantic-mediawiki.org/wiki/Help:Result_formats</ref> | <span lang="en" dir="ltr" class="mw-content-ltr">no native result display; data may be visualized via:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Query Service or other external tools </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * on wiki data access via LUA (no query support) </div> * {{ll|Extension:LinkedWiki}} - <span lang="en" dir="ltr" class="mw-content-ltr">third-party</span> | <span lang="en" dir="ltr" class="mw-content-ltr">~ 25</span><ref>{{ll|Extension:Cargo/Display formats}}</ref> | 12+ (Json, Table, Datatable, Template, Calendar, Carousel, Map, pageid, pagetitle, count, raw, Lua ) <ref>{{ll|Extension:VisualData/Result_formats}}</ref> | | |- | <span lang="en" dir="ltr" class="mw-content-ltr">Development</span> | [[github:SemanticMediaWiki/SemanticMediaWiki|GitHub]] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Cargo Gerrit] | [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/VisualData Gerrit] |[[github:weirdgloop/mediawiki-extensions-Bucket|GitHub]] |[[github:ProfessionalWiki/NeoWiki|GItHub]] |- | <span lang="en" dir="ltr" class="mw-content-ltr">Complementary extensions</span> | ~ 40<ref>{{ll|Category:Semantic MediaWiki extensions}}</ref>, e.g. {{ll|Extension:Semantic Result Formats|Semantic Result Formats}}, {{ll|Extension:Semantic Bundle|Semantic Bundle}}, {{ll|Extension:Semantic Scribunto|Semantic Scribunto}} | ~12<ref>{{ll|Category:Wikibase extensions}}</ref>, e.g. {{ll|Extension:Wikibase Repository|Wikibase Repository}}, {{ll|Extension:Wikibase Client|Wikibase Client}}, {{ll|Extension:WikibaseLexeme|WikibaseLexeme}}, [https://wikiba.se/applications/#query-service Query Service] | <span lang="en" dir="ltr" class="mw-content-ltr">2 ([[Special:MyLanguage/Extension:Page Forms|Page Forms]], [[Special:MyLanguage/Extension:Page Schemas|Page Schemas]]). Cargo provides some or all of the functionality of Semantic MediaWiki, Semantic Result Formats, Maps, Semantic Drilldown, Semantic Compound Queries, Semantic Internal Objects and Semantic Scribunto.</span><ref>[[Extension:Cargo/Cargo and Semantic MediaWiki]].</ref> | {{ll|Extension:ContactManager|ContactManager}} |{{ll|Extension:Lua|Lua}} | |} <span id="Alternative_comparisons"></span> == Alternatywne porównania == * {{ll|Extension:Cargo/Cargo and Semantic MediaWiki|2=Cargo i semantyczne MediaWiki}} * <span class="mw-translate-fuzzy">'''[https://professional.wiki/en/articles/managing-data-in-mediawiki Semantyczne MediaWiki kontra Wikibase kontra Cargo]''' przez [$url2 Professional.Wiki], zaktualizowane w lutym 2023 r. lub później</span> <span id="References"></span> == Przypisy == <references/> <span id="See_also"></span> == Zobacz też == * {{ll|Multi-Content Revisions}} – <span class="mw-translate-fuzzy">Możliwość zarządzania różnymi niezależnymi obiektami treści na tej samej stronie wiki poprzez zmianę technologii w back-end MediaWiki.</span> * {{ll|Extension:WikiDB|WikiDB}} – Oferuje funkcje bazy danych, nieco podobne do właściwości semantycznych. * {{ll|Extension:JsonConfig|JsonConfig}} – przechowywanie JSON (w tym danych tabeli i map) na stronach wiki i umożliwienie dostępu do nich za pośrednictwem Lua; brak wsparcia do zapytań * {{ll|Extension:External Data|External Data}} – <span class="mw-translate-fuzzy">dostęp do danych z zewnętrznego adresu URL, pliku lokalnego oraz bazy danych SQL lub MongoDB (które mogą zawierać dane z witryn niebędących Mediawiki)</span> * {{ll|Structured data across Wikimedia}} – <span class="mw-translate-fuzzy">bieżący (od 2021 r.) projekt na rzecz poprawy wsparcia danych strukturalnych w MediaWiki</span> * {{ll|Category:Data management extensions}} [[Category:MediaWiki Introduction{{#translation:}}]] [[Category:Extension comparisons{{#translation:}}]] 01jne90qajez5itbbwyrwfilwtpqnh4 Project:Village Pump 4 1926565 8365077 8363402 2026-05-04T07:59:48Z Akwam1 18368158 /* Report concerning User:~2026-26642-65 */ ù 8365077 wikitext text/x-wiki {{Project:Village Pump/Header}}{{Auto archiving |archive = Project:Village Pump/Archive %(counter)d |algo = old(14d) |counter = 4 |maxarchivesize = 250K |minthreadsleft = 2 |minthreadstoarchive = 1 |archiveheader = {{talk archive}} }} == Minor rewording in the deletion templates == I propose that the two deletion templates, {{Tlx|Delete}} and {{Tlx|Speedy}}, drop the mention of the to-be-delated page as one the places, the other being the associated talk page, to discuss the deletions. The latter even mentions the talk page only in brackets. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 02:48, 18 April 2026 (UTC) : I disagree. Those templates can also be used on talk pages so discussing on the to-be-deleted page or talk page ("as applicable") is correct. --[[User:Clump|Clump]] ([[User talk:Clump|talk]]) 13:07, 2 May 2026 (UTC) ::What about having matching mentions then? [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:51, 2 May 2026 (UTC) == Propagation of templates == I have been making some needed changes to Template:BlueSpiceFooter to make it easier to maintain installation information and other extension information that applies to all BlueSpice extensions. For example, I nested the Template:ExtensionInstallComposer. Whenever I make a change/correction, I don't see it applied immediately on the pages that use the template, no matter how I try to purge the page. Is there a job running that takes care of that or is it in some translation queue and if so, when would I expect to see the latest template changes applied or is there a way to speed this process up? [[User:MLRodrigue|MLRodrigue]] ([[User talk:MLRodrigue|talk]]) 08:07, 30 April 2026 (UTC) :It’s in a queue, which is visible at [[Special:PageTranslation]] and is handled by humans (translation administrators), so you can only expect the time to vary a lot depending on how much free time translation administrators have. —[[User:Tacsipacsi|Tacsipacsi]] ([[User talk:Tacsipacsi|talk]]) 23:01, 30 April 2026 (UTC) == Wikidata item of Project:Support desk == Should the [[Project:Support desk]] page and various other non-Wikipedia pages really link [[wikidata:Q4582194|via Wikidata]] to various language Wikipedias? Yes, from the Wikipedias it is rare to stumble into here, but users choosing the language selection button here surely expect to see a translation, not the help page of their local Wikipedia. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 17:19, 23 April 2026 (UTC) :Hmm, maybe we could/should use whatever the method is (?), that is used at [[d:Wikidata:Project_chat]] and [[c:Commons:Village pump]], whereby they have the interlanguage-links list header replaced with "In Wikipedia"? But it's not currently being used in [[m:Wikimedia Forum]] or [[f:Wikifunctions:Project chat]] (i.e. not a global override) so I'm not sure if it's a good method, or an imperfect method; someone would ideally verify that first. –[[User:Quiddity|Quiddity]] ([[User talk:Quiddity|talk]]) 18:23, 23 April 2026 (UTC) :Yes. We should choose the nearest equivalent and if necessary, make a new Wikidata item. —[[User:Koavf|Justin (<span style="color:grey">ko'''a'''vf</span>)]]<span style="color:red">❤[[User talk:Koavf|T]]☮[[Special:Contributions/Koavf|C]]☺[[Special:Emailuser/Koavf|M]]☯</span> 21:31, 23 April 2026 (UTC) == Request for comment (global AI policy) == <bdi lang="en" dir="ltr" class="mw-content-ltr"> A [[:m:Requests for comment/Artificial intelligence policy|request for comment]] is currently being held to decide on a global AI policy. {{int:Feedback-thanks-title}} [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 00:57, 26 April 2026 (UTC) </bdi> <!-- Message sent by User:Codename Noreste@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Distribution_list/Global_message_delivery&oldid=30424282 --> == Report concerning User:~2026-26154-72 == {{userLinks|1=~2026-26154-72}} &mdash; '''Reasons:''' Vandalism. Please check for proxy <small>[[:m:Special:MyLanguage/User:TenWhile6/XReport|XReport]]</small> --[[User:NDG|NDG]] ([[User talk:NDG|talk]]) 15:42, 29 April 2026 (UTC) : Single, minor instance; not sure it's necessary. --[[User:Clump|Clump]] ([[User talk:Clump|talk]]) 16:36, 29 April 2026 (UTC) == Report concerning User:~2026-26642-65 == {{userLinks|1=~2026-26642-65}} &mdash; '''Reasons:''' Bad translations <small>[[:m:Special:MyLanguage/User:TenWhile6/XReport|XReport]]</small> --[[User:Tenshi Hinanawi|Tenshi Hinanawi]] ([[User talk:Tenshi Hinanawi|talk]]) 15:06, 1 May 2026 (UTC) : :what happens [[User:Akwam1|Akwam1]] ([[User talk:Akwam1|talk]]) 07:59, 4 May 2026 (UTC) irdovsgmfi99ln354z2jkt2t66vk3uy 8365120 8365077 2026-05-04T10:50:05Z Clump 81610 Reverted edits by [[Special:Contribs/Akwam1|Akwam1]] ([[User talk:Akwam1|talk]]) to last version by Clump 8363192 wikitext text/x-wiki {{Project:Village Pump/Header}}{{Auto archiving |archive = Project:Village Pump/Archive %(counter)d |algo = old(14d) |counter = 4 |maxarchivesize = 250K |minthreadsleft = 2 |minthreadstoarchive = 1 |archiveheader = {{talk archive}} }} == Minor rewording in the deletion templates == I propose that the two deletion templates, {{Tlx|Delete}} and {{Tlx|Speedy}}, drop the mention of the to-be-delated page as one the places, the other being the associated talk page, to discuss the deletions. The latter even mentions the talk page only in brackets. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 02:48, 18 April 2026 (UTC) : I disagree. Those templates can also be used on talk pages so discussing on the to-be-deleted page or talk page ("as applicable") is correct. --[[User:Clump|Clump]] ([[User talk:Clump|talk]]) 13:07, 2 May 2026 (UTC) ::What about having matching mentions then? [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:51, 2 May 2026 (UTC) == Propagation of templates == I have been making some needed changes to Template:BlueSpiceFooter to make it easier to maintain installation information and other extension information that applies to all BlueSpice extensions. For example, I nested the Template:ExtensionInstallComposer. Whenever I make a change/correction, I don't see it applied immediately on the pages that use the template, no matter how I try to purge the page. Is there a job running that takes care of that or is it in some translation queue and if so, when would I expect to see the latest template changes applied or is there a way to speed this process up? [[User:MLRodrigue|MLRodrigue]] ([[User talk:MLRodrigue|talk]]) 08:07, 30 April 2026 (UTC) :It’s in a queue, which is visible at [[Special:PageTranslation]] and is handled by humans (translation administrators), so you can only expect the time to vary a lot depending on how much free time translation administrators have. —[[User:Tacsipacsi|Tacsipacsi]] ([[User talk:Tacsipacsi|talk]]) 23:01, 30 April 2026 (UTC) == Wikidata item of Project:Support desk == Should the [[Project:Support desk]] page and various other non-Wikipedia pages really link [[wikidata:Q4582194|via Wikidata]] to various language Wikipedias? Yes, from the Wikipedias it is rare to stumble into here, but users choosing the language selection button here surely expect to see a translation, not the help page of their local Wikipedia. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 17:19, 23 April 2026 (UTC) :Hmm, maybe we could/should use whatever the method is (?), that is used at [[d:Wikidata:Project_chat]] and [[c:Commons:Village pump]], whereby they have the interlanguage-links list header replaced with "In Wikipedia"? But it's not currently being used in [[m:Wikimedia Forum]] or [[f:Wikifunctions:Project chat]] (i.e. not a global override) so I'm not sure if it's a good method, or an imperfect method; someone would ideally verify that first. –[[User:Quiddity|Quiddity]] ([[User talk:Quiddity|talk]]) 18:23, 23 April 2026 (UTC) :Yes. We should choose the nearest equivalent and if necessary, make a new Wikidata item. —[[User:Koavf|Justin (<span style="color:grey">ko'''a'''vf</span>)]]<span style="color:red">❤[[User talk:Koavf|T]]☮[[Special:Contributions/Koavf|C]]☺[[Special:Emailuser/Koavf|M]]☯</span> 21:31, 23 April 2026 (UTC) == Request for comment (global AI policy) == <bdi lang="en" dir="ltr" class="mw-content-ltr"> A [[:m:Requests for comment/Artificial intelligence policy|request for comment]] is currently being held to decide on a global AI policy. {{int:Feedback-thanks-title}} [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 00:57, 26 April 2026 (UTC) </bdi> <!-- Message sent by User:Codename Noreste@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Distribution_list/Global_message_delivery&oldid=30424282 --> == Report concerning User:~2026-26154-72 == {{userLinks|1=~2026-26154-72}} &mdash; '''Reasons:''' Vandalism. Please check for proxy <small>[[:m:Special:MyLanguage/User:TenWhile6/XReport|XReport]]</small> --[[User:NDG|NDG]] ([[User talk:NDG|talk]]) 15:42, 29 April 2026 (UTC) : Single, minor instance; not sure it's necessary. --[[User:Clump|Clump]] ([[User talk:Clump|talk]]) 16:36, 29 April 2026 (UTC) == Report concerning User:~2026-26642-65 == {{userLinks|1=~2026-26642-65}} &mdash; '''Reasons:''' Bad translations <small>[[:m:Special:MyLanguage/User:TenWhile6/XReport|XReport]]</small> --[[User:Tenshi Hinanawi|Tenshi Hinanawi]] ([[User talk:Tenshi Hinanawi|talk]]) 15:06, 1 May 2026 (UTC) 4a5uyh2vkannw3v9h3g6k0i1w9ahm1h Extension:WhoIsWatching/cs 102 1974859 8364408 6973941 2026-05-03T14:58:52Z FuzzyBot 451990 Updating to match new version of source page 8364408 wikitext text/x-wiki <languages/> {{Extension |name = Who Is Watching |status = stable |type1 = special |type2 = database |type3 = parser function |author = * [[User:Gri6507|Paul Grinberg]], * [[User:Siebrand|Siebrand Mazeland]], * [[User:MarkAHershberger|Mark Hershberger]] |image = |license = GPL-2.0-only |version = 0.13.0 |update = 2019-08-04 |mediawiki = 1.43+ |download = {{WikimediaDownload}} |readme = [https://github.com/wikimedia/mediawiki-extensions-WhoIsWatching/blob/master/README.mediawiki README.mediawiki] |changelog = |compatibility policy = master |description = Find out who is watching a particular page, and add others to watchlist for that page. |parameters= * $whoiswatching_nametype * $whoiswatching_allowaddingpeople * $whoiswatching_showifzero * $whoiswatching_showwatchingusers * $whoiswatching_maxPicklistUsers |rights = * addpagetoanywatchlist * seepagewatchers |example = [http://ec.europa.eu/eurostat/statistics-explained/index.php?title=Special:WhoIsWatching&ns=&page=Transport_accident_statistics http://ec.europa.eu/eurostat/] |phabricator = MediaWiki-extensions-WhoIsWatching }} Rozšíření '''WhoIsWatching''' umožňuje zjistit, kdo sleduje konkrétní stránku, a přidat další do seznamu sledovaných pro tuto stránku. <span id="Rationale"></span> == Zdůvodnění == I když je tato představa v rozporu se [[w:Wikipedia:Watchlist#Privacy of watchlists|zásadami ochrany soukromí]] Wikipedie a Wikimedie, některé wikiny by ve skutečnosti rády viděly, kteří z jejích uživatelů sledují konkrétní stránky. Toto rozšíření poskytuje právě takové rozhraní ve spodní části každé stránky. Toto rozšíření má navíc možnost umožnit každému uživateli přidat libovolnou stránku do seznamu sledovaných jiných uživatelů. <span id="Installation"></span> == Instalace == Ujistěte se, že je nainstalován {{ll|Extension:Echo}}, protože je nezbytným předpokladem pro fungování tohoto rozšíření. {{ExtensionInstall |registration=required |localsettings = # $whoiswatching_nametype = "RealName"; # $whoiswatching_allowaddingpeople = false; # $whoiswatching_showifzero = true; # $whoiswatching_showwatchingusers = false; # $whoiswatching_maxPicklistUsers = 10; # $wgGroupPermissions['sysop']['addpagetoanywatchlist'] = true; # $wgGroupPermissions['sysop']['seepagewatchers'] = true; }} <span id="Configuration"></span> == Konfigurace == Rozšíření můžete jednoduše začít používat, aniž byste cokoliv dalšího měnili. Jediná dodatečná konfigurace, která je v současné době pro rozšíření možná, definuje způsob zobrazení jmen uživatelů sledujících stránky. V <code>SpecialWhoIsWatching.php</code>, je <syntaxhighlight lang="php"> # Set the following to either 'UserName' or 'RealName' to change how watching users are displayed. $whoiswatching_nametype = 'RealName'; </syntaxhighlight> Jak vyplývá z komentáře, v závislosti na hodnotě této proměnné můžete zobrazit buď skutečná jména sledujících uživatelů, nebo jejich uživatelská jména na wiki. Důvodem, proč některé wiki mohou chtít přejít do režimu 'UserName', je, že nevyžadují, aby jejich členové měli platné skutečné jméno. Další konfigurovatelnou možností v rozšíření je možnost zapnout/vypnout možnost umožnit libovolnému uživateli přidat libovolnou stránku do seznamu sledovaných libovolného jiného uživatele. To se provádí v <code>SpecialWhoIsWatching.php</code>, kde je <syntaxhighlight lang="php"> # Set true if you don't want to use permissions and users are allowed to add to other user's watchlists. $whoiswatching_allowaddingpeople = true; </syntaxhighlight> Je také možné zobrazit pouze počet sledujících lidí, pokud je počet větší než nula. To se provádí v <code>SpecialWhoIsWatching.php</code>, kde je <syntaxhighlight lang="php"> # Set to true if you want people with permission to see 0 if no one is watching the page. $whoiswatching_showifzero = true; </syntaxhighlight> A konečně, novější verze tohoto rozšíření, i když se snažíme být zpětně kompatibilní, vám umožňují používat oprávnění namísto globálních proměnných. <syntaxhighlight lang="php"> # Set to true if you don't want to use permissions. $whoiswatching_showwatchingusers = true; </syntaxhighlight> Ve výchozím nastavení mají uživatelé ve skupině sysop oprávnění vidět uživatele stránek a přidávat stránky do seznamu sledovaných kohokoli. Tato oprávnění můžete udělit také přihlášeným uživatelům nebo jakékoli skupině, o které si myslíte, že to potřebuje. <syntaxhighlight lang="php"> # Give all logged in users full access. $wgGroupPermissions['user']['addpagetoanywatchlist'] = true; $wgGroupPermissions['user']['seepagewatchers'] = true; </syntaxhighlight> <span id="Usage"></span> == Použití == {{tmpl|0=Toto rozšíření také poskytuje funkci analyzátoru <code>{{#whoiswatching:$1}}</code>, která ukazuje počet sledujících uživatelů <code>$1</code> plus poskytuje odkaz na <code>Special:WhoIsWatching/$1</code>. |1=Nějaká stránka }} To lze použít u vzhledů, které nepodporují odkazy v zápatí, nebo k vytvoření odkazu WhoIsWatching někde na stránce wiki. <span id="Known_issues"></span> == Známé problémy == Když poprvé po odeslání žádosti o odstranění stránky ze seznamu sledovaných uživatelů, bude uživatel stále zobrazen ve formuláři. Chcete-li to obejít, je zakázáno a zobrazeno s červeným přeškrtnutím. {{Used by}} [[Category:Notification extensions{{#translation:}}]] [[Category:WatchArticle extensions{{#translation:}}]] [[Category:Watchlist extensions{{#translation:}}]] rqkvn3x7qgfmx516iei3ejjwmxtia8j Local development quickstart/zh 0 1979334 8365134 8360193 2026-05-04T11:36:07Z Peterxy12 18072041 8365134 wikitext text/x-wiki <languages/> {{InstallationNav}} 本页是使用PHP和Composer为MediaWiki设置本地开发的'''快速入门'''指南。 {{note|1=此工作流仅适用于本地开发。 要为公共网站提供服务,请参阅{{ll|Manual:Installation requirements}}。}} {{TOC|limit=2}} <span id="Install_prerequisites"></span> == 安装前置条件 == <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki's master branch requires {{ll|Compatibility#PHP|PHP 8.3.0+}} and Composer 2.</span> {{void|1=MediaWiki需要[[w:zh:PHP|PHP]] {{MW stable php requirement}}+和[[w:zh:Composer_(軟體)|Composer]] 2。}} {{TabbedWindowBegin}} === Linux === 在Ubuntu 24+或Debian 13+上,使用[[w:zh:APT|APT]]。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> sudo apt install php php-intl php-mbstring php-xml php-apcu php-curl php-sqlite3 composer </syntaxhighlight> <span class="mw-translate-fuzzy">在Fedora 36+上,使用[[w:zh:DNF (软件)|DNF]]。</span> <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> sudo dnf install php composer </syntaxhighlight> 在Arch Linux上,使用[[w:zh:pacman|pacman]]安装所需的软件包。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> sudo pacman -S php composer </syntaxhighlight> === Mac === 使用[https://brew.sh/ Homebrew]安装所需的软件包。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> brew install php@8.5 composer brew link --overwrite php@8.5 </syntaxhighlight> 如果以下命令成功执行,则应显示PHP版本。 如果失败,可能是因为您的$PATH未配置,以从brew查找命令。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> php -v </syntaxhighlight> === Windows === 您可以选择使用[https://learn.microsoft.com/en-us/windows/wsl/about 适用于Linux的Windows子系统]并按照本页的Linux说明进行操作。 或者,要直接在Windows上安装MediaWiki,请使用[https://chocolatey.org/install Chocolatey]安装所需的软件包。 <syntaxhighlight lang="powershell" copy style="max-width: fit-content;"> choco install -y php composer </syntaxhighlight> 要加载所需的PHP扩展,请编辑您的php.ini文件,并取消注释以下行。 若要查找php.ini的位置,请运行<code>php --ini</code>,然后查找已加载的配置文件。 <syntaxhighlight lang="ini"> extension:fileinfo extension:intl extension:pdo_sqlite extension:zip extension:sodium </syntaxhighlight> {{TabbedWindowEnd}} <span id="Clone_MediaWiki"></span> == 克隆MediaWiki == 使用[https://git-scm.com/book/en/v2/Getting-Started-Installing-Git Git]克隆MediaWiki核心存储库和默认皮肤。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> git clone https://gerrit.wikimedia.org/r/mediawiki/core.git mediawiki git clone https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git mediawiki/skins/Vector cd mediawiki </syntaxhighlight> 克隆MediaWiki需要几分钟时间。 在您等待期间,如果您还没有一个维基媒体开发者帐户,且有計畫要建立或分享補丁,您可以點擊{{ll|Developer account|這裡}}以创建维基媒体开发者帐户。 <span id="Install_dependencies"></span> == 安装依赖 == 在MediaWiki的根目录中,使用Composer安装MediaWiki的依赖项。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> composer update </syntaxhighlight> <span id="Install_MediaWiki"></span> == 安装MediaWiki == 使用PHP内置的SQLite数据库安装MediaWiki。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> composer mw-install:sqlite </syntaxhighlight> <span id="Start_server"></span> == 启动服务器 == 启动PHP的内置Web服务器,并在浏览器中打开[http://localhost:4000/ localhost:4000]以查看您的MediaWiki实例。 要以{{ll|Manual:Administrators|管理员}}身份登录,请使用用户名<code>Admin</code>和密码<code>adminpassword</code>。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> composer serve </syntaxhighlight> <span id="Next_steps"></span> == 下一步 == * {{ll|Manual:Code|2=浏览MediaWiki代码库}} – 通过了解入口点和顶级目录来熟悉MediaWiki的核心代码。 * {{ll|Manual:PHP unit testing|2=运行单元测试}} – MediaWiki使用PHPUnit框架对PHP代码进行单元和集成测试。阅读文档以运行测试并查找有关编写测试的信息。 * {{ll|Manual:Extensions|2=安装扩展}} – 添加扩展,例如{{ll|Extension:VisualEditor|可视化编辑器}}和{{ll|Extension:Echo|Echo}},到您的开发环境中。 请参阅{{ll|Manual:Developing extensions}}了解扩展的工作原理。 * {{ll|Manual:How to debug|2=调试你的-{zh-cn:代码;zh-tw:程式碼}-}} – 了解如何使用XDebug配置调试辅助工具,并逐步调试MediaWiki代码。 * {{ll|Gerrit/Tutorial|2=提交补丁}} – 探索{{ll|good first bugs}}和{{ll|Gerrit/Tutorial#Configure Git|配置SSH访问权限}}到维基媒体Gerrit提交补丁。 [[Category:Development environments{{#translation:}}]] qrebrzngfzg2r8ki8rv1wmrclk60bue 8365136 8365134 2026-05-04T11:36:15Z Peterxy12 18072041 8365136 wikitext text/x-wiki <languages/> {{InstallationNav}} 本页是使用PHP和Composer为MediaWiki设置本地开发的'''快速入门'''指南。 {{note|1=此工作流仅适用于本地开发。 要为公共网站提供服务,请参阅{{ll|Manual:Installation requirements}}。}} {{TOC|limit=2}} <span id="Install_prerequisites"></span> == 安装前置条件 == <span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki's master branch requires {{ll|Compatibility#PHP|PHP 8.3.0+}} and Composer 2.</span> {{void|1=MediaWiki需要[[w:zh:PHP|PHP]] {{MW stable php requirement}}+和[[w:zh:Composer_(軟體)|Composer]] 2。}} {{TabbedWindowBegin}} === Linux === 在Ubuntu 24+或Debian 13+上,使用[[w:zh:APT|APT]]。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> sudo apt install php php-intl php-mbstring php-xml php-apcu php-curl php-sqlite3 composer </syntaxhighlight> 在Fedora 40+上,使用[[w:zh:DNF (软件)|DNF]]。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> sudo dnf install php composer </syntaxhighlight> 在Arch Linux上,使用[[w:zh:pacman|pacman]]安装所需的软件包。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> sudo pacman -S php composer </syntaxhighlight> === Mac === 使用[https://brew.sh/ Homebrew]安装所需的软件包。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> brew install php@8.5 composer brew link --overwrite php@8.5 </syntaxhighlight> 如果以下命令成功执行,则应显示PHP版本。 如果失败,可能是因为您的$PATH未配置,以从brew查找命令。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> php -v </syntaxhighlight> === Windows === 您可以选择使用[https://learn.microsoft.com/en-us/windows/wsl/about 适用于Linux的Windows子系统]并按照本页的Linux说明进行操作。 或者,要直接在Windows上安装MediaWiki,请使用[https://chocolatey.org/install Chocolatey]安装所需的软件包。 <syntaxhighlight lang="powershell" copy style="max-width: fit-content;"> choco install -y php composer </syntaxhighlight> 要加载所需的PHP扩展,请编辑您的php.ini文件,并取消注释以下行。 若要查找php.ini的位置,请运行<code>php --ini</code>,然后查找已加载的配置文件。 <syntaxhighlight lang="ini"> extension:fileinfo extension:intl extension:pdo_sqlite extension:zip extension:sodium </syntaxhighlight> {{TabbedWindowEnd}} <span id="Clone_MediaWiki"></span> == 克隆MediaWiki == 使用[https://git-scm.com/book/en/v2/Getting-Started-Installing-Git Git]克隆MediaWiki核心存储库和默认皮肤。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> git clone https://gerrit.wikimedia.org/r/mediawiki/core.git mediawiki git clone https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git mediawiki/skins/Vector cd mediawiki </syntaxhighlight> 克隆MediaWiki需要几分钟时间。 在您等待期间,如果您还没有一个维基媒体开发者帐户,且有計畫要建立或分享補丁,您可以點擊{{ll|Developer account|這裡}}以创建维基媒体开发者帐户。 <span id="Install_dependencies"></span> == 安装依赖 == 在MediaWiki的根目录中,使用Composer安装MediaWiki的依赖项。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> composer update </syntaxhighlight> <span id="Install_MediaWiki"></span> == 安装MediaWiki == 使用PHP内置的SQLite数据库安装MediaWiki。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> composer mw-install:sqlite </syntaxhighlight> <span id="Start_server"></span> == 启动服务器 == 启动PHP的内置Web服务器,并在浏览器中打开[http://localhost:4000/ localhost:4000]以查看您的MediaWiki实例。 要以{{ll|Manual:Administrators|管理员}}身份登录,请使用用户名<code>Admin</code>和密码<code>adminpassword</code>。 <syntaxhighlight lang="bash" copy style="max-width: fit-content;"> composer serve </syntaxhighlight> <span id="Next_steps"></span> == 下一步 == * {{ll|Manual:Code|2=浏览MediaWiki代码库}} – 通过了解入口点和顶级目录来熟悉MediaWiki的核心代码。 * {{ll|Manual:PHP unit testing|2=运行单元测试}} – MediaWiki使用PHPUnit框架对PHP代码进行单元和集成测试。阅读文档以运行测试并查找有关编写测试的信息。 * {{ll|Manual:Extensions|2=安装扩展}} – 添加扩展,例如{{ll|Extension:VisualEditor|可视化编辑器}}和{{ll|Extension:Echo|Echo}},到您的开发环境中。 请参阅{{ll|Manual:Developing extensions}}了解扩展的工作原理。 * {{ll|Manual:How to debug|2=调试你的-{zh-cn:代码;zh-tw:程式碼}-}} – 了解如何使用XDebug配置调试辅助工具,并逐步调试MediaWiki代码。 * {{ll|Gerrit/Tutorial|2=提交补丁}} – 探索{{ll|good first bugs}}和{{ll|Gerrit/Tutorial#Configure Git|配置SSH访问权限}}到维基媒体Gerrit提交补丁。 [[Category:Development environments{{#translation:}}]] 4hf66866xpmeh80pa7jh5x92mteb2e1 Translations:Local development quickstart/5/zh 1198 1979340 8365133 7783263 2026-05-04T11:36:06Z Peterxy12 18072041 8365133 wikitext text/x-wiki 在Ubuntu $1+或Debian $2+上,使用[[w:zh:APT|APT]]。 lchk66myoj2p8p8uz7llmku3r0e814r Translations:Local development quickstart/7/zh 1198 1979342 8365135 7783265 2026-05-04T11:36:14Z Peterxy12 18072041 8365135 wikitext text/x-wiki 在Fedora $1+上,使用[[w:zh:DNF (软件)|DNF]]。 4lhumggp4kn6h1h09ebb3t028uile8m Extension:WhoIsWatching/ha 102 1979910 8364410 6771229 2026-05-03T14:58:54Z FuzzyBot 451990 Updating to match new version of source page 8364410 wikitext text/x-wiki <languages/> {{Extension |name = Who Is Watching |status = stable |type1 = special |type2 = database |type3 = parser function |author = * [[User:Gri6507|Paul Grinberg]], * [[User:Siebrand|Siebrand Mazeland]], * [[User:MarkAHershberger|Mark Hershberger]] |image = |license = GPL-2.0-only |version = 0.13.0 |update = 2019-08-04 |mediawiki = 1.43+ |download = {{WikimediaDownload}} |readme = [https://github.com/wikimedia/mediawiki-extensions-WhoIsWatching/blob/master/README.mediawiki README.mediawiki] |changelog = |compatibility policy = master |description = Find out who is watching a particular page, and add others to watchlist for that page. |parameters= * $whoiswatching_nametype * $whoiswatching_allowaddingpeople * $whoiswatching_showifzero * $whoiswatching_showwatchingusers * $whoiswatching_maxPicklistUsers |rights = * addpagetoanywatchlist * seepagewatchers |example = [http://ec.europa.eu/eurostat/statistics-explained/index.php?title=Special:WhoIsWatching&ns=&page=Transport_accident_statistics http://ec.europa.eu/eurostat/] |phabricator = MediaWiki-extensions-WhoIsWatching }} <span lang="en" dir="ltr" class="mw-content-ltr">The '''WhoIsWatching''' extension allows to find out who is watching a particular page, and add others to watchlist for that page.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Rationale == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Even though this notion goes against Wikipedia and Wikimedia [[w:Wikipedia:Watchlist#Privacy of watchlists|privacy policy]], some wikis may actually like to see which of its users are watching particular pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This extension provides just such an interface at the bottom of every page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Additionally, this extension has an option to allow any user to add any page to any other user's watch list.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Installation == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Make sure that {{ll|Extension:Echo}} is installed as it is a prerequisite for this extension to work. </div> {{ExtensionInstall |registration=required |localsettings = # $whoiswatching_nametype = "RealName"; # $whoiswatching_allowaddingpeople = false; # $whoiswatching_showifzero = true; # $whoiswatching_showwatchingusers = false; # $whoiswatching_maxPicklistUsers = 10; # $wgGroupPermissions['sysop']['addpagetoanywatchlist'] = true; # $wgGroupPermissions['sysop']['seepagewatchers'] = true; }} <div lang="en" dir="ltr" class="mw-content-ltr"> == Configuration == </div> <span lang="en" dir="ltr" class="mw-content-ltr">You can simply start using the extension without changing anything else.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The only additional configuration that is currently possible for the extension defines how to display the names of the users watching the pages.</span> A cikin <code>SpecialWhoIsWatching.php</code>, akwai <syntaxhighlight lang="php"> # Set the following to either 'UserName' or 'RealName' to change how watching users are displayed. $whoiswatching_nametype = 'RealName'; </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">As the comment implies, depending on the value of this variable, you can display either the real names of the watching users or their wiki usernames.</span> Dalilin da yasa wasu wiki za su so su canza zuwa yanayin 'UserName' shine idan ba sa buƙatar membobinsu su sami ingantaccen suna. <span lang="en" dir="ltr" class="mw-content-ltr">Another configurable option in the extension is the ability to switch on/off the option to allow any user to add any page to any other user's watch list.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done in <code>SpecialWhoIsWatching.php</code>, where there is</span> <syntaxhighlight lang="php"> # Set true if you don't want to use permissions and users are allowed to add to other user's watchlists. $whoiswatching_allowaddingpeople = true; </syntaxhighlight> Hakanan yana yiwuwa a nuna ƙidayar kallon mutane kawai idan adadin ya fi sifili. Ana yin wannan a cikin <code>SpecialWhoIsWatching.php</code>, inda akwai <syntaxhighlight lang="php"> # Set to true if you want people with permission to see 0 if no one is watching the page. $whoiswatching_showifzero = true; </syntaxhighlight> A ƙarshe, sabbin nau'ikan wannan haɓakawa, yayin da muke ƙoƙarin kasancewa masu dacewa da baya, suna ba ku damar amfani da izini maimakon masu canjin duniya. <syntaxhighlight lang="php"> # Set to true if you don't want to use permissions. $whoiswatching_showwatchingusers = true; </syntaxhighlight> Ta hanyar tsoho, masu amfani a cikin rukunin sysop suna da izinin ganin masu kallon shafi da ƙara shafuka zuwa jerin saƙon kowa. Kuna iya ba da waɗannan izini don shiga masu amfani, suma, ko kowace ƙungiya da kuke tunanin tana buƙatar ta. <syntaxhighlight lang="php"> # Give all logged in users full access. $wgGroupPermissions['user']['addpagetoanywatchlist'] = true; $wgGroupPermissions['user']['seepagewatchers'] = true; </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Usage == </div> {{tmpl|0=Wannan kari kuma yana ba da aikin tantancewa <code>{{#whoiswatching:$1}}</code> yana nuna adadin masu amfani da <code>$1</code> da samar da hanyar haɗi zuwa <code>Special:WhoIsWatching/$1</code>. |1=Wasu Shafuka }} Ana iya amfani da wannan tare da fatun baya tallafawa hanyoyin haɗin ƙafa ko don ƙirƙirar hanyar haɗin WhoIsWatching a wani wuri a cikin shafin wiki. <div lang="en" dir="ltr" class="mw-content-ltr"> == Known issues == </div> A karo na farko bayan ƙaddamar da buƙatar cire shafi daga jerin masu amfani, har yanzu ana nuna mai amfani akan fom. Don kewaya wannan an kashe shi kuma an nuna shi tare da ja-in-ja. {{Used by}} [[Category:Notification extensions{{#translation:}}]] [[Category:WatchArticle extensions{{#translation:}}]] [[Category:Watchlist extensions{{#translation:}}]] eemelje7zzg55pxjgoj6rwwttpivfnt Translations:Help:Extension:Translate/Components/104/en 1198 1984950 8364820 6596977 2026-05-04T02:27:20Z FuzzyBot 451990 Importing a new version from external source 8364820 wikitext text/x-wiki Each class that extends the $2 class only needs to implement one method called $1. g3a7srwke307gjlodyyvjp1exvbc2qg Extension:TimedMediaHandler/VideoJS Player/uk 102 1987440 8364372 8363699 2026-05-03T13:12:22Z FuzzyBot 451990 Updating to match new version of source page 8364372 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Скріншот плеєра VideoJS в дії]] Програвач '''VideoJS''' - це відеопрогравач для MediaWiki в проектах Wikimedia. Він заснований на [https://videojs.com/ VideoJS] і має сучасний, швидкий інтерфейс користувача, сумісний із мобільними пристроями та HTML5. <span id="Usage"></span> == Використання == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Приклад відеоплеєра]] [[File:Armstrong Small Step.ogg|thumb|Приклад аудіоплеєра]] Є як аудіо, так і відео плеєр. <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using tab, enter and spacebar keys</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Known issues == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The video player is still in development, but if you find any problems, please report these on the [[Extension_talk:TimedMediaHandler/VideoJS Player|talk page]] or file them in [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 3ajm3jzxlcdy65d4ubv2vcrzmiggxj2 8364787 8364372 2026-05-03T23:14:46Z FuzzyBot 451990 Updating to match new version of source page 8364787 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|Скріншот плеєра VideoJS в дії]] Програвач '''VideoJS''' - це відеопрогравач для MediaWiki в проектах Wikimedia. Він заснований на [https://videojs.com/ VideoJS] і має сучасний, швидкий інтерфейс користувача, сумісний із мобільними пристроями та HTML5. <span id="Usage"></span> == Використання == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|Приклад відеоплеєра]] [[File:Armstrong Small Step.ogg|thumb|Приклад аудіоплеєра]] Є як аудіо, так і відео плеєр. <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Known issues == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The video player is still in development, but if you find any problems, please report these on the [[Extension_talk:TimedMediaHandler/VideoJS Player|talk page]] or file them in [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> rhd29uc90u6sm5stfvz683qlulhshen Reading/Web/Accessibility for reading/Reporting/en.wikipedia.org 0 1994575 8364747 8364226 2026-05-03T21:23:01Z MoreHans 18367925 /* Yajna dark mode error */ new section 8364747 wikitext text/x-wiki __NEWSECTIONLINK__ {{Auto archiving |archive = Reading/Web/Accessibility for reading/Reporting/en.wikipedia.org/Archive %(counter)d |algo = old(30d) |counter = 2 |maxarchivesize = 250K |minthreadsleft = 5 |minthreadstoarchive = 5 |archiveheader = {{talk archive}} }}<!-- --> {{Archives}}{{-}}{{Center|'''[[Special:NewSection/{{PAGENAME}}|CREATE A REPORT]]'''}} Key: The following emojis in the title mean someone has looked at the feedback and worked out what to do with it. {| class="wikitable" |+ Caption ! Icon !! Meaning |- | 📢 || User is providing general feedback and it should be reviewed by designer/PM. If the template is legible in dark mode (just bright!) you can also consider it feedback and use this emoji. For popular templates, please consider adding a comment on the talk page when adding this emoji. |- |❓ |Report was unclear and we don't know what to do with it. |- |✅ |This has been fixed or reported on wiki. |- |🐛 |This is tracked in a bug or a talk page comment (please use the Tracked template). |- |🤖 |Concerns a gadget |} == [https://en.wikipedia.org/wiki/Nantucket_series Nantucket series] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' tables in the novels section are unreadable in dark mode. Same issue as with the page for the emberverse series(?) --[[Special:Contributions/&#126;2026-15344-86|&#126;2026-15344-86]] ([[User talk:&#126;2026-15344-86|talk]]) 05:45, 11 March 2026 (UTC) :Both problems have been addressed by [[User:TheDJ|TheDJ]]. Thanks to him for fixing this! [[User:A Wondrous Raven|A Wondrous Raven]] ([[User talk:A Wondrous Raven|talk]]) 19:42, 13 April 2026 (UTC) == [https://en.wikipedia.org/wiki/House_of_Commons_of_the_United_Kingdom House of Commons of the United Kingdom] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' The House of Commons logo is in a lighter than normal colour == [https://en.wikipedia.org/wiki/Foje Foje] dark mode error == The Effect that the dark mode has on the wikipedia Logo and name in an article: The Wikipedia Logo is barely readable with the Dark mode on when it is in the Top-Left of the screen. excample: "i go to an article like lets say 'Foje' (A late nineteen-hundreds musical band) and when i look at the top-Left of the article i see a text that is barely possible to read, turns out when i look VERY closely i see its the Wikipedia logo and Name!" but the light mode also has slight problems which i will not go into. : Not a dark mode error, that's just the icon and the text below being small, possibly because of the skin you're using. Looks OK with [https://en.wikipedia.org/wiki/Foje?useskin=monobook Monobook] for example. --[[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 05:54, 31 March 2026 (UTC) == [https://en.wikipedia.org/wiki/Hexose Hexose] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' [[Hexose]] Top section in the svg images which display fully white / the black color of the svg is not reversed. --[[Special:Contributions/&#126;2026-19839-73|&#126;2026-19839-73]] ([[User talk:&#126;2026-19839-73|talk]]) 00:28, 31 March 2026 (UTC) :Fixed. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 05:33, 31 March 2026 (UTC) ::Shouldn't all images either be reversed or not, though? [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 10:32, 4 April 2026 (UTC) :::No, only some of them need to be inverted. One of the inherent problems with (popular) wikis is that images are not all created the same, so there's no "one size fits all" rule and inconsistencies are bound to happen. Sites with no distinction between light and dark mode have it easier though :) [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 10:52, 4 April 2026 (UTC) ::::Of course, and I should've looked at what exactly did you change/fix. Better question, I guess: Why not / wouldn't it be possible to make them dark? [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 11:00, 4 April 2026 (UTC) :::::[[Recommendations_for_night_mode_compatibility_on_Wikimedia_wikis#When_skin-invert_does_not_work|This link]] explains it a bit, though this is a question for a developer. I guess it's not easy to programmatically darken everything properly, hence it's up to editors to decide when (not) to use the invert feature. Sometimes you may even want to use different images for each mode and give control to the reader, hence in enwiki Matrix created [[w:Template:Dark mode switch]]. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 12:01, 4 April 2026 (UTC) ::::::My question was more to the style of: Could you please make all images in the article "dark"? If not, why? [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 17:33, 23 April 2026 (UTC) == [https://en.wikipedia.org/wiki/Three_Principles_of_the_People Three Principles of the People] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' In the infoboxes, when switched to dark mode, the color stripes are rendered as dark gray, the same color as the rest of the infobox, as well as texts such as ''other Mandarin'' or ''Yue: Cantonese'' to become unreadable in dark mode. --[[User:&#45;25FJ25|&#45;25FJ25]] ([[User talk:&#45;25FJ25|talk]]) 17:10, 31 March 2026 (UTC) == [[:en:Template:Infobox_legislature|Template:Infobox legislature]] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' In the infobox, the total number of seats being black on a dark grey background makes the visibility not great. --[[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 07:21, 1 April 2026 (UTC) :Isn't this a problem with [[w:template:Infobox legislature|the infobox template]], not just the article? [[User:A Wondrous Raven|A Wondrous Raven]] ([[User talk:A Wondrous Raven|talk]]) 18:21, 14 April 2026 (UTC) ::It appears that it is, and that I made an oopsie. Thank you! ::<small>(Changed "United Nations Economic and Social Council" to "Template:Infobox legislature" in the title.)</small> [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 02:28, 16 April 2026 (UTC) == ✅[https://en.wikipedia.org/wiki/Wikipedia:Deceased_Wikipedians/Invite Deceased Wikipedians/Invite] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' The template does not conform to dark mode. --[[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 17:47, 3 April 2026 (UTC) :It does now. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 18:09, 3 April 2026 (UTC) ::Thanks! [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 10:00, 4 April 2026 (UTC) == ✅[https://en.wikipedia.org/wiki/Ylide Ylide] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' --[[User:11pro12|11pro12]] ([[User talk:11pro12|talk]]) 02:31, 4 April 2026 (UTC) :Fixed. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 08:59, 4 April 2026 (UTC) == [https://en.wikipedia.org/wiki/H1_antagonist H1 antagonist] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' The image https://upload.wikimedia.org/wikipedia/commons/a/a1/Antihistamine.svg in the #Common_structural_features section has so little contrast with the background it's impossible to read. --[[User:NyxWhiteFang|NyxWhiteFang]] ([[User talk:NyxWhiteFang|talk]]) 14:07, 6 April 2026 (UTC) :Fixed. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 14:21, 6 April 2026 (UTC) == [https://en.wikipedia.org/wiki/Finland–NATO_relations Finland–NATO relations] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''It doesn't remember that I select dark mode permanently and it's annoying that I have to occasionally keep switching it. I use safari on my MacBook Air 2025''' --[[Special:Contributions/&#126;2026-21883-77|&#126;2026-21883-77]] ([[User talk:&#126;2026-21883-77|talk]]) 09:37, 9 April 2026 (UTC) :@[[User:~2026-21883-77|~2026-21883-77]] this would happen if you use private browsing mode, disable cookie storage (/LocalStorage) or use some sort of privacy protection tool to prevent cookiestorage. If you make an account, your preference is saved server side and you should not experience this kind of problem. —[[User:TheDJ|Th<span style="color: green">e</span>DJ (Not WMF)]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 13:35, 10 April 2026 (UTC) == ✅[https://en.wikipedia.org/wiki/1,3-Propane_sultone 1,3-Propane sultone] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' The file https://upload.wikimedia.org/wikipedia/commons/4/4a/Propane-1%2C3-sultone_hydrolysis.svg in the #Reactions section isn't inverted, making it invisible in dark mode. --[[User:NyxWhiteFang|NyxWhiteFang]] ([[User talk:NyxWhiteFang|talk]]) 08:42, 13 April 2026 (UTC) :done —[[User:TheDJ|Th<span style="color: green">e</span>DJ (Not WMF)]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 09:53, 14 April 2026 (UTC) == [https://en.wikipedia.org/wiki/History_of_molecular_theory History of molecular theory] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' --[[User:11pro12|11pro12]] ([[User talk:11pro12|talk]]) 12:04, 14 April 2026 (UTC) :@[[User:11pro12|11pro12]] done.. i think. you didn't really describe what problem you experienced, so i had to guess. —[[User:TheDJ|Th<span style="color: green">e</span>DJ (Not WMF)]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 10:41, 15 April 2026 (UTC) == [https://en.wikipedia.org/wiki/Wikipedia:Talk_page_templates Talk page templates] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' on the page concerned, (talk page templates) the message boxes appear quite illegible, because they are quite dark in dark mode, and the text is still dark as well, unlike on the present (mediawiki) page where the issue does not appear. I am not certain from which angle this should be fixed, but if you do sort it, could you please ping me so I can see how it is done? I would like to know so I can try to help in the future. Thanks in advance, and happy editing. --[[User:Slomo666|Slomo666]] ([[User talk:Slomo666|talk]]) 14:01, 14 April 2026 (UTC) :Fixed. You can check the [[w:Special:Diff/1348835689|history]] to see what I changed. :Anyway this is the most simple example of fixing issues with dark mode: just avoid forcing a fixed background color, and if you need any it is best to specify one of the [https://doc.wikimedia.org/codex/latest/design-tokens/color.html Codex design tokens]. It is also important to [[Recommendations for night mode compatibility on Wikimedia wikis#Always define color when defining background|specify a foreground color]] whenever you use a given background color in order to avoid [[Help:Lint_errors/night-mode-unaware-background-color|lint errors]] and visual issues related to dark mode. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 14:39, 14 April 2026 (UTC) ::Thanks a million. I thought it might be something like this, but I was not sure since I saw some stuff about those message boxes that specified a border- and background colour: {{tq|The following standards of design have been chosen: ::* Background colour of #F8EABA {{colorsample|#F8EABA}} and border colour (1px solid) is #C0C090 {{colorsample|#C0C090}}. If the message is more important or is related to deletion, a yellow, orange, or red border activated by the "style", "content", "delete", or "speedy" classes can be used.}} ::So I was not sure what to do. (PS: I just noticed those prescribed colours are different from the one you removed. If I had paid more attention, I might not have needed to ask you) [[User:Slomo666|Slomo666]] ([[User talk:Slomo666|talk]]) 18:16, 14 April 2026 (UTC) == [https://en.wikipedia.org/wiki/2025_NBA_playoffs 2025 NBA playoffs] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' background-color: #eee hard-coded for tables and parent div. --[[Special:Contributions/&#126;2026-23017-78|&#126;2026-23017-78]] ([[User talk:&#126;2026-23017-78|talk]]) 17:54, 14 April 2026 (UTC) == [https://en.wikipedia.org/wiki/Spanish_Prisoner Spanish Prisoner] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''wikipedia keeps randomly reverting to light mode even though i keep selecting dark mode and my os is dark mode by default.''' --[[Special:Contributions/&#126;2026-23333-35|&#126;2026-23333-35]] ([[User talk:&#126;2026-23333-35|talk]]) 05:31, 15 April 2026 (UTC) :See [[#Finland–NATO_relations_dark_mode_error|above]]. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 10:29, 16 April 2026 (UTC) == [https://en.wikipedia.org/wiki/Democratic_Progressive_Party_(Malawi) Democratic Progressive Party (Malawi)] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' --[[Special:Contributions/&#126;2026-23147-19|&#126;2026-23147-19]] ([[User talk:&#126;2026-23147-19|talk]]) 11:17, 15 April 2026 (UTC) 0gfgjgfipy == [https://en.wikipedia.org/wiki/Xylem Xylem] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' Some text on an image was hide page on zelem cells --[[Special:Contributions/&#126;2026-23282-41|&#126;2026-23282-41]] ([[User talk:&#126;2026-23282-41|talk]]) 09:21, 16 April 2026 (UTC) == [https://en.wikipedia.org/wiki/2026_Stanley_Cup_playoffs 2026 Stanley Cup playoffs] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' Tables in the First round section for all teams are unreadable in dark mode. --[[User:Jaxx28|Jaxx28]] ([[User talk:Jaxx28|talk]]) 18:22, 21 April 2026 (UTC) == [https://en.wikipedia.org/wiki/Virtua_Fighter_(video_game) Virtua Fighter (video game)] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' --[[User:Marcmy|Marcmy]] ([[User talk:Marcmy|talk]]) 09:35, 22 April 2026 (UTC) In the section under Reception, in the collapsable table that shows review scores, the text is dark gray on the dark background while using official dark mode. My dark mode extension is disabled for the site. :@[[User:Marcmy|Marcmy]] [https://en.wikipedia.org/w/index.php?title=Virtua_Fighter_(video_game)&diff=prev&oldid=1350529742 fixed] —[[User:TheDJ|Th<span style="color: green">e</span>DJ (Not WMF)]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 12:49, 22 April 2026 (UTC) [[File:Dark mode problem example.png|thumb]] == [https://en.wikipedia.org/wiki/Wikipedia:RedWarn RedWarn] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''The picture at WP:REDWARN merges into the background (black on black)''' --[[User:Jacksonvil|Jacksonvil]] ([[User talk:Jacksonvil|talk]]) 11:29, 23 April 2026 (UTC) == [https://en.wikipedia.org/wiki/2026_NBA_playoffs 2026 NBA playoffs] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' [https://en.wikipedia.org/wiki/2026_NBA_playoffs#(1)_Detroit_Pistons_vs._(8)_Orlando_Magic This instance] of [[:en:Template:Basketballbox|Template:Basketballbox]] outputs a bright white background, with roughly half the text also white. The template talk page was made aware of this issue in 2024; however, a solution has not been found since. --[[User:Andrew11374265|Andrew11374265]] ([[User talk:Andrew11374265|talk]]) 22:08, 23 April 2026 (UTC) == [https://en.wikipedia.org/wiki/Yakut_scripts Yakut scripts] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' The L with descender letter image in the section New Turkic alphabet blends into the background, making it unreadable in dark mode (obviously fails the contrast test). --<span style="font-family:Lentariso">[[User:GeniusWorkbench4622|Genius]][[User_talk:GeniusWorkbench4622|Workbench]][[Special:Contributions/GeniusWorkbench4622|4622]]</span> 18:33, 27 April 2026 (UTC) == [https://en.wikipedia.org/wiki/Nitrate Nitrate] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' resonance structures not showing --[[User:11pro12|11pro12]] ([[User talk:11pro12|talk]]) 08:30, 28 April 2026 (UTC) == [https://en.wikipedia.org/wiki/Archaic_Greek_alphabets Archaic Greek alphabets] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' The table, "Regional Greek alphabets", contains special cells with light background colors, most notably for the Xi, Chi and Psi columns, but also sections of the Eta and Omega columns where cells have a light yellow background color. The Latin glyphs in those light-colored cells, such as "(" and ")", are rendered in a dark font color even in dark mode, so they're fairly accessible, but the Greek glyphs are rendered in white in dark mode, making them very difficult to read against the light background, especially where light yellow is used. This may be a problem caused by the background color rather than the text color. If a low opacity tint was used as a filter over the cells' theme-based background color, that would allow for the text to conform to the rest of the theme color rules without needing to specify two different tones for each background color. --[[User:Jgaehring|Jgaehring]] ([[User talk:Jgaehring|talk]]) 00:27, 1 May 2026 (UTC) == [https://en.wikipedia.org/wiki/Arapaima Arapaima] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' Dark Mode makes it too dark. --[[Special:Contributions/&#126;2026-26509-59|&#126;2026-26509-59]] ([[User talk:&#126;2026-26509-59|talk]]) 18:55, 1 May 2026 (UTC) == [https://en.wikipedia.org/wiki/Template:Audio_formats Audio formats] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' In almost every cell, there is the too high chance that some of the text which is not formatted is too hard to look into without a text/objects selection. First noticed in [https://en.wikipedia.org/wiki/Magnetic-tape_data_storage Magnetic-tape data storage]. — [[User:Fonibak|Fonibak]] ([[User talk:Fonibak|talk]]) 10:36, 3 May 2026 (UTC) == [https://en.wikipedia.org/wiki/Yajna Yajna] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' There are two boxes of text in the History section of the Yanja article. They are quotes from Vedic texts describing the practice. The text box is transparent, so the background is dark. The text is almost the same color as the background, making reading extremely difficult. There is also a table under the Types section describing the various types of ritual sacrifice which suffers from the same issue. --[[User:MoreHans|MoreHans]] ([[User talk:MoreHans|talk]]) 21:23, 3 May 2026 (UTC) 3ye08b7titej8nj7gkdy79kchgg9hy0 Extension:PageTriage/uk 102 1998353 8365075 8157896 2026-05-04T07:51:39Z FuzzyBot 451990 Updating to match new version of source page 8365075 wikitext text/x-wiki <languages /> {{Extension |templatemode = |status = stable |type1 = special |type2 = interface |newhook1 = |newhook2 = |username = |author = [[User:Kaldari|Ryan Kaldari]], [[User:Bsitu|Benny Situ]] |description = Полегшує перегляд і затвердження нових сторінок |image = Extension-PageTriage Special-NewPagesFeed Screenshot.png |imagesize = 300 |version = |update = |version preview = |update preview = |compatibility policy = rel |mediawiki = |php = |composer = |table1 = pagetriage_page |table2 = pagetriage_page_tags |table3 = pagetriage_tags |download = {{WikimediaDownload|phab=EPTR}} |readme = |changelog = |example = [[wikipedia:Special:NewPagesFeed | Special:NewPagesFeed on the English Wikipedia]] |namespace = |tags = |compatibility = |bugzilla = |phabricator = PageTriage |vagrant-role = }} '''PageTriage''' — розширення, що спрямоване на забезпечення багатого інтерфейсу для відсіву новостворених сторінок. Воно призначене замінити основну функцію ''патрулювання нових сторінок'', додаючи додаткову функціональність для перегляду, позначення та поліпшення нових статей. Воно додає сторінку Спеціальна:Стрічка_нових_сторінок, а також панель інструментів кураторства сторінок, до нових сторінок для користувачів із дозволом «патрульний». Його розробила [[Wikimedia_Features_engineering|Features Engineering team]] Фонду Вікімедіа. Детальніше див. «[[Page Curation|Кураторство сторінок]]». Важливо відзначити, що частина конфігурації та коду є специфічною для робочих процесів англомовної Вікіпедії, і те, як розширення сконструйоване зараз, майже унеможливлює його інтернаціоналізацію. (див. [[Phabricator:T50552]]). [[File:Page-Curation-Video.ogv|thumb|An overview of the page curation feature. The interface in the video is outdated but the content remains useful.]] <span id="Installation"></span> == Встановлення == [[File:PageTriage-ListView-Whole.png|thumb|Screenshot of Special:NewPagesFeed as it appeared in 2012]] {{ExtensionInstall |db-update=yes |registration=required |localsettings= }} == Checking for successful install == Щоб побачити роботу розширення: * Створіть нову сторінку, що містить лише кілька речень тексту, як анонімний користувач. * Відвідайте Спеціальна:Стрічка_нових_сторінок Повинна з'явитися нова сторінка з позначками «{{int|pagetriage-no-categories}}», «{{int|pagetriage-orphan}}» тощо. Щоб побачити панель інструментів кураторства сторінок: * Увійдіть як користувач із дозволом «адміністратор», або додайте групу з дозволом «[[Special:MyLanguage/Help:Patrolled_edits|патрульний]]», і додайте котрогось користувача до цієї групи, й увійдіть як цей користувач. * Відвідайте Спеціальна:Стрічка_нових_сторінок * Тепер ви повинні побачити кнопку «{{int|pagetriage-triage}}» поруч із новою сторінкою. * Натисніть на неї, і ви повинні побачити панель інструментів кураторства сторінок на новій сторінці. <span id="Advanced_installation"></span> == Розширене встановлення == <span id="Additional_extensions"></span> === Додаткові розширення === Для повної функціональності вам також потрібно встановити деякі додаткові розширення, хоча PageTriage працює без них. * {{ll|Extension:Echo|Echo}} - Allows users to receive notifications for things like when an article they created has been marked as reviewed. * {{ll|Extension:ORES|ORES}} - In Special:NewPagesFeed, allows filtering by "predicted class" (<code>articlequality</code>: stub, start, c-class, b-class, good, featured) and "potential issues" (<code>draftquality</code>: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because <code>draftquality</code> needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's [[git:mediawiki/extensions/ORES/+/8bd39f26548d58fa8bf6765e1c23f5e3086f1cd4/extension.json#225|extension.json file]]. * {{ll|Extension:WikiLove|WikiLove}} - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily. === Enabling draft namespace === By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php <syntaxhighlight lang="php" copy> // These three settings are optional, and will enable the Articles-for-Creation mode. $wgPageTriageDraftNamespaceId = 118; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft'; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk'; </syntaxhighlight> When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed. By default pages edited in the draft namespace will be "unsubmitted". Articles in the draft namespace can be submitted for review by adding <nowiki>[[Category:Pending_AfC_submissions]]</nowiki> to the draft page. At which point they will show up under "awaiting review". Note the toolbar controlled by the configuration variable '''$wgPageTriageEnableCurationToolbar''' does not show up in the draft namespace. === Cron jobs === To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: <code>cron/updatePageTriageQueue.php</code> == Manual testing == === Special:NewPagesFeed -> Articles for Creation === * Enable draftspace by following the directions above in the section [[#Enabling draft namespace]]. * In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories: ** Unsubmitted: (no category) ** Awaiting review: Category:Pending AfC submissions ** Under review: Category:Pending AfC submissions being reviewed now ** Declined: Category:Declined AfC submissions Note: The Page Curation toolbar does not display for drafts. === ORES === Enwiki has the [[Extension:ORES|ORES extension]] installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure: * Clone Extension:ORES and add <code>wfLoadExtension( 'ORES' );</code> in <code>LocalSettings.php</code> * Add this to <code>LocalSettings.php</code> <syntaxhighlight lang="php" copy> $wgPageTriageEnableOresFilters = true; $wgOresWikiId = 'enwiki'; $wgOresModels = [ 'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ], 'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'sources' => [ 1 ] ] ]; </syntaxhighlight> * Run <code>php maintenance/run.php ./extensions/ORES/maintenance/BackfillPageTriageQueue.php</code> == Determining if a page is reviewed == === Status codes === There are status codes used to track whether a page is reviewed or not. These are the values given when you query <code>patrol_status</code>, <code>ptrp_reviewed</code>, and <code>ptrl_reviewed</code>: * Unreviewed ** 0 - unreviewed * Reviewed ** 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar) ** 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page) ** 3 - autopatrolled (someone with the <code>autopatrol</code> user right created the page, or moved the page from a non-tracked namespace to a tracked namespace) ** no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job) === Via the API === To check the review status of pages using an API query, you can use <code>api.php?action=query&prop=isreviewed</code>. Sample JavaScript code:<syntaxhighlight lang="js" copy> /** * @param {number} pageID The page ID number. A positive number with no commas. */ async isReviewed(pageID) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', pageids: pageID, } ); return response.query.pages[0].isreviewed; } /** * @param {string} title One title. Can include namespace. Example: User:Test */ async function isReviewed(title) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', titles: title, } ); return response.query.pages[0].isreviewed; } </syntaxhighlight> === Via SQL === To check the review status of pages using an SQL query, you need to query the <code>{{ll|Extension:PageTriage/pagetriage page table|pagetriage_page}}</code> table and the <code>ptrp_reviewed</code> field. Follow the directions in [[#Status codes]] to interpret the values of this field. <syntaxhighlight lang="sql" copy> /* By page_id */ SELECT ptrp_reviewed FROM pagetriage_page WHERE ptrp_page_id = 71318376 /* By page_title and page_namespace */ SELECT ptrp_reviewed FROM pagetriage_page JOIN page ON page_id = ptrp_page_id WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces AND page_namespace = 0 </syntaxhighlight> == SQL == === SQL tables === {| class="wikitable" |+ !Name !Prefix !Description !Old entry deletion strategy !Service classes (when refactoring, SQL queries should be moved to here) !Data classes |- |[[Extension:PageTriage/pagetriage page table|pagetriage_page]] |ptrp_ |The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query <code>ptrp_reviewed > 0</code> in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. |All articles deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. |QueueManager, QueueLookup |QueueRecord |- |[[Extension:PageTriage/pagetriage page tags table|pagetriage_page_tags]] |ptrpt_ |Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the <code>pagetriage_tags</code> table. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. |All article metadata deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status. | | |- |[[Extension:PageTriage/pagetriage tags table|pagetriage_tags]] |ptrt_ |A dictionary of page_tags, and their corresponding ID number. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. | | | |} === pagetriage_page_tags === <code>pagetriage_page_tags</code> data is updated by calling <code>ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata()</code>. This is called in the following hooks: * <code>onPageMoveComplete()</code> - runs when moving a page * <code>onLinksUpdateComplete()</code> - runs when saving an edit * <code>onMarkPatrolledComplete()</code> - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user. ==== List of tags ==== The <code>pagetriage_page_tags</code> are as follows: * Author information ** user_id ** user_name - there's a filter where you can type in their username ** user_editcount ** user_creation_date ** user_autoconfirmed ** user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with <code>MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()</code> ** user_bot ** user_block_status * Deletion tags - will display a black trash can icon if marked for deletion ** afd_status ** blp_prod_status ** csd_status ** prod_status * Special:NewPagesFeed red warning text ** category_count - No categories ** linkcount - Orphan ** reference - No citations ** recreated - Previously deleted ** user_block_status - Blocked * Page information ** page_len - size of article, in bytes ** rev_count - number of edits to the article ** snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article * afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined * copyvio - latest revision ID that has been tagged as a likely copyright violation, if any == PHP == <span id="Extension_configuration"></span> === Конфігурування розширення === Розширення засноване на праві «патрульний». Докладніше про конфігурування патрулювання див. {{ll|Manual:Patrolling}}. Наступні конфігураційні змінні можна задати у вашому файлі LocalSettings.php: {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">Variable</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Default</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> |- | {{phpi|$wgPageTriageEnableCurationToolbar}} | {{phpi|true}} | Встановіть у хибність для вимкнення [[Special:MyLanguage/Page Curation#User Experience: Curation Toolbar|панелі інструментів кураторства]] |- | {{phpi|$wgPageTriageInfiniteScrolling}} | {{phpi|true}} | Чи використовувати нескінчене прокручування у стрічці нових сторінок |- | {{phpi|$wgPageTriageMaxAge}} |90 | The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true). |- | {{phpi|$wgPageTriageNamespaces}} |NS_MAIN | The namespaces that PageTriage is active in. |- | {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} | {{phpi|false}} | Встановіть це в істину, якщо нові, непереглянуті статті повинні встановлюватися в noindex. Іншими словами, якщо вони не повинні індексуватися пошуковими системами до їх перегляду. |} Повний список конфігураційних змінних див. у [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/extension.json#698|extension.json]]. === API === PageTriage додає наступні кінцеві точки API, якими можна користуватися: {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">API</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Triggering action</span> |- |pagetriageaction | Позначає сторінку переглянутою чи непереглянутою, та журналює дію в Special:Log. |Write | * Using the Page Curation toolbar to mark a page as reviewed * Using the Page Curation toolbar to mark a page as unreviewed |- |pagetriagelist | Видобуває список сторінок у черзі, а також метадані кожної сторінки, включно зі статусом їхнього перегляду. To retrieve one page, you must provide the <code>page_id</code>. To provide multiple pages, you must select one of <code>showreviewed</code>/<code>showunreviewed</code>, and one of <code>showredirs</code>/<code>showdeleted</code>/<code>showothers</code>, or no pages will be returned. |Read | * Loading the Page Curation toolbar (automatically loaded if you have the <code>patrol</code> userright and view a page that is unpatrolled or recently patrolled) * Viewing Special:NewPagesFeed (provides the list of articles) |- |pagetriagestats | Видобуває статистики про кількість сторінок у черзі для використання в заголовку Спеціальна:Стрічка_нових_сторінок. |Read | * Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer) |- |pagetriagetagcopyvio |Mark an article as a potential copyright violation, and logs the action in Special:Log. |Write | * Marking as a copyright violation by a bot with the <code>copyviobot</code> userright |- |pagetriagetagging | Додає шаблони упорядкування чи вилучення на сторінку, та журналює дію в Special:Log. |Write | * Using the Page Curation toolbar to place a maintenance tag on an article * Using the Page Curation toolbar to place a deletion tag on an article |} === Special:Log === The following logs are created by the extension: {| class="wikitable" |+ !Special:Log !<code>log_type</code> !<code>log_action</code> !Description !Notes |- |Page curation log |pagetriage-curation |delete, enqueue, reviewed, tag, unreviewed |Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed | |- |Potential copyright violation log |pagetriage-copyvio |insert |Allows a bot to log potential copyright violations |Doesn't display unless you set {{phpi|$wgPageTriageEnableCopyvio}} to true |} <span id="Entry_points"></span> === Точки входу === Риси розширення можуть бути викликані різними діями: {| class="wikitable" |+ !Entry point type !File location !Notes |- |5 APIs |includes/Api/* | |- |1 special page |includes/SpecialNewPagesFeed.php | |- |20 hooks | * includes/Hooks.php * includes/HookHandlers/UndeleteHookHandler.php * includes/HookHandlers/Schema.php | |- |1 cron job |cron/updatePageTriageQueue.php |runs every 48 hours |- |7 maintenance scripts |maintenance/* |need to be run manually |} Here is a list of some actions and the corresponding entry points they trigger: {| class="wikitable" |+ !Action !Entry points used |- |View Main page | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() |- |Save an edit to the Main page | * Hooks.php -> onRevisionFromEditComplete() * Hooks.php -> onPageSaveComplete() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onLinksUpdateComplete() |- |Type in search box, triggering search suggestions | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onApiMain__moduleManager() |- |View Special:NewPagesFeed | * Hooks.php -> onBeforeCreateEchoEvent() * SpecialNewPagesFeed * ApiPageTriageStats * ApiPageTriageList |- |View an unreviewed article while logged in and having the <code>patrol</code> permission. | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onResourceLoaderGetConfigVars() * Hooks.php -> onDefinedTags() * Hooks.php -> onApiMain__moduleManager() * ApiPageTriageList (by <code>page_id</code>) |} ==== Hooks ==== {| class="wikitable" |+ !File !Group !Hook !Actions it performs |- | rowspan="18" |Hooks.php |Move page |[[Manual:Hooks/PageMoveComplete|onPageMoveComplete]] |Changes patrolled status, updates cache, updates metadata in <code>pagetriage_page_tags</code> table. |- | rowspan="3" |Edit page |[[Manual:Hooks/RevisionFromEditComplete|onRevisionFromEditComplete]] |Handles marking '''redirects that flip to articles''' as unreviewed. [[Deferred updates|DeferredUpdate]]. |- |[[Manual:Hooks/PageSaveComplete|onPageSaveComplete]] |Add '''new articles''' to the New Pages Feed and <code>pagetriage_page</code> table. |- |[[Manual:Hooks/LinksUpdateComplete|onLinksUpdateComplete]] |[[Deferred updates|DeferredUpdate]] of metadata / <code>pagetriage_page_tags</code> table. |- |Every page load |[[Manual:Hooks/ArticleViewFooter|onArticleViewFooter]] | * Turn on '''noindex''' for new, unreviewed articles. * Determine whether to load a '''link for autopatrolled users to unpatrol''' their article * Displays the '''Page Curation toolbar''' on recently created pages. * Create '''"Add to New Pages Feed" toolbox link''' for old articles. |- |[[Help:Patrolled edits]] |[[Manual:Hooks/MarkPatrolledComplete|onMarkPatrolledComplete]] |Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage. |- | rowspan="2" |Blocking and unblocking |[[Manual:Hooks/BlockIpComplete|onBlockIpComplete]] | rowspan="2" |Update article metadata / <code>pagetriage_page_tags</code> when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users. |- |[[Manual:Hooks/UnblockUserComplete|onUnblockUserComplete]] |- | |[[Manual:Hooks/ResourceLoaderGetConfigVars|onResourceLoaderGetConfigVars]] |Adjusts some config vars related to draft namespace ID. |- | rowspan="3" |[[Extension:Echo]] |[[Manual:Hooks/BeforeCreateEchoEvent|onBeforeCreateEchoEvent]] | rowspan="3" |Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed. |- |[[Manual:Hooks/EchoGetDefaultNotifiedUsers|onEchoGetDefaultNotifiedUsers]] |- |[[Manual:Hooks/LocalUserCreated|onLocalUserCreated]] |- |[[Extension:ORES]] |[[Manual:Hooks/ORESCheckModels|onORESCheckModels]] |Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio. |- | rowspan="3" |[[Help:Tags]] |[[Manual:Hooks/ListDefinedTags|onListDefinedTags]] | rowspan="3" |Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage". |- |[[Manual:Hooks/ChangeTagsAllowedAdd|onChangeTagsAllowedAdd]] |- |[[Manual:Hooks/ChangeTagsListActive|onChangeTagsListActive]] |- |API |[[Manual:Hooks/ApiMain::moduleManager|onApiMain__moduleManager]] |Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings. |- | rowspan="2" |Delete or undelete page |[[Manual:Hooks/PageDeleteComplete|onPageDeleteComplete]] |If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache. |- |HookHandlers/ UndeleteHookHandler.php |[[Manual:Hooks/ArticleUndelete|onArticleUndelete]] |If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed. |- |HookHandlers/ Schema.php |SQL |[[Manual:Hooks/LoadExtensionSchemaUpdates|onLoadExtensionSchemaUpdates]] | * The code that installs PageTriage's 4 SQL tables when you run <code>php maintenance/run.php update</code>. * Will also alter schemas from previous versions to match the latest schema. * This is also where all the '''pagetriage_tags''' are hard-coded. |} ==== Cron jobs and maintenance scripts ==== {| class="wikitable" |+ !File !What it does !Why run it? When is it useful? ![[phab:T341431|Safe to delete maintenance script?]] |- |cron/updatePageTriageQueue.php |Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". |Keeps the SQL tables from getting too big. | |- |maintenance/cleanupPageTriage.php |Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. |Fix a bug? [[phab:T321982|T321982]] | |- |maintenance/cleanupPageTriageLog.php |Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log |One time conversion of old log entries to modern format? Logs are now always written in the new format. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/6d9105c020c62d648a4ef6be957297bbc8a6d7d2]. |Probably |- |maintenance/cleanupPageTriagePageTags.php |Remove page from <code>pagetriage_page_tags</code> if they are not in <code>pagetriage_page</code> |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/00a752368e00e0d8b29a4908bfc3bab3096268dd]. |Probably |- |maintenance/DeleteAfcStates.php |Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ab2d8d4a2f9d0f4ff981afaee35a85f33edb5e99]. [[phab:T203184#4592953|T203184#4592953]]. |Probably |- |maintenance/FixNominatedForDeletion.php |Set <code>pagetriage_page.ptrp_deleted</code> if the page is has any <code>pagetriage_page_tags</code> related to deletion (e.g. prod_status, blp_prod_status, etc.) |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ff0c433226300aeba692089b5389435d47feef1e]. [[phab:T202582|T202582]]. |Probably |- |maintenance/populateDraftQueue.php |Add missing Draft namespace pages to the AfC triage queue. |Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/59e1fedffcdafc46722d7231011aee194db9ee08]. | |- |maintenance/updateUserMetadata.php |Former cron job. Update expired user metadata in the <code>pagetriage_page_tags</code> table |[https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/92a675a5f1f2e07cee532ec90fc57eee7f2cd49b]. [[phab:T341432|T341432]]. | |} === NOINDEX === NOINDEX refers to the HTML code <code>&lt;meta name="robots" content="noindex"></code>, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode <code><nowiki>__NOINDEX__</nowiki></code>. When {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in <code>includes/Hooks.php</code>, in the <code>onArticleViewFooter()</code> method. ==== First check ==== * First check: Noindex the page if ALL of the following are true: ** {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is turned on ** Page age is less than {{phpi|$wgPageTriageMaxAge}} (set to 90 days on enwiki) ** Page is in <code>pagetriage_page</code> table<ref>Checked by <code>isPageUnreviewed()</code></ref> ** Page is marked as unpatrolled (ptrp_status = 0) ==== Second check ==== * Second check: If the wikitext has the <code><nowiki>__NOINDEX__</nowiki></code> magic word, noindex the page if ALL of the following are true: ** Page age is less than {{phpi|$wgPageTriageMaxNoIndexAge}} (set to 90 days on enwiki) ** If {{phpi|$wgPageTriageMaxNoIndexAge}} is not null, page is in <code>pagetriage_page</code> table<ref>Checked by <code>isNewEnoughToNoIndex()</code>, if it doesn't exit early due to <code>$wgPageTriageMaxNoIndexAge</code> being <code>null</code>.</ref> The main use case for the <nowiki>__NOINDEX__</nowiki> magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See [https://en.wikipedia.org/w/index.php?search=NOINDEX&title=Special:Search&profile=advanced&fulltext=1&ns10=1 this search]. ==== Is the page in the <code>pagetriage_page</code> table? ==== In regards to the requirement "Page is in <code>pagetriage_page</code> table", there are several ways a for a page to get into this table: * Not been deleted by a PageTriage cron job ** One cron job deletes redirects older than {{phpi|$wgPageTriageRedirectAutoreviewAge}} days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them. ** Another cron job deletes reviewed pages after 30 days of being reviewed * In a namespace that PageTriage is configured to patrol * Isn't an article that is so old it predates the installation of PageTriage == JavaScript == === Directory structure === * /modules/ ** ext.pageTriage.article - related to marking an article as reviewed ** ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar ** ext.pageTriage.init - creates a mw.pageTriage object ** ext.pageTriage.newPagesFeed - Special:NewPagesFeed ** ext.pageTriage.sidebarLink - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates ** ext.pageTriage.toolbar - Page Curation toolbar <!--** ext.pageTriage.toolbar - Page Curation toolbar (Vue version)--> ** ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code ** ext.pageTriage.util - Backbone.js models (article, revision, stats) ** external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore <span id="Toolbar"></span> === Панель інструментів === The toolbar has three states: <code>maximized</code>, <code>minimized</code>, and <code>hidden</code>. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu. === External libraries === * front end ** old (moving away from) *** [[w:Backbone.js|Backbone.js]] *** [[w:jQuery|jQuery]] *** jQuery Badge *** jQuery Waypoints *** [[w:jQuery UI|jQuery UI]] *** [[w:Mustache (template system)|Mustache (template system)]] *** [[OOUI]] - used in modules/ext.PageTriage.enqueue ([https://codesearch.wmcloud.org/deployed/?q=oojs&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FPageTriage codesearch]) *** [[w:Underscore.js|Underscore.js]] ** new (moving towards) *** Codex *** [[w:Moment.js|Moment.js]] *** Vue Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, [[phab:T208256|we are interested in replacing these front end libraries]], to make the extension easier to maintain. <span id="Client-side_hooks"></span> === Клієнтські гачки === ==== mw.hook ==== * <code>ext.pageTriage.toolbar.ready</code> ==== mw.pageTriage.actionQueue ==== PageTriage забезпечує систему черги спеціалізованих дій, для уможливлення інтеграції інших сценаріїв і додатків із ним. Це схоже на <code>mw.hook</code> за винятком того, що воно використовує обіцянки. Це робиться за допомогою модуля <code>mw.pageTriage.actionQueue</code>. Документацію про роботу системи див. у коментарі у {{tmpl|0={{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=$1}}|джерельному коді}}. {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">It is [$1 not currently used by any scripts or gadgets on enwiki], but it is used internally by PageTriage.</span> |1=https://en.wikipedia.org/w/index.php?search=%22actionQueue%22&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1&ns2300=1&ns2301=1&ns2302=1&ns2303=1 }} Модуль actionQueue доступний після спрацювання mw.hook <code>ext.pageTriage.toolbar.ready</code>. PageTriage дасть опрацьовувачеві черги дій Object із наступними даними, на додачу до інших даних, як зазначено нижче: * <code>pageid</code> — ID сторінки, що переглядається. * <code>title</code> — Назва сторінки, включно з простором імен. * <code>reviewer</code> — Ім'я користувача PageTriage. * <code>creator</code> — Користувацьке ім'я творця сторінки. * <code>reviewed</code> — Чи позначена сторінка, зараз або в майбутньому, переглянута. <span id="Available_actions"></span> ===== Доступні дії ===== * <code>delete</code> — Спрацьовує, коли переглядач висуває сторінку на вилучення. Дані, що передаються опрацьовувачеві, також включають: ** <code>tags</code> — Об'єкт усіх шаблонів, доданих до сторінки. Ключі — назви шаблонів, а значення — об'єкти метаданних, включно з такими речами, як код швидкого вилучення. * <code>mark</code> — Спрацьовує в разі зміни статусу перегляду сторінки. Також уключає: ** <code>note</code> — Особисте повідомлення, яке переглядач додає творцеві сторінки. Може бути порожнім. * <code>tags</code> — Спрацьовує, коли шаблони підтримки додаються до сторінки. Також уключає: ** <code>tags</code> — Масив назв усіх шаблонів, які додаються до сторінки. ** <code>note</code> — Особисте повідомлення, яке переглядач додає творцеві сторінки. Може бути порожнім. <span id="Example"></span> ===== Приклад ===== Для використання черги дій, зареєструйте функцію, що запуститься після спрацювання вищезгаданої дії. PageTriage чекатиме на завершення будь-якого асинхронного коду перш, ніж робити будь-що інше, як-от оновити сторінку. Наприклад, для редагування [[Пісочниця|пісочниці]] після позначення сторінки патрульованою, можна використати: <syntaxhighlight lang="javascript"> $( function () { // You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time. mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) { // Listen for the 'mark' action. queue.add( 'mark', function ( data ) { return new mw.Api().edit( 'Sandbox', function ( revision ) { // Replace 'foo' with the note the reviewer left. return revision.content.replace( 'foo', data.note ); } ); } ); } ); } ); </syntaxhighlight> === Where are preferences stored? === Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is <code>userjs-NewPagesFeedFilterOptions</code>. It is set using <code>mw.Api().saveOption()</code> and read using <code>mw.user.options.get()</code>. This data ends up in the SQL <code>user_properties</code> table. Temporary accounts (IP masking) will not be able to store their preferences. == Installation on WMF wikis == This extension was designed for English Wikipedia. There is interest in changing its code and making it more useful to other wikis ([[phab:T50552]]), however this is challenging from a technical perspective and progress is slow. For now, the following are true: * PageTriage is allowed to be installed on other wikis<ref>https://meta.wikimedia.org/w/index.php?title=Limits_to_configuration_changes&diff=prev&oldid=26121135</ref> (although as of 2024 this hasn't happened yet). * The setting <code>$wgPageTriageEnableExtendedFeatures</code> can be set to <code>false</code> to turn off English Wikipedia-specific features such as maintenance tags and deletion tags in the Page Curation toolbar. * There are concerns that the noindex features (controlled by <code>$wgPageTriageNoIndexUnreviewedNewArticles</code> and <code>$wgPageTriageMaxNoIndexAge</code>) create search engine optimization problems, and these noindex features should not be enabled on new wikis without first discussing it with product manager [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]. * Like most other WMF-deployed extensions, PageTriage supports internationalization, and has its interface [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/i18n/|translated into many other languages]]. <span id="See_also"></span> == Див. також == * [[commons:Category:PageTriage extension]] * [[Help:New pages feed]] * [[w:Wikipedia:Page Curation/Help]] == Notes == <references /> {{OnWikimedia}} {{Used by}} [[Category:API extensions{{#translation:}}]] 5ro763q0cnvvtfvsxrvjrh3fzom41no Help:Extension:ParserFunctions/gu 12 2013000 8365015 8353931 2026-05-04T06:20:30Z FuzzyBot 451990 Updating to match new version of source page 8365015 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} <span lang="en" dir="ltr" class="mw-content-ltr">The {{ll|Extension:ParserFunctions|nsp=0}} extension provides additional [[Special:MyLanguage/Parser functions|parser functions]] to supplement those already present in MediaWiki core.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See {{ll|Help:Magic words#Parser functions}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">(It ''may'' be configured to provide additional parser functions for string handling; these are only available to non-Wikimedia Foundation wikis hence these string functions are documented {{ll|Extension:ParserFunctions/String functions|elsewhere}}.)</span> <span lang="en" dir="ltr" class="mw-content-ltr">All the parser functions provided by this extension take the form:</span> :<code><nowiki>{{</nowiki><span lang="en" dir="ltr" class="mw-content-ltr">'''#functionname''': ''argument 1'' | ''argument 2'' | ''argument 3'' ...</span> <nowiki>}}</nowiki></code> == #expr == {{for|1=<span lang="en" dir="ltr" class="mw-content-ltr">a more '''in-depth manual''' on the finer points of how the expression evaluator works, including some additional operators not covered here</span>|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Operators</span> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Grouping (parentheses)</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Numbers</span> | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | <span lang="en" dir="ltr" class="mw-content-ltr">binary operator</span> <code>'''e'''</code> &nbsp; <span lang="en" dir="ltr" class="mw-content-ltr">unary</span> <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Unary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Binary</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Round</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Logic</span> | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} <span lang="en" dir="ltr" class="mw-content-ltr">This function evaluates a mathematical expression and returns the calculated value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This function is also available in {{ll|Extension:Scribunto|nsp=0}} via the <code>mw.ext.ParserFunctions.expr</code> function.</span> :<code><nowiki>{{#expr:</nowiki> ''<span lang="en" dir="ltr" class="mw-content-ltr">expression</span>'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">Basic example</span> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The available operators are listed to the right, in order of precedence. See {{ll|Manual:Expr parser function syntax}} for more details of the function of each operator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The accuracy and format of the result returned will vary depending on the operating system of the server running the wiki and the number format of the site language.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> When evaluating using [[w:boolean algebra|boolean algebra]], zero evaluates to {{phpi|false}}, and any nonzero value, positive or negative, evaluates to {{phpi|true}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the <code>[[##iferror|#iferror]]</code> function: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The order of addition and subtraction operands before or after a number is meaningful and may be treated as a positive or negative value instead of as an operand with an erroneous input: </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Note, if using the output of magic words, you must raw-format them in order to remove commas and translate the numerals.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{NUMBEROFUSERS}}</nowiki> results in {{NUMBEROFUSERS}}, where we want {{formatnum:{{NUMBEROFUSERS}}|R}}, which can be obtained using <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is especially important in some languages, where numerals are translated.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, in Bengali, <nowiki>{{NUMBEROFUSERS}}</nowiki> produces ৩০,০৬১.</span> :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The operator <code>mod</code> gives wrong results for some values of the second argument:</span> <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} <span lang="en" dir="ltr" class="mw-content-ltr">(produces an empty string; should be 123)</span><br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=<span lang="en" dir="ltr" class="mw-content-ltr">If you want to do calculations based on dates (ex. test whether current date and time is after some other date and time), first convert the time to number of seconds after January 1, 1970 (UTC) using <nowiki>{{#time: xNU }}</nowiki>, then you can simply add and subtract dates as numbers.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Rounding === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> [https://php.net/function.round Rounds] off the number on the left to a multiple of 1/10 raised to a power, with the exponent equal to the truncated value of the number given on the right. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To round up or down use unary <code>ceil</code> or <code>floor</code> respectively. </div> {| class="wikitable" ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Test case</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Result</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Method of rounding</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is < 5, so no apparent rounding occurs</span> (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Final digit is ≥ 5, so it is rounded up</span> (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Again, the result is rounded up on the last digit, which results in additional rounding</span> (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100 because negative values round to the left of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Rounded to nearest 100th because positive values round to the right of the decimal point</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimals in the rounding index make no difference in the rounded result</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Decimal portion truncated (chopped off)</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to the nearest integer</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the ''nearest'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the nearest integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the nearest integer, which is negative one</span> |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding up or down with ''ceil'' and ''floor''</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next ''larger'' integer, which is one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next ''smaller'' integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Up to the next larger integer, which is zero</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || <span lang="en" dir="ltr" class="mw-content-ltr">Down to the next smaller integer, which is negative one</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || <span lang="en" dir="ltr" class="mw-content-ltr">Not rounded, since 1 already is an integer</span><br />{{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Interpreted as '''(ceil''' 1''')'''/3, not '''ceil('''1/3''')''', as you might expect</span>}} |- ! colspan=3 {{hl2}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding large numbers</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | <span lang="en" dir="ltr" class="mw-content-ltr">Rounding to a very large number leads to infinity.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Hence, the original value without the infinity is given as the answer.</span> |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | <span lang="en" dir="ltr" class="mw-content-ltr">Same as above.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Strings === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Expressions only work with number-like values, they cannot compare strings or characters. [[#ifeq]] can be used instead. </div> :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: test string | value if test string is not empty | value if test string is empty (or only white space)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: first parameter | second parameter | third parameter }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> This function first tests whether the first parameter is not empty. If the first parameter is not empty, the function displays the second argument. If the first parameter is empty or contains only whitespace characters (spaces, newlines, etc.) it displays the third argument. </div> :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The test string is always interpreted as pure text, so mathematical expressions are not evaluated (see [[##ifexpr|#ifexpr]] for that): </div> :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The last parameter (false) may be omitted: </div> :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The function may be nested. To do so, nest the inner <code>#if</code> function in its full form in place of a parameter of the enclosing <code>#if</code> function. Up to seven levels of nesting is possible, although that may depend on the wiki or a memory limit.</span> <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:test string | value if test string is not empty |{{#if:test string |value if test string is not empty |value if test string is empty (or only white space) }} }} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">You can also use a parameter as the test string in your <code>#if</code> statement.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You need to ensure you add the <code>|</code> (pipe symbol) after the name of the variable.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(So that if the parameter does not have a value, it evaluates to an empty string instead of the string "<code><nowiki>{{{1}}}</nowiki></code>".)</span> :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">You entered text in variable 1</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">There is no text in variable 1</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> See {{ll|Help:Parser functions in templates}} for more examples of this parser function. </div> {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == <span lang="en" dir="ltr" class="mw-content-ltr">This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If more comparisons and output strings are required, consider using <code>#switch</code>.</span> :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> If both strings are valid numerical values, the strings are compared numerically: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Otherwise, the comparison is made as text; this comparison is case-sensitive: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, without the quotes)</span>'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''<span lang="en" dir="ltr" class="mw-content-ltr">(compare to similar example above, with <code>[[##expr|#expr]]</code> returning a valid number first)</span>'' <span lang="en" dir="ltr" class="mw-content-ltr">As a practical example, consider an existing {{ll|Help:Templates|template}} <code>Template:Timer</code> using the parser to choose between two standard times, short and long.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It takes the parameter as the first input to compare against the string "short" &ndash; there is no convention for the order, but it is simpler to read if the parameter goes first.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The template code is defined as:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> the following ensue: </div> :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">When used inside a parser function, any parser tags and other parser functions must be temporarily replaced with {{ll|Strip marker|a unique code}}. This affects comparisons:</span> :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the strings to be compared are given as equal calls to the same {{ll|Help:Templates|template}} containing such tags, then the condition is true, but in the case of two templates with identical content containing such tags it is false. </div> }} {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">Literal comparisons to {{ll|Help:Magic words#Page names|page-name magic words}} may fail depending on site configuration.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, <nowiki>{{FULLPAGENAME}}</nowiki>, depending on wiki, may capitalize the first letter, and will replace all underscores with spaces.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> To work around this, apply the magic word to both parameters: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string and returns one of two results; the function evaluates to <code>true</code> if the input string contains an HTML object with <code>class="error"</code>, as generated by other parser functions such as <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> and <code>[[##rel2abs|#rel2abs]]</code>, [[Special:MyLanguage/Help:Templates|template]] errors such as loops and recursions, and other "failsoft" parser errors. </div> :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">One or both of the return strings can be omitted.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>correct</code> string is omitted, the <code>test string</code> is returned if it is not erroneous.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the <code>error</code> string is also omitted, an empty string is returned on an error:</span> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Some errors may cause a tracking category to be added, using <code><nowiki>{{#iferror:}}</nowiki></code> will not suppress the addition of the category.</span> == #ifexpr == <div lang="en" dir="ltr" class="mw-content-ltr"> This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result: </div> :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>expression</code> input is evaluated exactly as for <code>[[##expr|#expr]]</code> above, with the same operators being available. The output is then evaluated as a boolean expression. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> An empty input expression evaluates to {{phpi|false}}: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> As mentioned above, zero evaluates to {{phpi|false}} and any nonzero value evaluates to {{phpi|true}}, so this function is equivalent to one using <code>[[##ifeq|#ifeq]]</code> and <code>[[##expr|#expr]]</code> only: </div> :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> except for an empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get <code>value if true</code>). </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> comparing </div> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Either or both of the return values may be omitted; no output is given when the appropriate branch is left empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Boolean operators of equality or inequality operators are supported.</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=<span lang="en" dir="ltr" class="mw-content-ltr">The results of numerical comparisons with <code>[[##ifexpr|#ifexpr]]</code> do not always match those of <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These latter two are more accurate than <code>[[##ifexpr|#ifexpr]]</code>, and so may not return equivalent results.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Consider these comparisons with the final digit changed:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Because PHP used in <code>[[##ifeq|#ifeq]]</code> and <code>[[##switch|#switch]]</code> compares two numbers of type integer, it returns the expected result correctly.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Whereas with <code>[[##ifexpr|#ifexpr]]</code> and the same numbers:</span> :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' <span lang="en" dir="ltr" class="mw-content-ltr">With the different digit, the result of equal is actually incorrect.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This behaviour in <code>[[##ifexpr|#ifexpr]]</code> is caused because MediaWiki converts literal numbers in expressions to type float, which, for large integers like these, involves rounding.</span><br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=<span lang="en" dir="ltr" class="mw-content-ltr">See [[Manual:Checking for page existence|Manual:Checking for page existence]] for other methods of checking if a page exists with different limitations</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki. </div> :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The function evaluates to {{phpi|true}} if the page exists, whether it contains content, is visibly blank (contains meta-data such as category links or {{ll|Help:Magic words|magic words}}, but no visible content), is blank, or is a {{ll|Help:Redirects|redirect}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Only pages that are redlinked evaluate to {{phpi|false}}, including if the page used to exist but has been deleted.</span> :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The function evaluates to {{phpi|true}} for {{ll|Help:System message|system messages}} that have been customized, and for {{ll|Help:Special pages|special pages}} that are defined by the software. </div> :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is installed on this wiki)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because the {{ll|Extension:Checkuser|nsp=0}} extension is not installed on this wiki)</span> }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has been customized)</span> | '''doesn't exist''' <span lang="en" dir="ltr" class="mw-content-ltr">(because [[{{ns:8}}:Copyright]] has not been customized)</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45 if a page checks a target using <code>#ifexist:</code>, then that page will appear in the [[{{#special:WhatLinksHere}}]] list for the target page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">So if the code <code><nowiki>{{#ifexist:Foo }}</nowiki></code> were included live on this page ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] will list {{FULLPAGENAME}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> On wikis using a shared media repository, <code>#ifexist:</code> can be used to check if a file has been uploaded to the repository but not to the wiki itself: </div> :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If a local description page has been created for the file, the result is '''exists''' for all of the above. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#ifexist:</code> does not work with interwiki links. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist limits === </div> <span lang="en" dir="ltr" class="mw-content-ltr"><code>#ifexist:</code> is considered an "expensive parser function"; only a limited number of which can be included on any one page (including functions inside transcluded templates).</span> <span lang="en" dir="ltr" class="mw-content-ltr">When this limit is exceeded, any further <code>#ifexist:</code> functions automatically return false, whether the target page exists or not, and the page is categorized into [[:Category:{{MediaWiki:expensive-parserfunction-category}}]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The name of the {{ll|Help:Tracking categories|tracking category}} may vary depending on the content language of your wiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For some use cases it is possible to emulate the ifexist effect with css, by using the selectors <code>a.new</code> (to select links to nonexistent pages) or <code>a:not(.new)</code> (to select links to existing pages).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Furthermore, since the number of expensive parser functions that can be used on a single page is controlled by <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, one can also increase the limit in LocalSettings.php if needed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === ifexist and wanted pages === </div> <span lang="en" dir="ltr" class="mw-content-ltr">Prior to MediaWiki 1.45, a page that does not exist and is tested for using #ifexist will end up on the [[Special:MyLanguage/Manual:WantedPages|Wanted Pages]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{phab|T14019}} for the reason, and [[w:Template:Linkless exists]] for a workaround.</span> == #rel2abs == <div lang="en" dir="ltr" class="mw-content-ltr"> This function converts a relative file path into an absolute filepath. </div> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> Within the <code>path</code> input, the following syntax is valid: </div> *<code>.</code> → <span lang="en" dir="ltr" class="mw-content-ltr">the current level</span> *<code>..</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go up one level</span> *<code>/foo</code> → <span lang="en" dir="ltr" class="mw-content-ltr">go down one level into the subdirectory /foo</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>base path</code> is not specified, the full page name of the page will be used instead: </div> :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Invalid syntax, such as <code>/.</code> or <code>/./</code>, is ignored.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Since no more than two consecutive full stops are permitted, sequences such as these can be used to separate successive statements:</span> :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' <span lang="en" dir="ltr" class="mw-content-ltr">For a similar group of functions see also [[Special:MyLanguage/Help:Magic words#URL data|Help:Magic words#URL data]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Built-in parser functions include: 'localurl:', 'fullurl:', 'anchorencode:' etc.</span> == #switch == ''આ પણ જુઓ: [[w:Help:Switch parser function]]'' <div lang="en" dir="ltr" class="mw-content-ltr"> This function compares one input value against several test cases, returning an associated string if a match is found. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> <nowiki>#</nowiki>switch with partial transclusion tags can be used to make a configuration file that enables editors unfamiliar with template coding to view and edit configurable elements. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Default === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''default result''</code> is returned if no <code>''case''</code> string matches the <code>''comparison string''</code>: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">In this syntax, the default result must be the last parameter and must not contain a raw equals sign (an equals sign without <code><nowiki>{{}}</nowiki></code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it does, it will be treated as a case comparison, and no text will display if no cases match.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is because the default value has not been defined (is empty).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If a case matches however, its associated string will be returned.</span> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> Alternatively, the default result may be explicitly declared with a <code>''case''</code> string of "<code>#default</code>". </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Default results declared in this way may be placed anywhere within the function: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> If the <code>''default''</code> parameter is omitted and no match is made, no <code>''result''</code> is returned: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <div lang="en" dir="ltr" class="mw-content-ltr"> === Grouping results === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to have 'fall through' values, where several <code>''case''</code> strings return the same <code>''result''</code> string. This minimizes duplication. </div> {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here cases 2, 3 and 4 all return <code>''result234''</code>; cases 6 and 7 both return <code>''result67''</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The "<code>#default = </code>" in the last parameter may be omitted in the above case.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Use with parameters === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The function may be used with parameters as the test string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In this case, it is not necessary to place the pipe after the parameter name, because it is very unlikely that you will choose to set a case to be the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>".</span> (<span lang="en" dir="ltr" class="mw-content-ltr">This is the value the parameter will default to if the pipe is absent and the parameter doesn't exist or have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Help:Parser functions in templates}}.</span>) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">In the above case, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> As in the section above, cases can be combined to give a single result. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">Here, if <code><nowiki>{{{1}}}</nowiki></code> equals <code>foo</code>, <code>zoo</code> or <code>roo</code>, the function will return <code>Foo</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If it equals <code>baz</code>, the function will return <code>Baz</code>.</span> <span lang="en" dir="ltr" class="mw-content-ltr">If the parameter is empty or does not exist, the function will return <code>Bar</code>.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Additionally, the default result can be omitted if you do not wish to return anything if the test parameter value does not match any of the cases. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> In this case, the function returns an empty string unless <code><nowiki>{{{1}}}</nowiki></code> exists and equals <code>foo</code> or <code>bar</code>, in which case it returns <code>Foo</code> or <code>Bar</code>, respectively. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This has the same effect as declaring the default result as empty. </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">If you decide to set a case as "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", the function will return that case's result when the parameter doesn't exist or doesn't have a value.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The parameter would have to exist and have a value other than the string "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" to return the function's default result.</span> :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> doesn't exist or is empty):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code>test</code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :<span lang="en" dir="ltr" class="mw-content-ltr">(when <code><nowiki>{{{1}}}</nowiki></code> has the value "<code><nowiki>{{{1}}}</nowiki></code>"):</span> ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' <div lang="en" dir="ltr" class="mw-content-ltr"> In this hypothetical case, you would need to add the pipe to the parameter (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Comparison behavior === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As with <code>[[##ifeq|#ifeq]]</code>, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A <code>''case''</code> string may be empty: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Once a match is found, subsequent <code>''cases''</code> are ignored: </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Numerical comparisons with <code>[[##switch|#switch]]</code> and <code>[[##ifeq|#ifeq]]</code> are not equivalent to comparisons in expressions (see also above): </div> :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Raw equal signs === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> "Case" strings cannot contain raw equals signs. To work around this, use the [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] magic word, or replace equals sign with HTML code <code><nowiki>&amp;#61;</nowiki></code>. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Example: </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=<span lang="en" dir="ltr" class="mw-content-ltr">For a simple real life example of the use of this function, check [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Two complex examples can be found at {{ll|Template:Extension}} and [[w:Template:BOTREQ]].</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> === Replacing #ifeq === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> <code>#switch</code> can be used to reduce [[Special:MyLanguage/Help:Expansion depth|expansion depth]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> is equivalent to </div> * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> i.e. deep nesting, linear: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> On the other hand, the switch replacement could be complicated/impractical for IFs nested in both branches (shown with alternatives of indentation, indented on both sides), making full symmetrical tree: </div> <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Code</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! {{hl1}} | <span lang="en" dir="ltr" class="mw-content-ltr">Current output <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purge this page's cache] to update)</small></span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Year</span> |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">4-digit year.</span> | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | <span lang="en" dir="ltr" class="mw-content-ltr">1 if it's a leap year, 0 if not.</span> | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Requires PHP 5.1.0 and newer and [[rev:45208]].</span>|group=note}} | <span lang="en" dir="ltr" class="mw-content-ltr">ISO-8601 year of the specified week.</span>{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.</span>|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|<span lang="en" dir="ltr" class="mw-content-ltr">Will output literal ''o'' if note 1 not fulfilled.</span>|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Month</span> |- | style="text-align: center;" | <code>n</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, not zero-padded.</span> | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Month index, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation of the month name, in the site language.</span> | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full month name in the site language.</span> | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Output the full month name in the [[w:Genitive case|genitive]] form for site languages that distinguish between genitive and [[w:Nominative case|nominative]] forms. This option is useful for many [[w:Slavic languages|Slavic languages]] like Polish, Russian, Belarusian, Czech, Slovak, Slovene, Ukrainian, etc.</span> | style="line-height: 1.6;" | <span lang="en" dir="ltr" class="mw-content-ltr">For Polish:</span><br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(nominative)</span><br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br /><span lang="en" dir="ltr" class="mw-content-ltr">(genitive)</span> |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month or the year</span> |- | style="text-align: center;" | <code>j</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, not zero-padded.</span> | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year (January&nbsp;1 = 0).<br />{{note}} To get the ISO day of the year add 1.</span> | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Week and day of the week</span> |- | style="text-align: center;" | <code>W</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 week number, zero-padded.</span> | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 day of the week (Monday = 1, Sunday = 7).</span> | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of the day of the week (Sunday = 0, Saturday = 6).</span> | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | <span lang="en" dir="ltr" class="mw-content-ltr">An abbreviation for the day of the week. Rarely internationalized.</span> | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | <span lang="en" dir="ltr" class="mw-content-ltr">The full weekday name. Rarely internationalized.</span> | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour</span> |- | style="text-align: center;" | <code>a</code> | <span lang="en" dir="ltr" class="mw-content-ltr">"am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59).</span> | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Uppercase version of <code>a</code> above.</span> | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 12-hour format, zero-padded.</span> | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, not zero-padded.</span> | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| <span lang="en" dir="ltr" class="mw-content-ltr">Hour in 24-hour format, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Minutes and seconds</span> |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Minutes past the hour, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | <span lang="en" dir="ltr" class="mw-content-ltr">Seconds past the minute, zero-padded.</span> | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[w:Unix time|Unix time]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Seconds since January 1 1970 00:00:00 GMT.</span> | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Timezone (as of [[MediaWiki_1.22/Roadmap|1.22wmf2]])</span> |- | style="text-align: center;" | <code>e</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone identifier.</span> | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the date is in daylight savings time.</span> | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT)</span> | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Difference to Greenwich time (GMT), with colon</span> | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone abbreviation.</span> | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| <span lang="en" dir="ltr" class="mw-content-ltr">Miscellaneous</span> |- | style="text-align: center;" | <code>t</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the current month.</span> | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | <span lang="en" dir="ltr" class="mw-content-ltr">ISO 8601 formatted date, equivalent to <code>Y-m-d"T"H:i:s+00:00</code>.</span> | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | <span lang="en" dir="ltr" class="mw-content-ltr">[[rfc:5322|RFC 5322]] formatted date, equivalent to <code>D, j M Y H:i:s +0000</code>, with weekday name and month name not internationalized.</span> | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Non-Gregorian calendars</span> |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Islamic</span> |- | style="text-align: center;" | <code>xmj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xmY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Iranian (Jalaly)</span> |- | style="text-align: center;" | <code>xit</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in the month.</span> | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the year.</span> | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month index.</span> | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | <span lang="en" dir="ltr" class="mw-content-ltr">2-digit year.</span> | {{#time:xiy}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Hebrew</span> |- | style="text-align: center;" | <code>xjj</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Day of the month.</span> | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full month name.</span> | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Number of days in month.</span> | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Genitive form of the month name.</span> | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Month number.</span> | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xjY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Thai solar</span> |- | style="text-align: center;" | <code>xkY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year in [[w:Thai solar calendar|Thai solar calendar]]. <br />{{note}} For years before 1941 the dates in Jan-Mar range are not [[w:Thai_solar_calendar#New_year|calculated]] properly.</span> | {{#time:xkY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Minguo/Juche year</span> |- | style="text-align: center;" | <code>xoY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xoY}} |- ! {{hl3}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Japanese nengo</span> |- | style="text-align: center;" | <code>xtY</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Full year.</span> | {{#time:xtY}} |- ! {{hl2}} colspan="3" | <span lang="en" dir="ltr" class="mw-content-ltr">Flags</span> |- | style="text-align: center;" | <code>xn</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next numeric code as a raw ASCII number.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">In the Hindi language, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produces ०६, 06.</span> |- | style="text-align: center;" | <code>xN</code> | colspan="2" | <span lang="en" dir="ltr" class="mw-content-ltr">Like <code>xn</code>, but as a toggled flag, which endures until the end of the string or until the next appearance of <code>xN</code> in the string.</span> |- | style="text-align: center;" | <code>xr</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a roman numeral. Only works for numbers up to 10,000<br /><small>(up to 3,000 in pre MediaWiki 1.20)</small>.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | <span lang="en" dir="ltr" class="mw-content-ltr">Format the next number as a Hebrew numeral.</span> | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} <div lang="en" dir="ltr" class="mw-content-ltr"> This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the [[Special:MyLanguage/Help:Magic words#Date and time|magic word]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; that is, the time the page was last rendered into HTML. </div> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> <span lang="en" dir="ltr" class="mw-content-ltr">The list of accepted formatting codes is given in the table to the right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Any character in the formatting string that is not recognized is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes).</span> <span lang="en" dir="ltr" class="mw-content-ltr">If no character is recognized in the formatting string, and the date/time object is without error, then the formatting string is returned as output.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also two ways to escape characters within the formatting string:</span> # <span lang="en" dir="ltr" class="mw-content-ltr">A backslash followed by a formatting character is interpreted as a single literal character</span> # <span lang="en" dir="ltr" class="mw-content-ltr">Characters enclosed in double quotes are considered literal characters, and the quotes are removed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> In addition, the digraph <code>xx</code> is interpreted as a single literal "x". </div> <div lang="en" dir="ltr" class="mw-content-ltr"> As the list of formatting codes continues to evolve (with the support of new calendars, or of new date fields computed and formatted differently), you should escape all literal characters (not just ASCII letters currently used by formatting codes) that need to be passed through unaltered. </div> <span lang="en" dir="ltr" class="mw-content-ltr">Unfortunately, for now, the ASCII single quote is still not recognized as a simple alternative for marking literal text to the currently supported ASCII double quotes (for example, double quotes are mandatory for in other uses like the delimitation of string values in JSON, C, C++...) and backslashes (which have to be escaped as well in string constants used by many languages, including JSON, C, C++, PHP, JavaScript, Lua).</span> <span lang="en" dir="ltr" class="mw-content-ltr">So you still cannot embed any literal double quote without escaping it with a backslash (or you can use other curly, angular or square quotation marks instead).</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' <span lang="en" dir="ltr" class="mw-content-ltr">The <code>''date/time object''</code> can be in any format accepted by PHP's [https://php.net/function.strtotime strtotime()] function.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Absolute (e.g. <code>20 December 2000</code>), relative (e.g. <code>+20 hours</code>), and combined times (e.g. <code>30 July +1 year</code>) are accepted.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''language code''</code> in [[w:ISO 639-3|ISO 639-3]] (?) allows the string to be displayed in the chosen language </div> :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> The <code>''local''</code> parameter specifies if the ''date/time object'' refers to the local timezone or to UTC. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This is a boolean parameters: its value is determined by casting the value of the argument (see the [https://php.net/language.types.boolean#language.types.boolean.casting official PHP documentation] for details on how string are cast to boolean values). </div> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to <code>true</code> or <code>false</code>.</span>}} <div lang="en" dir="ltr" class="mw-content-ltr"> See the following examples for details: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an <code>@</code> symbol. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Without the <code>@</code> prefix before numeric timestamp values, the result is an error most of the time, or is an unexpected value: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(interpreted as a year with current month and day of the month)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(correct)</span> :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(unsupported year format)</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The range of acceptable input is 1 January 0111 → 31 December 9999. For the years 100 through 110 the output is inconsistent, Y and leap years are like the years 100-110, r, D, l and U are like interpreting these years as 2000-2010. </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> <span lang="en" dir="ltr" class="mw-content-ltr">(correct, no leap year), but</span> :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">(wrong, even if 100 is interpreted as 2000, because that is a leap year)</span> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> Year numbers 0-99 are interpreted as 2000-2069 and 1970-1999, except when written in 4-digit format with leading zeros: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) <div lang="en" dir="ltr" class="mw-content-ltr"> The weekday is supplied for the years 100-110 and from 1753, for the years 111-1752 the r-output shows "Unknown" and the l-output "<>". As a consequence, the r-output is not accepted as input for these years. </div> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the ''current'' values: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The fill-in feature is not consistent; some parts are filled in using the current values, others are not: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the month and the current year.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day, but the current day of the year.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> There's exception case of the filled day: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Gives the start of the day and the start of the month.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> A four-digit number is always interpreted as a year, never as hours and minutes:<ref>Prior to {{rev|86805}} in 2011 this was not the case.</ref> </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month): </div> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Input is treated as a time rather than a year+month code.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The function performs a certain amount of date mathematics: </div> :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' <span lang="en" dir="ltr" class="mw-content-ltr">The total length of the format strings of the calls of <code>#time</code> is limited to 6000 characters.</span><ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== Time Zone issue ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There is a bug in this #time parser function (more specifically in ''PHP DateTime'') that does not allow the passing-in of ''non-integers'' as relative time zone offsets. This issue does not apply when using an on-the-hour time zone, such as EDT. For example: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} <div lang="en" dir="ltr" class="mw-content-ltr"> However, India is on a +5.5 hours time offset from UTC, and thus using its time zone will not normally allow the correct calculation of a relative time zone offset. Here's what happens: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} <div lang="en" dir="ltr" class="mw-content-ltr"> To workaround this issue, simply convert the time into minutes or seconds, like this: </div> * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} <div lang="en" dir="ltr" class="mw-content-ltr"> (Tim Starling, the developer of this function, provided the exact syntax for this solution.) </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== #time format like in signatures ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Sometimes it is useful to construct a timestamp, which looks like the automatic timestamp generated by [[Special:MyLanguage/Help:Signatures|signatures]] in discussions on talk pages.</span> <span lang="en" dir="ltr" class="mw-content-ltr">On an English-language wiki, it can be created with:</span> * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == <div lang="en" dir="ltr" class="mw-content-ltr"> This function is identical to <code><nowiki>{{#time: ... }}</nowiki></code> with the <code>local</code> parameter set to {{phpi|true}}, so it always uses the local time of the wiki (as set in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Syntax of the function is: </div> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=<span lang="en" dir="ltr" class="mw-content-ltr">Please note that, if the variable {{phpi|$wgLocaltimezone}} is set to <code>UTC</code>, there is no difference in the output when <code>local</code> is set to {{phpi|true}} or {{phpi|false}}</span>}} [[File:Time-Timel.png|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example of the use of #time and #timel parser functions from a server where the timezone is not UTC</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> For instance, see the following examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Warning Example from https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid</span>]] {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> Be aware that U for both time and timel will return the same number of seconds since 1970-01-01 00:00:00 UTC on Wikipedias with different timezones than UTC (formerly known as GMT) </div> :<code>U</code> <span lang="en" dir="ltr" class="mw-content-ltr">Unix time. Seconds since January 1 1970 00:00:00 GMT.</span> :<code>Z</code> <span lang="en" dir="ltr" class="mw-content-ltr">Timezone offset in seconds.</span> :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == <span lang="en" dir="ltr" class="mw-content-ltr">This function formats a date using a standard format for the selected language, as defined in <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (see {{Phab|T223772}}).</span> : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">''date/time object''</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">''format type''</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">''language code''</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> The format of the ''date/time object'' is the same as for [[#time|#time]]. If it is empty, the time when the page was rendered is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The ''format type'' may be one of: </div> ; <code>time</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the time is shown.</span> ; <code>date</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown.</span> ; <code>both</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Both the time and date are shown.</span> ; <code>pretty</code> : <span lang="en" dir="ltr" class="mw-content-ltr">Only the date is shown, using an abbreviated format which does not include the year.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Not all languages support this; if it is not supported, the "date" format is used.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''format type'' is not specified, both the time and date will be show, as if <code>both</code> were specified. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''language code'' is not specified, the page's content language is used. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Using <code>#timef</code> instead of <code>#time</code> allows templates to more easily support multiple languages, since different languages have different ways to format dates. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> In English, the order of the day and month is controlled by {{wg|AmericanDates}}. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Examples: </div> :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == <span lang="en" dir="ltr" class="mw-content-ltr">This function is the same as [[#timef|#timef]] except that it uses the local timezone of the wiki as configured in {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}.</span> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == <div lang="en" dir="ltr" class="mw-content-ltr"> This function separates a page title into segments based on slashes, then returns some of those segments as output. </div> : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=<span lang="en" dir="ltr" class="mw-content-ltr">pagename</span> |2=<span lang="en" dir="ltr" class="mw-content-ltr">number of segments to return</span> |3=<span lang="en" dir="ltr" class="mw-content-ltr">segment to start at</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> If the ''number of segments to return'' parameter is not specified, it defaults to "0", which returns all the segments from the ''segment to start at'' to the end (included). If the ''segment to start at'' parameter is not specified or is "0", it defaults to "1": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki> પણ જુઓ. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' <div lang="en" dir="ltr" class="mw-content-ltr"> Negative values are accepted for both values. Negative values for the ''number of segments to return'' parameter effectively 'strips' segments from the end of the string. Negative values for the ''first segment to return'' translates to "start with this segment counting from the right": </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string.</span> {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}} પણ જુઓ. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips all 4 segments from the end of the string</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips 5 segments from the end of the string (more than exist)</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Returns last segment.</span> {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}} પણ જુઓ. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Strips one segment from the end of the string, then returns the second segment and beyond</span> : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' <span lang="en" dir="ltr" class="mw-content-ltr">Start copying at the second last element; strip one segment from the end of the string</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Before processing, the ''pagename'' parameter is HTML-decoded: if it contains some standard HTML character entities, they will be converted to plain characters (internally encoded with UTF-8, i.e. the same encoding as in the MediaWiki source page using this parser function). </div> : <span lang="en" dir="ltr" class="mw-content-ltr">For example, any occurrence of <code>&amp;quot;</code>, <code>&amp;#34;</code>, or <code>&amp;#x22;</code> in ''pagename'' will be replaced by <code>"</code>.</span> : <span lang="en" dir="ltr" class="mw-content-ltr">No other conversion from HTML to plain text is performed, so HTML tags are left intact at this initial step even if they are invalid in page titles.</span> {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> Some magic keywords or parser functions of MediaWiki (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> and similar) are known to return strings that are needlessly HTML-encoded, even if their own input parameter was not HTML-encoded: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The titleparts parser function can then be used as a workaround, to convert these returned strings so that they can be processed correctly by some other parser functions also taking a page name in parameter (such as <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) but which are still not working properly with HTML-encoded input strings. </div> This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. <div lang="en" dir="ltr" class="mw-content-ltr"> For example, if the current page is [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], then: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #ifeq parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight>, and <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> are both returning <code>1</code>; (the #switch parser function does perform the HTML-decoding of its input parameters).</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight>, <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> will all return <code>1</code> if that category page exists (the #ifexist parser function does perform the HTML-decoding of its input parameters);</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> will return a non-zero number, if that category contains pages or subcategories, '''but''':</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, may still '''unconditionally''' return 0, just like:</span> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> The reason of this unexpected behavior is that, with the current versions of MediaWiki, there are two caveats: </div> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, or even <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''may'' return the actually HTML-encoded string <code>Category:Côte-d&apos;Or</code> and not the expected <code>Category:Côte-d'Or</code>, and that:</span> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> '''unconditionally''' returns 0 (the PAGESINCAT magic keyword does not perform any HTML-decoding of its input parameter).</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The simple workaround using titleparts (which will continue to work if the two caveats are fixed in a later version of MediaWiki) is: </div> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <span lang="en" dir="ltr" class="mw-content-ltr"><syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, that all return the actual number of pages in the same category.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> Then the decoded ''pagename'' is canonicalized into a standard page title supported by MediaWiki, as much as possible: </div> # <span lang="en" dir="ltr" class="mw-content-ltr">All underscores are automatically replaced with spaces:</span> #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' <span lang="en" dir="ltr" class="mw-content-ltr">Not bah_boo, despite the underscore in the original.</span> # <span lang="en" dir="ltr" class="mw-content-ltr">The string is split a maximum of 25 times; further slashes are ignored and the 25th element will contain the rest of the string.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The string is also limited to 255 characters, as it is treated as a [[Special:MyLanguage/Manual:Page table#Schema summary|page title]]:</span> #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: <span lang="en" dir="ltr" class="mw-content-ltr">If for whatever reason you needed to push this function to its limit, although very unlikely, it is possible to bypass the 25 split limit by nesting function calls:</span> #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # <span lang="en" dir="ltr" class="mw-content-ltr">Finally the first substring is capitalized according to the capitalization settings of the local wiki (if that substring also starts by a local namespace name, that namespace name is also normalized).</span> #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= <div lang="en" dir="ltr" class="mw-content-ltr"> You can use #titleparts as a small "string parser and converter", but consider that it returns the first substring capitalized: </div> : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' <div lang="en" dir="ltr" class="mw-content-ltr"> If lower case is needed, use lc: function to control output: </div> : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' <div lang="en" dir="ltr" class="mw-content-ltr"> You can prepend a 'dummy' slash at the beginning of the string to get the correct first substring capitalization (uppercase or lowercase). Use <code>2</code> instead of <code>1</code> for ''first segment to return'': </div> : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">Certain characters that are {{ll|Manual:Page title#Naming restrictions|illegal in a page title}} will cause #titleparts to not parse the string:</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not produce the expected:</span> '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because brackets are illegal in page titles and this parser function does not process links embedded in its input ''pagename'' parameter, even when they use the MediaWiki syntax, or any other HTML or MediaWiki tags.</span> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". <span lang="en" dir="ltr" class="mw-content-ltr">Does not work because "#" is also illegal in page titles.</span> }} {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> If any part of the title is just "<code>.</code>" or "<code>..</code>", #titleparts will not parse the string: </div> : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. <span lang="en" dir="ltr" class="mw-content-ltr">The whole string is returned. It does not produce the expected:</span> '''one''' }} {{Warning|1= <span lang="en" dir="ltr" class="mw-content-ltr">This function does not degrade gracefully if the input exceeds 255 bytes in UTF-8. If the input string is 256 bytes or more, the whole string is returned.</span> }} <div lang="en" dir="ltr" class="mw-content-ltr"> == String functions == </div> {{Main|Extension:ParserFunctions/String functions}} <span lang="en" dir="ltr" class="mw-content-ltr">The ParserFunctions extension optionally defines various string functions if <code>$wgPFEnableStringFunctions</code> is set to {{phpi|true}}:</span> * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> <span lang="en" dir="ltr" class="mw-content-ltr">See the dedicated subpage for documentation, and {{ll|Manual:Performing string operations with parser functions}} for examples.</span> {{Warning |1=<span lang="en" dir="ltr" class="mw-content-ltr">In 2013, it was decided that '''these functions will <em>never</em> be enabled on any Wikimedia wiki''', because they are inefficient when used on a large scale (see [[phab:T8455]] for some history).</span> '''<span lang="en" dir="ltr" class="mw-content-ltr">These functions do <strong>NOT</strong> work on Wikimedia wikis!</span>'''<br/><br/><span lang="en" dir="ltr" class="mw-content-ltr">If you are here to write something on a Wikimedia project, you are looking for something else: if your home wiki has string functions, it probably uses {{ll|Extension:Scribunto|Lua}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For example, the English Wikipedia uses [[w:Module:String|Module:String]], which does some of the same things with wildly different syntax.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There are also individual [[w:Template:String-handling templates|String-handling templates]].</span> }} <span lang="en" dir="ltr" class="mw-content-ltr">Here is a short overview of [[Module:String]] functions:</span> * [[w:Module:String#len|&#35;len]] <span lang="en" dir="ltr" class="mw-content-ltr">(length of string)</span>: <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] <span lang="en" dir="ltr" class="mw-content-ltr">(substring)</span>: <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] <span lang="en" dir="ltr" class="mw-content-ltr">(position of target)</span>: <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] <span lang="en" dir="ltr" class="mw-content-ltr">(repeat)</span>: <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <div lang="en" dir="ltr" class="mw-content-ltr"> == General points == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Substitution === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Parser functions can be [[Special:MyLanguage/Help:Substitution|substituted]] by prefixing the hash character with <code>'''subst:'''</code>: </div> :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → <span lang="en" dir="ltr" class="mw-content-ltr">the code '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' will be inserted in the wikitext since the page {{FULLPAGENAME}} exists.</span> {{Warning|1= <div lang="en" dir="ltr" class="mw-content-ltr"> The results of substituted parser functions are undefined if the expressions contain ''un''substituted volatile code such as {{ll|Help:Magic words#Variables|variables}} or other parser functions. For consistent results, all the volatile code in the expression to be evaluated must be substituted. See [[w:Help:Substitution|Help:Substitution]]. </div>}} <div lang="en" dir="ltr" class="mw-content-ltr"> Substitution does not work within {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; you can use <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> for this purpose. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Redirects === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Especially [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] could be handy in {{ll|Help:Redirects|redirects}} to pages including dates, but this does not work. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Escaping pipe characters === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In tables ==== </div> <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions will mangle {{ll|Help:Tables|wikitable}} syntax and pipe characters (<code><nowiki>|</nowiki></code>), treating all the raw pipe characters as parameter dividers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To avoid this, most wikis used a template [[{{ns:10}}:!]] with its contents only a raw pipe character (<code><nowiki>|</nowiki></code>), since MW 1.24 a {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> magic word}} replaced this kludge.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This 'hides' the pipe from the MediaWiki parser, ensuring that it is not considered until after all the templates and variables on a page have been expanded.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It will then be interpreted as a table row or column separator.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Alternatively, raw HTML table syntax can be used, although this is less intuitive and more error-prone.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> You can also escape the pipe character &vert; for display as a plain, uninterpreted character using an HTML entity: <code>&amp;#124;</code> or <code>&amp;vert;</code> . </div> {| class="wikitable" ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">You get</span> |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as table row/column separator</span> | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | <span lang="en" dir="ltr" class="mw-content-ltr">Escaping pipe character as a plain character</span> | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <div lang="en" dir="ltr" class="mw-content-ltr"> ==== In template calls ==== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The same pipe protection applies as for the following example: </div> <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> We observe that ''text after'' is not displayed when the pipe | just before ''sandbox name='' is present since ''|sandbox name='' is considered erroneously to be a parameter of template ''Documentation'' at the same level as ''|content='' is. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Stripping whitespace === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Whitespace, including newlines, tabs, and spaces, is stripped from the beginning and end of all the parameters of these parser functions. If this is not desirable, comparison of strings can be done after putting them in quotation marks. </div> :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' <span lang="en" dir="ltr" class="mw-content-ltr">To prevent the trimming of then and else parts, see [[m:Template:If]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Some people achieve this by using <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> instead of spaces.</span> :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> However, this method can be used to render a '''single''' whitespace character only, since the parser squeezes multiple whitespace characters in a row into one. </div> :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} <div lang="en" dir="ltr" class="mw-content-ltr"> In this example, the <code>white-space: pre</code> style is used to force the whitespace to be preserved by the browser, but even with it the spaces are not shown. This happens because the spaces are stripped by the software, before being sent to the browser. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is possible to workaround this behavior replacing whitespaces with <code>&amp;#32;</code> (''breakable space'') or <code>&amp;nbsp;</code> (''non-breakable space''), since they are not modified by the software: </div> :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' <span lang="en" dir="ltr" class="mw-content-ltr">Beware that not all parameters are created equal.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In ParserFunctions, whitespace at the beginning and end is always stripped.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In {{ll|Help:Templates|templates}}, whitespace at the beginning and end is stripped for named parameters and named unnamed parameters but ''not'' from unnamed parameters:</span> :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <div lang="en" dir="ltr" class="mw-content-ltr"> == Other parser functions == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Case conversion functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase:'''</span> {{xpdoc|lc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase:'''</span> {{xpdoc|uc: AbC|}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Lowercase first character:'''</span> {{xpdoc|lcfirst: AbC}} * <span lang="en" dir="ltr" class="mw-content-ltr">'''Uppercase first character:'''</span> {{xpdoc|ucfirst: abc}} <div lang="en" dir="ltr" class="mw-content-ltr"> === Encoding functions === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">'''URL encoding:'''</span> <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- "{{urlencode: AbC dEf ghi}}" ---- <div lang="en" dir="ltr" class="mw-content-ltr"> So inner new lines convert into %0A, and inner spaces convert into +. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Anchor encoding === </div> <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">renders as</span> ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == આ પણ જુઓ == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – <span lang="en" dir="ltr" class="mw-content-ltr">an (incomplete) list of parser functions added by core and extensions.</span> * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – <span lang="en" dir="ltr" class="mw-content-ltr">in particular for number formatting and padding</span> * {{ll|Manual:Template limits#Expensive parser function calls}} <div lang="en" dir="ltr" class="mw-content-ltr"> * [[Module:String]] obsoleting {{ll|Extension:StringFunctions}} </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Parser functions for Wikibase (the extensions that enables Wikidata):</span> [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|<span lang="en" dir="ltr" class="mw-content-ltr">How to use data on Wikimedia projects#Parser function</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> == References == </div> <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] iha3dti45n3fb3xcok4pct2y7m46l1f Reading/Web/Accessibility for reading/Reporting/meta.wikimedia.org 0 2032213 8365091 8352540 2026-05-04T09:31:07Z ~2026-27134-35 18368216 /* Proposals for closing projects dark mode error */ new section 8365091 wikitext text/x-wiki == [https://meta.wikimedia.org/wiki/Special:Contributions/Katia_Aguirre Contributions/Katia Aguirre] dark mode error == '''Issue Description''' Box generated from [[m:MediaWiki:sp-contributions-footer]] is partially illegible. {{unsigned|ToadetteEdit|07:20, 21 set 2024 (UTC)}} :Waiting approval of [[meta:MediaWiki talk:Sp-contributions-footer#Dark_mode_accessibility|my edit request]]. --[[User:ZandDev|ZandDev]] ([[User talk:ZandDev|talk]]) 13:53, 7 November 2024 (UTC) :{{Done}} --[[User:ZandDev|ZandDev]] ([[User talk:ZandDev|talk]]) 13:54, 7 November 2024 (UTC) == [https://meta.wikimedia.org/wiki/Testpage1 Testpage1] dark mode error == '''Issue Description''' When opening the edit window, the box generated by [[m:MediaWiki:newarticletext]] is illegible. {{unsigned|ToadetteEdit|07:47, 21 set 2024 (UTC)}} :Waiting that [[meta:Template:Newarticletext]] (transcluded in the message) is marked for translation. --[[User:ZandDev|ZandDev]] ([[User talk:ZandDev|talk]]) 13:53, 7 November 2024 (UTC) :It’s now readable, but because it lost all its styling. MediaWiki messages need to be wrapped in an element with <code>class="mw-parser-output"</code> for TemplateStyles to work (this is automatic in the page text, but not in MediaWiki messages). It technically doesn’t matter whether this class is added in the template or directly in the MediaWiki message, but I find the latter cleaner. —[[User:Tacsipacsi|Tacsipacsi]] ([[User talk:Tacsipacsi|talk]]) 23:41, 7 November 2024 (UTC) ::{{ping|Melos}} I see you’ve [https://meta.wikimedia.org/w/index.php?title=MediaWiki:Recentchangestext&diff=27828494 fixed Recentchangestext], maybe you could handle this one as well? Thanks in advance! —[[User:Tacsipacsi|Tacsipacsi]] ([[User talk:Tacsipacsi|talk]]) 22:26, 21 November 2024 (UTC) :::{{Done|Fixed}} Thanks! --[[User:Melos|Melos]] ([[User talk:Melos|talk]]) 21:20, 22 November 2024 (UTC) == [https://meta.wikimedia.org/wiki/Steward_requests/Global_permissions Steward requests/Global permissions] dark mode error == '''Issue Description''' Some links are "gone" {{unsigned|ToadetteEdit|18:44, 23 set 2024 (UTC)}} == [https://meta.wikimedia.org/wiki/Requests_for_comment/Global_ban_for_PokestarFan Requests for comment/Global ban for PokestarFan] dark mode error == '''Issue Description''' Headers are unreadable, in this and other closed RFCs {{unsigned|ToadetteEdit|07:29, 25 set 2024 (UTC)}} :Waiting that [[meta:Template:Rfc subpage]] (used in the message) is marked for translation. --[[User:ZandDev|ZandDev]] ([[User talk:ZandDev|talk]]) 13:53, 7 November 2024 (UTC) == [https://meta.wikimedia.org/wiki/WikiIndaba_conference_2024/Program WikiIndaba conference 2024/Program] dark mode error == '''Issue Description''' Mostly unreadable. {{unsigned|ToadetteEdit|14:11, 28 set 2024 (UTC)}} :Better than before, but I think that the image at upper-left corner has to be redrawn. --[[User:ZandDev|ZandDev]] ([[User talk:ZandDev|talk]]) 13:53, 7 November 2024 (UTC) :{{Done}} dark mode image added [[User:Matrix|Matrix]] ([[User talk:Matrix|talk]]) 20:26, 2 December 2024 (UTC) == [https://meta.wikimedia.org/wiki/Global_Majority_Wikimedia_Technology_Priorities Global Majority Wikimedia Technology Priorities] dark mode glitch == '''While going through the *Global Majority Wikimedia Technology Priorities* page on meta, and decided to explore the dark mode, I noticed that the background of the introduction card was remained white and quite invisible. The text could only be read when it was highlighted''' [[User:Eugene233|eugene23]] ([[User talk:Eugene233|talk]]) 16:03, 4 November 2024 (UTC) :{{done}} --[[User:ZandDev|ZandDev]] ([[User talk:ZandDev|talk]]) 13:53, 7 November 2024 (UTC) == [https://meta.wikimedia.org/wiki/Mental_health_resources Mental health resources] dark mode error == '''Issue Description''': this page (and likely others like it!) is completely unreadable in dark mode, showing up black text on black {{unsigned|2001:818:d839:c00:5404:4893:5570:66f2|20:52, 6 nov 2024 (UTC)}} :I should have fixed this with [[meta:Special:Diff/27713914|edit 27713914]] on [[meta:Template:Start tab]], called by [[meta:Template:Mental Health Resource Center Tabs]] ← [[meta:Template:Start tab]]. --[[User:ZandDev|ZandDev]] ([[User talk:ZandDev|talk]]) 13:53, 7 November 2024 (UTC) == [https://meta.wikimedia.org/wiki/Template:Translatable_template Translatable template] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. --> '''Issue Description:''' the template likely uses hardcoded colours and needs to be translated to using the current palette. [[User:JnpoJuwan|JnpoJuwan]] ([[User talk:JnpoJuwan|talk]]) 22:16, 15 December 2024 (UTC) :This template doesn’t use any colors: its sole purpose is to transclude other templates in the appropriate language (although this function is mostly superseded by software features by now and I’m working on removing it wherever possible). The color problems are caused by the template specified as its first parameter (the template it transcludes), so you should report that template/those templates. —[[User:Tacsipacsi|Tacsipacsi]] ([[User talk:Tacsipacsi|talk]]) 20:15, 16 December 2024 (UTC) == [https://meta.wikimedia.org/wiki/Template:Languages Languages] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. --> '''Issue Description:''' the template likely uses hardcoded colours and needs to be translated to using the current palette. [[User:JnpoJuwan|JnpoJuwan]] ([[User talk:JnpoJuwan|talk]]) 22:17, 15 December 2024 (UTC) == [https://meta.wikimedia.org/wiki/Steward_requests/Global Steward requests/Global] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. --> '''Issue Description''' Some links on the mentioned page that are under the "Requests for global (un)block" section, mainly ones that are inside boxes, are rendered in a black color, making them difficult, if not impossible to see what the text is without selecting it. [https://meta.wikimedia.org/wiki/Steward_requests/Global_permissions Steward_requests/Global_permissions] seems to be affected as well. Not sure what other pages on that wiki are affected by this. -<span style="font-family:Lentariso">[[User:GeniusWorkbench4622|Genius]][[User_talk:GeniusWorkbench4622|Workbench]][[Special:Contributions/GeniusWorkbench4622|4622]]</span> 04:19, 15 March 2025 (UTC) == [https://meta.wikimedia.org/wiki/MediaWiki:Gadget-Coloredlinks.css Gadget-Coloredlinks.css] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' the link color for mediawiki being black makes it impossible to read. maybe some of the other colors i haven't seen yet are affected hy this too and could benefit of some change for dark-mode, probably using light-dark(). also affects [[MediaWiki:Gadget-Coloredlinks.css]], and I suspect a lot of other instances where that same file may exist too.<br/>–[[User:joshinils|joshinils]] ([[User Talk:joshinils|talk]] <sup><small>[https://de.wikipedia.org/wiki/Benutzer_Diskussion:joshinils [<u><small>🇩🇪</small>Disk</u>&rsqb;]</small></sup>) 08:26, 22 February 2026 (UTC) == [https://meta.wikimedia.org/wiki/Event:Celebrate_Women Celebrate Women] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' tables are not adapted for dark theme --[[User:Plaga med|Plaga med]] ([[User talk:Plaga med|talk]]) 13:34, 5 March 2026 (UTC) : cc @[[User:GFontenelle (WMF)|GFontenelle (WMF)]]. [[User:SCP-2000|SCP-2000]] ([[User talk:SCP-2000|talk]]) 19:04, 11 March 2026 (UTC) == [https://meta.wikimedia.org/wiki/Template:Ptag Ptag] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' The template does not conform to dark mode. --[[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 07:55, 24 March 2026 (UTC) == [https://meta.wikimedia.org/wiki/User:Pine/sandbox/night_mode_testing Pine/sandbox/night mode testing] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' The text inside of the box, where the text isn't part of a link, isn't changing color to white when night mode is enabled. --[[User:Pine|<span style="color:#01796f;text-shadow:#00BFFF 0 0 1.0em">↠Pine</span>]] [[User talk:Pine|<font color="DeepSkyBlue">(<span style="color:#FFDF00 ;text-shadow:#FFDF00 0 0 1.0em"><b>✉</b></span>)</font>]] 04:25, 1 April 2026 (UTC) == [https://meta.wikimedia.org/wiki/FAQ_for_developer_app_guidelines FAQ for developer app guidelines] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' The defined background color makes some text (mostly the headers) blend in with it, making it fail the contrast check. Another issue is that some text stays the same color, so just changing the background color to black will cause different text to fail the contrast check. --<span style="font-family:Lentariso">[[User:GeniusWorkbench4622|Genius]][[User_talk:GeniusWorkbench4622|Workbench]][[Special:Contributions/GeniusWorkbench4622|4622]]</span> 18:42, 10 April 2026 (UTC) :{{Done|1=[https://meta.wikimedia.org/w/index.php?title=FAQ_for_developer_app_guidelines&diff=30392935 Fixed.]}} —[[User:Tacsipacsi|Tacsipacsi]] ([[User talk:Tacsipacsi|talk]]) 22:20, 11 April 2026 (UTC) == [https://meta.wikimedia.org/wiki/Proposals_for_closing_projects Proposals for closing projects] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' --[[Special:Contributions/&#126;2026-27134-35|&#126;2026-27134-35]] ([[User talk:&#126;2026-27134-35|talk]]) 09:31, 4 May 2026 (UTC) 4emf7kx1ml5u3qqyf6n9jkyipg6iqhv 8365114 8365091 2026-05-04T10:48:06Z Clump 81610 Undid revision [[Special:Diff/8365091|8365091]] by [[Special:Contributions/~2026-27134-35|~2026-27134-35]] ([[User talk:~2026-27134-35|talk]]) no description 8365114 wikitext text/x-wiki == [https://meta.wikimedia.org/wiki/Special:Contributions/Katia_Aguirre Contributions/Katia Aguirre] dark mode error == '''Issue Description''' Box generated from [[m:MediaWiki:sp-contributions-footer]] is partially illegible. {{unsigned|ToadetteEdit|07:20, 21 set 2024 (UTC)}} :Waiting approval of [[meta:MediaWiki talk:Sp-contributions-footer#Dark_mode_accessibility|my edit request]]. --[[User:ZandDev|ZandDev]] ([[User talk:ZandDev|talk]]) 13:53, 7 November 2024 (UTC) :{{Done}} --[[User:ZandDev|ZandDev]] ([[User talk:ZandDev|talk]]) 13:54, 7 November 2024 (UTC) == [https://meta.wikimedia.org/wiki/Testpage1 Testpage1] dark mode error == '''Issue Description''' When opening the edit window, the box generated by [[m:MediaWiki:newarticletext]] is illegible. {{unsigned|ToadetteEdit|07:47, 21 set 2024 (UTC)}} :Waiting that [[meta:Template:Newarticletext]] (transcluded in the message) is marked for translation. --[[User:ZandDev|ZandDev]] ([[User talk:ZandDev|talk]]) 13:53, 7 November 2024 (UTC) :It’s now readable, but because it lost all its styling. MediaWiki messages need to be wrapped in an element with <code>class="mw-parser-output"</code> for TemplateStyles to work (this is automatic in the page text, but not in MediaWiki messages). It technically doesn’t matter whether this class is added in the template or directly in the MediaWiki message, but I find the latter cleaner. —[[User:Tacsipacsi|Tacsipacsi]] ([[User talk:Tacsipacsi|talk]]) 23:41, 7 November 2024 (UTC) ::{{ping|Melos}} I see you’ve [https://meta.wikimedia.org/w/index.php?title=MediaWiki:Recentchangestext&diff=27828494 fixed Recentchangestext], maybe you could handle this one as well? Thanks in advance! —[[User:Tacsipacsi|Tacsipacsi]] ([[User talk:Tacsipacsi|talk]]) 22:26, 21 November 2024 (UTC) :::{{Done|Fixed}} Thanks! --[[User:Melos|Melos]] ([[User talk:Melos|talk]]) 21:20, 22 November 2024 (UTC) == [https://meta.wikimedia.org/wiki/Steward_requests/Global_permissions Steward requests/Global permissions] dark mode error == '''Issue Description''' Some links are "gone" {{unsigned|ToadetteEdit|18:44, 23 set 2024 (UTC)}} == [https://meta.wikimedia.org/wiki/Requests_for_comment/Global_ban_for_PokestarFan Requests for comment/Global ban for PokestarFan] dark mode error == '''Issue Description''' Headers are unreadable, in this and other closed RFCs {{unsigned|ToadetteEdit|07:29, 25 set 2024 (UTC)}} :Waiting that [[meta:Template:Rfc subpage]] (used in the message) is marked for translation. --[[User:ZandDev|ZandDev]] ([[User talk:ZandDev|talk]]) 13:53, 7 November 2024 (UTC) == [https://meta.wikimedia.org/wiki/WikiIndaba_conference_2024/Program WikiIndaba conference 2024/Program] dark mode error == '''Issue Description''' Mostly unreadable. {{unsigned|ToadetteEdit|14:11, 28 set 2024 (UTC)}} :Better than before, but I think that the image at upper-left corner has to be redrawn. --[[User:ZandDev|ZandDev]] ([[User talk:ZandDev|talk]]) 13:53, 7 November 2024 (UTC) :{{Done}} dark mode image added [[User:Matrix|Matrix]] ([[User talk:Matrix|talk]]) 20:26, 2 December 2024 (UTC) == [https://meta.wikimedia.org/wiki/Global_Majority_Wikimedia_Technology_Priorities Global Majority Wikimedia Technology Priorities] dark mode glitch == '''While going through the *Global Majority Wikimedia Technology Priorities* page on meta, and decided to explore the dark mode, I noticed that the background of the introduction card was remained white and quite invisible. The text could only be read when it was highlighted''' [[User:Eugene233|eugene23]] ([[User talk:Eugene233|talk]]) 16:03, 4 November 2024 (UTC) :{{done}} --[[User:ZandDev|ZandDev]] ([[User talk:ZandDev|talk]]) 13:53, 7 November 2024 (UTC) == [https://meta.wikimedia.org/wiki/Mental_health_resources Mental health resources] dark mode error == '''Issue Description''': this page (and likely others like it!) is completely unreadable in dark mode, showing up black text on black {{unsigned|2001:818:d839:c00:5404:4893:5570:66f2|20:52, 6 nov 2024 (UTC)}} :I should have fixed this with [[meta:Special:Diff/27713914|edit 27713914]] on [[meta:Template:Start tab]], called by [[meta:Template:Mental Health Resource Center Tabs]] ← [[meta:Template:Start tab]]. --[[User:ZandDev|ZandDev]] ([[User talk:ZandDev|talk]]) 13:53, 7 November 2024 (UTC) == [https://meta.wikimedia.org/wiki/Template:Translatable_template Translatable template] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. --> '''Issue Description:''' the template likely uses hardcoded colours and needs to be translated to using the current palette. [[User:JnpoJuwan|JnpoJuwan]] ([[User talk:JnpoJuwan|talk]]) 22:16, 15 December 2024 (UTC) :This template doesn’t use any colors: its sole purpose is to transclude other templates in the appropriate language (although this function is mostly superseded by software features by now and I’m working on removing it wherever possible). The color problems are caused by the template specified as its first parameter (the template it transcludes), so you should report that template/those templates. —[[User:Tacsipacsi|Tacsipacsi]] ([[User talk:Tacsipacsi|talk]]) 20:15, 16 December 2024 (UTC) == [https://meta.wikimedia.org/wiki/Template:Languages Languages] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. --> '''Issue Description:''' the template likely uses hardcoded colours and needs to be translated to using the current palette. [[User:JnpoJuwan|JnpoJuwan]] ([[User talk:JnpoJuwan|talk]]) 22:17, 15 December 2024 (UTC) == [https://meta.wikimedia.org/wiki/Steward_requests/Global Steward requests/Global] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. --> '''Issue Description''' Some links on the mentioned page that are under the "Requests for global (un)block" section, mainly ones that are inside boxes, are rendered in a black color, making them difficult, if not impossible to see what the text is without selecting it. [https://meta.wikimedia.org/wiki/Steward_requests/Global_permissions Steward_requests/Global_permissions] seems to be affected as well. Not sure what other pages on that wiki are affected by this. -<span style="font-family:Lentariso">[[User:GeniusWorkbench4622|Genius]][[User_talk:GeniusWorkbench4622|Workbench]][[Special:Contributions/GeniusWorkbench4622|4622]]</span> 04:19, 15 March 2025 (UTC) == [https://meta.wikimedia.org/wiki/MediaWiki:Gadget-Coloredlinks.css Gadget-Coloredlinks.css] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' the link color for mediawiki being black makes it impossible to read. maybe some of the other colors i haven't seen yet are affected hy this too and could benefit of some change for dark-mode, probably using light-dark(). also affects [[MediaWiki:Gadget-Coloredlinks.css]], and I suspect a lot of other instances where that same file may exist too.<br/>–[[User:joshinils|joshinils]] ([[User Talk:joshinils|talk]] <sup><small>[https://de.wikipedia.org/wiki/Benutzer_Diskussion:joshinils [<u><small>🇩🇪</small>Disk</u>&rsqb;]</small></sup>) 08:26, 22 February 2026 (UTC) == [https://meta.wikimedia.org/wiki/Event:Celebrate_Women Celebrate Women] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' tables are not adapted for dark theme --[[User:Plaga med|Plaga med]] ([[User talk:Plaga med|talk]]) 13:34, 5 March 2026 (UTC) : cc @[[User:GFontenelle (WMF)|GFontenelle (WMF)]]. [[User:SCP-2000|SCP-2000]] ([[User talk:SCP-2000|talk]]) 19:04, 11 March 2026 (UTC) == [https://meta.wikimedia.org/wiki/Template:Ptag Ptag] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' The template does not conform to dark mode. --[[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 07:55, 24 March 2026 (UTC) == [https://meta.wikimedia.org/wiki/User:Pine/sandbox/night_mode_testing Pine/sandbox/night mode testing] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' The text inside of the box, where the text isn't part of a link, isn't changing color to white when night mode is enabled. --[[User:Pine|<span style="color:#01796f;text-shadow:#00BFFF 0 0 1.0em">↠Pine</span>]] [[User talk:Pine|<font color="DeepSkyBlue">(<span style="color:#FFDF00 ;text-shadow:#FFDF00 0 0 1.0em"><b>✉</b></span>)</font>]] 04:25, 1 April 2026 (UTC) == [https://meta.wikimedia.org/wiki/FAQ_for_developer_app_guidelines FAQ for developer app guidelines] dark mode error == <!-- Instructions Please describe how the dark mode colors are making Wikipedia difficult to read. Please include the section of the article where you found the issue. If you know the exact template with the issue, please report it on the template talk page instead for a quicker response. Please write in English. --> '''Issue Description''' The defined background color makes some text (mostly the headers) blend in with it, making it fail the contrast check. Another issue is that some text stays the same color, so just changing the background color to black will cause different text to fail the contrast check. --<span style="font-family:Lentariso">[[User:GeniusWorkbench4622|Genius]][[User_talk:GeniusWorkbench4622|Workbench]][[Special:Contributions/GeniusWorkbench4622|4622]]</span> 18:42, 10 April 2026 (UTC) :{{Done|1=[https://meta.wikimedia.org/w/index.php?title=FAQ_for_developer_app_guidelines&diff=30392935 Fixed.]}} —[[User:Tacsipacsi|Tacsipacsi]] ([[User talk:Tacsipacsi|talk]]) 22:20, 11 April 2026 (UTC) 629uyq26ujv63wo7j1o31oy8l6l2166 Help:Temporary accounts/ro 12 2039046 8364810 8356034 2026-05-04T02:19:06Z ~2026-26904-54 18368037 Created page with "`a`🙏£🙏🙏``a2" 8364810 wikitext text/x-wiki <languages /> [[File:Temporary Accounts - first edit popup.png|400x400px|O notificare privind contul temporar după publicarea primei modificări|alt=Cont temporar - prima modificare popup|thumb]] <span class="mw-translate-fuzzy">Proiectele Wikimedia permit oricui să editeze, cu sau fără crearea unui cont. Atunci când o modificare este făcută prin intermediul unui cont înregistrat, ea este atribuită contului respectiv în diverse jurnale și pagini precum [[$1|Schimbări recente]] sau [[$2|istoricul paginii]]. Similar, atunci când o modificare este efectuată fără un cont, modificarea este atribuită unui '''cont temporar''' generat automat. Un cont temporar este creat în numele editorului neautentificat și va dura o perioadă de 90 de zile. Toate modificările ulterioare efectuate de pe același dispozitiv vor fi atribuite aceluiași cont temporar.</span> `a`🙏£🙏🙏``a2 <span lang="en" dir="ltr" class="mw-content-ltr">Similarly, when an edit is made without an account, the edit is attributed to an auto-generated '''temporary account'''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">A temporary account is created on behalf of the logged-out editor and lasts for a period of 90 days.</span> <span lang="en" dir="ltr" class="mw-content-ltr">All subsequent edits by the same device will be attributed to the same temporary account.</span> <span id="Why_are_temporary_accounts_necessary?"></span> == De ce sunt necesare conturile temporare? == Înainte de introducerea conturilor temporare, modificările efectuate de contribuitorii neautentificați erau atribuite [[:ro:Adresă_IP|adreselor IP]] ale acestora. Adresele IP conțin informații sensibile care pot amenința confidențialitatea și siguranța utilizatorului conectat prin intermediul acestora. Pentru a atenua acest risc la adresa confidențialității utilizatorilor, am decis să introducem conturi temporare. În cadrul acestui nou sistem, adresele IP asociate cu un cont temporar sunt ascunse și doar numele contului temporar este atribuit public unei anumite modificări. <span id="Who_can_see_IP_address_data_associated_with_temporary_accounts?"></span> == Cine poate vedea datele privind adresele IP asociate conturilor temporare? == {{see also|Special:MyLanguage/Trust and Safety Product/Temporary Accounts/Access to IP|l1=Trust and Safety Product/Temporary Accounts/Access to IP}} [[File:IP Info with link to expand to see all IPs.png|400x400px|Funcția Informații despre IP cu date privind conturile temporare|alt=Opțiuni Informații despre IP pentru afișarea cu un cont temporar|thumb]] <span class="mw-translate-fuzzy">Limităm accesul la datele privind adresele IP pentru conturile temporare la utilizatorii care au nevoie de acest acces în scopuri de moderare anti-abuz. Criteriile de acces pentru aceste date sunt formulate într-o politică juridică numită [[$1|Acces la adresele IP ale conturilor temporare]]. Adresa IP utilizată la momentul fiecărei modificări va fi stocată timp de 90 de zile după modificare. După 90 de zile, aceste date vor fi șterse din bazele noastre de date. Pentru a afla toate detaliile despre ce date colectăm și cum le folosim, consultați [[$2|politica de confidențialitate]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access criteria for this data are articulated in a legal policy called [[foundation:Special:MyLanguage/Policy:Access to temporary account IP addresses|Access to temporary account IP addresses]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The IP address used at the time of each edit will be stored for 90 days after the edit.</span> <span lang="en" dir="ltr" class="mw-content-ltr">After 90 days, this data will be deleted from our databases.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To know all the details on what data we collect and how we use it, see our [[foundation:Special:MyLanguage/foundation:Policy:Privacy policy#use|privacy policy]].</span> Moderatorii noștri voluntari vor avea acces la anumite informații privind adresa dvs. de IP. Aceste informații sunt limitate la editorii care au nevoie de ele în scopuri de moderare anti-abuz. Informațiile expuse, criteriile de acces la acestea și scopurile permise de utilizare sunt [[foundation:Special:MyLanguage/Legal:IP_Information_tool_guidelines|detaliate în ghiduri]]. Dacă acest lucru vă creează probleme de securitate personală, vă rugăm să contactați {{@|talktohumanrights|wikimedia.org}} pentru sfaturi. <span id="How_do_temporary_accounts_work?"></span> == Cum funcționează conturile temporare? == [[File:Editing with Temporary Accounts.webm|400x400px|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">A 2-minute video (with subtitles) about editing with a temporary account</span>]] <section begin="how" /> * <span class="mw-translate-fuzzy">Numele conturilor temporare se formează după modelul: <code>~{{CURRENTYEAR}}-12345-6</code> (o tildă, anul curent, un număr generat automat). Utilizatorii nu pot alege sau modifica numele conturilor lor temporare.</span> * <span class="mw-translate-fuzzy">După 90 de zile de la data creării, contul temporar va expira automat. Va înceta să mai poată fi folosit și să mai primească mesaje pe pagina de discuție.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Edits made will still be tracked by page histories and logs, and the talk page of the temporary account will also remain available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, the user will no longer be able to use that account or receive notifications for messages posted on its talk page.</span> * Modificările ulterioare atribuie un nou cont temporar. Cel vechi va fi dezactivat și nu veți mai putea să îl păstrați sau să vă autentificați cu el. <span lang="en" dir="ltr" class="mw-content-ltr">It will be permanently inactive.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The only indication the account has expired is it is no longer used.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There is no flag or message indicating whether a temporary account has expired or not.</span> * Este imposibil să vă conectați la un cont temporar. Nu există parole pentru conturile temporare. * Toate modificările efectuate de pe același dispozitiv și browser vor fi atribuite aceluiași cont temporar, chiar dacă [[:ro:Adresă_IP|adresa IP]] pe care o utilizați se schimbă (de exemplu, dacă editați de acasă și de la o cafenea). Acest lucru se realizează prin plasarea unui cookie de browser care reține contul temporar care v-a fost atribuit. * Conturile temporare nu sunt precum istoricul de navigare sau filele deschise. Dacă aveți un browser sincronizat între dispozitive, vă vor fi atribuite conturi diferite pe dispozitive diferite. Aceasta este o consecință a modului în care funcționează browserele. <span lang="en" dir="ltr" class="mw-content-ltr">If you are worried about this, you may want to create a registered account.</span> * Conturile temporare pot fi dezactivate în orice moment prin încheierea sesiunii sau ștergerea cookie-urilor din browser.<section end="how" /> <span id="Notable_aspects_of_temporary_accounts"></span> == Aspecte notabile ale conturilor temporare == <section begin="notable" /> * Conturile temporare sunt diferite de conturile înregistrate. Ele sunt de scurtă durată și oferă funcții limitate. Nu colectăm date suplimentare pentru conturile temporare în afara celor colectate pentru modificările obișnuite.{{clarify|reason=What's a &quot;regular edit&quot;?}} * Conturile temporare nu au acces la toate funcțiile disponibile pentru utilizatorii autentificați. Unele acțiuni, cum ar fi încărcarea fotografiilor la [[m:Special:MyLanguage/Wikimedia Commons|Commons]], sunt limitate la utilizatorii cu un cont înregistrat. * <span class="mw-translate-fuzzy">Conturile temporare au propriile [[Special:MyLanguage/Help:User page|pagini de utilizator și pagini de discuții]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">In general, a temporary account and a (subsequent) regular user account could be linked. But because of the possible delink, it is technically not allowed in some projects to edit the user page of a temporary account after it has expired or was permanently blocked.</span> * Conturile temporare pot primi [[Special:MyLanguage/Help:Notifications|notificări]] și pot vedea [[Special:MyLanguage/Help:Talk pages#User talk pages|un banner despre mesaje noi pe pagina lor de discuții]]. * <span class="mw-translate-fuzzy">Conturile temporare pot primi [[Special:MyLanguage/Help:Notifications/Thanks|mulțumiri]] de la editorii autentificați.</span> * Conturile temporare pot [[Special:MyLanguage/Help:Notifications/Types#Mentions|menționa]] alți utilizatori, iar aceștia le pot menționa la rândul lor.<section end="notable" /> <span id="Creating_a_permanent_account"></span> == Crearea unui cont permanent == În orice moment, puteți alege să [[Special:CreateAccount|creați un cont înregistrat, permanent]]. Conturile înregistrate oferă cea mai bună protecție a confidențialității și oferă multe setări de preferințe pentru personalizare. Înregistrarea unui cont permanent este rapidă și ușoară. Nu aveți nevoie de o adresă de e-mail pentru a crea un cont înregistrat. <span class="mw-translate-fuzzy">Modificările și alte activități nu vor fi preluate. Totuși, pe noua pagină de utilizator a contului dvs. înregistrat puteți plasa o legătură spre vechea pagină de utilizator a contului temporar.</span> <span id="See_also"></span> == Vezi și == * [[{{#special:CreateAccount}}]] – <span class="mw-translate-fuzzy">pentru a crea un cont</span> <span lang="en" dir="ltr" class="mw-content-ltr">(this won’t create a temporary account)</span> * {{ll|Trust and Safety Product/Temporary Accounts}} – proiect WMF asociat * {{ll|Trust and Safety Product/Temporary Accounts/For developers}} – informații tehnice [[Category:Temporary Accounts{{#translation:}}]] r6ezwjrutypkezamia5j96mawwfyot5 8364863 8364810 2026-05-04T03:42:41Z 94rain 14443205 Not a translation 8364863 wikitext text/x-wiki <languages /> [[File:Temporary Accounts - first edit popup.png|400x400px|O notificare privind contul temporar după publicarea primei modificări|alt=Cont temporar - prima modificare popup|thumb]] <span class="mw-translate-fuzzy">Proiectele Wikimedia permit oricui să editeze, cu sau fără crearea unui cont. Atunci când o modificare este făcută prin intermediul unui cont înregistrat, ea este atribuită contului respectiv în diverse jurnale și pagini precum [[$1|Schimbări recente]] sau [[$2|istoricul paginii]]. Similar, atunci când o modificare este efectuată fără un cont, modificarea este atribuită unui '''cont temporar''' generat automat. Un cont temporar este creat în numele editorului neautentificat și va dura o perioadă de 90 de zile. Toate modificările ulterioare efectuate de pe același dispozitiv vor fi atribuite aceluiași cont temporar.</span> <span lang="en" dir="ltr" class="mw-content-ltr">When an edit is made through a registered account, the edit is attributed to the respective account in various logs and pages like [[Special:MyLanguage/Help:Recent changes|Recent Changes]] or [[Special:MyLanguage/Help:History|page history]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Similarly, when an edit is made without an account, the edit is attributed to an auto-generated '''temporary account'''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">A temporary account is created on behalf of the logged-out editor and lasts for a period of 90 days.</span> <span lang="en" dir="ltr" class="mw-content-ltr">All subsequent edits by the same device will be attributed to the same temporary account.</span> <span id="Why_are_temporary_accounts_necessary?"></span> == De ce sunt necesare conturile temporare? == Înainte de introducerea conturilor temporare, modificările efectuate de contribuitorii neautentificați erau atribuite [[:ro:Adresă_IP|adreselor IP]] ale acestora. Adresele IP conțin informații sensibile care pot amenința confidențialitatea și siguranța utilizatorului conectat prin intermediul acestora. Pentru a atenua acest risc la adresa confidențialității utilizatorilor, am decis să introducem conturi temporare. În cadrul acestui nou sistem, adresele IP asociate cu un cont temporar sunt ascunse și doar numele contului temporar este atribuit public unei anumite modificări. <span id="Who_can_see_IP_address_data_associated_with_temporary_accounts?"></span> == Cine poate vedea datele privind adresele IP asociate conturilor temporare? == {{see also|Special:MyLanguage/Trust and Safety Product/Temporary Accounts/Access to IP|l1=Trust and Safety Product/Temporary Accounts/Access to IP}} [[File:IP Info with link to expand to see all IPs.png|400x400px|Funcția Informații despre IP cu date privind conturile temporare|alt=Opțiuni Informații despre IP pentru afișarea cu un cont temporar|thumb]] <span class="mw-translate-fuzzy">Limităm accesul la datele privind adresele IP pentru conturile temporare la utilizatorii care au nevoie de acest acces în scopuri de moderare anti-abuz. Criteriile de acces pentru aceste date sunt formulate într-o politică juridică numită [[$1|Acces la adresele IP ale conturilor temporare]]. Adresa IP utilizată la momentul fiecărei modificări va fi stocată timp de 90 de zile după modificare. După 90 de zile, aceste date vor fi șterse din bazele noastre de date. Pentru a afla toate detaliile despre ce date colectăm și cum le folosim, consultați [[$2|politica de confidențialitate]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The access criteria for this data are articulated in a legal policy called [[foundation:Special:MyLanguage/Policy:Access to temporary account IP addresses|Access to temporary account IP addresses]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">The IP address used at the time of each edit will be stored for 90 days after the edit.</span> <span lang="en" dir="ltr" class="mw-content-ltr">After 90 days, this data will be deleted from our databases.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To know all the details on what data we collect and how we use it, see our [[foundation:Special:MyLanguage/foundation:Policy:Privacy policy#use|privacy policy]].</span> Moderatorii noștri voluntari vor avea acces la anumite informații privind adresa dvs. de IP. Aceste informații sunt limitate la editorii care au nevoie de ele în scopuri de moderare anti-abuz. Informațiile expuse, criteriile de acces la acestea și scopurile permise de utilizare sunt [[foundation:Special:MyLanguage/Legal:IP_Information_tool_guidelines|detaliate în ghiduri]]. Dacă acest lucru vă creează probleme de securitate personală, vă rugăm să contactați {{@|talktohumanrights|wikimedia.org}} pentru sfaturi. <span id="How_do_temporary_accounts_work?"></span> == Cum funcționează conturile temporare? == [[File:Editing with Temporary Accounts.webm|400x400px|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">A 2-minute video (with subtitles) about editing with a temporary account</span>]] <section begin="how" /> * <span class="mw-translate-fuzzy">Numele conturilor temporare se formează după modelul: <code>~{{CURRENTYEAR}}-12345-6</code> (o tildă, anul curent, un număr generat automat). Utilizatorii nu pot alege sau modifica numele conturilor lor temporare.</span> * <span class="mw-translate-fuzzy">După 90 de zile de la data creării, contul temporar va expira automat. Va înceta să mai poată fi folosit și să mai primească mesaje pe pagina de discuție.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Edits made will still be tracked by page histories and logs, and the talk page of the temporary account will also remain available.</span> <span lang="en" dir="ltr" class="mw-content-ltr">However, the user will no longer be able to use that account or receive notifications for messages posted on its talk page.</span> * Modificările ulterioare atribuie un nou cont temporar. Cel vechi va fi dezactivat și nu veți mai putea să îl păstrați sau să vă autentificați cu el. <span lang="en" dir="ltr" class="mw-content-ltr">It will be permanently inactive.</span> <span lang="en" dir="ltr" class="mw-content-ltr">The only indication the account has expired is it is no longer used.</span> <span lang="en" dir="ltr" class="mw-content-ltr">There is no flag or message indicating whether a temporary account has expired or not.</span> * Este imposibil să vă conectați la un cont temporar. Nu există parole pentru conturile temporare. * Toate modificările efectuate de pe același dispozitiv și browser vor fi atribuite aceluiași cont temporar, chiar dacă [[:ro:Adresă_IP|adresa IP]] pe care o utilizați se schimbă (de exemplu, dacă editați de acasă și de la o cafenea). Acest lucru se realizează prin plasarea unui cookie de browser care reține contul temporar care v-a fost atribuit. * Conturile temporare nu sunt precum istoricul de navigare sau filele deschise. Dacă aveți un browser sincronizat între dispozitive, vă vor fi atribuite conturi diferite pe dispozitive diferite. Aceasta este o consecință a modului în care funcționează browserele. <span lang="en" dir="ltr" class="mw-content-ltr">If you are worried about this, you may want to create a registered account.</span> * Conturile temporare pot fi dezactivate în orice moment prin încheierea sesiunii sau ștergerea cookie-urilor din browser.<section end="how" /> <span id="Notable_aspects_of_temporary_accounts"></span> == Aspecte notabile ale conturilor temporare == <section begin="notable" /> * Conturile temporare sunt diferite de conturile înregistrate. Ele sunt de scurtă durată și oferă funcții limitate. Nu colectăm date suplimentare pentru conturile temporare în afara celor colectate pentru modificările obișnuite.{{clarify|reason=What's a &quot;regular edit&quot;?}} * Conturile temporare nu au acces la toate funcțiile disponibile pentru utilizatorii autentificați. Unele acțiuni, cum ar fi încărcarea fotografiilor la [[m:Special:MyLanguage/Wikimedia Commons|Commons]], sunt limitate la utilizatorii cu un cont înregistrat. * <span class="mw-translate-fuzzy">Conturile temporare au propriile [[Special:MyLanguage/Help:User page|pagini de utilizator și pagini de discuții]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">In general, a temporary account and a (subsequent) regular user account could be linked. But because of the possible delink, it is technically not allowed in some projects to edit the user page of a temporary account after it has expired or was permanently blocked.</span> * Conturile temporare pot primi [[Special:MyLanguage/Help:Notifications|notificări]] și pot vedea [[Special:MyLanguage/Help:Talk pages#User talk pages|un banner despre mesaje noi pe pagina lor de discuții]]. * <span class="mw-translate-fuzzy">Conturile temporare pot primi [[Special:MyLanguage/Help:Notifications/Thanks|mulțumiri]] de la editorii autentificați.</span> * Conturile temporare pot [[Special:MyLanguage/Help:Notifications/Types#Mentions|menționa]] alți utilizatori, iar aceștia le pot menționa la rândul lor.<section end="notable" /> <span id="Creating_a_permanent_account"></span> == Crearea unui cont permanent == În orice moment, puteți alege să [[Special:CreateAccount|creați un cont înregistrat, permanent]]. Conturile înregistrate oferă cea mai bună protecție a confidențialității și oferă multe setări de preferințe pentru personalizare. Înregistrarea unui cont permanent este rapidă și ușoară. Nu aveți nevoie de o adresă de e-mail pentru a crea un cont înregistrat. <span class="mw-translate-fuzzy">Modificările și alte activități nu vor fi preluate. Totuși, pe noua pagină de utilizator a contului dvs. înregistrat puteți plasa o legătură spre vechea pagină de utilizator a contului temporar.</span> <span id="See_also"></span> == Vezi și == * [[{{#special:CreateAccount}}]] – <span class="mw-translate-fuzzy">pentru a crea un cont</span> <span lang="en" dir="ltr" class="mw-content-ltr">(this won’t create a temporary account)</span> * {{ll|Trust and Safety Product/Temporary Accounts}} – proiect WMF asociat * {{ll|Trust and Safety Product/Temporary Accounts/For developers}} – informații tehnice [[Category:Temporary Accounts{{#translation:}}]] n65dps5lzodm42yk5qcpyt7rwdhbs15 Help:Contents/kge 12 2041253 8364667 8281166 2026-05-03T18:45:24Z ~2026-26740-81 18367839 8364667 wikitext text/x-wiki <languages /> {{PD Help Page}} ''[[Special:MyLanguage/Communication|Ajuko partanyaan tentang parangkat luyak MediaWiki.]]'' <span id="Welcome_to_MediaWiki.org_help_pages"></span> == Salamat ratong di halaman katulungan MediaWiki.org == {{ambox |type=notice |image=[[File:Codex icon help notice-blue.svg|45px|alt=|link=]] |text= '''Situs katulungan say bih untuk aplikasi wiki MediaWiki gawoh.''' Lamon wiki say tidukung bak MediaWiki uwat kahikan guk halaman hasa. <span class="mw-translate-fuzzy">Man Niku ratong guk ja jak wiki barih untuk nyopok katulungan say mak tikahik rik parangkat luyak MediaWiki, informasi sa mak bakal nulungi.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|differences between Wikipedia, Wikimedia, MediaWiki, and wiki}}.</span> }} {{ContentGrid |content = <!-- nowiki markers are added so the first bullet in the list are rendered correctly! please don't remove those markers, thank you --> {{InfoCard |heading = [[File:OOjs_UI_icon_article-ltr.svg|class=skin-invert|20px|link=]] Ambaca |content = <nowiki /> * {{ll|Help:Searching|nsp=0}} ** {{ll|Help:Go button|nsp=0}} * {{ll|Help:Namespaces|nsp=0}} * {{ll|Help:Navigation|nsp=0}} * {{ll|Help:Printing|nsp=0}} * {{ll|Help:History|nsp=0}} * {{ll|Help:Diff|nsp=0}} * {{ll|Help:Keyboard shortcuts|nsp=0}} }} {{InfoCard |heading = [[File:OOjs_UI_icon_edit-ltr.svg|class=skin-invert|20px|link=]] Pandandanan |content = <nowiki /> * {{ll|Help:Logging in|nsp=0}} * {{ll|Help:Editing pages|nsp=0}} ** {{ll|Help:Editing FAQ|nsp=0}} * {{ll|Help:Preview|nsp=0}} * {{ll|Help:Reverting|nsp=0}} * {{ll|Help:Edit summary|nsp=0}} * {{ll|Help:Starting a new page|nsp=0}} * {{ll|Help:Formatting|nsp=0}} * {{ll|Help:Links|nsp=0}} * {{ll|Help:User page|nsp=0}} * {{ll|Help:Talk pages|nsp=0}} * {{ll|Help:Signatures|nsp=0}} * {{ll|Help:Section|nsp=0}} * {{ll|Help:VisualEditor/User guide|2=Penyunting Visual}} * {{ll|Help:Tracking changes|nsp=0}} ** {{ll|Help:Recent changes|nsp=0}} ** {{ll|Help:New filters for edit review|2=Paningkatan parubahan paling ganta}} ** {{ll|Help:Related changes|nsp=0}} ** {{ll|Help:User contributions|nsp=0}} * {{ll|Help:Minor edit|nsp=0}} * {{ll|Help:Watchlist|nsp=0}} * {{ll|Help:Reference card|nsp=0}} }} {{InfoCard |heading = [[File:OOjs_UI_icon_academic.svg|class=skin-invert|30px|link=]]Pandandanan lanjutan |content = <nowiki /> * {{ll|Help:Advanced editing|nsp=0}} - Nginju'i gambaran umum tentang lamon fitur di bah sa * {{ll|Help:Edit conflict|nsp=0}} * {{ll|Help:Images|nsp=0}} * {{ll|Help:Lists|nsp=0}} * {{ll|Help:URL|nsp=0}} * {{ll|Help:Extension:Cite|2=Catatan Kukut}} * {{ll|Help:Tables|nsp=0}} ** {{ll|Help:Sortable tables|nsp=0}} * {{ll|Help:Categories|nsp=0}} * {{ll|Help:Subpages|nsp=0}} * {{ll|Help:Managing files|nsp=0}} * {{ll|Help:Moving a page|2=Pamindahan (pangubahan judul) laman}} * {{ll|Help:Redirects|nsp=0}} * {{ll|Help:Protected pages|nsp=0}} * {{ll|Help:Templates|nsp=0}} ** {{ll|Help:Transclusion|nsp=0}} ** {{ll|Help:Substitution|nsp=0}} * {{ll|Help:System message|nsp=0}} * {{ll|Help:Magic words|nsp=0}} * {{ll|Help:Namespaces|nsp=0}} * {{ll|Help:Cite|2=Rujukan}} * {{ll|Help:Special pages|nsp=0}} * {{ll|Help:External searches|nsp=0}} * {{ll|Help:HTML in wikitext|nsp=0}} ** {{ll|Help:Text color|nsp=0}} * {{ll|Help:Pre-save transform|nsp=0}} * {{ll|Help:Export|nsp=0}} * {{ll|Help:Bots|nsp=0}} * {{ll|Help:Page size|nsp=0}} * {{ll|Help:Special characters|nsp=0}} * {{ll|Help:Wikitext examples|nsp=0}} }} {{InfoCard |heading = [[File:OOjs_UI_icon_speechBubbles-ltr.svg|class=skin-invert|20px|link=]] Kolaborasi |content = <nowiki /> * {{ll|Help:Notifications|nsp=0}} }} {{InfoCard |heading = [[File:OOjs UI icon advanced.svg|class=skin-invert|20px|link=]] Pangubahsuwayan pribadi |content = <nowiki /> * {{ll|Help:Preferences|nsp=0}} * {{ll|Help:Skins|nsp=0}} }} {{InfoCard |heading = [[File:OOjs UI icon desktop.svg|class=skin-invert|20px|link=]] Pangabalaan wiki |content = <nowiki /> * {{ll|Help:Sysops and permissions|nsp=0}} Fitur-fitur di bah sa morluko hak akses adisi say umumna mak tiunjukko guk kaunyin pamakay wiki. * {{ll|Help:Protecting and unprotecting pages|nsp=0}} * {{ll|Help:Deletion and undeletion|nsp=0}} * {{ll|Help:Patrolled edits|nsp=0}} * {{ll|Help:Blocking users|nsp=0}} * {{ll|Help:Range blocks|2=Pamblokiran kisaran IP}} * {{ll|Help:User rights and groups|nsp=0}} * {{ll|Help:Import|nsp=0}} }} }} [[Category:Help{{#translation:}}| ]] __NOTOC__ qzja6el449wp4b7m8tdld5k3tf148n5 Translations:Help:Contents/22/kge 1198 2041261 8364666 6795025 2026-05-03T18:45:23Z ~2026-26740-81 18367839 8364666 wikitext text/x-wiki Penyunting Visual 4j2zkifn7fyk93zb5kkh7j8cs78iqhh Translations:Help:Extension:Translate/Validators/171/ja 1198 2048127 8364882 6817994 2026-05-04T04:03:15Z Shirayuki 472859 8364882 wikitext text/x-wiki メッセージ パラメーター nn1yhy8oxls268f75x5bwi5vcyo2s1x Extension talk:DiscussionTools 103 2063067 8364755 8273896 2026-05-03T21:42:55Z RoyZuo 17340036 /* Non-lv2 sections */ Reply 8364755 wikitext text/x-wiki {{User:Dexbot/Archivebot |archive = Extension talk:DiscussionTools/Archive %(counter)d |algo = old(180d) |counter = 1 |maxarchivesize = 50K |archiveheader = {{Archive}} |minthreadstoarchive = 1 |minthreadsleft = 1 }} {{Archive box| * [[/Flow]] {{Archive list|auto = long}} }} == Non-lv2 sections == Some projects uses section headers lower than level 2 for discussion header, notably: * [[c:COM:DR|Commons Deletion Requests]] * [[:m:SR|meta's Stewards requests]] * [[:en:WP:CHUS|English Wikipedia Changing Usernames]] * [[:en:WP:PERM|English Wikipedia Requests for Permissions]] Since most of these pages are organized into subpages, maybe some json config in MediaWiki ns that allows local wikis to specify 'subpages of these pages should be using these section levels'? Filing here as I dunno if this has been already reported or needs more… discussion. :-p &mdash;&nbsp;[[User:Revi C.|<span style="color:green;font-family:Courier new, serif;font-variant:small-caps">Revi</span>]] 06:01, 27 November 2025 (UTC) :I found this page with the same wish of asking for more customisation so that the tool can be enabled for pages like [[c:Commons:Categories for discussion/2025/03/Category:Screenshot images from VOGUE Taiwan YouTube account]] [[c:Commons:Deletion requests/Files in Category:Art]]. their ns cannot be listed as wgExtraSignatureNamespaces and these pages should not have NEWSECTIONLINK, so the 3 current conditions all fail for these pages. [[User:RoyZuo|RoyZuo]] ([[User talk:RoyZuo|talk]]) 21:42, 3 May 2026 (UTC) == Bug == DiscussionTools with bot user right does not mark as bot in recentchanges when replying with this tool. [[Special:Contributions/&#126;2025-37864-69|&#126;2025-37864-69]] ([[User talk:&#126;2025-37864-69|talk]]) 00:08, 2 December 2025 (UTC) 4sx9d9ghxs7m3z7wwdcrmr9ahtgqujr Extension:TimedMediaHandler/VideoJS Player/pl 102 2064938 8364363 8363692 2026-05-03T13:12:18Z FuzzyBot 451990 Updating to match new version of source page 8364363 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|<span lang="en" dir="ltr" class="mw-content-ltr">Screenshot of the VideoJS player in action</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is based on [https://videojs.com/ VideoJS], and has a modern, fast user interface with compatibility with mobile devices and HTML5. </div> <span id="Usage"></span> == Użycie == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|<span lang="en" dir="ltr" class="mw-content-ltr">Example video player</span>]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using tab, enter and spacebar keys</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Known issues == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The video player is still in development, but if you find any problems, please report these on the [[Extension_talk:TimedMediaHandler/VideoJS Player|talk page]] or file them in [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note |1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span> |2=gotcha }} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> mpci8wbcfdn1cxcdb1hvy67c9znizqf 8364780 8364363 2026-05-03T23:14:42Z FuzzyBot 451990 Updating to match new version of source page 8364780 wikitext text/x-wiki <languages/> {{ptag|TimedMediaHandler-Player}} [[File:Screenshot of TimedMediaHandler using VideoJS with Big Buck Bunny.png|thumb|upright=2|<span lang="en" dir="ltr" class="mw-content-ltr">Screenshot of the VideoJS player in action</span>]] <div lang="en" dir="ltr" class="mw-content-ltr"> The '''VideoJS Player''' is the video player for MediaWiki on Wikimedia projects. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> It is based on [https://videojs.com/ VideoJS], and has a modern, fast user interface with compatibility with mobile devices and HTML5. </div> <span id="Usage"></span> == Użycie == [[File:Elephants_Dream_(2006).webm|300px|thumb|thumbtime=5|<span lang="en" dir="ltr" class="mw-content-ltr">Example video player</span>]] [[File:Armstrong Small Step.ogg|thumb|<span lang="en" dir="ltr" class="mw-content-ltr">Example audio player</span>]] <span lang="en" dir="ltr" class="mw-content-ltr">There is both an audio and video player.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can find examples of both players on this page.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Once launched you will see a control bar when interacting with the video.</span> [[File:VideoJS controlbar.png|frameless|350px]] <span lang="en" dir="ltr" class="mw-content-ltr">The controls in order from left to right are:</span> <!-- do not turn into block translation, i'll be adding screenshots of the controls.--> * [[File:VideoJS play pause control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Play/pause control</span> * [[File:VideoJS volume control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Volume control</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Playback position</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Remaining playback time</span> * [[File:VideoJS subtitle control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Subtitle language selector and subtitle style controls</span> * [[File:VideoJS resolution control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Resolution selector</span> * [[File:VideoJS picture-in-picture control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Optional Picture-in-Picture control</span> * [[File:VideoJS fullscreen control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Fullscreen control</span> * [[File:VideoJS file description control.png|30px|]]&nbsp;<span lang="en" dir="ltr" class="mw-content-ltr">Info button to take you to the file description page</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Mouse and keyboard controls === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">Click the play icon above the thumbnail to begin playback of the media file.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Right click or middle click the thumbnail to open the file description page</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Play/Pause the player with a single mouse click inside the player window</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Double click the player window to enter or leave fullscreen mode</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The following keyboard controls are available:</span> *; {{Key press|k}} / {{Key press|Space}} : <span lang="en" dir="ltr" class="mw-content-ltr">Play/pause the media playback</span> *; {{Key press|f}} : <span lang="en" dir="ltr" class="mw-content-ltr">Enter/Leave fullscreen</span> *; {{Key press|m}} : <span lang="en" dir="ltr" class="mw-content-ltr">Mute the audio</span> *; {{Key press|c}} / {{Key press|s}} : <span lang="en" dir="ltr" class="mw-content-ltr">Toggle subtitles on / off</span> *; {{Key press|&lt;}} / {{Key press|&gt;}} : <span lang="en" dir="ltr" class="mw-content-ltr">Decrease and increase playback speed</span> *; {{Key press|←}} / {{Key press|→}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 5 seconds back / forward</span> *; {{Key press|j}} / {{Key press|l}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip 10 seconds back / forward</span> *; {{Key press|Home}} / {{Key press|End}} : <span lang="en" dir="ltr" class="mw-content-ltr">Skip to start / end of video</span> *; {{Key press|,}} / {{Key press|.}} : <span lang="en" dir="ltr" class="mw-content-ltr">When paused, skip 1 frame back or forward</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The player is fully keyboard accessible using {{Key press|Tab}}, {{Key press|Enter}} and {{Key press|Space}} keys</span> <div lang="en" dir="ltr" class="mw-content-ltr"> == Known issues == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The video player is still in development, but if you find any problems, please report these on the [[Extension_talk:TimedMediaHandler/VideoJS Player|talk page]] or file them in [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=videojs_player Phabricator]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Developers == </div> <span lang="en" dir="ltr" class="mw-content-ltr">Developers working on features that use the Video.js player will need to initialize and configure it appropriately.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below is an example of typical usage.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === Basic Configuration Example === </div> {{Note|1=<span lang="en" dir="ltr" class="mw-content-ltr">This is outdated and should be reworked to make use of our player wrappers, which apply consistent options and settings for videojs playback.</span>|2=gotcha}} <syntaxhighlight lang="js"> // The first argument can be a string ID or a <video> element var player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: "https://path/to/poster/image" sources: [ /* array of source files in various sizes and formats */ ] } ); </syntaxhighlight> <span lang="en" dir="ltr" class="mw-content-ltr">The <code>sources</code> can also be provided in the HTML {{tag|video|open}} element instead of in JS:</span> <syntaxhighlight lang="html"> <video class="video-js"> <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"> </video> </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> === Advanced configuration with Ogv.js support === </div> <span lang="en" dir="ltr" class="mw-content-ltr">If you need cross-platform playback of OGG or WebM files (many files in Commons are in these formats), you can use the [https://github.com/hartman/videojs-ogvjs Ogv.js plugin for Video.js], which is also included in TimedMediaHandler.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example configuration:</span> <syntaxhighlight lang="js"> var player; // Load the appropriate modules in ResourceLoader mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () { // Load ogvjs if necessary; when this promise resolves, // all necessary code has been loaded return mw.OgvJsSupport.loadIfNeeded(); } ).then( function () { player = videojs( 'my-player-id', { controls: true, autoplay: false, poster: 'https://path/to/my/image', sources: [ /* array of sources */ ], // Ogv.js-specific configuration ogvjs: { base: mw.OgvJsSupport.basePath() } } ); } ); </syntaxhighlight> 2u4es0uwu8v0g5hm6gj49nu4aiq1o9d Category:Time/th 14 2065646 8364451 6880100 2026-05-03T15:44:21Z Hiyuune 17854348 Created page with "$1" 8364451 wikitext text/x-wiki <languages /> [[Category:MediaWiki components{{#translation:}}]] na0nbjk82ivoahnb20sa6kbhyph7ykw Project:Support desk 4 2084484 8364757 8363485 2026-05-03T22:14:48Z Draheinsunvale 17524502 /* Is the Special:RestSandbox page available for third-party wikis (i.e. external installations)? */ new section 8364757 wikitext text/x-wiki {{Project:Support desk/Header/{{int:lang}}}} {{Auto archiving |archive = Project:Support desk/Archive %(counter)d |algo = old(14d) |counter = 25 |maxarchivesize = 250K |minthreadsleft = 2 |minthreadstoarchive = 1 |archiveheader = {{talk archive}} }} == request to have [[Special:Tags]] sorted by tag name == {{tracked|T424105}}Better to have alphabetical order in first column of [[Special:Tags]] to find easily one's tag. Thanks. [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 17:55, 19 April 2026 (UTC) :@[[User:Wladek92|Wladek92]] See [[How to report a bug]]. [[User:Malyacko|Malyacko]] ([[User talk:Malyacko|talk]]) 12:49, 21 April 2026 (UTC) ::is that a bug ? rather an improvement. Confirmed: it is a ''feature request'' -- [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 18:35, 21 April 2026 (UTC) :::The first sentence on the linked page says: "These guidelines explain how to write a good bug report or feature request". [[User:Malyacko|Malyacko]] ([[User talk:Malyacko|talk]]) 10:14, 22 April 2026 (UTC) == why edit section link is missing on pages ? == {{tracked|T424198}} I have observed a difference on the section title of the rendered pages I cannot explain logically. Here it is : On page Extension:InlineComments I click the following title from the TOC, i.e. -> https://www.mediawiki.org/wiki/Extension:InlineComments#Download<br/> and there is '''no 'Edit section' link''' beside the section title 'Download' On page Wikimedia_Research I click the following title from the TOC, i.e. -> https://www.mediawiki.org/wiki/Wikimedia_Research#Mandate<br/> and '''there is an 'Edit section'''' link beside the title 'Mandate' shown as [ [https://www.mediawiki.org/w/index.php?title=Wikimedia_Research&action=edit&section=1 edit] ] <u>Question:</u> why the Edit section link is sometimes present, sometimes absent beside the title ? Thanks. [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:21, 20 April 2026 (UTC) :I think it's because extension pages use [[Template:Extension]] which contains <code><nowiki>{{#if:{{TRANSLATABLEPAGE}}|__NOEDITSECTION__}}</nowiki></code>. See [[Help:Magic words]]. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 11:04, 20 April 2026 (UTC) ::thanks, but this should be transparent to the editor: from an external point of view, I only want to use the functionality to update a section regardless to the code hidden behind and independently of the used namespace.<br/>I add for reference -> https://www.mediawiki.org/wiki/Help:Section/Editing_sections_of_included_templates. ::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 12:17, 20 April 2026 (UTC) :::I think it's because the way translation is done on this website is a bit of a mess. Well, it seems to work well, but leaves the wikitext in a mess. Maybe editing sections in that context (i.e. translation system plus the extension template) would make it worse. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 10:32, 21 April 2026 (UTC) ::::@[[User:Jonathan3|Jonathan3]], I agree. The translations can make the edit button not appear. [[User:Floating Orb|Floating Orb]] ([[User talk:Floating Orb|talk]]) 03:18, 23 April 2026 (UTC) :::::thanks for your support, track added. The edit possibility is expected on the root EN page (else the translated pages are using messages and there is ''normally'' no edit button there). :::::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 09:54, 23 April 2026 (UTC) == Photo = File == [[MediaWiki:Mobile-frontend-editor-uploadenable]]: Please replace the word "photo" here with "file", its not for just "photo". Sincerely, [[User:Qədir|Qədir]] ([[User talk:Qədir|talk]]) 20:57, 23 April 2026 (UTC) == Categories not sorting content properly and next/previous page broken? == I don't know how to describe the problem succinctly, so I'll give a simple example to start: <nowiki>https://fireemblemwiki.org/wiki/Category:Navigation_templates</nowiki> this category has 222 pages. If you click the "next" button, you are taken to a page with only one categorized item, 21 pages are missing from the listing. Then, if you click previous page, it sorts the categories starting from A instead of 0 and gives "The following 193 pages are in this category, out of 222 total.", if you click previous again (meaning the category is '''2 pages long going forward''' but '''3 pages long going backwards''') you get a page showing entries sorted as 0 to A comprising "The following 29 pages are in this category, out of 222 total.". Additionally, alphabetization seems to be behaving oddly. New files are being put at the end of the category, sorted alphabetically. So for example, If I upload "Carl.png" to ExampleCategory, the category will become "Bob.png, Sam.png, Tim.png, '''Carl.png'''". Instead of the expected "Bob.png, '''Carl.png''', Sam.png, Tim.png". This has progressed to "Bob.png, Sam.png, Tim.png, '''Alfred.png, Carl.png, Dan.png, Ed.png'''" in more active categories. Example of the alphabetization issue: fireemblemwiki.org/wiki/Category:Yutona_Heroes_War_Chronicles_portraits "Portrait yuni trs01.png, Portrait zacharia trs01.png, Portrait zeek 01 trs01.png, '''Portrait charlent trs01.png, Portrait golgotha trs01.png'''" What is gong on here? I'm only an editor so I'm not sure how to diagnose this, and when I asked the backend guys they said none of the extensions should be breaking categories, and that it might be a 1.43 feature change? But I don't understand what this feature would be. I don't think it's being caused by anything obvious like sortkeys or cache issues, it's been like this for about six months. I've also tried a few things like editing the category page with some minor edit to make it update, but that doesn't seem to help. It also happens if I look around the category pages while logged out. [[Special:Contributions/&#126;2026-25342-15|&#126;2026-25342-15]] ([[User talk:&#126;2026-25342-15|talk]]) 02:02, 25 April 2026 (UTC) == How to find out when a certain Namespace is used across the wikis? == Hello! I'll just give an example right away. If I wanted to know all the instances (of the several Wikisource projects in the Wikimedia world) where a special namespace usually called "Author:" (in English) is used, while it does not have a fixed number but varies from project to project ([https://en.wikisource.org/wiki/Special:NamespaceInfo en/102] or [https://es.wikisource.org/wiki/Especial:NamespaceInfo es/106]], how would I do that? [[User:Pxos|Pxos]] ([[User talk:Pxos|talk]]) 14:21, 26 April 2026 (UTC) == Good starting doc for editing templates == Any recommendations for good starting points for editing templates on a MediaWiki install? I've found * https://www.mediawiki.org/wiki/Help:Templates * https://en.wikipedia.org/wiki/Help:A_quick_guide_to_templates * https://en.wikipedia.org/wiki/Help:Template but I'm finding them challenging to learn from. Are there any I've missed? Maybe some "unofficial" documents or articles or blogposts I should read? [[User:Bsammon|Bsammon]] ([[User talk:Bsammon|talk]]) 00:43, 27 April 2026 (UTC) :A good starting point is looking at existing templates. Ask a specific question about what you're trying to do :-) [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 12:54, 29 April 2026 (UTC) ::use also the sandbox and write testcases to see how parameters react and follow the code source ::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:53, 1 May 2026 (UTC) == 1.43 CheckUser Internal Error == When attempting to execute CheckUser inquiries on 1.43, I can run the "Get IP Addresses" for a registered account and the "Get Users" for an IP address without issue. But attempting to run the "Get Actions" for either registered or unregistered, as well as attempting to use Special:Investigate, both throw the fatal exception/internal error: <code>[afDsJx7ifTZnjjMNwX4hMwAFmxo] /index.php?title=Special:CheckUser Error: Class "Firebase\JWT\JWT" not found</code> Yet strangely these actions are still logged in the CU log, even though I can't view any data from them. [[User:The Boston Railfan|The Boston Railfan]] ([[User talk:The Boston Railfan|talk]]) 17:23, 28 April 2026 (UTC) :There's a similar question here - [[Topic%3AWgcydicxa790v7io]] - and the answer was to run <code>composer update --no-dev</code>. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 12:53, 29 April 2026 (UTC) == Marking [sic] text or creating a custom tag == I'm using my wiki to collaboratively transcribe old documents. With this, I need to balance accurately transcribing the text and fixing outdated or incorrect usages. Is there a way I can markup this text? And if one doesn't already exist, is it possible to make my own custom tags? "The ((Berenstein|Berenstain)) Bears is a children's literature franchise." [[Special:Contributions/&#126;2026-26583-63|&#126;2026-26583-63]] ([[User talk:&#126;2026-26583-63|talk]]) 12:46, 1 May 2026 (UTC) :Is it possible to write a custom parser extension that registers new bracket syntaxes? I want to avoid heavy syntax like <nowiki>{{#sic:Berenstein|Berenstain}}</nowiki> or <sic>Berenstein|Berenstain</sic>. [[Special:Contributions/&#126;2026-26583-63|&#126;2026-26583-63]] ([[User talk:&#126;2026-26583-63|talk]]) 12:57, 1 May 2026 (UTC) == Distinguish articles within categories == Hello! I am a user of the Kurdish Wiktionary. My problem is that several variants of the same word appear in the same category without it being possible to distinguish them. It sometimes happens that within the same category, there are more variants than standard words... I would therefore like to know if it is technically possible to display a page using a given template in a category with a specific color or symbol (as is the case for page redirects which are displayed in italics)? [[User:Ghybu|Ghybu]] ([[User talk:Ghybu|talk]]) 16:06, 1 May 2026 (UTC) == Add topic == [https://www.mediawiki.org/wiki/Project:Support_desk#Post_a_new_question This page] says: "4. To start a new thread, click the box with the text Add topic." But... there IS no such button. - [[User:Erik Baas|Erik Baas]] ([[User talk:Erik Baas|talk]]) 07:27, 2 May 2026 (UTC) == PageSaveComplete Hook and rendered HTML == I'm trying to store the rendered html of articles in my main namespace. Right now I'm trying to save them as a file trying to get it to work, but then I plan on saving it in a database. I'm using MediaWiki 1.43.8. <pre>$wgHooks['PageSaveComplete'][] = function($wikiPage, $user, $summary, $flags, $revisionRecord, $editResult){ if($wikiPage->getTitle()->getNamespace() !== NS_MAIN) return true; $title = $wikiPage->getTitle(); $pageName = $title->getPrefixedDBkey(); $services = MediaWiki\MediaWikiServices::getInstance(); $content = $revisionRecord->getContent(MediaWiki\Revision\SlotRecord::MAIN); $renderer = $services->getContentRenderer(); file_put_contents('test1.html', 'test 1'); $parserOptions = $services->getParserFactory()->getParserOptionsFactory()->newOptions(); file_put_contents('test2.html', 'test 2'); $parserOutput = $renderer->getParserOutput($content, $title, null, $parserOptions); $html = $parserOutput->getText(); file_put_contents('test3.html', $html); return true;};</pre> I think the error is between test 1 and test 2 as the first file writes and the second doesn't. I don't get any server log or browser errors. [[Special:Contributions/&#126;2026-26696-50|&#126;2026-26696-50]] ([[User talk:&#126;2026-26696-50|talk]]) 22:45, 2 May 2026 (UTC) == Is the Special:RestSandbox page available for third-party wikis (i.e. external installations)? == I asked this before on the [[API:REST API]] page but didn't get any response there. I read somewhere that it will be available on MW 1.46, can anyone confirm this? [[User:Draheinsunvale|Draheinsunvale]] ([[User talk:Draheinsunvale|talk]]) 22:14, 3 May 2026 (UTC) 9l8nnhwop914qvpofazdpg7ovi3bp0y 8364890 8364757 2026-05-04T04:26:28Z ~2026-27047-81 18368075 /* The first one 1️⃣ million times is the one 1️⃣ 4 me */ new section 8364890 wikitext text/x-wiki {{Project:Support desk/Header/{{int:lang}}}} {{Auto archiving |archive = Project:Support desk/Archive %(counter)d |algo = old(14d) |counter = 25 |maxarchivesize = 250K |minthreadsleft = 2 |minthreadstoarchive = 1 |archiveheader = {{talk archive}} }} == request to have [[Special:Tags]] sorted by tag name == {{tracked|T424105}}Better to have alphabetical order in first column of [[Special:Tags]] to find easily one's tag. Thanks. [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 17:55, 19 April 2026 (UTC) :@[[User:Wladek92|Wladek92]] See [[How to report a bug]]. [[User:Malyacko|Malyacko]] ([[User talk:Malyacko|talk]]) 12:49, 21 April 2026 (UTC) ::is that a bug ? rather an improvement. Confirmed: it is a ''feature request'' -- [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 18:35, 21 April 2026 (UTC) :::The first sentence on the linked page says: "These guidelines explain how to write a good bug report or feature request". [[User:Malyacko|Malyacko]] ([[User talk:Malyacko|talk]]) 10:14, 22 April 2026 (UTC) == why edit section link is missing on pages ? == {{tracked|T424198}} I have observed a difference on the section title of the rendered pages I cannot explain logically. Here it is : On page Extension:InlineComments I click the following title from the TOC, i.e. -> https://www.mediawiki.org/wiki/Extension:InlineComments#Download<br/> and there is '''no 'Edit section' link''' beside the section title 'Download' On page Wikimedia_Research I click the following title from the TOC, i.e. -> https://www.mediawiki.org/wiki/Wikimedia_Research#Mandate<br/> and '''there is an 'Edit section'''' link beside the title 'Mandate' shown as [ [https://www.mediawiki.org/w/index.php?title=Wikimedia_Research&action=edit&section=1 edit] ] <u>Question:</u> why the Edit section link is sometimes present, sometimes absent beside the title ? Thanks. [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:21, 20 April 2026 (UTC) :I think it's because extension pages use [[Template:Extension]] which contains <code><nowiki>{{#if:{{TRANSLATABLEPAGE}}|__NOEDITSECTION__}}</nowiki></code>. See [[Help:Magic words]]. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 11:04, 20 April 2026 (UTC) ::thanks, but this should be transparent to the editor: from an external point of view, I only want to use the functionality to update a section regardless to the code hidden behind and independently of the used namespace.<br/>I add for reference -> https://www.mediawiki.org/wiki/Help:Section/Editing_sections_of_included_templates. ::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 12:17, 20 April 2026 (UTC) :::I think it's because the way translation is done on this website is a bit of a mess. Well, it seems to work well, but leaves the wikitext in a mess. Maybe editing sections in that context (i.e. translation system plus the extension template) would make it worse. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 10:32, 21 April 2026 (UTC) ::::@[[User:Jonathan3|Jonathan3]], I agree. The translations can make the edit button not appear. [[User:Floating Orb|Floating Orb]] ([[User talk:Floating Orb|talk]]) 03:18, 23 April 2026 (UTC) :::::thanks for your support, track added. The edit possibility is expected on the root EN page (else the translated pages are using messages and there is ''normally'' no edit button there). :::::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 09:54, 23 April 2026 (UTC) == Photo = File == [[MediaWiki:Mobile-frontend-editor-uploadenable]]: Please replace the word "photo" here with "file", its not for just "photo". Sincerely, [[User:Qədir|Qədir]] ([[User talk:Qədir|talk]]) 20:57, 23 April 2026 (UTC) == Categories not sorting content properly and next/previous page broken? == I don't know how to describe the problem succinctly, so I'll give a simple example to start: <nowiki>https://fireemblemwiki.org/wiki/Category:Navigation_templates</nowiki> this category has 222 pages. If you click the "next" button, you are taken to a page with only one categorized item, 21 pages are missing from the listing. Then, if you click previous page, it sorts the categories starting from A instead of 0 and gives "The following 193 pages are in this category, out of 222 total.", if you click previous again (meaning the category is '''2 pages long going forward''' but '''3 pages long going backwards''') you get a page showing entries sorted as 0 to A comprising "The following 29 pages are in this category, out of 222 total.". Additionally, alphabetization seems to be behaving oddly. New files are being put at the end of the category, sorted alphabetically. So for example, If I upload "Carl.png" to ExampleCategory, the category will become "Bob.png, Sam.png, Tim.png, '''Carl.png'''". Instead of the expected "Bob.png, '''Carl.png''', Sam.png, Tim.png". This has progressed to "Bob.png, Sam.png, Tim.png, '''Alfred.png, Carl.png, Dan.png, Ed.png'''" in more active categories. Example of the alphabetization issue: fireemblemwiki.org/wiki/Category:Yutona_Heroes_War_Chronicles_portraits "Portrait yuni trs01.png, Portrait zacharia trs01.png, Portrait zeek 01 trs01.png, '''Portrait charlent trs01.png, Portrait golgotha trs01.png'''" What is gong on here? I'm only an editor so I'm not sure how to diagnose this, and when I asked the backend guys they said none of the extensions should be breaking categories, and that it might be a 1.43 feature change? But I don't understand what this feature would be. I don't think it's being caused by anything obvious like sortkeys or cache issues, it's been like this for about six months. I've also tried a few things like editing the category page with some minor edit to make it update, but that doesn't seem to help. It also happens if I look around the category pages while logged out. [[Special:Contributions/&#126;2026-25342-15|&#126;2026-25342-15]] ([[User talk:&#126;2026-25342-15|talk]]) 02:02, 25 April 2026 (UTC) == How to find out when a certain Namespace is used across the wikis? == Hello! I'll just give an example right away. If I wanted to know all the instances (of the several Wikisource projects in the Wikimedia world) where a special namespace usually called "Author:" (in English) is used, while it does not have a fixed number but varies from project to project ([https://en.wikisource.org/wiki/Special:NamespaceInfo en/102] or [https://es.wikisource.org/wiki/Especial:NamespaceInfo es/106]], how would I do that? [[User:Pxos|Pxos]] ([[User talk:Pxos|talk]]) 14:21, 26 April 2026 (UTC) == Good starting doc for editing templates == Any recommendations for good starting points for editing templates on a MediaWiki install? I've found * https://www.mediawiki.org/wiki/Help:Templates * https://en.wikipedia.org/wiki/Help:A_quick_guide_to_templates * https://en.wikipedia.org/wiki/Help:Template but I'm finding them challenging to learn from. Are there any I've missed? Maybe some "unofficial" documents or articles or blogposts I should read? [[User:Bsammon|Bsammon]] ([[User talk:Bsammon|talk]]) 00:43, 27 April 2026 (UTC) :A good starting point is looking at existing templates. Ask a specific question about what you're trying to do :-) [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 12:54, 29 April 2026 (UTC) ::use also the sandbox and write testcases to see how parameters react and follow the code source ::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:53, 1 May 2026 (UTC) == 1.43 CheckUser Internal Error == When attempting to execute CheckUser inquiries on 1.43, I can run the "Get IP Addresses" for a registered account and the "Get Users" for an IP address without issue. But attempting to run the "Get Actions" for either registered or unregistered, as well as attempting to use Special:Investigate, both throw the fatal exception/internal error: <code>[afDsJx7ifTZnjjMNwX4hMwAFmxo] /index.php?title=Special:CheckUser Error: Class "Firebase\JWT\JWT" not found</code> Yet strangely these actions are still logged in the CU log, even though I can't view any data from them. [[User:The Boston Railfan|The Boston Railfan]] ([[User talk:The Boston Railfan|talk]]) 17:23, 28 April 2026 (UTC) :There's a similar question here - [[Topic%3AWgcydicxa790v7io]] - and the answer was to run <code>composer update --no-dev</code>. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 12:53, 29 April 2026 (UTC) == Marking [sic] text or creating a custom tag == I'm using my wiki to collaboratively transcribe old documents. With this, I need to balance accurately transcribing the text and fixing outdated or incorrect usages. Is there a way I can markup this text? And if one doesn't already exist, is it possible to make my own custom tags? "The ((Berenstein|Berenstain)) Bears is a children's literature franchise." [[Special:Contributions/&#126;2026-26583-63|&#126;2026-26583-63]] ([[User talk:&#126;2026-26583-63|talk]]) 12:46, 1 May 2026 (UTC) :Is it possible to write a custom parser extension that registers new bracket syntaxes? I want to avoid heavy syntax like <nowiki>{{#sic:Berenstein|Berenstain}}</nowiki> or <sic>Berenstein|Berenstain</sic>. [[Special:Contributions/&#126;2026-26583-63|&#126;2026-26583-63]] ([[User talk:&#126;2026-26583-63|talk]]) 12:57, 1 May 2026 (UTC) == Distinguish articles within categories == Hello! I am a user of the Kurdish Wiktionary. My problem is that several variants of the same word appear in the same category without it being possible to distinguish them. It sometimes happens that within the same category, there are more variants than standard words... I would therefore like to know if it is technically possible to display a page using a given template in a category with a specific color or symbol (as is the case for page redirects which are displayed in italics)? [[User:Ghybu|Ghybu]] ([[User talk:Ghybu|talk]]) 16:06, 1 May 2026 (UTC) == Add topic == [https://www.mediawiki.org/wiki/Project:Support_desk#Post_a_new_question This page] says: "4. To start a new thread, click the box with the text Add topic." But... there IS no such button. - [[User:Erik Baas|Erik Baas]] ([[User talk:Erik Baas|talk]]) 07:27, 2 May 2026 (UTC) == PageSaveComplete Hook and rendered HTML == I'm trying to store the rendered html of articles in my main namespace. Right now I'm trying to save them as a file trying to get it to work, but then I plan on saving it in a database. I'm using MediaWiki 1.43.8. <pre>$wgHooks['PageSaveComplete'][] = function($wikiPage, $user, $summary, $flags, $revisionRecord, $editResult){ if($wikiPage->getTitle()->getNamespace() !== NS_MAIN) return true; $title = $wikiPage->getTitle(); $pageName = $title->getPrefixedDBkey(); $services = MediaWiki\MediaWikiServices::getInstance(); $content = $revisionRecord->getContent(MediaWiki\Revision\SlotRecord::MAIN); $renderer = $services->getContentRenderer(); file_put_contents('test1.html', 'test 1'); $parserOptions = $services->getParserFactory()->getParserOptionsFactory()->newOptions(); file_put_contents('test2.html', 'test 2'); $parserOutput = $renderer->getParserOutput($content, $title, null, $parserOptions); $html = $parserOutput->getText(); file_put_contents('test3.html', $html); return true;};</pre> I think the error is between test 1 and test 2 as the first file writes and the second doesn't. I don't get any server log or browser errors. [[Special:Contributions/&#126;2026-26696-50|&#126;2026-26696-50]] ([[User talk:&#126;2026-26696-50|talk]]) 22:45, 2 May 2026 (UTC) == Is the Special:RestSandbox page available for third-party wikis (i.e. external installations)? == I asked this before on the [[API:REST API]] page but didn't get any response there. I read somewhere that it will be available on MW 1.46, can anyone confirm this? [[User:Draheinsunvale|Draheinsunvale]] ([[User talk:Draheinsunvale|talk]]) 22:14, 3 May 2026 (UTC) == The first one 1️⃣ million times is the one 1️⃣ 4 me == Cloudy ☁️ with a chance of the sun 🌞 making the 🌻 and the 🫛 🫛 grow towards the horizon…hope42day’s forecast! [[Special:Contributions/&#126;2026-27047-81|&#126;2026-27047-81]] ([[User talk:&#126;2026-27047-81|talk]]) 04:26, 4 May 2026 (UTC) q35m8fmfyl0rwlpnpfufd8gdh72s0xa 8364891 8364890 2026-05-04T04:41:12Z Thanhtrieu120724 18096855 /* S */ new section 8364891 wikitext text/x-wiki {{Project:Support desk/Header/{{int:lang}}}} {{Auto archiving |archive = Project:Support desk/Archive %(counter)d |algo = old(14d) |counter = 25 |maxarchivesize = 250K |minthreadsleft = 2 |minthreadstoarchive = 1 |archiveheader = {{talk archive}} }} == request to have [[Special:Tags]] sorted by tag name == {{tracked|T424105}}Better to have alphabetical order in first column of [[Special:Tags]] to find easily one's tag. Thanks. [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 17:55, 19 April 2026 (UTC) :@[[User:Wladek92|Wladek92]] See [[How to report a bug]]. [[User:Malyacko|Malyacko]] ([[User talk:Malyacko|talk]]) 12:49, 21 April 2026 (UTC) ::is that a bug ? rather an improvement. Confirmed: it is a ''feature request'' -- [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 18:35, 21 April 2026 (UTC) :::The first sentence on the linked page says: "These guidelines explain how to write a good bug report or feature request". [[User:Malyacko|Malyacko]] ([[User talk:Malyacko|talk]]) 10:14, 22 April 2026 (UTC) == why edit section link is missing on pages ? == {{tracked|T424198}} I have observed a difference on the section title of the rendered pages I cannot explain logically. Here it is : On page Extension:InlineComments I click the following title from the TOC, i.e. -> https://www.mediawiki.org/wiki/Extension:InlineComments#Download<br/> and there is '''no 'Edit section' link''' beside the section title 'Download' On page Wikimedia_Research I click the following title from the TOC, i.e. -> https://www.mediawiki.org/wiki/Wikimedia_Research#Mandate<br/> and '''there is an 'Edit section'''' link beside the title 'Mandate' shown as [ [https://www.mediawiki.org/w/index.php?title=Wikimedia_Research&action=edit&section=1 edit] ] <u>Question:</u> why the Edit section link is sometimes present, sometimes absent beside the title ? Thanks. [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:21, 20 April 2026 (UTC) :I think it's because extension pages use [[Template:Extension]] which contains <code><nowiki>{{#if:{{TRANSLATABLEPAGE}}|__NOEDITSECTION__}}</nowiki></code>. See [[Help:Magic words]]. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 11:04, 20 April 2026 (UTC) ::thanks, but this should be transparent to the editor: from an external point of view, I only want to use the functionality to update a section regardless to the code hidden behind and independently of the used namespace.<br/>I add for reference -> https://www.mediawiki.org/wiki/Help:Section/Editing_sections_of_included_templates. ::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 12:17, 20 April 2026 (UTC) :::I think it's because the way translation is done on this website is a bit of a mess. Well, it seems to work well, but leaves the wikitext in a mess. Maybe editing sections in that context (i.e. translation system plus the extension template) would make it worse. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 10:32, 21 April 2026 (UTC) ::::@[[User:Jonathan3|Jonathan3]], I agree. The translations can make the edit button not appear. [[User:Floating Orb|Floating Orb]] ([[User talk:Floating Orb|talk]]) 03:18, 23 April 2026 (UTC) :::::thanks for your support, track added. The edit possibility is expected on the root EN page (else the translated pages are using messages and there is ''normally'' no edit button there). :::::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 09:54, 23 April 2026 (UTC) == Photo = File == [[MediaWiki:Mobile-frontend-editor-uploadenable]]: Please replace the word "photo" here with "file", its not for just "photo". Sincerely, [[User:Qədir|Qədir]] ([[User talk:Qədir|talk]]) 20:57, 23 April 2026 (UTC) == Categories not sorting content properly and next/previous page broken? == I don't know how to describe the problem succinctly, so I'll give a simple example to start: <nowiki>https://fireemblemwiki.org/wiki/Category:Navigation_templates</nowiki> this category has 222 pages. If you click the "next" button, you are taken to a page with only one categorized item, 21 pages are missing from the listing. Then, if you click previous page, it sorts the categories starting from A instead of 0 and gives "The following 193 pages are in this category, out of 222 total.", if you click previous again (meaning the category is '''2 pages long going forward''' but '''3 pages long going backwards''') you get a page showing entries sorted as 0 to A comprising "The following 29 pages are in this category, out of 222 total.". Additionally, alphabetization seems to be behaving oddly. New files are being put at the end of the category, sorted alphabetically. So for example, If I upload "Carl.png" to ExampleCategory, the category will become "Bob.png, Sam.png, Tim.png, '''Carl.png'''". Instead of the expected "Bob.png, '''Carl.png''', Sam.png, Tim.png". This has progressed to "Bob.png, Sam.png, Tim.png, '''Alfred.png, Carl.png, Dan.png, Ed.png'''" in more active categories. Example of the alphabetization issue: fireemblemwiki.org/wiki/Category:Yutona_Heroes_War_Chronicles_portraits "Portrait yuni trs01.png, Portrait zacharia trs01.png, Portrait zeek 01 trs01.png, '''Portrait charlent trs01.png, Portrait golgotha trs01.png'''" What is gong on here? I'm only an editor so I'm not sure how to diagnose this, and when I asked the backend guys they said none of the extensions should be breaking categories, and that it might be a 1.43 feature change? But I don't understand what this feature would be. I don't think it's being caused by anything obvious like sortkeys or cache issues, it's been like this for about six months. I've also tried a few things like editing the category page with some minor edit to make it update, but that doesn't seem to help. It also happens if I look around the category pages while logged out. [[Special:Contributions/&#126;2026-25342-15|&#126;2026-25342-15]] ([[User talk:&#126;2026-25342-15|talk]]) 02:02, 25 April 2026 (UTC) == How to find out when a certain Namespace is used across the wikis? == Hello! I'll just give an example right away. If I wanted to know all the instances (of the several Wikisource projects in the Wikimedia world) where a special namespace usually called "Author:" (in English) is used, while it does not have a fixed number but varies from project to project ([https://en.wikisource.org/wiki/Special:NamespaceInfo en/102] or [https://es.wikisource.org/wiki/Especial:NamespaceInfo es/106]], how would I do that? [[User:Pxos|Pxos]] ([[User talk:Pxos|talk]]) 14:21, 26 April 2026 (UTC) == Good starting doc for editing templates == Any recommendations for good starting points for editing templates on a MediaWiki install? I've found * https://www.mediawiki.org/wiki/Help:Templates * https://en.wikipedia.org/wiki/Help:A_quick_guide_to_templates * https://en.wikipedia.org/wiki/Help:Template but I'm finding them challenging to learn from. Are there any I've missed? Maybe some "unofficial" documents or articles or blogposts I should read? [[User:Bsammon|Bsammon]] ([[User talk:Bsammon|talk]]) 00:43, 27 April 2026 (UTC) :A good starting point is looking at existing templates. Ask a specific question about what you're trying to do :-) [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 12:54, 29 April 2026 (UTC) ::use also the sandbox and write testcases to see how parameters react and follow the code source ::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:53, 1 May 2026 (UTC) == 1.43 CheckUser Internal Error == When attempting to execute CheckUser inquiries on 1.43, I can run the "Get IP Addresses" for a registered account and the "Get Users" for an IP address without issue. But attempting to run the "Get Actions" for either registered or unregistered, as well as attempting to use Special:Investigate, both throw the fatal exception/internal error: <code>[afDsJx7ifTZnjjMNwX4hMwAFmxo] /index.php?title=Special:CheckUser Error: Class "Firebase\JWT\JWT" not found</code> Yet strangely these actions are still logged in the CU log, even though I can't view any data from them. [[User:The Boston Railfan|The Boston Railfan]] ([[User talk:The Boston Railfan|talk]]) 17:23, 28 April 2026 (UTC) :There's a similar question here - [[Topic%3AWgcydicxa790v7io]] - and the answer was to run <code>composer update --no-dev</code>. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 12:53, 29 April 2026 (UTC) == Marking [sic] text or creating a custom tag == I'm using my wiki to collaboratively transcribe old documents. With this, I need to balance accurately transcribing the text and fixing outdated or incorrect usages. Is there a way I can markup this text? And if one doesn't already exist, is it possible to make my own custom tags? "The ((Berenstein|Berenstain)) Bears is a children's literature franchise." [[Special:Contributions/&#126;2026-26583-63|&#126;2026-26583-63]] ([[User talk:&#126;2026-26583-63|talk]]) 12:46, 1 May 2026 (UTC) :Is it possible to write a custom parser extension that registers new bracket syntaxes? I want to avoid heavy syntax like <nowiki>{{#sic:Berenstein|Berenstain}}</nowiki> or <sic>Berenstein|Berenstain</sic>. [[Special:Contributions/&#126;2026-26583-63|&#126;2026-26583-63]] ([[User talk:&#126;2026-26583-63|talk]]) 12:57, 1 May 2026 (UTC) == Distinguish articles within categories == Hello! I am a user of the Kurdish Wiktionary. My problem is that several variants of the same word appear in the same category without it being possible to distinguish them. It sometimes happens that within the same category, there are more variants than standard words... I would therefore like to know if it is technically possible to display a page using a given template in a category with a specific color or symbol (as is the case for page redirects which are displayed in italics)? [[User:Ghybu|Ghybu]] ([[User talk:Ghybu|talk]]) 16:06, 1 May 2026 (UTC) == Add topic == [https://www.mediawiki.org/wiki/Project:Support_desk#Post_a_new_question This page] says: "4. To start a new thread, click the box with the text Add topic." But... there IS no such button. - [[User:Erik Baas|Erik Baas]] ([[User talk:Erik Baas|talk]]) 07:27, 2 May 2026 (UTC) == PageSaveComplete Hook and rendered HTML == I'm trying to store the rendered html of articles in my main namespace. Right now I'm trying to save them as a file trying to get it to work, but then I plan on saving it in a database. I'm using MediaWiki 1.43.8. <pre>$wgHooks['PageSaveComplete'][] = function($wikiPage, $user, $summary, $flags, $revisionRecord, $editResult){ if($wikiPage->getTitle()->getNamespace() !== NS_MAIN) return true; $title = $wikiPage->getTitle(); $pageName = $title->getPrefixedDBkey(); $services = MediaWiki\MediaWikiServices::getInstance(); $content = $revisionRecord->getContent(MediaWiki\Revision\SlotRecord::MAIN); $renderer = $services->getContentRenderer(); file_put_contents('test1.html', 'test 1'); $parserOptions = $services->getParserFactory()->getParserOptionsFactory()->newOptions(); file_put_contents('test2.html', 'test 2'); $parserOutput = $renderer->getParserOutput($content, $title, null, $parserOptions); $html = $parserOutput->getText(); file_put_contents('test3.html', $html); return true;};</pre> I think the error is between test 1 and test 2 as the first file writes and the second doesn't. I don't get any server log or browser errors. [[Special:Contributions/&#126;2026-26696-50|&#126;2026-26696-50]] ([[User talk:&#126;2026-26696-50|talk]]) 22:45, 2 May 2026 (UTC) == Is the Special:RestSandbox page available for third-party wikis (i.e. external installations)? == I asked this before on the [[API:REST API]] page but didn't get any response there. I read somewhere that it will be available on MW 1.46, can anyone confirm this? [[User:Draheinsunvale|Draheinsunvale]] ([[User talk:Draheinsunvale|talk]]) 22:14, 3 May 2026 (UTC) == The first one 1️⃣ million times is the one 1️⃣ 4 me == Cloudy ☁️ with a chance of the sun 🌞 making the 🌻 and the 🫛 🫛 grow towards the horizon…hope42day’s forecast! [[Special:Contributions/&#126;2026-27047-81|&#126;2026-27047-81]] ([[User talk:&#126;2026-27047-81|talk]]) 04:26, 4 May 2026 (UTC) == S == d [[User:Thanhtrieu120724|Thanhtrieu120724]] ([[User talk:Thanhtrieu120724|talk]]) 04:41, 4 May 2026 (UTC) en69wc4vnd8zvrkh53w601flmeq2fft 8365044 8364891 2026-05-04T06:53:52Z ~2026-26946-99 18368138 Md Sahid Ali 8365044 wikitext text/x-wiki {{Project:Support desk/Header/{{int:lang}}}} {{Auto archiving |archive = Project:Support desk/Archive %(counter)d |algo = old(14d) |counter = 25 |maxarchivesize = 250K |minthreadsleft = 2 |minthreadstoarchive = 1 |archiveheader = {{talk archive}} }} == request to have [[Special:Tags]] sorted by tag name == {{tracked|T424105}}Better to have alphabetical order in first column of [[Special:Tags]] to find easily one's tag. Thanks. [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 17:55, 19 April 2026 (UTC) :@[[User:Wladek92|Wladek92]] See [[How to report a bug]]. [[User:Malyacko|Malyacko]] ([[User talk:Malyacko|talk]]) 12:49, 21 April 2026 (UTC) ::is that a bug ? rather an improvement. Confirmed: it is a ''feature request'' -- [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 18:35, 21 April 2026 (UTC) :::The first sentence on the linked page says: "These guidelines explain how to write a good bug report or feature request". [[User:Malyacko|Malyacko]] ([[User talk:Malyacko|talk]]) 10:14, 22 April 2026 (UTC) == why edit section link is missing on pages ? == {{tracked|T424198}} I have observed a difference on the section title of the rendered pages I cannot explain logically. Here it is : On page Extension:InlineComments I click the following title from the TOC, i.e. -> https://www.mediawiki.org/wiki/Extension:InlineComments#Download<br/> and there is '''no 'Edit section' link''' beside the section title 'Download' On page Wikimedia_Research I click the following title from the TOC, i.e. -> https://www.mediawiki.org/wiki/Wikimedia_Research#Mandate<br/> and '''there is an 'Edit section'''' link beside the title 'Mandate' shown as [ [https://www.mediawiki.org/w/index.php?title=Wikimedia_Research&action=edit&section=1 edit] ] <u>Question:</u> why the Edit section link is sometimes present, sometimes absent beside the title ? Thanks. [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:21, 20 April 2026 (UTC) :I think it's because extension pages use [[Template:Extension]] which contains <code><nowiki>{{#if:{{TRANSLATABLEPAGE}}|__NOEDITSECTION__}}</nowiki></code>. See [[Help:Magic words]]. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 11:04, 20 April 2026 (UTC) ::thanks, but this should be transparent to the editor: from an external point of view, I only want to use the functionality to update a section regardless to the code hidden behind and independently of the used namespace.<br/>I add for reference -> https://www.mediawiki.org/wiki/Help:Section/Editing_sections_of_included_templates. ::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 12:17, 20 April 2026 (UTC) :::I think it's because the way translation is done on this website is a bit of a mess. Well, it seems to work well, but leaves the wikitext in a mess. Maybe editing sections in that context (i.e. translation system plus the extension template) would make it worse. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 10:32, 21 April 2026 (UTC) ::::@[[User:Jonathan3|Jonathan3]], I agree. The translations can make the edit button not appear. [[User:Floating Orb|Floating Orb]] ([[User talk:Floating Orb|talk]]) 03:18, 23 April 2026 (UTC) :::::thanks for your support, track added. The edit possibility is expected on the root EN page (else the translated pages are using messages and there is ''normally'' no edit button there). :::::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 09:54, 23 April 2026 (UTC) == Photo = File == [[MediaWiki:Mobile-frontend-editor-uploadenable]]: Please replace the word "photo" here with "file", its not for just "photo". Sincerely, [[User:Qədir|Qədir]] ([[User talk:Qədir|talk]]) 20:57, 23 April 2026 (UTC) == Categories not sorting content properly and next/previous page broken? == I don't know how to describe the problem succinctly, so I'll give a simple example to start: <nowiki>https://fireemblemwiki.org/wiki/Category:Navigation_templates</nowiki> this category has 222 pages. If you click the "next" button, you are taken to a page with only one categorized item, 21 pages are missing from the listing. Then, if you click previous page, it sorts the categories starting from A instead of 0 and gives "The following 193 pages are in this category, out of 222 total.", if you click previous again (meaning the category is '''2 pages long going forward''' but '''3 pages long going backwards''') you get a page showing entries sorted as 0 to A comprising "The following 29 pages are in this category, out of 222 total.". Additionally, alphabetization seems to be behaving oddly. New files are being put at the end of the category, sorted alphabetically. So for example, If I upload "Carl.png" to ExampleCategory, the category will become "Bob.png, Sam.png, Tim.png, '''Carl.png'''". Instead of the expected "Bob.png, '''Carl.png''', Sam.png, Tim.png". This has progressed to "Bob.png, Sam.png, Tim.png, '''Alfred.png, Carl.png, Dan.png, Ed.png'''" in more active categories. Example of the alphabetization issue: fireemblemwiki.org/wiki/Category:Yutona_Heroes_War_Chronicles_portraits "Portrait yuni trs01.png, Portrait zacharia trs01.png, Portrait zeek 01 trs01.png, '''Portrait charlent trs01.png, Portrait golgotha trs01.png'''" What is gong on here? I'm only an editor so I'm not sure how to diagnose this, and when I asked the backend guys they said none of the extensions should be breaking categories, and that it might be a 1.43 feature change? But I don't understand what this feature would be. I don't think it's being caused by anything obvious like sortkeys or cache issues, it's been like this for about six months. I've also tried a few things like editing the category page with some minor edit to make it update, but that doesn't seem to help. It also happens if I look around the category pages while logged out. [[Special:Contributions/&#126;2026-25342-15|&#126;2026-25342-15]] ([[User talk:&#126;2026-25342-15|talk]]) 02:02, 25 April 2026 (UTC) == How to find out when a certain Namespace is used across the wikis? == Hello! I'll just give an example right away. If I wanted to know all the instances (of the several Wikisource projects in the Wikimedia world) where a special namespace usually called "Author:" (in English) is used, while it does not have a fixed number but varies from project to project ([https://en.wikisource.org/wiki/Special:NamespaceInfo en/102] or [https://es.wikisource.org/wiki/Especial:NamespaceInfo es/106]], how would I do that? [[User:Pxos|Pxos]] ([[User talk:Pxos|talk]]) 14:21, 26 April 2026 (UTC) == Good starting doc for editing templates == Any recommendations for good starting points for editing templates on a MediaWiki install? I've found * https://www.mediawiki.org/wiki/Help:Templates * https://en.wikipedia.org/wiki/Help:A_quick_guide_to_templates * https://en.wikipedia.org/wiki/Help:Template but I'm finding them challenging to learn from. Are there any I've missed? Maybe some "unofficial" documents or articles or blogposts I should read? [[User:Bsammon|Bsammon]] ([[User talk:Bsammon|talk]]) 00:43, 27 April 2026 (UTC) :A good starting point is looking at existing templates. Ask a specific question about what you're trying to do :-) [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 12:54, 29 April 2026 (UTC) ::use also the sandbox and write testcases to see how parameters react and follow the code source ::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:53, 1 May 2026 (UTC) == 1.43 CheckUser Internal Error == When attempting to execute CheckUser inquiries on 1.43, I can run the "Get IP Addresses" for a registered account and the "Get Users" for an IP address without issue. But attempting to run the "Get Actions" for either registered or unregistered, as well as attempting to use Special:Investigate, both throw the fatal exception/internal error: <code>[afDsJx7ifTZnjjMNwX4hMwAFmxo] /index.php?title=Special:CheckUser Error: Class "Firebase\JWT\JWT" not found</code> Yet strangely these actions are still logged in the CU log, even though I can't view any data from them. [[User:The Boston Railfan|The Boston Railfan]] ([[User talk:The Boston Railfan|talk]]) 17:23, 28 April 2026 (UTC) :There's a similar question here - [[Topic%3AWgcydicxa790v7io]] - and the answer was to run <code>composer update --no-dev</code>. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 12:53, 29 April 2026 (UTC) == Marking [sic] text or creating a custom tag == I'm using my wiki to collaboratively transcribe old documents. With this, I need to balance accurately transcribing the text and fixing outdated or incorrect usages. Is there a way I can markup this text? And if one doesn't already exist, is it possible to make my own custom tags? "The ((Berenstein|Berenstain)) Bears is a children's literature franchise." [[Special:Contributions/&#126;2026-26583-63|&#126;2026-26583-63]] ([[User talk:&#126;2026-26583-63|talk]]) 12:46, 1 May 2026 (UTC) :Is it possible to write a custom parser extension that registers new bracket syntaxes? I want to avoid heavy syntax like <nowiki>{{#sic:Berenstein|Berenstain}}</nowiki> or <sic>Berenstein|Berenstain</sic>. [[Special:Contributions/&#126;2026-26583-63|&#126;2026-26583-63]] ([[User talk:&#126;2026-26583-63|talk]]) 12:57, 1 May 2026 (UTC) == Distinguish articles within categories == Hello! I am a user of the Kurdish Wiktionary. My problem is that several variants of the same word appear in the same category without it being possible to distinguish them. It sometimes happens that within the same category, there are more variants than standard words... I would therefore like to know if it is technically possible to display a page using a given template in a category with a specific color or symbol (as is the case for page redirects which are displayed in italics)? [[User:Ghybu|Ghybu]] ([[User talk:Ghybu|talk]]) 16:06, 1 May 2026 (UTC) == Add topic == [https://www.mediawiki.org/wiki/Project:Support_desk#Post_a_new_question This page] says: "4. To start a new thread, click the box with the text Add topic." But... there IS no such button. - [[User:Erik Baas|Erik Baas]] ([[User talk:Erik Baas|talk]]) 07:27, 2 May 2026 (UTC) == PageSaveComplete Hook and rendered HTML == I'm trying to store the rendered html of articles in my main namespace. Right now I'm trying to save them as a file trying to get it to work, but then I plan on saving it in a database. I'm using MediaWiki 1.43.8. <pre>$wgHooks['PageSaveComplete'][] = function($wikiPage, $user, $summary, $flags, $revisionRecord, $editResult){ if($wikiPage->getTitle()->getNamespace() !== NS_MAIN) return true; $title = $wikiPage->getTitle(); $pageName = $title->getPrefixedDBkey(); $services = MediaWiki\MediaWikiServices::getInstance(); $content = $revisionRecord->getContent(MediaWiki\Revision\SlotRecord::MAIN); $renderer = $services->getContentRenderer(); file_put_contents('test1.html', 'test 1'); $parserOptions = $services->getParserFactory()->getParserOptionsFactory()->newOptions(); file_put_contents('test2.html', 'test 2'); $parserOutput = $renderer->getParserOutput($content, $title, null, $parserOptions); $html = $parserOutput->getText(); file_put_contents('test3.html', $html); return true;};</pre> I think the error is between test 1 and test 2 as the first file writes and the second doesn't. I don't get any server log or browser errors. [[Special:Contributions/&#126;2026-26696-50|&#126;2026-26696-50]] ([[User talk:&#126;2026-26696-50|talk]]) 22:45, 2 May 2026 (UTC) == Is the Special:RestSandbox page available for third-party wikis (i.e. external installations)? == I asked this before on the [[API:REST API]] page but didn't get any response there. I read somewhere that it will be available on MW 1.46, can anyone confirm this? [[User:Draheinsunvale|Draheinsunvale]] ([[User talk:Draheinsunvale|talk]]) 22:14, 3 May 2026 (UTC) == The first one 1️⃣ million times is the one 1️⃣ 4 me == Cloudy ☁️ with a chance of the sun 🌞 making the 🌻 and the 🫛 🫛 grow towards the horizon…hope42day’s forecast! [[Special:Contributions/&#126;2026-27047-81|&#126;2026-27047-81]] ([[User talk:&#126;2026-27047-81|talk]]) 04:26, 4 May 2026 (UTC) == S == d [[User:Thanhtrieu120724|Thanhtrieu120724]] ([[User talk:Thanhtrieu120724|talk]]) 04:41, 4 May 2026 (UTC) :MD SAHID ALI 1/11(/20005 Sh ahid md. Ali 580202310007772 MD SAHID NURUL. lMuhammad Shahid [[Special:Contributions/&#126;2026-26946-99|&#126;2026-26946-99]] ([[User talk:&#126;2026-26946-99|talk]]) 06:53, 4 May 2026 (UTC) 5zhb8k38q8j529pqcyovpwv0je2uhmk 8365050 8365044 2026-05-04T06:58:24Z ~2026-26946-99 18368138 /* S */ Reply 8365050 wikitext text/x-wiki {{Project:Support desk/Header/{{int:lang}}}} {{Auto archiving |archive = Project:Support desk/Archive %(counter)d |algo = old(14d) |counter = 25 |maxarchivesize = 250K |minthreadsleft = 2 |minthreadstoarchive = 1 |archiveheader = {{talk archive}} }} == request to have [[Special:Tags]] sorted by tag name == {{tracked|T424105}}Better to have alphabetical order in first column of [[Special:Tags]] to find easily one's tag. Thanks. [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 17:55, 19 April 2026 (UTC) :@[[User:Wladek92|Wladek92]] See [[How to report a bug]]. [[User:Malyacko|Malyacko]] ([[User talk:Malyacko|talk]]) 12:49, 21 April 2026 (UTC) ::is that a bug ? rather an improvement. Confirmed: it is a ''feature request'' -- [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 18:35, 21 April 2026 (UTC) :::The first sentence on the linked page says: "These guidelines explain how to write a good bug report or feature request". [[User:Malyacko|Malyacko]] ([[User talk:Malyacko|talk]]) 10:14, 22 April 2026 (UTC) == why edit section link is missing on pages ? == {{tracked|T424198}} I have observed a difference on the section title of the rendered pages I cannot explain logically. Here it is : On page Extension:InlineComments I click the following title from the TOC, i.e. -> https://www.mediawiki.org/wiki/Extension:InlineComments#Download<br/> and there is '''no 'Edit section' link''' beside the section title 'Download' On page Wikimedia_Research I click the following title from the TOC, i.e. -> https://www.mediawiki.org/wiki/Wikimedia_Research#Mandate<br/> and '''there is an 'Edit section'''' link beside the title 'Mandate' shown as [ [https://www.mediawiki.org/w/index.php?title=Wikimedia_Research&action=edit&section=1 edit] ] <u>Question:</u> why the Edit section link is sometimes present, sometimes absent beside the title ? Thanks. [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:21, 20 April 2026 (UTC) :I think it's because extension pages use [[Template:Extension]] which contains <code><nowiki>{{#if:{{TRANSLATABLEPAGE}}|__NOEDITSECTION__}}</nowiki></code>. See [[Help:Magic words]]. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 11:04, 20 April 2026 (UTC) ::thanks, but this should be transparent to the editor: from an external point of view, I only want to use the functionality to update a section regardless to the code hidden behind and independently of the used namespace.<br/>I add for reference -> https://www.mediawiki.org/wiki/Help:Section/Editing_sections_of_included_templates. ::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 12:17, 20 April 2026 (UTC) :::I think it's because the way translation is done on this website is a bit of a mess. Well, it seems to work well, but leaves the wikitext in a mess. Maybe editing sections in that context (i.e. translation system plus the extension template) would make it worse. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 10:32, 21 April 2026 (UTC) ::::@[[User:Jonathan3|Jonathan3]], I agree. The translations can make the edit button not appear. [[User:Floating Orb|Floating Orb]] ([[User talk:Floating Orb|talk]]) 03:18, 23 April 2026 (UTC) :::::thanks for your support, track added. The edit possibility is expected on the root EN page (else the translated pages are using messages and there is ''normally'' no edit button there). :::::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 09:54, 23 April 2026 (UTC) == Photo = File == [[MediaWiki:Mobile-frontend-editor-uploadenable]]: Please replace the word "photo" here with "file", its not for just "photo". Sincerely, [[User:Qədir|Qədir]] ([[User talk:Qədir|talk]]) 20:57, 23 April 2026 (UTC) == Categories not sorting content properly and next/previous page broken? == I don't know how to describe the problem succinctly, so I'll give a simple example to start: <nowiki>https://fireemblemwiki.org/wiki/Category:Navigation_templates</nowiki> this category has 222 pages. If you click the "next" button, you are taken to a page with only one categorized item, 21 pages are missing from the listing. Then, if you click previous page, it sorts the categories starting from A instead of 0 and gives "The following 193 pages are in this category, out of 222 total.", if you click previous again (meaning the category is '''2 pages long going forward''' but '''3 pages long going backwards''') you get a page showing entries sorted as 0 to A comprising "The following 29 pages are in this category, out of 222 total.". Additionally, alphabetization seems to be behaving oddly. New files are being put at the end of the category, sorted alphabetically. So for example, If I upload "Carl.png" to ExampleCategory, the category will become "Bob.png, Sam.png, Tim.png, '''Carl.png'''". Instead of the expected "Bob.png, '''Carl.png''', Sam.png, Tim.png". This has progressed to "Bob.png, Sam.png, Tim.png, '''Alfred.png, Carl.png, Dan.png, Ed.png'''" in more active categories. Example of the alphabetization issue: fireemblemwiki.org/wiki/Category:Yutona_Heroes_War_Chronicles_portraits "Portrait yuni trs01.png, Portrait zacharia trs01.png, Portrait zeek 01 trs01.png, '''Portrait charlent trs01.png, Portrait golgotha trs01.png'''" What is gong on here? I'm only an editor so I'm not sure how to diagnose this, and when I asked the backend guys they said none of the extensions should be breaking categories, and that it might be a 1.43 feature change? But I don't understand what this feature would be. I don't think it's being caused by anything obvious like sortkeys or cache issues, it's been like this for about six months. I've also tried a few things like editing the category page with some minor edit to make it update, but that doesn't seem to help. It also happens if I look around the category pages while logged out. [[Special:Contributions/&#126;2026-25342-15|&#126;2026-25342-15]] ([[User talk:&#126;2026-25342-15|talk]]) 02:02, 25 April 2026 (UTC) == How to find out when a certain Namespace is used across the wikis? == Hello! I'll just give an example right away. If I wanted to know all the instances (of the several Wikisource projects in the Wikimedia world) where a special namespace usually called "Author:" (in English) is used, while it does not have a fixed number but varies from project to project ([https://en.wikisource.org/wiki/Special:NamespaceInfo en/102] or [https://es.wikisource.org/wiki/Especial:NamespaceInfo es/106]], how would I do that? [[User:Pxos|Pxos]] ([[User talk:Pxos|talk]]) 14:21, 26 April 2026 (UTC) == Good starting doc for editing templates == Any recommendations for good starting points for editing templates on a MediaWiki install? I've found * https://www.mediawiki.org/wiki/Help:Templates * https://en.wikipedia.org/wiki/Help:A_quick_guide_to_templates * https://en.wikipedia.org/wiki/Help:Template but I'm finding them challenging to learn from. Are there any I've missed? Maybe some "unofficial" documents or articles or blogposts I should read? [[User:Bsammon|Bsammon]] ([[User talk:Bsammon|talk]]) 00:43, 27 April 2026 (UTC) :A good starting point is looking at existing templates. Ask a specific question about what you're trying to do :-) [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 12:54, 29 April 2026 (UTC) ::use also the sandbox and write testcases to see how parameters react and follow the code source ::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:53, 1 May 2026 (UTC) == 1.43 CheckUser Internal Error == When attempting to execute CheckUser inquiries on 1.43, I can run the "Get IP Addresses" for a registered account and the "Get Users" for an IP address without issue. But attempting to run the "Get Actions" for either registered or unregistered, as well as attempting to use Special:Investigate, both throw the fatal exception/internal error: <code>[afDsJx7ifTZnjjMNwX4hMwAFmxo] /index.php?title=Special:CheckUser Error: Class "Firebase\JWT\JWT" not found</code> Yet strangely these actions are still logged in the CU log, even though I can't view any data from them. [[User:The Boston Railfan|The Boston Railfan]] ([[User talk:The Boston Railfan|talk]]) 17:23, 28 April 2026 (UTC) :There's a similar question here - [[Topic%3AWgcydicxa790v7io]] - and the answer was to run <code>composer update --no-dev</code>. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 12:53, 29 April 2026 (UTC) == Marking [sic] text or creating a custom tag == I'm using my wiki to collaboratively transcribe old documents. With this, I need to balance accurately transcribing the text and fixing outdated or incorrect usages. Is there a way I can markup this text? And if one doesn't already exist, is it possible to make my own custom tags? "The ((Berenstein|Berenstain)) Bears is a children's literature franchise." [[Special:Contributions/&#126;2026-26583-63|&#126;2026-26583-63]] ([[User talk:&#126;2026-26583-63|talk]]) 12:46, 1 May 2026 (UTC) :Is it possible to write a custom parser extension that registers new bracket syntaxes? I want to avoid heavy syntax like <nowiki>{{#sic:Berenstein|Berenstain}}</nowiki> or <sic>Berenstein|Berenstain</sic>. [[Special:Contributions/&#126;2026-26583-63|&#126;2026-26583-63]] ([[User talk:&#126;2026-26583-63|talk]]) 12:57, 1 May 2026 (UTC) == Distinguish articles within categories == Hello! I am a user of the Kurdish Wiktionary. My problem is that several variants of the same word appear in the same category without it being possible to distinguish them. It sometimes happens that within the same category, there are more variants than standard words... I would therefore like to know if it is technically possible to display a page using a given template in a category with a specific color or symbol (as is the case for page redirects which are displayed in italics)? [[User:Ghybu|Ghybu]] ([[User talk:Ghybu|talk]]) 16:06, 1 May 2026 (UTC) == Add topic == [https://www.mediawiki.org/wiki/Project:Support_desk#Post_a_new_question This page] says: "4. To start a new thread, click the box with the text Add topic." But... there IS no such button. - [[User:Erik Baas|Erik Baas]] ([[User talk:Erik Baas|talk]]) 07:27, 2 May 2026 (UTC) == PageSaveComplete Hook and rendered HTML == I'm trying to store the rendered html of articles in my main namespace. Right now I'm trying to save them as a file trying to get it to work, but then I plan on saving it in a database. I'm using MediaWiki 1.43.8. <pre>$wgHooks['PageSaveComplete'][] = function($wikiPage, $user, $summary, $flags, $revisionRecord, $editResult){ if($wikiPage->getTitle()->getNamespace() !== NS_MAIN) return true; $title = $wikiPage->getTitle(); $pageName = $title->getPrefixedDBkey(); $services = MediaWiki\MediaWikiServices::getInstance(); $content = $revisionRecord->getContent(MediaWiki\Revision\SlotRecord::MAIN); $renderer = $services->getContentRenderer(); file_put_contents('test1.html', 'test 1'); $parserOptions = $services->getParserFactory()->getParserOptionsFactory()->newOptions(); file_put_contents('test2.html', 'test 2'); $parserOutput = $renderer->getParserOutput($content, $title, null, $parserOptions); $html = $parserOutput->getText(); file_put_contents('test3.html', $html); return true;};</pre> I think the error is between test 1 and test 2 as the first file writes and the second doesn't. I don't get any server log or browser errors. [[Special:Contributions/&#126;2026-26696-50|&#126;2026-26696-50]] ([[User talk:&#126;2026-26696-50|talk]]) 22:45, 2 May 2026 (UTC) == Is the Special:RestSandbox page available for third-party wikis (i.e. external installations)? == I asked this before on the [[API:REST API]] page but didn't get any response there. I read somewhere that it will be available on MW 1.46, can anyone confirm this? [[User:Draheinsunvale|Draheinsunvale]] ([[User talk:Draheinsunvale|talk]]) 22:14, 3 May 2026 (UTC) == The first one 1️⃣ million times is the one 1️⃣ 4 me == Cloudy ☁️ with a chance of the sun 🌞 making the 🌻 and the 🫛 🫛 grow towards the horizon…hope42day’s forecast! [[Special:Contributions/&#126;2026-27047-81|&#126;2026-27047-81]] ([[User talk:&#126;2026-27047-81|talk]]) 04:26, 4 May 2026 (UTC) == S == d [[User:Thanhtrieu120724|Thanhtrieu120724]] ([[User talk:Thanhtrieu120724|talk]]) 04:41, 4 May 2026 (UTC) :MD SAHID ALI 1/11(/20005 Sh ahid md. Ali 580202310007772 MD SAHID NURUL. lMuhammad Shahid [[Special:Contributions/&#126;2026-26946-99|&#126;2026-26946-99]] ([[User talk:&#126;2026-26946-99|talk]]) 06:53, 4 May 2026 (UTC) ::20262694699 Ali Mumbai MD SAHID [[Special:Contributions/&#126;2026-26946-99|&#126;2026-26946-99]] ([[User talk:&#126;2026-26946-99|talk]]) 06:58, 4 May 2026 (UTC) c1icmxzhd2uqj2itvufwllb59m5ldob 8365121 8365050 2026-05-04T10:50:34Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-26946-99|~2026-26946-99]] ([[User talk:~2026-26946-99|talk]]) to last version by Thanhtrieu120724 8364891 wikitext text/x-wiki {{Project:Support desk/Header/{{int:lang}}}} {{Auto archiving |archive = Project:Support desk/Archive %(counter)d |algo = old(14d) |counter = 25 |maxarchivesize = 250K |minthreadsleft = 2 |minthreadstoarchive = 1 |archiveheader = {{talk archive}} }} == request to have [[Special:Tags]] sorted by tag name == {{tracked|T424105}}Better to have alphabetical order in first column of [[Special:Tags]] to find easily one's tag. Thanks. [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 17:55, 19 April 2026 (UTC) :@[[User:Wladek92|Wladek92]] See [[How to report a bug]]. [[User:Malyacko|Malyacko]] ([[User talk:Malyacko|talk]]) 12:49, 21 April 2026 (UTC) ::is that a bug ? rather an improvement. Confirmed: it is a ''feature request'' -- [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 18:35, 21 April 2026 (UTC) :::The first sentence on the linked page says: "These guidelines explain how to write a good bug report or feature request". [[User:Malyacko|Malyacko]] ([[User talk:Malyacko|talk]]) 10:14, 22 April 2026 (UTC) == why edit section link is missing on pages ? == {{tracked|T424198}} I have observed a difference on the section title of the rendered pages I cannot explain logically. Here it is : On page Extension:InlineComments I click the following title from the TOC, i.e. -> https://www.mediawiki.org/wiki/Extension:InlineComments#Download<br/> and there is '''no 'Edit section' link''' beside the section title 'Download' On page Wikimedia_Research I click the following title from the TOC, i.e. -> https://www.mediawiki.org/wiki/Wikimedia_Research#Mandate<br/> and '''there is an 'Edit section'''' link beside the title 'Mandate' shown as [ [https://www.mediawiki.org/w/index.php?title=Wikimedia_Research&action=edit&section=1 edit] ] <u>Question:</u> why the Edit section link is sometimes present, sometimes absent beside the title ? Thanks. [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:21, 20 April 2026 (UTC) :I think it's because extension pages use [[Template:Extension]] which contains <code><nowiki>{{#if:{{TRANSLATABLEPAGE}}|__NOEDITSECTION__}}</nowiki></code>. See [[Help:Magic words]]. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 11:04, 20 April 2026 (UTC) ::thanks, but this should be transparent to the editor: from an external point of view, I only want to use the functionality to update a section regardless to the code hidden behind and independently of the used namespace.<br/>I add for reference -> https://www.mediawiki.org/wiki/Help:Section/Editing_sections_of_included_templates. ::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 12:17, 20 April 2026 (UTC) :::I think it's because the way translation is done on this website is a bit of a mess. Well, it seems to work well, but leaves the wikitext in a mess. Maybe editing sections in that context (i.e. translation system plus the extension template) would make it worse. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 10:32, 21 April 2026 (UTC) ::::@[[User:Jonathan3|Jonathan3]], I agree. The translations can make the edit button not appear. [[User:Floating Orb|Floating Orb]] ([[User talk:Floating Orb|talk]]) 03:18, 23 April 2026 (UTC) :::::thanks for your support, track added. The edit possibility is expected on the root EN page (else the translated pages are using messages and there is ''normally'' no edit button there). :::::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 09:54, 23 April 2026 (UTC) == Photo = File == [[MediaWiki:Mobile-frontend-editor-uploadenable]]: Please replace the word "photo" here with "file", its not for just "photo". Sincerely, [[User:Qədir|Qədir]] ([[User talk:Qədir|talk]]) 20:57, 23 April 2026 (UTC) == Categories not sorting content properly and next/previous page broken? == I don't know how to describe the problem succinctly, so I'll give a simple example to start: <nowiki>https://fireemblemwiki.org/wiki/Category:Navigation_templates</nowiki> this category has 222 pages. If you click the "next" button, you are taken to a page with only one categorized item, 21 pages are missing from the listing. Then, if you click previous page, it sorts the categories starting from A instead of 0 and gives "The following 193 pages are in this category, out of 222 total.", if you click previous again (meaning the category is '''2 pages long going forward''' but '''3 pages long going backwards''') you get a page showing entries sorted as 0 to A comprising "The following 29 pages are in this category, out of 222 total.". Additionally, alphabetization seems to be behaving oddly. New files are being put at the end of the category, sorted alphabetically. So for example, If I upload "Carl.png" to ExampleCategory, the category will become "Bob.png, Sam.png, Tim.png, '''Carl.png'''". Instead of the expected "Bob.png, '''Carl.png''', Sam.png, Tim.png". This has progressed to "Bob.png, Sam.png, Tim.png, '''Alfred.png, Carl.png, Dan.png, Ed.png'''" in more active categories. Example of the alphabetization issue: fireemblemwiki.org/wiki/Category:Yutona_Heroes_War_Chronicles_portraits "Portrait yuni trs01.png, Portrait zacharia trs01.png, Portrait zeek 01 trs01.png, '''Portrait charlent trs01.png, Portrait golgotha trs01.png'''" What is gong on here? I'm only an editor so I'm not sure how to diagnose this, and when I asked the backend guys they said none of the extensions should be breaking categories, and that it might be a 1.43 feature change? But I don't understand what this feature would be. I don't think it's being caused by anything obvious like sortkeys or cache issues, it's been like this for about six months. I've also tried a few things like editing the category page with some minor edit to make it update, but that doesn't seem to help. It also happens if I look around the category pages while logged out. [[Special:Contributions/&#126;2026-25342-15|&#126;2026-25342-15]] ([[User talk:&#126;2026-25342-15|talk]]) 02:02, 25 April 2026 (UTC) == How to find out when a certain Namespace is used across the wikis? == Hello! I'll just give an example right away. If I wanted to know all the instances (of the several Wikisource projects in the Wikimedia world) where a special namespace usually called "Author:" (in English) is used, while it does not have a fixed number but varies from project to project ([https://en.wikisource.org/wiki/Special:NamespaceInfo en/102] or [https://es.wikisource.org/wiki/Especial:NamespaceInfo es/106]], how would I do that? [[User:Pxos|Pxos]] ([[User talk:Pxos|talk]]) 14:21, 26 April 2026 (UTC) == Good starting doc for editing templates == Any recommendations for good starting points for editing templates on a MediaWiki install? I've found * https://www.mediawiki.org/wiki/Help:Templates * https://en.wikipedia.org/wiki/Help:A_quick_guide_to_templates * https://en.wikipedia.org/wiki/Help:Template but I'm finding them challenging to learn from. Are there any I've missed? Maybe some "unofficial" documents or articles or blogposts I should read? [[User:Bsammon|Bsammon]] ([[User talk:Bsammon|talk]]) 00:43, 27 April 2026 (UTC) :A good starting point is looking at existing templates. Ask a specific question about what you're trying to do :-) [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 12:54, 29 April 2026 (UTC) ::use also the sandbox and write testcases to see how parameters react and follow the code source ::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:53, 1 May 2026 (UTC) == 1.43 CheckUser Internal Error == When attempting to execute CheckUser inquiries on 1.43, I can run the "Get IP Addresses" for a registered account and the "Get Users" for an IP address without issue. But attempting to run the "Get Actions" for either registered or unregistered, as well as attempting to use Special:Investigate, both throw the fatal exception/internal error: <code>[afDsJx7ifTZnjjMNwX4hMwAFmxo] /index.php?title=Special:CheckUser Error: Class "Firebase\JWT\JWT" not found</code> Yet strangely these actions are still logged in the CU log, even though I can't view any data from them. [[User:The Boston Railfan|The Boston Railfan]] ([[User talk:The Boston Railfan|talk]]) 17:23, 28 April 2026 (UTC) :There's a similar question here - [[Topic%3AWgcydicxa790v7io]] - and the answer was to run <code>composer update --no-dev</code>. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 12:53, 29 April 2026 (UTC) == Marking [sic] text or creating a custom tag == I'm using my wiki to collaboratively transcribe old documents. With this, I need to balance accurately transcribing the text and fixing outdated or incorrect usages. Is there a way I can markup this text? And if one doesn't already exist, is it possible to make my own custom tags? "The ((Berenstein|Berenstain)) Bears is a children's literature franchise." [[Special:Contributions/&#126;2026-26583-63|&#126;2026-26583-63]] ([[User talk:&#126;2026-26583-63|talk]]) 12:46, 1 May 2026 (UTC) :Is it possible to write a custom parser extension that registers new bracket syntaxes? I want to avoid heavy syntax like <nowiki>{{#sic:Berenstein|Berenstain}}</nowiki> or <sic>Berenstein|Berenstain</sic>. [[Special:Contributions/&#126;2026-26583-63|&#126;2026-26583-63]] ([[User talk:&#126;2026-26583-63|talk]]) 12:57, 1 May 2026 (UTC) == Distinguish articles within categories == Hello! I am a user of the Kurdish Wiktionary. My problem is that several variants of the same word appear in the same category without it being possible to distinguish them. It sometimes happens that within the same category, there are more variants than standard words... I would therefore like to know if it is technically possible to display a page using a given template in a category with a specific color or symbol (as is the case for page redirects which are displayed in italics)? [[User:Ghybu|Ghybu]] ([[User talk:Ghybu|talk]]) 16:06, 1 May 2026 (UTC) == Add topic == [https://www.mediawiki.org/wiki/Project:Support_desk#Post_a_new_question This page] says: "4. To start a new thread, click the box with the text Add topic." But... there IS no such button. - [[User:Erik Baas|Erik Baas]] ([[User talk:Erik Baas|talk]]) 07:27, 2 May 2026 (UTC) == PageSaveComplete Hook and rendered HTML == I'm trying to store the rendered html of articles in my main namespace. Right now I'm trying to save them as a file trying to get it to work, but then I plan on saving it in a database. I'm using MediaWiki 1.43.8. <pre>$wgHooks['PageSaveComplete'][] = function($wikiPage, $user, $summary, $flags, $revisionRecord, $editResult){ if($wikiPage->getTitle()->getNamespace() !== NS_MAIN) return true; $title = $wikiPage->getTitle(); $pageName = $title->getPrefixedDBkey(); $services = MediaWiki\MediaWikiServices::getInstance(); $content = $revisionRecord->getContent(MediaWiki\Revision\SlotRecord::MAIN); $renderer = $services->getContentRenderer(); file_put_contents('test1.html', 'test 1'); $parserOptions = $services->getParserFactory()->getParserOptionsFactory()->newOptions(); file_put_contents('test2.html', 'test 2'); $parserOutput = $renderer->getParserOutput($content, $title, null, $parserOptions); $html = $parserOutput->getText(); file_put_contents('test3.html', $html); return true;};</pre> I think the error is between test 1 and test 2 as the first file writes and the second doesn't. I don't get any server log or browser errors. [[Special:Contributions/&#126;2026-26696-50|&#126;2026-26696-50]] ([[User talk:&#126;2026-26696-50|talk]]) 22:45, 2 May 2026 (UTC) == Is the Special:RestSandbox page available for third-party wikis (i.e. external installations)? == I asked this before on the [[API:REST API]] page but didn't get any response there. I read somewhere that it will be available on MW 1.46, can anyone confirm this? [[User:Draheinsunvale|Draheinsunvale]] ([[User talk:Draheinsunvale|talk]]) 22:14, 3 May 2026 (UTC) == The first one 1️⃣ million times is the one 1️⃣ 4 me == Cloudy ☁️ with a chance of the sun 🌞 making the 🌻 and the 🫛 🫛 grow towards the horizon…hope42day’s forecast! [[Special:Contributions/&#126;2026-27047-81|&#126;2026-27047-81]] ([[User talk:&#126;2026-27047-81|talk]]) 04:26, 4 May 2026 (UTC) == S == d [[User:Thanhtrieu120724|Thanhtrieu120724]] ([[User talk:Thanhtrieu120724|talk]]) 04:41, 4 May 2026 (UTC) en69wc4vnd8zvrkh53w601flmeq2fft 8365122 8365121 2026-05-04T10:51:03Z Clump 81610 Undid revision [[Special:Diff/8364891|8364891]] by [[Special:Contributions/Thanhtrieu120724|Thanhtrieu120724]] ([[User talk:Thanhtrieu120724|talk]]) 8365122 wikitext text/x-wiki {{Project:Support desk/Header/{{int:lang}}}} {{Auto archiving |archive = Project:Support desk/Archive %(counter)d |algo = old(14d) |counter = 25 |maxarchivesize = 250K |minthreadsleft = 2 |minthreadstoarchive = 1 |archiveheader = {{talk archive}} }} == request to have [[Special:Tags]] sorted by tag name == {{tracked|T424105}}Better to have alphabetical order in first column of [[Special:Tags]] to find easily one's tag. Thanks. [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 17:55, 19 April 2026 (UTC) :@[[User:Wladek92|Wladek92]] See [[How to report a bug]]. [[User:Malyacko|Malyacko]] ([[User talk:Malyacko|talk]]) 12:49, 21 April 2026 (UTC) ::is that a bug ? rather an improvement. Confirmed: it is a ''feature request'' -- [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 18:35, 21 April 2026 (UTC) :::The first sentence on the linked page says: "These guidelines explain how to write a good bug report or feature request". [[User:Malyacko|Malyacko]] ([[User talk:Malyacko|talk]]) 10:14, 22 April 2026 (UTC) == why edit section link is missing on pages ? == {{tracked|T424198}} I have observed a difference on the section title of the rendered pages I cannot explain logically. Here it is : On page Extension:InlineComments I click the following title from the TOC, i.e. -> https://www.mediawiki.org/wiki/Extension:InlineComments#Download<br/> and there is '''no 'Edit section' link''' beside the section title 'Download' On page Wikimedia_Research I click the following title from the TOC, i.e. -> https://www.mediawiki.org/wiki/Wikimedia_Research#Mandate<br/> and '''there is an 'Edit section'''' link beside the title 'Mandate' shown as [ [https://www.mediawiki.org/w/index.php?title=Wikimedia_Research&action=edit&section=1 edit] ] <u>Question:</u> why the Edit section link is sometimes present, sometimes absent beside the title ? Thanks. [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:21, 20 April 2026 (UTC) :I think it's because extension pages use [[Template:Extension]] which contains <code><nowiki>{{#if:{{TRANSLATABLEPAGE}}|__NOEDITSECTION__}}</nowiki></code>. See [[Help:Magic words]]. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 11:04, 20 April 2026 (UTC) ::thanks, but this should be transparent to the editor: from an external point of view, I only want to use the functionality to update a section regardless to the code hidden behind and independently of the used namespace.<br/>I add for reference -> https://www.mediawiki.org/wiki/Help:Section/Editing_sections_of_included_templates. ::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 12:17, 20 April 2026 (UTC) :::I think it's because the way translation is done on this website is a bit of a mess. Well, it seems to work well, but leaves the wikitext in a mess. Maybe editing sections in that context (i.e. translation system plus the extension template) would make it worse. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 10:32, 21 April 2026 (UTC) ::::@[[User:Jonathan3|Jonathan3]], I agree. The translations can make the edit button not appear. [[User:Floating Orb|Floating Orb]] ([[User talk:Floating Orb|talk]]) 03:18, 23 April 2026 (UTC) :::::thanks for your support, track added. The edit possibility is expected on the root EN page (else the translated pages are using messages and there is ''normally'' no edit button there). :::::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 09:54, 23 April 2026 (UTC) == Photo = File == [[MediaWiki:Mobile-frontend-editor-uploadenable]]: Please replace the word "photo" here with "file", its not for just "photo". Sincerely, [[User:Qədir|Qədir]] ([[User talk:Qədir|talk]]) 20:57, 23 April 2026 (UTC) == Categories not sorting content properly and next/previous page broken? == I don't know how to describe the problem succinctly, so I'll give a simple example to start: <nowiki>https://fireemblemwiki.org/wiki/Category:Navigation_templates</nowiki> this category has 222 pages. If you click the "next" button, you are taken to a page with only one categorized item, 21 pages are missing from the listing. Then, if you click previous page, it sorts the categories starting from A instead of 0 and gives "The following 193 pages are in this category, out of 222 total.", if you click previous again (meaning the category is '''2 pages long going forward''' but '''3 pages long going backwards''') you get a page showing entries sorted as 0 to A comprising "The following 29 pages are in this category, out of 222 total.". Additionally, alphabetization seems to be behaving oddly. New files are being put at the end of the category, sorted alphabetically. So for example, If I upload "Carl.png" to ExampleCategory, the category will become "Bob.png, Sam.png, Tim.png, '''Carl.png'''". Instead of the expected "Bob.png, '''Carl.png''', Sam.png, Tim.png". This has progressed to "Bob.png, Sam.png, Tim.png, '''Alfred.png, Carl.png, Dan.png, Ed.png'''" in more active categories. Example of the alphabetization issue: fireemblemwiki.org/wiki/Category:Yutona_Heroes_War_Chronicles_portraits "Portrait yuni trs01.png, Portrait zacharia trs01.png, Portrait zeek 01 trs01.png, '''Portrait charlent trs01.png, Portrait golgotha trs01.png'''" What is gong on here? I'm only an editor so I'm not sure how to diagnose this, and when I asked the backend guys they said none of the extensions should be breaking categories, and that it might be a 1.43 feature change? But I don't understand what this feature would be. I don't think it's being caused by anything obvious like sortkeys or cache issues, it's been like this for about six months. I've also tried a few things like editing the category page with some minor edit to make it update, but that doesn't seem to help. It also happens if I look around the category pages while logged out. [[Special:Contributions/&#126;2026-25342-15|&#126;2026-25342-15]] ([[User talk:&#126;2026-25342-15|talk]]) 02:02, 25 April 2026 (UTC) == How to find out when a certain Namespace is used across the wikis? == Hello! I'll just give an example right away. If I wanted to know all the instances (of the several Wikisource projects in the Wikimedia world) where a special namespace usually called "Author:" (in English) is used, while it does not have a fixed number but varies from project to project ([https://en.wikisource.org/wiki/Special:NamespaceInfo en/102] or [https://es.wikisource.org/wiki/Especial:NamespaceInfo es/106]], how would I do that? [[User:Pxos|Pxos]] ([[User talk:Pxos|talk]]) 14:21, 26 April 2026 (UTC) == Good starting doc for editing templates == Any recommendations for good starting points for editing templates on a MediaWiki install? I've found * https://www.mediawiki.org/wiki/Help:Templates * https://en.wikipedia.org/wiki/Help:A_quick_guide_to_templates * https://en.wikipedia.org/wiki/Help:Template but I'm finding them challenging to learn from. Are there any I've missed? Maybe some "unofficial" documents or articles or blogposts I should read? [[User:Bsammon|Bsammon]] ([[User talk:Bsammon|talk]]) 00:43, 27 April 2026 (UTC) :A good starting point is looking at existing templates. Ask a specific question about what you're trying to do :-) [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 12:54, 29 April 2026 (UTC) ::use also the sandbox and write testcases to see how parameters react and follow the code source ::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:53, 1 May 2026 (UTC) == 1.43 CheckUser Internal Error == When attempting to execute CheckUser inquiries on 1.43, I can run the "Get IP Addresses" for a registered account and the "Get Users" for an IP address without issue. But attempting to run the "Get Actions" for either registered or unregistered, as well as attempting to use Special:Investigate, both throw the fatal exception/internal error: <code>[afDsJx7ifTZnjjMNwX4hMwAFmxo] /index.php?title=Special:CheckUser Error: Class "Firebase\JWT\JWT" not found</code> Yet strangely these actions are still logged in the CU log, even though I can't view any data from them. [[User:The Boston Railfan|The Boston Railfan]] ([[User talk:The Boston Railfan|talk]]) 17:23, 28 April 2026 (UTC) :There's a similar question here - [[Topic%3AWgcydicxa790v7io]] - and the answer was to run <code>composer update --no-dev</code>. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 12:53, 29 April 2026 (UTC) == Marking [sic] text or creating a custom tag == I'm using my wiki to collaboratively transcribe old documents. With this, I need to balance accurately transcribing the text and fixing outdated or incorrect usages. Is there a way I can markup this text? And if one doesn't already exist, is it possible to make my own custom tags? "The ((Berenstein|Berenstain)) Bears is a children's literature franchise." [[Special:Contributions/&#126;2026-26583-63|&#126;2026-26583-63]] ([[User talk:&#126;2026-26583-63|talk]]) 12:46, 1 May 2026 (UTC) :Is it possible to write a custom parser extension that registers new bracket syntaxes? I want to avoid heavy syntax like <nowiki>{{#sic:Berenstein|Berenstain}}</nowiki> or <sic>Berenstein|Berenstain</sic>. [[Special:Contributions/&#126;2026-26583-63|&#126;2026-26583-63]] ([[User talk:&#126;2026-26583-63|talk]]) 12:57, 1 May 2026 (UTC) == Distinguish articles within categories == Hello! I am a user of the Kurdish Wiktionary. My problem is that several variants of the same word appear in the same category without it being possible to distinguish them. It sometimes happens that within the same category, there are more variants than standard words... I would therefore like to know if it is technically possible to display a page using a given template in a category with a specific color or symbol (as is the case for page redirects which are displayed in italics)? [[User:Ghybu|Ghybu]] ([[User talk:Ghybu|talk]]) 16:06, 1 May 2026 (UTC) == Add topic == [https://www.mediawiki.org/wiki/Project:Support_desk#Post_a_new_question This page] says: "4. To start a new thread, click the box with the text Add topic." But... there IS no such button. - [[User:Erik Baas|Erik Baas]] ([[User talk:Erik Baas|talk]]) 07:27, 2 May 2026 (UTC) == PageSaveComplete Hook and rendered HTML == I'm trying to store the rendered html of articles in my main namespace. Right now I'm trying to save them as a file trying to get it to work, but then I plan on saving it in a database. I'm using MediaWiki 1.43.8. <pre>$wgHooks['PageSaveComplete'][] = function($wikiPage, $user, $summary, $flags, $revisionRecord, $editResult){ if($wikiPage->getTitle()->getNamespace() !== NS_MAIN) return true; $title = $wikiPage->getTitle(); $pageName = $title->getPrefixedDBkey(); $services = MediaWiki\MediaWikiServices::getInstance(); $content = $revisionRecord->getContent(MediaWiki\Revision\SlotRecord::MAIN); $renderer = $services->getContentRenderer(); file_put_contents('test1.html', 'test 1'); $parserOptions = $services->getParserFactory()->getParserOptionsFactory()->newOptions(); file_put_contents('test2.html', 'test 2'); $parserOutput = $renderer->getParserOutput($content, $title, null, $parserOptions); $html = $parserOutput->getText(); file_put_contents('test3.html', $html); return true;};</pre> I think the error is between test 1 and test 2 as the first file writes and the second doesn't. I don't get any server log or browser errors. [[Special:Contributions/&#126;2026-26696-50|&#126;2026-26696-50]] ([[User talk:&#126;2026-26696-50|talk]]) 22:45, 2 May 2026 (UTC) == Is the Special:RestSandbox page available for third-party wikis (i.e. external installations)? == I asked this before on the [[API:REST API]] page but didn't get any response there. I read somewhere that it will be available on MW 1.46, can anyone confirm this? [[User:Draheinsunvale|Draheinsunvale]] ([[User talk:Draheinsunvale|talk]]) 22:14, 3 May 2026 (UTC) == The first one 1️⃣ million times is the one 1️⃣ 4 me == Cloudy ☁️ with a chance of the sun 🌞 making the 🌻 and the 🫛 🫛 grow towards the horizon…hope42day’s forecast! [[Special:Contributions/&#126;2026-27047-81|&#126;2026-27047-81]] ([[User talk:&#126;2026-27047-81|talk]]) 04:26, 4 May 2026 (UTC) q35m8fmfyl0rwlpnpfufd8gdh72s0xa 8365123 8365122 2026-05-04T10:51:14Z Clump 81610 Undid revision [[Special:Diff/8364890|8364890]] by [[Special:Contributions/~2026-27047-81|~2026-27047-81]] ([[User talk:~2026-27047-81|talk]]) 8365123 wikitext text/x-wiki {{Project:Support desk/Header/{{int:lang}}}} {{Auto archiving |archive = Project:Support desk/Archive %(counter)d |algo = old(14d) |counter = 25 |maxarchivesize = 250K |minthreadsleft = 2 |minthreadstoarchive = 1 |archiveheader = {{talk archive}} }} == request to have [[Special:Tags]] sorted by tag name == {{tracked|T424105}}Better to have alphabetical order in first column of [[Special:Tags]] to find easily one's tag. Thanks. [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 17:55, 19 April 2026 (UTC) :@[[User:Wladek92|Wladek92]] See [[How to report a bug]]. [[User:Malyacko|Malyacko]] ([[User talk:Malyacko|talk]]) 12:49, 21 April 2026 (UTC) ::is that a bug ? rather an improvement. Confirmed: it is a ''feature request'' -- [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 18:35, 21 April 2026 (UTC) :::The first sentence on the linked page says: "These guidelines explain how to write a good bug report or feature request". [[User:Malyacko|Malyacko]] ([[User talk:Malyacko|talk]]) 10:14, 22 April 2026 (UTC) == why edit section link is missing on pages ? == {{tracked|T424198}} I have observed a difference on the section title of the rendered pages I cannot explain logically. Here it is : On page Extension:InlineComments I click the following title from the TOC, i.e. -> https://www.mediawiki.org/wiki/Extension:InlineComments#Download<br/> and there is '''no 'Edit section' link''' beside the section title 'Download' On page Wikimedia_Research I click the following title from the TOC, i.e. -> https://www.mediawiki.org/wiki/Wikimedia_Research#Mandate<br/> and '''there is an 'Edit section'''' link beside the title 'Mandate' shown as [ [https://www.mediawiki.org/w/index.php?title=Wikimedia_Research&action=edit&section=1 edit] ] <u>Question:</u> why the Edit section link is sometimes present, sometimes absent beside the title ? Thanks. [[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:21, 20 April 2026 (UTC) :I think it's because extension pages use [[Template:Extension]] which contains <code><nowiki>{{#if:{{TRANSLATABLEPAGE}}|__NOEDITSECTION__}}</nowiki></code>. See [[Help:Magic words]]. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 11:04, 20 April 2026 (UTC) ::thanks, but this should be transparent to the editor: from an external point of view, I only want to use the functionality to update a section regardless to the code hidden behind and independently of the used namespace.<br/>I add for reference -> https://www.mediawiki.org/wiki/Help:Section/Editing_sections_of_included_templates. ::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 12:17, 20 April 2026 (UTC) :::I think it's because the way translation is done on this website is a bit of a mess. Well, it seems to work well, but leaves the wikitext in a mess. Maybe editing sections in that context (i.e. translation system plus the extension template) would make it worse. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 10:32, 21 April 2026 (UTC) ::::@[[User:Jonathan3|Jonathan3]], I agree. The translations can make the edit button not appear. [[User:Floating Orb|Floating Orb]] ([[User talk:Floating Orb|talk]]) 03:18, 23 April 2026 (UTC) :::::thanks for your support, track added. The edit possibility is expected on the root EN page (else the translated pages are using messages and there is ''normally'' no edit button there). :::::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 09:54, 23 April 2026 (UTC) == Photo = File == [[MediaWiki:Mobile-frontend-editor-uploadenable]]: Please replace the word "photo" here with "file", its not for just "photo". Sincerely, [[User:Qədir|Qədir]] ([[User talk:Qədir|talk]]) 20:57, 23 April 2026 (UTC) == Categories not sorting content properly and next/previous page broken? == I don't know how to describe the problem succinctly, so I'll give a simple example to start: <nowiki>https://fireemblemwiki.org/wiki/Category:Navigation_templates</nowiki> this category has 222 pages. If you click the "next" button, you are taken to a page with only one categorized item, 21 pages are missing from the listing. Then, if you click previous page, it sorts the categories starting from A instead of 0 and gives "The following 193 pages are in this category, out of 222 total.", if you click previous again (meaning the category is '''2 pages long going forward''' but '''3 pages long going backwards''') you get a page showing entries sorted as 0 to A comprising "The following 29 pages are in this category, out of 222 total.". Additionally, alphabetization seems to be behaving oddly. New files are being put at the end of the category, sorted alphabetically. So for example, If I upload "Carl.png" to ExampleCategory, the category will become "Bob.png, Sam.png, Tim.png, '''Carl.png'''". Instead of the expected "Bob.png, '''Carl.png''', Sam.png, Tim.png". This has progressed to "Bob.png, Sam.png, Tim.png, '''Alfred.png, Carl.png, Dan.png, Ed.png'''" in more active categories. Example of the alphabetization issue: fireemblemwiki.org/wiki/Category:Yutona_Heroes_War_Chronicles_portraits "Portrait yuni trs01.png, Portrait zacharia trs01.png, Portrait zeek 01 trs01.png, '''Portrait charlent trs01.png, Portrait golgotha trs01.png'''" What is gong on here? I'm only an editor so I'm not sure how to diagnose this, and when I asked the backend guys they said none of the extensions should be breaking categories, and that it might be a 1.43 feature change? But I don't understand what this feature would be. I don't think it's being caused by anything obvious like sortkeys or cache issues, it's been like this for about six months. I've also tried a few things like editing the category page with some minor edit to make it update, but that doesn't seem to help. It also happens if I look around the category pages while logged out. [[Special:Contributions/&#126;2026-25342-15|&#126;2026-25342-15]] ([[User talk:&#126;2026-25342-15|talk]]) 02:02, 25 April 2026 (UTC) == How to find out when a certain Namespace is used across the wikis? == Hello! I'll just give an example right away. If I wanted to know all the instances (of the several Wikisource projects in the Wikimedia world) where a special namespace usually called "Author:" (in English) is used, while it does not have a fixed number but varies from project to project ([https://en.wikisource.org/wiki/Special:NamespaceInfo en/102] or [https://es.wikisource.org/wiki/Especial:NamespaceInfo es/106]], how would I do that? [[User:Pxos|Pxos]] ([[User talk:Pxos|talk]]) 14:21, 26 April 2026 (UTC) == Good starting doc for editing templates == Any recommendations for good starting points for editing templates on a MediaWiki install? I've found * https://www.mediawiki.org/wiki/Help:Templates * https://en.wikipedia.org/wiki/Help:A_quick_guide_to_templates * https://en.wikipedia.org/wiki/Help:Template but I'm finding them challenging to learn from. Are there any I've missed? Maybe some "unofficial" documents or articles or blogposts I should read? [[User:Bsammon|Bsammon]] ([[User talk:Bsammon|talk]]) 00:43, 27 April 2026 (UTC) :A good starting point is looking at existing templates. Ask a specific question about what you're trying to do :-) [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 12:54, 29 April 2026 (UTC) ::use also the sandbox and write testcases to see how parameters react and follow the code source ::[[User:Wladek92|🚨 Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:53, 1 May 2026 (UTC) == 1.43 CheckUser Internal Error == When attempting to execute CheckUser inquiries on 1.43, I can run the "Get IP Addresses" for a registered account and the "Get Users" for an IP address without issue. But attempting to run the "Get Actions" for either registered or unregistered, as well as attempting to use Special:Investigate, both throw the fatal exception/internal error: <code>[afDsJx7ifTZnjjMNwX4hMwAFmxo] /index.php?title=Special:CheckUser Error: Class "Firebase\JWT\JWT" not found</code> Yet strangely these actions are still logged in the CU log, even though I can't view any data from them. [[User:The Boston Railfan|The Boston Railfan]] ([[User talk:The Boston Railfan|talk]]) 17:23, 28 April 2026 (UTC) :There's a similar question here - [[Topic%3AWgcydicxa790v7io]] - and the answer was to run <code>composer update --no-dev</code>. [[User:Jonathan3|Jonathan3]] ([[User talk:Jonathan3|talk]]) 12:53, 29 April 2026 (UTC) == Marking [sic] text or creating a custom tag == I'm using my wiki to collaboratively transcribe old documents. With this, I need to balance accurately transcribing the text and fixing outdated or incorrect usages. Is there a way I can markup this text? And if one doesn't already exist, is it possible to make my own custom tags? "The ((Berenstein|Berenstain)) Bears is a children's literature franchise." [[Special:Contributions/&#126;2026-26583-63|&#126;2026-26583-63]] ([[User talk:&#126;2026-26583-63|talk]]) 12:46, 1 May 2026 (UTC) :Is it possible to write a custom parser extension that registers new bracket syntaxes? I want to avoid heavy syntax like <nowiki>{{#sic:Berenstein|Berenstain}}</nowiki> or <sic>Berenstein|Berenstain</sic>. [[Special:Contributions/&#126;2026-26583-63|&#126;2026-26583-63]] ([[User talk:&#126;2026-26583-63|talk]]) 12:57, 1 May 2026 (UTC) == Distinguish articles within categories == Hello! I am a user of the Kurdish Wiktionary. My problem is that several variants of the same word appear in the same category without it being possible to distinguish them. It sometimes happens that within the same category, there are more variants than standard words... I would therefore like to know if it is technically possible to display a page using a given template in a category with a specific color or symbol (as is the case for page redirects which are displayed in italics)? [[User:Ghybu|Ghybu]] ([[User talk:Ghybu|talk]]) 16:06, 1 May 2026 (UTC) == Add topic == [https://www.mediawiki.org/wiki/Project:Support_desk#Post_a_new_question This page] says: "4. To start a new thread, click the box with the text Add topic." But... there IS no such button. - [[User:Erik Baas|Erik Baas]] ([[User talk:Erik Baas|talk]]) 07:27, 2 May 2026 (UTC) == PageSaveComplete Hook and rendered HTML == I'm trying to store the rendered html of articles in my main namespace. Right now I'm trying to save them as a file trying to get it to work, but then I plan on saving it in a database. I'm using MediaWiki 1.43.8. <pre>$wgHooks['PageSaveComplete'][] = function($wikiPage, $user, $summary, $flags, $revisionRecord, $editResult){ if($wikiPage->getTitle()->getNamespace() !== NS_MAIN) return true; $title = $wikiPage->getTitle(); $pageName = $title->getPrefixedDBkey(); $services = MediaWiki\MediaWikiServices::getInstance(); $content = $revisionRecord->getContent(MediaWiki\Revision\SlotRecord::MAIN); $renderer = $services->getContentRenderer(); file_put_contents('test1.html', 'test 1'); $parserOptions = $services->getParserFactory()->getParserOptionsFactory()->newOptions(); file_put_contents('test2.html', 'test 2'); $parserOutput = $renderer->getParserOutput($content, $title, null, $parserOptions); $html = $parserOutput->getText(); file_put_contents('test3.html', $html); return true;};</pre> I think the error is between test 1 and test 2 as the first file writes and the second doesn't. I don't get any server log or browser errors. [[Special:Contributions/&#126;2026-26696-50|&#126;2026-26696-50]] ([[User talk:&#126;2026-26696-50|talk]]) 22:45, 2 May 2026 (UTC) == Is the Special:RestSandbox page available for third-party wikis (i.e. external installations)? == I asked this before on the [[API:REST API]] page but didn't get any response there. I read somewhere that it will be available on MW 1.46, can anyone confirm this? [[User:Draheinsunvale|Draheinsunvale]] ([[User talk:Draheinsunvale|talk]]) 22:14, 3 May 2026 (UTC) 9l8nnhwop914qvpofazdpg7ovi3bp0y User talk:Shirayuki 3 2090786 8364374 8340626 2026-05-03T13:27:18Z Waldyrious 16665 /* Reverted edit */ new section 8364374 wikitext text/x-wiki {{archives|list= * [[/Archive 1]] (pre-Flow) * [[/Flow|Original Flow board]] * [[/2013|2013]] * [[/2014|2014]] * [[/2015|2015]] * [[/2016|2016]] * [[/2017|2017]] * [[/2018|2018]] * [[/2019|2019]] * [[/2020|2020]] * [[/2021|2021]] * [[/2022|2022]] * [[/2023|2023]] * [[/2024|2024]] }} == where are the id of the UI messages ? == Hi, in -> https://www.mediawiki.org/w/index.php?title=Help:Advanced_editing&diff=prev&oldid=6940302 it is right, but how (from where) I do identify the ID of the user interface to be used ? Thanks. --[[User:Wladek92|Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:16, 24 December 2024 (UTC) :See {{ll|Help:System_message#Finding_messages_and_documentation}}. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 10:35, 24 December 2024 (UTC) == Wikimedia_Apps/Team/iOS/Personalized_Wikipedia_Year_in_Review/How_your_data_is_used == Thank you for taking care of the translators and pages. Would you care to indicate why [https://www.mediawiki.org/w/index.php?title=Wikimedia_Apps/Team/iOS/Personalized_Wikipedia_Year_in_Review/How_your_data_is_used&oldid=prev&diff=6948124&markasread=2058413&markasreadwiki=mediawikiwiki a particular sentence was unmarked] for translation please? I understand that T:75 and T:76 ignore one sentence between them. [[User:Omotecho|Omotecho]] ([[User talk:Omotecho|talk]]) 03:51, 31 December 2024 (UTC) :You inserted unwanted {{tag|nowiki}} tags. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 05:03, 31 December 2024 (UTC) ::My bad! Case solved, I will be more careful switching between Source and Visual Editors. Not comprehended why nowiki tags are involved though… /: Thank you for your golden wisdom as always. [[User:Omotecho|Omotecho]] ([[User talk:Omotecho|talk]]) 05:56, 31 December 2024 (UTC) == Help:Notifications -can I edit it? == Hi {{PAGENAME}}, I have made some minor changes to [[Help:Notifications]]. However, it is not clear to me if the community here is invited to edit Help documentation. I hope the changes I made meet with your approval? Cheers, [[User:Ottawahitech|Ottawahitech]] ([[User talk:Ottawahitech|talk]]) 20:42, 23 January 2025 (UTC) :Hi again, I have made a few more minor changes to [[Help:Notifications/Thanks]]. I assume that you have no objection? [[User:Ottawahitech|Ottawahitech]] ([[User talk:Ottawahitech|talk]]) 20:58, 4 February 2025 (UTC) == Why do you leave whole chunks of the page out of translation markup? == Hey, I can't see any reasons to leave text out of translation tags, like you did on [[Wikimedia Language and Product Localization/Newsletter/2025/January]]. I understand that you did a lot of work on that page, because it had to be properly tagged. But whole lists and paragraphs ended up outside translate tags. Is it that you just didn't notice that? [[User:Ата|<span style="color:SteelBlue;">Ата</span>]] <sup>[[User talk:Ата|<span style="color:#80A0FF;">(talk)</span>]]</sup> 09:18, 5 February 2025 (UTC) :I didn't have enough time, so I only marked for translation the parts where the tagging was correct. For the other sections, I tried to indicate how they should be fixed to some extent. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 10:57, 5 February 2025 (UTC) ::Is there anywhere a template to mark pages if parts are not tagged or would that not be usefull? [[User:True|True]] ([[User talk:True|talk]]) 12:25, 18 February 2025 (UTC) == [[Special:Contribs/Allan_Candido_Guedes_-_ACG]] == Good day, please nuke the contribution as machine translation, per [[m:User talk:Allan Candido Guedes - ACG]] [[User:Minorax|Minorax]] ([[User talk:Minorax|talk]]) 04:06, 8 February 2025 (UTC) :{{done}} [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 04:38, 8 February 2025 (UTC) == Question == Hi Shirayuki, can you please create the [[Manual:$wgLinterWriteNamespaceColumnStage]] page? [[User:USB4215|USB4215]] ([[User talk:USB4215|talk]]) 14:04, 17 February 2025 (UTC) :I haven't checked for configuration variables additions/removals for weeks, so I'll do it in the coming days and reflect the changes on the pages. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 22:57, 17 February 2025 (UTC) :@[[User:USB4215|USB4215]]: I've checked the history of the MediaWiki core repository, but I couldn't find such a configuration variable.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 09:39, 8 March 2025 (UTC) :@[[User:USB4215|USB4215]]: That variable is defined by [[Extension:Linter]]. Configuration variables defined by extensions are not subject to the creation of separate manual pages.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 09:08, 9 March 2025 (UTC) == Revert == You reverted my edit [https://www.mediawiki.org/w/index.php?title=Wikimedia_Language_and_Product_Localization%2FCommunity_meetings&diff=7055576&oldid=7055379]. There are two sentences outside of the translation which should be inside, how can i do that? --[[User:Ailura|Ailura]] ([[User talk:Ailura|talk]]) 14:13, 25 February 2025 (UTC) :Use {{tag|tvar}} tags to make text untranslatable. -- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:02, 25 February 2025 (UTC) ::I wanted to make the text translatable, thank you. [[User:Ailura|Ailura]] ([[User talk:Ailura|talk]]) 06:49, 26 February 2025 (UTC) == Translation tricks == Hi Shirayuki, can you please help me to translate the name of the page "Special:ViewXML" in the sentence below <pre> Data Transfer defines a special page, "Special:ViewXML" </pre> thank you --[[User:JLTRY|JLTRY]] ([[User talk:JLTRY|talk]]) 09:57, 27 February 2025 (UTC) :To simplify translation units, use {{tag|code}} tags instead of quotes and enclose special page names with {{tag|tvar}} tags.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:56, 27 February 2025 (UTC) Hi Shirayuki, can you help I have an issue in this page when viewing it [[Extension:ContactPage/fr]] <pre> Personnalisation supplémentaire <span id="Adding_a_link_to_special_page_"Contact"_to_the_footer"> </pre> --[[User:JLTRY|JLTRY]] ([[User talk:JLTRY|talk]]) 08:43, 28 February 2025 (UTC) :If a heading contains links or code, you need to [[Special:Diff/7063359|add the nowrap attribute to the surrounding translate tag]]. For details, read the manual.--[[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 12:09, 28 February 2025 (UTC) Hi Shirayuki I do not really know how I should write the translate part for this paragraph My both last trials were reverted for [[Extension:Data_Transfer]]:<br> KO <pre><nowiki> <translate>You can also import content into page "slots" other than the main one, using MediaWiki's &lt;tvar name=1>{{ll|Multi-Content Revisions}}</tvar> feature, by adding the "Slot" column, like so:</translate> </nowiki></pre> KO <pre><nowiki> <translate>You can also import content into page "slots" other than the main one, using MediaWiki's {{ll|Multi-Content Revisions}} feature, by adding the <code>Slot</code> column, like so:</translate> </nowiki></pre> --[[User:JLTRY|JLTRY]] ([[User talk:JLTRY|talk]]) 12:42, 5 March 2025 (UTC) :Enclose each part that translators should not translate or modify with a separate {{tag|tvar}} tag. Your markup does not seem to meet that requirement, based on my reading of the page content.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:07, 5 March 2025 (UTC) ::I corrected [[ Extension:Data_Transfer]] [[User:JLTRY|JLTRY]] ([[User talk:JLTRY|talk]]) 07:16, 6 March 2025 (UTC) == Pagelinks.sql.gz file == Hi @[[User:Shirayuki|Shirayuki]] I am trying to work with the Pagelinks file in order to extract the number of articles that link to a specific Wiki page (same idea as can be seen in the [[:en:Help:What_links_here|"What-links-here]]" tool. However, when I loop over this sql like file, I find very weird cases of links that doesn't seem to exist in Wikipedia. For example, the first line in the file indicate that there is a link between page ids 1939 and 2. PageID 2 doesn't even seems to exist. Even when I look on pageIDs that do exist, the link indicated in the file does not exist in the actual wiki page. Am I missing anything? thanks a lot! [[User:Avrahami-isr|Avrahami-isr]] ([[User talk:Avrahami-isr|talk]]) 18:10, 28 February 2025 (UTC) :Please ask at [[Project:Support desk]]. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 22:10, 28 February 2025 (UTC) ::Sure, thanks! [[User:Avrahami-isr|Avrahami-isr]] ([[User talk:Avrahami-isr|talk]]) 02:07, 1 March 2025 (UTC) == how to call the template {{tlx|categoryPages}} without breaking the list ? == hello i need your help if you agree. My first steps in template coding let me create a simple template {{tlx|categoryPages}} today. Tests seem ok on the flow but when I call the template from a list # in [[Manual:Adding_support_for_new_filetypes#What_do_I_need_to_do?]] it lost the numbering. Where to look for ? blabla..... {{categoryPages|cat=Media handling extensions}}. ..is correct on the flow ..blabla # this is first list item on the same line but it breaks {{categoryPages|cat=Media handling extensions}}. # second item # third item Thankx -- [[User:Wladek92|Christian 🇫🇷 FR 🚨]] ([[User talk:Wladek92|talk]]) 21:00, 15 March 2025 (UTC) :@[[User:Wladek92|Wladek92]]: Writing {{tlx|CategoryPages}} will transclude [[Template:CategoryPages/en]]. Templates with translation-aware transclusion enabled behave in the same way.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 23:26, 15 March 2025 (UTC) ::Yes my problem is not if it is transcluded or not but as you see in the source, transclusion is requested to be made on the same line without breaking the list. ::<blockquote>blabla..... <nowiki>{{categoryPages|cat=Media handling extensions}}</nowiki>. ..is correct on the flow ..blabla # this is first list item on the same line but it breaks <nowiki>{{categoryPages|cat=Media handling extensions}}</nowiki>. # second item # third item</blockquote> ::[[User:Wladek92|Christian 🇫🇷 FR 🚨]] ([[User talk:Wladek92|talk]]) 10:43, 16 March 2025 (UTC) :::@[[User:Wladek92|Wladek92]]: Compare the source of {{tlx|CategoryPages}} and {{tlx|CategoryPages/en}}. Although you are transcluding the former, in reality, the latter is transcluded, which causes confusion.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 11:39, 16 March 2025 (UTC) ::::Thanks seems having satisfying functionality , pb of the includes tags [[User:Wladek92|Christian 🇫🇷 FR 🚨]] ([[User talk:Wladek92|talk]]) 21:21, 16 March 2025 (UTC) == Pages that should not be translated == Sorry, that's already a few pages you've written about that I shouldn't translate. I have a few questions. Why are these pages marked as being intended for translation? So why are they displayed in "Translante content"? Shouldn't these pages have a block for displaying that they are/are not available for translation? How is it possible that some of these pages are already translated? Thank you [[User:Rebulka|Rebulka]] ([[User talk:Rebulka|talk]]) 16:26, 29 March 2025 (UTC) :@[[User:Rebulka|Rebulka]] See the source of [[MediaWiki Language Extension Bundle/installation]]-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 22:26, 29 March 2025 (UTC) ::Thank you for the answer. Unfortunately, I did not find the answer to my question on the recommended pages. I do not require an answer. It is only a suggestion for possible improvement. "The page should not be translated - it is not published anywhere in the translation offer". Sunny day [[User:Rebulka|Rebulka]] ([[User talk:Rebulka|talk]]) 07:00, 30 March 2025 (UTC) :::@[[User:Rebulka|Rebulka]] The above source says "This file text is included in MLEB tarball. Please do not wikify if that would make it not work as plain text file", so the page should not be prepared for translation.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 07:41, 30 March 2025 (UTC) :@[[User:Rebulka|Rebulka]] We handle a lot of pages, so it would be helpful if you could provide a link to the specific page you're referring to. (I have a general idea, but it would help to clarify.)-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 07:55, 30 March 2025 (UTC) ::Thank you for your reply. I will keep you posted on these pages. It is amazing that they are being released for translation and have even been partially translated. Slunicky's Day [[User:Rebulka|Rebulka]] ([[User talk:Rebulka|talk]]) 08:59, 30 March 2025 (UTC) == Reversion == Hi, why did you revert my edits to [[Project:Requests for permissions/Header]]? – [[User:Svartava|<b style="color:#4682B4; font-size:105%;">Svārtava</b>]] ([[User talk:Svartava|t]][[Special:Contributions/Svartava|ɕ]]) 05:40, 7 April 2025 (UTC) :@[[User:Svartava|Svartava]]: The reason for reverting the change is to better preserve the original intent. The phrase "Promotion to" in the original text emphasizes the process of advancing to specific roles, which was important for clarity. The revised version lost this nuance and became overly simplified. Retaining the original phrasing ensures the meaning is conveyed more accurately.~~ [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 11:39, 9 April 2025 (UTC) ::OK, but there are some minor issues which I was trying to solve with my edit. For example, there should be mention of other user groups like importer and bot which are granted through that requests page only. Then, the page reads as "Use this page for requests for: autopatrollers, uploaders [...]" but "requests for autopatrollers" does not mean "requests for autopatroller rights" or "requests for autopatrollership"; ordinarily it implies "requests that are to be fulfilled by autopatrollers". – [[User:Svartava|<b style="color:#4682B4; font-size:105%;">Svārtava</b>]] ([[User talk:Svartava|t]][[Special:Contributions/Svartava|ɕ]]) 09:53, 11 April 2025 (UTC) :::I understand the intention behind your edits, and I appreciate your effort to improve the clarity. That said, I believe the original phrasing carries specific intent, particularly in how it distinguishes types of requests and roles. Rewording it for grammar or simplification at the cost of that nuance is not ideal. :::Even if the current version isn't perfect, it has been working well enough — it's already translated and widely understood. Preserving the original meaning is more important than smoothing it out in a way that alters the intent. :::I'm happy to help refine the text if needed, but ultimately, this feels like something that should be discussed at [[Project:Village Pump]].-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 00:29, 12 April 2025 (UTC) == Segmenting translation units? == For [https://www.mediawiki.org/w/index.php?title=Trust_and_Safety_Product/Temporary_Accounts/Updates&diff=next&oldid=7487027 segmenting translation units], I trust your judgement, however, it actually causes pain to those translators who had already worked on them: sorry, I do not have to repeat what you were not happy with, or I appreciate shorter units, too usually. Is there something I could do to improve the situation, like go to the Portal and raise a flag, maybe to ask tech ppl consider something? I have encountered somebody who was segmenting longer ones and matching the existing translation to new short bits at the same time, but not recall who it was to ask for attention... Unfortunately, the T:91 as above link is an old part of the page, that I do not doubt I am not the only one who had already translated it many days back. Well, we both understand segmenting translation units does not require human hands actually, since the issue is to align the longer units into new T: numbers, but not the contents themselves... Of course, shorter units saves everybody's energy in the long run, since the system has better chances to reuse shorter ones later compared to longer ones, which means translators will see samples on the right pane to work less pain (;. Kindly, [[User:Omotecho|Omotecho]] ([[User talk:Omotecho|talk]]) 21:07, 22 April 2025 (UTC) :@[[User:Omotecho|Omotecho]]: I do not split all translation units; I only split them when it is necessary to add or change translation variables due to changes in the source text (which may be changes made by others or by myself), and afterwards, sometimes I also update the translations. :It is not just a matter of splitting; since the source text may have been modified beforehand or the corresponding translations may have become outdated, I believe it is difficult to handle the splitting of translations systemically. :I think we should also request cooperation from those who are adding variables to large translation units on various pages, asking them to refrain from making changes. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 10:55, 23 April 2025 (UTC) ::You are so kind indeed showing the larger picture to me, and there are more points to watch for, I was blind folded. Yes, we need to accommodate changes made in the translation originals. And truly, if the translation original be segmented _after_ many translators on languages have already worked on that part, that is annoying from a translator's scope, not appreciated nor encourage working on that part: It leaves bitter taste with me, that readers will wonder why the headnote tells them their local language page is not updated or which part is not suited to the reality. ::I will note and be careful for those parts updated, and wish I will coordinate my translation as you do. Thank you taking time replying me. veru much. I'd call it case solved for my question here. Kindly, [[User:Omotecho|Omotecho]] ([[User talk:Omotecho|talk]]) 15:19, 23 April 2025 (UTC) ::As a translator, here are my cons for long units: ::<ul><li>It is a burden to translate big units, as you seem not to progress. <li>You dont see easily what has changed. <li>They are difficult to reread and correct since a single ID is assigned to the long unit (several sentences sometimes) and you must search within the text. <li>The long units are those which most remain untranslated. <li>Translation suggestions not often appear with long units. <li>diff on messages cannot be closed to retrieve space on the screen.<li>units with 4,5,6... sentences are repulsive</ul> ::My pros for short units: ::<ul><li>It is pleasant translate short units and progression is fast. <li>You see immediately what has changed. <li>rereading is fast. <li>correction is fast since each small unit has its ID <li>The short units are those which are most translated. <li>Translation suggestions often appears immedialty for short units. <li>diff is reduced and leaves space on the screen.<li>units with 2 to 3 sentences are acceptable<li>splitting long translated units into smaller ones is easy since you move already translated lines in sequence to following units<li>I am favorable to @[[User:Shirayuki|Shirayuki]] principle even if detail is pushed to each sentence.</ul> [[User:Wladek92|Christian 🇫🇷 FR 🚨]] ([[User talk:Wladek92|talk]]) 07:17, 2 May 2025 (UTC) == Changing <code>doc.wikimedia.org</code> external links to <code>wmdoc:</code> wikilinks == Hi Shirayuki :) Could I ask why you're changing external links to <code>doc.wikimedia.org</code> to <code>wmdoc:</code> wikilinks? In many cases, IMO, the external link styling looks/fits better in the context of the page (e.g., [https://www.mediawiki.org/w/index.php?title=Manual:Notifications&diff=prev&oldid=7593187]); and - in any event - I'm not sure that all external links to doc.wikimedia.org need to be replaced with wikilinks in this way. Is there a reason to prefer formatting them as wikilinks that I'm not aware of? Apologies if I've missed anything here. Best wishes, <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 21:25, 27 April 2025 (UTC) :From a behind the scenes point of view, Its better for how they are tracked in the various DB tables such as the externallinks table. [[User:P858snake|P858snake]] ([[User talk:P858snake|talk]]) 11:12, 28 April 2025 (UTC) ::@[[User:P858snake|P858snake]] Fair enough - I suppose my next question would be, is that something that we need to be/should be considering when editing pages on MW.org? (/genuine question)&nbsp;&nbsp;&nbsp;If it is, then I guess the changes make sense <small>(though IMO it'd be nicer if they had an edit summary with a brief reason behind the change)</small>. I guess I'm used to enwiki's [[w:en:Wikipedia:Don't worry about performance]] from when I was editing over there, but I don't know whether MW.org generally shares that perspective :) Best, <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 11:43, 28 April 2025 (UTC) == cancelling formatnum: for japanese == Hi, you have cancelled -> https://www.mediawiki.org/w/index.php?title=Help%3AExtension%3AKartographer&oldid=prev&diff=7601386 but I dont understand japanese. The idea, if you take time to analyse my proposal was : 1. do not impact translators if the number is modified 2. respect the number format according to user language I dont see what is wrong. If you suspect formatnum: is making a bad translation you should request the correction for japanese to be aligned correctly with other formats rather than making an undo and hiding the problem being aware of it. If the problem is known, a reference should be appreciated for checking. Can you clarify please ? Thanks. -- [[User:Wladek92|Christian 🇫🇷 FR 🚨]] ([[User talk:Wladek92|talk]]) 06:49, 2 May 2025 (UTC) :<code>formatnum</code> is fine — Japanese also uses "3.6" for decimals. But this case is special because it’s followed by "million". :In Japanese, "3.6 million" is translated as "360万", not "3.6百万", which sounds unnatural and confusing. :If the number is turned into a variable, the translation interface shows $1 million instead of 3.6 million, and we can no longer rewrite the number. :So I reverted the change to keep the number as a literal, allowing translators to produce natural output like "360万". Thanks.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 10:56, 2 May 2025 (UTC) == $wgRestrictionTypes == [[Special:Diff/7617076|Adding comma-separator + word-separator]] and then getting all three actions inside a tvar doesn't fix my problem... My language only allows me to translate the word "itself" if it comes '''before''' <code>protect</code>, not after. [[User:Eduardogobi|Eduardogobi]] ([[User talk:Eduardogobi|talk]]) 05:57, 9 May 2025 (UTC) :@[[User:Eduardogobi|Eduardogobi]]: I made adjustments based on feedback from someone who understands Brazilian Portuguese. I hope this helps — how does it look now?-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 10:54, 9 May 2025 (UTC) ::Yep, commit your last edit to Fuzzy, it will solve our issue. Thanks! [[User:Eduardogobi|Eduardogobi]] ([[User talk:Eduardogobi|talk]]) 05:34, 10 May 2025 (UTC) == Work on Download page == Hi @[[User:Shirayuki|Shirayuki]], you just [https://www.mediawiki.org/w/index.php?title=Download&diff=prev&oldid=7619928 reverted this edit] I made on [[Download]]. As I wrote in my edit summary, I believe the content is largely duplicated in the "All versions" box. You mentioned the old branch support. I don't see why this is so relevant, as this page seem to be about downloading for new installations, not [[Manual:Upgrading]]. I have a strong motivation to make the documentation generally much more concise, but I am always grateful when people push back, because I am relatively new here! [[User:Douginamug|Douginamug]] ([[User talk:Douginamug|talk]]) 22:12, 9 May 2025 (UTC) :@[[User:Douginamug|Douginamug]]: Instead of listing the releases, I think it would be better to direct users to [[Manual:Upgrading]], but that page does not mention the "heavily modified installations" you removed. :The translation unit you removed has been [https://www.mediawiki.org/w/index.php?title=Special:Translations&message=Translations%3ADownload%2F17%2Fja translated into many languages], so I’m generally opposed to its removal.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 22:27, 9 May 2025 (UTC) :@[[User:Douginamug|Douginamug]]: Your changes to [[Download]] is quite bold and has a significant impact on the many existing translations. How about drafting it in a subpage of your user page first, and then proposing it at [[Project:Village Pump]]? [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 23:25, 9 May 2025 (UTC) :: (talk page stalker) Personally I agree with Douginamug that the content removed was redundant on the merits, but also with Shirayuki that it would be wise to draft and discuss changes rather than implementing them boldly. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun</sub>]] 05:27, 10 May 2025 (UTC) ::@[[User:Shirayuki|Shirayuki]] I have reverted all my recent edits, restoring the last version you marked for translation. I will do as you suggest, and make a personal subpage first before proposing it at the Village pump. ::I was intentionally being bold, you are right! I fear that being less bold will mean I ultimately do less editing, and as far as I'm concerned, there is really a lot that should be edited (eventually). Despite being bold, I meant no respect to all the translation work that has and is being done. [[User:Douginamug|Douginamug]] ([[User talk:Douginamug|talk]]) 05:32, 10 May 2025 (UTC) ::: This specific page is super high-profile (linked from the main page and the sidebar), so uses special rules. For lower-profile pages (basically anything else), boldness is fine and encouraged. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun</sub>]] 05:38, 10 May 2025 (UTC) :::Practical questions before I beging: Is it preferred to always wrap translated blocks in the <code><nowiki>{{void}}</nowiki></code> template instead of deleting them? If yes, can I move voided blocks to the end of the page, to avoid cluttering the source? (It seems only possible to edit translated content properly with the source editor) [[User:Douginamug|Douginamug]] ([[User talk:Douginamug|talk]]) 05:42, 10 May 2025 (UTC) :::: The purpose of the void blocks is for translated content that cycles in and out of existence as new versions are released (for example, sometimes there's a legacy non-LTS version and a legacy LTS version, sometimes there's two legacy LTS versions, etc.), so it always appears in the translate UI and the translations can be reused with each cycle. [https://www.mediawiki.org/w/index.php?title=Download&diff=prev&oldid=6949712 Example void cycling edit]. Content that's going to disappear and stay gone forever can just be deleted. :::: (It seems only possible to edit translated content properly with the source editor) -> indeed, VE and translate don't play nice with each other, which is a known issue and not easy to fix because they work in fundamentally incompatible ways. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun</sub>]] 05:50, 10 May 2025 (UTC) :::::Since this "void cycling edit" is quite tedious every time, I’m hoping someone could write a Lua module to automate the toggling of visibility? It would be a huge help! :) -- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 06:06, 10 May 2025 (UTC) :::: And, as a technical matter, it doesn't matter where the void blocks are, but personally I would prefer they stay near where they will get unvoided to, to make the voiding an d unvoiding easier. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun</sub>]] 05:53, 10 May 2025 (UTC) :::::Great! Thanks both of you for the information, that's enough for me to work from for now :) [[User:Douginamug|Douginamug]] ([[User talk:Douginamug|talk]]) 05:54, 10 May 2025 (UTC) == Your reverting == Your edit summary “Revert as most of their edits have been reverted and are not trustworthy” is nonsense as most reverted does not make sense as ip address may be shared by multiple users. [[Special:Contributions/185.137.137.154|185.137.137.154]] 07:53, 24 May 2025 (UTC) == Spurious span in translated versions of [[Help:Lint errors/multiple-unclosed-formatting-tags]] == Hi, Shirayuki. As you know, in translations of this page where segment 10 (a section title containing two variables) is translated, a spurious span is generated above the section. Even though you tried to fix the issue (among other users, in different ways, such as @Tooki, @Pppery or myself), as of now, the issue is still there, as the following code is generated where it shouldn't: <code><nowiki><span id="Scenario_2:_Incorrect_use_of_&lt;tag">_instead_of_&lt;/tag&gt;"&gt;</span></nowiki></code> [[User:Sabbut|Sabbut]] ([[User talk:Sabbut|talk]]) 09:41, 8 June 2025 (UTC) == Extension:MobileFrontend == Hello Shirayuki, your latest update to mark this document for translation leaves the "It is preferable to use..." paragraph untranslated again. Why? It's pointless to translate when some strings are still left in English and there's nothing we can do. While I'm at it I should mention that translation markup of lists in that page is all wrong according to the manual, with translation tags wrapping also bullets for single items. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 14:06, 22 June 2025 (UTC) :@[[User:Tactica|Tactica]]: There's no need to make the {{tag|code}} tag translatable, so it should be excluded using the {{tag|tvar}} tag instead. :In [[Special:Diff/7701851]], you wrapped <code><nowiki>* {{ll|Skin:MonoBook}}</nowiki></code> in {{tag|translate}}, which is also incorrect. :If the tagging is not correct, I can't just mark the page for translation as-is. :As for the existing tagging of list items, there are already many translations that would be affected by any change. Therefore, it's preferable not to modify them just to follow the manual.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 22:04, 22 June 2025 (UTC) == Your revert in Help:Categories doesn't make sense == [https://www.mediawiki.org/w/index.php?title=Help%3ACategories&oldid=prev&diff=7703597 This revert] of yours doesn't make any sense. As it is, the page is <strong>again</strong> broken because [[MediaWiki:pagecategories]] was <strong>deleted</strong> on this site. With my change, the intent of the document remains intact as translators can still translate "Categories" as intended. Really, with this kind of behaviour sometimes it gets frustrating to try and contribute anything to this site. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 22:52, 23 June 2025 (UTC) :Even if [[MediaWiki:pagecategories]] doesn't exist on this site, it's still a standard MediaWiki message, and [https://translatewiki.net/w/i.php?title=Special:Translations&message=MediaWiki%3APagecategories its source text and translations do exist]. You seem to have no understanding of that fact. :The translation unit T:18 you tried to change [https://www.mediawiki.org/w/index.php?title=Special%3ATranslations&message=Translations%3AHelp%3ACategories%2F18%2Fja has a large number of translations], and I don’t think your edit is important enough to justify invalidating all of them and forcing them to be retranslated. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 22:59, 23 June 2025 (UTC) ::In other words, saving you some work is more important than usable documentation. ::I'll remember that. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 23:04, 23 June 2025 (UTC) == Edit summaries == Hi Shirayuki :) If possible, please could I ask that you provide more information in edit summaries when making changes to previously-prepared translation markup (e.g., removing translation tags from certain text)? E.g., in [[Special:Diff/7732048]], you removed the translation tags from the custom step within the 'installation' section; but, as the edit summary for that edit was just {{tq|simplify translation units}}, I'm not sure why that removal was made. From my perspective, that sentence should be fine to be translated (& I imagine that it might potentially be confusing to people reading the translated versions of the page if it isn't). So I guess I'm left not really seeing a clear reason why the tags have been removed (and therefore wanting to re-add them to the page); but at the same time not wanting to edit-war by reverting your removal of them. As another example within that edit, I'm not sure why the multiple translation variables within the description for <code>$wgEmailAuthUnmaskedDomains</code> were condensed down into one. From my perspective, when preparing that description for translation, I deliberately put each domain name into its own tvar; so that (e.g.) languages that would organise the list in a different way (and/or that would use a different separator between the domain names than a comma) could do so with more flexibility than with one 'mega-<code>tvar</code>' that contained all the domains together. But without knowing the reason behind your change, and because I don't want to edit war, I'm again reluctant to blindly revert. Let me know if I've worded anything poorly, and/or if you have any queries about anything I've said. I apologise if there's anything here that I'm not taking into account. Best wishes, <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 06:09, 10 July 2025 (UTC) :@[[User:A smart kitten|A smart kitten]]: Thank you for your message, and I’m sorry for not providing enough detail in the edit summary — it's indeed too short to fully explain everything. :As you know, parts that should not be changed by translators need to be excluded from translation using {{tag|tvar}}. I reverted parts where this wasn't sufficiently enforced, to avoid unintended edits in translated versions. :Also, regarding the variable names like $domain1, I’ve seen several cases where translators mistakenly translate such names when they’re written in plain English words. To avoid this, I replaced them with numeric placeholders like $1, which are generally safer and less likely to be changed. :I'm certainly aware that some languages use something other than commas for list separators. :Using messages like <code><nowiki>{{int|comma-separator}}</nowiki></code> allows commas to be automatically replaced with the appropriate symbol for the page language, so I’d like to apply that where possible when there's time. :However, doing this can make the source harder to read, so in some cases it might be better to exclude the list from translation and present it as bullet points instead. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 11:56, 10 July 2025 (UTC) ::Thanks for the quick reply (and apologies for taking a few days to get back to you) <code>:)</code> ::{{pb}} ::{{tq|As you know, parts that should not be changed by translators need to be excluded from translation using ‎<code><tvar>...‎</tvar></code>.}} Indeed <code>:)</code> ::{{tq|I reverted parts where this wasn't sufficiently enforced, to avoid unintended edits in translated versions.}} For the sentence in question, I [{{fullurl:special:diff/7729841}} marked it up] as: ::{{#tag:syntaxhighlight|Add a {{((}}ll{{!}}{{^(}}tvar name=1>Manual:Hooks#Writing_a_hook_handler</tvar>{{!}}hook handler{{))}} for the {{^(}}tvar name=2>{{((}}ll{{!}}Extension:EmailAuth/EmailAuthRequireToken{{!}}EmailAuthRequireToken{{))}}</tvar> hook.|lang=wikitext}} ::Please could you let me know how this could be improved? As far as I can see, everything not in a tvar (except for the first <syntaxhighlight lang=wikitext inline>{{ll}}</syntaxhighlight> template name) is a part of the sentence that should be translated. (Am I missing something?) ::{{pb}} ::{{tq|Also, regarding the variable names like $domain1, I’ve seen several cases where translators mistakenly translate such names when they’re written in plain English words. To avoid this, I replaced them with numeric placeholders like $1, which are generally safer and less likely to be changed.}} Hmmm... yeah, that makes sense. I gave the variables names like <code>$domain1</code> in case knowing their type of text would make life easier for translators. I guess there are probably benefits and drawbacks to either approach - I see where you're coming from with the issue you've pointed out. ::{{pb}} ::{{tq|Using messages like <code><nowiki>{{int|comma-separator}}</nowiki></code> allows commas to be automatically replaced with the appropriate symbol for the page language, so I’d like to apply that where possible when there's time. However, doing this can make the source harder to read [...]}} Yeah. I get the reasoning for using <code><nowiki>{{int|comma-separator}}</nowiki></code>; but at the same time it does make the page a bit more unwieldy to edit, and potentially also allows for less flexibility when translating (although - as I'm not a translator - I'd defer to others on that front). ::One thing I forgot to say in my original message is that I also split the domain names into multiple tvars so that I could include the word "and" at the end of the list (to allow the sentence to flow a little more easily), but I guess it's not a <em>massive</em> problem if the sentence doesn't include that. ::It might also be worth noting that the current (singular) tvar appears to have potentially confused one translator, who may have been expecting it to only contain a single value - [{{fullurl:special:diff/7737247}}]. (I'll add some <code>qqq</code> documentation for that segment after leaving this message.) ::{{pb}} ::{{tq|[...] in some cases it might be better to exclude the list from translation and present it as bullet points instead.}} Personally speaking, I'd probably prefer not to do that here, as I feel like the current structure (where the default values can be included in the same line as the config variable's description) might be slightly cleaner/more readable than if the default values were in a list. In any event, thanks for the suggestion, though - I'll keep it in mind for the future <code>:)</code> ::{{pb}} ::Best, <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 13:15, 13 July 2025 (UTC) :::Regarding the {{#tag:source|{{ll{{!}}{{^(}}tvar name=1{{)^}}...{{^(}}/tvar{{)^}}{{!}}hook handler}}|lang=mediawiki|inline=1}} markup: the <code>ll|</code> part should also be included in the {{tag|tvar|open}}, since the template name isn’t meant to be translated or changed. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:10, 13 July 2025 (UTC) ::::Ah, thanks for pointing that out! I'm not sure why I didn't think to include that before. Best, <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 07:39, 14 July 2025 (UTC) ::::Hi again - please could you explain if there was anything else wrong with the updated markup, or if there was another reason for its [{{fullurl:special:diff/7746297}} re-removal] without an edit summary? The updated markup was: ::::{{#tag:syntaxhighlight|Add a {{((}}{{^(}}tvar name=1>ll{{!}}Manual:Hooks#Writing_a_hook_handler</tvar>{{!}}hook handler{{))}} for the {{^(}}tvar name=2>{{((}}ll{{!}}Extension:EmailAuth/EmailAuthRequireToken{{!}}EmailAuthRequireToken{{))}}</tvar> hook.|lang=wikitext}} ::::As far as I can see, everything that shouldn't be translated (including the <syntaxhighlight lang=wikitext inline>{{ll}}</syntaxhighlight> template call) is now within a tvar; and the segment can be translated similarly to <code><nowiki>Add a {{$1|hook handler}} for the $2 hook.</nowiki></code>. Am I missing something again (as I previously was)?&nbsp;/genq ::::{{pb}} ::::(As a side note, I preferred the style of the "EmailAuthHooks in WikimediaEvents" link prior to [{{fullurl:special:diff/7746432}} this change] - IMO it makes more sense with all of the text within the link (as I believe - when reading the text - it makes it slightly clearer what the link is pointing to); and TBH I don't like the idea that we have to make the page slightly less readable in general, to be able to make it translatable. Do you mind if I change it back? I recognise that - with its number of tvars - this segment may not be the easiest to translate, and I was planning to add <code>qqq</code> documentation to assist translators on that front.) ::::{{pb}} ::::Best, <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 08:55, 15 July 2025 (UTC) :::::@[[User:A smart kitten|A smart kitten]]: I reverted the change temporarily because I thought the hook page name might be missing "/Hooks" after the extension name. However, since the markup itself was correct, it seems the reversion wasn’t actually necessary.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 10:18, 15 July 2025 (UTC) ::::::Thanks for the reply :) I'll reapply the markup. Best, <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 10:36, 15 July 2025 (UTC) == Defective documentation == Unless you enjoy doing [https://www.mediawiki.org/w/index.php?title=Extension:Cite&oldid=7757228 this kind of edits] every time someone modifies a translatable page I strongly suggest you amend [[Help:Extension:Translate/Page_translation_administration#Markup_examples|the documentation]]. That page doesn't mention {{tl|ll}} at all for example. I'd do it myself but (1) the logic behind the syntax is beyond my comprehension and (2) documenting it with wikitext requires developer-grade template knowledge. It's hardly surprising that text based examples are scarce (and defective, it seems) and it's all mostly done with videos. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 06:00, 20 July 2025 (UTC) :> On mediawiki.org, you can use [[Template:Localized link]] to link to pages on the same wiki as a simpler alternative to Special:MyLanguage/. :Since {{tl|ll}} is just a shorthand for {{tl|Localized link}}, it's not entirely unmentioned.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 06:49, 20 July 2025 (UTC) ::Great, so it is mentioned but not used, so the documentation remains suboptimal. ::BTW your latest ''simplification'' in [[Extension:Cite]] made the second wikilink within the Limitations section use a hardcoded string, so the Spanish translation now looks like crap with a first capital letter in the middle of a sentence. Thank you very much. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 07:41, 20 July 2025 (UTC) :::@[[User:Tactica|Tactica]] I've boldly [{{fullurl:special:diff/7759064}} modified] that link so that only its target (and the <code>ll|</code> template call) are now within the <syntaxhighlight lang=wikitext inline><tvar></tvar></syntaxhighlight> tags, given that the link's text needs to be capitalised differently to the target page's title. Best, <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 15:15, 20 July 2025 (UTC) ::::Thanks [[Special:Contributions/&#126;2025-27996-1|&#126;2025-27996-1]] ([[User talk:&#126;2025-27996-1|talk]]) 21:41, 27 July 2025 (UTC) == Regarding link anchor to on-page section usage and marking [[Skin:Lakeus]] for translation == Thank you for your previous work on marking [[Skin:Lakeus]] for translation and helping me with formatting! It's sort of pity that I couldn't find a documentation about translation pages. So, in my newer edits regarding the dark mode, I used links like this: <nowiki>[[#Migration to dark mode|Migration to dark mode]]</nowiki> and I sort of don't know how should I wrap them into tvars. Could you kindly help me with this matter? Thanks in advance! -- [[User:Lakejason0|Lakejason0]] ([[User talk:Lakejason0|talk]]) 09:42, 28 July 2025 (UTC) :I have created a separate anchor, could you please kindly check if that was correct? Thanks in advance! -- [[User:Lakejason0|Lakejason0]] ([[User talk:Lakejason0|talk]]) 12:52, 29 July 2025 (UTC) ::@[[User:Lakejason0|Lakejason0]] I've marked it for translation. [[User:Ciencia Al Poder|Ciencia Al Poder]] ([[User talk:Ciencia Al Poder|talk]]) 20:39, 29 July 2025 (UTC) == Not sure why my edits are getting reverted? == Hi, I don't really understand why these reverts were made, without explanation: * https://www.mediawiki.org/w/index.php?title=Help:Temporary_accounts&diff=next&oldid=7807234 * https://www.mediawiki.org/w/index.php?title=Help:Temporary_accounts&diff=prev&oldid=7807209 Am I doing something wrong? I'm just removing accidental newlines created by the placement of the html tags. Thanks. [[User:FaviFake|FaviFake]] ([[User talk:FaviFake|talk]]) 11:34, 11 August 2025 (UTC) :@[[User:FaviFake|FaviFake]]: I did not revert your edits, but only added blank lines to follow the conventions below: :* It is common practice to insert a blank line immediately before section headings. In fact, when editing by section, a blank line is automatically inserted just before the edited section. :* However, there is a special case when the line immediately before a section heading is {{tag|translate|open}}. In that case, insert a blank line immediately before that tag. :[[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 12:33, 11 August 2025 (UTC) ::@[[User:Shirayuki|Shirayuki]] Thanks. That effectively resulted in the 2 accidental newlines being reinstated again. Is there a way they can be removed for good? I think the conventions shouldn't be applied if applying them necessarily creates a blank newline between sections. [[User:FaviFake|FaviFake]] ([[User talk:FaviFake|talk]]) 12:54, 11 August 2025 (UTC) :::@[[User:FaviFake|FaviFake]]: As long as translators can translate the page and the translations display correctly, I don't really care whether there is one blank line or two blank lines between sections.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 13:27, 11 August 2025 (UTC) ::::@[[User:Shirayuki|Shirayuki]] Sure. I fixed them again, but this time my fix complies with the two conventions you mentioned. Thanks [[User:FaviFake|FaviFake]] ([[User talk:FaviFake|talk]]) 13:32, 11 August 2025 (UTC) == Revert == Why did you revert [https://www.mediawiki.org/w/index.php?title=VisualEditor%2FPortal%2FKeyboard_shortcuts&diff=7809924&oldid=7809754 this]?? [[User:Waddie96|Waddie96]] ([[User talk:Waddie96|talk]]) 22:18, 13 August 2025 (UTC) :@[[User:Waddie96|Waddie96]] [[Help:System_message#Avoid_fragmented_or_%22patchwork%22_messages]] [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 22:21, 13 August 2025 (UTC) ::Okay, can we capital S [[User:Waddie96|Waddie96]] ([[User talk:Waddie96|talk]]) 22:24, 13 August 2025 (UTC) ::@[[User:Shirayuki|Shirayuki]]: related question about [[Special:Diff/8274164]]: can you tell me in which human language that won't work? AFAIK that's the only part in the statement that anyone in a locale other than English will change, hence my attempt to make that part translatable. The blanket URL you mention doesn't even begin to give an explanation for your revert, and if this is an rtl/ltr issue then the change needs to be improved, not reverted. Not making things translatable isn't the solution. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 21:29, 9 March 2026 (UTC) :::@[[User:Tactica|Tactica]]: Because word order differs by language, making only "/path/to" translatable is inappropriate. There is no proper way to mark this up right now.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:39, 9 March 2026 (UTC) == Download page needs updating == I can't figure out [[Special:Diff/6949712|this change of yours]]. It needs to be updated, because it's showing the wrong information [[Download#Signature downloads|on the page]] (1.44.0 is ''not'' LTS, but 1.43.3 is). Please consider making this portion of the page easier for others to update. - [[User:Dcljr|dcljr]] ([[User talk:Dcljr|talk]]) 03:44, 21 September 2025 (UTC) :@[[User:Dcljr|Dcljr]]: Ask for help at [[Project:Village Pump]]. Manually updating this every time a new version is released is a waste of time, especially since there are only about four possible patterns that appear in a cyclical manner. Someone should automate this using Lua.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 05:28, 21 September 2025 (UTC) ::OK, but you are the one who made the edit that is causing the incorrect information to be displayed now. It would be great if you took a little time to fix the problem you caused. - [[User:Dcljr|dcljr]] ([[User talk:Dcljr|talk]]) 12:29, 21 September 2025 (UTC) :: Nevermind. [[Special:Diff/7896849|I got it to work]]. - [[User:Dcljr|dcljr]] ([[User talk:Dcljr|talk]]) 14:19, 21 September 2025 (UTC) :::That means you will be the one asked to fix things next time there is a version update :P -- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:59, 21 September 2025 (UTC) ::::Unless I do something about the crap way things are done on that and similar pages. - [[User:Dcljr|dcljr]] ([[User talk:Dcljr|talk]]) 23:58, 21 September 2025 (UTC) == Parts of Help:CirrusSearch missing translation tags == Hello, as you usually mark this page for translation: Some recently added parts of [[Help:CirrusSearch]] cannot be translated in the moment. These are [[Help:CirrusSearch#Articlecountry]] in total and [[Help:CirrusSearch#creationdate and lasteditdate]] in parts (some sentences, all the tables, the title itself due to the “and”, but there could be, instead, added a comma). For sentences, I’ve added the tags myself in the past, but I am unsure about the section title. By the way: Maybe all the other section captions should be made translatable, as well, for non-Latin script additions? I am undecided. —<span style="white-space:nowrap"> [[User:Speravir|Speravir]] ([[User talk:Speravir|talk]]) – 01:42, 8 October 2025 (UTC)</span> :@[[User:Speravir|Speravir]]: Regarding the section headings, I think they should not be made translatable because the current headings are the keywords themselves, not the search target categories. :Also, when section headings contain "and" or commas, requests often arise to make them translatable, so using slashes to separate them might be a more neutral approach.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:16, 8 October 2025 (UTC) :Furthermore, I think [[Help:CirrusSearch#Insource|insource]] should not be capitalized, because it does not work when the first letter is uppercase. The same probably applies to the other keywords as well.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:35, 8 October 2025 (UTC) ::Thank you for your edits. So, there have been even more sentences missing the translation tags. —<span style="white-space:nowrap"> [[User:Speravir|Speravir]] ([[User talk:Speravir|talk]]) – 22:34, 8 October 2025 (UTC)</span> == Discouraged status == FYI I've undone several of your translation encouragement actions. Since the translate UI doesn't allow edit summaries, I'm explaining why here: * [[Manual:CommonElements.css]], [[Manual:checkLanguage.inc]] - the file was removed from MediaWiki years ago, there's no point in translating it now. * [[Extension:GoogleLogin/PreAuthManager]] - this is documentation for a decade-old bit of code that isn't being maintained, there's no point in translating it now. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun</sub>]] 23:02, 23 November 2025 (UTC) :@[[User:Pppery|Pppery]]: I haven't seen the manuals for the removed files marked as "discouraged" at all. Should each of them ideally be marked that way?-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 23:20, 23 November 2025 (UTC) :: I do it when I notice, not via any kind of systematic review, but yes, any manual page for a file (or configuration setting, or anything else) marked as removed before {{tl|MW legacy lts branch number}} (currently {{MW legacy lts branch number}}) should definitely be discouraged, and I wouldn't object to discouraging anything marked as removed in any version either. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun</sub>]] 23:31, 23 November 2025 (UTC) == Vandal report == {{User:LBLaiSiNanHai/VandalReport|AdBriyanOfficial|8101331|vandalOnly=1}} [[User:LBLaiSiNanHai|LBLaiSiNanHai]] ([[User talk:LBLaiSiNanHai|talk]]) 11:15, 24 December 2025 (UTC) :@[[User:LBLaiSiNanHai|LBLaiSiNanHai]]: {{done}} - [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 11:19, 24 December 2025 (UTC) == about translating == excuse me, I wrote a page [[Manual:NotificationService.php]], may you mark it translate? thanks very much [[User:LBLaiSiNanHai|LBLaiSiNanHai]] ([[User talk:LBLaiSiNanHai|talk]]) 11:50, 24 December 2025 (UTC) :also, you are the most active current Translate Admin, i hope you see [[Project:Village_Pump#RfC:_about_my_perm_request|this topic]], you suggestion to me will be important [[User:LBLaiSiNanHai|LBLaiSiNanHai]] ([[User talk:LBLaiSiNanHai|talk]]) 11:52, 24 December 2025 (UTC) :@[[User:LBLaiSiNanHai|LBLaiSiNanHai]]: Thank you for your work on expanding the documentation pages. :However, the page you mentioned currently contains incorrect or problematic markup, so it cannot be marked for translation in its present state. In general, the necessary translation markup should be added by one of the existing Translate administrators. If contributors add it themselves in a non-standard way, it can actually increase the workload for the Translate admins, so I would appreciate it if you could avoid doing so. :Regarding your request for TA rights, I will not comment on that here, but I believe you will understand my position from the above. -- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 12:06, 24 December 2025 (UTC) == Really should delete deprecated file manual page? == Many user using old version of MediaWiki, we should archive them, not delete them, I think. [[User:LBLaiSiNanHai|LBLaiSiNanHai]] ([[User talk:LBLaiSiNanHai|talk]]) 06:18, 30 December 2025 (UTC) :@[[User:LBLaiSiNanHai|LBLaiSiNanHai]]: Thanks for your message. :I understand the concern about people still using older versions of MediaWiki, and in general I also think archiving can be preferable to deleting. However, the pages I deleted all shared the same characteristics: :* They were created mechanically by me in 2020. :* Since creation, nobody has added any further description or documentation. :* There is no realistic prospect that these pages will ever be expanded. :* The features described were removed in versions older than the current legacy LTS (1.39), meaning they are already outside the range of currently supported releases. :Given that these pages only existed as empty placeholders for obsolete functionality, I felt it was cleaner to delete them rather than leave them indefinitely in that state.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 06:36, 30 December 2025 (UTC) :: Agreed these should be deleted. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun</sub>]] 06:55, 30 December 2025 (UTC) == Kindly fuzzy an image caption == Hello, Shirayuki-san, so appreciating you taking up the role of translation admin every day. May I bother you and request to fuzzy a caption on File:Editing maps in TemplateData Editor.png [https://www.mediawiki.org/wiki/Citoid/Enabling_Citoid_on_your_wiki] please? Wish you another brilliant year in 2026, kindly, -- [[User:Omotecho|Omotecho]] ([[User talk:Omotecho|talk]]) 23:19, 17 January 2026 (UTC) == Request for merging pages == Hello, could you please take look at [[Project:Village_Pump#Move_draft_in_my_user_page_to_main_namespace]]? Thanks! [[User:Diskdance|Diskdance]] ([[User talk:Diskdance|talk]]) 08:45, 9 February 2026 (UTC) == About [[Readers/Information_Retrieval/Phase_0]] == Hello,@[[User:Shirayuki|Shirayuki]] You have just canceled the markup we made. Please note that more than 45% of the text is not marked for translation, which I have already done. We need this page to complete the translation. As I do not have the rights in MediaWiki, I hope that an administrator will be able to correct this for me. Thank you very much for your support. Best regards, [[User:Dezedien|Dezedien]] ([[User talk:Dezedien|talk]]) 19:24, 11 February 2026 (UTC) :Hi @[[User:Shirayuki|Shirayuki]], I have added a mark. Could you please check if it is correct and activate it if possible? Thank you very much. [[User:Dezedien|Dezedien]] ([[User talk:Dezedien|talk]]) 00:40, 12 February 2026 (UTC) ::@[[User:Dezedien|Dezedien]]: Read [[Help:System message#Avoid fragmented or "patchwork" messages]].-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 11:53, 12 February 2026 (UTC) :::@[[User:Shirayuki|Shirayuki]], I would like to clarify my intention. :::When a page is written in French, all original English text should be translated completely. Leaving full sentences in English inside a French page creates inconsistency for readers. :::Using the translate tag is not “patchwork.” It is simply the correct way to mark text for translation in MediaWiki. The goal is clarity and full localization. :::This does not affect internationalization. I have translated content into multiple languages for many years without causing any i18n issues. :::My objective is only to ensure that French readers receive fully translated content, not partially English text. :::Thank you for your understanding. [[User:Dezedien|Dezedien]] ([[User talk:Dezedien|talk]]) 00:17, 16 February 2026 (UTC) :::: You should use [[tvar]]s rather than splitting nontranslatable bits into separate units. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun</sub>]] 07:19, 22 February 2026 (UTC) == Hello == I don´t see Wikivy Foundation in [[Hosting services]] although it is a wiki farm powered by MediaWiki. [[User:Darrrrmilk|Darrrrmilk]] ([[User talk:Darrrrmilk|talk]]) 01:48, 15 February 2026 (UTC) :Hi can you please answer to this [[User:Darrrrmilk|Darrrrmilk]] ([[User talk:Darrrrmilk|talk]]) 22:00, 15 February 2026 (UTC) :@[[User:Darrrrmilk|Darrrrmilk]]: I don't know that foundation, so there's nothing I can do about it.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 23:04, 15 February 2026 (UTC) ::Ok thank you for replying @[[User:Shirayuki|Shirayuki]] [[User:Darrrrmilk|Darrrrmilk]] ([[User talk:Darrrrmilk|talk]]) 23:18, 15 February 2026 (UTC) :::The wiki farm is not made yet put it is TBA but I heard the registration page and document is filled out but it is not founded yet [[User:Darrrrmilk|Darrrrmilk]] ([[User talk:Darrrrmilk|talk]]) 00:26, 16 February 2026 (UTC) == I want to add localization to [[Extension:UniversalCalendar]]. Could you tell me how to do it? == I want to add localization to "Extension:UniversalCalendar". Could you tell me how to do it? [[User:HoshinoKennji|HoshinoKennji]] ([[User talk:HoshinoKennji|talk]]) 09:40, 15 February 2026 (UTC) :@[[User:HoshinoKennji|HoshinoKennji]]: Please refrain from preparing the page of an experimental extension for translation.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 10:49, 15 February 2026 (UTC) ::I am writing a plugin introduction and plan to translate it into at least Chinese, Japanese, English and Korean. This is my first time creating an extension page and I have no experience, so I am gaining experience for the second extension that will be released soon. [[Special:Contributions/&#126;2026-10146-04|&#126;2026-10146-04]] ([[User talk:&#126;2026-10146-04|talk]]) 10:59, 15 February 2026 (UTC) ::I see. Please disregard my previous reply; I misunderstood earlier. [[Special:Contributions/&#126;2026-10146-04|&#126;2026-10146-04]] ([[User talk:&#126;2026-10146-04|talk]]) 11:12, 15 February 2026 (UTC) :As the extension is still experimental, the page may change substantially. :Marking it for translation now could impose unnecessary work on translators due to frequent updates. :Therefore, it would be better to wait until the content stabilizes.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 11:16, 15 February 2026 (UTC) == Translations - editing of old pages == --Warning: You are currently editing an outdated version of this page. If you publish it, all later changes will be lost.-- appears only after opening the history and some of the edits. Then after opening the edit, Sometimes I have to perform this operation twice or more. Thanks for the editing and cooperation. :)) [[User:ENeRZet|ENeRZet]] ([[User talk:ENeRZet|talk]]) 10:57, 16 February 2026 (UTC) == Recycling translations for [[Template:Extension]] == Shirayuki, I need to move lines 306-344 into a separate template in order to implement support for multiple licenses, as this code will be called once per every stated license and it would be silly to repeat this in an already intricate template. Shall I remove the {{tag|translate}} tags in the new template or is there any way existing translations can be reused? I would prefer the change to be as painless as possible for everyone. TIA. Oh, and I know [[Template:ExtensionLicense]] exists, but it never solved the underlying problem of pages being categorized as using an "unknown license". That's the problem I intend to solve here. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 16:08, 24 February 2026 (UTC) == Wikivy foundation == So basically I want to report this brand new wiki farm created this month called the WIkivy Foundation and here is the link-https://meta.wikivy.com/ but I know I should not be reporting this on MediaWiki Steward's talk pages so please tell me where to report this. Reason:Copy and pasting policies from Miraheze without proper attributions. While they do mention that some of their policies are inspired by Miraheze it almost looks like a copy and paste for a lot of them. Such as global policies,templates,Meta pages,and Wiki Policies(there are more,these are just some major ones). So basically they replace the "Miraheze" part in policies and replace it with "Wikivy" Here is an example of what I said above: Wikivy-"The '''Content Policy''' exists to help the Wikivy Foundation maintain a safe, welcoming, and productive environment for all contributors. Wiki requesters, reviewers, and administrators are expected to understand and apply this policy when requesting new wikis and when overseeing existing ones. Administrators play a crucial role in ensuring that on-wiki content complies with these guidelines. Repeated violations—especially those left unaddressed by local admins—may result in '''wiki closure''' or [https://frog.frogiesarcade.infinityfreeapp.com/frog/ixl/hvtrs8%2F-mgtc.uiiity%2Ccmm-wkkk%2FQpgckan%3AOyNalgwaee-Sveuapdq Steward] [https://frog.frogiesarcade.infinityfreeapp.com/frog/ixl/hvtrs8%2F-mgtc.uiiity%2Ccmm-wkkk%2FQpgckan%3AOyNalgwaee-cmnqepvctmrqhkp conservatorship]. This policy applies to everyone. All editors, not just leadership, should make an effort to follow these guidelines as well as any additional local content policies a wiki adopts. Together, we can keep Wikivy a collaborative, mission-aligned, and trustworthy platform for free knowledge."-Wikivy Content Policy Miraheze-"The '''Content Policy''' seeks to help Miraheze maintain a safe, welcoming, and productive environment for everyone. We'd like to remind our wiki requesters, reviewers and administrators to be familiar with this policy and apply it when handling new requests or overseeing their wikis. Wiki administrators play a crucial role in ensuring that on-wiki content complies with these guidelines – repeated policy violations without local administrator action may result in wiki closure or [[miraheze:Special:MyLanguage/Stewards|Steward]] [[miraheze:Special:MyLanguage/conservatorship|conservatorship]]. This policy is not just for those in leadership roles. All our editors should make an effort to adhere to this policy and any additional local content policies that might be in place on the specific wikis they contribute to. Together, we can make Miraheze a fantastic place for knowledge-sharing and collaboration!"-Miraheze Content Policy You see this is just copy and paste but replacing "Miraheze" with "Wikivy" Now I'll show an example of copy and pasting policies(Using Privacy Policy as example): Wikivy-"(snip)" Also not to mention that the founder of Wikivy foundation is not a Miraheze Steward nor did they ever get permission to straight-up just copy and paste Miraheze stuff. [[User:Darrrrmilk|Darrrrmilk]] ([[User talk:Darrrrmilk|talk]]) 05:58, 1 March 2026 (UTC) :Wait ur not steward mb [[User:Darrrrmilk|Darrrrmilk]] ([[User talk:Darrrrmilk|talk]]) 05:58, 1 March 2026 (UTC) ::On top of this,they also deleted my wiki saying my copy and pasted without attributions while I did give attributions multiple times throughout the wiki and they refused to block 2 people that where harassing me,one of which was blackmailing another user,spreading false info,stating his opinions as facts,and vandalizing my wiki. But a steward blocked me one day for vandalizing that guys userpage because I got really mad since he was spewing a big hate on me but while I do commit to have vandalized what the other 2 users have done is very worse yet they got away due to this corruption. [[User:Darrrrmilk|Darrrrmilk]] ([[User talk:Darrrrmilk|talk]]) 06:10, 1 March 2026 (UTC) :@[[User:Darrrrmilk|Darrrrmilk]]: This matter does not concern MediaWiki.org, nor am I affiliated with Miraheze. :Please refrain from posting further comments about disputes unrelated to this site on my talk page. :If this continues, I may take administrative action.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 06:22, 1 March 2026 (UTC) == Should punctuation be part of translations or not? == Dear @[[User:Shirayuki|Shirayuki]]: At the risk of becoming a PITA (and believe me, I'm doing my best to avoid just that) I must ask because I'm completely baffled now. The section "Symbols, colons, brackets, etc. are parts of messages" under [[Help:System message]] advocates this, and yet you keep undoing about every effort towards that end, for example in T:37 as part of [[Special:Diff/8277169]], which looks the more surprising coming from a Japanese person. As I understand it this isn't ''patchwork'' because I was making the whole string translatable, and besides there's absolutely no reason to prevent "Category:Cars" from being translatable too. ISTR reading Arabian text must not be italicised for example or something along those lines, so the more reason to make e.g. ''style'' translatable...? I'll be very interested in your reasoning for this one. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 23:50, 11 March 2026 (UTC) :@[[User:Tactica|Tactica]]: I could understand making Category:Cars a separate translation unit. However, I don't see a strong reason to include the bold markup in the same translatable message. :The actual text here is just "No translation", and the bold markup is only formatting. :Including the colon in the existing T:37 unit might make sense, since some languages insert a space before a colon. But extending the same translation unit further to include formatting or the category name doesn't seem necessary to me.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 11:08, 12 March 2026 (UTC) == [[Help:Content translation/Translating/Translation quality]] == Almost two months ago, you protected the above page at the administrator level. I suggest lowering the protection to autoconfirmed since all accounts that have vandalized the page weren't autoconfirmed at the time of vandalism occurrence, also the fact that certain WMF accounts might not be able to update the page due to not having thre required permission as well. [[User:ToadetteEdit|ToadetteEdit]] ([[User talk:ToadetteEdit|talk]]) 15:31, 18 March 2026 (UTC) :@[[User:ToadetteEdit|ToadetteEdit]]: Thank you for your suggestion. You are correct, so I have lowered the protection level. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:18, 18 March 2026 (UTC) == Preserving leading spaces == Hi Shirayuki, The reason why in {{tl|Wrapper}} I [[Special:Diff/8317414/8318193|changed]] the condition <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{any-left|}}}|no|...|...}}</syntaxhighlight> into <syntaxhighlight lang="wikitext" inline>{{P{{#ifeq:{{{any-left|}}}|no|1|2}}|...|...}}</syntaxhighlight> is that the text shown was “...will work here.However, the following are...”. The rationale is the fact that if I write <syntaxhighlight lang="wikitext" inline>a{{#ifeq:XXX|YYY| B | C }}d</syntaxhighlight> I get “a{{#ifeq:XXX|YYY| B | C }}d”, whereas if I write <syntaxhighlight lang="wikitext" inline>a{{P{{#ifeq:XXX|YYY|1|2}}| B | C }}d</syntaxhighlight> I get “a{{P{{#ifeq:XXX|YYY|1|2}}| B | C }}d”. However, despite my edit, here the leading space is still suppressed. Is there any way around this? --[[User:Grufo|Grufo]] ([[User talk:Grufo|talk]]) 13:39, 2 April 2026 (UTC) == Reverted edit == Hi there, Shirayuki. Thanks for your tireless work here on mediawiki.org, including cleaning up some of the stuff I do, sometimes oblivious to the implications to the translated tags. However, I can't understand why you performed [[Special:Diff/8364313|this revert]]. Can you explain what was the issue with my changes? --[[User:Waldyrious|Waldyrious]] ([[User talk:Waldyrious|talk]]) 13:27, 3 May 2026 (UTC) bkymj4zikv5nymzysm6lbznf8xmk48l 8364405 8364374 2026-05-03T14:55:52Z Shirayuki 472859 /* Reverted edit */ Reply 8364405 wikitext text/x-wiki {{archives|list= * [[/Archive 1]] (pre-Flow) * [[/Flow|Original Flow board]] * [[/2013|2013]] * [[/2014|2014]] * [[/2015|2015]] * [[/2016|2016]] * [[/2017|2017]] * [[/2018|2018]] * [[/2019|2019]] * [[/2020|2020]] * [[/2021|2021]] * [[/2022|2022]] * [[/2023|2023]] * [[/2024|2024]] }} == where are the id of the UI messages ? == Hi, in -> https://www.mediawiki.org/w/index.php?title=Help:Advanced_editing&diff=prev&oldid=6940302 it is right, but how (from where) I do identify the ID of the user interface to be used ? Thanks. --[[User:Wladek92|Christian 🇫🇷 FR]] ([[User talk:Wladek92|talk]]) 10:16, 24 December 2024 (UTC) :See {{ll|Help:System_message#Finding_messages_and_documentation}}. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 10:35, 24 December 2024 (UTC) == Wikimedia_Apps/Team/iOS/Personalized_Wikipedia_Year_in_Review/How_your_data_is_used == Thank you for taking care of the translators and pages. Would you care to indicate why [https://www.mediawiki.org/w/index.php?title=Wikimedia_Apps/Team/iOS/Personalized_Wikipedia_Year_in_Review/How_your_data_is_used&oldid=prev&diff=6948124&markasread=2058413&markasreadwiki=mediawikiwiki a particular sentence was unmarked] for translation please? I understand that T:75 and T:76 ignore one sentence between them. [[User:Omotecho|Omotecho]] ([[User talk:Omotecho|talk]]) 03:51, 31 December 2024 (UTC) :You inserted unwanted {{tag|nowiki}} tags. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 05:03, 31 December 2024 (UTC) ::My bad! Case solved, I will be more careful switching between Source and Visual Editors. Not comprehended why nowiki tags are involved though… /: Thank you for your golden wisdom as always. [[User:Omotecho|Omotecho]] ([[User talk:Omotecho|talk]]) 05:56, 31 December 2024 (UTC) == Help:Notifications -can I edit it? == Hi {{PAGENAME}}, I have made some minor changes to [[Help:Notifications]]. However, it is not clear to me if the community here is invited to edit Help documentation. I hope the changes I made meet with your approval? Cheers, [[User:Ottawahitech|Ottawahitech]] ([[User talk:Ottawahitech|talk]]) 20:42, 23 January 2025 (UTC) :Hi again, I have made a few more minor changes to [[Help:Notifications/Thanks]]. I assume that you have no objection? [[User:Ottawahitech|Ottawahitech]] ([[User talk:Ottawahitech|talk]]) 20:58, 4 February 2025 (UTC) == Why do you leave whole chunks of the page out of translation markup? == Hey, I can't see any reasons to leave text out of translation tags, like you did on [[Wikimedia Language and Product Localization/Newsletter/2025/January]]. I understand that you did a lot of work on that page, because it had to be properly tagged. But whole lists and paragraphs ended up outside translate tags. Is it that you just didn't notice that? [[User:Ата|<span style="color:SteelBlue;">Ата</span>]] <sup>[[User talk:Ата|<span style="color:#80A0FF;">(talk)</span>]]</sup> 09:18, 5 February 2025 (UTC) :I didn't have enough time, so I only marked for translation the parts where the tagging was correct. For the other sections, I tried to indicate how they should be fixed to some extent. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 10:57, 5 February 2025 (UTC) ::Is there anywhere a template to mark pages if parts are not tagged or would that not be usefull? [[User:True|True]] ([[User talk:True|talk]]) 12:25, 18 February 2025 (UTC) == [[Special:Contribs/Allan_Candido_Guedes_-_ACG]] == Good day, please nuke the contribution as machine translation, per [[m:User talk:Allan Candido Guedes - ACG]] [[User:Minorax|Minorax]] ([[User talk:Minorax|talk]]) 04:06, 8 February 2025 (UTC) :{{done}} [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 04:38, 8 February 2025 (UTC) == Question == Hi Shirayuki, can you please create the [[Manual:$wgLinterWriteNamespaceColumnStage]] page? [[User:USB4215|USB4215]] ([[User talk:USB4215|talk]]) 14:04, 17 February 2025 (UTC) :I haven't checked for configuration variables additions/removals for weeks, so I'll do it in the coming days and reflect the changes on the pages. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 22:57, 17 February 2025 (UTC) :@[[User:USB4215|USB4215]]: I've checked the history of the MediaWiki core repository, but I couldn't find such a configuration variable.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 09:39, 8 March 2025 (UTC) :@[[User:USB4215|USB4215]]: That variable is defined by [[Extension:Linter]]. Configuration variables defined by extensions are not subject to the creation of separate manual pages.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 09:08, 9 March 2025 (UTC) == Revert == You reverted my edit [https://www.mediawiki.org/w/index.php?title=Wikimedia_Language_and_Product_Localization%2FCommunity_meetings&diff=7055576&oldid=7055379]. There are two sentences outside of the translation which should be inside, how can i do that? --[[User:Ailura|Ailura]] ([[User talk:Ailura|talk]]) 14:13, 25 February 2025 (UTC) :Use {{tag|tvar}} tags to make text untranslatable. -- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:02, 25 February 2025 (UTC) ::I wanted to make the text translatable, thank you. [[User:Ailura|Ailura]] ([[User talk:Ailura|talk]]) 06:49, 26 February 2025 (UTC) == Translation tricks == Hi Shirayuki, can you please help me to translate the name of the page "Special:ViewXML" in the sentence below <pre> Data Transfer defines a special page, "Special:ViewXML" </pre> thank you --[[User:JLTRY|JLTRY]] ([[User talk:JLTRY|talk]]) 09:57, 27 February 2025 (UTC) :To simplify translation units, use {{tag|code}} tags instead of quotes and enclose special page names with {{tag|tvar}} tags.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:56, 27 February 2025 (UTC) Hi Shirayuki, can you help I have an issue in this page when viewing it [[Extension:ContactPage/fr]] <pre> Personnalisation supplémentaire <span id="Adding_a_link_to_special_page_"Contact"_to_the_footer"> </pre> --[[User:JLTRY|JLTRY]] ([[User talk:JLTRY|talk]]) 08:43, 28 February 2025 (UTC) :If a heading contains links or code, you need to [[Special:Diff/7063359|add the nowrap attribute to the surrounding translate tag]]. For details, read the manual.--[[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 12:09, 28 February 2025 (UTC) Hi Shirayuki I do not really know how I should write the translate part for this paragraph My both last trials were reverted for [[Extension:Data_Transfer]]:<br> KO <pre><nowiki> <translate>You can also import content into page "slots" other than the main one, using MediaWiki's &lt;tvar name=1>{{ll|Multi-Content Revisions}}</tvar> feature, by adding the "Slot" column, like so:</translate> </nowiki></pre> KO <pre><nowiki> <translate>You can also import content into page "slots" other than the main one, using MediaWiki's {{ll|Multi-Content Revisions}} feature, by adding the <code>Slot</code> column, like so:</translate> </nowiki></pre> --[[User:JLTRY|JLTRY]] ([[User talk:JLTRY|talk]]) 12:42, 5 March 2025 (UTC) :Enclose each part that translators should not translate or modify with a separate {{tag|tvar}} tag. Your markup does not seem to meet that requirement, based on my reading of the page content.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:07, 5 March 2025 (UTC) ::I corrected [[ Extension:Data_Transfer]] [[User:JLTRY|JLTRY]] ([[User talk:JLTRY|talk]]) 07:16, 6 March 2025 (UTC) == Pagelinks.sql.gz file == Hi @[[User:Shirayuki|Shirayuki]] I am trying to work with the Pagelinks file in order to extract the number of articles that link to a specific Wiki page (same idea as can be seen in the [[:en:Help:What_links_here|"What-links-here]]" tool. However, when I loop over this sql like file, I find very weird cases of links that doesn't seem to exist in Wikipedia. For example, the first line in the file indicate that there is a link between page ids 1939 and 2. PageID 2 doesn't even seems to exist. Even when I look on pageIDs that do exist, the link indicated in the file does not exist in the actual wiki page. Am I missing anything? thanks a lot! [[User:Avrahami-isr|Avrahami-isr]] ([[User talk:Avrahami-isr|talk]]) 18:10, 28 February 2025 (UTC) :Please ask at [[Project:Support desk]]. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 22:10, 28 February 2025 (UTC) ::Sure, thanks! [[User:Avrahami-isr|Avrahami-isr]] ([[User talk:Avrahami-isr|talk]]) 02:07, 1 March 2025 (UTC) == how to call the template {{tlx|categoryPages}} without breaking the list ? == hello i need your help if you agree. My first steps in template coding let me create a simple template {{tlx|categoryPages}} today. Tests seem ok on the flow but when I call the template from a list # in [[Manual:Adding_support_for_new_filetypes#What_do_I_need_to_do?]] it lost the numbering. Where to look for ? blabla..... {{categoryPages|cat=Media handling extensions}}. ..is correct on the flow ..blabla # this is first list item on the same line but it breaks {{categoryPages|cat=Media handling extensions}}. # second item # third item Thankx -- [[User:Wladek92|Christian 🇫🇷 FR 🚨]] ([[User talk:Wladek92|talk]]) 21:00, 15 March 2025 (UTC) :@[[User:Wladek92|Wladek92]]: Writing {{tlx|CategoryPages}} will transclude [[Template:CategoryPages/en]]. Templates with translation-aware transclusion enabled behave in the same way.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 23:26, 15 March 2025 (UTC) ::Yes my problem is not if it is transcluded or not but as you see in the source, transclusion is requested to be made on the same line without breaking the list. ::<blockquote>blabla..... <nowiki>{{categoryPages|cat=Media handling extensions}}</nowiki>. ..is correct on the flow ..blabla # this is first list item on the same line but it breaks <nowiki>{{categoryPages|cat=Media handling extensions}}</nowiki>. # second item # third item</blockquote> ::[[User:Wladek92|Christian 🇫🇷 FR 🚨]] ([[User talk:Wladek92|talk]]) 10:43, 16 March 2025 (UTC) :::@[[User:Wladek92|Wladek92]]: Compare the source of {{tlx|CategoryPages}} and {{tlx|CategoryPages/en}}. Although you are transcluding the former, in reality, the latter is transcluded, which causes confusion.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 11:39, 16 March 2025 (UTC) ::::Thanks seems having satisfying functionality , pb of the includes tags [[User:Wladek92|Christian 🇫🇷 FR 🚨]] ([[User talk:Wladek92|talk]]) 21:21, 16 March 2025 (UTC) == Pages that should not be translated == Sorry, that's already a few pages you've written about that I shouldn't translate. I have a few questions. Why are these pages marked as being intended for translation? So why are they displayed in "Translante content"? Shouldn't these pages have a block for displaying that they are/are not available for translation? How is it possible that some of these pages are already translated? Thank you [[User:Rebulka|Rebulka]] ([[User talk:Rebulka|talk]]) 16:26, 29 March 2025 (UTC) :@[[User:Rebulka|Rebulka]] See the source of [[MediaWiki Language Extension Bundle/installation]]-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 22:26, 29 March 2025 (UTC) ::Thank you for the answer. Unfortunately, I did not find the answer to my question on the recommended pages. I do not require an answer. It is only a suggestion for possible improvement. "The page should not be translated - it is not published anywhere in the translation offer". Sunny day [[User:Rebulka|Rebulka]] ([[User talk:Rebulka|talk]]) 07:00, 30 March 2025 (UTC) :::@[[User:Rebulka|Rebulka]] The above source says "This file text is included in MLEB tarball. Please do not wikify if that would make it not work as plain text file", so the page should not be prepared for translation.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 07:41, 30 March 2025 (UTC) :@[[User:Rebulka|Rebulka]] We handle a lot of pages, so it would be helpful if you could provide a link to the specific page you're referring to. (I have a general idea, but it would help to clarify.)-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 07:55, 30 March 2025 (UTC) ::Thank you for your reply. I will keep you posted on these pages. It is amazing that they are being released for translation and have even been partially translated. Slunicky's Day [[User:Rebulka|Rebulka]] ([[User talk:Rebulka|talk]]) 08:59, 30 March 2025 (UTC) == Reversion == Hi, why did you revert my edits to [[Project:Requests for permissions/Header]]? – [[User:Svartava|<b style="color:#4682B4; font-size:105%;">Svārtava</b>]] ([[User talk:Svartava|t]][[Special:Contributions/Svartava|ɕ]]) 05:40, 7 April 2025 (UTC) :@[[User:Svartava|Svartava]]: The reason for reverting the change is to better preserve the original intent. The phrase "Promotion to" in the original text emphasizes the process of advancing to specific roles, which was important for clarity. The revised version lost this nuance and became overly simplified. Retaining the original phrasing ensures the meaning is conveyed more accurately.~~ [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 11:39, 9 April 2025 (UTC) ::OK, but there are some minor issues which I was trying to solve with my edit. For example, there should be mention of other user groups like importer and bot which are granted through that requests page only. Then, the page reads as "Use this page for requests for: autopatrollers, uploaders [...]" but "requests for autopatrollers" does not mean "requests for autopatroller rights" or "requests for autopatrollership"; ordinarily it implies "requests that are to be fulfilled by autopatrollers". – [[User:Svartava|<b style="color:#4682B4; font-size:105%;">Svārtava</b>]] ([[User talk:Svartava|t]][[Special:Contributions/Svartava|ɕ]]) 09:53, 11 April 2025 (UTC) :::I understand the intention behind your edits, and I appreciate your effort to improve the clarity. That said, I believe the original phrasing carries specific intent, particularly in how it distinguishes types of requests and roles. Rewording it for grammar or simplification at the cost of that nuance is not ideal. :::Even if the current version isn't perfect, it has been working well enough — it's already translated and widely understood. Preserving the original meaning is more important than smoothing it out in a way that alters the intent. :::I'm happy to help refine the text if needed, but ultimately, this feels like something that should be discussed at [[Project:Village Pump]].-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 00:29, 12 April 2025 (UTC) == Segmenting translation units? == For [https://www.mediawiki.org/w/index.php?title=Trust_and_Safety_Product/Temporary_Accounts/Updates&diff=next&oldid=7487027 segmenting translation units], I trust your judgement, however, it actually causes pain to those translators who had already worked on them: sorry, I do not have to repeat what you were not happy with, or I appreciate shorter units, too usually. Is there something I could do to improve the situation, like go to the Portal and raise a flag, maybe to ask tech ppl consider something? I have encountered somebody who was segmenting longer ones and matching the existing translation to new short bits at the same time, but not recall who it was to ask for attention... Unfortunately, the T:91 as above link is an old part of the page, that I do not doubt I am not the only one who had already translated it many days back. Well, we both understand segmenting translation units does not require human hands actually, since the issue is to align the longer units into new T: numbers, but not the contents themselves... Of course, shorter units saves everybody's energy in the long run, since the system has better chances to reuse shorter ones later compared to longer ones, which means translators will see samples on the right pane to work less pain (;. Kindly, [[User:Omotecho|Omotecho]] ([[User talk:Omotecho|talk]]) 21:07, 22 April 2025 (UTC) :@[[User:Omotecho|Omotecho]]: I do not split all translation units; I only split them when it is necessary to add or change translation variables due to changes in the source text (which may be changes made by others or by myself), and afterwards, sometimes I also update the translations. :It is not just a matter of splitting; since the source text may have been modified beforehand or the corresponding translations may have become outdated, I believe it is difficult to handle the splitting of translations systemically. :I think we should also request cooperation from those who are adding variables to large translation units on various pages, asking them to refrain from making changes. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 10:55, 23 April 2025 (UTC) ::You are so kind indeed showing the larger picture to me, and there are more points to watch for, I was blind folded. Yes, we need to accommodate changes made in the translation originals. And truly, if the translation original be segmented _after_ many translators on languages have already worked on that part, that is annoying from a translator's scope, not appreciated nor encourage working on that part: It leaves bitter taste with me, that readers will wonder why the headnote tells them their local language page is not updated or which part is not suited to the reality. ::I will note and be careful for those parts updated, and wish I will coordinate my translation as you do. Thank you taking time replying me. veru much. I'd call it case solved for my question here. Kindly, [[User:Omotecho|Omotecho]] ([[User talk:Omotecho|talk]]) 15:19, 23 April 2025 (UTC) ::As a translator, here are my cons for long units: ::<ul><li>It is a burden to translate big units, as you seem not to progress. <li>You dont see easily what has changed. <li>They are difficult to reread and correct since a single ID is assigned to the long unit (several sentences sometimes) and you must search within the text. <li>The long units are those which most remain untranslated. <li>Translation suggestions not often appear with long units. <li>diff on messages cannot be closed to retrieve space on the screen.<li>units with 4,5,6... sentences are repulsive</ul> ::My pros for short units: ::<ul><li>It is pleasant translate short units and progression is fast. <li>You see immediately what has changed. <li>rereading is fast. <li>correction is fast since each small unit has its ID <li>The short units are those which are most translated. <li>Translation suggestions often appears immedialty for short units. <li>diff is reduced and leaves space on the screen.<li>units with 2 to 3 sentences are acceptable<li>splitting long translated units into smaller ones is easy since you move already translated lines in sequence to following units<li>I am favorable to @[[User:Shirayuki|Shirayuki]] principle even if detail is pushed to each sentence.</ul> [[User:Wladek92|Christian 🇫🇷 FR 🚨]] ([[User talk:Wladek92|talk]]) 07:17, 2 May 2025 (UTC) == Changing <code>doc.wikimedia.org</code> external links to <code>wmdoc:</code> wikilinks == Hi Shirayuki :) Could I ask why you're changing external links to <code>doc.wikimedia.org</code> to <code>wmdoc:</code> wikilinks? In many cases, IMO, the external link styling looks/fits better in the context of the page (e.g., [https://www.mediawiki.org/w/index.php?title=Manual:Notifications&diff=prev&oldid=7593187]); and - in any event - I'm not sure that all external links to doc.wikimedia.org need to be replaced with wikilinks in this way. Is there a reason to prefer formatting them as wikilinks that I'm not aware of? Apologies if I've missed anything here. Best wishes, <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 21:25, 27 April 2025 (UTC) :From a behind the scenes point of view, Its better for how they are tracked in the various DB tables such as the externallinks table. [[User:P858snake|P858snake]] ([[User talk:P858snake|talk]]) 11:12, 28 April 2025 (UTC) ::@[[User:P858snake|P858snake]] Fair enough - I suppose my next question would be, is that something that we need to be/should be considering when editing pages on MW.org? (/genuine question)&nbsp;&nbsp;&nbsp;If it is, then I guess the changes make sense <small>(though IMO it'd be nicer if they had an edit summary with a brief reason behind the change)</small>. I guess I'm used to enwiki's [[w:en:Wikipedia:Don't worry about performance]] from when I was editing over there, but I don't know whether MW.org generally shares that perspective :) Best, <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 11:43, 28 April 2025 (UTC) == cancelling formatnum: for japanese == Hi, you have cancelled -> https://www.mediawiki.org/w/index.php?title=Help%3AExtension%3AKartographer&oldid=prev&diff=7601386 but I dont understand japanese. The idea, if you take time to analyse my proposal was : 1. do not impact translators if the number is modified 2. respect the number format according to user language I dont see what is wrong. If you suspect formatnum: is making a bad translation you should request the correction for japanese to be aligned correctly with other formats rather than making an undo and hiding the problem being aware of it. If the problem is known, a reference should be appreciated for checking. Can you clarify please ? Thanks. -- [[User:Wladek92|Christian 🇫🇷 FR 🚨]] ([[User talk:Wladek92|talk]]) 06:49, 2 May 2025 (UTC) :<code>formatnum</code> is fine — Japanese also uses "3.6" for decimals. But this case is special because it’s followed by "million". :In Japanese, "3.6 million" is translated as "360万", not "3.6百万", which sounds unnatural and confusing. :If the number is turned into a variable, the translation interface shows $1 million instead of 3.6 million, and we can no longer rewrite the number. :So I reverted the change to keep the number as a literal, allowing translators to produce natural output like "360万". Thanks.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 10:56, 2 May 2025 (UTC) == $wgRestrictionTypes == [[Special:Diff/7617076|Adding comma-separator + word-separator]] and then getting all three actions inside a tvar doesn't fix my problem... My language only allows me to translate the word "itself" if it comes '''before''' <code>protect</code>, not after. [[User:Eduardogobi|Eduardogobi]] ([[User talk:Eduardogobi|talk]]) 05:57, 9 May 2025 (UTC) :@[[User:Eduardogobi|Eduardogobi]]: I made adjustments based on feedback from someone who understands Brazilian Portuguese. I hope this helps — how does it look now?-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 10:54, 9 May 2025 (UTC) ::Yep, commit your last edit to Fuzzy, it will solve our issue. Thanks! [[User:Eduardogobi|Eduardogobi]] ([[User talk:Eduardogobi|talk]]) 05:34, 10 May 2025 (UTC) == Work on Download page == Hi @[[User:Shirayuki|Shirayuki]], you just [https://www.mediawiki.org/w/index.php?title=Download&diff=prev&oldid=7619928 reverted this edit] I made on [[Download]]. As I wrote in my edit summary, I believe the content is largely duplicated in the "All versions" box. You mentioned the old branch support. I don't see why this is so relevant, as this page seem to be about downloading for new installations, not [[Manual:Upgrading]]. I have a strong motivation to make the documentation generally much more concise, but I am always grateful when people push back, because I am relatively new here! [[User:Douginamug|Douginamug]] ([[User talk:Douginamug|talk]]) 22:12, 9 May 2025 (UTC) :@[[User:Douginamug|Douginamug]]: Instead of listing the releases, I think it would be better to direct users to [[Manual:Upgrading]], but that page does not mention the "heavily modified installations" you removed. :The translation unit you removed has been [https://www.mediawiki.org/w/index.php?title=Special:Translations&message=Translations%3ADownload%2F17%2Fja translated into many languages], so I’m generally opposed to its removal.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 22:27, 9 May 2025 (UTC) :@[[User:Douginamug|Douginamug]]: Your changes to [[Download]] is quite bold and has a significant impact on the many existing translations. How about drafting it in a subpage of your user page first, and then proposing it at [[Project:Village Pump]]? [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 23:25, 9 May 2025 (UTC) :: (talk page stalker) Personally I agree with Douginamug that the content removed was redundant on the merits, but also with Shirayuki that it would be wise to draft and discuss changes rather than implementing them boldly. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun</sub>]] 05:27, 10 May 2025 (UTC) ::@[[User:Shirayuki|Shirayuki]] I have reverted all my recent edits, restoring the last version you marked for translation. I will do as you suggest, and make a personal subpage first before proposing it at the Village pump. ::I was intentionally being bold, you are right! I fear that being less bold will mean I ultimately do less editing, and as far as I'm concerned, there is really a lot that should be edited (eventually). Despite being bold, I meant no respect to all the translation work that has and is being done. [[User:Douginamug|Douginamug]] ([[User talk:Douginamug|talk]]) 05:32, 10 May 2025 (UTC) ::: This specific page is super high-profile (linked from the main page and the sidebar), so uses special rules. For lower-profile pages (basically anything else), boldness is fine and encouraged. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun</sub>]] 05:38, 10 May 2025 (UTC) :::Practical questions before I beging: Is it preferred to always wrap translated blocks in the <code><nowiki>{{void}}</nowiki></code> template instead of deleting them? If yes, can I move voided blocks to the end of the page, to avoid cluttering the source? (It seems only possible to edit translated content properly with the source editor) [[User:Douginamug|Douginamug]] ([[User talk:Douginamug|talk]]) 05:42, 10 May 2025 (UTC) :::: The purpose of the void blocks is for translated content that cycles in and out of existence as new versions are released (for example, sometimes there's a legacy non-LTS version and a legacy LTS version, sometimes there's two legacy LTS versions, etc.), so it always appears in the translate UI and the translations can be reused with each cycle. [https://www.mediawiki.org/w/index.php?title=Download&diff=prev&oldid=6949712 Example void cycling edit]. Content that's going to disappear and stay gone forever can just be deleted. :::: (It seems only possible to edit translated content properly with the source editor) -> indeed, VE and translate don't play nice with each other, which is a known issue and not easy to fix because they work in fundamentally incompatible ways. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun</sub>]] 05:50, 10 May 2025 (UTC) :::::Since this "void cycling edit" is quite tedious every time, I’m hoping someone could write a Lua module to automate the toggling of visibility? It would be a huge help! :) -- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 06:06, 10 May 2025 (UTC) :::: And, as a technical matter, it doesn't matter where the void blocks are, but personally I would prefer they stay near where they will get unvoided to, to make the voiding an d unvoiding easier. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun</sub>]] 05:53, 10 May 2025 (UTC) :::::Great! Thanks both of you for the information, that's enough for me to work from for now :) [[User:Douginamug|Douginamug]] ([[User talk:Douginamug|talk]]) 05:54, 10 May 2025 (UTC) == Your reverting == Your edit summary “Revert as most of their edits have been reverted and are not trustworthy” is nonsense as most reverted does not make sense as ip address may be shared by multiple users. [[Special:Contributions/185.137.137.154|185.137.137.154]] 07:53, 24 May 2025 (UTC) == Spurious span in translated versions of [[Help:Lint errors/multiple-unclosed-formatting-tags]] == Hi, Shirayuki. As you know, in translations of this page where segment 10 (a section title containing two variables) is translated, a spurious span is generated above the section. Even though you tried to fix the issue (among other users, in different ways, such as @Tooki, @Pppery or myself), as of now, the issue is still there, as the following code is generated where it shouldn't: <code><nowiki><span id="Scenario_2:_Incorrect_use_of_&lt;tag">_instead_of_&lt;/tag&gt;"&gt;</span></nowiki></code> [[User:Sabbut|Sabbut]] ([[User talk:Sabbut|talk]]) 09:41, 8 June 2025 (UTC) == Extension:MobileFrontend == Hello Shirayuki, your latest update to mark this document for translation leaves the "It is preferable to use..." paragraph untranslated again. Why? It's pointless to translate when some strings are still left in English and there's nothing we can do. While I'm at it I should mention that translation markup of lists in that page is all wrong according to the manual, with translation tags wrapping also bullets for single items. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 14:06, 22 June 2025 (UTC) :@[[User:Tactica|Tactica]]: There's no need to make the {{tag|code}} tag translatable, so it should be excluded using the {{tag|tvar}} tag instead. :In [[Special:Diff/7701851]], you wrapped <code><nowiki>* {{ll|Skin:MonoBook}}</nowiki></code> in {{tag|translate}}, which is also incorrect. :If the tagging is not correct, I can't just mark the page for translation as-is. :As for the existing tagging of list items, there are already many translations that would be affected by any change. Therefore, it's preferable not to modify them just to follow the manual.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 22:04, 22 June 2025 (UTC) == Your revert in Help:Categories doesn't make sense == [https://www.mediawiki.org/w/index.php?title=Help%3ACategories&oldid=prev&diff=7703597 This revert] of yours doesn't make any sense. As it is, the page is <strong>again</strong> broken because [[MediaWiki:pagecategories]] was <strong>deleted</strong> on this site. With my change, the intent of the document remains intact as translators can still translate "Categories" as intended. Really, with this kind of behaviour sometimes it gets frustrating to try and contribute anything to this site. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 22:52, 23 June 2025 (UTC) :Even if [[MediaWiki:pagecategories]] doesn't exist on this site, it's still a standard MediaWiki message, and [https://translatewiki.net/w/i.php?title=Special:Translations&message=MediaWiki%3APagecategories its source text and translations do exist]. You seem to have no understanding of that fact. :The translation unit T:18 you tried to change [https://www.mediawiki.org/w/index.php?title=Special%3ATranslations&message=Translations%3AHelp%3ACategories%2F18%2Fja has a large number of translations], and I don’t think your edit is important enough to justify invalidating all of them and forcing them to be retranslated. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 22:59, 23 June 2025 (UTC) ::In other words, saving you some work is more important than usable documentation. ::I'll remember that. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 23:04, 23 June 2025 (UTC) == Edit summaries == Hi Shirayuki :) If possible, please could I ask that you provide more information in edit summaries when making changes to previously-prepared translation markup (e.g., removing translation tags from certain text)? E.g., in [[Special:Diff/7732048]], you removed the translation tags from the custom step within the 'installation' section; but, as the edit summary for that edit was just {{tq|simplify translation units}}, I'm not sure why that removal was made. From my perspective, that sentence should be fine to be translated (& I imagine that it might potentially be confusing to people reading the translated versions of the page if it isn't). So I guess I'm left not really seeing a clear reason why the tags have been removed (and therefore wanting to re-add them to the page); but at the same time not wanting to edit-war by reverting your removal of them. As another example within that edit, I'm not sure why the multiple translation variables within the description for <code>$wgEmailAuthUnmaskedDomains</code> were condensed down into one. From my perspective, when preparing that description for translation, I deliberately put each domain name into its own tvar; so that (e.g.) languages that would organise the list in a different way (and/or that would use a different separator between the domain names than a comma) could do so with more flexibility than with one 'mega-<code>tvar</code>' that contained all the domains together. But without knowing the reason behind your change, and because I don't want to edit war, I'm again reluctant to blindly revert. Let me know if I've worded anything poorly, and/or if you have any queries about anything I've said. I apologise if there's anything here that I'm not taking into account. Best wishes, <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 06:09, 10 July 2025 (UTC) :@[[User:A smart kitten|A smart kitten]]: Thank you for your message, and I’m sorry for not providing enough detail in the edit summary — it's indeed too short to fully explain everything. :As you know, parts that should not be changed by translators need to be excluded from translation using {{tag|tvar}}. I reverted parts where this wasn't sufficiently enforced, to avoid unintended edits in translated versions. :Also, regarding the variable names like $domain1, I’ve seen several cases where translators mistakenly translate such names when they’re written in plain English words. To avoid this, I replaced them with numeric placeholders like $1, which are generally safer and less likely to be changed. :I'm certainly aware that some languages use something other than commas for list separators. :Using messages like <code><nowiki>{{int|comma-separator}}</nowiki></code> allows commas to be automatically replaced with the appropriate symbol for the page language, so I’d like to apply that where possible when there's time. :However, doing this can make the source harder to read, so in some cases it might be better to exclude the list from translation and present it as bullet points instead. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 11:56, 10 July 2025 (UTC) ::Thanks for the quick reply (and apologies for taking a few days to get back to you) <code>:)</code> ::{{pb}} ::{{tq|As you know, parts that should not be changed by translators need to be excluded from translation using ‎<code><tvar>...‎</tvar></code>.}} Indeed <code>:)</code> ::{{tq|I reverted parts where this wasn't sufficiently enforced, to avoid unintended edits in translated versions.}} For the sentence in question, I [{{fullurl:special:diff/7729841}} marked it up] as: ::{{#tag:syntaxhighlight|Add a {{((}}ll{{!}}{{^(}}tvar name=1>Manual:Hooks#Writing_a_hook_handler</tvar>{{!}}hook handler{{))}} for the {{^(}}tvar name=2>{{((}}ll{{!}}Extension:EmailAuth/EmailAuthRequireToken{{!}}EmailAuthRequireToken{{))}}</tvar> hook.|lang=wikitext}} ::Please could you let me know how this could be improved? As far as I can see, everything not in a tvar (except for the first <syntaxhighlight lang=wikitext inline>{{ll}}</syntaxhighlight> template name) is a part of the sentence that should be translated. (Am I missing something?) ::{{pb}} ::{{tq|Also, regarding the variable names like $domain1, I’ve seen several cases where translators mistakenly translate such names when they’re written in plain English words. To avoid this, I replaced them with numeric placeholders like $1, which are generally safer and less likely to be changed.}} Hmmm... yeah, that makes sense. I gave the variables names like <code>$domain1</code> in case knowing their type of text would make life easier for translators. I guess there are probably benefits and drawbacks to either approach - I see where you're coming from with the issue you've pointed out. ::{{pb}} ::{{tq|Using messages like <code><nowiki>{{int|comma-separator}}</nowiki></code> allows commas to be automatically replaced with the appropriate symbol for the page language, so I’d like to apply that where possible when there's time. However, doing this can make the source harder to read [...]}} Yeah. I get the reasoning for using <code><nowiki>{{int|comma-separator}}</nowiki></code>; but at the same time it does make the page a bit more unwieldy to edit, and potentially also allows for less flexibility when translating (although - as I'm not a translator - I'd defer to others on that front). ::One thing I forgot to say in my original message is that I also split the domain names into multiple tvars so that I could include the word "and" at the end of the list (to allow the sentence to flow a little more easily), but I guess it's not a <em>massive</em> problem if the sentence doesn't include that. ::It might also be worth noting that the current (singular) tvar appears to have potentially confused one translator, who may have been expecting it to only contain a single value - [{{fullurl:special:diff/7737247}}]. (I'll add some <code>qqq</code> documentation for that segment after leaving this message.) ::{{pb}} ::{{tq|[...] in some cases it might be better to exclude the list from translation and present it as bullet points instead.}} Personally speaking, I'd probably prefer not to do that here, as I feel like the current structure (where the default values can be included in the same line as the config variable's description) might be slightly cleaner/more readable than if the default values were in a list. In any event, thanks for the suggestion, though - I'll keep it in mind for the future <code>:)</code> ::{{pb}} ::Best, <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 13:15, 13 July 2025 (UTC) :::Regarding the {{#tag:source|{{ll{{!}}{{^(}}tvar name=1{{)^}}...{{^(}}/tvar{{)^}}{{!}}hook handler}}|lang=mediawiki|inline=1}} markup: the <code>ll|</code> part should also be included in the {{tag|tvar|open}}, since the template name isn’t meant to be translated or changed. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:10, 13 July 2025 (UTC) ::::Ah, thanks for pointing that out! I'm not sure why I didn't think to include that before. Best, <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 07:39, 14 July 2025 (UTC) ::::Hi again - please could you explain if there was anything else wrong with the updated markup, or if there was another reason for its [{{fullurl:special:diff/7746297}} re-removal] without an edit summary? The updated markup was: ::::{{#tag:syntaxhighlight|Add a {{((}}{{^(}}tvar name=1>ll{{!}}Manual:Hooks#Writing_a_hook_handler</tvar>{{!}}hook handler{{))}} for the {{^(}}tvar name=2>{{((}}ll{{!}}Extension:EmailAuth/EmailAuthRequireToken{{!}}EmailAuthRequireToken{{))}}</tvar> hook.|lang=wikitext}} ::::As far as I can see, everything that shouldn't be translated (including the <syntaxhighlight lang=wikitext inline>{{ll}}</syntaxhighlight> template call) is now within a tvar; and the segment can be translated similarly to <code><nowiki>Add a {{$1|hook handler}} for the $2 hook.</nowiki></code>. Am I missing something again (as I previously was)?&nbsp;/genq ::::{{pb}} ::::(As a side note, I preferred the style of the "EmailAuthHooks in WikimediaEvents" link prior to [{{fullurl:special:diff/7746432}} this change] - IMO it makes more sense with all of the text within the link (as I believe - when reading the text - it makes it slightly clearer what the link is pointing to); and TBH I don't like the idea that we have to make the page slightly less readable in general, to be able to make it translatable. Do you mind if I change it back? I recognise that - with its number of tvars - this segment may not be the easiest to translate, and I was planning to add <code>qqq</code> documentation to assist translators on that front.) ::::{{pb}} ::::Best, <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 08:55, 15 July 2025 (UTC) :::::@[[User:A smart kitten|A smart kitten]]: I reverted the change temporarily because I thought the hook page name might be missing "/Hooks" after the extension name. However, since the markup itself was correct, it seems the reversion wasn’t actually necessary.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 10:18, 15 July 2025 (UTC) ::::::Thanks for the reply :) I'll reapply the markup. Best, <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 10:36, 15 July 2025 (UTC) == Defective documentation == Unless you enjoy doing [https://www.mediawiki.org/w/index.php?title=Extension:Cite&oldid=7757228 this kind of edits] every time someone modifies a translatable page I strongly suggest you amend [[Help:Extension:Translate/Page_translation_administration#Markup_examples|the documentation]]. That page doesn't mention {{tl|ll}} at all for example. I'd do it myself but (1) the logic behind the syntax is beyond my comprehension and (2) documenting it with wikitext requires developer-grade template knowledge. It's hardly surprising that text based examples are scarce (and defective, it seems) and it's all mostly done with videos. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 06:00, 20 July 2025 (UTC) :> On mediawiki.org, you can use [[Template:Localized link]] to link to pages on the same wiki as a simpler alternative to Special:MyLanguage/. :Since {{tl|ll}} is just a shorthand for {{tl|Localized link}}, it's not entirely unmentioned.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 06:49, 20 July 2025 (UTC) ::Great, so it is mentioned but not used, so the documentation remains suboptimal. ::BTW your latest ''simplification'' in [[Extension:Cite]] made the second wikilink within the Limitations section use a hardcoded string, so the Spanish translation now looks like crap with a first capital letter in the middle of a sentence. Thank you very much. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 07:41, 20 July 2025 (UTC) :::@[[User:Tactica|Tactica]] I've boldly [{{fullurl:special:diff/7759064}} modified] that link so that only its target (and the <code>ll|</code> template call) are now within the <syntaxhighlight lang=wikitext inline><tvar></tvar></syntaxhighlight> tags, given that the link's text needs to be capitalised differently to the target page's title. Best, <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 15:15, 20 July 2025 (UTC) ::::Thanks [[Special:Contributions/&#126;2025-27996-1|&#126;2025-27996-1]] ([[User talk:&#126;2025-27996-1|talk]]) 21:41, 27 July 2025 (UTC) == Regarding link anchor to on-page section usage and marking [[Skin:Lakeus]] for translation == Thank you for your previous work on marking [[Skin:Lakeus]] for translation and helping me with formatting! It's sort of pity that I couldn't find a documentation about translation pages. So, in my newer edits regarding the dark mode, I used links like this: <nowiki>[[#Migration to dark mode|Migration to dark mode]]</nowiki> and I sort of don't know how should I wrap them into tvars. Could you kindly help me with this matter? Thanks in advance! -- [[User:Lakejason0|Lakejason0]] ([[User talk:Lakejason0|talk]]) 09:42, 28 July 2025 (UTC) :I have created a separate anchor, could you please kindly check if that was correct? Thanks in advance! -- [[User:Lakejason0|Lakejason0]] ([[User talk:Lakejason0|talk]]) 12:52, 29 July 2025 (UTC) ::@[[User:Lakejason0|Lakejason0]] I've marked it for translation. [[User:Ciencia Al Poder|Ciencia Al Poder]] ([[User talk:Ciencia Al Poder|talk]]) 20:39, 29 July 2025 (UTC) == Not sure why my edits are getting reverted? == Hi, I don't really understand why these reverts were made, without explanation: * https://www.mediawiki.org/w/index.php?title=Help:Temporary_accounts&diff=next&oldid=7807234 * https://www.mediawiki.org/w/index.php?title=Help:Temporary_accounts&diff=prev&oldid=7807209 Am I doing something wrong? I'm just removing accidental newlines created by the placement of the html tags. Thanks. [[User:FaviFake|FaviFake]] ([[User talk:FaviFake|talk]]) 11:34, 11 August 2025 (UTC) :@[[User:FaviFake|FaviFake]]: I did not revert your edits, but only added blank lines to follow the conventions below: :* It is common practice to insert a blank line immediately before section headings. In fact, when editing by section, a blank line is automatically inserted just before the edited section. :* However, there is a special case when the line immediately before a section heading is {{tag|translate|open}}. In that case, insert a blank line immediately before that tag. :[[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 12:33, 11 August 2025 (UTC) ::@[[User:Shirayuki|Shirayuki]] Thanks. That effectively resulted in the 2 accidental newlines being reinstated again. Is there a way they can be removed for good? I think the conventions shouldn't be applied if applying them necessarily creates a blank newline between sections. [[User:FaviFake|FaviFake]] ([[User talk:FaviFake|talk]]) 12:54, 11 August 2025 (UTC) :::@[[User:FaviFake|FaviFake]]: As long as translators can translate the page and the translations display correctly, I don't really care whether there is one blank line or two blank lines between sections.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 13:27, 11 August 2025 (UTC) ::::@[[User:Shirayuki|Shirayuki]] Sure. I fixed them again, but this time my fix complies with the two conventions you mentioned. Thanks [[User:FaviFake|FaviFake]] ([[User talk:FaviFake|talk]]) 13:32, 11 August 2025 (UTC) == Revert == Why did you revert [https://www.mediawiki.org/w/index.php?title=VisualEditor%2FPortal%2FKeyboard_shortcuts&diff=7809924&oldid=7809754 this]?? [[User:Waddie96|Waddie96]] ([[User talk:Waddie96|talk]]) 22:18, 13 August 2025 (UTC) :@[[User:Waddie96|Waddie96]] [[Help:System_message#Avoid_fragmented_or_%22patchwork%22_messages]] [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 22:21, 13 August 2025 (UTC) ::Okay, can we capital S [[User:Waddie96|Waddie96]] ([[User talk:Waddie96|talk]]) 22:24, 13 August 2025 (UTC) ::@[[User:Shirayuki|Shirayuki]]: related question about [[Special:Diff/8274164]]: can you tell me in which human language that won't work? AFAIK that's the only part in the statement that anyone in a locale other than English will change, hence my attempt to make that part translatable. The blanket URL you mention doesn't even begin to give an explanation for your revert, and if this is an rtl/ltr issue then the change needs to be improved, not reverted. Not making things translatable isn't the solution. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 21:29, 9 March 2026 (UTC) :::@[[User:Tactica|Tactica]]: Because word order differs by language, making only "/path/to" translatable is inappropriate. There is no proper way to mark this up right now.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:39, 9 March 2026 (UTC) == Download page needs updating == I can't figure out [[Special:Diff/6949712|this change of yours]]. It needs to be updated, because it's showing the wrong information [[Download#Signature downloads|on the page]] (1.44.0 is ''not'' LTS, but 1.43.3 is). Please consider making this portion of the page easier for others to update. - [[User:Dcljr|dcljr]] ([[User talk:Dcljr|talk]]) 03:44, 21 September 2025 (UTC) :@[[User:Dcljr|Dcljr]]: Ask for help at [[Project:Village Pump]]. Manually updating this every time a new version is released is a waste of time, especially since there are only about four possible patterns that appear in a cyclical manner. Someone should automate this using Lua.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 05:28, 21 September 2025 (UTC) ::OK, but you are the one who made the edit that is causing the incorrect information to be displayed now. It would be great if you took a little time to fix the problem you caused. - [[User:Dcljr|dcljr]] ([[User talk:Dcljr|talk]]) 12:29, 21 September 2025 (UTC) :: Nevermind. [[Special:Diff/7896849|I got it to work]]. - [[User:Dcljr|dcljr]] ([[User talk:Dcljr|talk]]) 14:19, 21 September 2025 (UTC) :::That means you will be the one asked to fix things next time there is a version update :P -- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:59, 21 September 2025 (UTC) ::::Unless I do something about the crap way things are done on that and similar pages. - [[User:Dcljr|dcljr]] ([[User talk:Dcljr|talk]]) 23:58, 21 September 2025 (UTC) == Parts of Help:CirrusSearch missing translation tags == Hello, as you usually mark this page for translation: Some recently added parts of [[Help:CirrusSearch]] cannot be translated in the moment. These are [[Help:CirrusSearch#Articlecountry]] in total and [[Help:CirrusSearch#creationdate and lasteditdate]] in parts (some sentences, all the tables, the title itself due to the “and”, but there could be, instead, added a comma). For sentences, I’ve added the tags myself in the past, but I am unsure about the section title. By the way: Maybe all the other section captions should be made translatable, as well, for non-Latin script additions? I am undecided. —<span style="white-space:nowrap"> [[User:Speravir|Speravir]] ([[User talk:Speravir|talk]]) – 01:42, 8 October 2025 (UTC)</span> :@[[User:Speravir|Speravir]]: Regarding the section headings, I think they should not be made translatable because the current headings are the keywords themselves, not the search target categories. :Also, when section headings contain "and" or commas, requests often arise to make them translatable, so using slashes to separate them might be a more neutral approach.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:16, 8 October 2025 (UTC) :Furthermore, I think [[Help:CirrusSearch#Insource|insource]] should not be capitalized, because it does not work when the first letter is uppercase. The same probably applies to the other keywords as well.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:35, 8 October 2025 (UTC) ::Thank you for your edits. So, there have been even more sentences missing the translation tags. —<span style="white-space:nowrap"> [[User:Speravir|Speravir]] ([[User talk:Speravir|talk]]) – 22:34, 8 October 2025 (UTC)</span> == Discouraged status == FYI I've undone several of your translation encouragement actions. Since the translate UI doesn't allow edit summaries, I'm explaining why here: * [[Manual:CommonElements.css]], [[Manual:checkLanguage.inc]] - the file was removed from MediaWiki years ago, there's no point in translating it now. * [[Extension:GoogleLogin/PreAuthManager]] - this is documentation for a decade-old bit of code that isn't being maintained, there's no point in translating it now. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun</sub>]] 23:02, 23 November 2025 (UTC) :@[[User:Pppery|Pppery]]: I haven't seen the manuals for the removed files marked as "discouraged" at all. Should each of them ideally be marked that way?-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 23:20, 23 November 2025 (UTC) :: I do it when I notice, not via any kind of systematic review, but yes, any manual page for a file (or configuration setting, or anything else) marked as removed before {{tl|MW legacy lts branch number}} (currently {{MW legacy lts branch number}}) should definitely be discouraged, and I wouldn't object to discouraging anything marked as removed in any version either. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun</sub>]] 23:31, 23 November 2025 (UTC) == Vandal report == {{User:LBLaiSiNanHai/VandalReport|AdBriyanOfficial|8101331|vandalOnly=1}} [[User:LBLaiSiNanHai|LBLaiSiNanHai]] ([[User talk:LBLaiSiNanHai|talk]]) 11:15, 24 December 2025 (UTC) :@[[User:LBLaiSiNanHai|LBLaiSiNanHai]]: {{done}} - [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 11:19, 24 December 2025 (UTC) == about translating == excuse me, I wrote a page [[Manual:NotificationService.php]], may you mark it translate? thanks very much [[User:LBLaiSiNanHai|LBLaiSiNanHai]] ([[User talk:LBLaiSiNanHai|talk]]) 11:50, 24 December 2025 (UTC) :also, you are the most active current Translate Admin, i hope you see [[Project:Village_Pump#RfC:_about_my_perm_request|this topic]], you suggestion to me will be important [[User:LBLaiSiNanHai|LBLaiSiNanHai]] ([[User talk:LBLaiSiNanHai|talk]]) 11:52, 24 December 2025 (UTC) :@[[User:LBLaiSiNanHai|LBLaiSiNanHai]]: Thank you for your work on expanding the documentation pages. :However, the page you mentioned currently contains incorrect or problematic markup, so it cannot be marked for translation in its present state. In general, the necessary translation markup should be added by one of the existing Translate administrators. If contributors add it themselves in a non-standard way, it can actually increase the workload for the Translate admins, so I would appreciate it if you could avoid doing so. :Regarding your request for TA rights, I will not comment on that here, but I believe you will understand my position from the above. -- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 12:06, 24 December 2025 (UTC) == Really should delete deprecated file manual page? == Many user using old version of MediaWiki, we should archive them, not delete them, I think. [[User:LBLaiSiNanHai|LBLaiSiNanHai]] ([[User talk:LBLaiSiNanHai|talk]]) 06:18, 30 December 2025 (UTC) :@[[User:LBLaiSiNanHai|LBLaiSiNanHai]]: Thanks for your message. :I understand the concern about people still using older versions of MediaWiki, and in general I also think archiving can be preferable to deleting. However, the pages I deleted all shared the same characteristics: :* They were created mechanically by me in 2020. :* Since creation, nobody has added any further description or documentation. :* There is no realistic prospect that these pages will ever be expanded. :* The features described were removed in versions older than the current legacy LTS (1.39), meaning they are already outside the range of currently supported releases. :Given that these pages only existed as empty placeholders for obsolete functionality, I felt it was cleaner to delete them rather than leave them indefinitely in that state.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 06:36, 30 December 2025 (UTC) :: Agreed these should be deleted. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun</sub>]] 06:55, 30 December 2025 (UTC) == Kindly fuzzy an image caption == Hello, Shirayuki-san, so appreciating you taking up the role of translation admin every day. May I bother you and request to fuzzy a caption on File:Editing maps in TemplateData Editor.png [https://www.mediawiki.org/wiki/Citoid/Enabling_Citoid_on_your_wiki] please? Wish you another brilliant year in 2026, kindly, -- [[User:Omotecho|Omotecho]] ([[User talk:Omotecho|talk]]) 23:19, 17 January 2026 (UTC) == Request for merging pages == Hello, could you please take look at [[Project:Village_Pump#Move_draft_in_my_user_page_to_main_namespace]]? Thanks! [[User:Diskdance|Diskdance]] ([[User talk:Diskdance|talk]]) 08:45, 9 February 2026 (UTC) == About [[Readers/Information_Retrieval/Phase_0]] == Hello,@[[User:Shirayuki|Shirayuki]] You have just canceled the markup we made. Please note that more than 45% of the text is not marked for translation, which I have already done. We need this page to complete the translation. As I do not have the rights in MediaWiki, I hope that an administrator will be able to correct this for me. Thank you very much for your support. Best regards, [[User:Dezedien|Dezedien]] ([[User talk:Dezedien|talk]]) 19:24, 11 February 2026 (UTC) :Hi @[[User:Shirayuki|Shirayuki]], I have added a mark. Could you please check if it is correct and activate it if possible? Thank you very much. [[User:Dezedien|Dezedien]] ([[User talk:Dezedien|talk]]) 00:40, 12 February 2026 (UTC) ::@[[User:Dezedien|Dezedien]]: Read [[Help:System message#Avoid fragmented or "patchwork" messages]].-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 11:53, 12 February 2026 (UTC) :::@[[User:Shirayuki|Shirayuki]], I would like to clarify my intention. :::When a page is written in French, all original English text should be translated completely. Leaving full sentences in English inside a French page creates inconsistency for readers. :::Using the translate tag is not “patchwork.” It is simply the correct way to mark text for translation in MediaWiki. The goal is clarity and full localization. :::This does not affect internationalization. I have translated content into multiple languages for many years without causing any i18n issues. :::My objective is only to ensure that French readers receive fully translated content, not partially English text. :::Thank you for your understanding. [[User:Dezedien|Dezedien]] ([[User talk:Dezedien|talk]]) 00:17, 16 February 2026 (UTC) :::: You should use [[tvar]]s rather than splitting nontranslatable bits into separate units. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun</sub>]] 07:19, 22 February 2026 (UTC) == Hello == I don´t see Wikivy Foundation in [[Hosting services]] although it is a wiki farm powered by MediaWiki. [[User:Darrrrmilk|Darrrrmilk]] ([[User talk:Darrrrmilk|talk]]) 01:48, 15 February 2026 (UTC) :Hi can you please answer to this [[User:Darrrrmilk|Darrrrmilk]] ([[User talk:Darrrrmilk|talk]]) 22:00, 15 February 2026 (UTC) :@[[User:Darrrrmilk|Darrrrmilk]]: I don't know that foundation, so there's nothing I can do about it.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 23:04, 15 February 2026 (UTC) ::Ok thank you for replying @[[User:Shirayuki|Shirayuki]] [[User:Darrrrmilk|Darrrrmilk]] ([[User talk:Darrrrmilk|talk]]) 23:18, 15 February 2026 (UTC) :::The wiki farm is not made yet put it is TBA but I heard the registration page and document is filled out but it is not founded yet [[User:Darrrrmilk|Darrrrmilk]] ([[User talk:Darrrrmilk|talk]]) 00:26, 16 February 2026 (UTC) == I want to add localization to [[Extension:UniversalCalendar]]. Could you tell me how to do it? == I want to add localization to "Extension:UniversalCalendar". Could you tell me how to do it? [[User:HoshinoKennji|HoshinoKennji]] ([[User talk:HoshinoKennji|talk]]) 09:40, 15 February 2026 (UTC) :@[[User:HoshinoKennji|HoshinoKennji]]: Please refrain from preparing the page of an experimental extension for translation.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 10:49, 15 February 2026 (UTC) ::I am writing a plugin introduction and plan to translate it into at least Chinese, Japanese, English and Korean. This is my first time creating an extension page and I have no experience, so I am gaining experience for the second extension that will be released soon. [[Special:Contributions/&#126;2026-10146-04|&#126;2026-10146-04]] ([[User talk:&#126;2026-10146-04|talk]]) 10:59, 15 February 2026 (UTC) ::I see. Please disregard my previous reply; I misunderstood earlier. [[Special:Contributions/&#126;2026-10146-04|&#126;2026-10146-04]] ([[User talk:&#126;2026-10146-04|talk]]) 11:12, 15 February 2026 (UTC) :As the extension is still experimental, the page may change substantially. :Marking it for translation now could impose unnecessary work on translators due to frequent updates. :Therefore, it would be better to wait until the content stabilizes.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 11:16, 15 February 2026 (UTC) == Translations - editing of old pages == --Warning: You are currently editing an outdated version of this page. If you publish it, all later changes will be lost.-- appears only after opening the history and some of the edits. Then after opening the edit, Sometimes I have to perform this operation twice or more. Thanks for the editing and cooperation. :)) [[User:ENeRZet|ENeRZet]] ([[User talk:ENeRZet|talk]]) 10:57, 16 February 2026 (UTC) == Recycling translations for [[Template:Extension]] == Shirayuki, I need to move lines 306-344 into a separate template in order to implement support for multiple licenses, as this code will be called once per every stated license and it would be silly to repeat this in an already intricate template. Shall I remove the {{tag|translate}} tags in the new template or is there any way existing translations can be reused? I would prefer the change to be as painless as possible for everyone. TIA. Oh, and I know [[Template:ExtensionLicense]] exists, but it never solved the underlying problem of pages being categorized as using an "unknown license". That's the problem I intend to solve here. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 16:08, 24 February 2026 (UTC) == Wikivy foundation == So basically I want to report this brand new wiki farm created this month called the WIkivy Foundation and here is the link-https://meta.wikivy.com/ but I know I should not be reporting this on MediaWiki Steward's talk pages so please tell me where to report this. Reason:Copy and pasting policies from Miraheze without proper attributions. While they do mention that some of their policies are inspired by Miraheze it almost looks like a copy and paste for a lot of them. Such as global policies,templates,Meta pages,and Wiki Policies(there are more,these are just some major ones). So basically they replace the "Miraheze" part in policies and replace it with "Wikivy" Here is an example of what I said above: Wikivy-"The '''Content Policy''' exists to help the Wikivy Foundation maintain a safe, welcoming, and productive environment for all contributors. Wiki requesters, reviewers, and administrators are expected to understand and apply this policy when requesting new wikis and when overseeing existing ones. Administrators play a crucial role in ensuring that on-wiki content complies with these guidelines. Repeated violations—especially those left unaddressed by local admins—may result in '''wiki closure''' or [https://frog.frogiesarcade.infinityfreeapp.com/frog/ixl/hvtrs8%2F-mgtc.uiiity%2Ccmm-wkkk%2FQpgckan%3AOyNalgwaee-Sveuapdq Steward] [https://frog.frogiesarcade.infinityfreeapp.com/frog/ixl/hvtrs8%2F-mgtc.uiiity%2Ccmm-wkkk%2FQpgckan%3AOyNalgwaee-cmnqepvctmrqhkp conservatorship]. This policy applies to everyone. All editors, not just leadership, should make an effort to follow these guidelines as well as any additional local content policies a wiki adopts. Together, we can keep Wikivy a collaborative, mission-aligned, and trustworthy platform for free knowledge."-Wikivy Content Policy Miraheze-"The '''Content Policy''' seeks to help Miraheze maintain a safe, welcoming, and productive environment for everyone. We'd like to remind our wiki requesters, reviewers and administrators to be familiar with this policy and apply it when handling new requests or overseeing their wikis. Wiki administrators play a crucial role in ensuring that on-wiki content complies with these guidelines – repeated policy violations without local administrator action may result in wiki closure or [[miraheze:Special:MyLanguage/Stewards|Steward]] [[miraheze:Special:MyLanguage/conservatorship|conservatorship]]. This policy is not just for those in leadership roles. All our editors should make an effort to adhere to this policy and any additional local content policies that might be in place on the specific wikis they contribute to. Together, we can make Miraheze a fantastic place for knowledge-sharing and collaboration!"-Miraheze Content Policy You see this is just copy and paste but replacing "Miraheze" with "Wikivy" Now I'll show an example of copy and pasting policies(Using Privacy Policy as example): Wikivy-"(snip)" Also not to mention that the founder of Wikivy foundation is not a Miraheze Steward nor did they ever get permission to straight-up just copy and paste Miraheze stuff. [[User:Darrrrmilk|Darrrrmilk]] ([[User talk:Darrrrmilk|talk]]) 05:58, 1 March 2026 (UTC) :Wait ur not steward mb [[User:Darrrrmilk|Darrrrmilk]] ([[User talk:Darrrrmilk|talk]]) 05:58, 1 March 2026 (UTC) ::On top of this,they also deleted my wiki saying my copy and pasted without attributions while I did give attributions multiple times throughout the wiki and they refused to block 2 people that where harassing me,one of which was blackmailing another user,spreading false info,stating his opinions as facts,and vandalizing my wiki. But a steward blocked me one day for vandalizing that guys userpage because I got really mad since he was spewing a big hate on me but while I do commit to have vandalized what the other 2 users have done is very worse yet they got away due to this corruption. [[User:Darrrrmilk|Darrrrmilk]] ([[User talk:Darrrrmilk|talk]]) 06:10, 1 March 2026 (UTC) :@[[User:Darrrrmilk|Darrrrmilk]]: This matter does not concern MediaWiki.org, nor am I affiliated with Miraheze. :Please refrain from posting further comments about disputes unrelated to this site on my talk page. :If this continues, I may take administrative action.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 06:22, 1 March 2026 (UTC) == Should punctuation be part of translations or not? == Dear @[[User:Shirayuki|Shirayuki]]: At the risk of becoming a PITA (and believe me, I'm doing my best to avoid just that) I must ask because I'm completely baffled now. The section "Symbols, colons, brackets, etc. are parts of messages" under [[Help:System message]] advocates this, and yet you keep undoing about every effort towards that end, for example in T:37 as part of [[Special:Diff/8277169]], which looks the more surprising coming from a Japanese person. As I understand it this isn't ''patchwork'' because I was making the whole string translatable, and besides there's absolutely no reason to prevent "Category:Cars" from being translatable too. ISTR reading Arabian text must not be italicised for example or something along those lines, so the more reason to make e.g. ''style'' translatable...? I'll be very interested in your reasoning for this one. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 23:50, 11 March 2026 (UTC) :@[[User:Tactica|Tactica]]: I could understand making Category:Cars a separate translation unit. However, I don't see a strong reason to include the bold markup in the same translatable message. :The actual text here is just "No translation", and the bold markup is only formatting. :Including the colon in the existing T:37 unit might make sense, since some languages insert a space before a colon. But extending the same translation unit further to include formatting or the category name doesn't seem necessary to me.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 11:08, 12 March 2026 (UTC) == [[Help:Content translation/Translating/Translation quality]] == Almost two months ago, you protected the above page at the administrator level. I suggest lowering the protection to autoconfirmed since all accounts that have vandalized the page weren't autoconfirmed at the time of vandalism occurrence, also the fact that certain WMF accounts might not be able to update the page due to not having thre required permission as well. [[User:ToadetteEdit|ToadetteEdit]] ([[User talk:ToadetteEdit|talk]]) 15:31, 18 March 2026 (UTC) :@[[User:ToadetteEdit|ToadetteEdit]]: Thank you for your suggestion. You are correct, so I have lowered the protection level. [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 21:18, 18 March 2026 (UTC) == Preserving leading spaces == Hi Shirayuki, The reason why in {{tl|Wrapper}} I [[Special:Diff/8317414/8318193|changed]] the condition <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{any-left|}}}|no|...|...}}</syntaxhighlight> into <syntaxhighlight lang="wikitext" inline>{{P{{#ifeq:{{{any-left|}}}|no|1|2}}|...|...}}</syntaxhighlight> is that the text shown was “...will work here.However, the following are...”. The rationale is the fact that if I write <syntaxhighlight lang="wikitext" inline>a{{#ifeq:XXX|YYY| B | C }}d</syntaxhighlight> I get “a{{#ifeq:XXX|YYY| B | C }}d”, whereas if I write <syntaxhighlight lang="wikitext" inline>a{{P{{#ifeq:XXX|YYY|1|2}}| B | C }}d</syntaxhighlight> I get “a{{P{{#ifeq:XXX|YYY|1|2}}| B | C }}d”. However, despite my edit, here the leading space is still suppressed. Is there any way around this? --[[User:Grufo|Grufo]] ([[User talk:Grufo|talk]]) 13:39, 2 April 2026 (UTC) == Reverted edit == Hi there, Shirayuki. Thanks for your tireless work here on mediawiki.org, including cleaning up some of the stuff I do, sometimes oblivious to the implications to the translated tags. However, I can't understand why you performed [[Special:Diff/8364313|this revert]]. Can you explain what was the issue with my changes? --[[User:Waldyrious|Waldyrious]] ([[User talk:Waldyrious|talk]]) 13:27, 3 May 2026 (UTC) :@[[User:Waldyrious|Waldyrious]]: Conversely, explain what issue exists in the current version. Your edit summary “allow reason string to be omitted” is unclear.-- [[User:Shirayuki|Shirayuki]] ([[User talk:Shirayuki#top|talk]]) 14:55, 3 May 2026 (UTC) by0jharkmagescmos9bo1eioselwdsz Talk:XTools 1 2093290 8364485 8364221 2026-05-03T15:57:43Z Zackmann08 434625 /* Support for edit counts over 1,000,000 */ Reply 8364485 wikitext text/x-wiki {{tmbox|text=This page is a feedback forum for XTools. For reporting bugs, it's preferred that you use [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=XTools Phabricator].}} {{archives|list= * [[Talk:XTools/Flow|Original Flow board]] '''Flow cleanup bot exports''' * [[/2017|2017]] * [[/2018|2018]] * [[/2019|2019]] * [[/2020|2020]] * [[/2021|2021]] * [[/2022|2022]] * [[/2023|2023]] * [[/2024|2024]] }} == Old edits (DE:WP) == Hi, I'm astonished how far back this finds information: https://xtools.wmcloud.org/ec/de.wikipedia/Heribert3?uselang=de I'd like to search in my contributions history in DE:WP about '''Higgs''' years ago, but no hit. Any hints, please? [[User:Heribert3|Heribert3]] ([[User talk:Heribert3|talk]]) 03:35, 25 December 2024 (UTC) == Support for Fandom wikis? == Hi, is it possible to extend this tool to Fandom wikis? I'm very active there and have been very eager to see the statistics of my edits. Thanks! [[User:Harmoniker666|Harmoniker666]] ([[User talk:Harmoniker666|talk]]) 10:24, 13 February 2025 (UTC) :We hope to bring back third party support eventually, though it is admittedly a low priority. You can follow [[phab:T344090]] for updates. Getting it to work for Fandom however might be a real challenge. I understand they use a fork of MediaWiki and custom tailor extensions and services to work for it. The engineering team would likely need to do the same for XTools. <span style="font-family:sans-serif">&mdash; <span style="font-weight:bold">[[User:MusikAnimal|<span style="color:black; font-style:italic">MusikAnimal</span>]] <sup>[[User talk:MusikAnimal|<span style="color:green">talk</span>]]</sup></span></span> 14:32, 13 February 2025 (UTC) ::Thanks for replying. The link seems very technical so not sure how I should "follow" it? [[User:Harmoniker666|Harmoniker666]] ([[User talk:Harmoniker666|talk]]) 10:07, 25 February 2025 (UTC) == Bug with blocks? == For a user that's indeffed at enwp since January ([https://en.wikipedia.org/wiki/Special:Log?page=User%3ATG-article&type=block][https://en.wikipedia.org/wiki/Special:Contributions/TG-article]), [https://xtools.wmcloud.org/ec/en.wikipedia.org/TG-article xtools reports] 3 blocks (instead of 5), with longest 6 days and current none. Looks as if it wasn't aware of the last two blocks. Two months seems to me to be too long to be replag's fault. — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 16:52, 30 March 2025 (UTC) :(Made a detailed report at [[phab:T391824]].) — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 12:55, 14 April 2025 (UTC) :: And for information also ended up fixing it myself. Rabbit holes... — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 20:17, 6 May 2025 (UTC) == Feature Request: Edtorship over Time for any given page == Thank you by the way for creating XTools it's really excellent and I'm so happy that something like it exists. Goal/Purpose: see if any specific editors were disproportionately influential as (% of edits in a year) in a page's lifetime. Edits are already shown as a barchart by year. Perhaps a stacked bar chart (every year adds up to 100% but broken down proportionately by contributing editor). For many pages, this may be useless as there are very many editors and not single one dominating, but for some it may be interesting to see. [[User:Greengiraffe89|Greengiraffe89]] ([[User talk:Greengiraffe89|talk]]) 09:14, 11 May 2025 (UTC) : Created [[phab:T396215|T396215]]. — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 12:29, 6 June 2025 (UTC) == Link to Liquid Soul == Link is incorrect. [[Special:Contributions/2003:CF:E73A:99B5:4574:BE18:3963:F757|2003:CF:E73A:99B5:4574:BE18:3963:F757]] 21:31, 15 May 2025 (UTC) : Can you give precisions? — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 19:00, 9 June 2025 (UTC) == Wrong move count? == Going by my [[:en:Special:Logs/move/CX Zoom]], I have 2068 moves, even [[:quarry:query/93856]] agrees. XTools only counts 1505. In fact, I have moved several hundreds of pages since yesterday, but my move count barely moved. I remember it was 1400-something before the moves. &#8212;&#8205;[[User:CX Zoom|CX Zoom]] <abbr title="en-English, hi-हिंदी, bn-বাংলা">(A/अ/অ)</abbr> ([[User talk:CX Zoom|let's talk]]&#124;[[Special:Contributions/CX Zoom|contribs]]) 19:21, 21 May 2025 (UTC) : Bug found; mw gives a different log_action for moves over redirects; we were only counting move/move as opposed to move/move_redir. Left [[phab:T396216|T396216]] and pull request that fixes. — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 12:49, 6 June 2025 (UTC) ::Thank you for figuring it out. I hope it gets merged soon. &#8212;&#8205;[[User:CX Zoom|CX Zoom]] <abbr title="en-English, hi-हिंदी, bn-বাংলা">(A/अ/অ)</abbr> ([[User talk:CX Zoom|let's talk]]&#124;[[Special:Contributions/CX Zoom|contribs]]) 19:59, 14 June 2025 (UTC) ::: I'm doing a lot of PRs these days; but it'll probably get deployed in at most a few releases. — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 20:43, 14 June 2025 (UTC) Now merged; will go out in next deployment. — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 20:18, 15 July 2025 (UTC) :Thank you very much! &#8212;&#8205;[[User:CX Zoom|CX Zoom]] <abbr title="en-English, hi-हिंदी, bn-বাংলা">(A/अ/অ)</abbr> ([[User talk:CX Zoom|let's talk]]&#124;[[Special:Contributions/CX Zoom|contribs]]) 20:46, 15 July 2025 (UTC) :: (Now deployed.) — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 22:22, 20 August 2025 (UTC) == Time Card local time == In the Time Card there is a "Use local time instead of UTC" checkbox. Does it show edits in my local time or the user's local time? In the Xtools User Documentation I did not find a section for Time Card. [[User:Jay|Jay]] ([[User talk:Jay|talk]]) 02:40, 18 September 2025 (UTC) :@[[User:Jay|Jay]] It would be ''your'' timezone. I have [[Special:Diff/7893821|updated]] the documentation to clarify this. <span style="font-family:sans-serif">&mdash; <span style="font-weight:bold">[[User:MusikAnimal|<span style="color:black; font-style:italic">MusikAnimal</span>]] <sup>[[User talk:MusikAnimal|<span style="color:green">talk</span>]]</sup></span></span> 21:54, 18 September 2025 (UTC) == Not all assessments types are supported == Hello, thanks a lot for the tool, it's very useful ! There is an issue that I found though. On the "pages created" page, there is an assessment column that can hold different values (in English : stub, start, C, list, etc/in French : ébauche, BD, B, ec). The "homonymie" value that can be found on disambiguation pages on French Wikipedia (for instance [https://fr.wikipedia.org/wiki/Discussion:Michel_Terrasse here]) is not transfered to the assessment column in "pages created" (for instance [https://xtools.wmcloud.org/pages/fr.wikipedia.org/TTSolitaire?uselang=en my page] with the same disambiguation page on line 9 with "unknown" as assessment). I don't know if it is an easy fix ? But it would be helpful to know which pages are not yet evaluated and which are already evaluated. Thank you in advance for your answer ! Sincerely, [[User:TTSolitaire|TTSolitaire]] ([[User talk:TTSolitaire|talk]]) 12:36, 5 October 2025 (UTC) : Bonjour. Ceci est du à la manière dont les modèles d'évaluation (au sens les bandeaux de PDD) de FRWP fonctionnent. Ils ne marquent une page comme ayant une certaine évaluation que si au moins un Projet est marqué. Par exemple, <source lang="wikitext" inline>{{Wikiprojet|avancement=homonymie}}</source> ne marche pas mais <source lang="wikitext" inline>{{Wikiprojet|Homonymie||avancement=homonymie}}</source> marcherait. XTools ne peut pas trouver cette évaluation, tout simplement parce que le modèle ne la rend pas accessible dans la base de données. : Si le Projet Homonymie de FRWP n'est pas contre utiliser des choses à la <source lang="wikitext" inline>{{Wikiprojet|Homonymie|N/A|avancement=homonymie}}</source>, ça serait une solution. J'ai l'impression (au premier regard) que telle n'est pas la pratique. : L'autre solution serait peut-être de modifier le code pour, par exemple, que sur des PDD ne possédant qu'une évaluation "Homonymie" sans projets, il mette tout de même dans la base de données un enregistrement de l'évaluation. : Je pourrais aider à essayer d'implémenter la deuxième idée, si nécessaire. — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 11:13, 20 October 2025 (UTC) ::Bonjour @[[User:Alien333|Alien333]], merci pour la réponse et pour la proposition d'aide. Je n'avais pas vu qu'une réponse avait été apportée autant pour moi. Entre temps, @[[User:Slzbg|Slzbg]] est passé (merci !) sur les évaluations des articles pour y apposer le modèle <nowiki>&lt;nowiki&gt;{{Catégorisation homonymie pour XTools}}&lt;/nowiki&gt;</nowiki> qui résout ce problème et fait apparaître l'avancement Homonymie sur ma page XTools. L'outil existait donc déjà ! Cordialement, [[User:TTSolitaire|TTSolitaire]] ([[User talk:TTSolitaire|talk]]) 17:56, 12 December 2025 (UTC) == Dead links on this page == All or most of the links titled "link" in the "User documentation" section of this page are 404. They lead to a page called "Oh noes!". [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 20:58, 31 October 2025 (UTC) :@[[User:Jonesey95|Jonesey95]] Your browser is apparently failing the Anubis proof-of-work check that we use to filter out malicious bots. Which browser and version are using? And do you have JavaScript enabled? <span style="font-family:sans-serif">&mdash; <span style="font-weight:bold">[[User:MusikAnimal|<span style="color:black; font-style:italic">MusikAnimal</span>]] <sup>[[User talk:MusikAnimal|<span style="color:green">talk</span>]]</sup></span></span> 01:43, 1 November 2025 (UTC) ::Firefox 140.3.1esr on Mac OS, a totally normal browser that works everywhere. And yes, I have JavaScript enabled. [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 02:38, 1 November 2025 (UTC) :::Are you using a VPN or some other proxying service? <span style="font-family:sans-serif">&mdash; <span style="font-weight:bold">[[User:MusikAnimal|<span style="color:black; font-style:italic">MusikAnimal</span>]] <sup>[[User talk:MusikAnimal|<span style="color:green">talk</span>]]</sup></span></span> 04:58, 1 November 2025 (UTC) == stats by "bytes added/removed" == {{tracked|T407814}} until recently, there were two main pies - one by # of edits, and the other by bytes added/removed. in many cases the 2nd pie was the significant one when looking for information regarding "who authored this article". i do not see the 2nd pie now, and dearly miss it. don't know if the absence of the 2nd pie is intentional or not. if it is, i want to strongly advocate against this intention - the removed piece was the most useful one on the whole tool. if it's unintentional, then this is my bug report. i don't know where is the right place to report bugs. is it [[phab:]] ? peace - [[User:קיפודנחש|קיפודנחש]] ([[User talk:קיפודנחש|talk]]) 20:42, 13 November 2025 (UTC) :@[[User:קיפודנחש|קיפודנחש]]: : '''tl;dr''': not intentional, collateral effect of temporary fix for another issue, sorry for the annoyance, gotta try and patch something for this sometime soon. (Ideally getting a serious fix for that other issue.) I'll try and take some time for this but I can't promise anything. (And yes, in general the right place to report bugs tends to be [[phab:tag/xtools/]], but do please try and avoid creating duplicates.) :In a nutshell: when determining "max addition"s we rely on reverts, to not count vandalism, except due to [[phab:T389026|T389026]]/[[phab:T407814|T407814]], some of our revert stuff had to be temporarily disabled. :More in detail: there was a schema change, in which the <code>sha1</code> field (the revision's [[w:hash function|hash]]) was moved from the <code>revision</code> table to the <code>content</code> table ([[phab:T389026|T389026]]). We use <code>sha1</code> because it lets you do revert detection: if one revision's sha1 is the same as the one a few revisions earlier, it likely means all edits in between were reverted. We didn't adapt in time to the column move {{small|could always use some participation, we got quite a stack of stuff to do and sadly I don't have much time these days (blame IRL)}}, and now the values have been removed from the <code>revision</code> table. Which meant the queries we had that tried to read <code>sha1</code>s all ended up crashing, bringing down some tools with them ([[phab:T407814|T407814]]). We commented out these parts of the queries as an emergency measure to get the time to solve it properly and get <code>sha1</code>s back. A side effect is that we're behaving as if all <code>sha1</code>s were <code>NULL</code>, aka 0. So to our code currently all revisions are the same and all edits are reverted, essentially. Given we exclude reverted edits (as likely vandalism) when counting added text, to the code no one has added text and so there's no point showing the chart. :Cheers, — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 21:46, 14 November 2025 (UTC) ::thank you so much! ::this is by no means "urgent", i just worried that the second pie, which i find the most useful part of this tool is gone for good. ::i can definitely wait patiently, happy to know that at some point it will be back... ::peace. [[User:קיפודנחש|קיפודנחש]] ([[User talk:קיפודנחש|talk]]) 23:56, 14 November 2025 (UTC) :::@[[User:Alien333|Alien333]] @[[User:MusikAnimal|MusikAnimal]] sorry to insist, but this change of removing bytes without notice is so harmful... I am managing two university projects ([[:ca:Viquiprojecte:Microbiologia_dels_aliments_UAB|Viquiprojecte:Microbiologia dels aliments UAB]] and [[:ca:Viquiprojecte:Biotecnologia_alimentària_UAB|Viquiprojecte:Biotecnologia alimentària UAB]] in the Catalan Wikipedia) and the way we evaluated our students (these are graded assignments: about 400 articles since 2017, no small thing!) was by partially checking the number of added bytes by each student in the article. Besides, they were told to check these statistics to see whether they were editing in an equilibrated way. Now, in the middle of the evaluation period, this has suddenly disappeared without any notice! How Wikipedians and educational tutors are we supposed to trust the project if suddenly we see these problems from one day to the other? '''This change has ruined my evaluation rubric in just two days and now I must count characters manually for each student by using the history page and against the clock.''' For some of us, and sorry the harsh tone, this is really urgent and annoying. Luckily I knew where to check here in Mediawiki, but what about other people affected?? Nine years volunteering on these courses that bring Wikipedia to the students so that they see that it is a great tool to participate, and the feeling is that year after year it is more difficult to trust any external tool that may help to easily grade them and use the project scholarly. [[User:Xavier Dengra|Xavier Dengra]] ([[User talk:Xavier Dengra|talk]]) 12:14, 17 November 2025 (UTC) ::::@[[User:Xavier Dengra|Xavier Dengra]]: XTools is a volunteer project that MA had been more or less taking care of ''alone'', for ''the last 8 years'' before I arrived last spring. We do our best. We are only volunteers that do what they can do in the little time IRL and the rest of our lives give us. It is not a question of trust. It is a question of possibility. It would be foolish to expect that that one or two guys volunteering in their evenings when they can can guarantee a permanent and unfailing service. We are only human. Contributions would be welcome: people keep complaining that we don't manage to do much, but no one ever wants to give a hand. It doesn't just all magically fix itself. ::::So yes, a) I would appreciate a less harsh tone {{small|(is the best thing you have to do ranting against unpaid volunteers that do their best?)}}, and b) wait until we get time, or fix it yourself at https://github.com/x-tools/xtools/pulls. — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 16:04, 17 November 2025 (UTC) :::::I get your (fair) point. But please, understand that from a plain Wikipedian point of view, the technical maintenance you never know (and it is not that obvious) whether relies on a volunteer or on the WMF. And should rather be the second one -I expect we both agree on this to some extent. The editors also (we) spend a huge amount of volunteering time as well to then see this kind of sudden changes, which sometimes are far worse than a "collateral effect". We wish that the interface was simpler so that many tools did not depend on external websites, so we could understand and help more with technical knowledge. Not the case for most of us, that we are not trained nor expert in coding... And the experience in Phabricator is that it is a 'cul-de-sac' where requests can take up to several years while the wiki interface is worsening over years. All this said, and ofc respecting your volunteering, I can only beg so that a new patch can show again, somehow, the bytes added. And that others' volunteering does not become a nightmare with the need of a calculator in the hand. Best regards, [[User:Xavier Dengra|Xavier Dengra]] ([[User talk:Xavier Dengra|talk]]) 17:00, 17 November 2025 (UTC) ::::::I will try to set some time aside to work on it this week. Apologies for the inconvenience! <span style="font-family:sans-serif">&mdash; <span style="font-weight:bold">[[User:MusikAnimal|<span style="color:black; font-style:italic">MusikAnimal</span>]] <sup>[[User talk:MusikAnimal|<span style="color:green">talk</span>]]</sup></span></span> 17:57, 17 November 2025 (UTC) :::::::{{done}} The "Top 10 by added text" chart has been restored. That was easier to fix than I thought it'd be. [[phab:T407814]] is not fully resolved yet; We still need to give the same treatment to the [[xtools:topedits|TopEdits]] tool, but that seems less important right now so it can wait. Best, <span style="font-family:sans-serif">&mdash; <span style="font-weight:bold">[[User:MusikAnimal|<span style="color:black; font-style:italic">MusikAnimal</span>]] <sup>[[User talk:MusikAnimal|<span style="color:green">talk</span>]]</sup></span></span> 19:55, 17 November 2025 (UTC) ::::::::Thank you very much to both for the extra workload to restore it. And my sincere apologies for the 'nerves' when I saw it was gone. It is really a great help to have it available again! [[User:Xavier Dengra|Xavier Dengra]] ([[User talk:Xavier Dengra|talk]]) 14:34, 18 November 2025 (UTC) == Author link is broken == Phabricator ticket: {{Phabricator|T410474}} On English Wikipedia article [[:en:Water|Water]], the author links to [[:en:Drj:User:Drj|Drj:User:Drj]] instead [[:en:User:Drj|User:Drj]]. I am using Vector 2022 skin. [[User:Shushugah|Shushugah]] ([[User talk:Shushugah|talk]]) 01:56, 18 November 2025 (UTC) :Came here to say the same. It's been happening (on all articles and drafts, AFAICT) for a few days at least. :I also use Vector 2022, in case that's relevant. -- [[User:DoubleGrazing|DoubleGrazing]] ([[User talk:DoubleGrazing|talk]]) 10:40, 18 November 2025 (UTC) ::Same problem in Vector 2010. I think it`s the XTool api`s problem. [[User:ChasingAir|ChasingAir]] ([[User talk:ChasingAir|talk]]) 18:23, 18 November 2025 (UTC) :::I created {{Phabricator|T410474}} bug. [[User:Shushugah|Shushugah]] ([[User talk:Shushugah|talk]]) 01:05, 19 November 2025 (UTC) :Seems to be fixed now. -- [[User:DoubleGrazing|DoubleGrazing]] ([[User talk:DoubleGrazing|talk]]) 06:56, 19 November 2025 (UTC) == Errors on tool? == Hi... https://xtools.wmcloud.org/pageinfo/en.wikipedia.org/Poisoning_of_Abbot_Greenwell It's throwing the following: A fatal error has occurred within XTools. This has been automatically reported, but feel free to file a task on [https://phabricator.wikimedia.org/maniphest/task/create/?title=PLEASE%20REPLACE%20WITH%20A%20DESCRIPTION%20OF%20THE%20ERROR&priority=75&projects=XTools&description=```/var/www/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:%2079%20-%20An%20exception%20occurred%20while%20executing%20%27SELECT%20error,%20notice,%20found,%20name_trans%20AS%20name,%20prio,%20text_trans%20AS%20explanation%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20FROM%20s51080__checkwiki_p.cw_error%20a%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20JOIN%20s51080__checkwiki_p.cw_overview_errors%20b%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20WHERE%20a.project%20=%20b.project%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20AND%20a.project%20=%20?%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20AND%20a.title%20=%20?%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20AND%20a.error%20=%20b.id%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20AND%20a.ok%20=%200%27%20with%20params%20&#x5B;%22enwiki%22,%20%22Poisoning%20of%20Abbot%20Greenwell%22&#x5D;:SQLSTATE&#x5B;42S22&#x5D;:%20Column%20not%20found:%201054%20Unknown%20column%20%27a.project%27%20in%20%27WHERE%27```%0A%0AURL:%20https://xtools.wmcloud.org/pageinfo/en.wikipedia.org/Poisoning_of_Abbot_Greenwell%0A%0APlease%20provide%20any%20further%20details%20here%0A%0AXTools%20version:%203.22.4-43c7dc35 Phabricator] (requires a Wikimedia account). The server said: <code>An exception occurred while executing 'SELECT error, notice, found, name_trans AS name, prio, text_trans AS explanation FROM s51080__checkwiki_p.cw_error a JOIN s51080__checkwiki_p.cw_overview_errors b WHERE a.project = b.project AND a.project = ? AND a.title = ? AND a.error = b.id AND a.ok = 0' with params ["enwiki", "Poisoning of Abbot Greenwell"]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'a.project' in 'WHERE'</code> Thanks! [[User:Very Polite Person|Very Polite Person]] ([[User talk:Very Polite Person|talk]]) 18:24, 17 December 2025 (UTC) :Same problem for me. [[User:FrizzB|FrizzB]] ([[User talk:FrizzB|talk]]) 19:22, 17 December 2025 (UTC) ::Looking into it! <span style="font-family:sans-serif">&mdash; <span style="font-weight:bold">[[User:MusikAnimal|<span style="color:black; font-style:italic">MusikAnimal</span>]] <sup>[[User talk:MusikAnimal|<span style="color:green">talk</span>]]</sup></span></span> 20:59, 17 December 2025 (UTC) :::A temporary hotfix has been applied. I guess [[toolforge:checkwiki]] changed their schema. So the "Bugs" section of the Page History tool that at least partially was fed by CheckWiki is currently not working. <span style="font-family:sans-serif">&mdash; <span style="font-weight:bold">[[User:MusikAnimal|<span style="color:black; font-style:italic">MusikAnimal</span>]] <sup>[[User talk:MusikAnimal|<span style="color:green">talk</span>]]</sup></span></span> 21:03, 17 December 2025 (UTC) == 403 Forbidden error == When accessing the page https://xtools.wmcloud.org/pages/fa.wikipedia.org/persia, I receive a 403 Forbidden error. Why does this happen? [[user:Persia|<b style="color:#32cd32">Persia ☘</b>]] 16:42, 19 December 2025 (UTC) :As it says on that error page, ::{{tq|For performance reasons, the requested data is only available to logged-in users.}} :We do that for editors with many edits, because it takes more time to compile statistics about them. By requiring users to log in, we filter out a lot of the expensive traffic but still permit wikimedians to access these pages. — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 17:44, 26 December 2025 (UTC) == Error if I ask my created articles == Hi, knows anybody why comes an error, if I asked my created articles (de). [[xtools:pages/de.wikipedia.org/karlderkahle|Error - XTools]] A fatal error has occurred within XTools. This has been automatically reported, but feel free to file a task on [https://phabricator.wikimedia.org/maniphest/task/create/?title=PLEASE%20REPLACE%20WITH%20A%20DESCRIPTION%20OF%20THE%20ERROR&priority=75&projects=XTools&description=```/var/www/src/Twig/AppExtension.php:%20453%20-%20App\Twig\AppExtension::numberFormat():%20Argument%20#1%20($number)%20must%20be%20of%20type%20int|float,%20null%20given,%20called%20in%20/var/www/var/cache/prod/twig/47/474960ad8913773c49afdf4949fc18d3.php%20on%20line%20278%60%60%60%0A%0AURL:%20https://xtools.wmcloud.org/pages/de.wikipedia.org/karlderkahle%0A%0APlease%20provide%20any%20further%20details%20here%0A%0AXTools%20version:%203.23.0-769d34fe Phabricator] (requires a Wikimedia account). The server said: <code>App\Twig\AppExtension::numberFormat(): Argument #1 ($number) must be of type int|float, null given, called in /var/www/var/cache/prod/twig/47/474960ad8913773c49afdf4949fc18d3.php on line 278</code> Thanks Karlderkahle [[User:Karlderkahle|Karlderkahle]] ([[User talk:Karlderkahle|talk]]) 11:13, 3 January 2026 (UTC) :{{tick}} '''Fixed''' (fix should be deployed at around 18:30 UTC). — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 18:22, 3 January 2026 (UTC) ::Thanks @[[User:Alien333|Alien333]] for the quick fix :) I wonder why we didn't get an email about this error… I feel like a lot of errors are getting suppressed! The [https://github.com/x-tools/xtools/blob/main/config/packages/prod/monolog.yaml monolog config] might need to be adjusted, or it could be an issue with the [https://github.com/x-tools/xtools/blob/main/src/EventSubscriber/ExceptionListener.php exception listener]. I suspect perhaps with the Symfony 6 upgrade, the [https://github.com/x-tools/xtools/blob/e911430e23468313b8e4de2267057a5d8d01a0f8/src/EventSubscriber/ExceptionListener.php#L112 Twig errors] aren't being handled properly. <span style="font-family:sans-serif">&mdash; <span style="font-weight:bold">[[User:MusikAnimal|<span style="color:black; font-style:italic">MusikAnimal</span>]] <sup>[[User talk:MusikAnimal|<span style="color:green">talk</span>]]</sup></span></span> 20:57, 3 January 2026 (UTC) == authorship script throws error: Wikiwho API: Unknown == If I go to https://xtools.wmcloud.org/authorship/de.wikipedia.org/Wikipedia?uselang=en, i get the message: * "Error querying Wikiwho API: Unknown" -- [[User:Lustiger seth|seth]] ([[User talk:Lustiger seth|talk]]) 22:46, 7 January 2026 (UTC) :The [[WikiWho]] service went down due to low disk space. I happened to find time to take care of it, so I think we're okay for now. CC @[[User:Alien333|Alien333]] who is taking over tending to XTools while I'm on sabbatical. If you run into such issues with [[xtools:authorship]] or [[xtools:blame]], refer to the point-persons for [[WikiWho]] as listed at [[phab:E1926]]. :To @[[User:Ragesoss|Ragesoss]] @[[User:TheresNoTime|TheresNoTime]] (who have [[toolforge:openstack-browser/project/wikiwho|server access]]): The above report was about disk space on <code>wikiwho01</code> itself (not the pickle storage). I deleted some old logs, reduced log rotation to every 3 days instead of 7. ''However'', I noticed the main <code>pickles</code> volume is now '''99% full'''! I am on sabbatical/wikibreak until March 1. I can ''try'' to help in the next week if you ''really'' need me, but if either of you could please try to reserve time for [[phab:T407660]] in the near future, that'd prevent a lot of users from becoming very unhappy :) I apologize for not tending to this before going on my break. If you need to reach me, [[Special:EmailUser/MusikAnimal]] is the preferred way, as I'm not checking the wikis much. I can also hop on IRC if requested. Thanks in advance! <span style="font-family:sans-serif">&mdash; <span style="font-weight:bold">[[User:MusikAnimal|<span style="color:black; font-style:italic">MusikAnimal</span>]] <sup>[[User talk:MusikAnimal|<span style="color:green">talk</span>]]</sup></span></span> 23:45, 8 January 2026 (UTC) ::Thanks @[[User:MusikAnimal|MusikAnimal]]! I will give it a go either tomorrow or early next week. Worst case scenario, we can just delete some of the pickles that haven't been touched in a while as a stopgap. (Any that get requested would get rebuilt on-demand, so it shouldn't cause much problems for end-users.) [[User:Ragesoss|Ragesoss]] ([[User talk:Ragesoss|talk]]) 00:08, 9 January 2026 (UTC) ::Thanks a lot! :-) ::-- [[User:Lustiger seth|seth]] ([[User talk:Lustiger seth|talk]]) 07:57, 9 January 2026 (UTC) == Number of edits in that size change interval, in bytes* (>10kb) == Number of edits in that size change interval, in bytes* (>10kb) The bar chart can be dynamically changed, or more detailed bar charts can be added. This bar chart can only display up to 10kb, but since almost all of my edits are larger than 10kb, this bar chart displays almost no information. I don't know how many edits are 10kb, 20kb, 30kb, 100kb, 200kb, 600kb, or 800kb. [[User:Gedu11539381|Gedu11539381]] ([[User talk:Gedu11539381|talk]]) 19:24, 21 January 2026 (UTC) :Hello. That's tracked at [[phab:T394606]]. :The main issue would be: How would users input what they want? We can't vary all parameters. The way it currently works is doing 10 * powers of 2. We could make that 10 vary possibly. But I'm unsure how on the user interface side we could say this in an understandable way. :Suggestions are of course welcome (especially given you have the user-facing perspective I don't necessarily have). :Cheers, — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 19:18, 22 January 2026 (UTC) == Support for edit counts over 1,000,000 == Is there a reason that edit counts over 1,000,000 are not supported? That seems like a surprisingly low threshold that could be raised at this time? [[User:Zackmann08|Zackmann08]] ([[User talk:Zackmann08|talk]]) 20:01, 18 February 2026 (UTC) :(Calling 1M "a surprisingly low threshold" is certainly a well... original perspective knowing there are a mere 18 people on enwiki (the largest wiki) that are above it? A million edits is a rather absurd number.) :Users with many edits make for long-running queries which slow down the service. (These can take like more than 15 minutes.) :We do keep in mind the eventual possibility of raising the limits and have been discussing it (more or less) lately (esp. in the light of having gotten rid of most of our crawler problems). — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 18:52, 7 March 2026 (UTC) ::{{ping|Alien333}} forgive me, first for taking so long to return to this thread... but also for my statement that it was surprisingly low threshold. I should say ''surprising to me'', which obviously conveys my lack of understanding of the service and how it works. Full disclosure I am rapidly approaching the 1,000,000 mark and will be sad to no longer be able to see my stats on Xtools as those are always entertaining to see. ::Wondering if there is a middle ground here that is more technically feasible? For example, allowing for viewing ''more'' of the stats for those over 1 million, while also not generating the full stats that are shown for those under 1 million? I.E. expanding the so called "simple counter"? Even if just the General Statistics section could be retained that would be awesome. That being said, I do respect that asking for a huge feature that ('''at the moment''') would only help under 2 dozen editors is probably not a high priority! [[User:Zackmann08|Zackmann08]] ([[User talk:Zackmann08|talk]]) 03:24, 3 May 2026 (UTC) ::: There are multiple things we could try to deal with these situations, of which [[phab:T182182]] is probably the most easily doable one, but I'd be lying if I said we're going to deal with it soon.<br> Cheers, — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 10:26, 3 May 2026 (UTC) ::::Well I hope one day it is ''fixed'' but totally understand it isn't a priority, [[User:Zackmann08|Zackmann08]] ([[User talk:Zackmann08|talk]]) 15:57, 3 May 2026 (UTC) == Bug in xtools/blame == I get the Error „Error querying Wikiwho API: Unknown“ in xtools/blame. Can you help, please? --[[User:IsUpper|IsUpper]] ([[User talk:IsUpper|talk]]) 13:49, 14 March 2026 (UTC) :Fixed now. — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 22:16, 14 March 2026 (UTC) ::Thanks! [[User:IsUpper|IsUpper]] ([[User talk:IsUpper|talk]]) 22:43, 14 March 2026 (UTC) == Average edit size == Is it possible to get a list of editors by Average edit size? (E.g. on wikipedia) To track deletions over time? I'm curious how extraordinary an editor's deletion streak is. They have a large negative average edit size. FYI @[[User:Voorts|Voorts]] may interest you. [[User:RememberOrwell|RememberOrwell]] ([[User talk:RememberOrwell|talk]]) 00:21, 26 March 2026 (UTC) :Well, making a list doesn't look like a job for XTools? That would mean a very long-running query and checking every single editor everywhere seems infeasible. — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 15:48, 28 March 2026 (UTC) ::Thanks. Maybe I'm asking in the wrong place. Any ideas on where to ask, anyone? ::Agree-doesn't make sense as something that is run on demand. But it does as something run periodically; we have other stats like that being maintained, IIRC. I asked here because Xtools does display Average edit size. [[User:RememberOrwell|RememberOrwell]] ([[User talk:RememberOrwell|talk]]) 19:26, 28 March 2026 (UTC) ::Yeah, https://stats.wikimedia.org/#/en.wikipedia.org/contributing/top-editors/normal|table|last-month|~total|monthly is top editors. Top deleters would be similar and close to what I'm interested in. ::I asked at [[Talk:Statistics#Looking_for_Average_edit_size_or_top_deleters_stats]]. [[User:RememberOrwell|RememberOrwell]] ([[User talk:RememberOrwell|talk]]) 19:37, 28 March 2026 (UTC) :::Could be done through eg through [[quarry:]] if you have some SQL knowledge, but I haven't tried. — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 20:26, 28 March 2026 (UTC) ::::Thanks again. ::::https://quarry.wmcloud.org/query/80687 looks like a start. + https://quarry.wmcloud.org/query/87216 turns #s into editor names. Beyond me at the moment, maybe I'll try AI as suggested at [[Talk:Quarry]]. Not today. [[User:RememberOrwell|RememberOrwell]] ([[User talk:RememberOrwell|talk]]) 01:32, 29 March 2026 (UTC) == Feature request : show the complete list of most viewed articles from a user == Hello, I would love to have an option to see the exhaustive list a user's articles sorted by numbers of views. Right now the only thing like this is the "your impact" box on my wikipedia profile but it only shows me the top 5. Do you think it would be possible ? Thank you for Xtools ! [[User:TyranCometh|TyranCometh]] ([[User talk:TyranCometh|talk]]) 12:09, 17 April 2026 (UTC) :Well, I was about to say we couldn't, but there ''is'' [[m:Pageviews Analysis#Massviews|massviews]]. We'll look into it. — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 09:57, 26 April 2026 (UTC) ::Thanks ! I'll look forward to it [[User:TyranCometh|TyranCometh]] ([[User talk:TyranCometh|talk]]) 11:01, 26 April 2026 (UTC) ::: I'm sorry, but looking into it closer massviews is too slow for us to use it for this purpose. So in the end it won't be possible. — [[User:Alien333|Alien]] [[User talk:Alien333|<b style="display:inline-block;line-height:100%;font-size:60%;background-image:linear-gradient(90deg,#007,#077,#070);background-clip:text;color:transparent">&ensp;3<br/>3 3</b>]] 10:30, 3 May 2026 (UTC) 9tgu82fhv21g74pzpi8rkdg7cj32hpf Category:SVG extensions/vi 14 2100348 8364470 6937044 2026-05-03T15:51:17Z Hiyuune 17854348 Created page with "'''Xem thêm:'''" 8364470 wikitext text/x-wiki <languages/> '''Xem thêm:''' <div lang="en" dir="ltr" class="mw-content-ltr"> * [[w:Wikipedia:Graphic Lab/Resources/SVG resources|Wikipedia:Graphic Lab/Resources/SVG resources]] </div> [[Category:Image extensions{{#translation:}}]] [[Category:SVG{{#translation:}}]] r6uv44bx45109l2c9pe6rbhjj21kzcg 8364472 8364470 2026-05-03T15:51:34Z Hiyuune 17854348 Created page with "* [[w:Wikipedia:Graphic Lab/Resources/SVG resources|Wikipedia:Graphic Lab/Resources/SVG resources]]" 8364472 wikitext text/x-wiki <languages/> '''Xem thêm:''' * [[w:Wikipedia:Graphic Lab/Resources/SVG resources|Wikipedia:Graphic Lab/Resources/SVG resources]] [[Category:Image extensions{{#translation:}}]] [[Category:SVG{{#translation:}}]] bev4l0um343r062adddouwpbbpr9ggl Category:SVG/vi 14 2100349 8364468 6937045 2026-05-03T15:50:44Z Hiyuune 17854348 Created page with "Xem thêm $meta" 8364468 wikitext text/x-wiki <languages/> Xem thêm [[meta:Category:SVG]] [[Category:MediaWiki components{{#translation:}}]] [[Category:MediaWiki development{{#translation:}}]] 5qcp71rv2ybf31zzmij5rnmtbqsp3ph Category:Link templates/vi 14 2100493 8364483 7961184 2026-05-03T15:56:49Z Hiyuune 17854348 Created page with "$1" 8364483 wikitext text/x-wiki <languages /> [[Category:Templates by style{{#translation:}}]] n1ljatm5f5cr1iy8oss1jd5wkub8yn2 Extension talk:NamespacePaths 103 2144814 8365144 7106198 2026-05-04T11:58:43Z ~2026-26696-50 18367213 /* MainPageIsDomainRoot Overwritten */ new section 8365144 wikitext text/x-wiki {{Flow-enabled}} == Configuration == Hi, {{FlowMention|Dantman}} Could you provide an example how to configure this extension? What to put in $wgNamespacePaths and htaccess? I'm not exactly a programmer but I need an extension like that and I can't figure it out myself. [[User:Cristal01|Cristal01]] ([[User talk:Cristal01|talk]]) 23:24, 3 May 2018 (UTC) :Interesting question. I'd e.g. go for this: :; LocalSettings.php :<syntaxhighlight lang="php"> $wgArticlePath = "/wiki/$1"; $wgNamespacePaths = [ NS_FILE => "/wiki/file/$1", NS_HELP => "/wiki/help/$1" ]; </syntaxhighlight> :; .htaccess :<syntaxhighlight lang="apache"> <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^/?wiki/file(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L] RewriteRule ^/?wiki/help(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L] RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L] RewriteRule ^/?$ %{DOCUMENT_ROOT}/w/index.php [L] </IfModule> </syntaxhighlight> :If this is not working I do not know. Still Dantman may comment. :) [[User:Kghbln|&#91;&#91;kgh&#93;&#93;]] ([[User talk:Kghbln|talk]]) 06:44, 4 May 2018 (UTC) == more Variable == an option to make it more variable would be pleasing. Namespaces as subdomain for example and no need to hardwire the <nowiki> NS_FILE => "/wiki/file/$1", NS_HELP => "/wiki/help/$1"</nowiki> would be nice. Actual every addition of namespaces need an modification of the config, it would be awesome that it isn't needed in future versions. I use several, a couple douzen, to set all manually shouldn't be the way to go. [[User:Gunnar.offel|Gunnar.offel]] ([[User talk:Gunnar.offel|talk]]) 10:10, 5 December 2020 (UTC) == Undesired changes to keys defined in $wgNamespacePaths when extension is active == To summarize: After having a wiki updated from 1.35 to 1.39, in which the configuration was working just fine, the keys pointing to custom namespaces somehow get themselves chanted into zero-indexed integers, as though the values are stored in a regular array. With $wgNamespacePaths as configured, assuming that NS_FOO = 3000 and NS_BAR = 3002: '''LocalSettings.php''' <pre> $wgArticlePath = "/$1"; $wgNamespacePaths = [ NS_FOO => "/foo/$1", NS_BAR => "/bar/$1" ]; </pre> The associative array as evaluated is expected to return <pre> Array ( [3000] => /foo/$1 [3002] => /bar/$1 ) </pre>However, with the extension active, the actual outcome gives me <pre> Array ( [0] => /foo/$1 [1] => /bar/$1 ) </pre> thereby causing these short links to point to the wrong namespaces in that manner. <s>With all these taken into account, did I misconfigure anything, or am I missing something, or does the extension have an existing issue that has yet to be fixed? If it's any of the former two, how do I go along with solving the problem in question?</s> UPDATE: I found out the underlying cause, that being the absence of <code>"merge_strategy": "array_plus"</code> to be specified in the NamespacePaths config of extension.json. [[User:UniversalEntropy|UniversalEntropy]] ([[User talk:UniversalEntropy|talk]]) 12:06, 28 March 2023 (UTC) :I also had this issue in MediaWiki 1.41. :Apparently fixed by adding to extensions/NamespacePaths/extension.json :in the section "config"/"NamespacePaths", the key-value pair "merge_strategy": "array_plus" :Thanks, UniversalEntropy, for the help! [[Special:Contributions/95.98.134.109|95.98.134.109]] ([[User talk:95.98.134.109|talk]]) 11:14, 31 March 2024 (UTC) == example.com/foo/ vs example.com/foo == I notice that example.com/foo works great with namespaces, but example.com/foo/ returns an error page, which is not preferred: "Bad title The requested page title is empty or contains only the name of a namespace." I can assume it is requesting the page Foo: Does anybody have a reliable correction for this? [[Special:Contributions/95.98.134.109|95.98.134.109]] ([[User talk:95.98.134.109|talk]]) 11:18, 31 March 2024 (UTC) == MainPageIsDomainRoot Overwritten == When I have $wgNamespacePaths set, then my main page is no longer the domain root. It doesn't matter if I define $wgMainPageIsDomainRoot before or after $wgNamespacePaths. Is there a way to have my main page as the domain root and use this extension? I'm using MediaWiki 1.43.8. <pre> $wgNamespacePaths = [NS_MAIN => "/example/$1/"]; $wgMainPageIsDomainRoot = true;</pre> [[Special:Contributions/&#126;2026-26696-50|&#126;2026-26696-50]] ([[User talk:&#126;2026-26696-50|talk]]) 11:58, 4 May 2026 (UTC) 24v4dr2ui5lpuq0hav2ks954g6j9iju Extension talk:QuickInstantCommons 103 2151878 8364488 8352163 2026-05-03T16:13:41Z Bawolff 24267 /* .tif files are not displayed */ Reply 8364488 wikitext text/x-wiki {{Flow-enabled}} == PHP warning == {{Archive top|status=resolved}} Couldn't find the issue tracker for this ext, so posting this here. I enabled the extension on an instance of MW 1.36.2, PHP 7.4.25. When viewing pages with Commons imagery I get the following error message at the top of the page: Warning: curl_multi_setopt(): CURLPIPE_HTTP1 is no longer supported in /var/www/html/extensions/QuickInstantCommons/src/MultiHttpClient.php on line 532 More version information: https://nonsa.pl/wiki/Specjalna:Wersja?uselang=en [[User:Ostrzyciel|Ostrzyciel]] ([[User talk:Ostrzyciel|talk]]) 10:36, 15 November 2021 (UTC) :Oh you have a newer version of curl than me. It should be safe to ignore that warning, i'll commit a fix this evening. (The 3 should be a 2 on line 532) [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 17:05, 15 November 2021 (UTC) :This should be fixed now [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 01:35, 16 November 2021 (UTC) {{Archive bottom}} == Translation link is not suitable == {{Archive top|result=Now on translatewiki|status=resolved}} Code[1] shows there are 2 messages but the link[2] shows nothing of them. 1: https://github.com/wikimedia/mediawiki-extensions-QuickInstantCommons/blob/HEAD/i18n/en.json 2: https://translatewiki.net/wiki/Special:Translate/ext-quickinstantcommons [[User:Lens0021|Lens0021]] ([[User talk:Lens0021|talk]]) 02:21, 20 November 2021 (UTC) :I'm looking into how to get the extension added to translate wiki. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 04:30, 21 November 2021 (UTC) :You can use [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=translatewiki.net&description=%3D%3D%20Project%20information%0A**Name**%3A%20%0A**Homepage**%3A%20%0A**Project%20link**%3A%20%0A**Code%20repository**%3A%20%0A-%20Source%20branch%3A%20%7BRepo%20branch%20from%20where%20the%20latest%20translations%20are%20imported%7D%0A-%20Target%20branch%3A%20%7BRepo%20branch%20to%20which%20translations%20are%20submitted%3B%20usually%20the%20same%20as%20Source.%20Please%20ensure%20translatewiki%20has%20permissions%20to%20push%20changes%20here%7D%0A**OS%20License**%3A%0A**Issue%20Tracker**%3A%0A**Project%20contact**%3A%20%7BUser%20account%20on%20Translatewiki.net%20%2F%20Email%7D%0A%0A**Logo**%3A%0A*%20Without%20text%3A%20%0A*%20With%20text%3A%0A%0A**Project%20description**%3A%20%0A%7BDESCRIPTION%20GOES%20HERE%7D%0A%0ANOTE%3A%20Section%20below%20will%20be%20filled%20by%20twn%20staff%0A%0A%3D%3D%20Project%20setup%20checklist%0A%5B%20%5D%20Project%20information%20(see%20template%20above)%0A%5B%20%5D%20Content%20fit%0A%5B%20%5D%20Quality%20of%20strings%0A%5B%20%5D%20Message%20documentation%0A%5B%20%5D%20Activity%0A%5B%20%5D%20File%20format%3A%20%0A%5B%20%5D%20Commit%20access%0A%5B%20%5D%20Update%20%5B%5B%20https%3A%2F%2Ftranslatewiki.net%2Fwiki%2FProject%3ANews%20%7C%20Translatewiki.net%20news%20%5D%5D%0A%5B%20%5D%20Update%20%5B%5B%20https%3A%2F%2Ftranslatewiki.net%2Fwiki%2FGroup_descriptions%20%7C%20Translatewiki.net%20group%20description%20%5D%5D%20%0A%5B%20%5D%20Create%20project%20page%0A%0A%3D%3D%20Project%20configuration%20(for%20translation%20admins)%0ANamespace%3A%0APrefix%3A%0AValidators%3A%0ASupport%3A%0A%0A%3D%3D%3D%20Concerns&title=Add%20%7BPROJECT%7D%20to%20translatewiki.net this task template] as described in https://translatewiki.net/wiki/Translating:New_project! [[User:Lens0021|Lens0021]] ([[User talk:Lens0021|talk]]) 04:32, 21 November 2021 (UTC) :Thanks, I was looking for something like that. All I could find was [[translatewiki:Translating:MediaWiki#Extensions]]. :I'll update [[phab:T296142]] with the extra info [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 04:50, 21 November 2021 (UTC) :{{done}} [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 23:04, 21 November 2021 (UTC) {{Archive bottom}} == Git reference than "master" == {{Archive top|status=resolved}} Hi, I am considering trying this extension on the production of [[Femiwiki]] which is a small wiki that has an average of 5000 visitors daily. But I couldn't find tags or deterministic branches. Could I ask you to add the tag "1.0" to the repository? [[User:Lens0021|Lens0021]] ([[User talk:Lens0021|talk]]) 02:36, 20 November 2021 (UTC) :There should now be a "v1.1" tag [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 04:29, 21 November 2021 (UTC) :Thank you! QuickInstantCommons is just installed in FemiWiki (https://femiwiki.com/w/Special:Version#mw-version-ext-other-QuickInstantCommons) [[User:Lens0021|Lens0021]] ([[User talk:Lens0021|talk]]) 21:15, 21 November 2021 (UTC) :Awesome! Let me know if you run into any issues or if any of the image performance is less than expected. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 23:05, 21 November 2021 (UTC) {{Archive bottom}} == Thank you for this great extension == Hi, hopes you are doing well. This extension is a life saver, and absolutely the best extension for commons, I've tried it and it works like magic. I have a small issue related to thumbs, if another api repo is used, for instance: <code>'apibase' => 'en.wikipedia.org/w/api.php',</code> then: <code>'thumbUrl' => 'upload.wikimedia.org/wikipedia/commons/thumb',</code> It won't load thumbs of en.wikipedia.org when the image is only available for that particular wiki(en), where the thumb url has to be like: <code>upload.wikimedia.org/wikipedia/en</code> instead of <code>upload.wikimedia.org/wikipedia/commons</code> At the same time, all thumbs that are presented on commons are just loading fine. changing the thumbUrl to <code>upload.wikimedia.org/wikipedia/en</code> solved the problem of thumbs on en.wikipedia but created another problem for thumbs on commons, and thumbs on commons will not load because of url. This sounds a bit tricky to me, you might be able to solve it, since you are the master of this extension. Thank you very much. [[Special:Contributions/2001:8F8:1E6D:72D2:4DD7:3397:2DCD:1F2D|2001:8F8:1E6D:72D2:4DD7:3397:2DCD:1F2D]] ([[User talk:2001:8F8:1E6D:72D2:4DD7:3397:2DCD:1F2D|talk]]) 07:30, 17 December 2021 (UTC) :Oh hmm, i forgot about the case where there are layered repos like wikipedia. :If you set <code>transformVia404 => false</code> it should work for this case, but it won't be as fast (should still be an improvement over mediawikis built in support, but not quite by the same amount) [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 03:46, 18 December 2021 (UTC) :Is it a bug that you have to work it out, or additional feature that need to take place? Thank you [[Special:Contributions/2001:8F8:1E6D:72D2:5C94:A1C3:6BA1:9011|2001:8F8:1E6D:72D2:5C94:A1C3:6BA1:9011]] ([[User talk:2001:8F8:1E6D:72D2:5C94:A1C3:6BA1:9011|talk]]) 07:29, 18 December 2021 (UTC) :By the way Setting transformVia404 => false, killed the performance, it's just like normal instant commons now. [[Special:Contributions/2001:8F8:1E6D:72D2:5C94:A1C3:6BA1:9011|2001:8F8:1E6D:72D2:5C94:A1C3:6BA1:9011]] ([[User talk:2001:8F8:1E6D:72D2:5C94:A1C3:6BA1:9011|talk]]) 07:32, 18 December 2021 (UTC) :Hi, :I made a new version of the extension. :In the new version, if you set thumbUrl to false, it should auto-detect the proper one and work in this situation even when transformVia404 is true (so at full speed). :I also fixed the description fetching, so it should now be able to fetch descriptions form both commons and wikipedia. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 21:37, 23 December 2021 (UTC) :Thank you very much. I will try it now [[Special:Contributions/2001:8F8:1E6D:72D2:ED:DE30:6A50:5078|2001:8F8:1E6D:72D2:ED:DE30:6A50:5078]] ([[User talk:2001:8F8:1E6D:72D2:ED:DE30:6A50:5078|talk]]) 06:02, 27 December 2021 (UTC) :Things are great, i have one more issue related to local images, it is a case were images are stored on local wiki, those images are not loading at all. can you try to address this issue please. for instance, images from commons, wikipedia are working, but local images not. [[Special:Contributions/2001:8F8:1E6D:72D2:ED:DE30:6A50:5078|2001:8F8:1E6D:72D2:ED:DE30:6A50:5078]] ([[User talk:2001:8F8:1E6D:72D2:ED:DE30:6A50:5078|talk]]) 06:13, 27 December 2021 (UTC) :That's odd, the extension shouldn't affect local images in any way. :I tried on my test wiki, and local images seem to work fine. :Can you check to make sure that when you disable the extension, local images start to work again (In order to rule out other causes). :Are there any php errors or warnings being generated? :Do you have any non-default settings for local images (In case there is some weird interaction) :If you go to mywiki.com/w/thumb.php?f=Local_File_Name_with_No_namespace.png&w=102 - does it thumbnail the image. If it doesn't, does it give a specific error message? [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 23:34, 27 December 2021 (UTC) :You are right, that was because of one setting, that changed the url. xd; :<nowiki>#</nowiki>$wgUploadPath = "$wgScriptPath/img_auth.php"; :all went back to normal after disabling it [[Special:Contributions/2001:8F8:1E6D:72D2:61C3:2D42:4213:4A8E|2001:8F8:1E6D:72D2:61C3:2D42:4213:4A8E]] ([[User talk:2001:8F8:1E6D:72D2:61C3:2D42:4213:4A8E|talk]]) 10:39, 28 December 2021 (UTC) :I noticed another issue related to image that is redirected to another image in commons, :for instance: if you call File:Lua-logo-nolabel.svg, which is redirecting to File:Lua-Logo.svg, image will not show, it looks like it is fetching the wrong thumb or url of the old file: :<code>upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Lua-logo-nolabel.svg/300px-Lua-logo-nolabel.svg.png</code> :while it has to fetch this file :<code>upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Lua-Logo.svg/30px-Lua-Logo.svg.png</code> [[Special:Contributions/2001:8F8:1E6D:72D2:61C3:2D42:4213:4A8E|2001:8F8:1E6D:72D2:61C3:2D42:4213:4A8E]] ([[User talk:2001:8F8:1E6D:72D2:61C3:2D42:4213:4A8E|talk]]) 10:58, 28 December 2021 (UTC) :hmm. The MediaWiki api doesn't seem to report the image is redirect if its not local. (e.g. compare https://en.wikipedia.org/w/api.php?titles=File%3ALua-logo-nolabel.svg&iiprop=timestamp|user|comment|url|size|sha1|mime|mediatype&prop=imageinfo&format=json&action=query&redirects=true&uselang=en vs https://commons.wikimedia.org/w/api.php?titles=File%3ALua-logo-nolabel.svg&iiprop=timestamp|user|comment|url|size|sha1|mime|mediatype&prop=imageinfo&format=json&action=query&redirects=true&uselang=en ) so the extension doesn't realize that the file is a redirect, and gets confused. :I tried filing [[phab:T298358]] but I'm not hopeful that it will be fixed anytime soon, so I'll have to try and think of some other work-around. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 01:23, 29 December 2021 (UTC) :Ok, i think i found a work around, try the new version. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 02:43, 29 December 2021 (UTC) :I am really sorry Bawolff, i didn't meant to make all this troubles to you. I've read the phabricator post, i which this can be implemented soon. your solution is working and tested. I will keep an eye on this extension and report to you. [[Special:Contributions/2001:8F8:1E6D:72D2:89B6:46B2:F904:4A86|2001:8F8:1E6D:72D2:89B6:46B2:F904:4A86]] ([[User talk:2001:8F8:1E6D:72D2:89B6:46B2:F904:4A86|talk]]) 06:57, 29 December 2021 (UTC) :No problem at all. I'm just happy someone is using it and testing it. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 10:13, 29 December 2021 (UTC) :This should really become part of core. Page that was loading slowly and caused timeouts for backend cache response is no longer issue. Is this also speeding up Preview extension? [[User:Pspviwki|Pspviwki]] ([[User talk:Pspviwki|talk]]) 12:41, 26 January 2022 (UTC) == Problem rendering TIF files == Hi, I've noticed that after enabling QuickInstantCommons, TIF files from Commons stopped displaying in articles. See for example this page https://nonsa.pl/wiki/Patelnia with this image https://nonsa.pl/n/A3 I'm not sure why that is, but I suspect it may have something to do with TIF thumbnails having a different extension than the original file, they use <code>.tif.jpg</code>. [[User:Ostrzyciel|Ostrzyciel]] ([[User talk:Ostrzyciel|talk]]) 08:44, 20 December 2021 (UTC) :I think i found the culprit. In TiffHandler.php in MW core it hard codes built in InstantCommons. :<syntaxhighlight lang='text'> public function canRender( $file ) { global $wgTiffThumbnailType; return (bool)$wgTiffThumbnailType || $file->getRepo() instanceof ForeignAPIRepo; } </syntaxhighlight> :'''sigh''' [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 19:11, 23 December 2021 (UTC) :Ouch. :I managed to temporarily fix it by setting: :<code>$wgTiffThumbnailType = [ 'jpg', 'image/jpeg' ];</code> :Sooo thanks for the hint! ;) [[User:Ostrzyciel|Ostrzyciel]] ([[User talk:Ostrzyciel|talk]]) 20:49, 23 December 2021 (UTC) :I made a new version (version 1.2) that will ignore built in tiff handler. :I don't think $wgTiffThumbnailType = [ 'jpg', 'image/jpeg' ]; should work (unless transformVia404 is false) because commons uses PagedTiffHandler instead which uses an incomaptible url format. :I think for best results, install PagedTiffHandler extension so it matches the one used on commons, but the new version should work regardless. :I've also been told there are issues with TimedMediaHandler files. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 21:36, 23 December 2021 (UTC) == help with ogv file type == <span class="mw-default-size"><span>[[File:Play_fight_of_polar_bears_edit_1.ogv|384x384px]]</span></span> The attached example video from commons is just working good, but when using this extensions, i got a message saying (Error missing media source), while i have timed media handler installed. [[Special:Contributions/2001:8F8:1E6D:A884:D8AB:3E80:31ED:4D26|2001:8F8:1E6D:A884:D8AB:3E80:31ED:4D26]] ([[User talk:2001:8F8:1E6D:A884:D8AB:3E80:31ED:4D26|talk]]) 20:31, 17 January 2022 (UTC) :i think this is an issue with timedmediahandler. I don't think it works with normal instant commons either. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 01:16, 18 January 2022 (UTC) :it works with normal instant commons, i just did a test now. [[Special:Contributions/2001:8F8:1E6D:A884:D8AB:3E80:31ED:4D26|2001:8F8:1E6D:A884:D8AB:3E80:31ED:4D26]] ([[User talk:2001:8F8:1E6D:A884:D8AB:3E80:31ED:4D26|talk]]) 05:35, 18 January 2022 (UTC) :Hmm, you're right. :I made a change that should fix it ( https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TimedMediaHandler/+/756875 ) however the issue is in TimedMediaHandler extension, so I'm not sure how soon the maintainers of that will merge that change (or if they will) [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 06:58, 25 January 2022 (UTC) :I am sorry Bawolff, i am just working on testing as i promised you earlier, the good thing here that you solve the issues. [[Special:Contributions/2001:8F8:1E6D:53DC:853A:9508:C4AD:A5C1|2001:8F8:1E6D:53DC:853A:9508:C4AD:A5C1]] ([[User talk:2001:8F8:1E6D:53DC:853A:9508:C4AD:A5C1|talk]]) 07:18, 27 January 2022 (UTC) :I appreciate it :) :It just might take a bit longer to fix, because the issue isn't in my code, so I have to get other stakeholders on board, which can be a complicated process sometimes. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 08:05, 28 January 2022 (UTC) :I am watching those changes, but wondering whether they are applied to version 1.37 or only at the master branch. [[Special:Contributions/2001:8F8:1E6D:E155:6DBD:BAA4:5CA2:D6A9|2001:8F8:1E6D:E155:6DBD:BAA4:5CA2:D6A9]] ([[User talk:2001:8F8:1E6D:E155:6DBD:BAA4:5CA2:D6A9|talk]]) 11:00, 26 February 2022 (UTC) :Yes. it requires the "master" or "1.38" version of TimedMediaHandler. Its likely that version only works with the (yet unreleased) MediaWiki 1.38. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 06:53, 5 March 2022 (UTC) :Thank you Bawolff [[Special:Contributions/2001:8F8:1E6D:2802:A84E:54BC:CA12:8558|2001:8F8:1E6D:2802:A84E:54BC:CA12:8558]] ([[User talk:2001:8F8:1E6D:2802:A84E:54BC:CA12:8558|talk]]) 07:19, 5 March 2022 (UTC) == (No action needed) QuickInstantCommons is deployed by Miraheze wikis == Hi, I've noticed Miraheze wikis now using QuickInstantCommons and just want to share it with anyone interested. The related ticket was https://phabricator.miraheze.org/T8626 and you can see the usage on WikiApiary https://wikiapiary.com/wiki/Extension:QuickInstantCommons. Thank you. [[User:Lens0021|Lens0021]] ([[User talk:Lens0021|talk]]) 08:23, 27 January 2022 (UTC) :Awesome! If you encounter any bugs or issues please let me know. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 04:08, 28 January 2022 (UTC) == Logic Exception == Accessing "<code><nowiki>[[special:specialpages]]</nowiki></code>" when both InstantCommons and QuickInstantCommons are enabled produces the following error message: "Internal error: [ZB4h8wFwXxIU-rLZVpSjQQAAAAE] 2023-03-24 22:19:32: Fatal exception of type 'LogicException'". What I think happened is that I had MediaWiki initially configured with InstantCommons disabled and QuickInstantCommons enabled, using "<code>$wgForeignFileRepos</code>" to access content from Wikimedia Commons. I then disabled "<code>$wgForeignFileRepos</code>" for Wikimedia Commons and enabled InstantCommons instead, which apparently broke the QuickInstantCommons extension. I'll leave the configuration to use "<code>$wgForeignFileRepos</code>" instead of InstantCommons for accessing Wikimedia Commons content, but this appears to be a bug with QuickInstantCommons that prevents switching back and forth between InstantCommons and "<code>$wgForeignFileRepos</code>" for accessing Wikimedia Commons content. I am using MediaWiki 1.39.2 with PHP 8.2.0. [[User:Nicole Sharp|Nicole Sharp]] ([[User talk:Nicole Sharp|talk]]) 22:28, 24 March 2023 (UTC) :Its kind of unclear what you did here, but if you are using both [normal] instant commons and QuickInstantCommons, at least one of them has to be setup via $wgForeignFileRepos (Doesn't matter which, could be both), and the two of them have to have separate repo names. If you are setting one up with $wgForeignFileRepos you must ensure the repo name you chose is different from the repo name that is automatically setup for the other one. :If you use the same repo name in $wgForeignFileRepos for more than one foreign file repo, an error will be generated (Potentially this one, but set $wgShowExceptionDetails = true; to be sure). [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 23:41, 24 March 2023 (UTC) :Below is the syntax from "<code>LocalSettings.php</code>" that produces the error. InstantCommons is enabled but the "<code>ForeignFileRepos</code>" for Wikimedia Commons is disabled. Disabling InstantCommons and un-commenting "<code>ForeignFileRepos</code>" for Wikimedia Commons resolves the error. :<code><syntaxhighlight lang="php"> # To enable image uploads, make sure the "images" directory is writable, then set this to true: $wgEnableUploads = true; $wgUseImageMagick = true; $wgImageMagickConvertCommand = "/usr/bin/convert"; ## https://www.mediawiki.org/wiki/manual:$wgUploadDirectory $wgUploadDirectory = "{$IP}/uploads"; ## https://www.mediawiki.org/wiki/manual:$wgUploadPath $wgUploadPath = "$wgScriptPath/uploads"; # InstantCommons allows wiki to use images from: https://commons.wikimedia.org/ $wgUseInstantCommons = true; ## https://www.mediawiki.org/wiki/InstantCommons # https://www.mediawiki.org/wiki/Extension:QuickInstantCommons wfLoadExtension( 'QuickInstantCommons' ); # https://www.mediawiki.org/wiki/Manual:$wgForeignFileRepos#Usage # $wgForeignFileRepos[] = [ # 'class' => ForeignAPIRepo::class, # 'name' => 'commonswiki', # Must be a distinct name. # 'apibase' => 'https://commons.wikimedia.org/w/api.php', # 'hashLevels' => 2, # 'fetchDescription' => true, # Optional. # 'descriptionCacheExpiry' => 43200, # 12 hours, optional (values are seconds). # 'apiThumbCacheExpiry' => 86400, # 24 hours, optional, but required for local thumb caching. # ]; $wgForeignFileRepos[] = [ 'class' => ForeignAPIRepo::class, 'name' => 'enwikipedia', 'apibase' => 'https://en.wikipedia.org/w/api.php', 'hashLevels' => 2, 'fetchDescription' => true, 'descriptionCacheExpiry' => 43200, 'apiThumbCacheExpiry' => 86400, ]; </syntaxhighlight></code> :[[User:Nicole Sharp|Nicole Sharp]] ([[User talk:Nicole Sharp|talk]]) 00:18, 25 March 2023 (UTC) :This is covered on the extension page. If you want to use both you need to use the settings mentioned in the Advanced Configuration section. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 00:59, 25 March 2023 (UTC) :err nevermind, i thought the docs had something about this, but i guess it does not. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 01:00, 25 March 2023 (UTC) :Anyways this is expected behaviour, if you need to use both at the same time (probably not a good idea) use the settings suggested in the advanced configuration section. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 01:04, 25 March 2023 (UTC) == This commons files not working on either wikis?? help! == I keep getting this No file by this name exists message whlist entering file:flag of italy.svg page on this wikis, so any fix this!?!?!?!??! can you someone help me pls! [[User:ThatRobloxianuser2K6|ThatRobloxianuser2K6]] ([[User talk:ThatRobloxianuser2K6|talk]]) 03:48, 29 March 2024 (UTC) :The i in Italy needs to be capitalized [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 14:45, 29 March 2024 (UTC) == User-Agent == @[[User:Bawolff|Bawolff]] Hi! Appropedia.org uses the latest (master) version of this extension and recently (not sure exactly when) the images we use from Commons have started to fail with "429 Too Many Requests". I thought this might be related to the new [[Wikimedia APIs/Rate limits]] but I'm not sure. When I analyze a request to a broken image (for example at [[Appropedia:Water]]) I can see that the User-Agent is set to that of my browser. Judging by a quick look at the code of this extension, shouldn't it be set to something like "QuickInstantCommons/1.5.1 MediaWiki/1.43 etc"? I tried setting the (undocumented) config variables $wgQuickInstantCommonsUserAgentInfo and $wgQuickInstantCommonsUserAgentOverride but to no avail, the User-Agent doesn't change. I read your message on wikitech-l saying that you tried debugging on appropedia.org but were blocked by an unsolvable Cloudflare captcha. Not sure what happened but these days we've been under a lot of pressure due to some rouge bots and were forced to enable Cloudflare's "Under Attack Mode" and other security rules to mitigate. Perhaps you met one of those, but the situation should be under control and normalized now. Would you care to try again? If so, I'll be super grateful! In any case, thanks! [[User:Sophivorus|Sophivorus]] ([[User talk:Sophivorus|talk]]) 15:24, 6 March 2026 (UTC) :Same issue on Vikidia.org with the latest version of the plugin and $wgQuickInstantCommonsUserAgentInfo set to "https:fr.vikidia.org; <hidden email>". [[User:Linedwell|Linedwell]] ([[User talk:Linedwell|talk]]) 15:34, 10 March 2026 (UTC) :I think a custom user-agent is necessary, but not sufficient, with the current rate limits in place. The [[common thumbnail sizes]] work is very likely also impacting users of InstantCommons and QuickInstantCommons. I would recommend making sure you are running [[MediaWiki 1.44]] or newer and then setting <syntaxhighlight lang=php inline>$wgThumbnailSteps = [20, 40, 60, 120, 250, 330, 500, 960, 1280, 1920, 3840];</syntaxhighlight> and <syntaxhighlight lang=php inline>$wgThumbnailStepsRatio = 1;</syntaxhighlight> in your LocalSettings. These settings should make your MediaWiki emit HTML that puts whatever <code>width</code> and <code>height</code> is appropriate on generated <code><img/></code> tags while also selecting the exact match or next largest width from the step sizes for the image requested from upload.wikimedia.org. This has a bit of coverage in [[Extension:QuickInstantCommons#Advanced Configuration]] now, but the way those settings interact with MediaWiki and why it matters might not be easy to understand yet. -- [[User:BDavis (WMF)|BDavis (WMF)]] ([[User talk:BDavis (WMF)|talk]]) 20:03, 10 March 2026 (UTC) ::Hello and thanks for you kind help. I have added those 2 variables on my LocalSettings.php and it works for some images (but not all). On my side [[MediaWiki 1.44]] will never be installed as we only use LTS. Here are some images that doesn't work with QuickInstantCommons : [[:File:Persian in Cat Cafe.jpg]] or [[:File:Havana Brown - choco.jpg]] because their default width is not common (399px) [[User:Linedwell|Linedwell]] ([[User talk:Linedwell|talk]]) 13:26, 11 March 2026 (UTC) :::{{tq|On my side MediaWiki 1.44 will never be installed as we only use LTS.}} :::The <code>$wgThumbnailSteps</code> setting and the mechanism it uses behind the scenes to "bucket" image sizes was first introduced in 1.44. The setting will not change any system behavior if you are stuck running 1.43. -- [[User:BDavis (WMF)|BDavis (WMF)]] ([[User talk:BDavis (WMF)|talk]]) 21:28, 11 March 2026 (UTC) ::::@[[User:Linedwell|Linedwell]] I talked with some folks and got the enabling changes for <code>$wgThumbnailSteps</code> merged into the REL1_43 branch. The next 1.43 point release (1.43.7) should include the code your wiki will need to generate bucketed thumbnail size requests from an LTS release. Thanks for helping me realize this was a gap that would cause folks problems as they adapt to the new rate limits and other constraints on InstantCommons and QuickInstantCommons. -- [[User:BDavis (WMF)|BDavis (WMF)]] ([[User talk:BDavis (WMF)|talk]]) 17:09, 12 March 2026 (UTC) :::::In my case, upgrading to MediaWiki 1.45 seems to have solved the issue. [[User:Sophivorus|Sophivorus]] ([[User talk:Sophivorus|talk]]) 14:49, 13 March 2026 (UTC) :::::Thank you very much for the report of the changes into REL1_43. I will have a look into it. Have a very nice day and thanks again for your help. [[User:Linedwell|Linedwell]] ([[User talk:Linedwell|talk]]) 12:02, 22 March 2026 (UTC) == .tif files are not displayed == Hi, we are using the extension, version 1.5.1 (site version 1.45.3). We've noticed that .tif files from Commons are not being displayed ([http://www.hamichlol.org.il/file:Milwaukee_War_Memorial_Center,_Milwaukee,_Wisconsin,_1952-57._Exterior.tif example]). Is this an issue with the extension, or with how we've configured it? ping @[[User:Bawolff|Bawolff]]. Thanks, [[Special:Contributions/&#126;2026-24956-87|&#126;2026-24956-87]] ([[User talk:&#126;2026-24956-87|talk]]) 21:54, 23 April 2026 (UTC) :i think its a problem with the extension. I'm going to look into it further. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 00:26, 24 April 2026 (UTC) :Hi, Sorry for the delay. It was due to a problem with the PagedTiffHandler extension [https://gerrit.wikimedia.org/r/c/mediawiki/extensions/PagedTiffHandler/+/1281999]. The issue should be fixed now. Try redownloading the extension. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 16:13, 3 May 2026 (UTC) nemo6gkwht5usujuo2c87jl37ly2k42 8364619 8364488 2026-05-03T17:11:50Z Bawolff 24267 /* .tif files are not displayed */ 8364619 wikitext text/x-wiki {{Flow-enabled}} == PHP warning == {{Archive top|status=resolved}} Couldn't find the issue tracker for this ext, so posting this here. I enabled the extension on an instance of MW 1.36.2, PHP 7.4.25. When viewing pages with Commons imagery I get the following error message at the top of the page: Warning: curl_multi_setopt(): CURLPIPE_HTTP1 is no longer supported in /var/www/html/extensions/QuickInstantCommons/src/MultiHttpClient.php on line 532 More version information: https://nonsa.pl/wiki/Specjalna:Wersja?uselang=en [[User:Ostrzyciel|Ostrzyciel]] ([[User talk:Ostrzyciel|talk]]) 10:36, 15 November 2021 (UTC) :Oh you have a newer version of curl than me. It should be safe to ignore that warning, i'll commit a fix this evening. (The 3 should be a 2 on line 532) [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 17:05, 15 November 2021 (UTC) :This should be fixed now [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 01:35, 16 November 2021 (UTC) {{Archive bottom}} == Translation link is not suitable == {{Archive top|result=Now on translatewiki|status=resolved}} Code[1] shows there are 2 messages but the link[2] shows nothing of them. 1: https://github.com/wikimedia/mediawiki-extensions-QuickInstantCommons/blob/HEAD/i18n/en.json 2: https://translatewiki.net/wiki/Special:Translate/ext-quickinstantcommons [[User:Lens0021|Lens0021]] ([[User talk:Lens0021|talk]]) 02:21, 20 November 2021 (UTC) :I'm looking into how to get the extension added to translate wiki. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 04:30, 21 November 2021 (UTC) :You can use [https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=translatewiki.net&description=%3D%3D%20Project%20information%0A**Name**%3A%20%0A**Homepage**%3A%20%0A**Project%20link**%3A%20%0A**Code%20repository**%3A%20%0A-%20Source%20branch%3A%20%7BRepo%20branch%20from%20where%20the%20latest%20translations%20are%20imported%7D%0A-%20Target%20branch%3A%20%7BRepo%20branch%20to%20which%20translations%20are%20submitted%3B%20usually%20the%20same%20as%20Source.%20Please%20ensure%20translatewiki%20has%20permissions%20to%20push%20changes%20here%7D%0A**OS%20License**%3A%0A**Issue%20Tracker**%3A%0A**Project%20contact**%3A%20%7BUser%20account%20on%20Translatewiki.net%20%2F%20Email%7D%0A%0A**Logo**%3A%0A*%20Without%20text%3A%20%0A*%20With%20text%3A%0A%0A**Project%20description**%3A%20%0A%7BDESCRIPTION%20GOES%20HERE%7D%0A%0ANOTE%3A%20Section%20below%20will%20be%20filled%20by%20twn%20staff%0A%0A%3D%3D%20Project%20setup%20checklist%0A%5B%20%5D%20Project%20information%20(see%20template%20above)%0A%5B%20%5D%20Content%20fit%0A%5B%20%5D%20Quality%20of%20strings%0A%5B%20%5D%20Message%20documentation%0A%5B%20%5D%20Activity%0A%5B%20%5D%20File%20format%3A%20%0A%5B%20%5D%20Commit%20access%0A%5B%20%5D%20Update%20%5B%5B%20https%3A%2F%2Ftranslatewiki.net%2Fwiki%2FProject%3ANews%20%7C%20Translatewiki.net%20news%20%5D%5D%0A%5B%20%5D%20Update%20%5B%5B%20https%3A%2F%2Ftranslatewiki.net%2Fwiki%2FGroup_descriptions%20%7C%20Translatewiki.net%20group%20description%20%5D%5D%20%0A%5B%20%5D%20Create%20project%20page%0A%0A%3D%3D%20Project%20configuration%20(for%20translation%20admins)%0ANamespace%3A%0APrefix%3A%0AValidators%3A%0ASupport%3A%0A%0A%3D%3D%3D%20Concerns&title=Add%20%7BPROJECT%7D%20to%20translatewiki.net this task template] as described in https://translatewiki.net/wiki/Translating:New_project! [[User:Lens0021|Lens0021]] ([[User talk:Lens0021|talk]]) 04:32, 21 November 2021 (UTC) :Thanks, I was looking for something like that. All I could find was [[translatewiki:Translating:MediaWiki#Extensions]]. :I'll update [[phab:T296142]] with the extra info [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 04:50, 21 November 2021 (UTC) :{{done}} [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 23:04, 21 November 2021 (UTC) {{Archive bottom}} == Git reference than "master" == {{Archive top|status=resolved}} Hi, I am considering trying this extension on the production of [[Femiwiki]] which is a small wiki that has an average of 5000 visitors daily. But I couldn't find tags or deterministic branches. Could I ask you to add the tag "1.0" to the repository? [[User:Lens0021|Lens0021]] ([[User talk:Lens0021|talk]]) 02:36, 20 November 2021 (UTC) :There should now be a "v1.1" tag [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 04:29, 21 November 2021 (UTC) :Thank you! QuickInstantCommons is just installed in FemiWiki (https://femiwiki.com/w/Special:Version#mw-version-ext-other-QuickInstantCommons) [[User:Lens0021|Lens0021]] ([[User talk:Lens0021|talk]]) 21:15, 21 November 2021 (UTC) :Awesome! Let me know if you run into any issues or if any of the image performance is less than expected. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 23:05, 21 November 2021 (UTC) {{Archive bottom}} == Thank you for this great extension == Hi, hopes you are doing well. This extension is a life saver, and absolutely the best extension for commons, I've tried it and it works like magic. I have a small issue related to thumbs, if another api repo is used, for instance: <code>'apibase' => 'en.wikipedia.org/w/api.php',</code> then: <code>'thumbUrl' => 'upload.wikimedia.org/wikipedia/commons/thumb',</code> It won't load thumbs of en.wikipedia.org when the image is only available for that particular wiki(en), where the thumb url has to be like: <code>upload.wikimedia.org/wikipedia/en</code> instead of <code>upload.wikimedia.org/wikipedia/commons</code> At the same time, all thumbs that are presented on commons are just loading fine. changing the thumbUrl to <code>upload.wikimedia.org/wikipedia/en</code> solved the problem of thumbs on en.wikipedia but created another problem for thumbs on commons, and thumbs on commons will not load because of url. This sounds a bit tricky to me, you might be able to solve it, since you are the master of this extension. Thank you very much. [[Special:Contributions/2001:8F8:1E6D:72D2:4DD7:3397:2DCD:1F2D|2001:8F8:1E6D:72D2:4DD7:3397:2DCD:1F2D]] ([[User talk:2001:8F8:1E6D:72D2:4DD7:3397:2DCD:1F2D|talk]]) 07:30, 17 December 2021 (UTC) :Oh hmm, i forgot about the case where there are layered repos like wikipedia. :If you set <code>transformVia404 => false</code> it should work for this case, but it won't be as fast (should still be an improvement over mediawikis built in support, but not quite by the same amount) [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 03:46, 18 December 2021 (UTC) :Is it a bug that you have to work it out, or additional feature that need to take place? Thank you [[Special:Contributions/2001:8F8:1E6D:72D2:5C94:A1C3:6BA1:9011|2001:8F8:1E6D:72D2:5C94:A1C3:6BA1:9011]] ([[User talk:2001:8F8:1E6D:72D2:5C94:A1C3:6BA1:9011|talk]]) 07:29, 18 December 2021 (UTC) :By the way Setting transformVia404 => false, killed the performance, it's just like normal instant commons now. [[Special:Contributions/2001:8F8:1E6D:72D2:5C94:A1C3:6BA1:9011|2001:8F8:1E6D:72D2:5C94:A1C3:6BA1:9011]] ([[User talk:2001:8F8:1E6D:72D2:5C94:A1C3:6BA1:9011|talk]]) 07:32, 18 December 2021 (UTC) :Hi, :I made a new version of the extension. :In the new version, if you set thumbUrl to false, it should auto-detect the proper one and work in this situation even when transformVia404 is true (so at full speed). :I also fixed the description fetching, so it should now be able to fetch descriptions form both commons and wikipedia. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 21:37, 23 December 2021 (UTC) :Thank you very much. I will try it now [[Special:Contributions/2001:8F8:1E6D:72D2:ED:DE30:6A50:5078|2001:8F8:1E6D:72D2:ED:DE30:6A50:5078]] ([[User talk:2001:8F8:1E6D:72D2:ED:DE30:6A50:5078|talk]]) 06:02, 27 December 2021 (UTC) :Things are great, i have one more issue related to local images, it is a case were images are stored on local wiki, those images are not loading at all. can you try to address this issue please. for instance, images from commons, wikipedia are working, but local images not. [[Special:Contributions/2001:8F8:1E6D:72D2:ED:DE30:6A50:5078|2001:8F8:1E6D:72D2:ED:DE30:6A50:5078]] ([[User talk:2001:8F8:1E6D:72D2:ED:DE30:6A50:5078|talk]]) 06:13, 27 December 2021 (UTC) :That's odd, the extension shouldn't affect local images in any way. :I tried on my test wiki, and local images seem to work fine. :Can you check to make sure that when you disable the extension, local images start to work again (In order to rule out other causes). :Are there any php errors or warnings being generated? :Do you have any non-default settings for local images (In case there is some weird interaction) :If you go to mywiki.com/w/thumb.php?f=Local_File_Name_with_No_namespace.png&w=102 - does it thumbnail the image. If it doesn't, does it give a specific error message? [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 23:34, 27 December 2021 (UTC) :You are right, that was because of one setting, that changed the url. xd; :<nowiki>#</nowiki>$wgUploadPath = "$wgScriptPath/img_auth.php"; :all went back to normal after disabling it [[Special:Contributions/2001:8F8:1E6D:72D2:61C3:2D42:4213:4A8E|2001:8F8:1E6D:72D2:61C3:2D42:4213:4A8E]] ([[User talk:2001:8F8:1E6D:72D2:61C3:2D42:4213:4A8E|talk]]) 10:39, 28 December 2021 (UTC) :I noticed another issue related to image that is redirected to another image in commons, :for instance: if you call File:Lua-logo-nolabel.svg, which is redirecting to File:Lua-Logo.svg, image will not show, it looks like it is fetching the wrong thumb or url of the old file: :<code>upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Lua-logo-nolabel.svg/300px-Lua-logo-nolabel.svg.png</code> :while it has to fetch this file :<code>upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Lua-Logo.svg/30px-Lua-Logo.svg.png</code> [[Special:Contributions/2001:8F8:1E6D:72D2:61C3:2D42:4213:4A8E|2001:8F8:1E6D:72D2:61C3:2D42:4213:4A8E]] ([[User talk:2001:8F8:1E6D:72D2:61C3:2D42:4213:4A8E|talk]]) 10:58, 28 December 2021 (UTC) :hmm. The MediaWiki api doesn't seem to report the image is redirect if its not local. (e.g. compare https://en.wikipedia.org/w/api.php?titles=File%3ALua-logo-nolabel.svg&iiprop=timestamp|user|comment|url|size|sha1|mime|mediatype&prop=imageinfo&format=json&action=query&redirects=true&uselang=en vs https://commons.wikimedia.org/w/api.php?titles=File%3ALua-logo-nolabel.svg&iiprop=timestamp|user|comment|url|size|sha1|mime|mediatype&prop=imageinfo&format=json&action=query&redirects=true&uselang=en ) so the extension doesn't realize that the file is a redirect, and gets confused. :I tried filing [[phab:T298358]] but I'm not hopeful that it will be fixed anytime soon, so I'll have to try and think of some other work-around. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 01:23, 29 December 2021 (UTC) :Ok, i think i found a work around, try the new version. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 02:43, 29 December 2021 (UTC) :I am really sorry Bawolff, i didn't meant to make all this troubles to you. I've read the phabricator post, i which this can be implemented soon. your solution is working and tested. I will keep an eye on this extension and report to you. [[Special:Contributions/2001:8F8:1E6D:72D2:89B6:46B2:F904:4A86|2001:8F8:1E6D:72D2:89B6:46B2:F904:4A86]] ([[User talk:2001:8F8:1E6D:72D2:89B6:46B2:F904:4A86|talk]]) 06:57, 29 December 2021 (UTC) :No problem at all. I'm just happy someone is using it and testing it. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 10:13, 29 December 2021 (UTC) :This should really become part of core. Page that was loading slowly and caused timeouts for backend cache response is no longer issue. Is this also speeding up Preview extension? [[User:Pspviwki|Pspviwki]] ([[User talk:Pspviwki|talk]]) 12:41, 26 January 2022 (UTC) == Problem rendering TIF files == Hi, I've noticed that after enabling QuickInstantCommons, TIF files from Commons stopped displaying in articles. See for example this page https://nonsa.pl/wiki/Patelnia with this image https://nonsa.pl/n/A3 I'm not sure why that is, but I suspect it may have something to do with TIF thumbnails having a different extension than the original file, they use <code>.tif.jpg</code>. [[User:Ostrzyciel|Ostrzyciel]] ([[User talk:Ostrzyciel|talk]]) 08:44, 20 December 2021 (UTC) :I think i found the culprit. In TiffHandler.php in MW core it hard codes built in InstantCommons. :<syntaxhighlight lang='text'> public function canRender( $file ) { global $wgTiffThumbnailType; return (bool)$wgTiffThumbnailType || $file->getRepo() instanceof ForeignAPIRepo; } </syntaxhighlight> :'''sigh''' [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 19:11, 23 December 2021 (UTC) :Ouch. :I managed to temporarily fix it by setting: :<code>$wgTiffThumbnailType = [ 'jpg', 'image/jpeg' ];</code> :Sooo thanks for the hint! ;) [[User:Ostrzyciel|Ostrzyciel]] ([[User talk:Ostrzyciel|talk]]) 20:49, 23 December 2021 (UTC) :I made a new version (version 1.2) that will ignore built in tiff handler. :I don't think $wgTiffThumbnailType = [ 'jpg', 'image/jpeg' ]; should work (unless transformVia404 is false) because commons uses PagedTiffHandler instead which uses an incomaptible url format. :I think for best results, install PagedTiffHandler extension so it matches the one used on commons, but the new version should work regardless. :I've also been told there are issues with TimedMediaHandler files. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 21:36, 23 December 2021 (UTC) == help with ogv file type == <span class="mw-default-size"><span>[[File:Play_fight_of_polar_bears_edit_1.ogv|384x384px]]</span></span> The attached example video from commons is just working good, but when using this extensions, i got a message saying (Error missing media source), while i have timed media handler installed. [[Special:Contributions/2001:8F8:1E6D:A884:D8AB:3E80:31ED:4D26|2001:8F8:1E6D:A884:D8AB:3E80:31ED:4D26]] ([[User talk:2001:8F8:1E6D:A884:D8AB:3E80:31ED:4D26|talk]]) 20:31, 17 January 2022 (UTC) :i think this is an issue with timedmediahandler. I don't think it works with normal instant commons either. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 01:16, 18 January 2022 (UTC) :it works with normal instant commons, i just did a test now. [[Special:Contributions/2001:8F8:1E6D:A884:D8AB:3E80:31ED:4D26|2001:8F8:1E6D:A884:D8AB:3E80:31ED:4D26]] ([[User talk:2001:8F8:1E6D:A884:D8AB:3E80:31ED:4D26|talk]]) 05:35, 18 January 2022 (UTC) :Hmm, you're right. :I made a change that should fix it ( https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TimedMediaHandler/+/756875 ) however the issue is in TimedMediaHandler extension, so I'm not sure how soon the maintainers of that will merge that change (or if they will) [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 06:58, 25 January 2022 (UTC) :I am sorry Bawolff, i am just working on testing as i promised you earlier, the good thing here that you solve the issues. [[Special:Contributions/2001:8F8:1E6D:53DC:853A:9508:C4AD:A5C1|2001:8F8:1E6D:53DC:853A:9508:C4AD:A5C1]] ([[User talk:2001:8F8:1E6D:53DC:853A:9508:C4AD:A5C1|talk]]) 07:18, 27 January 2022 (UTC) :I appreciate it :) :It just might take a bit longer to fix, because the issue isn't in my code, so I have to get other stakeholders on board, which can be a complicated process sometimes. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 08:05, 28 January 2022 (UTC) :I am watching those changes, but wondering whether they are applied to version 1.37 or only at the master branch. [[Special:Contributions/2001:8F8:1E6D:E155:6DBD:BAA4:5CA2:D6A9|2001:8F8:1E6D:E155:6DBD:BAA4:5CA2:D6A9]] ([[User talk:2001:8F8:1E6D:E155:6DBD:BAA4:5CA2:D6A9|talk]]) 11:00, 26 February 2022 (UTC) :Yes. it requires the "master" or "1.38" version of TimedMediaHandler. Its likely that version only works with the (yet unreleased) MediaWiki 1.38. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 06:53, 5 March 2022 (UTC) :Thank you Bawolff [[Special:Contributions/2001:8F8:1E6D:2802:A84E:54BC:CA12:8558|2001:8F8:1E6D:2802:A84E:54BC:CA12:8558]] ([[User talk:2001:8F8:1E6D:2802:A84E:54BC:CA12:8558|talk]]) 07:19, 5 March 2022 (UTC) == (No action needed) QuickInstantCommons is deployed by Miraheze wikis == Hi, I've noticed Miraheze wikis now using QuickInstantCommons and just want to share it with anyone interested. The related ticket was https://phabricator.miraheze.org/T8626 and you can see the usage on WikiApiary https://wikiapiary.com/wiki/Extension:QuickInstantCommons. Thank you. [[User:Lens0021|Lens0021]] ([[User talk:Lens0021|talk]]) 08:23, 27 January 2022 (UTC) :Awesome! If you encounter any bugs or issues please let me know. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 04:08, 28 January 2022 (UTC) == Logic Exception == Accessing "<code><nowiki>[[special:specialpages]]</nowiki></code>" when both InstantCommons and QuickInstantCommons are enabled produces the following error message: "Internal error: [ZB4h8wFwXxIU-rLZVpSjQQAAAAE] 2023-03-24 22:19:32: Fatal exception of type 'LogicException'". What I think happened is that I had MediaWiki initially configured with InstantCommons disabled and QuickInstantCommons enabled, using "<code>$wgForeignFileRepos</code>" to access content from Wikimedia Commons. I then disabled "<code>$wgForeignFileRepos</code>" for Wikimedia Commons and enabled InstantCommons instead, which apparently broke the QuickInstantCommons extension. I'll leave the configuration to use "<code>$wgForeignFileRepos</code>" instead of InstantCommons for accessing Wikimedia Commons content, but this appears to be a bug with QuickInstantCommons that prevents switching back and forth between InstantCommons and "<code>$wgForeignFileRepos</code>" for accessing Wikimedia Commons content. I am using MediaWiki 1.39.2 with PHP 8.2.0. [[User:Nicole Sharp|Nicole Sharp]] ([[User talk:Nicole Sharp|talk]]) 22:28, 24 March 2023 (UTC) :Its kind of unclear what you did here, but if you are using both [normal] instant commons and QuickInstantCommons, at least one of them has to be setup via $wgForeignFileRepos (Doesn't matter which, could be both), and the two of them have to have separate repo names. If you are setting one up with $wgForeignFileRepos you must ensure the repo name you chose is different from the repo name that is automatically setup for the other one. :If you use the same repo name in $wgForeignFileRepos for more than one foreign file repo, an error will be generated (Potentially this one, but set $wgShowExceptionDetails = true; to be sure). [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 23:41, 24 March 2023 (UTC) :Below is the syntax from "<code>LocalSettings.php</code>" that produces the error. InstantCommons is enabled but the "<code>ForeignFileRepos</code>" for Wikimedia Commons is disabled. Disabling InstantCommons and un-commenting "<code>ForeignFileRepos</code>" for Wikimedia Commons resolves the error. :<code><syntaxhighlight lang="php"> # To enable image uploads, make sure the "images" directory is writable, then set this to true: $wgEnableUploads = true; $wgUseImageMagick = true; $wgImageMagickConvertCommand = "/usr/bin/convert"; ## https://www.mediawiki.org/wiki/manual:$wgUploadDirectory $wgUploadDirectory = "{$IP}/uploads"; ## https://www.mediawiki.org/wiki/manual:$wgUploadPath $wgUploadPath = "$wgScriptPath/uploads"; # InstantCommons allows wiki to use images from: https://commons.wikimedia.org/ $wgUseInstantCommons = true; ## https://www.mediawiki.org/wiki/InstantCommons # https://www.mediawiki.org/wiki/Extension:QuickInstantCommons wfLoadExtension( 'QuickInstantCommons' ); # https://www.mediawiki.org/wiki/Manual:$wgForeignFileRepos#Usage # $wgForeignFileRepos[] = [ # 'class' => ForeignAPIRepo::class, # 'name' => 'commonswiki', # Must be a distinct name. # 'apibase' => 'https://commons.wikimedia.org/w/api.php', # 'hashLevels' => 2, # 'fetchDescription' => true, # Optional. # 'descriptionCacheExpiry' => 43200, # 12 hours, optional (values are seconds). # 'apiThumbCacheExpiry' => 86400, # 24 hours, optional, but required for local thumb caching. # ]; $wgForeignFileRepos[] = [ 'class' => ForeignAPIRepo::class, 'name' => 'enwikipedia', 'apibase' => 'https://en.wikipedia.org/w/api.php', 'hashLevels' => 2, 'fetchDescription' => true, 'descriptionCacheExpiry' => 43200, 'apiThumbCacheExpiry' => 86400, ]; </syntaxhighlight></code> :[[User:Nicole Sharp|Nicole Sharp]] ([[User talk:Nicole Sharp|talk]]) 00:18, 25 March 2023 (UTC) :This is covered on the extension page. If you want to use both you need to use the settings mentioned in the Advanced Configuration section. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 00:59, 25 March 2023 (UTC) :err nevermind, i thought the docs had something about this, but i guess it does not. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 01:00, 25 March 2023 (UTC) :Anyways this is expected behaviour, if you need to use both at the same time (probably not a good idea) use the settings suggested in the advanced configuration section. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 01:04, 25 March 2023 (UTC) == This commons files not working on either wikis?? help! == I keep getting this No file by this name exists message whlist entering file:flag of italy.svg page on this wikis, so any fix this!?!?!?!??! can you someone help me pls! [[User:ThatRobloxianuser2K6|ThatRobloxianuser2K6]] ([[User talk:ThatRobloxianuser2K6|talk]]) 03:48, 29 March 2024 (UTC) :The i in Italy needs to be capitalized [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 14:45, 29 March 2024 (UTC) == User-Agent == @[[User:Bawolff|Bawolff]] Hi! Appropedia.org uses the latest (master) version of this extension and recently (not sure exactly when) the images we use from Commons have started to fail with "429 Too Many Requests". I thought this might be related to the new [[Wikimedia APIs/Rate limits]] but I'm not sure. When I analyze a request to a broken image (for example at [[Appropedia:Water]]) I can see that the User-Agent is set to that of my browser. Judging by a quick look at the code of this extension, shouldn't it be set to something like "QuickInstantCommons/1.5.1 MediaWiki/1.43 etc"? I tried setting the (undocumented) config variables $wgQuickInstantCommonsUserAgentInfo and $wgQuickInstantCommonsUserAgentOverride but to no avail, the User-Agent doesn't change. I read your message on wikitech-l saying that you tried debugging on appropedia.org but were blocked by an unsolvable Cloudflare captcha. Not sure what happened but these days we've been under a lot of pressure due to some rouge bots and were forced to enable Cloudflare's "Under Attack Mode" and other security rules to mitigate. Perhaps you met one of those, but the situation should be under control and normalized now. Would you care to try again? If so, I'll be super grateful! In any case, thanks! [[User:Sophivorus|Sophivorus]] ([[User talk:Sophivorus|talk]]) 15:24, 6 March 2026 (UTC) :Same issue on Vikidia.org with the latest version of the plugin and $wgQuickInstantCommonsUserAgentInfo set to "https:fr.vikidia.org; <hidden email>". [[User:Linedwell|Linedwell]] ([[User talk:Linedwell|talk]]) 15:34, 10 March 2026 (UTC) :I think a custom user-agent is necessary, but not sufficient, with the current rate limits in place. The [[common thumbnail sizes]] work is very likely also impacting users of InstantCommons and QuickInstantCommons. I would recommend making sure you are running [[MediaWiki 1.44]] or newer and then setting <syntaxhighlight lang=php inline>$wgThumbnailSteps = [20, 40, 60, 120, 250, 330, 500, 960, 1280, 1920, 3840];</syntaxhighlight> and <syntaxhighlight lang=php inline>$wgThumbnailStepsRatio = 1;</syntaxhighlight> in your LocalSettings. These settings should make your MediaWiki emit HTML that puts whatever <code>width</code> and <code>height</code> is appropriate on generated <code><img/></code> tags while also selecting the exact match or next largest width from the step sizes for the image requested from upload.wikimedia.org. This has a bit of coverage in [[Extension:QuickInstantCommons#Advanced Configuration]] now, but the way those settings interact with MediaWiki and why it matters might not be easy to understand yet. -- [[User:BDavis (WMF)|BDavis (WMF)]] ([[User talk:BDavis (WMF)|talk]]) 20:03, 10 March 2026 (UTC) ::Hello and thanks for you kind help. I have added those 2 variables on my LocalSettings.php and it works for some images (but not all). On my side [[MediaWiki 1.44]] will never be installed as we only use LTS. Here are some images that doesn't work with QuickInstantCommons : [[:File:Persian in Cat Cafe.jpg]] or [[:File:Havana Brown - choco.jpg]] because their default width is not common (399px) [[User:Linedwell|Linedwell]] ([[User talk:Linedwell|talk]]) 13:26, 11 March 2026 (UTC) :::{{tq|On my side MediaWiki 1.44 will never be installed as we only use LTS.}} :::The <code>$wgThumbnailSteps</code> setting and the mechanism it uses behind the scenes to "bucket" image sizes was first introduced in 1.44. The setting will not change any system behavior if you are stuck running 1.43. -- [[User:BDavis (WMF)|BDavis (WMF)]] ([[User talk:BDavis (WMF)|talk]]) 21:28, 11 March 2026 (UTC) ::::@[[User:Linedwell|Linedwell]] I talked with some folks and got the enabling changes for <code>$wgThumbnailSteps</code> merged into the REL1_43 branch. The next 1.43 point release (1.43.7) should include the code your wiki will need to generate bucketed thumbnail size requests from an LTS release. Thanks for helping me realize this was a gap that would cause folks problems as they adapt to the new rate limits and other constraints on InstantCommons and QuickInstantCommons. -- [[User:BDavis (WMF)|BDavis (WMF)]] ([[User talk:BDavis (WMF)|talk]]) 17:09, 12 March 2026 (UTC) :::::In my case, upgrading to MediaWiki 1.45 seems to have solved the issue. [[User:Sophivorus|Sophivorus]] ([[User talk:Sophivorus|talk]]) 14:49, 13 March 2026 (UTC) :::::Thank you very much for the report of the changes into REL1_43. I will have a look into it. Have a very nice day and thanks again for your help. [[User:Linedwell|Linedwell]] ([[User talk:Linedwell|talk]]) 12:02, 22 March 2026 (UTC) == .tif files are not displayed == Hi, we are using the extension, version 1.5.1 (site version 1.45.3). We've noticed that .tif files from Commons are not being displayed ([http://www.hamichlol.org.il/file:Milwaukee_War_Memorial_Center,_Milwaukee,_Wisconsin,_1952-57._Exterior.tif example]). Is this an issue with the extension, or with how we've configured it? ping @[[User:Bawolff|Bawolff]]. Thanks, [[Special:Contributions/&#126;2026-24956-87|&#126;2026-24956-87]] ([[User talk:&#126;2026-24956-87|talk]]) 21:54, 23 April 2026 (UTC) :i think its a problem with the extension. I'm going to look into it further. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 00:26, 24 April 2026 (UTC) :Hi, Sorry for the delay. It was due to a problem with the PagedTiffHandler extension [https://gerrit.wikimedia.org/r/c/mediawiki/extensions/PagedTiffHandler/+/1281999]. The issue should be fixed now. Try redownloading the PagedTiffHandler extension. [[User:Bawolff|Bawolff]] ([[User talk:Bawolff|talk]]) 16:13, 3 May 2026 (UTC) e1cewl5zza0otcykeij6vvx68724aqm Manual:Filerevision table 100 2156505 8364434 8363026 2026-05-03T15:29:14Z Rebulka 17532855 editace 8364434 wikitext text/x-wiki <languages /> {{Database layout}} {{MW 1.44|+|gerrit change=1091477}} {{TOCright}} <translate><!--T:1--> This table stores information about revisions of uploaded images and other files.</translate> <translate><!--T:2--> It is part of the replacement of the following old tables:</translate> {{ll|Manual:Image table|image}}, {{ll|Manual:oldimage table|oldimage}}, {{ll|Manual:filearchive table|filearchive}} <translate> == Fields == <!--T:3--> </translate> === fr_id === <translate><!--T:4--> Primary key.</translate> === fr_file === <translate><!--T:6--> ID of the file to which this revision belongs.</translate> <translate><!--T:19--> Foreign key to the <tvar name="1">{{ll|Manual:file table|file}}</tvar> table.</translate> === fr_size === <translate><!--T:7--> Size of this file revision, in bytes.</translate> === fr_width === <translate><!--T:8--> Width of this file revision, in pixels (if appropriate).</translate> === fr_height === <translate><!--T:9--> Height of this file revision, in pixels (if appropriate).</translate> === fr_metadata === <translate><!--T:10--> Extracted Exif metadata stored as a JSON array (new system) or serialized PHP array (old system).</translate> <translate><!--T:20--> The JSON array can contain an address in the <tvar name=1>text</tvar> table or external storage.</translate> === fr_bits === <translate><!--T:11--> Bits per pixel of this file revision (if appropriate).</translate> === fr_description_id === <translate><!--T:12--> Upload comment for this file revision.</translate> <translate><!--T:21--> Foreign key to the <tvar name="1">{{ll|Manual:comment table|comment}}</tvar> table.</translate> === fr_actor === <translate><!--T:13--> Actor who uploaded this file revision.</translate> <translate><!--T:22--> Foreign key to the <tvar name="1">{{ll|Manual:actor table|actor}}</tvar> table.</translate> === fr_timestamp === <translate><!--T:14--> Timestamp for this file revision (in MW timestamp format).</translate> === fr_sha1 === <translate><!--T:15--> SHA-1 content hash for this file revision, in base-36.</translate> === fr_archive_name === <translate><!--T:16--> Filename of the archived file.</translate> <translate><!--T:23--> This is generally a timestamp and <tvar name=1><code>!</code></tvar> prepended to the base name.</translate> === fr_deleted === <translate> <!--T:17--> Whether this file revision is deleted. == Schema summary == <!--T:18--> </translate> {{MW 1.44|+|gerrit change=1091477}}{{describe table}} <pre> +-------------------+----------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------------+----------------------+------+-----+---------+----------------+ | fr_id | bigint(20) unsigned | NO | PRI | NULL | auto_increment | | fr_file | bigint(20) | NO | MUL | NULL | | | fr_size | bigint(20) unsigned | NO | MUL | 0 | | | fr_width | int(10) unsigned | NO | | 0 | | | fr_height | int(10) unsigned | NO | | 0 | | | fr_metadata | mediumblob | NO | | NULL | | | fr_bits | int(10) unsigned | NO | | 0 | | | fr_description_id | bigint(20) unsigned | NO | | NULL | | | fr_actor | bigint(20) unsigned | NO | MUL | NULL | | | fr_timestamp | binary(14) | NO | MUL | NULL | | | fr_sha1 | varbinary(32) | NO | MUL | | | | fr_archive_name | varbinary(255) | NO | | | | | fr_deleted | smallint(5) unsigned | NO | | NULL | | +-------------------+----------------------+------+-----+---------+----------------+ </pre> <translate> == Indexes == <!--T:24--> </translate> {{MW 1.44|+|gerrit change=1091477}} {{show index in table}} <pre style="overflow-x: scroll; white-space: pre;"> +--------------+------------+--------------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +--------------+------------+--------------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | filerevision | 0 | PRIMARY | 1 | fr_id | A | 0 | NULL | NULL | | BTREE | | | | filerevision | 1 | fr_actor_timestamp | 1 | fr_actor | A | 0 | NULL | NULL | | BTREE | | | | filerevision | 1 | fr_actor_timestamp | 2 | fr_timestamp | A | 0 | NULL | NULL | | BTREE | | | | filerevision | 1 | fr_size | 1 | fr_size | A | 0 | NULL | NULL | | BTREE | | | | filerevision | 1 | fr_timestamp | 1 | fr_timestamp | A | 0 | NULL | NULL | | BTREE | | | | filerevision | 1 | fr_sha1 | 1 | fr_sha1 | A | 0 | 10 | NULL | | BTREE | | | | filerevision | 1 | fr_file | 1 | fr_file | A | 0 | NULL | NULL | | BTREE | | | +--------------+------------+--------------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ </pre> {{databases}} da9v2n7s9o9ri7w6n2nunf1fkdgz01p Translations:Manual:Filerevision table/6/en 1198 2157124 8364753 8363543 2026-05-03T21:31:03Z FuzzyBot 451990 Importing a new version from external source 8364753 wikitext text/x-wiki ID of the file to which this revision belongs. 6i3u8684k76jipczfic38sbf647q0p1 Manual:Filerevision table/en 100 2157137 8364754 8363544 2026-05-03T21:31:04Z FuzzyBot 451990 Updating to match new version of source page 8364754 wikitext text/x-wiki <languages /> {{Database layout}} {{MW 1.44|+|gerrit change=1091477}} {{TOCright}} This table stores information about revisions of uploaded images and other files. It is part of the replacement of the following old tables: {{ll|Manual:Image table|image}}, {{ll|Manual:oldimage table|oldimage}}, {{ll|Manual:filearchive table|filearchive}} == Fields == === fr_id === Primary key. === fr_file === ID of the file to which this revision belongs. Foreign key to the {{ll|Manual:file table|file}} table. === fr_size === Size of this file revision, in bytes. === fr_width === Width of this file revision, in pixels (if appropriate). === fr_height === Height of this file revision, in pixels (if appropriate). === fr_metadata === Extracted Exif metadata stored as a JSON array (new system) or serialized PHP array (old system). The JSON array can contain an address in the text table or external storage. === fr_bits === Bits per pixel of this file revision (if appropriate). === fr_description_id === Upload comment for this file revision. Foreign key to the {{ll|Manual:comment table|comment}} table. === fr_actor === Actor who uploaded this file revision. Foreign key to the {{ll|Manual:actor table|actor}} table. === fr_timestamp === Timestamp for this file revision (in MW timestamp format). === fr_sha1 === SHA-1 content hash for this file revision, in base-36. === fr_archive_name === Filename of the archived file. This is generally a timestamp and <code>!</code> prepended to the base name. === fr_deleted === Whether this file revision is deleted. == Schema summary == {{MW 1.44|+|gerrit change=1091477}}{{describe table}} <pre> +-------------------+----------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------------+----------------------+------+-----+---------+----------------+ | fr_id | bigint(20) unsigned | NO | PRI | NULL | auto_increment | | fr_file | bigint(20) | NO | MUL | NULL | | | fr_size | bigint(20) unsigned | NO | MUL | 0 | | | fr_width | int(10) unsigned | NO | | 0 | | | fr_height | int(10) unsigned | NO | | 0 | | | fr_metadata | mediumblob | NO | | NULL | | | fr_bits | int(10) unsigned | NO | | 0 | | | fr_description_id | bigint(20) unsigned | NO | | NULL | | | fr_actor | bigint(20) unsigned | NO | MUL | NULL | | | fr_timestamp | binary(14) | NO | MUL | NULL | | | fr_sha1 | varbinary(32) | NO | MUL | | | | fr_archive_name | varbinary(255) | NO | | | | | fr_deleted | smallint(5) unsigned | NO | | NULL | | +-------------------+----------------------+------+-----+---------+----------------+ </pre> == Indexes == {{MW 1.44|+|gerrit change=1091477}} {{show index in table}} <pre style="overflow-x: scroll; white-space: pre;"> +--------------+------------+--------------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +--------------+------------+--------------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | filerevision | 0 | PRIMARY | 1 | fr_id | A | 0 | NULL | NULL | | BTREE | | | | filerevision | 1 | fr_actor_timestamp | 1 | fr_actor | A | 0 | NULL | NULL | | BTREE | | | | filerevision | 1 | fr_actor_timestamp | 2 | fr_timestamp | A | 0 | NULL | NULL | | BTREE | | | | filerevision | 1 | fr_size | 1 | fr_size | A | 0 | NULL | NULL | | BTREE | | | | filerevision | 1 | fr_timestamp | 1 | fr_timestamp | A | 0 | NULL | NULL | | BTREE | | | | filerevision | 1 | fr_sha1 | 1 | fr_sha1 | A | 0 | 10 | NULL | | BTREE | | | | filerevision | 1 | fr_file | 1 | fr_file | A | 0 | NULL | NULL | | BTREE | | | +--------------+------------+--------------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ </pre> {{databases}} 76zzwcn7j6nvedt2vtcl01u0xx373t2 Extension:PageTriage/cs 102 2165753 8365062 8157885 2026-05-04T07:51:29Z FuzzyBot 451990 Updating to match new version of source page 8365062 wikitext text/x-wiki <languages /> {{Extension |templatemode = |status = stable |type1 = special |type2 = interface |newhook1 = |newhook2 = |username = |author = [[User:Kaldari|Ryan Kaldari]], [[User:Bsitu|Benny Situ]] |description = Usnadňuje kontrolu a schvalování nových stránek |image = Extension-PageTriage Special-NewPagesFeed Screenshot.png |imagesize = 300 |version = |update = |version preview = |update preview = |compatibility policy = rel |mediawiki = |php = |composer = |table1 = pagetriage_page |table2 = pagetriage_page_tags |table3 = pagetriage_tags |download = {{WikimediaDownload|phab=EPTR}} |readme = |changelog = |example = [[wikipedia:Special:NewPagesFeed | Special:NewPagesFeed on the English Wikipedia]] |namespace = |tags = |compatibility = |bugzilla = |phabricator = PageTriage |vagrant-role = }} <span lang="en" dir="ltr" class="mw-content-ltr">'''PageTriage''' is an extension that aims to provide a feature-rich interface for triaging newly-created articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It is intended to replace the ''new page patrol'' core function while adding additional functionality for reviewing, tagging, and improving new articles.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It adds a Special:NewPagesFeed page, and a page curation toolbar to new pages for those with the 'patrol' permission.</span> <span lang="en" dir="ltr" class="mw-content-ltr">It was developed by the Wikimedia Foundation's [[Wikimedia_Features_engineering|Features Engineering team]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">For additional details see ''[[Page Curation|Page Curation]]''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">An important note is that some of the configuration and code is specific to the English-language Wikipedia's workflows and as it's constructed now the extension is pretty much impossible to internationalise.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(See [[Phabricator:T50552]].)</span> [[File:Page-Curation-Video.ogv|thumb|An overview of the page curation feature. The interface in the video is outdated but the content remains useful.]] <div lang="en" dir="ltr" class="mw-content-ltr"> == Installation == </div> [[File:PageTriage-ListView-Whole.png|thumb|Screenshot of Special:NewPagesFeed as it appeared in 2012]] {{ExtensionInstall |db-update=yes |registration=required |localsettings= }} == Checking for successful install == <div lang="en" dir="ltr" class="mw-content-ltr"> To actually see the extension working: </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Create a new page containing just a few sentences of text as an anonymous user. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Visit Special:NewPagesFeed </div> <span lang="en" dir="ltr" class="mw-content-ltr">The new page should appear, flagged as "{{int|pagetriage-no-categories}}", "{{int|pagetriage-orphan}}", etc.</span> <span lang="en" dir="ltr" class="mw-content-ltr">To see the page curation toolbar:</span> <div lang="en" dir="ltr" class="mw-content-ltr"> * Login as a user with the 'sysop' permission, or add a group with the "[[Special:MyLanguage/Help:Patrolled_edits|patrol]]" permission, and add some user to that group, and login as that user. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Visit Special:NewPagesFeed </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Now you should see a "{{int|pagetriage-triage}}" button next to the new page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> * Click this and you should see the page curation toolbar on the new page. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Advanced installation == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === Additional extensions === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> For full functionality, you'll also need to install some additional extensions, although PageTriage works without them. </div> * {{ll|Extension:Echo|Echo}} - Allows users to receive notifications for things like when an article they created has been marked as reviewed. * {{ll|Extension:ORES|ORES}} - In Special:NewPagesFeed, allows filtering by "predicted class" (<code>articlequality</code>: stub, start, c-class, b-class, good, featured) and "potential issues" (<code>draftquality</code>: vandalism, spam, attack, copyvio). The predictions are done with machine learning (except for copyvio, which is done via a third party bot using an API, but is included here because <code>draftquality</code> needs to be turned on). ORES AI is typically trained by editors via https://labels.wmflabs.org/ui/, or by analyzing reverts. The ORES database provides probabilities which are accessed via the ORES extension. A threshold (tolerable false positive rate) is applied to this data, and some of the thresholds are set in the ORES extension's [[git:mediawiki/extensions/ORES/+/8bd39f26548d58fa8bf6765e1c23f5e3086f1cd4/extension.json#225|extension.json file]]. * {{ll|Extension:WikiLove|WikiLove}} - Adds a button to the Page Curation toolbar that allows you to leave a person a barnstar more easily. === Enabling draft namespace === By default, the draft namespace is disabled, but can be enabled with the following update to LocalSettings.php <syntaxhighlight lang="php" copy> // These three settings are optional, and will enable the Articles-for-Creation mode. $wgPageTriageDraftNamespaceId = 118; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId ] = 'Draft'; $wgExtraNamespaces[ $wgPageTriageDraftNamespaceId + 1 ] = 'Draft_talk'; </syntaxhighlight> When enabled, a new "articles for creation" tab will show up on Special:NewPagesFeed. By default pages edited in the draft namespace will be "unsubmitted". Articles in the draft namespace can be submitted for review by adding <nowiki>[[Category:Pending_AfC_submissions]]</nowiki> to the draft page. At which point they will show up under "awaiting review". Note the toolbar controlled by the configuration variable '''$wgPageTriageEnableCurationToolbar''' does not show up in the draft namespace. === Cron jobs === To make sure old articles are eventually taken out of the new pages feed, you should set up a cron job to run the following file every 48 hours: <code>cron/updatePageTriageQueue.php</code> == Manual testing == === Special:NewPagesFeed -> Articles for Creation === * Enable draftspace by following the directions above in the section [[#Enabling draft namespace]]. * In Special:NewPagesFeed, to place a draft in one of the AFC states, you need to create a page in the "Draft" namespace, and add it to the following categories: ** Unsubmitted: (no category) ** Awaiting review: Category:Pending AfC submissions ** Under review: Category:Pending AfC submissions being reviewed now ** Declined: Category:Declined AfC submissions Note: The Page Curation toolbar does not display for drafts. === ORES === Enwiki has the [[Extension:ORES|ORES extension]] installed, which provides machine learning predictions of an article's quality and of some common issues. ORES works fine in production, but requires some setup if you want to test in a localhost environment. It can be desirable to test with ORES turned on, for example, if you are changing the layout of Special:NewPagesFeed. Here is a localhost testing procedure: * Clone Extension:ORES and add <code>wfLoadExtension( 'ORES' );</code> in <code>LocalSettings.php</code> * Add this to <code>LocalSettings.php</code> <syntaxhighlight lang="php" copy> $wgPageTriageEnableOresFilters = true; $wgOresWikiId = 'enwiki'; $wgOresModels = [ 'articlequality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'cleanParent' => true ], 'draftquality' => [ 'enabled' => true, 'namespaces' => [ 0 ], 'sources' => [ 1 ] ] ]; </syntaxhighlight> * Run <code>php maintenance/run.php ./extensions/ORES/maintenance/BackfillPageTriageQueue.php</code> == Determining if a page is reviewed == === Status codes === There are status codes used to track whether a page is reviewed or not. These are the values given when you query <code>patrol_status</code>, <code>ptrp_reviewed</code>, and <code>ptrl_reviewed</code>: * Unreviewed ** 0 - unreviewed * Reviewed ** 1 - reviewed (someone clicked the green check mark in the Page Curation toolbar) ** 2 - patrolled (someone clicked the "Mark as patrolled" link at the bottom right corner of a page) ** 3 - autopatrolled (someone with the <code>autopatrol</code> user right created the page, or moved the page from a non-tracked namespace to a tracked namespace) ** no result - will occur if the page is not in a tracked namespace (mainspace, userspace, and draftspace), if the article was created before PageTriage was installed, or if the article was reviewed for longer than 30 days (these records are deleted by a cron job) === Via the API === To check the review status of pages using an API query, you can use <code>api.php?action=query&prop=isreviewed</code>. Sample JavaScript code:<syntaxhighlight lang="js" copy> /** * @param {number} pageID The page ID number. A positive number with no commas. */ async isReviewed(pageID) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', pageids: pageID, } ); return response.query.pages[0].isreviewed; } /** * @param {string} title One title. Can include namespace. Example: User:Test */ async function isReviewed(title) { let api = new mw.Api(); let response = await api.get( { action: 'query', format: 'json', formatversion: '2', prop: 'isreviewed', titles: title, } ); return response.query.pages[0].isreviewed; } </syntaxhighlight> === Via SQL === To check the review status of pages using an SQL query, you need to query the <code>{{ll|Extension:PageTriage/pagetriage page table|pagetriage_page}}</code> table and the <code>ptrp_reviewed</code> field. Follow the directions in [[#Status codes]] to interpret the values of this field. <syntaxhighlight lang="sql" copy> /* By page_id */ SELECT ptrp_reviewed FROM pagetriage_page WHERE ptrp_page_id = 71318376 /* By page_title and page_namespace */ SELECT ptrp_reviewed FROM pagetriage_page JOIN page ON page_id = ptrp_page_id WHERE page_title = 'Živko_Kostadinović' -- underscores, not spaces AND page_namespace = 0 </syntaxhighlight> == SQL == === SQL tables === {| class="wikitable" |+ !Name !Prefix !Description !Old entry deletion strategy !Service classes (when refactoring, SQL queries should be moved to here) !Data classes |- |[[Extension:PageTriage/pagetriage page table|pagetriage_page]] |ptrp_ |The main table. Log of all pages created after PageTriage was installed. One entry per page. Stores the "mark as reviewed" statuses mentioned above. Also stores the last time a tag was placed on the page by PageTriage. Query <code>ptrp_reviewed > 0</code> in this table to figure out if a page is marked as reviewed. No entry also means the page is reviewed. |All articles deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirects deleted after 180 days regardless of patrol status. |QueueManager, QueueLookup |QueueRecord |- |[[Extension:PageTriage/pagetriage page tags table|pagetriage_page_tags]] |ptrpt_ |Stores metadata about pages, to make the filters in the Page Curation toolbar work. For example, if you pick the filter "Were previously deleted", then PageTriage will query this table looking for the recreated tag ID. The tag ID is discovered by checking the <code>pagetriage_tags</code> table. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. |All article metadata deleted once <code>ptrp_reviewed</code> > 0 (marked as reviewed) and older than 30 days. All redirect metadata deleted after 180 days regardless of patrol status. | | |- |[[Extension:PageTriage/pagetriage tags table|pagetriage_tags]] |ptrt_ |A dictionary of page_tags, and their corresponding ID number. See [[Extension:PageTriage#pagetriage%20page%20tags|#pagetriage_page_tags]] for list of tags. | | | |} === pagetriage_page_tags === <code>pagetriage_page_tags</code> data is updated by calling <code>ArticleCompileProcessor::newFromPageId( [ $pageId ] )->compileMetadata()</code>. This is called in the following hooks: * <code>onPageMoveComplete()</code> - runs when moving a page * <code>onLinksUpdateComplete()</code> - runs when saving an edit * <code>onMarkPatrolledComplete()</code> - runs when clicking the "Mark this page as patrolled" link in bottom right corner of certain pages It is called asynchronously. The user will see that their edit succeeded and can continue browsing the website, and the page tags update will occur in the background, invisibly to the user. ==== List of tags ==== The <code>pagetriage_page_tags</code> are as follows: * Author information ** user_id ** user_name - there's a filter where you can type in their username ** user_editcount ** user_creation_date ** user_autoconfirmed ** user_experience - Experience level: newcomer (non-autoconfirmed), learner (newly autoconfirmed), experienced, or anonymous. These experience levels are baked into core and can be accessed with <code>MediaWikiServices::getInstance()->getUserFactory()->newFromUserIdentity( $performer )->getExperienceLevel()</code> ** user_bot ** user_block_status * Deletion tags - will display a black trash can icon if marked for deletion ** afd_status ** blp_prod_status ** csd_status ** prod_status * Special:NewPagesFeed red warning text ** category_count - No categories ** linkcount - Orphan ** reference - No citations ** recreated - Previously deleted ** user_block_status - Blocked * Page information ** page_len - size of article, in bytes ** rev_count - number of edits to the article ** snippet - text from beginning of article, used in Special:NewPagesFeed to preview the article * afc_state - 1 unsubmitted, 2 pending, 3 under review, 4 declined * copyvio - latest revision ID that has been tagged as a likely copyright violation, if any == PHP == <div lang="en" dir="ltr" class="mw-content-ltr"> === Extension configuration === </div> <span lang="en" dir="ltr" class="mw-content-ltr">The extension is based on the 'patrol' right.</span> <span lang="en" dir="ltr" class="mw-content-ltr">For more information about configuring patrolling, see {{ll|Manual:Patrolling}}.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The following configuration variables can be set from your LocalSettings.php file: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">Variable</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Default</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> |- | {{phpi|$wgPageTriageEnableCurationToolbar}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set to false to disable the [[Special:MyLanguage/Page Curation#User Experience: Curation Toolbar|curation toolbar]]</span> |- | {{phpi|$wgPageTriageInfiniteScrolling}} | {{phpi|true}} | <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not to use infinite scrolling in the new pages feed</span> |- | {{phpi|$wgPageTriageMaxAge}} |90 | The age (in days) at which PageTriage allows unreviewed articles to become indexed by search engines (if $wgPageTriageNoIndexUnreviewedNewArticles is true). |- | {{phpi|$wgPageTriageNamespaces}} |NS_MAIN | The namespaces that PageTriage is active in. |- | {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} | {{phpi|false}} | <span lang="en" dir="ltr" class="mw-content-ltr">Set this to true if new, unreviewed articles should be set to noindex.</span> <span lang="en" dir="ltr" class="mw-content-ltr">In other words, if they should not be indexed by search engines until they are reviewed.</span> |} <div lang="en" dir="ltr" class="mw-content-ltr"> See [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/extension.json#698|extension.json]] for the full list of config variables. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === API === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> PageTriage adds the following API endpoints which can be used: </div> {| class="wikitable" |+ ! <span lang="en" dir="ltr" class="mw-content-ltr">API</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Description</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Type</span> ! <span lang="en" dir="ltr" class="mw-content-ltr">Triggering action</span> |- |pagetriageaction | <span lang="en" dir="ltr" class="mw-content-ltr">Mark a page as reviewed or unreviewed, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to mark a page as reviewed * Using the Page Curation toolbar to mark a page as unreviewed |- |pagetriagelist | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves the list of pages in the queue, and each page's metadata, including their reviewed status.</span> To retrieve one page, you must provide the <code>page_id</code>. To provide multiple pages, you must select one of <code>showreviewed</code>/<code>showunreviewed</code>, and one of <code>showredirs</code>/<code>showdeleted</code>/<code>showothers</code>, or no pages will be returned. |Read | * Loading the Page Curation toolbar (automatically loaded if you have the <code>patrol</code> userright and view a page that is unpatrolled or recently patrolled) * Viewing Special:NewPagesFeed (provides the list of articles) |- |pagetriagestats | <span lang="en" dir="ltr" class="mw-content-ltr">Retrieves stats about the number of pages in the queue for use in the header of Special:NewPagesFeed.</span> |Read | * Viewing Special:NewPagesFeed (provides the total articles in the header, and provides the stats in the footer) |- |pagetriagetagcopyvio |Mark an article as a potential copyright violation, and logs the action in Special:Log. |Write | * Marking as a copyright violation by a bot with the <code>copyviobot</code> userright |- |pagetriagetagging | <span lang="en" dir="ltr" class="mw-content-ltr">Add clean-up tags or deletion templates to a page, and logs the action in Special:Log.</span> |Write | * Using the Page Curation toolbar to place a maintenance tag on an article * Using the Page Curation toolbar to place a deletion tag on an article |} === Special:Log === The following logs are created by the extension: {| class="wikitable" |+ !Special:Log !<code>log_type</code> !<code>log_action</code> !Description !Notes |- |Page curation log |pagetriage-curation |delete, enqueue, reviewed, tag, unreviewed |Logs deletion tagging, maintenance tagging, marking page as reviewed, marking page as unreviewed | |- |Potential copyright violation log |pagetriage-copyvio |insert |Allows a bot to log potential copyright violations |Doesn't display unless you set {{phpi|$wgPageTriageEnableCopyvio}} to true |} <div lang="en" dir="ltr" class="mw-content-ltr"> === Entry points === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The extension's features can be triggered by various actions: </div> {| class="wikitable" |+ !Entry point type !File location !Notes |- |5 APIs |includes/Api/* | |- |1 special page |includes/SpecialNewPagesFeed.php | |- |20 hooks | * includes/Hooks.php * includes/HookHandlers/UndeleteHookHandler.php * includes/HookHandlers/Schema.php | |- |1 cron job |cron/updatePageTriageQueue.php |runs every 48 hours |- |7 maintenance scripts |maintenance/* |need to be run manually |} Here is a list of some actions and the corresponding entry points they trigger: {| class="wikitable" |+ !Action !Entry points used |- |View Main page | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() |- |Save an edit to the Main page | * Hooks.php -> onRevisionFromEditComplete() * Hooks.php -> onPageSaveComplete() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onLinksUpdateComplete() |- |Type in search box, triggering search suggestions | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onApiMain__moduleManager() |- |View Special:NewPagesFeed | * Hooks.php -> onBeforeCreateEchoEvent() * SpecialNewPagesFeed * ApiPageTriageStats * ApiPageTriageList |- |View an unreviewed article while logged in and having the <code>patrol</code> permission. | * Hooks.php -> onBeforeCreateEchoEvent() * Hooks.php -> onArticleViewFooter() * Hooks.php -> onResourceLoaderGetConfigVars() * Hooks.php -> onDefinedTags() * Hooks.php -> onApiMain__moduleManager() * ApiPageTriageList (by <code>page_id</code>) |} ==== Hooks ==== {| class="wikitable" |+ !File !Group !Hook !Actions it performs |- | rowspan="18" |Hooks.php |Move page |[[Manual:Hooks/PageMoveComplete|onPageMoveComplete]] |Changes patrolled status, updates cache, updates metadata in <code>pagetriage_page_tags</code> table. |- | rowspan="3" |Edit page |[[Manual:Hooks/RevisionFromEditComplete|onRevisionFromEditComplete]] |Handles marking '''redirects that flip to articles''' as unreviewed. [[Deferred updates|DeferredUpdate]]. |- |[[Manual:Hooks/PageSaveComplete|onPageSaveComplete]] |Add '''new articles''' to the New Pages Feed and <code>pagetriage_page</code> table. |- |[[Manual:Hooks/LinksUpdateComplete|onLinksUpdateComplete]] |[[Deferred updates|DeferredUpdate]] of metadata / <code>pagetriage_page_tags</code> table. |- |Every page load |[[Manual:Hooks/ArticleViewFooter|onArticleViewFooter]] | * Turn on '''noindex''' for new, unreviewed articles. * Determine whether to load a '''link for autopatrolled users to unpatrol''' their article * Displays the '''Page Curation toolbar''' on recently created pages. * Create '''"Add to New Pages Feed" toolbox link''' for old articles. |- |[[Help:Patrolled edits]] |[[Manual:Hooks/MarkPatrolledComplete|onMarkPatrolledComplete]] |Marking as patrolled (the patrol link shows up in template namespace, for example) will also mark as reviewed in PageTriage. |- | rowspan="2" |Blocking and unblocking |[[Manual:Hooks/BlockIpComplete|onBlockIpComplete]] | rowspan="2" |Update article metadata / <code>pagetriage_page_tags</code> when a user gets blocked or unblocked. This is so Special:NewPagesFeed can display "Blocked" by articles created by blocked users. |- |[[Manual:Hooks/UnblockUserComplete|onUnblockUserComplete]] |- | |[[Manual:Hooks/ResourceLoaderGetConfigVars|onResourceLoaderGetConfigVars]] |Adjusts some config vars related to draft namespace ID. |- | rowspan="3" |[[Extension:Echo]] |[[Manual:Hooks/BeforeCreateEchoEvent|onBeforeCreateEchoEvent]] | rowspan="3" |Code that makes PageTriage Echo notifications work. For example, the notification to article creators that their article was marked as reviewed. |- |[[Manual:Hooks/EchoGetDefaultNotifiedUsers|onEchoGetDefaultNotifiedUsers]] |- |[[Manual:Hooks/LocalUserCreated|onLocalUserCreated]] |- |[[Extension:ORES]] |[[Manual:Hooks/ORESCheckModels|onORESCheckModels]] |Code that makes PageTriage ORES filters in Special:NewPagesFeed work. For example, filtering by article size or by predicted vandalism/spam/copyvio. |- | rowspan="3" |[[Help:Tags]] |[[Manual:Hooks/ListDefinedTags|onListDefinedTags]] | rowspan="3" |Code that makes PageTriage tags work. Tags can be attached to individual revisions to show that a tool helped make the edit. For PageTriage, it tags edits "PageTriage". |- |[[Manual:Hooks/ChangeTagsAllowedAdd|onChangeTagsAllowedAdd]] |- |[[Manual:Hooks/ChangeTagsListActive|onChangeTagsListActive]] |- |API |[[Manual:Hooks/ApiMain::moduleManager|onApiMain__moduleManager]] |Disables the pagetriagetagging API, if that feature is turned off in PageTriage's settings. |- | rowspan="2" |Delete or undelete page |[[Manual:Hooks/PageDeleteComplete|onPageDeleteComplete]] |If a page is deleted, also delete its data from the PageTriage queue, and remove it from the cache. |- |HookHandlers/ UndeleteHookHandler.php |[[Manual:Hooks/ArticleUndelete|onArticleUndelete]] |If a page is undeleted, add it back to the PageTriage queue, regardless of autopatrol status. Fixes a bug where undeleted pages were automatically marked as reviewed. |- |HookHandlers/ Schema.php |SQL |[[Manual:Hooks/LoadExtensionSchemaUpdates|onLoadExtensionSchemaUpdates]] | * The code that installs PageTriage's 4 SQL tables when you run <code>php maintenance/run.php update</code>. * Will also alter schemas from previous versions to match the latest schema. * This is also where all the '''pagetriage_tags''' are hard-coded. |} ==== Cron jobs and maintenance scripts ==== {| class="wikitable" |+ !File !What it does !Why run it? When is it useful? ![[phab:T341431|Safe to delete maintenance script?]] |- |cron/updatePageTriageQueue.php |Every 48 hours, remove some items from the new pages feed after certain time limits. Removed items can be re-added by clicking "Add to the New Pages Feed". |Keeps the SQL tables from getting too big. | |- |maintenance/cleanupPageTriage.php |Remove page with namespace other than NS_MAIN/NS_USER from pagetriage queue. |Fix a bug? [[phab:T321982|T321982]] | |- |maintenance/cleanupPageTriageLog.php |Maintenance script that updates parameter name from '4::tags' to 'tags' in pagetriage-curation log and (now defunct) pagetriage-deletion log |One time conversion of old log entries to modern format? Logs are now always written in the new format. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/6d9105c020c62d648a4ef6be957297bbc8a6d7d2]. |Probably |- |maintenance/cleanupPageTriagePageTags.php |Remove page from <code>pagetriage_page_tags</code> if they are not in <code>pagetriage_page</code> |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/00a752368e00e0d8b29a4908bfc3bab3096268dd]. |Probably |- |maintenance/DeleteAfcStates.php |Delete the afc_state tag value for every page in the queue (drafts and non-drafts). Normally all pages have this tag even if they're not drafts. |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ab2d8d4a2f9d0f4ff981afaee35a85f33edb5e99]. [[phab:T203184#4592953|T203184#4592953]]. |Probably |- |maintenance/FixNominatedForDeletion.php |Set <code>pagetriage_page.ptrp_deleted</code> if the page is has any <code>pagetriage_page_tags</code> related to deletion (e.g. prod_status, blp_prod_status, etc.) |Fix a bug that made it into production. All solved now. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/ff0c433226300aeba692089b5389435d47feef1e]. [[phab:T202582|T202582]]. |Probably |- |maintenance/populateDraftQueue.php |Add missing Draft namespace pages to the AfC triage queue. |Related to deploying PageTriage's draftspace feature into an environment that already has a draftspace. [https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/59e1fedffcdafc46722d7231011aee194db9ee08]. | |- |maintenance/updateUserMetadata.php |Former cron job. Update expired user metadata in the <code>pagetriage_page_tags</code> table |[https://github.com/wikimedia/mediawiki-extensions-PageTriage/commit/92a675a5f1f2e07cee532ec90fc57eee7f2cd49b]. [[phab:T341432|T341432]]. | |} === NOINDEX === NOINDEX refers to the HTML code <code>&lt;meta name="robots" content="noindex"></code>, which can be inserted into a page to stop the page from appearing in search engine results. In default installations of MediaWiki, all pages are indexed unless they contain the wikicode <code><nowiki>__NOINDEX__</nowiki></code>. When {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is set to true, PageTriage will take over deciding what pages are indexed. The logic that determines this is located in <code>includes/Hooks.php</code>, in the <code>onArticleViewFooter()</code> method. ==== First check ==== * First check: Noindex the page if ALL of the following are true: ** {{phpi|$wgPageTriageNoIndexUnreviewedNewArticles}} is turned on ** Page age is less than {{phpi|$wgPageTriageMaxAge}} (set to 90 days on enwiki) ** Page is in <code>pagetriage_page</code> table<ref>Checked by <code>isPageUnreviewed()</code></ref> ** Page is marked as unpatrolled (ptrp_status = 0) ==== Second check ==== * Second check: If the wikitext has the <code><nowiki>__NOINDEX__</nowiki></code> magic word, noindex the page if ALL of the following are true: ** Page age is less than {{phpi|$wgPageTriageMaxNoIndexAge}} (set to 90 days on enwiki) ** If {{phpi|$wgPageTriageMaxNoIndexAge}} is not null, page is in <code>pagetriage_page</code> table<ref>Checked by <code>isNewEnoughToNoIndex()</code>, if it doesn't exit early due to <code>$wgPageTriageMaxNoIndexAge</code> being <code>null</code>.</ref> The main use case for the <nowiki>__NOINDEX__</nowiki> magic word is in deletion templates and maintenance tag templates that are transcluded into mainspace or draftspace. See [https://en.wikipedia.org/w/index.php?search=NOINDEX&title=Special:Search&profile=advanced&fulltext=1&ns10=1 this search]. ==== Is the page in the <code>pagetriage_page</code> table? ==== In regards to the requirement "Page is in <code>pagetriage_page</code> table", there are several ways a for a page to get into this table: * Not been deleted by a PageTriage cron job ** One cron job deletes redirects older than {{phpi|$wgPageTriageRedirectAutoreviewAge}} days old (default 180 days as of Sep 2022), regardless of patrol status. In other words, this cron job autopatrols them. ** Another cron job deletes reviewed pages after 30 days of being reviewed * In a namespace that PageTriage is configured to patrol * Isn't an article that is so old it predates the installation of PageTriage == JavaScript == === Directory structure === * /modules/ ** ext.pageTriage.article - related to marking an article as reviewed ** ext.pageTriage.defaultTagsOptions - lists of deletion tags and maintenance tags used by the Page Curation toolbar ** ext.pageTriage.init - creates a mw.pageTriage object ** ext.pageTriage.newPagesFeed - Special:NewPagesFeed ** ext.pageTriage.sidebarLink - related to the "Add to the New Pages feed" link that shows up in the left menu toolbox, and the ooui alert box it generates ** ext.pageTriage.toolbar - Page Curation toolbar <!--** ext.pageTriage.toolbar - Page Curation toolbar (Vue version)--> ** ext.pageTriage.toolbarStartup - ActionQueue and toolbar startup code ** ext.pageTriage.util - Backbone.js models (article, revision, stats) ** external - contains external libraries including backbone, jquery.tipoff, jquery.badge, jquery.waypoint, and underscore <div lang="en" dir="ltr" class="mw-content-ltr"> === Toolbar === </div> The toolbar has three states: <code>maximized</code>, <code>minimized</code>, and <code>hidden</code>. The maximized toolbar is the full-size toolbar with all buttons. The minimized toolbar still displays and floats, but simply says "Curation" and has an X you can click to close it. The hidden toolbar doesn't display at all, and can be re-opened by clicking the "Open Page Curation" link in the left menu. === External libraries === * front end ** old (moving away from) *** [[w:Backbone.js|Backbone.js]] *** [[w:jQuery|jQuery]] *** jQuery Badge *** jQuery Waypoints *** [[w:jQuery UI|jQuery UI]] *** [[w:Mustache (template system)|Mustache (template system)]] *** [[OOUI]] - used in modules/ext.PageTriage.enqueue ([https://codesearch.wmcloud.org/deployed/?q=oojs&files=&excludeFiles=&repos=mediawiki%2Fextensions%2FPageTriage codesearch]) *** [[w:Underscore.js|Underscore.js]] ** new (moving towards) *** Codex *** [[w:Moment.js|Moment.js]] *** Vue Backbone and Underscore are unusual libraries to use in MediaWiki extensions, and jQuery UI is deprecated. Long term, [[phab:T208256|we are interested in replacing these front end libraries]], to make the extension easier to maintain. <div lang="en" dir="ltr" class="mw-content-ltr"> === Client-side hooks === </div> ==== mw.hook ==== * <code>ext.pageTriage.toolbar.ready</code> ==== mw.pageTriage.actionQueue ==== <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage provides a specialised action queue system to allow other scripts and gadgets to integrate with it.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is similar to <code>mw.hook</code> except that it uses promises.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This is done using the <code>mw.pageTriage.actionQueue</code> module.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the comments in the {{tmpl|0={{git file|project=mediawiki/extensions/PageTriage|branch=master|file=modules/ext.pageTriage.toolbarStartup/ext.pageTriage.actionQueue.js|text=$1}}|source code}} for documentation on how the system works.</span> {{tmpl|0=<span lang="en" dir="ltr" class="mw-content-ltr">It is [$1 not currently used by any scripts or gadgets on enwiki], but it is used internally by PageTriage.</span> |1=https://en.wikipedia.org/w/index.php?search=%22actionQueue%22&title=Special:Search&profile=advanced&fulltext=1&ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&ns100=1&ns101=1&ns118=1&ns119=1&ns710=1&ns711=1&ns828=1&ns829=1&ns2300=1&ns2301=1&ns2302=1&ns2303=1 }} <span lang="en" dir="ltr" class="mw-content-ltr">The actionQueue module is available after the mw.hook <code>ext.pageTriage.toolbar.ready</code> fires.</span> <span lang="en" dir="ltr" class="mw-content-ltr">PageTriage will give the action queue handler an Object with the following data, in addition to other data as noted below:</span> * <code>pageid</code> — <span lang="en" dir="ltr" class="mw-content-ltr">ID of the page being reviewed.</span> * <code>title</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Title of the page, including namespace.</span> * <code>reviewer</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of who is using PageTriage.</span> * <code>creator</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Username of the creator of the page.</span> * <code>reviewed</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Whether or not the page is currently or will be marked as reviewed.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ===== Available actions ===== </div> * <code>delete</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the reviewer tags a page for deletion. The data given to the handler also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An object of all the templates added to the page. The keys are the template title, and the values are an object of metadata, including things like the speedy deletion code.</span> * <code>mark</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when the review status of a page is changed. Also includes:</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> * <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">Fired when maintenance tags are added to the page. Also includes:</span> ** <code>tags</code> — <span lang="en" dir="ltr" class="mw-content-ltr">An array of the titles of all templates that were added to the page.</span> ** <code>note</code> — <span lang="en" dir="ltr" class="mw-content-ltr">The personal message the reviewer added for the creator of the page. This may be blank.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> ===== Example ===== </div> <div lang="en" dir="ltr" class="mw-content-ltr"> To use the action queue, register a function to be ran when an aforementioned action is fired. PageTriage will wait for any asynchronous code to complete before doing anything else, such as refreshing the page. For example, to edit [[Sandbox]] after a page has been marked as reviewed, you could use: </div> <syntaxhighlight lang="javascript"> $( function () { // You must first listen for the ext.pageTriage.toolbar.ready event using mw.hook, to ensure your handler is registered at the right time. mw.hook( 'ext.pageTriage.toolbar.ready' ).add( function ( queue ) { // Listen for the 'mark' action. queue.add( 'mark', function ( data ) { return new mw.Api().edit( 'Sandbox', function ( revision ) { // Replace 'foo' with the note the reviewer left. return revision.content.replace( 'foo', data.note ); } ); } ); } ); } ); </syntaxhighlight> === Where are preferences stored? === Preferences such as the user's Special:NewPagesFeed selected filters are stored as MediaWiki user preferences. The preference name is <code>userjs-NewPagesFeedFilterOptions</code>. It is set using <code>mw.Api().saveOption()</code> and read using <code>mw.user.options.get()</code>. This data ends up in the SQL <code>user_properties</code> table. Temporary accounts (IP masking) will not be able to store their preferences. == Installation on WMF wikis == This extension was designed for English Wikipedia. There is interest in changing its code and making it more useful to other wikis ([[phab:T50552]]), however this is challenging from a technical perspective and progress is slow. For now, the following are true: * PageTriage is allowed to be installed on other wikis<ref>https://meta.wikimedia.org/w/index.php?title=Limits_to_configuration_changes&diff=prev&oldid=26121135</ref> (although as of 2024 this hasn't happened yet). * The setting <code>$wgPageTriageEnableExtendedFeatures</code> can be set to <code>false</code> to turn off English Wikipedia-specific features such as maintenance tags and deletion tags in the Page Curation toolbar. * There are concerns that the noindex features (controlled by <code>$wgPageTriageNoIndexUnreviewedNewArticles</code> and <code>$wgPageTriageMaxNoIndexAge</code>) create search engine optimization problems, and these noindex features should not be enabled on new wikis without first discussing it with product manager [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]. * Like most other WMF-deployed extensions, PageTriage supports internationalization, and has its interface [[gerrit:plugins/gitiles/mediawiki/extensions/PageTriage/+/refs/heads/master/i18n/|translated into many other languages]]. <div lang="en" dir="ltr" class="mw-content-ltr"> == See also == </div> * [[commons:Category:PageTriage extension]] * [[Help:New pages feed]] * [[w:Wikipedia:Page Curation/Help]] == Notes == <references /> {{OnWikimedia}} {{Used by}} [[Category:API extensions{{#translation:}}]] 6ly6nqi1nngb0bd0w7u2yxb9zg9vzwh Talk:MediaWiki Stakeholders' Group 1 2172119 8364664 8311559 2026-05-03T18:07:02Z MediaWiki message delivery 1125986 /* Affiliations Committee News (January-March 2026) */ new section 8364664 wikitext text/x-wiki {{Flow-enabled}} == Naming == According to the latest meeting's notes (2014-10-17) the name will have to be changed to get accepted as a formal group. What about just doing "Third Party MediaWiki Co-operation". That's basically how this started out and addresses the valid concerns of the AffCom. [[User:Kghbln|&#91;&#91;kgh&#93;&#93;]] ([[User talk:Kghbln|talk]]) 14:37, 20 October 2014 (UTC) :OK with me. Better: "Third party cooperation". Some people do not like the term "3rd party". We could also use the term "Stakeholder". So this would be "Stakeholder cooperation". [[User:Mglaser|Mglaser]] ([[User talk:Mglaser|talk]]) 10:57, 21 October 2014 (UTC) ::Yeah, "Stakeholder cooperation" is a more neutral wording which does also not exclude anyone (any party). Thus +1 from me. [[User:Kghbln|&#91;&#91;kgh&#93;&#93;]] ([[User talk:Kghbln|talk]]) 11:17, 21 October 2014 (UTC) :::The name can be: "MediaWiki Fans", "MediaWiki Devotees". I am a devotee! ;) [[User:Natkabrown|Natkabrown]] ([[User talk:Natkabrown|talk]]) 13:33, 7 November 2014 (UTC) ::::Non-WMF MediaWiki Users Group [[User:Rob Kam|Rob Kam]] ([[User talk:Rob Kam|talk]]) 16:09, 7 November 2014 (UTC) :::::In 2014-11-07 user group meeting, the decision is: MediaWiki Stakeholders. [[User:Palexis|Palexis]] ([[User talk:Palexis|talk]]) 16:47, 7 November 2014 (UTC) ::::::This will be in the notes which will be published on MW.org by the end of the week. [[User:Palexis|Palexis]] ([[User talk:Palexis|talk]]) 16:49, 7 November 2014 (UTC) == Congratulations! == {{Archive top|status=resolved}} :Congratulations on being recognized as an official Wikimedia User Group! :) [[User:Varnent|Varnent]] ([[User talk:Varnent|talk]])<sup>([[m:User:Varnent/COI|COI]])</sup> 21:33, 11 November 2014 (UTC) ::Fantastic news! Thank you! :) [[User:Palexis|Palexis]] ([[User talk:Palexis|talk]]) 23:01, 11 November 2014 (UTC) ::Indeed, great news! Thanks a ton ... Cheers [[User:Kghbln|&#91;&#91;kgh&#93;&#93;]] ([[User talk:Kghbln|talk]]) 14:33, 12 November 2014 (UTC) {{Archive bottom}} == Improve group's page == Hi. I think users will reach [[MediaWiki Stakeholders' Group]] pretty frequently and it's pretty... bad currently. The lede is very weak and it's very difficult to get even a basic understanding of what this group is and what it does (or doesn't do). I just made a first-pass at improving the intro, but I don't know enough to do so as well as some others, I imagine. What's the difference between the MediaWiki Cooperation and the MediaWiki Stakeholders' Group? Simple rename? [[Groups/Proposals/MediaWiki Cooperation]] didn't seem to explain this. [[User:MZMcBride|MZMcBride]] ([[User talk:MZMcBride|talk]]) 00:22, 14 November 2014 (UTC) :I just moved you opinion and suggestion to a new thread and hope that you do not mind. :Indeed this page needs to be further improved. As for the difference between the names: I extended the proposal's page to provide information on this. Thank you for your input and question! [[User:Kghbln|&#91;&#91;kgh&#93;&#93;]] ([[User talk:Kghbln|talk]]) 14:51, 14 November 2014 (UTC) == VisualEditor triage meetings == Hi, I'm pretty sure you all receive most of the tech-related Wikimedia mailing lists, but in case you hadn't heard about the upcoming VE triage meetings yet, please [[Talk:VisualEditor/Portal#How_to_join_the_triage_meetings|read details here]]: the first meeting is Wednesday 11 February and we're looking forward to seeing lots of regular and new MediaWiki code contributors there. Best, [[User:Elitre (WMF)|Elitre (WMF)]] ([[User talk:Elitre (WMF)|talk]]) 20:08, 10 February 2015 (UTC) :Thanks for this notice. I couldn't make it on this time, but will definitely spread the news and try to attend the next one. [[User:Mglaser|Mglaser]] ([[User talk:Mglaser|talk]]) 23:38, 20 February 2015 (UTC) == [[m:Special:MyLanguage/Wikimedia Foundation elections 2015/Call for candidates|Nominations are being accepted for 2015 Wikimedia Foundation elections]] == ''This is a message from the [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015/Committee 2015 Wikimedia Foundation Elections Committee]. [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015/MassMessages/Accepting&#x20;nominations Translations] are available.'' Greetings, I am pleased to announce that nominations are now being accepted for the 2015 Wikimedia Foundation Elections. This year the Board and the FDC Staff are looking for a diverse set of candidates from regions and projects that are traditionally under-represented on the board and in the movement as well as candidates with experience in technology, product or finance. To this end they have [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015/Call&#x20;for&#x20;candidates published letters] describing what they think is needed and, recognizing that those who know the community the best are the community themselves, the election committee is [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015 accepting nominations] for community members you think should run and will reach out to those nominated to provide them with information about the job and the election process. This year, elections are being held for the following roles: ''Board of Trustees''<br /> The Board of Trustees is the decision-making body that is ultimately responsible for the long term sustainability of the Foundation, so we value wide input into its selection. There are three positions being filled. More information about this role can be found at [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections/Board&#x20;elections/2015 the board elections page]. ''Funds Dissemination Committee (FDC)''<br /> The Funds Dissemination Committee (FDC) makes recommendations about how to allocate Wikimedia movement funds to eligible entities. There are five positions being filled. More information about this role can be found at [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections/FDC&#x20;elections/2015 the FDC elections page]. ''Funds Dissemination Committee (FDC) Ombud''<br /> The FDC Ombud receives complaints and feedback about the FDC process, investigates complaints at the request of the Board of Trustees, and summarizes the investigations and feedback for the Board of Trustees on an annual basis. One position is being filled. More information about this role can be found at [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections/FDC&#x20;Ombudsperson&#x20;elections/2015 the FDC Ombudsperson elections page]. The candidacy submission phase lasts from 00:00 UTC April 20 to 23:59 UTC May 5 for the Board and from 00:00 UTCApril 20 to 23:59 UTC April 30 for the FDC and FDC Ombudsperson. This year, we are accepting both self-nominations and nominations of others. More information on this election and the nomination process can be found on [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015 the 2015 Wikimedia elections page on Meta-Wiki]. Please feel free to post a note about the election on your project's village pump. Any questions related to the election can be posted on the talk page on Meta, or sent to the election committee's mailing list, board-elections -at- wikimedia.org On behalf of the Elections Committee,<br /> -Gregory Varnum ([//meta.wikimedia.org/wiki/User:Varnent User:Varnent])<br /> Coordinator, [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015/Committee 2015 Wikimedia Foundation Elections Committee] ''Posted by the [//meta.wikimedia.org/wiki/User:MediaWiki&#x20;message&#x20;delivery MediaWiki message delivery] on behalf of the [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015/Committee 2015 Wikimedia Foundation Elections Committee], 04:56, 21 April 2015 (UTC) • [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015/MassMessages/Accepting&#x20;nominations Translate] • [//meta.wikimedia.org/wiki/Talk:Wikimedia&#x20;Foundation&#x20;elections&#x20;2015 Get help]'' <!-- Message sent by User:Varnent@metawiki using the list at http://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=11918788 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 04:56, 21 April 2015 (UTC) == [[m:Special:MyLanguage/Affiliations Committee/RFCs/Wikimedia user groups approval process and agreements - Spring 2015|Requests for comments on Wikimedia user groups approval process and agreements]] == [[File:Affiliations Committee logo.svg|100px|right|link=m:Special:MyLanguage/Affiliations Committee]] ''This is an [//meta.wikimedia.org/wiki/Special:MyLanguage/Global&#x20;message&#x20;delivery/Targets/Affiliations&#x20;Committee/News update] from the [//meta.wikimedia.org/wiki/Special:MyLanguage/Affiliations&#x20;Committee Wikimedia Affiliations Committee]. [//meta.wikimedia.org/wiki/Special:MyLanguage/Affiliations&#x20;Committee/MassMessages/Wikimedia&#x20;user&#x20;groups&#x20;approval&#x20;process&#x20;and&#x20;agreements&#x20;RFC&#x20;-&#x20;April&#x20;2015 Translations] are available.'' The [//meta.wikimedia.org/wiki/Special:MyLanguage/Affiliations&#x20;Committee Wikimedia Affiliations Committee] is [//meta.wikimedia.org/wiki/Special:MyLanguage/Affiliations&#x20;Committee/RFCs/Wikimedia&#x20;user&#x20;groups&#x20;approval&#x20;process&#x20;and&#x20;agreements&#x20;-&#x20;Spring&#x20;2015 requesting comments] on the approval process and agreements for [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;user&#x20;groups Wikimedia user groups]. Wikimedia user groups are groups of Wikimedia users who support and promote the Wikimedia projects in the offline world by organizing meetups and other projects. The Wikimedia Affiliations Committee's responsibilities include approval of new Wikimedia user groups. The committee will seek community input until Friday, May 1, 2015. The committee will then review the community's input, and publish the new process and agreements on Meta-Wiki. The committee will again seek community input approximately six months after any changes are adopted to gauge effectiveness and if any additional changes are necessary. Please see [//meta.wikimedia.org/wiki/Special:MyLanguage/Affiliations&#x20;Committee/RFCs/Wikimedia&#x20;user&#x20;groups&#x20;approval&#x20;process&#x20;and&#x20;agreements&#x20;-&#x20;Spring&#x20;2015 the RFC page on Meta-Wiki] for more information and to provide feedback. Thank you - [//meta.wikimedia.org/wiki/Special:MyLanguage/Affiliations&#x20;Committee Wikimedia Affiliations Committee] ''Posted by [//meta.wikimedia.org/wiki/Special:MyLanguage/User:MediaWiki&#x20;message&#x20;delivery MediaWiki message delivery] on behalf of the [//meta.wikimedia.org/wiki/Special:MyLanguage/Affiliations&#x20;Committee Affiliations Committee], 04:26, 24 April 2015 (UTC) • [//meta.wikimedia.org/wiki/Special:MyLanguage/Affiliations&#x20;Committee/MassMessages/Wikimedia&#x20;user&#x20;groups&#x20;approval&#x20;process&#x20;and&#x20;agreements&#x20;RFC&#x20;-&#x20;April&#x20;2015 Translate] • [//meta.wikimedia.org/wiki/Special:MyLanguage/Affiliations&#x20;Committee Get help] • [//meta.wikimedia.org/wiki/Special:MyLanguage/Global&#x20;message&#x20;delivery/Targets/Affiliations&#x20;Committee/News Subscribe or unsubscribe].'' <!-- Message sent by User:Varnent@metawiki using the list at http://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=11918788 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 04:27, 24 April 2015 (UTC) == [[m:Special:MyLanguage/Wikimedia Foundation elections 2015/MassMessages/FDC voting has begun|Wikimedia Foundation Funds Dissemination Committee elections 2015]] == [[File:Wikimedia Foundation RGB logo with text.svg|right|75px|link=m:Special:MyLanguage/Wikimedia Foundation elections 2015/MassMessages/FDC voting has begun]] ''This is a message from the [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015/Committee 2015 Wikimedia Foundation Elections Committee]. [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015/MassMessages/FDC&#x20;voting&#x20;has&#x20;begun Translations] are available.'' [//meta.wikimedia.org/wiki/Special:SecurePoll/vote/336 Voting has begun] for [//meta.wikimedia.org/wiki/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015#Requirements eligible voters] in the 2015 elections for the ''[//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections/FDC&#x20;elections/2015 Funds Dissemination Committee]'' (FDC) and ''[//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections/FDC&#x20;Ombudsperson&#x20;elections/2015 FDC Ombudsperson]''. Questions and discussion with the candidates for the ''[//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections/FDC&#x20;elections/2015/Questions Funds Dissemination Committee]'' (FDC) and ''[//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections/FDC&#x20;Ombudsperson&#x20;elections/2015/Questions FDC Ombudsperson]'' will continue during the voting. Nominations for the ''[//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections/Board&#x20;elections/2015 Board of Trustees]'' will be accepted until 23:59 UTC May 5. The ''[//meta.wikimedia.org/wiki/Special:MyLanguage/Grants:APG/Funds&#x20;Dissemination&#x20;Committee Funds Dissemination Committee]'' (FDC) makes recommendations about how to allocate Wikimedia movement funds to eligible entities. There are five positions on the committee being filled. The ''[//meta.wikimedia.org/wiki/Special:MyLanguage/Grants:APG/Funds&#x20;Dissemination&#x20;Committee/Ombudsperson&#x20;role,&#x20;expectations,&#x20;and&#x20;selection&#x20;process FDC Ombudsperson]'' receives complaints and feedback about the FDC process, investigates complaints at the request of the [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;Board&#x20;of&#x20;Trustees Board of Trustees], and summarizes the investigations and feedback for the Board of Trustees on an annual basis. One position is being filled. The voting phase lasts from 00:00 UTC May 3 to 23:59 UTC May 10. '''[//meta.wikimedia.org/wiki/Special:SecurePoll/vote/336 Click here to vote].''' Questions and discussion with the candidates will continue during that time. '''[//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections/FDC&#x20;elections/2015/Questions Click here to ask the FDC candidates a question]. [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections/FDC&#x20;Ombudsperson&#x20;elections/2015/Questions Click here to ask the FDC Ombudsperson candidates a question].''' More information on the candidates and the elections can be found on the [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections/FDC&#x20;elections/2015 2015 FDC election page], the [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections/FDC&#x20;Ombudsperson&#x20;elections/2015 2015 FDC Ombudsperson election page], and the [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections/Board&#x20;elections/2015 2015 Board election page] on Meta-Wiki. On behalf of the Elections Committee,<br /> -Gregory Varnum ([//meta.wikimedia.org/wiki/User:Varnent User:Varnent])<br /> Volunteer Coordinator, [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015/Committee 2015 Wikimedia Foundation Elections Committee] ''Posted by the [//meta.wikimedia.org/wiki/Special:MyLanguage/User:MediaWiki&#x20;message&#x20;delivery MediaWiki message delivery] 03:40, 4 May 2015 (UTC) • [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015/MassMessages/FDC&#x20;voting&#x20;has&#x20;begun Translate] • [//meta.wikimedia.org/wiki/Talk:Wikimedia&#x20;Foundation&#x20;elections&#x20;2015 Get help]'' <!-- Message sent by User:Varnent@metawiki using the list at http://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=11918788 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 03:41, 4 May 2015 (UTC) == [https://meta.wikimedia.org/wiki/Special:SecurePoll/vote/339 Wikimedia Foundation Board of Trustees elections 2015] == [[File:Wmf logo vert pms.svg|right|100px|link=metawiki:Special:MyLanguage/Wikimedia Foundation elections 2015/MassMessages/Board voting has begun]] ''This is a message from the [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015/Committee 2015 Wikimedia Foundation Elections Committee]. [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015/MassMessages/Board&#x20;voting&#x20;has&#x20;begun Translations] are available.'' [https://meta.wikimedia.org/wiki/Special:SecurePoll/vote/339?setlang=en Voting has begun] for [//meta.wikimedia.org/wiki/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015#Requirements eligible voters] in the 2015 elections for the ''[//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections/Board&#x20;elections/2015 Wikimedia Foundation Board of Trustees]''. Questions and discussion with the candidates for the ''[//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections/Board&#x20;elections/2015/Questions Board]'' will continue during the voting. The ''[//meta.wikimedia.org/wiki/Wikimedia&#x20;Foundation&#x20;Board&#x20;of&#x20;Trustees Wikimedia Foundation Board of Trustees]'' is the ultimate governing authority of the Wikimedia Foundation, a 501(c)(3) non-profit organization registered in the United States. The Wikimedia Foundation manages many diverse projects such as Wikipedia and Commons. The voting phase lasts from 00:00 UTC May 17 to 23:59 UTC May 31. '''[https://meta.wikimedia.org/wiki/Special:SecurePoll/vote/339?setlang=en Click here to vote].''' More information on the candidates and the elections can be found on the [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections/Board&#x20;elections/2015 2015 ''Board'' election page] on Meta-Wiki. On behalf of the Elections Committee,<br /> -Gregory Varnum ([//meta.wikimedia.org/wiki/User:Varnent User:Varnent])<br /> Volunteer Coordinator, [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015/Committee 2015 Wikimedia Foundation Elections Committee] ''Posted by the [//meta.wikimedia.org/wiki/Special:MyLanguage/User:MediaWiki&#x20;message&#x20;delivery MediaWiki message delivery] 17:20, 17 May 2015 (UTC) • [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation&#x20;elections&#x20;2015/MassMessages/Board&#x20;voting&#x20;has&#x20;begun Translate] • [//meta.wikimedia.org/wiki/Talk:Wikimedia&#x20;Foundation&#x20;elections&#x20;2015 Get help]'' <!-- Message sent by User:Varnent@metawiki using the list at http://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=11918788 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 17:24, 17 May 2015 (UTC) == Sign up HERE! == If you're interested, sign up here! [[Special:Contributions/84.88.37.183|84.88.37.183]] ([[User talk:84.88.37.183|talk]]) 15:54, 28 October 2015 (UTC) :Definitely interested [[User:Rcdeboer|Remco de Boer]] 15:55, 28 October 2015 (UTC) :Me! <span style="color:#d30000">☠</span>[[User:MarkAHershberger|MarkAHershberger]]<span style="color:#d30000">☢</span>([[User_talk:MarkAHershberger|talk]])<span style="color:#d30000">☣</span> 15:56, 28 October 2015 (UTC) :I'm interested! [[User:AdSvS|AdSvS]] ([[User talk:AdSvS|talk]]) 15:57, 28 October 2015 (UTC) :Don't fork! ;-) [[User:Dan Bolser|Dan Bolser]] ([[User talk:Dan Bolser|talk]]) 16:20, 28 October 2015 (UTC) == Roadmap for the stakeholders' group? == [[MediaWiki_Stakeholders'_Group/Tasks/Feature_wishlist]] is working towards a road map of what we want to realize in terms of technical features. I think we should also have such a road map about the stakeholders' group itself: what do we want to realize in terms of e.g. interaction with the foundation? [[User:Rcdeboer|Remco de Boer]] 16:22, 28 October 2015 (UTC) == [[m:Special:MyLanguage/Free Bassel/MassMessages/2015 Free Bassel banner straw poll|Your input requested on the proposed #FreeBassel banner campaign]] == ''This is a message regarding the [//meta.wikimedia.org/wiki/Special:MyLanguage/Free&#x20;Bassel/Banner proposed 2015 Free Bassel banner]. [//meta.wikimedia.org/wiki/Special:MyLanguage/Free&#x20;Bassel/MassMessages/2015&#x20;Free&#x20;Bassel&#x20;banner&#x20;straw&#x20;poll Translations] are available.'' Hi everyone, This is to inform all Wikimedia contributors that a [//meta.wikimedia.org/wiki/Special:MyLanguage/Free&#x20;Bassel/Banner/Straw&#x20;poll straw poll seeking your involvement] has just been started on Meta-Wiki. As some of your might be aware, a small group of Wikimedia volunteers have proposed a banner campaign informing Wikipedia readers about the urgent situation of our fellow Wikipedian, open source software developer and Creative Commons activist, [//en.wikipedia.org/wiki/Bassel&#x20;Khartabil Bassel Khartabil]. An exemplary [//meta.wikimedia.org/wiki/Special:MyLanguage/Free&#x20;Bassel/Banner banner] and an [//meta.wikimedia.org/wiki/Special:MyLanguage/Free&#x20;Bassel/Banner explanatory page] have now been prepared, and translated into about half a dozen languages by volunteer translators. We are seeking [//meta.wikimedia.org/wiki/Special:MyLanguage/Free&#x20;Bassel/Banner/Straw&#x20;poll your involvement to decide] if the global Wikimedia community approves starting a banner campaign asking Wikipedia readers to call on the Syrian government to release Bassel from prison. We understand that a campaign like this would be unprecedented in Wikipedia's history, which is why we're seeking the widest possible consensus among the community. Given Bassel's urgent situation and the resulting tight schedule, we ask everyone to [//meta.wikimedia.org/wiki/Special:MyLanguage/Free&#x20;Bassel/Banner/Straw&#x20;poll get involved with the poll and the discussion] to the widest possible extent, and to promote it among your communities as soon as possible. (Apologies for writing in English; please kindly [//meta.wikimedia.org/wiki/Special:MyLanguage/Free&#x20;Bassel/MassMessages/2015&#x20;Free&#x20;Bassel&#x20;banner&#x20;straw&#x20;poll translate] this message into your own language.) Thank you for your participation! ''Posted by the [//meta.wikimedia.org/wiki/Special:MyLanguage/User:MediaWiki&#x20;message&#x20;delivery MediaWiki message delivery] 21:46, 25 November 2015 (UTC) • [//meta.wikimedia.org/wiki/Special:MyLanguage/Free&#x20;Bassel/MassMessages/2015&#x20;Free&#x20;Bassel&#x20;banner&#x20;straw&#x20;poll Translate] • [//meta.wikimedia.org/wiki/Talk:Free&#x20;Bassel/Banner Get help]'' <!-- Message sent by User:Varnent@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=14822147 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 21:46, 25 November 2015 (UTC) == [[m:Special:MyLanguage/Affiliations Committee/MassMessages/Call for candidates - December 2015|2015 Affiliations Committee call for candidates]] == <div lang="en" dir="ltr" class="mw-content-ltr"> ''This is an [//meta.wikimedia.org/wiki/Special:MyLanguage/Global&#x20;message&#x20;delivery/Targets/Affiliations&#x20;Committee/News update] from the [//meta.wikimedia.org/wiki/Special:MyLanguage/Affiliations&#x20;Committee Wikimedia Affiliations Committee]. [//meta.wikimedia.org/wiki/Special:MyLanguage/Affiliations&#x20;Committee/MassMessages/Call&#x20;for&#x20;candidates&#x20;-&#x20;December&#x20;2015 Translations] are available.'' [[File:Affiliations Committee logo.svg|right|150px]] The '''[//meta.wikimedia.org/wiki/Special:MyLanguage/Affiliations&#x20;Committee Affiliations Committee]''' – the committee responsible for guiding volunteers in establishing Wikimedia chapters, thematic organizations, and user groups – is looking for new members! The main role of the Affiliations Committee is to guide groups of volunteers that are interested in forming Wikimedia affiliates. We review applications from new groups, answer questions and provide advice about the different Wikimedia affiliation models and processes, review affiliate bylaws for compliance with requirements and best practices, and advise the Wikimedia Foundation Board of Trustees on issues connected to chapters, thematic organizations and Wikimedia user groups. The committee consists of twelve members, six of whom are selected every twelve months for staggered two-year terms. ; Key skills Being a part of the Affiliations Committee requires communication with volunteers all over the world, negotiating skills, cultural sensitivity, and the ability to understand legal texts. We try to get a healthy mix of different skill sets in our members. The key skills and experience that we look for in candidates are: * Excitement by the challenge of helping to empower groups of volunteers worldwide. * Willingness to process applications through a set, perhaps bureaucratic process. * Readiness to participate in political discussions on the role and future of affiliates, models of affiliations, and similar questions. * Availability of up to 5 hours per week, and the time to participate in a monthly ~2 hour voice/video meeting. * International orientation. * Very good communication skills in English. * Ability to work and communicate with other languages and cultures. * Strong understanding of the structure and work of affiliates and the WMF. * Knowledge of different legal systems and experience in community building and organising are a plus. * Effective communication skills in other languages are a major plus. * Experience with or in an active affiliate is a major plus. * Willingness to use one's real name in committee activities (including contacts with current and potential affiliates) when appropriate. We are looking for people who are not afraid of the workload and are motivated by helping other volunteers to get organized and form communities that further our mission around the world. ; Selection process As a reflection of our commitment to openness, transparency, and bilateral engagement with the Wikimedia community, the 2015 member selection process will include a public review and comment period. All applications received by the committee will be posted on Meta (at '''[//meta.wikimedia.org/wiki/Special:MyLanguage/Affiliations&#x20;Committee/Candidates/2015 Affiliations Committee/Candidates/2015]'''), and the community will be invited to provide comments and feedback about each candidate. At the end of the public comment period, the applications will be voted on by the members of the committee who are not seeking re-election, taking into account comments put forward by the committee's members, advisors, WMF staff and board liaisons, and the community. A final decision will be made by mid-January 2016, with new members expected to join later that month. ; How to apply If you are interested in joining the committee, please send an application to affcom@lists.wikimedia.org by 31 December 2015. You will get a confirmation that your application was received. Your application should include the following: * Your full name * Your contact information (including e-mail address and username) * A statement describing your relevant experience, skills, and motivation for joining the committee. Your statement will be published for community review and feedback, so please do not include any information that you are not comfortable sharing. If you have any questions, please don't hesitate to email me and/or the committee as a whole. We are happy to chat or have a phone call with anyone about our work if this helps them decide to apply. Please distribute this call among your networks, and do apply if you are interested! Best regards,<br /> Carlos Colina<br /> Chair, Affiliations Committee ''Posted by [//meta.wikimedia.org/wiki/Special:MyLanguage/User:MediaWiki&#x20;message&#x20;delivery MediaWiki message delivery] on behalf of the [//meta.wikimedia.org/wiki/Special:MyLanguage/Affiliations&#x20;Committee Affiliations Committee], 17:59, 9 December 2015 (UTC) • [//meta.wikimedia.org/wiki/Special:MyLanguage/Affiliations&#x20;Committee/MassMessages/Call&#x20;for&#x20;candidates&#x20;-&#x20;December&#x20;2015 {{int:please-translate}}] • [//meta.wikimedia.org/wiki/Special:MyLanguage/Affiliations&#x20;Committee Get help] • [//meta.wikimedia.org/wiki/Special:MyLanguage/Global&#x20;message&#x20;delivery/Targets/Affiliations&#x20;Committee/News Subscribe or unsubscribe].'' </div> <!-- Message sent by User:Varnent@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=14822147 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 17:59, 9 December 2015 (UTC) == [[m:Special:MyLanguage/Wikipedia 15|Get involved in Wikipedia 15!]] == <div lang="en" dir="ltr" class="mw-content-ltr"> ''This is a message from the [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikimedia&#x20;Foundation Wikimedia Foundation]. [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikipedia&#x20;15/MassMessages/Get&#x20;involved Translations] are available.'' [[File:International-Space-Station wordmark blue.svg|right|200px]] As many of you know, January 15 is Wikipedia’s 15th Birthday! People around the world are getting involved in the celebration and have started adding their [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikipedia&#x20;15/Events events on Meta Page]. While we are celebrating Wikipedia's birthday, we hope that all projects and affiliates will be able to utilize this celebration to raise awareness of our community's efforts. Haven’t started planning? Don’t worry, there’s lots of ways to get involved. Here are some ideas: * '''[//meta.wikimedia.org/wiki/Special:MyLanguage/Wikipedia&#x20;15/Events Join/host an event]'''. We already have more than 80, and hope to have many more. * '''[//meta.wikimedia.org/wiki/Special:MyLanguage/Wikipedia&#x20;15/Media Talk to local press]'''. In the past 15 years, Wikipedia has accomplished extraordinary things. We’ve made a [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikipedia&#x20;15/15&#x20;years handy summary] of milestones and encourage you to add your own. More resources, including a [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikipedia&#x20;15/Media#releases press release template] and [//meta.wikimedia.org/wiki/Special:MyLanguage/Communications/Movement&#x20;Communications&#x20;Skills resources on working with the media], are also available. * '''[//meta.wikimedia.org/wiki/Special:MyLanguage/Wikipedia&#x20;15/Material Design a Wikipedia 15 logo]'''. In place of a single icon for Wikipedia 15, we’re making dozens. Add your own with something fun and representative of your community. Just use the visual guide so they share a common sensibility. * '''[//meta.wikimedia.org/wiki/Special:MyLanguage/Wikipedia&#x20;15/Events/Package#birthdaywish Share a message on social media]'''. Tell the world what Wikipedia means to you, and add #wikipedia15 to the post. We might re-tweet or share your message! Everything is linked on the [//meta.wikimedia.org/wiki/Special:MyLanguage/Wikipedia&#x20;15 Wikipedia 15 Meta page]. You’ll find a set of ten data visualization works that you can show at your events, and a [//commons.wikimedia.org/wiki/Category:Wikipedia15&#x20;Mark list of all the Wikipedia 15 logos] that community members have already designed. If you have any questions, please contact [//meta.wikimedia.org/wiki/User:ZMcCune&#x20;(WMF) Zachary McCune] or [//meta.wikimedia.org/wiki/User:JSutherland&#x20;(WMF) Joe Sutherland]. Thanks and Happy nearly Wikipedia 15!<br /> -The Wikimedia Foundation Communications team ''Posted by the [//meta.wikimedia.org/wiki/User:MediaWiki&#x20;message&#x20;delivery MediaWiki message delivery], 20:53, 18 December 2015 (UTC) • [//meta.wikimedia.org/wiki/Wikipedia&#x20;15/MassMessages/Get&#x20;involved {{int:please-translate}}] • [//meta.wikimedia.org/wiki/Talk:Wikipedia&#x20;15 {{int:help}}]'' </div> <!-- Message sent by User:GVarnum-WMF@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=15158196 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 20:53, 18 December 2015 (UTC) == Support for the "MediaWiki Foundation" in the next WMF Annual Plan == In the [[Wikimedia Developer Summit 2016]] there were again conversations about a MediaWiki-centric organization focusing on 3rd party (non-Wikimedia) use cases. If the people interested in this initiative want to influence the next Wikimedia Foundation Annual Plan, the time is now, and the place is [[phab:T127312]]. [[User:Qgil-WMF|Qgil-WMF]] ([[User talk:Qgil-WMF|talk]]) 14:54, 18 February 2016 (UTC) :Thanks for this pointer. As I can see, a few people of Stakeholders have already left their comments. [[User:Mglaser|Mglaser]] ([[User talk:Mglaser|talk]]) 15:26, 22 February 2016 (UTC) == Come work with us == Hi everyone: the Wikimedia Foundation is looking for a Developer Advocate to join our [//meta.wikimedia.org/wiki/Technical&#x20;Collaboration Technical Collaboration] team. S/he will lead [//meta.wikimedia.org/wiki/Technical&#x20;Collaboration/Strategy our strategy] and efforts to engage volunteer developers in Wikimedia software projects and to grow the Wikimedia technical community. You can read the full job description, and apply, [https://boards.greenhouse.io/wikimedia/jobs/228080?t=yfm27u#.V2QNuGPVWx9 on Greenhouse]. Or, you can let somebody else know about this opening! Thanks! [[User:Elitre (WMF)|Elitre (WMF)]] ([[User talk:Elitre (WMF)|talk]]) 15:02, 17 June 2016 (UTC) == Pushing requests to the Developer Wishlist == Hi, two things happened at the Wikimedia developer Summit 2017 that are directly related to the MediaWiki Stakeholders Group: # There was [[Phab:T149586|a meeting]] where we agreed that the group should re-assess their wishlist. # There was another session where a [[Developer Wishlist]] was approved. Both events were not connected, but actually can support each other very well. The MediaWiki Stakeholders Group could submit their wishlist items to the Developer Wishlist, and participate in the survey just like the rest of the Wikimedia and MediaWiki developers. This will place your wishlist items in a general backlog. This action will also fit the idea of taking advantage of existing Wikimedia developer processes. What do you think? The deadline for proposing ideas is '''January 31'''. [[User:Qgil-WMF|Qgil-WMF]] ([[User talk:Qgil-WMF|talk]]) 09:47, 23 January 2017 (UTC) == De-Recognition of Affiliates with Long-standing Non-Compliance == <div lang="en" dir="ltr" class="mw-content-ltr"> ''This is an [[m:Special:MyLanguage/Affiliations Committee/MassMessages|update]] from the [[m:Special:MyLanguage/Affiliations Committee|Wikimedia Affiliations Committee]]. [[m:Special:MyLanguage/Affiliations Committee/MassMessages/De-Recognition of Affiliates with Long-standing Non-Compliance|Translations]] are available.'' Recognition as a Wikimedia affiliate - a chapter, thematic organization, or user group - is a privilege that allows an independent group to officially use the Wikimedia name to further the Wikimedia mission. While most Wikimedia affiliates adhere to the basic compliance standards set forth in their agreements with the Wikimedia Foundation, [[m:Wikimedia movement affiliates/Protocol for noncompliant Wikimedia movement affiliates|a protocol]] has been developed to address the exceptional cases when a Wikimedia affiliate does not meet basic compliance standards and their continued recognition as a Wikimedia affiliate presents a risk to the Wikimedia movement. In the past year, the [[m:Affiliations Committee|Affiliations Committee]] - with support from Wikimedia Foundation staff - has made a concerted effort to address a handful of chapters with long-standing issues of non-compliance. As a result, in the coming days and months, a small number of chapters that have been unable to return to compliance through their efforts in the past year will not have their chapter agreements renewed. As a consequence, these organizations will no longer have the additional rights to use the Wikimedia trademarks, including the Wikimedia name, that had been granted under those agreements. If you have questions about what this means for community members in the affected affiliates’ region or language areas, we have put together a [[m:Wikimedia movement affiliates/Affiliate derecognition FAQ|basic FAQ]]. The [[m:Talk:Wikimedia movement affiliates/Affiliate derecognition FAQ|FAQ talk page]] is available for additional questions and comments, and the [[m:Affiliations Committee|Affiliations Committee]] is happy to answer questions directly. ''Posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|MediaWiki message delivery]] on behalf of the [[m:Special:MyLanguage/Affiliations Committee|Affiliations Committee]], 15:55, 13 February 2017 (UTC) • [[m:Special:MyLanguage/Affiliations Committee/MassMessages/De-Recognition of Affiliates with Long-standing Non-Compliance|{{int:please-translate}}]] • [[m:Special:MyLanguage/Affiliations Committee|Get help]] • [[m:Global message delivery/Targets/Affiliations Committee/Affiliates|Subscribe or unsubscribe]].'' </div> <!-- Message sent by User:GVarnum-WMF@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=16300305 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 15:55, 13 February 2017 (UTC) :Note for others reading this: MediaWiki Stakeholders is still in compliance and is recognised by AffCom. This message is regarding derecognition is an announcement about affiliates like [https://meta.wikimedia.org/w/index.php?title=Wikimedia_Hong_Kong&type=revision&diff=16316490&oldid=15977057 Wikimedia Hong Kong]. <span style="color:#d30000">☠</span>[[User:MarkAHershberger|MarkAHershberger]]<span style="color:#d30000">☢</span>([[User_talk:MarkAHershberger|talk]])<span style="color:#d30000">☣</span> 16:40, 13 February 2017 (UTC) == Review of initial updates on Wikimedia movement strategy process == <div lang="en" dir="ltr" class="mw-content-ltr"> ''Note: Apologies for cross-posting and sending in English. [[m:Strategy/Wikimedia movement/2017/Updates/Initial announcements review|Message is available for translation on Meta-Wiki]].'' The Wikimedia movement is beginning a movement-wide strategy discussion, a process which will run throughout 2017. For 15 years, Wikimedians have worked together to build the largest free knowledge resource in human history. During this time, we've grown from a small group of editors to a diverse network of editors, developers, affiliates, readers, donors, and partners. Today, we are more than a group of websites. We are a movement rooted in values and a powerful vision: all knowledge for all people. As a movement, we have an opportunity to decide where we go from here. This movement strategy discussion will focus on the future of our movement: where we want to go together, and what we want to achieve. We hope to design an inclusive process that makes space for everyone: editors, community leaders, affiliates, developers, readers, donors, technology platforms, institutional partners, and people we have yet to reach. There will be multiple ways to participate including on-wiki, in private spaces, and in-person meetings. You are warmly invited to join and make your voice heard. The immediate goal is to have a strategic direction by Wikimania 2017 to help frame a discussion on how we work together toward that strategic direction. Regular updates are being sent to the [https://lists.wikimedia.org/mailman/listinfo/Wikimedia-l Wikimedia-l mailing list], and posted [[m:Strategy/Wikimedia_movement/2017/Updates|on Meta-Wiki]]. Beginning with this message, monthly reviews of these updates will be sent to this page as well. [[m:Strategy/Wikimedia movement/2017/Updates/Signup|Sign up]] to receive future announcements and monthly highlights of strategy updates on your user talk page. Here is a review of the updates that have been sent so far: * [[m:Strategy/Wikimedia movement/2017/Updates/15 December 2016 - Update 1 on Wikimedia movement strategy process|Update 1 on Wikimedia movement strategy process]] (15 December 2016) ** Introduction to process and information about budget spending resolution to support it * [[m:Strategy/Wikimedia movement/2017/Updates/23 December 2016 - Update 2 on Wikimedia movement strategy process|Update 2 on Wikimedia movement strategy process]] (23 December 2016) ** Start of search for Lead Architect for movement strategy process * [[m:Strategy/Wikimedia movement/2017/Updates/8 January 2017 - Update 3 on Wikimedia movement strategy process|Update 3 on Wikimedia movement strategy process]] (8 January 2017) ** Plans for strategy sessions at upcoming Wikimedia Conference 2017 * [[m:Strategy/Wikimedia movement/2017/Updates/11 January 2017 - Update 4 on Wikimedia movement strategy process|Update 4 on Wikimedia movement strategy process]] (11 January 2017) ** Introduction of williamsworks * [[m:Strategy/Wikimedia movement/2017/Updates/2 February 2017 - Update 5 on Wikimedia movement strategy process|Update 5 on Wikimedia movement strategy process]] (2 February 2017) ** The core movement strategy team, team tracks being developed, introduction of the Community Process Steering Committee, discussions at WikiIndaba conference 2017 and the Wikimedia movement affiliates executive directors gathering in Switzerland * [[m:Strategy/Wikimedia movement/2017/Updates/10 February 2017 - Update 6 on Wikimedia movement strategy process|Update 6 on Wikimedia movement strategy process]] (10 February 2017) ** Tracks A & B process prototypes and providing feedback, updates on development of all four Tracks More information about the movement strategy is available on the [[m:Strategy/Wikimedia movement/2017|Meta-Wiki 2017 Wikimedia movement strategy portal]]. ''Posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|MediaWiki message delivery]] on behalf of the [[m:Special:MyLanguage/Wikimedia Foundation|Wikimedia Foundation]], 20:27, 15 February 2017 (UTC) • [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Updates/Initial announcements review|{{int:please-translate}}]] • [[m:Talk:Strategy/Wikimedia movement/2017/Updates|Get help]]'' </div> <!-- Message sent by User:GVarnum-WMF@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=16300305 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 20:27, 15 February 2017 (UTC) == Overview #2 of updates on Wikimedia movement strategy process == <div lang="en" dir="ltr" class="mw-content-ltr"> ''Note: Apologies for cross-posting and sending in English. [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Updates/Overview 2 of updates on Wikimedia movement strategy process|This message is available for translation on Meta-Wiki]].'' As we mentioned last month, the Wikimedia movement is beginning a movement-wide strategy discussion, a process which will run throughout 2017. This movement strategy discussion will focus on the future of our movement: where we want to go together, and what we want to achieve. Regular updates are being sent to the [https://lists.wikimedia.org/mailman/listinfo/Wikimedia-l Wikimedia-l mailing list], and posted [[m:Special:MyLanguage/Strategy/Wikimedia_movement/2017/Updates|on Meta-Wiki]]. Each month, we are sending overviews of these updates to this page as well. [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Updates/Signup|Sign up]] to receive future announcements and monthly highlights of strategy updates on your user talk page. Here is a overview of the updates that have been sent since our message last month: * [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Updates/16 February 2017 - Update 7 on Wikimedia movement strategy process|Update 7 on Wikimedia movement strategy process]] (16 February 2017) ** Development of documentation for Tracks A & B * [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Updates/24 February 2017 - Update 8 on Wikimedia movement strategy process|Update 8 on Wikimedia movement strategy process]] (24 February 2017) ** Introduction of Track Leads for all four audience tracks * [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Updates/2 March 2017 - Update 9 on Wikimedia movement strategy process|Update 9 on Wikimedia movement strategy process]] (2 March 2017) ** Seeking feedback on documents being used to help facilitate upcoming community discussions More information about the movement strategy is available on the [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017|Meta-Wiki 2017 Wikimedia movement strategy portal]]. ''Posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|MediaWiki message delivery]] on behalf of the [[m:Special:MyLanguage/Wikimedia Foundation|Wikimedia Foundation]], 19:42, 9 March 2017 (UTC) • [[m:Strategy/Wikimedia movement/2017/Updates/Overview 2 of updates on Wikimedia movement strategy process|{{int:please-translate}}]] • [[m:Talk:Strategy/Wikimedia movement/2017/Updates|Get help]]'' </div> <!-- Message sent by User:GVarnum-WMF@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=16396325 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 19:42, 9 March 2017 (UTC) == We invite you to join the movement strategy conversation (now through April 15) == <div class="plainlinks mw-content-ltr" lang="en" dir="ltr"><div class="plainlinks"> : ''This message, "[[mailarchive:wikimediaannounce-l/2017-March/001383.html|We invite you to join the movement strategy conversation (now through April 15)]]", was sent through multiple channels by [[m:User:GVarnum-WMF|Gregory Varnum]] on 15 and 16 of March 2017 to village pumps, affiliate talk pages, movement mailing lists, and MassMessage groups. A similar message was sent by [[m:User:Nicole_Ebber_(WMDE)|Nicole Ebber]] to organized groups and their mailing lists on 15 of March 2017. This version of the message is available for translation and documentation purposes'' Dear Wikimedians/Wikipedians: Today we are starting a broad discussion to define Wikimedia's future role in the world and develop a collaborative strategy to fulfill that role. You are warmly invited to join the conversation. There are many ways to participate, by joining an existing conversation or starting your own: [[m:Special:MyLanguage/Strategy/Wikimedia_movement/2017/Track_A|Track A (organized groups)]]: Discussions with your affiliate, committee or other organized group (these are groups that support the Wikimedia movement). Track B (individual contributors): [[m:Special:MyLanguage/Strategy/Wikimedia_movement/2017/Cycle_1|On Meta]] or your [[m:Special:MyLanguage/Strategy/Wikimedia_movement/2017/Participate|local language or project wiki]]. This is the first of three conversations, and it will run between now and April 15. The purpose of cycle 1 is to discuss the future of the movement and generate major themes around potential directions. What do we want to build or achieve together over the next 15 years? We welcome you, as we create this conversation together, and look forward to broad and diverse participation from all parts of our movement. * [[m:Special:MyLanguage/Strategy/Wikimedia_movement/2017|Find out more about the movement strategy process]] * [[m:Special:MyLanguage/Strategy/Wikimedia_movement/2017/Toolkit/Discussion_Coordinator_Role|Learn more about volunteering to be a Discussion Coordinator]] Sincerely, Nicole Ebber (Track A Lead), Jaime Anstee (Track B Lead), & the [[m:Special:MyLanguage/Strategy/Wikimedia_movement/2017/People|engagement support teams]]</div></div> 05:00, 18 March 2017 (UTC) <!-- Message sent by User:GVarnum-WMF@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=16396325 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 05:00, 18 March 2017 (UTC) == [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Updates/Start of the 2017 Wikimedia Foundation Board of Trustees elections|Start of the 2017 Wikimedia Foundation Board of Trustees elections]] == <div lang="en" dir="ltr" class="mw-content-ltr"> ''Please accept our apologies for cross-posting this message. [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Updates/Start of the 2017 Wikimedia Foundation Board of Trustees elections|This message is available for translation on Meta-Wiki]].'' [[File:Wikimedia-logo black.svg|right|150px|link=m:Special:MyLanguage/Wikimedia Foundation elections/2017]] On behalf of the Wikimedia Foundation Elections Committee, I am pleased to announce that self-nominations are being accepted for the [[m:Special:MyLanguage/Wikimedia_Foundation_elections/2017/Board_of_Trustees/Call_for_candidates|2017 Wikimedia Foundation Board of Trustees Elections]]. The [[m:Special:MyLanguage/Wikimedia Foundation Board of Trustees|Board of Trustees]] (Board) is the decision-making body that is ultimately responsible for the long-term sustainability of the Wikimedia Foundation, so we value wide input into its selection. More information about this role can be found [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Board of Trustees|on Meta-Wiki]]. Please read the [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Board of Trustees/Call for candidates|letter from the Board of Trustees calling for candidates]]. '''The [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Board of Trustees/Candidates|candidacy submission phase]] will last from April 7 (00:00 UTC) to April 20 (23:59 UTC).''' '''We will also be accepting questions to ask the candidates from April 7 to April 20. [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Board of Trustees/Questions|You can submit your questions on Meta-Wiki]].''' Once the questions submission period has ended on April 20, the Elections Committee will then collate the questions for the candidates to respond to beginning on April 21. The goal of this process is to fill the '''three community-selected seats''' on the Wikimedia Foundation Board of Trustees. The election results will be used by the Board itself to select its new members. The full schedule for the Board elections is as follows. All dates are '''inclusive''', that is, from the beginning of the first day (UTC) to the end of the last. * April 7 (00:00 UTC) – April 20 (23:59 UTC) – '''Board nominations''' * April 7 – April 20 – '''Board candidates questions submission period''' * April 21 – April 30 – '''Board candidates answer questions''' * May 1 – May 14 – '''Board voting period''' * May 15–19 – '''Board vote checking''' * May 20 – '''Board result announcement goal''' In addition to the Board elections, we will also soon be holding elections for the following roles: * '''Funds Dissemination Committee (FDC)''' ** There are five positions being filled. More information about this election will be available [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Funds Dissemination Committee|on Meta-Wiki]]. * '''Funds Dissemination Committee Ombudsperson (Ombuds)''' ** One position is being filled. More information about this election will be available [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Funds Dissemination Committee Ombudsperson|on Meta-Wiki]]. Please note that this year the Board of Trustees elections will be held before the FDC and Ombuds elections. Candidates who are not elected to the Board are explicitly permitted and encouraged to submit themselves as candidates to the FDC or Ombuds positions after the results of the Board elections are announced. More information on this year's elections can be found [[m:Special:MyLanguage/Wikimedia Foundation elections/2017|on Meta-Wiki]]. Any questions related to the election can be posted on the [[m:Talk:Wikimedia Foundation elections/2017|election talk page on Meta-Wiki]], or sent to the election committee's mailing list, <tt dir="ltr" style="white-space:nowrap;font-size:12px;line-height:1.5">board-elections<span class="mw-valign-middle"><span>[[File:At sign.svg|link=|alt=(at)|15x15px]]</span></span>wikimedia.org</tt>. On behalf of the Election Committee,<br /> [[m:User:KTC|Katie Chan]], Chair, [[m:Special:MyLanguage/Wikimedia Foundation elections committee|Wikimedia Foundation Elections Committee]]<br /> [[m:User:JSutherland (WMF)|Joe Sutherland]], Community Advocate, Wikimedia Foundation ''Posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|MediaWiki message delivery]] on behalf of the [[m:Special:MyLanguage/Wikimedia Foundation elections committee|Wikimedia Foundation Elections Committee]], 03:35, 7 April 2017 (UTC) • [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Updates/Start of the 2017 Wikimedia Foundation Board of Trustees elections|{{int:please-translate}}]] • [[m:Talk:Wikimedia Foundation elections/2017|Get help]]''</div> <!-- Message sent by User:GVarnum-WMF@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=16396325 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 03:35, 7 April 2017 (UTC) == [https://meta.wikimedia.org/wiki/Special:SecurePoll/vote/341?setlang={{CONTENTLANG}} Voting has begun in 2017 Wikimedia Foundation Board of Trustees elections] == <div class="plainlinks mw-content-ltr" lang="en" dir="ltr">[[File:Wikimedia-logo black.svg|right|125px|link=m:Special:MyLanguage/Wikimedia Foundation elections/2017/Updates/Board voting has begun]]''This is a message from the [[m:Special:MyLanguage/Wikimedia Foundation elections committee|Wikimedia Foundation Elections Committee]]. [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Updates/Board voting has begun|Translations]] are available.'' [https://meta.wikimedia.org/wiki/Special:SecurePoll/vote/341?setlang={{CONTENTLANG}}&uselang={{CONTENTLANG}} Voting has begun] for [[m:Wikimedia Foundation elections/2017#Requirements|eligible voters]] in the 2017 elections for the ''[[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Board of Trustees|Wikimedia Foundation Board of Trustees]]''. The [[m:Wikimedia Foundation Board of Trustees|Wikimedia Foundation Board of Trustees]] is the ultimate governing authority of the Wikimedia Foundation, a 501(c)(3) non-profit organization registered in the United States. The Wikimedia Foundation manages many diverse projects such as Wikipedia and Commons. The voting phase lasts from 00:00 UTC May 1 to 23:59 UTC May 14. '''[https://meta.wikimedia.org/wiki/Special:SecurePoll/vote/341?setlang={{CONTENTLANG}}&uselang={{CONTENTLANG}} Click here to vote].''' More information on the candidates and the elections can be found on the [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Board of Trustees|2017 Board of Trustees election page]] on Meta-Wiki. On behalf of the Elections Committee,<br /> [[m:User:KTC|Katie Chan]], Chair, [[m:Special:MyLanguage/Wikimedia Foundation elections committee|Wikimedia Foundation Elections Committee]]<br /> [[User:JSutherland (WMF)|Joe Sutherland]], Community Advocate, Wikimedia Foundation ''Posted by the [[m:Special:MyLanguage/User:MediaWiki message delivery|MediaWiki message delivery]] • [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Updates/Board voting has begun|Translate]] • [[m:Talk:Wikimedia Foundation elections/2017|Get help]]''</div>'' 19:02, 3 May 2017 (UTC)'' <!-- Message sent by User:GVarnum-WMF@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=16683677 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 19:02, 3 May 2017 (UTC) == [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Cycle 2|Join the next cycle of Wikimedia movement strategy discussions (underway until June 12)]] == <div class="plainlinks mw-content-ltr" lang="en" dir="ltr"> :''[[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Updates/Cycle 2 discussions launch|Message is available for translation on Meta-Wiki]]'' [[File:Wikimedia-logo.svg|right|150px]] The Wikimedia movement strategy core team and working groups have completed reviewing the more than 1800 thematic statements we received from the first discussion. They have identified [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Cycle 2|5 themes that were consistent across all the conversations]] - each with their own set of sub-themes. These are not the final themes, just an initial working draft of the core concepts. You are invited to [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Participate|join the online and offline discussions taking place]] on these 5 themes. This round of discussions will take place between now and June 12th. You can discuss as many as you like; we ask you to participate in the ones that are most (or least) important to you. Here are the five themes, each has a page on Meta-Wiki with more information about the theme and how to participate in that theme's discussion: * [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Cycle 2/Healthy, Inclusive Communities|Healthy, Inclusive Communities]] * [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Cycle 2/The Augmented Age|The Augmented Age]] * [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Cycle 2/A Truly Global Movement|A Truly Global Movement]] * [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Cycle 2/The Most Respected Source of Knowledge|The Most Respected Source of Knowledge]] * [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Cycle 2/Engaging in the Knowledge Ecosystem|Engaging in the Knowledge Ecosystem]] On the [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Participate|movement strategy portal on Meta-Wiki]], you can find more information about each of these themes, their discussions, and how to participate. ''Posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|MediaWiki message delivery]] on behalf of the [[m:Special:MyLanguage/Wikimedia Foundation|Wikimedia Foundation]] • [[m:Special:MyLanguage/Strategy/Wikimedia movement/2017/Updates/Cycle 2 discussions launch|{{int:please-translate}}]] • [[m:Talk:Strategy/Wikimedia movement/2017/Updates|Get help]]''</div> 19:24, 16 May 2017 (UTC) <!-- Message sent by User:GVarnum-WMF@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=16683814 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 19:24, 16 May 2017 (UTC) == [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Updates/Start of the 2017 Wikimedia Foundation Funds Dissemination Committee elections|Start of the 2017 Wikimedia Foundation Funds Dissemination Committee elections]] == <div class="plainlinks mw-content-ltr" lang="en" dir="ltr">[[File:Wikimedia-logo black.svg|right|125px|link=m:Special:MyLanguage/Wikimedia Foundation elections/2017/Updates/Start of the 2017 Wikimedia Foundation Funds Dissemination Committee elections]] :''[[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Updates/Start of the 2017 Wikimedia Foundation Funds Dissemination Committee elections|Translations of this message are available on Meta-Wiki]].'' On behalf of the Wikimedia Foundation Elections Committee, we are pleased to announce that self-nominations are being accepted for the [[m:Wikimedia Foundation elections/2017/Funds Dissemination Committee/Call for candidates|2017 Wikimedia Foundation Funds Dissemination Committee]] and [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Funds Dissemination Committee Ombudsperson|Funds Dissemination Committee Ombudsperson]] elections. Please read the letter from the Wikimedia Foundation calling for candidates at [[m:Wikimedia Foundation elections/2017/Funds Dissemination Committee/Call for candidates|on the 2017 Wikimedia Foundation elections portal]]. ''Funds Dissemination Committee''<br /> The Funds Dissemination Committee (FDC) makes recommendations about how to allocate Wikimedia movement funds to eligible entities. There are five positions being filled. More information about this role can be found at [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Funds Dissemination Committee|the FDC elections page]]. ''Funds Dissemination Committee Ombudsperson''<br /> The Funds Dissemination Committee Ombudsperson receives complaints and feedback about the FDC process, investigates complaints at the request of the Board of Trustees, and summarizes the investigations and feedback for the Board of Trustees on an annual basis. One position is being filled. More information about this role can be found at [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Funds Dissemination Committee Ombudsperson|the FDC Ombudsperson elections page]]. '''The [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Funds Dissemination Committee/Candidates|candidacy submission phase]] will last until May 28 (23:59 UTC).''' '''We will also be accepting questions to ask the candidates until May 28. [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Funds Dissemination Committee/Questions|You can submit your questions on Meta-Wiki]].''' Once the questions submission period has ended on May 28, the Elections Committee will then collate the questions for the candidates to respond to. The goal of this process is to fill the '''five community-selected seats''' on the Wikimedia Foundation Funds Dissemination Committee and the '''community-selected ombudsperson'''. The election results will be used by the Board itself to make the appointments. The full schedule for the FDC elections is as follows. All dates are '''inclusive''', that is, from the beginning of the first day (UTC) to the end of the last. * May 15 (00:00 UTC) – May 28 (23:59 UTC) – '''Nominations''' * May 15 – May 28 – '''Candidates questions submission period''' * May 29 – June 2 – '''Candidates answer questions''' * June 3 – June 11 – '''Voting period''' * June 12–14 – '''Vote checking''' * June 15 – '''Goal date for announcing election results''' More information on this year's elections can be found at [[m:Special:MyLanguage/Wikimedia Foundation elections/2017|the 2017 Wikimedia Foundation elections portal]]. Please feel free to post a note about the election on your project's village pump. Any questions related to the election can be posted on [[m:Talk:Wikimedia Foundation elections/2017|the talk page on Meta-Wiki]], or sent to the election committee's mailing list, <tt dir="ltr" style="white-space:nowrap;font-size:12px;line-height:1.5">board-elections<span class="mw-valign-middle"><span>[[File:At sign.svg|link=|alt=(at)|15x15px]]</span></span>wikimedia.org</tt>. On behalf of the Election Committee,<br /> [[m:User:KTC|Katie Chan]], Chair, [[m:Special:MyLanguage/Wikimedia Foundation elections committee|Wikimedia Foundation Elections Committee]]<br /> [[m:User:JSutherland (WMF)|Joe Sutherland]], Community Advocate, Wikimedia Foundation ''Posted by the [[m:Special:MyLanguage/User:MediaWiki message delivery|MediaWiki message delivery]] • [[m:Special:MyLanguage/Wikimedia Foundation elections/2017/Updates/Start of the 2017 Wikimedia Foundation Funds Dissemination Committee elections|Translate]] • [[m:Talk:Wikimedia Foundation elections/2017|Get help]]''</div> 21:03, 23 May 2017 (UTC) <!-- Message sent by User:GVarnum-WMF@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=16804557 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 21:03, 23 May 2017 (UTC) == Learning Quarterly: October 2017 == <div style="width:80%;margin:0% 0% 0% 0%;min-width:40em;"> <div style="float:left; background-color:{{#if: #DCDCDC|#DCDCDC|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 85%|width:85%|}}&quot;> <span style=&quot;font-size: 0.8em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: &quot;>L&E Newsletter / Volume 4 / Issue 14 / October 2017<br /></span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.7em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#00008B&quot;>[[m:Learning and Evaluation/Newsletter/2017/4/14|<span style=&quot;color:#00008B&quot;>Learning Quarterly</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;clear:both;&quot;> <div style=&quot;float:left; background-color:{{#if: #FF5B00|#FF5B00|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: &quot;><span style=&quot;color:#DCDCDC&quot;>Frontpage:</span></span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> [[m:Learning and Evaluation/Newsletter/2017/4/14#learning-days|<span style=&quot;color:#DCDCDC&quot;>#Learning Days</span>]]<br> [[m:Learning and Evaluation/Newsletter/2017/4/14#ce-insights-report|<span style=&quot;color:#DCDCDC&quot;>#CEInsightsReport</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #26A9E0|#26A9E0|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2017/4/14#tuned14|<span style=&quot;color:#DCDCDC&quot;>Stay tuned</span>]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> blogs, events <br/> & more!</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> </div> <div style=&quot;clear:both;&quot;> <div style=&quot;float:left; background-color:{{#if: #00008B|#00008B|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;>{{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC&quot;> [[m:Learning and Evaluation/Newsletter/2017/4/14#Awesome14|<span style=&quot;color:#DCDCDC&quot;>A program in the spotlight:<br/>On-boarding new editors:<br/>The skills-focused approach of WMIL </span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2017/4/14#mark14|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> New AffCom corner, plus learning patterns you can contribute to. </span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:50, 3 November 2017 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=16804557 --> "> <span style="font-size: 0.8em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: ">L&E Newsletter / Volume 4 / Issue 14 / October 2017<br /></span> {{#if: |{{{link 2}}}|}}<span style="font-size: 1.7em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#00008B">[[m:Learning and Evaluation/Newsletter/2017/4/14|<span style="color:#00008B">Learning Quarterly</span>]]</span>{{#if: |<nowiki>]]</nowiki>|}} {{#if: |{{{images}}}|}} </div> <div style="clear:both;"> <div style="float:left; background-color:{{#if: #FF5B00|#FF5B00|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: &quot;><span style=&quot;color:#DCDCDC&quot;>Frontpage:</span></span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> [[m:Learning and Evaluation/Newsletter/2017/4/14#learning-days|<span style=&quot;color:#DCDCDC&quot;>#Learning Days</span>]]<br> [[m:Learning and Evaluation/Newsletter/2017/4/14#ce-insights-report|<span style=&quot;color:#DCDCDC&quot;>#CEInsightsReport</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #26A9E0|#26A9E0|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2017/4/14#tuned14|<span style=&quot;color:#DCDCDC&quot;>Stay tuned</span>]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> blogs, events <br/> & more!</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> </div> <div style=&quot;clear:both;&quot;> <div style=&quot;float:left; background-color:{{#if: #00008B|#00008B|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;>{{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC&quot;> [[m:Learning and Evaluation/Newsletter/2017/4/14#Awesome14|<span style=&quot;color:#DCDCDC&quot;>A program in the spotlight:<br/>On-boarding new editors:<br/>The skills-focused approach of WMIL </span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2017/4/14#mark14|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> New AffCom corner, plus learning patterns you can contribute to. </span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:50, 3 November 2017 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=16804557 --> "> <span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: "><span style="color:#DCDCDC">Frontpage:</span></span> {{#if: |{{{link 2}}}|}}<span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:"><br /> [[m:Learning and Evaluation/Newsletter/2017/4/14#learning-days|<span style="color:#DCDCDC">#Learning Days</span>]]<br> [[m:Learning and Evaluation/Newsletter/2017/4/14#ce-insights-report|<span style="color:#DCDCDC">#CEInsightsReport</span>]]</span>{{#if: |<nowiki>]]</nowiki>|}} {{#if: |{{{images}}}|}} </div> <div style="float:left; background-color:{{#if: #26A9E0|#26A9E0|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2017/4/14#tuned14|<span style=&quot;color:#DCDCDC&quot;>Stay tuned</span>]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> blogs, events <br/> & more!</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> </div> <div style=&quot;clear:both;&quot;> <div style=&quot;float:left; background-color:{{#if: #00008B|#00008B|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;>{{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC&quot;> [[m:Learning and Evaluation/Newsletter/2017/4/14#Awesome14|<span style=&quot;color:#DCDCDC&quot;>A program in the spotlight:<br/>On-boarding new editors:<br/>The skills-focused approach of WMIL </span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2017/4/14#mark14|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> New AffCom corner, plus learning patterns you can contribute to. </span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:50, 3 November 2017 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=16804557 --> "> <span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC">[[m:Learning and Evaluation/Newsletter/2017/4/14#tuned14|<span style="color:#DCDCDC">Stay tuned</span>]]</span> {{#if: |{{{link 2}}}|}}<span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:"><br /> blogs, events <br /> & more!</span>{{#if: |<nowiki>]]</nowiki>|}} {{#if: |{{{images}}}|}} </div> </div> <div style="clear:both;"> <div style="float:left; background-color:{{#if: #00008B|#00008B|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;>{{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC&quot;> [[m:Learning and Evaluation/Newsletter/2017/4/14#Awesome14|<span style=&quot;color:#DCDCDC&quot;>A program in the spotlight:<br/>On-boarding new editors:<br/>The skills-focused approach of WMIL </span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2017/4/14#mark14|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> New AffCom corner, plus learning patterns you can contribute to. </span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:50, 3 November 2017 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=16804557 --> ">{{#if: |{{{link 2}}}|}}<span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC"> [[m:Learning and Evaluation/Newsletter/2017/4/14#Awesome14|<span style="color:#DCDCDC">A program in the spotlight:<br />On-boarding new editors:<br />The skills-focused approach of WMIL </span>]]{{#if: |<nowiki>]]</nowiki>|}} {{#if: |{{{images}}}|}} </div> <div style="float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2017/4/14#mark14|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> New AffCom corner, plus learning patterns you can contribute to. </span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:50, 3 November 2017 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=16804557 --> "> <span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC">[[m:Learning and Evaluation/Newsletter/2017/4/14#mark14|<span style="color:#DCDCDC">Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF"><br /> New AffCom corner, plus learning patterns you can contribute to. </span>{{#if: |<nowiki>]]</nowiki>|}} {{#if: ||}} </div> </div> <div style="clear:both;"> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:50, 3 November 2017 (UTC) </div></div> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=16804557 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:50, 3 November 2017 (UTC) == Learning Quarterly: January 2018 == <div style="width:80%;margin:0% 0% 0% 0%;min-width:40em;"> <div style="float:left; background-color:{{#if: #DCDCDC|#DCDCDC|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 85%|width:85%|}}&quot;> <span style=&quot;font-size: 1.2em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: &quot;>L&E Newsletter / Volume 5 / Issue 15 / January 2018<br /></span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.7em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#00008B&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/15|<span style=&quot;color:#00008B&quot;>Learning Quarterly</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;clear:both;&quot;> <div style=&quot;float:left; background-color:{{#if: #FF5B00|#FF5B00|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: &quot;><span style=&quot;color:#DCDCDC&quot;>Frontpage:</span></span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> [[m:Learning and Evaluation/Newsletter/2018/5/15#LeadershipDevelopment|<span style=&quot;color:#DCDCDC&quot;>#LeadershipDevelopment</span>]]<br> [[m:Learning and Evaluation/Newsletter/2018/5/15#CaseStudies|<span style=&quot;color:#DCDCDC&quot;>#CaseStudies</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #26A9E0|#26A9E0|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/15#tuned15|<span style=&quot;color:#DCDCDC&quot;>Stay tuned</span>]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> blogs, events <br/> & more!</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> </div> <div style=&quot;clear:both;&quot;> <div style=&quot;float:left; background-color:{{#if: #00008B|#00008B|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;>{{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC&quot;> [[m:Learning and Evaluation/Newsletter/2018/5/15#Awesome15|<span style=&quot;color:#DCDCDC&quot;>A program in the spotlight:<br/>Raising awareness of Wikipedia in Nigeria, one radio program at a time</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/15#mark15|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> Inspire New Readers campaign, and AffCom elections</span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:45, 3 November 2017 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=17462105 --> "> <span style="font-size: 1.2em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: ">L&E Newsletter / Volume 5 / Issue 15 / January 2018<br /></span> {{#if: |{{{link 2}}}|}}<span style="font-size: 1.7em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#00008B">[[m:Learning and Evaluation/Newsletter/2018/5/15|<span style="color:#00008B">Learning Quarterly</span>]]</span>{{#if: |<nowiki>]]</nowiki>|}} {{#if: |{{{images}}}|}} </div> <div style="clear:both;"> <div style="float:left; background-color:{{#if: #FF5B00|#FF5B00|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: &quot;><span style=&quot;color:#DCDCDC&quot;>Frontpage:</span></span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> [[m:Learning and Evaluation/Newsletter/2018/5/15#LeadershipDevelopment|<span style=&quot;color:#DCDCDC&quot;>#LeadershipDevelopment</span>]]<br> [[m:Learning and Evaluation/Newsletter/2018/5/15#CaseStudies|<span style=&quot;color:#DCDCDC&quot;>#CaseStudies</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #26A9E0|#26A9E0|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/15#tuned15|<span style=&quot;color:#DCDCDC&quot;>Stay tuned</span>]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> blogs, events <br/> & more!</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> </div> <div style=&quot;clear:both;&quot;> <div style=&quot;float:left; background-color:{{#if: #00008B|#00008B|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;>{{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC&quot;> [[m:Learning and Evaluation/Newsletter/2018/5/15#Awesome15|<span style=&quot;color:#DCDCDC&quot;>A program in the spotlight:<br/>Raising awareness of Wikipedia in Nigeria, one radio program at a time</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/15#mark15|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> Inspire New Readers campaign, and AffCom elections</span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:45, 3 November 2017 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=17462105 --> "> <span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: "><span style="color:#DCDCDC">Frontpage:</span></span> {{#if: |{{{link 2}}}|}}<span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:"><br /> [[m:Learning and Evaluation/Newsletter/2018/5/15#LeadershipDevelopment|<span style="color:#DCDCDC">#LeadershipDevelopment</span>]]<br> [[m:Learning and Evaluation/Newsletter/2018/5/15#CaseStudies|<span style="color:#DCDCDC">#CaseStudies</span>]]</span>{{#if: |<nowiki>]]</nowiki>|}} {{#if: |{{{images}}}|}} </div> <div style="float:left; background-color:{{#if: #26A9E0|#26A9E0|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/15#tuned15|<span style=&quot;color:#DCDCDC&quot;>Stay tuned</span>]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> blogs, events <br/> & more!</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> </div> <div style=&quot;clear:both;&quot;> <div style=&quot;float:left; background-color:{{#if: #00008B|#00008B|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;>{{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC&quot;> [[m:Learning and Evaluation/Newsletter/2018/5/15#Awesome15|<span style=&quot;color:#DCDCDC&quot;>A program in the spotlight:<br/>Raising awareness of Wikipedia in Nigeria, one radio program at a time</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/15#mark15|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> Inspire New Readers campaign, and AffCom elections</span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:45, 3 November 2017 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=17462105 --> "> <span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC">[[m:Learning and Evaluation/Newsletter/2018/5/15#tuned15|<span style="color:#DCDCDC">Stay tuned</span>]]</span> {{#if: |{{{link 2}}}|}}<span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:"><br /> blogs, events <br /> & more!</span>{{#if: |<nowiki>]]</nowiki>|}} {{#if: |{{{images}}}|}} </div> </div> <div style="clear:both;"> <div style="float:left; background-color:{{#if: #00008B|#00008B|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;>{{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC&quot;> [[m:Learning and Evaluation/Newsletter/2018/5/15#Awesome15|<span style=&quot;color:#DCDCDC&quot;>A program in the spotlight:<br/>Raising awareness of Wikipedia in Nigeria, one radio program at a time</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/15#mark15|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> Inspire New Readers campaign, and AffCom elections</span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:45, 3 November 2017 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=17462105 --> ">{{#if: |{{{link 2}}}|}}<span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC"> [[m:Learning and Evaluation/Newsletter/2018/5/15#Awesome15|<span style="color:#DCDCDC">A program in the spotlight:<br />Raising awareness of Wikipedia in Nigeria, one radio program at a time</span>]]{{#if: |<nowiki>]]</nowiki>|}} {{#if: |{{{images}}}|}} </div> <div style="float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/15#mark15|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> Inspire New Readers campaign, and AffCom elections</span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:45, 3 November 2017 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=17462105 --> "> <span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC">[[m:Learning and Evaluation/Newsletter/2018/5/15#mark15|<span style="color:#DCDCDC">Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF"><br /> Inspire New Readers campaign, and AffCom elections</span>{{#if: |<nowiki>]]</nowiki>|}} {{#if: ||}} </div> </div> <div style="clear:both;"> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:45, 3 November 2017 (UTC) </div></div> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=17462105 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 19:33, 1 February 2018 (UTC) == Share your feedback in this global Wikimedia survey == Dear Wikimedia Affiliates,<br /> My name is [[m:user:MCruz|María Cruz]] and I work for the Wikimedia Foundation on the Learning and Evaluation team. In one week or so, the Foundation is starting a global survey to learn about the experiences and feedback of Wikimedians. I am writing here, because I wanted to share with you a bit more about the project. <br /> The survey is called "Wikimedia Communities and Contributors" and is conducted annually. We will send the survey to editors across all the Wikimedia projects, as well as Wikimedia affiliates and volunteer developers. This survey is going to be our way of making sure that we can hear feedback from a significant number of users from across the projects. This research supports editors and Wikipedia’s mission. This is our second annual CE Insights survey, and we look forward to improving it every year. <br /> '''We will be contacting 2 people from each affiliate, based on the primary contact information that we have. Each affiliate will receive an additional third link which they can distribute to any leader in their chapter or user group.'''<br /> Go to [[Community Engagement Insights|the project page]] to see the results of last year’s survey, and to see how your feedback helps the Wikimedia Foundation support communities. You can [[Community Engagement Insights/Thank you|sign up]] to be notified about the results of the survey, or to learn how you can help with planning the survey next year. <br /> If you have any questions or concerns about this project, please feel free to send them to [[User talk:EGalvez (WMF)|Edward Galvez's talk page on Meta-Wiki]] or email him directly at surveys{{at}}wikimedia{{dot}}org in any language. You can [[Community Engagement Insights/Frequent questions|learn more about this project]] and read about [[Community Engagement Insights/Frequently asked questions|frequently asked questions]]. You can also share your [[Community Engagement Insights/Feedback|feedback]] on Meta-Wiki. <br /> Thank you for your time supporting this project! <br> [[m:user:MCruz (WMF)|María Cruz]]<br /> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=17462105 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 23:42, 19 March 2018 (UTC) == Learning Quarterly: June 2018 == <div style="width:80%;margin:0% 0% 0% 0%;min-width:40em;"> <div style="float:left; background-color:{{#if: #DCDCDC|#DCDCDC|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 85%|width:85%|}}&quot;> <span style=&quot;font-size: 1.2em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: &quot;>L&E Newsletter / Volume 5 / Issue 16 / June 2018<br /></span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.7em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#00008B&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/16|<span style=&quot;color:#00008B&quot;>Learning Quarterly</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;clear:both;&quot;> <div style=&quot;float:left; background-color:{{#if: #FF5B00|#FF5B00|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: &quot;><span style=&quot;color:#DCDCDC&quot;>Frontpage:</span></span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> [[m:Learning and Evaluation/Newsletter/2018/5/16#wikiwomen|<span style=&quot;color:#DCDCDC&quot;>#WikiWomen</span>]]<br> [[m:Learning and Evaluation/Newsletter/2018/5/16#wikieduasia|<span style=&quot;color:#DCDCDC&quot;>#WikiEduAsia</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #26A9E0|#26A9E0|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/16#tuned16|<span style=&quot;color:#DCDCDC&quot;>Stay tuned</span>]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> blogs, events <br/> & more!</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> </div> <div style=&quot;clear:both;&quot;> <div style=&quot;float:left; background-color:{{#if: #00008B|#00008B|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;>{{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC&quot;> [[m:Learning and Evaluation/Newsletter/2018/5/16#Awesome16|<span style=&quot;color:#DCDCDC&quot;>A program in the spotlight:<br/>Karvachar’s WikiClub, when getting knowledge is cool</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/16#mark16|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> Inspire New Readers campaign, and AffCom elections</span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:45, 3 November 2017 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=17368180 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=17697586 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=18126821 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=17856406 --> "> <span style="font-size: 1.2em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: ">L&E Newsletter / Volume 5 / Issue 16 / June 2018<br /></span> {{#if: |{{{link 2}}}|}}<span style="font-size: 1.7em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#00008B">[[m:Learning and Evaluation/Newsletter/2018/5/16|<span style="color:#00008B">Learning Quarterly</span>]]</span>{{#if: |<nowiki>]]</nowiki>|}} {{#if: |{{{images}}}|}} </div> <div style="clear:both;"> <div style="float:left; background-color:{{#if: #FF5B00|#FF5B00|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: &quot;><span style=&quot;color:#DCDCDC&quot;>Frontpage:</span></span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> [[m:Learning and Evaluation/Newsletter/2018/5/16#wikiwomen|<span style=&quot;color:#DCDCDC&quot;>#WikiWomen</span>]]<br> [[m:Learning and Evaluation/Newsletter/2018/5/16#wikieduasia|<span style=&quot;color:#DCDCDC&quot;>#WikiEduAsia</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #26A9E0|#26A9E0|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/16#tuned16|<span style=&quot;color:#DCDCDC&quot;>Stay tuned</span>]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> blogs, events <br/> & more!</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> </div> <div style=&quot;clear:both;&quot;> <div style=&quot;float:left; background-color:{{#if: #00008B|#00008B|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;>{{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC&quot;> [[m:Learning and Evaluation/Newsletter/2018/5/16#Awesome16|<span style=&quot;color:#DCDCDC&quot;>A program in the spotlight:<br/>Karvachar’s WikiClub, when getting knowledge is cool</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/16#mark16|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> Inspire New Readers campaign, and AffCom elections</span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:45, 3 November 2017 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=17368180 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=17697586 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=18126821 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=17856406 --> "> <span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: "><span style="color:#DCDCDC">Frontpage:</span></span> {{#if: |{{{link 2}}}|}}<span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:"><br /> [[m:Learning and Evaluation/Newsletter/2018/5/16#wikiwomen|<span style="color:#DCDCDC">#WikiWomen</span>]]<br> [[m:Learning and Evaluation/Newsletter/2018/5/16#wikieduasia|<span style="color:#DCDCDC">#WikiEduAsia</span>]]</span>{{#if: |<nowiki>]]</nowiki>|}} {{#if: |{{{images}}}|}} </div> <div style="float:left; background-color:{{#if: #26A9E0|#26A9E0|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/16#tuned16|<span style=&quot;color:#DCDCDC&quot;>Stay tuned</span>]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> blogs, events <br/> & more!</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> </div> <div style=&quot;clear:both;&quot;> <div style=&quot;float:left; background-color:{{#if: #00008B|#00008B|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;>{{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC&quot;> [[m:Learning and Evaluation/Newsletter/2018/5/16#Awesome16|<span style=&quot;color:#DCDCDC&quot;>A program in the spotlight:<br/>Karvachar’s WikiClub, when getting knowledge is cool</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/16#mark16|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> Inspire New Readers campaign, and AffCom elections</span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:45, 3 November 2017 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=17368180 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=17697586 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=18126821 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=17856406 --> "> <span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC">[[m:Learning and Evaluation/Newsletter/2018/5/16#tuned16|<span style="color:#DCDCDC">Stay tuned</span>]]</span> {{#if: |{{{link 2}}}|}}<span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:"><br /> blogs, events <br /> & more!</span>{{#if: |<nowiki>]]</nowiki>|}} {{#if: |{{{images}}}|}} </div> </div> <div style="clear:both;"> <div style="float:left; background-color:{{#if: #00008B|#00008B|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;>{{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC&quot;> [[m:Learning and Evaluation/Newsletter/2018/5/16#Awesome16|<span style=&quot;color:#DCDCDC&quot;>A program in the spotlight:<br/>Karvachar’s WikiClub, when getting knowledge is cool</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/16#mark16|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> Inspire New Readers campaign, and AffCom elections</span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:45, 3 November 2017 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=17368180 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=17697586 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=18126821 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=17856406 --> ">{{#if: |{{{link 2}}}|}}<span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC"> [[m:Learning and Evaluation/Newsletter/2018/5/16#Awesome16|<span style="color:#DCDCDC">A program in the spotlight:<br />Karvachar’s WikiClub, when getting knowledge is cool</span>]]{{#if: |<nowiki>]]</nowiki>|}} {{#if: |{{{images}}}|}} </div> <div style="float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/16#mark16|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> Inspire New Readers campaign, and AffCom elections</span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:45, 3 November 2017 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=17368180 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=17697586 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=18126821 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=17856406 --> "> <span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC">[[m:Learning and Evaluation/Newsletter/2018/5/16#mark16|<span style="color:#DCDCDC">Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF"><br /> Inspire New Readers campaign, and AffCom elections</span>{{#if: |<nowiki>]]</nowiki>|}} {{#if: ||}} </div> </div> <div style="clear:both;"> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:45, 3 November 2017 (UTC) </div></div> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=17368180 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=17697586 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Learning_Quarterly&oldid=18126821 --> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=17856406 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 03:53, 14 June 2018 (UTC) == Learning Quarterly: November 2018 == <div style="width:80%;margin:0% 0% 0% 0%;min-width:40em;"> <div style="float:left; background-color:{{#if: #DCDCDC|#DCDCDC|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 85%|width:85%|}}&quot;> <span style=&quot;font-size: 1.2em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: &quot;>L&E Newsletter / Volume 5 / Issue 17 / November 2018<br /></span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.7em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#00008B&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/17|<span style=&quot;color:#00008B&quot;>Learning Quarterly</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;clear:both;&quot;> <div style=&quot;float:left; background-color:{{#if: #FF5B00|#FF5B00|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: &quot;><span style=&quot;color:#DCDCDC&quot;>Frontpage:</span></span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> [[m:Learning and Evaluation/Newsletter/2018/5/17#ce-insights18|<span style=&quot;color:#DCDCDC&quot;>#CEInsights18</span>]]<br> [[m:Learning and Evaluation/Newsletter/2018/5/17#genderequity|<span style=&quot;color:#DCDCDC&quot;>#GenderEquity</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #26A9E0|#26A9E0|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/17#tuned17|<span style=&quot;color:#DCDCDC&quot;>Stay tuned</span>]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> blogs, events <br/> & more!</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> </div> <div style=&quot;clear:both;&quot;> <div style=&quot;float:left; background-color:{{#if: #00008B|#00008B|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;>{{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC&quot;> [[m:Learning and Evaluation/Newsletter/2018/5/17#Awesome17|<span style=&quot;color:#DCDCDC&quot;>A program in the spotlight:<br/>Editatona: Writing women back in history</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/17#mark17|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> AffCom corner and Wikimania Poster session</span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 01:10, 29 November 2018 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=18658298 --> "> <span style="font-size: 1.2em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: ">L&E Newsletter / Volume 5 / Issue 17 / November 2018<br /></span> {{#if: |{{{link 2}}}|}}<span style="font-size: 1.7em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#00008B">[[m:Learning and Evaluation/Newsletter/2018/5/17|<span style="color:#00008B">Learning Quarterly</span>]]</span>{{#if: |<nowiki>]]</nowiki>|}} {{#if: |{{{images}}}|}} </div> <div style="clear:both;"> <div style="float:left; background-color:{{#if: #FF5B00|#FF5B00|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: &quot;><span style=&quot;color:#DCDCDC&quot;>Frontpage:</span></span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> [[m:Learning and Evaluation/Newsletter/2018/5/17#ce-insights18|<span style=&quot;color:#DCDCDC&quot;>#CEInsights18</span>]]<br> [[m:Learning and Evaluation/Newsletter/2018/5/17#genderequity|<span style=&quot;color:#DCDCDC&quot;>#GenderEquity</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #26A9E0|#26A9E0|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/17#tuned17|<span style=&quot;color:#DCDCDC&quot;>Stay tuned</span>]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> blogs, events <br/> & more!</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> </div> <div style=&quot;clear:both;&quot;> <div style=&quot;float:left; background-color:{{#if: #00008B|#00008B|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;>{{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC&quot;> [[m:Learning and Evaluation/Newsletter/2018/5/17#Awesome17|<span style=&quot;color:#DCDCDC&quot;>A program in the spotlight:<br/>Editatona: Writing women back in history</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/17#mark17|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> AffCom corner and Wikimania Poster session</span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 01:10, 29 November 2018 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=18658298 --> "> <span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: "><span style="color:#DCDCDC">Frontpage:</span></span> {{#if: |{{{link 2}}}|}}<span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:"><br /> [[m:Learning and Evaluation/Newsletter/2018/5/17#ce-insights18|<span style="color:#DCDCDC">#CEInsights18</span>]]<br> [[m:Learning and Evaluation/Newsletter/2018/5/17#genderequity|<span style="color:#DCDCDC">#GenderEquity</span>]]</span>{{#if: |<nowiki>]]</nowiki>|}} {{#if: |{{{images}}}|}} </div> <div style="float:left; background-color:{{#if: #26A9E0|#26A9E0|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/17#tuned17|<span style=&quot;color:#DCDCDC&quot;>Stay tuned</span>]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:&quot;><br/> blogs, events <br/> & more!</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> </div> <div style=&quot;clear:both;&quot;> <div style=&quot;float:left; background-color:{{#if: #00008B|#00008B|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;>{{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC&quot;> [[m:Learning and Evaluation/Newsletter/2018/5/17#Awesome17|<span style=&quot;color:#DCDCDC&quot;>A program in the spotlight:<br/>Editatona: Writing women back in history</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/17#mark17|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> AffCom corner and Wikimania Poster session</span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 01:10, 29 November 2018 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=18658298 --> "> <span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC">[[m:Learning and Evaluation/Newsletter/2018/5/17#tuned17|<span style="color:#DCDCDC">Stay tuned</span>]]</span> {{#if: |{{{link 2}}}|}}<span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:"><br /> blogs, events <br /> & more!</span>{{#if: |<nowiki>]]</nowiki>|}} {{#if: |{{{images}}}|}} </div> </div> <div style="clear:both;"> <div style="float:left; background-color:{{#if: #00008B|#00008B|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;>{{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC&quot;> [[m:Learning and Evaluation/Newsletter/2018/5/17#Awesome17|<span style=&quot;color:#DCDCDC&quot;>A program in the spotlight:<br/>Editatona: Writing women back in history</span>]]</span>{{#if: |]]|}} {{#if: |{{{images}}}|}} </div> <div style=&quot;float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/17#mark17|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> AffCom corner and Wikimania Poster session</span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 01:10, 29 November 2018 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=18658298 --> ">{{#if: |{{{link 2}}}|}}<span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#DCDCDC"> [[m:Learning and Evaluation/Newsletter/2018/5/17#Awesome17|<span style="color:#DCDCDC">A program in the spotlight:<br />Editatona: Writing women back in history</span>]]{{#if: |<nowiki>]]</nowiki>|}} {{#if: |{{{images}}}|}} </div> <div style="float:left; background-color:{{#if: #339966|#339966|#F0F0F0}}; color:#656565; padding: 1.5em 1em 1em 1em; margin: .5em; {{#if: 40%|width:40%|}}&quot;> <span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC&quot;>[[m:Learning and Evaluation/Newsletter/2018/5/17#mark17|<span style=&quot;color:#DCDCDC&quot;>Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style=&quot;font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF&quot;><br/> AffCom corner and Wikimania Poster session</span>{{#if: |]]|}} {{#if: ||}} </div> </div> <div style=&quot;clear:both;&quot;> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 01:10, 29 November 2018 (UTC) </div></div></span> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=18658298 --> "> <span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color: #DCDCDC">[[m:Learning and Evaluation/Newsletter/2018/5/17#mark17|<span style="color:#DCDCDC">Leave your mark on Meta!]]</span> {{#if: |{{{link 2}}}|}}<span style="font-size: 1.5em; font-family: Futura, 'Trebuchet MS', Arial, sans-serif; color:#FFFFFF"><br /> AffCom corner and Wikimania Poster session</span>{{#if: |<nowiki>]]</nowiki>|}} {{#if: ||}} </div> </div> <div style="clear:both;"> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 01:10, 29 November 2018 (UTC) </div></div> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=18658298 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 01:10, 29 November 2018 (UTC) == [[:m:Affiliations Committee/Candidates/December 2018|2018 Affiliations Committee call for candidates]] == <div lang="en" dir="ltr" class="mw-content-ltr"> ''This is an [[m:Special:MyLanguage/Global message delivery/Targets/Affiliations Committee/News|update]] from the [[m:Special:MyLanguage/Affiliations Committee|Wikimedia Affiliations Committee]].'' [[File:Affiliations Committee logo.svg|right|150px]] The '''[[m:Special:MyLanguage/Affiliations Committee|Affiliations Committee]]''' – the committee responsible for guiding volunteers in establishing Wikimedia chapters, thematic organizations, and user groups – is looking for new members! The main role of the Affiliations Committee is to guide groups of volunteers that are interested in forming Wikimedia affiliates. We review applications from new groups, answer questions and provide advice about the different Wikimedia affiliation models and processes, review affiliate bylaws for compliance with requirements and best practices, and advise the Wikimedia Foundation Board of Trustees on issues connected to chapters, thematic organizations and Wikimedia user groups. The committee can include up to fifteen members, roughly half of whom are selected every twelve months for staggered two-year terms. Those joining the committee during the current process will serve a two-year term ending in December 2020. ;Key skills Being a part of the Affiliations Committee requires communication with volunteers all over the world, negotiating skills, cultural sensitivity, and the ability to understand legal texts. We look for a healthy mix of different skill sets in our members, including the following key skills and experience:<br /> - Willingness to process applications through a set, perhaps bureaucratic process.<br /> - Readiness to participate in political discussions on the role and future of affiliates, models of affiliation, and similar topics.<br /> - Availability of up to 5 hours per week, and the time to participate in a monthly two-hour voice/video meeting.<br /> - International orientation.<br /> - Fluency in English.<br /> - Ability to work and communicate with other languages and cultures.<br /> - Strong understanding of the structure and work of affiliates and the Wikimedia Foundation.<br /> - Knowledge of different legal systems and experience in community building and organizing are a plus.<br /> - Skills in other languages are a major plus.<br /> - Experience with or in an active affiliate is a major plus.<br /> - Strong track record of effective collaboration (such as evidenced skills at facilitation, mediation, negotiation, and so forth) are a major plus.<br /> - Willingness to use one's real name in committee activities (including contacts with current and potential affiliates) when appropriate.<br /> We are looking for people who are excited by the challenge of empowering volunteers to get organized and form communities that further our mission around the world. In exchange, committee members selected will gain the experience of supporting their world-wide colleagues to develop their communities as well as personal development in guiding organizational development, facilitating affiliate partnerships, and professional communications.<br /> ;Selection process As a reflection of our commitment to openness, transparency, and bilateral engagement with the Wikimedia community, the 2018 member selection process will include a public review and comment period. All applications received by the committee will be posted on Meta at [[:m:Affiliations Committee/Candidates/December 2018|Affiliations Committee/Candidates/December 2018]], and the community will be invited to provide comments and feedback about each candidate. At the end of the public comment period, the applications will be voted on by the members of the committee who are not seeking re-election, taking into account comments put forward by the committee's members, advisors, Wikimedia Foundation staff and board liaisons, and the community. A final decision will be made by mid-January 2019, with new members expected to join later that month. ;How to apply If you are interested in joining the committee, please post your application on the nomination page and send an email announcing your application to affcom@lists.wikimedia.org by 31 December 2018. Your application must include the following information:<br /> - Your full name and Wikimedia username<br /> - A statement describing your relevant experience, skills, and motivation for joining the committee.<br /> - Answers to the following three questions:<br /> #How do you think affiliates work best together to partner on effective projects and initiatives?<br /> #What do you see as the role of affiliates in the Wikimedia movement in the next three years?<br /> #What do you feel you will bring to the committee that makes you a uniquely qualified candidate?<br /> If you have any questions, please don't hesitate to contact me and/or the committee as a whole. We are happy to chat or have a phone call with anyone about our work if this helps them decide to apply. Please distribute this call among your networks, and do apply if you are interested! Best regards,<br /> Kirill Lokshin<br /> Chair, Affiliations Committee ''Posted by [[m:Special:MyLanguage/User:MediaWiki message delivery|MediaWiki message delivery]] on behalf of the [[m:Special:MyLanguage/Affiliations Committee|Affiliations Committee]], 06:25, 17 December 2018 (UTC)'' </div> <!-- Message sent by User:Biplab Anand@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:Biplab_Anand/Affiliates_list&oldid=18720836 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 06:32, 17 December 2018 (UTC) == New Affiliations Committee appointments == [[:m:AffCom|AffCom]] is excited to share with you the news that the Wikimedia Foundation Board has unanimously approved the changes to the Bylaws during the last Board meeting on January 30, 2019. This change allows the participation of [[:m:Wikimedia user groups|User Groups]] in the [[:m:Affiliate-selected Board seats/2019|Affiliate-selected Board seats (ASBS) 2019 process]]. To read the Board's announcement, please click [[:m:Affiliate-selected_Board_seats/2019/Wikimedia_Foundation_Bylaws_changed_plus_next_steps|here]] -- <!-- Message sent by User:Fjmustak@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=18885377 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 14:45, 21 February 2019 (UTC) == Help us make Wikipedia talk pages more accessible to more participants == Hello! Our team at the Wikimedia Foundation is working on a project to improve the ease-of-use and productivity of wiki talk pages. As an affiliate, I can imagine you’ve run into challenges explaining talk pages to first-time participants, or it is an consultation that would interest your members. We want all contributors to be able to talk to each other on the wikis – to ask questions, to resolve differences, to organize projects and to make decisions. Communication is essential for the depth and quality of our content, and the health of our communities. We're currently leading a global consultation on how to improve talk pages, and we're looking for groups that can discuss and report on their experiences using (or helping other people to use) wiki talk pages. We'd like to invite you to participate, with the user groups that you belong to. You can learn more about the consultation [[mw:Talk_pages_consultation_2019|at Mediawiki.org]] and if you're interested in hosting a group discussion (on-wiki or off-wiki), you can sign up at [[mw:Talk_pages_consultation_2019/Participant_group_sign-up|the participant sign-up group]]. If you’d like to participate or if you have any questions, [[mw:Talk:Talk pages consultation 2019/Communication|please contact us]] and let us know. The more people participate from many horizons, the better the outcome will be. Thank you! [[user:Trizek (WMF)|Trizek (WMF)]] 15:29, 8 March 2019 (UTC) <!-- Message sent by User:Trizek (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=18885377 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 15:29, 8 March 2019 (UTC) == Call for complementary facilitators and more to get the ASBS 2019 process started! == <div class="mw-content-ltr" lang="en" dir="ltr"> [[File:User (13635) - The Noun Project.svg|right|240px]] Hi everyone, hope all is fine with you! The next weeks will be intense, as [[:m:Affiliate-selected_Board_seats/2019|affiliates figure out their participation]] in the [[:m:Talk:Affiliate-selected_Board_seats/2019#Tentative_timeline|process that will soon select 2 people]] for the Wikimedia Foundation Board of Trustees. Since new Bylaws established that the user groups are for the first time going to be involved in such process, a lot more support than before is certainly going to be necessary, among other things, for big and healthy conversations on the topic. Hence, please encourage members of your group to '''become a complementary facilitator''', or sign up yourself! [[:m:Talk:Affiliate-selected_Board_seats/2019#2019_call_for_election_facilitators!|You can add yourself to the list on Meta]] or reply to me to flag availability. One person from the facilitators group should soon be selected to liaise with the Foundation Board’s Chair, María Sefidari, on behalf of all affiliates, and it may be wise to also find a deputy for them. Finally, if you can think of any huge '''obstacles that would prevent your group from participating to the process''' (for instance, a language barrier, or lack of good decision-making mechanisms, etc.), please [[:m:User talk:Elitre (WMF)|reach out to me directly]]: it is really important that we hear about them as early as possible. Thank you! [[:m:User:Elitre (WMF)|Elitre (WMF)]] 15:23, 12 March 2019 (UTC) </div> <!-- Message sent by User:Elitre (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/AllAffiliates&oldid=18929492 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 15:23, 12 March 2019 (UTC) == Update on the Affiliate-selected Board seats 2019 process == <div class="mw-content-ltr" lang="en" dir="ltr"> Hi all, The Election Facilitators met on Friday, April 5. We finalized [[:m:Affiliate-selected_Board_seats/Resolution_2019|the resolution]], which is now frozen. The Board of Trustees of the Wikimedia Foundation will be asked to approve the resolution. We have made two small changes to be more inclusive. We extended the date for compliance with AffCom reporting and being in good standing to May 7 to allow time for as many Affiliates as possible to be current with these requirements. The Election Facilitators adjusted the language in case a quorum is not met during the election. On the talk page of the resolution one issue was raised. The issue looks like to be about a possible candidate. Affiliates will have ample time to discuss the merits of candidates during nomination time, screening time, and they can cast their votes on candidates. The Election Facilitators didn't see the necessity for this change, and left the resolution on this point unchanged. The Election Facilitators will be Abhinav Srivastava, Lane Rasberry, Jeffrey Keefer, Ad Huikeshoven, Neal McBurnett and Alessandro Marchetti. We will welcome more volunteers to assist us in this process, to reach out to the diversity in language and gender in our communities, and do so in an advisory role. The nomination period opens on April 15. We are going to prepare nomination pages on Meta. You can expect a call for nominations. There is a draft call, including a [[:m:Affiliate-selected_Board_seats/2019/Call_for_Candidates#Candidates'_profiles|candidates' profile section]] with non-binding guidelines about experience and characteristics for nominees. You are welcome to add your insights, or discuss on the talk page. Erica Litrenta ([[:m:User:Elitre (WMF)|WMF staff]]) supports us in this process. She will reach out to all affiliates through mail and other channels to make sure we are up to date with (user)name and contact details of your primary contact. On behalf of the Election Facilitators, [[:m:User:Ad Huikeshoven|Ad Huikeshoven]] 10:52, 6 April 2019 (UTC) </div> <!-- Message sent by User:Elitre (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/AllAffiliates&oldid=18994215 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:52, 6 April 2019 (UTC) == Update about the [[:m:Affiliate-selected Board seats/2019|Affiliate-selected Board seats process 2019]] == <div class="mw-content-ltr" lang="en" dir="ltr"> [[File:ASBS_2019.pdf|240px|right]] Hello everyone! *The [[:m:Affiliate-selected Board seats/Resolution 2019|Resolution]] has been approved by the Board of Trustees; *'''Nominations phase is now open, from April 15 00:00 UTC to April 30 23:59 UTC. See the [[:m:Affiliate-selected Board seats/2019/Call for Candidates|Call for Candidates]] and [[:m:Affiliate-selected Board seats/2019/Nominations|Nominations]] pages'''; **Community members may ask [[:m:Affiliate-selected_Board_seats/2019/Questions|questions]] of the candidates; *Your main representative has just received an email to confirm that they are indeed the primary contact and will perform official actions on behalf of your group (such as endorsing candidates and then voting). Some groups also need to verify their [[:m:Reports|eligibility status in due time]], as explained in the email; *New content is available to spread awareness around the process - the infographic on this page has clickable links and [[:m:Affiliate-selected_Board_seats/2019/Infographic_translations|can be translated]], and [[:m:Affiliate-selected_Board_seats/2019/Primer_for_user_groups|a primer]] is available, that we hope will be particularly helpful to those new to such a process; *Finally, you are welcome to help with translations! [[:m:Category:Affiliate-selected_Board_seats_2019_election|Pick one page from the ASBS category]] and, in the next couple of weeks, please consider translating [[:m:Category:Affiliate-selected Board seats 2019 election nominations|profiles of the candidates]] in particular. Thanks for your attention! [[:m:Talk:Affiliate-selected_Board_seats/2019|The Facilitators for ASBS 2019]], 07:33, 15 April 2019 (UTC) </div> <!-- Message sent by User:Elitre (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/AllAffiliates&oldid=19007770 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 07:33, 15 April 2019 (UTC) == [[:m:Affiliate-selected Board seats/2019|Affiliate-selected Board seats 2019 process]]: your representative == [[File:Nuvola_apps_important.png|120px|right]] {{int:Hello}}. The name of '''the only person who will vote on behalf of this group''' to select the next two Board members is now at [[:m:Affiliate-selected Board seats/2019/Eligible entities]]. Please contact me directly as soon as possible if you need any kind of corrections there. There's only a few hours left to endorse candidates, and only the official voter can do that. I would also like to take this opportunity to remind you that '''you can make a difference [[:m:Affiliate-selected Board seats/2019/Translations|with the necessary translations]]'''. Appreciate your attention and your support so far! {{Int:Feedback-thanks-title}} [[:m:User:Elitre (WMF)|Elitre (WMF)]] and Facilitators of ASBS 2019, 12:15, 29 April 2019 (UTC) <!-- Message sent by User:Elitre (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/AllAffiliates&oldid=19007770 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 12:15, 29 April 2019 (UTC) == Upcoming 2019 Affiliate-selected trustee position on the Board of Wikimedia Foundation == <br /> Greetings MediaWiki Stakeholders' Group, My name is Gerald Shields, also known as user:Geraldshields11. I am asking for your top rank vote for me in the election for one of two open trustee positions on the Wikimedia Foundation Board of Trustees. I am asking for your vote to help support emerging communities and promote an inclusive education environment on all wiki projects. Also, I plan to promote various other issues as I mention in my statement and answers to various questions. I ask that you show your support for the issues that need to be address by voting for me as one of your preferences. My candidacy information page is [[M:Affiliate-selected Board seats/2019/Nominations/Gerald Shields|Affiliate-selected Board seats/2019/Nominations/Gerald Shields]] on Meta or can be found at [[metawiki:Affiliate-selected_Board_seats/2019/Nominations/Gerald_Shields|Gerald Shields candidate]]. I have responded to the “Questions for all candidates - Questions for this individual candidate that do not apply to other candidates”. My answers give more details on why your affiliate should vote for me. Thank you for your time, discussion, and consideration of my candidacy. I appreciate it. My best regards, Gerald Shields [[User:Geraldshields11|Geraldshields11]] ([[User talk:Geraldshields11|talk]]) 02:06, 8 May 2019 (UTC) ::Thank you for your organization's vote during the 2019 trustee election. With your organizations', Florida's, Igbo's, and AfroCrowd's votes, I was able to score better than expected. [[User:Geraldshields11|Geraldshields11]] ([[User talk:Geraldshields11|talk]]) 20:55, 17 June 2019 (UTC) == Introducing Wikimedia Space: A platform for movement news and organizations == Hi {{PAGENAME}}, <br /> I’m writing to let you know that the Community Engagement department <ref>View [[m:Community Engagement|the department's page on Meta-Wiki.]]</ref>at the Wikimedia Foundation is launching a new platform, [https://space.wmflabs.org Wikimedia Space]. Here, you will find stories for and by contributors to the Wikimedia movement, and a space for discussions of different topics.<br /> <br /> We know that finding information about Wikimedia activities and processes is very complicated, which makes the learning curve to enter our movement and be successful afterwards, really steep. By centralizing community stories and conversations in one shared space, we believe we are facilitating access and discoverability of topics across the movement, improving, in turn, connections among Wikimedians.<br /> <br /> As an affiliated organization to the Wikimedia Foundation, we hope that you can share this platform with your local community, and we count on you to encourage them to add their voices. If you’d like to contribute stories, and overall, participate in the discussion section, please read our [[m:Wikimedia_Space/Editorial_guidelines|blogging guidelines]] and our [https://discuss-space.wmflabs.org/guidelines code of conduct] and [https://discuss-space.wmflabs.org/t/how-to-join-wikimedia-space/113 join the conversation]. Find more information about the project on [[m:Wikimedia Space|its page on Meta]].<br /> <br /> Looking forward to seeing you at Wikimedia Space, <br /> [[m:user:MCruz (WMF)|María Cruz]], Communications and Outreach Manager, Wikimedia Foundation.<br /> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 17:53, 25 June 2019 (UTC) <small> ;References <references /> </small> <!-- Message sent by User:MCruz (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/AllAffiliates&oldid=19007770 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 17:53, 25 June 2019 (UTC) :{{FlowMention|Jc86035}} Hey, check this out. &#8211;<span style="font-family:CG Times">[[w:User:MJL|<span style="color:black">MJL</span>]]&thinsp;[[User talk:MJL|‐'''Talk'''‐]]<sup>[[w:WP:CONN|☖]]</sup></span> 18:24, 25 June 2019 (UTC) :Thanks for the notification. This looks promising so far. [[User:Jc86035|Jc86035]] ([[User talk:Jc86035|talk]]) 11:54, 26 June 2019 (UTC) == Introducing Wikimedia Diary: A memory book (notebook) for all == {| style="border:1px solid #AAA;background:#C0FAFF" |- | rowspan="2" valign="middle" |<figure-inline>[[File:Wikipedia Education Globe 1.png|125x125px]]</figure-inline> | rowspan="2" | | style="padding:0;font-size:x-large;line-height:normal;vertical-align: middle" |'''[[m:Wikimedia Diary|Wikimedia Diary]]''' ---- |- |'''Hello {{PAGENAME}}''', I wanna share you about Wikimedia Diary, a public memory book (notebook) in which Wikimedians from all over the world are free to write any worth noting event/activities/experiences by them or community in this Wiki world. It is a more casual place to write about what one is up to. As we all know, a diary is a book in which diarist keeps a daily record of events and experiences. Likewise, the basic idea of Wikimedia Diary is that we do many activities here in wiki world which we are proud of, but unfortunately it became only the history anytime. So, It is meant to record those activities on the happened date with a signature <nowiki>(~~~~)</nowiki> which is worth noting, and letting fellow Wikimedians know about what inspirational you've did. It would motivate users from all around the world to keep on cool activities and publish a note. I hope you share your activities with all of us on the page, and please let your friends know about Wikimedia Diary. Also, your feedback is welcome on the [[m:Talk:Wikimedia Diary|discussion page]]. Thank you!<br /> '''Kind regards,'''<br /> '''[[User:Tulsi Bhagat|Tulsi Bhagat]], Initiator of Wikimedia Diary, Wikimedia movement communications group.'''<br /> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 08:09, 15 November 2019 (UTC) |} <!-- Message sent by User:Tulsi Bhagat@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:Tulsi_Bhagat/Mass_Message_Users_List&oldid=19559977 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 08:09, 15 November 2019 (UTC) == [[m:Special:MyLanguage/Affiliations Committee/MassMessages/Call for candidates - December 2019|2019 Affiliations Committee call for candidates]] == The '''[[m:Special:MyLanguage/Affiliations Committee|Affiliations Committee (AffCom)]]''' – the committee responsible for guiding volunteers in establishing Wikimedia chapters, thematic organizations, and user groups – '''is looking for new members!''' The main role of the Affiliations Committee is to guide groups of volunteers that are interested in forming Wikimedia affiliates. We review applications from new groups, answer questions and provide advice about the different Wikimedia affiliation models and processes, review affiliate bylaws for compliance with requirements and best practices, and update the Wikimedia Foundation Board of Trustees as well as advise them on issues connected to chapters, thematic organizations and Wikimedia user groups. The committee consists of fourteen members, selected every twelve months for staggered two-year terms. Those joining the committee during the current process will serve a two-year term ending in December 2021. AffCom continues to closely monitor the Wikimedia 2030 Strategy process that was initiated in 2016. While the affiliation models continue to be discussed as part of the broader strategy discussion, as no decisions have been made to change the current affiliation models yet, AffCom will continue to work in the same manner with regard to affiliate recognitions and intervention support for affiliates with issues of non-compliance in 2020. Specifically, AffCom will continue to process applications for user group and chapter/thematic organization creation, while we await the strategy next steps and begin to prepare for a smooth transition of the committee and affiliates ecosystem to any changing movement structures and systems in 2021. Being a part of the Affiliations Committee requires communication with volunteers all over the world, negotiating skills, cultural sensitivity, and the ability to understand legal texts. We look for a healthy mix of different skill sets in our members. ==Required and Recommended Skills for Affiliations Committee Members== Across all committee members there are additional relevant skills as well as requirements which help to support the committee and its sustainability which include both required and relevant general skills ===Required Skills=== *Fluency in English *Availability of up to 5 hours per week, and the time to participate in a monthly one and two-hour voice/video meetings. *Willingness to use one's real name in committee activities (including contacts with current and potential affiliates) when appropriate. *Strong track record of effective collaboration *International orientation ===Relevant Skills=== *Skills in other languages are a major plus. *Public Communications (English writing and speaking skills) *Strong understanding of the structure and work of affiliates and the Wikimedia Foundation. *Documentation practices *Interviewing experience *Knowledge of different legal systems and experience in community building and organizing are a plus *Experience with, or in, an active affiliate is a major plus. *Teamwork **Focusing on shared goals instead of disagreements **Focusing on the conflict at hand and not past ones **Ensuring each member of the team has a clearly defined role, which can help reduce disagreements over areas of responsibility **Project and people management to coordinate different parties on a shared plan and seeing it through to completion. *Problem-Solving **Ability to evaluate various solutions **Ability to consider multiple interests and points of view **Willingness to revisit unresolved issues **The capacity to recognize and respond to important matters **The ability to seek compromise and avoid punishing *Ability to work and communicate with other languages and cultures. Given the expectations for maintaining course in 2020 and preparing for potential 2021 transitions, it is important that we are also clear about two different skill sets critical to committee support at this time. The first skillset is oriented to understanding affiliate dynamics and organizational development patterns to successfully process affiliate applications for recognition; the other is oriented to conflict prevention and intervention support for affiliates in conflict. ===Affiliate Recognitions Relevant Skills=== *Administration **Willingness to process applications through a set, perhaps bureaucratic process. **Attention to detail *Monitoring & Strategic Development **Readiness to participate in political discussions on the role and future of affiliates, models of affiliation, and similar topics. *Organizational Awareness **Understanding of and community building and organizational development **Understanding of group dynamics **Awareness of the affiliates ecosystem and models ===Conflict Prevention & Intervention Relevant Skills=== *Communication **Active listening **Reading nonverbal cues **Knowing when to interrupt and when to stay quiet **Being culturally sensitive at the same time remaining clear and concise when explaining a concept or opinion *Stress Management **Patience **Positivity **Ability to inject a dose of humor to dilute anger and frustration when needed **Taking well-timed breaks that can bring calm in the midst of flared tempers **Ability to manage stress while remaining alert and calm *Emotional Intelligence **Being emotionally aware, **Ability to control emotions and behaviors, **Ability to practice empathy, **Impartiality, **Don’t take anything personally, **Being aware of and respectful of differences. *Facilitation skills **Meeting facilitation experience **Peer or community mediation training **Peer or community mediation experience Do you have any of these skill sets and an interest to support movement affiliates? We are looking for people who are excited by the challenge of empowering volunteers to get organized and form communities that further our mission around the world. In exchange, committee members selected will gain the experience of supporting their world-wide colleagues to develop their communities as well as personal development in guiding organizational development, facilitating affiliate partnerships, and professional communications. ==Selection process== As a reflection of our commitment to openness, transparency, and bilateral engagement with the Wikimedia community, the 2019 member selection process will include a public review and comment period. We invite you to share with us you applications, specifying your focus area you’re interested in. All applications received by the committee will be posted on Meta, and the community will be invited to provide comments and feedback about each candidate. At the end of the public comment period, the applications will be voted on by the members of the committee who are not seeking re-election, taking into account comments put forward by the committee's members, advisors, Wikimedia Foundation staff and board liaisons, and the community. A final decision will be made by mid-January 2020, with new members expected to join later that month. ==How to apply== If you are interested in joining the committee, please post your application on ''[[meta:Affiliations Committee/Candidates/December 2019|the nomination page]]'' and send an email '''announcing your application to AffCom{{@}}lists.wikimedia.org by 10 January 2020'''. Your application must include the following information: *Your full name and Wikimedia username *A statement describing your relevant experience, skills, and motivation for joining the committee. *Answers to the following questions: #How do you think affiliates work best together to partner on effective projects and initiatives? #What do you see as the role of affiliates in the Wikimedia movement in the next three years? #What do you feel you will bring to the committee that makes you uniquely qualified? #Which subcommittee are you most interested in serving on: Recognitions OR Conflict Prevention & Intervention? If you have any questions, please don't hesitate to contact me and/or the committee as a whole. We are happy to chat or have a phone call with anyone about our work if this helps them decide to apply. Please distribute this call among your networks, and do apply if you are interested! On behalf of the committee, Camelia Boban, AffCom member [[:Category:Affiliations committee communications]] <!-- Message sent by User:Fjmustak@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=19618456 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 19:59, 17 December 2019 (UTC) == Notification of User Group Expiration - Renewal pending submission of reporting == Greetings {{Ping|Mglaser}} & {{Ping|MarkAHershberger}}, This is a notification to bring to your attention that your organization is currently past due on its required annual reporting. Wikimedia User Groups are required to submit an annual activity report covering the entirety of the 12-month agreement period in order to prompt review for a renewal. Reports must be written in English, posted to meta, and linked on the meta [[m:Reports|Reports page]]. This page is used to track how organizations and groups are meeting reporting requirements described in their agreements with the Wikimedia Foundation (e.g. chapter agreements, thematic organization agreements, user group agreements). It is the central place where affiliates can add reports about their activities, share their plans, and even news or social media channels with the wider movement. When new reports are available, organizations and groups should add them to this page to keep their columns up to date. As noted on the meta [[m:Reports|Reports page]], your organization’s 2018-2019 annual reporting became past due in November. Please be sure to #Post your 2018-2019 annual reporting to the meta [[m:Reports|Reports page]] as soon as possible to return to compliance with your user group agreement. #Check that your group’s page is also up to date with past report links for historical record-keeping, and #Please send an email to [[m:Mailing lists/Wikimedia Announce|Wikimedia-l]] in order to share with a movement-wide audience. If you have any questions or need any further guidance, please don’t hesitate to reach out. Best regards,<br />{{FlowMention|DNdubane (WMF)}} [[User:DNdubane (WMF)|DNdubane (WMF)]] ([[User talk:DNdubane (WMF)|talk]]) 05:01, 26 February 2020 (UTC) == Talk:MediaWiki Stakeholders' Group - very little text to translate == very little text to translate [[User:BenyElbis|BenyElbis]] ([[User talk:BenyElbis|talk]]) 20:48, 14 March 2020 (UTC) == Invitation to participate in Wikipedia Pages Wanting Photos == Dear Wikimedia Affiliate Community, We are inviting you to participate in [[Wikipedia Pages Wanting Photos|Wikipedia Pages Wanting Photos (WPWP)]], a new global contest scheduled to run from July through August 2020: Participants will choose among Wikipedia pages without photo images, then add a suitable file from among the many thousands of photos in the Wikimedia Commons, especially those uploaded from thematic contests (Wiki Loves Africa, Wiki Loves Earth, Wiki Loves Folklore, etc.) over the years. WPWP offers a focused task for guiding new editors through the steps of adding content to existing pages. It can be used to organize editing workshops and edit-a-thons. The organizing team is looking for a contact person at the Chapter, Thematic group & Wikimedia User Group level (geographically or thematically), or for a language WP, to coordinate the project locally. We’d be glad for you to sign up directly at [[Wikipedia Pages Wanting Photos/Participating Communities| WPWP Participating Communities]] Thank you, Deborah Schwartz Jacobs On behalf of Wikipedia Pages Wanting Photos Organizing Team - 21:19, 9 May 2020 (UTC) <!-- Message sent by User:Romaine@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:T_Cells/WPWP_2020&oldid=20060760 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 21:19, 9 May 2020 (UTC) == [https://meta.wikimedia.org/wiki/Affiliations_Committee/MassMessages/Call_for_candidates_-_June_2020 Call for candidates - June 2020] == Hi everyone, The [https://meta.wikimedia.org/wiki/Affiliations_Committee Affiliations Committee] (AffCom) – the committee responsible for guiding volunteers in establishing and sustaining [https://meta.wikimedia.org/wiki/Wikimedia_chapters Wikimedia chapters], [https://meta.wikimedia.org/wiki/Wikimedia_thematic_organizations thematic organizations], and [https://meta.wikimedia.org/wiki/User_groups user groups] – is seeking new members! The main role of the AffCom is to guide groups of volunteers that are interested in forming Wikimedia affiliates. We review applications from new groups, answer questions and provide advice about the different Wikimedia affiliation models and processes, review affiliate bylaws for compliance with requirements and best practices, and update the [https://meta.wikimedia.org/wiki/Wikimedia_Foundation_Board_of_Trustees Wikimedia Foundation Board of Trustees] as well as advise them on issues connected to chapters, thematic organizations and Wikimedia user groups. The committee consists of five to fifteen members, selected at least once every year, to serve two-year terms. As the committee must hold mid-year elections to replenish its members at this time, those joining the committee during the current process will serve a slightly extended term from July 2020 through December 2022. AffCom continues to closely monitor the [https://meta.wikimedia.org/wiki/Strategy/Wikimedia_movement/2018-20 Wikimedia 2030 Strategy process] initiated in 2016. While the affiliation models continue to be discussed as part of the broader strategy discussion, as no decisions have been made to change the current affiliation models yet, AffCom continues to work in the same manner with regard to affiliate recognitions and intervention support for affiliates with issues of non-compliance in 2020. AffCom continues to process applications for user group and chapter/thematic organization creation, while we await the strategy next steps and begin to prepare for a smooth transition of the committee and affiliates ecosystem to any changing movement structures and systems in 2021. Being a part of the AffCom requires communication with volunteers all over the world, negotiating skills, cultural sensitivity, and the ability to understand legal texts. We look for a mix of different skill sets in our members. '''[https://meta.wikimedia.org/wiki/Affiliations_Committee/MassMessages/Call_for_candidates_-_June_2020 Click here for further details]'''. [[User:Doc James|James Heilman]] on behalf of AffCom <!-- Message sent by User:Doc James@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=20045459 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 06:18, 13 June 2020 (UTC) == Affiliations Committee elections announcement June 2020 == Hi everyone, This is a friendly reminder that the Affiliations Committee (AffCom) – the committee responsible for guiding volunteers in establishing and sustaining Wikimedia chapters, thematic organizations, and user groups – is seeking new members! The deadline to post your application on the [[Affiliations Committee/Candidates/June 2020|nomination page]] is 30 June 2020. *Application process: Considering the anticipated changes following the Strategy recommendations, we had a limited scope to introduce changes in the process. We have made a small but impactful addition to the application process by introducing the Self Assessment survey form which will help the committee know more about your engagement as endorsements are not consistently shared, may not be representative, and often do not speak to the specific skills needed. *Selection process: No change; see: [[Affiliations Committee/Rules of Procedure|Membership]]. If you have any questions, please contact me and/or the committee as a whole. We are happy to answer questions about our work if this helps people decide to apply. Please distribute this announcement among your networks. Good luck to all the candidates! On behalf of the committee, --[[User:Rosiestep|Rosiestep]] ([[User talk:Rosiestep|talk]]) 00:49, 19 June 2020 (UTC) via MassMessaging <!-- Message sent by User:Rosiestep@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=20169330 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 00:49, 19 June 2020 (UTC) == Feedback on movement names == There are a lot of conversations happening about the future of our movement names. We hope that you are part of these discussions and that your community is represented. Since 16 June, the Foundation Brand Team has been running a [https://wikimedia.qualtrics.com/jfe/form/SV_9G2dN7P0T7gPqpD survey] in 7 languages about [[m:Special:MyLanguage/Communications/Wikimedia brands/2030 movement brand project/Naming convention proposals|3 naming options]]. There are also community members sharing concerns about renaming in a [[m:Special:MyLanguage/Community open letter on renaming|Community Open Letter]]. You should have received a separate affiliate survey via email. If you have not, feel free to email brandproject{{@}}wikimedia.org. Our goal in this call for feedback is to hear from across the community, so we encourage you to participate in the survey, the open letter, or both. The survey will go through 7 July in all timezones. Input from the survey and discussions will be analyzed and published on Meta-Wiki. Thanks for thinking about the future of the movement --[[:m:Talk:Communications/Wikimedia brands/2030 movement brand project|The Brand Project team]], 13:37, 2 July 2020 (UTC) ''Note: The survey is conducted via a third-party service, which may subject it to additional terms. For more information on privacy and data-handling, see the [[foundation:Special:MyLanguage/Naming Convention Proposals Movement Feedback Survey Privacy Statement|survey privacy statement]].'' <!-- Message sent by User:Elitre (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:Elitre_(WMF)/Affiliates_June_2020&oldid=20227200 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 13:37, 2 July 2020 (UTC) == Announcing a new wiki project! Welcome, Abstract Wikipedia == <small>''Hello everyone. I am posting the announcement below, which you may have missed elsewhere, and in the hope that you can share it with your local communities. Please note that it may be available in your language at [[:m:Special:MyLanguage/Abstract Wikipedia/July 2020 announcement]]. Thanks for your attention! [[:m:User:Elitre (WMF)]]''</small> <div class="plainlinks mw-content-ltr" lang="en" dir="ltr"> Hi all, It is my honor to introduce Abstract Wikipedia, a new project that has been unanimously approved by the Wikimedia Foundation Board of Trustees. Abstract Wikipedia proposes a new way to generate baseline encyclopedic content in a multilingual fashion, allowing more contributors and more readers to share more knowledge in more languages. It is an approach that aims to make cross-lingual cooperation easier on our projects, increase the sustainability of our movement through expanding access to participation, improve the user experience for readers of all languages, and innovate in free knowledge by connecting some of the strengths of our movement to create something new. This is our first new project in over seven years. Abstract Wikipedia was submitted as a project proposal by Denny Vrandečić in May 2020 <ref>[[m:Special:MyLanguage/Abstract Wikipedia|Abstract Wikipedia]]</ref> after years of preparation and research, leading to a detailed plan and lively discussions in the Wikimedia communities. We know that the energy and the creativity of the community often runs up against language barriers, and information that is available in one language may not make it to other language Wikipedias. Abstract Wikipedia intends to look and feel like a Wikipedia, but build on the powerful, language-independent conceptual models of Wikidata, with the goal of letting volunteers create and maintain Wikipedia articles across our polyglot Wikimedia world. The project will allow volunteers to assemble the fundamentals of an article using words and entities from Wikidata. Because Wikidata uses conceptual models that are meant to be universal across languages, it should be possible to use and extend these building blocks of knowledge to create models for articles that also have universal value. Using code, volunteers will be able to translate these abstract “articles” into their own languages. If successful, this could eventually allow everyone to read about any topic in Wikidata in their own language. As you can imagine, this work will require a lot of software development, and a lot of cooperation among Wikimedians. In order to make this effort possible, Denny will join the Foundation as a staff member in July and lead this initiative. You may know Denny as the creator of Wikidata, a long-time community member, a former staff member at Wikimedia Deutschland, and a former Trustee at the Wikimedia Foundation <ref>[[m:User:Denny|User:Denny]]</ref>. We are very excited that Denny will bring his skills and expertise to work on this project alongside the Foundation’s product, technology, and community liaison teams. It is important to acknowledge that this is an experimental project, and that every Wikipedia community has different needs. This project may offer some communities great advantages. Other communities may engage less. Every language Wikipedia community will be free to choose and moderate whether or how they would use content from this project. We are excited that this new wiki-project has the possibility to advance knowledge equity through increased access to knowledge. It also invites us to consider and engage with critical questions about how and by whom knowledge is constructed. We look forward to working in cooperation with the communities to think through these important questions. There is much to do as we begin designing a plan for Abstract Wikipedia in close collaboration with our communities. I encourage you to get involved by going to the project page and joining the new mailing list <ref>[https://lists.wikimedia.org/mailman/listinfo/abstract-wikipedia Abstract Wikipedia mailing list]</ref>. We recognize that Abstract Wikipedia is ambitious, but we also recognize its potential. We invite you all to join us on a new, unexplored path. Yours, Katherine Maher (Executive Director, Wikimedia Foundation) -16:51, 10 July 2020 (UTC) <references /> </div> <!-- Message sent by User:Elitre (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:Elitre_(WMF)/Affiliates_June_2020&oldid=20227200 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 16:51, 10 July 2020 (UTC) == Movement Strategy - What Are Your Choices For Implementation == Hello {{PAGENAME}}, The time has come to put Strategy into work and [[m:Strategy/Wikimedia_movement/2018-20/Transition/Prioritization_events|everyone's invited to participate]]. The Movement Strategy [[m:Strategy/Wikimedia_movement/2018-20/Transition/People#Design_Group|Design Group]] and [[m:Strategy/Wikimedia_movement/2018-20/Transition/People#Support_Team|Support Team]] are inviting you to organize virtual meetings with your community and colleagues before the end of October. The aim is for you to decide what ideas from the Movement Strategy recommendations respond to your needs and will have an impact in the movement. The recommendations are [[m:Strategy/Wikimedia_movement/2018-20/Recommendations#Want_to_experience_this_content_in_another_format?|available in different formats]] and in many languages. There are 10 awesome recommendations and close to 50 recommended changes and actions or initiatives. Not everything will be implemented. The aim of prioritization is to create an 18-month implementation plan to take some of the initiatives forward starting in 2021. Prioritization is at the level of your group, affiliate, and community. Think local and relevant! Regional and thematic platforms are great ways to prepare and share ideas. Afterwards, we will come together in November to co-create the implementation plan. More information about November’s global events will be shared soon. For now and until the end of October, organize locally and share your priorities with us. You can find guidance for the events, the simple reporting template, and other supporting materials [[m:Strategy/Wikimedia_movement/2018-20/Transition/Prioritization_events|here on Meta]]. You can share your results [[m:Strategy/Wikimedia_movement/2018-20/Transition/Prioritization_events#What_you_need_to_do|directly on Meta]], by email, or by [https://docs.google.com/forms/d/e/1FAIpQLSdqpu57pooWy3A_WdhosEhjc7jhaYkBgqF0310QVZCCssJS7w/viewform filling out this survey]. Please don’t hesitate to get in touch with us if you have any questions or comments, strategy2030{{@}}wikimedia.org We will be hosting office hours to answer any questions you might have, Thursday October 1 at 14.00 UTC ([http://meet.google.com/ewx-jofx-kga Google Meet]). [[m:User:MPourzaki (WMF)|MPourzaki (WMF)]] ([[m:User talk:MPourzaki (WMF)|talk]]) 16:18, 25 September 2020 (UTC) <!-- Message sent by User:CKoerner (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:MPourzaki_(WMF)/Affiliates_list&oldid=20478851 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 16:18, 25 September 2020 (UTC) == Join the Global Conversations on November 21 and 22 == Hola, こんにちは, E kaabo, Ciao, ਸਤਿ ਸ਼੍ਰੀ, Hello, سلام, Halo, Salut, 你好, Nnọọ, হ্যালো, Hallo, สวัสดี, Dzień dobry, Gyebale ko, வணக்கம், Mi Kwabo, ନମସ୍କାର, приветствие, שלום, Mholo, नमस्ते, γεια, Ahoj, ഹലോ, 여보세요, مرحبا, Բարեւ Ձեզ, Xin chào, Hallå, ಹಲೋ, Sawubona, નમસ્તે, Здраво, Merhaba, Talofa, హలో, Olá, ನಮಸ್ಕಾರ {{PAGENAME}}, we would love to see you at the upcoming Movement Strategy Global Conversations. It’s been a while. The [[m:Strategy/Wikimedia_movement/2018-20/Transition/Global_Conversations|Movement Strategy Global Conversations]] will take place on '''Saturday November 21, 11:00 to 15:00 UTC''', and '''Sunday November 22, 17:00 to 21:00 UTC''', and you are warmly invited. The focus will be to look at [[m:Strategy/Wikimedia_movement/2018-20/Transition/Prioritization_events/Table|priorities identified by communities and affiliates]], and to begin to create a movement-wide implementation plan for 2021. The main sessions will be in English. Any group interested to support live interpretation in another language may be able to receive a rapid grant. Let us know as soon as possible. [https://docs.google.com/forms/d/e/1FAIpQLSclZkiCaqBDZ-BPEDw0CWOU_mv95MDUa2lY5NHUsvp9MuLEVA/viewform '''Please register by Nov. 20'''] so we can share the Zoom login information with you. If you have any questions or comments, don’t hesitate to reach out to the Support Team via [https://t.me/joinchat/NV8jtxZkQB7aN8spsaWtYg Telegram], [https://chat.wmcloud.org/wikimedia/channels/movement-strategy Wikimedia Chat] or by email at strategy2030{{at}}wikimedia.org. Looking forward to seeing you on November 21 or 22. [[m:User:MPourzaki (WMF)|MPourzaki (WMF)]] ([[m:User talk:MPourzaki (WMF)|talk]]) 16:05, 16 November 2020 (UTC) <!-- Message sent by User:CKoerner (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:MPourzaki_(WMF)/Affiliates_list&oldid=20489579 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 16:05, 16 November 2020 (UTC) == Call for insights on ways to better communicate the work of the movement == The Movement Strategy recommendations published this year made clear the importance of establishing stronger communications within our movement. To this end, the Foundation wants to gather insights from communities, including affiliates, on ways we all might more consistently communicate about our collective work, and better highlight community contributions from across the movement. Over the coming months, we will be running focus groups and online discussions to collect these insights. We hope your affiliate will decide to share your thoughts by participating in a focus group or [[m:Movement communications insights|joining the discussion on Meta-Wiki]]. [[m:User:ELappen (WMF)|ELappen (WMF)]] ([[m:User talk:ELappen (WMF)|talk]]) 18:54, 18 November 2020 (UTC) <!-- Message sent by User:CKoerner (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=20566855 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 18:54, 18 November 2020 (UTC) == Global Conversations continue on December 5 and 6 == Hola, こんにちは, Ciao, Hello, سلام, Halo, Salut, 你好, Nnọọ, হ্যালো, Hallo, สวัสดี, Dzień dobry, வணக்கம், приветствие, שלום, Mholo, हैलो, γεια, Ahoj, ഹലോ, 여보세요, مرحبا, Բարեւ Ձեզ, Olá, Xin chào, Hallå, ಹಲೋ, Sawubona, Здраво, Merhaba, Talofa, హలో [[File:Global_Events_poster_-_WM_colours_cropped.jpg|Global Conversations Dec. 5 & 6]] Hi {{PAGENAME}}. 250 people participated in virtual Global Conversations that took place on November 21 and 22. The conversation continues on '''December 5 and 6''' and we warmly invite you to take part. [https://docs.google.com/forms/d/e/1FAIpQLSeldyqX2vhR53yjUEzmhFg_y8phoCbPy4m3wCaPV4RBOerx1Q/viewform Registration is open until December 4]. Looking forward to seeing you. Since September, many groups have shared their local, regional, and thematic priorities for implementing the Movement Strategy recommendations. During the first set of Global Conversations on Nov. 21 and 22, we focused on initiatives that should be globally prioritized and coordinated. [[m:Strategy/Wikimedia_movement/2018-20/Transition/Global_Conversations/Report|We invite you to read the selected global priorities]]. What do you like about them? What is missing? And what would make you want to play an active role in implementation? Share your thoughts in advance and continue the conversation on December 5 and 6. Looking forward to seeing you again, or for the first time, on December 5 and 6. [[m:User:MPourzaki (WMF)|MPourzaki (WMF)]] ([[m:User talk:MPourzaki (WMF)|talk]]) 20:58, 25 November 2020 (UTC) <!-- Message sent by User:CKoerner (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:MPourzaki_(WMF)/Affiliates_list&oldid=20489579 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 20:58, 25 November 2020 (UTC) == Project Grant Open Call == This is the announcement for the [[m:Grants:Project|Project Grants program]] open call that started on January 11, with the submission deadline of February 10, 2021.<br> This first open call will be focussed on Community Organizing proposals. A second open call focused on research and software proposals is scheduled from February 15 with a submission deadline of March 16, 2021.<br> For the Round 1 open call, we invite you to propose grant applications that fall under community development and organizing (offline and online) categories. Project Grant funds are available to support individuals, groups, and organizations to implement new experiments and proven ideas, from organizing a better process on your wiki, coordinating a campaign or editathon series to providing other support for community building. We offer the following resources to help you plan your project and complete a grant proposal:<br> Weekly proposals clinics via Zoom during the Open Call. Join us for [[m:Grants:Project|#Upcoming_Proposal_Clinics|real-time discussions]] with Program Officers and select thematic experts and get live feedback about your Project Grants proposal. We’ll answer questions and help you make your proposal better.<br> *[[m:Grants:Project/Tutorial|Video tutorials]] for writing a strong application<br> *General [[m:Grants:Project/Plan|planning page]] for Project Grants <br> *[[m:Grants:Project/Learn|Program guidelines and criteria]]<br> Program officers are also available to offer individualized proposal support upon request. Contact us at projectgrants@wikimedia.org if you would like feedback or more information.<br> We are excited to see your grant ideas that will support our community and make an impact on the future of Wikimedia projects. Put your idea into motion, and [[m:Grants:Project/Apply|submit your proposal]] by February 10, 2021!<br> Please feel free to get in touch with questions about getting started with your grant application, or about serving on the Project Grants Committee. Contact us at projectgrants{{at}}wikimedia.org.<br> [[User:RSharma (WMF)|RSharma (WMF)]] <!-- Message sent by User:RSharma (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=20766694 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 07:56, 28 January 2021 (UTC) == Invitation for Wikipedia Pages Wanting Photos 2021 == Hello there, We are inviting you to participate in '''[[:m:Wikipedia Pages Wanting Photos 2021|Wikipedia Pages Wanting Photos 2021]]''', a global contest scheduled to run from July through August 2021. Participants will choose among Wikipedia pages without photo images, then add a suitable file from among the many thousands of photos in the Wikimedia Commons, especially those uploaded from thematic contests (Wiki Loves Africa, Wiki Loves Earth, Wiki Loves Folklore, etc.) over the years. In its first year (2020), 36 Wikimedia communities in 27 countries joined the campaign. Events relating to the campaign included training organized by at least 18 Wikimedia communities in 14 countries. The campaign resulted in the addition of media files (photos, audios and videos) to more than 90,000 Wikipedia articles in 272 languages. Wikipedia Pages Wanting Photos (WPWP) offers an ideal task for recruiting and guiding new editors through the steps of adding content to existing pages. Besides individual participation, the WPWP campaign can be used by user groups and chapters to organize editing workshops and edit-a-thons. The organizing team is looking for a contact person to coordinate WPWP participation at the Wikimedia user group or chapter level (geographically or thematically) or for a language WP. We’d be glad for you to reply to this message, or sign up directly at [[:m:Wikipedia Pages Wanting Photos 2021/Participating Communities#Wikimedia affiliate communities|WPWP Participating Communities]]. Please feel free to contact [[:m:Wikipedia Pages Wanting Photos 2021/Organizing Team|Organizing Team]] if you have any query. Kind regards,<br /> [[User:Tulsi Bhagat|Tulsi Bhagat]]<br /> Communication Manager<br /> Wikipedia Pages Wanting Photos Campaign<br /> <small>Message delivered by [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 04:48, 3 May 2021 (UTC)</small> <!-- Message sent by User:Tulsi Bhagat@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Wikipedia_Pages_Wanting_Photos_2021/Call_for_participation_letter/Targets&oldid=21417693 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 04:48, 3 May 2021 (UTC) == Affiliations Committee Call for Candidates - June 2021 == ''This is an [[m:Special:MyLanguage/Global message delivery/Targets/Affiliations Committee/News|update]] from the [[m:affcom|Wikimedia Affiliations Committee]]. [[m:Special:MyLanguage/Affiliations Committee/MassMessages/Call for candidates - June 2021|Translations]] are available.'' The '''[[Special:MyLanguage/Affiliations Committee|Affiliations Committee]]''' – the committee responsible for guiding volunteers in establishing Wikimedia chapters, thematic organizations, and user groups – is looking for new members! The main role of the AffCom is to guide groups of volunteers that are interested in forming Wikimedia affiliates. We review applications from new groups, answer questions and provide advice about the different Wikimedia affiliation models and processes, review affiliate bylaws for compliance with requirements and best practices, and update the Wikimedia Foundation Board of Trustees as well as advise them on issues connected to chapters, thematic organizations and Wikimedia user groups. The committee consists of five to fifteen members, selected at least once every year, to serve two-year terms. Being a part of the AffCom requires communication with volunteers all over the world, negotiating skills, cultural sensitivity, and the ability to understand legal texts. We look for a mix of different skill sets in our members. ;Responsibilities *Availability of up to 5-8 hours per month *Participate in monthly one and two-hour voice/video meetings *Commitment to carry out assigned tasks in a given time. *Facilitate and support communications *Affiliate Support and growth ; ;Required and Recommended Abilities, Skills, Knowledge for Affiliations Committee Members Strong interpersonal relationship among members of the committee and also with the Wikimedia community members. Across all committee members, there are additional relevant skills as well as requirements which help to support the committee and its sustainability which include both required and relevant general skills ; ; ;Required *Fluency in English *Availability of up to 5 hours per week, and the time to participate in a monthly one and two-hour voice/video meetings. *Willingness to use one's real name in committee activities (including contacts with current and potential affiliates) when appropriate. *Strong track record of effective collaboration *International orientation ; ; ;Relevant for all members *Public Communications (English writing and speaking skills) *Skills in other languages are a major plus. *Understanding of the structure and work of affiliates and the Wikimedia Foundation. *Documentation practices *Interviewing experience *Experience with, or in, an active affiliate is a major plus. *Teamwork: Project and people management skills to coordinate and collaborate with different parties on a shared plan and see it through to completion. *Problem-Solving: Ability to evaluate various solutions, consider multiple interests and points of view, revisit unresolved issues, seek compromise and work and communicate across languages and cultures. Given the expectations for maintaining the course in 2021 and preparing for potential 2021 transitions as part of the Movement Strategy implementation process, it is important that we are also clear about two different skill sets critical to committee support at this time. The first skillset is oriented to understanding affiliate dynamics and organizational development patterns to successfully process affiliate applications for recognition; the other is oriented to conflict prevention and intervention support for affiliates in conflict. ; ; ;Relevant to Affiliate Recognitions *Administration & Attention to detail *Readiness to participate in political discussions on the role and future of affiliates, models of affiliation, and similar topics. *Awareness of the affiliates ecosystem and models and understanding of community building, organizational development, and group dynamics ; ; ;Relevant to Conflict Prevention & Intervention *Communication skills for active listening, clear instruction and turn-taking. *Stress Management skills for maintaining patience and positivity *Emotional intelligence to maintain awareness of emotions of oneself and others to practice empathy, impartiality, and mutual respect. *Facilitation, negotiation, and mediation skills to guide diverse individuals and groups toward cooperation. *Ability to work within a team Do you have relevant skills and interest to support movement affiliates? We are looking for people who are excited by the challenge of empowering volunteers to get organized and form communities that further our mission around the world. In exchange, committee members will gain the experience of supporting their world-wide colleagues to develop their communities as well as personal development in guiding organizational development, facilitating affiliate partnerships, and professional communications. ;Selection process As a reflection of our commitment to openness, transparency, and bilateral engagement with the Wikimedia community, the 2021 member selection process will include a public review and comment period and a self-assessment survey for candidates to share their skills and experience. This self-assessment information will help the committee to identify the skill sets relevant to our affiliate support processes. We invite you to apply for membership to the committee and join us in supporting the affiliates. The data shared in the self-assessment will only be made available to the committee and the relevant staff support. The nomination, candidate Q&A, and endorsements will be posted on Meta for public review at https://meta.wikimedia.org/wiki/Affiliations_Committee/Candidates/June_2021. Here the global community is welcome to provide comments and feedback about each candidate. Once the nomination window closes June 30, 2021, the sitting members who are not candidates for re-election in this cycle will deliberate and then vote, taking into account all inputs from the meta page, self-assessment, advisors, Wikimedia Foundation staff and board liaisons, and committee member discussion. A final decision will be made in late-July 2021, with new members to be notified for onboarding in August. ;How to apply If you are interested in joining the committee, please: '''Step 1'''. Post your application [[Affiliations_Committee/Candidates/June_2021|on the nomination page]] '''by 30 June 2021'''. Your application must include the following information: #Your full name and Wikimedia username #A statement describing your relevant education, experience, abilities, skills, knowledge, availability, and motivation for joining the committee. '''Step 2'''. Complete the [https://wikimedia.qualtrics.com/jfe/form/SV_1Yt1kHndXGBZhqe self-assessment survey] between '''June 01, 2021''' and '''June 30, 2021.''' *The privacy statement that applies to the survey can be found [[foundation:AffCom_Elections_Self-Assessment_Survey_Privacy_Statement|here]]. *'''''NOTE:''' The survey will take 15 mins. Please do not close your browser. If you need a break, you are advised to keep the browser open. In case of losing the link, please reach out to mkaur-ctr{{at}}wikimedia.org'' *This survey must be completed before Steps 3 & 4, as it will provide more background as to the type of work and expectations of members of AffCom. '''Step 3'''. Answers the following questions: *'''''NOTE:''''' Questions 1-3 are required for all candidates. *Question 4 & 5 should be answered by those interested in joining the Recognitions subcommittee. *Question 6 & 7 should be answered by those interested in joining the Conflicts Intervention subcommittee. *If you are willing to nominate yourself for both subcommittees, answer all questions. #What roles have you served across any Wikimedia projects and affiliates that you think have prepared you for this role? #AffCom members need to manage time, confidentiality, conflicts of interest, and diverse situations across the global movement. How do you envision managing these? #Members of AffCom serve on one of two subcommittees: Recognitions OR Conflicts Intervention. Which one of these are you most interested in serving on? #If you are interested in serving on the Recognitions subcommittee, what do you think makes a group of Wikimedians ready to function together as an affiliate? #If you are interested in serving on the Recognitions subcommittee, what do you think are the benefits and responsibilities of functioning as formal affiliates? #If you are interested in serving on the Conflicts Intervention subcommittee, please describe your experience working with conflicts resolution. #If you are interested in serving on the Conflicts Intervention subcommittee, please describe how you have helped build consensus and support diversity. '''Step 4'''. Once you have completed the above, send an email announcing your application to '''affcom{{@}}wikimedia.org''' before the application deadline. If you have any questions, please don't hesitate to contact me and/or the committee as a whole. We are happy to chat or have a phone call with anyone about our work if this helps them decide to apply. Please distribute this call among your networks, and do apply if you are interested! On behalf of the committee, -- [[User:FULBERT|FULBERT]] ([[User talk:FULBERT|talk]]) 15:30, 15 May 2021 (UTC) via MassMessaging [[:Category:Affiliations committee communications]] <!-- Message sent by User:FULBERT@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=21460559 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 15:34, 15 May 2021 (UTC) == UCoC Affiliates consultation report == Hello, We are pleased to announce the completion of the [[Universal Code of Conduct]] [[Universal Code of Conduct/Affiliates consultation|Affiliates]] consultation process early this month. The summary report of the direct consultations and survey is now available at this Meta page: '''https://w.wiki/3Pew'''. Should you have any questions or concerns, please do not hesitate to leave a message on the talk page of the report, or contact [[User:Mervat (WMF)|Mervat]] ({{Nospam||msalman-ctr@wikimedia.org}}) and [[User:RamzyM (WMF)|Ramzy]] ({{Nospam||ramzym-ctr@wikimedia.org}}). Regards, <br> UCoC Team, Wikimedia Foundation <br> <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=21460559 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 08:51, 27 May 2021 (UTC) == Could not bind to LDAP: (-1) Can't contact LDAP server == I keep getting this error when trying to login using LDAPS. [4ac09db92834bbdc36feccae] /index.php?title=Special:PluggableAuthLogin MWException from line 168 of C:\inetpub\myMediaWiki.mydomain.com\extensions\LDAPProvider\src\Client.php: Could not bind to LDAP: (-1) Can't contact LDAP server In the ldap.log, I see that it keeps showing the following error. ldap_connect( $hostname = 'ldaps://ldap.mydomain.com:636', $port = 389 ); Where in the extension does it keeps pointing to port 389? Is there something wrong with the extension? This is my configuration. <code>$LDAPProviderDomainConfigProvider = function() {</code> <code>$config = [</code> <code>'myDomain.com' => [</code> <code>'connection' => [</code> <code>"server" => "ldap.myDomain.com",</code> <code>"port" => 636,</code> <code>"user" => "cn=LDAPMediaWiki,ou=ldap,ou=other,ou=myDomain users,dc=myDomain,dc=com",</code> <code>"pass" => "password",</code> <code>"enctype" => "tls",</code> <code>"options" => [</code> <code>"LDAP_OPT_DEREF" => 1</code> <code>],</code> <code>"basedn" => "dc=myDomain,dc=com",</code> <code>"groupbasedn" => "ou=myDomain groups,dc=myDomain,dc=com",</code> <code>"userbasedn" => "ou=myDomain users,dc=myDomain,dc=com",</code> <code>"searchattribute" => "samaccountname",</code> <code>"usernameattribute" => "samaccountname",</code> <code>"realnameattribute" => "displayname",</code> <code>"emailattribute" => "mail",</code> <code>"grouprequest" => "MediaWiki\\Extension\\LDAPProvider\\UserGroupsRequest\\UserMemberOf::factory"</code> <code>],</code> <code>]</code> <code>];</code> <code>return new \MediaWiki\Extension\LDAPProvider\DomainConfigProvider\InlinePHPArray( $config );</code> <code>};</code> [[User:Laujc|Laujc]] ([[User talk:Laujc|talk]]) 16:07, 3 June 2021 (UTC) == Wikimania 2021: Affiliate Program Submissions and Scholarships == [[File:Wikimania logo with text 2.svg|right|200px]] Dear Wikimedia Affiliates, Wikimania 2021 will be [[:wikimania:2021:Save the date and the Core Organizing Team|hosted virtually]] for the first time in the event's 15-year history. Since there is no in-person host, the event is being organized by a diverse group of Wikimedia volunteers that form the [[:wikimania:2021:Organizers|Core Organizing Team]] for Wikimania 2021. '''Event Program''' - The program design of this Wikimania accommodates affiliates for them to curate a portion of the program. Wikimedia affiliates have an opportunity to host a series of their own sessions. Below are some links to guide you through; *[[:wikimania:2021:Submissions|Program Submissions]] *[[:wikimania:2021:Submissions/Guidelines|Session Submission Guidelines]] *[[:wikimania:2021:FAQ|FAQ]] Please note that the deadline for submission is 18th June 2021. '''Affiliate Scholarships''' - [[:m:Wikimania 2021/Scholarships|Scholarships]] are available to all Wikimedia movement affiliates to support practical access to and participation in Wikimania 2021 in their communities. Please read more about it in the Affiliate Announcement section [[:wikimania:2021:Announcements|here]]. '''Office Hour''' - If you are left with questions, the COT will be hosting some office hours (in multiple languages), in multiple time-zones, to answer any programming questions that you might have. Details can be found [[:wikimania:2021:Organizers#Office hours schedule|here.]] Best regards, [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 13:23, 15 June 2021 (UTC) On behalf of Wikimania 2021 Core Organizing Team <!-- Message sent by User:Bodhisattwa@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=21460559 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 13:23, 15 June 2021 (UTC) == Final Call for Candidates for AffCom - June 2021 == <languages /> {{Help translate/AffCom Elections June 2021}}<!-- --> [[File:Affiliations Committee logo black.svg|[[Affiliations Committee]] (AffCom) logo]] <!--T:1--> ''This is an [[m:Special:MyLanguage/Global message delivery/Targets/Affiliations Committee/News|update]] from the [[m:affcom|Wikimedia Affiliations Committee]]. [[m:Special:MyLanguage/Affiliations Committee/MassMessages/Final Call for Candidates for AffCom - June 2021|Translations]] are available.'' This is a final Call for Candidates for the June 2021 '''[[Special:MyLanguage/Affiliations Committee|Affiliations Committee]]''' election. If you are interested in running, please post your application and follow all four steps [[Affiliations_Committee/Candidates/June_2021|on the nomination page]] '''by 30 June 2021'''. If you know somebody you think may be interested, please share this with them and encourage them to consider it. If you have any questions about this process or the requirements, please email '''affcom@wikimedia.org''' before the application deadline or reach out to any of [[Affiliations_Committee#who-we-are|the current members]]. On behalf of the AffCom elections committee, --- [[User:FULBERT|FULBERT]] ([[User talk:FULBERT|talk]]) 14:15, 20 June 2021 (UTC) via MassMessaging [[:Category:Affiliations committee communications]] [[:Category:AffCom Elections June 2021]] [[:Category:Help translate templates]] [[:Category:AffCom Elections June 2021{{#translation:}}|]] <!-- Message sent by User:FULBERT@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=21625315 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 14:40, 22 June 2021 (UTC) == Learn how the Implementation Grants can support your Movement Strategy plans == We are excited to announce the reopening of the '''Movement Strategy Implementation Grants'''. This program funds projects that advance a specific [[m:Movement Strategy/Initiatives|Movement Strategy initiative]]. The projects can be big or small, but they must all make a case for advancing one initiative. Affiliates that have received funding from the Simple/Annual Plan Grants are welcome to apply. '''[[m:Grants:MSIG/About|Read more about the criteria, what to apply for, and how to apply]]'''. Best regards, <br> [[m:Movement Strategy and Governance|Movement Strategy and Governance Team]] <br> Wikimedia Foundation <br> 15:31, 21 October 2021 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=22135095 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 15:31, 21 October 2021 (UTC) == Affiliations Committee (AffCom) Call for candidates - January 2022 == ''[[m:Special:MyLanguage/Affiliations Committee/Translations/Call for candidates - January 2022|Translations]] are available.'' The '''[[m:Affiliations Committee|Affiliations Committee]]''' – the committee responsible for guiding volunteers in establishing Wikimedia chapters, thematic organizations, and user groups – is looking for new members! The main role of the AffCom is to guide groups of volunteers that are interested in forming Wikimedia affiliates. We review applications from new groups, answer questions and provide advice about the different Wikimedia affiliation models and processes, review affiliate bylaws for compliance with requirements and best practices, and update the Wikimedia Foundation Board of Trustees as well as advise them on issues connected to chapters, thematic organizations and Wikimedia user groups. The committee consists of five to fifteen members, selected at least once every year, to serve two-year terms. Being a part of the AffCom requires communication with volunteers all over the world, negotiating skills, cultural sensitivity, and the ability to understand legal texts. We look for a mix of different skill sets in our members. ;Responsibilities *Availability of up to 5-8 hours per month *Participate in monthly one and two-hour voice/video meetings *Commitment to carry out assigned tasks in a given time. *Facilitate and support communications *Affiliate Support and growth ; ;Required and Recommended Abilities, Skills, Knowledge for Affiliations Committee Members Strong interpersonal relationship among members of the committee and also with the Wikimedia community members. Across all committee members, there are additional relevant skills as well as requirements which help to support the committee and its sustainability which include both required and relevant general skills ; ; ;Required *Fluency in English *Availability of up to 5 hours per week, and the time to participate in a monthly one and two-hour voice/video meetings. *Willingness to use one's real name in committee activities (including contacts with current and potential affiliates) when appropriate. *Strong track record of effective collaboration *International orientation ; ; ;Relevant for all members *Public Communications (English writing and speaking skills) *Skills in other languages are a major plus. *Understanding of the structure and work of affiliates and the Wikimedia Foundation. *Documentation practices *Interviewing experience *Experience with, or in, an active affiliate is a major plus. *Teamwork: Project and people management skills to coordinate and collaborate with different parties on a shared plan and see it through to completion. *Problem-Solving: Ability to evaluate various solutions, consider multiple interests and points of view, revisit unresolved issues, seek compromise and work and communicate across languages and cultures. Given the expectations for maintaining the course in 2022 and preparing for potential 2022 transitions as part of the Movement Strategy implementation process, it is important that we are also clear about two different skill sets critical to committee support at this time. The first skillset is oriented to understanding affiliate dynamics and organizational development patterns to successfully process affiliate applications for recognition; the other is oriented to conflict prevention and intervention support for affiliates in conflict. ; ; ;Relevant to Affiliate Recognitions *Administration & Attention to detail *Readiness to participate in political discussions on the role and future of affiliates, models of affiliation, and similar topics. *Awareness of the affiliates ecosystem and models and understanding of community building, organizational development, and group dynamics ; ; ;Relevant to Conflict Prevention & Intervention *Communication skills for active listening, clear instruction and turn-taking. *Stress Management skills for maintaining patience and positivity *Emotional intelligence to maintain awareness of emotions of oneself and others to practice empathy, impartiality, and mutual respect. *Facilitation, negotiation, and mediation skills to guide diverse individuals and groups toward cooperation. *Ability to work within a team Do you have relevant skills and interest to support movement affiliates? We are looking for people who are excited by the challenge of empowering volunteers to get organized and form communities that further our mission around the world. In exchange, committee members will gain the experience of supporting their world-wide colleagues to develop their communities as well as personal development in guiding organizational development, facilitating affiliate partnerships, and professional communications. ;Selection process As a reflection of our commitment to openness, transparency, and bilateral engagement with the Wikimedia community, the 2022 member selection process will include a public review and comment period and a self-assessment survey for candidates to share their skills and their experience. This self-assessment information will help the committee to identify the skill sets relevant and supportive to our affiliate support processes. We invite you to apply for membership to the committee and join us in supporting the affiliates. The data shared in the self-assessment will only be made available to the committee and the relevant staff support. The nomination, candidate Q&A, and endorsements will still take place posted on Meta for public review at [[:m:Special:MyLanguage/Affiliations Committee/Candidates/January 2022|January 2022 page]]. Here the global community is welcome to provide comments and feedback about each candidate. Once the nomination window closes 31 January 2022, the sitting members who are not candidates for re-election in this cycle will deliberate and then vote, taking into account all inputs from the meta page, self-assessment, advisors, Wikimedia Foundation staff and board liaisons, and committee member discussion. A final decision will be made in late-February 2022, with new members to be notified for onboarding in February. ;How to apply If you are interested in joining the committee, please: '''Step 1'''. Post your application [[:m:Special:MyLanguage/Affiliations Committee/Candidates/January 2022|on the nomination page]] by '''31 January 2022'''. Your application must include the following information: #Your full name and Wikimedia username #A statement describing your relevant education, experience, abilities, skills, knowledge, availability, and motivation for joining the committee. '''Step 2'''. Complete the '''self-assessment survey''' between '''January 1, 2021''' and '''January 31, 2021.''' *The privacy statement that applies to the survey can be found [[foundation:AffCom_Elections_Self-Assessment_Survey_Privacy_Statement|here]]. *'''''NOTE:''' The survey will take 15 mins. Please do not close your browser. If you need a break, you are advised to keep the browser open. In case of losing the link, please reach out to mkaur-ctr{{at}}wikimedia.org'' *This survey must be completed before Steps 3 & 4, as it will provide more background as to the type of work and expectations of members of AffCom. '''Step 3'''. Answers the following questions: *'''''NOTE:''''' Questions 1-3 are required for all candidates. *Question 4 & 5 should be answered by those interested in joining the Recognitions subcommittee. *Question 6 & 7 should be answered by those interested in joining the Conflicts Intervention subcommittee. *If you are willing to nominate yourself for both subcommittees, answer all questions. #What roles have you served across any Wikimedia projects and affiliates that you think have prepared you for this role? #AffCom members need to manage time, confidentiality, conflicts of interest, and diverse situations across the global movement. How do you envision managing these? #Members of AffCom serve on one of two subcommittees: Recognitions OR Conflicts Intervention. Which one of these are you most interested in serving on? #If you are interested in serving on the Recognitions subcommittee, what do you think makes a group of Wikimedians ready to function together as an affiliate? #If you are interested in serving on the Recognitions subcommittee, what do you think are the benefits and responsibilities of functioning as formal affiliates? #If you are interested in serving on the Conflicts Intervention subcommittee, please describe your experience working with conflicts resolution. #If you are interested in serving on the Conflicts Intervention subcommittee, please describe how you have helped build consensus and support diversity. '''Step 4'''. Once you have completed the above, send an email announcing your application to '''affcom{{@}}wikimedia.org''' before the application deadline. If you have any questions, please don't hesitate to contact me and/or the committee as a whole. We are happy to chat or have a webinar call with anyone about our work if this helps them decide to apply. Please distribute this call among your networks, and do apply if you are interested! On behalf of the committee, --[[User:FULBERT|FULBERT]] ([[User talk:FULBERT|talk]]) 13:18, 19 December 2021 (UTC) <!-- Message sent by User:FULBERT@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=22291609 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 14:08, 19 December 2021 (UTC) == Affiliations Committee (AffCom) Call for advisors - January 2022 == ''[[m:Special:MyLanguage/Affiliations Committee/Translations/Call for advisors 2022|Translations]] are available.'' The '''[[m:Special:MyLanguage/Affiliations Committee|Affiliations Committee]]''' – the committee responsible for guiding volunteers in establishing Wikimedia chapters, thematic organizations, and user groups – is looking for new members! '''The Affiliations Committee''' – the committee responsible for guiding volunteers in establishing Wikimedia Chapters, Thematic Organizations, and User Groups – is looking for advisors! The main role of the Affiliations Committee is to guide groups of volunteers that are interested in forming Wikimedia affiliates. We review applications from new groups, answer questions and provide advice about the different Wikimedia affiliation models and processes, review affiliate bylaws for compliance with requirements and best practices, and advise the Wikimedia Foundation Board of Trustees on issues connected to chapters, thematic organizations and Wikimedia user groups. We are looking for advisors who are excited by the challenge of empowering volunteers to get organized and form communities that further our mission around the world. In exchange, committee advisors selected will gain the experience of supporting their world-wide colleagues to develop their communities as well as personal development in guiding organizational development, facilitating affiliate partnerships, and professional communications. AffCom advisors can engage with the committee in a variety of capacities: ;Consultant Individuals with extensive movement experience can be engaged as Consultants for specific cases or initiatives by AffCom. ;Trainer Individuals with specific expertise may be engaged for short-term projects for training AffCom or Affiliates. They might also lead the Capacity Building initiatives for AffCom or affiliates. ;Observer AffCom can request specific or all advisors to act as an observer in different cases to ensure neutrality & compliance with guidelines. ;AffCom Support '''Development of Policies:''' While advisors cannot create legally binding policies for the committee, they can help create policies that provide direction and support for the committee. '''Planning and Implementing Community Relations:''' The advisors are long-term wikimedians & also include influential community leaders who can be effective at spreading the word about initiatives and services. '''Supporting Subcommittees:''' The advisors can support subcommittees that have assigned tasks in specific areas. '''Other Tasks:''' Advisors can be engaged to address a specific need. Such engagements are usually short-lived and are disbanded as soon as their specific goals are met. ;Key skills We look for a healthy mix of different skill sets in our advisors, including the following key skills and experience: #Strong understanding of the structure and work of Wikimedia affiliates and the Wikimedia Foundation. #Readiness to participate in political discussions on the role and future of affiliates, models of affiliation, and similar topics. #Availability of up to 2 hours per week, and the time to participate in a monthly two-hour voice/video meeting #International orientation and ability to work and communicate with other languages and cultures. #Knowledge of different legal systems and experience in community building and organizing are a plus. #Fluency in English is required; skills in other languages are a major plus. #Experience with or in an active Wikimedia affiliate is a major plus. #Strong track record of effective collaboration (such as evidenced skills at facilitation, mediation, negotiation, and so forth) is a major plus. #Willingness to use one's real name in committee activities (including contacts with current and potential affiliates) when appropriate. ;Selection process As a reflection of our commitment to openness, transparency, and bilateral engagement with the Wikimedia community, the 2022 advisors selection process will include a public review and comment period. All applications must be posted on Meta between '''January 01 and January 31, 2022''' at [[m:Affiliations Committee/Advisors/2022|Affiliations Committee/Advisors/2022]], and the community will be invited to provide comments and feedback about each candidate. At the end of the nomination period, the applications will be voted on by the members of the committee, taking into account comments put forward by the committee's members, advisors, Wikimedia Foundation staff and board liaisons, and the community. A final decision will be made in February 2022, with new advisors expected to begin later that month. ;How to apply If you are interested in advising the committee, please submit your candidacy on [[m:Affiliations Committee/Advisors/2022|Affiliations Committee/Advisors/2022]] between January 01 to January 31, 2022. Your application must include the following information: #Your full name and Wikimedia username #A statement describing your relevant experience, skills, and motivation for joining the committee as an advisor. #The advisor role you would like to serve #Answers to the following three questions: ##How do you think affiliates work best together to partner on effective projects and initiatives? ##What do you see as the role of affiliates in the Wikimedia movement in the next three years? ##What do you feel you will bring as an advisor to the committee that makes you a uniquely qualified candidate? If you have any questions, please don't hesitate to contact the committee. We are happy to chat or have a phone call with anyone about our work if this helps them decide to apply. Please distribute this call among your networks, and do apply if you are interested! On behalf of the committee, --[[User:FULBERT|FULBERT]] ([[User talk:FULBERT|talk]]) 13:17, 19 December 2021 (UTC) <!-- Message sent by User:FULBERT@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=22291609 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 14:20, 19 December 2021 (UTC) == Movement Strategy Implementation Grants == {{int:hello}}, the Movement Strategy and Governance team wishes you a good start of the new 2022! As we begin this year, we look forward to seeing more collaboration, increased support and connection between communities and affiliates. We would like to use this chance to share some information on the '''[[m:Grants:MSIG|Movement Strategy Implementation Grants]]''' that aim to support volunteers and affiliates looking to help in implementing the Movement Strategy Initiatives within their communities. These grants support big and small projects that aim to take the current state of an initiative and push it one step forward. Apply for a grant to implement a Movement Strategy initiative with a budget up to $25,000. We understand that ideas flow at their own pace, so Movement Strategy Implementation Grants are designed to be flexible with no set deadline. Your applications are welcome at any time. Applications received after the 15th of each month will be reviewed in the following month. Get in touch with us if you would like to discuss your project proposal or if you need more information about the program. The Movement Strategy and Governance team is happy to host conversations regarding these grants. Conversations may help answer your questions, develop your ideas, and connect with other communities with similar interests. Please see [[m:Grants:MSIG]] and [[m:Grants:MSIG/Examples|suggested examples]], and you are welcome to [[m:Grants:MSIG/Contact#Join our community of practice|join the "MS – Grants Community of Practice" group]] on Telegram! Best regards, Movement Strategy and Governance team ---- Please feel free to reach out to me with any questions. [[User:Xeno (WMF)|Xeno (WMF)]] ([[User talk:Xeno (WMF)|talk]]) 01:50, 6 January 2022 (UTC) == Subscribe to the This Month in Education newsletter - learn from others and share your stories == Dear community members, Greetings from the EWOC Newsletter team and the education team at Wikimedia Foundation. We are very excited to share that we on tenth years of Education Newsletter ([[m:Education/News|This Month in Education]]) invite you to join us by [[m:Global message delivery/Targets/This Month in Education|subscribing to the newsletter on your talk page]] or by [[m:Education/News/Newsroom|sharing your activities in the upcoming newsletters]]. The Wikimedia Education newsletter is a monthly newsletter that collects articles written by community members using Wikimedia projects in education around the world, and it is published by the EWOC Newsletter team in collaboration with the Education team. These stories can bring you new ideas to try, valuable insights about the success and challenges of our community members in running education programs in their context. If your affiliate/language project is developing its own education initiatives, please remember to take advantage of this newsletter to publish your stories with the wider movement that shares your passion for education. You can submit newsletter articles in your own language or submit bilingual articles for the education newsletter. For the month of January the deadline to submit articles is on the 20th January. We look forward to reading your stories. Older versions of this newsletter can be found in the [[outreach:Education/Newsletter/Archives|complete archive]]. More information about the newsletter can be found at [[m:Education/News/Publication Guidelines|Education/Newsletter/About]]. For more information, please contact spatnaik{{@}}wikimedia.org. ------ <div style="text-align: center;"><div style="margin-top:10px; font-size:90%; padding-left:5px; font-family:Georgia, Palatino, Palatino Linotype, Times, Times New Roman, serif;">[[m:Education/Newsletter/About|About ''This Month in Education'']] · [[m:Global message delivery/Targets/This Month in Education|Subscribe/Unsubscribe]] · [[m:MassMessage|Global message delivery]] · For the team: [[User:ZI Jony|<span style="color:#8B0000">'''ZI Jony'''</span>]] [[User talk:ZI Jony|<sup><span style="color:Green"><i>(Talk)</i></span></sup>]], {{<includeonly>subst:</includeonly>#time:l G:i, d F Y|}} (UTC)</div></div> <!-- Message sent by User:ZI Jony@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/AllAffiliates&oldid=21417682 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 11:12, 18 January 2022 (UTC) == Call for Feedback about the Board of Trustees elections is now open == The [[m:Special:MyLanguage/Wikimedia Foundation Board of Trustees/Call for feedback: Board of Trustees elections|'''Call for Feedback: Board of Trustees elections''']] is now open and will close on 16 February 2022. With this Call for Feedback, the Movement Strategy and Governance team is taking a different approach. This approach incorporates community feedback from 2021. Instead of leading with proposals, the Call is framed around key questions from the Board of Trustees. The key questions came from the feedback about the 2021 Board of Trustees election. The intention is to inspire collective conversation and collaborative proposal development about these key questions. There are three questions that will be asked during this Call for Feedback: #What is the best way to ensure more diverse representation among elected candidates? ''The Board of Trustees noted the importance of selecting candidates who represent the full diversity of the Wikimedia movement. The current processes have favored volunteers from North America and Europe.'' #What are the expectations for the candidates during the election? ''Board candidates have traditionally completed applications and answered community questions. How can an election provide appropriate insight into candidates while also appreciating candidates’ status as volunteers?'' #How should affiliates participate in elections? ''Affiliates are an important part of the Wikimedia movement. Two seats of the Board of Trustees due to be filled this year were filled in 2019 through the Affiliate-selected Board seats process. A change in the Bylaws removed the distinction between community and affiliate seats. This leaves the important question: How should affiliates be involved in the selection of new seats?'' The third question is broad in the sense that the answers may refer not just to the two seats mentioned, but also to other, Community- and Affiliate-selected seats. The Board is hoping to find an approach that will both engage the affiliates and give them actual agency, and also optimize the outcomes in terms of selecting people with top skills, experience, diversity, and wide community’s support. The Board of Trustees is seeking feedback about this question especially, although not solely, from the affiliate community. Everyone is invited to share proposals and join the conversation in the Call for Feedback channels. In addition to collecting online feedback, the Movement Strategy and Governance team will organize several video calls with affiliate members to collect feedback. These calls will be at different times and include Trustees. Due to the late addition of this third question, the Call will be extended until 16 February. [[m:Special:MyLanguage/Wikimedia Foundation Board of Trustees/Call for feedback: Board of Trustees elections|Join the conversation.]] Best regards, Movement Strategy and Governance [[User:Xeno (WMF)|Xeno (WMF)]] ([[User talk:Xeno (WMF)|talk]]) 02:14, 21 January 2022 (UTC) == Affiliations Committee (AffCom) Member & Advisor Elections - Final Reminder for January 2022 == ''[[m:Special:MyLanguage/Affiliations Committee/Translations/Member & Advisor elections final reminder for January 2022|Translations]] are available.'' This is a friendly reminder that the '''[[m:Special:MyLanguage/Affiliations Committee|Affiliations Committee]]''' – which is responsible for guiding volunteers in establishing and sustaining Wikimedia chapters, thematic organizations, and user groups – is seeking new members and advisors! The deadline to post your application on the [[m:Special:MyLanguage/Affiliations Committee/Candidates/January 2022|Member nomination page]] and [[m:Special:MyLanguage/Affiliations Committee/Advisors/2022|Advisor nomination]] is 31 January 2022. If you know somebody you think may be interested, please share and encourage them to consider applying. If you have any questions please email affcom@wikimedia.org before the application deadline or reach out to any of the current members. Good luck to all the candidates! On behalf of the committee,<br> [[User:FULBERT|FULBERT]] ([[User talk:FULBERT|talk]]) 17:32, 25 January 2022 (UTC) [[:Category:Affiliations committee communications]] <!-- Message sent by User:FULBERT@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=22291609 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 17:39, 25 January 2022 (UTC) == Leadership Development Task Force: Your feedback is appreciated! == (Read this message in other languages [[metawiki:Leadership_Development_Task_Force|on Meta]]: ‎العربية • Deutsch • español • français • Русский • 中文 • हिन्दी  • বাংলা • Bahasa Indonesia •日本語 • 한국어 • Yorùbá  • Polski • Português bosanski • hrvatski • српски / srpski) Hello everyone, The Community Development team at the Wikimedia Foundation is supporting the creation of a global, community-driven Leadership Development Task Force. The purpose of the task force is to advise leadership development work. The team is looking for feedback about the responsibilities of the Leadership Development Task Force. This Meta page shares the proposal for a [[metawiki:Leadership_Development_Task_Force|Leadership Development Task Force]] and how [[metawiki:Leadership_Development_Task_Force/Participate|you can help.]] Feedback on the proposal will be collected from 7  to 25 February 2022. Thank you, The Community Development team [[User:CCasares (WMF)|CCasares (WMF)]] ([[User talk:CCasares (WMF)|talk]]) 17:13, 10 February 2022 (UTC) == Upcoming vote 7 to 21 March 2022 about the Universal Code of Conduct (UCoC) Enforcement guidelines == Hello again, I am sharing details about an '''[[m:Special:MyLanguage/Universal Code of Conduct/Enforcement guidelines/Voting|upcoming SecurePoll vote]] from 7 to 21 March 2022''' related to the [[m:Universal Code of Conduct/Project|Universal Code of Conduct project]]. Eligibility to vote is determined based on contributions, including as a staff member or contractor of Wikimedia movement affiliates. See the [[m:Special:MyLanguage/Universal_Code_of_Conduct/Enforcement_guidelines/Voter_information|voter information page]] for full details. During the poll, participants will be invited to include comments with their vote. The participation and valuable input from many movement participants and affiliates throughout this process is recognized and greatly appreciated. Please let me know if you have any questions. [[User:Xeno (WMF)|Xeno (WMF)]] ([[User talk:Xeno (WMF)|talk]]) 02:20, 24 February 2022 (UTC) ---- :''[[m:Special:MyLanguage/Universal Code of Conduct/Enforcement guidelines/Voting/Announcement|You can find this message translated into additional languages on Meta-wiki.]]'' :''<div class="plainlinks">[[m:Special:MyLanguage/Universal Code of Conduct/Enforcement guidelines/Voting/Announcement|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Universal Code of Conduct/Enforcement guidelines/Voting/Announcement}}&language=&action=page&filter= {{int:please-translate}}]</div>'' A [[m:Special:MyLanguage/Universal_Code_of_Conduct/Enforcement_guidelines/Voting|'''vote in SecurePoll from 7 to 21 March 2022''']] is scheduled as part of the ratification process for the Universal Code of Conduct (UCoC) Enforcement guidelines. Eligible voters are invited to answer a poll question and share comments. [[m:Special:MyLanguage/Universal_Code_of_Conduct/Enforcement_guidelines/Voter_information|Read voter information and eligibility details.]] During the poll, voters will be asked if they support the enforcement of the Universal Code of Conduct based on the proposed guidelines. The [[m:Special:MyLanguage/Universal Code of Conduct|Universal Code of Conduct]] (UCoC) provides a baseline of acceptable behavior for the entire movement. The [[m:Special:MyLanguage/Universal_Code_of_Conduct/Enforcement_guidelines|revised enforcement guidelines]] were published 24 January 2022 as a proposed way to apply the policy across the movement. A [[m:Special:MyLanguage/Wikimedia_Foundation_Board_noticeboard/January_2022_-_Board_of_Trustees_on_Community_ratification_of_enforcement_guidelines_of_UCoC|Wikimedia Foundation Board statement]] calls for a [[m:Special:MyLanguage/Universal_Code_of_Conduct/Enforcement_guidelines/Voting|ratification process]] where eligible voters will have an opportunity to support or oppose the adoption of the UCoC Enforcement guidelines in a vote. Wikimedians are invited to [[m:Special:MyLanguage/Universal_Code_of_Conduct/Enforcement_guidelines/Voter_information/Volunteer|translate and share important information]]. For more information about the UCoC, please see the [[m:Special:MyLanguage/Universal Code of Conduct/Project|project page]] and [[m:Special:MyLanguage/Universal Code of Conduct/FAQ|frequently asked questions]] on Meta-wiki. The [[m:Movement Strategy and Governance|Movement Strategy and Governance]] (MSG) team is hosting Conversation Hours on 25 February 2022 at 12:00 UTC and 4 March 2022 at 15:00 UTC. Please [[m:Special:MyLanguage/Universal_Code_of_Conduct/Conversations|'''sign-up for these conversation hours''']] to interact with the project team and the drafting committee about the updated enforcement guidelines and the ratification process. See the [[m:Special:MyLanguage/Universal_Code_of_Conduct/2022_conversation_hour_summaries|Conversation Hour summaries]] for notes from 4 February 2022. You can comment on Meta-wiki talk pages in any language. You may also contact either team by email: msg<span><span>[[File:At sign.svg|link=|16x16px]]</span></span>wikimedia.org or ucocproject<span><span>[[File:At sign.svg|link=|16x16px]]</span></span>wikimedia.org Sincerely, Movement Strategy and Governance <br /> Wikimedia Foundation <br /><section end="announcement-content" /> [[User:Xeno (WMF)|Xeno (WMF)]] ([[User talk:Xeno (WMF)|talk]]) 02:20, 24 February 2022 (UTC) :As a reminder, the ratification voting process for the [[m:Special:MyLanguage/Universal Code of Conduct/Enforcement guidelines|revised enforcement guidelines]] of the [[m:Special:MyLanguage/Universal Code of Conduct|Universal Code of Conduct]] (UCoC) is now open! '''[[m:Special:MyLanguage/Universal Code of Conduct/Enforcement guidelines/Voting|Voting commenced on SecurePoll]]''' on 7 March 2022 and will conclude on 21 March 2022. Please [[m:Universal Code of Conduct/Enforcement guidelines/Voter information|read more on the voter information and eligibility details]]. :Staff and members may have the opportunity to vote. Anyone who meets the criteria but finds themselves unable to vote should email ucocproject<span><span>[[File:At sign.svg|link=|16x16px]]</span></span>wikimedia.org at least four day before the end of voting to be manually added. :Let me know if you have questions. [[User:Xeno (WMF)|Xeno (WMF)]] ([[User talk:Xeno (WMF)|talk]]) 01:49, 10 March 2022 (UTC) == Invitation to Hubs event: Global Conversation on 2022-03-12 at 13:00 UTC == Hello everyone, We hope you can join us this upcoming Saturday 12 March for a '''[[m:Special:MyLanguage/Hubs/Global_Conversations_March_12,_2022|Global Conversation]]''' about [[m:Special:MyLanguage/Hubs|Hubs]]. Please see more details below. ---- :''[[m:Special:MyLanguage/Hubs/Global Conversations March 12, 2022/Invitation|You can find this message translated into additional languages on Meta-wiki.]]'' :''<div class="plainlinks">[[m:Special:MyLanguage/Hubs/Global Conversations March 12, 2022/Invitation|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Hubs/Global Conversations March 12, 2022/Invitation}}&language=&action=page&filter= {{int:please-translate}}]</div>'' <section begin="announcement-content" />Hello! The Movement Strategy and Governance team of the Wikimedia Foundation would like to invite you to the next event about "Regional and Thematic Hubs". The Wikimedia Movement is in the process of understanding what Regional and Thematic Hubs should be. Our workshop in November was a good start ([[m:Special:MyLanguage/Hubs/Documentation/27 November Workshop|read the report]]), but we're not finished yet. Over the last weeks we conducted about 16 interviews with groups working on establishing a Hub in their context ([[m:Special:MyLanguage/Hubs/Dialogue|see Hubs Dialogue]]). These interviews informed a report that will serve as a foundation for discussion on March 12. The report is planned to be published on March 9. The event will take place on March 12, 13:00 to 16:00 UTC on Zoom. Interpretation will be provided in French, Spanish, Arabic, Russian, and Portuguese. Registration is open, and will close on March 10. Anyone interested in the topic is invited to join us. '''[[m:Hubs/Global Conversations March 12, 2022|More information on the event on Meta-wiki]]'''. Best regards, [[User:KVaidla (WMF)|Kaarel Vaidla]]<br />Movement Strategy<br /> <section end="announcement-content" /> ---- Feel free to let me know if you have any questions. [[User:Xeno (WMF)|Xeno (WMF)]] ([[User talk:Xeno (WMF)|talk]]) 17:05, 5 March 2022 (UTC) :[[File:Hubs_Dialogue_Findings_Summary.pdf|right|Hubs Dialogue Findings Summary]] ::A [[:file:Hubs_Dialogue_Findings_Summary.pdf |report on the findings of the Hubs Dialogue has been published on Commons]] ahead of the Global Conversation later today. [[User:Xeno (WMF)|Xeno (WMF)]] ([[User talk:Xeno (WMF)|talk]]) 01:37, 12 March 2022 (UTC) == Maggie Dennis (CR&S) conversation hour 24 March 2022; apply to Leadership Development Working Group by 10 April; closing message about the Board Call for Feedback and UCoC enforcement guidelines vote == Hello all- I have a multipart announcement: feel free to let me know if you have questions about any of these topics (or bring them to the conversation hour!). ---- ;Join the Community Resilience and Sustainability Conversation Hour with Maggie Dennis <section begin="announcement-content" /> :''[[m:IRC office hours/Office hours 2022-03-24/Announcement|You can find this message translated into additional languages on Meta-wiki.]]'' :''<div class="plainlinks">[[m:Special:MyLanguage/IRC office hours/Office hours 2022-03-24/Announcement|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:IRC office hours/Office hours 2022-03-24/Announcement}}&language=&action=page&filter= {{int:please-translate}}]</div>'' The [[m:Community Resilience and Sustainability|Community Resilience and Sustainability]] team at the Wikimedia Foundation is hosting a conversation hour led by its Vice President [[m:User:Mdennis (WMF)|Maggie Dennis]]. Topics within scope for this call include Movement Strategy, Board Governance, Trust and Safety, the Universal Code of Conduct, Community Development, and Human Rights. Come with your questions and feedback, and let's talk! You can also send us your questions in advance. The meeting will be on 24 March 2022 at 15:00 UTC ([https://zonestamp.toolforge.org/1648134035 check your local time]). You can [[m:IRC office hours/Office hours 2022-03-24|'''read details on Meta-wiki''']]. ---- ;Leadership Development Working Group - Apply to join by 10 April 2022 :''[[m:Special:MyLanguage/Leadership Development Working Group/Participate/Announcement/Reminder|You can find this message translated into additional languages on Meta-wiki.]]'' :''<div class="plainlinks">[[m:Special:MyLanguage/Leadership Development Working Group/Participate/Announcement/Reminder|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Leadership Development Working Group/Participate/Announcement/Reminder}}&language=&action=page&filter= {{int:please-translate}}]</div>'' The Community Development team at the Wikimedia Foundation is supporting the creation of a global, community-driven [[m:Special:MyLanguage/Leadership Development Working Group|Leadership Development Working Group]]. The purpose of the working group is to advise leadership development work. Feedback was collected in February 2022 and a [[m:Special:MyLanguage/Leadership Development Working Group/Participate#5. Summary of Call for Feedback|summary of the feedback]] is on Meta-wiki. The application period to join the Working Group is now open and is closing soon on April 10, 2022. Please [[m:Special:MyLanguage/Leadership Development Working Group/Purpose and Structure#3. How is the working group formed and structured?|review the information about the working group]], share with community members who might be interested, and [[m:Special:MyLanguage/Leadership Development Working Group/Participate#1. How to participate|'''apply if you are interested''']]. Thank you, From the Community Development team<br /><section end="announcement-content" /> ---- ;The Call for Feedback - Board of Trustees elections is now closed <section begin="announcement-content" />:''[[m:Special:MyLanguage/Wikimedia Foundation Board of Trustees/Call for feedback: Board of Trustees elections/Call for Feedback is now closed|You can find this message translated into additional languages on Meta-wiki.]]'' :''<div class="plainlinks">[[m:Special:MyLanguage/Wikimedia Foundation Board of Trustees/Call for feedback: Board of Trustees elections/Call for Feedback is now closed|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Wikimedia Foundation Board of Trustees/Call for feedback: Board of Trustees elections/Call for Feedback is now closed}}&language=&action=page&filter= {{int:please-translate}}]</div>'' The [[m:Wikimedia Foundation Board of Trustees/Call for feedback: Board of Trustees elections|Call for Feedback: Board of Trustees elections]] is now closed. This Call ran from 10 January and closed on 16 February 2022. The Call focused on [[m:Wikimedia Foundation Board of Trustees/Call for feedback: Board of Trustees elections/Discuss Key Questions#Questions|three key questions]] and received broad discussion [[m:Talk:Wikimedia Foundation Board of Trustees/Call for feedback: Board of Trustees elections/Discuss Key Questions|on Meta-wiki]], during meetings with affiliates, and in various community conversations. The community and affiliates provided many proposals and discussion points. The [[m:Wikimedia Foundation Board of Trustees/Call for feedback: Board of Trustees elections/Reports|'''reports are on Meta-wiki''']]. This information will be shared with the Board of Trustees and Elections Committee so they can make informed decisions about the upcoming Board of Trustees election. The Board of Trustees will then follow with an announcement after they have discussed the information. Thank you to everyone who participated in the Call for Feedback to help improve Board election processes. Best regards, Movement Strategy and Governance<br /><section end="announcement-content" /> ---- ;Universal Code of Conduct Enforcement guidelines ratification voting is now closed <section begin="announcement-content" /> :''[[m:Special:MyLanguage/Universal Code of Conduct/Enforcement guidelines/Vote/Closing message|You can find this message translated into additional languages on Meta-wiki.]]'' :''<div class="plainlinks">[[m:Special:MyLanguage/Universal Code of Conduct/Enforcement guidelines/Vote/Closing message|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Universal Code of Conduct/Enforcement guidelines/Vote/Closing message}}&language=&action=page&filter= {{int:please-translate}}]</div>'' The ratification voting process for the [[m:Special:MyLanguage/Universal Code of Conduct/Enforcement guidelines|revised enforcement guidelines]] of the [[m:Special:MyLanguage/Universal Code of Conduct|Universal Code of Conduct]] (UCoC) came to a close on 21 March 2022. Over {{#expr:2300}} Wikimedians voted across different regions of our movement. Thank you to everyone who participated in this process! The scrutinizing group is now reviewing the vote for accuracy, so please allow up to two weeks for them to finish their work. The final [[m:Special:MyLanguage/Universal Code of Conduct/Enforcement guidelines/Voting/Results|'''results from the voting process will be announced here''']], along with the relevant statistics and a summary of comments as soon as they are available. Please check out [[m:Special:MyLanguage/Universal Code of Conduct/Enforcement guidelines/Voter information|the voter information page]] to learn about the next steps. You can comment on the project talk page [[m:Talk:Universal Code of Conduct/Enforcement guidelines|on Meta-wiki]] in any language. You may also contact the UCoC project team by email: ucocproject<span><span>[[File:At sign.svg|link=|16x16px]]</span></span>wikimedia.org Best regards, Movement Strategy and Governance<br /><section end="announcement-content" /> ---- [[User:Xeno (WMF)|Xeno (WMF)]] ([[User talk:Xeno (WMF)|talk]]) 01:43, 23 March 2022 (UTC) == Movement Strategy and Governance News – Issue 6 == <section begin="msg-newsletter" /> <div style="line-height: 1.2"> <span style="font-size:200%;">'''Movement Strategy and Governance News'''</span><br> <span style="font-size:120%; color:#404040;">'''Issue 6, April 2022'''</span><span style="font-size:120%; float:right;">[[m:Special:MyLanguage/Movement Strategy and Governance/Newsletter/6|'''Read the full newsletter''']]</span> ---- Welcome to the sixth issue of Movement Strategy and Governance News! This revamped newsletter distributes relevant news and events about the Movement Charter, Universal Code of Conduct, Movement Strategy Implementation grants, Board of trustees elections and other relevant MSG topics. This Newsletter will be distributed quarterly, while the more frequent Updates will also be delivered weekly. Please remember to subscribe [[m:Special:MyLanguage/Global message delivery/Targets/MSG Newsletter Subscription|here]] if you would like to receive future issues of this newsletter. </div><div style="margin-top:3px; padding:10px 10px 10px 20px; background:#fffff; border:2px solid #808080; border-radius:4px; font-size:100%;"> *'''Leadership Development -''' A Working Group is Forming! - The application to join the Leadership Development Working Group closed on April 10th, 2022, and up to 12 community members will be selected to participate in the working group. ([[:m:Special:MyLanguage/Movement Strategy and Governance/Newsletter/6#A1|continue reading]]) *'''Universal Code of Conduct Ratification Results are out! -''' The global decision process on the enforcement of the UCoC via SecurePoll was held from 7 to 21 March. Over 2,300 eligible voters from at least 128 different home projects submitted their opinions and comments. ([[:m:Special:MyLanguage/Movement Strategy and Governance/Newsletter/6#A2|continue reading]]) *'''Movement Discussions on Hubs -''' The Global Conversation event on Regional and Thematic Hubs was held on Saturday, March 12, and was attended by 84 diverse Wikimedians from across the movement. ([[:m:Special:MyLanguage/Movement Strategy and Governance/Newsletter/6#A3|continue reading]]) *'''Movement Strategy Grants Remain Open! -''' Since the start of the year, six proposals with a total value of about $80,000 USD have been approved. Do you have a movement strategy project idea? Reach out to us! ([[:m:Special:MyLanguage/Movement Strategy and Governance/Newsletter/6#A4|continue reading]]) *'''The Movement Charter Drafting Committee is All Set! -''' The Committee of fifteen members which was elected in October 2021, has agreed on the essential values and methods for its work, and has started to create the outline of the Movement Charter draft. ([[:m:Special:MyLanguage/Movement Strategy and Governance/Newsletter/6#A5|continue reading]]) *'''Introducing Movement Strategy Weekly -''' Contribute and Subscribe! - The MSG team have just launched the updates portal, which is connected to the various Movement Strategy pages on Meta-wiki. Subscriber to get up-to-date news about the various ongoing projects. ([[:m:Special:MyLanguage/Movement Strategy and Governance/Newsletter/6#A6|continue reading]]) *'''Diff Blogs -''' Check out the most recent publications about the UCoC on Wikimedia Diff. ([[:m:Special:MyLanguage/Movement Strategy and Governance/Newsletter/6#A7|continue reading]]) </div><section end="msg-newsletter" /> Please let me know if you have questions. [[User:Xeno (WMF)|Xeno (WMF)]] ([[User talk:Xeno (WMF)|talk]]) 02:01, 13 April 2022 (UTC) == Wikimedia Foundation Board of Trustees election 2022 Call for Candidates == {{Archive top|status=resolved}} There is an open [[m:Special:MyLanguage/Wikimedia Foundation elections/2022/Announcement/Call for Candidates|'''Call for Candidates''']] for the [[m:Special:MyLanguage/Wikimedia Foundation elections/2022|2022 Board of Trustees election]]. Find out more on the [[m:Special:MyLanguage/Wikimedia Foundation elections/2022/Apply to be a Candidate|Apply to be a Candidate page]]. The Wikimedia Foundation Board of Trustees oversees the Wikimedia Foundation's operations. Community-and-affiliate selected trustees and Board-appointed trustees make up the Board of Trustees. Each trustee serves a three year term. The Wikimedia community has the opportunity to vote for community-and-affiliate selected trustees. The Wikimedia community will vote to fill two seats on the Board in 2022. This is an opportunity to improve the representation, diversity, and expertise of the Board as a team. Please consider [[m:Special:MyLanguage/Wikimedia_Foundation_elections/2022/Apply_to_be_a_Candidate|submitting your candidacy to join the Board of Trustees]]. –Movement Strategy and Governance on behalf of the Elections Committee and the Board of Trustees ([[m:Special:MyLanguage/Wikimedia Foundation elections/2022/Announcement/Call for Candidates/Short|see full announcement]]) [[User:Xeno (WMF)|Xeno (WMF)]] ([[User talk:Xeno (WMF)|talk]]) 02:42, 26 April 2022 (UTC) {{Archive bottom}} == Wikimedia Foundation Board Elections 2022: Propose statements for the Election Compass == {{Archive top|status=resolved}} <section begin="announcement-content" /> :''[[m:Special:MyLanguage/Wikimedia Foundation elections/2022/Announcement/Propose statements for the 2022 Election Compass| You can find this message translated into additional languages on Meta-wiki.]]'' :''<div class="plainlinks">[[m:Special:MyLanguage/Wikimedia Foundation elections/2022/Announcement/Propose statements for the 2022 Election Compass|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Wikimedia Foundation elections/2022/Announcement/Propose statements for the 2022 Election Compass}}&language=&action=page&filter= {{int:please-translate}}]</div>'' Hi all, Community members in the [[m:Special:MyLanguage/Wikimedia Foundation elections/2022|2022 Board of Trustees election]] are invited to '''[[m:Special:MyLanguage/Wikimedia_Foundation_elections/2022/Community_Voting/Election_Compass|propose statements to use in the Election Compass.]]''' An Election Compass is a tool to help voters select the candidates that best align with their beliefs and views. The community members will propose statements for the candidates to answer using a Lickert scale (agree/neutral/disagree). The candidates’ answers to the statements will be loaded into the Election Compass tool. Voters will use the tool by entering in their answer to the statements (agree/disagree/neutral). The results will show the candidates that best align with the voter’s beliefs and views. {| class="wikitable mw-collapsible mw-collapsed" |- ! colspan="3" |Timeline for the Election Compass |- | July 8 - 20: Community members propose statements for the Election Compass July 21 - 22: Elections Committee reviews statements for clarity and removes off-topic statements July 23 - August 1: Volunteers vote on the statements August 2 - 4: Elections Committee selects the top 15 statements August 5 - 12: candidates align themselves with the statements August 15: The Election Compass opens for voters to use to help guide their voting decision |} The Elections Committee will select the top 15 statements at the beginning of August. The Elections Committee will oversee the process, supported by the Movement Strategy and Governance team. MSG will check that the questions are clear, there are no duplicates, no typos, and so on. Best, Movement Strategy and Governance ''This message was sent on behalf of the Board Selection Task Force and the Elections Committee''<br /><section end="announcement-content" /> [[User:Xeno (WMF)|Xeno (WMF)]] ([[User talk:Xeno (WMF)|talk]]) 17:20, 11 July 2022 (UTC) {{Archive bottom}} == Vote for Election Compass Statements == {{Archive top|status=resolved}} Hi all, Volunteers in the [[metawiki:Special:MyLanguage/Wikimedia Foundation elections/2022|2022 Board of Trustees election]] are invited to [[metawiki:Special:MyLanguage/Wikimedia_Foundation_elections/2022/Community_Voting/Election_Compass/Statements|vote for statements to use in the Election Compass]]. You can vote for the statements you would like to see included in the Election Compass on Meta-wiki. An Election Compass is a tool to help voters select the candidates that best align with their beliefs and views. The community members will propose statements for the candidates to answer using a Lickert scale (agree/neutral/disagree). The candidates’ answers to the statements will be loaded into the Election Compass tool. Voters will use the tool by entering in their answer to the statements (agree/disagree/neutral). The results will show the candidates that best align with the voter’s beliefs and views. Here is the timeline for the Election Compass: *<s>July 8 - 20: Volunteers propose statements for the Election Compass</s> *<s>July 21 - 22: Elections Committee reviews statements for clarity and removes off-topic statements</s> *July 23 - August 1: Volunteers vote on the statements *August 2 - 4: Elections Committee selects the top 15 statements *August 5 - 12: candidates align themselves with the statements *August 15: The Election Compass opens for voters to use to help guide their voting decision The Elections Committee will select the top 15 statements at the beginning of August Best, Movement Strategy and Governance ''This message was sent on behalf of the Board Selection Task Force and the Elections Committee'' [[User:RamzyM (WMF)|RamzyM (WMF)]] ([[User talk:RamzyM (WMF)|talk]]) 08:33, 26 July 2022 (UTC) {{Archive bottom}} == Delay of the 2022 Wikimedia Foundation Board of Trustees election == {{Archive top|status=resolved}} <section begin="announcement-content" /> :''[[m:Special:MyLanguage/Wikimedia Foundation elections/2022/Announcement/Delay of Board of Trustees election| You can find this message translated into additional languages on Meta-wiki.]]'' :''<div class="plainlinks">[[m:Special:MyLanguage/Wikimedia Foundation elections/2022/Delay of Board of Trustees election|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Wikimedia Foundation elections/2022/Announcement/Delay of Board of Trustees election}}&language=&action=page&filter= {{int:please-translate}}]</div>'' Hi all, I am reaching out to you today with an update about the timing of the voting for the Board of Trustees election. As many of you are already aware, this year we are offering an [[m:Special:MyLanguage/Wikimedia_Foundation_elections/2022/Community_Voting/Election_Compass|Election Compass]] to help voters identify the alignment of candidates on some key topics. Several candidates requested an extension of the character limitation on their responses expanding on their positions, and the Elections Committee felt their reasoning was consistent with the goals of a fair and equitable election process. To ensure that the longer statements can be translated in time for the election, the Elections Committee and Board Selection Task Force decided to delay the opening of the Board of Trustees election by one week - a time proposed as ideal by staff working to support the election. Although it is not expected that everyone will want to use the Election Compass to inform their voting decision, the Elections Committee felt it was more appropriate to open the voting period with essential translations for community members across languages to use if they wish to make this important decision. The voting will open on August 23 at 00:00 UTC and close on September 6 at 23:59 UTC. Best regards, Matanya, on behalf of the Elections Committee <section end="announcement-content" /> [[User:RamzyM (WMF)|RamzyM (WMF)]] 12:23, 15 August 2022 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliates_-_RM&oldid=23566904 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 12:23, 15 August 2022 (UTC) {{Archive bottom}} == Revised Enforcement Draft Guidelines for the Universal Code of Conduct == {{Archive top|status=resolved}} <section begin="announcement-content" /> :''[[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines/Announcement|You can find this message translated into additional languages on Meta-wiki.]]'' :''<div class="plainlinks">[[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines/Announcement|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Universal Code of Conduct/Revised enforcement guidelines/Announcement}}&language=&action=page&filter= {{int:please-translate}}]</div>'' Hello everyone, The [[m:Special:MyLanguage/Universal Code of Conduct/Drafting committee#Revisions Committee|Universal Code of Conduct Enforcement Guidelines Revisions committee]] is requesting comments regarding the [[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines|'''Revised Enforcement Draft Guidelines for the Universal Code of Conduct (UCoC)''']]. This review period will be open from '''8 September 2022 until 8 October 2022.''' The Committee collaborated to revise these draft guidelines based on input gathered from the community discussion period from May through July, as well as the community vote that concluded in March 2022. The revisions are focused on the following four areas: #To identify the type, purpose, and applicability of the UCoC training; #To simplify the language for more accessible translation and comprehension by non-experts; #To explore the concept of affirmation, including its pros and cons; #To review the balancing of the privacy of the accuser and the accused The Committee requests comments and suggestions about these revisions by '''8 October 2022'''. From there, the Revisions Committee anticipates further revising the guidelines based on community input. '''[[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines|Find the Revised Guidelines on Meta]], and a [[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines/Comparison|comparison page in some languages.]]''' Everyone may share comments in a number of places. Facilitators welcome comments in any language on [[m:Special:MyLanguage/Talk:Universal Code of Conduct/Revised enforcement guidelines|the Revised Enforcement Guidelines talk page]]. Comments can also be shared on talk pages of translations, at local discussions, or during conversation hours. There are a series of [[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines/Conversation hours|'''conversation hours''']] planned about the Revised Enforcement Guidelines; please see Meta for the times and details. The facilitation team supporting this review period hopes to reach a large number of communities. If you do not see a conversation happening in your community, please organize a discussion. Facilitators can assist you in setting up the conversations. Discussions will be summarized and presented to the drafting committee every two weeks. The summaries will be published [[m:Special:MyLanguage/Universal Code of Conduct/Drafting committee/Digests|here]].<section end="announcement-content" /> On behalf of the UCoC Project Team,<br> [[User:RamzyM (WMF)|RamzyM (WMF)]] 16:21, 9 September 2022 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Movement_Strategy_and_Governance/Delivery/Affiliates_-_RM&oldid=23733590 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 16:21, 9 September 2022 (UTC) {{Archive bottom}} == Review period on the revised Enforcement Guidelines for the Universal Code of Conduct closed == {{Archive top|status=resolved}} <section begin="announcement-content" /> :''[[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines/Announcement/Consultation Close|You can find this message translated into additional languages on Meta-wiki.]]'' :''<div class="plainlinks">[[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines/Announcement/Consultation Close|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Universal Code of Conduct/Revised enforcement guidelines/Announcement/Consultation Close}}&language=&action=page&filter= {{int:please-translate}}]</div>'' Dear Wikimedians, Thank you for participating in the review of the [[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines|Revised Enforcement Draft Guidelines for the Universal Code of Conduct (UCoC)]]. The UCoC project team and the [[m:Special:MyLanguage/Universal Code of Conduct/Drafting committee#Revisions Committee|UCoC Enforcement Guidelines Revisions Committee]] appreciate you all taking the time to discuss the guidelines, suggest changes, and ask questions. '''This community review period lasted from 8 September 2022 to 8 October 2022.''' Over the past four weeks, the UCoC project team has collected valuable community input from various channels, including three [[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines/Conversation hours|conversation hours sessions]], where Wikimedians could get together to discuss the revised UCoC Enforcement Guidelines. The Revisions Committee will review community input when they reconvene in the second week of October 2022. The UCoC project team will support them in providing updates as they continue their work and will continue to inform the community about all important developments and milestones as the Committee prepares the final version of the UCoC Enforcement Guidelines that is currently scheduled for a community-wide vote in mid-January of 2023.<br> On behalf of the UCoC Project Team, <section end="announcement-content" /> [[User:RamzyM (WMF)|RamzyM (WMF)]] & [[User:VChang (WMF)|VChang (WMF)]] 13:48, 18 October 2022 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Movement_Strategy_and_Governance/Delivery/Affiliates_-_RM&oldid=23733590 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 13:48, 18 October 2022 (UTC) {{Archive bottom}} == Upcoming vote on the revised Enforcement Guidelines for the Universal Code of Conduct == <section begin="announcement-content" /> :''[[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines/Announcement/Voting 1|You can find this message translated into additional languages on Meta-wiki.]]'' :''<div class="plainlinks">[[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines/Announcement/Voting 1|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Universal Code of Conduct/Revised enforcement guidelines/Announcement/Voting 1}}&language=&action=page&filter= {{int:please-translate}}]</div>'' Hello all, In mid-January 2023, the [[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines|Enforcement Guidelines]] for the [[m:Special:MyLanguage/Universal Code of Conduct|Universal Code of Conduct]] will undergo a second community-wide ratification vote. This follows [[m:Special:MyLanguage/Universal Code of Conduct/Enforcement guidelines/Voting/Results|the March 2022 vote]], which resulted in a majority of voters supporting the Enforcement Guidelines. During the vote, participants helped highlight important community concerns. The Board’s [[m:Special:MyLanguage/Wikimedia Foundation Community Affairs Committee|Community Affairs Committee]] requested that these areas of concern be reviewed. The volunteer-led [[m:Special:MyLanguage/Universal_Code_of_Conduct/Drafting_committee#Revisions_Committee_members|Revisions Committee]] worked hard reviewing community input and making changes. They updated areas of concern, such as training and affirmation requirements, privacy and transparency in the process, and readability and translatability of the document itself. The revised Enforcement Guidelines can be viewed '''[[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines|here]]''', and a comparison of changes can be found '''[[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines/Comparison|here]]'''. '''How to vote?''' Beginning '''January 17, 2023''', voting will be open. '''[[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines/Voter information|This page on Meta-wiki]]''' outlines information on how to vote using SecurePoll. '''Who can vote?''' The '''[[m:Special:MyLanguage/Universal_Code_of_Conduct/Revised enforcement_guidelines/Voter_information#Voting_eligibility|eligibility requirements]]''' for this vote are the same as for the Wikimedia Board of Trustees elections. See the voter information page for more details about voter eligibility. If you are an eligible voter, you can use your Wikimedia account to access the voting server. '''What happens after the vote?''' Votes will be scrutinized by an independent group of volunteers, and the results will be published on Wikimedia-l, the Movement Strategy Forum, Diff and on Meta-wiki. Voters will again be able to vote and share concerns they have about the guidelines. The Board of Trustees will look at the levels of support and concerns raised as they look at how the Enforcement Guidelines should be ratified or developed further. On behalf of the UCoC Project Team,<section end="announcement-content" /> [[User:RamzyM (WMF)|RamzyM (WMF)]] 10:08, 12 January 2023 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Movement_Strategy_and_Governance/Delivery/Affiliates_-_RM&oldid=23733590 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:08, 12 January 2023 (UTC) == Upcoming event == The Tech Department at Wikimedia Foundation [1] invites you to a '''special event on February 09, 2023, at 1600 UTC''' [2]. '''Richard Evans, Electronics & Data Systems Engineer At NASA Glenn Research Center''' [3], will be presenting on '''how MediaWiki is being used within NASA''' to help manage the testing of very large spacecraft to prove they can survive the harsh conditions of launch, orbit, and re-entry. The management platform is built from MediaWiki and several key extensions that provide workflow support. This evolving platform plans to incorporate the extensions that form the MediaWiki-powered Open CSP platform [4]. This talk will explain the architecture and benefits of the NASA platform and motivate the need for Open CSP. We’ll also be recording the event to share with those who can’t make it. You can join the event through YouTube [5]. Looking forward to seeing you there, --on behalf of the Tech Department, Wikimedia Foundation. (For follow-ups, please reach out to lnguyen@wikimedia.org.) [1] https://www.mediawiki.org/wiki/Wikimedia_Technology [2] https://zonestamp.toolforge.org/1675958415 [3] https://www.wikidata.org/wiki/Q618728#sitelinks-wikipedia [4] https://www.open-csp.org/Main_Page [5] https://youtube.com/live/kBkiNRJPLM8 [[User:Elitre (WMF)|Elitre (WMF)]] ([[User talk:Elitre (WMF)|talk]]) 14:00, 31 January 2023 (UTC) :(Please note the event link has changed.) [[User:Elitre (WMF)|Elitre (WMF)]] ([[User talk:Elitre (WMF)|talk]]) 12:25, 1 February 2023 (UTC) == Voting on the revised Enforcement Guidelines for the Universal Code of Conduct is closed == <section begin="announcement-content" /> :''[[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines/Announcement/Voting 4|You can find this message translated into additional languages on Meta-wiki.]]'' :''<div class="plainlinks">[[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines/Announcement/Voting 4|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Universal Code of Conduct/Revised enforcement guidelines/Announcement/Voting 4}}&language=&action=page&filter= {{int:please-translate}}]</div>'' Hello all, The [[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines/Voting|vote]] on the [[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines|Universal Code of Conduct Enforcement Guidelines]] is now closed. The results will now be counted and scrutinized to ensure that only eligible votes are included. Results will be published [[m:Special:MyLanguage/Universal Code of Conduct/Enforcement guidelines/Voting/Results|on Meta]] and other movement forums as soon as they become available, as well as information on future steps. Thank you to all who participated in the voting process, and who have contributed to the drafting of Guidelines. On behalf of the UCoC Project Team, <section end="announcement-content" /> [[User:RamzyM (WMF)|RamzyM (WMF)]] 11:39, 3 February 2023 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Movement_Strategy_and_Governance/Delivery/Affiliates_-_RM&oldid=23733590 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 11:39, 3 February 2023 (UTC) == Universal Code of Conduct revised enforcement guidelines vote results == <section begin="announcement-content" /> The recent community-wide vote on the [[m:Special:MyLanguage/Universal_Code_of_Conduct/Revised_enforcement_guidelines |Universal Code of Conduct revised Enforcement Guidelines]] has been tallied and scrutinized. Thank you to everyone who participated. After 3097 voters from 146 Wikimedia communities voted, the results are 76% in support of the Enforcement Guidelines, and 24% in opposition. [[m:Special:MyLanguage/Universal_Code_of_Conduct/Revised_enforcement_guidelines/Voting_statistics|Statistics]] for the vote are available. A more detailed summary of comments submitted during the vote will be published soon. From here, the results and comments collected during this vote will be submitted to the Board of Trustees for their review. The current expectation is that the Board of Trustees review process will complete in March 2023. We will update you when their review process is completed. On behalf of the UCoC Project Team, <section end="announcement-content" /> [[User:RamzyM (WMF)|RamzyM (WMF)]] 16:05, 14 February 2023 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Movement_Strategy_and_Governance/Delivery/Affiliates_-_RM&oldid=23733590 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 16:05, 14 February 2023 (UTC) == Report on voter comments from the revised UCoC Enforcement Guidelines ratification vote == <section begin="announcement-content" /> :''[[m:Universal Code of Conduct/Revised enforcement guidelines/Voting/Report/Email|You can find this message translated into additional languages on Meta-wiki.]]'' :''<div class="plainlinks">[[m:Universal Code of Conduct/Revised enforcement guidelines/Voting/Report/Email|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Universal Code of Conduct/Revised enforcement guidelines/Voting/Report/Email}}&language=&action=page&filter= {{int:please-translate}}]</div>'' Hello all, The Universal Code of Conduct project team has completed the analysis of the comments accompanying the ratification vote on the [[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines|revised Universal Code of Conduct Enforcement Guidelines]]. All respondents to the vote had the opportunity to provide comments regarding the contents of the revised Enforcement Guidelines draft document. A total of 369 participants left comments in 18 languages; compared to 657 commenters in 27 languages in 2022. The Trust and Safety Policy team completed an analysis of these results, categorizing comments to identify major themes and areas of focus within the comments. '''[[m:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines/Voter comments report|The report is available in translated versions on Meta-wiki here]]'''. Please help translate into your language. Again, we are thankful to all who participated in the vote and discussions. More information about the Universal Code of Conduct and its Enforcement Guidelines can be found on Meta-wiki. On behalf of the Universal Code of Conduct project team,<section end="announcement-content" /> [[User:RamzyM (WMF)|RamzyM (WMF)]] 14:45, 31 March 2023 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Movement_Strategy_and_Governance/Delivery/Affiliates_-_RM&oldid=23733590 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 14:45, 31 March 2023 (UTC) == Upcoming community review of the Movement Charter ratification methodology == <section begin="announcement-content" /> :''[[m:Movement Charter/Ratification/Pre-announcement|You can find this message translated into additional languages on Meta-wiki.]]'' Hello everyone, The [[m:Special:MyLanguage/Movement Charter/Drafting Committee|Movement Charter Drafting Committee]] (MCDC) will propose a ratification methodology for the future [[m:Special:MyLanguage/Movement Charter|Movement Charter]] on April 10, 2023. The proposed ratification methodology is a result of learnings from previous ratification processes. The MCDC will organize a consultation period with the Wikimedia Movement to hear feedback on the proposed ratification methodology from '''April 10 to 28, 2023'''. People will be invited to share their feedback on the questions mainly via the Meta Talk page discussion, on the Movement Strategy Forum, and during the community conversation hours. The MCDC welcomes your input on some open questions. '''Join the community conversation hours''' The MCDC invites everyone interested in sharing their feedback on the proposed methodology to join the community conversation hours: *[[m:Special:MyLanguage/Movement_Charter/Community_Consultation#Community_conversation_#1:_18_April,_2023_at_10.00_UTC|Community conversation hour #1]]: '''18 April at 10:00 UTC''' ([https://zonestamp.toolforge.org/1681812036 your local time]) *[[m:Special:MyLanguage/Movement_Charter/Community_Consultation#Community_conversation_#1:_18_April,_2023_at_10.00_UTC|Community conversation hour #2]]: '''24 April at 17:00 UTC''' ([https://zonestamp.toolforge.org/1682355603 your local time]) When signing up, please leave a comment if you need language support. Please note that language interpretation will be provided if at least 3 people expressed interest to participate in the following languages: Arabic, Mandarin Chinese, French, German, Indonesian, Japanese, Polish, Portuguese (Brazilian), Russian and Spanish. Thank you, On behalf of the Movement Charter Drafting Committee,<section end="announcement-content" /> [[User:RamzyM (WMF)|RamzyM (WMF)]] & [[m:User:VChang (WMF)|VChang (WMF)]] 15:41, 6 April 2023 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Movement_Strategy_and_Governance/Delivery/Affiliates_-_RM&oldid=23733590 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 15:41, 6 April 2023 (UTC) == Elections Committee: Call for New Members == <section begin="announcement-content" /> :''[[m:Special:MyLanguage/Wikimedia Foundation elections committee/Nominations/2023/Announcement|You can find this message translated into additional languages on Meta-wiki.]]'' :''<div class="plainlinks">[[m:Special:MyLanguage/Wikimedia Foundation elections committee/Nominations/2023/Announcement|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Wikimedia Foundation elections committee/Nominations/2023/Announcement}}&language=&action=page&filter= {{int:please-translate}}]</div>'' Hello everyone, The [[m:Special:MyLanguage/Wikimedia_Foundation_elections_committee|Wikimedia Foundation elections committee]] (Elections Committee) is, from today until April 24, seeking an additional 2–4 members to help facilitate the Wikimedia Foundation Board of Trustee (Board) selection process. The 2024 Wikimedia Foundation Board of Trustees election is being planned. New members are invited to join the Elections Committee. The Elections Committee oversees the Board of Trustees community seat selection process. Join the committee and contribute your valuable skills and ideas to the Trustee selection process. There are eight community- and affiliate-selected seats on [[m:Special:MyLanguage/Wikimedia_Foundation_Board_of_Trustees|the Wikimedia Foundation Board]]. The wider Wikimedia community votes for community members to occupy these seats. In 2024, the Elections Committee will oversee this selection process for the community- and affiliate-selected seats with expiring terms. This process will be supported by the Wikimedia Foundation. Elections Committee members sign up for three-year terms and will be asked to [[phab:L37|sign a confidentiality agreement]]. Members can expect to contribute 2–5 hours per week before the selection process and 5–8 hours per week during the selection process. As an Elections Committee member, you will be responsible for: *Attending online meetings between now and the next election (mid-2024) *Attending onboarding and online training in May–June 2023 *Working with the Committee to fulfill its [[foundation:Special:MyLanguage/Elections_Committee_Charter|other responsibilities]] New members should have the following qualities: *Fluency in English *Responsiveness to email collaboration *Knowledge of the movement and movement governance If you would like to volunteer for this role, please '''submit your candidacy by April 24, 2023 23:59 [[en:Anywhere on Earth|en:Anywhere on Earth]] on [[m:Special:MyLanguage/Wikimedia_Foundation_elections_committee/Nominations/2023|this Meta-Wiki page]]'''. You can [[m:Special:MyLanguage/Wikimedia_Foundation_Board_noticeboard/Wikimedia_Foundation_Elections_Committee_-_2023_Call_for_New_Members|'''read the full announcement here''']]. Thank you in advance for your interest! If you are not interested but know someone who might be, share this message with them. Please let me know if you have questions. On behalf of the Elections Committee,<br /><section end="announcement-content" /> [[User:RamzyM (WMF)|RamzyM (WMF)]] & [[m:User:VChang (WMF)|VChang (WMF)]] 15:40, 12 April 2023 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Movement_Strategy_and_Governance/Delivery/Affiliates_-_RM&oldid=23733590 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 15:40, 12 April 2023 (UTC) == Invitation to join the Wikimedia Affiliate strategy discussions == Hope this message finds you well. I am sharing an update about the Wikimedia Foundation Affiliate strategy initiative. In November, [https://lists.wikimedia.org/hyperkitty/list/wikimedia-l@lists.wikimedia.org/thread/SRHX3KLSYAEDCM4T35RSNNRWWLYVNCQB/#GPAAZGQB42YJJ6JDW4WJYLBWBLFZC7A7 Nataliia Tymkiv, Chair, Wikimedia Foundation Board of Trustees announced the beginning of Wikimedia Foundation Affiliate strategy]. We are working on the next steps of the Affiliate strategy. We invite you to a session with the Board of Trustees, AffCom, and supporting staff to provide input into this process. These sessions will be conducted in groups and the language will be English. If you are able to attend one of these meetings, please sign up [[Wikimedia_Foundation_Affiliates_Strategy#Live_sessions|here]]. If you prefer a 1:1 session for a detailed discussion, please reach out to me. If you are unable to attend the meeting, please respond via [https://docs.google.com/forms/d/e/1FAIpQLScyRTQSIMYj9ymX4S-pbjtpZSqnQ8Icr-P3quvlAeh6sAk0aw/viewform?usp=sf_link the survey] or in writing to askcac@wikimedia.org or on the [[Talk:Wikimedia_Foundation_Affiliates_Strategy|Talk page]]. This message was also sent by email to affiliate primary contacts. Best, [[User:MKaur (WMF)|MKaur (WMF)]] 22:30, 22 May 2023 (UTC) <!-- Message sent by User:Xeno (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=24808948 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 22:30, 22 May 2023 (UTC) == WikiWomenCamp 2023 Scholarship Application == Hello all, We are thrilled to announce the opening of the scholarship applications for [[metawiki:WikiWomenCamp 2023|Wiki Women Camp 2023]] which will run from '''20-23 October''' in New Delhi, India. '''The scholarship application deadline is July 4th, end of the day (anywhere in the world), and applicants will receive notification of decisions in mid-July.''' Please submit your application directly through the provided forms available [https://docs.google.com/forms/d/e/1FAIpQLSeREOTwKknhAxM18suApzc9XLYD6E4ixCKJ0N1ebvOy0SEw8g/viewform here]. If you have any questions or require further information, please do not hesitate to reach out to us at admin@wikiwomencamp.org. Cheers, [[User:Maffeth.opiana|Maffeth.opiana]] ([[User talk:Maffeth.opiana|talk]]) 11:25, 23 June 2023 (UTC) On behalf of the WikiWomenCamp 2023 Team <!-- Message sent by User:Tulsi@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/WikiWomenCamp_2023&oldid=25195132 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 11:25, 23 June 2023 (UTC) == Call for Affiliates & Call for Trainers WikiWomenCamp 2023 == Dear all, The WikiWomenCamp 2023 team is excited to announce that the calls for Affiliates and Trainers are open now! ; Self-funded affiliates attendance If your affiliate is interested, kindly fill out the registration form by 8 August 2023, anywhere on earth. Please note that self-funded attendance means participants will be responsible for their travel, accommodation, visa (if required), and related expenses. We have 10 seats reserved for affiliates. Here is the form link: [https://docs.google.com/forms/d/e/1FAIpQLSdGxUpf1njEw3vmTNUsuN5TChj3qVIhVOBc3LpBvsdUoN_-jw/viewform Google Forms] ; Trainers The call for trainers to facilitate gender-focused sessions at WikiWomenCamp 2023 is open. To propose your session(s), please submit the application form by 8th August 2023. More details about the call for trainers (benefits for trainers and key dates) are here: [[metawiki:WWC2023/Program|m:WWC2023/Program]] To read more about the camp, please visit: [[metawiki:WikiWomenCamp 2023|m:WikiWomenCamp 2023]] Cheers, [[User:Maffeth.opiana|Maffeth.opiana]] ([[User talk:Maffeth.opiana|talk]]) 03:37, 29 July 2023 (UTC) On behalf of the WWC23 team <!-- Message sent by User:Tulsi@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/WikiWomenCamp_2023&oldid=25195132 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 03:37, 29 July 2023 (UTC) == Call for Highlight Videos for WikiWomenCamp 2023 == Dear Community Members, As we gear up for the upcoming [[WikiWomenCamp 2023|WikiWomenCamp]] in India, we are excited to announce a unique opportunity to share your incredible work and its impact with the global community. '''What We're Looking For:''' We invite you to submit short (3-5 minute) videos highlighting your projects, initiatives, or efforts that have made a '''''significant difference in addressing gender gaps.''''' We know that many of you are doing remarkable work in various corners of the world, and we want to shine a spotlight on your achievements. '''Why Short Videos:''' Our camp sessions are extensive, covering a wide range of topics and discussions. In the interest of time and with a commitment to showcasing the amazing initiatives across our movement, we believe that short videos are an effective way to capture and share the essence of your work. '''How Your Videos Will Be Used:''' The selected videos will be featured on our social media channels and played during breaks at the camp. This provides an excellent opportunity for you to showcase your work to a broader audience and inspire others to get involved or collaborate with you. '''Submission Guidelines:''' # Videos should be 3-5 minutes in length. # Please focus on the impact of your work, highlighting how it contributes to '''''addressing gender gap.''''' # Be creative and engage in your presentation. # Ensure video quality is clear and audible. # Narration (optional): If possible, include a brief voiceover or text captions to provide context and explanation. # Language: While English is preferred for wider accessibility, videos in other languages are also welcome. Kindly ensure that non-English videos are accompanied by English subtitles or captions. '''Submission Deadline:''' To be considered for inclusion in our camp programming, please submit your videos by '''Thursday, 28th September 2023.''' Late submissions may still be featured later on our social media channels. '''How to Submit:''' To avoid any issues with file sizes, we recommend using a file transfer service like WeTransfer or Google Drive while sharing your videos with us at <u>admin@wikiwomencamp.org.</u> In your email, include a brief description of your project, affiliate name / your name or username, and contact information. We believe that your stories and experiences are powerful tools for change. By sharing them with our community, you contribute to a collective effort to bridge the gender gap and empower women and girls worldwide. Thank you for being a part of the camp initiatives, and we look forward to receiving your inspiring videos. Warm regards, WikiWomenCamp 2023 COT [[User:Maffeth.opiana|Maffeth.opiana]] ([[User talk:Maffeth.opiana|talk]]) 09:57, 21 September 2023 (UTC) == Introducing the Wikimedia photo library and a workshop invite == Dear Wikimedia affiliates communications leads, We are so excited to share a new resource with you: [[Brand/imagery#Open Wikimedia Photo Collection|The Wikimedia Photo Library]]. In it you will find high quality images that help to tell the story of free knowledge. We hope that this library will help you in the important work you do as a communication lead. Alongside this library, we’ve also [[Brand/imagery|updated guidelines]] on how to effectively use imagery to tell brand stories. '''Curious to learn more about these resources?''' We will be holding a short workshop for 45 minutes on Tuesday 3 October 2023, at 16:00 UTC ([https://calendar.google.com/calendar/event?action=TEMPLATE&tmeid=NnNzdWVzaGRtMTBhZmYzZWtvOHBkZXRjZ2ogc2Vsc2hhcmJhdHlAd2lraW1lZGlhLm9yZw&tmsrc=selsharbaty%40wikimedia.org add event to your calendar]) and again on Thursday 5 October at 7:00 UTC ([https://calendar.google.com/calendar/event?action=TEMPLATE&tmeid=NTk1cDc3bHNsZjM0MTI5NG84c290MnI4M2ogc2Vsc2hhcmJhdHlAd2lraW1lZGlhLm9yZw&tmsrc=selsharbaty%40wikimedia.org add event to your calendar]) to accommodate different time zones. During these workshops, we will walk you through some examples of images that align with the Movement Brand Guidelines, some basics of quality photography and answer any questions you may have about this topic. '''The need for a Wikimedia Photo Library''' Our research showed that there are lots of photos available from Wikimedia events, usually featuring people using computers. There were very few images showing mobile editing or reading, and even fewer showing people using the projects in their everyday lives. These images are the first steps in creating a photo library that is representative of the whole movement. We have added images that are aligned with the Movement Brand Guidelines in [[commons:Category:Photos_aligned_with_Wikimedia_brand_guidelines|this category on Wikimedia Commons]]. Photography is a powerful tool to create cohesion in Wikimedia communication. Our hope is that all of you will help to build this resource out with images from your region. By continuing to add to this category, we will be helping one another tell more impactful stories of the free knowledge movement – learn how on the [[Brand/imagery|Brand portal on Meta-wiki]]. Thank you so much and please let me know if you have any questions. We hope to see you at one of the workshops! Best, Samir and the Brand Studio team -- <!-- Message sent by User:Selsharbaty (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=25568414 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 16:54, 23 September 2023 (UTC) == Introducing the Wikimedia photo library and a workshop invite == Dear Wikimedia affiliates communications leads, We are so excited to share a new resource with you: [[Brand/imagery#Open Wikimedia Photo Collection|The Wikimedia Photo Library]]. In it you will find high quality images that help to tell the story of free knowledge. We hope that this library will help you in the important work you do as a communication lead. Alongside this library, we’ve also [[Brand/imagery|updated guidelines]] on how to effectively use imagery to tell brand stories. '''Curious to learn more about these resources?''' We will be holding a short workshop for 45 minutes on Tuesday 3 October 2023, at 16:00 UTC ([https://calendar.google.com/calendar/event?action=TEMPLATE&tmeid=NnNzdWVzaGRtMTBhZmYzZWtvOHBkZXRjZ2ogc2Vsc2hhcmJhdHlAd2lraW1lZGlhLm9yZw&tmsrc=selsharbaty%40wikimedia.org add event to your calendar]) and again on Thursday 5 October at 7:00 UTC ([https://calendar.google.com/calendar/event?action=TEMPLATE&tmeid=NTk1cDc3bHNsZjM0MTI5NG84c290MnI4M2ogc2Vsc2hhcmJhdHlAd2lraW1lZGlhLm9yZw&tmsrc=selsharbaty%40wikimedia.org add event to your calendar]) to accommodate different time zones. During these workshops, we will walk you through some examples of images that align with the Movement Brand Guidelines, some basics of quality photography and answer any questions you may have about this topic. '''The need for a Wikimedia Photo Library''' Our research showed that there are lots of photos available from Wikimedia events, usually featuring people using computers. There were very few images showing mobile editing or reading, and even fewer showing people using the projects in their everyday lives. These images are the first steps in creating a photo library that is representative of the whole movement. We have added images that are aligned with the Movement Brand Guidelines in [[commons:Category:Photos_aligned_with_Wikimedia_brand_guidelines|this category on Wikimedia Commons]]. Photography is a powerful tool to create cohesion in Wikimedia communication. Our hope is that all of you will help to build this resource out with images from your region. By continuing to add to this category, we will be helping one another tell more impactful stories of the free knowledge movement – learn how on the [[Brand/imagery|Brand portal on Meta-wiki]]. Thank you so much and please let me know if you have any questions. We hope to see you at one of the workshops! Best, Samir and the Brand Studio team -- <!-- Message sent by User:Selsharbaty (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=25568414 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 18:01, 23 September 2023 (UTC) == Follow up on the last message about the photography workshop == Hi everyone, This is a reminder about our photography sessions happening this week. Also, some people reached out with concerns about not being able to open the links to meetings in the previous message. Please find a direct link to the Google Meet sessions here: * [https://meet.google.com/mfz-mfdk-zri Tuesday session link] - [https://tel.meet/mfz-mfdk-zri?pin=4898872382244 Dial phone numbers] * [https://meet.google.com/yvu-evtb-qss Thursday session link] - [https://tel.meet/yvu-evtb-qss?pin=2734647398094 Dial phone numbers] Thank you and please let me know if you have any questions. If you have any questions please reach out to {{nospam|selsharbaty|wikimedia.org}} . -- <!-- Message sent by User:Selsharbaty (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=25568414 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 08:21, 2 October 2023 (UTC) == Opportunities open for the Affiliations Committee, Ombuds commission, and the Case Review Committee == <div style="margin:.2em 0 .5em;margin-{{#switch:{{PAGELANGUAGE}}|ar|arc|ary|arz|azb|bcc|bgn|ckb|bqi|dv|fa|fa-af|glk|ha-arab|he|kk-arab|kk-cn|ks|ku-arab|ms-arab|mzn|pnb|prd|ps|sd|ug|ur|ydd|yi=right|left}}:3ex;"> [[metawiki:Special:MyLanguage/Wikimedia Foundation Legal department/Committee appointments/Announcement/Short|''You can find this message translated into additional languages on Meta-wiki.'']] ''<span class="plainlinks">[[metawiki:Special:MyLanguage/Wikimedia Foundation Legal department/Committee appointments/Announcement/Short|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Wikimedia Foundation Legal department/Committee appointments/Announcement/Short}}&language=&action=page&filter= {{int:please-translate}}]</span>''</div> Hi everyone! The [[metawiki:Special:MyLanguage/Affiliations Committee|Affiliations Committee]] (AffCom), [[metawiki:Special:MyLanguage/Ombuds_commission|Ombuds commission]] (OC), and the [[metawiki:Special:MyLanguage/Trust_and_Safety/Case_Review_Committee|Case Review Committee]] (CRC) are looking for new members. These volunteer groups provide important structural and oversight support for the community and movement. People are encouraged to nominate themselves or encourage others they feel would contribute to these groups to apply. There is more information about the roles of the groups, the skills needed, and the opportunity to apply on the [[metawiki:Special:MyLanguage/Wikimedia Foundation Legal department/Committee appointments|'''Meta-wiki page''']]. If you are aware of participants in your affiliate who may be interested in these roles, please share this message with them. On behalf of the Committee Support team, [[metawiki:User:Keegan (WMF)|Keegan (WMF)]] ([[metawiki:User talk:Keegan (WMF)|talk]]) 20:23, 18 October 2023 (UTC) <!-- Message sent by User:Keegan (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=25741879 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 20:23, 18 October 2023 (UTC) == Wikimedia Foundation Affiliates Strategy: Summary and Report == Dear Wikimedia affiliate, Last year, the Wikimedia Foundation Board announced they started the process with creating an Affiliates Strategy in collaboration with the Affiliations Committee, the affiliates, and the broader communities with the intention to develop a strategy that will help guide the Foundation’s immediate work in supporting affiliates for the next few years, with a primary focus on the recognition process, as a direct responsibility of the Board. Over several months, the Wikimedia Foundation Board engaged with an outside consultant to drive a review process of what work the Foundation was doing to support affiliates. The end goal was to have several recommended actions. You can read more about the findings and the recommendations on [[metawiki:Wikimedia_Foundation_Affiliates_Strategy/Report|this Meta-Wiki page]]. Best, [[User:MPossoupe (WMF)|MPossoupe_(WMF)]]21:29, 23 October 2023 (UTC) <!-- Message sent by User:MPossoupe (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:MPossoupe_(WMF)/delivery&oldid=25781969 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 21:29, 23 October 2023 (UTC) == Feedback invited on proposed requirements for affiliates & user groups recognition changes == <section begin="announcement-content" /> : ''[[metawiki:Special:MyLanguage/Wikimedia Foundation Board noticeboard/Wikimedia Foundation Affiliates Strategy: proposed requirements for affiliates & user groups recognition changes -- MassMessage|You can find this message translated into additional languages on Meta-wiki.]] [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-Wikimedia+Foundation+Board+noticeboard%2FWikimedia+Foundation+Affiliates+Strategy%3A+proposed+requirements+for+affiliates+%26+user+groups+recognition+changes+--+MassMessage&language=&action=page&filter= {{int:please-translate}}]'' Dear Wikimedia Affiliates, Following up on the development of Wikimedia Foundation Affiliates Strategy, we would like to invite you to give feedback on requirements for affiliates & user groups recognition changes. You can find the details of the proposed changes in [[metawiki:Special:MyLanguage/Wikimedia Foundation Board noticeboard/Wikimedia Foundation Affiliates Strategy: proposed requirements for affiliates & user groups recognition changes|this message from Wikimedia Foundation Board of Trustees liaisons to the Affiliations Committee]], as well as the ways to give your feedback. We have also reached out to your contact persons via the emails provided. Best regards,<section end="announcement-content" /> [[User:Xeno (WMF)|Xeno (WMF)]] ([[User talk:Xeno (WMF)|talk]]) 14:40, 9 February 2024 (UTC) <!-- Message sent by User:Xeno (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=25825395 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 14:40, 9 February 2024 (UTC) == Introducing Let's Connect! to MediaWiki Stakeholders' Group == Dear MediaWiki Stakeholders' Group, We hope this message finds you well and that you are in good spirits. We are the [[metawiki:Grants:Knowledge_Sharing/Connect/Team|Let’s Connect working group]] - a team of movement contributors/organizers who are liaison representatives of [[metawiki:Wikimedia_regions|7/8 regions]]. We are connecting with you to see if Wikimedia LGBT+ is interested in and/or know about the peer-to-peer program, [[metawiki:Grants:Knowledge_Sharing/Connect|Let’s Connect!]] The program creates an open and safe learning space for any Wikimedian who is part of an organized group to share and learn different skills (organizational/interpersonal / grant related / learning & evaluation ...) with other peers to add value and contribute collectively to the community. The purpose is to further develop skills, share knowledge and promote human connections and mutual support between different groups and communities, in alignment with the [[metawiki:Movement_Strategy|Movement Strategy]]. Every month, we host 2-3 live 2-hour [[metawiki:Grants:Knowledge_Sharing/Connect#Live_learning_clinics_with_“hot_topic_of_the_month”_and_around_proposal_and_reporting_cycles|learning clinics]] with interesting topics selected by our team and our interested sharers. Our live learning sessions have up to 4 interpreters translating the clinic for our participants. Our main languages are Spanish | Arabic | French | Portuguese. If there is a specific language you would like to see in the calls, we are happy to see how we can accommodate it. Let’s Connect is directed at Wikimedians in all regions that are part of organized groups (this can range from a group of individuals that are not formally organized user groups, chapters and mission-aligned organizations). [[metawiki:Grants:Knowledge_Sharing/Connect#Who_is_Let’s_Connect_for?|Please see our Meta page for more criteria]]. To participate as a sharer, you can register in this initial [https://docs.google.com/forms/d/e/1FAIpQLSdiea87tSYmB2-1XHn_u8RLe7efMJifJBzffIM-6rtpx0PWqw/viewform registration form] where you can register your learning and sharing interests and state if you want to share your knowledge through Learning Clinics. Below, you will find our team of 8 who are excited to meet with you if you are interested. Please email our team at letsconnect@wikimedia.org if you have any questions :) We look forward to hearing from you. Best, Bukola James The Let’s Connect Working Group [[User:Bukky658|Bukky658]] ([[User talk:Bukky658|talk]]) 06:40, 20 March 2024 (UTC) == The full draft of the Wikimedia Movement Charter will soon be shared == <section begin="announcement-content" /> : ''[[metawiki:Special:MyLanguage/Movement Charter Drafting Committee/Announcement - Short notice on key projects 2024-03-25|You can find this message translated into additional languages on Meta-wiki.]] [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Movement Charter Drafting Committee/Announcement - Short notice on key projects 2024-03-25}}&language=&action=page&filter= {{int:please-translate}}]'' Hi there, The Movement Charter Drafting Committee is happy to announce that the full draft of the Movement Charter will be published on April 2nd, 2024. This will kick off the '''community engagement period from April 2nd to April 22nd'''. The [[metawiki:Special:MyLanguage/Movement Charter|'''Movement Charter''']] is a proposed document to define roles and responsibilities for all the members and entities of the Wikimedia Movement, including to lay out a new Global Council for movement governance. Everyone in the Wikimedia Movement is invited to share opinions on the full version of the Charter draft – this is the last chance to offer feedback before the Charter draft is updated for the ratification vote in June 2024. '''How to share your feedback?''' * share your message or question on the [[metawiki:Special:MyLanguage/Talk:Movement Charter|'''Movement Charter Talk page''']]; * attend a [[metawiki:Special:MyLanguage/Movement Charter/Community Consultation#Upcoming_drop-in_session|'''community drop-in session''']] on '''April 4th''' at [https://zonestamp.toolforge.org/1712242800 15.00-17.00 UTC]; * or email [mailto:movementcharter@wikimedia.org '''movementcharter@wikimedia.org''']. [[metawiki:Special:MyLanguage/Movement Charter/Drafting Committee/Updates|Read the Committee's latest updates]] for more information. On behalf of the MCDC,<section end="announcement-content" /> [[metawiki:User:RamzyM (WMF)|RamzyM (WMF)]] 13:58, 28 March 2024 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=26436588 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 13:58, 28 March 2024 (UTC) == The full Movement Charter draft awaits your review on Meta == <section begin="announcement-content" /> : ''[[metawiki:Special:MyLanguage/Movement Charter/Drafting Committee/Announcement - Start of community engagement period 2024-04-02|You can find this message translated into additional languages on Meta-wiki.]] [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Movement Charter/Drafting Committee/Announcement - Start of community engagement period 2024-04-02}}&language=&action=page&filter= {{int:please-translate}}]'' Hi everyone, The full draft of the [[metawiki:Special:MyLanguage/Movement Charter|Movement Charter]] has been published on Meta for your review. '''Why should you care?''' The Charter is important as it will be an essential document for the implementation of the 2030 strategy recommendations. Participating in the Charter discussions means that you ensure that your voice is heard and your interests are represented in shaping the future of the Movement. '''Community Engagement – April 2nd to April 30th, 2024''' The Movement Charter Drafting Committee (MCDC) cordially invites everyone in the Wikimedia movement to share feedback on the full draft of the Movement Charter. Let your voice be heard by sharing your feedback it in any language on the [[metawiki:Special:MyLanguage/Talk:Movement Charter|Movement Charter talk pages]], attend a [[metawiki:Special:MyLanguage/Movement Charter/Community Consultation#Upcoming_drop-in_session|community drop-in session]], or email [mailto:movementcharter@wikimedia.org movementcharter@wikimedia.org]. Please read the [[metawiki:Special:MyLanguage/Movement Charter/Drafting Committee/Updates|Committee's latest updates]] for more information. Thank you. On behalf of the MCDC,<section end="announcement-content" /> [[metawiki:User:RamzyM (WMF)|RamzyM (WMF)]] 13:07, 3 April 2024 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=26436588 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 13:07, 3 April 2024 (UTC) == Affiliations Committee News (January-March 2024) == <section begin="announcement-content" /> [[File:Group_photo_-_Edu_Wiki_conference_2023,_Belgrade,_Serbia.jpg|right|thumb|256x256px|Group photo of the 2023 EduWiki Conference in Belgrade, organized by Wikipedia & Education User Group]] <small>''[[metawiki:Special:MyLanguage/Affiliations Committee/News/Issue 1|You can find this newsletter translated into additional languages on Meta-wiki]]. [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Affiliations Committee/News/Issue 1}}&language=&action=page&filter= {{int:please-translate}}]''</small> Quarterly newsletter sharing news and events about the work of Wikimedia's [[metawiki:Special:MyLanguage/Affiliations_Committee|Affiliations Committee]]. <div style="column-count:1;"> '''Affiliate Recognition and Derecognition''': [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_1#Affiliate_Recognition_and_Derecognition|Recognition of Cyprus, Botswana, Niger, and Telugu user groups]] '''Affiliate Activities Report''': [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_1#Affiliate_Activities_Report|Reports from Belgium, South African, and Ukrainian chapters]] '''AffCom Movement Contribution''': [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_1#AffCom_Movement_Contribution|AffCom engagement with the new Affiliates Strategy and Movement Charter drafts]] '''AffCom Administration''': [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_1#AffCom_Administration|New AffCom members and advisors]] </div> <div class="hlist" style="margin-top:10px; font-size:100%; ">'''[[metawiki:Special:MyLanguage/Affiliations Committee/News/Issue 1|read this newsletter in full]]''' • [[metawiki:Special:MyLanguage/Global message delivery/Targets/Affiliations Committee/News|subscribe/unsubscribe]]<section end="announcement-content" /></div> <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=26436588 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 12:55, 18 April 2024 (UTC) == Board of Trustees selection call for candidates == Hello all, The call for candidates for the 2024 Wikimedia Foundation Board of Trustees selection is now open from May 8, 2024 - May 29, 2024 at 23:59 UTC. The Board of Trustees oversees the Wikimedia Foundation's work, and each Trustee serves a [[foundation:Legal:Bylaws#(B)_Term|three-year term]]. This is a volunteer position. This year, the Wikimedia community will vote to fill four (4) seats on the Foundation Board in August 2024. You can see the timeline of the full selection process [[Wikimedia Foundation elections/2024#Timeline|here]]. '''Traits''' Wikimedia is a global movement and seeks candidates from the broader community. Ideal candidates are thoughtful, respectful, community-oriented and align with the Wikimedia Foundation mission. Candidates should think about what experiences and perspectives they will bring to the Board. The Board would like to find perspectives and voices that are essential but underrepresented in our movement. Accordingly, all candidates will be asked to include statements in their application that speak to their experiences in the world and in the movement and share how those experiences have equipped them to promote diversity, equity, and inclusion. '''Trustees commitment''' Trustees [[foundation:Bylaws#(B)_Term.|serve a three year term and can serve up to three consecutive terms]]. The expectation is that Trustees serve on at least [[Special:MyLanguage/Wikimedia committees#Board committees|one of the Board’s committees]]. The time commitment is about 150 hours per year, excluding travel. This time is not evenly spread throughout the year. The time is concentrated around meetings. '''Trustees requirements''' English is the language of business for the Board. Candidates must be fluent in written and spoken English. Previous experience serving on a collective decision-making body, especially Boards or committees, and significant experience in Wikimedia (or equivalent) movement building and organizing are expected from candidates. '''Apply''' Candidates from all projects and communities who meet the criteria to become a Wikimedia Trustee are welcome to apply. Could you - or someone you know - be a good fit to join the Wikimedia Foundation's Board of Trustees? Encourage them to run for election. Candidates can find information and submit their nomination on the [[Wikimedia Foundation elections/2024/Candidate application|candidate application]] page. If you want to learn more about the role of Trustees or have questions, refer to this [[Wikimedia Foundation elections/2024/Resources for candidates|candidate resources page]]. '''Community questions for candidates''' All community members, including affiliates, are invited to submit questions for the Board of Trustees candidates to answer. From the list of questions, the Election Committee selects 5 questions for candidates to answer, which the candidates are expected to answer. The selected questions may be a combination of what’s been submitted from the community, if they’re alike or related. Questions can be submitted between May 8 - June 12 at 23:59 UTC. Learn more about how to submit your questions on this [[Wikimedia Foundation elections/2024/Questions for candidates|Meta-wiki page]]. Best regards, The [[Wikimedia Foundation elections committee|Elections Committee]] and Board Selection Working Group [[User:MPossoupe (WMF)|MPossoupe_(WMF)]] 18:33, 8 May 2024 (UTC) <!-- Message sent by User:MPossoupe (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=26436588 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 18:33, 8 May 2024 (UTC) == Feedback invited on Procedure for Sibling Project Lifecycle == <section begin="announcement-content" /> : ''[[metawiki:Special:MyLanguage/Wikimedia Foundation Community Affairs Committee/Procedure for Sibling Project Lifecycle/Invitation for feedback (MM-Affiliates)|You can find this message translated into additional languages on Meta-wiki.]] [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Wikimedia Foundation Community Affairs Committee/Procedure for Sibling Project Lifecycle/Invitation for feedback (MM-Affiliates)}}&language=&action=page&filter= {{int:please-translate}}]'' [[File:Sibling_Project_Lifecycle_Conversation_2.png|link=m:Special:MyLanguage/Wikimedia_Foundation_Community_Affairs_Committee/Procedure_for_Sibling_Project_Lifecycle|right|150x150px]] Dear Wikimedia Affiliates, The [[metawiki:Special:MyLanguage/Wikimedia Foundation Community Affairs Committee|Community Affairs Committee]] (CAC) of the [[metawiki:Special:MyLanguage/Wikimedia Foundation Board of Trustees|Wikimedia Foundation Board of Trustees]] invites you to give feedback on a '''[[metawiki:Special:MyLanguage/Wikimedia Foundation Community Affairs Committee/Procedure for Sibling Project Lifecycle|draft Procedure for Sibling Project Lifecycle]]'''. Affiliates play important roles in the Movement, working with communities and external partners, and thus they bring valuable perspectives to the table. We warmly welcome you to the conversations. In addition, please share information about this with your affiliate membership, and any project communities your affiliate works with or supports. You can also help translate the procedure into more languages so that people can join the discussions in their language. This draft Procedure outlines proposed steps and requirements for opening and closing Wikimedia Sibling Projects. It aims to ensure any newly approved projects are set up for success. This is separate from the procedures for opening or closing language versions of projects, which is handled by the [[metawiki:Special:MyLanguage/Language committee|Language Committee]]. It is also separate from the [[metawiki:Special:MyLanguage/Closing_projects_policy|closing projects policy]]. You can find the details of the proposal on [[metawiki:Special:MyLanguage/Talk:Wikimedia Foundation Community Affairs Committee/Procedure for Sibling Project Lifecycle#Review|this page]], as well as the ways to give your feedback from today until the end of the day on '''June 23, 2024''', anywhere on Earth. We have also reached out to your contact persons via the emails provided. On behalf of the CAC,<section end="announcement-content" /> [[metawiki:User:RamzyM (WMF)|RamzyM (WMF)]] 16:08, 21 May 2024 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=26436588 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 16:08, 21 May 2024 (UTC) == The final text of the Wikimedia Movement Charter is now on Meta == <section begin="announcement-content" /> : ''[[metawiki:Special:MyLanguage/Movement Charter/Drafting Committee/Announcement - Final draft available|You can find this message translated into additional languages on Meta-wiki.]] [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Movement Charter/Drafting Committee/Announcement - Final draft available}}&language=&action=page&filter= {{int:please-translate}}]'' Hi everyone, The final text of the [[metawiki:Special:MyLanguage/Movement Charter|Wikimedia Movement Charter]] is now up on Meta in more than 20 languages for your reading. '''What is the Wikimedia Movement Charter?''' The Wikimedia Movement Charter is a proposed document to define roles and responsibilities for all the members and entities of the Wikimedia movement, including the creation of a new body – the Global Council – for movement governance. '''Join the Wikimedia Movement Charter “Launch Party”''' Join the [[metawiki:Special:MyLanguage/Event:Movement Charter Launch Party|“Launch Party”]] on '''June 20, 2024''' at '''14.00-15.00 UTC''' ([https://zonestamp.toolforge.org/1718892000 your local time]). During this call, we will celebrate the release of the final Charter and present the content of the Charter. Join and learn about the Charter before casting your vote. '''Movement Charter ratification vote''' Voting will commence on SecurePoll on '''June 25, 2024''' at '''00:01 UTC''' and will conclude on '''July 9, 2024''' at '''23:59 UTC.''' You can read more about the [[metawiki:Special:MyLanguage/Movement Charter/Ratification/Voting|voting process, eligibility criteria, and other details]] on Meta. If you have any questions, please leave a comment on the [[metawiki:Special:MyLanguage/Talk:Movement Charter|Meta talk page]] or email the MCDC at [mailto:mcdc@wikimedia.org mcdc@wikimedia.org]. On behalf of the MCDC,<section end="announcement-content" /> [[metawiki:User:RamzyM (WMF)|RamzyM (WMF)]] 08:43, 11 June 2024 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=26840648 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 08:43, 11 June 2024 (UTC) == Wikimedia Foundation Affiliates Strategy: Affiliate health criteria and changes to User Group recognition process == <section begin="announcement-content" /> : ''This communication has been adapted from the [[metawiki:Wikimedia Foundation Affiliates Strategy/Affiliate health criteria and changes to User Group recognition process|original message]].'' : ''<div class="plainlinks">[[metawiki:Special:MyLanguage/Wikimedia Foundation Affiliates Strategy/Implementation/Announcement|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Wikimedia Foundation Affiliates Strategy/Implementation/Announcement}}&language=&action=page&filter= {{int:please-translate}}]</div>'' Dear all, We would like to thank all of you who shared feedback with us during this phase of the [[Wikimedia Foundation Affiliates Strategy]] process that started in November 2022, both on- and off-wiki. [[Wikimedia Foundation Affiliates Strategy/Report|You can read the report from the first phase here]]. Since that point, AffCom has been working with the Board of Trustees, Foundation staff, affiliates, and wider community members to enable them to provide appropriate guidance to affiliates regarding what it means to be an active and healthy Wikimedia organisation. As a result of those conversations, the committee has [[Affiliations Committee/Resolutions/2024/Adopting Affiliate Health Criteria|voted]] to adopt the following 10 criteria for affiliates, grouped into four main areas: * '''Goal delivery''' * '''Organisational Development''' ** Good governance & communication ** Financial & legal compliance ** Affiliate health & resilience * '''Leadership & Inclusion''' ** Diverse, skilled, and accountable leadership ** Diversity balance (especially gender) ** Universal Code of Conduct compliance) * '''Engagement & Collaboration''' ** Internal (membership) engagement ** Community connection ** Partnerships & collaboration You are encouraged to read '''[[metawiki:Wikimedia_Foundation_Affiliates_Strategy/Implementation/Example|more details about each of these criteria here]]''', including guidance on how each can be met. All criteria will be tracked for all affiliates, except for the criteria around financial and legal compliance, which only apply to those affiliates receiving funds and/or that are incorporated. Staff and AffCom are working on streamlining affiliate reporting requirements, and responding to feedback raised during the community feedback period about the reporting burden. The new requirements of data collected in reports would be useful also for different Foundation teams and departments, and allow for the creation of detailed regional or global reports that demonstrate affiliate health and impact. In July 2024, AffCom will work to finalise the implementation plans for the changes to the affiliate requirements and application process. In August 2024, updates will be made to Meta-wiki and other supporting platforms. '''[[metawiki:Wikimedia_Foundation_Affiliates_Strategy/Implementation|You can follow the process here]].''' The insights from the 2023 process also included recognising a need to strengthen AffCom processes for evaluating potential User Groups’ furtherance of shared movement goals, sustainability, and general ability to be healthy and active movement participants. AffCom has [[metawiki:Special:MyLanguage/Affiliations_Committee/Resolutions/2024/Approving_Updated_User_Group_Recognition_Process|adopted]] a revised process for User Group recognition, and will be pausing new User Group recognitions until September 2024. '''No immediate changes are happening''', except the pause of considering new User Group recognitions until September, for applications received after today, June 12, 2024. Once more detailed implementation plans are developed, there will be an update [[metawiki:Special:MyLanguage/Wikimedia Foundation Affiliates Strategy/Implementation|here]] and on the relevant Meta pages with the next steps after Wikimania. To provide your feedback, please [[Talk:Wikimedia Foundation Affiliates Strategy|leave a comment on the main talk page on Meta]]. Alternatively, you can join [[metawiki:Wikimedia Foundation Affiliates Strategy/Implementation|AffCom's open office hours]] on June 19 at 14:00 UTC or request a conversation as a part of [[metawiki:Special:MyLanguages/Wikimedia Foundation Community Affairs Committee/Talking: 2024|Talking:2024]]. You can use the [[metawiki:Special:MyLanguage/Wikimedia_Foundation_Community_Affairs_Committee/Talking:_2024#Let's_talk|Let’s Talk]] to sign up for a time to speak with us. Looking forward to your feedback! Best regards, Nat, Mike & Lorenzo Wikimedia Foundation Board of Trustees Liaisons to the Affiliations Committee<section end="announcement-content" /> <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=26840648 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 03:32, 13 June 2024 (UTC) == Affiliations Committee News (April-June 2024) == <section begin="announcement-content" /> [[File:Wikimedia-Summit-2024-Friday-128.jpg|right|thumb|256x256px|AffCom group photo at Wikimedia Summit 2024 in Berlin, Germany]] <small>''[[metawiki:Special:MyLanguage/Affiliations Committee/News/Issue 2|You can find this newsletter translated into additional languages on Meta-wiki]]. [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Affiliations Committee/News/Issue 2}}&language=&action=page&filter= {{int:please-translate}}]''</small> Quarterly newsletter sharing news and events about the work of Wikimedia's [[metawiki:Special:MyLanguage/Affiliations_Committee|Affiliations Committee]]. <div style="column-count:1;">Affiliates Strategy Updates: [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_2#Affiliate_Strategy_Updates|Adoption of a new affiliate health criteria and changes to User Groups recognition process]] Affiliate Recognition and Derecognition: [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_2#Affiliate_Recognition_and_Derecognition|Recognition of Madagascar, Senegal, Republic of Congo, and Namibia user groups]] Affiliate Activities and Compliance Report: [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_2#Affiliate_Activities_and_Compliance_Report|Activities reports around the world]] AffCom Conflict Intervention: [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_2#AffCom_Conflict_Intervention|Six active conflicts, no new reports for Q4]] AffCom Movement Contribution: [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_2#AffCom_Movement_Contribution|AffCom engagement at Wikimedia Summit and ESEAP Conference]] AffCom Administration: [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_2#AffCom_Administration|Officers elections and departing members]] Upcoming AffCom Events: [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_2#Upcoming_AffCom_Events|AffCom at Wikimania 2024]] </div> <div class="hlist" style="margin-top:10px; font-size:100%; ">'''[[metawiki:Special:MyLanguage/Affiliations Committee/News/Issue 1|read this newsletter in full]]''' • [[metawiki:Special:MyLanguage/Global message delivery/Targets/Affiliations Committee/News|subscribe/unsubscribe]]<section end="announcement-content" /></div> <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=26840648 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 16:20, 15 July 2024 (UTC) == Affiliations Committee News (July-September 2024) == <section begin="announcement-content" /> [[File:Wikimania_2024_-_Lviv_-_Day_3_-_AffCom_meets_community.webm|right|thumb|256x256px|AffCom session at Wikimania 2024]] <small>''[[metawiki:Special:MyLanguage/Affiliations Committee/News/Issue 3|You can find this newsletter translated into additional languages on Meta-wiki]]. [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Affiliations Committee/News/Issue 3}}&language=&action=page&filter= {{int:please-translate}}]''</small> Quarterly newsletter sharing news and events about the work of Wikimedia's [[metawiki:Special:MyLanguage/Affiliations_Committee|Affiliations Committee]]. <div style="column-count:1;">Affiliates Strategy Update: [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_3#Affiliate_Strategy_Updates|Implementation status of a new affiliate health criteria and changes to User Groups recognition process]] Affiliate Recognition and Derecognition: [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_3#Affiliate_Recognition_and_Derecognition|Recognition of Togo, Wayúu, and Singapore user groups]] Affiliate Activities and Compliance Report: [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_3#Affiliate_Activities_and_Compliance_Report|Activities reports around the world]] AffCom Conflict Intervention: [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_3#AffCom_Conflict_Intervention|Updates on conflict intervention cases]] AffCom Movement Contribution: [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_3#AffCom_Movement_Contribution|AffCom engagement at Wikimania]] AffCom Administration: [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_3#AffCom_Administrative_Updates|Results of the officers elections]] Upcoming AffCom Events: [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_3#Upcoming_AffCom_Events|AffCom at WikiIndaba and a strategy meetup]] Other Movement News: [[metawiki:Special:MyLanguage/Affiliations_Committee/News/Issue_3#Other_Movement_News|Regional conferences, mental health support, and new committee support inbox]]</div> <div class="hlist" style="margin-top:10px; font-size:100%; ">'''[[metawiki:Special:MyLanguage/Affiliations Committee/News/Issue 1|read this newsletter in full]]''' • [[metawiki:Special:MyLanguage/Global message delivery/Targets/Affiliations Committee/News|subscribe/unsubscribe]]<section end="announcement-content" /></div> <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=27479932 --> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 15:53, 7 October 2024 (UTC) :: FR version is available [[User:Wladek92|Christian 🇫🇷 FR 🚨]] ([[User talk:Wladek92|talk]]) 18:11, 7 October 2024 (UTC) == Affiliations Committee News (October-December 2024) == <section begin="announcement-content" /> [[File:Affiliations Committee 2024 05.jpg|256px|right|thumb|AffCom at its Strategic Retreat in Frankfurt]] <small>''[[m:Special:MyLanguage/Affiliations Committee/News/Issue 4|You can find this newsletter translated into additional languages on Meta-wiki]]. [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Affiliations Committee/News/Issue 4}}&language=&action=page&filter= {{int:please-translate}}]''</small> Quarterly newsletter sharing news and events about the work of Wikimedia's [[m:Special:MyLanguage/Affiliations_Committee|Affiliations Committee]]. <div style="column-count:1;">Affiliates Strategy Update: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_4#Affiliate Strategy Updates|Notes from the 2024 AffCom strategic retreat]] Affiliate Recognition and Derecognition: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_4#Affiliate Recognition and Derecognition|User group application pause lifted]] Affiliate Activities and Compliance Report: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_4#Affiliate Activities and Compliance Report|Activities reports around the world]] AffCom Conflict Intervention: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_4#AffCom Conflict Intervention|Updates on conflict intervention cases]] AffCom Movement Contribution: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue4_#AffCom_Movement_Contribution|AffCom engagement at WikiIndaba]] AffCom Administration: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_4#AffCom_Administrative_Updates|Mari Avetisyan appointed new AffCom secretary]]</div> <div class="hlist" style="margin-top:10px; font-size:100%; ">'''[[m:Special:MyLanguage/Affiliations Committee/News/Issue 4|read this newsletter in full]]''' • [[m:Special:MyLanguage/Global message delivery/Targets/Affiliations Committee/News|subscribe/unsubscribe]]<section end="announcement-content" /> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 03:03, 5 February 2025 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=28207880 --> == Affiliations Committee News (January-March 2025) == <section begin="announcement-content" /> [[File:WMB meeting in Belo Horizonte in 2023 (day 02) 059.jpg|256px|right|thumb|Wikimedia Brasil, the latest chapter to be recognized by AffCom]] <small>''[[m:Special:MyLanguage/Affiliations Committee/News/Issue 5|You can find this newsletter translated into additional languages on Meta-wiki]]. [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Affiliations Committee/News/Issue 5}}&language=&action=page&filter= {{int:please-translate}}]''</small> Quarterly newsletter sharing news and events about the work of Wikimedia's [[m:Special:MyLanguage/Affiliations_Committee|Affiliations Committee]]. <div style="column-count:1;"> Affiliate Recognition and Derecognition: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_5#Affiliate Recognition and Derecognition|Recognition of Wikimedia Brasil and four user groups]] Affiliate Activities and Compliance Report: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_5#Affiliate Activities and Compliance Report|Activities reports around the world]] AffCom Conflict Intervention: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_5#AffCom Conflict Intervention|Updates on conflict intervention cases]] AffCom Movement Contribution: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue 5#AffCom_Movement_Contribution|AffCom engagement at Wikimedia+Libraries and Wikisource conferences]] AffCom Administration: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_5#AffCom_Administrative_Updates|Welcoming new AffCom voting and advisory members]] Upcoming AffCom Events: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_5#Upcoming_AffCom_Events|AffCom at ESEAP Strategy Summit]]</div> <div class="hlist" style="margin-top:10px; font-size:100%; ">'''[[m:Special:MyLanguage/Affiliations Committee/News/Issue 5|read this newsletter in full]]''' • [[m:Special:MyLanguage/Global message delivery/Targets/Affiliations Committee/News|subscribe/unsubscribe]]<section end="announcement-content" /> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 01:28, 26 April 2025 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=28345608 --> == Join the 6th Wikipedia Pages Wanting Photos Campaign – 2025 Edition == Dear Wikimedia affiliate, We invite your community to participate in the 6th edition of the [[:m:Wikipedia Pages Wanting Photos 2025|Wikipedia Pages Wanting Photos Campaign]], a global campaign taking place from July 1 to August 31, 2025. Participants will choose among Wikipedia pages without photos, then add a suitable photo from among the many thousands of photos in the Wikimedia Commons, especially those uploaded from thematic contests ([[:m:Wiki Loves Africa|Wiki Loves Africa]], [[:m:Wiki Loves Earth|Wiki Loves Earth]], [[:m:Wiki Loves Folklore|Wiki Loves Folklore]], [[:m:Wiki Loves Monuments|Wiki Loves Monuments]], etc.) over the years. More than 60 Wikimedia affiliates have participated since the campaign was launched in 2020 and have added images to more than 400,000 Wikipedia articles in over 245 Wikipedia languages. Thanks to the volunteer contributors! We now invite your affiliate to organize and lead the campaign within your community. As a local organizer, you may: *Encourage individual members to take part by adding images to Wikipedia articles. *Host edit-a-thons focused on improving visual content. *Organize training workshops to teach contributors how to correctly integrate images into Wikipedia. These activities will help build local capacity and increase visual content across Wikipedia. Please note that for participants to be eligible to participate in the campaign, they need to have registered an account for at least a year before the official start date of the contest. That is, for the 2025 edition, they must have registered an account on or before July 1, 2025. The account can be from any Wikimedia project wikis. The organizing team is looking for a contact person to coordinate WPWP participation at the Wikimedia user group or chapter level (geographically or thematically) or for a language Wikipedia. We would be glad for you to [[:m:Wikipedia Pages Wanting Photos 2025/Participating Communities|sign up directly]] at [[:m:Wikipedia Pages Wanting Photos 2025/Participating Communities|WPWP Participating Communities]]. With kind regards, [[User:Reading Beans]] On behalf of the Wikipedia Pages Wanting Photos campaign 2025. [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 10:03, 15 May 2025 (UTC) <!-- Message sent by User:T Cells@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Wikipedia_Pages_Wanting_Photos_2025/Call_for_participation_letter/Targets_affiliates&oldid=28720964 --> == Wikimedia Foundation Board of Trustees 2025 - Call for Candidates == <section begin="announcement-content" /> :''<div class="plainlinks">[[m:Special:MyLanguage/Wikimedia Foundation elections/2025/Call for candidates|{{int:interlanguage-link-mul}}]] • [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Wikimedia Foundation elections/2025/Call for candidates}}&language=&action=page&filter= {{int:please-translate}}]</div>'' Hello all, The call for candidates for the 2025 Wikimedia Foundation Board of Trustees selection is now open from June 17, 2025 - July 2, 2025 at 11:59 UTC. The Board of Trustees oversees the Wikimedia Foundation's work, and each Trustee serves a [[foundation:Legal:Bylaws#(B)_Term.|three-year term]]. This is a volunteer position. This year, the Wikimedia community will vote starting in August and ending in September 2025 to fill two (2) seats on the Foundation Board. You can see the timeline of the full selection process [[m:Special:MyLanguage/Wikimedia_Foundation_elections/2025#Timeline|here]]. '''Traits''' Wikimedia is a global movement and seeks candidates from the broader community. Ideal candidates are thoughtful, respectful, community-oriented and align with the Wikimedia Foundation mission. The Board is looking for candidates with experience guiding organizational strategy, navigating change, and driving long-term strategic objectives. Candidates should think about what experiences and perspectives they will bring to the Board. The Board would like to find perspectives and voices that are essential but underrepresented in our movement. Accordingly, all candidates will be asked to include statements in their application that speak to their experiences in the world, the perspectives they bring to the movement and share how these help them to include those not already here. '''Time Commitment for Trustees''' Trustees [[foundation:Bylaws#(B)_Term.|serve a three year term and can serve up to three consecutive terms]]. The expectation is that Trustees serve on at least [[foundation:Committee:Main|one of the Board’s committees]]. The time commitment is about 150 hours per year, excluding travel. This time is not evenly spread throughout the year. The time is concentrated around meetings. '''Requirements to be a Trustee''' English is the language of business for the Board. Candidates must be fluent in written and spoken English. Previous experience serving on a collective decision-making body, especially Boards or committees, and significant experience in Wikimedia (or equivalent) movement building and organizing are expected from candidates. [[m:Special:MyLanguage/Wikimedia_Foundation_elections/2025/Candidate_application|You can review the candidate guidelines here.]] '''How to Apply''' Candidates from all projects and communities who meet the criteria to become a Wikimedia Trustee are welcome to apply. Could you - or someone you know - be a good fit to join the Wikimedia Foundation's Board of Trustees? Encourage them to run for election. Candidates can find information and submit their nomination on the [[m:Special:MyLanguage/Wikimedia_Foundation_elections/2025/Candidate_application|candidate application]] page. If you want to learn more about the role of Trustees or have questions, refer to this [[m:Special:MyLanguage/Wikimedia_Foundation_elections/2025/Resources_for_candidates|candidate resources]] page. '''Community questions for candidates''' The questions for the Board of Trustees candidates to answer have been published as part of the candidate application. From the list of questions submitted by the community, the Election Committee selected 5 questions which the candidates are required to answer. Learn more about the community questions on [[m:Special:MyLanguage/Wikimedia_Foundation_elections/2025/Questions_for_candidates|this Meta-wiki page]]. Best regards, The Elections Committee and the Governance Committee<section end="announcement-content" /> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 14:02, 26 June 2025 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=28901675 --> == 2025 Board of Trustees selection process – Candidate shortlisting process == The [[Wikimedia_Foundation_elections/2025/Call_for_candidates|candidates application period]] for the Wikimedia Foundation 2025 Board of Trustees selection was closed on July 9, 2025. The [[Wikimedia_Foundation_elections_committee|Elections Committee]] has announced the list of [[Wikimedia_Foundation_elections/2025/Candidates|12 (twelve) eligible candidates]]. A shortlisting process will be conducted to produce 6 (six) final candidates that will be voted on by the wider community. Representatives of Wikimedia movement affiliates that are currently compliant with their reporting obligations ([[Wikimedia_movement_affiliates/Affiliates_Status_Report/Archive/2025-07|list of all Affiliates currently compliant]]) has been notified to participate in the shortlisting process based on the candidates’ alignment with the [[Wikimedia_Foundation_elections/2025/Candidate_application|requirements and desired criteria for candidates]]. The process is open from now until '''Monday, July 28, 2025 at 23:59 UTC'''. After the shortlisting process concludes, the 6 (six) candidates who receive the highest number of votes will be announced by the Elections Committee on Wikimedia-l and Meta-wiki, but without publicly mentioning their ranking. As mentioned on [[Wikimedia_Foundation_elections/2024#Shortlisting_process|the Meta page]], the results of this shortlisting process will be shared after the election closes, to avoid influencing the vote. On behalf of the Elections Committee and the Governance Committee, [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 18:16, 15 July 2025 (UTC) <!-- Message sent by User:MPossoupe (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=28901675 --> == Affiliations Committee News (April-June 2025) == <section begin="announcement-content" /> [[File:MNL25 - day one 08.jpg|256px|right|thumb|AffCom session at the ESEAP Strategy Summit 2025 in Manila, the Philippines]] <small>''[[m:Special:MyLanguage/Affiliations Committee/News/Issue 6|You can find this newsletter translated into additional languages on Meta-wiki]]. [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Affiliations Committee/News/Issue 6}}&language=&action=page&filter= {{int:please-translate}}]''</small> Quarterly newsletter sharing news and events about the work of Wikimedia's [[m:Special:MyLanguage/Affiliations_Committee|Affiliations Committee]]. <div style="column-count:1;">Affiliate Recognition and Derecognition: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_6#Affiliate Recognition and Derecognition|Recognition of Wikimedia Aotearoa New Zealand and Assamese Wikimedia Community User Group]] Affiliate Activities and Compliance Report: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_6#Affiliate Activities and Compliance Report|Activities reports around the world]] AffCom Conflict Intervention: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_6#AffCom Conflict Intervention|Updates on conflict intervention cases]] AffCom Movement Contribution: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue 6#AffCom_Movement_Contribution|AffCom engagement at the ESEAP Strategy Summit]] AffCom Administration: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_6#AffCom_Administrative_Updates|Results of the AffCom officers election]] Upcoming AffCom Events: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_6#Upcoming_AffCom_Events|Meet AffCom at Wikimania]]</div> <div class="hlist" style="margin-top:10px; font-size:100%; ">'''[[m:Special:MyLanguage/Affiliations Committee/News/Issue 6|read this newsletter in full]]''' • [[m:Special:MyLanguage/Global message delivery/Targets/Affiliations Committee/News|subscribe/unsubscribe]]<section end="announcement-content" /> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 06:26, 5 August 2025 (UTC) <!-- Message sent by User:RamzyM (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=29060030 --> == Seeking volunteers to join several of the movement’s committees == <section begin="announcement-content" /> Each year, typically from October through December, several of the movement’s committees seek new volunteers. Read more about the committees on their Meta-wiki pages: * [[m:Special:MyLanguage/Affiliations Committee|Affiliations Committee (AffCom)]] * [[m:Special:MyLanguage/Ombuds commission|Ombuds commission (OC)]] * [[m:Special:MyLanguage/Wikimedia Foundation/Legal/Community Resilience and Sustainability/Trust and Safety/Case Review Committee|Case Review Committee (CRC)]] Applications for the committees open on October 30, 2025. Applications for the Affiliations Committee, Ombuds commission and the Case Review Committee close on December 11, 2025. Learn how to apply by [[m:Special:MyLanguage/Wikimedia Foundation/Legal/Committee appointments|visiting the appointment page on Meta-wiki]]. Post to the talk page or email cst[[File:At sign.svg|16x16px|link=|(_AT_)]]wikimedia.org with any questions you may have. For the Committee Support team, <section end="announcement-content" /> -[[User:MKaur (WMF)| MKaur (WMF)]] 14:10, 30 October 2025 (UTC) <!-- Message sent by User:MKaur (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=29313530 --> == Seeking volunteers to join several of the movement’s committees == <section begin="announcement-content" /> Each year, typically from October through December, several of the movement’s committees seek new volunteers. Read more about the committees on their Meta-wiki pages: * [[m:Special:MyLanguage/Affiliations Committee|Affiliations Committee (AffCom)]] * [[m:Special:MyLanguage/Ombuds commission|Ombuds commission (OC)]] * [[m:Special:MyLanguage/Wikimedia Foundation/Legal/Community Resilience and Sustainability/Trust and Safety/Case Review Committee|Case Review Committee (CRC)]] Applications for the committees open on October 30, 2025. Applications for the Affiliations Committee, Ombuds commission and the Case Review Committee close on December 11, 2025. Learn how to apply by [[m:Special:MyLanguage/Wikimedia Foundation/Legal/Committee appointments|visiting the appointment page on Meta-wiki]]. Post to the talk page or email cst[[File:At sign.svg|16x16px|link=|(_AT_)]]wikimedia.org with any questions you may have. For the Committee Support team, <section end="announcement-content" /> -[[User:MKaur (WMF)| MKaur (WMF)]] 14:11, 30 October 2025 (UTC) <!-- Message sent by User:MKaur (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=29313530 --> ==Call for Applications for WikiDebates from Wikimedia Affiliates== Dear Wikimedia Affiliates, The Core Organising Team for WikiDebates is pleased to invite interested Wikimedia affiliates to apply to participate in the upcoming '''[https://meta.wikimedia.org/wiki/Wiki_Debates WikiDebates]'''. [[File:WikiDebates Logo (cropped).jpg|200px|right]] * '''About WikiDebates''' WikiDebates is a collaborative knowledge-engagement initiative designed to strengthen critical reasoning, public discourse, and community participation across the Wikimedia movement. The program uses structured debate as a tool to deepen understanding of open knowledge, digital citizenship, and the role of Wikimedia projects in shaping informed societies. * '''Program Objectives''' ** Promote constructive dialogue on themes connected to free knowledge and public information. ** Strengthen community members' capacity in research, argument development, and public speaking. ** Encourage cross-affiliate collaboration and relationship building. ** Highlight shared movement values such as openness, verifiability, diversity, and community governance. * '''Who Can Apply''' ** Recognised Wikimedia User Groups, Chapters, and Thematic Affiliates. ** Affiliates must have an active community and be able to field a small team (2–3 participants) to represent them. ** Teams may include new and experienced contributors; no previous debate experience is required. * '''Expected Participation''' ** Attend a virtual orientation and training session. ** Participate in scheduled debate rounds between affiliates. ** Demonstrate respect, collaboration, and adherence to friendly space policies throughout the program. * '''Support Provided''' ** Orientation and training resources on debate structure and research. ** Coaching sessions and topic guides. ** Publicity and movement-level visibility for participating affiliates. * '''How to Apply ''' Interested affiliates should complete the '''[https://docs.google.com/forms/d/e/1FAIpQLSfH__DK8tlfFi8NrGCXsb33N7GT0FhQO73NLfITGPdiFWWtRQ/viewform application form]'''. * '''Please provide:''' ** Affiliate name and contact details. ** Names of proposed team members (3–5 participants). ** A short statement (150–200 words) on why your affiliate wishes to participate. ** Any preferred support needs or time-zone constraints. '''Application Deadline:''' 30 November 2025 '''Notification of Selected Affiliates:''' 15 December 2025 We welcome your participation in building a vibrant, informed, and collaborative knowledge community through WikiDebates. For inquiries, please contact: WikiDebates.Global[at]gmail.com '''Sincerely,''' <br> '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 22:09, 16 November 2025 (UTC) '''The Core Organizing Team,''' [https://meta.wikimedia.org/wiki/Wiki_Debates '''WikiDebates'''] == Affiliations Committee News (July-December 2025) == [[File:At Wikimania 2025 127.jpg|256px|right|thumb|AffCom at Wikimania 2025 in Nairobi, Kenya]]<br> <div style="column-count:1;">Affiliate Recognition and Derecognition: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_7#Affiliate Recognition and Derecognition|Recognition of Wikimedia Georgia: recognized & announced September 2025]] Recognition Status Report: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_7#Recognition Status Report|Updates of affiliate applications]] AffCom Conflict Intervention: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_7#AffCom Conflict Intervention|Updates on conflict intervention cases]] AffCom Movement Contribution: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue 7#AffCom at WikiConference North America|AffCom at WikiConference North America]] AffCom Administration: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_7#AffCom and EDs Discuss Affiliate Ecosystem|AffCom and EDs Discuss Affiliate Ecosystem]] AffCom Events: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_7#AffCom Administrative Updates|AffCom at Wikimania]]</div> <small>''[[m:Special:MyLanguage/Affiliations Committee/News/Issue 7|This newsletter is best translated into additional languages on Meta-wiki]]. [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Affiliations Committee/News/Issue 7}}&language=&action=page&filter= {{int:please-translate}}]''</small> <div class="hlist" style="margin-top:10px; font-size:100%; ">'''[[m:Special:MyLanguage/Affiliations Committee/News/Issue 7|read this newsletter in full]]''' • [[m:Special:MyLanguage/Global message delivery/Targets/Affiliations Committee/News|subscribe/unsubscribe]]</div><section end="announcement-content" /> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 11:11, 26 January 2026 (UTC) <!-- Message sent by User:Buszmail@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=29313530 --> == Affiliations Committee News (January-March 2026) == <!-- == Affiliations Committee News (January-March 2026) == --> <small>''[[m:Special:MyLanguage/Affiliations Committee/News/Issue 8|You can find this newsletter translated into additional languages on Meta-wiki]]. [https://meta.wikimedia.org/w/index.php?title=Special:Translate&group=page-{{urlencode:Affiliations Committee/News/Issue 8}}&language=&action=page&filter= {{int:please-translate}}]''</small> Quarterly newsletter sharing news and events about the work of Wikimedia's [[m:Special:MyLanguage/Affiliations_Committee|Affiliations Committee]]. [[File:AffCom_and_GRDC_members_at_APP_meeting,_Lisbon_2026_01_(cropped).jpg|256px|right|thumb|AffCom and GRDC members at APP meeting, Lisbon, Portugal]] <div style="column-count:1;"> Affiliate Recognition and Derecognition: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_8#Affiliate Recognition and Derecognition|This past quarter, AffCom recognized no new Affiliates due to the pause in recognizing new affiliates.]] AffCom Conflict Intervention: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_8#AffCom Conflict Intervention|AffCom is currently addressing eight ongoing affiliate conflict cases received in previous quarters.]] Affiliate Recognition Pause Extension: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_8#Affiliate Recognition Pause Extension|The Wikimedia Foundation, together with the AffCom, has extended the pause on new affiliate recognition until September 1, 2026.]] New Affiliate Model Development Efforts: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_8#New Affiliate Model Development Efforts|The Affiliations Committee held collaborative meetings with the Global Resource Distribution Committee (GRDC) to explore the development of a new affiliations model.]] Towards a Healthy Ecosystem of Wikimedia Organizations: [[m:Special:MyLanguage/Affiliations_Committee/News/Issue_8#Towards a Healthy Ecosystem of Wikimedia Organizations: Updates on the Movement Organizations Pilot, GRDC, and AffCom|Two major pilot initiatives were launched to address long-standing questions about the roles of movement organizations and the future of resource allocation.]] <div class="hlist" style="margin-top:10px; font-size:100%; ">'''[[m:Special:MyLanguage/Affiliations Committee/News/Issue 8|read this newsletter in full]]''' • [[m:Special:MyLanguage/Global message delivery/Targets/Affiliations Committee/News|subscribe/unsubscribe]]</div><section end="announcement-content" /> [[User:MediaWiki message delivery|MediaWiki message delivery]] ([[User talk:MediaWiki message delivery|talk]]) 03:50, 03 May 2026 (UTC) <!-- Message sent by User:Buszmail@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Affiliations_Committee/Affiliates&oldid=29313530 --> gu2kk8668fhzqnfr8imszbahkpkl7sa Help:URL/cs 12 2173400 8364443 8358801 2026-05-03T15:31:20Z Rebulka 17532855 8364443 wikitext text/x-wiki <languages/> {{PD Help Page|imported=yes}} <div style="font-style: italic; padding-left: 1.6em; margin-bottom: 0.5em;"> Nápovědu k URL ve wikitextu naleznete v {{ll|Help:Links}}. Tato stránka se týká různých URL adres projektových stránek. </div> <span id="URLs_in_external_links"></span> == URL adresy v externích odkazech == <span id="Form_of_the_URL"></span> === Formát URL === [[Special:MyLanguage/Help:Link|Odkaz]] ve stylu externího odkazu může mít následující tvar: ; ''cíl'' : <nowiki>https://mediawiki.org/</nowiki> se zobrazí jako https://mediawiki.org ; [ ''cíl'' ''označení'' ] s mezerou mezi nimi : <nowiki>[https://mediawiki.org/ mediawiki]</nowiki> se zobrazí jako [https://mediawiki.org mediawiki] (viz také {{ll|Help:Links#Piped links|piped propojení}}) ; <span class="mw-translate-fuzzy">[ ''cíl'' ]:</span> : "<nowiki>[https://mediawiki.org]</nowiki> a <nowiki>[https://www.w3.org/TR/url/]</nowiki>" se zobrazí jako "[https://mediawiki.org/] a [https://www.w3.org/TR/url/]". Každý odkaz zobrazuje pořadové číslo 1, 2, 3, ... Cílem je URL adresa, která může začínat <code><nowiki>https://</nowiki></code>, <code><nowiki>https://</nowiki></code> nebo <code><nowiki>ftp://</nowiki></code>. V hranatých závorkách může URL adresa začínat také <code><nowiki>//</nowiki></code> (vůbec žádné schéma), což je [[w:Uniform_resource_locator#Protocol-relative_URLs | URL adresa relativní k protokolu]], která používá stejný protokol (http nebo https) jako aktuální webová stránka. Proměnná <code>file://</code> ve výchozím nastavení nefunguje. Pokud je povoleno, funguje pouze v MSIE. Chcete-li ji povolit, přidejte položku [[Special:MyLanguage/Manual:$wgUrlProtocols|$wgUrlProtocols]] do položky [[Special:MyLanguage/LocalSettings.php|LocalSettings.php]]. Viz například položku <code>$wgUrlProtocols</code> v položce DefaultSettings.php. <span id="Allowed_characters"></span> === Povolené znaky === Všechny [[Special:MyLanguage/Help:Special characters|znaky]] URL adresy musí být mezi: A-Z a-z 0-9 :._\/~%-+&amp;#?!=()@ Pokud URL adresa obsahuje jiný znak, musíte jej převést. Například <code>^</code> musí být zapsáno jako <code>%5e</code>, což je hexadecimální hodnota [[w:ASCII|ASCII]] se znaménkem procenta na začátku. Jako podtržítko můžete také napsat prázdnou mezeru. <span id="Character_conversion"></span> === Převod znaků === " # $ % &amp;<!-- --> ' ( ) * , ; %20 %22 %23 %24 %25 %26 <!-- -->%27 %28 %29 %2a %2c %3b < > ? [ ] ^ ` { | } %3c %3e %3f %5b %5d %5e %60 %7b %7c %7d U ostatních znaků lze v interních i externích odkazech použít buď kód, nebo znak, jsou ekvivalentní. Systém provede, v případě potřeby, konverzi. Například <nowiki>[[m:%C3%80_propos_de_M%C3%A9ta]]</nowiki> se vykreslí jako [[m:%C3%80_propos_de_M%C3%A9ta|m:%C3%80_propos_de_M%C3%A9ta]], téměř jako [[m:À propos de Méta|m:À propos de Méta]], což vede na stránku na meta.wikimedia.org s URL adresou v adresním řádku https://meta.wikimedia.org/wiki/%C3%80_propos_de_M%C3%A9ta zatímco https://meta.wikimedia.org/wiki/À_propos_de_Méta vede ke stejnému výsledku. <span id="Parser_function_[[Special:MyLanguage/Help:Parser_function#URLENCODE|urlencode]]"></span> === Funkce parseru [[Special:MyLanguage/Help:Parser_function#URLENCODE|urlencode]] === *<code><nowiki>{{urlencode:"#$%&'()*,;?[]^`{} }}</nowiki></code> → {{urlencode:"#$%&'()*,;?[]^`{} }} [//mediawiki.org/w/index.php?title=Special:ExpandTemplates&wpInput=%22%7B%7Burlencode%3A%22%23%24%25%26%27%28%29%2A%2C%3B%3F%5B%5D%5E%60%7B%7D%7D%7D%22&removecomments=true] *<code><nowiki>{{urlencode:<}}</nowiki></code> → {{urlencode:<}} [//mediawiki.org/w/index.php?title=Special:ExpandTemplates&wpInput=%7B%7Burlencode%3A%3C%7D%7D&removecomments=true] *<code><nowiki>{{urlencode:>}}</nowiki></code> → {{urlencode:>}} [//mediawiki.org/w/index.php?title=Special:ExpandTemplates&wpInput=%7B%7Burlencode%3A%3E%7D%7D&removecomments=true] *<code><nowiki>{{urlencode:{{!}} }}</nowiki></code> → {{urlencode:{{!}} }} [//meta.mediawiki.org/w/index.php?title=Special:ExpandTemplates&wpInput=%7B%7Burlencode%3A%7B%7B%21%7D%7D%7D%7D&removecomments=true] Existuje externí [https://wikiurl.miteff.com/ online převodník] pro kódování vlastních URL adres do formátu mediawiki. Viz také (na Wikipedii): [[w:Internationalized domain names|Internacionalizované doménové názvy]] a [[w:Punycode|Punycode]]. <span id="Percent-encoding"></span> === Procentuální kódování === Pro znaky ASCII (až do desítková hodnoty 127, hex. 7F) procentuální kódování jednoduše znamená přičtení '''%''' k hexadecimální hodnotě, např. pro vlnovku '''~''' (desítková hodnota 126, hexadecimální 7E) je to %7E. Jinak (ne-ASCII) nejprve převeďte do UTF-8 a poté jej kódujte procentuálně. Zde jsou kroky, které je třeba dodržet, s příkladem: # Převedení znaku do formátu Unicode, např. Latin-1 192 (hexadecimální C0) na À (u+00C0) nebo windows-1252 131 (hexadecimální 8B) na Š (u+0160). # Převedení Unicode na bity, 00000000 11000000 (u+00C0) nebo 00000001 01100000 (u+0160). # Sestavte skupiny šesti bitů zprava a v případě potřeby přidejte úvodní nuly, dokud zbytek nebudou nuly: 000011 000000 (u+00C0) nebo 000101 100000 (u+0160). # Přidejte '''10''' před všechny skupiny kromě té úplně vlevo. 2 bity + 6 bitů = 8 bitů, také známé jako oktet. # Pokud existují pouze dvě skupiny a první (levá) začíná 0: ## Přičtěte '''11''' doleva: '''11''' 000011 '''10''' 0000000 (u+00C0) nebo '''11''' 000101 '''10''' 100000 (u+0160). ## Převeďte oktety do hexadecimálního formátu, přidejte procenta na začátek, hotovo: %C3%80 (u+00C0) nebo %C5%A0 (u+0160). # Pokud první (levá) ze dvou skupin začíná číslem 1: #: Přičtěte '''111''' 00000 '''10''' doleva, poté procentuálně kódujte tři oktety, %E0%??%?? # Pokud existují tři skupiny, první (levá) začínající na 00 (000001 až 001111): #: Nahraďte 00 hodnotou '''111''' 0, zakódujte tři oktety v procentech, připraveno, výsledek %E?%??%??. # Jinak je to nejméně 010000 000000 000000 (u+10000), který potřebuje '''čtyři''' oktety UTF-8: #: '''1111''' 0000 '''10''' 010000 '''10''' 000000 '''10''' 000000 by byl %F0%90%80%80. <span id="URLs_of_pages_within_the_projects"></span> == URL adresy stránek v rámci projektů == Viz [[w:Wikipedia:URLs]]. Na jiných projektech funguje vše stejně, až na to, že se liší názvy domén: *xx.wikipedia.org s kódem jazyka xx, viz [[m:Complete list of language Wikipedias available|Kompletní seznam dostupných Wikipedií v daných jazycích]] v Meta-wiki *meta.wikimedia.org (přesměrování na meta.wikipedia.org) *xx.wiktionary.org *xx.wikiquote.org *xx.wikibooks.org *xx.wikisource.org *sep11.wikipedia.org URL začínající na www.wikipedia.org přesměrovává na odpovídající URL začínající na en. Pouze samotná adresa www.wikipedia.org vede na portálovou stránku místo na hlavní stránku anglické Wikipedie: https://www.wikipedia.org V projektech mimo Wikimedii se "w/" v URL adresách, jako je https://www.wikipedia.org/w/wiki.phtml?title=Main_Page&action=history, někdy nepoužívá, někdy se používá jinak, např.: * https://www.sourcewatch.org/index.php?title=SourceWatch&action=history * https://wikitravel.org/en/index.php?title=Main_Page&action=history <span id="Use_in_templates"></span> === Použití v šablonách === Pro použití v šablonách je třeba mít na paměti, že všechny URL adresy např. na anglické Wikipedii lze zapsat ve tvaru: <code><nowiki>https://</nowiki>en.wikipedia.org/w/index.php?title={{{1}}}</code> To vyžaduje, aby byl <code><nowiki>{{{1}}}</nowiki></code> zapsán s podtržítky a escape kódy (pokud existují), nebo může být escapován pomocí [[#Parser_function_urlencode|urlencode]] jako <code><nowiki>{{urlencode:{{{1}}}}}</nowiki></code>. Aby bylo možné využít konverze provedené magickým slovem ''[[Special:MyLanguage/Help:Magic_words#URL data|fullurl]]'', jsou potřeba dva parametry: <code><nowiki>{{fullurl:{{{1}}}|{{{2}}}}}</nowiki></code> (viz šablona [[m:Template discuss:Url 2p|Url 2p]] na meta). Příklad s druhým parametrem ve fullurl fixed je {{tiw|ed}} obsahující odkaz <code><nowiki>[{{fullurl:Template:{{{1}}}|action=edit}} {{MediaWiki:Edit}} {{{2|{{{1}}}}}}].</nowiki></code> Toto funguje pro odkaz ve stylu externího odkazu na stránku ve stejném projektu. Localurl můžeme použít pro odkaz na projekt, který používá stejný řetězec v URL mezi názvem serveru a otazníkem ([[Special:MyLanguage/Manual:$wgScript|$wgScript]], na Wikimedii "<code><nowiki>/w/index.php</nowiki></code>"), ale ne pro odkazy na jiné projekty. <span id="Old_versions_of_pages"></span> == Starší verze stránek == Všechny staré verze všech stránek jsou číslovány (s [[Special:MyLanguage/Manual:Old_table|oldid]]) přibližně v pořadí, v jakém se stávají starou verzí, tj. v chronologickém pořadí od další úpravy stejné stránky. * https://www.mediawiki.org/w/index.php?title=Help:Link&oldid=53587 - normální odkaz na starou stránku * https://www.mediawiki.org/w/index.php?oldid=53587 - v URL adrese není uveden název stránky, vede na správnou stránku * https://www.mediawiki.org/w/index.php?title=Help:Link&oldid=53588 - číslo a název se neshodují. Název je ignorován * https://www.mediawiki.org/w/index.php?title=abc&oldid=53587 - název neexistující stránky. oldid je ignorováno, funguje jako přechod na neexistující stránku, s výjimkou odkazů na předpokládané předchozí a následující verze a při úpravách pro upozornění na úpravu staré verze stránky. Viz také [[Special:MyLanguage/Help:Page history#Linking_to_a_specific_version_of_a_page|Odkazování na konkrétní verze stránky]]. <span id="New_pages"></span> == Nové stránky == Stránky jsou číslovány pomocí page_id (viz {{ll|Manual:page table}}) v pořadí, v jakém byly vytvořeny. *https://www.mediawiki.org/w/index.php?title=x&curid=9906 - vrátí stránku se správným celým názvem Naopak většina výstupů z [[Special:MyLanguage/API:query|Query API]] poskytuje názvy stránek i jejich ID, např. https://meta.wikimedia.org/w/query.php?titles=Hilfe:Zeitleiste Verze stránek získají číslo "oldid" ihned po vytvoření. Jsou generovány proměnnou <nowiki>{{REVISIONID}}</nowiki>. URL adresa je stejná jako v předchozí části. <span id="Edit"></span> == Úpravy == Příklady: * Upravit celou stránku: https://www.mediawiki.org/w/index.php?title=Help:URL&action=edit * Upravit 5. část: https://www.mediawiki.org//wiki/Help:URL?action=edit&section=5 * Přidat na konec: https://www.mediawiki.org//w/wiki.phtml?title=Help:URL&action=edit&section=new <span id="Purge"></span> == Vyčištění == V některých případech problémů s ukládáním do mezipaměti může pro aktualizaci stránky pomoci použití parametru <code>action=purge</code> v URL adrese, například <pre>{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAMEE}}|action=purge}}</pre> což má za následek: <code>{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAMEE}}|action=purge}}</code> <span id="Parameter_uselang"></span> == Parametr uselang == V některých případech je užitečné propojení s jiným projektem Wikimedie pomocí parametru "&uselang" v URL adrese, například https://commons.wikimedia.org/w/index.php?title=Glavna_stran&uselang=sl. Toto umožňuje specifikovat jazyk (zde 'sl' pro slovenštinu) zpráv rozhraní, které se zobrazí při otevření stránky 'Glavna stran' v projektu Commons. <span id="Miscellaneous_actions"></span> == Různé akce == Nezpracovaný wikitext stránky můžete načíst pomocí URL adresy, jako je <pre>{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAMEE}}|action=raw}}</pre> což má za následek: <code>{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAMEE}}|action=raw}}</code> Další akce jsou <code>view</code>, <code>watch</code>, <code>unwatch</code>, <code>delete</code>, <code>revert</code>, <code>rollback</code>, <code>unprotect</code>, <code>info</code>, <code>markpatrolled</code>, <code>validate</code>, <code>render</code>, <code>deletetrackback</code>, <code>history</code>. (Tyto parametry je zřídka nutné zadávat explicitně, protože ty užitečné jsou předem propojeny na různých kartách a tlačítkách. Některé z těchto akcí vyžadují administrátorská oprávnění. Ostatní uživatelé odkaz nemají. Pokud se pokusí zadat URL, zobrazí se jim chyba.) <span id="Kinds_of_dead_links"></span> == Druhy nefunkčních odkazů == V URL adrese se mohou vyskytovat různé druhy chyb. U některých se server ani nedostane, u jiných server provede nějakou akci. Server může také přejít na správnou stránku a jednoduše ignorovat nesprávný parametr nebo kotvu. *{{SERVER}}{{localurl:%abc}} *https://meta.wikimedia.or/ *{{SERVER}}abc *https://met.mediawiki.org *{{SERVER}}/abc *https://meta.wikimedia.org/w/index.php?title=Help:URL&action=abc *https://meta.wikimedia.org/w/index.php?title=Help:URL&act=abc *https://meta.wikimedia.org/w/index.php?title=Help:URL#abc <span id="See_also"></span> == Související odkazy == * {{ll|Manual:Parameters to index.php}} * {{ll|Help:Namespaces}} * {{ll|Manual:Short URL}} * {{wg|UrlProtocols}} 87jcyylcrppxti7ab44vh7s38539mhk 8364445 8364443 2026-05-03T15:31:30Z Rebulka 17532855 8364445 wikitext text/x-wiki <languages/> {{PD Help Page|imported=yes}} <div style="font-style: italic; padding-left: 1.6em; margin-bottom: 0.5em;"> Nápovědu k URL ve wikitextu naleznete v {{ll|Help:Links}}. Tato stránka se týká různých URL adres projektových stránek. </div> <span id="URLs_in_external_links"></span> == URL adresy v externích odkazech == <span id="Form_of_the_URL"></span> === Formát URL === [[Special:MyLanguage/Help:Link|Odkaz]] ve stylu externího odkazu může mít následující tvar: ; ''cíl'' : <nowiki>https://mediawiki.org/</nowiki> se zobrazí jako https://mediawiki.org ; [ ''cíl'' ''označení'' ] s mezerou mezi nimi : <nowiki>[https://mediawiki.org/ mediawiki]</nowiki> se zobrazí jako [https://mediawiki.org mediawiki] (viz také {{ll|Help:Links#Piped links|piped propojení}}) ; [ ''cíl'' ] : "<nowiki>[https://mediawiki.org]</nowiki> a <nowiki>[https://www.w3.org/TR/url/]</nowiki>" se zobrazí jako "[https://mediawiki.org/] a [https://www.w3.org/TR/url/]". Každý odkaz zobrazuje pořadové číslo 1, 2, 3, ... Cílem je URL adresa, která může začínat <code><nowiki>https://</nowiki></code>, <code><nowiki>https://</nowiki></code> nebo <code><nowiki>ftp://</nowiki></code>. V hranatých závorkách může URL adresa začínat také <code><nowiki>//</nowiki></code> (vůbec žádné schéma), což je [[w:Uniform_resource_locator#Protocol-relative_URLs | URL adresa relativní k protokolu]], která používá stejný protokol (http nebo https) jako aktuální webová stránka. Proměnná <code>file://</code> ve výchozím nastavení nefunguje. Pokud je povoleno, funguje pouze v MSIE. Chcete-li ji povolit, přidejte položku [[Special:MyLanguage/Manual:$wgUrlProtocols|$wgUrlProtocols]] do položky [[Special:MyLanguage/LocalSettings.php|LocalSettings.php]]. Viz například položku <code>$wgUrlProtocols</code> v položce DefaultSettings.php. <span id="Allowed_characters"></span> === Povolené znaky === Všechny [[Special:MyLanguage/Help:Special characters|znaky]] URL adresy musí být mezi: A-Z a-z 0-9 :._\/~%-+&amp;#?!=()@ Pokud URL adresa obsahuje jiný znak, musíte jej převést. Například <code>^</code> musí být zapsáno jako <code>%5e</code>, což je hexadecimální hodnota [[w:ASCII|ASCII]] se znaménkem procenta na začátku. Jako podtržítko můžete také napsat prázdnou mezeru. <span id="Character_conversion"></span> === Převod znaků === " # $ % &amp;<!-- --> ' ( ) * , ; %20 %22 %23 %24 %25 %26 <!-- -->%27 %28 %29 %2a %2c %3b < > ? [ ] ^ ` { | } %3c %3e %3f %5b %5d %5e %60 %7b %7c %7d U ostatních znaků lze v interních i externích odkazech použít buď kód, nebo znak, jsou ekvivalentní. Systém provede, v případě potřeby, konverzi. Například <nowiki>[[m:%C3%80_propos_de_M%C3%A9ta]]</nowiki> se vykreslí jako [[m:%C3%80_propos_de_M%C3%A9ta|m:%C3%80_propos_de_M%C3%A9ta]], téměř jako [[m:À propos de Méta|m:À propos de Méta]], což vede na stránku na meta.wikimedia.org s URL adresou v adresním řádku https://meta.wikimedia.org/wiki/%C3%80_propos_de_M%C3%A9ta zatímco https://meta.wikimedia.org/wiki/À_propos_de_Méta vede ke stejnému výsledku. <span id="Parser_function_[[Special:MyLanguage/Help:Parser_function#URLENCODE|urlencode]]"></span> === Funkce parseru [[Special:MyLanguage/Help:Parser_function#URLENCODE|urlencode]] === *<code><nowiki>{{urlencode:"#$%&'()*,;?[]^`{} }}</nowiki></code> → {{urlencode:"#$%&'()*,;?[]^`{} }} [//mediawiki.org/w/index.php?title=Special:ExpandTemplates&wpInput=%22%7B%7Burlencode%3A%22%23%24%25%26%27%28%29%2A%2C%3B%3F%5B%5D%5E%60%7B%7D%7D%7D%22&removecomments=true] *<code><nowiki>{{urlencode:<}}</nowiki></code> → {{urlencode:<}} [//mediawiki.org/w/index.php?title=Special:ExpandTemplates&wpInput=%7B%7Burlencode%3A%3C%7D%7D&removecomments=true] *<code><nowiki>{{urlencode:>}}</nowiki></code> → {{urlencode:>}} [//mediawiki.org/w/index.php?title=Special:ExpandTemplates&wpInput=%7B%7Burlencode%3A%3E%7D%7D&removecomments=true] *<code><nowiki>{{urlencode:{{!}} }}</nowiki></code> → {{urlencode:{{!}} }} [//meta.mediawiki.org/w/index.php?title=Special:ExpandTemplates&wpInput=%7B%7Burlencode%3A%7B%7B%21%7D%7D%7D%7D&removecomments=true] Existuje externí [https://wikiurl.miteff.com/ online převodník] pro kódování vlastních URL adres do formátu mediawiki. Viz také (na Wikipedii): [[w:Internationalized domain names|Internacionalizované doménové názvy]] a [[w:Punycode|Punycode]]. <span id="Percent-encoding"></span> === Procentuální kódování === Pro znaky ASCII (až do desítková hodnoty 127, hex. 7F) procentuální kódování jednoduše znamená přičtení '''%''' k hexadecimální hodnotě, např. pro vlnovku '''~''' (desítková hodnota 126, hexadecimální 7E) je to %7E. Jinak (ne-ASCII) nejprve převeďte do UTF-8 a poté jej kódujte procentuálně. Zde jsou kroky, které je třeba dodržet, s příkladem: # Převedení znaku do formátu Unicode, např. Latin-1 192 (hexadecimální C0) na À (u+00C0) nebo windows-1252 131 (hexadecimální 8B) na Š (u+0160). # Převedení Unicode na bity, 00000000 11000000 (u+00C0) nebo 00000001 01100000 (u+0160). # Sestavte skupiny šesti bitů zprava a v případě potřeby přidejte úvodní nuly, dokud zbytek nebudou nuly: 000011 000000 (u+00C0) nebo 000101 100000 (u+0160). # Přidejte '''10''' před všechny skupiny kromě té úplně vlevo. 2 bity + 6 bitů = 8 bitů, také známé jako oktet. # Pokud existují pouze dvě skupiny a první (levá) začíná 0: ## Přičtěte '''11''' doleva: '''11''' 000011 '''10''' 0000000 (u+00C0) nebo '''11''' 000101 '''10''' 100000 (u+0160). ## Převeďte oktety do hexadecimálního formátu, přidejte procenta na začátek, hotovo: %C3%80 (u+00C0) nebo %C5%A0 (u+0160). # Pokud první (levá) ze dvou skupin začíná číslem 1: #: Přičtěte '''111''' 00000 '''10''' doleva, poté procentuálně kódujte tři oktety, %E0%??%?? # Pokud existují tři skupiny, první (levá) začínající na 00 (000001 až 001111): #: Nahraďte 00 hodnotou '''111''' 0, zakódujte tři oktety v procentech, připraveno, výsledek %E?%??%??. # Jinak je to nejméně 010000 000000 000000 (u+10000), který potřebuje '''čtyři''' oktety UTF-8: #: '''1111''' 0000 '''10''' 010000 '''10''' 000000 '''10''' 000000 by byl %F0%90%80%80. <span id="URLs_of_pages_within_the_projects"></span> == URL adresy stránek v rámci projektů == Viz [[w:Wikipedia:URLs]]. Na jiných projektech funguje vše stejně, až na to, že se liší názvy domén: *xx.wikipedia.org s kódem jazyka xx, viz [[m:Complete list of language Wikipedias available|Kompletní seznam dostupných Wikipedií v daných jazycích]] v Meta-wiki *meta.wikimedia.org (přesměrování na meta.wikipedia.org) *xx.wiktionary.org *xx.wikiquote.org *xx.wikibooks.org *xx.wikisource.org *sep11.wikipedia.org URL začínající na www.wikipedia.org přesměrovává na odpovídající URL začínající na en. Pouze samotná adresa www.wikipedia.org vede na portálovou stránku místo na hlavní stránku anglické Wikipedie: https://www.wikipedia.org V projektech mimo Wikimedii se "w/" v URL adresách, jako je https://www.wikipedia.org/w/wiki.phtml?title=Main_Page&action=history, někdy nepoužívá, někdy se používá jinak, např.: * https://www.sourcewatch.org/index.php?title=SourceWatch&action=history * https://wikitravel.org/en/index.php?title=Main_Page&action=history <span id="Use_in_templates"></span> === Použití v šablonách === Pro použití v šablonách je třeba mít na paměti, že všechny URL adresy např. na anglické Wikipedii lze zapsat ve tvaru: <code><nowiki>https://</nowiki>en.wikipedia.org/w/index.php?title={{{1}}}</code> To vyžaduje, aby byl <code><nowiki>{{{1}}}</nowiki></code> zapsán s podtržítky a escape kódy (pokud existují), nebo může být escapován pomocí [[#Parser_function_urlencode|urlencode]] jako <code><nowiki>{{urlencode:{{{1}}}}}</nowiki></code>. Aby bylo možné využít konverze provedené magickým slovem ''[[Special:MyLanguage/Help:Magic_words#URL data|fullurl]]'', jsou potřeba dva parametry: <code><nowiki>{{fullurl:{{{1}}}|{{{2}}}}}</nowiki></code> (viz šablona [[m:Template discuss:Url 2p|Url 2p]] na meta). Příklad s druhým parametrem ve fullurl fixed je {{tiw|ed}} obsahující odkaz <code><nowiki>[{{fullurl:Template:{{{1}}}|action=edit}} {{MediaWiki:Edit}} {{{2|{{{1}}}}}}].</nowiki></code> Toto funguje pro odkaz ve stylu externího odkazu na stránku ve stejném projektu. Localurl můžeme použít pro odkaz na projekt, který používá stejný řetězec v URL mezi názvem serveru a otazníkem ([[Special:MyLanguage/Manual:$wgScript|$wgScript]], na Wikimedii "<code><nowiki>/w/index.php</nowiki></code>"), ale ne pro odkazy na jiné projekty. <span id="Old_versions_of_pages"></span> == Starší verze stránek == Všechny staré verze všech stránek jsou číslovány (s [[Special:MyLanguage/Manual:Old_table|oldid]]) přibližně v pořadí, v jakém se stávají starou verzí, tj. v chronologickém pořadí od další úpravy stejné stránky. * https://www.mediawiki.org/w/index.php?title=Help:Link&oldid=53587 - normální odkaz na starou stránku * https://www.mediawiki.org/w/index.php?oldid=53587 - v URL adrese není uveden název stránky, vede na správnou stránku * https://www.mediawiki.org/w/index.php?title=Help:Link&oldid=53588 - číslo a název se neshodují. Název je ignorován * https://www.mediawiki.org/w/index.php?title=abc&oldid=53587 - název neexistující stránky. oldid je ignorováno, funguje jako přechod na neexistující stránku, s výjimkou odkazů na předpokládané předchozí a následující verze a při úpravách pro upozornění na úpravu staré verze stránky. Viz také [[Special:MyLanguage/Help:Page history#Linking_to_a_specific_version_of_a_page|Odkazování na konkrétní verze stránky]]. <span id="New_pages"></span> == Nové stránky == Stránky jsou číslovány pomocí page_id (viz {{ll|Manual:page table}}) v pořadí, v jakém byly vytvořeny. *https://www.mediawiki.org/w/index.php?title=x&curid=9906 - vrátí stránku se správným celým názvem Naopak většina výstupů z [[Special:MyLanguage/API:query|Query API]] poskytuje názvy stránek i jejich ID, např. https://meta.wikimedia.org/w/query.php?titles=Hilfe:Zeitleiste Verze stránek získají číslo "oldid" ihned po vytvoření. Jsou generovány proměnnou <nowiki>{{REVISIONID}}</nowiki>. URL adresa je stejná jako v předchozí části. <span id="Edit"></span> == Úpravy == Příklady: * Upravit celou stránku: https://www.mediawiki.org/w/index.php?title=Help:URL&action=edit * Upravit 5. část: https://www.mediawiki.org//wiki/Help:URL?action=edit&section=5 * Přidat na konec: https://www.mediawiki.org//w/wiki.phtml?title=Help:URL&action=edit&section=new <span id="Purge"></span> == Vyčištění == V některých případech problémů s ukládáním do mezipaměti může pro aktualizaci stránky pomoci použití parametru <code>action=purge</code> v URL adrese, například <pre>{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAMEE}}|action=purge}}</pre> což má za následek: <code>{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAMEE}}|action=purge}}</code> <span id="Parameter_uselang"></span> == Parametr uselang == V některých případech je užitečné propojení s jiným projektem Wikimedie pomocí parametru "&uselang" v URL adrese, například https://commons.wikimedia.org/w/index.php?title=Glavna_stran&uselang=sl. Toto umožňuje specifikovat jazyk (zde 'sl' pro slovenštinu) zpráv rozhraní, které se zobrazí při otevření stránky 'Glavna stran' v projektu Commons. <span id="Miscellaneous_actions"></span> == Různé akce == Nezpracovaný wikitext stránky můžete načíst pomocí URL adresy, jako je <pre>{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAMEE}}|action=raw}}</pre> což má za následek: <code>{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAMEE}}|action=raw}}</code> Další akce jsou <code>view</code>, <code>watch</code>, <code>unwatch</code>, <code>delete</code>, <code>revert</code>, <code>rollback</code>, <code>unprotect</code>, <code>info</code>, <code>markpatrolled</code>, <code>validate</code>, <code>render</code>, <code>deletetrackback</code>, <code>history</code>. (Tyto parametry je zřídka nutné zadávat explicitně, protože ty užitečné jsou předem propojeny na různých kartách a tlačítkách. Některé z těchto akcí vyžadují administrátorská oprávnění. Ostatní uživatelé odkaz nemají. Pokud se pokusí zadat URL, zobrazí se jim chyba.) <span id="Kinds_of_dead_links"></span> == Druhy nefunkčních odkazů == V URL adrese se mohou vyskytovat různé druhy chyb. U některých se server ani nedostane, u jiných server provede nějakou akci. Server může také přejít na správnou stránku a jednoduše ignorovat nesprávný parametr nebo kotvu. *{{SERVER}}{{localurl:%abc}} *https://meta.wikimedia.or/ *{{SERVER}}abc *https://met.mediawiki.org *{{SERVER}}/abc *https://meta.wikimedia.org/w/index.php?title=Help:URL&action=abc *https://meta.wikimedia.org/w/index.php?title=Help:URL&act=abc *https://meta.wikimedia.org/w/index.php?title=Help:URL#abc <span id="See_also"></span> == Související odkazy == * {{ll|Manual:Parameters to index.php}} * {{ll|Help:Namespaces}} * {{ll|Manual:Short URL}} * {{wg|UrlProtocols}} ljn86xukaxwufiln2i1anpmp8n9av16 Translations:Help:URL/80/cs 1198 2181048 8364442 7572872 2026-05-03T15:31:19Z Rebulka 17532855 8364442 wikitext text/x-wiki ''cíl'' 3op0urmlt27tbonyg9qh3hq191o6a8r Translations:Help:URL/81/cs 1198 2181052 8364444 7572880 2026-05-03T15:31:29Z Rebulka 17532855 8364444 wikitext text/x-wiki [ ''cíl'' ] 7ow17vpnkpv44mcbo6f66moqwu6ehba User:Serhio Magpie/instantDiffs.test.js 2 2203063 8365080 8364126 2026-05-04T08:14:10Z Serhio Magpie 1775170 [ee41ec7] [v5.4.0+build.3]: Updated from repository. 8365080 javascript text/javascript /** * Instant Diffs * * Version: 5.4.0+build.3 * Author: Serhio Magpie * Licenses: (MIT OR CC-BY-SA-4.0) * Documentation: https://www.mediawiki.org/wiki/Instant_Diffs * * For license information please see: https://www.mediawiki.org/wiki/User:Serhio_Magpie/instantDiffs.js.LEGAL.txt */ /* <nowiki> */ (()=>{var Rn=Object.create;var Ye=Object.defineProperty;var Wn=Object.getOwnPropertyDescriptor;var Nn=Object.getOwnPropertyNames;var Fn=Object.getPrototypeOf,Vn=Object.prototype.hasOwnProperty;var gs=i=>e=>{var t=i[e];if(t)return t();throw new Error("Module not found in bundle: "+e)};var m=(i,e)=>()=>(i&&(e=i(i=0)),e);var re=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),_=(i,e)=>{for(var t in e)Ye(i,t,{get:e[t],enumerable:!0})},ms=(i,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Nn(e))!Vn.call(i,n)&&n!==t&&Ye(i,n,{get:()=>e[n],enumerable:!(s=Wn(e,n))||s.enumerable});return i};var jn=(i,e,t)=>(t=i!=null?Rn(Fn(i)):{},ms(e||!i||!i.__esModule?Ye(t,"default",{value:i,enumerable:!0}):t,i)),De=i=>ms(Ye({},"__esModule",{value:!0}),i);var qn,o,P=m(()=>{self.instantDiffs||={};qn=self.instantDiffs,o=qn});var ks=re((Zo,vs)=>{vs.exports=function(e){var t=String.prototype.split,s=/()??/.exec("")[1]===e,n;return n=function(r,u,p){if(Object.prototype.toString.call(u)!=="[object RegExp]")return t.call(r,u,p);var f=[],g=(u.ignoreCase?"i":"")+(u.multiline?"m":"")+(u.extended?"x":"")+(u.sticky?"y":""),S=0,u=new RegExp(u.source,g+"g"),v,y,oe,ps;for(r+="",s||(v=new RegExp("^"+u.source+"$(?!\\s)",g)),p=p===e?-1>>>0:p>>>0;(y=u.exec(r))&&(oe=y.index+y[0].length,!(oe>S&&(f.push(r.slice(S,y.index)),!s&&y.length>1&&y[0].replace(v,function(){for(var Je=1;Je<arguments.length-2;Je++)arguments[Je]===e&&(y[Je]=e)}),y.length>1&&y.index<r.length&&Array.prototype.push.apply(f,y.slice(1)),ps=y[0].length,S=oe,f.length>=p)));)u.lastIndex===y.index&&u.lastIndex++;return S===r.length?(ps||!u.test(""))&&f.push(""):f.push(r.slice(S)),f.length>p?f.slice(0,p):f},n}()});var xs=re((er,ys)=>{var Bn=[].indexOf;ys.exports=function(i,e){if(Bn)return i.indexOf(e);for(var t=0;t<i.length;++t)if(i[t]===e)return t;return-1}});var jt=re((tr,Ds)=>{var Vt=xs();Ds.exports=Un;function Un(i){var e=i.classList;if(e)return e;var t={add:s,remove:n,contains:r,toggle:c,toString:p,length:0,item:f};return t;function s(u){var v=g();Vt(v,u)>-1||(v.push(u),S(v))}function n(u){var v=g(),y=Vt(v,u);y!==-1&&(v.splice(y,1),S(v))}function r(u){return Vt(g(),u)>-1}function c(u){return r(u)?(n(u),!1):(s(u),!0)}function p(){return i.className}function f(u){var v=g();return v[u]||null}function g(){var u=i.className;return Hn(u.split(" "),_n)}function S(u){var v=u.length;i.className=u.join(" "),t.length=v;for(var y=0;y<u.length;y++)t[y]=u[y];delete u[v]}}function Hn(i,e){for(var t=[],s=0;s<i.length;s++)e(i[s])&&t.push(i[s]);return t}function _n(i){return!!i}});var Ss=re((ir,Ls)=>{var Gn={className:"class",htmlFor:"for"},zn={accept:new Set(["form","input"]),"accept-charset":new Set(["form"]),accesskey:"GLOBAL",action:new Set(["form"]),align:new Set(["applet","caption","col","colgroup","hr","iframe","img","table","tbody","td","tfoot","th","thead","tr"]),alt:new Set(["applet","area","img","input"]),async:new Set(["script"]),autocomplete:new Set(["form","input"]),autofocus:new Set(["button","input","keygen","select","textarea"]),autoplay:new Set(["audio","video"]),autosave:new Set(["input"]),bgcolor:new Set(["body","col","colgroup","marquee","table","tbody","tfoot","td","th","tr"]),border:new Set(["img","object","table"]),buffered:new Set(["audio","video"]),challenge:new Set(["keygen"]),charset:new Set(["meta","script"]),checked:new Set(["command","input"]),cite:new Set(["blockquote","del","ins","q"]),class:"GLOBAL",code:new Set(["applet"]),codebase:new Set(["applet"]),color:new Set(["basefont","font","hr"]),cols:new Set(["textarea"]),colspan:new Set(["td","th"]),content:new Set(["meta"]),contenteditable:"GLOBAL",contextmenu:"GLOBAL",controls:new Set(["audio","video"]),coords:new Set(["area"]),data:new Set(["object"]),datetime:new Set(["del","ins","time"]),default:new Set(["track"]),defer:new Set(["script"]),dir:"GLOBAL",dirname:new Set(["input","textarea"]),disabled:new Set(["button","command","fieldset","input","keygen","optgroup","option","select","textarea"]),download:new Set(["a","area"]),draggable:"GLOBAL",dropzone:"GLOBAL",enctype:new Set(["form"]),for:new Set(["label","output"]),form:new Set(["button","fieldset","input","keygen","label","meter","object","output","progress","select","textarea"]),formaction:new Set(["input","button"]),headers:new Set(["td","th"]),height:new Set(["canvas","embed","iframe","img","input","object","video"]),hidden:"GLOBAL",high:new Set(["meter"]),href:new Set(["a","area","base","link"]),hreflang:new Set(["a","area","link"]),"http-equiv":new Set(["meta"]),icon:new Set(["command"]),id:"GLOBAL",ismap:new Set(["img"]),itemprop:"GLOBAL",keytype:new Set(["keygen"]),kind:new Set(["track"]),label:new Set(["track"]),lang:"GLOBAL",language:new Set(["script"]),list:new Set(["input"]),loop:new Set(["audio","bgsound","marquee","video"]),low:new Set(["meter"]),manifest:new Set(["html"]),max:new Set(["input","meter","progress"]),maxlength:new Set(["input","textarea"]),maxlength:new Set(["input","textarea"]),media:new Set(["a","area","link","source","style"]),method:new Set(["form"]),min:new Set(["input","meter"]),multiple:new Set(["input","select"]),muted:new Set(["video"]),name:new Set(["button","form","fieldset","iframe","input","keygen","object","output","select","textarea","map","meta","param"]),novalidate:new Set(["form"]),open:new Set(["details"]),optimum:new Set(["meter"]),pattern:new Set(["input"]),ping:new Set(["a","area"]),placeholder:new Set(["input","textarea"]),poster:new Set(["video"]),preload:new Set(["audio","video"]),radiogroup:new Set(["command"]),readonly:new Set(["input","textarea"]),rel:new Set(["a","area","link"]),required:new Set(["input","select","textarea"]),reversed:new Set(["ol"]),rows:new Set(["textarea"]),rowspan:new Set(["td","th"]),sandbox:new Set(["iframe"]),scope:new Set(["th"]),scoped:new Set(["style"]),seamless:new Set(["iframe"]),selected:new Set(["option"]),shape:new Set(["a","area"]),size:new Set(["input","select"]),sizes:new Set(["img","link","source"]),span:new Set(["col","colgroup"]),spellcheck:"GLOBAL",src:new Set(["audio","embed","iframe","img","input","script","source","track","video"]),srcdoc:new Set(["iframe"]),srclang:new Set(["track"]),srcset:new Set(["img"]),start:new Set(["ol"]),step:new Set(["input"]),style:"GLOBAL",summary:new Set(["table"]),tabindex:"GLOBAL",target:new Set(["a","area","base","form"]),title:"GLOBAL",type:new Set(["button","input","command","embed","object","script","source","style","menu"]),usemap:new Set(["img","input","object"]),value:new Set(["button","option","input","li","meter","progress","param"]),width:new Set(["canvas","embed","iframe","img","input","object","video"]),wrap:new Set(["textarea"])};function Kn(i,e){e=e.toLowerCase();var t=zn[i.toLowerCase()];return!!t&&(t==="GLOBAL"||t.has(e))}function Qn(i){return Gn[i]||i}Ls.exports={isStandardAttribute:Kn,propToAttr:Qn}});var Cs=re((sr,Os)=>{var Jn=jt(),Ps=Ss();function Oe(i,e){this.type=i,this.target=null,Object.keys(e||{}).forEach(function(t){this[t]=e[t]},this)}Oe.prototype.preventDefault=function(){};Oe.prototype.stopPropagation=function(){};Oe.prototype.stopImmediatePropagation=function(){};function $s(i,e){this._eventListeners=this._eventListeners||{},this._eventListeners[i]=this._eventListeners[i]||[];var t=this._eventListeners[i];t.indexOf(e)===-1&&t.push(e)}function As(i,e){var t=this._eventListeners&&this._eventListeners[i];if(t){var s=t.indexOf(e);s!==-1&&t.splice(s,1)}}function Ts(i){i.target=this;var e=this._eventListeners&&this._eventListeners[i.type];return e&&e.forEach(function(t){t(i)}),!0}function ae(){}ae.prototype.createTextNode=function(i){var e=new V;return e.textContent=i,e.nodeName="#text",e.nodeType=3,e};ae.prototype.createElement=function(i){var e=new A;return e.nodeName=e.tagName=i,e};ae.prototype.createComment=function(i){var e=new G;return e.data=i,e};ae.prototype.addEventListener=$s;ae.prototype.removeEventListener=As;ae.prototype.dispatchEvent=Ts;function Ce(){}V.prototype=new Ce;A.prototype=new Ce;G.prototype=new Ce;function Me(i){this.el=i,this.styles=[]}Me.prototype.setProperty=function(i,e){this.el._setProperty(this.styles,{name:i,value:e})};Me.prototype.getProperty=function(i){return this.el._getProperty(this.styles,i)};Me.prototype.__defineGetter__("cssText",function(){var i="";return this.styles.forEach(function(e){i+=e.name+":"+e.value+";"}),i});Me.prototype.__defineSetter__("cssText",function(i){this.styles.length=0,i.split(";").forEach(function(e){var t=e.indexOf(":");if(t){var s=e.slice(0,t).trim(),n=e.slice(t+1).trim();this.setProperty(s,n)}},this)});function Yn(i,e){i&&(this.name=i,this.value=e||"")}function A(){var i=this;this.style=new Me(this),this.classList=Jn(this),this.childNodes=[],this.attributes=[],this.dataset={},this.className="",this._setProperty=function(e,t,s,n){var r=i._getProperty(e,s);if(r){r.value=String(n);return}e.push(typeof t=="function"?new t(s.toLowerCase(),String(n)):t)},this._getProperty=function(e,t){if(t){t=t.toLowerCase();for(var s=0;s<e.length;s++)if(t===e[s].name)return e[s]}}}A.prototype.nodeType=1;A.prototype.appendChild=function(i){return i.parentElement=this,this.childNodes.push(i),i};A.prototype.setAttribute=function(i,e){i==="style"?this.style.cssText=e:this._setProperty(this.attributes,Yn,i,e)};A.prototype.getAttribute=function(i){if(i==="style")return this.style.cssText;var e=this._getProperty(this.attributes,i);return typeof e<"u"?e.value:null};A.prototype.removeAttribute=function(i){if(i==="class")delete this.className;else for(var e=0,t=this.attributes.length;e<t;e++)if(this.attributes[e].name===i){this.attributes.splice(e,1);break}};A.prototype.replaceChild=function(i,e){var t=this,s=!1;if(this.childNodes.forEach(function(n,r){n===e&&(t.childNodes[r]=i,i.parentElement=this,s=!0)}),s)return e};A.prototype.removeChild=function(i){var e=this,t=!0;if(this.childNodes.forEach(function(s,n){s===i&&(e.childNodes.splice(n,1),i.parentElement=null,t=!0)}),t)return i};A.prototype.insertBefore=function(i,e){var t=this.childNodes;if(e===null)t.push(i);else for(var s=0,n=t.length;s<n;s++){var r=t[s];if(r===e){s===0?t.unshift(i):t.splice(s,0,i);break}}return i.parentElement=this,i};A.prototype.addEventListener=$s;A.prototype.removeEventListener=As;A.prototype.dispatchEvent=Ts;A.prototype.insertAdjacentHTML=function(i,e){};A.prototype.__defineGetter__("innerHTML",function(){var i=this.childNodes.html||"";return this.childNodes.forEach(function(e){i+=e.outerHTML||e.textContent}),i});A.prototype.__defineSetter__("innerHTML",function(i){this.childNodes.length=0,this.childNodes.html=i});A.prototype.__defineGetter__("outerHTML",function(){var i=[],e=this,t={AREA:!0,BASE:!0,BR:!0,COL:!0,EMBED:!0,HR:!0,IMG:!0,INPUT:!0,KEYGEN:!0,LINK:!0,META:!0,PARAM:!0,SOURCE:!0,TRACK:!0,WBR:!0};function s(f){var g=[],S;return f.forEach(function(u){S=u.name!="style"?u.value:e.style.cssText,g.push(u.name+'="'+Es(S)+'"')}),g.length?" "+g.join(" "):""}function n(f){var g=[],S;return Object.keys(f).forEach(function(u){g.push("data-"+u+'="'+Es(f[u])+'"')}),g.length?" "+g.join(" "):""}function r(){var f=[];for(var g in e){var S=Ps.propToAttr(g);e.hasOwnProperty(g)&&["string","boolean","number"].indexOf(typeof e[g])!==-1&&Ps.isStandardAttribute(S,e.nodeName)&&c(g,S)&&f.push({name:S,value:e[g]})}return f?s(f):""}function c(f,g){return e.getAttribute(g)?!1:!(f==="className"&&!e[f])}var p=this.style.cssText?this.attributes.concat([{name:"style"}]):this.attributes;return i.push("<"+this.nodeName+r()+s(p)+n(this.dataset)+">"),t[this.nodeName.toUpperCase()]||(i.push(this.innerHTML),i.push("</"+this.nodeName+">")),i.join("")});A.prototype.__defineGetter__("textContent",function(){var i="";return this.childNodes.forEach(function(e){i+=e.textContent}),i});A.prototype.__defineSetter__("textContent",function(i){var e=new V;return e.textContent=i,this.childNodes=[e],i});function Ie(i){return String(i).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Es(i){return Ie(i).replace(/"/g,"&quot;")}A.prototype.nodeValue=null;function V(){}V.prototype.nodeType=3;V.prototype.nodeName="#text";V.prototype.__defineGetter__("textContent",function(){return Ie(this.value||"")});V.prototype.__defineSetter__("textContent",function(i){this.value=i});V.prototype.__defineGetter__("nodeValue",function(){return Ie(this.value||"")});V.prototype.__defineSetter__("nodeValue",function(i){this.value=i});V.prototype.__defineGetter__("length",function(){return(this.value||"").length});V.prototype.replaceData=function(i,e,t){this.value=this.value.slice(0,i)+t+this.value.slice(i+e)};function G(){}G.prototype.nodeType=8;G.prototype.nodeName="#comment";G.prototype.__defineGetter__("data",function(){return this.value});G.prototype.__defineSetter__("data",function(i){this.value=i});G.prototype.__defineGetter__("outerHTML",function(){return"<!--"+Ie(this.value||"")+"-->"});G.prototype.__defineGetter__("nodeValue",function(){return Ie(this.value||"")});G.prototype.__defineSetter__("nodeValue",function(i){this.value=i});function Xe(i){i.__defineGetter__("parentNode",function(){return this.parentElement})}Xe(A.prototype);Xe(G.prototype);Xe(V.prototype);Xe(Ce.prototype);Os.exports={Document:ae,Node:Ce,Element:A,Comment:G,Text:V,document:new ae,Event:Oe,CustomEvent:Oe}});var Ns=re((nr,Ws)=>{var Xn=ks(),Zn=jt(),Is=typeof window>"u"?Cs():window,Re=Is.document,eo=Is.Text;function Rs(){var i=[];function e(){var t=[].slice.call(arguments),s=null;function n(r){var c;function p(u){var v=Xn(u,/([\.#]?[^\s#.]+)/);/^\.|#/.test(v[1])&&(s=Re.createElement("div")),Ms(v,function(y){var oe=y.substring(1,y.length);y&&(s?y[0]==="."?Zn(s).add(oe):y[0]==="#"&&s.setAttribute("id",oe):s=Re.createElement(y))})}if(r!=null){if(typeof r=="string")s?s.appendChild(c=Re.createTextNode(r)):p(r);else if(typeof r=="number"||typeof r=="boolean"||r instanceof Date||r instanceof RegExp)s.appendChild(c=Re.createTextNode(r.toString()));else if(io(r))Ms(r,n);else if(qt(r))s.appendChild(c=r);else if(r instanceof eo)s.appendChild(c=r);else if(typeof r=="object")for(var f in r)if(typeof r[f]=="function")/^on\w+/.test(f)?function(u,v){s.addEventListener?(s.addEventListener(u.substring(2),v[u],!1),i.push(function(){s.removeEventListener(u.substring(2),v[u],!1)})):(s.attachEvent(u,v[u]),i.push(function(){s.detachEvent(u,v[u])}))}(f,r):(s[f]=r[f](),i.push(r[f](function(u){s[f]=u})));else if(f==="style")if(typeof r[f]=="string")s.style.cssText=r[f];else for(var g in r[f])(function(u,v){if(typeof v=="function")s.style.setProperty(u,v()),i.push(v(function(oe){s.style.setProperty(u,oe)}));else var y=r[f][u].match(/(.*)\W+!important\W*$/);y?s.style.setProperty(u,y[1],"important"):s.style.setProperty(u,r[f][u])})(g,r[f][g]);else if(f==="attrs")for(var S in r[f])s.setAttribute(S,r[f][S]);else f.substr(0,5)==="data-"?s.setAttribute(f,r[f]):s[f]=r[f];else if(typeof r=="function"){var S=r();s.appendChild(c=qt(S)?S:Re.createTextNode(S)),i.push(r(function(v){qt(v)&&c.parentElement?(c.parentElement.replaceChild(v,c),c=v):c.textContent=v}))}}return c}for(;t.length;)n(t.shift());return s}return e.cleanup=function(){for(var t=0;t<i.length;t++)i[t]();i.length=0},e}var to=Ws.exports=Rs();to.context=Rs;function qt(i){return i&&i.nodeName&&i.nodeType}function Ms(i,e){if(i.forEach)return i.forEach(e);for(var t=0;t<i.length;t++)e(i[t],t)}function io(i){return Object.prototype.toString.call(i)=="[object Array]"}});var Bt,W,le=m(()=>{x();X();O();B();Bt=class{static utils=et;options={};values={type:null,typeVariant:null,hostname:location.hostname};mw={serverName:mw.config.get("wgServerName"),mobileServerName:mw.config.get("wgMobileServerName")};isValid=!1;isForeign=!1;isHidden=!1;constructor(e,t){this.options={fixTenet:!0,...t},T(e)||this.set(e)}set(e){this.values={...this.values,...this.validateValues(e)},this.isValid=this.validate(),this.process()}setValue(e,t){this.values[e]=t}setValues(e){for(let[t,s]of Object.entries(e))this.setValue(t,s)}get(e){return this.values[e]}getValues(){return this.values}getMW(e){return this.mw[e]}validateValues(e){return!a(e.diff)&&R(e.diff)&&e.diff.indexOf("|")>-1&&(e.diff=e.diff.split("|").shift()),!a(e.oldid)&&R(e.oldid)&&e.oldid.indexOf("|")>-1&&(e.oldid=e.oldid.split("|").shift()),!a(e.curid)&&R(e.curid)&&e.curid.indexOf("|")>-1&&(e.curid=e.curid.split("|").shift()),[0,"0"].includes(e.oldid)&&delete e.oldid,[0,"0","current","latest"].includes(e.diff)&&(e.diff="cur"),M(e.direction)||(e.direction="prev"),a(e.hash)||(e.hash=mw.util.percentDecodeFragment(e.hash),e.hash&&(e.hash=e.hash.replace(/^#/,""))),a(e.section)||(e.section=e.section.replace(/^#/,"")),e}validate(){if(Ze(this.values.title)==="Special:ComparePages"&&(!a(this.values.page1)||h(this.values.rev1))&&(!a(this.values.page2)||h(this.values.rev2)))return this.options.fixTenet=!1,this.values.type="diff",this.values.typeVariant="comparePages",!0;if(Ze(this.values.title)==="Special:Undelete")return this.values.type="diff",this.values.typeVariant="undelete",!1;if(h(this.values.oldid)&&a(this.values.diff))return this.values.type="revision",!0;if(h(this.values.diff)||h(this.values.oldid)){if(this.values.type="diff",a(this.values.title)&&M(this.values.oldid)){let e=this.values.oldid;this.values.oldid=this.values.diff,this.values.diff=e}if(a(this.values.oldid)&&(this.values.oldid=this.values.diff,this.values.diff=this.values.direction),this.options.fixTenet&&h(this.values.oldid)&&h(this.values.diff)&&parseInt(this.values.oldid)>parseInt(this.values.diff)){let e=this.values.oldid;this.values.oldid=this.values.diff,this.values.diff=e}return!0}return!a(this.values.title)&&M(this.values.diff)?(this.values.type="diff",!0):h(this.values.curid)?(this.values.type="revision",this.values.typeVariant="page",!0):!1}process(){this.values.revid=Ut(this),a(this.values.hostname)||this.setHostname(),a(this.values.title)||this.setTitle(),(!a(this.values.page1)||!a(this.values.page2))&&this.setComparePages()}setHostname(){let{general:e}=w.siteInfoAliases[this.values.hostname]||{};T(e)?(this.mw.serverName=this.values.hostname,this.mw.mobileServerName=this.values.hostname):(this.values.hostname=ge()&&!a(e.mobileservername)?e.mobileservername:e.servername,this.mw.serverName=e.servername,this.mw.mobileServerName=e.mobileservername),this.mw.endPoint=`https://${this.values.hostname}${mw.util.wikiScript("index")}`,this.mw.endPointUrl=new URL(this.mw.endPoint),this.isForeign=Z(this.values.hostname)}setTitle(){a(this.values.origTitle)&&(this.values.origTitle=this.values.title);try{this.mw.title=new mw.Title(this.values.title),this.values.title=this.mw.title.getPrefixedDb(),this.values.titleText=this.mw.title.getPrefixedText()}catch{}l.get("linksHash")&&!a(this.values.section)&&(this.values.titleSection=[this.values.title,this.values.section].join("#"),this.values.titleTextSection=[this.values.titleText,this.values.section].join("#")),this.values.href=mw.util.getUrl(this.values.titleSection||this.values.title),this.isForeign&&(this.values.href=U(this,this.values.href))}setComparePages(){try{this.mw.page1=new mw.Title(this.values.page1),this.values.page1=this.mw.page1.getPrefixedDb(),this.values.page1Text=this.mw.page1.getPrefixedText()}catch{}try{this.mw.page2=new mw.Title(this.values.page2),this.values.page2=this.mw.page2.getPrefixedDb(),this.values.page2Text=this.mw.page2.getPrefixedText()}catch{}}},W=Bt});var Ht,w,B=m(()=>{P();x();Le();O();le();Ht=class{static utils=Gt;static api;static foreignApi={};static getApi(e){let t=e instanceof W?e.get("hostname"):e;if(!Z(t))return this.api||(this.api=new mw.Api),this.api;if(!this.foreignApi[t]){let s=`https://${t}${mw.util.wikiScript("api")}`;this.foreignApi[t]=new mw.ForeignApi(s)}return this.foreignApi[t]}static get(e,t){return this.getApi(t).get(e)}static post(e,t){return this.getApi(t).post(e)}static postWithToken(e,t,s){return this.getApi(s).postWithToken(e,t)}static watch(e,t,s){return this.getApi(s).watch(e,t)}static unwatch(e,t){return this.getApi(t).unwatch(e)}static notifyError(e){E("error-api-generic",{tag:"api",message:e?.message||e,silent:!0})}static getAuthToken(e){let t={action:"centralauthtoken",format:"json",formatversion:2,uselang:o.local.language};return this.get(t,e)}static loadMessage(e,t){return e=typeof e=="string"?[e]:e,e.filter(n=>!mw.message(n).exists()).length===0?$.Deferred().resolve().promise():this.getApi(t).loadMessagesIfMissing(e,{uselang:o.local.userLanguage})}static async parseWikitext(e,t){e={action:"parse",contentmodel:"wikitext",format:"json",formatversion:2,uselang:o.local.language,...e};try{let{parse:s}=await this.post(e,t);return s.text}catch(s){this.notifyError(s)}}static async getCompare(e,t,s){e={action:"compare",prop:["title","ids","timestamp","comment"],format:"json",formatversion:2,uselang:o.local.userLanguage,...e};let n=s||this;try{return(await n.get(e,t)).compare}catch(r){this.notifyError(r)}}static async getPageInfo(e,t,s){let n=o.local.userLanguage;e={action:"query",prop:["info","pageprops","entityterms"],inprop:["watched","notificationtimestamp"],wbetterms:["label"],wbetlanguage:n,intestactions:["edit"],format:"json",formatversion:2,uselang:n,...e};let r=s||this;try{return(await r.get(e,t)).query.pages[0]}catch(c){this.notifyError(c)}}static async markAsSeen(e,t){e={action:"setnotificationtimestamp",redirects:1,format:"json",formatversion:2,uselang:o.local.userLanguage,...e};try{return(await this.postWithToken("csrf",e,t)).setnotificationtimestamp[0].notificationtimestamp}catch(s){this.notifyError(s)}}static siteInfo={};static siteInfoAliases={};static async getSiteInfo(e=[],t,s){let n=t instanceof W?t.get("hostname"):t;if(a(n)&&(n=mw.config.get("wgServerName")),!We()&&T(this.siteInfo)&&(this.siteInfo=mw.storage.getObject(`${o.config.prefix}-siteInfo`)||{},this.processSiteInfo()),!T(this.siteInfoAliases[n])||!T(this.siteInfo[n]))return this.siteInfoAliases[n]||this.siteInfo[n];let r={action:"query",meta:"siteinfo",siprop:e,format:"json",formatversion:2,uselang:o.local.userLanguage},c=s||this;try{let{query:p}=await c.get(r,n);this.siteInfo[n]||(this.siteInfo[n]={});for(let[f,g]of Object.entries(p))this.siteInfo[n][f]=g;return mw.storage.setObject(`${o.config.prefix}-siteInfo`,this.siteInfo,l.get("storageExpiry")),this.processSiteInfoAliases(this.siteInfo[n]),this.siteInfo[n]}catch(p){this.notifyError(p)}}static processSiteInfo(){if(!T(this.siteInfo))for(let e of Object.values(this.siteInfo))this.processSiteInfoAliases(e)}static processSiteInfoAliases(e){T(e?.general)||(this.siteInfoAliases[e.general.servername]=e,a(e.general.mobileserver)||(e.general.mobileservername=K("hostname",e.general.mobileserver),this.siteInfoAliases[e.general.mobileservername]=e))}static specialPages={};static specialPagesLocal={};static async getSpecialPages(e){if(T(this.specialPages)&&o.config.specialPages.forEach(s=>{this.specialPages[s]=s}),!We()&&T(this.specialPagesLocal)&&(this.specialPagesLocal=mw.storage.getObject(`${o.config.prefix}-specialPagesLocal`)||{}),!T(this.specialPagesLocal))return this.specialPagesLocal;for(let[s,n]of Object.entries(this.specialPages))this.specialPagesLocal[s]=n;let t={action:"query",titles:o.config.specialPages,format:"json",formatversion:2,uselang:mw.config.get("wgContentLanguage")};try{let{query:s}=await this.get(t,e);return s.normalized&&s.normalized.forEach(n=>{this.specialPagesLocal[n.from]=n.to}),mw.storage.setObject(`${o.config.prefix}-specialPagesLocal`,this.specialPagesLocal,l.get("storageExpiry")),this.specialPagesLocal}catch(s){this.notifyError(s)}}static interwikiMap=[];static async getInterwikiMap(e){if(!We()&&a(this.interwikiMap)&&(this.interwikiMap=mw.storage.getObject(`${o.config.prefix}-interwikiMap`)||[]),!a(this.interwikiMap))return this.interwikiMap;let t={action:"query",meta:"siteinfo",siprop:"interwikimap",format:"json",formatversion:2,uselang:o.local.userLanguage};try{let{query:s}=await this.get(t,e);return this.interwikiMap=s.interwikimap,mw.storage.setObject(`${o.config.prefix}-interwikiMap`,this.interwikiMap,l.get("storageExpiry")),this.interwikiMap}catch(s){this.notifyError(s)}}static async getWBLabel(e,t,s){if(!_t(e))return;let n=o.local.userLanguage,r={action:"wbgetentities",props:"labels",ids:e,languages:n,languagefallback:1,format:"json",formatversion:2,uselang:n},c=s||this;try{let{entities:p}=await c.get(r,t),f=p[e];return f.type==="lexeme"?Object.values(f.lemmas).map(g=>g.value).join("/"):f.labels[n].value}catch(p){this.notifyError(p)}}},w=Ht});var Gt={};_(Gt,{getEntitySchemaLabel:()=>Qt,getNamespaceConfig:()=>zt,getWikilambdaLabel:()=>Jt,isEditableContentModel:()=>Kt,isProbablyWbTitle:()=>_t,isWbContentModel:()=>me});function zt(i){let e=w.siteInfoAliases[i];if(!T(e))return{wgFormattedNamespaces:Object.values(e.namespaces).reduce((t,s)=>(t[s.id]=s.canonical||"",t),{}),wgNamespaceIds:{...Object.values(e.namespaces).reduce((t,s)=>(t[tt(s.name.toLowerCase())]=s.id,s.canonical&&(t[tt(s.canonical.toLowerCase())]=s.id),t),{}),...e.namespacealiases.reduce((t,s)=>(t[s.alias.toLowerCase()]=s.id,t),{})},wgCaseSensitiveNamespaces:Object.values(e.namespaces).filter(t=>t.case==="case-sensitive").map(t=>t.id),wgContentNamespaces:Object.values(e.namespaces).filter(t=>t.content).map(t=>t.id)}}function _t(i){return!a(i)&&/^[QPL][0-9]+$/.test(i)}function me(i){return!a(i)&&i.includes("wikibase")}function Kt(i){return!o.config.nonEditableContentModels.includes(i)}function Qt(i){return $(i).find(".entityschema-title-label").text()}function Jt(i){return!T(i)&&(i[`wikilambda-label-${o.local.userLanguage}`]||i["wikilambda-label-en"])}var Le=m(()=>{P();x();B()});var et={};_(et,{addLinkTags:()=>ti,getDependencies:()=>Yt,getForeignDependencies:()=>Xt,getHref:()=>N,getHrefAbsolute:()=>U,getRevID:()=>Ut,getWikilink:()=>si,loadForeignDependencies:()=>Zt,loadForeignStylesDependencies:()=>ei,removeLinkTags:()=>ii});function Ut(i){let e=i.getValues();if(h(e.revid))return e.revid;if(e.type==="revision"&&h(e.oldid)&&(!M(e.direction)||e.direction==="prev"))return e.oldid;if(e.type==="diff"){if(h(e.oldid)&&h(e.diff))return Math.max(e.oldid,e.diff);if(h(e.oldid)){if(!M(e.diff)||e.diff==="prev")return e.oldid}else if(h(e.diff)&&(!M(e.oldid)||e.oldid==="prev"))return e.diff}return!1}function Yt(i){let e=[],t=o.config.dependencies.page;t&&(e=e.concat(Se(i,t)));let s=o.config.dependencies[i.get("type")];s&&(e=e.concat(Se(i,s)));let n=o.config.dependencies.skins[mw.config.get("skin")];return n&&(e=e.concat(Se(i,n))),e}function Se(i,e){let t=[];if(a(e))return t;z(e["*"])&&(t=t.concat(e["*"]));let s=i.getMW("title")?.getNamespaceId();return z(e[s])&&(t=t.concat(e[s])),t}function Xt(i){let e=[],t=[],s=[],n=o.config.foreignDependencies[i.get("type")];if(n){if(e=e.concat(Se(i,n)),t=t.concat(Se(i,n.styles)),me(mw.config.get("wgPageContentModel"))){let r=n.wikibase;r&&(e=e.concat(Se(i,r)),t=t.concat(r.styles.all,ge()?r.styles.mobile:r.styles.desktop))}s=s.concat(so(i,n.links))}return{modules:e,styles:t,links:s}}function so(i,e){let t=[];if(a(e))return t;z(e["*"])&&(t=t.concat(e["*"].map(n=>Fs(i,n))));let s=i.getMW("title")?.getNamespaceId();return z(e[s])&&(t=t.concat(e[s].map(n=>Fs(i,n)))),t}function Zt(i,e){let t=it(e),s=i.get("hostname"),n=mw.util.wikiScript("load"),r=$.param({modules:t.join("|"),skin:mw.config.get("skin")});mw.loader.load(`https://${s}${n}?${r}`)}function ei(i,e){let t=it(e),s=i.get("hostname"),n=mw.util.wikiScript("load"),r=$.param({modules:t.join("|"),only:"styles",skin:mw.config.get("skin")});mw.loader.load(`https://${s}${n}?${r}`,"text/css")}function ti(i){if(!a(i))return i.map(e=>mw.loader.addLinkTag?.(e))}function ii(i){a(i)||i.forEach(e=>e?.remove())}async function si(i){let e={relative:!1,hash:l.get("linksHash"),minify:l.get("linksFormat")==="minify",wikilink:!0,wikilinkPreset:l.get("wikilinksFormat")};if(i.isForeign){let t=await w.getInterwikiMap();t&&(e.interwiki=t.filter(s=>s.url.includes(i.getMW("serverName"))).reduce((s,n)=>!s||s.prefix.length>n.prefix.length?n:s))}return N(i,{},e)}function N(i,e,t){i instanceof W||(i=new W(i)),e={...e},t={type:null,...t};let s={...i.getValues()};return t.type||(s.type==="revision"&&s.typeVariant==="page"?t.type="page":t.type=s.type),t.type==="diff"&&(a(s.diff)&&M(s.direction)&&(s.diff=s.direction),h(s.oldid)&&h(s.diff)?(e.oldid=s.oldid,e.diff=s.diff):h(s.revid)?e.diff=s.revid:h(s.oldid)?M(s.diff)&&s.diff!=="prev"?(e.oldid=s.oldid,e.diff=s.diff):e.diff=s.oldid:h(s.diff)&&(M(s.oldid)&&s.oldid!=="prev"?(e.oldid=s.diff,e.diff=s.oldid):e.diff=s.diff)),t.type==="revision"&&(a(s.direction)&&M(s.diff)&&(s.direction=s.diff),h(s.revid)?e.oldid=s.revid:h(s.oldid)&&(e.oldid=s.oldid,M(s.direction)&&s.direction==="next"&&(e.direction=s.direction))),t.type==="page"&&(e.curid=s.curid),no(i,e,t)}function U(i,e){let t=i?.mw.endPointUrl||o.local.mwEndPointUrl;try{return new URL(e,t.origin).toString()}catch{return e}}function no(i,e,t){e={...e},t={type:"diff",relative:!0,hash:!1,minify:!1,interwiki:null,wikilink:!1,wikilinkPreset:null,...t},Z(i.get("hostname"))&&(t.relative=!1);let s=i.getMW("endPointUrl")||o.local.mwEndPointUrl,n;if(a(i.get("title"))?(n=new URL(s),n.search=new URLSearchParams(e).toString()):n=new URL(mw.util.getUrl(i.get("title"),e),s.origin),t.hash&&!a(i.get("section"))){let r=mw.util.escapeIdForLink(i.get("section"));r&&(n.hash=`#${r}`)}return t.minify&&(n.pathname="",n.hash="",n.searchParams.delete("title")),t.href=decodeURIComponent(t.relative?n.pathname+n.search+n.hash:n.toString()),t.hash=decodeURIComponent(n.hash),t.wikilink?oo(i,e,t):t.href}function oo(i,e,t){e={...e},t={href:null,hash:null,type:"diff",minify:!1,relative:!0,interwiki:null,wikilink:!0,wikilinkPreset:"special",...t};let s=null;!a(e.oldid)&&!a(e.diff)?s=`${e.oldid}/${e.diff}`:a(e.oldid)?a(e.diff)?a(e.curid)||(s=e.curid):s=e.diff:s=e.oldid,a(t.hash)||(s=`${s}${t.hash}`);let r=(o.config.wikilinkPresets[t.wikilinkPreset]||o.config.wikilinkPresets.special)[t.type],c=t.interwiki?.prefix;return r.replace("$1",s).replace("$pref",c?`${c}:`:"").replace("$href",t.href).replace("$msg",d(`copy-wikilink-${t.type}`))}function Fs(i,e){let t=mw.util.getUrl(e,{action:"raw",ctype:"text/css"});return i.isForeign?U(i,t):t}var X=m(()=>{P();x();Le();B();le();O()});function H(i){let e=Object.getPrototypeOf(i);return OO.initClass(e),i.static=Object.create(e.static),Object.keys(i).filter(t=>t!=="static").forEach(t=>{i.static[t]=i[t]}),i.parent=i.super=e,i}function ni(i){let e={prototype:{}};OO.mixinClass(e,OO.EventEmitter),Object.assign(i,e.prototype),OO.EventEmitter.call(i)}function st(){k(OO.ui.RadioSelectWidget.prototype.findFirstSelectedItem)||(OO.ui.RadioSelectWidget.prototype.findFirstSelectedItem=function(){let i=this.findSelectedItems();return Array.isArray(i)?i[0]||null:i}),k(OO.ui.ButtonSelectWidget.prototype.findFirstSelectedItem)||(OO.ui.ButtonSelectWidget.prototype.findFirstSelectedItem=function(){let i=this.findSelectedItems();return Array.isArray(i)?i[0]||null:i}),k(OO.ui.getTeleportTarget)||(OO.ui.getTeleportTarget=function(){return document.body})}function Vs(){$(["#mw-notification-area",".mw-notification-area-overlay",".ext-checkuser-userinfocard-popover"]).each((i,e)=>{$(e).removeAttr("aria-hidden").removeAttr("inert")})}function nt(){ro();let i=new OO.ui.WindowManager;return $(OO.ui.getTeleportTarget()).append(i.$element),i}function ro(i){i=i||l.get("viewWidth")||"standard",i!=="full"&&(OO.ui.WindowManager.static.sizes.instantDiffs=L.constructor.sizes[i]||L.constructor.sizes.standard),L.isOpen&&L.dialog.setSize(oi(i))}function oi(i){return i=i||l.get("viewWidth")||"standard",i==="full"?"full":"instantDiffs"}function ot(i,e){let t=mw.loader.moduleRegistry[i],s=e.match(/^((?:\.\.?\/)+)(.*)$/);return s&&(e=`resources/src/${i}/${s[2]}`),t?.packageExports[e]}function js(i){return mw.loader.moduleRegistry[i]?.script($,jQuery,null,null)}var j=m(()=>{x();ee();O()});var li={};_(li,{getMWLine:()=>ri,getMWLineTitle:()=>ai,getSplitSpecialUrl:()=>rt,isMWLink:()=>te});function rt(i){let e=i.split("/"),t={};return o.local.specialPagesAliasesPrefixed["Special:PermanentLink"].includes(e[0])?(t.oldid=e[1],t):o.local.specialPagesAliasesPrefixed["Special:Redirect"].includes(e[0])?e[1]==="revision"?(t.oldid=e[2],t):(e[1]==="page"&&(t.curid=e[2]),t):(e.length>1&&(t.diff=e.pop()),e.length>1&&(t.oldid=e.pop()),t)}function te(i,e){let t=!1;return e=e||o.config.mwLink,e.id&&(t=e.id.some(s=>i.id===s),t)||e.hasClass&&(t=e.hasClass.some(s=>i.classList.contains(s)),t)||e.hasChild&&(t=e.hasChild.some(s=>i.querySelector(s)),t)||e.closestTo&&(t=e.closestTo.some(s=>i.closest(s))),t}function ri(i){return i.closest(o.config.mwLine.selector.join(","))}function ai(i){let e=i.dataset.title;if(!a(e))return decodeURIComponent(e);let t=o.config.mwLineTitle.selector.join(","),s=i.querySelector(t);if(s)return a(s.title)?s.innerText:s.title}var qs=m(()=>{P();x()});var ci,ie,at=m(()=>{x();ci=class{options={};node;constructor(e){this.options={node:null,tag:"button",classes:[],label:null,title:null,href:null,target:"_self",handler:null,container:null,insertMethod:"appendTo",ariaHaspopup:!1,altTitle:null,useAltKey:!1,...e},a(this.options.href)||(this.options.tag="a"),OO.EventEmitter.call(this),this.options.node?.nodeType===1?(this.node=this.options.node,this.process()):this.render()}render(){this.node=document.createElement(this.options.tag),this.node.innerText=this.options.label,this.node.classList.add(...this.options.classes),a(this.options.title)||(this.node.title=this.options.title),a(this.options.href)?(this.node.setAttribute("tabindex","0"),this.node.setAttribute("role","button")):(this.node.href=this.options.href,this.node.target=this.options.target),this.process(),this.embed(this.options.container,this.options.insertMethod)}process(){k(this.options.handler)&&(this.options.ariaHaspopup&&this.node.setAttribute("aria-haspopup","dialog"),a(this.options.altTitle)||(this.node.dataset.altTitle=this.options.altTitle),Ne(this.node,this.options.handler.bind(this),this.options.useAltKey))}embed(e,t){I(this.node,e,t)}remove(){this.node.remove()}pending(e){this.node.classList.toggle("instantDiffs-link--pending",e)}getContainer(){return this.node}},ie=ci});var Bs=m(()=>{});var Us,ao,fi,C,Ee=m(()=>{P();x();qs();B();le();at();ee();O();Bs();({h:Us,ht:ao}=b),fi=class i{static utils=li;static stack=new Map;static findLinks(e){return typeof e>"u"&&(e=$e()),e.find(o.local.linkSelector)}static addLink(e,t){this.stack.set(e,t.isValid?t:!1)}static getLink(e){return this.stack.get(e)}static hasLink(e){return this.stack.has(e)}static getLinks(){return this.stack.values()}node;options={};article;nodes={};mw={hasLink:!1,hasLine:!1};manual={behavior:"basic",options:{}};actions={};extensions={};isValid=!1;isForeign=!1;isLoading=!1;isLoaded=!1;isProcessed=!1;isObserved=!1;hasRequest=!1;constructor(e,t){this.node=e,this.options={behavior:"basic",insertMethod:"insertAfter",showLink:l.get("showLink"),showPageLink:l.get("showPageLink"),showAltTitle:!1,initiatorLink:null,initiatorPage:null,initiatorView:null,onRequest:()=>{},onLoad:()=>{},onOpen:()=>{},onClose:()=>{},...t},L.isContains(this.node)&&(this.options.initiatorView=L,this.options.initiatorPage=L.getPage()),this.process(),i.addLink(this.node,this),this.isValid&&this.render()}process(){if(this.href=this.node.href,a(this.href))return;let e={};try{this.url=new URL(this.href),e.title=this.url.searchParams.get("title"),e.pathname=decodeURIComponent(this.url.pathname),e.pathnameNormalized=e.pathname.replace(new RegExp(o.local.mwArticlePath),"")}catch{return}if(o.config.exclude.linkActions.includes(this.url.searchParams.get("action"))||te(this.node,o.config.mwLinkExclude))return;let t={hostname:this.url.hostname,hash:this.url.hash};o.local.specialPagesLinksSearchRegExp.test(e.title)?t={...t,...rt(e.title)}:o.local.specialPagesLinksPathRegExp.test(e.pathname)?t={...t,...rt(e.pathnameNormalized)}:(["title","curid","oldid","diff","direction","page1","rev1","page2","rev2"].forEach(s=>{t[s]=this.url.searchParams.get(s)}),a(t.title)&&o.local.articlePathRegExp.test(e.pathname)&&(t.title=e.pathnameNormalized)),this.article=new W(t),this.isValid=this.article.isValid,this.isForeign=this.article.isForeign}render(){switch(this.processMWOptions(),this.processManualOptions(),this.postValidateOptions(),a(this.article.get("title"))&&this.mw.hasLine&&this.article.set({title:this.mw.title}),this.options.behavior){case"event":this.renderEvent();break;case"basic":this.renderBasic();break;case"request":this.renderRequest();break}}processMWOptions(){this.mw.isContent=te(this.node,o.config.mwLinkContent),this.mw.isContent&&(this.options.behavior="request"),this.mw.hasLink=te(this.node,o.config.mwLink),this.mw.hasLink&&(this.options.behavior="basic",this.mw.isDiffOnly=te(this.node,o.config.mwLinkDiffOnly),this.mw.isPrepend=te(this.node,o.config.mwLinkPrepend),this.mw.isPrepend&&(this.options.insertMethod="insertBefore"),this.mw.isAltTitle=te(this.node,o.config.mwLinkAltTitle),this.mw.isAltTitle&&(this.options.showAltTitle=!0),this.mw.line=ri(this.node),this.mw.line&&(this.mw.hasLine=!0,this.mw.title=ai(this.mw.line),this.mw.line.classList.add("instantDiffs-line")),this.mw.isContentInside=te(this.node,o.config.mwLinkContentInside),this.mw.isContentInside&&(this.options.behavior="request"))}processManualOptions(){if(this.manual.options=this.node.dataset.instantdiffsOptions,!a(this.manual.options))try{this.manual.options=JSON.parse(this.manual.options),this.options={...this.options,...this.manual.options}}catch(e){let t={type:"link",tag:"link",message:e?.message||e,silent:!0};E("error-link-options",t)}this.manual.behavior=this.node.dataset.instantdiffsLink,a(this.manual.behavior)||(this.options.behavior=this.manual.behavior)}postValidateOptions(){let e={link:"event",default:"request"};e[this.options.behavior]&&(this.options.behavior=e[this.options.behavior]),["request","basic","event","none"].includes(this.options.behavior)||(this.options.behavior="basic"),this.options.showPageLink&&=this.options.behavior==="request"}observe(){this.isObserved||(this.isObserved=!0,o.local.interactionObserver.observe(this.node))}unobserve(){this.isObserved&&(this.isObserved=!1,o.local.interactionObserver.unobserve(this.node))}onIntersect(){this.isLoading||this.isLoaded||!this.isObserved||(this.unobserve(),this.request())}renderRequest(){this.hasRequest=this.isValid,this.hasRequest?(this.toggleSpinner(!0),this.observe()):(this.toggleSpinner(!1),this.isLoaded=!0,this.isProcessed=!1,this.unobserve())}request(){let e=this.article.get("type"),t=this.article.get("typeVariant");if(e==="revision")return this.requestRevision();if(e==="diff")return t==="comparePages"?this.requestCompare():this.requestDiff()}requestRevision(){if(this.isLoading)return;this.isLoading=!0,this.error=null;let e={action:"query",prop:"revisions",rvprop:["ids","timestamp","comment","content","user"],rvslots:"main",rvsection:0,format:"json",formatversion:2,uselang:o.local.userLanguage};return a(this.article.get("oldid"))?a(this.article.get("curid"))||(e.pageids=this.article.get("curid")):e.revids=this.article.get("oldid"),w.get(e,this.article).then(this.onRequestRevisionDone).fail(this.onRequestRevisionError)}onRequestRevisionError=(e,t)=>{this.isLoading=!1,this.error={type:"revision",tag:"link",code:a(this.article.get("curid"))?"generic":"curid",article:this.article,silent:!0},t?.error?(this.error.code=t.error.code,this.error.message=t.error.info):(this.error.message=e,E(`error-revision-${this.error.code}`,this.error)),this.renderError()};onRequestRevisionDone=e=>{this.isLoading=!1;let t=e?.query;if(!t||!t.badrevids&&!t.badpageids&&!t.pages)return this.onRequestRevisionError(void 0,e);let s=t.pages?.[0],n=s?.revisions?.[0],r={type:"revision"};if(t.badrevids?r.code="badrevids":t.badpageids?r.code="badpageids":!s||s.missing||!n?r.code="missing":s.invalid&&(r.code="invalid",r.info=s.invalidreason),r.code)return this.error=r,this.renderError();this.revision=n,this.article.set({title:s.title,section:ui(this.revision)}),this.article.isHidden=di(this.revision),this.renderSuccess()};requestDiff(){if(this.isLoading)return;this.isLoading=!0,this.error=null;let e={action:"compare",prop:["title","ids","timestamp","comment","user"],fromrev:h(this.article.get("oldid"))?this.article.get("oldid"):void 0,fromtitle:a(this.article.get("title"))?void 0:this.article.get("title"),torev:h(this.article.get("diff"))?this.article.get("diff"):void 0,torelative:M(this.article.get("diff"))?this.article.get("diff"):void 0,format:"json",formatversion:2,uselang:o.local.userLanguage};return w.get(e,this.article).then(this.onRequestDiffDone).fail(this.onRequestDiffError)}onRequestDiffError=(e,t)=>{this.isLoading=!1,this.error={type:"diff",tag:"link",article:this.article,silent:!0},t?.error?(this.error.code=t.error.code,this.error.message=t.error.info):(this.error.message=e,E("error-diff-generic",this.error)),this.renderError()};onRequestDiffDone=e=>{if(this.isLoading=!1,this.compare=e?.compare,!this.compare)return this.onRequestDiffError(null,e);this.article.set({title:ce(this.compare),section:Pe(this.compare)}),this.article.isHidden=lt(this.compare),this.renderSuccess()};requestCompare(){if(this.isLoading)return;this.isLoading=!0,this.error=null;let e=this.article.getValues(),t={action:"compare",prop:["title","ids","timestamp","comment","user"],fromrev:h(e.rev1)?e.rev1:void 0,fromtitle:a(e.page1)?void 0:e.page1,torev:h(e.rev2)?e.rev2:void 0,totitle:a(e.page2)?void 0:e.page2,format:"json",formatversion:2,uselang:o.local.userLanguage};return w.get(t,this.article).then(this.onRequestCompareDone).fail(this.onRequestCompareError)}onRequestCompareError=(e,t)=>{this.isLoading=!1,this.error={type:"diff",tag:"link",article:this.article,silent:!0},t?.error?(this.error.code=t.error.code,this.error.message=t.error.info):(this.error.message=e,E("error-diff-generic",this.error)),this.renderError()};onRequestCompareDone=e=>{if(this.isLoading=!1,this.compare=e?.compare,!this.compare)return this.onRequestCompareError(null,e);this.article.set({oldid:this.compare.fromrevid,diff:this.compare.torevid,page1:this.compare.fromtitle,page2:this.compare.totitle,title:ce(this.compare),section:Pe(this.compare)}),this.article.isHidden=lt(this.compare),this.renderSuccess()};renderEvent(){this.isValid&&(this.actions.action=new ie({node:this.node,handler:this.openDialog.bind(this),ariaHaspopup:!0}),this.renderSuccess())}renderBasic(){!this.isValid||this.mw.isDiffOnly&&this.article.get("type")!=="diff"||this.renderSuccess()}renderError(){if(this.isLoaded=!0,this.isProcessed=!1,this.toggleSpinner(!1),this.options.behavior!=="event"){this.renderWrapper();let e;this.error.type&&(e=`error-${this.error.type}-${this.error.code||"generic"}`,Fe(e)||(e=`error-${this.error.type}-generic`)),this.nodes.error=Us("span",{class:["item","error","error-info"],title:se(e,this.error,this.article)},ao(we("error"))),this.nodes.inner.append(this.nodes.error),this.embed(this.node,this.options.insertMethod)}mw.hook(`${o.config.prefix}.link.renderError`).fire(this)}renderSuccess(){this.isLoaded=!0,this.isProcessed=!0,this.toggleSpinner(!1),this.options.behavior!=="event"&&(this.renderWrapper(),this.renderLinkAction(),this.options.showPageLink&&this.renderPageAction(),this.embed(this.node,this.options.insertMethod)),mw.hook(`${o.config.prefix}.link.renderSuccess`).fire(this)}renderWrapper(){this.nodes.container=this.nodes.inner=Us("span",{class:["instantDiffs-panel","nowrap","noprint"]})}renderAction(e){return e={tag:"a",label:null,title:null,href:null,target:Ve(this.options.initiatorView),handler:null,classes:[],modifiers:[],container:this.nodes.inner,...e},e.classes=["item","text","instantDiffs-action",...e.classes],e.modifiers.forEach(t=>e.classes.push(`instantDiffs-action--${t}`)),new ie(e)}getLinkTitle(e){return this.options.showAltTitle&&!a(this.node.title)?this.node.title:(this.article.isHidden&&(e=`${e}-hidden`),d(e))}renderLinkAction(){let e=this.article.get("typeVariant")==="comparePages"?"compare-pages":this.article.get("type"),t=this.getLinkTitle(`${e}-title`);if(!this.options.showLink)return this.mutateLinkAction(t);let s=[];this.article.isHidden&&s.push("error","error-admin"),this.actions.action=this.renderAction({label:we(this.article.get("type")),title:t,classes:s,modifiers:[this.article.get("type")],handler:this.openDialog.bind(this),ariaHaspopup:!0})}mutateLinkAction(e){let t=["instantDiffs-link",`instantDiffs-link--${this.article.get("type")}`,`is-${this.options.insertMethod}`];this.article.isHidden&&t.push("instantDiffs-link--error"),this.node.classList.remove("external"),this.node.classList.add(...t),this.node.dataset.instantdiffsLink=this.options.behavior,this.actions.action=new ie({node:this.node,handler:this.openDialog.bind(this),ariaHaspopup:!0,altTitle:e,useAltKey:!0})}renderPageAction(){this.actions.page=this.renderAction({label:we("page"),title:this.article.get("titleTextSection")||this.article.get("titleText"),href:this.article.get("href"),modifiers:["page"]})}openDialog(){let e={initiatorPage:this.options.initiatorPage,onOpen:()=>this.onDialogOpen(),onClose:()=>this.onDialogClose()};if(L.setup(this,e))return this.onDialogRequest(),$.when(L.load()).always(()=>this.onDialogLoad())}onDialogRequest(){this.toggleLoader(!0),k(this.options.onRequest)&&this.options.onRequest(this)}onDialogLoad(){this.toggleLoader(!1),k(this.options.onLoad)&&this.options.onLoad(this)}onDialogOpen(){this.mw.hasLine&&l.get("highlightLine")&&this.mw.line.classList.add("instantDiffs-line--highlight"),k(this.options.onOpen)&&this.options.onOpen(this),this.options.initiatorLink instanceof i&&this.options.initiatorLink.onDialogOpen()}onDialogClose(){this.mw.hasLine&&(l.get("highlightLine")&&this.mw.line.classList.remove("instantDiffs-line--highlight"),l.get("markWatchedLine")&&o.config.changeLists.includes(mw.config.get("wgCanonicalSpecialPageName"))&&(this.mw.line.classList.remove(...o.config.mwLine.unseen),this.mw.line.classList.add(...o.config.mwLine.seen)),l.get("markWatchedLine")&&o.local.mwCanonicalSpecialPageName==="GlobalWatchlist"&&this.mw.line.classList.add("instantDiffs-line--seen")),k(this.options.onClose)&&this.options.onClose(this),this.options.initiatorLink instanceof i&&this.options.initiatorLink.onDialogClose()}toggleLoader(e){this.actions.action?this.actions.action.pending(e):this.node.classList.toggle("instantDiffs-link--pending",e)}toggleSpinner(e){let t=ct(["loader",this.article.get("type")]);e?this.node.classList.add(...t):this.node.classList.remove(...t)}embed(e,t){I(this.nodes.container,e,t)}getContainer(){return this.nodes.container}getNode(){return this.node}getInitiatorLink(){return this.options.initiatorLink||this}getArticle(){return this.article}getMW(){return this.mw}},C=fi});var hi,be,pi=m(()=>{x();Ee();hi=class i{static instance;static newInstance(e){this.instance=new i(e)}options={};link;links=[];constructor(e){this.options={filterType:null,filterMWLine:!1,...e},this.links=Array.from(C.findLinks())}setLink(e){this.link=e}hasLink(e){return e instanceof C&&this.links.includes(e.getNode())}isLinkValid(e){if(!(e instanceof C)||!(e.isValid&&(e.isProcessed||e.hasRequest&&!e.isLoaded)))return!1;let n=a(this.options.filterType)?!0:e.getArticle().get("type")===this.options.filterType,r=this.options.filterMWLine===!0?e.getMW()?.hasLine:!0;return n&&r}getLength(){return this.links.length}getIndex(){return this.link instanceof C?this.links.indexOf(this.link.getNode()):-1}getPreviousLink(e){if(typeof e>"u"&&(e=this.getIndex()),e<=0)return;let t=e-1,s=C.getLink(this.links[t]);return this.isLinkValid(s)?s:this.getPreviousLink(t)}getNextLink(e){if(typeof e>"u"&&(e=this.getIndex()),e<0||e+1>=this.getLength())return;let t=e+1,s=C.getLink(this.links[t]);return this.isLinkValid(s)?s:this.getNextLink(t)}},be=hi});var Be={};_(Be,{getUserDate:()=>je,isVisualDiffsAvailable:()=>ut,processRevisionDiffTable:()=>qe,renderDiffTable:()=>mi,renderDiffTableSide:()=>dt,renderMobileDiffFooter:()=>bi,renderUserLink:()=>wi,restoreFileMediaInfo:()=>Di,restoreInlineFormatToggle:()=>vi,restoreRollbackLink:()=>yi,restoreVisualDiffs:()=>ki,restoreWikiLambda:()=>xi});function mi(i){let e={};return e.container=D("table",{class:["diff","diff-type-table",`diff-contentalign-${mw.config.get("wgContentLanguageDir")==="rtl"?"right":"left"}`,`diff-editfont-${mw.user.options.get("editfont")}`]},D("colgroup",D("col",{class:"diff-marker"}),D("col",{class:"diff-content"}),D("col",{class:"diff-marker"}),D("col",{class:"diff-content"})),e.head=D("tbody",D("tr",{class:"diff-title",lang:o.local.userLanguage},e.deleted=D("td",{class:["diff-otitle","diff-side-deleted"],colSpan:2}),e.added=D("td",{class:["diff-ntitle","diff-side-added"],colSpan:2}))),e.body=D("tbody")),a(i)?i===""&&(e.notice=D("tr",D("td",{class:"diff-notice",colSpan:4},D("div",{class:"mw-diff-empty"},mw.msg("diff-empty")))),e.body.append(e.notice)):Si(e.body,i),e}function dt(i){i={prefix:"n",title:null,revid:null,curRevid:null,hostname:null,timestamp:null,texthidden:!1,user:null,userhidden:!1,comment:null,commenthidden:!1,...i};let e=`mw-diff-${i.prefix}title`,t=i.revid===i.curRevid?"currentrev-asof":"revisionasof",s=new W({type:"revision",title:i.title,oldid:i.revid,hostname:i.hostname});return gi(D("div",{id:`${e}1`},D("strong",i.texthidden?D("span",{class:"history-deleted"},mw.msg(t,je(i.timestamp))):D("a",{href:N(s)},mw.msg(t,je(i.timestamp))))),D("div",{id:`${e}2`},i.userhidden?D("span",{class:["mw-userlink","history-deleted"]},mw.msg("rev-deleted-user")):wi(s,i.user)),D("div",{id:`${e}3`},i.commenthidden?D("span",{class:["comment","history-deleted"]},mw.msg("rev-deleted-comment")):a(i.comment)?D("span",{class:["comment","mw-comment-none"]},mw.msg("changeslist-nocomment")):D("span",{class:["comment","comment--without-parentheses"],innerHTML:i.comment})))}function qe(i){l.get("showRevisionInfo")?(i.find("td:is(.diff-otitle, .diff-side-deleted)").addClass("instantDiffs-hidden"),i.find("td:is(.diff-ntitle, .diff-side-added)").attr("colspan","4"),i.find("tr:not([class])").addClass("instantDiffs-hidden")):i.addClass("instantDiffs-hidden")}function wi(i,e){let t=new mw.Title(e,2).getPrefixedText(),s=new mw.Title(e,3).getPrefixedText(),n=new mw.Title(`Contributions/${e}`,-1).getPrefixedText(),r=gi(D("a",{class:["mw-redirect","mw-usertoollinks-talk"],title:s,href:U(i,mw.util.getUrl(s))},mw.msg("talkpagelinktext")),Hs(mw.msg("pipe-separator")),D("a",{class:["mw-redirect","mw-usertoollinks-talk"],title:n,href:U(i,mw.util.getUrl(n))},mw.msg("contribslink")));return gi(D("a",{class:"mw-userlink",title:t,href:U(i,mw.util.getUrl(t))},D("bdi",e)),Hs(mw.msg("word-separator")),D("span",{class:"mw-usertoollinks"},lo(mw.message("parentheses",r).parseDom())))}function je(i){if(R(i)&&(i=new Date(i)),!(i instanceof Date))return;let e=Ue("mediawiki.DateFormatter");return e?e.forUser().formatTimeAndDate(i):i.toLocaleString()}function bi(i){i={title:null,revid:null,hostname:null,user:null,userhidden:!1,...i};let e=new W({type:"revision",title:i.title,oldid:i.revid,hostname:i.hostname});return D("div",{class:["mw-diff-mobile-footer"]},i.userhidden?D("span",{class:["mw-userlink","history-deleted"]},mw.msg("rev-deleted-user")):wi(e,i.user))}function vi(i){if(!i||i.length===0||mw.loader.getState("mediawiki.diff")!=="ready")return!1;let e=i.find("#mw-diffPage-inline-toggle-switch-layout"),t=ot("mediawiki.diff","./inlineFormatToggle.js");try{return t(e),!0}catch{}return!1}function ki(i){if(!i||i.length===0||!h(mw.config.get("wgDiffOldId"))||!h(mw.config.get("wgDiffNewId"))||!ut(mw.config.get("wgPageContentModel"))||mw.loader.getState("ext.visualEditor.diffPage.init")!=="ready")return!1;let e=i.find(".ve-init-mw-diffPage-diffMode");if(e.length>0)return!0;e=$("<div>").addClass("ve-init-mw-diffPage-diffMode");let t=i.find(".mw-diffPage-inlineToggle-container");return t.length>0?t.before(e):i.append(e),!0}function ut(i){let e=mw.config.get("wgVisualEditorConfig");return e&&Object.prototype.hasOwnProperty.call(e.contentModels,i)}function yi(i){if(!i||i.length===0)return!1;let e=['.mw-rollback-link a[data-mw="interface"]',".mw-rollback-link a[data-mw-interface]"];return i.confirmable({i18n:{confirm:mw.msg("rollback-confirmation-confirm"),yes:mw.msg("rollback-confirmation-yes"),no:mw.msg("rollback-confirmation-no")},delegate:e.join(","),handler:t=>{t.preventDefault(),co(t.target)}}),!0}function co(i){let e=$.createSpinner({size:"small",type:"inline"});$(i).css("display","none").after(e);let t={action:"rollback",title:Li(i.href),user:mw.util.getParamValue("from",i.href),token:mw.util.getParamValue("token",i.href),formatversion:2,uselang:o.local.userLanguage};w.post(t).then(s=>{let n=$(ft(s?.rollback?.summary));fe(n),mw.notify(n,{tag:"rollback"}),$(i).closest(".mw-rollback-link").remove(),L.refresh()}).catch((s,n)=>{let r=$(ft(n?.error?.info));fe(r),mw.notify(r,{type:"error",tag:"rollback"}),e.remove(),$(i).css("display","")})}function xi(i){return!i||i.length===0?!1:(mw.loader.using(["@wikimedia/codex","ext.wikilambda.app"]).then(e=>{let{createMwApp:t}=e("vue"),{createPinia:s}=e("pinia"),{useMainStore:n,App:r}=e("ext.wikilambda.app");if(mw.config.get("wgWikiLambda")){let c=s(),p=n(c);window.vueInstance=t(Object.assign({provide:()=>({viewmode:p.getViewMode})},r)).use(c).mount(i.get(0))}}),!0)}async function Di(i){if(!i||i.length===0)return;let e=["wikibasemediainfo-filepage-fileinfo-heading","wikibasemediainfo-filepage-structured-data-heading"];return await w.loadMessage(e),fo(i)}function fo(i){let e=new OO.ui.TabPanelLayout("captions",{expanded:!1,label:mw.msg("wikibasemediainfo-filepage-fileinfo-heading"),$content:i.find("mediainfoviewcaptions")}),t=new OO.ui.TabPanelLayout("statements",{expanded:!1,label:mw.msg("wikibasemediainfo-filepage-structured-data-heading"),$content:i.find("mediainfoviewstatements")}),s=new OO.ui.IndexLayout({expanded:!1,framed:!1});s.addTabPanels([e,t],0);let n=new OO.ui.PanelLayout({expanded:!1,framed:!1,content:[s]});return D("div",{class:"instantDiffs-page-mediaInfo"},n.$element.get(0))}var D,gi,Hs,lo,ht=m(()=>{P();x();j();X();B();le();ee();O();({h:D,hf:gi,ht:Hs,hj:lo}=b)});var Pi,Ei,_s=m(()=>{x();Pi=class{config=mw.config;values={};backup={};constructor(e,t){t&&(this.config=t),this.setValues(e)}set(e,t){Object.hasOwn(this.backup,e)||(this.backup[e]=this.config.get(e)),this.values[e]=t}setValues(e){for(let[t,s]of Object.entries(e))this.set(t,s)}setTitle(e){a(e)||(R(e)&&(e=new mw.Title(e)),this.setValues({wgTitle:e.getMainText(),wgPageName:e.getPrefixedDb(),wgNamespaceNumber:e.getNamespaceId(),wgRelevantPageName:e.getPrefixedDb()}))}get(e){return this.values[e]}getValues(){return this.values}apply(){for(let[e,t]of Object.entries(this.values))t!==void 0&&this.config.set(e,t)}restore(){for(let[e,t]of Object.entries(this.backup))t!==void 0&&this.config.set(e,t)}},Ei=Pi});var $i,Gs,zs=m(()=>{B();$i=class{items=new Map;get(e,t){let s=w.get(e,t);return this.add(s),s}ajax(e){let t=$.ajax(e);return this.add(t),t}when(...e){return $.when(...e)}abort(){this.items.forEach((e,t)=>t.abort())}add(e){let t=e.always(()=>this.delete(e));return this.items.set(e,t),t}delete(e){this.items.delete(e)}},Gs=$i});var Ci={};_(Ci,{getDaysLeftExpiry:()=>Ai,updateGlobalWatchlistStatus:()=>Oi,updateWatchButtonStatus:()=>pt,updateWatchlistStatus:()=>Ti});function Ai(i){if(!i||mw.util.isInfinity(i))return null;let e=new Date(i);return Math.ceil((e-new Date)/(1e3*60*60*24))}function pt(i,e){let t=i.get("watched"),s=t?"unwatch":"watch",n=i.get("expiry")||"infinity",r=Ai(n),c=`action-${s}`,p=mw.util.getUrl(i.get("title"),{action:s}),f,g;t?mw.util.isInfinity(n)?(f="unwatch",g="unStar"):(f=r>0?"unwatch-expiring":"unwatch-expiring-hours",g="halfStar"):(f="watch",g="star"),e.setLabel(d(c)),e.setTitle(mw.msg(`tooltip-ca-${f}`,r)),e.setHref(U(i,p)),e.setIcon(g)}function Ti(i,e,t){let s=i.get("titleText");e?Qs(s,(n,r,c)=>{r.find(".mw-changelist-line-inner-unwatched").addBack(".mw-enhanced-rc-nested").removeClass("mw-changelist-line-inner-unwatched"),c.length>0&&c.text(mw.msg("watchlist-unwatch")).attr("title",mw.msg("tooltip-ca-unwatch")).attr("href",mw.util.getUrl(n,{action:"unwatch"})).removeClass("mw-watch-link loading").addClass("mw-unwatch-link"),Ks(r,e,t)}):Qs(s,(n,r,c)=>{r.find(".mw-changeslist-line-inner, .mw-enhanced-rc-nested").addBack(".mw-enhanced-rc-nested").addClass("mw-changelist-line-inner-unwatched"),c.length>0&&c.text(mw.msg("watchlist-unwatch-undo")).attr("title",mw.msg("tooltip-ca-watch")).attr("href",mw.util.getUrl(n,{action:"watch"})).removeClass("mw-unwatch-link loading").addClass("mw-watch-link"),Ks(r,e,t)})}function Ks(i,e,t){if(!e)return;let s=i.find(".mw-changesList-watchlistExpiry");if(mw.util.isInfinity(t))return uo(i,s);let n=Ai(t),r=n>0?"days-full-text":"hours-full-text",c=mw.msg(`watchlist-expiring-${r}`,n);s.length>0?s.each((p,f)=>{f.title=c}):ho(i,c)}function uo(i,e){e.each((t,s)=>{let n=$(s);n.next(".mw-changeslist-separator").addClass("mw-changeslist-separator--semicolon").removeClass("mw-changeslist-separator"),s.previousSibling.nodeValue=s.previousSibling.nodeValue.trimEnd(),s.nextSibling.nodeValue=s.nextSibling.nodeValue.trimStart(),n.next(".mw-changeslist-links").before(" "),e.remove()}),i.find(".mw-changeslist-line-inner-historyLink").prepend(" ")}function ho(i,e){i.find(".mw-title").each((t,s)=>{let n=$(s),r=n.next(".mw-fr-reviewlink"),c=new OO.ui.IconWidget({icon:"clock",title:e,classes:["mw-changesList-watchlistExpiry"]});(r.length>0?r:n).after(" ").after(c.$element).after(" "),c.$element.next(".mw-changeslist-separator--semicolon").addClass("mw-changeslist-separator").removeClass("mw-changeslist-separator--semicolon")})}function Qs(i,e){let t=mw.Title.newFromText(i),n=(t.isTalkPage()?t.getSubjectPage():t.getTalkPage()).getPrefixedText();$(".mw-changeslist-line").each((r,c)=>{$(c).find("[data-target-page]").each((f,g)=>{let S=$(g),u=String(S.data("targetPage"));if(u===i||u===n){let v=S.closest("li, .mw-enhancedchanges-checkbox + table.mw-changeslist-log td[data-target-page], table"),y=v.find(".mw-unwatch-link, .mw-watch-link");e(u,v,y)}})})}function Oi(i,e,t){if(mw.globalwatchlist)try{let s=mw.globalwatchlist.watchedSites.siteList.find(n=>n.site===i.get("hostname"));if(!s)return;s.processUpdateWatched(i.get("origTitle"),!e)}catch(s){E("error-global-watchlist",{article:i,tag:"watch",message:s?.message||s,silent:!0})}}var Mi=m(()=>{x();X()});var po,Ii,gt,Ri=m(()=>{P();x();Mi();j();O();B();({h:po}=b),Ii=class{static utils=Ci;static notificationId="mw-watchlink-notification";article;options={};preferredExpiry;isWatchlistExpiryEnabled=!1;watchlistLabelsEnabled=!1;isWatchListPopupEnabled=!1;isWatched=!1;$watchLink;watchlistPopupWrapper;watchlistPopup;constructor(e,t){this.article=e,this.options={onUpdate:()=>{},...t},this.$watchLink=$('<a class="instantDiffs-button--fake-watch">'),I(this.$watchLink,document.body);let s=ot("mediawiki.page.watch.ajax","config.json")||{};this.isWatchlistExpiryEnabled=!this.article.isForeign&&(s.WatchlistExpiry||!1),this.watchlistLabelsEnabled=!this.article.isForeign&&(s.EnableWatchlistLabels||!1),this.isWatchListPopupEnabled=l.get("showWatchlistPopup")&&(this.isWatchlistExpiryEnabled||this.watchlistLabelsEnabled);let n=["mediawiki.notification"];(this.isWatchlistExpiryEnabled||this.watchlistLabelsEnabled)&&n.push("mediawiki.watchstar.widgets"),this.watchlistLabelsEnabled&&n.push("mediawiki.widgets.MenuTagMultiselectWidget"),mw.loader.load(n)}async preloadMessages(){await w.loadMessage(["watchlist-expiring-days-full-text","watchlist-expiring-hours-full-text","tooltip-ca-watch","tooltip-ca-unwatch","tooltip-ca-unwatch-expiring","tooltip-ca-unwatch-expiring-hours"])}async request(){return await this.preloadMessages(),this.preferredExpiry=mw.user.options.get("watchstar-expiry","infinity"),this.isWatched=this.article.get("watched"),l.get("expEnableWatchlistPopup")&&this.isWatchListPopupEnabled?this.requestModules():this.requestWatchStatus()}requestModules(){return mw.loader.using("mediawiki.watchstar.widgets").then(e=>{let t=e("mediawiki.watchstar.widgets");return Ae(t)?this.showWatchlistPopup():this.requestWatchStatus()})}requestWatchStatus(){let e=this.article.getMW("title").getPrefixedDb();return(this.isWatched?w.unwatch(e,this.article):w.watch(e,this.preferredExpiry,this.article)).then(this.showNotice).fail(this.showError)}showError=(e,t)=>{let s=w.getApi().getErrorMessage(t);mw.notify(s,{tag:"watch-self",type:"error",id:this.constructor.notificationId})};showNotice=e=>{if(!e)return this.showError(void 0,e);this.isWatched=e.watched===!0;let t=this.article.getMW("title"),s=e.expiry||"infinity",n=this.isWatched?"addedwatchtext":"removedwatchtext";t.isTalkPage()&&(n+="-talk");let r;this.isWatchListPopupEnabled?(this.isWatched&&(n=!this.preferredExpiry||mw.util.isInfinity(this.preferredExpiry)?"addedwatchindefinitelytext":"addedwatchexpirytext",t.isTalkPage()&&(n+="-talk")),r=this.showWatchlistNotice(t,n,s)):r=this.showBasicNotice(t,n),r.always(()=>{let c=this.isWatched?"unwatch":"watch";this.updateStatus(this.$watchLink,c,"idle",s,"infinity")})};getNoticeMessage(e,t){let s=this.article.get("hostname"),n=mw.message(t,e.getPrefixedText(),this.preferredExpiry).parseDom();return Q(n,`https://${s}`),fe(n),n}showBasicNotice(e,t){let s=this.getNoticeMessage(e,t);return mw.notify(s,{tag:"watch-self",id:this.constructor.notificationId})}showWatchlistNotice(e,t,s){return mw.loader.using("mediawiki.watchstar.widgets").then(n=>{let r=n("mediawiki.watchstar.widgets");if(!r)return this.showBasicNotice(e,t);let c=this.getNoticeMessage(e,t),p=[this.isWatched?"watch":"unwatch",e.getPrefixedDb(),s,this.updateStatus,{expiryEnabled:this.isWatchlistExpiryEnabled,labelsEnabled:this.watchlistLabelsEnabled,$link:this.$watchLink,message:c}];Wi(mw.config.get("wgVersion"),"1.45.0")<0&&p.splice(2,1);try{let f=new r(...p);mw.notify(f.$element,{tag:"watch-self",id:this.constructor.notificationId,autoHideSeconds:"short"})}catch(f){ve(this.constructor.name,"Falls back to basic watch/unwatch functionality.",f),this.showBasicNotice(e,t)}})}showWatchlistPopup(){return this.watchlistPopup?(this.watchlistPopup.isOpen?this.watchlistPopup.isOpen=!1:this.watchlistPopup.openPopup(this.$watchLink[0]),$.Deferred().resolve().promise()):mw.loader.using(["@wikimedia/codex","mediawiki.watchstar.widgets"]).then(e=>{let t=e("vue"),s=e("mediawiki.watchstar.widgets"),n=s.WatchlistPopup;this.watchlistPopupWrapper=po("span.mw-watchlink-popup"),I(this.watchlistPopupWrapper,document.body),this.watchlistPopup=t.createMwApp(n,{initialAction:this.isWatched?"unwatch":"watch",expiryEnabled:this.isWatchlistExpiryEnabled,labelsEnabled:this.watchlistLabelsEnabled,title:this.article.getMW("title"),dataExpiryOptions:s.dataExpiryOptions,preferredExpiry:this.preferredExpiry,link:this.$watchLink[0]}).mount(this.watchlistPopupWrapper),window.addEventListener("WatchlistPopup.watch",this.onWatchlistPopupWatch),window.addEventListener("WatchlistPopup.unwatch",this.onWatchlistPopupUnwatch)})}onWatchlistPopupWatch=e=>{this.isWatched=!0;let t=e.detail?.watchResponse?e.detail.watchResponse.expiry||e.detail.watchResponse._rawValue?.expiry:"infinity";this.updateStatus(this.$watchLink,"unwatch","idle",t)};onWatchlistPopupUnwatch=e=>{this.isWatched=!1,this.updateStatus(this.$watchLink,"watch","idle")};updateStatus=(e,t,s,n="infinity",r="infinity")=>{let c=t==="unwatch";if(this.isWatched=c,this.article.setValues({watched:c,expiry:n,expirySelected:r}),this.options.onUpdate(s),!this.article.isForeign&&o.local.mwTitleText===this.article.get("titleText")){let{updatePageWatchStatus:p}=Ue("mediawiki.page.watch.ajax")||{};p?.(c,n,r)}s!=="loading"&&(!this.article.isForeign&&o.local.mwCanonicalSpecialPageName==="Watchlist"&&Ti(this.article,c,n),o.local.mwCanonicalSpecialPageName==="GlobalWatchlist"&&Oi(this.article,c,n))};getArticle(){return this.article}detach(){this.watchlistPopup&&(window.removeEventListener("WatchlistPopup.watch",this.onWatchlistPopupWatch),window.removeEventListener("WatchlistPopup.unwatch",this.onWatchlistPopupUnwatch),this.watchlistPopup.isOpen=!1,this.watchlistPopupWrapper.remove()),this.$watchLink.detach()}},gt=Ii});var Ni={};_(Ni,{default:()=>go});var mt,go,Fi=m(()=>{x();j();X();Ee();O();mt=class extends OO.ui.ButtonWidget{options={};invisibleIcon=!1;link;handler;constructor(e){e={name:null,type:"default",classes:[],framed:!0,invisibleLabel:!1,invisibleIcon:!1,icon:"puzzle",href:null,target:Ve(!0),handler:null,useAltKey:!1,article:null,setLink:!1,...e,linkOptions:{behavior:"event",...e.linkOptions}},e.type==="navigation"&&(e.icon=null,e.classes=[...e.classes,"instantDiffs-button--navigation"]),e.type==="pin"&&(e.invisibleLabel=!0,e.classes=[...e.classes,"instantDiffs-button--pin"]),e.type==="menu"&&(e.classes=[...e.classes,"instantDiffs-button--link"],e.framed=!1,l.get("showMenuIcons")||(e.invisibleIcon=!0)),a(e.href)||(e.href=U(e.article,e.href)),super(e),this.options=e,this.setInvisibleIcon(e.invisibleIcon),e.handler&&this.setHandler(e.handler,e.useAltKey),e.setLink&&this.setLink(e.linkOptions)}setInvisibleIcon(e){return e=!!e,this.invisibleIcon!==e&&(this.invisibleIcon=e,this.$element.toggleClass("instantDiffs-invisibleIconElement",!this.icon||this.invisibleIcon)),this}setLink(e){return this.link=new C(this.$button.get(0),e),this}setHandler(e,t){if(k(this.handler)&&Vi(this.$button.get(0),this.handler),k(e)){let s=n=>e(this,n);this.handler=Ne(this.$button.get(0),s,t)}return this}execHandler(){return this.$button.get(0).click(),this}getOption(e){return this.options[e]}getOptions(){return this.options}getArticle(){return this.getOption("article")}pending(e){return this.$button.toggleClass("instantDiffs-link--pending",e),this}};H(mt);go=mt});var ji,Js,Ys=m(()=>{x();O();ji=class{article;options={};groups={};buttons={};MenuButton;constructor(e,t){this.article=e,this.options={...t},this.MenuButton=(Fi(),De(Ni)).default}renderGroup(e){return e={name:null,group:null,widget:null,type:"vertical",classes:[],container:null,...e},e.type==="vertical"&&e.classes.push("instantDiffs-buttons-group","instantDiffs-buttons-group--vertical",`instantDiffs-buttons-group--${e.name}`,l.get("showMenuIcons")?"has-icons":null),e.type==="horizontal"&&e.classes.push("instantDiffs-buttons-group","instantDiffs-buttons-group--horizontal",`instantDiffs-buttons-group--${e.name}`),e.widget=new OO.ui.ButtonGroupWidget(e),I(e.widget.$element,e.container),this.registerGroup(e)}registerGroup(e){if(e={name:null,group:null,widget:null,...e},!this.groups[e.name])return this.groups[e.name]=e,e}getGroup(e){return this.groups[e]}getGroups(e){return Object.values(this.groups).filter(t=>!e||e===t.group)}getGroupsWidgets(e){return this.getGroups(e).map(t=>t.widget)}getGroupsElements(e){return this.getGroups(e).map(t=>t.widget.$element.get(0))}addGroupButtons(e,t){let s=this.getGroup(e);if(!s)return;t=z(t)?t:[t];let n=t.map(r=>r.widget);s.widget.addItems(n)}getGroupButtons(e){return this.getButtons().filter(t=>wt(e,t.group))}renderButton(e){if(e={article:this.article,name:null,group:null,canSystem:!1,systemType:"pin",systemGroup:"navigation",canPin:!1,pinType:"pin",pinGroup:"pins",canMenu:!0,menuGroup:"menu",menuType:"menu",widget:null,...e},this.buttons[e.name])return;let t=this.buttons[e.name]=[];if(e.canSystem){let s=this.renderButtonHelper({...e,type:e.systemType,group:e.systemGroup,isSystem:!0});t.push(s)}if(e.canPin&&wt(l.get("pinnedActions"),e.name)){let s=this.renderButtonHelper({...e,type:e.pinType,group:e.pinGroup,isPin:!0});t.push(s)}if(e.canMenu){let s=this.renderButtonHelper({...e,type:e.menuType,group:e.menuGroup,isMenu:!0});t.push(s)}return t}renderButtonHelper(e){return e.widget=new this.MenuButton(e),this.addGroupButtons(e.group,e),e}registerButton(e){if(e={name:null,group:null,type:null,widget:null,...e},!this.buttons[e.name])return this.buttons[e.name]=[e],this.addGroupButtons(e.group,e),e}getButton(e,t){if(this.buttons[e])return this.buttons[e].filter(n=>!t||R(t)&&n.group===t||z(t)&&t.includes(n.group))}getButtonWidget(e,t){let s=this.getButton(e,t);if(s)return s.map(n=>n.widget)}getButtons(){return Object.values(this.buttons).flat()}eachButton(e,t,s){let n=this.getButton(e,t);n&&n.forEach(r=>s(r))}eachButtonWidget(e,t,s){let n=this.getButtonWidget(e,t);n&&n.forEach(r=>s(r))}focusButton(e,t){let s=!1;return this.eachButtonWidget(e,t,n=>{if(!n.isDisabled())return n.focus(),s=!0,!0}),s}pendingButton(e,t,s){this.eachButtonWidget(e,t,n=>{n.pending(s)})}},Js=ji});var Xs=m(()=>{});var Zs={};_(Zs,{default:()=>mo});var bt,mo,en=m(()=>{x();j();O();bt=class extends OO.ui.PopupButtonWidget{constructor(e){e=J({icon:"menu",label:d("goto-actions"),title:q("goto-actions","actions",l.get("enableHotkeys")),invisibleLabel:!0,popup:{classes:["instantDiffs-buttons-popup",l.get("showMenuIcons")?"has-icons":null],width:"auto",padded:!1,anchor:!1,align:"backwards",autoClose:!0}},e),super(e)}execHandler(){return this.$button.get(0).click(),this}togglePopup(e){return this.getPopup().toggle(e),this}pending(e){return this.$button.toggleClass("instantDiffs-link--pending",e),this}};H(bt);mo=bt});var ke,wo,bo,qi,tn,sn=m(()=>{P();x();Le();X();Mi();le();pi();Ri();Ys();ee();O();Xs();({h:ke,hf:wo,ht:bo}=b),qi=class{MenuActionsButton;MenuButton;page;article;articleParams={};options={};nodes={};actionRegister;watch;menu;isDetached=!1;constructor(e,t,s,n){this.page=e,this.article=t,this.articleParams={...s},this.options={initiatorAction:null,links:{},...n},this.MenuActionsButton=(en(),De(Zs)).default,this.MenuButton=(Fi(),De(Ni)).default,L.connect(this,{hotkey:"onHotkey"}),this.render()}render(){this.nodes.container=ke("div",{class:["instantDiffs-navigation"]},this.nodes.left=ke("div",{class:["instantDiffs-navigation-group","instantDiffs-navigation-group--left"]}),this.nodes.center=ke("div",{class:["instantDiffs-navigation-group","instantDiffs-navigation-group--center"]}),this.nodes.right=ke("div",{class:["instantDiffs-navigation-group","instantDiffs-navigation-group--right"]})),this.renderMenu(),this.renderSnapshotLinks(),this.renderNavigationLinks(),this.renderActionLinks(),mw.hook(`${o.config.prefix}.navigation.complete`).fire(this)}groupsMap={left:["snapshot"],center:["navigation"],right:["pins-custom","pins"]};groups=[];actionGroupsMap=["mobile","menu-custom","menu","footer"];actionGroups=[];renderMenu(){this.menu=new Js(this.article);for(let[e,t]of Object.entries(this.groupsMap))t.forEach(s=>{this.groups.push(s),this.menu.renderGroup({name:s,group:e,type:"horizontal",container:this.nodes[e]})});this.actionGroupsMap.forEach(e=>{this.actionGroups.push(e),this.menu.renderGroup({name:e,group:"actions",type:"vertical"})})}renderSnapshotLinks(){let e={canSystem:!0,systemType:"pin",systemGroup:"snapshot",canPin:!1,canMenu:!1},t={canMenu:!0,menuGroup:"mobile"};this.renderSnapshotPrevLink(e),this.renderSnapshotNextLink(e),this.page.getInitiatorPage()&&this.renderBackLink({...e,...t}),a(this.options.links.unpatrolled)||this.renderUnpatrolledLink({...e,...t})}renderNavigationLinks(){let e={canSystem:!0,systemType:"navigation",systemGroup:"navigation",canPin:!1,canMenu:!1},t={canMenu:!0,menuGroup:"mobile"};this.renderPrevLink(e),["page"].includes(this.article.get("typeVariant"))||this.renderSwitchLink({...e,...t}),this.renderNextLink(e)}renderActionLinks(){this.renderMenuLinks(),this.renderMenuFooterLinks(),this.renderMenuActions()}renderMenuLinks(){let e={canPin:!0,pinGroup:"pins",canMenu:!0,menuGroup:"menu"};this.renderCopyLink(e),this.renderCopyWikilink(e),this.renderTypeLink(e),a(this.article.get("title"))||(this.renderPageLink(e),this.article.getMW("title").canHaveTalkPage()&&this.renderTalkPageLink(e),Kt(mw.config.get("wgPageContentModel"))&&this.renderEditLink(e),this.renderHistoryLink(e),this.renderInfoLink(e),o.local.mwIsAnon||this.renderWatchLink(e)),this.renderSettingsLink(e)}renderMenuFooterLinks(){let e={canPin:!1,canMenu:!0,menuGroup:"footer"};this.renderIDLink(e)}renderMenuActions(){let e=Bi(this.menu.getGroupsElements("actions"),ke("hr.instantDiffs-buttons-separator")),t=new this.MenuActionsButton({popup:{$content:$(e)}});this.menu.registerButton({name:"actions",group:"pins",type:"pin",widget:t})}renderSnapshotPrevLink(e){let t=be.instance.getPreviousLink();e={name:"snapshotPrev",label:d("goto-snapshot-prev"),title:q("goto-snapshot-prev","snapshot-prev",l.get("enableHotkeys")),icon:"doubleChevronStart",href:t?t.href:null,disabled:!t,setLink:!!t,linkOptions:{initiatorLink:t,onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderSnapshotNextLink(e){let t=be.instance.getNextLink();e={name:"snapshotNext",label:d("goto-snapshot-next"),title:q("goto-snapshot-next","snapshot-next",l.get("enableHotkeys")),icon:"doubleChevronEnd",href:t?t.href:null,disabled:!t,setLink:!!t,linkOptions:{initiatorLink:t,onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderPrevLink(e){let t;if(this.options.links.prev){let n=new W({title:this.article.get("title"),hostname:this.article.get("hostname"),oldid:mw.config.get("wgDiffOldId"),diff:this.article.get("type")==="diff"?"prev":null,direction:this.article.get("type")==="revision"?"prev":null});t=N(n)}let s=vt({short:d("goto-prev"),long:d(`goto-prev-${this.article.get("type")}`),iconBefore:document.dir==="ltr"?"\u2190":"\u2192"});e={name:"prev",label:$(s),title:q(`goto-prev-${this.article.get("type")}`,"prev",l.get("enableHotkeys")),href:t,disabled:!t,setLink:!!t,linkOptions:{onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderNextLink(e){let t;if(this.options.links.next){let n=new W({title:this.article.get("title"),hostname:this.article.get("hostname"),oldid:mw.config.get("wgDiffNewId"),diff:this.article.get("type")==="diff"?"next":null,direction:this.article.get("type")==="revision"?"next":null});t=N(n)}let s=vt({short:d("goto-next"),long:d(`goto-next-${this.article.get("type")}`),iconAfter:document.dir==="ltr"?"\u2192":"\u2190"});e={name:"next",label:$(s),title:q(`goto-next-${this.article.get("type")}`,"next",l.get("enableHotkeys")),href:t,disabled:!t,setLink:!!t,linkOptions:{onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderSwitchLink(e){let t=this.article.get("type")==="diff"?"revision":"diff",s={type:t};e={name:"switch",label:d(`goto-view-${t}`),title:q(`goto-view-${t}`,"switch",l.get("enableHotkeys")),icon:"specialPages",href:N(this.article,{},s),classes:["instantDiffs-button--switch"],setLink:!0,linkOptions:{onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderUnpatrolledLink(e){e={name:"unpatrolled",label:d("goto-view-unpatrolled"),title:q("goto-view-unpatrolled","unpatrolled",l.get("enableHotkeys")),icon:"eyeClosed",href:this.options.links.unpatrolled,classes:["instantDiffs-button--pending"],setLink:!0,linkOptions:{initiatorPage:this.page,onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderBackLink(e){let t=this.page.getInitiatorPage(),s=t.getArticle();e={name:"back",label:d(`goto-back-${s.get("type")}`),title:q(`goto-back-${s.get("type")}`,"back",l.get("enableHotkeys")),icon:"newline",href:N(s,t.getArticleParams()),classes:["instantDiffs-button--back"],setLink:!0,linkOptions:{onRequest:()=>{let n=t.getNavigation()?.getActionRegister(),r=a(n)?e.name:`${e.name}-${n}`;this.setActionRegister(r)}},...e},this.menu.renderButton(e)}renderCopyLink(e){this.menu.renderButton({name:"copyLink",label:d("copy-link"),icon:"link",handler:this.actionCopyLink.bind(this),...e})}renderCopyWikilink(e){this.menu.renderButton({name:"copyWikilink",label:d("copy-wikilink"),icon:"wikiText",handler:this.actionCopyWikilink.bind(this),...e})}renderTypeLink(e){let t=this.article.get("type"),s={hash:l.get("linksHash")};this.menu.renderButton({name:"link",label:d(`goto-${t}`),icon:"articleRedirect",href:N(this.article,{},s),...e})}renderPageLink(e){let t=this.article.getMW("title").isTalkPage()?this.article.getMW("title").getSubjectPage().getUrl():this.article.get("href"),s={2:"userAvatar",3:"userAvatar",default:"article"};this.menu.renderButton({name:"page",label:d("goto-page"),icon:s[this.article.getMW("title").getNamespaceId()]||s.default,href:t,...e})}renderTalkPageLink(e){let t=this.article.getMW("title").isTalkPage()?this.article.get("href"):this.article.getMW("title").getTalkPage().getUrl(),s={2:"userTalk",3:"userTalk",default:"speechBubbles"};this.menu.renderButton({name:"talkPage",label:d("goto-talkpage"),icon:s[this.article.getMW("title").getNamespaceId()]||s.default,href:t,...e})}renderEditLink(e){let t=mw.config.get("wgIsProbablyEditable"),s=mw.util.getUrl(this.article.get("title"),{action:"edit"});this.menu.renderButton({name:"edit",label:d(t?"goto-edit":"goto-source"),icon:t?"edit":"editLock",href:s,...e})}renderHistoryLink(e){let t=mw.util.getUrl(this.article.get("title"),{action:"history"});this.menu.renderButton({name:"history",label:d("goto-history"),icon:"history",href:t,...e})}renderInfoLink(e){let t=mw.util.getUrl(this.article.get("title"),{action:"info"});this.menu.renderButton({name:"info",label:d("goto-info"),icon:"info",href:t,...e})}renderWatchLink(e){this.menu.renderButton({name:"watch",label:d("action-watch"),handler:this.actionWatchPage.bind(this),...e}),this.menu.eachButtonWidget("watch",null,t=>{pt(this.article,t)})}renderSettingsLink(e){this.menu.renderButton({name:"settings",label:d("goto-settings"),icon:"settings",handler:this.actionOpenSettings.bind(this),...e})}renderIDLink(e){let t=wo(ke("span.name",d("script-name")),bo(" "),ke("span.version",`v.${o.config.version}`));this.menu.renderButton({name:"id",label:$(t),icon:null,href:kt(`/wiki/${o.config.link}`),classes:["instantDiffs-button--link-id"],...e})}actionCopyLink(e){let t={relative:!1,hash:l.get("linksHash"),minify:l.get("linksFormat")==="minify"},s=N(this.article,{},t);He(s),this.focusAction(e)}actionCopyWikilink(e){this.pendingAction(e,!0),$.when(si(this.article)).done(t=>{He(t)}).fail(()=>{He(!1)}).always(()=>{this.pendingAction(e,!1),this.focusAction(e)})}actionWatchPage(e){this.pendingAction(e,!0),this.watch||(this.watch=new gt(this.article,{onUpdate:t=>{this.menu.eachButtonWidget("watch",null,s=>{s.pending(t==="loading"),pt(this.article,s)})}})),$.when(this.watch.request()).always(()=>{this.pendingAction(e,!1),this.focusAction(e)})}actionOpenSettings(e){this.pendingAction(e,!0),l.once("opening",()=>this.toggleActions(!1)),l.once("closed",()=>this.focusAction(e)),$.when(l.load()).always(()=>{this.pendingAction(e,!1)})}actionCounterparts={unpatrolled:"back","back-unpatrolled":"unpatrolled"};disabledActionCounterparts={next:"prev",prev:"next",snapshotNext:"snapshotPrev",snapshotPrev:"snapshotNext"};focusAction(e){return this.toggleActions(!1),e instanceof this.MenuButton?this.focusActionByWidget(e):R(e)?this.focusActionByName(e):!1}focusActionByWidget(e){if(e.isDisabled())return!1;let t=e.getOption("group");return this.groups.includes(t)?(e.focus(),!0):this.focusActionByName("actions")}focusActionByName(e){return e=this.actionCounterparts[e]||e,this.menu.focusButton(e,this.groups)?!0:(e=this.disabledActionCounterparts[e],e?this.menu.focusButton(e,this.groups):!1)}getActionName(e){if(e instanceof this.MenuButton)return e.getOption("name");if(R(e))return e}pendingAction(e,t){this.getActionName(e)&&this.menu.pendingButton(this.getActionName(e),null,t)}execAction(e){let t=this.getActionName(e);t&&(t!=="actions"&&this.toggleActions(!1),this.menu.eachButtonWidget(t,null,s=>{if(!s.isDisabled())return s.focus(),s.execHandler(),!0}))}toggleActions(e){this.menu.eachButtonWidget("actions",this.groups,t=>{t.togglePopup(e)})}setActionRegister(e){this.actionRegister=e}getActionRegister(){return this.actionRegister}getPinnableActions(){return this.menu.getButtons().filter(e=>e.canPin)}addCustomAction(e){e={...e,canSystem:!1,canPin:!0,pinGroup:"pins-custom",canMenu:!0,menuGroup:"menu-custom"},!a(e.name)&&(e.name=`custom-${e.name}`,this.menu.renderButton(e))}getCustomAction(e){let t;return e instanceof this.MenuButton&&(t=e.getOption("name")),R(e)&&(t=`custom-${e}`),this.menu.getButton(t,["pins-custom","menu-custom"])}getCustomActionWidget(e){let t=this.getCustomAction(e);if(t)return t.map(s=>s.widget)}eachCustomAction(e,t){let s=this.getCustomAction(e);s&&s.forEach(n=>t(n))}eachCustomActionWidget(e,t){let s=this.getCustomActionWidget(e);s&&s.forEach(n=>t(n))}actionHotkeyMap={none:{ArrowLeft:"prev",ArrowRight:"next"},ctrl:{ArrowLeft:"snapshotPrev",ArrowRight:"snapshotNext",ArrowUp:"switch",ArrowDown:"actions",KeyZ:"back",KeyP:"unpatrolled"},alt:{},shift:{}};actionHotkeyMapRTL={none:{ArrowRight:"prev",ArrowLeft:"next"},ctrl:{ArrowRight:"snapshotPrev",ArrowLeft:"snapshotNext"}};getActionHotkeyMap(){return document.dir==="rtl"?J(this.actionHotkeyMap,this.actionHotkeyMapRTL):this.actionHotkeyMap}onHotkey(e){if(!l.get("enableHotkeys"))return;let t=this.getActionHotkeyMap(),s=e.altKey?"alt":e.ctrlKey?"ctrl":e.shiftKey?"shift":"none",n=t[s]?.[e.code];n&&(e.preventDefault(),e.stopPropagation(),this.execAction(n))}getOuterHeight(e=!1){return Ui(this.nodes.container,e)}getArticle(){return this.article}getMenu(){return this.menu}fire(){this.focusAction(this.options.initiatorAction)}embed(e,t){I(this.nodes.container,e,t)}detach(){this.watch?.detach(),this.toggleActions(!1),L.disconnect(this,{hotkey:"onHotkey"}),this.nodes.container.remove(),this.isDetached=!0}},tn=qi});var nn=m(()=>{});var Hi,ye,yt=m(()=>{P();x();ht();X();Le();B();_s();zs();sn();O();nn();Hi=class{static utils=Be;type="abstract";article;options={};articleParams={};error;errorData;nodes={};links={};configManager;userOptionsManager;requestManager;loadPromise;navigation;isLoading=!1;isLoaded=!1;isConfigsChanged=!1;isDetached=!1;constructor(e,t){this.article=e,this.options={initiatorAction:null,initiatorPage:null,fireDiffHook:!0,fireContentHook:!0,...t},this.articleParams={action:"render",diffonly:this.article.get("type")==="diff"?1:0,unhide:l.get("unHideDiffs")?1:0,uselang:o.local.userLanguage},this.configManager=new Ei({wgTitle:!1,wgPageName:!1,wgRelevantPageName:!1,wgPageContentModel:"wikitext",wgNamespaceNumber:!1,wgArticleId:!1,wgRelevantArticleId:!1,wgCurRevisionId:!1,wgRevisionId:!1,wgDiffOldId:!1,wgDiffNewId:!1,wgCanonicalSpecialPageName:!1,wgIsProbablyEditable:!1,wgRelevantPageIsProbablyEditable:!1,wbEntityId:!1,"thanks-confirmation-required":!0}),this.userOptionsManager=new Ei({},mw.user.options),this.requestManager=new Gs,OO.EventEmitter.call(this)}load(){return this.isLoading?this.loadPromise:(this.isLoading=!0,this.isLoaded=!1,this.error=null,this.errorData=null,this.loadPromise=this.preloadProcess())}preloadProcess(){let e=this.getPreloadPromises();return Promise.allSettled(e).then(this.loadProcess.bind(this))}loadProcess(){let e=this.getLoadPromises();return Promise.allSettled(e).then(this.onLoadResponse).then(this.loadProcessSecondary)}loadProcessSecondary=()=>{let e=this.getLoadSecondaryPromises();return Promise.allSettled(e)};getPreloadPromises(){return[this.requestCompare()]}getLoadPromises(){return[this.requestPageInfo(),this.request()]}getLoadSecondaryPromises(){return[this.requestWBLabel()]}onLoadResponse=async()=>{this.isLoading=!1,this.isLoaded=!0,!this.isDetached&&this.error?.statusText!=="abort"&&(a(this.data)?await this.renderError():await this.renderSuccess())};request(){return this.requestProcess().done(this.onRequestDone).fail(this.onRequestError)}requestProcess(){return this.requestManager.when()}onRequestError=(e,t)=>{this.error=e,this.errorData=t?.error};onRequestDone=e=>{this.data=e};requestCompare(){let e=this.article.getValues();if(this.error||e.typeVariant!=="comparePages"||h(e.oldid)&&h(e.diff))return $.Deferred().resolve().promise();let t={action:"compare",prop:["title","ids","timestamp","comment"],fromrev:h(e.rev1)?e.rev1:void 0,fromtitle:a(e.page1)?void 0:e.page1,torev:h(e.rev2)?e.rev2:void 0,totitle:a(e.page2)?void 0:e.page2,format:"json",formatversion:2,uselang:o.local.userLanguage};return this.requestManager.get(t,e.hostname).then(this.onRequestCompareDone).fail(this.onRequestCompareError)}onRequestCompareError=(e,t)=>{this.onRequestError(e,t)};onRequestCompareDone=e=>{let t=e?.compare;if(!t)return this.onRequestCompareError(null,e);this.article.set({oldid:t.fromrevid,diff:t.torevid,page1:t.fromtitle,page2:t.totitle,title:ce(t),section:Pe(t)})};async requestPageInfo(){let e=Math.max(this.article.get("revid"),this.article.get("oldid")),t=this.article.get("curid"),s=this.article.get("title"),n={};h(e)?n.revids=e:h(t)?n.pageids=t:a(s)||(n.titles=s);let r=await w.getPageInfo(n,this.article,this.requestManager);if(r){let c=r.pageprops||{},p=r.entityterms||{};this.configManager.setValues({wgArticleId:r.pageid,wgRelevantArticleId:r.pageid,wgCurRevisionId:r.lastrevid,wgContentLanguage:r.pagelanguage,wgContentLanguageDir:r.pagelanguagedir,wgPageContentModel:r.contentmodel,wgIsProbablyEditable:r.actions?.edit,wgRelevantPageIsProbablyEditable:r.actions?.edit,wbEntityId:c.wikibase_item||me(r.contentmodel)&&r.title||this.configManager.get("wbEntityId")}),this.article.setValues({title:r.title,curid:r.pageid,curRevid:r.lastrevid,watched:r.watched,expiry:r.watchlistexpiry,notificationtimestamp:r.notificationtimestamp,new:r.new,label:me(r.contentmodel)&&p.label?.[0]||r.contentmodel==="EntitySchema"&&Qt(c.displaytitle)||r.contentmodel==="zobject"&&Jt(c)||this.article.get("label")}),this.setConfigs()}}async requestWBLabel(){if(this.error||!a(this.article.get("label"))||!me(this.configManager.get("wgPageContentModel")))return $.Deferred().resolve().promise();let e=this.article.getMW("title")?.getMain(),t=await w.getWBLabel(e,this.article,this.requestManager);a(t)||(this.configManager.set("wbEntityId",e),this.article.setValue("label",t),this.setConfigs())}markAsSeen(){if(this.error||!l.get("markWatchedLine")||!this.article.isForeign||a(this.article.get("timestamp"))||a(this.article.get("notificationtimestamp")))return;let e=new Date(this.article.get("notificationtimestamp")).getTime();if(new Date(this.article.get("timestamp")).getTime()<e)return;let s={titles:this.article.get("titleText"),newerthanrevid:this.article.get("revid")};w.markAsSeen(s,this.article)}abort(){this.isLoading&&this.requestManager.abort()}async renderSuccess(){await this.render(),this.markAsSeen(),mw.hook(`${o.config.prefix}.page.renderSuccess`).fire(this),mw.hook(`${o.config.prefix}.page.renderComplete`).fire(this)}async renderError(){let e=this.article.get("type"),t=this.article.get("typeVariant"),s=t==="page"?"curid":t==="comparePages"?"compare-pages":"generic";this.error={type:e,code:s,tag:"page",status:this.error?.status,statusText:this.error?.statusText,message:this.errorData?.info||_i(this.error?.status),article:this.article},E(`error-${this.error.type}-${this.error.code}`,this.error),await this.render(),mw.hook(`${o.config.prefix}.page.renderError`).fire(this),mw.hook(`${o.config.prefix}.page.renderComplete`).fire(this)}async render(){let e=["instantDiffs-page",`instantDiffs-page--${this.type}`,`instantDiffs-page--${this.article.get("type")}`,"mw-body-content"],t=["instantDiffs-page-body",`instantDiffs-page-body--${this.type}`,`instantDiffs-page-body--${this.article.get("type")}`],s=o.config.skinBodyClasses[mw.config.get("skin")];s&&e.push(...s),this.nodes.$container=$("<div>").attr("dir",document.dir).addClass(e),this.nodes.$tools=$("<div>").addClass("instantDiffs-page-tools").appendTo(this.nodes.$container),this.nodes.$body=$("<div>").addClass(t).appendTo(this.nodes.$container),await this.renderContent(),await this.renderNavigation()}async renderContent(){this.error?await this.renderErrorContent():await this.renderSuccessContent()}async renderErrorContent(){let e=se(`error-${this.error.type}-${this.error.code}`,this.error,this.article),t=$(`<p>${e}</p>`);this.renderWarning({$content:t})}renderWarning({$content:e,type:t="warning",container:s=this.nodes.$body,insertMethod:n="prependTo"}){let r=zi({$content:e,type:t});return I(r,s,n),r}async renderSuccessContent(){await this.restoreFunctionality(),this.requestDependencies()}async renderNavigation(){this.navigation=new tn(this,this.article,this.articleParams,{initiatorAction:this.options.initiatorAction,links:this.links}),this.navigation.embed(this.nodes.$container,"prependTo")}requestDependencies(e={}){let{modulestyles:t=[],modulescripts:s=[],modules:n=[]}=e,r=[...Yt(this.article),...t,...s,...n];return mw.loader.using(de(r))}async restoreFunctionality(){if(!this.error&&(this.nodes.$mediaInfoView=this.nodes.$body.find("mediainfoview"),this.article.get("type")==="revision"&&this.nodes.$mediaInfoView.length>0)){let e=await Di(this.nodes.$mediaInfoView);e&&I(e,this.nodes.$diffTitle,"insertAfter")}}getScrollableSection(){let e=this.article.get("hash");if(!a(e))return Gi(e,this.nodes.$body)}getScrollableOffsetTop(){return this.getNavigation()?.getOuterHeight(!0)}async fire(){if(mw.hook(`${o.config.prefix}.page.ready`).fire(this),this.getNavigation()?.fire(),this.options.fireDiffHook){let e=this.getDiffTable();this.article.get("type")==="diff"&&e?.length>0&&mw.hook("wikipage.diff").fire(e)}if(this.options.fireContentHook){let e=this.getContainer();e?.length>0&&mw.hook("wikipage.content").fire(e)}fe(this.nodes.$container),mw.hook(`${o.config.prefix}.page.complete`).fire(this)}focus(){this.emit("focus")}setConfigs(){this.isConfigsChanged=!0,this.configManager.apply(),this.userOptionsManager.apply()}restoreConfigs(){this.isConfigsChanged&&(this.isConfigsChanged=!1,this.configManager.restore(),this.userOptionsManager.restore())}getArticle(){return this.article}getArticleTitleText(){let e=this.article.getValues(),t;return!a(e.page1Text)&&!a(e.page2Text)?t=`${e.page1Text} \u2192 ${e.page2Text}`:a(e.titleText)?t=d(this.error?"dialog-title-not-found":"dialog-title-empty"):t=e.titleText,a(e.label)?t:`${e.label} (${t})`}getArticleParams(){return this.articleParams}getContainer(){return this.nodes.$container}getDiffTable(){return this.nodes.$table}getInitiatorPage(){return this.options.initiatorPage}getNavigation(){return this.navigation}close(){this.emit("close")}detach(){this.isDetached||(mw.hook(`${o.config.prefix}.page.beforeDetach`).fire(this),this.abort(),this.restoreConfigs(),this.getNavigation()?.detach(),this.getContainer()?.detach(),this.isDetached=!0)}},ye=Hi});var Ki,Dt,Qi=m(()=>{P();x();ht();j();yt();O();Ki=class extends ye{type="local";isDependenciesLoaded=!1;getLoadPromises(){let e=super.getLoadPromises();return this.article.get("type")==="revision"&&(this.article.get("typeVariant")!=="page"&&h(this.article.get("revid"))||this.article.get("typeVariant")==="page"&&h(this.article.get("curid")))&&e.push(this.requestPage()),e}requestPage(){if(this.error)return $.Deferred().resolve().promise();let e={action:"parse",prop:["revid","modules","jsconfigvars","categorieshtml"],disablelimitreport:1,redirects:1,format:"json",formatversion:2,uselang:o.local.userLanguage},t=this.configManager.get("wgDiffNewId")||Math.max(this.article.get("revid"),this.article.get("oldid")),s=this.configManager.get("wgArticleId")||this.article.get("curid");return h(t)?e.oldid=t:h(s)&&(e.pageid=s),this.requestManager.get(e).then(n=>this.onRequestPageDone(n,e)).fail((n,r)=>this.onRequestPageError(n,r,e))}onRequestPageError=(e,t,s)=>{this.isDependenciesLoaded=!0;let n={message:e,type:"dependencies",tag:"page",article:this.article,silent:!0};t?.error&&(n.code=t.error.code,n.message=t.error.info);let r=s.oldid?"revid":"curid";E(`error-dependencies-${r}`,n)};onRequestPageDone=(e,t)=>{if(this.isDependenciesLoaded=!0,this.parse=e?.parse,!this.parse)return this.onRequestPageError(null,e,t);this.configManager.setValues({wgArticleId:this.parse.pageid,wgRevisionId:Math.max(this.article.get("revid"),this.parse.revid),...this.parse.jsconfigvars}),this.article.setValues({curid:this.configManager.get("wgArticleId"),revid:this.configManager.get("wgRevisionId")}),this.setConfigs(),this.processCategories(),this.requestDependencies(this.parse)};requestProcess(){if(this.error)return $.Deferred().resolve().promise();let e=this.article.getValues(),t={title:a(e.title)?void 0:e.title,diff:a(e.diff)?e.direction:e.diff,oldid:a(e.oldid)?void 0:e.oldid,curid:a(e.curid)?void 0:e.curid},s={url:o.local.mwEndPoint,dataType:"html",data:$.extend(t,this.articleParams)};return this.requestManager.ajax(s)}async renderSuccessContent(){this.nodes.data=$.parseHTML(this.data),this.nodes.$data=$(this.nodes.data).appendTo(this.nodes.$body),this.collectData(),this.setConfigs(),this.nodes.$data.filter(".cdx-message").prependTo(this.nodes.$body),this.nodes.$data.find(".cdx-message").prependTo(this.nodes.$body);let e=this.nodes.$data.filter("p");e.length>0&&this.renderWarning({$content:e}),this.processMobileFooter(),this.processDiffTable(),this.processFlaggedRevs(),this.article.get("type")==="revision"&&this.processRevision(),await super.renderSuccessContent()}collectData(){let e={},t=this.nodes.$data.find("#mw-diff-otitle1 strong > a, #differences-prevlink"),s=this.nodes.$data.find("#mw-diff-ntitle1 strong > a, #differences-nextlink");if(t.length>0){let f=Number(Te("oldid",t.prop("href")));h(f)&&this.configManager.set("wgDiffOldId",f);let g=Te("title",t.prop("href"))||t.prop("title");a(g)||(e.page1=g,e.title=g)}if(s.length>0){let f=Number(Te("oldid",s.prop("href")));h(f)&&(this.configManager.setValues({wgDiffNewId:f,wgRevisionId:f}),e.revid=f,this.article.get("diff")==="cur"&&(e.diff=f));let g=Te("title",s.prop("href"))||s.prop("title");a(g)||(e.page2=g,e.title=g)}e.page1===e.page2&&(delete e.page1,delete e.page2);let n=this.nodes.$data.find("#mw-diff-ntitle2 .mw-userlink");n.length>0&&(e.userhidden=n.hasClass("history-deleted"),e.userhidden||(e.user=n.text()));let r=this.nodes.$data.find("#mw-diff-ntitle1 .mw-diff-timestamp");r.length>0&&(e.timestamp=r.attr("data-timestamp"));let c=this.nodes.$data.find("#mw-diff-ntitle3 .autocomment a");a(this.article.get("section"))&&c.length>0&&(e.section=K("hash",c.prop("href"))),this.nodes.$data.find(".mw-diff-undo a, .mw-rollback-link a").length>0&&this.configManager.set("wgIsProbablyEditable",!0),this.article.set(e),this.configManager.setTitle(this.article.getMW("title")),this.article.get("type")!=="diff"&&!ut(this.configManager.get("wgPageContentModel"))&&this.userOptionsManager.set("visualeditor-diffmode-historical","source")}processMobileFooter(){if(this.nodes.$diffMobileFooter=this.nodes.$data.filter(".mw-diff-mobile-footer"),this.nodes.$diffMobileFooter.length===0)return;this.nodes.$diffMobileFooter.prependTo(this.nodes.$body);let e="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--action-default",t=[".mw-diff-undo",".mw-rollback-link"],s=this.nodes.$diffMobileFooter.find(t.join(","));s.length!==0&&(mw.user.isAnon()?s.hide():s.children("a").addClass(e))}processDiffTable(){this.nodes.$diffTablePrefix=this.nodes.$data.filter(".mw-diff-table-prefix"),(this.article.get("type")!=="diff"||!l.get("showDiffTools"))&&this.nodes.$diffTablePrefix.addClass("instantDiffs-hidden"),this.nodes.$table=this.nodes.$data.filter("table.diff"),this.nodes.$prev=this.nodes.$table.find("#differences-prevlink").attr("data-instantdiffs-link","none").addClass("instantDiffs-hidden"),this.nodes.$next=this.nodes.$table.find("#differences-nextlink").attr("data-instantdiffs-link","none").addClass("instantDiffs-hidden");let e=this.nodes.$table.find("#mw-diff-otitle4");xt(e);let t=this.nodes.$table.find("#mw-diff-ntitle4");xt(t),this.nodes.$data.filter(".mw-revslider-container, .mw-diff-revision-history-links, #mw-oldid").addClass("instantDiffs-hidden"),this.links.prev=this.article.get("type")==="revision"?h(this.configManager.get("wgDiffOldId")):this.nodes.$prev.attr("href"),this.links.next=this.nodes.$next.attr("href")}processRevision(){this.nodes.$diffTitle=this.nodes.$data.filter(".diff-currentversion-title"),l.get("showRevisionInfo")||this.nodes.$diffMobileFooter.addClass("instantDiffs-hidden"),qe(this.nodes.$table),this.processCategories(),this.nodes.$data.find(".mw-diff-slot-header, .mw-slot-header").addClass("instantDiffs-hidden")}processFlaggedRevs(){this.nodes.$frDiffHeader=this.nodes.$data.filter("#mw-fr-diff-headeritems").insertBefore(this.nodes.$table),this.nodes.$unpatrolled=this.nodes.$frDiffHeader.find(".fr-diff-to-stable a").attr("data-instantdiffs-link","none").addClass("instantDiffs-hidden"),this.article.get("type")==="diff"&&(this.links.unpatrolled=this.nodes.$unpatrolled.attr("href")),this.article.get("type")==="revision"&&(l.get("showRevisionInfo")?this.nodes.$frDiffHeader.find(".fr-diff-ratings td:nth-child(2n-1)").addClass("instantDiffs-hidden"):this.nodes.$frDiffHeader.addClass("instantDiffs-hidden")),this.nodes.$data.find(".fr-diff-to-stable, #mw-fr-diff-dataform").addClass("instantDiffs-hidden")}processCategories(){a(this.data)||a(this.parse)||a(this.parse.categorieshtml)||(this.nodes.$categories=$(this.parse.categorieshtml).appendTo(this.nodes.$body))}restoreFunctionalityEmbed(){if(this.error)return;js("mediawiki.misc-authed-curate"),yi(this.nodes.$body);let e=[];if(this.article.get("type")==="diff"&&l.get("showDiffTools")){let t=vi(this.nodes.$diffTablePrefix);t&&e.push(t);let s=ki(this.nodes.$diffTablePrefix);s&&e.push(s)}if(this.nodes.$diffTablePrefix?.length>0){let t=this.nodes.$diffTablePrefix.children(":visible").length>0;this.nodes.$diffTablePrefix.toggleClass("instantDiffs-hidden",!t||e.length===0)}if(this.nodes.$wikiLambdaApp=this.nodes.$body.find("#ext-wikilambda-app"),this.nodes.$wikiLambdaApp.length>0){let t=$(ue("dialog-notice-wikilambda"));this.renderWarning({$content:t,type:"notice",container:this.nodes.$wikiLambdaApp,insertMethod:"insertBefore"})}}restoreFunctionalityWithDependencies(){this.error||this.nodes.$wikiLambdaApp.length>0&&xi(this.nodes.$wikiLambdaApp)}async fire(){this.restoreFunctionalityEmbed(),this.article.get("type")==="revision"&&!this.isDependenciesLoaded&&await this.requestPage(),this.restoreFunctionalityWithDependencies(),await super.fire()}},Dt=Ki});var vo,Ji,Lt,Yi=m(()=>{P();x();ht();X();Le();B();yt();ee();({h:vo}=b),Ji=class extends ye{type="foreign";compare;parse;linkTags=[];constructor(e,t){super(e,{...t,fireDiffHook:!1})}getLoadPromises(){return[this.requestMessages(),this.requestSiteInfo(),...super.getLoadPromises()]}getLoadSecondaryPromises(){let e=super.getLoadSecondaryPromises();return this.article.get("type")==="revision"&&e.push(this.requestRevision()),e}requestProcess(){let e=this.article.getValues(),t={action:"compare",prop:["title","ids","rel","timestamp","user","diff","parsedcomment"],fromrev:h(e.oldid)?e.oldid:void 0,fromrelative:M(e.oldid)?e.oldid:void 0,torev:h(e.diff)?e.diff:void 0,difftype:ge()?"inline":"table",format:"json",formatversion:2,uselang:o.local.userLanguage};return e.type==="diff"&&!h(e.diff)&&(t.torelative=M(e.diff)?e.diff:"prev"),e.type==="revision"&&!h(e.diff)&&(t.torelative=M(e.direction)?e.direction:"prev"),e.typeVariant==="page"&&h(e.curid)&&(t.fromid=e.curid,t.torelative="cur"),this.requestManager.get(t,this.article)}onRequestDone=e=>{this.data=e?.compare};async requestSiteInfo(){let e=["general","namespaces","namespacealiases"],t=await w.getSiteInfo(e,this.article,this.requestManager)||{};if(!T(t)){let s=t.general;T(s)||(this.article.set({hostname:s.servername}),this.configManager.setValues({wgServer:s.server,wgServerName:s.servername,wgMobileServer:s.mobileserver,wgMobileServerName:s.mobileservername}));let n=zt(this.article.get("hostname"));this.configManager.setValues(n),this.setConfigs()}}async requestMessages(){let e=["revisionasof","currentrev-asof","word-separator","pipe-separator","parentheses","talkpagelinktext","contribslink","changeslist-nocomment","rev-deleted-no-diff","rev-deleted-user","rev-deleted-comment","diff-empty"];await w.loadMessage(e)}async renderContent(){this.renderForeignWarning(),await super.renderContent()}async renderSuccessContent(){this.collectData(),this.setConfigs(),await this.renderDiffTable(),this.requestDependencies()}collectData(){this.configManager.setValues({wgArticleId:this.data.toid,wgRevisionId:this.data.torevid,wgDiffOldId:this.data.fromrevid,wgDiffNewId:this.data.torevid});let e=$("<span>").html(this.data.fromparsedcomment).find(".autocomment a");e.length>0&&(this.data.fromsection=K("hash",e.prop("href")));let t=$("<span>").html(this.data.toparsedcomment).find(".autocomment a");t.length>0&&(this.data.tosection=K("hash",t.prop("href")));let s={previd:this.data.prev,nextid:this.data.next,curid:this.configManager.get("wgArticleId"),revid:this.configManager.get("wgRevisionId"),title:ce(this.data),section:this.data.tosection,timestamp:this.data.totimestamp,user:this.data.touser,userhidden:this.data.touserhidden};this.data.fromid!==this.data.toid&&(s.page1=this.data.fromtitle,s.page2=this.data.totitle),this.article.set(s),this.configManager.setTitle(this.article.getMW("title")),this.links.prev=this.article.get("type")==="revision"?h(this.data.fromrevid):this.data.prev&&this.data.prev!==this.data.fromrevid,this.links.next=this.data.next&&this.data.next!==this.data.torevid}async renderDiffTable(){if(this.nodes.table=mi(this.data.body),(this.data.fromtexthidden||this.data.totexthidden)&&await this.renderDeletedWarning(),this.data.fromid){let e=dt({prefix:"o",title:this.data.fromtitle,revid:this.data.fromrevid,curRevid:this.article.get("curRevid"),hostname:this.article.get("hostname"),timestamp:this.data.fromtimestamp,texthidden:this.data.fromtexthidden,user:this.data.fromuser,userhidden:this.data.fromuserhidden,comment:this.data.fromparsedcomment,commenthidden:this.data.fromcommenthidden});I(e,this.nodes.table.deleted)}else this.nodes.table.added.colSpan=4,this.nodes.table.deleted.classList.add("instantDiffs-hidden");if(this.data.toid){let e=dt({prefix:"n",title:this.data.totitle,revid:this.data.torevid,curRevid:this.article.get("curRevid"),hostname:this.article.get("hostname"),timestamp:this.data.totimestamp,texthidden:this.data.totexthidden,user:this.data.touser,userhidden:this.data.touserhidden,comment:this.data.toparsedcomment,commenthidden:this.data.tocommenthidden});I(e,this.nodes.table.added)}else this.nodes.table.deleted.colSpan=4,this.nodes.table.added.classList.add("instantDiffs-hidden");if(this.nodes.$table=$(this.nodes.table.container).appendTo(this.nodes.$body),Q(this.nodes.$table,`https://${this.article.get("hostname")}`),this.article.get("type")==="revision"&&qe(this.nodes.$table),this.data.toid){let e=bi({title:this.data.totitle,revid:this.data.torevid,hostname:this.article.get("hostname"),user:this.data.touser,userhidden:this.data.touserhidden});I(e,this.nodes.$body,"prependTo")}}async renderErrorContent(){this.errorData?.code==="missingcontent"?await this.renderDeletedWarning():await super.renderErrorContent();let e=this.article.getValues(),t=this.errorData?.code==="missingcontent"?this.errorData.info.replace(/\D/g,""):null,s=[e.oldid,e.diff,t].filter(n=>!isNaN(n)&&n>0);this.configManager.setValues({wgDiffOldId:Math.min(...s),wgDiffNewId:Math.max(...s)}),this.setConfigs(),this.configManager.get("wgDiffOldId")!==this.configManager.get("wgDiffNewId")&&(this.links.prev=h(this.configManager.get("wgDiffOldId")),this.links.next=h(this.configManager.get("wgDiffNewId"))),this.options.initiatorPage=L.getPreviousPage()}renderForeignWarning(){let e=$(ue(`dialog-notice-foreign-${this.article.get("type")}`,`https://${this.article.get("hostname")}`,this.article.get("hostname")));this.nodes.$foreignWarning=this.renderWarning({$content:e,type:"notice"})}async renderDeletedWarning(){let e=await w.parseWikitext({title:this.article.get("title"),text:mw.msg("rev-deleted-no-diff")},this.article),t=$(e).find("p");this.nodes.$deleteWarning=this.renderWarning({$content:t,type:"warning",container:this.nodes.$foreignWarning,insertMethod:"insertAfter"})}requestRevision(){if(this.error)return $.Deferred().resolve().promise();let e={action:"parse",prop:["text","revid","modules","jsconfigvars","categorieshtml"],disablelimitreport:1,redirects:1,format:"json",formatversion:2,uselang:o.local.userLanguage},t=Math.max(this.article.get("revid"),this.article.get("oldid")),s=this.article.get("curid");return h(t)?e.oldid=t:h(s)&&(e.pageid=s),this.requestManager.get(e,this.article).then(n=>this.onRequestRevisionDone(n,e)).fail((n,r)=>this.onRequestRevisionError(n,r,e))}onRequestRevisionError=(e,t,s)=>{let n={message:e,type:"dependencies",tag:"page",article:this.article};t?.error&&(n.code=t.error.code,n.message=t.error.info);let r=s.oldid?"revid":"curid";E(`error-dependencies-${r}`,n)};onRequestRevisionDone=async(e,t)=>{if(this.parse=e?.parse,!this.parse)return this.onRequestRevisionError(null,e,t);await this.renderRevision()};async renderRevision(){this.configManager.setValues({wgArticleId:this.parse.pageid,wgRevisionId:Math.max(this.article.get("revid"),this.parse.revid),...this.parse.jsconfigvars}),this.article.setValues({curid:this.configManager.get("wgArticleId"),revid:this.configManager.get("wgRevisionId")}),this.setConfigs();let e=this.article.get("revid")===this.article.get("curRevid")?"currentrev-asof":"revisionasof";this.nodes.diffTitle=vo("h2",{class:"diff-currentversion-title"},mw.msg(e,je(this.data.totimestamp))),this.nodes.$diffTitle=$(this.nodes.diffTitle).appendTo(this.nodes.$body),this.nodes.$revision=$(this.parse.text).appendTo(this.nodes.$body),a(this.parse.categorieshtml)||(this.nodes.$categories=$(this.parse.categorieshtml).appendTo(this.nodes.$body)),await this.processRevision(),Q(this.nodes.$body,this.article.get("href")),this.requestDependencies(this.parse),this.requestForeignDependencies()}async processRevision(){if(this.nodes.$body.find("#ext-wikilambda-app, .ext-wikilambda-view-nojsfallback, .mw-diff-slot-header, .mw-slot-header").addClass("instantDiffs-hidden"),this.nodes.$wikiLambdaApp=this.nodes.$body.find("#ext-wikilambda-app"),this.nodes.$wikiLambdaApp.length>0){let e=$(`<p>${d("dialog-notice-foreign-wikilambda")}</p>`);this.renderWarning({$content:e,type:"notice",container:this.nodes.$wikiLambdaApp,insertMethod:"insertBefore"})}await this.restoreFunctionality()}requestForeignDependencies(){let e=Xt(this.article);Zt(this.article,e.modules),ei(this.article,e.styles),this.linkTags=ti(e.links)}detach(){this.isDetached||(super.detach(),ii(this.linkTags))}},Lt=Ji});var on=m(()=>{});var St,rn,an=m(()=>{j();St=class extends OO.ui.LabelWidget{static tagName="div";constructor(){super({classes:["oo-ui-messageDialog-message","is-transparent"]})}toggleVisibility(e){this.$element.toggleClass("is-transparent",!e)}};H(St);rn=St});var Pt,ln,cn=m(()=>{x();j();Pt=class extends OO.ui.ProgressBarWidget{toggleDelay;toggleTime;constructor(e){super({classes:["instantDiffs-view-loader","is-transparent"],progress:!1,inline:!0,...e})}toggleVisibility(e,t){if(this.toggleDelay&&clearTimeout(this.toggleDelay),t&&(this.toggle(e),Et(()=>this.$element.toggleClass("is-transparent",!e))),e===!0&&(this.toggleTime=Date.now(),this.toggle(!0),Et(()=>this.$element.removeClass("is-transparent"))),e===!1){if(!this.isVisible())return;let s=this.calculateRemainingTime(this.toggleTime,1e3),n=Math.max(s-150,0);this.toggleDelay=setTimeout(()=>{this.$element.addClass("is-transparent"),this.toggleDelay=setTimeout(()=>this.toggle(!1),150)},n)}}calculateRemainingTime(e,t=1e3){let n=(Date.now()-e)%t;return t-n}};H(Pt);ln=Pt});var fn={};_(fn,{default:()=>ko});var $t,ko,dn=m(()=>{x();j();an();cn();O();$t=class extends OO.ui.MessageDialog{static name="Instant Diffs Window";static size="instantDiffs";static actions=[{action:"close",label:d("action-close"),title:q("action-close","close")}];constructor(){super({classes:["instantDiffs-view"]})}initialize(){return super.initialize(),this.message.$element.remove(),this.message=new rn,this.text.$element.append(this.message.$element),this.$content.removeAttr("tabindex"),this.container.$element.attr("tabindex","-1"),l.get("closeOutside")&&(this.$clickOverlay=$("<div>").on("click",()=>this.close()).addClass("instantDiffs-view-overlay").appendTo(this.$element)),this.progressBar=new ln,this.$content.prepend(this.progressBar.$element),this}getSetupProcess(e){return super.getSetupProcess(e).next(()=>{Vs(),this.scrollContentTop(0),this.focus()})}onDialogKeyDown(e){super.onDialogKeyDown(e),!Xi()&&this.emit("hotkey",e)}getBodyHeight(){return"auto"}update(e){return this.getUpdateProcess(e).execute()}getUpdateProcess(e){return new OO.ui.Process().next(()=>{e={title:this.constructor.static.title,message:this.constructor.static.message,scrollTop:0,...e},this.toggleProgress(!1),this.title.setLabel(e.title),this.message.setLabel(e.message),this.scrollContentTop(k(e.scrollTop)?e.scrollTop():e.scrollTop),this.toggleVisibility(!0),this.focus()})}getTeardownProcess(e){return super.getTeardownProcess(e).next(()=>{this.toggleProgress(!1),this.toggleVisibility(!1)})}focus(e){return e?super.focus(e):this.container.$element.trigger("focus"),this}toggleVisibility(e){return this.message.toggleVisibility(e),this}toggleProgress(...e){return this.progressBar.toggleVisibility(...e),this}getContentOffsetTop(e,t=0){let s=0;if((_e(e)||e instanceof jQuery)&&(s=At(e,this.container.$element)?.top),typeof s=="number")return s+t}setScrollOffsetTop(e=0){return this.container.$element.css("--instantDiffs-view-scroll-padding-top",`${e}px`),this}scrollContentTop(e=0,t=0){let s=0;return typeof e=="number"&&(s=e),(_e(e)||e instanceof jQuery)&&(s=At(e,this.container.$element)?.top),typeof s=="number"&&this.container.$element.scrollTop(s+t),this}};H($t);ko=$t});var Zi,L,ee=m(()=>{P();x();j();Ee();pi();Qi();Yi();O();on();Zi=class{static sizes={compact:{width:800,height:"auto"},standard:{width:1200,height:"auto"},wide:{width:1600,height:"auto"}};static getSize(e){return this.sizes[e]}link;page;options={};opener={link:null,options:{}};initiator={link:null,options:{}};previousInitiator={link:null,options:{}};document={};loadPromise;isDependenciesLoaded=!1;isConstructed=!1;isOpen=!1;isLoading=!1;isRequesting=!1;isProcessing=!1;mixin(){OO.EventEmitter.call(this)}setup(e,t){if(this.isRequesting||this.isProcessing)return!1;if(o.timers.dialogProcesStart=mw.now(),this.link=e,this.options={initiatorPage:null,onOpen:()=>{},onClose:()=>{},...t},!this.isOpen){this.opener.link=this.link,this.opener.options={...this.options};let s={};this.opener.link.getMW?.().hasLine&&(s.filterType=this.opener.link.getArticle().get("type"),s.filterMWLine=!0),be.newInstance(s)}if(this.link instanceof C){let s=this.link.getInitiatorLink();be.instance.hasLink(s)&&(this.previousInitiator={...this.initiator},this.initiator.link=s,this.initiator.options={...this.options},be.instance.setLink(this.initiator.link))}return!0}load(){return this.isLoading?this.loadPromise:this.isDependenciesLoaded?(this.open(),!0):(this.isLoading=!0,this.error=null,this.loadPromise=$.when(mw.loader.using(this.getDependencies())).then(this.onLoadSuccess.bind(this)).fail(this.onLoadError.bind(this)),this.loadPromise)}getDependencies(){return de([...o.config.dependencies.window,...o.config.dependencies.content])}onLoadError(e){this.isLoading=!1,this.isDependenciesLoaded=!1,this.error={type:"dependencies",tag:"view",message:e&&e.message?e.message:null},E("error-dependencies-generic",this.error)}onLoadSuccess(){this.isLoading=!1,this.isDependenciesLoaded=!0,st(),this.open()}construct(){this.isConstructed=!0;let e=(dn(),De(fn)).default;this.dialog=new e,this.dialog.connect(this,{hotkey:t=>this.emit("hotkey",t)}),this.manager=nt(),this.manager.addWindows([this.dialog])}open(){if(this.isConstructed||this.construct(),!this.isOpen){this.document.scrollableRoot=OO.ui.Element.static.getRootScrollableElement(document.body),this.document.scrollTop=this.document.scrollableRoot.scrollTop;let e=this.link.getArticle(),t={title:e.get("titleText")||e.get("title"),size:oi()};this.windowInstance=this.manager.openWindow(this.dialog,t),this.windowInstance.opening.then(this.onOpening.bind(this)),this.windowInstance.opened.then(this.onOpen.bind(this)),this.windowInstance.closing.then(this.onClosing.bind(this)),this.windowInstance.closed.then(this.onClose.bind(this))}this.request()}onOpening(){this.emit("opening")}onOpen(){this.isOpen=!0,k(this.options.onOpen)&&this.options.onOpen(this),this.emit("opened")}onClosing(){this.emit("closing")}onClose(){this.isOpen=!1,this.isRequesting=!1,this.isProcessing=!1,this.previousPage&&(this.previousPage.detach(),this.previousPage=null),this.page&&(this.page.detach(),this.page=null),k(this.options.onClose)&&this.options.onClose(this),k(this.opener.options.onClose)&&this.opener.link!==this.link&&this.opener.options.onClose(this),k(this.initiator.options.onClose)&&this.initiator.link!==this.link&&this.initiator.options.onClose(this),this.opener={link:null,options:{}},this.initiator={link:null,options:{}},this.previousInitiator={link:null,options:{}},this.document.scrollableRoot.scrollTop=this.document.scrollTop,this.emit("closed")}onUpdate(){this.fire(),this.previousInitiator.link instanceof C&&this.opener.link!==this.previousInitiator.link&&k(this.previousInitiator.options.onClose)&&this.previousInitiator.options.onClose(this),this.initiator.link instanceof C&&this.opener.link!==this.initiator.link&&k(this.initiator.options.onOpen)&&this.initiator.options.onOpen(this),this.emit("updated")}request(){this.isRequesting=!0,this.isProcessing=!0,this.error=null,this.previousPage=this.page,this.dialog.toggleProgress(!0),this.previousPage&&this.previousPage.restoreConfigs();let e=this.link.getArticle(),t={initiatorAction:this.previousPage?.getNavigation()?.getActionRegister(),initiatorPage:this.options.initiatorPage},s=e.get("hostname"),n=Z(s)?Lt:Dt;this.page=new n(e,t),this.page.connect(this,{focus:"focus",close:"close"}),$.when(this.page.load()).always(this.onRequestResponse.bind(this))}onRequestResponse(){if(this.isRequesting=!1,!this.page||this.page.isDetached)return;let e={title:this.page.getArticleTitleText(),message:this.page.getContainer(),scrollTop:this.getContentOffset.bind(this)};this.dialog.update(e).then(this.onUpdate.bind(this))}refresh(){return this.isRequesting||this.isProcessing?!1:(o.timers.dialogProcesStart=mw.now(),this.load())}fire(){this.previousPage&&this.previousPage.detach(),$.when(this.page.fire()).always(()=>{this.setContentOffset(),o.timers.dialogProcesEnd=mw.now(),l.get("logTimers")&&he("dialog process time",o.timers.dialogProcesStart,o.timers.dialogProcesEnd),this.isProcessing=!1})}focus(){this.dialog.focus()}close(){this.dialog.close()}getContentOffset(){let e=this.page.getScrollableSection(),t=this.page.getScrollableOffsetTop();return this.dialog.getContentOffsetTop(e,-t)}setContentOffset(){let e=this.page.getArticle();e&&e.get("type")==="revision"&&(this.dialog.setScrollOffsetTop(this.page.getScrollableOffsetTop()),this.dialog.scrollContentTop(this.getContentOffset()))}getLink(){return this.link}getPage(){return this.page}getPreviousPage(){return this.previousPage}getDialog(){return this.dialog}isContains(e){return this.dialog?.$content.get(0).contains(e)}},L=new Zi});function yo(){un.call(this,this.getField("linksFormat"))}function un(){let i=this.getFieldValue("linksHash"),e=this.getFieldValue("linksFormat"),s=pn({relative:!1,hash:i,minify:e==="minify"});this.setFieldHelp("linksFormat",s),hn.call(this,this.getField("wikilinksFormat"))}function hn(){let i=this.getFieldValue("linksHash"),e=this.getFieldValue("linksFormat"),t=this.getFieldValue("wikilinksFormat"),n=pn({relative:!1,hash:i,minify:e==="minify",wikilink:!0,wikilinkPreset:t});this.setFieldHelp("wikilinksFormat",n)}function pn(i){let e=d("copy-wikilink-example-title"),t=N({title:e,diff:"12345",type:"diff",section:"Section"},{},i),s=N({title:e,oldid:"12345",type:"revision",section:"Section"},{},i),n=N({title:e,curid:"12345",type:"revision",typeVariant:"page",section:"Section"},{},i);return xe("ul.instantDiffs-list--settings",xe("li",xe("i",t)),xe("li",xe("i",s)),xe("li",xe("i",n)))}function xo(){let i=L.getPage()?.getNavigation()?.getPinnableActions();if(!i)return{};let e=new Set,t=i.map(n=>(e.add(n.name),[n.name,{label:n.label}]));return(l.get("pinnedActions")||[]).forEach(n=>{e.has(n)||t.push([n,{label:n,show:!1}])}),Object.fromEntries(t)}var xe,Ge,es=m(()=>{x();X();ee();O();({h:xe}=b),Ge={general:{config:{labelMsg:"settings-fieldset-general"},fields:{enableMobile:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-enable-mobile",helpMsg:"settings-enable-mobile-help"}},notifyErrors:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-notify-errors"}}}},links:{config:{labelMsg:"settings-fieldset-links"},fields:{showLink:{type:"checkbox",enabled:!0,default:!1,config:{labelMsg:"settings-show-link",helpMsg:"settings-show-link-help"}},showPageLink:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-show-page-link",helpMsg:"settings-show-page-link-help"}},highlightLine:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-highlight-line"}},markWatchedLine:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-mark-watched-line"}}}},dialog:{config:{labelMsg:"settings-fieldset-dialog"},fields:{viewWidth:{type:"buttonSelect",enabled:!0,default:"standard",config:{labelMsg:"settings-view-width",helpMsg:"settings-view-width-help"},optionsType:"buttonOption",options:{compact:{labelMsg:"settings-view-width-compact",titleMsg:["settings-view-width-option-title",L.constructor.getSize("compact").width]},standard:{labelMsg:"settings-view-width-standard",titleMsg:["settings-view-width-option-title",L.constructor.getSize("standard").width]},wide:{labelMsg:"settings-view-width-wide",titleMsg:["settings-view-width-option-title",L.constructor.getSize("wide").width]},full:{labelMsg:"settings-view-width-full",titleMsg:"settings-view-width-full-title"}}},closeOutside:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-close-outside"}},enableHotkeys:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-enable-hotkeys"}},showDiffTools:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-show-diff-tools"}},showRevisionInfo:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-show-revision-info"}},unHideDiffs:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-unhide-diffs",helpMsg:["settings-unhide-diffs-help","suppressrevision"]}},openInNewTab:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-open-in-new-tab"}}}},menu:{config:{labelMsg:"settings-fieldset-menu"},fields:{showMenuIcons:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-show-menu-icons"}},showWatchlistPopup:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-show-watchlist-popup",helpMsg:"settings-show-watchlist-popup-help"}},linksHash:{type:"checkbox",enabled:!0,default:!1,config:{labelMsg:"settings-links-hash",helpMsg:"settings-links-hash-help"},onChange:yo},linksFormat:{type:"radioSelect",enabled:!0,default:"full",config:{labelMsg:"settings-links-format",helpMsg:"placeholder"},optionsType:"radioOption",options:{full:{labelMsg:"settings-links-format-full"},minify:{labelMsg:"settings-links-format-minify"}},onSelect:un},wikilinksFormat:{type:"radioSelect",enabled:!0,default:"special",config:{labelMsg:"settings-wikilinks-format",helpMsg:"placeholder"},optionsType:"radioOption",options:{link:{labelMsg:"settings-wikilinks-format-link"},special:{labelMsg:"settings-wikilinks-format-special"}},onSelect:hn}}},pinnedActions:{config:{labelMsg:"settings-fieldset-pinned-actions"},fields:{pinnedActions:{type:"checkboxMultiselect",enabled:!0,default:["copyLink"],config:{labelMsg:"settings-pinned-actions",helpMsg:"settings-pinned-actions-help"},optionsType:"checkboxMultioption",options:xo}}}}});var os={};_(os,{getQueryDefaults:()=>ns,getSchemaDefaults:()=>ss,getSchemaSettings:()=>is,renderNoticeBox:()=>Tt});function is(){let e=Object.values(Ge).flatMap(t=>Object.entries(t.fields)).map(([t,s])=>[t,s.enabled]);return Object.fromEntries(e)}function ss(){let e=Object.values(Ge).flatMap(t=>Object.entries(t.fields)).map(([t,s])=>[t,s.default]);return Object.fromEntries(e)}function ns(){let i=rs(document.currentScript?.src)?.instantdiffs||{},e=Object.entries(i).map(([t,s])=>[t,s==="true"?!0:s==="false"?!1:s]);return Object.fromEntries(e)}function Tt(i){i={modifiers:[],content:null,image:null,alt:null,...i};let e=["instantDiffs-notice-box"];return i.modifiers.forEach(t=>e.push(`instantDiffs-notice-box--${t}`)),ts("div",{class:e},ts("img",{src:`${o.config.commonsAssetsPath}${i.image}`,alt:i.alt}),ts("h5",i.content))}var ts,Ot=m(()=>{P();x();es();({h:ts}=b)});var gn=m(()=>{});var mn={};_(mn,{default:()=>Do});var Ct,Do,wn=m(()=>{P();x();j();Ot();es();O();Ct=class extends OO.ui.ProcessDialog{static name="Instant Diffs Settings";static title=d("settings-title");static actions=[{action:"save",modes:"edit",label:d("action-save"),flags:["primary","progressive"]},{action:"reload",modes:"finish",label:d("action-reload"),flags:["primary","progressive"]},{action:"close",modes:"empty",label:d("action-close"),flags:["primary","progressive"]},{modes:["edit","finish","empty"],label:d("action-close"),title:d("action-close"),invisibleLabel:!0,icon:"close",flags:["safe","close"]}];panels={};tabs={};visibleTabWidgets=[];fields={};constructor(){super({classes:["instantDiffs-settings"]})}initialize(...e){super.initialize(...e),this.panels.edit=this.renderEditPanel(),this.panels.finish=this.renderFinishPanel(),this.panels.empty=this.renderEmptyPanel(),this.stackLayout=new OO.ui.StackLayout({items:[this.panels.edit,this.panels.finish,this.panels.empty]}),this.$body.append(this.stackLayout.$element)}renderEditPanel(){return new OO.ui.PanelLayout({classes:["instantDiffs-settings-panel","instantDiffs-settings-panel--edit"],padded:!1,expanded:!0})}renderFinishPanel(){return new OO.ui.PanelLayout({classes:["instantDiffs-settings-panel","instantDiffs-settings-panel--finish"],padded:!0,expanded:!0})}renderEmptyPanel(){return new OO.ui.PanelLayout({classes:["instantDiffs-settings-panel","instantDiffs-settings-panel--empty"],padded:!0,expanded:!0})}setPanel(e){this.panels[e]&&(this.actions.setMode(e),this.stackLayout.setItem(this.panels[e]))}renderContents(){this.renderEditContent(),this.renderFinishContent(),this.renderEmptyContent(),this.processLinksAttr(this.stackLayout.$element)}renderEditContent(){for(let[t,s]of Object.entries(Ge))this.tabs[t]=this.renderTab(t,s);this.visibleTabWidgets=Object.values(this.tabs).map(t=>t.tab).filter(t=>t.isVisible());let e=new OO.ui.IndexLayout({expanded:!0,framed:!1});e.addTabPanels(this.visibleTabWidgets,0),this.panels.edit.$element.empty().append(e.$element)}renderFinishContent(){let t=Tt({image:"/6/6f/Eo_circle_light-green_checkmark.svg",content:d("settings-saved"),alt:d("settings-saved-icon")});this.panels.finish.$element.empty().append(t)}renderEmptyContent(){let e=["/2/2f/Cappuccino.svg","/c/ca/Coffe.svg","/9/9a/Coffee_cup_icon.svg","/1/1a/Applications-ristretto.svg","/f/f7/Cup-o-coffee-simple.svg"],t=Math.floor(Math.random()*e.length),s=e[t]||e[0],n=Tt({image:s,content:d("settings-empty"),alt:d("settings-empty-icon"),modifiers:["empty"]});this.panels.empty.$element.empty().append(n)}renderTab(e,t){t=J({name:e,fields:{},fieldset:null,tab:null,config:{label:null}},t),t.config=this.validateFieldConfig(t.config);for(let[r,c]of Object.entries(t.fields))this.fields[r]=t.fields[r]=this.renderField(r,c);let s=Object.values(t.fields).map(r=>r.field);t.fieldset=new OO.ui.FieldsetLayout().addItems(s);let n=Object.keys(t.fields).map(r=>l.check(r)).some(r=>r===!0);return t.tab=new OO.ui.TabPanelLayout(t.name,{...t.config,content:[t.fieldset]}).toggle(n),t}renderField(e,t){t=J({name:e,type:null,input:null,field:null,config:{label:null,align:"inline",help:null,helpInline:!0},optionsType:null,options:{},onSelect:()=>{},onChange:()=>{}},t),t.config=this.validateFieldConfig(t.config),k(t.options)&&(t.options=t.options.call(this,t));for(let[n,r]of Object.entries(t.options))t.options[n]=this.renderInputOption(n,r,t.optionsType);let s=Object.values(t.options).map(n=>n.option);switch(t.type){case"checkbox":t.input=new OO.ui.CheckboxInputWidget;break;case"radioSelect":t.input=new OO.ui.RadioSelectWidget({items:s});break;case"buttonSelect":t.input=new OO.ui.ButtonSelectWidget({items:s});break;case"checkboxMultiselect":t.input=new OO.ui.CheckboxMultiselectWidget({items:s});break}return k(t.onSelect)&&t.input.on("select",()=>t.onSelect.call(this,t)),k(t.onChange)&&t.input.on("change",()=>t.onChange.call(this,t)),t.field=new OO.ui.FieldLayout(t.input,t.config).toggle(l.check(t.name)),t}renderInputOption(e,t,s){switch(t=J({name:e,type:s,data:e,option:null,show:!0},t),t=this.validateFieldConfig(t),t.type){case"radioOption":t.option=new OO.ui.RadioOptionWidget(t);break;case"buttonOption":t.option=new OO.ui.ButtonOptionWidget(t);break;case"checkboxMultioption":t.option=new OO.ui.CheckboxMultioptionWidget(t);break}return t.option.toggle(t.show),t}validateFieldConfig(e){return[{key:"labelMsg",target:"label",useDom:!0},{key:"titleMsg",target:"title",useDom:!1},{key:"helpMsg",target:"help",useDom:!0}].forEach(({key:s,target:n,useDom:r})=>{let c=e[s];if(!c)return;let p=r?ue:d;e[n]=Array.isArray(c)?p(...c):p(c)}),e}getField(e){return this.fields[e]}getFields(){return this.fields}getFieldValue(e){let t=this.getField(e);if(t){if(["checkbox"].includes(t.type))return t.input.isSelected();if(["radioSelect","buttonSelect"].includes(t.type))return t.input.findFirstSelectedItem()?.getData();if(["checkboxMultiselect"].includes(t.type))return t.input.findSelectedItemsData()}}getFieldValues(){let e={};for(let[t]of Object.entries(this.fields))e[t]=this.getFieldValue(t);return e}setFieldValue(e,t){let s=this.getField(e);if(s)return["checkbox"].includes(s.type)&&s.input.setSelected(t),["radioSelect","buttonSelect"].includes(s.type)&&s.input.selectItemByData(t),["checkboxMultiselect"].includes(s.type)&&s.input.selectItemsByData(t),this}setFieldHelp(e,t){let s=this.getField(e);if(s)return s.field.$help.empty().append(t),this}setFieldDisabled(e,t){let s=this.getField(e);if(s)return s.input.setDisabled(t),this}getSetupProcess(e){return super.getSetupProcess(e).next(()=>{this.$body.scrollTop(0),this.processActionRequest()})}getActionProcess(e){return e==="save"?new OO.ui.Process(()=>this.processActionSave()):e==="reload"?new OO.ui.Process(()=>this.processActionReload()):e==="close"?new OO.ui.Process(()=>this.close()):super.getActionProcess(e)}processLinksAttr(e){e.find("a:not(.jquery-confirmable-element)").each((s,n)=>n.setAttribute("target","_blank")),Q(e,o.config.origin)}getBodyHeight(){return 500}processActionRequest(){this.pushPending(),this.renderContents(),this.setPanel(this.visibleTabWidgets.length>0?"edit":"empty");for(let[e]of Object.entries(this.fields))this.setFieldDisabled(e,!0);l.request().then(this.onActionRequestSuccess).fail(this.onActionRequestError).always(()=>this.popPending())}onActionRequestError=(e,t)=>{let s={type:"settings",message:e};t?.error&&(s.code=t.error.code,s.message=t.error.info);let n=new OO.ui.Error(se("error-setting-request",s),{recoverable:!0});this.showErrors(n)};onActionRequestSuccess=e=>{if(o.local.mwIsAnon)return this.update();let t=e?.query?.userinfo?.options;if(!t)return this.onActionRequestError(null,e);try{let s=JSON.parse(t[`${o.config.settingsPrefix}-settings`]);l.set(s,!0)}catch{}this.update()};update(){return this.getUpdateProcess().execute()}getUpdateProcess(){return new OO.ui.Process(()=>{this.setPanel(this.visibleTabWidgets.length>0?"edit":"empty"),this.processActionUpdate(l.get())})}processActionUpdate(e){this.popPending();for(let[t]of Object.entries(this.fields)){this.setFieldDisabled(t,!1);let s=e[t];typeof s>"u"||this.setFieldValue(t,s)}}processActionSave(){this.pushPending(),l.save(this.getFieldValues()).then(this.onActionSaveSuccess).fail(this.onActionSaveError).always(()=>this.popPending())}onActionSaveError=(e,t)=>{let s={type:"settings",message:e};t?.error&&(s.code=t.error.code,s.message=t.error.info);let n=new OO.ui.Error(se("error-setting-save",s),{recoverable:!0});this.showErrors(n)};onActionSaveSuccess=()=>{this.setPanel("finish")};processActionReload(){this.pushPending(),window.location.reload()}};H(Ct);Do=Ct});var as,l,O=m(()=>{P();x();Ot();j();B();gn();as=class{static utils=os;loadPromise;isDependenciesLoaded=!1;isConstructed=!1;isOpen=!1;isLoading=!1;isRequesting=!1;isSaving=!1;mixin(){OO.EventEmitter.call(this)}load(){return this.isLoading?this.loadPromise:this.isDependenciesLoaded?(this.open(),!0):(this.isLoading=!0,this.error=null,this.loadPromise=$.when(mw.loader.using(de(o.config.dependencies.settings))).then(this.onLoadSuccess).fail(this.onLoadError),this.loadPromise)}onLoadError=e=>{this.isLoading=!1,this.isDependenciesLoaded=!1,this.error={type:"dependencies",tag:"settings",message:e?.message},E("error-dependencies-generic",this.error)};onLoadSuccess=()=>{this.isLoading=!1,this.isDependenciesLoaded=!0,st(),this.open()};construct(){this.isConstructed=!0;let e=(wn(),De(mn)).default;this.dialog=new e,this.manager=nt(),this.manager.addWindows([this.dialog])}open(){this.isOpen||(this.isConstructed||this.construct(),this.windowInstance=this.manager.openWindow(this.dialog),this.windowInstance.opening.then(this.onOpening),this.windowInstance.opened.then(this.onOpen),this.windowInstance.closing.then(this.onClosing),this.windowInstance.closed.then(this.onClose))}onOpening=()=>{this.emit("opening")};onOpen=()=>{this.isOpen=!0,this.emit("opened")};onClosing=()=>{this.emit("closing")};onClose=()=>{this.isOpen=!1,this.emit("closed")};request(){if(o.local.mwIsAnon)return $.Deferred().resolve().promise();this.isRequesting=!0;let e={action:"query",meta:"userinfo",uiprop:"options",format:"json",formatversion:2,uselang:o.local.userLanguage};return w.post(e).always(this.onRequestResponse)}onRequestResponse=()=>{this.isRequesting=!1};save(e){return this.set(e,!0),o.local.mwIsAnon?$.Deferred().resolve().promise():(this.isSaving=!0,de(["ext.GlobalPreferences.global"]).length>0?this.saveGlobal(e):this.saveLocal(e))}saveLocal(e){let t=[`${o.config.settingsPrefix}-settings`,JSON.stringify(e)],s=w.getApi();return s.saveOption.apply(s,t).always(this.onSaveResponse)}saveGlobal(e){let t={action:"globalpreferences",optionname:`${o.config.settingsPrefix}-settings`,optionvalue:JSON.stringify(e)};return w.getApi().postWithEditToken(t).always(this.onSaveResponse)}onSaveResponse=()=>{this.isSaving=!1};get(e,t){if(t){let s=Object.entries(o.local.defaults).filter(([r])=>r in o.config.settings),n=Object.fromEntries(s);return e?n[e]:n}return e?o.local.defaults[e]:o.local.defaults}check(e){return e?o.local.settings[e]:o.local.settings}set(e,t){o.local.defaults={...o.local.defaults,...e};let s=this.get(void 0,!0);if(mw.storage.setObject(`${o.config.prefix}-settings`,s),t){let n=JSON.stringify(s);k(o.GM?.setValue)&&o.GM.setValue("settings",n),o.local.mwIsAnon||mw.user?.options?.set(o.config.settingsPrefix,n)}}async processDefaults(){let e={};try{e={...e,...mw.storage.getObject(`${o.config.prefix}-settings`)}}catch{}if(k(o.GM?.getValue))try{e={...e,...JSON.parse(await o.GM.getValue("settings"))}}catch{}if(!o.local.mwIsAnon)try{e={...e,...JSON.parse(mw.user.options.get(`${o.config.settingsPrefix}-settings`))}}catch{}this.set(e,!1)}},l=new as});var b={};_(b,{addBaseToLinks:()=>Q,addClick:()=>Ne,addTargetToLinks:()=>fe,arrayIntersperse:()=>Bi,clearWhitespaces:()=>xt,clipboardWriteLink:()=>He,embed:()=>I,getBodyContentNode:()=>$e,getCanonicalSpecialPage:()=>Ze,getCompareSection:()=>Pe,getCompareTitle:()=>ce,getComponentFromUrl:()=>K,getDependencies:()=>de,getErrorMessage:()=>se,getErrorStatusText:()=>_i,getHref:()=>Ke,getLabel:()=>we,getMissingDependencies:()=>it,getMobileServer:()=>cs,getMsgKey:()=>ze,getMsgParams:()=>Rt,getOffsetRelativeToContainer:()=>At,getParamFromUrl:()=>Te,getPlaceholderClasses:()=>ct,getRevisionSection:()=>ui,getSpecialPageAliases:()=>Nt,getTarget:()=>Ve,getTargetFromFragment:()=>Gi,getTitleFromUrl:()=>Li,getURL:()=>Wt,h:()=>F,hf:()=>fs,hint:()=>ls,hj:()=>Eo,hs:()=>Po,ht:()=>xn,inArray:()=>wt,isActiveElement:()=>Xi,isAllowed:()=>pe,isArray:()=>z,isBoolean:()=>vn,isBreakpoint:()=>Lo,isCompareHidden:()=>lt,isElement:()=>_e,isEmpty:()=>a,isEmptyObject:()=>T,isForeign:()=>Z,isFunction:()=>k,isMF:()=>ge,isMessageExists:()=>Fe,isNew:()=>We,isObject:()=>Ae,isRevisionHidden:()=>di,isString:()=>R,isToggleKey:()=>kn,isValidDir:()=>M,isValidID:()=>h,log:()=>ne,logException:()=>ve,logTimer:()=>he,moduleRequire:()=>Ue,msg:()=>d,msgDom:()=>ue,msgHint:()=>q,msgParse:()=>So,notifyError:()=>E,notifyMsg:()=>yn,onSchedule:()=>Et,optionsMerge:()=>J,origin:()=>kt,outerHeight:()=>Ui,parseQuery:()=>rs,processMessages:()=>It,removeClick:()=>Vi,renderLabel:()=>vt,renderMessageBox:()=>zi,renderPlaceholder:()=>Qe,semverCompare:()=>Wi,server:()=>Mt,setHTML:()=>Si,spacesToUnderlines:()=>tt,textDom:()=>ft});function a(i){return!i||i.length===0}function T(i){return!i||!Ae(i)||Object.keys(i).length===0}function R(i){return typeof i=="string"}function vn(i){return typeof i=="boolean"}function k(i){return typeof i=="function"}function z(i){return Array.isArray(i)}function Ae(i){return i&&typeof i=="object"&&!Array.isArray(i)}function kn(i){return i.type==="click"||i.type==="keypress"&&["Enter","Space"].includes(i.code)}function _e(i){return i instanceof Element||i instanceof HTMLElement}function Xi(){let i=["button","submit","reset","file","checkbox","radio","range","color","image","hidden"],e=document.activeElement;return!e||e.contentEditable==="true"||e.tagName==="TEXTAREA"||e.tagName==="INPUT"&&!i.includes(e.type)}function kt(i){return`${o.config.origin}${i}`}function Mt(i){return`${o.config.server}${i}`}function de(i){return i.filter(e=>{let t=mw.loader.getState(e);return t&&!["error","missing"].includes(t)})}function it(i){return i.filter(e=>{let t=mw.loader.getState(e);return!["ready","registered"].includes(t)})}function Ue(i){return o.local.require(i)}function We(){return o.local.lastVersion!==o.config.version}function pe(){return!l.get("standalone")&&o.config.include.pageActions.includes(mw.config.get("wgAction"))&&!o.config.exclude.pages.includes(mw.config.get("wgCanonicalSpecialPageName"))}function Z(i){return!a(i)&&!o.local.mwServerNames.includes(i)}function ge(){return document.readyState==="complete"?document.body.classList.contains("mw-mf"):!a(mw.config.get("wgMFMode"))}function Lo(i){return i=o.config.breakpoints[i],i?window.matchMedia(i):!1}function Et(i){requestAnimationFrame(()=>{requestAnimationFrame(i)})}function ne(i,e,t){let s=console[i];if(!s)return;let n=Fe("script-name")?d("script-name"):"Instant Diffs";/\.$/.test(e)||(e=`${e}.`);let r=[`${n}: ${e}`];z(t)?r.push(...t):a(t)||r.push(t),s(...r)}function ve(i,e,t){let s=`Exception in "${i}"`;a(e)||(s=`${s}: ${e}`),ne("warn",s,t)}function he(i,e,t){let s=t-e;s<1e3?s=`${Math.round(s)}ms`:s=`${(s/1e3).toFixed(2)}s`,ne("info",`${i}: ${s}`)}function tt(i){return i.replace(/ /g,"_")}function Wi(i,e){return i=i.split("-").shift(),e=e.split("-").shift(),i.localeCompare(e,void 0,{numeric:!0,sensitivity:"case",caseFirst:"upper"})}function Bi(i,e){if(!Array.isArray(i)||i.length===0)return i;let t=_e(e);return i.flatMap((s,n)=>{if(n<i.length-1){let r=t?e.cloneNode(!0):e;return[s,r]}return[s]})}function wt(i,e){return z(i)?i.includes(e):R(i)&&R(e)?i===e:!1}function J(...i){return i.reduce((e,t)=>(Object.keys(t).forEach(s=>{let n=e[s],r=t[s];Ae(n)&&Ae(r)?e[s]=J(n,r):e[s]=r}),e),{})}function d(){return mw.msg.apply(mw.msg,Rt(arguments))}function ls(i){return i=`hint-${i}`,`[${d(i)}]`}function q(i,e,t=!0){return i=d(i),t&&(i=`${i} ${ls(e)}`),i.trim()}function So(){return mw.message.apply(mw.message,Rt(arguments)).parse()}function ue(){return mw.message.apply(mw.message,Rt(arguments)).parseDom()}function ft(i){return mw.messages.set({[ze("buffer")]:i}),ue("buffer")}function Fe(i){return a(i)?!1:mw.message(ze(i)).exists()}function It(){if(o.local.userLanguage=mw.config.get("wgUserLanguage"),o.local.userLanguage==="qqx"){o.local.language=o.local.userLanguage;return}o.local.language=o.i18n[o.local.userLanguage]?o.local.userLanguage:"en",o.local.messages=o.i18n[o.local.language]||{},o.local.language!=="en"&&(o.local.messages={...o.i18n.en,...o.local.messages});let i={};for(let[e,t]of Object.entries(o.local.messages))i[ze(e)]=t;mw.messages.set(i)}function ze(i){return`${o.config.messagePrefix}-${i}`}function Rt(i){return a(i[0])||(i[0]=ze(i[0])),i}function _i(i){if(Number.isInteger(i)){if(i===0)return d("error-offline");if(i>=400&&i<500)return d("error-revision-missing");if(i>500)return d("error-server")}}function se(i,e){i=Fe(i)?i:"error-generic",e={...e};let t={...e.article?.getValues()},s=d(i,t.oldid||t.curid||t.page1||t.rev1,t.diff||t.page2||t.rev2,t.titleText||t.title,e.message||d("error-wasted"));return/\.$/.test(s)||(s=`${s}.`),s}function E(i,e){if(e={article:null,silent:null,...e},e.silent=vn(e.silent)?e.silent:!l.get("notifyErrors"),o.isUnloading)return;document.visibilityState==="hidden"&&(e.silent=!0);let t=se(i,e);if(e.silent){ne("warn",t,e);return}if(typeof mw<"u"&&mw.notify){let s=F("div.instantDiffs-notification",F("div.instantDiffs-notification-label",F("a",{href:kt(`/wiki/${o.config.link}`),target:"_blank"},d("script-name"))),xn(t));yn(s,e)}ne("error",t,e)}function yn(i,e){mw.notify(i,{type:"error",tag:`${o.config.prefix}-${e.tag}`})}function we(i){let e=o.config.labels[i];if(e)return typeof e=="object"?e[document.dir]:e}function Ve(i){return l.get("openInNewTab")&&i?"_blank":"_self"}function Ke(i){return/^\/\//.test(i)&&(i=`https:${i}`),i}function Wt(i){try{return new URL(Ke(i))}catch{return null}}function Te(i,e){let t=Wt(e);if(t)return t.searchParams.get(i)}function K(i,e){let t=Wt(e);if(t)return t[i]}function Li(i){let e=mw.util.getParamValue("title",i);if(!e)try{let t=new URL(i,location.href),s=mw.config.get("wgArticlePath")?.split("$1")[0];t.pathname.startsWith(s)&&(e=decodeURIComponent(t.pathname.substring(s.length)))}catch(t){return ne("error","Error parsing URL",t),null}return e}function rs(i){let e=Wt(i);if(!e)return;let t={};for(let[s,n]of e.searchParams){let r=s.match(/^([^[]+)\[([^\]]+)\]$/);if(r){let[,c,p]=r;t[c]=t[c]||{},t[c][p]=n}else t[s]=n}return t}function h(i){return!a(i)&&!isNaN(i)}function M(i){return!a(i)&&["next","prev","cur"].includes(i)}function lt(i){return i&&(i.fromtexthidden||i.totexthidden)}function di(i){return i&&i.slots?.main?.texthidden}function ce(i){return i.torevid?i.totitle:i.fromrevid?i.fromtitle:null}function Pe(i){let e;return i.torevid?(a(i.tocomment)||(e=i.tocomment.match(o.config.sectionRegExp)),e&&e[1]||null):i.fromrevid?(a(i.fromcomment)||(e=i.fromcomment.match(o.config.sectionRegExp)),e&&e[1]||null):null}function ui(i){let e;return i&&!a(i.comment)&&(e=i.comment.match(o.config.sectionRegExp)),e&&e[1]||null}function cs(){let i=mw.config.get("wgServer").replace(/^https?:/,""),e=new RegExp("^//www\\.").test(i)?"www.":"",t=mw.config.get("wgContentLanguage");if(!a(t)){let n=new RegExp(`^//${t}\\.`);if(n.test(i))return i.replace(n,`//${t}.m.`)}let s=mw.config.get("wgNoticeProject");if(!a(s)){let n=new RegExp(`^//${e}${s}\\.`);if(n.test(i))return i.replace(n,a(e)?`//${s}.m.`:`//m.${s}.`)}}function $e(){let i=o.config.bodyContentSelector[mw.config.get("skin")]||o.config.bodyContentSelector.default,e=$(i);return(!e||e.length===0)&&(e=$(document.body)),e}function Nt(i,e){let t="Special",s=mw.config.get("wgFormattedNamespaces")[-1],n=e.split(":"),r=i[e],c=r.split(":");n[0]=s,c[0]=t;let p=[e,r,n.join(":"),c.join(":")];return[...new Set(p)]}function Ze(i){if(!a(i))try{let e=new mw.Title(i).getPrefixedDb();for(let[t,s]of Object.entries(o.local.specialPagesAliasesPrefixed))if(s.includes(e))return t}catch{}}function F(i,e={},...t){return Object.keys(e).forEach(s=>{let n=e[s];if(!a(n))switch(s){case"id":i=`${i}#${n.trim()}`,delete e[s];break;case"class":n=Array.isArray(n)?n.map(r=>r.trim()).join("."):n.trim().replace(/\s+/g,"."),i=`${i}.${n}`,delete e[s];break}}),(0,bn.default)(i,e,...t)}function xn(i){return document.createTextNode(i)}function Po(...i){return i.reduce((e,t)=>e+t.outerHTML,"")}function fs(...i){let e=new DocumentFragment;for(let t of i)e.append(t);return e}function Eo(i){return fs(...i.toArray())}function Gi(i,e){if(a(i))return null;if(!e)return mw.util.getTargetFromFragment(i);let t=e instanceof jQuery?e[0]:e;if(!t)return null;let s=t.querySelector(`#${CSS.escape(i)}`);if(s)return s;let n=mw.util.percentDecodeFragment(i);return n?t.querySelector(`#${CSS.escape(n)}`):null}function At(i,e){if(i instanceof jQuery&&(i=i[0]),e instanceof jQuery&&(e=e[0]),!i||!e)return null;let t=0,s=0,n=i;for(;n&&n!==e&&(t+=n.offsetTop,s+=n.offsetLeft,n=n.offsetParent,!(n&&!e.contains(n))););return{top:t,left:s}}function Ui(i,e=!1){if(i instanceof jQuery&&(i=i[0]),!i)return 0;let t=i.offsetHeight;if(e){let s=getComputedStyle(i);t+=parseFloat(s.marginTop)||0,t+=parseFloat(s.marginBottom)||0}return t}function xt(i){!i||i.length===0||i.contents().each((e,t)=>{t.nodeType===3&&t.remove()})}function He(i,e){let t=()=>{mw.notify(d("copy-link-copied"),{tag:`${o.config.prefix}-copyLink`}),k(e)&&e(!0)},s=()=>{mw.notify(d("copy-link-error"),{tag:`${o.config.prefix}-copyLink`,type:"error"}),k(e)&&e(!1)};if(a(i)||!R(i))return s();if(navigator.clipboard?.writeText)navigator.clipboard.writeText(i).then(t).catch(s);else{let n=F("textarea",{value:i});document.body.append(n),n.select();let r=document.execCommand("copy");n.remove(),r?t():s()}}function Ne(i,e,t=!0){let s=n=>{if(n){if(!kn(n)||n.button||n.ctrlKey)return;if(n.preventDefault(),t&&n.altKey&&!a(i.href)){i.target==="_blank"?window.open(i.href,"_blank").focus():window.location.href=i.href;return}}e(n)};return t&&!a(i.href)&&(a(i.dataset.altTitle)&&(i.dataset.altTitle=i.title),i.dataset.altTitle=`${i.dataset.altTitle} ${ls("alt-click")}`.trim(),i.dataset.origTitle=i.title,i.addEventListener("mouseenter",()=>i.title=i.dataset.altTitle),i.addEventListener("mouseleave",()=>i.title=i.dataset.origTitle),i.addEventListener("mousedown",n=>n.preventDefault())),i.addEventListener("click",s),i.addEventListener("keypress",s),s}function Vi(i,e){i.removeEventListener("click",e),i.removeEventListener("keypress",e)}function I(i,e,t="appendTo"){if(!e)return;if(e instanceof jQuery){(i instanceof jQuery?i:$(i))[t](e);return}let s=i instanceof jQuery?i.get(0):i;switch(t){case"insertBefore":e.before(s);break;case"insertAfter":e.after(s);break;case"prependTo":e.prepend(s);break;case"appendTo":default:e.append(s);break}}function Si(i,e){if(i){if(i instanceof jQuery){i.html(e);return}i.innerHTML=e}}function Q(i,e,t=!1){if(!i)return;let s;try{s=new URL(e,`https://${location.hostname}`)}catch{return}let n=(c,p)=>{$(p).attr("href","https://"+s.hostname+s.pathname+$(p).attr("href"))},r=(c,p)=>{$(p).attr("href","https://"+s.hostname+$(p).attr("href").replace(/special:mylanguage\//i,"")).attr("title",($(p).attr("title")||"").replace(/special:mylanguage\//i,""))};i.filter('a[href^="#"]').each(n),i.find('a[href^="#"]').each(n),t||(i.filter('a[href^="/"]:not([href^="//"])').each(r),i.find('a[href^="/"]:not([href^="//"])').each(r))}function fe(i){if(!l.get("openInNewTab"))return;let e=(t,s)=>{let n=s.getAttribute("href");a(n)||/^#/.test(n)||s.setAttribute("target","_blank")};i.filter("a:not(.mw-thanks-thank-link, .jquery-confirmable-element)").each(e),i.find("a:not(.mw-thanks-thank-link, .jquery-confirmable-element)").each(e)}function ct(i=[]){let e=["instantDiffs-panel-placeholder"];return i.forEach(t=>e.push(`instantDiffs-panel-placeholder--${t}`)),l.get("showLink")&&e.push("has-link"),e}function Qe(){return $("<span>").addClass(ct())}function vt(i){i={short:null,long:null,iconBefore:null,iconAfter:null,...i},a(i.short)||(i.short=F("span",i.short)),a(i.long)||(i.long=F("span",i.long)),a(i.iconBefore)||(i.iconBefore=F("i",i.iconBefore)),a(i.iconAfter)||(i.iconAfter=F("i",i.iconAfter));let e=[i.iconBefore,i.short,i.iconAfter].filter(s=>!a(s)).map(s=>s.cloneNode(!0)),t=[i.iconBefore,i.long,i.iconAfter].filter(s=>!a(s)).map(s=>s.cloneNode(!0));return fs(F("div.instantDiffs-label.instantDiffs-label--long",...t),F("div.instantDiffs-label.instantDiffs-label--short",...e))}function zi(i){i={$content:null,type:"notice",...i};let e=i.$content.toArray();return F("div",{class:["cdx-message","cdx-message--block",`cdx-message--${i.type}`,"plainlinks"]},F("span.cdx-message__icon"),F("div.cdx-message__content",...e))}var bn,x=m(()=>{bn=jn(Ns());P();O()});var Dn=re(()=>{window.instantDiffs||={};instantDiffs.i18n||={};instantDiffs.i18n.en={"@metadata":{authors:["Serhio Magpie"]},"script-name":"Instant Diffs","script-name-short":"ID","diff-title":"Difference between revisions","diff-title-hidden":"Difference between revisions is hidden","revision-title":"Revision content","revision-title-hidden":"Revision content is hidden","compare-label":"$1","compare-title":"Compare selected revisions ($1)","compare-pages-title":"Difference between pages","compare-pages-title-hidden":"Difference between pages is hidden","page-title":"Go to page","comment-title":"Go to message","action-save":"Save","action-cancel":"Cancel","action-close":"Close","action-reload":"Reload","action-watch":"Watch","action-unwatch":"Unwatch","goto-snapshot-prev":"Previous link on a page","goto-snapshot-next":"Next link on a page","goto-view-diff":"Show changes","goto-view-revision":"Show revision","goto-view-unpatrolled":"Pending changes","goto-prev":"Older","goto-next":"Newer","goto-prev-diff":"Older edit","goto-next-diff":"Newer edit","goto-back-diff":"Back","goto-prev-revision":"Older revision","goto-next-revision":"Newer revision","goto-back-revision":"Back","goto-diff":"Go to edit","goto-revision":"Go to revision","goto-page":"Go to page","goto-comment":"Go to message","goto-edit":"Edit","goto-source":"View source","goto-history":"View history","goto-info":"View info","goto-talkpage":"Discussion","goto-settings":"Settings","goto-actions":"Actions","hint-close":"Esc","hint-alt-click":"Alt+Click: open the link","hint-snapshot-prev":"Ctrl+Arrow Left","hint-snapshot-next":"Ctrl+Arrow Right","hint-prev":"Arrow Left","hint-next":"Arrow Right","hint-switch":"Ctrl+Arrow Up","hint-unpatrolled":"Ctrl+P","hint-back":"Ctrl+Z","hint-actions":"Ctrl+Arrow Down","copy-link":"Copy link","copy-link-copied":"The link has been copied to the clipboard.","copy-link-error":"Couldn't copy the link.","copy-wikilink":"Copy wikilink","copy-wikilink-page":"page","copy-wikilink-diff":"diff","copy-wikilink-revision":"revision","copy-wikilink-example-title":"Main Page","dialog-title-empty":"[No title]","dialog-title-not-found":"[Not found]","dialog-notice-wikilambda":"WikiLambda app currently only shows the latest revision. See a [[phab:T397902|ticket]] on Phabricator.","dialog-notice-foreign-diff":"You are viewing a foreign diff from [$1 $2]. Some features can be limited.","dialog-notice-foreign-revision":"You are viewing a foreign revision from [$1 $2]. Some features can be limited.","dialog-notice-foreign-wikilambda":"WikiLambda app is not currently supported in the foreign revisions.","settings-title":"Instant Diffs Settings","settings-saved":`The settings have been saved successfully. Reload the page to apply them.`,"settings-saved-icon":"Checkmark icon","settings-empty":`Oops, looks like the admin disabled all settings. Time to relax and grab some coffee!`,"settings-empty-icon":"Coffee cup icon","settings-fieldset-links":"Links","settings-show-link":"Show action link","settings-show-link-help":"Displays an action button (\u2756) after the link to open the Instant Diffs dialog. Otherwise, the click action is added directly to the link. You can still open the link in the current tab by pressing Alt+Click.","settings-show-page-link":"Show page link","settings-show-page-link-help":"Displays an action button (\u2794) after the link to navigate to the page and section where the edit was made. If the [[mw:Special:MyLanguage/Convenient Discussions|Convenient Discussions]] script is installed, the button will also try to navigate to the corresponding comment.","settings-highlight-line":"Highlight lines in Watchlists and similar lists when the Instant Diffs dialog opens from the related link.","settings-mark-watched-line":"Mark changes as visited in Watchlists when the Instant Diffs dialog opens from the related link.","settings-fieldset-dialog":"Dialog","settings-view-width":"Set window dimensions:","settings-view-width-help":"Dimensions apply only to desktop view. Mobile view always uses full screen dimensions.","settings-view-width-option-title":"$1 pixels wide","settings-view-width-compact":"Compact","settings-view-width-standard":"Standard","settings-view-width-wide":"Wide","settings-view-width-full":"Full","settings-view-width-full-title":"All available screen space","settings-close-outside":"Close Instant Diffs dialog when clicking outside of it.","settings-enable-hotkeys":"Enable keyboard shortcuts in the Instant Diffs dialog.","settings-show-diff-tools":"Show additional diff tools, such as the Inline format toggle.","settings-show-revision-info":"Show change information when viewing a revision.","settings-unhide-diffs":"Display hidden revision content and diff info without additional steps.","settings-unhide-diffs-help":'The "$1" [[mw:Special:MyLanguage/Help:RevisionDelete|user right]] is required to view revision content.',"settings-open-in-new-tab":"Open links inside the Instant Diffs dialog in a new tab.","settings-fieldset-menu":"Menu","settings-show-menu-icons":"Show icons in the Instant Diffs dialog dropdown menu.","settings-show-watchlist-popup":"Show advanced options when adding or removing pages from the Watchlist.","settings-show-watchlist-popup-help":"When available, displays a popup with watchlist time period and label settings.","settings-links-hash":"Include section name (anchor) in the links","settings-links-hash-help":"The section name will also be appended as an anchor to the link URL when using copy actions with the selected non-minified format.","settings-links-format":"Link format for the copy action:","settings-links-format-full":"Full url with a page title","settings-links-format-minify":"Minified url","settings-wikilinks-format":"Wikilink format for the copy action:","settings-wikilinks-format-link":"Simple link in brackets","settings-wikilinks-format-special":"Internal wiki link","settings-fieldset-general":"General","settings-enable-mobile":"Enable Instant Diffs on the mobile skin (Minerva).","settings-enable-mobile-help":"To re-enable Instant Diffs, you will need to switch to a different skin.","settings-notify-errors":"Show popup alerts for critical errors.","settings-fieldset-pinned-actions":"Pinned Actions","settings-pinned-actions":"Pin selected actions in the quick access menu:","settings-pinned-actions-help":"This list shows only actions available for the current view. Pinned actions appear only in desktop view.","error-generic":"Something went wrong: $4","error-server":"Server error, please try again later","error-offline":"Please check your internet connection","error-wasted":"Unexpected error","error-prepare-generic":"Failed to prepare configuration: $4","error-prepare-version":"Another instance is already running: $4","error-prepare-replaced":"Standalone instance replaced successfully: $4","error-prepare-mobile":"The script is disabled in the settings for the mobile skin (Minerva)","error-link-options":'Failed to parse the "data-instantdiffs-options" link attribute: $4',"error-revision-generic":'Failed to load revision data "oldid=$1": $4',"error-revision-curid":'Failed to load revision data "curid=$1": $4',"error-revision-badrevids":"Revision not found","error-revision-badpageids":"Page not found","error-revision-missing":"Page not found","error-revision-invalid":"Page not found: $4","error-diff-generic":'Failed to load revision compare data "oldid=$1", "diff=$2": $4',"error-diff-compare-pages":'Failed to load page compare data "page1=$1", "page2=$2": $4',"error-diff-missingcontent":"Revision is hidden","error-diff-nosuchrevid":"Revision not found","error-diff-missingtitle":"Page not found","error-api-generic":"Failed to request api: $4","error-dependencies-generic":"Failed to load dependencies: $4","error-dependencies-revid":'Failed to load page dependencies "oldid=$1": $4',"error-dependencies-curid":'Failed to load page dependencies "curid=$1": $4',"error-global-watchlist":"Failed to execute Global Watchlist API: $4","error-setting-request":"Failed to load user options: $4","error-setting-save":"Failed to save user options: $4"}});var Sn=re(Ln=>{Ln.loaders={en:()=>Dn()}});var Pn=m(()=>{P();x();mw.hook("mw.translate.editor.showTranslationHelpers").add((i,e)=>{!e||!pe()||mw.hook(`${o.config.prefix}.process`).fire(e)})});var En=m(()=>{P();x();Ee();mw.hook("convenientDiscussions.preprocessed").add(i=>{if(!i)return;let e=s=>{!s||!s.isValid||!s.isProcessed||s.isForeign||!s.options.showPageLink||s.actions.cd||(s.extensions.cd={},s.extensions.cd.href=t(s),!a(s.extensions.cd.href)&&(s.actions.page&&s.actions.page.remove(),s.actions.cd=s.renderAction({label:we("page"),title:d("comment-title"),href:s.extensions.cd.href,modifiers:["page","comment"]})))},t=s=>{if(!s.compare&&!s.revision)return;let n=s.getArticle().get("titleText"),r=i.api.pageRegistry.get(n);if(!r||!r.isProbablyTalkPage())return;if(s.revision?s.revision.revid&&(s.extensions.cd.date=new Date(s.revision.timestamp),s.extensions.cd.user=s.revision.user):s.compare&&(s.compare.torevid?(s.extensions.cd.date=new Date(s.compare.totimestamp),s.extensions.cd.user=s.compare.touser):s.compare.fromrevid&&(s.extensions.cd.date=new Date(s.compare.fromtimestamp),s.extensions.cd.user=s.compare.fromuser)),s.extensions.cd.date&&s.extensions.cd.user)try{s.extensions.cd.anchor=i.api.generateCommentId(s.extensions.cd.date,s.extensions.cd.user)}catch(p){ve("Gadget-ConvenientDiscussions","Unable to generate comment anchor.",p)}if(!s.extensions.cd.anchor)return;let c=`#${s.extensions.cd.anchor}`;return n!==o.local.mwTitleText&&(c=mw.util.getUrl(`${n}${c}`)),c};if(o.isRunCompleted)for(let s of C.getLinks())e(s);mw.hook(`${o.config.prefix}.link.renderSuccess`).add(s=>{s&&e(s)})})});var $n=m(()=>{P();mw.hook(`${o.config.prefix}.page.complete`).add(i=>{if(!i)return;(i.getContainer()?.find('[id^="tw-revert"] a')).each((t,s)=>{s.addEventListener("click",()=>i.close())})})});var An=m(()=>{P();mw.hook(`${o.config.prefix}.page.beforeDetach`).add(i=>{if(!i)return;let e=i.getDiffTable();typeof wikEd<"u"&&wikEd.diffTableLinkified&&e?.length>0&&wikEd.diffTable===e.get(0)&&(wikEd.diffTableLinkified=!1)})});var Tn=m(()=>{P();x();mw.hook("wikipage.content").add(()=>{if(!pe()||mw.config.get("skin")!=="citizen")return;let i=(s,n)=>{try{let r=new URL(s.href);a(r.searchParams.get("diff"))&&(r.searchParams.set("diff","cur"),s.href=r.href),s.dataset.instantdiffsLink="basic",s.dataset.instantdiffsOptions=JSON.stringify({showLink:!1,showPageLink:!1,showAltTitle:!0}),mw.hook(`${o.config.prefix}.process`).fire($(n))}catch(r){ve("Skin-Citizen","Unable to append the link action.",r)}},e=document.querySelector("#citizen-lastmod-relative"),t=document.querySelector("#citizen-sidebar-lastmod");e&&t&&i(e,t)})});var $o={};var On=m(()=>{Pn();En();$n();An();Tn()});P();var Y={version:"5.4.0+build.3",link:"Instant_Diffs",discussion:"Talk:Instant_Diffs",outname:"instantDiffs",outdir:"dist",origin:"https://www.mediawiki.org",server:"https://www.mediawiki.org",prefix:"instantDiffs",messagePrefix:"instant-diffs",settingsPrefix:"userjs-instantDiffs",dependencies:{styles:"/w/index.php?title=User:Serhio_Magpie/instantDiffs.test.css&action=raw&ctype=text/css",messages:"/w/index.php?title=User:Serhio_Magpie/instantDiffs-i18n/$lang.js&action=raw&ctype=text/javascript",main:["oojs","mediawiki.api","mediawiki.util","mediawiki.user","mediawiki.storage","mediawiki.notification","mediawiki.ForeignApi","mediawiki.Title"],settings:["oojs","oojs-ui-core","oojs-ui-widgets","oojs-ui-windows","oojs-ui.styles.icons-interactions"],window:["oojs","oojs-ui-core","oojs-ui-widgets","oojs-ui-windows","oojs-ui.styles.icons-accessibility","oojs-ui.styles.icons-movement","oojs-ui.styles.icons-content","oojs-ui.styles.icons-alerts","oojs-ui.styles.icons-interactions","oojs-ui.styles.icons-moderation","oojs-ui.styles.icons-editing-core","oojs-ui.styles.icons-editing-advanced","oojs-ui.styles.icons-user","oojs-ui.styles.icons-layout"],content:["jquery.confirmable","mediawiki.DateFormatter","mediawiki.codex.messagebox.styles","mediawiki.interface.helpers.styles","mediawiki.diff","mediawiki.diff.styles","mediawiki.misc-authed-curate","mediawiki.page.watch.ajax","ext.flaggedRevs.basic","ext.visualEditor.diffPage.init"],page:{"*":["ext.thanks.corethank","ext.checkUser.userInfoCard","ext.checkUser.styles"]},revision:{6:["filepage","wikibase.mediainfo.filepage.styles","wikibase.mediainfo.statements","wikibase.mediainfo.statements.styles"],14:["mediawiki.page.gallery.styles"],146:["wikibase.lexeme.styles"]},skins:{minerva:{"*":["skins.minerva.categories.styles"]}}},foreignDependencies:{revision:{styles:{6:["wikibase.mediainfo.filepage.styles","wikibase.mediainfo.statements","wikibase.mediainfo.statements.styles"],146:["wikibase.lexeme.styles"]},links:{6:["MediaWiki:Filepage.css"]},wikibase:{styles:{all:["jquery.wikibase.toolbar.styles","wikibase.view.ControllerViewFactory","wikibase.alltargets"],desktop:["wikibase.desktop"],mobile:["wikibase.mobile"]}}}},settings:{},defaults:{debug:!1,GM:!1,standalone:!1,storageExpiry:86400,logTimers:!0,expEnableWatchlistPopup:!1},include:{pageActions:["view","history"]},exclude:{pages:[],linkActions:["edit","history"]},labels:{page:{ltr:"\u2794",rtl:"\u{1F870}"},diff:"\u2756",revision:"\u272A",error:"\u{1D4D4}"},breakpoints:{mobileUp:"(min-width: 640px)",mobileDown:"(max-width: 639px)"},wikilinkPresets:{link:{page:"[$href $msg]",diff:"[$href $msg]",revision:"[$href $msg]"},special:{page:"[[$prefSpecial:Redirect/page/$1|$msg]]",diff:"[[$prefSpecial:Diff/$1|$msg]]",revision:"[[$prefSpecial:PermanentLink/$1|$msg]]"}},commonsAssetsPath:"https://upload.wikimedia.org/wikipedia/commons",changeLists:["Watchlist","Recentchanges","Recentchangeslinked"],contributionLists:["Contributions","GlobalContributions"],otherLists:["Newpages","PendingChanges","GlobalWatchlist"],specialPages:["Special:Diff","Special:Permalink","Special:PermanentLink","Special:MobileDiff","Special:Redirect","Special:ComparePages","Special:Undelete"],nonEditableContentModels:["wikibase-item","wikibase-property","wikibase-lexeme"],skinBodyClasses:{"vector-2022":["mw-body","vector-body"],vector:["vector-body"],monobook:["monobook-body"],minerva:["content"],timeless:["mw-body"]},bodyContentSelector:{minerva:"#content",default:"#bodyContent"},contentSelector:"#mw-content-text",specialPagesLinks:["Special:Diff","Special:Permalink","Special:PermanentLink","Special:MobileDiff","Special:Redirect"],specialPagesLinksSearchRegExp:"^($1)",specialPagesLinksPathRegExp:"$1($2)",specialPagesLinksSelector:'a[title^="$1"]',articlePathRegExp:"^($1)",sectionRegExp:/^\/\*\s*(.*?)\s*\*\/.*$/,linkSelector:["a[data-instantdiffs-link]",'a.external[href^="$1"]',"a.mw-changeslist-date","a.mw-changeslist-diff","a.mw-changeslist-diff-cur","a.mw-changeslist-groupdiff",".mw-changeslist-line a.extiw",".mw-fr-reviewlink a",".mw-enhanced-rc-time a",".mw-history-histlinks a",".mw-diff-bytes + a",".mw-contributions-list .comment a",".mw-fr-pending-changes-table a.cdx-docs-link","#mw-revision-nav a","table.diff #differences-prevlink","table.diff #differences-nextlink",".mw-diff-revision-history-links a",".mw-logevent-loglines a","[data-afl-log-id] a",'li[class^="mw-tag"] a',"a.ext-globalwatchlist-diff",".wikibase-statementview-references a","a.edit-summary-time","#mw-fr-revision-messages a","#mw-fr-revision-details a"],mwLine:{selector:[".mw-changeslist-line",".mw-contributions-list li",".mw-fr-pending-changes-table tr",".mw-logevent-loglines li",".mw-special-AbuseLog [data-afl-log-id]",'.mw-special-EditTags li[class^="mw-tag"]',".ext-globalwatchlist-site li"],seen:["mw-changeslist-line-not-watched","mw-enhanced-not-watched","mw-changeslist-watchedseen"],unseen:["mw-changeslist-line-watched","mw-enhanced-watched","mw-changeslist-watchedunseen"]},mwLineTitle:{selector:[".mw-changeslist-title",".mw-contributions-title",".mw-newpages-pagename",".mw-fr-pending-changes-page-title"]},mwLink:{id:["differences-prevlink","differences-nextlink"],hasClass:["mw-diff-revision-history-link-prev","mw-diff-revision-history-link-next","mw-changeslist-date","mw-changeslist-diff","mw-changeslist-diff-cur","mw-changeslist-groupdiff","mw-newpages-time"],closestTo:[".mw-changeslist-line",".mw-contributions-list",".mw-history-histlinks",".mw-pager-navigation-bar + ul",".mw-fr-hist-difflink","#mw-fr-reviewnotice","#mw-fr-revisiontag","#mw-fr-revisiontag-edit","#mw-fr-revision-tag-edit",".mw-specialpage-summary","#mw-revision-nav",".mw-fr-pending-changes-table",".mw-logevent-loglines",".mw-special-AbuseLog li[data-afl-log-id]",'.mw-special-EditTags li[class^="mw-tag"]',".wikibase-statementview-references",".ext-globalwatchlist-site",".tux-message-editor",".mw-pt-translate-header"]},mwLinkExclude:{hasClass:["mw-contributions-title"]},mwLinkDiffOnly:{id:["differences-prevlink","differences-nextlink"],closestTo:["#mw-revision-nav"]},mwLinkPrepend:{id:["differences-nextlink"],hasClass:["mw-diff-revision-history-link-next"]},mwLinkAltTitle:{closestTo:[".mw-fr-reviewlink",".mw-history-histlinks"]},mwLinkContent:{closestTo:[".mw-parser-output"]},mwLinkContentInside:{closestTo:[".comment"]}},ws={messages:{},settings:{},defaults:{},require:null,language:null,linkSelector:null,mwIsAnon:!0,mwEndPoint:null,mwEndPointUrl:null,mwAction:null,mwArticlePath:null,mwCanonicalSpecialPageName:null,mwTitle:null,mwTitleText:null,mwServers:[],mwServerNames:[],specialPagesLocalPrefixed:{},specialPagesAliases:{},specialPagesAliasesFlat:[],specialPagesAliasesPrefixed:{},specialPagesAliasesPrefixedFlat:[],specialPagesLinksAliases:{},specialPagesLinksAliasesFlat:[],specialPagesLinksAliasesPrefixed:{},specialPagesLinksAliasesPrefixedFlat:[],specialPagesLinksPathRegExp:null,specialPagesLinksSearchRegExp:null,articlePathRegExp:null,mutationObserver:null,interactionObserver:null},bs={};x();j();Ot();B();le();at();Ee();yt();Qi();Yi();le();at();ee();var ds=class extends ie{article;constructor(e){super({article:{},...e,ariaHaspopup:!0,handler:()=>this.openDialog()}),this.article=new W(this.options.article)}openDialog(){let e={onOpen:()=>this.onDialogOpen(),onClose:()=>this.onDialogClose()};if(L.setup(this,e))return this.onDialogRequest(),$.when(L.load()).always(()=>this.onDialogLoad())}onDialogRequest(){this.pending(!0),this.emit("loading")}onDialogLoad(){this.pending(!1),this.emit("loaded")}onDialogOpen(){this.emit("opened")}onDialogClose(){this.emit("closed")}getArticle(){return this.article}},Ft=ds;P();O();var us=class extends Ft{nodes={};openDialog(){this.nodes.$oldid=$('#mw-history-compare input[name="oldid"]:checked'),this.nodes.$oldidLine=this.nodes.$oldid.closest("li"),this.nodes.$diff=$('#mw-history-compare input[name="diff"]:checked'),this.nodes.$diffLine=this.nodes.$diff.closest("li"),this.article.set({type:"diff",title:o.local.mwTitleText,oldid:this.nodes.$oldid.val(),diff:this.nodes.$diff.val()}),super.openDialog()}onDialogOpen(){l.get("highlightLine")&&(this.nodes.$oldidLine.addClass("instantDiffs-line--highlight"),this.nodes.$diffLine.addClass("instantDiffs-line--highlight")),super.onDialogOpen()}onDialogClose(){l.get("highlightLine")&&(this.nodes.$oldidLine.removeClass("instantDiffs-line--highlight"),this.nodes.$diffLine.removeClass("instantDiffs-line--highlight")),super.onDialogClose()}},hs=us;Ri();ee();O();var Ao=gs({"../dist/instantDiffs-i18n-bundle.js":()=>Sn()});function Cn(){if(!(o.isPageAdjustmentsApplied||!pe())){if(o.isPageAdjustmentsApplied=!0,document.body.classList.add("instantDiffs-enabled"),o.config.changeLists.includes(o.local.mwCanonicalSpecialPageName))return To();if(o.config.contributionLists.includes(o.local.mwCanonicalSpecialPageName))return Oo();if(o.local.mwCanonicalSpecialPageName==="GlobalWatchlist")return Mo();if(o.local.mwAction==="history")return Io()}}function To(){$(".mw-changeslist-line").addClass("instantDiffs-line")}function Oo(){$(".mw-contributions-list .mw-changeslist-links:not(.mw-pager-tools) > span:first-child").each((e,t)=>{let s=$(t);s.find("a").length===0&&s.wrapInner(Qe())}),o.local.mwCanonicalSpecialPageName==="GlobalContributions"&&Co()}function Co(){$(".mw-contributions-list li").each((e,t)=>{let s=$(t),n=s.find("a.mw-changeslist-date, a.mw-changeslist-history");if(n.length!==0)try{let r=new URL(n.prop("href"));Q(s,r.origin)}catch{}})}function Mo(){let i=document.getElementById("ext-globalwatchlist-watchlistsfeed");o.local.mutationObserver.observe(i,{childList:!0})}function Io(){let i=$("#pagehistory > li, #pagehistory .mw-contributions-list > li").addClass("instantDiffs-line--history");if(i.length<=1)return;i.each((t,s)=>{let n=$(s),r=n.find(".mw-history-histlinks > span:first-child"),c=n.find(".mw-history-histlinks > span:last-child");r.find("a").length===0&&r.wrapInner(Qe()),c.find("a").length===0&&c.wrapInner(Qe())}),$(".mw-history-compareselectedversions").each((t,s)=>{let r=$(s).find(".mw-history-compareselectedversions-button");new hs({label:d("compare-label",o.config.labels.diff),title:d("compare-title",d("script-name")),classes:["mw-ui-button","cdx-button","instantDiffs-button--compare"],insertMethod:"insertAfter",container:r}),$("<span>").text(" ").addClass("instantDiffs-spacer").insertAfter(r)})}function Ro(i){o.local.require=i,mw.util.addCSS(".instantDiffs-panel { display:none; }"),L.mixin(),l.mixin(),ni(L),ni(l),OO.mixinClass(ie,OO.EventEmitter),OO.mixinClass(ye,OO.EventEmitter),o.local.mwIsAnon=mw.user?.isAnon?.()??!0,o.local.mwEndPoint=`${location.origin}${mw.config.get("wgScript")}`,o.local.mwEndPointUrl=new URL(o.local.mwEndPoint),o.local.mwAction=mw.config.get("wgAction"),o.local.mwArticlePath=mw.config.get("wgArticlePath").replace("$1",""),o.local.mwCanonicalSpecialPageName=mw.config.get("wgCanonicalSpecialPageName"),o.local.mwTitle=new mw.Title(mw.config.get("wgRelevantPageName")),o.local.mwTitleText=o.local.mwTitle.getPrefixedText();let e=cs();mw.config.set("wgMobileServer",e),mw.config.set("wgMobileServerName",K("hostname",e));let t=[mw.config.get("wgServer"),mw.config.get("wgMobileServer")].filter(n=>!a(n)).map(Ke);o.local.mwServers=[...new Set(t)];let s=[mw.config.get("wgServerName"),mw.config.get("wgMobileServerName")].filter(n=>!a(n));return o.local.mwServerNames=[...new Set(s)],o.local.lastVersion=mw.storage.get(`${o.config.prefix}-version`),mw.storage.set(`${o.config.prefix}-version`,o.config.version),o.local.mutationObserver=new MutationObserver(zo),o.local.interactionObserver=new IntersectionObserver(Go,{threshold:0,rootMargin:l.get("debug")?"0px 0px 0px 0px":"33% 0px 33% 0px"}),window.addEventListener("pageshow",Ko),window.addEventListener("beforeunload",Qo),Promise.allSettled([w.getSpecialPages(),Wo(),...No()])}async function Wo(){let{general:i}=await w.getSiteInfo(["general"])||{};if(!T(i)){a(i.mobileserver)||(mw.config.set("wgMobileServer",i.mobileserver),mw.config.set("wgMobileServerName",i.mobileservername));let e=[...o.local.mwServers,i.server,i.mobileserver].filter(s=>!a(s)).map(Ke);o.local.mwServers=[...new Set(e)];let t=[...o.local.mwServerNames,i.servername,i.mobileservername].filter(s=>!a(s));o.local.mwServerNames=[...new Set(t)]}}function No(){return["en",mw.config.get("wgUserLanguage")].filter((e,t,s)=>s.indexOf(e)===t&&!o.i18n[e]).map(e=>{let t=o.config.dependencies.messages.replace("$lang",e);return mw.loader.getScript(Mt(t))})}function Fo(){for(let[i,e]of Object.entries(w.specialPagesLocal))o.local.specialPagesLocalPrefixed[i]=new mw.Title(e).getPrefixedDb(),o.local.specialPagesAliases[i]=Nt(w.specialPagesLocal,i),o.local.specialPagesAliasesPrefixed[i]=Nt(o.local.specialPagesLocalPrefixed,i),o.config.specialPagesLinks.includes(i)&&(o.local.specialPagesLinksAliases[i]=o.local.specialPagesAliases[i],o.local.specialPagesLinksAliasesPrefixed[i]=o.local.specialPagesAliasesPrefixed[i]);o.local.specialPagesAliasesFlat=Object.values(o.local.specialPagesAliases).flat(),o.local.specialPagesAliasesPrefixedFlat=Object.values(o.local.specialPagesAliasesPrefixed).flat(),o.local.specialPagesLinksAliasesFlat=Object.values(o.local.specialPagesLinksAliases).flat(),o.local.specialPagesLinksAliasesPrefixedFlat=Object.values(o.local.specialPagesLinksAliasesPrefixed).flat()}function Vo(){o.local.articlePathRegExp=new RegExp(o.config.articlePathRegExp.replaceAll("$1",o.local.mwArticlePath));let i=[];o.config.linkSelector.forEach(t=>{/\$1/.test(t)?o.local.mwServers.forEach(s=>{i.push(t.replaceAll("$1",s))}):i.push(t)}),o.local.specialPagesLinksAliasesFlat.forEach(t=>{i.push(o.config.specialPagesLinksSelector.replaceAll("$1",t))});let e=o.local.specialPagesLinksAliasesPrefixedFlat.join("|");o.local.specialPagesLinksPathRegExp=new RegExp(o.config.specialPagesLinksPathRegExp.replaceAll("$1",o.local.mwArticlePath).replaceAll("$2",e)),o.local.specialPagesLinksSearchRegExp=new RegExp(o.config.specialPagesLinksSearchRegExp.replaceAll("$1",e)),o.local.linkSelector=i.join(",")}function jo(){Y.settings={...is(),...Y.settings},Y.defaults={...ss(),...Y.defaults};let i={...Y.settings,...o.settings},e={...Y.defaults,...o.defaults,...ns()};if(o.isRunning){o.isReplaced=Ho(i,e),E(o.isReplaced?"error-prepare-replaced":"error-prepare-version",{tag:"app",message:`loaded: ${o.config.version}, concurrent: ${Y.version}`,silent:!0});return}o.isRunning=!0,o.i18n||={},o.config=Y,o.local=ws,o.local.settings=i,o.local.defaults=e,o.timers=bs,o.utils=b,o.modules={Api:w,Article:W,Link:C,Button:ie,ViewButton:Ft,HistoryCompareButton:hs,Page:ye,LocalPage:Dt,GlobalPage:Lt,Watch:gt,view:L,settings:l},o.timers.run=mw.now(),qo(),It(),On(),Bo()}function qo(){let{loaders:i}=Ao(`../${o.config.outdir}/${o.config.outname}-i18n-bundle.js`);for(let e of Object.values(i))e()}function Bo(){mw.loader.load(Mt(o.config.dependencies.styles),"text/css"),mw.loader.using(o.config.dependencies.main).then(Ro).then(()=>$(Uo)).fail(i=>{E("error-prepare-generic",{tag:"app",message:i?.message})})}async function Uo(){if(await l.processDefaults(),It(),mw.config.get("skin")==="minerva"&&!l.get("enableMobile")){E("error-prepare-mobile",{tag:"app",silent:!0});return}o.isReady=!0,Fo(),Vo(),Cn(),o.timers.ready=mw.now(),mw.hook(`${o.config.prefix}.ready`).fire(o),mw.hook("wikipage.content").add(Mn),mw.hook(`${o.config.prefix}.process`).add(In),mw.hook(`${o.config.prefix}.replace`).add(_o)}function Mn(i){!i||!pe()||(o.isFirstRun=!o.isRunCompleted,o.isFirstRun&&(o.isRunCompleted=!0,i=$e()),In(i),l.get("logTimers")&&o.isFirstRun&&(he("ready time",o.timers.run,o.timers.ready),he("total time",o.timers.run,o.timers.processEnd)))}function In(i){if(!i)return;o.timers.processStart=mw.now(),o.timers.findLinksStart=mw.now();let e=C.findLinks(i);o.timers.findLinksEnd=mw.now();let t=[],s=[];for(let n of e){if(C.hasLink(n))continue;let r=new C(n);t.push(r),r.isValid&&s.push(r)}o.timers.processEnd=mw.now(),l.get("logTimers")&&t.length>0&&(ne("info",`links found: ${t.length}`),ne("info",`links processed: ${s.length}`),he("links selector time",o.timers.findLinksStart,o.timers.findLinksEnd),he("links process time",o.timers.processStart,o.timers.processEnd)),mw.hook(`${o.config.prefix}.processed`).fire(s)}function Ho(i,e){return o.modules.settings.get("standalone")&&!e.standalone?(mw.hook(`${o.config.prefix}.replace`).fire(i,e),!0):!1}async function _o(i,e){!i||!e||(o.local.settings=i,o.local.defaults=e,o.isReady&&(await l.processDefaults(),o.timers.run=mw.now(),o.timers.ready=mw.now(),Cn(),Mn($e())))}function Go(i){o.isUnloading||i.forEach(e=>{if(!e.isIntersecting)return;let t=C.getLink(e.target);t&&t.onIntersect()})}function zo(i){o.isUnloading||i.forEach(e=>{e.addedNodes.length>0&&mw.hook(`${o.config.prefix}.process`).fire($(e.target))})}function Ko(i){i.persisted&&(o.isUnloading=!1)}function Qo(){o.isUnloading=!0}jo();})(); /* </nowiki> */ 1cam0n9r4k63wfyhw6ij9ig002g0emn 8365096 8365080 2026-05-04T10:10:08Z Serhio Magpie 1775170 [e81b54d] [v5.4.0+build.4]: Updated from repository. 8365096 javascript text/javascript /** * Instant Diffs * * Version: 5.4.0+build.4 * Author: Serhio Magpie * Licenses: (MIT OR CC-BY-SA-4.0) * Documentation: https://www.mediawiki.org/wiki/Instant_Diffs * * For license information please see: https://www.mediawiki.org/wiki/User:Serhio_Magpie/instantDiffs.js.LEGAL.txt */ /* <nowiki> */ (()=>{var Vn=Object.create;var Ye=Object.defineProperty;var jn=Object.getOwnPropertyDescriptor;var qn=Object.getOwnPropertyNames;var Bn=Object.getPrototypeOf,Un=Object.prototype.hasOwnProperty;var ms=i=>e=>{var t=i[e];if(t)return t();throw new Error("Module not found in bundle: "+e)};var m=(i,e)=>()=>(i&&(e=i(i=0)),e);var re=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),_=(i,e)=>{for(var t in e)Ye(i,t,{get:e[t],enumerable:!0})},ws=(i,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qn(e))!Un.call(i,n)&&n!==t&&Ye(i,n,{get:()=>e[n],enumerable:!(s=jn(e,n))||s.enumerable});return i};var Hn=(i,e,t)=>(t=i!=null?Vn(Bn(i)):{},ws(e||!i||!i.__esModule?Ye(t,"default",{value:i,enumerable:!0}):t,i)),De=i=>ws(Ye({},"__esModule",{value:!0}),i);var _n,o,P=m(()=>{self.instantDiffs||={};_n=self.instantDiffs,o=_n});var ys=re((sr,ks)=>{ks.exports=function(e){var t=String.prototype.split,s=/()??/.exec("")[1]===e,n;return n=function(r,u,p){if(Object.prototype.toString.call(u)!=="[object RegExp]")return t.call(r,u,p);var f=[],g=(u.ignoreCase?"i":"")+(u.multiline?"m":"")+(u.extended?"x":"")+(u.sticky?"y":""),S=0,u=new RegExp(u.source,g+"g"),v,D,oe,gs;for(r+="",s||(v=new RegExp("^"+u.source+"$(?!\\s)",g)),p=p===e?-1>>>0:p>>>0;(D=u.exec(r))&&(oe=D.index+D[0].length,!(oe>S&&(f.push(r.slice(S,D.index)),!s&&D.length>1&&D[0].replace(v,function(){for(var Je=1;Je<arguments.length-2;Je++)arguments[Je]===e&&(D[Je]=e)}),D.length>1&&D.index<r.length&&Array.prototype.push.apply(f,D.slice(1)),gs=D[0].length,S=oe,f.length>=p)));)u.lastIndex===D.index&&u.lastIndex++;return S===r.length?(gs||!u.test(""))&&f.push(""):f.push(r.slice(S)),f.length>p?f.slice(0,p):f},n}()});var Ds=re((nr,xs)=>{var Gn=[].indexOf;xs.exports=function(i,e){if(Gn)return i.indexOf(e);for(var t=0;t<i.length;++t)if(i[t]===e)return t;return-1}});var jt=re((or,Ls)=>{var Vt=Ds();Ls.exports=zn;function zn(i){var e=i.classList;if(e)return e;var t={add:s,remove:n,contains:r,toggle:c,toString:p,length:0,item:f};return t;function s(u){var v=g();Vt(v,u)>-1||(v.push(u),S(v))}function n(u){var v=g(),D=Vt(v,u);D!==-1&&(v.splice(D,1),S(v))}function r(u){return Vt(g(),u)>-1}function c(u){return r(u)?(n(u),!1):(s(u),!0)}function p(){return i.className}function f(u){var v=g();return v[u]||null}function g(){var u=i.className;return Kn(u.split(" "),Qn)}function S(u){var v=u.length;i.className=u.join(" "),t.length=v;for(var D=0;D<u.length;D++)t[D]=u[D];delete u[v]}}function Kn(i,e){for(var t=[],s=0;s<i.length;s++)e(i[s])&&t.push(i[s]);return t}function Qn(i){return!!i}});var Ps=re((rr,Ss)=>{var Jn={className:"class",htmlFor:"for"},Yn={accept:new Set(["form","input"]),"accept-charset":new Set(["form"]),accesskey:"GLOBAL",action:new Set(["form"]),align:new Set(["applet","caption","col","colgroup","hr","iframe","img","table","tbody","td","tfoot","th","thead","tr"]),alt:new Set(["applet","area","img","input"]),async:new Set(["script"]),autocomplete:new Set(["form","input"]),autofocus:new Set(["button","input","keygen","select","textarea"]),autoplay:new Set(["audio","video"]),autosave:new Set(["input"]),bgcolor:new Set(["body","col","colgroup","marquee","table","tbody","tfoot","td","th","tr"]),border:new Set(["img","object","table"]),buffered:new Set(["audio","video"]),challenge:new Set(["keygen"]),charset:new Set(["meta","script"]),checked:new Set(["command","input"]),cite:new Set(["blockquote","del","ins","q"]),class:"GLOBAL",code:new Set(["applet"]),codebase:new Set(["applet"]),color:new Set(["basefont","font","hr"]),cols:new Set(["textarea"]),colspan:new Set(["td","th"]),content:new Set(["meta"]),contenteditable:"GLOBAL",contextmenu:"GLOBAL",controls:new Set(["audio","video"]),coords:new Set(["area"]),data:new Set(["object"]),datetime:new Set(["del","ins","time"]),default:new Set(["track"]),defer:new Set(["script"]),dir:"GLOBAL",dirname:new Set(["input","textarea"]),disabled:new Set(["button","command","fieldset","input","keygen","optgroup","option","select","textarea"]),download:new Set(["a","area"]),draggable:"GLOBAL",dropzone:"GLOBAL",enctype:new Set(["form"]),for:new Set(["label","output"]),form:new Set(["button","fieldset","input","keygen","label","meter","object","output","progress","select","textarea"]),formaction:new Set(["input","button"]),headers:new Set(["td","th"]),height:new Set(["canvas","embed","iframe","img","input","object","video"]),hidden:"GLOBAL",high:new Set(["meter"]),href:new Set(["a","area","base","link"]),hreflang:new Set(["a","area","link"]),"http-equiv":new Set(["meta"]),icon:new Set(["command"]),id:"GLOBAL",ismap:new Set(["img"]),itemprop:"GLOBAL",keytype:new Set(["keygen"]),kind:new Set(["track"]),label:new Set(["track"]),lang:"GLOBAL",language:new Set(["script"]),list:new Set(["input"]),loop:new Set(["audio","bgsound","marquee","video"]),low:new Set(["meter"]),manifest:new Set(["html"]),max:new Set(["input","meter","progress"]),maxlength:new Set(["input","textarea"]),maxlength:new Set(["input","textarea"]),media:new Set(["a","area","link","source","style"]),method:new Set(["form"]),min:new Set(["input","meter"]),multiple:new Set(["input","select"]),muted:new Set(["video"]),name:new Set(["button","form","fieldset","iframe","input","keygen","object","output","select","textarea","map","meta","param"]),novalidate:new Set(["form"]),open:new Set(["details"]),optimum:new Set(["meter"]),pattern:new Set(["input"]),ping:new Set(["a","area"]),placeholder:new Set(["input","textarea"]),poster:new Set(["video"]),preload:new Set(["audio","video"]),radiogroup:new Set(["command"]),readonly:new Set(["input","textarea"]),rel:new Set(["a","area","link"]),required:new Set(["input","select","textarea"]),reversed:new Set(["ol"]),rows:new Set(["textarea"]),rowspan:new Set(["td","th"]),sandbox:new Set(["iframe"]),scope:new Set(["th"]),scoped:new Set(["style"]),seamless:new Set(["iframe"]),selected:new Set(["option"]),shape:new Set(["a","area"]),size:new Set(["input","select"]),sizes:new Set(["img","link","source"]),span:new Set(["col","colgroup"]),spellcheck:"GLOBAL",src:new Set(["audio","embed","iframe","img","input","script","source","track","video"]),srcdoc:new Set(["iframe"]),srclang:new Set(["track"]),srcset:new Set(["img"]),start:new Set(["ol"]),step:new Set(["input"]),style:"GLOBAL",summary:new Set(["table"]),tabindex:"GLOBAL",target:new Set(["a","area","base","form"]),title:"GLOBAL",type:new Set(["button","input","command","embed","object","script","source","style","menu"]),usemap:new Set(["img","input","object"]),value:new Set(["button","option","input","li","meter","progress","param"]),width:new Set(["canvas","embed","iframe","img","input","object","video"]),wrap:new Set(["textarea"])};function Xn(i,e){e=e.toLowerCase();var t=Yn[i.toLowerCase()];return!!t&&(t==="GLOBAL"||t.has(e))}function Zn(i){return Jn[i]||i}Ss.exports={isStandardAttribute:Xn,propToAttr:Zn}});var Ms=re((ar,Os)=>{var eo=jt(),Es=Ps();function Ce(i,e){this.type=i,this.target=null,Object.keys(e||{}).forEach(function(t){this[t]=e[t]},this)}Ce.prototype.preventDefault=function(){};Ce.prototype.stopPropagation=function(){};Ce.prototype.stopImmediatePropagation=function(){};function As(i,e){this._eventListeners=this._eventListeners||{},this._eventListeners[i]=this._eventListeners[i]||[];var t=this._eventListeners[i];t.indexOf(e)===-1&&t.push(e)}function Ts(i,e){var t=this._eventListeners&&this._eventListeners[i];if(t){var s=t.indexOf(e);s!==-1&&t.splice(s,1)}}function Cs(i){i.target=this;var e=this._eventListeners&&this._eventListeners[i.type];return e&&e.forEach(function(t){t(i)}),!0}function ae(){}ae.prototype.createTextNode=function(i){var e=new V;return e.textContent=i,e.nodeName="#text",e.nodeType=3,e};ae.prototype.createElement=function(i){var e=new A;return e.nodeName=e.tagName=i,e};ae.prototype.createComment=function(i){var e=new G;return e.data=i,e};ae.prototype.addEventListener=As;ae.prototype.removeEventListener=Ts;ae.prototype.dispatchEvent=Cs;function Oe(){}V.prototype=new Oe;A.prototype=new Oe;G.prototype=new Oe;function Me(i){this.el=i,this.styles=[]}Me.prototype.setProperty=function(i,e){this.el._setProperty(this.styles,{name:i,value:e})};Me.prototype.getProperty=function(i){return this.el._getProperty(this.styles,i)};Me.prototype.__defineGetter__("cssText",function(){var i="";return this.styles.forEach(function(e){i+=e.name+":"+e.value+";"}),i});Me.prototype.__defineSetter__("cssText",function(i){this.styles.length=0,i.split(";").forEach(function(e){var t=e.indexOf(":");if(t){var s=e.slice(0,t).trim(),n=e.slice(t+1).trim();this.setProperty(s,n)}},this)});function to(i,e){i&&(this.name=i,this.value=e||"")}function A(){var i=this;this.style=new Me(this),this.classList=eo(this),this.childNodes=[],this.attributes=[],this.dataset={},this.className="",this._setProperty=function(e,t,s,n){var r=i._getProperty(e,s);if(r){r.value=String(n);return}e.push(typeof t=="function"?new t(s.toLowerCase(),String(n)):t)},this._getProperty=function(e,t){if(t){t=t.toLowerCase();for(var s=0;s<e.length;s++)if(t===e[s].name)return e[s]}}}A.prototype.nodeType=1;A.prototype.appendChild=function(i){return i.parentElement=this,this.childNodes.push(i),i};A.prototype.setAttribute=function(i,e){i==="style"?this.style.cssText=e:this._setProperty(this.attributes,to,i,e)};A.prototype.getAttribute=function(i){if(i==="style")return this.style.cssText;var e=this._getProperty(this.attributes,i);return typeof e<"u"?e.value:null};A.prototype.removeAttribute=function(i){if(i==="class")delete this.className;else for(var e=0,t=this.attributes.length;e<t;e++)if(this.attributes[e].name===i){this.attributes.splice(e,1);break}};A.prototype.replaceChild=function(i,e){var t=this,s=!1;if(this.childNodes.forEach(function(n,r){n===e&&(t.childNodes[r]=i,i.parentElement=this,s=!0)}),s)return e};A.prototype.removeChild=function(i){var e=this,t=!0;if(this.childNodes.forEach(function(s,n){s===i&&(e.childNodes.splice(n,1),i.parentElement=null,t=!0)}),t)return i};A.prototype.insertBefore=function(i,e){var t=this.childNodes;if(e===null)t.push(i);else for(var s=0,n=t.length;s<n;s++){var r=t[s];if(r===e){s===0?t.unshift(i):t.splice(s,0,i);break}}return i.parentElement=this,i};A.prototype.addEventListener=As;A.prototype.removeEventListener=Ts;A.prototype.dispatchEvent=Cs;A.prototype.insertAdjacentHTML=function(i,e){};A.prototype.__defineGetter__("innerHTML",function(){var i=this.childNodes.html||"";return this.childNodes.forEach(function(e){i+=e.outerHTML||e.textContent}),i});A.prototype.__defineSetter__("innerHTML",function(i){this.childNodes.length=0,this.childNodes.html=i});A.prototype.__defineGetter__("outerHTML",function(){var i=[],e=this,t={AREA:!0,BASE:!0,BR:!0,COL:!0,EMBED:!0,HR:!0,IMG:!0,INPUT:!0,KEYGEN:!0,LINK:!0,META:!0,PARAM:!0,SOURCE:!0,TRACK:!0,WBR:!0};function s(f){var g=[],S;return f.forEach(function(u){S=u.name!="style"?u.value:e.style.cssText,g.push(u.name+'="'+$s(S)+'"')}),g.length?" "+g.join(" "):""}function n(f){var g=[],S;return Object.keys(f).forEach(function(u){g.push("data-"+u+'="'+$s(f[u])+'"')}),g.length?" "+g.join(" "):""}function r(){var f=[];for(var g in e){var S=Es.propToAttr(g);e.hasOwnProperty(g)&&["string","boolean","number"].indexOf(typeof e[g])!==-1&&Es.isStandardAttribute(S,e.nodeName)&&c(g,S)&&f.push({name:S,value:e[g]})}return f?s(f):""}function c(f,g){return e.getAttribute(g)?!1:!(f==="className"&&!e[f])}var p=this.style.cssText?this.attributes.concat([{name:"style"}]):this.attributes;return i.push("<"+this.nodeName+r()+s(p)+n(this.dataset)+">"),t[this.nodeName.toUpperCase()]||(i.push(this.innerHTML),i.push("</"+this.nodeName+">")),i.join("")});A.prototype.__defineGetter__("textContent",function(){var i="";return this.childNodes.forEach(function(e){i+=e.textContent}),i});A.prototype.__defineSetter__("textContent",function(i){var e=new V;return e.textContent=i,this.childNodes=[e],i});function Ie(i){return String(i).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function $s(i){return Ie(i).replace(/"/g,"&quot;")}A.prototype.nodeValue=null;function V(){}V.prototype.nodeType=3;V.prototype.nodeName="#text";V.prototype.__defineGetter__("textContent",function(){return Ie(this.value||"")});V.prototype.__defineSetter__("textContent",function(i){this.value=i});V.prototype.__defineGetter__("nodeValue",function(){return Ie(this.value||"")});V.prototype.__defineSetter__("nodeValue",function(i){this.value=i});V.prototype.__defineGetter__("length",function(){return(this.value||"").length});V.prototype.replaceData=function(i,e,t){this.value=this.value.slice(0,i)+t+this.value.slice(i+e)};function G(){}G.prototype.nodeType=8;G.prototype.nodeName="#comment";G.prototype.__defineGetter__("data",function(){return this.value});G.prototype.__defineSetter__("data",function(i){this.value=i});G.prototype.__defineGetter__("outerHTML",function(){return"<!--"+Ie(this.value||"")+"-->"});G.prototype.__defineGetter__("nodeValue",function(){return Ie(this.value||"")});G.prototype.__defineSetter__("nodeValue",function(i){this.value=i});function Xe(i){i.__defineGetter__("parentNode",function(){return this.parentElement})}Xe(A.prototype);Xe(G.prototype);Xe(V.prototype);Xe(Oe.prototype);Os.exports={Document:ae,Node:Oe,Element:A,Comment:G,Text:V,document:new ae,Event:Ce,CustomEvent:Ce}});var Fs=re((lr,Ns)=>{var io=ys(),so=jt(),Rs=typeof window>"u"?Ms():window,Re=Rs.document,no=Rs.Text;function Ws(){var i=[];function e(){var t=[].slice.call(arguments),s=null;function n(r){var c;function p(u){var v=io(u,/([\.#]?[^\s#.]+)/);/^\.|#/.test(v[1])&&(s=Re.createElement("div")),Is(v,function(D){var oe=D.substring(1,D.length);D&&(s?D[0]==="."?so(s).add(oe):D[0]==="#"&&s.setAttribute("id",oe):s=Re.createElement(D))})}if(r!=null){if(typeof r=="string")s?s.appendChild(c=Re.createTextNode(r)):p(r);else if(typeof r=="number"||typeof r=="boolean"||r instanceof Date||r instanceof RegExp)s.appendChild(c=Re.createTextNode(r.toString()));else if(ro(r))Is(r,n);else if(qt(r))s.appendChild(c=r);else if(r instanceof no)s.appendChild(c=r);else if(typeof r=="object")for(var f in r)if(typeof r[f]=="function")/^on\w+/.test(f)?function(u,v){s.addEventListener?(s.addEventListener(u.substring(2),v[u],!1),i.push(function(){s.removeEventListener(u.substring(2),v[u],!1)})):(s.attachEvent(u,v[u]),i.push(function(){s.detachEvent(u,v[u])}))}(f,r):(s[f]=r[f](),i.push(r[f](function(u){s[f]=u})));else if(f==="style")if(typeof r[f]=="string")s.style.cssText=r[f];else for(var g in r[f])(function(u,v){if(typeof v=="function")s.style.setProperty(u,v()),i.push(v(function(oe){s.style.setProperty(u,oe)}));else var D=r[f][u].match(/(.*)\W+!important\W*$/);D?s.style.setProperty(u,D[1],"important"):s.style.setProperty(u,r[f][u])})(g,r[f][g]);else if(f==="attrs")for(var S in r[f])s.setAttribute(S,r[f][S]);else f.substr(0,5)==="data-"?s.setAttribute(f,r[f]):s[f]=r[f];else if(typeof r=="function"){var S=r();s.appendChild(c=qt(S)?S:Re.createTextNode(S)),i.push(r(function(v){qt(v)&&c.parentElement?(c.parentElement.replaceChild(v,c),c=v):c.textContent=v}))}}return c}for(;t.length;)n(t.shift());return s}return e.cleanup=function(){for(var t=0;t<i.length;t++)i[t]();i.length=0},e}var oo=Ns.exports=Ws();oo.context=Ws;function qt(i){return i&&i.nodeName&&i.nodeType}function Is(i,e){if(i.forEach)return i.forEach(e);for(var t=0;t<i.length;t++)e(i[t],t)}function ro(i){return Object.prototype.toString.call(i)=="[object Array]"}});var Bt,W,le=m(()=>{y();X();C();B();Bt=class{static utils=et;options={};values={type:null,typeVariant:null,hostname:location.hostname};mw={serverName:mw.config.get("wgServerName"),mobileServerName:mw.config.get("wgMobileServerName")};isValid=!1;isForeign=!1;isHidden=!1;constructor(e,t){this.options={fixTenet:!0,...t},T(e)||this.set(e)}set(e){this.values={...this.values,...this.validateValues(e)},this.isValid=this.validate(),this.process()}setValue(e,t){this.values[e]=t}setValues(e){for(let[t,s]of Object.entries(e))this.setValue(t,s)}get(e){return this.values[e]}getValues(){return this.values}getMW(e){return this.mw[e]}validateValues(e){return!a(e.diff)&&R(e.diff)&&e.diff.indexOf("|")>-1&&(e.diff=e.diff.split("|").shift()),!a(e.oldid)&&R(e.oldid)&&e.oldid.indexOf("|")>-1&&(e.oldid=e.oldid.split("|").shift()),!a(e.curid)&&R(e.curid)&&e.curid.indexOf("|")>-1&&(e.curid=e.curid.split("|").shift()),[0,"0"].includes(e.oldid)&&delete e.oldid,[0,"0","current","latest"].includes(e.diff)&&(e.diff="cur"),M(e.direction)||(e.direction="prev"),a(e.hash)||(e.hash=mw.util.percentDecodeFragment(e.hash),e.hash&&(e.hash=e.hash.replace(/^#/,""))),a(e.section)||(e.section=e.section.replace(/^#/,"")),e}validate(){if(Ze(this.values.title)==="Special:ComparePages"&&(!a(this.values.page1)||h(this.values.rev1))&&(!a(this.values.page2)||h(this.values.rev2)))return this.options.fixTenet=!1,this.values.type="diff",this.values.typeVariant="comparePages",!0;if(Ze(this.values.title)==="Special:Undelete")return this.values.type="diff",this.values.typeVariant="undelete",!1;if(h(this.values.oldid)&&a(this.values.diff))return this.values.type="revision",!0;if(h(this.values.diff)||h(this.values.oldid)){if(this.values.type="diff",a(this.values.title)&&M(this.values.oldid)){let e=this.values.oldid;this.values.oldid=this.values.diff,this.values.diff=e}if(a(this.values.oldid)&&(this.values.oldid=this.values.diff,this.values.diff=this.values.direction),this.options.fixTenet&&h(this.values.oldid)&&h(this.values.diff)&&parseInt(this.values.oldid)>parseInt(this.values.diff)){let e=this.values.oldid;this.values.oldid=this.values.diff,this.values.diff=e}return!0}return!a(this.values.title)&&M(this.values.diff)?(this.values.type="diff",!0):h(this.values.curid)?(this.values.type="revision",this.values.typeVariant="page",!0):!1}process(){this.values.revid=Ut(this),a(this.values.hostname)||this.setHostname(),a(this.values.title)||this.setTitle(),(!a(this.values.page1)||!a(this.values.page2))&&this.setComparePages()}setHostname(){let{general:e}=b.siteInfoAliases[this.values.hostname]||{};T(e)?(this.mw.serverName=this.values.hostname,this.mw.mobileServerName=this.values.hostname):(this.values.hostname=ge()&&!a(e.mobileservername)?e.mobileservername:e.servername,this.mw.serverName=e.servername,this.mw.mobileServerName=e.mobileservername),this.mw.endPoint=`https://${this.values.hostname}${mw.util.wikiScript("index")}`,this.mw.endPointUrl=new URL(this.mw.endPoint),this.isForeign=Z(this.values.hostname)}setTitle(){a(this.values.origTitle)&&(this.values.origTitle=this.values.title);try{this.mw.title=new mw.Title(this.values.title),this.values.title=this.mw.title.getPrefixedDb(),this.values.titleText=this.mw.title.getPrefixedText()}catch{}l.get("linksHash")&&!a(this.values.section)&&(this.values.titleSection=[this.values.title,this.values.section].join("#"),this.values.titleTextSection=[this.values.titleText,this.values.section].join("#")),this.values.href=mw.util.getUrl(this.values.titleSection||this.values.title),this.isForeign&&(this.values.href=U(this,this.values.href))}setComparePages(){try{this.mw.page1=new mw.Title(this.values.page1),this.values.page1=this.mw.page1.getPrefixedDb(),this.values.page1Text=this.mw.page1.getPrefixedText()}catch{}try{this.mw.page2=new mw.Title(this.values.page2),this.values.page2=this.mw.page2.getPrefixedDb(),this.values.page2Text=this.mw.page2.getPrefixedText()}catch{}}},W=Bt});var Ht,b,B=m(()=>{P();y();Le();C();le();Ht=class{static utils=Gt;static api;static foreignApi={};static getApi(e){let t=e instanceof W?e.get("hostname"):e;if(!Z(t))return this.api||(this.api=new mw.Api),this.api;if(!this.foreignApi[t]){let s=`https://${t}${mw.util.wikiScript("api")}`;this.foreignApi[t]=new mw.ForeignApi(s)}return this.foreignApi[t]}static get(e,t){return this.getApi(t).get(e)}static post(e,t){return this.getApi(t).post(e)}static postWithToken(e,t,s){return this.getApi(s).postWithToken(e,t)}static watch(e,t,s){return this.getApi(s).watch(e,t)}static unwatch(e,t){return this.getApi(t).unwatch(e)}static notifyError(e){E("error-api-generic",{tag:"api",message:e?.message||e,silent:!0})}static getAuthToken(e){let t={action:"centralauthtoken",format:"json",formatversion:2,uselang:o.local.language};return this.get(t,e)}static loadMessage(e,t){return e=typeof e=="string"?[e]:e,e.filter(n=>!mw.message(n).exists()).length===0?$.Deferred().resolve().promise():this.getApi(t).loadMessagesIfMissing(e,{uselang:o.local.userLanguage})}static async parseWikitext(e,t){e={action:"parse",contentmodel:"wikitext",format:"json",formatversion:2,uselang:o.local.language,...e};try{let{parse:s}=await this.post(e,t);return s.text}catch(s){this.notifyError(s)}}static async getCompare(e,t,s){e={action:"compare",prop:["title","ids","timestamp","comment"],format:"json",formatversion:2,uselang:o.local.userLanguage,...e};let n=s||this;try{return(await n.get(e,t)).compare}catch(r){this.notifyError(r)}}static async getPageInfo(e,t,s){let n=o.local.userLanguage;e={action:"query",prop:["info","pageprops","entityterms"],inprop:["watched","notificationtimestamp"],wbetterms:["label"],wbetlanguage:n,intestactions:["edit"],format:"json",formatversion:2,uselang:n,...e};let r=s||this;try{return(await r.get(e,t)).query.pages[0]}catch(c){this.notifyError(c)}}static async markAsSeen(e,t){e={action:"setnotificationtimestamp",redirects:1,format:"json",formatversion:2,uselang:o.local.userLanguage,...e};try{return(await this.postWithToken("csrf",e,t)).setnotificationtimestamp[0].notificationtimestamp}catch(s){this.notifyError(s)}}static siteInfo={};static siteInfoAliases={};static async getSiteInfo(e=[],t,s){let n=t instanceof W?t.get("hostname"):t;if(a(n)&&(n=mw.config.get("wgServerName")),!We()&&T(this.siteInfo)&&(this.siteInfo=mw.storage.getObject(`${o.config.prefix}-siteInfo`)||{},this.processSiteInfo()),!T(this.siteInfoAliases[n])||!T(this.siteInfo[n]))return this.siteInfoAliases[n]||this.siteInfo[n];let r={action:"query",meta:"siteinfo",siprop:e,format:"json",formatversion:2,uselang:o.local.userLanguage},c=s||this;try{let{query:p}=await c.get(r,n);this.siteInfo[n]||(this.siteInfo[n]={});for(let[f,g]of Object.entries(p))this.siteInfo[n][f]=g;return mw.storage.setObject(`${o.config.prefix}-siteInfo`,this.siteInfo,l.get("storageExpiry")),this.processSiteInfoAliases(this.siteInfo[n]),this.siteInfo[n]}catch(p){this.notifyError(p)}}static processSiteInfo(){if(!T(this.siteInfo))for(let e of Object.values(this.siteInfo))this.processSiteInfoAliases(e)}static processSiteInfoAliases(e){T(e?.general)||(this.siteInfoAliases[e.general.servername]=e,a(e.general.mobileserver)||(e.general.mobileservername=K("hostname",e.general.mobileserver),this.siteInfoAliases[e.general.mobileservername]=e))}static specialPages={};static specialPagesLocal={};static async getSpecialPages(e){if(T(this.specialPages)&&o.config.specialPages.forEach(s=>{this.specialPages[s]=s}),!We()&&T(this.specialPagesLocal)&&(this.specialPagesLocal=mw.storage.getObject(`${o.config.prefix}-specialPagesLocal`)||{}),!T(this.specialPagesLocal))return this.specialPagesLocal;for(let[s,n]of Object.entries(this.specialPages))this.specialPagesLocal[s]=n;let t={action:"query",titles:o.config.specialPages,format:"json",formatversion:2,uselang:mw.config.get("wgContentLanguage")};try{let{query:s}=await this.get(t,e);return s.normalized&&s.normalized.forEach(n=>{this.specialPagesLocal[n.from]=n.to}),mw.storage.setObject(`${o.config.prefix}-specialPagesLocal`,this.specialPagesLocal,l.get("storageExpiry")),this.specialPagesLocal}catch(s){this.notifyError(s)}}static interwikiMap=[];static async getInterwikiMap(e){if(!We()&&a(this.interwikiMap)&&(this.interwikiMap=mw.storage.getObject(`${o.config.prefix}-interwikiMap`)||[]),!a(this.interwikiMap))return this.interwikiMap;let t={action:"query",meta:"siteinfo",siprop:"interwikimap",format:"json",formatversion:2,uselang:o.local.userLanguage};try{let{query:s}=await this.get(t,e);return this.interwikiMap=s.interwikimap,mw.storage.setObject(`${o.config.prefix}-interwikiMap`,this.interwikiMap,l.get("storageExpiry")),this.interwikiMap}catch(s){this.notifyError(s)}}static async getWBLabel(e,t,s){if(!_t(e))return;let n=o.local.userLanguage,r={action:"wbgetentities",props:"labels",ids:e,languages:n,languagefallback:1,format:"json",formatversion:2,uselang:n},c=s||this;try{let{entities:p}=await c.get(r,t),f=p[e];return f.type==="lexeme"?Object.values(f.lemmas).map(g=>g.value).join("/"):f.labels[n].value}catch(p){this.notifyError(p)}}},b=Ht});var Gt={};_(Gt,{getEntitySchemaLabel:()=>Qt,getNamespaceConfig:()=>zt,getWikilambdaLabel:()=>Jt,isEditableContentModel:()=>Kt,isProbablyWbTitle:()=>_t,isWbContentModel:()=>me});function zt(i){let e=b.siteInfoAliases[i];if(!T(e))return{wgFormattedNamespaces:Object.values(e.namespaces).reduce((t,s)=>(t[s.id]=s.canonical||"",t),{}),wgNamespaceIds:{...Object.values(e.namespaces).reduce((t,s)=>(t[tt(s.name.toLowerCase())]=s.id,s.canonical&&(t[tt(s.canonical.toLowerCase())]=s.id),t),{}),...e.namespacealiases.reduce((t,s)=>(t[s.alias.toLowerCase()]=s.id,t),{})},wgCaseSensitiveNamespaces:Object.values(e.namespaces).filter(t=>t.case==="case-sensitive").map(t=>t.id),wgContentNamespaces:Object.values(e.namespaces).filter(t=>t.content).map(t=>t.id)}}function _t(i){return!a(i)&&/^[QPL][0-9]+$/.test(i)}function me(i){return!a(i)&&i.includes("wikibase")}function Kt(i){return!o.config.nonEditableContentModels.includes(i)}function Qt(i){return $(i).find(".entityschema-title-label").text()}function Jt(i){return!T(i)&&(i[`wikilambda-label-${o.local.userLanguage}`]||i["wikilambda-label-en"])}var Le=m(()=>{P();y();B()});var et={};_(et,{addLinkTags:()=>ti,getDependencies:()=>Yt,getForeignDependencies:()=>Xt,getHref:()=>N,getHrefAbsolute:()=>U,getRevID:()=>Ut,getWikilink:()=>si,loadForeignDependencies:()=>Zt,loadForeignStylesDependencies:()=>ei,removeLinkTags:()=>ii});function Ut(i){let e=i.getValues();if(h(e.revid))return e.revid;if(e.type==="revision"&&h(e.oldid)&&(!M(e.direction)||e.direction==="prev"))return e.oldid;if(e.type==="diff"){if(h(e.oldid)&&h(e.diff))return Math.max(e.oldid,e.diff);if(h(e.oldid)){if(!M(e.diff)||e.diff==="prev")return e.oldid}else if(h(e.diff)&&(!M(e.oldid)||e.oldid==="prev"))return e.diff}return!1}function Yt(i){let e=[],t=o.config.dependencies.page;t&&(e=e.concat(Se(i,t)));let s=o.config.dependencies[i.get("type")];s&&(e=e.concat(Se(i,s)));let n=o.config.dependencies.skins[mw.config.get("skin")];return n&&(e=e.concat(Se(i,n))),e}function Se(i,e){let t=[];if(a(e))return t;z(e["*"])&&(t=t.concat(e["*"]));let s=i.getMW("title")?.getNamespaceId();return z(e[s])&&(t=t.concat(e[s])),t}function Xt(i){let e=[],t=[],s=[],n=o.config.foreignDependencies[i.get("type")];if(n){if(e=e.concat(Se(i,n)),t=t.concat(Se(i,n.styles)),me(mw.config.get("wgPageContentModel"))){let r=n.wikibase;r&&(e=e.concat(Se(i,r)),t=t.concat(r.styles.all,ge()?r.styles.mobile:r.styles.desktop))}s=s.concat(ao(i,n.links))}return{modules:e,styles:t,links:s}}function ao(i,e){let t=[];if(a(e))return t;z(e["*"])&&(t=t.concat(e["*"].map(n=>Vs(i,n))));let s=i.getMW("title")?.getNamespaceId();return z(e[s])&&(t=t.concat(e[s].map(n=>Vs(i,n)))),t}function Zt(i,e){let t=it(e),s=i.get("hostname"),n=mw.util.wikiScript("load"),r=$.param({modules:t.join("|"),skin:mw.config.get("skin")});mw.loader.load(`https://${s}${n}?${r}`)}function ei(i,e){let t=it(e),s=i.get("hostname"),n=mw.util.wikiScript("load"),r=$.param({modules:t.join("|"),only:"styles",skin:mw.config.get("skin")});mw.loader.load(`https://${s}${n}?${r}`,"text/css")}function ti(i){if(!a(i))return i.map(e=>mw.loader.addLinkTag?.(e))}function ii(i){a(i)||i.forEach(e=>e?.remove())}async function si(i){let e={relative:!1,hash:l.get("linksHash"),minify:l.get("linksFormat")==="minify",wikilink:!0,wikilinkPreset:l.get("wikilinksFormat")};if(i.isForeign){let t=await b.getInterwikiMap();t&&(e.interwiki=t.filter(s=>s.url.includes(i.getMW("serverName"))).reduce((s,n)=>!s||s.prefix.length>n.prefix.length?n:s))}return N(i,{},e)}function N(i,e,t){i instanceof W||(i=new W(i)),e={...e},t={type:null,...t};let s={...i.getValues()};return t.type||(s.type==="revision"&&s.typeVariant==="page"?t.type="page":t.type=s.type),t.type==="diff"&&(a(s.diff)&&M(s.direction)&&(s.diff=s.direction),h(s.oldid)&&h(s.diff)?(e.oldid=s.oldid,e.diff=s.diff):h(s.revid)?e.diff=s.revid:h(s.oldid)?M(s.diff)&&s.diff!=="prev"?(e.oldid=s.oldid,e.diff=s.diff):e.diff=s.oldid:h(s.diff)&&(M(s.oldid)&&s.oldid!=="prev"?(e.oldid=s.diff,e.diff=s.oldid):e.diff=s.diff)),t.type==="revision"&&(a(s.direction)&&M(s.diff)&&(s.direction=s.diff),h(s.revid)?e.oldid=s.revid:h(s.oldid)&&(e.oldid=s.oldid,M(s.direction)&&s.direction==="next"&&(e.direction=s.direction))),t.type==="page"&&(e.curid=s.curid),lo(i,e,t)}function U(i,e){let t=i?.mw.endPointUrl||o.local.mwEndPointUrl;try{return new URL(e,t.origin).toString()}catch{return e}}function lo(i,e,t){e={...e},t={type:"diff",relative:!0,hash:!1,minify:!1,interwiki:null,wikilink:!1,wikilinkPreset:null,...t},Z(i.get("hostname"))&&(t.relative=!1);let s=i.getMW("endPointUrl")||o.local.mwEndPointUrl,n;if(a(i.get("title"))?(n=new URL(s),n.search=new URLSearchParams(e).toString()):n=new URL(mw.util.getUrl(i.get("title"),e),s.origin),t.hash&&!a(i.get("section"))){let r=mw.util.escapeIdForLink(i.get("section"));r&&(n.hash=`#${r}`)}return t.minify&&(n.pathname="",n.hash="",n.searchParams.delete("title")),t.href=decodeURIComponent(t.relative?n.pathname+n.search+n.hash:n.toString()),t.hash=decodeURIComponent(n.hash),t.wikilink?co(i,e,t):t.href}function co(i,e,t){e={...e},t={href:null,hash:null,type:"diff",minify:!1,relative:!0,interwiki:null,wikilink:!0,wikilinkPreset:"special",...t};let s=null;!a(e.oldid)&&!a(e.diff)?s=`${e.oldid}/${e.diff}`:a(e.oldid)?a(e.diff)?a(e.curid)||(s=e.curid):s=e.diff:s=e.oldid,a(t.hash)||(s=`${s}${t.hash}`);let r=(o.config.wikilinkPresets[t.wikilinkPreset]||o.config.wikilinkPresets.special)[t.type],c=t.interwiki?.prefix;return r.replace("$1",s).replace("$pref",c?`${c}:`:"").replace("$href",t.href).replace("$msg",d(`copy-wikilink-${t.type}`))}function Vs(i,e){let t=mw.util.getUrl(e,{action:"raw",ctype:"text/css"});return i.isForeign?U(i,t):t}var X=m(()=>{P();y();Le();B();le();C()});function H(i){let e=Object.getPrototypeOf(i);return OO.initClass(e),i.static=Object.create(e.static),Object.keys(i).filter(t=>t!=="static").forEach(t=>{i.static[t]=i[t]}),i.parent=i.super=e,i}function ni(i){let e={prototype:{}};OO.mixinClass(e,OO.EventEmitter),Object.assign(i,e.prototype),OO.EventEmitter.call(i)}function st(){x(OO.ui.RadioSelectWidget.prototype.findFirstSelectedItem)||(OO.ui.RadioSelectWidget.prototype.findFirstSelectedItem=function(){let i=this.findSelectedItems();return Array.isArray(i)?i[0]||null:i}),x(OO.ui.ButtonSelectWidget.prototype.findFirstSelectedItem)||(OO.ui.ButtonSelectWidget.prototype.findFirstSelectedItem=function(){let i=this.findSelectedItems();return Array.isArray(i)?i[0]||null:i}),x(OO.ui.getTeleportTarget)||(OO.ui.getTeleportTarget=function(){return document.body})}function js(){$(["#mw-notification-area",".mw-notification-area-overlay",".ext-checkuser-userinfocard-popover"]).each((i,e)=>{$(e).removeAttr("aria-hidden").removeAttr("inert")})}function nt(){fo();let i=new OO.ui.WindowManager;return $(OO.ui.getTeleportTarget()).append(i.$element),i}function fo(i){i=i||l.get("viewWidth")||"standard",i!=="full"&&(OO.ui.WindowManager.static.sizes.instantDiffs=L.constructor.sizes[i]||L.constructor.sizes.standard),L.isOpen&&L.dialog.setSize(oi(i))}function oi(i){return i=i||l.get("viewWidth")||"standard",i==="full"?"full":"instantDiffs"}function ot(i,e){let t=mw.loader.moduleRegistry[i],s=e.match(/^((?:\.\.?\/)+)(.*)$/);return s&&(e=`resources/src/${i}/${s[2]}`),t?.packageExports[e]}function qs(i){return mw.loader.moduleRegistry[i]?.script($,jQuery,null,null)}var j=m(()=>{y();ee();C()});var li={};_(li,{getMWLine:()=>ri,getMWLineTitle:()=>ai,getSplitSpecialUrl:()=>rt,isMWLink:()=>te});function rt(i){let e=i.split("/"),t={};return o.local.specialPagesAliasesPrefixed["Special:PermanentLink"].includes(e[0])?(t.oldid=e[1],t):o.local.specialPagesAliasesPrefixed["Special:Redirect"].includes(e[0])?e[1]==="revision"?(t.oldid=e[2],t):(e[1]==="page"&&(t.curid=e[2]),t):(e.length>1&&(t.diff=e.pop()),e.length>1&&(t.oldid=e.pop()),t)}function te(i,e){let t=!1;return e=e||o.config.mwLink,e.id&&(t=e.id.some(s=>i.id===s),t)||e.hasClass&&(t=e.hasClass.some(s=>i.classList.contains(s)),t)||e.hasChild&&(t=e.hasChild.some(s=>i.querySelector(s)),t)||e.closestTo&&(t=e.closestTo.some(s=>i.closest(s))),t}function ri(i){return i.closest(o.config.mwLine.selector.join(","))}function ai(i){let e=i.dataset.title;if(!a(e))return decodeURIComponent(e);let t=o.config.mwLineTitle.selector.join(","),s=i.querySelector(t);if(s)return a(s.title)?s.innerText:s.title}var Bs=m(()=>{P();y()});var ci,ie,at=m(()=>{y();ci=class{options={};node;constructor(e){this.options={node:null,tag:"button",classes:[],label:null,title:null,href:null,target:"_self",handler:null,container:null,insertMethod:"appendTo",ariaHaspopup:!1,altTitle:null,useAltKey:!1,...e},a(this.options.href)||(this.options.tag="a"),OO.EventEmitter.call(this),this.options.node?.nodeType===1?(this.node=this.options.node,this.process()):this.render()}render(){this.node=document.createElement(this.options.tag),this.node.innerText=this.options.label,this.node.classList.add(...this.options.classes),a(this.options.title)||(this.node.title=this.options.title),a(this.options.href)?(this.node.setAttribute("tabindex","0"),this.node.setAttribute("role","button")):(this.node.href=this.options.href,this.node.target=this.options.target),this.process(),this.embed(this.options.container,this.options.insertMethod)}process(){x(this.options.handler)&&(this.options.ariaHaspopup&&this.node.setAttribute("aria-haspopup","dialog"),a(this.options.altTitle)||(this.node.dataset.altTitle=this.options.altTitle),Ne(this.node,this.options.handler.bind(this),this.options.useAltKey))}embed(e,t){I(this.node,e,t)}remove(){this.node.remove()}pending(e){this.node.classList.toggle("instantDiffs-link--pending",e)}getContainer(){return this.node}},ie=ci});var Us=m(()=>{});var Hs,uo,fi,O,Ee=m(()=>{P();y();Bs();B();le();at();ee();C();Us();({h:Hs,ht:uo}=w),fi=class i{static utils=li;static stack=new Map;static findLinks(e){return typeof e>"u"&&(e=$e()),e.find(o.local.linkSelector)}static addLink(e,t){this.stack.set(e,t.isValid?t:!1)}static getLink(e){return this.stack.get(e)}static hasLink(e){return this.stack.has(e)}static getLinks(){return this.stack.values()}node;options={};article;nodes={};mw={hasLink:!1,hasLine:!1};manual={behavior:"basic",options:{}};actions={};extensions={};isValid=!1;isForeign=!1;isLoading=!1;isLoaded=!1;isProcessed=!1;isObserved=!1;hasRequest=!1;constructor(e,t){this.node=e,this.options={behavior:"basic",insertMethod:"insertAfter",showLink:l.get("showLink"),showPageLink:l.get("showPageLink"),showAltTitle:!1,initiatorLink:null,initiatorPage:null,initiatorView:null,onRequest:()=>{},onLoad:()=>{},onOpen:()=>{},onClose:()=>{},...t},L.isContains(this.node)&&(this.options.initiatorView=L,this.options.initiatorPage=L.getPage()),this.process(),i.addLink(this.node,this),this.isValid&&this.render()}process(){if(this.href=this.node.href,a(this.href))return;let e={};try{this.url=new URL(this.href),e.title=this.url.searchParams.get("title"),e.pathname=decodeURIComponent(this.url.pathname),e.pathnameNormalized=e.pathname.replace(new RegExp(o.local.mwArticlePath),"")}catch{return}if(o.config.exclude.linkActions.includes(this.url.searchParams.get("action"))||te(this.node,o.config.mwLinkExclude))return;let t={hostname:this.url.hostname,hash:this.url.hash};o.local.specialPagesLinksSearchRegExp.test(e.title)?t={...t,...rt(e.title)}:o.local.specialPagesLinksPathRegExp.test(e.pathname)?t={...t,...rt(e.pathnameNormalized)}:(["title","curid","oldid","diff","direction","page1","rev1","page2","rev2"].forEach(s=>{t[s]=this.url.searchParams.get(s)}),a(t.title)&&o.local.articlePathRegExp.test(e.pathname)&&(t.title=e.pathnameNormalized)),this.article=new W(t),this.isValid=this.article.isValid,this.isForeign=this.article.isForeign}render(){switch(this.processMWOptions(),this.processManualOptions(),this.postValidateOptions(),a(this.article.get("title"))&&this.mw.hasLine&&this.article.set({title:this.mw.title}),this.options.behavior){case"event":this.renderEvent();break;case"basic":this.renderBasic();break;case"request":this.renderRequest();break}}processMWOptions(){this.mw.isContent=te(this.node,o.config.mwLinkContent),this.mw.isContent&&(this.options.behavior="request"),this.mw.hasLink=te(this.node,o.config.mwLink),this.mw.hasLink&&(this.options.behavior="basic",this.mw.isDiffOnly=te(this.node,o.config.mwLinkDiffOnly),this.mw.isPrepend=te(this.node,o.config.mwLinkPrepend),this.mw.isPrepend&&(this.options.insertMethod="insertBefore"),this.mw.isAltTitle=te(this.node,o.config.mwLinkAltTitle),this.mw.isAltTitle&&(this.options.showAltTitle=!0),this.mw.line=ri(this.node),this.mw.line&&(this.mw.hasLine=!0,this.mw.title=ai(this.mw.line),this.mw.line.classList.add("instantDiffs-line")),this.mw.isContentInside=te(this.node,o.config.mwLinkContentInside),this.mw.isContentInside&&(this.options.behavior="request"))}processManualOptions(){if(this.manual.options=this.node.dataset.instantdiffsOptions,!a(this.manual.options))try{this.manual.options=JSON.parse(this.manual.options),this.options={...this.options,...this.manual.options}}catch(e){let t={type:"link",tag:"link",message:e?.message||e,silent:!0};E("error-link-options",t)}this.manual.behavior=this.node.dataset.instantdiffsLink,a(this.manual.behavior)||(this.options.behavior=this.manual.behavior)}postValidateOptions(){let e={link:"event",default:"request"};e[this.options.behavior]&&(this.options.behavior=e[this.options.behavior]),["request","basic","event","none"].includes(this.options.behavior)||(this.options.behavior="basic"),this.options.showPageLink&&=this.options.behavior==="request"}observe(){this.isObserved||(this.isObserved=!0,o.local.interactionObserver.observe(this.node))}unobserve(){this.isObserved&&(this.isObserved=!1,o.local.interactionObserver.unobserve(this.node))}onIntersect(){this.isLoading||this.isLoaded||!this.isObserved||(this.unobserve(),this.request())}renderRequest(){this.hasRequest=this.isValid,this.hasRequest?(this.toggleSpinner(!0),this.observe()):(this.toggleSpinner(!1),this.isLoaded=!0,this.isProcessed=!1,this.unobserve())}request(){let e=this.article.get("type"),t=this.article.get("typeVariant");if(e==="revision")return this.requestRevision();if(e==="diff")return t==="comparePages"?this.requestCompare():this.requestDiff()}requestRevision(){if(this.isLoading)return;this.isLoading=!0,this.error=null;let e={action:"query",prop:"revisions",rvprop:["ids","timestamp","comment","content","user"],rvslots:"main",rvsection:0,format:"json",formatversion:2,uselang:o.local.userLanguage};return a(this.article.get("oldid"))?a(this.article.get("curid"))||(e.pageids=this.article.get("curid")):e.revids=this.article.get("oldid"),b.get(e,this.article).then(this.onRequestRevisionDone).fail(this.onRequestRevisionError)}onRequestRevisionError=(e,t)=>{this.isLoading=!1,this.error={type:"revision",tag:"link",code:a(this.article.get("curid"))?"generic":"curid",article:this.article,silent:!0},t?.error?(this.error.code=t.error.code,this.error.message=t.error.info):(this.error.message=e,E(`error-revision-${this.error.code}`,this.error)),this.renderError()};onRequestRevisionDone=e=>{this.isLoading=!1;let t=e?.query;if(!t||!t.badrevids&&!t.badpageids&&!t.pages)return this.onRequestRevisionError(void 0,e);let s=t.pages?.[0],n=s?.revisions?.[0],r={type:"revision"};if(t.badrevids?r.code="badrevids":t.badpageids?r.code="badpageids":!s||s.missing||!n?r.code="missing":s.invalid&&(r.code="invalid",r.info=s.invalidreason),r.code)return this.error=r,this.renderError();this.revision=n,this.article.set({title:s.title,section:ui(this.revision)}),this.article.isHidden=di(this.revision),this.renderSuccess()};requestDiff(){if(this.isLoading)return;this.isLoading=!0,this.error=null;let e={action:"compare",prop:["title","ids","timestamp","comment","user"],fromrev:h(this.article.get("oldid"))?this.article.get("oldid"):void 0,fromtitle:a(this.article.get("title"))?void 0:this.article.get("title"),torev:h(this.article.get("diff"))?this.article.get("diff"):void 0,torelative:M(this.article.get("diff"))?this.article.get("diff"):void 0,format:"json",formatversion:2,uselang:o.local.userLanguage};return b.get(e,this.article).then(this.onRequestDiffDone).fail(this.onRequestDiffError)}onRequestDiffError=(e,t)=>{this.isLoading=!1,this.error={type:"diff",tag:"link",article:this.article,silent:!0},t?.error?(this.error.code=t.error.code,this.error.message=t.error.info):(this.error.message=e,E("error-diff-generic",this.error)),this.renderError()};onRequestDiffDone=e=>{if(this.isLoading=!1,this.compare=e?.compare,!this.compare)return this.onRequestDiffError(null,e);this.article.set({title:ce(this.compare),section:Pe(this.compare)}),this.article.isHidden=lt(this.compare),this.renderSuccess()};requestCompare(){if(this.isLoading)return;this.isLoading=!0,this.error=null;let e=this.article.getValues(),t={action:"compare",prop:["title","ids","timestamp","comment","user"],fromrev:h(e.rev1)?e.rev1:void 0,fromtitle:a(e.page1)?void 0:e.page1,torev:h(e.rev2)?e.rev2:void 0,totitle:a(e.page2)?void 0:e.page2,format:"json",formatversion:2,uselang:o.local.userLanguage};return b.get(t,this.article).then(this.onRequestCompareDone).fail(this.onRequestCompareError)}onRequestCompareError=(e,t)=>{this.isLoading=!1,this.error={type:"diff",tag:"link",article:this.article,silent:!0},t?.error?(this.error.code=t.error.code,this.error.message=t.error.info):(this.error.message=e,E("error-diff-generic",this.error)),this.renderError()};onRequestCompareDone=e=>{if(this.isLoading=!1,this.compare=e?.compare,!this.compare)return this.onRequestCompareError(null,e);this.article.set({oldid:this.compare.fromrevid,diff:this.compare.torevid,page1:this.compare.fromtitle,page2:this.compare.totitle,title:ce(this.compare),section:Pe(this.compare)}),this.article.isHidden=lt(this.compare),this.renderSuccess()};renderEvent(){this.isValid&&(this.actions.action=new ie({node:this.node,handler:this.openDialog.bind(this),ariaHaspopup:!0}),this.renderSuccess())}renderBasic(){!this.isValid||this.mw.isDiffOnly&&this.article.get("type")!=="diff"||this.renderSuccess()}renderError(){if(this.isLoaded=!0,this.isProcessed=!1,this.toggleSpinner(!1),this.options.behavior!=="event"){this.renderWrapper();let e;this.error.type&&(e=`error-${this.error.type}-${this.error.code||"generic"}`,Fe(e)||(e=`error-${this.error.type}-generic`)),this.nodes.error=Hs("span",{class:["item","error","error-info"],title:se(e,this.error,this.article)},uo(we("error"))),this.nodes.inner.append(this.nodes.error),this.embed(this.node,this.options.insertMethod)}mw.hook(`${o.config.prefix}.link.renderError`).fire(this)}renderSuccess(){this.isLoaded=!0,this.isProcessed=!0,this.toggleSpinner(!1),this.options.behavior!=="event"&&(this.renderWrapper(),this.renderLinkAction(),this.options.showPageLink&&this.renderPageAction(),this.embed(this.node,this.options.insertMethod)),mw.hook(`${o.config.prefix}.link.renderSuccess`).fire(this)}renderWrapper(){this.nodes.container=this.nodes.inner=Hs("span",{class:["instantDiffs-panel","nowrap","noprint"]})}renderAction(e){return e={tag:"a",label:null,title:null,href:null,target:Ve(this.options.initiatorView),handler:null,classes:[],modifiers:[],container:this.nodes.inner,...e},e.classes=["item","text","instantDiffs-action",...e.classes],e.modifiers.forEach(t=>e.classes.push(`instantDiffs-action--${t}`)),new ie(e)}getLinkTitle(e){return this.options.showAltTitle&&!a(this.node.title)?this.node.title:(this.article.isHidden&&(e=`${e}-hidden`),d(e))}renderLinkAction(){let e=this.article.get("typeVariant")==="comparePages"?"compare-pages":this.article.get("type"),t=this.getLinkTitle(`${e}-title`);if(!this.options.showLink)return this.mutateLinkAction(t);let s=[];this.article.isHidden&&s.push("error","error-admin"),this.actions.action=this.renderAction({label:we(this.article.get("type")),title:t,classes:s,modifiers:[this.article.get("type")],handler:this.openDialog.bind(this),ariaHaspopup:!0})}mutateLinkAction(e){let t=["instantDiffs-link",`instantDiffs-link--${this.article.get("type")}`,`is-${this.options.insertMethod}`];this.article.isHidden&&t.push("instantDiffs-link--error"),this.node.classList.remove("external"),this.node.classList.add(...t),this.node.dataset.instantdiffsLink=this.options.behavior,this.actions.action=new ie({node:this.node,handler:this.openDialog.bind(this),ariaHaspopup:!0,altTitle:e,useAltKey:!0})}renderPageAction(){this.actions.page=this.renderAction({label:we("page"),title:this.article.get("titleTextSection")||this.article.get("titleText"),href:this.article.get("href"),modifiers:["page"]})}openDialog(){let e={initiatorPage:this.options.initiatorPage,onOpen:()=>this.onDialogOpen(),onClose:()=>this.onDialogClose()};if(L.setup(this,e))return this.onDialogRequest(),$.when(L.load()).always(()=>this.onDialogLoad())}onDialogRequest(){this.toggleLoader(!0),x(this.options.onRequest)&&this.options.onRequest(this)}onDialogLoad(){this.toggleLoader(!1),x(this.options.onLoad)&&this.options.onLoad(this)}onDialogOpen(){this.mw.hasLine&&l.get("highlightLine")&&this.mw.line.classList.add("instantDiffs-line--highlight"),x(this.options.onOpen)&&this.options.onOpen(this),this.options.initiatorLink instanceof i&&this.options.initiatorLink.onDialogOpen()}onDialogClose(){this.mw.hasLine&&(l.get("highlightLine")&&this.mw.line.classList.remove("instantDiffs-line--highlight"),l.get("markWatchedLine")&&o.config.changeLists.includes(mw.config.get("wgCanonicalSpecialPageName"))&&(this.mw.line.classList.remove(...o.config.mwLine.unseen),this.mw.line.classList.add(...o.config.mwLine.seen)),l.get("markWatchedLine")&&o.local.mwCanonicalSpecialPageName==="GlobalWatchlist"&&this.mw.line.classList.add("instantDiffs-line--seen")),x(this.options.onClose)&&this.options.onClose(this),this.options.initiatorLink instanceof i&&this.options.initiatorLink.onDialogClose()}toggleLoader(e){this.actions.action?this.actions.action.pending(e):this.node.classList.toggle("instantDiffs-link--pending",e)}toggleSpinner(e){let t=ct(["loader",this.article.get("type")]);e?this.node.classList.add(...t):this.node.classList.remove(...t)}embed(e,t){I(this.nodes.container,e,t)}getContainer(){return this.nodes.container}getNode(){return this.node}getInitiatorLink(){return this.options.initiatorLink||this}getArticle(){return this.article}getMW(){return this.mw}},O=fi});var hi,be,pi=m(()=>{y();Ee();hi=class i{static instance;static newInstance(e){this.instance=new i(e)}options={};link;links=[];constructor(e){this.options={filterType:null,filterMWLine:!1,...e},this.links=Array.from(O.findLinks())}setLink(e){this.link=e}hasLink(e){return e instanceof O&&this.links.includes(e.getNode())}isLinkValid(e){if(!(e instanceof O)||!(e.isValid&&(e.isProcessed||e.hasRequest&&!e.isLoaded)))return!1;let n=a(this.options.filterType)?!0:e.getArticle().get("type")===this.options.filterType,r=this.options.filterMWLine===!0?e.getMW()?.hasLine:!0;return n&&r}getLength(){return this.links.length}getIndex(){return this.link instanceof O?this.links.indexOf(this.link.getNode()):-1}getPreviousLink(e){if(typeof e>"u"&&(e=this.getIndex()),e<=0)return;let t=e-1,s=O.getLink(this.links[t]);return this.isLinkValid(s)?s:this.getPreviousLink(t)}getNextLink(e){if(typeof e>"u"&&(e=this.getIndex()),e<0||e+1>=this.getLength())return;let t=e+1,s=O.getLink(this.links[t]);return this.isLinkValid(s)?s:this.getNextLink(t)}},be=hi});function _s(i){return i==="<unregistered>"?!1:!mw.util.isIPAddress(i)}function Gs(i){return"isTemporaryUser"in mw.util?mw.util.isTemporaryUser(i):!1}function je(i){if(R(i)&&(i=new Date(i)),!(i instanceof Date))return;let e=qe("mediawiki.DateFormatter");return e?e.forUser().formatTimeAndDate(i):i.toLocaleString()}var gi=m(()=>{y()});var Ue={};_(Ue,{isVisualDiffsAvailable:()=>ut,processRevisionDiffTable:()=>Be,renderDiffTable:()=>wi,renderDiffTableSide:()=>dt,renderMobileDiffFooter:()=>vi,renderUserInfoCardButton:()=>Ks,renderUserLink:()=>bi,restoreFileMediaInfo:()=>Li,restoreInlineFormatToggle:()=>ki,restoreRollbackLink:()=>xi,restoreVisualDiffs:()=>yi,restoreWikiLambda:()=>Di});function wi(i){let e={};return e.container=k("table",{class:["diff","diff-type-table",`diff-contentalign-${mw.config.get("wgContentLanguageDir")==="rtl"?"right":"left"}`,`diff-editfont-${mw.user.options.get("editfont")}`]},k("colgroup",k("col",{class:"diff-marker"}),k("col",{class:"diff-content"}),k("col",{class:"diff-marker"}),k("col",{class:"diff-content"})),e.head=k("tbody",k("tr",{class:"diff-title",lang:o.local.userLanguage},e.deleted=k("td",{class:["diff-otitle","diff-side-deleted"],colSpan:2}),e.added=k("td",{class:["diff-ntitle","diff-side-added"],colSpan:2}))),e.body=k("tbody")),a(i)?i===""&&(e.notice=k("tr",k("td",{class:"diff-notice",colSpan:4},k("div",{class:"mw-diff-empty"},mw.msg("diff-empty")))),e.body.append(e.notice)):Pi(e.body,i),e}function dt(i){i={prefix:"n",title:null,revid:null,curRevid:null,hostname:null,timestamp:null,texthidden:!1,user:null,userhidden:!1,comment:null,commenthidden:!1,...i};let e=`mw-diff-${i.prefix}title`,t=i.revid===i.curRevid?"currentrev-asof":"revisionasof",s=new W({type:"revision",title:i.title,oldid:i.revid,hostname:i.hostname});return mi(k("div",{id:`${e}1`},k("strong",i.texthidden?k("span",{class:"history-deleted"},mw.msg(t,je(i.timestamp))):k("a",{href:N(s)},mw.msg(t,je(i.timestamp))))),k("div",{id:`${e}2`},i.userhidden?k("span",{class:["mw-userlink","history-deleted"]},mw.msg("rev-deleted-user")):bi(s,i.user)),k("div",{id:`${e}3`},i.commenthidden?k("span",{class:["comment","history-deleted"]},mw.msg("rev-deleted-comment")):a(i.comment)?k("span",{class:["comment","mw-comment-none"]},mw.msg("changeslist-nocomment")):k("span",{class:["comment","comment--without-parentheses"],innerHTML:i.comment})))}function Be(i){l.get("showRevisionInfo")?(i.find("td:is(.diff-otitle, .diff-side-deleted)").addClass("instantDiffs-hidden"),i.find("td:is(.diff-ntitle, .diff-side-added)").attr("colspan","4"),i.find("tr:not([class])").addClass("instantDiffs-hidden")):i.addClass("instantDiffs-hidden")}function bi(i,e){let t=new mw.Title(e,2).getPrefixedText(),s=new mw.Title(e,3).getPrefixedText(),n=new mw.Title(`Contributions/${e}`,-1).getPrefixedText(),r=mi(k("a",{class:["mw-redirect","mw-usertoollinks-talk"],title:s,href:U(i,mw.util.getUrl(s))},mw.msg("talkpagelinktext")),zs(mw.msg("pipe-separator")),k("a",{class:["mw-redirect","mw-usertoollinks-talk"],title:n,href:U(i,mw.util.getUrl(n))},mw.msg("contribslink")));return mi(Ks(e),k("a",{class:"mw-userlink",title:t,href:U(i,mw.util.getUrl(t))},k("bdi",e)),zs(mw.msg("word-separator")),k("span",{class:"mw-usertoollinks"},ho(mw.message("parentheses",r).parseDom())))}function Ks(i){if(!mw.user.options.get("checkuser-userinfocard-enable")||!_s(i))return;let e=["cdx-button__icon","ext-checkuser-userinfocard-button__icon",Gs(i)?"ext-checkuser-userinfocard-button__icon--userTemporary":"ext-checkuser-userinfocard-button__icon--userAvatar"],t=k("a",{class:"ext-checkuser-userinfocard-button cdx-button cdx-button--action-default cdx-button--weight-quiet cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cd-comment-author-userInfoCard-button",role:"button",tabindex:0,href:"javascript:void(0)",ariaLabel:mw.msg("checkuser-userinfocard-toggle-button-aria-label"),"data-username":i},k("span",{class:e}));return t.setAttribute("aria-haspopover","dialog"),t}function vi(i){i={title:null,revid:null,hostname:null,user:null,userhidden:!1,...i};let e=new W({type:"revision",title:i.title,oldid:i.revid,hostname:i.hostname});return k("div",{class:["mw-diff-mobile-footer"]},i.userhidden?k("span",{class:["mw-userlink","history-deleted"]},mw.msg("rev-deleted-user")):bi(e,i.user))}function ki(i){if(!i||i.length===0||mw.loader.getState("mediawiki.diff")!=="ready")return!1;let e=i.find("#mw-diffPage-inline-toggle-switch-layout"),t=ot("mediawiki.diff","./inlineFormatToggle.js");try{return t(e),!0}catch{}return!1}function yi(i){if(!i||i.length===0||!h(mw.config.get("wgDiffOldId"))||!h(mw.config.get("wgDiffNewId"))||!ut(mw.config.get("wgPageContentModel"))||mw.loader.getState("ext.visualEditor.diffPage.init")!=="ready")return!1;let e=i.find(".ve-init-mw-diffPage-diffMode");if(e.length>0)return!0;e=$("<div>").addClass("ve-init-mw-diffPage-diffMode");let t=i.find(".mw-diffPage-inlineToggle-container");return t.length>0?t.before(e):i.append(e),!0}function ut(i){let e=mw.config.get("wgVisualEditorConfig");return e&&Object.prototype.hasOwnProperty.call(e.contentModels,i)}function xi(i){if(!i||i.length===0)return!1;let e=['.mw-rollback-link a[data-mw="interface"]',".mw-rollback-link a[data-mw-interface]"];return i.confirmable({i18n:{confirm:mw.msg("rollback-confirmation-confirm"),yes:mw.msg("rollback-confirmation-yes"),no:mw.msg("rollback-confirmation-no")},delegate:e.join(","),handler:t=>{t.preventDefault(),po(t.target)}}),!0}function po(i){let e=$.createSpinner({size:"small",type:"inline"});$(i).css("display","none").after(e);let t={action:"rollback",title:Si(i.href),user:mw.util.getParamValue("from",i.href),token:mw.util.getParamValue("token",i.href),formatversion:2,uselang:o.local.userLanguage};b.post(t).then(s=>{let n=$(ft(s?.rollback?.summary));fe(n),mw.notify(n,{tag:"rollback"}),$(i).closest(".mw-rollback-link").remove(),L.refresh()}).catch((s,n)=>{let r=$(ft(n?.error?.info));fe(r),mw.notify(r,{type:"error",tag:"rollback"}),e.remove(),$(i).css("display","")})}function Di(i){return!i||i.length===0?!1:(mw.loader.using(["@wikimedia/codex","ext.wikilambda.app"]).then(e=>{let{createMwApp:t}=e("vue"),{createPinia:s}=e("pinia"),{useMainStore:n,App:r}=e("ext.wikilambda.app");if(mw.config.get("wgWikiLambda")){let c=s(),p=n(c);window.vueInstance=t(Object.assign({provide:()=>({viewmode:p.getViewMode})},r)).use(c).mount(i.get(0))}}),!0)}async function Li(i){if(!i||i.length===0)return;let e=["wikibasemediainfo-filepage-fileinfo-heading","wikibasemediainfo-filepage-structured-data-heading"];return await b.loadMessage(e),go(i)}function go(i){let e=new OO.ui.TabPanelLayout("captions",{expanded:!1,label:mw.msg("wikibasemediainfo-filepage-fileinfo-heading"),$content:i.find("mediainfoviewcaptions")}),t=new OO.ui.TabPanelLayout("statements",{expanded:!1,label:mw.msg("wikibasemediainfo-filepage-structured-data-heading"),$content:i.find("mediainfoviewstatements")}),s=new OO.ui.IndexLayout({expanded:!1,framed:!1});s.addTabPanels([e,t],0);let n=new OO.ui.PanelLayout({expanded:!1,framed:!1,content:[s]});return k("div",{class:"instantDiffs-page-mediaInfo"},n.$element.get(0))}var k,mi,zs,ho,ht=m(()=>{P();y();j();X();gi();B();le();ee();C();({h:k,hf:mi,ht:zs,hj:ho}=w)});var Ei,$i,Qs=m(()=>{y();Ei=class{config=mw.config;values={};backup={};constructor(e,t){t&&(this.config=t),this.setValues(e)}set(e,t){Object.hasOwn(this.backup,e)||(this.backup[e]=this.config.get(e)),this.values[e]=t}setValues(e){for(let[t,s]of Object.entries(e))this.set(t,s)}setTitle(e){a(e)||(R(e)&&(e=new mw.Title(e)),this.setValues({wgTitle:e.getMainText(),wgPageName:e.getPrefixedDb(),wgNamespaceNumber:e.getNamespaceId(),wgRelevantPageName:e.getPrefixedDb()}))}get(e){return this.values[e]}getValues(){return this.values}apply(){for(let[e,t]of Object.entries(this.values))t!==void 0&&this.config.set(e,t)}restore(){for(let[e,t]of Object.entries(this.backup))t!==void 0&&this.config.set(e,t)}},$i=Ei});var Ai,Js,Ys=m(()=>{B();Ai=class{items=new Map;get(e,t){let s=b.get(e,t);return this.add(s),s}ajax(e){let t=$.ajax(e);return this.add(t),t}when(...e){return $.when(...e)}abort(){this.items.forEach((e,t)=>t.abort())}add(e){let t=e.always(()=>this.delete(e));return this.items.set(e,t),t}delete(e){this.items.delete(e)}},Js=Ai});var Mi={};_(Mi,{getDaysLeftExpiry:()=>Ti,updateGlobalWatchlistStatus:()=>Oi,updateWatchButtonStatus:()=>pt,updateWatchlistStatus:()=>Ci});function Ti(i){if(!i||mw.util.isInfinity(i))return null;let e=new Date(i);return Math.ceil((e-new Date)/(1e3*60*60*24))}function pt(i,e){let t=i.get("watched"),s=t?"unwatch":"watch",n=i.get("expiry")||"infinity",r=Ti(n),c=`action-${s}`,p=mw.util.getUrl(i.get("title"),{action:s}),f,g;t?mw.util.isInfinity(n)?(f="unwatch",g="unStar"):(f=r>0?"unwatch-expiring":"unwatch-expiring-hours",g="halfStar"):(f="watch",g="star"),e.setLabel(d(c)),e.setTitle(mw.msg(`tooltip-ca-${f}`,r)),e.setHref(U(i,p)),e.setIcon(g)}function Ci(i,e,t){let s=i.get("titleText");e?Zs(s,(n,r,c)=>{r.find(".mw-changelist-line-inner-unwatched").addBack(".mw-enhanced-rc-nested").removeClass("mw-changelist-line-inner-unwatched"),c.length>0&&c.text(mw.msg("watchlist-unwatch")).attr("title",mw.msg("tooltip-ca-unwatch")).attr("href",mw.util.getUrl(n,{action:"unwatch"})).removeClass("mw-watch-link loading").addClass("mw-unwatch-link"),Xs(r,e,t)}):Zs(s,(n,r,c)=>{r.find(".mw-changeslist-line-inner, .mw-enhanced-rc-nested").addBack(".mw-enhanced-rc-nested").addClass("mw-changelist-line-inner-unwatched"),c.length>0&&c.text(mw.msg("watchlist-unwatch-undo")).attr("title",mw.msg("tooltip-ca-watch")).attr("href",mw.util.getUrl(n,{action:"watch"})).removeClass("mw-unwatch-link loading").addClass("mw-watch-link"),Xs(r,e,t)})}function Xs(i,e,t){if(!e)return;let s=i.find(".mw-changesList-watchlistExpiry");if(mw.util.isInfinity(t))return mo(i,s);let n=Ti(t),r=n>0?"days-full-text":"hours-full-text",c=mw.msg(`watchlist-expiring-${r}`,n);s.length>0?s.each((p,f)=>{f.title=c}):wo(i,c)}function mo(i,e){e.each((t,s)=>{let n=$(s);n.next(".mw-changeslist-separator").addClass("mw-changeslist-separator--semicolon").removeClass("mw-changeslist-separator"),s.previousSibling.nodeValue=s.previousSibling.nodeValue.trimEnd(),s.nextSibling.nodeValue=s.nextSibling.nodeValue.trimStart(),n.next(".mw-changeslist-links").before(" "),e.remove()}),i.find(".mw-changeslist-line-inner-historyLink").prepend(" ")}function wo(i,e){i.find(".mw-title").each((t,s)=>{let n=$(s),r=n.next(".mw-fr-reviewlink"),c=new OO.ui.IconWidget({icon:"clock",title:e,classes:["mw-changesList-watchlistExpiry"]});(r.length>0?r:n).after(" ").after(c.$element).after(" "),c.$element.next(".mw-changeslist-separator--semicolon").addClass("mw-changeslist-separator").removeClass("mw-changeslist-separator--semicolon")})}function Zs(i,e){let t=mw.Title.newFromText(i),n=(t.isTalkPage()?t.getSubjectPage():t.getTalkPage()).getPrefixedText();$(".mw-changeslist-line").each((r,c)=>{$(c).find("[data-target-page]").each((f,g)=>{let S=$(g),u=String(S.data("targetPage"));if(u===i||u===n){let v=S.closest("li, .mw-enhancedchanges-checkbox + table.mw-changeslist-log td[data-target-page], table"),D=v.find(".mw-unwatch-link, .mw-watch-link");e(u,v,D)}})})}function Oi(i,e,t){if(mw.globalwatchlist)try{let s=mw.globalwatchlist.watchedSites.siteList.find(n=>n.site===i.get("hostname"));if(!s)return;s.processUpdateWatched(i.get("origTitle"),!e)}catch(s){E("error-global-watchlist",{article:i,tag:"watch",message:s?.message||s,silent:!0})}}var Ii=m(()=>{y();X()});var bo,Ri,gt,Wi=m(()=>{P();y();Ii();j();C();B();({h:bo}=w),Ri=class{static utils=Mi;static notificationId="mw-watchlink-notification";article;options={};preferredExpiry;isWatchlistExpiryEnabled=!1;watchlistLabelsEnabled=!1;isWatchListPopupEnabled=!1;isWatched=!1;$watchLink;watchlistPopupWrapper;watchlistPopup;constructor(e,t){this.article=e,this.options={onUpdate:()=>{},...t},this.$watchLink=$('<a class="instantDiffs-button--fake-watch">'),I(this.$watchLink,document.body);let s=ot("mediawiki.page.watch.ajax","config.json")||{};this.isWatchlistExpiryEnabled=!this.article.isForeign&&(s.WatchlistExpiry||!1),this.watchlistLabelsEnabled=!this.article.isForeign&&(s.EnableWatchlistLabels||!1),this.isWatchListPopupEnabled=l.get("showWatchlistPopup")&&(this.isWatchlistExpiryEnabled||this.watchlistLabelsEnabled);let n=["mediawiki.notification"];(this.isWatchlistExpiryEnabled||this.watchlistLabelsEnabled)&&n.push("mediawiki.watchstar.widgets"),this.watchlistLabelsEnabled&&n.push("mediawiki.widgets.MenuTagMultiselectWidget"),mw.loader.load(n)}async preloadMessages(){await b.loadMessage(["watchlist-expiring-days-full-text","watchlist-expiring-hours-full-text","tooltip-ca-watch","tooltip-ca-unwatch","tooltip-ca-unwatch-expiring","tooltip-ca-unwatch-expiring-hours"])}async request(){return await this.preloadMessages(),this.preferredExpiry=mw.user.options.get("watchstar-expiry","infinity"),this.isWatched=this.article.get("watched"),l.get("expEnableWatchlistPopup")&&this.isWatchListPopupEnabled?this.requestModules():this.requestWatchStatus()}requestModules(){return mw.loader.using("mediawiki.watchstar.widgets").then(e=>{let t=e("mediawiki.watchstar.widgets");return Ae(t)?this.showWatchlistPopup():this.requestWatchStatus()})}requestWatchStatus(){let e=this.article.getMW("title").getPrefixedDb();return(this.isWatched?b.unwatch(e,this.article):b.watch(e,this.preferredExpiry,this.article)).then(this.showNotice).fail(this.showError)}showError=(e,t)=>{let s=b.getApi().getErrorMessage(t);mw.notify(s,{tag:"watch-self",type:"error",id:this.constructor.notificationId})};showNotice=e=>{if(!e)return this.showError(void 0,e);this.isWatched=e.watched===!0;let t=this.article.getMW("title"),s=e.expiry||"infinity",n=this.isWatched?"addedwatchtext":"removedwatchtext";t.isTalkPage()&&(n+="-talk");let r;this.isWatchListPopupEnabled?(this.isWatched&&(n=!this.preferredExpiry||mw.util.isInfinity(this.preferredExpiry)?"addedwatchindefinitelytext":"addedwatchexpirytext",t.isTalkPage()&&(n+="-talk")),r=this.showWatchlistNotice(t,n,s)):r=this.showBasicNotice(t,n),r.always(()=>{let c=this.isWatched?"unwatch":"watch";this.updateStatus(this.$watchLink,c,"idle",s,"infinity")})};getNoticeMessage(e,t){let s=this.article.get("hostname"),n=mw.message(t,e.getPrefixedText(),this.preferredExpiry).parseDom();return Q(n,`https://${s}`),fe(n),n}showBasicNotice(e,t){let s=this.getNoticeMessage(e,t);return mw.notify(s,{tag:"watch-self",id:this.constructor.notificationId})}showWatchlistNotice(e,t,s){return mw.loader.using("mediawiki.watchstar.widgets").then(n=>{let r=n("mediawiki.watchstar.widgets");if(!r)return this.showBasicNotice(e,t);let c=this.getNoticeMessage(e,t),p=[this.isWatched?"watch":"unwatch",e.getPrefixedDb(),s,this.updateStatus,{expiryEnabled:this.isWatchlistExpiryEnabled,labelsEnabled:this.watchlistLabelsEnabled,$link:this.$watchLink,message:c}];Ni(mw.config.get("wgVersion"),"1.45.0")<0&&p.splice(2,1);try{let f=new r(...p);mw.notify(f.$element,{tag:"watch-self",id:this.constructor.notificationId,autoHideSeconds:"short"})}catch(f){ve(this.constructor.name,"Falls back to basic watch/unwatch functionality.",f),this.showBasicNotice(e,t)}})}showWatchlistPopup(){return this.watchlistPopup?(this.watchlistPopup.isOpen?this.watchlistPopup.isOpen=!1:this.watchlistPopup.openPopup(this.$watchLink[0]),$.Deferred().resolve().promise()):mw.loader.using(["@wikimedia/codex","mediawiki.watchstar.widgets"]).then(e=>{let t=e("vue"),s=e("mediawiki.watchstar.widgets"),n=s.WatchlistPopup;this.watchlistPopupWrapper=bo("span.mw-watchlink-popup"),I(this.watchlistPopupWrapper,document.body),this.watchlistPopup=t.createMwApp(n,{initialAction:this.isWatched?"unwatch":"watch",expiryEnabled:this.isWatchlistExpiryEnabled,labelsEnabled:this.watchlistLabelsEnabled,title:this.article.getMW("title"),dataExpiryOptions:s.dataExpiryOptions,preferredExpiry:this.preferredExpiry,link:this.$watchLink[0]}).mount(this.watchlistPopupWrapper),window.addEventListener("WatchlistPopup.watch",this.onWatchlistPopupWatch),window.addEventListener("WatchlistPopup.unwatch",this.onWatchlistPopupUnwatch)})}onWatchlistPopupWatch=e=>{this.isWatched=!0;let t=e.detail?.watchResponse?e.detail.watchResponse.expiry||e.detail.watchResponse._rawValue?.expiry:"infinity";this.updateStatus(this.$watchLink,"unwatch","idle",t)};onWatchlistPopupUnwatch=e=>{this.isWatched=!1,this.updateStatus(this.$watchLink,"watch","idle")};updateStatus=(e,t,s,n="infinity",r="infinity")=>{let c=t==="unwatch";if(this.isWatched=c,this.article.setValues({watched:c,expiry:n,expirySelected:r}),this.options.onUpdate(s),!this.article.isForeign&&o.local.mwTitleText===this.article.get("titleText")){let{updatePageWatchStatus:p}=qe("mediawiki.page.watch.ajax")||{};p?.(c,n,r)}s!=="loading"&&(!this.article.isForeign&&o.local.mwCanonicalSpecialPageName==="Watchlist"&&Ci(this.article,c,n),o.local.mwCanonicalSpecialPageName==="GlobalWatchlist"&&Oi(this.article,c,n))};getArticle(){return this.article}detach(){this.watchlistPopup&&(window.removeEventListener("WatchlistPopup.watch",this.onWatchlistPopupWatch),window.removeEventListener("WatchlistPopup.unwatch",this.onWatchlistPopupUnwatch),this.watchlistPopup.isOpen=!1,this.watchlistPopupWrapper.remove()),this.$watchLink.detach()}},gt=Ri});var Fi={};_(Fi,{default:()=>vo});var mt,vo,Vi=m(()=>{y();j();X();Ee();C();mt=class extends OO.ui.ButtonWidget{options={};invisibleIcon=!1;link;handler;constructor(e){e={name:null,type:"default",classes:[],framed:!0,invisibleLabel:!1,invisibleIcon:!1,icon:"puzzle",href:null,target:Ve(!0),handler:null,useAltKey:!1,article:null,setLink:!1,...e,linkOptions:{behavior:"event",...e.linkOptions}},e.type==="navigation"&&(e.icon=null,e.classes=[...e.classes,"instantDiffs-button--navigation"]),e.type==="pin"&&(e.invisibleLabel=!0,e.classes=[...e.classes,"instantDiffs-button--pin"]),e.type==="menu"&&(e.classes=[...e.classes,"instantDiffs-button--link"],e.framed=!1,l.get("showMenuIcons")||(e.invisibleIcon=!0)),a(e.href)||(e.href=U(e.article,e.href)),super(e),this.options=e,this.setInvisibleIcon(e.invisibleIcon),e.handler&&this.setHandler(e.handler,e.useAltKey),e.setLink&&this.setLink(e.linkOptions)}setInvisibleIcon(e){return e=!!e,this.invisibleIcon!==e&&(this.invisibleIcon=e,this.$element.toggleClass("instantDiffs-invisibleIconElement",!this.icon||this.invisibleIcon)),this}setLink(e){return this.link=new O(this.$button.get(0),e),this}setHandler(e,t){if(x(this.handler)&&ji(this.$button.get(0),this.handler),x(e)){let s=n=>e(this,n);this.handler=Ne(this.$button.get(0),s,t)}return this}execHandler(){return this.$button.get(0).click(),this}getOption(e){return this.options[e]}getOptions(){return this.options}getArticle(){return this.getOption("article")}pending(e){return this.$button.toggleClass("instantDiffs-link--pending",e),this}};H(mt);vo=mt});var qi,en,tn=m(()=>{y();C();qi=class{article;options={};groups={};buttons={};MenuButton;constructor(e,t){this.article=e,this.options={...t},this.MenuButton=(Vi(),De(Fi)).default}renderGroup(e){return e={name:null,group:null,widget:null,type:"vertical",classes:[],container:null,...e},e.type==="vertical"&&e.classes.push("instantDiffs-buttons-group","instantDiffs-buttons-group--vertical",`instantDiffs-buttons-group--${e.name}`,l.get("showMenuIcons")?"has-icons":null),e.type==="horizontal"&&e.classes.push("instantDiffs-buttons-group","instantDiffs-buttons-group--horizontal",`instantDiffs-buttons-group--${e.name}`),e.widget=new OO.ui.ButtonGroupWidget(e),I(e.widget.$element,e.container),this.registerGroup(e)}registerGroup(e){if(e={name:null,group:null,widget:null,...e},!this.groups[e.name])return this.groups[e.name]=e,e}getGroup(e){return this.groups[e]}getGroups(e){return Object.values(this.groups).filter(t=>!e||e===t.group)}getGroupsWidgets(e){return this.getGroups(e).map(t=>t.widget)}getGroupsElements(e){return this.getGroups(e).map(t=>t.widget.$element.get(0))}addGroupButtons(e,t){let s=this.getGroup(e);if(!s)return;t=z(t)?t:[t];let n=t.map(r=>r.widget);s.widget.addItems(n)}getGroupButtons(e){return this.getButtons().filter(t=>wt(e,t.group))}renderButton(e){if(e={article:this.article,name:null,group:null,canSystem:!1,systemType:"pin",systemGroup:"navigation",canPin:!1,pinType:"pin",pinGroup:"pins",canMenu:!0,menuGroup:"menu",menuType:"menu",widget:null,...e},this.buttons[e.name])return;let t=this.buttons[e.name]=[];if(e.canSystem){let s=this.renderButtonHelper({...e,type:e.systemType,group:e.systemGroup,isSystem:!0});t.push(s)}if(e.canPin&&wt(l.get("pinnedActions"),e.name)){let s=this.renderButtonHelper({...e,type:e.pinType,group:e.pinGroup,isPin:!0});t.push(s)}if(e.canMenu){let s=this.renderButtonHelper({...e,type:e.menuType,group:e.menuGroup,isMenu:!0});t.push(s)}return t}renderButtonHelper(e){return e.widget=new this.MenuButton(e),this.addGroupButtons(e.group,e),e}registerButton(e){if(e={name:null,group:null,type:null,widget:null,...e},!this.buttons[e.name])return this.buttons[e.name]=[e],this.addGroupButtons(e.group,e),e}getButton(e,t){if(this.buttons[e])return this.buttons[e].filter(n=>!t||R(t)&&n.group===t||z(t)&&t.includes(n.group))}getButtonWidget(e,t){let s=this.getButton(e,t);if(s)return s.map(n=>n.widget)}getButtons(){return Object.values(this.buttons).flat()}eachButton(e,t,s){let n=this.getButton(e,t);n&&n.forEach(r=>s(r))}eachButtonWidget(e,t,s){let n=this.getButtonWidget(e,t);n&&n.forEach(r=>s(r))}focusButton(e,t){let s=!1;return this.eachButtonWidget(e,t,n=>{if(!n.isDisabled())return n.focus(),s=!0,!0}),s}pendingButton(e,t,s){this.eachButtonWidget(e,t,n=>{n.pending(s)})}},en=qi});var sn=m(()=>{});var nn={};_(nn,{default:()=>ko});var bt,ko,on=m(()=>{y();j();C();bt=class extends OO.ui.PopupButtonWidget{constructor(e){e=J({icon:"menu",label:d("goto-actions"),title:q("goto-actions","actions",l.get("enableHotkeys")),invisibleLabel:!0,popup:{classes:["instantDiffs-buttons-popup",l.get("showMenuIcons")?"has-icons":null],width:"auto",padded:!1,anchor:!1,align:"backwards",autoClose:!0}},e),super(e)}execHandler(){return this.$button.get(0).click(),this}togglePopup(e){return this.getPopup().toggle(e),this}pending(e){return this.$button.toggleClass("instantDiffs-link--pending",e),this}};H(bt);ko=bt});var ke,yo,xo,Bi,rn,an=m(()=>{P();y();Le();X();Ii();le();pi();Wi();tn();ee();C();sn();({h:ke,hf:yo,ht:xo}=w),Bi=class{MenuActionsButton;MenuButton;page;article;articleParams={};options={};nodes={};actionRegister;watch;menu;isDetached=!1;constructor(e,t,s,n){this.page=e,this.article=t,this.articleParams={...s},this.options={initiatorAction:null,links:{},...n},this.MenuActionsButton=(on(),De(nn)).default,this.MenuButton=(Vi(),De(Fi)).default,L.connect(this,{hotkey:"onHotkey"}),this.render()}render(){this.nodes.container=ke("div",{class:["instantDiffs-navigation"]},this.nodes.left=ke("div",{class:["instantDiffs-navigation-group","instantDiffs-navigation-group--left"]}),this.nodes.center=ke("div",{class:["instantDiffs-navigation-group","instantDiffs-navigation-group--center"]}),this.nodes.right=ke("div",{class:["instantDiffs-navigation-group","instantDiffs-navigation-group--right"]})),this.renderMenu(),this.renderSnapshotLinks(),this.renderNavigationLinks(),this.renderActionLinks(),mw.hook(`${o.config.prefix}.navigation.complete`).fire(this)}groupsMap={left:["snapshot"],center:["navigation"],right:["pins-custom","pins"]};groups=[];actionGroupsMap=["mobile","menu-custom","menu","footer"];actionGroups=[];renderMenu(){this.menu=new en(this.article);for(let[e,t]of Object.entries(this.groupsMap))t.forEach(s=>{this.groups.push(s),this.menu.renderGroup({name:s,group:e,type:"horizontal",container:this.nodes[e]})});this.actionGroupsMap.forEach(e=>{this.actionGroups.push(e),this.menu.renderGroup({name:e,group:"actions",type:"vertical"})})}renderSnapshotLinks(){let e={canSystem:!0,systemType:"pin",systemGroup:"snapshot",canPin:!1,canMenu:!1},t={canMenu:!0,menuGroup:"mobile"};this.renderSnapshotPrevLink(e),this.renderSnapshotNextLink(e),this.page.getInitiatorPage()&&this.renderBackLink({...e,...t}),a(this.options.links.unpatrolled)||this.renderUnpatrolledLink({...e,...t})}renderNavigationLinks(){let e={canSystem:!0,systemType:"navigation",systemGroup:"navigation",canPin:!1,canMenu:!1},t={canMenu:!0,menuGroup:"mobile"};this.renderPrevLink(e),["page"].includes(this.article.get("typeVariant"))||this.renderSwitchLink({...e,...t}),this.renderNextLink(e)}renderActionLinks(){this.renderMenuLinks(),this.renderMenuFooterLinks(),this.renderMenuActions()}renderMenuLinks(){let e={canPin:!0,pinGroup:"pins",canMenu:!0,menuGroup:"menu"};this.renderCopyLink(e),this.renderCopyWikilink(e),this.renderTypeLink(e),a(this.article.get("title"))||(this.renderPageLink(e),this.article.getMW("title").canHaveTalkPage()&&this.renderTalkPageLink(e),Kt(mw.config.get("wgPageContentModel"))&&this.renderEditLink(e),this.renderHistoryLink(e),this.renderInfoLink(e),o.local.mwIsAnon||this.renderWatchLink(e)),this.renderSettingsLink(e)}renderMenuFooterLinks(){let e={canPin:!1,canMenu:!0,menuGroup:"footer"};this.renderIDLink(e)}renderMenuActions(){let e=Ui(this.menu.getGroupsElements("actions"),ke("hr.instantDiffs-buttons-separator")),t=new this.MenuActionsButton({popup:{$content:$(e)}});this.menu.registerButton({name:"actions",group:"pins",type:"pin",widget:t})}renderSnapshotPrevLink(e){let t=be.instance.getPreviousLink();e={name:"snapshotPrev",label:d("goto-snapshot-prev"),title:q("goto-snapshot-prev","snapshot-prev",l.get("enableHotkeys")),icon:"doubleChevronStart",href:t?t.href:null,disabled:!t,setLink:!!t,linkOptions:{initiatorLink:t,onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderSnapshotNextLink(e){let t=be.instance.getNextLink();e={name:"snapshotNext",label:d("goto-snapshot-next"),title:q("goto-snapshot-next","snapshot-next",l.get("enableHotkeys")),icon:"doubleChevronEnd",href:t?t.href:null,disabled:!t,setLink:!!t,linkOptions:{initiatorLink:t,onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderPrevLink(e){let t;if(this.options.links.prev){let n=new W({title:this.article.get("title"),hostname:this.article.get("hostname"),oldid:mw.config.get("wgDiffOldId"),diff:this.article.get("type")==="diff"?"prev":null,direction:this.article.get("type")==="revision"?"prev":null});t=N(n)}let s=vt({short:d("goto-prev"),long:d(`goto-prev-${this.article.get("type")}`),iconBefore:document.dir==="ltr"?"\u2190":"\u2192"});e={name:"prev",label:$(s),title:q(`goto-prev-${this.article.get("type")}`,"prev",l.get("enableHotkeys")),href:t,disabled:!t,setLink:!!t,linkOptions:{onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderNextLink(e){let t;if(this.options.links.next){let n=new W({title:this.article.get("title"),hostname:this.article.get("hostname"),oldid:mw.config.get("wgDiffNewId"),diff:this.article.get("type")==="diff"?"next":null,direction:this.article.get("type")==="revision"?"next":null});t=N(n)}let s=vt({short:d("goto-next"),long:d(`goto-next-${this.article.get("type")}`),iconAfter:document.dir==="ltr"?"\u2192":"\u2190"});e={name:"next",label:$(s),title:q(`goto-next-${this.article.get("type")}`,"next",l.get("enableHotkeys")),href:t,disabled:!t,setLink:!!t,linkOptions:{onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderSwitchLink(e){let t=this.article.get("type")==="diff"?"revision":"diff",s={type:t};e={name:"switch",label:d(`goto-view-${t}`),title:q(`goto-view-${t}`,"switch",l.get("enableHotkeys")),icon:"specialPages",href:N(this.article,{},s),classes:["instantDiffs-button--switch"],setLink:!0,linkOptions:{onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderUnpatrolledLink(e){e={name:"unpatrolled",label:d("goto-view-unpatrolled"),title:q("goto-view-unpatrolled","unpatrolled",l.get("enableHotkeys")),icon:"eyeClosed",href:this.options.links.unpatrolled,classes:["instantDiffs-button--pending"],setLink:!0,linkOptions:{initiatorPage:this.page,onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderBackLink(e){let t=this.page.getInitiatorPage(),s=t.getArticle();e={name:"back",label:d(`goto-back-${s.get("type")}`),title:q(`goto-back-${s.get("type")}`,"back",l.get("enableHotkeys")),icon:"newline",href:N(s,t.getArticleParams()),classes:["instantDiffs-button--back"],setLink:!0,linkOptions:{onRequest:()=>{let n=t.getNavigation()?.getActionRegister(),r=a(n)?e.name:`${e.name}-${n}`;this.setActionRegister(r)}},...e},this.menu.renderButton(e)}renderCopyLink(e){this.menu.renderButton({name:"copyLink",label:d("copy-link"),icon:"link",handler:this.actionCopyLink.bind(this),...e})}renderCopyWikilink(e){this.menu.renderButton({name:"copyWikilink",label:d("copy-wikilink"),icon:"wikiText",handler:this.actionCopyWikilink.bind(this),...e})}renderTypeLink(e){let t=this.article.get("type"),s={hash:l.get("linksHash")};this.menu.renderButton({name:"link",label:d(`goto-${t}`),icon:"articleRedirect",href:N(this.article,{},s),...e})}renderPageLink(e){let t=this.article.getMW("title").isTalkPage()?this.article.getMW("title").getSubjectPage().getUrl():this.article.get("href"),s={2:"userAvatar",3:"userAvatar",default:"article"};this.menu.renderButton({name:"page",label:d("goto-page"),icon:s[this.article.getMW("title").getNamespaceId()]||s.default,href:t,...e})}renderTalkPageLink(e){let t=this.article.getMW("title").isTalkPage()?this.article.get("href"):this.article.getMW("title").getTalkPage().getUrl(),s={2:"userTalk",3:"userTalk",default:"speechBubbles"};this.menu.renderButton({name:"talkPage",label:d("goto-talkpage"),icon:s[this.article.getMW("title").getNamespaceId()]||s.default,href:t,...e})}renderEditLink(e){let t=mw.config.get("wgIsProbablyEditable"),s=mw.util.getUrl(this.article.get("title"),{action:"edit"});this.menu.renderButton({name:"edit",label:d(t?"goto-edit":"goto-source"),icon:t?"edit":"editLock",href:s,...e})}renderHistoryLink(e){let t=mw.util.getUrl(this.article.get("title"),{action:"history"});this.menu.renderButton({name:"history",label:d("goto-history"),icon:"history",href:t,...e})}renderInfoLink(e){let t=mw.util.getUrl(this.article.get("title"),{action:"info"});this.menu.renderButton({name:"info",label:d("goto-info"),icon:"info",href:t,...e})}renderWatchLink(e){this.menu.renderButton({name:"watch",label:d("action-watch"),handler:this.actionWatchPage.bind(this),...e}),this.menu.eachButtonWidget("watch",null,t=>{pt(this.article,t)})}renderSettingsLink(e){this.menu.renderButton({name:"settings",label:d("goto-settings"),icon:"settings",handler:this.actionOpenSettings.bind(this),...e})}renderIDLink(e){let t=yo(ke("span.name",d("script-name")),xo(" "),ke("span.version",`v.${o.config.version}`));this.menu.renderButton({name:"id",label:$(t),icon:null,href:kt(`/wiki/${o.config.link}`),classes:["instantDiffs-button--link-id"],...e})}actionCopyLink(e){let t={relative:!1,hash:l.get("linksHash"),minify:l.get("linksFormat")==="minify"},s=N(this.article,{},t);He(s),this.focusAction(e)}actionCopyWikilink(e){this.pendingAction(e,!0),$.when(si(this.article)).done(t=>{He(t)}).fail(()=>{He(!1)}).always(()=>{this.pendingAction(e,!1),this.focusAction(e)})}actionWatchPage(e){this.pendingAction(e,!0),this.watch||(this.watch=new gt(this.article,{onUpdate:t=>{this.menu.eachButtonWidget("watch",null,s=>{s.pending(t==="loading"),pt(this.article,s)})}})),$.when(this.watch.request()).always(()=>{this.pendingAction(e,!1),this.focusAction(e)})}actionOpenSettings(e){this.pendingAction(e,!0),l.once("opening",()=>this.toggleActions(!1)),l.once("closed",()=>this.focusAction(e)),$.when(l.load()).always(()=>{this.pendingAction(e,!1)})}actionCounterparts={unpatrolled:"back","back-unpatrolled":"unpatrolled"};disabledActionCounterparts={next:"prev",prev:"next",snapshotNext:"snapshotPrev",snapshotPrev:"snapshotNext"};focusAction(e){return this.toggleActions(!1),e instanceof this.MenuButton?this.focusActionByWidget(e):R(e)?this.focusActionByName(e):!1}focusActionByWidget(e){if(e.isDisabled())return!1;let t=e.getOption("group");return this.groups.includes(t)?(e.focus(),!0):this.focusActionByName("actions")}focusActionByName(e){return e=this.actionCounterparts[e]||e,this.menu.focusButton(e,this.groups)?!0:(e=this.disabledActionCounterparts[e],e?this.menu.focusButton(e,this.groups):!1)}getActionName(e){if(e instanceof this.MenuButton)return e.getOption("name");if(R(e))return e}pendingAction(e,t){this.getActionName(e)&&this.menu.pendingButton(this.getActionName(e),null,t)}execAction(e){let t=this.getActionName(e);t&&(t!=="actions"&&this.toggleActions(!1),this.menu.eachButtonWidget(t,null,s=>{if(!s.isDisabled())return s.focus(),s.execHandler(),!0}))}toggleActions(e){this.menu.eachButtonWidget("actions",this.groups,t=>{t.togglePopup(e)})}setActionRegister(e){this.actionRegister=e}getActionRegister(){return this.actionRegister}getPinnableActions(){return this.menu.getButtons().filter(e=>e.canPin)}addCustomAction(e){e={...e,canSystem:!1,canPin:!0,pinGroup:"pins-custom",canMenu:!0,menuGroup:"menu-custom"},!a(e.name)&&(e.name=`custom-${e.name}`,this.menu.renderButton(e))}getCustomAction(e){let t;return e instanceof this.MenuButton&&(t=e.getOption("name")),R(e)&&(t=`custom-${e}`),this.menu.getButton(t,["pins-custom","menu-custom"])}getCustomActionWidget(e){let t=this.getCustomAction(e);if(t)return t.map(s=>s.widget)}eachCustomAction(e,t){let s=this.getCustomAction(e);s&&s.forEach(n=>t(n))}eachCustomActionWidget(e,t){let s=this.getCustomActionWidget(e);s&&s.forEach(n=>t(n))}actionHotkeyMap={none:{ArrowLeft:"prev",ArrowRight:"next"},ctrl:{ArrowLeft:"snapshotPrev",ArrowRight:"snapshotNext",ArrowUp:"switch",ArrowDown:"actions",KeyZ:"back",KeyP:"unpatrolled"},alt:{},shift:{}};actionHotkeyMapRTL={none:{ArrowRight:"prev",ArrowLeft:"next"},ctrl:{ArrowRight:"snapshotPrev",ArrowLeft:"snapshotNext"}};getActionHotkeyMap(){return document.dir==="rtl"?J(this.actionHotkeyMap,this.actionHotkeyMapRTL):this.actionHotkeyMap}onHotkey(e){if(!l.get("enableHotkeys"))return;let t=this.getActionHotkeyMap(),s=e.altKey?"alt":e.ctrlKey?"ctrl":e.shiftKey?"shift":"none",n=t[s]?.[e.code];n&&(e.preventDefault(),e.stopPropagation(),this.execAction(n))}getOuterHeight(e=!1){return Hi(this.nodes.container,e)}getArticle(){return this.article}getMenu(){return this.menu}fire(){this.focusAction(this.options.initiatorAction)}embed(e,t){I(this.nodes.container,e,t)}detach(){this.watch?.detach(),this.toggleActions(!1),L.disconnect(this,{hotkey:"onHotkey"}),this.nodes.container.remove(),this.isDetached=!0}},rn=Bi});var ln=m(()=>{});var _i,ye,yt=m(()=>{P();y();ht();X();Le();B();Qs();Ys();an();C();ln();_i=class{static utils=Ue;type="abstract";article;options={};articleParams={};error;errorData;nodes={};links={};configManager;userOptionsManager;requestManager;loadPromise;navigation;isLoading=!1;isLoaded=!1;isConfigsChanged=!1;isDetached=!1;constructor(e,t){this.article=e,this.options={initiatorAction:null,initiatorPage:null,fireDiffHook:!0,fireContentHook:!0,...t},this.articleParams={action:"render",diffonly:this.article.get("type")==="diff"?1:0,unhide:l.get("unHideDiffs")?1:0,uselang:o.local.userLanguage},this.configManager=new $i({wgTitle:!1,wgPageName:!1,wgRelevantPageName:!1,wgPageContentModel:"wikitext",wgNamespaceNumber:!1,wgArticleId:!1,wgRelevantArticleId:!1,wgCurRevisionId:!1,wgRevisionId:!1,wgDiffOldId:!1,wgDiffNewId:!1,wgCanonicalSpecialPageName:!1,wgIsProbablyEditable:!1,wgRelevantPageIsProbablyEditable:!1,wbEntityId:!1,"thanks-confirmation-required":!0}),this.userOptionsManager=new $i({},mw.user.options),this.requestManager=new Js,OO.EventEmitter.call(this)}load(){return this.isLoading?this.loadPromise:(this.isLoading=!0,this.isLoaded=!1,this.error=null,this.errorData=null,this.loadPromise=this.preloadProcess())}preloadProcess(){let e=this.getPreloadPromises();return Promise.allSettled(e).then(this.loadProcess.bind(this))}loadProcess(){let e=this.getLoadPromises();return Promise.allSettled(e).then(this.onLoadResponse).then(this.loadProcessSecondary)}loadProcessSecondary=()=>{let e=this.getLoadSecondaryPromises();return Promise.allSettled(e)};getPreloadPromises(){return[this.requestCompare()]}getLoadPromises(){return[this.requestPageInfo(),this.request()]}getLoadSecondaryPromises(){return[this.requestWBLabel()]}onLoadResponse=async()=>{this.isLoading=!1,this.isLoaded=!0,!this.isDetached&&this.error?.statusText!=="abort"&&(a(this.data)?await this.renderError():await this.renderSuccess())};request(){return this.requestProcess().done(this.onRequestDone).fail(this.onRequestError)}requestProcess(){return this.requestManager.when()}onRequestError=(e,t)=>{this.error=e,this.errorData=t?.error};onRequestDone=e=>{this.data=e};requestCompare(){let e=this.article.getValues();if(this.error||e.typeVariant!=="comparePages"||h(e.oldid)&&h(e.diff))return $.Deferred().resolve().promise();let t={action:"compare",prop:["title","ids","timestamp","comment"],fromrev:h(e.rev1)?e.rev1:void 0,fromtitle:a(e.page1)?void 0:e.page1,torev:h(e.rev2)?e.rev2:void 0,totitle:a(e.page2)?void 0:e.page2,format:"json",formatversion:2,uselang:o.local.userLanguage};return this.requestManager.get(t,e.hostname).then(this.onRequestCompareDone).fail(this.onRequestCompareError)}onRequestCompareError=(e,t)=>{this.onRequestError(e,t)};onRequestCompareDone=e=>{let t=e?.compare;if(!t)return this.onRequestCompareError(null,e);this.article.set({oldid:t.fromrevid,diff:t.torevid,page1:t.fromtitle,page2:t.totitle,title:ce(t),section:Pe(t)})};async requestPageInfo(){let e=Math.max(this.article.get("revid"),this.article.get("oldid")),t=this.article.get("curid"),s=this.article.get("title"),n={};h(e)?n.revids=e:h(t)?n.pageids=t:a(s)||(n.titles=s);let r=await b.getPageInfo(n,this.article,this.requestManager);if(r){let c=r.pageprops||{},p=r.entityterms||{};this.configManager.setValues({wgArticleId:r.pageid,wgRelevantArticleId:r.pageid,wgCurRevisionId:r.lastrevid,wgContentLanguage:r.pagelanguage,wgContentLanguageDir:r.pagelanguagedir,wgPageContentModel:r.contentmodel,wgIsProbablyEditable:r.actions?.edit,wgRelevantPageIsProbablyEditable:r.actions?.edit,wbEntityId:c.wikibase_item||me(r.contentmodel)&&r.title||this.configManager.get("wbEntityId")}),this.article.setValues({title:r.title,curid:r.pageid,curRevid:r.lastrevid,watched:r.watched,expiry:r.watchlistexpiry,notificationtimestamp:r.notificationtimestamp,new:r.new,label:me(r.contentmodel)&&p.label?.[0]||r.contentmodel==="EntitySchema"&&Qt(c.displaytitle)||r.contentmodel==="zobject"&&Jt(c)||this.article.get("label")}),this.setConfigs()}}async requestWBLabel(){if(this.error||!a(this.article.get("label"))||!me(this.configManager.get("wgPageContentModel")))return $.Deferred().resolve().promise();let e=this.article.getMW("title")?.getMain(),t=await b.getWBLabel(e,this.article,this.requestManager);a(t)||(this.configManager.set("wbEntityId",e),this.article.setValue("label",t),this.setConfigs())}markAsSeen(){if(this.error||!l.get("markWatchedLine")||!this.article.isForeign||a(this.article.get("timestamp"))||a(this.article.get("notificationtimestamp")))return;let e=new Date(this.article.get("notificationtimestamp")).getTime();if(new Date(this.article.get("timestamp")).getTime()<e)return;let s={titles:this.article.get("titleText"),newerthanrevid:this.article.get("revid")};b.markAsSeen(s,this.article)}abort(){this.isLoading&&this.requestManager.abort()}async renderSuccess(){await this.render(),this.markAsSeen(),mw.hook(`${o.config.prefix}.page.renderSuccess`).fire(this),mw.hook(`${o.config.prefix}.page.renderComplete`).fire(this)}async renderError(){let e=this.article.get("type"),t=this.article.get("typeVariant"),s=t==="page"?"curid":t==="comparePages"?"compare-pages":"generic";this.error={type:e,code:s,tag:"page",status:this.error?.status,statusText:this.error?.statusText,message:this.errorData?.info||Gi(this.error?.status),article:this.article},E(`error-${this.error.type}-${this.error.code}`,this.error),await this.render(),mw.hook(`${o.config.prefix}.page.renderError`).fire(this),mw.hook(`${o.config.prefix}.page.renderComplete`).fire(this)}async render(){let e=["instantDiffs-page",`instantDiffs-page--${this.type}`,`instantDiffs-page--${this.article.get("type")}`,"mw-body-content"],t=["instantDiffs-page-body",`instantDiffs-page-body--${this.type}`,`instantDiffs-page-body--${this.article.get("type")}`],s=o.config.skinBodyClasses[mw.config.get("skin")];s&&e.push(...s),this.nodes.$container=$("<div>").attr("dir",document.dir).addClass(e),this.nodes.$tools=$("<div>").addClass("instantDiffs-page-tools").appendTo(this.nodes.$container),this.nodes.$body=$("<div>").addClass(t).appendTo(this.nodes.$container),await this.renderContent(),await this.renderNavigation()}async renderContent(){this.error?await this.renderErrorContent():await this.renderSuccessContent()}async renderErrorContent(){let e=se(`error-${this.error.type}-${this.error.code}`,this.error,this.article),t=$(`<p>${e}</p>`);this.renderWarning({$content:t})}renderWarning({$content:e,type:t="warning",container:s=this.nodes.$body,insertMethod:n="prependTo"}){let r=Ki({$content:e,type:t});return I(r,s,n),r}async renderSuccessContent(){await this.restoreFunctionality(),this.requestDependencies()}async renderNavigation(){this.navigation=new rn(this,this.article,this.articleParams,{initiatorAction:this.options.initiatorAction,links:this.links}),this.navigation.embed(this.nodes.$container,"prependTo")}requestDependencies(e={}){let{modulestyles:t=[],modulescripts:s=[],modules:n=[]}=e,r=[...Yt(this.article),...t,...s,...n];return mw.loader.using(de(r))}async restoreFunctionality(){if(!this.error&&(this.nodes.$mediaInfoView=this.nodes.$body.find("mediainfoview"),this.article.get("type")==="revision"&&this.nodes.$mediaInfoView.length>0)){let e=await Li(this.nodes.$mediaInfoView);e&&I(e,this.nodes.$diffTitle,"insertAfter")}}getScrollableSection(){let e=this.article.get("hash");if(!a(e))return zi(e,this.nodes.$body)}getScrollableOffsetTop(){return this.getNavigation()?.getOuterHeight(!0)}async fire(){if(mw.hook(`${o.config.prefix}.page.ready`).fire(this),this.getNavigation()?.fire(),this.options.fireDiffHook){let e=this.getDiffTable();this.article.get("type")==="diff"&&e?.length>0&&mw.hook("wikipage.diff").fire(e)}if(this.options.fireContentHook){let e=this.getContainer();e?.length>0&&mw.hook("wikipage.content").fire(e)}fe(this.nodes.$container),mw.hook(`${o.config.prefix}.page.complete`).fire(this)}focus(){this.emit("focus")}setConfigs(){this.isConfigsChanged=!0,this.configManager.apply(),this.userOptionsManager.apply()}restoreConfigs(){this.isConfigsChanged&&(this.isConfigsChanged=!1,this.configManager.restore(),this.userOptionsManager.restore())}getArticle(){return this.article}getArticleTitleText(){let e=this.article.getValues(),t;return!a(e.page1Text)&&!a(e.page2Text)?t=`${e.page1Text} \u2192 ${e.page2Text}`:a(e.titleText)?t=d(this.error?"dialog-title-not-found":"dialog-title-empty"):t=e.titleText,a(e.label)?t:`${e.label} (${t})`}getArticleParams(){return this.articleParams}getContainer(){return this.nodes.$container}getDiffTable(){return this.nodes.$table}getInitiatorPage(){return this.options.initiatorPage}getNavigation(){return this.navigation}close(){this.emit("close")}detach(){this.isDetached||(mw.hook(`${o.config.prefix}.page.beforeDetach`).fire(this),this.abort(),this.restoreConfigs(),this.getNavigation()?.detach(),this.getContainer()?.detach(),this.isDetached=!0)}},ye=_i});var Qi,Dt,Ji=m(()=>{P();y();ht();j();yt();C();Qi=class extends ye{type="local";isDependenciesLoaded=!1;getLoadPromises(){let e=super.getLoadPromises();return this.article.get("type")==="revision"&&(this.article.get("typeVariant")!=="page"&&h(this.article.get("revid"))||this.article.get("typeVariant")==="page"&&h(this.article.get("curid")))&&e.push(this.requestPage()),e}requestPage(){if(this.error)return $.Deferred().resolve().promise();let e={action:"parse",prop:["revid","modules","jsconfigvars","categorieshtml"],disablelimitreport:1,redirects:1,format:"json",formatversion:2,uselang:o.local.userLanguage},t=this.configManager.get("wgDiffNewId")||Math.max(this.article.get("revid"),this.article.get("oldid")),s=this.configManager.get("wgArticleId")||this.article.get("curid");return h(t)?e.oldid=t:h(s)&&(e.pageid=s),this.requestManager.get(e).then(n=>this.onRequestPageDone(n,e)).fail((n,r)=>this.onRequestPageError(n,r,e))}onRequestPageError=(e,t,s)=>{this.isDependenciesLoaded=!0;let n={message:e,type:"dependencies",tag:"page",article:this.article,silent:!0};t?.error&&(n.code=t.error.code,n.message=t.error.info);let r=s.oldid?"revid":"curid";E(`error-dependencies-${r}`,n)};onRequestPageDone=(e,t)=>{if(this.isDependenciesLoaded=!0,this.parse=e?.parse,!this.parse)return this.onRequestPageError(null,e,t);this.configManager.setValues({wgArticleId:this.parse.pageid,wgRevisionId:Math.max(this.article.get("revid"),this.parse.revid),...this.parse.jsconfigvars}),this.article.setValues({curid:this.configManager.get("wgArticleId"),revid:this.configManager.get("wgRevisionId")}),this.setConfigs(),this.processCategories(),this.requestDependencies(this.parse)};requestProcess(){if(this.error)return $.Deferred().resolve().promise();let e=this.article.getValues(),t={title:a(e.title)?void 0:e.title,diff:a(e.diff)?e.direction:e.diff,oldid:a(e.oldid)?void 0:e.oldid,curid:a(e.curid)?void 0:e.curid},s={url:o.local.mwEndPoint,dataType:"html",data:$.extend(t,this.articleParams)};return this.requestManager.ajax(s)}async renderSuccessContent(){this.nodes.data=$.parseHTML(this.data),this.nodes.$data=$(this.nodes.data).appendTo(this.nodes.$body),this.collectData(),this.setConfigs(),this.nodes.$data.filter(".cdx-message").prependTo(this.nodes.$body),this.nodes.$data.find(".cdx-message").prependTo(this.nodes.$body);let e=this.nodes.$data.filter("p");e.length>0&&this.renderWarning({$content:e}),this.processMobileFooter(),this.processDiffTable(),this.processFlaggedRevs(),this.article.get("type")==="revision"&&this.processRevision(),await super.renderSuccessContent()}collectData(){let e={},t=this.nodes.$data.find("#mw-diff-otitle1 strong > a, #differences-prevlink"),s=this.nodes.$data.find("#mw-diff-ntitle1 strong > a, #differences-nextlink");if(t.length>0){let f=Number(Te("oldid",t.prop("href")));h(f)&&this.configManager.set("wgDiffOldId",f);let g=Te("title",t.prop("href"))||t.prop("title");a(g)||(e.page1=g,e.title=g)}if(s.length>0){let f=Number(Te("oldid",s.prop("href")));h(f)&&(this.configManager.setValues({wgDiffNewId:f,wgRevisionId:f}),e.revid=f,this.article.get("diff")==="cur"&&(e.diff=f));let g=Te("title",s.prop("href"))||s.prop("title");a(g)||(e.page2=g,e.title=g)}e.page1===e.page2&&(delete e.page1,delete e.page2);let n=this.nodes.$data.find("#mw-diff-ntitle2 .mw-userlink");n.length>0&&(e.userhidden=n.hasClass("history-deleted"),e.userhidden||(e.user=n.text()));let r=this.nodes.$data.find("#mw-diff-ntitle1 .mw-diff-timestamp");r.length>0&&(e.timestamp=r.attr("data-timestamp"));let c=this.nodes.$data.find("#mw-diff-ntitle3 .autocomment a");a(this.article.get("section"))&&c.length>0&&(e.section=K("hash",c.prop("href"))),this.nodes.$data.find(".mw-diff-undo a, .mw-rollback-link a").length>0&&this.configManager.set("wgIsProbablyEditable",!0),this.article.set(e),this.configManager.setTitle(this.article.getMW("title")),this.article.get("type")!=="diff"&&!ut(this.configManager.get("wgPageContentModel"))&&this.userOptionsManager.set("visualeditor-diffmode-historical","source")}processMobileFooter(){if(this.nodes.$diffMobileFooter=this.nodes.$data.filter(".mw-diff-mobile-footer"),this.nodes.$diffMobileFooter.length===0)return;this.nodes.$diffMobileFooter.appendTo(this.nodes.$body);let e="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--action-default",t=[".mw-diff-undo",".mw-rollback-link"],s=this.nodes.$diffMobileFooter.find(t.join(","));s.length!==0&&(mw.user.isAnon()?s.hide():s.children("a").addClass(e))}processDiffTable(){this.nodes.$diffTablePrefix=this.nodes.$data.filter(".mw-diff-table-prefix"),(this.article.get("type")!=="diff"||!l.get("showDiffTools"))&&this.nodes.$diffTablePrefix.addClass("instantDiffs-hidden"),this.nodes.$table=this.nodes.$data.filter("table.diff"),this.nodes.$prev=this.nodes.$table.find("#differences-prevlink").attr("data-instantdiffs-link","none").addClass("instantDiffs-hidden"),this.nodes.$next=this.nodes.$table.find("#differences-nextlink").attr("data-instantdiffs-link","none").addClass("instantDiffs-hidden");let e=this.nodes.$table.find("#mw-diff-otitle4");xt(e);let t=this.nodes.$table.find("#mw-diff-ntitle4");xt(t),this.nodes.$data.filter(".mw-revslider-container, .mw-diff-revision-history-links, #mw-oldid").addClass("instantDiffs-hidden"),this.links.prev=this.article.get("type")==="revision"?h(this.configManager.get("wgDiffOldId")):this.nodes.$prev.attr("href"),this.links.next=this.nodes.$next.attr("href")}processRevision(){this.nodes.$diffTitle=this.nodes.$data.filter(".diff-currentversion-title"),l.get("showRevisionInfo")||this.nodes.$diffMobileFooter.addClass("instantDiffs-hidden"),Be(this.nodes.$table),this.processCategories(),this.nodes.$data.find(".mw-diff-slot-header, .mw-slot-header").addClass("instantDiffs-hidden")}processFlaggedRevs(){this.nodes.$frDiffHeader=this.nodes.$data.filter("#mw-fr-diff-headeritems").insertBefore(this.nodes.$table),this.nodes.$unpatrolled=this.nodes.$frDiffHeader.find(".fr-diff-to-stable a").attr("data-instantdiffs-link","none").addClass("instantDiffs-hidden"),this.article.get("type")==="diff"&&(this.links.unpatrolled=this.nodes.$unpatrolled.attr("href")),this.article.get("type")==="revision"&&(l.get("showRevisionInfo")?this.nodes.$frDiffHeader.find(".fr-diff-ratings td:nth-child(2n-1)").addClass("instantDiffs-hidden"):this.nodes.$frDiffHeader.addClass("instantDiffs-hidden")),this.nodes.$data.find(".fr-diff-to-stable, #mw-fr-diff-dataform").addClass("instantDiffs-hidden")}processCategories(){a(this.data)||a(this.parse)||a(this.parse.categorieshtml)||(this.nodes.$categories=$(this.parse.categorieshtml).appendTo(this.nodes.$body))}restoreFunctionalityEmbed(){if(this.error)return;qs("mediawiki.misc-authed-curate"),xi(this.nodes.$body);let e=[];if(this.article.get("type")==="diff"&&l.get("showDiffTools")){let t=ki(this.nodes.$diffTablePrefix);t&&e.push(t);let s=yi(this.nodes.$diffTablePrefix);s&&e.push(s)}if(this.nodes.$diffTablePrefix?.length>0){let t=this.nodes.$diffTablePrefix.children(":visible").length>0;this.nodes.$diffTablePrefix.toggleClass("instantDiffs-hidden",!t||e.length===0)}if(this.nodes.$wikiLambdaApp=this.nodes.$body.find("#ext-wikilambda-app"),this.nodes.$wikiLambdaApp.length>0){let t=$(ue("dialog-notice-wikilambda"));this.renderWarning({$content:t,type:"notice",container:this.nodes.$wikiLambdaApp,insertMethod:"insertBefore"})}}restoreFunctionalityWithDependencies(){this.error||this.nodes.$wikiLambdaApp.length>0&&Di(this.nodes.$wikiLambdaApp)}async fire(){this.restoreFunctionalityEmbed(),this.article.get("type")==="revision"&&!this.isDependenciesLoaded&&await this.requestPage(),this.restoreFunctionalityWithDependencies(),await super.fire()}},Dt=Qi});var Do,Yi,Lt,Xi=m(()=>{P();y();ht();X();Le();gi();B();yt();ee();({h:Do}=w),Yi=class extends ye{type="foreign";compare;parse;linkTags=[];constructor(e,t){super(e,{...t,fireDiffHook:!1})}getLoadPromises(){return[this.requestMessages(),this.requestSiteInfo(),...super.getLoadPromises()]}getLoadSecondaryPromises(){let e=super.getLoadSecondaryPromises();return this.article.get("type")==="revision"&&e.push(this.requestRevision()),e}requestProcess(){let e=this.article.getValues(),t={action:"compare",prop:["title","ids","rel","timestamp","user","diff","parsedcomment"],fromrev:h(e.oldid)?e.oldid:void 0,fromrelative:M(e.oldid)?e.oldid:void 0,torev:h(e.diff)?e.diff:void 0,difftype:ge()?"inline":"table",format:"json",formatversion:2,uselang:o.local.userLanguage};return e.type==="diff"&&!h(e.diff)&&(t.torelative=M(e.diff)?e.diff:"prev"),e.type==="revision"&&!h(e.diff)&&(t.torelative=M(e.direction)?e.direction:"prev"),e.typeVariant==="page"&&h(e.curid)&&(t.fromid=e.curid,t.torelative="cur"),this.requestManager.get(t,this.article)}onRequestDone=e=>{this.data=e?.compare};async requestSiteInfo(){let e=["general","namespaces","namespacealiases"],t=await b.getSiteInfo(e,this.article,this.requestManager)||{};if(!T(t)){let s=t.general;T(s)||(this.article.set({hostname:s.servername}),this.configManager.setValues({wgServer:s.server,wgServerName:s.servername,wgMobileServer:s.mobileserver,wgMobileServerName:s.mobileservername}));let n=zt(this.article.get("hostname"));this.configManager.setValues(n),this.setConfigs()}}async requestMessages(){let e=["revisionasof","currentrev-asof","word-separator","pipe-separator","parentheses","talkpagelinktext","contribslink","changeslist-nocomment","rev-deleted-no-diff","rev-deleted-user","rev-deleted-comment","diff-empty","checkuser-userinfocard-toggle-button-aria-label"];await b.loadMessage(e)}async renderContent(){this.renderForeignWarning(),await super.renderContent()}async renderSuccessContent(){this.collectData(),this.setConfigs(),await this.renderDiffTable(),this.requestDependencies()}collectData(){this.configManager.setValues({wgArticleId:this.data.toid,wgRevisionId:this.data.torevid,wgDiffOldId:this.data.fromrevid,wgDiffNewId:this.data.torevid});let e=$("<span>").html(this.data.fromparsedcomment).find(".autocomment a");e.length>0&&(this.data.fromsection=K("hash",e.prop("href")));let t=$("<span>").html(this.data.toparsedcomment).find(".autocomment a");t.length>0&&(this.data.tosection=K("hash",t.prop("href")));let s={previd:this.data.prev,nextid:this.data.next,curid:this.configManager.get("wgArticleId"),revid:this.configManager.get("wgRevisionId"),title:ce(this.data),section:this.data.tosection,timestamp:this.data.totimestamp,user:this.data.touser,userhidden:this.data.touserhidden};this.data.fromid!==this.data.toid&&(s.page1=this.data.fromtitle,s.page2=this.data.totitle),this.article.set(s),this.configManager.setTitle(this.article.getMW("title")),this.links.prev=this.article.get("type")==="revision"?h(this.data.fromrevid):this.data.prev&&this.data.prev!==this.data.fromrevid,this.links.next=this.data.next&&this.data.next!==this.data.torevid}async renderDiffTable(){if(this.nodes.table=wi(this.data.body),(this.data.fromtexthidden||this.data.totexthidden)&&await this.renderDeletedWarning(),this.data.fromid){let e=dt({prefix:"o",title:this.data.fromtitle,revid:this.data.fromrevid,curRevid:this.article.get("curRevid"),hostname:this.article.get("hostname"),timestamp:this.data.fromtimestamp,texthidden:this.data.fromtexthidden,user:this.data.fromuser,userhidden:this.data.fromuserhidden,comment:this.data.fromparsedcomment,commenthidden:this.data.fromcommenthidden});I(e,this.nodes.table.deleted)}else this.nodes.table.added.colSpan=4,this.nodes.table.deleted.classList.add("instantDiffs-hidden");if(this.data.toid){let e=dt({prefix:"n",title:this.data.totitle,revid:this.data.torevid,curRevid:this.article.get("curRevid"),hostname:this.article.get("hostname"),timestamp:this.data.totimestamp,texthidden:this.data.totexthidden,user:this.data.touser,userhidden:this.data.touserhidden,comment:this.data.toparsedcomment,commenthidden:this.data.tocommenthidden});I(e,this.nodes.table.added)}else this.nodes.table.deleted.colSpan=4,this.nodes.table.added.classList.add("instantDiffs-hidden");if(this.nodes.$table=$(this.nodes.table.container).appendTo(this.nodes.$body),Q(this.nodes.$table,`https://${this.article.get("hostname")}`),this.article.get("type")==="revision"&&Be(this.nodes.$table),this.data.toid){let e=vi({title:this.data.totitle,revid:this.data.torevid,hostname:this.article.get("hostname"),user:this.data.touser,userhidden:this.data.touserhidden});I(e,this.nodes.$body,"appendTo")}}async renderErrorContent(){this.errorData?.code==="missingcontent"?await this.renderDeletedWarning():await super.renderErrorContent();let e=this.article.getValues(),t=this.errorData?.code==="missingcontent"?this.errorData.info.replace(/\D/g,""):null,s=[e.oldid,e.diff,t].filter(n=>!isNaN(n)&&n>0);this.configManager.setValues({wgDiffOldId:Math.min(...s),wgDiffNewId:Math.max(...s)}),this.setConfigs(),this.configManager.get("wgDiffOldId")!==this.configManager.get("wgDiffNewId")&&(this.links.prev=h(this.configManager.get("wgDiffOldId")),this.links.next=h(this.configManager.get("wgDiffNewId"))),this.options.initiatorPage=L.getPreviousPage()}renderForeignWarning(){let e=$(ue(`dialog-notice-foreign-${this.article.get("type")}`,`https://${this.article.get("hostname")}`,this.article.get("hostname")));this.nodes.$foreignWarning=this.renderWarning({$content:e,type:"notice"})}async renderDeletedWarning(){let e=await b.parseWikitext({title:this.article.get("title"),text:mw.msg("rev-deleted-no-diff")},this.article),t=$(e).find("p");this.nodes.$deleteWarning=this.renderWarning({$content:t,type:"warning",container:this.nodes.$foreignWarning,insertMethod:"insertAfter"})}requestRevision(){if(this.error)return $.Deferred().resolve().promise();let e={action:"parse",prop:["text","revid","modules","jsconfigvars","categorieshtml"],disablelimitreport:1,redirects:1,format:"json",formatversion:2,uselang:o.local.userLanguage},t=Math.max(this.article.get("revid"),this.article.get("oldid")),s=this.article.get("curid");return h(t)?e.oldid=t:h(s)&&(e.pageid=s),this.requestManager.get(e,this.article).then(n=>this.onRequestRevisionDone(n,e)).fail((n,r)=>this.onRequestRevisionError(n,r,e))}onRequestRevisionError=(e,t,s)=>{let n={message:e,type:"dependencies",tag:"page",article:this.article};t?.error&&(n.code=t.error.code,n.message=t.error.info);let r=s.oldid?"revid":"curid";E(`error-dependencies-${r}`,n)};onRequestRevisionDone=async(e,t)=>{if(this.parse=e?.parse,!this.parse)return this.onRequestRevisionError(null,e,t);await this.renderRevision()};async renderRevision(){this.configManager.setValues({wgArticleId:this.parse.pageid,wgRevisionId:Math.max(this.article.get("revid"),this.parse.revid),...this.parse.jsconfigvars}),this.article.setValues({curid:this.configManager.get("wgArticleId"),revid:this.configManager.get("wgRevisionId")}),this.setConfigs();let e=this.article.get("revid")===this.article.get("curRevid")?"currentrev-asof":"revisionasof";this.nodes.diffTitle=Do("h2",{class:"diff-currentversion-title"},mw.msg(e,je(this.data.totimestamp))),this.nodes.$diffTitle=$(this.nodes.diffTitle).appendTo(this.nodes.$body),this.nodes.$revision=$(this.parse.text).appendTo(this.nodes.$body),a(this.parse.categorieshtml)||(this.nodes.$categories=$(this.parse.categorieshtml).appendTo(this.nodes.$body)),await this.processRevision(),Q(this.nodes.$body,this.article.get("href")),this.requestDependencies(this.parse),this.requestForeignDependencies()}async processRevision(){if(this.nodes.$body.find("#ext-wikilambda-app, .ext-wikilambda-view-nojsfallback, .mw-diff-slot-header, .mw-slot-header").addClass("instantDiffs-hidden"),this.nodes.$wikiLambdaApp=this.nodes.$body.find("#ext-wikilambda-app"),this.nodes.$wikiLambdaApp.length>0){let e=$(`<p>${d("dialog-notice-foreign-wikilambda")}</p>`);this.renderWarning({$content:e,type:"notice",container:this.nodes.$wikiLambdaApp,insertMethod:"insertBefore"})}await this.restoreFunctionality()}requestForeignDependencies(){let e=Xt(this.article);Zt(this.article,e.modules),ei(this.article,e.styles),this.linkTags=ti(e.links)}detach(){this.isDetached||(super.detach(),ii(this.linkTags))}},Lt=Yi});var cn=m(()=>{});var St,fn,dn=m(()=>{j();St=class extends OO.ui.LabelWidget{static tagName="div";constructor(){super({classes:["oo-ui-messageDialog-message","is-transparent"]})}toggleVisibility(e){this.$element.toggleClass("is-transparent",!e)}};H(St);fn=St});var Pt,un,hn=m(()=>{y();j();Pt=class extends OO.ui.ProgressBarWidget{toggleDelay;toggleTime;constructor(e){super({classes:["instantDiffs-view-loader","is-transparent"],progress:!1,inline:!0,...e})}toggleVisibility(e,t){if(this.toggleDelay&&clearTimeout(this.toggleDelay),t&&(this.toggle(e),Et(()=>this.$element.toggleClass("is-transparent",!e))),e===!0&&(this.toggleTime=Date.now(),this.toggle(!0),Et(()=>this.$element.removeClass("is-transparent"))),e===!1){if(!this.isVisible())return;let s=this.calculateRemainingTime(this.toggleTime,1e3),n=Math.max(s-150,0);this.toggleDelay=setTimeout(()=>{this.$element.addClass("is-transparent"),this.toggleDelay=setTimeout(()=>this.toggle(!1),150)},n)}}calculateRemainingTime(e,t=1e3){let n=(Date.now()-e)%t;return t-n}};H(Pt);un=Pt});var pn={};_(pn,{default:()=>Lo});var $t,Lo,gn=m(()=>{y();j();dn();hn();C();$t=class extends OO.ui.MessageDialog{static name="Instant Diffs Window";static size="instantDiffs";static actions=[{action:"close",label:d("action-close"),title:q("action-close","close")}];constructor(){super({classes:["instantDiffs-view"]})}initialize(){return super.initialize(),this.message.$element.remove(),this.message=new fn,this.text.$element.append(this.message.$element),this.$content.removeAttr("tabindex"),this.container.$element.attr("tabindex","-1"),l.get("closeOutside")&&(this.$clickOverlay=$("<div>").on("click",()=>this.close()).addClass("instantDiffs-view-overlay").appendTo(this.$element)),this.progressBar=new un,this.$content.prepend(this.progressBar.$element),this}getSetupProcess(e){return super.getSetupProcess(e).next(()=>{js(),this.scrollContentTop(0),this.focus()})}onDialogKeyDown(e){super.onDialogKeyDown(e),!Zi()&&this.emit("hotkey",e)}getBodyHeight(){return"auto"}update(e){return this.getUpdateProcess(e).execute()}getUpdateProcess(e){return new OO.ui.Process().next(()=>{e={title:this.constructor.static.title,message:this.constructor.static.message,scrollTop:0,...e},this.toggleProgress(!1),this.title.setLabel(e.title),this.message.setLabel(e.message),this.scrollContentTop(x(e.scrollTop)?e.scrollTop():e.scrollTop),this.toggleVisibility(!0),this.focus()})}getTeardownProcess(e){return super.getTeardownProcess(e).next(()=>{this.toggleProgress(!1),this.toggleVisibility(!1)})}focus(e){return e?super.focus(e):this.container.$element.trigger("focus"),this}toggleVisibility(e){return this.message.toggleVisibility(e),this}toggleProgress(...e){return this.progressBar.toggleVisibility(...e),this}getContentOffsetTop(e,t=0){let s=0;if((_e(e)||e instanceof jQuery)&&(s=At(e,this.container.$element)?.top),typeof s=="number")return s+t}setScrollOffsetTop(e=0){return this.container.$element.css("--instantDiffs-view-scroll-padding-top",`${e}px`),this}scrollContentTop(e=0,t=0){let s=0;return typeof e=="number"&&(s=e),(_e(e)||e instanceof jQuery)&&(s=At(e,this.container.$element)?.top),typeof s=="number"&&this.container.$element.scrollTop(s+t),this}};H($t);Lo=$t});var es,L,ee=m(()=>{P();y();j();Ee();pi();Ji();Xi();C();cn();es=class{static sizes={compact:{width:800,height:"auto"},standard:{width:1200,height:"auto"},wide:{width:1600,height:"auto"}};static getSize(e){return this.sizes[e]}link;page;options={};opener={link:null,options:{}};initiator={link:null,options:{}};previousInitiator={link:null,options:{}};document={};loadPromise;isDependenciesLoaded=!1;isConstructed=!1;isOpen=!1;isLoading=!1;isRequesting=!1;isProcessing=!1;mixin(){OO.EventEmitter.call(this)}setup(e,t){if(this.isRequesting||this.isProcessing)return!1;if(o.timers.dialogProcesStart=mw.now(),this.link=e,this.options={initiatorPage:null,onOpen:()=>{},onClose:()=>{},...t},!this.isOpen){this.opener.link=this.link,this.opener.options={...this.options};let s={};this.opener.link.getMW?.().hasLine&&(s.filterType=this.opener.link.getArticle().get("type"),s.filterMWLine=!0),be.newInstance(s)}if(this.link instanceof O){let s=this.link.getInitiatorLink();be.instance.hasLink(s)&&(this.previousInitiator={...this.initiator},this.initiator.link=s,this.initiator.options={...this.options},be.instance.setLink(this.initiator.link))}return!0}load(){return this.isLoading?this.loadPromise:this.isDependenciesLoaded?(this.open(),!0):(this.isLoading=!0,this.error=null,this.loadPromise=$.when(mw.loader.using(this.getDependencies())).then(this.onLoadSuccess.bind(this)).fail(this.onLoadError.bind(this)),this.loadPromise)}getDependencies(){return de([...o.config.dependencies.window,...o.config.dependencies.content])}onLoadError(e){this.isLoading=!1,this.isDependenciesLoaded=!1,this.error={type:"dependencies",tag:"view",message:e&&e.message?e.message:null},E("error-dependencies-generic",this.error)}onLoadSuccess(){this.isLoading=!1,this.isDependenciesLoaded=!0,st(),this.open()}construct(){this.isConstructed=!0;let e=(gn(),De(pn)).default;this.dialog=new e,this.dialog.connect(this,{hotkey:t=>this.emit("hotkey",t)}),this.manager=nt(),this.manager.addWindows([this.dialog])}open(){if(this.isConstructed||this.construct(),!this.isOpen){this.document.scrollableRoot=OO.ui.Element.static.getRootScrollableElement(document.body),this.document.scrollTop=this.document.scrollableRoot.scrollTop;let e=this.link.getArticle(),t={title:e.get("titleText")||e.get("title"),size:oi()};this.windowInstance=this.manager.openWindow(this.dialog,t),this.windowInstance.opening.then(this.onOpening.bind(this)),this.windowInstance.opened.then(this.onOpen.bind(this)),this.windowInstance.closing.then(this.onClosing.bind(this)),this.windowInstance.closed.then(this.onClose.bind(this))}this.request()}onOpening(){this.emit("opening")}onOpen(){this.isOpen=!0,x(this.options.onOpen)&&this.options.onOpen(this),this.emit("opened")}onClosing(){this.emit("closing")}onClose(){this.isOpen=!1,this.isRequesting=!1,this.isProcessing=!1,this.previousPage&&(this.previousPage.detach(),this.previousPage=null),this.page&&(this.page.detach(),this.page=null),x(this.options.onClose)&&this.options.onClose(this),x(this.opener.options.onClose)&&this.opener.link!==this.link&&this.opener.options.onClose(this),x(this.initiator.options.onClose)&&this.initiator.link!==this.link&&this.initiator.options.onClose(this),this.opener={link:null,options:{}},this.initiator={link:null,options:{}},this.previousInitiator={link:null,options:{}},this.document.scrollableRoot.scrollTop=this.document.scrollTop,this.emit("closed")}onUpdate(){this.fire(),this.previousInitiator.link instanceof O&&this.opener.link!==this.previousInitiator.link&&x(this.previousInitiator.options.onClose)&&this.previousInitiator.options.onClose(this),this.initiator.link instanceof O&&this.opener.link!==this.initiator.link&&x(this.initiator.options.onOpen)&&this.initiator.options.onOpen(this),this.emit("updated")}request(){this.isRequesting=!0,this.isProcessing=!0,this.error=null,this.previousPage=this.page,this.dialog.toggleProgress(!0),this.previousPage&&this.previousPage.restoreConfigs();let e=this.link.getArticle(),t={initiatorAction:this.previousPage?.getNavigation()?.getActionRegister(),initiatorPage:this.options.initiatorPage},s=e.get("hostname"),n=Z(s)?Lt:Dt;this.page=new n(e,t),this.page.connect(this,{focus:"focus",close:"close"}),$.when(this.page.load()).always(this.onRequestResponse.bind(this))}onRequestResponse(){if(this.isRequesting=!1,!this.page||this.page.isDetached)return;let e={title:this.page.getArticleTitleText(),message:this.page.getContainer(),scrollTop:this.getContentOffset.bind(this)};this.dialog.update(e).then(this.onUpdate.bind(this))}refresh(){return this.isRequesting||this.isProcessing?!1:(o.timers.dialogProcesStart=mw.now(),this.load())}fire(){this.previousPage&&this.previousPage.detach(),$.when(this.page.fire()).always(()=>{this.setContentOffset(),o.timers.dialogProcesEnd=mw.now(),l.get("logTimers")&&he("dialog process time",o.timers.dialogProcesStart,o.timers.dialogProcesEnd),this.isProcessing=!1})}focus(){this.dialog.focus()}close(){this.dialog.close()}getContentOffset(){let e=this.page.getScrollableSection(),t=this.page.getScrollableOffsetTop();return this.dialog.getContentOffsetTop(e,-t)}setContentOffset(){let e=this.page.getArticle();e&&e.get("type")==="revision"&&(this.dialog.setScrollOffsetTop(this.page.getScrollableOffsetTop()),this.dialog.scrollContentTop(this.getContentOffset()))}getLink(){return this.link}getPage(){return this.page}getPreviousPage(){return this.previousPage}getDialog(){return this.dialog}isContains(e){return this.dialog?.$content.get(0).contains(e)}},L=new es});function So(){mn.call(this,this.getField("linksFormat"))}function mn(){let i=this.getFieldValue("linksHash"),e=this.getFieldValue("linksFormat"),s=bn({relative:!1,hash:i,minify:e==="minify"});this.setFieldHelp("linksFormat",s),wn.call(this,this.getField("wikilinksFormat"))}function wn(){let i=this.getFieldValue("linksHash"),e=this.getFieldValue("linksFormat"),t=this.getFieldValue("wikilinksFormat"),n=bn({relative:!1,hash:i,minify:e==="minify",wikilink:!0,wikilinkPreset:t});this.setFieldHelp("wikilinksFormat",n)}function bn(i){let e=d("copy-wikilink-example-title"),t=N({title:e,diff:"12345",type:"diff",section:"Section"},{},i),s=N({title:e,oldid:"12345",type:"revision",section:"Section"},{},i),n=N({title:e,curid:"12345",type:"revision",typeVariant:"page",section:"Section"},{},i);return xe("ul.instantDiffs-list--settings",xe("li",xe("i",t)),xe("li",xe("i",s)),xe("li",xe("i",n)))}function Po(){let i=L.getPage()?.getNavigation()?.getPinnableActions();if(!i)return{};let e=new Set,t=i.map(n=>(e.add(n.name),[n.name,{label:n.label}]));return(l.get("pinnedActions")||[]).forEach(n=>{e.has(n)||t.push([n,{label:n,show:!1}])}),Object.fromEntries(t)}var xe,Ge,ts=m(()=>{y();X();ee();C();({h:xe}=w),Ge={general:{config:{labelMsg:"settings-fieldset-general"},fields:{enableMobile:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-enable-mobile",helpMsg:"settings-enable-mobile-help"}},notifyErrors:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-notify-errors"}}}},links:{config:{labelMsg:"settings-fieldset-links"},fields:{showLink:{type:"checkbox",enabled:!0,default:!1,config:{labelMsg:"settings-show-link",helpMsg:"settings-show-link-help"}},showPageLink:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-show-page-link",helpMsg:"settings-show-page-link-help"}},highlightLine:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-highlight-line"}},markWatchedLine:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-mark-watched-line"}}}},dialog:{config:{labelMsg:"settings-fieldset-dialog"},fields:{viewWidth:{type:"buttonSelect",enabled:!0,default:"standard",config:{labelMsg:"settings-view-width",helpMsg:"settings-view-width-help"},optionsType:"buttonOption",options:{compact:{labelMsg:"settings-view-width-compact",titleMsg:["settings-view-width-option-title",L.constructor.getSize("compact").width]},standard:{labelMsg:"settings-view-width-standard",titleMsg:["settings-view-width-option-title",L.constructor.getSize("standard").width]},wide:{labelMsg:"settings-view-width-wide",titleMsg:["settings-view-width-option-title",L.constructor.getSize("wide").width]},full:{labelMsg:"settings-view-width-full",titleMsg:"settings-view-width-full-title"}}},closeOutside:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-close-outside"}},enableHotkeys:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-enable-hotkeys"}},showDiffTools:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-show-diff-tools"}},showRevisionInfo:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-show-revision-info"}},unHideDiffs:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-unhide-diffs",helpMsg:["settings-unhide-diffs-help","suppressrevision"]}},openInNewTab:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-open-in-new-tab"}}}},menu:{config:{labelMsg:"settings-fieldset-menu"},fields:{showMenuIcons:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-show-menu-icons"}},showWatchlistPopup:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-show-watchlist-popup",helpMsg:"settings-show-watchlist-popup-help"}},linksHash:{type:"checkbox",enabled:!0,default:!1,config:{labelMsg:"settings-links-hash",helpMsg:"settings-links-hash-help"},onChange:So},linksFormat:{type:"radioSelect",enabled:!0,default:"full",config:{labelMsg:"settings-links-format",helpMsg:"placeholder"},optionsType:"radioOption",options:{full:{labelMsg:"settings-links-format-full"},minify:{labelMsg:"settings-links-format-minify"}},onSelect:mn},wikilinksFormat:{type:"radioSelect",enabled:!0,default:"special",config:{labelMsg:"settings-wikilinks-format",helpMsg:"placeholder"},optionsType:"radioOption",options:{link:{labelMsg:"settings-wikilinks-format-link"},special:{labelMsg:"settings-wikilinks-format-special"}},onSelect:wn}}},pinnedActions:{config:{labelMsg:"settings-fieldset-pinned-actions"},fields:{pinnedActions:{type:"checkboxMultiselect",enabled:!0,default:["copyLink"],config:{labelMsg:"settings-pinned-actions",helpMsg:"settings-pinned-actions-help"},optionsType:"checkboxMultioption",options:Po}}}}});var rs={};_(rs,{getQueryDefaults:()=>os,getSchemaDefaults:()=>ns,getSchemaSettings:()=>ss,renderNoticeBox:()=>Tt});function ss(){let e=Object.values(Ge).flatMap(t=>Object.entries(t.fields)).map(([t,s])=>[t,s.enabled]);return Object.fromEntries(e)}function ns(){let e=Object.values(Ge).flatMap(t=>Object.entries(t.fields)).map(([t,s])=>[t,s.default]);return Object.fromEntries(e)}function os(){let i=as(document.currentScript?.src)?.instantdiffs||{},e=Object.entries(i).map(([t,s])=>[t,s==="true"?!0:s==="false"?!1:s]);return Object.fromEntries(e)}function Tt(i){i={modifiers:[],content:null,image:null,alt:null,...i};let e=["instantDiffs-notice-box"];return i.modifiers.forEach(t=>e.push(`instantDiffs-notice-box--${t}`)),is("div",{class:e},is("img",{src:`${o.config.commonsAssetsPath}${i.image}`,alt:i.alt}),is("h5",i.content))}var is,Ct=m(()=>{P();y();ts();({h:is}=w)});var vn=m(()=>{});var kn={};_(kn,{default:()=>Eo});var Ot,Eo,yn=m(()=>{P();y();j();Ct();ts();C();Ot=class extends OO.ui.ProcessDialog{static name="Instant Diffs Settings";static title=d("settings-title");static actions=[{action:"save",modes:"edit",label:d("action-save"),flags:["primary","progressive"]},{action:"reload",modes:"finish",label:d("action-reload"),flags:["primary","progressive"]},{action:"close",modes:"empty",label:d("action-close"),flags:["primary","progressive"]},{modes:["edit","finish","empty"],label:d("action-close"),title:d("action-close"),invisibleLabel:!0,icon:"close",flags:["safe","close"]}];panels={};tabs={};visibleTabWidgets=[];fields={};constructor(){super({classes:["instantDiffs-settings"]})}initialize(...e){super.initialize(...e),this.panels.edit=this.renderEditPanel(),this.panels.finish=this.renderFinishPanel(),this.panels.empty=this.renderEmptyPanel(),this.stackLayout=new OO.ui.StackLayout({items:[this.panels.edit,this.panels.finish,this.panels.empty]}),this.$body.append(this.stackLayout.$element)}renderEditPanel(){return new OO.ui.PanelLayout({classes:["instantDiffs-settings-panel","instantDiffs-settings-panel--edit"],padded:!1,expanded:!0})}renderFinishPanel(){return new OO.ui.PanelLayout({classes:["instantDiffs-settings-panel","instantDiffs-settings-panel--finish"],padded:!0,expanded:!0})}renderEmptyPanel(){return new OO.ui.PanelLayout({classes:["instantDiffs-settings-panel","instantDiffs-settings-panel--empty"],padded:!0,expanded:!0})}setPanel(e){this.panels[e]&&(this.actions.setMode(e),this.stackLayout.setItem(this.panels[e]))}renderContents(){this.renderEditContent(),this.renderFinishContent(),this.renderEmptyContent(),this.processLinksAttr(this.stackLayout.$element)}renderEditContent(){for(let[t,s]of Object.entries(Ge))this.tabs[t]=this.renderTab(t,s);this.visibleTabWidgets=Object.values(this.tabs).map(t=>t.tab).filter(t=>t.isVisible());let e=new OO.ui.IndexLayout({expanded:!0,framed:!1});e.addTabPanels(this.visibleTabWidgets,0),this.panels.edit.$element.empty().append(e.$element)}renderFinishContent(){let t=Tt({image:"/6/6f/Eo_circle_light-green_checkmark.svg",content:d("settings-saved"),alt:d("settings-saved-icon")});this.panels.finish.$element.empty().append(t)}renderEmptyContent(){let e=["/2/2f/Cappuccino.svg","/c/ca/Coffe.svg","/9/9a/Coffee_cup_icon.svg","/1/1a/Applications-ristretto.svg","/f/f7/Cup-o-coffee-simple.svg"],t=Math.floor(Math.random()*e.length),s=e[t]||e[0],n=Tt({image:s,content:d("settings-empty"),alt:d("settings-empty-icon"),modifiers:["empty"]});this.panels.empty.$element.empty().append(n)}renderTab(e,t){t=J({name:e,fields:{},fieldset:null,tab:null,config:{label:null}},t),t.config=this.validateFieldConfig(t.config);for(let[r,c]of Object.entries(t.fields))this.fields[r]=t.fields[r]=this.renderField(r,c);let s=Object.values(t.fields).map(r=>r.field);t.fieldset=new OO.ui.FieldsetLayout().addItems(s);let n=Object.keys(t.fields).map(r=>l.check(r)).some(r=>r===!0);return t.tab=new OO.ui.TabPanelLayout(t.name,{...t.config,content:[t.fieldset]}).toggle(n),t}renderField(e,t){t=J({name:e,type:null,input:null,field:null,config:{label:null,align:"inline",help:null,helpInline:!0},optionsType:null,options:{},onSelect:()=>{},onChange:()=>{}},t),t.config=this.validateFieldConfig(t.config),x(t.options)&&(t.options=t.options.call(this,t));for(let[n,r]of Object.entries(t.options))t.options[n]=this.renderInputOption(n,r,t.optionsType);let s=Object.values(t.options).map(n=>n.option);switch(t.type){case"checkbox":t.input=new OO.ui.CheckboxInputWidget;break;case"radioSelect":t.input=new OO.ui.RadioSelectWidget({items:s});break;case"buttonSelect":t.input=new OO.ui.ButtonSelectWidget({items:s});break;case"checkboxMultiselect":t.input=new OO.ui.CheckboxMultiselectWidget({items:s});break}return x(t.onSelect)&&t.input.on("select",()=>t.onSelect.call(this,t)),x(t.onChange)&&t.input.on("change",()=>t.onChange.call(this,t)),t.field=new OO.ui.FieldLayout(t.input,t.config).toggle(l.check(t.name)),t}renderInputOption(e,t,s){switch(t=J({name:e,type:s,data:e,option:null,show:!0},t),t=this.validateFieldConfig(t),t.type){case"radioOption":t.option=new OO.ui.RadioOptionWidget(t);break;case"buttonOption":t.option=new OO.ui.ButtonOptionWidget(t);break;case"checkboxMultioption":t.option=new OO.ui.CheckboxMultioptionWidget(t);break}return t.option.toggle(t.show),t}validateFieldConfig(e){return[{key:"labelMsg",target:"label",useDom:!0},{key:"titleMsg",target:"title",useDom:!1},{key:"helpMsg",target:"help",useDom:!0}].forEach(({key:s,target:n,useDom:r})=>{let c=e[s];if(!c)return;let p=r?ue:d;e[n]=Array.isArray(c)?p(...c):p(c)}),e}getField(e){return this.fields[e]}getFields(){return this.fields}getFieldValue(e){let t=this.getField(e);if(t){if(["checkbox"].includes(t.type))return t.input.isSelected();if(["radioSelect","buttonSelect"].includes(t.type))return t.input.findFirstSelectedItem()?.getData();if(["checkboxMultiselect"].includes(t.type))return t.input.findSelectedItemsData()}}getFieldValues(){let e={};for(let[t]of Object.entries(this.fields))e[t]=this.getFieldValue(t);return e}setFieldValue(e,t){let s=this.getField(e);if(s)return["checkbox"].includes(s.type)&&s.input.setSelected(t),["radioSelect","buttonSelect"].includes(s.type)&&s.input.selectItemByData(t),["checkboxMultiselect"].includes(s.type)&&s.input.selectItemsByData(t),this}setFieldHelp(e,t){let s=this.getField(e);if(s)return s.field.$help.empty().append(t),this}setFieldDisabled(e,t){let s=this.getField(e);if(s)return s.input.setDisabled(t),this}getSetupProcess(e){return super.getSetupProcess(e).next(()=>{this.$body.scrollTop(0),this.processActionRequest()})}getActionProcess(e){return e==="save"?new OO.ui.Process(()=>this.processActionSave()):e==="reload"?new OO.ui.Process(()=>this.processActionReload()):e==="close"?new OO.ui.Process(()=>this.close()):super.getActionProcess(e)}processLinksAttr(e){e.find("a:not(.jquery-confirmable-element)").each((s,n)=>n.setAttribute("target","_blank")),Q(e,o.config.origin)}getBodyHeight(){return 500}processActionRequest(){this.pushPending(),this.renderContents(),this.setPanel(this.visibleTabWidgets.length>0?"edit":"empty");for(let[e]of Object.entries(this.fields))this.setFieldDisabled(e,!0);l.request().then(this.onActionRequestSuccess).fail(this.onActionRequestError).always(()=>this.popPending())}onActionRequestError=(e,t)=>{let s={type:"settings",message:e};t?.error&&(s.code=t.error.code,s.message=t.error.info);let n=new OO.ui.Error(se("error-setting-request",s),{recoverable:!0});this.showErrors(n)};onActionRequestSuccess=e=>{if(o.local.mwIsAnon)return this.update();let t=e?.query?.userinfo?.options;if(!t)return this.onActionRequestError(null,e);try{let s=JSON.parse(t[`${o.config.settingsPrefix}-settings`]);l.set(s,!0)}catch{}this.update()};update(){return this.getUpdateProcess().execute()}getUpdateProcess(){return new OO.ui.Process(()=>{this.setPanel(this.visibleTabWidgets.length>0?"edit":"empty"),this.processActionUpdate(l.get())})}processActionUpdate(e){this.popPending();for(let[t]of Object.entries(this.fields)){this.setFieldDisabled(t,!1);let s=e[t];typeof s>"u"||this.setFieldValue(t,s)}}processActionSave(){this.pushPending(),l.save(this.getFieldValues()).then(this.onActionSaveSuccess).fail(this.onActionSaveError).always(()=>this.popPending())}onActionSaveError=(e,t)=>{let s={type:"settings",message:e};t?.error&&(s.code=t.error.code,s.message=t.error.info);let n=new OO.ui.Error(se("error-setting-save",s),{recoverable:!0});this.showErrors(n)};onActionSaveSuccess=()=>{this.setPanel("finish")};processActionReload(){this.pushPending(),window.location.reload()}};H(Ot);Eo=Ot});var ls,l,C=m(()=>{P();y();Ct();j();B();vn();ls=class{static utils=rs;loadPromise;isDependenciesLoaded=!1;isConstructed=!1;isOpen=!1;isLoading=!1;isRequesting=!1;isSaving=!1;mixin(){OO.EventEmitter.call(this)}load(){return this.isLoading?this.loadPromise:this.isDependenciesLoaded?(this.open(),!0):(this.isLoading=!0,this.error=null,this.loadPromise=$.when(mw.loader.using(de(o.config.dependencies.settings))).then(this.onLoadSuccess).fail(this.onLoadError),this.loadPromise)}onLoadError=e=>{this.isLoading=!1,this.isDependenciesLoaded=!1,this.error={type:"dependencies",tag:"settings",message:e?.message},E("error-dependencies-generic",this.error)};onLoadSuccess=()=>{this.isLoading=!1,this.isDependenciesLoaded=!0,st(),this.open()};construct(){this.isConstructed=!0;let e=(yn(),De(kn)).default;this.dialog=new e,this.manager=nt(),this.manager.addWindows([this.dialog])}open(){this.isOpen||(this.isConstructed||this.construct(),this.windowInstance=this.manager.openWindow(this.dialog),this.windowInstance.opening.then(this.onOpening),this.windowInstance.opened.then(this.onOpen),this.windowInstance.closing.then(this.onClosing),this.windowInstance.closed.then(this.onClose))}onOpening=()=>{this.emit("opening")};onOpen=()=>{this.isOpen=!0,this.emit("opened")};onClosing=()=>{this.emit("closing")};onClose=()=>{this.isOpen=!1,this.emit("closed")};request(){if(o.local.mwIsAnon)return $.Deferred().resolve().promise();this.isRequesting=!0;let e={action:"query",meta:"userinfo",uiprop:"options",format:"json",formatversion:2,uselang:o.local.userLanguage};return b.post(e).always(this.onRequestResponse)}onRequestResponse=()=>{this.isRequesting=!1};save(e){return this.set(e,!0),o.local.mwIsAnon?$.Deferred().resolve().promise():(this.isSaving=!0,de(["ext.GlobalPreferences.global"]).length>0?this.saveGlobal(e):this.saveLocal(e))}saveLocal(e){let t=[`${o.config.settingsPrefix}-settings`,JSON.stringify(e)],s=b.getApi();return s.saveOption.apply(s,t).always(this.onSaveResponse)}saveGlobal(e){let t={action:"globalpreferences",optionname:`${o.config.settingsPrefix}-settings`,optionvalue:JSON.stringify(e)};return b.getApi().postWithEditToken(t).always(this.onSaveResponse)}onSaveResponse=()=>{this.isSaving=!1};get(e,t){if(t){let s=Object.entries(o.local.defaults).filter(([r])=>r in o.config.settings),n=Object.fromEntries(s);return e?n[e]:n}return e?o.local.defaults[e]:o.local.defaults}check(e){return e?o.local.settings[e]:o.local.settings}set(e,t){o.local.defaults={...o.local.defaults,...e};let s=this.get(void 0,!0);if(mw.storage.setObject(`${o.config.prefix}-settings`,s),t){let n=JSON.stringify(s);x(o.GM?.setValue)&&o.GM.setValue("settings",n),o.local.mwIsAnon||mw.user?.options?.set(o.config.settingsPrefix,n)}}async processDefaults(){let e={};try{e={...e,...mw.storage.getObject(`${o.config.prefix}-settings`)}}catch{}if(x(o.GM?.getValue))try{e={...e,...JSON.parse(await o.GM.getValue("settings"))}}catch{}if(!o.local.mwIsAnon)try{e={...e,...JSON.parse(mw.user.options.get(`${o.config.settingsPrefix}-settings`))}}catch{}this.set(e,!1)}},l=new ls});var w={};_(w,{addBaseToLinks:()=>Q,addClick:()=>Ne,addTargetToLinks:()=>fe,arrayIntersperse:()=>Ui,clearWhitespaces:()=>xt,clipboardWriteLink:()=>He,embed:()=>I,getBodyContentNode:()=>$e,getCanonicalSpecialPage:()=>Ze,getCompareSection:()=>Pe,getCompareTitle:()=>ce,getComponentFromUrl:()=>K,getDependencies:()=>de,getErrorMessage:()=>se,getErrorStatusText:()=>Gi,getHref:()=>Ke,getLabel:()=>we,getMissingDependencies:()=>it,getMobileServer:()=>fs,getMsgKey:()=>ze,getMsgParams:()=>Rt,getOffsetRelativeToContainer:()=>At,getParamFromUrl:()=>Te,getPlaceholderClasses:()=>ct,getRevisionSection:()=>ui,getSpecialPageAliases:()=>Nt,getTarget:()=>Ve,getTargetFromFragment:()=>zi,getTitleFromUrl:()=>Si,getURL:()=>Wt,h:()=>F,hf:()=>ds,hint:()=>cs,hj:()=>Co,hs:()=>To,ht:()=>Pn,inArray:()=>wt,isActiveElement:()=>Zi,isAllowed:()=>pe,isArray:()=>z,isBoolean:()=>Dn,isBreakpoint:()=>$o,isCompareHidden:()=>lt,isElement:()=>_e,isEmpty:()=>a,isEmptyObject:()=>T,isForeign:()=>Z,isFunction:()=>x,isMF:()=>ge,isMessageExists:()=>Fe,isNew:()=>We,isObject:()=>Ae,isRevisionHidden:()=>di,isString:()=>R,isToggleKey:()=>Ln,isValidDir:()=>M,isValidID:()=>h,log:()=>ne,logException:()=>ve,logTimer:()=>he,moduleRequire:()=>qe,msg:()=>d,msgDom:()=>ue,msgHint:()=>q,msgParse:()=>Ao,notifyError:()=>E,notifyMsg:()=>Sn,onSchedule:()=>Et,optionsMerge:()=>J,origin:()=>kt,outerHeight:()=>Hi,parseQuery:()=>as,processMessages:()=>It,removeClick:()=>ji,renderLabel:()=>vt,renderMessageBox:()=>Ki,renderPlaceholder:()=>Qe,semverCompare:()=>Ni,server:()=>Mt,setHTML:()=>Pi,spacesToUnderlines:()=>tt,textDom:()=>ft});function a(i){return!i||i.length===0}function T(i){return!i||!Ae(i)||Object.keys(i).length===0}function R(i){return typeof i=="string"}function Dn(i){return typeof i=="boolean"}function x(i){return typeof i=="function"}function z(i){return Array.isArray(i)}function Ae(i){return i&&typeof i=="object"&&!Array.isArray(i)}function Ln(i){return i.type==="click"||i.type==="keypress"&&["Enter","Space"].includes(i.code)}function _e(i){return i instanceof Element||i instanceof HTMLElement}function Zi(){let i=["button","submit","reset","file","checkbox","radio","range","color","image","hidden"],e=document.activeElement;return!e||e.contentEditable==="true"||e.tagName==="TEXTAREA"||e.tagName==="INPUT"&&!i.includes(e.type)}function kt(i){return`${o.config.origin}${i}`}function Mt(i){return`${o.config.server}${i}`}function de(i){return i.filter(e=>{let t=mw.loader.getState(e);return t&&!["error","missing"].includes(t)})}function it(i){return i.filter(e=>{let t=mw.loader.getState(e);return!["ready","registered"].includes(t)})}function qe(i){return o.local.require(i)}function We(){return o.local.lastVersion!==o.config.version}function pe(){return!l.get("standalone")&&o.config.include.pageActions.includes(mw.config.get("wgAction"))&&!o.config.exclude.pages.includes(mw.config.get("wgCanonicalSpecialPageName"))}function Z(i){return!a(i)&&!o.local.mwServerNames.includes(i)}function ge(){return document.readyState==="complete"?document.body.classList.contains("mw-mf"):!a(mw.config.get("wgMFMode"))}function $o(i){return i=o.config.breakpoints[i],i?window.matchMedia(i):!1}function Et(i){requestAnimationFrame(()=>{requestAnimationFrame(i)})}function ne(i,e,t){let s=console[i];if(!s)return;let n=Fe("script-name")?d("script-name"):"Instant Diffs";/\.$/.test(e)||(e=`${e}.`);let r=[`${n}: ${e}`];z(t)?r.push(...t):a(t)||r.push(t),s(...r)}function ve(i,e,t){let s=`Exception in "${i}"`;a(e)||(s=`${s}: ${e}`),ne("warn",s,t)}function he(i,e,t){let s=t-e;s<1e3?s=`${Math.round(s)}ms`:s=`${(s/1e3).toFixed(2)}s`,ne("info",`${i}: ${s}`)}function tt(i){return i.replace(/ /g,"_")}function Ni(i,e){return i=i.split("-").shift(),e=e.split("-").shift(),i.localeCompare(e,void 0,{numeric:!0,sensitivity:"case",caseFirst:"upper"})}function Ui(i,e){if(!Array.isArray(i)||i.length===0)return i;let t=_e(e);return i.flatMap((s,n)=>{if(n<i.length-1){let r=t?e.cloneNode(!0):e;return[s,r]}return[s]})}function wt(i,e){return z(i)?i.includes(e):R(i)&&R(e)?i===e:!1}function J(...i){return i.reduce((e,t)=>(Object.keys(t).forEach(s=>{let n=e[s],r=t[s];Ae(n)&&Ae(r)?e[s]=J(n,r):e[s]=r}),e),{})}function d(){return mw.msg.apply(mw.msg,Rt(arguments))}function cs(i){return i=`hint-${i}`,`[${d(i)}]`}function q(i,e,t=!0){return i=d(i),t&&(i=`${i} ${cs(e)}`),i.trim()}function Ao(){return mw.message.apply(mw.message,Rt(arguments)).parse()}function ue(){return mw.message.apply(mw.message,Rt(arguments)).parseDom()}function ft(i){return mw.messages.set({[ze("buffer")]:i}),ue("buffer")}function Fe(i){return a(i)?!1:mw.message(ze(i)).exists()}function It(){if(o.local.userLanguage=mw.config.get("wgUserLanguage"),o.local.userLanguage==="qqx"){o.local.language=o.local.userLanguage;return}o.local.language=o.i18n[o.local.userLanguage]?o.local.userLanguage:"en",o.local.messages=o.i18n[o.local.language]||{},o.local.language!=="en"&&(o.local.messages={...o.i18n.en,...o.local.messages});let i={};for(let[e,t]of Object.entries(o.local.messages))i[ze(e)]=t;mw.messages.set(i)}function ze(i){return`${o.config.messagePrefix}-${i}`}function Rt(i){return a(i[0])||(i[0]=ze(i[0])),i}function Gi(i){if(Number.isInteger(i)){if(i===0)return d("error-offline");if(i>=400&&i<500)return d("error-revision-missing");if(i>500)return d("error-server")}}function se(i,e){i=Fe(i)?i:"error-generic",e={...e};let t={...e.article?.getValues()},s=d(i,t.oldid||t.curid||t.page1||t.rev1,t.diff||t.page2||t.rev2,t.titleText||t.title,e.message||d("error-wasted"));return/\.$/.test(s)||(s=`${s}.`),s}function E(i,e){if(e={article:null,silent:null,...e},e.silent=Dn(e.silent)?e.silent:!l.get("notifyErrors"),o.isUnloading)return;document.visibilityState==="hidden"&&(e.silent=!0);let t=se(i,e);if(e.silent){ne("warn",t,e);return}if(typeof mw<"u"&&mw.notify){let s=F("div.instantDiffs-notification",F("div.instantDiffs-notification-label",F("a",{href:kt(`/wiki/${o.config.link}`),target:"_blank"},d("script-name"))),Pn(t));Sn(s,e)}ne("error",t,e)}function Sn(i,e){mw.notify(i,{type:"error",tag:`${o.config.prefix}-${e.tag}`})}function we(i){let e=o.config.labels[i];if(e)return typeof e=="object"?e[document.dir]:e}function Ve(i){return l.get("openInNewTab")&&i?"_blank":"_self"}function Ke(i){return/^\/\//.test(i)&&(i=`https:${i}`),i}function Wt(i){try{return new URL(Ke(i))}catch{return null}}function Te(i,e){let t=Wt(e);if(t)return t.searchParams.get(i)}function K(i,e){let t=Wt(e);if(t)return t[i]}function Si(i){let e=mw.util.getParamValue("title",i);if(!e)try{let t=new URL(i,location.href),s=mw.config.get("wgArticlePath")?.split("$1")[0];t.pathname.startsWith(s)&&(e=decodeURIComponent(t.pathname.substring(s.length)))}catch(t){return ne("error","Error parsing URL",t),null}return e}function as(i){let e=Wt(i);if(!e)return;let t={};for(let[s,n]of e.searchParams){let r=s.match(/^([^[]+)\[([^\]]+)\]$/);if(r){let[,c,p]=r;t[c]=t[c]||{},t[c][p]=n}else t[s]=n}return t}function h(i){return!a(i)&&!isNaN(i)}function M(i){return!a(i)&&["next","prev","cur"].includes(i)}function lt(i){return i&&(i.fromtexthidden||i.totexthidden)}function di(i){return i&&i.slots?.main?.texthidden}function ce(i){return i.torevid?i.totitle:i.fromrevid?i.fromtitle:null}function Pe(i){let e;return i.torevid?(a(i.tocomment)||(e=i.tocomment.match(o.config.sectionRegExp)),e&&e[1]||null):i.fromrevid?(a(i.fromcomment)||(e=i.fromcomment.match(o.config.sectionRegExp)),e&&e[1]||null):null}function ui(i){let e;return i&&!a(i.comment)&&(e=i.comment.match(o.config.sectionRegExp)),e&&e[1]||null}function fs(){let i=mw.config.get("wgServer").replace(/^https?:/,""),e=new RegExp("^//www\\.").test(i)?"www.":"",t=mw.config.get("wgContentLanguage");if(!a(t)){let n=new RegExp(`^//${t}\\.`);if(n.test(i))return i.replace(n,`//${t}.m.`)}let s=mw.config.get("wgNoticeProject");if(!a(s)){let n=new RegExp(`^//${e}${s}\\.`);if(n.test(i))return i.replace(n,a(e)?`//${s}.m.`:`//m.${s}.`)}}function $e(){let i=o.config.bodyContentSelector[mw.config.get("skin")]||o.config.bodyContentSelector.default,e=$(i);return(!e||e.length===0)&&(e=$(document.body)),e}function Nt(i,e){let t="Special",s=mw.config.get("wgFormattedNamespaces")[-1],n=e.split(":"),r=i[e],c=r.split(":");n[0]=s,c[0]=t;let p=[e,r,n.join(":"),c.join(":")];return[...new Set(p)]}function Ze(i){if(!a(i))try{let e=new mw.Title(i).getPrefixedDb();for(let[t,s]of Object.entries(o.local.specialPagesAliasesPrefixed))if(s.includes(e))return t}catch{}}function F(i,e={},...t){return Object.keys(e).forEach(s=>{let n=e[s];if(!a(n))switch(s){case"id":i=`${i}#${n.trim()}`,delete e[s];break;case"class":n=Array.isArray(n)?n.map(r=>r.trim()).join("."):n.trim().replace(/\s+/g,"."),i=`${i}.${n}`,delete e[s];break}}),(0,xn.default)(i,e,...t)}function Pn(i){return document.createTextNode(i)}function To(...i){return i.reduce((e,t)=>e+t.outerHTML,"")}function ds(...i){let e=new DocumentFragment;for(let t of i)t&&e.append(t);return e}function Co(i){return ds(...i.toArray())}function zi(i,e){if(a(i))return null;if(!e)return mw.util.getTargetFromFragment(i);let t=e instanceof jQuery?e[0]:e;if(!t)return null;let s=t.querySelector(`#${CSS.escape(i)}`);if(s)return s;let n=mw.util.percentDecodeFragment(i);return n?t.querySelector(`#${CSS.escape(n)}`):null}function At(i,e){if(i instanceof jQuery&&(i=i[0]),e instanceof jQuery&&(e=e[0]),!i||!e)return null;let t=0,s=0,n=i;for(;n&&n!==e&&(t+=n.offsetTop,s+=n.offsetLeft,n=n.offsetParent,!(n&&!e.contains(n))););return{top:t,left:s}}function Hi(i,e=!1){if(i instanceof jQuery&&(i=i[0]),!i)return 0;let t=i.offsetHeight;if(e){let s=getComputedStyle(i);t+=parseFloat(s.marginTop)||0,t+=parseFloat(s.marginBottom)||0}return t}function xt(i){!i||i.length===0||i.contents().each((e,t)=>{t.nodeType===3&&t.remove()})}function He(i,e){let t=()=>{mw.notify(d("copy-link-copied"),{tag:`${o.config.prefix}-copyLink`}),x(e)&&e(!0)},s=()=>{mw.notify(d("copy-link-error"),{tag:`${o.config.prefix}-copyLink`,type:"error"}),x(e)&&e(!1)};if(a(i)||!R(i))return s();if(navigator.clipboard?.writeText)navigator.clipboard.writeText(i).then(t).catch(s);else{let n=F("textarea",{value:i});document.body.append(n),n.select();let r=document.execCommand("copy");n.remove(),r?t():s()}}function Ne(i,e,t=!0){let s=n=>{if(n){if(!Ln(n)||n.button||n.ctrlKey)return;if(n.preventDefault(),t&&n.altKey&&!a(i.href)){i.target==="_blank"?window.open(i.href,"_blank").focus():window.location.href=i.href;return}}e(n)};return t&&!a(i.href)&&(a(i.dataset.altTitle)&&(i.dataset.altTitle=i.title),i.dataset.altTitle=`${i.dataset.altTitle} ${cs("alt-click")}`.trim(),i.dataset.origTitle=i.title,i.addEventListener("mouseenter",()=>i.title=i.dataset.altTitle),i.addEventListener("mouseleave",()=>i.title=i.dataset.origTitle),i.addEventListener("mousedown",n=>n.preventDefault())),i.addEventListener("click",s),i.addEventListener("keypress",s),s}function ji(i,e){i.removeEventListener("click",e),i.removeEventListener("keypress",e)}function I(i,e,t="appendTo"){if(!e)return;if(e instanceof jQuery){(i instanceof jQuery?i:$(i))[t](e);return}let s=i instanceof jQuery?i.get(0):i;switch(t){case"insertBefore":e.before(s);break;case"insertAfter":e.after(s);break;case"prependTo":e.prepend(s);break;case"appendTo":default:e.append(s);break}}function Pi(i,e){if(i){if(i instanceof jQuery){i.html(e);return}i.innerHTML=e}}function Q(i,e,t=!1){if(!i)return;let s;try{s=new URL(e,`https://${location.hostname}`)}catch{return}let n=(c,p)=>{$(p).attr("href","https://"+s.hostname+s.pathname+$(p).attr("href"))},r=(c,p)=>{$(p).attr("href","https://"+s.hostname+$(p).attr("href").replace(/special:mylanguage\//i,"")).attr("title",($(p).attr("title")||"").replace(/special:mylanguage\//i,""))};i.filter('a[href^="#"]').each(n),i.find('a[href^="#"]').each(n),t||(i.filter('a[href^="/"]:not([href^="//"])').each(r),i.find('a[href^="/"]:not([href^="//"])').each(r))}function fe(i){if(!l.get("openInNewTab"))return;let e=(t,s)=>{let n=s.getAttribute("href");a(n)||/^#/.test(n)||s.setAttribute("target","_blank")};i.filter("a:not(.mw-thanks-thank-link, .jquery-confirmable-element)").each(e),i.find("a:not(.mw-thanks-thank-link, .jquery-confirmable-element)").each(e)}function ct(i=[]){let e=["instantDiffs-panel-placeholder"];return i.forEach(t=>e.push(`instantDiffs-panel-placeholder--${t}`)),l.get("showLink")&&e.push("has-link"),e}function Qe(){return $("<span>").addClass(ct())}function vt(i){i={short:null,long:null,iconBefore:null,iconAfter:null,...i},a(i.short)||(i.short=F("span",i.short)),a(i.long)||(i.long=F("span",i.long)),a(i.iconBefore)||(i.iconBefore=F("i",i.iconBefore)),a(i.iconAfter)||(i.iconAfter=F("i",i.iconAfter));let e=[i.iconBefore,i.short,i.iconAfter].filter(s=>!a(s)).map(s=>s.cloneNode(!0)),t=[i.iconBefore,i.long,i.iconAfter].filter(s=>!a(s)).map(s=>s.cloneNode(!0));return ds(F("div.instantDiffs-label.instantDiffs-label--long",...t),F("div.instantDiffs-label.instantDiffs-label--short",...e))}function Ki(i){i={$content:null,type:"notice",...i};let e=i.$content.toArray();return F("div",{class:["cdx-message","cdx-message--block",`cdx-message--${i.type}`,"plainlinks"]},F("span.cdx-message__icon"),F("div.cdx-message__content",...e))}var xn,y=m(()=>{xn=Hn(Fs());P();C()});var En=re(()=>{window.instantDiffs||={};instantDiffs.i18n||={};instantDiffs.i18n.en={"@metadata":{authors:["Serhio Magpie"]},"script-name":"Instant Diffs","script-name-short":"ID","diff-title":"Difference between revisions","diff-title-hidden":"Difference between revisions is hidden","revision-title":"Revision content","revision-title-hidden":"Revision content is hidden","compare-label":"$1","compare-title":"Compare selected revisions ($1)","compare-pages-title":"Difference between pages","compare-pages-title-hidden":"Difference between pages is hidden","page-title":"Go to page","comment-title":"Go to message","action-save":"Save","action-cancel":"Cancel","action-close":"Close","action-reload":"Reload","action-watch":"Watch","action-unwatch":"Unwatch","goto-snapshot-prev":"Previous link on a page","goto-snapshot-next":"Next link on a page","goto-view-diff":"Show changes","goto-view-revision":"Show revision","goto-view-unpatrolled":"Pending changes","goto-prev":"Older","goto-next":"Newer","goto-prev-diff":"Older edit","goto-next-diff":"Newer edit","goto-back-diff":"Back","goto-prev-revision":"Older revision","goto-next-revision":"Newer revision","goto-back-revision":"Back","goto-diff":"Go to edit","goto-revision":"Go to revision","goto-page":"Go to page","goto-comment":"Go to message","goto-edit":"Edit","goto-source":"View source","goto-history":"View history","goto-info":"View info","goto-talkpage":"Discussion","goto-settings":"Settings","goto-actions":"Actions","hint-close":"Esc","hint-alt-click":"Alt+Click: open the link","hint-snapshot-prev":"Ctrl+Arrow Left","hint-snapshot-next":"Ctrl+Arrow Right","hint-prev":"Arrow Left","hint-next":"Arrow Right","hint-switch":"Ctrl+Arrow Up","hint-unpatrolled":"Ctrl+P","hint-back":"Ctrl+Z","hint-actions":"Ctrl+Arrow Down","copy-link":"Copy link","copy-link-copied":"The link has been copied to the clipboard.","copy-link-error":"Couldn't copy the link.","copy-wikilink":"Copy wikilink","copy-wikilink-page":"page","copy-wikilink-diff":"diff","copy-wikilink-revision":"revision","copy-wikilink-example-title":"Main Page","dialog-title-empty":"[No title]","dialog-title-not-found":"[Not found]","dialog-notice-wikilambda":"WikiLambda app currently only shows the latest revision. See a [[phab:T397902|ticket]] on Phabricator.","dialog-notice-foreign-diff":"You are viewing a foreign diff from [$1 $2]. Some features can be limited.","dialog-notice-foreign-revision":"You are viewing a foreign revision from [$1 $2]. Some features can be limited.","dialog-notice-foreign-wikilambda":"WikiLambda app is not currently supported in the foreign revisions.","settings-title":"Instant Diffs Settings","settings-saved":`The settings have been saved successfully. Reload the page to apply them.`,"settings-saved-icon":"Checkmark icon","settings-empty":`Oops, looks like the admin disabled all settings. Time to relax and grab some coffee!`,"settings-empty-icon":"Coffee cup icon","settings-fieldset-links":"Links","settings-show-link":"Show action link","settings-show-link-help":"Displays an action button (\u2756) after the link to open the Instant Diffs dialog. Otherwise, the click action is added directly to the link. You can still open the link in the current tab by pressing Alt+Click.","settings-show-page-link":"Show page link","settings-show-page-link-help":"Displays an action button (\u2794) after the link to navigate to the page and section where the edit was made. If the [[mw:Special:MyLanguage/Convenient Discussions|Convenient Discussions]] script is installed, the button will also try to navigate to the corresponding comment.","settings-highlight-line":"Highlight lines in Watchlists and similar lists when the Instant Diffs dialog opens from the related link.","settings-mark-watched-line":"Mark changes as visited in Watchlists when the Instant Diffs dialog opens from the related link.","settings-fieldset-dialog":"Dialog","settings-view-width":"Set window dimensions:","settings-view-width-help":"Dimensions apply only to desktop view. Mobile view always uses full screen dimensions.","settings-view-width-option-title":"$1 pixels wide","settings-view-width-compact":"Compact","settings-view-width-standard":"Standard","settings-view-width-wide":"Wide","settings-view-width-full":"Full","settings-view-width-full-title":"All available screen space","settings-close-outside":"Close Instant Diffs dialog when clicking outside of it.","settings-enable-hotkeys":"Enable keyboard shortcuts in the Instant Diffs dialog.","settings-show-diff-tools":"Show additional diff tools, such as the Inline format toggle.","settings-show-revision-info":"Show change information when viewing a revision.","settings-unhide-diffs":"Display hidden revision content and diff info without additional steps.","settings-unhide-diffs-help":'The "$1" [[mw:Special:MyLanguage/Help:RevisionDelete|user right]] is required to view revision content.',"settings-open-in-new-tab":"Open links inside the Instant Diffs dialog in a new tab.","settings-fieldset-menu":"Menu","settings-show-menu-icons":"Show icons in the Instant Diffs dialog dropdown menu.","settings-show-watchlist-popup":"Show advanced options when adding or removing pages from the Watchlist.","settings-show-watchlist-popup-help":"When available, displays a popup with watchlist time period and label settings.","settings-links-hash":"Include section name (anchor) in the links","settings-links-hash-help":"The section name will also be appended as an anchor to the link URL when using copy actions with the selected non-minified format.","settings-links-format":"Link format for the copy action:","settings-links-format-full":"Full url with a page title","settings-links-format-minify":"Minified url","settings-wikilinks-format":"Wikilink format for the copy action:","settings-wikilinks-format-link":"Simple link in brackets","settings-wikilinks-format-special":"Internal wiki link","settings-fieldset-general":"General","settings-enable-mobile":"Enable Instant Diffs on the mobile skin (Minerva).","settings-enable-mobile-help":"To re-enable Instant Diffs, you will need to switch to a different skin.","settings-notify-errors":"Show popup alerts for critical errors.","settings-fieldset-pinned-actions":"Pinned Actions","settings-pinned-actions":"Pin selected actions in the quick access menu:","settings-pinned-actions-help":"This list shows only actions available for the current view. Pinned actions appear only in desktop view.","error-generic":"Something went wrong: $4","error-server":"Server error, please try again later","error-offline":"Please check your internet connection","error-wasted":"Unexpected error","error-prepare-generic":"Failed to prepare configuration: $4","error-prepare-version":"Another instance is already running: $4","error-prepare-replaced":"Standalone instance replaced successfully: $4","error-prepare-mobile":"The script is disabled in the settings for the mobile skin (Minerva)","error-link-options":'Failed to parse the "data-instantdiffs-options" link attribute: $4',"error-revision-generic":'Failed to load revision data "oldid=$1": $4',"error-revision-curid":'Failed to load revision data "curid=$1": $4',"error-revision-badrevids":"Revision not found","error-revision-badpageids":"Page not found","error-revision-missing":"Page not found","error-revision-invalid":"Page not found: $4","error-diff-generic":'Failed to load revision compare data "oldid=$1", "diff=$2": $4',"error-diff-compare-pages":'Failed to load page compare data "page1=$1", "page2=$2": $4',"error-diff-missingcontent":"Revision is hidden","error-diff-nosuchrevid":"Revision not found","error-diff-missingtitle":"Page not found","error-api-generic":"Failed to request api: $4","error-dependencies-generic":"Failed to load dependencies: $4","error-dependencies-revid":'Failed to load page dependencies "oldid=$1": $4',"error-dependencies-curid":'Failed to load page dependencies "curid=$1": $4',"error-global-watchlist":"Failed to execute Global Watchlist API: $4","error-setting-request":"Failed to load user options: $4","error-setting-save":"Failed to save user options: $4"}});var An=re($n=>{$n.loaders={en:()=>En()}});var Tn=m(()=>{P();y();mw.hook("mw.translate.editor.showTranslationHelpers").add((i,e)=>{!e||!pe()||mw.hook(`${o.config.prefix}.process`).fire(e)})});var Cn=m(()=>{P();y();Ee();mw.hook("convenientDiscussions.preprocessed").add(i=>{if(!i)return;let e=s=>{!s||!s.isValid||!s.isProcessed||s.isForeign||!s.options.showPageLink||s.actions.cd||(s.extensions.cd={},s.extensions.cd.href=t(s),!a(s.extensions.cd.href)&&(s.actions.page&&s.actions.page.remove(),s.actions.cd=s.renderAction({label:we("page"),title:d("comment-title"),href:s.extensions.cd.href,modifiers:["page","comment"]})))},t=s=>{if(!s.compare&&!s.revision)return;let n=s.getArticle().get("titleText"),r=i.api.pageRegistry.get(n);if(!r||!r.isProbablyTalkPage())return;if(s.revision?s.revision.revid&&(s.extensions.cd.date=new Date(s.revision.timestamp),s.extensions.cd.user=s.revision.user):s.compare&&(s.compare.torevid?(s.extensions.cd.date=new Date(s.compare.totimestamp),s.extensions.cd.user=s.compare.touser):s.compare.fromrevid&&(s.extensions.cd.date=new Date(s.compare.fromtimestamp),s.extensions.cd.user=s.compare.fromuser)),s.extensions.cd.date&&s.extensions.cd.user)try{s.extensions.cd.anchor=i.api.generateCommentId(s.extensions.cd.date,s.extensions.cd.user)}catch(p){ve("Gadget-ConvenientDiscussions","Unable to generate comment anchor.",p)}if(!s.extensions.cd.anchor)return;let c=`#${s.extensions.cd.anchor}`;return n!==o.local.mwTitleText&&(c=mw.util.getUrl(`${n}${c}`)),c};if(o.isRunCompleted)for(let s of O.getLinks())e(s);mw.hook(`${o.config.prefix}.link.renderSuccess`).add(s=>{s&&e(s)})})});var On=m(()=>{P();mw.hook(`${o.config.prefix}.page.complete`).add(i=>{if(!i)return;(i.getContainer()?.find('[id^="tw-revert"] a')).each((t,s)=>{s.addEventListener("click",()=>i.close())})})});var Mn=m(()=>{P();mw.hook(`${o.config.prefix}.page.beforeDetach`).add(i=>{if(!i)return;let e=i.getDiffTable();typeof wikEd<"u"&&wikEd.diffTableLinkified&&e?.length>0&&wikEd.diffTable===e.get(0)&&(wikEd.diffTableLinkified=!1)})});var In=m(()=>{P();y();mw.hook("wikipage.content").add(()=>{if(!pe()||mw.config.get("skin")!=="citizen")return;let i=(s,n)=>{try{let r=new URL(s.href);a(r.searchParams.get("diff"))&&(r.searchParams.set("diff","cur"),s.href=r.href),s.dataset.instantdiffsLink="basic",s.dataset.instantdiffsOptions=JSON.stringify({showLink:!1,showPageLink:!1,showAltTitle:!0}),mw.hook(`${o.config.prefix}.process`).fire($(n))}catch(r){ve("Skin-Citizen","Unable to append the link action.",r)}},e=document.querySelector("#citizen-lastmod-relative"),t=document.querySelector("#citizen-sidebar-lastmod");e&&t&&i(e,t)})});var Oo={};var Rn=m(()=>{Tn();Cn();On();Mn();In()});P();var Y={version:"5.4.0+build.4",link:"Instant_Diffs",discussion:"Talk:Instant_Diffs",outname:"instantDiffs",outdir:"dist",origin:"https://www.mediawiki.org",server:"https://www.mediawiki.org",prefix:"instantDiffs",messagePrefix:"instant-diffs",settingsPrefix:"userjs-instantDiffs",dependencies:{styles:"/w/index.php?title=User:Serhio_Magpie/instantDiffs.test.css&action=raw&ctype=text/css",messages:"/w/index.php?title=User:Serhio_Magpie/instantDiffs-i18n/$lang.js&action=raw&ctype=text/javascript",main:["oojs","mediawiki.api","mediawiki.util","mediawiki.user","mediawiki.storage","mediawiki.notification","mediawiki.ForeignApi","mediawiki.Title"],settings:["oojs","oojs-ui-core","oojs-ui-widgets","oojs-ui-windows","oojs-ui.styles.icons-interactions"],window:["oojs","oojs-ui-core","oojs-ui-widgets","oojs-ui-windows","oojs-ui.styles.icons-accessibility","oojs-ui.styles.icons-movement","oojs-ui.styles.icons-content","oojs-ui.styles.icons-alerts","oojs-ui.styles.icons-interactions","oojs-ui.styles.icons-moderation","oojs-ui.styles.icons-editing-core","oojs-ui.styles.icons-editing-advanced","oojs-ui.styles.icons-user","oojs-ui.styles.icons-layout"],content:["jquery.confirmable","mediawiki.DateFormatter","mediawiki.codex.messagebox.styles","mediawiki.interface.helpers.styles","mediawiki.diff","mediawiki.diff.styles","mediawiki.misc-authed-curate","mediawiki.page.watch.ajax","ext.flaggedRevs.basic","ext.visualEditor.diffPage.init"],page:{"*":["ext.thanks.corethank","ext.checkUser.styles","ext.checkUser.userInfoCard"]},revision:{6:["filepage","wikibase.mediainfo.filepage.styles","wikibase.mediainfo.statements","wikibase.mediainfo.statements.styles"],14:["mediawiki.page.gallery.styles"],146:["wikibase.lexeme.styles"]},skins:{minerva:{"*":["codex-styles","skins.minerva.categories.styles"]}}},foreignDependencies:{revision:{styles:{6:["wikibase.mediainfo.filepage.styles","wikibase.mediainfo.statements","wikibase.mediainfo.statements.styles"],146:["wikibase.lexeme.styles"]},links:{6:["MediaWiki:Filepage.css"]},wikibase:{styles:{all:["jquery.wikibase.toolbar.styles","wikibase.view.ControllerViewFactory","wikibase.alltargets"],desktop:["wikibase.desktop"],mobile:["wikibase.mobile"]}}}},settings:{},defaults:{debug:!1,GM:!1,standalone:!1,storageExpiry:86400,logTimers:!0,expEnableWatchlistPopup:!1},include:{pageActions:["view","history"]},exclude:{pages:[],linkActions:["edit","history"]},labels:{page:{ltr:"\u2794",rtl:"\u{1F870}"},diff:"\u2756",revision:"\u272A",error:"\u{1D4D4}"},breakpoints:{mobileUp:"(min-width: 640px)",mobileDown:"(max-width: 639px)"},wikilinkPresets:{link:{page:"[$href $msg]",diff:"[$href $msg]",revision:"[$href $msg]"},special:{page:"[[$prefSpecial:Redirect/page/$1|$msg]]",diff:"[[$prefSpecial:Diff/$1|$msg]]",revision:"[[$prefSpecial:PermanentLink/$1|$msg]]"}},commonsAssetsPath:"https://upload.wikimedia.org/wikipedia/commons",changeLists:["Watchlist","Recentchanges","Recentchangeslinked"],contributionLists:["Contributions","GlobalContributions"],otherLists:["Newpages","PendingChanges","GlobalWatchlist"],specialPages:["Special:Diff","Special:Permalink","Special:PermanentLink","Special:MobileDiff","Special:Redirect","Special:ComparePages","Special:Undelete"],nonEditableContentModels:["wikibase-item","wikibase-property","wikibase-lexeme"],skinBodyClasses:{"vector-2022":["mw-body","vector-body"],vector:["vector-body"],monobook:["monobook-body"],minerva:["content"],timeless:["mw-body"]},bodyContentSelector:{minerva:"#content",default:"#bodyContent"},contentSelector:"#mw-content-text",specialPagesLinks:["Special:Diff","Special:Permalink","Special:PermanentLink","Special:MobileDiff","Special:Redirect"],specialPagesLinksSearchRegExp:"^($1)",specialPagesLinksPathRegExp:"$1($2)",specialPagesLinksSelector:'a[title^="$1"]',articlePathRegExp:"^($1)",sectionRegExp:/^\/\*\s*(.*?)\s*\*\/.*$/,linkSelector:["a[data-instantdiffs-link]",'a.external[href^="$1"]',"a.mw-changeslist-date","a.mw-changeslist-diff","a.mw-changeslist-diff-cur","a.mw-changeslist-groupdiff",".mw-changeslist-line a.extiw",".mw-fr-reviewlink a",".mw-enhanced-rc-time a",".mw-history-histlinks a",".mw-diff-bytes + a",".mw-contributions-list .comment a",".mw-fr-pending-changes-table a.cdx-docs-link","#mw-revision-nav a","table.diff #differences-prevlink","table.diff #differences-nextlink",".mw-diff-revision-history-links a",".mw-logevent-loglines a","[data-afl-log-id] a",'li[class^="mw-tag"] a',"a.ext-globalwatchlist-diff",".wikibase-statementview-references a","a.edit-summary-time","#mw-fr-revision-messages a","#mw-fr-revision-details a"],mwLine:{selector:[".mw-changeslist-line",".mw-contributions-list li",".mw-fr-pending-changes-table tr",".mw-logevent-loglines li",".mw-special-AbuseLog [data-afl-log-id]",'.mw-special-EditTags li[class^="mw-tag"]',".ext-globalwatchlist-site li"],seen:["mw-changeslist-line-not-watched","mw-enhanced-not-watched","mw-changeslist-watchedseen"],unseen:["mw-changeslist-line-watched","mw-enhanced-watched","mw-changeslist-watchedunseen"]},mwLineTitle:{selector:[".mw-changeslist-title",".mw-contributions-title",".mw-newpages-pagename",".mw-fr-pending-changes-page-title"]},mwLink:{id:["differences-prevlink","differences-nextlink"],hasClass:["mw-diff-revision-history-link-prev","mw-diff-revision-history-link-next","mw-changeslist-date","mw-changeslist-diff","mw-changeslist-diff-cur","mw-changeslist-groupdiff","mw-newpages-time"],closestTo:[".mw-changeslist-line",".mw-contributions-list",".mw-history-histlinks",".mw-pager-navigation-bar + ul",".mw-fr-hist-difflink","#mw-fr-reviewnotice","#mw-fr-revisiontag","#mw-fr-revisiontag-edit","#mw-fr-revision-tag-edit",".mw-specialpage-summary","#mw-revision-nav",".mw-fr-pending-changes-table",".mw-logevent-loglines",".mw-special-AbuseLog li[data-afl-log-id]",'.mw-special-EditTags li[class^="mw-tag"]',".wikibase-statementview-references",".ext-globalwatchlist-site",".tux-message-editor",".mw-pt-translate-header"]},mwLinkExclude:{hasClass:["mw-contributions-title"]},mwLinkDiffOnly:{id:["differences-prevlink","differences-nextlink"],closestTo:["#mw-revision-nav"]},mwLinkPrepend:{id:["differences-nextlink"],hasClass:["mw-diff-revision-history-link-next"]},mwLinkAltTitle:{closestTo:[".mw-fr-reviewlink",".mw-history-histlinks"]},mwLinkContent:{closestTo:[".mw-parser-output"]},mwLinkContentInside:{closestTo:[".comment"]}},bs={messages:{},settings:{},defaults:{},require:null,language:null,linkSelector:null,mwIsAnon:!0,mwEndPoint:null,mwEndPointUrl:null,mwAction:null,mwArticlePath:null,mwCanonicalSpecialPageName:null,mwTitle:null,mwTitleText:null,mwServers:[],mwServerNames:[],specialPagesLocalPrefixed:{},specialPagesAliases:{},specialPagesAliasesFlat:[],specialPagesAliasesPrefixed:{},specialPagesAliasesPrefixedFlat:[],specialPagesLinksAliases:{},specialPagesLinksAliasesFlat:[],specialPagesLinksAliasesPrefixed:{},specialPagesLinksAliasesPrefixedFlat:[],specialPagesLinksPathRegExp:null,specialPagesLinksSearchRegExp:null,articlePathRegExp:null,mutationObserver:null,interactionObserver:null},vs={};y();j();Ct();B();le();at();Ee();yt();Ji();Xi();le();at();ee();var us=class extends ie{article;constructor(e){super({article:{},...e,ariaHaspopup:!0,handler:()=>this.openDialog()}),this.article=new W(this.options.article)}openDialog(){let e={onOpen:()=>this.onDialogOpen(),onClose:()=>this.onDialogClose()};if(L.setup(this,e))return this.onDialogRequest(),$.when(L.load()).always(()=>this.onDialogLoad())}onDialogRequest(){this.pending(!0),this.emit("loading")}onDialogLoad(){this.pending(!1),this.emit("loaded")}onDialogOpen(){this.emit("opened")}onDialogClose(){this.emit("closed")}getArticle(){return this.article}},Ft=us;P();C();var hs=class extends Ft{nodes={};openDialog(){this.nodes.$oldid=$('#mw-history-compare input[name="oldid"]:checked'),this.nodes.$oldidLine=this.nodes.$oldid.closest("li"),this.nodes.$diff=$('#mw-history-compare input[name="diff"]:checked'),this.nodes.$diffLine=this.nodes.$diff.closest("li"),this.article.set({type:"diff",title:o.local.mwTitleText,oldid:this.nodes.$oldid.val(),diff:this.nodes.$diff.val()}),super.openDialog()}onDialogOpen(){l.get("highlightLine")&&(this.nodes.$oldidLine.addClass("instantDiffs-line--highlight"),this.nodes.$diffLine.addClass("instantDiffs-line--highlight")),super.onDialogOpen()}onDialogClose(){l.get("highlightLine")&&(this.nodes.$oldidLine.removeClass("instantDiffs-line--highlight"),this.nodes.$diffLine.removeClass("instantDiffs-line--highlight")),super.onDialogClose()}},ps=hs;Wi();ee();C();var Mo=ms({"../dist/instantDiffs-i18n-bundle.js":()=>An()});function Wn(){if(!(o.isPageAdjustmentsApplied||!pe())){if(o.isPageAdjustmentsApplied=!0,document.body.classList.add("instantDiffs-enabled"),o.config.changeLists.includes(o.local.mwCanonicalSpecialPageName))return Io();if(o.config.contributionLists.includes(o.local.mwCanonicalSpecialPageName))return Ro();if(o.local.mwCanonicalSpecialPageName==="GlobalWatchlist")return No();if(o.local.mwAction==="history")return Fo()}}function Io(){$(".mw-changeslist-line").addClass("instantDiffs-line")}function Ro(){$(".mw-contributions-list .mw-changeslist-links:not(.mw-pager-tools) > span:first-child").each((e,t)=>{let s=$(t);s.find("a").length===0&&s.wrapInner(Qe())}),o.local.mwCanonicalSpecialPageName==="GlobalContributions"&&Wo()}function Wo(){$(".mw-contributions-list li").each((e,t)=>{let s=$(t),n=s.find("a.mw-changeslist-date, a.mw-changeslist-history");if(n.length!==0)try{let r=new URL(n.prop("href"));Q(s,r.origin)}catch{}})}function No(){let i=document.getElementById("ext-globalwatchlist-watchlistsfeed");o.local.mutationObserver.observe(i,{childList:!0})}function Fo(){let i=$("#pagehistory > li, #pagehistory .mw-contributions-list > li").addClass("instantDiffs-line--history");if(i.length<=1)return;i.each((t,s)=>{let n=$(s),r=n.find(".mw-history-histlinks > span:first-child"),c=n.find(".mw-history-histlinks > span:last-child");r.find("a").length===0&&r.wrapInner(Qe()),c.find("a").length===0&&c.wrapInner(Qe())}),$(".mw-history-compareselectedversions").each((t,s)=>{let r=$(s).find(".mw-history-compareselectedversions-button");new ps({label:d("compare-label",o.config.labels.diff),title:d("compare-title",d("script-name")),classes:["mw-ui-button","cdx-button","instantDiffs-button--compare"],insertMethod:"insertAfter",container:r}),$("<span>").text(" ").addClass("instantDiffs-spacer").insertAfter(r)})}function Vo(i){o.local.require=i,mw.util.addCSS(".instantDiffs-panel { display:none; }"),L.mixin(),l.mixin(),ni(L),ni(l),OO.mixinClass(ie,OO.EventEmitter),OO.mixinClass(ye,OO.EventEmitter),o.local.mwIsAnon=mw.user?.isAnon?.()??!0,o.local.mwEndPoint=`${location.origin}${mw.config.get("wgScript")}`,o.local.mwEndPointUrl=new URL(o.local.mwEndPoint),o.local.mwAction=mw.config.get("wgAction"),o.local.mwArticlePath=mw.config.get("wgArticlePath").replace("$1",""),o.local.mwCanonicalSpecialPageName=mw.config.get("wgCanonicalSpecialPageName"),o.local.mwTitle=new mw.Title(mw.config.get("wgRelevantPageName")),o.local.mwTitleText=o.local.mwTitle.getPrefixedText();let e=fs();mw.config.set("wgMobileServer",e),mw.config.set("wgMobileServerName",K("hostname",e));let t=[mw.config.get("wgServer"),mw.config.get("wgMobileServer")].filter(n=>!a(n)).map(Ke);o.local.mwServers=[...new Set(t)];let s=[mw.config.get("wgServerName"),mw.config.get("wgMobileServerName")].filter(n=>!a(n));return o.local.mwServerNames=[...new Set(s)],o.local.lastVersion=mw.storage.get(`${o.config.prefix}-version`),mw.storage.set(`${o.config.prefix}-version`,o.config.version),o.local.mutationObserver=new MutationObserver(Yo),o.local.interactionObserver=new IntersectionObserver(Jo,{threshold:0,rootMargin:l.get("debug")?"0px 0px 0px 0px":"33% 0px 33% 0px"}),window.addEventListener("pageshow",Xo),window.addEventListener("beforeunload",Zo),Promise.allSettled([b.getSpecialPages(),jo(),...qo()])}async function jo(){let{general:i}=await b.getSiteInfo(["general"])||{};if(!T(i)){a(i.mobileserver)||(mw.config.set("wgMobileServer",i.mobileserver),mw.config.set("wgMobileServerName",i.mobileservername));let e=[...o.local.mwServers,i.server,i.mobileserver].filter(s=>!a(s)).map(Ke);o.local.mwServers=[...new Set(e)];let t=[...o.local.mwServerNames,i.servername,i.mobileservername].filter(s=>!a(s));o.local.mwServerNames=[...new Set(t)]}}function qo(){return["en",mw.config.get("wgUserLanguage")].filter((e,t,s)=>s.indexOf(e)===t&&!o.i18n[e]).map(e=>{let t=o.config.dependencies.messages.replace("$lang",e);return mw.loader.getScript(Mt(t))})}function Bo(){for(let[i,e]of Object.entries(b.specialPagesLocal))o.local.specialPagesLocalPrefixed[i]=new mw.Title(e).getPrefixedDb(),o.local.specialPagesAliases[i]=Nt(b.specialPagesLocal,i),o.local.specialPagesAliasesPrefixed[i]=Nt(o.local.specialPagesLocalPrefixed,i),o.config.specialPagesLinks.includes(i)&&(o.local.specialPagesLinksAliases[i]=o.local.specialPagesAliases[i],o.local.specialPagesLinksAliasesPrefixed[i]=o.local.specialPagesAliasesPrefixed[i]);o.local.specialPagesAliasesFlat=Object.values(o.local.specialPagesAliases).flat(),o.local.specialPagesAliasesPrefixedFlat=Object.values(o.local.specialPagesAliasesPrefixed).flat(),o.local.specialPagesLinksAliasesFlat=Object.values(o.local.specialPagesLinksAliases).flat(),o.local.specialPagesLinksAliasesPrefixedFlat=Object.values(o.local.specialPagesLinksAliasesPrefixed).flat()}function Uo(){o.local.articlePathRegExp=new RegExp(o.config.articlePathRegExp.replaceAll("$1",o.local.mwArticlePath));let i=[];o.config.linkSelector.forEach(t=>{/\$1/.test(t)?o.local.mwServers.forEach(s=>{i.push(t.replaceAll("$1",s))}):i.push(t)}),o.local.specialPagesLinksAliasesFlat.forEach(t=>{i.push(o.config.specialPagesLinksSelector.replaceAll("$1",t))});let e=o.local.specialPagesLinksAliasesPrefixedFlat.join("|");o.local.specialPagesLinksPathRegExp=new RegExp(o.config.specialPagesLinksPathRegExp.replaceAll("$1",o.local.mwArticlePath).replaceAll("$2",e)),o.local.specialPagesLinksSearchRegExp=new RegExp(o.config.specialPagesLinksSearchRegExp.replaceAll("$1",e)),o.local.linkSelector=i.join(",")}function Ho(){Y.settings={...ss(),...Y.settings},Y.defaults={...ns(),...Y.defaults};let i={...Y.settings,...o.settings},e={...Y.defaults,...o.defaults,...os()};if(o.isRunning){o.isReplaced=Ko(i,e),E(o.isReplaced?"error-prepare-replaced":"error-prepare-version",{tag:"app",message:`loaded: ${o.config.version}, concurrent: ${Y.version}`,silent:!0});return}o.isRunning=!0,o.i18n||={},o.config=Y,o.local=bs,o.local.settings=i,o.local.defaults=e,o.timers=vs,o.utils=w,o.modules={Api:b,Article:W,Link:O,Button:ie,ViewButton:Ft,HistoryCompareButton:ps,Page:ye,LocalPage:Dt,GlobalPage:Lt,Watch:gt,view:L,settings:l},o.timers.run=mw.now(),_o(),It(),Rn(),Go()}function _o(){let{loaders:i}=Mo(`../${o.config.outdir}/${o.config.outname}-i18n-bundle.js`);for(let e of Object.values(i))e()}function Go(){mw.loader.load(Mt(o.config.dependencies.styles),"text/css"),mw.loader.using(o.config.dependencies.main).then(Vo).then(()=>$(zo)).fail(i=>{E("error-prepare-generic",{tag:"app",message:i?.message})})}async function zo(){if(await l.processDefaults(),It(),mw.config.get("skin")==="minerva"&&!l.get("enableMobile")){E("error-prepare-mobile",{tag:"app",silent:!0});return}o.isReady=!0,Bo(),Uo(),Wn(),o.timers.ready=mw.now(),mw.hook(`${o.config.prefix}.ready`).fire(o),mw.hook("wikipage.content").add(Nn),mw.hook(`${o.config.prefix}.process`).add(Fn),mw.hook(`${o.config.prefix}.replace`).add(Qo)}function Nn(i){!i||!pe()||(o.isFirstRun=!o.isRunCompleted,o.isFirstRun&&(o.isRunCompleted=!0,i=$e()),Fn(i),l.get("logTimers")&&o.isFirstRun&&(he("ready time",o.timers.run,o.timers.ready),he("total time",o.timers.run,o.timers.processEnd)))}function Fn(i){if(!i)return;o.timers.processStart=mw.now(),o.timers.findLinksStart=mw.now();let e=O.findLinks(i);o.timers.findLinksEnd=mw.now();let t=[],s=[];for(let n of e){if(O.hasLink(n))continue;let r=new O(n);t.push(r),r.isValid&&s.push(r)}o.timers.processEnd=mw.now(),l.get("logTimers")&&t.length>0&&(ne("info",`links found: ${t.length}`),ne("info",`links processed: ${s.length}`),he("links selector time",o.timers.findLinksStart,o.timers.findLinksEnd),he("links process time",o.timers.processStart,o.timers.processEnd)),mw.hook(`${o.config.prefix}.processed`).fire(s)}function Ko(i,e){return o.modules.settings.get("standalone")&&!e.standalone?(mw.hook(`${o.config.prefix}.replace`).fire(i,e),!0):!1}async function Qo(i,e){!i||!e||(o.local.settings=i,o.local.defaults=e,o.isReady&&(await l.processDefaults(),o.timers.run=mw.now(),o.timers.ready=mw.now(),Wn(),Nn($e())))}function Jo(i){o.isUnloading||i.forEach(e=>{if(!e.isIntersecting)return;let t=O.getLink(e.target);t&&t.onIntersect()})}function Yo(i){o.isUnloading||i.forEach(e=>{e.addedNodes.length>0&&mw.hook(`${o.config.prefix}.process`).fire($(e.target))})}function Xo(i){i.persisted&&(o.isUnloading=!1)}function Zo(){o.isUnloading=!0}Ho();})(); /* </nowiki> */ myxyiolapf2dna3wtjch99jcjmqu4k7 User:Serhio Magpie/instantDiffs.test.css 2 2203064 8365079 8364125 2026-05-04T08:14:08Z Serhio Magpie 1775170 [ee41ec7] [v5.4.0+build.3]: Updated from repository. 8365079 css text/css /** * Instant Diffs * * Version: 5.4.0+build.3 * Author: Serhio Magpie * Licenses: (MIT OR CC-BY-SA-4.0) * Documentation: https://www.mediawiki.org/wiki/Instant_Diffs * * For license information please see: https://www.mediawiki.org/wiki/User:Serhio_Magpie/instantDiffs.js.LEGAL.txt */ /* <nowiki> */ .instantDiffs-link{padding-inline:var(--instantDiffs-gap);-webkit-box-decoration-break:clone;box-decoration-break:clone;background:var(--instantDiffs-background-link);color:var(--instantDiffs-color-link);text-decoration:none}.instantDiffs-link:where(:not(.cdx-button)){border-radius:1em}.instantDiffs-link:before{margin-inline-end:var(--instantDiffs-gap)}.instantDiffs-link:after{margin-inline-start:var(--instantDiffs-gap)}.instantDiffs-link.is-insertBefore:before{content:var(--instantDiffs-label)}.instantDiffs-link.is-insertAfter:after{content:var(--instantDiffs-label)}.instantDiffs-link.is-insertAfter[rel~="mw:ExtLink"]:empty:after{margin-inline:0;content:"[" counter(mw-numbered-ext-link) "] " var(--instantDiffs-label);counter-increment:mw-numbered-ext-link}.instantDiffs-link:is(:hover,:focus-visible){background:var(--instantDiffs-background-link--hover);color:var(--instantDiffs-color-link--hover);text-decoration:none}.instantDiffs-link:is(:active,:focus){background:var(--instantDiffs-background-link--active);color:var(--instantDiffs-color-link--active);text-decoration:none}.instantDiffs-link--diff{--instantDiffs-label: var(--instantDiffs-label-diff)}.instantDiffs-link--revision{--instantDiffs-label: var(--instantDiffs-label-revision)}.instantDiffs-link--error{background:var(--instantDiffs-background-link-error);color:var(--instantDiffs-color-link-error)}.instantDiffs-link--error:is(:hover,:focus-visible){background:var(--instantDiffs-background-link-error--hover);color:var(--instantDiffs-color-link-error--hover)}.instantDiffs-link--error:is(:active,:focus){background:var(--instantDiffs-background-link-error--active);color:var(--instantDiffs-color-link-error--active)}.instantDiffs-link--pending{cursor:wait!important}.instantDiffs-panel{margin-inline:var(--instantDiffs-gap);font-weight:400;font-style:normal;color:#72777d;user-select:none}.instantDiffs-panel:is(:empty){display:none!important}span.instantDiffs-panel{display:inline}.instantDiffs-panel a{cursor:pointer;color:inherit}.instantDiffs-panel .item:not(:last-child){margin-inline-end:var(--instantDiffs-gap)}.instantDiffs-panel .error{font-size:inherit}.instantDiffs-panel .error-info{cursor:help}.cdx-dialog__footer__actions .instantDiffs-panel{align-self:center}.instantDiffs-panel-placeholder{padding-inline:var(--instantDiffs-gap)}.instantDiffs-panel-placeholder:after{margin-inline-start:var(--instantDiffs-gap);color:var(--color-placeholder, #72777d);content:var(--instantDiffs-label-placeholder)}.instantDiffs-panel-placeholder.has-link{padding:0}.instantDiffs-panel-placeholder--diff:after{content:var(--instantDiffs-label-diff)}.instantDiffs-panel-placeholder--revision:after{content:var(--instantDiffs-label-revision)}.instantDiffs-panel-placeholder--loader:after{color:var(--color-disabled, #a2a9b1);animation:instantDiffs-blink 1s infinite alternate}@keyframes instantDiffs-blink{0%{opacity:0}to{opacity:1}}.instantDiffs-navigation{margin:0 -16px 1em;padding:1em 16px;display:flex;gap:.5em;position:sticky;z-index:2;top:0;border-bottom:1px solid var(--instantDiffs-border-color);background:var(--instantDiffs-background-navigation);background-clip:padding-box;-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);font-size:var(--instantDiffs-font-size-navigation)}@media (max-width: 639px){.instantDiffs-navigation{padding:.5em}}.instantDiffs-navigation-group{display:flex;gap:var(--instantDiffs-gap)}.instantDiffs-navigation-group--left{justify-content:flex-start;flex:1}@media (max-width: 639px){.instantDiffs-navigation-group--left .instantDiffs-button--pending,.instantDiffs-navigation-group--left .instantDiffs-button--back{display:none}}.instantDiffs-navigation-group--center{min-width:0;justify-content:center;flex:0 1 auto}.instantDiffs-navigation-group--center .oo-ui-buttonElement{min-width:0;flex:auto}.instantDiffs-navigation-group--center .oo-ui-buttonElement-button{display:block;overflow:hidden;text-overflow:ellipsis}@media (max-width: 639px){.instantDiffs-navigation-group--center{flex:auto}.instantDiffs-navigation-group--center .instantDiffs-button--switch{display:none}}.instantDiffs-navigation-group--right{justify-content:flex-end;flex:1}@media (max-width: 959px){.instantDiffs-navigation-group--right .instantDiffs-button--pin{display:none}}.instantDiffs-buttons-group{min-width:0;margin:0;display:flex}.instantDiffs-buttons-group:is(:empty){display:none}.instantDiffs-buttons-group--vertical{padding:0;flex-direction:column}.instantDiffs-buttons-group--vertical:is(:empty)+hr{display:none}.instantDiffs-buttons-group--vertical.has-icons{gap:var(--instantDiffs-gap)}@media (max-width: 959px){.instantDiffs-buttons-group--pins-custom{display:none}}@media (min-width: 640px){.instantDiffs-buttons-group--mobile.instantDiffs-buttons-group--mobile{display:none}.instantDiffs-buttons-group--mobile+hr{display:none}}.instantDiffs-buttons-separator{margin:0;flex:none;background-color:var(--instantDiffs-border-color)}.instantDiffs-buttons-popup .oo-ui-popupWidget-popup{padding:0}.instantDiffs-buttons-popup .oo-ui-popupWidget-body{display:flex;flex-direction:column}.instantDiffs-buttons-popup.has-icons .oo-ui-popupWidget-body{padding:var(--instantDiffs-gap);gap:var(--instantDiffs-gap)}.instantDiffs-button--link{display:block}.instantDiffs-button--link>.oo-ui-buttonElement-button{display:block}.instantDiffs-button--link.oo-ui-buttonElement-frameless.instantDiffs-button--link.oo-ui-buttonElement-frameless:first-child{margin:0}.instantDiffs-button--link.oo-ui-buttonElement-frameless>.oo-ui-buttonElement-button{margin:0;border-radius:var(--instantDiffs-button-radius)}.instantDiffs-button--link.oo-ui-widget-enabled>.oo-ui-buttonElement-button:is(:hover,:focus){background-color:var(--background-color-interactive, #eaecf0);color:var(--color-progressive--hover, var(--instantDiffs-color-link--hover))}.instantDiffs-button--link.oo-ui-widget-enabled>.oo-ui-buttonElement-button:active{border-color:var(--border-color-progressive--active, #2a4b8d);background-color:var(--background-color-progressive-subtle, #eaf3ff);color:var(--color-progressive--active, var(--instantDiffs-color-link--active))}.instantDiffs-button--link-id .oo-ui-labelElement-label{white-space:wrap}.instantDiffs-button--link-id .oo-ui-labelElement-label .name{white-space:nowrap}.instantDiffs-button--link-id .oo-ui-labelElement-label .version{white-space:nowrap;font-size:.8em;color:var(--color-placeholder, #72777d)}.instantDiffs-button--fake-watch{position:fixed;top:0;left:0;visibility:hidden}.instantDiffs-label{max-width:100%;display:inline-flex;gap:var(--instantDiffs-gap)}.instantDiffs-label i{flex:none}.instantDiffs-label span{min-width:0;flex:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media (min-width: 960px){.instantDiffs-label--short{display:none}}@media (max-width: 959px){.instantDiffs-label--long{display:none}}.instantDiffs-page{width:auto;max-width:none;display:flow-root;margin:0;padding:0;font-size:var(--instantDiffs-font-size);line-height:var(--instantDiffs-line-height)}.instantDiffs-page-tools{display:flex;justify-content:center}.instantDiffs-page-tools:is(:empty){display:none}.instantDiffs-page-body{display:flow-root;position:relative;z-index:1}.instantDiffs-page-body .cdx-message--block{margin-bottom:1em}.instantDiffs-page-body #mw-fr-diff-headeritems{margin-top:0}.instantDiffs-page-body #mw-fr-revisiontag-old{margin-bottom:1em}.instantDiffs-page-body .mw-diff-table-prefix{min-height:2rem;margin-top:0}.instantDiffs-page-body .mw-diffPage-inlineToggle-container .oo-ui-fieldLayout>.oo-ui-fieldLayout-body>.oo-ui-fieldLayout-field{width:auto}.instantDiffs-page-body table.diff .mw-rollback-link{display:initial}.instantDiffs-page-body table.diff .jquery-confirmable-wrapper{vertical-align:top}.instantDiffs-page-body .mw-parser-output{text-align:initial}.instantDiffs-page-body #toc,.instantDiffs-page-body .mw-diff-mobile-footer{display:none}.instantDiffs-page-body .wikibase-statementgroupview .wikibase-snakview-body{margin-right:0!important}.instantDiffs-page-body .wikibase-statementgroupview .wikibase-statementview-mainsnak{max-width:none!important;margin-right:0!important}.instantDiffs-page-body--foreign .wikibase-statementgroupview .wikibase-initially-collapsed{display:block!important}.instantDiffs-page-body--foreign .wikibase-entitytermsview .wikibase-toolbar-container{position:relative}.instantDiffs-page-mediaInfo .oo-ui-indexLayout-stackLayout>.oo-ui-tabPanelLayout-active{margin:1rem 0 0;padding:0}.oo-ui-windowManager-modal>.instantDiffs-view.oo-ui-window-active{top:var(--instantDiffs-view-top)}.instantDiffs-view .oo-ui-messageDialog-container{scroll-padding-top:var(--instantDiffs-view-scroll-padding-top)}.instantDiffs-view .oo-ui-messageDialog-message{transition:opacity .15s ease-in-out}.instantDiffs-view .oo-ui-messageDialog-message.is-transparent{opacity:0}.oo-ui-windowManager-modal:not(.oo-ui-windowManager-size-full) .instantDiffs-view .instantDiffs-navigation{border-radius:var(--instantDiffs-view-radius) var(--instantDiffs-view-radius) 0 0}.oo-ui-windowManager-modal:not(.oo-ui-windowManager-size-full) .instantDiffs-view .instantDiffs-view-loader{border-top-right-radius:max(var(--instantDiffs-view-radius),.28571429em) .28571429em;border-top-left-radius:max(var(--instantDiffs-view-radius),.28571429em) .28571429em}.instantDiffs-view-overlay{position:absolute;inset:0;z-index:-1}.instantDiffs-view-loader{max-width:none;position:absolute;inset:0 0 auto;z-index:3;border-radius:0;transition:opacity .15s ease-in-out}.instantDiffs-view-loader .oo-ui-progressBarWidget-bar{animation-duration:1s}.instantDiffs-view-loader.is-transparent{opacity:0}.oo-ui-windowManager-modal>.instantDiffs-settings.oo-ui-window-active{top:var(--instantDiffs-view-top)}.instantDiffs-settings-panel--empty,.instantDiffs-settings-panel--finish{min-height:100%;box-sizing:border-box;display:flex;justify-content:center;align-items:center}.instantDiffs-settings-panel--empty[hidden],.instantDiffs-settings-panel--finish[hidden]{display:none}.instantDiffs-settings-panel--empty .instantDiffs-notice-box,.instantDiffs-settings-panel--finish .instantDiffs-notice-box{transform:translateY(-50%)}ul.instantDiffs-list--settings{padding:0;margin-block:0;margin-inline:1.42857143em 0;list-style:disc;font-size:var(--instantDiffs-font-size-hint)}ul.instantDiffs-list--settings li{margin:0}ul.instantDiffs-list--settings i{direction:ltr;unicode-bidi:embed}:root{--instantDiffs-label-diff: "\2756";--instantDiffs-label-revision: "\272a";--instantDiffs-label-placeholder: "\25c7";--instantDiffs-color-link: var(--color-progressive, #36c);--instantDiffs-color-link--hover: var(--color-progressive--hover, #3056a9);--instantDiffs-color-link--active: var(--color-progressive--active, #233566);--instantDiffs-color-link-error: var(--color-error, #bf3c2c);--instantDiffs-color-link-error--hover: var(--color-error--hover, #9f3526);--instantDiffs-color-link-error--active: var(--color-error--active, #612419);--instantDiffs-background-link: var(--background-color-progressive-subtle, #f1f4fd);--instantDiffs-background-link--hover: var(--background-color-interactive-subtle--hover, #eaecf0);--instantDiffs-background-link--active: var(--background-color-interactive-subtle--active, #dadde3);--instantDiffs-background-link-error: var(--background-color-error-subtle, #ffe9e5);--instantDiffs-background-link-error--hover: var(--background-color-error-subtle--hover, #ffdad3);--instantDiffs-background-link-error--active: var(--background-color-error-subtle--active, #ffc8bd);--instantDiffs-background-line: color-mix(in srgb, var(--border-color-progressive, #cfe3ff) 30%, transparent);--instantDiffs-background-navigation: color-mix(in srgb, var(--background-color-base, #ffffff) 70%, transparent);--instantDiffs-border-color: var(--border-color-base, #a2a9b1);--instantDiffs-line-height: var(--line-height-medium, 1.5714285);--instantDiffs-font-size: var(--font-size-medium, .875rem);--instantDiffs-font-size-navigation: var(--font-size-medium, .875rem);--instantDiffs-font-size-hint: .75rem;--instantDiffs-gap: .25rem;--instantDiffs-view-top: 0;--instantDiffs-view-radius: 0;--instantDiffs-view-scroll-padding-top: 0;--instantDiffs-button-radius: var(--border-radius-base, 2px)}.instantDiffs-hidden{display:none!important}.instantDiffs-invisibleIconElement.instantDiffs-invisibleIconElement.oo-ui-buttonElement-framed>.oo-ui-buttonElement-button{padding-inline:12px}.instantDiffs-invisibleIconElement.instantDiffs-invisibleIconElement.oo-ui-buttonElement-frameless>.oo-ui-buttonElement-button{padding-inline:6px}.instantDiffs-invisibleIconElement .oo-ui-iconElement-icon{display:none}.instantDiffs-notice-box{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:1rem;white-space:pre-wrap;text-align:center}.instantDiffs-notice-box img{width:64px;aspect-ratio:1/1;border:none;font-size:0}.instantDiffs-notice-box h5{padding:0;margin:0}.instantDiffs-notice-box--empty img{width:128px}.instantDiffs-notification-label{font-weight:700}li.instantDiffs-line,tr.instantDiffs-line td,table.instantDiffs-line td{transition:background-color 1s ease-in-out}li.instantDiffs-line--highlight,tr.instantDiffs-line--highlight td,table.instantDiffs-line--highlight td{transition-duration:.25s;background-color:var(--instantDiffs-background-line)!important}.instantDiffs-line--seen .mw-title{font-weight:400}.mw-fr-reviewlink .instantDiffs-panel,.mw-changeslist-links .instantDiffs-panel,.mw-changeslist-diff-cur+.instantDiffs-panel,.mw-changeslist-diff+.instantDiffs-panel{margin-inline-end:0}.mw-fr-reviewlink .instantDiffs-link{background:transparent}.instantDiffs-button--compare{font-weight:400}.instantDiffs-button--compare.mw-ui-button{min-width:0}.instantDiffs-enabled .mw-history-compareselectedversions :is(.mw-ui-button,.cdx-button){vertical-align:top}body:not(.skin-minerva) .instantDiffs-line--history .mw-history-histlinks{margin-inline-end:.5em}body:not(.skin-minerva) .instantDiffs-line--history .mw-changeslist-date{margin-inline-start:.5em}@media screen{.skin-monobook{--instantDiffs-border-color: #ccc;--instantDiffs-line-height: 1.5;--instantDiffs-font-size: .794rem;--instantDiffs-font-size-navigation: var(--instantDiffs-font-size);--instantDiffs-button-radius: var(--border-radius-base, 3px)}}.skin-monobook .instantDiffs-view .oo-ui-messageDialog-text{padding:1rem 1rem 1.25rem}.skin-monobook .instantDiffs-navigation{margin-inline:-1rem;margin-bottom:1rem;padding:1rem}@media (max-width: 639px){.skin-monobook .instantDiffs-navigation{padding:.5rem 1rem}}@media (min-width: 640px){.skin-minerva{--instantDiffs-line-height: 1.65;--instantDiffs-font-size: 1rem}}.skin-minerva .instantDiffs-page-body table.diff{margin:0}.skin-minerva .instantDiffs-page-body:is(.mw-heading1,h1,.mw-heading2,h2){font-family:Linux Libertine,Georgia,Times,"Source Serif Pro",serif}.skin-minerva .instantDiffs-page-body .mw-diff-timestamp:is(:empty){display:none}.skin-minerva .instantDiffs-page-body .diff-title .mw-userlink{float:none}.skin-minerva .instantDiffs-page-body .diff-title .mw-userlink:before{display:none}.skin-minerva .instantDiffs-page-body .diff-title .mw-usertoollinks{float:none}@media (max-width: 639px){.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer{height:auto;display:block;margin:-1em -16px 1em;position:relative;inset:auto;border:none;border-bottom:1px solid var(--border-color-subtle, #c8ccd1)}.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-userlink{padding-top:0}.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-rollback-link:last-child,.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-diff-undo:last-child{padding-bottom:0}.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-rollback-link>.cdx-button{margin:0}.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-thanks-thank-link{max-width:100%;margin:0}.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-thanks-thank-link+.jquery-confirmable-interface{width:100%!important}}.skin-minerva .instantDiffs-page-body #mw-fr-diff-headeritems .fr-diff-ratings{margin:0}@media (max-width: 639px){.skin-minerva .instantDiffs-page-body #mw-fr-diff-headeritems .fr-diff-ratings td{width:100%!important;text-align:left!important}.skin-minerva .instantDiffs-page-body #mw-fr-diff-headeritems .fr-diff-ratings td:nth-child(2n-1){display:none}}.skin-minerva .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink:before{display:none!important}.skin-minerva .instantDiffs-line .minoredit{font-size:inherit}.skin-minerva .instantDiffs-line:not(.instantDiffs-line--history) .minoredit{margin-right:.5em;padding:0;background:transparent}.skin-minerva.mw-special-Watchlist .instantDiffs-line .ext-checkuser-userinfocard-button{float:left;clear:left;padding-top:0}.skin-minerva.mw-special-Watchlist .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink{float:left;clear:none;padding-top:0}.skin-minerva.mw-special-Watchlist .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:left;clear:right;padding-top:0}.skin-minerva.mw-special-Watchlist .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button{float:none;clear:both}.skin-minerva.mw-special-Watchlist .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink{float:none;clear:both}.skin-minerva.mw-special-Watchlist .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:none;clear:both}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .mw-userlink:before{width:100%;height:0;min-height:0;margin:0;display:table;content:""}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .mw-usertoollinks{display:inline!important}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .ext-checkuser-userinfocard-button{float:left;clear:left;padding-top:0}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink{float:left;clear:none;padding-top:0}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:left;clear:right;padding-top:0}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button{float:none;clear:both}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink{float:none;clear:both}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:none;clear:both}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-userlink:before{width:100%;height:0;min-height:0;margin:0;display:table;content:""}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-userlink:before{width:0;min-width:0}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-usertoollinks{display:inline!important}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .ext-checkuser-userinfocard-button{float:left;clear:left;padding-top:0}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink{float:left;clear:none;padding-top:0}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:left;clear:right;padding-top:0}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button{float:none;clear:both}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink{float:none;clear:both}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:none;clear:both}.skin-minerva:not(.mw-mf-amc-disabled) .instantDiffs-line .mw-userlink:before{width:100%;height:0;min-height:0;margin:0;display:table;content:""}.skin-minerva:not(.mw-mf-amc-disabled) .instantDiffs-line .mw-usertoollinks{display:inline!important}.skin-minerva:not(.mw-mf-amc-disabled) .instantDiffs-line .mw-changeslist-date{display:inline}.skin-minerva:not(.mw-mf-amc-disabled) .instantDiffs-line--history .mw-userlink:before{width:0;min-width:0}.skin-minerva.mw-mf-amc-disabled .instantDiffs-line a:is(.mw-history-histlinks-previous,.mw-changeslist-diff){position:relative;font-size:.85rem;color:var(--color-progressive, #36c)!important}.skin-minerva.mw-mf-amc-disabled .instantDiffs-line .instantDiffs-panel{display:inline-block;position:relative;z-index:10}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions{margin:0;display:flex!important;flex-wrap:wrap;align-items:flex-start;gap:10px;flex:auto;padding:10px 0}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions .mw-history-revisionactions{margin:0;display:flex!important;flex-wrap:wrap;align-items:flex-start;gap:10px;flex:auto}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions :is(.mw-ui-button,.cdx-button){max-width:none;flex:auto;margin:0}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions .mw-history-compareselectedversions-button{width:auto;flex:auto}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions .instantDiffs-button--compare{flex:none}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions .instantDiffs-spacer,.skin-minerva.mw-mf-amc-disabled .mw-history-compareselectedversions .instantDiffs-button--compare{display:none}.skin-minerva.mw-special-Newpages.instantDiffs-enabled .instantDiffs-line .mw-changeslist-date{display:inline}.skin-minerva.mw-special-Newpages.instantDiffs-enabled .instantDiffs-line .mw-changeslist-time{display:none}.skin-minerva.mw-special-Newpages.instantDiffs-enabled .instantDiffs-line .ext-checkuser-userinfocard-button{float:left}.skin-minerva.mw-special-Newpages.instantDiffs-enabled .instantDiffs-line .mw-userlink:before{display:none}.skin-minerva.mw-special-Newpages.instantDiffs-enabled .instantDiffs-page-body :is(.comment,.mw-userlink,.mw-usertoollinks){float:none;display:inline}.skin-minerva.instantDiffs-enabled .mw-diff-revision-history-links a{flex:none}.skin-minerva.instantDiffs-enabled .mw-diff-revision-history-link-previous+.instantDiffs-panel{margin-inline-end:auto}.skin-minerva.instantDiffs-enabled .instantDiffs-panel:has(+.mw-diff-revision-history-link-next){margin-inline-start:auto}@media screen{.skin-vector-legacy.theme-dark-grey{--instantDiffs-color-link: var(--link, #e6820f);--instantDiffs-color-link--hover: var(--link-vis, #b95500);--instantDiffs-color-link--active: var(--link-vis, #b95500);--instantDiffs-background-link: var(--btn-bg, #2d2d2d);--instantDiffs-background-link--hover: var(--btn-bg, #2d2d2d);--instantDiffs-background-link--active: var(--btn-bg, #2d2d2d);--instantDiffs-background-navigation: color-mix(in srgb, var(--bg-main, #232323) 70%, transparent)}}@media screen{.skin-citizen{--instantDiffs-color-link: var(--color-link);--instantDiffs-color-link--hover: var(--color-link--hover);--instantDiffs-color-link--active: var(--color-link--active);--instantDiffs-background-navigation: color-mix(in srgb, var(--color-surface-1, #ffffff) 70%, transparent);--instantDiffs-font-size: var(--font-size-medium, 1rem);--instantDiffs-font-size-navigation: var(--font-size-small, .875rem);--instantDiffs-line-height: var(--line-height, 1.6);--instantDiffs-view-radius: var(--border-radius-medium)}}.skin-citizen .instantDiffs-view .oo-ui-messageDialog-title{font-size:var(--font-size-large);line-height:var(--line-height-large);font-weight:var(--font-weight-semi-bold)}.skin-citizen #citizen-lastmod-relative.instantDiffs-link.is-insertBefore:before{margin-right:auto}.skin-citizen #citizen-lastmod-relative.instantDiffs-link.is-insertAfter:after{margin-left:auto}@media screen{.skin-fandomdesktop{--instantDiffs-background-navigation: color-mix(in srgb, var(--theme-page-background-color--secondary, #ffffff) 70%, transparent);--instantDiffs-border-color: var(--theme-border-color, #4f4f51);--instantDiffs-line-height: 1.75;--instantDiffs-font-size: 1rem;--instantDiffs-view-top: 45px}}.skin-fandomdesktop .instantDiffs-navigation{margin-inline:-24px}@media (min-width: 640px){.skin-fandomdesktop .instantDiffs-navigation{padding-inline:24px}}.skin-fandomdesktop .instantDiffs-buttons-group--vertical hr{border-color:var(--instantDiffs-border-color)}.skin-fandomdesktop .instantDiffs-view-loader{border:none}.skin-fandomdesktop .instantDiffs-view-loader .oo-ui-progressBarWidget-bar{height:.28571429em}@media screen{.skin-fandommobile{--instantDiffs-background-navigation: color-mix(in srgb, var(--theme-page-background-color--secondary, #ffffff) 70%, transparent);--instantDiffs-border-color: var(--theme-border-color, #4f4f51);--instantDiffs-line-height: 1.75;--instantDiffs-font-size: 1rem;--instantDiffs-view-top: 55px}}.skin-fandommobile .instantDiffs-navigation{margin-inline:-24px}@media (min-width: 640px){.skin-fandommobile .instantDiffs-navigation{padding-inline:24px}}.skin-fandommobile .instantDiffs-buttons-group--vertical hr{border-color:var(--instantDiffs-border-color)}.skin-fandommobile .instantDiffs-view-loader{border:none}.skin-fandommobile .instantDiffs-view-loader .oo-ui-progressBarWidget-bar{height:.28571429em}@media screen{.skin-overclocked{--instantDiffs-font-size: 1.3rem;--instantDiffs-font-size-navigation: var(--instantDiffs-font-size);--instantDiffs-font-size-hint: 1.2rem;--instantDiffs-view-top: 45px}}.skin-overclocked .mw-history-compareselectedversions{margin-top:10px;margin-bottom:10px}.skin-overclocked .mw-history-compareselectedversions-button{margin-top:0;margin-bottom:0}.skin-overclocked .instantDiffs-button--compare{padding:8px 12px}.skin-overclocked .instantDiffs-view-loader{border:none;box-shadow:none}.skin-overclocked .instantDiffs-view-loader .oo-ui-progressBarWidget-bar{height:.28571429em} /* </nowiki> */ qks99c5a7ct0lrm46yagshustgwal3k 8365095 8365079 2026-05-04T10:10:06Z Serhio Magpie 1775170 [e81b54d] [v5.4.0+build.4]: Updated from repository. 8365095 css text/css /** * Instant Diffs * * Version: 5.4.0+build.4 * Author: Serhio Magpie * Licenses: (MIT OR CC-BY-SA-4.0) * Documentation: https://www.mediawiki.org/wiki/Instant_Diffs * * For license information please see: https://www.mediawiki.org/wiki/User:Serhio_Magpie/instantDiffs.js.LEGAL.txt */ /* <nowiki> */ .instantDiffs-link{padding-inline:var(--instantDiffs-gap);-webkit-box-decoration-break:clone;box-decoration-break:clone;background:var(--instantDiffs-background-link);color:var(--instantDiffs-color-link);text-decoration:none}.instantDiffs-link:where(:not(.cdx-button)){border-radius:1em}.instantDiffs-link:before{margin-inline-end:var(--instantDiffs-gap)}.instantDiffs-link:after{margin-inline-start:var(--instantDiffs-gap)}.instantDiffs-link.is-insertBefore:before{content:var(--instantDiffs-label)}.instantDiffs-link.is-insertAfter:after{content:var(--instantDiffs-label)}.instantDiffs-link.is-insertAfter[rel~="mw:ExtLink"]:empty:after{margin-inline:0;content:"[" counter(mw-numbered-ext-link) "] " var(--instantDiffs-label);counter-increment:mw-numbered-ext-link}.instantDiffs-link:is(:hover,:focus-visible){background:var(--instantDiffs-background-link--hover);color:var(--instantDiffs-color-link--hover);text-decoration:none}.instantDiffs-link:is(:active,:focus){background:var(--instantDiffs-background-link--active);color:var(--instantDiffs-color-link--active);text-decoration:none}.instantDiffs-link--diff{--instantDiffs-label: var(--instantDiffs-label-diff)}.instantDiffs-link--revision{--instantDiffs-label: var(--instantDiffs-label-revision)}.instantDiffs-link--error{background:var(--instantDiffs-background-link-error);color:var(--instantDiffs-color-link-error)}.instantDiffs-link--error:is(:hover,:focus-visible){background:var(--instantDiffs-background-link-error--hover);color:var(--instantDiffs-color-link-error--hover)}.instantDiffs-link--error:is(:active,:focus){background:var(--instantDiffs-background-link-error--active);color:var(--instantDiffs-color-link-error--active)}.instantDiffs-link--pending{cursor:wait!important}.instantDiffs-panel{margin-inline:var(--instantDiffs-gap);font-weight:400;font-style:normal;color:#72777d;user-select:none}.instantDiffs-panel:is(:empty){display:none!important}span.instantDiffs-panel{display:inline}.instantDiffs-panel a{cursor:pointer;color:inherit}.instantDiffs-panel .item:not(:last-child){margin-inline-end:var(--instantDiffs-gap)}.instantDiffs-panel .error{font-size:inherit}.instantDiffs-panel .error-info{cursor:help}.cdx-dialog__footer__actions .instantDiffs-panel{align-self:center}.instantDiffs-panel-placeholder{padding-inline:var(--instantDiffs-gap)}.instantDiffs-panel-placeholder:after{margin-inline-start:var(--instantDiffs-gap);color:var(--color-placeholder, #72777d);content:var(--instantDiffs-label-placeholder)}.instantDiffs-panel-placeholder.has-link{padding:0}.instantDiffs-panel-placeholder--diff:after{content:var(--instantDiffs-label-diff)}.instantDiffs-panel-placeholder--revision:after{content:var(--instantDiffs-label-revision)}.instantDiffs-panel-placeholder--loader:after{color:var(--color-disabled, #a2a9b1);animation:instantDiffs-blink 1s infinite alternate}@keyframes instantDiffs-blink{0%{opacity:0}to{opacity:1}}.instantDiffs-navigation{margin:0 -16px 1em;padding:1em 16px;display:flex;gap:.5em;position:sticky;z-index:2;top:0;border-bottom:1px solid var(--instantDiffs-border-color);background:var(--instantDiffs-background-navigation);background-clip:padding-box;-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);font-size:var(--instantDiffs-font-size-navigation)}@media (max-width: 639px){.instantDiffs-navigation{padding:.5em}}.instantDiffs-navigation-group{display:flex;gap:var(--instantDiffs-gap)}.instantDiffs-navigation-group--left{justify-content:flex-start;flex:1}@media (max-width: 639px){.instantDiffs-navigation-group--left .instantDiffs-button--pending,.instantDiffs-navigation-group--left .instantDiffs-button--back{display:none}}.instantDiffs-navigation-group--center{min-width:0;justify-content:center;flex:0 1 auto}.instantDiffs-navigation-group--center .oo-ui-buttonElement{min-width:0;flex:auto}.instantDiffs-navigation-group--center .oo-ui-buttonElement-button{display:block;overflow:hidden;text-overflow:ellipsis}@media (max-width: 639px){.instantDiffs-navigation-group--center{flex:auto}.instantDiffs-navigation-group--center .instantDiffs-button--switch{display:none}}.instantDiffs-navigation-group--right{justify-content:flex-end;flex:1}@media (max-width: 959px){.instantDiffs-navigation-group--right .instantDiffs-button--pin{display:none}}.instantDiffs-buttons-group{min-width:0;margin:0;display:flex}.instantDiffs-buttons-group:is(:empty){display:none}.instantDiffs-buttons-group--vertical{padding:0;flex-direction:column}.instantDiffs-buttons-group--vertical:is(:empty)+hr{display:none}.instantDiffs-buttons-group--vertical.has-icons{gap:var(--instantDiffs-gap)}@media (max-width: 959px){.instantDiffs-buttons-group--pins-custom{display:none}}@media (min-width: 640px){.instantDiffs-buttons-group--mobile.instantDiffs-buttons-group--mobile{display:none}.instantDiffs-buttons-group--mobile+hr{display:none}}.instantDiffs-buttons-separator{margin:0;flex:none;background-color:var(--instantDiffs-border-color)}.instantDiffs-buttons-popup .oo-ui-popupWidget-popup{padding:0}.instantDiffs-buttons-popup .oo-ui-popupWidget-body{display:flex;flex-direction:column}.instantDiffs-buttons-popup.has-icons .oo-ui-popupWidget-body{padding:var(--instantDiffs-gap);gap:var(--instantDiffs-gap)}.instantDiffs-button--link{display:block}.instantDiffs-button--link>.oo-ui-buttonElement-button{display:block}.instantDiffs-button--link.oo-ui-buttonElement-frameless.instantDiffs-button--link.oo-ui-buttonElement-frameless:first-child{margin:0}.instantDiffs-button--link.oo-ui-buttonElement-frameless>.oo-ui-buttonElement-button{margin:0;border-radius:var(--instantDiffs-button-radius)}.instantDiffs-button--link.oo-ui-widget-enabled>.oo-ui-buttonElement-button:is(:hover,:focus){background-color:var(--background-color-interactive, #eaecf0);color:var(--color-progressive--hover, var(--instantDiffs-color-link--hover))}.instantDiffs-button--link.oo-ui-widget-enabled>.oo-ui-buttonElement-button:active{border-color:var(--border-color-progressive--active, #2a4b8d);background-color:var(--background-color-progressive-subtle, #eaf3ff);color:var(--color-progressive--active, var(--instantDiffs-color-link--active))}.instantDiffs-button--link-id .oo-ui-labelElement-label{white-space:wrap}.instantDiffs-button--link-id .oo-ui-labelElement-label .name{white-space:nowrap}.instantDiffs-button--link-id .oo-ui-labelElement-label .version{white-space:nowrap;font-size:.8em;color:var(--color-placeholder, #72777d)}.instantDiffs-button--fake-watch{position:fixed;top:0;left:0;visibility:hidden}.instantDiffs-label{max-width:100%;display:inline-flex;gap:var(--instantDiffs-gap)}.instantDiffs-label i{flex:none}.instantDiffs-label span{min-width:0;flex:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media (min-width: 960px){.instantDiffs-label--short{display:none}}@media (max-width: 959px){.instantDiffs-label--long{display:none}}.instantDiffs-page{width:auto;max-width:none;display:flow-root;margin:0;padding:0;font-size:var(--instantDiffs-font-size);line-height:var(--instantDiffs-line-height)}.instantDiffs-page-tools{display:flex;justify-content:center}.instantDiffs-page-tools:is(:empty){display:none}.instantDiffs-page-body{display:flow-root;position:relative;z-index:1}.instantDiffs-page-body .cdx-message--block{margin-bottom:1em}.instantDiffs-page-body #mw-fr-diff-headeritems{margin-top:0}.instantDiffs-page-body #mw-fr-revisiontag-old{margin-bottom:1em}.instantDiffs-page-body .mw-diff-table-prefix{min-height:2rem;margin-top:0}.instantDiffs-page-body .mw-diffPage-inlineToggle-container .oo-ui-fieldLayout>.oo-ui-fieldLayout-body>.oo-ui-fieldLayout-field{width:auto}.instantDiffs-page-body table.diff .mw-rollback-link{display:initial}.instantDiffs-page-body table.diff .jquery-confirmable-wrapper{vertical-align:top}.instantDiffs-page-body .mw-parser-output{text-align:initial}.instantDiffs-page-body #toc,.instantDiffs-page-body .mw-diff-mobile-footer{display:none}.instantDiffs-page-body .wikibase-statementgroupview .wikibase-snakview-body{margin-right:0!important}.instantDiffs-page-body .wikibase-statementgroupview .wikibase-statementview-mainsnak{max-width:none!important;margin-right:0!important}.instantDiffs-page-body--foreign .wikibase-statementgroupview .wikibase-initially-collapsed{display:block!important}.instantDiffs-page-body--foreign .wikibase-entitytermsview .wikibase-toolbar-container{position:relative}.instantDiffs-page-mediaInfo .oo-ui-indexLayout-stackLayout>.oo-ui-tabPanelLayout-active{margin:1rem 0 0;padding:0}.oo-ui-windowManager-modal>.instantDiffs-view.oo-ui-window-active{top:var(--instantDiffs-view-top)}.instantDiffs-view .oo-ui-messageDialog-container{scroll-padding-top:var(--instantDiffs-view-scroll-padding-top)}.instantDiffs-view .oo-ui-messageDialog-message{transition:opacity .15s ease-in-out}.instantDiffs-view .oo-ui-messageDialog-message.is-transparent{opacity:0}.oo-ui-windowManager-modal:not(.oo-ui-windowManager-size-full) .instantDiffs-view .instantDiffs-navigation{border-radius:var(--instantDiffs-view-radius) var(--instantDiffs-view-radius) 0 0}.oo-ui-windowManager-modal:not(.oo-ui-windowManager-size-full) .instantDiffs-view .instantDiffs-view-loader{border-top-right-radius:max(var(--instantDiffs-view-radius),.28571429em) .28571429em;border-top-left-radius:max(var(--instantDiffs-view-radius),.28571429em) .28571429em}.instantDiffs-view-overlay{position:absolute;inset:0;z-index:-1}.instantDiffs-view-loader{max-width:none;position:absolute;inset:0 0 auto;z-index:3;border-radius:0;transition:opacity .15s ease-in-out}.instantDiffs-view-loader .oo-ui-progressBarWidget-bar{animation-duration:1s}.instantDiffs-view-loader.is-transparent{opacity:0}.oo-ui-windowManager-modal>.instantDiffs-settings.oo-ui-window-active{top:var(--instantDiffs-view-top)}.instantDiffs-settings-panel--empty,.instantDiffs-settings-panel--finish{min-height:100%;box-sizing:border-box;display:flex;justify-content:center;align-items:center}.instantDiffs-settings-panel--empty[hidden],.instantDiffs-settings-panel--finish[hidden]{display:none}.instantDiffs-settings-panel--empty .instantDiffs-notice-box,.instantDiffs-settings-panel--finish .instantDiffs-notice-box{transform:translateY(-50%)}ul.instantDiffs-list--settings{padding:0;margin-block:0;margin-inline:1.42857143em 0;list-style:disc;font-size:var(--instantDiffs-font-size-hint)}ul.instantDiffs-list--settings li{margin:0}ul.instantDiffs-list--settings i{direction:ltr;unicode-bidi:embed}:root{--instantDiffs-label-diff: "\2756";--instantDiffs-label-revision: "\272a";--instantDiffs-label-placeholder: "\25c7";--instantDiffs-color-link: var(--color-progressive, #36c);--instantDiffs-color-link--hover: var(--color-progressive--hover, #3056a9);--instantDiffs-color-link--active: var(--color-progressive--active, #233566);--instantDiffs-color-link-error: var(--color-error, #bf3c2c);--instantDiffs-color-link-error--hover: var(--color-error--hover, #9f3526);--instantDiffs-color-link-error--active: var(--color-error--active, #612419);--instantDiffs-background-link: var(--background-color-progressive-subtle, #f1f4fd);--instantDiffs-background-link--hover: var(--background-color-interactive-subtle--hover, #eaecf0);--instantDiffs-background-link--active: var(--background-color-interactive-subtle--active, #dadde3);--instantDiffs-background-link-error: var(--background-color-error-subtle, #ffe9e5);--instantDiffs-background-link-error--hover: var(--background-color-error-subtle--hover, #ffdad3);--instantDiffs-background-link-error--active: var(--background-color-error-subtle--active, #ffc8bd);--instantDiffs-background-line: color-mix(in srgb, var(--border-color-progressive, #cfe3ff) 30%, transparent);--instantDiffs-background-navigation: color-mix(in srgb, var(--background-color-base, #ffffff) 70%, transparent);--instantDiffs-border-color: var(--border-color-base, #a2a9b1);--instantDiffs-line-height: var(--line-height-medium, 1.5714285);--instantDiffs-font-size: var(--font-size-medium, .875rem);--instantDiffs-font-size-navigation: var(--font-size-medium, .875rem);--instantDiffs-font-size-hint: .75rem;--instantDiffs-gap: .25rem;--instantDiffs-view-top: 0;--instantDiffs-view-radius: 0;--instantDiffs-view-scroll-padding-top: 0;--instantDiffs-button-radius: var(--border-radius-base, 2px)}.instantDiffs-hidden{display:none!important}.instantDiffs-invisibleIconElement.instantDiffs-invisibleIconElement.oo-ui-buttonElement-framed>.oo-ui-buttonElement-button{padding-inline:12px}.instantDiffs-invisibleIconElement.instantDiffs-invisibleIconElement.oo-ui-buttonElement-frameless>.oo-ui-buttonElement-button{padding-inline:6px}.instantDiffs-invisibleIconElement .oo-ui-iconElement-icon{display:none}.instantDiffs-notice-box{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:1rem;white-space:pre-wrap;text-align:center}.instantDiffs-notice-box img{width:64px;aspect-ratio:1/1;border:none;font-size:0}.instantDiffs-notice-box h5{padding:0;margin:0}.instantDiffs-notice-box--empty img{width:128px}.instantDiffs-notification-label{font-weight:700}li.instantDiffs-line,tr.instantDiffs-line td,table.instantDiffs-line td{transition:background-color 1s ease-in-out}li.instantDiffs-line--highlight,tr.instantDiffs-line--highlight td,table.instantDiffs-line--highlight td{transition-duration:.25s;background-color:var(--instantDiffs-background-line)!important}.instantDiffs-line--seen .mw-title{font-weight:400}.mw-fr-reviewlink .instantDiffs-panel,.mw-changeslist-links .instantDiffs-panel,.mw-changeslist-diff-cur+.instantDiffs-panel,.mw-changeslist-diff+.instantDiffs-panel{margin-inline-end:0}.mw-fr-reviewlink .instantDiffs-link{background:transparent}.instantDiffs-button--compare{font-weight:400}.instantDiffs-button--compare.mw-ui-button{min-width:0}.instantDiffs-enabled .mw-history-compareselectedversions :is(.mw-ui-button,.cdx-button){vertical-align:top}body:not(.skin-minerva) .instantDiffs-line--history .mw-history-histlinks{margin-inline-end:.5em}body:not(.skin-minerva) .instantDiffs-line--history .mw-changeslist-date{margin-inline-start:.5em}@media screen{.skin-monobook{--instantDiffs-border-color: #ccc;--instantDiffs-line-height: 1.5;--instantDiffs-font-size: .794rem;--instantDiffs-font-size-navigation: var(--instantDiffs-font-size);--instantDiffs-button-radius: var(--border-radius-base, 3px)}}.skin-monobook .instantDiffs-view .oo-ui-messageDialog-text{padding:1rem 1rem 1.25rem}.skin-monobook .instantDiffs-navigation{margin-inline:-1rem;margin-bottom:1rem;padding:1rem}@media (max-width: 639px){.skin-monobook .instantDiffs-navigation{padding:.5rem 1rem}}@media (min-width: 640px){.skin-minerva{--instantDiffs-line-height: 1.65;--instantDiffs-font-size: 1rem}}.skin-minerva .instantDiffs-page-body table.diff{margin:0}.skin-minerva .instantDiffs-page-body:is(.mw-heading1,h1,.mw-heading2,h2){font-family:Linux Libertine,Georgia,Times,"Source Serif Pro",serif}.skin-minerva .instantDiffs-page-body .mw-diff-timestamp:is(:empty){display:none}.skin-minerva .instantDiffs-page-body .diff-title .mw-userlink{float:none}.skin-minerva .instantDiffs-page-body .diff-title .mw-userlink:before{display:none}.skin-minerva .instantDiffs-page-body .diff-title .mw-usertoollinks{float:none}@media (max-width: 639px){.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer{height:auto;display:block;margin:1em -16px -16px;position:sticky;inset:auto auto 0}.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-userlink{padding-top:0}.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-rollback-link:last-child,.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-diff-undo:last-child{padding-bottom:0}.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-rollback-link>.cdx-button{margin:0}.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-thanks-thank-link{max-width:100%;margin:0}.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-thanks-thank-link+.jquery-confirmable-interface{width:100%!important}}.skin-minerva .instantDiffs-page-body #mw-fr-diff-headeritems .fr-diff-ratings{margin:0}@media (max-width: 639px){.skin-minerva .instantDiffs-page-body #mw-fr-diff-headeritems .fr-diff-ratings td{width:100%!important;text-align:left!important}.skin-minerva .instantDiffs-page-body #mw-fr-diff-headeritems .fr-diff-ratings td:nth-child(2n-1){display:none}}.skin-minerva .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink:before{display:none!important}.skin-minerva .instantDiffs-line .minoredit{font-size:inherit}.skin-minerva .instantDiffs-line:not(.instantDiffs-line--history) .minoredit{margin-right:.5em;padding:0;background:transparent}.skin-minerva.mw-special-Watchlist .instantDiffs-line .ext-checkuser-userinfocard-button{float:left;clear:left;padding-top:0}.skin-minerva.mw-special-Watchlist .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink{float:left;clear:none;padding-top:0}.skin-minerva.mw-special-Watchlist .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:left;clear:right;padding-top:0}.skin-minerva.mw-special-Watchlist .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button{float:none;clear:both}.skin-minerva.mw-special-Watchlist .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink{float:none;clear:both}.skin-minerva.mw-special-Watchlist .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:none;clear:both}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .mw-userlink:before{width:100%;height:0;min-height:0;margin:0;display:table;content:""}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .mw-usertoollinks{display:inline!important}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .ext-checkuser-userinfocard-button{float:left;clear:left;padding-top:0}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink{float:left;clear:none;padding-top:0}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:left;clear:right;padding-top:0}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button{float:none;clear:both}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink{float:none;clear:both}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:none;clear:both}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-userlink:before{width:100%;height:0;min-height:0;margin:0;display:table;content:""}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-userlink:before{width:0;min-width:0}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-usertoollinks{display:inline!important}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .ext-checkuser-userinfocard-button{float:left;clear:left;padding-top:0}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink{float:left;clear:none;padding-top:0}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:left;clear:right;padding-top:0}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button{float:none;clear:both}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink{float:none;clear:both}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:none;clear:both}.skin-minerva:not(.mw-mf-amc-disabled) .instantDiffs-line .mw-userlink:before{width:100%;height:0;min-height:0;margin:0;display:table;content:""}.skin-minerva:not(.mw-mf-amc-disabled) .instantDiffs-line .mw-usertoollinks{display:inline!important}.skin-minerva:not(.mw-mf-amc-disabled) .instantDiffs-line .mw-changeslist-date{display:inline}.skin-minerva:not(.mw-mf-amc-disabled) .instantDiffs-line--history .mw-userlink:before{width:0;min-width:0}.skin-minerva.mw-mf-amc-disabled .instantDiffs-line a:is(.mw-history-histlinks-previous,.mw-changeslist-diff){position:relative;font-size:.85rem;color:var(--color-progressive, #36c)!important}.skin-minerva.mw-mf-amc-disabled .instantDiffs-line .instantDiffs-panel{display:inline-block;position:relative;z-index:10}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions{margin:0;display:flex!important;flex-wrap:wrap;align-items:flex-start;gap:10px;flex:auto;padding:10px 0}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions .mw-history-revisionactions{margin:0;display:flex!important;flex-wrap:wrap;align-items:flex-start;gap:10px;flex:auto}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions :is(.mw-ui-button,.cdx-button){max-width:none;flex:auto;margin:0}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions .mw-history-compareselectedversions-button{width:auto;flex:auto}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions .instantDiffs-button--compare{flex:none}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions .instantDiffs-spacer,.skin-minerva.mw-mf-amc-disabled .mw-history-compareselectedversions .instantDiffs-button--compare{display:none}.skin-minerva.mw-special-Newpages.instantDiffs-enabled .instantDiffs-line .mw-changeslist-date{display:inline}.skin-minerva.mw-special-Newpages.instantDiffs-enabled .instantDiffs-line .mw-changeslist-time{display:none}.skin-minerva.mw-special-Newpages.instantDiffs-enabled .instantDiffs-line .ext-checkuser-userinfocard-button{float:left}.skin-minerva.mw-special-Newpages.instantDiffs-enabled .instantDiffs-line .mw-userlink:before{display:none}.skin-minerva.mw-special-Newpages.instantDiffs-enabled .instantDiffs-page-body :is(.comment,.mw-userlink,.mw-usertoollinks){float:none;display:inline}.skin-minerva.instantDiffs-enabled .mw-diff-revision-history-links a{flex:none}.skin-minerva.instantDiffs-enabled .mw-diff-revision-history-link-previous+.instantDiffs-panel{margin-inline-end:auto}.skin-minerva.instantDiffs-enabled .instantDiffs-panel:has(+.mw-diff-revision-history-link-next){margin-inline-start:auto}@media screen{.skin-vector-legacy.theme-dark-grey{--instantDiffs-color-link: var(--link, #e6820f);--instantDiffs-color-link--hover: var(--link-vis, #b95500);--instantDiffs-color-link--active: var(--link-vis, #b95500);--instantDiffs-background-link: var(--btn-bg, #2d2d2d);--instantDiffs-background-link--hover: var(--btn-bg, #2d2d2d);--instantDiffs-background-link--active: var(--btn-bg, #2d2d2d);--instantDiffs-background-navigation: color-mix(in srgb, var(--bg-main, #232323) 70%, transparent)}}@media screen{.skin-citizen{--instantDiffs-color-link: var(--color-link);--instantDiffs-color-link--hover: var(--color-link--hover);--instantDiffs-color-link--active: var(--color-link--active);--instantDiffs-background-navigation: color-mix(in srgb, var(--color-surface-1, #ffffff) 70%, transparent);--instantDiffs-font-size: var(--font-size-medium, 1rem);--instantDiffs-font-size-navigation: var(--font-size-small, .875rem);--instantDiffs-line-height: var(--line-height, 1.6);--instantDiffs-view-radius: var(--border-radius-medium)}}.skin-citizen .instantDiffs-view .oo-ui-messageDialog-title{font-size:var(--font-size-large);line-height:var(--line-height-large);font-weight:var(--font-weight-semi-bold)}.skin-citizen #citizen-lastmod-relative.instantDiffs-link.is-insertBefore:before{margin-right:auto}.skin-citizen #citizen-lastmod-relative.instantDiffs-link.is-insertAfter:after{margin-left:auto}@media screen{.skin-fandomdesktop{--instantDiffs-background-navigation: color-mix(in srgb, var(--theme-page-background-color--secondary, #ffffff) 70%, transparent);--instantDiffs-border-color: var(--theme-border-color, #4f4f51);--instantDiffs-line-height: 1.75;--instantDiffs-font-size: 1rem;--instantDiffs-view-top: 45px}}.skin-fandomdesktop .instantDiffs-navigation{margin-inline:-24px}@media (min-width: 640px){.skin-fandomdesktop .instantDiffs-navigation{padding-inline:24px}}.skin-fandomdesktop .instantDiffs-buttons-group--vertical hr{border-color:var(--instantDiffs-border-color)}.skin-fandomdesktop .instantDiffs-view-loader{border:none}.skin-fandomdesktop .instantDiffs-view-loader .oo-ui-progressBarWidget-bar{height:.28571429em}@media screen{.skin-fandommobile{--instantDiffs-background-navigation: color-mix(in srgb, var(--theme-page-background-color--secondary, #ffffff) 70%, transparent);--instantDiffs-border-color: var(--theme-border-color, #4f4f51);--instantDiffs-line-height: 1.75;--instantDiffs-font-size: 1rem;--instantDiffs-view-top: 55px}}.skin-fandommobile .instantDiffs-navigation{margin-inline:-24px}@media (min-width: 640px){.skin-fandommobile .instantDiffs-navigation{padding-inline:24px}}.skin-fandommobile .instantDiffs-buttons-group--vertical hr{border-color:var(--instantDiffs-border-color)}.skin-fandommobile .instantDiffs-view-loader{border:none}.skin-fandommobile .instantDiffs-view-loader .oo-ui-progressBarWidget-bar{height:.28571429em}@media screen{.skin-overclocked{--instantDiffs-font-size: 1.3rem;--instantDiffs-font-size-navigation: var(--instantDiffs-font-size);--instantDiffs-font-size-hint: 1.2rem;--instantDiffs-view-top: 45px}}.skin-overclocked .mw-history-compareselectedversions{margin-top:10px;margin-bottom:10px}.skin-overclocked .mw-history-compareselectedversions-button{margin-top:0;margin-bottom:0}.skin-overclocked .instantDiffs-button--compare{padding:8px 12px}.skin-overclocked .instantDiffs-view-loader{border:none;box-shadow:none}.skin-overclocked .instantDiffs-view-loader .oo-ui-progressBarWidget-bar{height:.28571429em} /* </nowiki> */ h114dnnr890qhtbonluugwa3rs0c9sr User:Serhio Magpie/instantDiffs.js 2 2203101 8365098 8363216 2026-05-04T10:15:03Z Serhio Magpie 1775170 [e81b54d] [v5.4.0]: Updated from repository. 8365098 javascript text/javascript /** * Instant Diffs * * Version: 5.4.0 * Author: Serhio Magpie * Licenses: (MIT OR CC-BY-SA-4.0) * Documentation: https://www.mediawiki.org/wiki/Instant_Diffs * * For license information please see: https://www.mediawiki.org/wiki/User:Serhio_Magpie/instantDiffs.js.LEGAL.txt */ /* <nowiki> */ (()=>{var Vn=Object.create;var Ye=Object.defineProperty;var jn=Object.getOwnPropertyDescriptor;var qn=Object.getOwnPropertyNames;var Bn=Object.getPrototypeOf,Un=Object.prototype.hasOwnProperty;var ms=i=>e=>{var t=i[e];if(t)return t();throw new Error("Module not found in bundle: "+e)};var m=(i,e)=>()=>(i&&(e=i(i=0)),e);var re=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),_=(i,e)=>{for(var t in e)Ye(i,t,{get:e[t],enumerable:!0})},ws=(i,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qn(e))!Un.call(i,n)&&n!==t&&Ye(i,n,{get:()=>e[n],enumerable:!(s=jn(e,n))||s.enumerable});return i};var Hn=(i,e,t)=>(t=i!=null?Vn(Bn(i)):{},ws(e||!i||!i.__esModule?Ye(t,"default",{value:i,enumerable:!0}):t,i)),De=i=>ws(Ye({},"__esModule",{value:!0}),i);var _n,o,P=m(()=>{self.instantDiffs||={};_n=self.instantDiffs,o=_n});var ys=re((sr,ks)=>{ks.exports=function(e){var t=String.prototype.split,s=/()??/.exec("")[1]===e,n;return n=function(r,u,p){if(Object.prototype.toString.call(u)!=="[object RegExp]")return t.call(r,u,p);var f=[],g=(u.ignoreCase?"i":"")+(u.multiline?"m":"")+(u.extended?"x":"")+(u.sticky?"y":""),S=0,u=new RegExp(u.source,g+"g"),v,D,oe,gs;for(r+="",s||(v=new RegExp("^"+u.source+"$(?!\\s)",g)),p=p===e?-1>>>0:p>>>0;(D=u.exec(r))&&(oe=D.index+D[0].length,!(oe>S&&(f.push(r.slice(S,D.index)),!s&&D.length>1&&D[0].replace(v,function(){for(var Je=1;Je<arguments.length-2;Je++)arguments[Je]===e&&(D[Je]=e)}),D.length>1&&D.index<r.length&&Array.prototype.push.apply(f,D.slice(1)),gs=D[0].length,S=oe,f.length>=p)));)u.lastIndex===D.index&&u.lastIndex++;return S===r.length?(gs||!u.test(""))&&f.push(""):f.push(r.slice(S)),f.length>p?f.slice(0,p):f},n}()});var Ds=re((nr,xs)=>{var Gn=[].indexOf;xs.exports=function(i,e){if(Gn)return i.indexOf(e);for(var t=0;t<i.length;++t)if(i[t]===e)return t;return-1}});var jt=re((or,Ls)=>{var Vt=Ds();Ls.exports=zn;function zn(i){var e=i.classList;if(e)return e;var t={add:s,remove:n,contains:r,toggle:c,toString:p,length:0,item:f};return t;function s(u){var v=g();Vt(v,u)>-1||(v.push(u),S(v))}function n(u){var v=g(),D=Vt(v,u);D!==-1&&(v.splice(D,1),S(v))}function r(u){return Vt(g(),u)>-1}function c(u){return r(u)?(n(u),!1):(s(u),!0)}function p(){return i.className}function f(u){var v=g();return v[u]||null}function g(){var u=i.className;return Kn(u.split(" "),Qn)}function S(u){var v=u.length;i.className=u.join(" "),t.length=v;for(var D=0;D<u.length;D++)t[D]=u[D];delete u[v]}}function Kn(i,e){for(var t=[],s=0;s<i.length;s++)e(i[s])&&t.push(i[s]);return t}function Qn(i){return!!i}});var Ps=re((rr,Ss)=>{var Jn={className:"class",htmlFor:"for"},Yn={accept:new Set(["form","input"]),"accept-charset":new Set(["form"]),accesskey:"GLOBAL",action:new Set(["form"]),align:new Set(["applet","caption","col","colgroup","hr","iframe","img","table","tbody","td","tfoot","th","thead","tr"]),alt:new Set(["applet","area","img","input"]),async:new Set(["script"]),autocomplete:new Set(["form","input"]),autofocus:new Set(["button","input","keygen","select","textarea"]),autoplay:new Set(["audio","video"]),autosave:new Set(["input"]),bgcolor:new Set(["body","col","colgroup","marquee","table","tbody","tfoot","td","th","tr"]),border:new Set(["img","object","table"]),buffered:new Set(["audio","video"]),challenge:new Set(["keygen"]),charset:new Set(["meta","script"]),checked:new Set(["command","input"]),cite:new Set(["blockquote","del","ins","q"]),class:"GLOBAL",code:new Set(["applet"]),codebase:new Set(["applet"]),color:new Set(["basefont","font","hr"]),cols:new Set(["textarea"]),colspan:new Set(["td","th"]),content:new Set(["meta"]),contenteditable:"GLOBAL",contextmenu:"GLOBAL",controls:new Set(["audio","video"]),coords:new Set(["area"]),data:new Set(["object"]),datetime:new Set(["del","ins","time"]),default:new Set(["track"]),defer:new Set(["script"]),dir:"GLOBAL",dirname:new Set(["input","textarea"]),disabled:new Set(["button","command","fieldset","input","keygen","optgroup","option","select","textarea"]),download:new Set(["a","area"]),draggable:"GLOBAL",dropzone:"GLOBAL",enctype:new Set(["form"]),for:new Set(["label","output"]),form:new Set(["button","fieldset","input","keygen","label","meter","object","output","progress","select","textarea"]),formaction:new Set(["input","button"]),headers:new Set(["td","th"]),height:new Set(["canvas","embed","iframe","img","input","object","video"]),hidden:"GLOBAL",high:new Set(["meter"]),href:new Set(["a","area","base","link"]),hreflang:new Set(["a","area","link"]),"http-equiv":new Set(["meta"]),icon:new Set(["command"]),id:"GLOBAL",ismap:new Set(["img"]),itemprop:"GLOBAL",keytype:new Set(["keygen"]),kind:new Set(["track"]),label:new Set(["track"]),lang:"GLOBAL",language:new Set(["script"]),list:new Set(["input"]),loop:new Set(["audio","bgsound","marquee","video"]),low:new Set(["meter"]),manifest:new Set(["html"]),max:new Set(["input","meter","progress"]),maxlength:new Set(["input","textarea"]),maxlength:new Set(["input","textarea"]),media:new Set(["a","area","link","source","style"]),method:new Set(["form"]),min:new Set(["input","meter"]),multiple:new Set(["input","select"]),muted:new Set(["video"]),name:new Set(["button","form","fieldset","iframe","input","keygen","object","output","select","textarea","map","meta","param"]),novalidate:new Set(["form"]),open:new Set(["details"]),optimum:new Set(["meter"]),pattern:new Set(["input"]),ping:new Set(["a","area"]),placeholder:new Set(["input","textarea"]),poster:new Set(["video"]),preload:new Set(["audio","video"]),radiogroup:new Set(["command"]),readonly:new Set(["input","textarea"]),rel:new Set(["a","area","link"]),required:new Set(["input","select","textarea"]),reversed:new Set(["ol"]),rows:new Set(["textarea"]),rowspan:new Set(["td","th"]),sandbox:new Set(["iframe"]),scope:new Set(["th"]),scoped:new Set(["style"]),seamless:new Set(["iframe"]),selected:new Set(["option"]),shape:new Set(["a","area"]),size:new Set(["input","select"]),sizes:new Set(["img","link","source"]),span:new Set(["col","colgroup"]),spellcheck:"GLOBAL",src:new Set(["audio","embed","iframe","img","input","script","source","track","video"]),srcdoc:new Set(["iframe"]),srclang:new Set(["track"]),srcset:new Set(["img"]),start:new Set(["ol"]),step:new Set(["input"]),style:"GLOBAL",summary:new Set(["table"]),tabindex:"GLOBAL",target:new Set(["a","area","base","form"]),title:"GLOBAL",type:new Set(["button","input","command","embed","object","script","source","style","menu"]),usemap:new Set(["img","input","object"]),value:new Set(["button","option","input","li","meter","progress","param"]),width:new Set(["canvas","embed","iframe","img","input","object","video"]),wrap:new Set(["textarea"])};function Xn(i,e){e=e.toLowerCase();var t=Yn[i.toLowerCase()];return!!t&&(t==="GLOBAL"||t.has(e))}function Zn(i){return Jn[i]||i}Ss.exports={isStandardAttribute:Xn,propToAttr:Zn}});var Ms=re((ar,Os)=>{var eo=jt(),Es=Ps();function Ce(i,e){this.type=i,this.target=null,Object.keys(e||{}).forEach(function(t){this[t]=e[t]},this)}Ce.prototype.preventDefault=function(){};Ce.prototype.stopPropagation=function(){};Ce.prototype.stopImmediatePropagation=function(){};function As(i,e){this._eventListeners=this._eventListeners||{},this._eventListeners[i]=this._eventListeners[i]||[];var t=this._eventListeners[i];t.indexOf(e)===-1&&t.push(e)}function Ts(i,e){var t=this._eventListeners&&this._eventListeners[i];if(t){var s=t.indexOf(e);s!==-1&&t.splice(s,1)}}function Cs(i){i.target=this;var e=this._eventListeners&&this._eventListeners[i.type];return e&&e.forEach(function(t){t(i)}),!0}function ae(){}ae.prototype.createTextNode=function(i){var e=new V;return e.textContent=i,e.nodeName="#text",e.nodeType=3,e};ae.prototype.createElement=function(i){var e=new A;return e.nodeName=e.tagName=i,e};ae.prototype.createComment=function(i){var e=new G;return e.data=i,e};ae.prototype.addEventListener=As;ae.prototype.removeEventListener=Ts;ae.prototype.dispatchEvent=Cs;function Oe(){}V.prototype=new Oe;A.prototype=new Oe;G.prototype=new Oe;function Me(i){this.el=i,this.styles=[]}Me.prototype.setProperty=function(i,e){this.el._setProperty(this.styles,{name:i,value:e})};Me.prototype.getProperty=function(i){return this.el._getProperty(this.styles,i)};Me.prototype.__defineGetter__("cssText",function(){var i="";return this.styles.forEach(function(e){i+=e.name+":"+e.value+";"}),i});Me.prototype.__defineSetter__("cssText",function(i){this.styles.length=0,i.split(";").forEach(function(e){var t=e.indexOf(":");if(t){var s=e.slice(0,t).trim(),n=e.slice(t+1).trim();this.setProperty(s,n)}},this)});function to(i,e){i&&(this.name=i,this.value=e||"")}function A(){var i=this;this.style=new Me(this),this.classList=eo(this),this.childNodes=[],this.attributes=[],this.dataset={},this.className="",this._setProperty=function(e,t,s,n){var r=i._getProperty(e,s);if(r){r.value=String(n);return}e.push(typeof t=="function"?new t(s.toLowerCase(),String(n)):t)},this._getProperty=function(e,t){if(t){t=t.toLowerCase();for(var s=0;s<e.length;s++)if(t===e[s].name)return e[s]}}}A.prototype.nodeType=1;A.prototype.appendChild=function(i){return i.parentElement=this,this.childNodes.push(i),i};A.prototype.setAttribute=function(i,e){i==="style"?this.style.cssText=e:this._setProperty(this.attributes,to,i,e)};A.prototype.getAttribute=function(i){if(i==="style")return this.style.cssText;var e=this._getProperty(this.attributes,i);return typeof e<"u"?e.value:null};A.prototype.removeAttribute=function(i){if(i==="class")delete this.className;else for(var e=0,t=this.attributes.length;e<t;e++)if(this.attributes[e].name===i){this.attributes.splice(e,1);break}};A.prototype.replaceChild=function(i,e){var t=this,s=!1;if(this.childNodes.forEach(function(n,r){n===e&&(t.childNodes[r]=i,i.parentElement=this,s=!0)}),s)return e};A.prototype.removeChild=function(i){var e=this,t=!0;if(this.childNodes.forEach(function(s,n){s===i&&(e.childNodes.splice(n,1),i.parentElement=null,t=!0)}),t)return i};A.prototype.insertBefore=function(i,e){var t=this.childNodes;if(e===null)t.push(i);else for(var s=0,n=t.length;s<n;s++){var r=t[s];if(r===e){s===0?t.unshift(i):t.splice(s,0,i);break}}return i.parentElement=this,i};A.prototype.addEventListener=As;A.prototype.removeEventListener=Ts;A.prototype.dispatchEvent=Cs;A.prototype.insertAdjacentHTML=function(i,e){};A.prototype.__defineGetter__("innerHTML",function(){var i=this.childNodes.html||"";return this.childNodes.forEach(function(e){i+=e.outerHTML||e.textContent}),i});A.prototype.__defineSetter__("innerHTML",function(i){this.childNodes.length=0,this.childNodes.html=i});A.prototype.__defineGetter__("outerHTML",function(){var i=[],e=this,t={AREA:!0,BASE:!0,BR:!0,COL:!0,EMBED:!0,HR:!0,IMG:!0,INPUT:!0,KEYGEN:!0,LINK:!0,META:!0,PARAM:!0,SOURCE:!0,TRACK:!0,WBR:!0};function s(f){var g=[],S;return f.forEach(function(u){S=u.name!="style"?u.value:e.style.cssText,g.push(u.name+'="'+$s(S)+'"')}),g.length?" "+g.join(" "):""}function n(f){var g=[],S;return Object.keys(f).forEach(function(u){g.push("data-"+u+'="'+$s(f[u])+'"')}),g.length?" "+g.join(" "):""}function r(){var f=[];for(var g in e){var S=Es.propToAttr(g);e.hasOwnProperty(g)&&["string","boolean","number"].indexOf(typeof e[g])!==-1&&Es.isStandardAttribute(S,e.nodeName)&&c(g,S)&&f.push({name:S,value:e[g]})}return f?s(f):""}function c(f,g){return e.getAttribute(g)?!1:!(f==="className"&&!e[f])}var p=this.style.cssText?this.attributes.concat([{name:"style"}]):this.attributes;return i.push("<"+this.nodeName+r()+s(p)+n(this.dataset)+">"),t[this.nodeName.toUpperCase()]||(i.push(this.innerHTML),i.push("</"+this.nodeName+">")),i.join("")});A.prototype.__defineGetter__("textContent",function(){var i="";return this.childNodes.forEach(function(e){i+=e.textContent}),i});A.prototype.__defineSetter__("textContent",function(i){var e=new V;return e.textContent=i,this.childNodes=[e],i});function Ie(i){return String(i).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function $s(i){return Ie(i).replace(/"/g,"&quot;")}A.prototype.nodeValue=null;function V(){}V.prototype.nodeType=3;V.prototype.nodeName="#text";V.prototype.__defineGetter__("textContent",function(){return Ie(this.value||"")});V.prototype.__defineSetter__("textContent",function(i){this.value=i});V.prototype.__defineGetter__("nodeValue",function(){return Ie(this.value||"")});V.prototype.__defineSetter__("nodeValue",function(i){this.value=i});V.prototype.__defineGetter__("length",function(){return(this.value||"").length});V.prototype.replaceData=function(i,e,t){this.value=this.value.slice(0,i)+t+this.value.slice(i+e)};function G(){}G.prototype.nodeType=8;G.prototype.nodeName="#comment";G.prototype.__defineGetter__("data",function(){return this.value});G.prototype.__defineSetter__("data",function(i){this.value=i});G.prototype.__defineGetter__("outerHTML",function(){return"<!--"+Ie(this.value||"")+"-->"});G.prototype.__defineGetter__("nodeValue",function(){return Ie(this.value||"")});G.prototype.__defineSetter__("nodeValue",function(i){this.value=i});function Xe(i){i.__defineGetter__("parentNode",function(){return this.parentElement})}Xe(A.prototype);Xe(G.prototype);Xe(V.prototype);Xe(Oe.prototype);Os.exports={Document:ae,Node:Oe,Element:A,Comment:G,Text:V,document:new ae,Event:Ce,CustomEvent:Ce}});var Fs=re((lr,Ns)=>{var io=ys(),so=jt(),Rs=typeof window>"u"?Ms():window,Re=Rs.document,no=Rs.Text;function Ws(){var i=[];function e(){var t=[].slice.call(arguments),s=null;function n(r){var c;function p(u){var v=io(u,/([\.#]?[^\s#.]+)/);/^\.|#/.test(v[1])&&(s=Re.createElement("div")),Is(v,function(D){var oe=D.substring(1,D.length);D&&(s?D[0]==="."?so(s).add(oe):D[0]==="#"&&s.setAttribute("id",oe):s=Re.createElement(D))})}if(r!=null){if(typeof r=="string")s?s.appendChild(c=Re.createTextNode(r)):p(r);else if(typeof r=="number"||typeof r=="boolean"||r instanceof Date||r instanceof RegExp)s.appendChild(c=Re.createTextNode(r.toString()));else if(ro(r))Is(r,n);else if(qt(r))s.appendChild(c=r);else if(r instanceof no)s.appendChild(c=r);else if(typeof r=="object")for(var f in r)if(typeof r[f]=="function")/^on\w+/.test(f)?function(u,v){s.addEventListener?(s.addEventListener(u.substring(2),v[u],!1),i.push(function(){s.removeEventListener(u.substring(2),v[u],!1)})):(s.attachEvent(u,v[u]),i.push(function(){s.detachEvent(u,v[u])}))}(f,r):(s[f]=r[f](),i.push(r[f](function(u){s[f]=u})));else if(f==="style")if(typeof r[f]=="string")s.style.cssText=r[f];else for(var g in r[f])(function(u,v){if(typeof v=="function")s.style.setProperty(u,v()),i.push(v(function(oe){s.style.setProperty(u,oe)}));else var D=r[f][u].match(/(.*)\W+!important\W*$/);D?s.style.setProperty(u,D[1],"important"):s.style.setProperty(u,r[f][u])})(g,r[f][g]);else if(f==="attrs")for(var S in r[f])s.setAttribute(S,r[f][S]);else f.substr(0,5)==="data-"?s.setAttribute(f,r[f]):s[f]=r[f];else if(typeof r=="function"){var S=r();s.appendChild(c=qt(S)?S:Re.createTextNode(S)),i.push(r(function(v){qt(v)&&c.parentElement?(c.parentElement.replaceChild(v,c),c=v):c.textContent=v}))}}return c}for(;t.length;)n(t.shift());return s}return e.cleanup=function(){for(var t=0;t<i.length;t++)i[t]();i.length=0},e}var oo=Ns.exports=Ws();oo.context=Ws;function qt(i){return i&&i.nodeName&&i.nodeType}function Is(i,e){if(i.forEach)return i.forEach(e);for(var t=0;t<i.length;t++)e(i[t],t)}function ro(i){return Object.prototype.toString.call(i)=="[object Array]"}});var Bt,W,le=m(()=>{y();X();C();B();Bt=class{static utils=et;options={};values={type:null,typeVariant:null,hostname:location.hostname};mw={serverName:mw.config.get("wgServerName"),mobileServerName:mw.config.get("wgMobileServerName")};isValid=!1;isForeign=!1;isHidden=!1;constructor(e,t){this.options={fixTenet:!0,...t},T(e)||this.set(e)}set(e){this.values={...this.values,...this.validateValues(e)},this.isValid=this.validate(),this.process()}setValue(e,t){this.values[e]=t}setValues(e){for(let[t,s]of Object.entries(e))this.setValue(t,s)}get(e){return this.values[e]}getValues(){return this.values}getMW(e){return this.mw[e]}validateValues(e){return!a(e.diff)&&R(e.diff)&&e.diff.indexOf("|")>-1&&(e.diff=e.diff.split("|").shift()),!a(e.oldid)&&R(e.oldid)&&e.oldid.indexOf("|")>-1&&(e.oldid=e.oldid.split("|").shift()),!a(e.curid)&&R(e.curid)&&e.curid.indexOf("|")>-1&&(e.curid=e.curid.split("|").shift()),[0,"0"].includes(e.oldid)&&delete e.oldid,[0,"0","current","latest"].includes(e.diff)&&(e.diff="cur"),M(e.direction)||(e.direction="prev"),a(e.hash)||(e.hash=mw.util.percentDecodeFragment(e.hash),e.hash&&(e.hash=e.hash.replace(/^#/,""))),a(e.section)||(e.section=e.section.replace(/^#/,"")),e}validate(){if(Ze(this.values.title)==="Special:ComparePages"&&(!a(this.values.page1)||h(this.values.rev1))&&(!a(this.values.page2)||h(this.values.rev2)))return this.options.fixTenet=!1,this.values.type="diff",this.values.typeVariant="comparePages",!0;if(Ze(this.values.title)==="Special:Undelete")return this.values.type="diff",this.values.typeVariant="undelete",!1;if(h(this.values.oldid)&&a(this.values.diff))return this.values.type="revision",!0;if(h(this.values.diff)||h(this.values.oldid)){if(this.values.type="diff",a(this.values.title)&&M(this.values.oldid)){let e=this.values.oldid;this.values.oldid=this.values.diff,this.values.diff=e}if(a(this.values.oldid)&&(this.values.oldid=this.values.diff,this.values.diff=this.values.direction),this.options.fixTenet&&h(this.values.oldid)&&h(this.values.diff)&&parseInt(this.values.oldid)>parseInt(this.values.diff)){let e=this.values.oldid;this.values.oldid=this.values.diff,this.values.diff=e}return!0}return!a(this.values.title)&&M(this.values.diff)?(this.values.type="diff",!0):h(this.values.curid)?(this.values.type="revision",this.values.typeVariant="page",!0):!1}process(){this.values.revid=Ut(this),a(this.values.hostname)||this.setHostname(),a(this.values.title)||this.setTitle(),(!a(this.values.page1)||!a(this.values.page2))&&this.setComparePages()}setHostname(){let{general:e}=b.siteInfoAliases[this.values.hostname]||{};T(e)?(this.mw.serverName=this.values.hostname,this.mw.mobileServerName=this.values.hostname):(this.values.hostname=ge()&&!a(e.mobileservername)?e.mobileservername:e.servername,this.mw.serverName=e.servername,this.mw.mobileServerName=e.mobileservername),this.mw.endPoint=`https://${this.values.hostname}${mw.util.wikiScript("index")}`,this.mw.endPointUrl=new URL(this.mw.endPoint),this.isForeign=Z(this.values.hostname)}setTitle(){a(this.values.origTitle)&&(this.values.origTitle=this.values.title);try{this.mw.title=new mw.Title(this.values.title),this.values.title=this.mw.title.getPrefixedDb(),this.values.titleText=this.mw.title.getPrefixedText()}catch{}l.get("linksHash")&&!a(this.values.section)&&(this.values.titleSection=[this.values.title,this.values.section].join("#"),this.values.titleTextSection=[this.values.titleText,this.values.section].join("#")),this.values.href=mw.util.getUrl(this.values.titleSection||this.values.title),this.isForeign&&(this.values.href=U(this,this.values.href))}setComparePages(){try{this.mw.page1=new mw.Title(this.values.page1),this.values.page1=this.mw.page1.getPrefixedDb(),this.values.page1Text=this.mw.page1.getPrefixedText()}catch{}try{this.mw.page2=new mw.Title(this.values.page2),this.values.page2=this.mw.page2.getPrefixedDb(),this.values.page2Text=this.mw.page2.getPrefixedText()}catch{}}},W=Bt});var Ht,b,B=m(()=>{P();y();Le();C();le();Ht=class{static utils=Gt;static api;static foreignApi={};static getApi(e){let t=e instanceof W?e.get("hostname"):e;if(!Z(t))return this.api||(this.api=new mw.Api),this.api;if(!this.foreignApi[t]){let s=`https://${t}${mw.util.wikiScript("api")}`;this.foreignApi[t]=new mw.ForeignApi(s)}return this.foreignApi[t]}static get(e,t){return this.getApi(t).get(e)}static post(e,t){return this.getApi(t).post(e)}static postWithToken(e,t,s){return this.getApi(s).postWithToken(e,t)}static watch(e,t,s){return this.getApi(s).watch(e,t)}static unwatch(e,t){return this.getApi(t).unwatch(e)}static notifyError(e){E("error-api-generic",{tag:"api",message:e?.message||e,silent:!0})}static getAuthToken(e){let t={action:"centralauthtoken",format:"json",formatversion:2,uselang:o.local.language};return this.get(t,e)}static loadMessage(e,t){return e=typeof e=="string"?[e]:e,e.filter(n=>!mw.message(n).exists()).length===0?$.Deferred().resolve().promise():this.getApi(t).loadMessagesIfMissing(e,{uselang:o.local.userLanguage})}static async parseWikitext(e,t){e={action:"parse",contentmodel:"wikitext",format:"json",formatversion:2,uselang:o.local.language,...e};try{let{parse:s}=await this.post(e,t);return s.text}catch(s){this.notifyError(s)}}static async getCompare(e,t,s){e={action:"compare",prop:["title","ids","timestamp","comment"],format:"json",formatversion:2,uselang:o.local.userLanguage,...e};let n=s||this;try{return(await n.get(e,t)).compare}catch(r){this.notifyError(r)}}static async getPageInfo(e,t,s){let n=o.local.userLanguage;e={action:"query",prop:["info","pageprops","entityterms"],inprop:["watched","notificationtimestamp"],wbetterms:["label"],wbetlanguage:n,intestactions:["edit"],format:"json",formatversion:2,uselang:n,...e};let r=s||this;try{return(await r.get(e,t)).query.pages[0]}catch(c){this.notifyError(c)}}static async markAsSeen(e,t){e={action:"setnotificationtimestamp",redirects:1,format:"json",formatversion:2,uselang:o.local.userLanguage,...e};try{return(await this.postWithToken("csrf",e,t)).setnotificationtimestamp[0].notificationtimestamp}catch(s){this.notifyError(s)}}static siteInfo={};static siteInfoAliases={};static async getSiteInfo(e=[],t,s){let n=t instanceof W?t.get("hostname"):t;if(a(n)&&(n=mw.config.get("wgServerName")),!We()&&T(this.siteInfo)&&(this.siteInfo=mw.storage.getObject(`${o.config.prefix}-siteInfo`)||{},this.processSiteInfo()),!T(this.siteInfoAliases[n])||!T(this.siteInfo[n]))return this.siteInfoAliases[n]||this.siteInfo[n];let r={action:"query",meta:"siteinfo",siprop:e,format:"json",formatversion:2,uselang:o.local.userLanguage},c=s||this;try{let{query:p}=await c.get(r,n);this.siteInfo[n]||(this.siteInfo[n]={});for(let[f,g]of Object.entries(p))this.siteInfo[n][f]=g;return mw.storage.setObject(`${o.config.prefix}-siteInfo`,this.siteInfo,l.get("storageExpiry")),this.processSiteInfoAliases(this.siteInfo[n]),this.siteInfo[n]}catch(p){this.notifyError(p)}}static processSiteInfo(){if(!T(this.siteInfo))for(let e of Object.values(this.siteInfo))this.processSiteInfoAliases(e)}static processSiteInfoAliases(e){T(e?.general)||(this.siteInfoAliases[e.general.servername]=e,a(e.general.mobileserver)||(e.general.mobileservername=K("hostname",e.general.mobileserver),this.siteInfoAliases[e.general.mobileservername]=e))}static specialPages={};static specialPagesLocal={};static async getSpecialPages(e){if(T(this.specialPages)&&o.config.specialPages.forEach(s=>{this.specialPages[s]=s}),!We()&&T(this.specialPagesLocal)&&(this.specialPagesLocal=mw.storage.getObject(`${o.config.prefix}-specialPagesLocal`)||{}),!T(this.specialPagesLocal))return this.specialPagesLocal;for(let[s,n]of Object.entries(this.specialPages))this.specialPagesLocal[s]=n;let t={action:"query",titles:o.config.specialPages,format:"json",formatversion:2,uselang:mw.config.get("wgContentLanguage")};try{let{query:s}=await this.get(t,e);return s.normalized&&s.normalized.forEach(n=>{this.specialPagesLocal[n.from]=n.to}),mw.storage.setObject(`${o.config.prefix}-specialPagesLocal`,this.specialPagesLocal,l.get("storageExpiry")),this.specialPagesLocal}catch(s){this.notifyError(s)}}static interwikiMap=[];static async getInterwikiMap(e){if(!We()&&a(this.interwikiMap)&&(this.interwikiMap=mw.storage.getObject(`${o.config.prefix}-interwikiMap`)||[]),!a(this.interwikiMap))return this.interwikiMap;let t={action:"query",meta:"siteinfo",siprop:"interwikimap",format:"json",formatversion:2,uselang:o.local.userLanguage};try{let{query:s}=await this.get(t,e);return this.interwikiMap=s.interwikimap,mw.storage.setObject(`${o.config.prefix}-interwikiMap`,this.interwikiMap,l.get("storageExpiry")),this.interwikiMap}catch(s){this.notifyError(s)}}static async getWBLabel(e,t,s){if(!_t(e))return;let n=o.local.userLanguage,r={action:"wbgetentities",props:"labels",ids:e,languages:n,languagefallback:1,format:"json",formatversion:2,uselang:n},c=s||this;try{let{entities:p}=await c.get(r,t),f=p[e];return f.type==="lexeme"?Object.values(f.lemmas).map(g=>g.value).join("/"):f.labels[n].value}catch(p){this.notifyError(p)}}},b=Ht});var Gt={};_(Gt,{getEntitySchemaLabel:()=>Qt,getNamespaceConfig:()=>zt,getWikilambdaLabel:()=>Jt,isEditableContentModel:()=>Kt,isProbablyWbTitle:()=>_t,isWbContentModel:()=>me});function zt(i){let e=b.siteInfoAliases[i];if(!T(e))return{wgFormattedNamespaces:Object.values(e.namespaces).reduce((t,s)=>(t[s.id]=s.canonical||"",t),{}),wgNamespaceIds:{...Object.values(e.namespaces).reduce((t,s)=>(t[tt(s.name.toLowerCase())]=s.id,s.canonical&&(t[tt(s.canonical.toLowerCase())]=s.id),t),{}),...e.namespacealiases.reduce((t,s)=>(t[s.alias.toLowerCase()]=s.id,t),{})},wgCaseSensitiveNamespaces:Object.values(e.namespaces).filter(t=>t.case==="case-sensitive").map(t=>t.id),wgContentNamespaces:Object.values(e.namespaces).filter(t=>t.content).map(t=>t.id)}}function _t(i){return!a(i)&&/^[QPL][0-9]+$/.test(i)}function me(i){return!a(i)&&i.includes("wikibase")}function Kt(i){return!o.config.nonEditableContentModels.includes(i)}function Qt(i){return $(i).find(".entityschema-title-label").text()}function Jt(i){return!T(i)&&(i[`wikilambda-label-${o.local.userLanguage}`]||i["wikilambda-label-en"])}var Le=m(()=>{P();y();B()});var et={};_(et,{addLinkTags:()=>ti,getDependencies:()=>Yt,getForeignDependencies:()=>Xt,getHref:()=>N,getHrefAbsolute:()=>U,getRevID:()=>Ut,getWikilink:()=>si,loadForeignDependencies:()=>Zt,loadForeignStylesDependencies:()=>ei,removeLinkTags:()=>ii});function Ut(i){let e=i.getValues();if(h(e.revid))return e.revid;if(e.type==="revision"&&h(e.oldid)&&(!M(e.direction)||e.direction==="prev"))return e.oldid;if(e.type==="diff"){if(h(e.oldid)&&h(e.diff))return Math.max(e.oldid,e.diff);if(h(e.oldid)){if(!M(e.diff)||e.diff==="prev")return e.oldid}else if(h(e.diff)&&(!M(e.oldid)||e.oldid==="prev"))return e.diff}return!1}function Yt(i){let e=[],t=o.config.dependencies.page;t&&(e=e.concat(Se(i,t)));let s=o.config.dependencies[i.get("type")];s&&(e=e.concat(Se(i,s)));let n=o.config.dependencies.skins[mw.config.get("skin")];return n&&(e=e.concat(Se(i,n))),e}function Se(i,e){let t=[];if(a(e))return t;z(e["*"])&&(t=t.concat(e["*"]));let s=i.getMW("title")?.getNamespaceId();return z(e[s])&&(t=t.concat(e[s])),t}function Xt(i){let e=[],t=[],s=[],n=o.config.foreignDependencies[i.get("type")];if(n){if(e=e.concat(Se(i,n)),t=t.concat(Se(i,n.styles)),me(mw.config.get("wgPageContentModel"))){let r=n.wikibase;r&&(e=e.concat(Se(i,r)),t=t.concat(r.styles.all,ge()?r.styles.mobile:r.styles.desktop))}s=s.concat(ao(i,n.links))}return{modules:e,styles:t,links:s}}function ao(i,e){let t=[];if(a(e))return t;z(e["*"])&&(t=t.concat(e["*"].map(n=>Vs(i,n))));let s=i.getMW("title")?.getNamespaceId();return z(e[s])&&(t=t.concat(e[s].map(n=>Vs(i,n)))),t}function Zt(i,e){let t=it(e),s=i.get("hostname"),n=mw.util.wikiScript("load"),r=$.param({modules:t.join("|"),skin:mw.config.get("skin")});mw.loader.load(`https://${s}${n}?${r}`)}function ei(i,e){let t=it(e),s=i.get("hostname"),n=mw.util.wikiScript("load"),r=$.param({modules:t.join("|"),only:"styles",skin:mw.config.get("skin")});mw.loader.load(`https://${s}${n}?${r}`,"text/css")}function ti(i){if(!a(i))return i.map(e=>mw.loader.addLinkTag?.(e))}function ii(i){a(i)||i.forEach(e=>e?.remove())}async function si(i){let e={relative:!1,hash:l.get("linksHash"),minify:l.get("linksFormat")==="minify",wikilink:!0,wikilinkPreset:l.get("wikilinksFormat")};if(i.isForeign){let t=await b.getInterwikiMap();t&&(e.interwiki=t.filter(s=>s.url.includes(i.getMW("serverName"))).reduce((s,n)=>!s||s.prefix.length>n.prefix.length?n:s))}return N(i,{},e)}function N(i,e,t){i instanceof W||(i=new W(i)),e={...e},t={type:null,...t};let s={...i.getValues()};return t.type||(s.type==="revision"&&s.typeVariant==="page"?t.type="page":t.type=s.type),t.type==="diff"&&(a(s.diff)&&M(s.direction)&&(s.diff=s.direction),h(s.oldid)&&h(s.diff)?(e.oldid=s.oldid,e.diff=s.diff):h(s.revid)?e.diff=s.revid:h(s.oldid)?M(s.diff)&&s.diff!=="prev"?(e.oldid=s.oldid,e.diff=s.diff):e.diff=s.oldid:h(s.diff)&&(M(s.oldid)&&s.oldid!=="prev"?(e.oldid=s.diff,e.diff=s.oldid):e.diff=s.diff)),t.type==="revision"&&(a(s.direction)&&M(s.diff)&&(s.direction=s.diff),h(s.revid)?e.oldid=s.revid:h(s.oldid)&&(e.oldid=s.oldid,M(s.direction)&&s.direction==="next"&&(e.direction=s.direction))),t.type==="page"&&(e.curid=s.curid),lo(i,e,t)}function U(i,e){let t=i?.mw.endPointUrl||o.local.mwEndPointUrl;try{return new URL(e,t.origin).toString()}catch{return e}}function lo(i,e,t){e={...e},t={type:"diff",relative:!0,hash:!1,minify:!1,interwiki:null,wikilink:!1,wikilinkPreset:null,...t},Z(i.get("hostname"))&&(t.relative=!1);let s=i.getMW("endPointUrl")||o.local.mwEndPointUrl,n;if(a(i.get("title"))?(n=new URL(s),n.search=new URLSearchParams(e).toString()):n=new URL(mw.util.getUrl(i.get("title"),e),s.origin),t.hash&&!a(i.get("section"))){let r=mw.util.escapeIdForLink(i.get("section"));r&&(n.hash=`#${r}`)}return t.minify&&(n.pathname="",n.hash="",n.searchParams.delete("title")),t.href=decodeURIComponent(t.relative?n.pathname+n.search+n.hash:n.toString()),t.hash=decodeURIComponent(n.hash),t.wikilink?co(i,e,t):t.href}function co(i,e,t){e={...e},t={href:null,hash:null,type:"diff",minify:!1,relative:!0,interwiki:null,wikilink:!0,wikilinkPreset:"special",...t};let s=null;!a(e.oldid)&&!a(e.diff)?s=`${e.oldid}/${e.diff}`:a(e.oldid)?a(e.diff)?a(e.curid)||(s=e.curid):s=e.diff:s=e.oldid,a(t.hash)||(s=`${s}${t.hash}`);let r=(o.config.wikilinkPresets[t.wikilinkPreset]||o.config.wikilinkPresets.special)[t.type],c=t.interwiki?.prefix;return r.replace("$1",s).replace("$pref",c?`${c}:`:"").replace("$href",t.href).replace("$msg",d(`copy-wikilink-${t.type}`))}function Vs(i,e){let t=mw.util.getUrl(e,{action:"raw",ctype:"text/css"});return i.isForeign?U(i,t):t}var X=m(()=>{P();y();Le();B();le();C()});function H(i){let e=Object.getPrototypeOf(i);return OO.initClass(e),i.static=Object.create(e.static),Object.keys(i).filter(t=>t!=="static").forEach(t=>{i.static[t]=i[t]}),i.parent=i.super=e,i}function ni(i){let e={prototype:{}};OO.mixinClass(e,OO.EventEmitter),Object.assign(i,e.prototype),OO.EventEmitter.call(i)}function st(){x(OO.ui.RadioSelectWidget.prototype.findFirstSelectedItem)||(OO.ui.RadioSelectWidget.prototype.findFirstSelectedItem=function(){let i=this.findSelectedItems();return Array.isArray(i)?i[0]||null:i}),x(OO.ui.ButtonSelectWidget.prototype.findFirstSelectedItem)||(OO.ui.ButtonSelectWidget.prototype.findFirstSelectedItem=function(){let i=this.findSelectedItems();return Array.isArray(i)?i[0]||null:i}),x(OO.ui.getTeleportTarget)||(OO.ui.getTeleportTarget=function(){return document.body})}function js(){$(["#mw-notification-area",".mw-notification-area-overlay",".ext-checkuser-userinfocard-popover"]).each((i,e)=>{$(e).removeAttr("aria-hidden").removeAttr("inert")})}function nt(){fo();let i=new OO.ui.WindowManager;return $(OO.ui.getTeleportTarget()).append(i.$element),i}function fo(i){i=i||l.get("viewWidth")||"standard",i!=="full"&&(OO.ui.WindowManager.static.sizes.instantDiffs=L.constructor.sizes[i]||L.constructor.sizes.standard),L.isOpen&&L.dialog.setSize(oi(i))}function oi(i){return i=i||l.get("viewWidth")||"standard",i==="full"?"full":"instantDiffs"}function ot(i,e){let t=mw.loader.moduleRegistry[i],s=e.match(/^((?:\.\.?\/)+)(.*)$/);return s&&(e=`resources/src/${i}/${s[2]}`),t?.packageExports[e]}function qs(i){return mw.loader.moduleRegistry[i]?.script($,jQuery,null,null)}var j=m(()=>{y();ee();C()});var li={};_(li,{getMWLine:()=>ri,getMWLineTitle:()=>ai,getSplitSpecialUrl:()=>rt,isMWLink:()=>te});function rt(i){let e=i.split("/"),t={};return o.local.specialPagesAliasesPrefixed["Special:PermanentLink"].includes(e[0])?(t.oldid=e[1],t):o.local.specialPagesAliasesPrefixed["Special:Redirect"].includes(e[0])?e[1]==="revision"?(t.oldid=e[2],t):(e[1]==="page"&&(t.curid=e[2]),t):(e.length>1&&(t.diff=e.pop()),e.length>1&&(t.oldid=e.pop()),t)}function te(i,e){let t=!1;return e=e||o.config.mwLink,e.id&&(t=e.id.some(s=>i.id===s),t)||e.hasClass&&(t=e.hasClass.some(s=>i.classList.contains(s)),t)||e.hasChild&&(t=e.hasChild.some(s=>i.querySelector(s)),t)||e.closestTo&&(t=e.closestTo.some(s=>i.closest(s))),t}function ri(i){return i.closest(o.config.mwLine.selector.join(","))}function ai(i){let e=i.dataset.title;if(!a(e))return decodeURIComponent(e);let t=o.config.mwLineTitle.selector.join(","),s=i.querySelector(t);if(s)return a(s.title)?s.innerText:s.title}var Bs=m(()=>{P();y()});var ci,ie,at=m(()=>{y();ci=class{options={};node;constructor(e){this.options={node:null,tag:"button",classes:[],label:null,title:null,href:null,target:"_self",handler:null,container:null,insertMethod:"appendTo",ariaHaspopup:!1,altTitle:null,useAltKey:!1,...e},a(this.options.href)||(this.options.tag="a"),OO.EventEmitter.call(this),this.options.node?.nodeType===1?(this.node=this.options.node,this.process()):this.render()}render(){this.node=document.createElement(this.options.tag),this.node.innerText=this.options.label,this.node.classList.add(...this.options.classes),a(this.options.title)||(this.node.title=this.options.title),a(this.options.href)?(this.node.setAttribute("tabindex","0"),this.node.setAttribute("role","button")):(this.node.href=this.options.href,this.node.target=this.options.target),this.process(),this.embed(this.options.container,this.options.insertMethod)}process(){x(this.options.handler)&&(this.options.ariaHaspopup&&this.node.setAttribute("aria-haspopup","dialog"),a(this.options.altTitle)||(this.node.dataset.altTitle=this.options.altTitle),Ne(this.node,this.options.handler.bind(this),this.options.useAltKey))}embed(e,t){I(this.node,e,t)}remove(){this.node.remove()}pending(e){this.node.classList.toggle("instantDiffs-link--pending",e)}getContainer(){return this.node}},ie=ci});var Us=m(()=>{});var Hs,uo,fi,O,Ee=m(()=>{P();y();Bs();B();le();at();ee();C();Us();({h:Hs,ht:uo}=w),fi=class i{static utils=li;static stack=new Map;static findLinks(e){return typeof e>"u"&&(e=$e()),e.find(o.local.linkSelector)}static addLink(e,t){this.stack.set(e,t.isValid?t:!1)}static getLink(e){return this.stack.get(e)}static hasLink(e){return this.stack.has(e)}static getLinks(){return this.stack.values()}node;options={};article;nodes={};mw={hasLink:!1,hasLine:!1};manual={behavior:"basic",options:{}};actions={};extensions={};isValid=!1;isForeign=!1;isLoading=!1;isLoaded=!1;isProcessed=!1;isObserved=!1;hasRequest=!1;constructor(e,t){this.node=e,this.options={behavior:"basic",insertMethod:"insertAfter",showLink:l.get("showLink"),showPageLink:l.get("showPageLink"),showAltTitle:!1,initiatorLink:null,initiatorPage:null,initiatorView:null,onRequest:()=>{},onLoad:()=>{},onOpen:()=>{},onClose:()=>{},...t},L.isContains(this.node)&&(this.options.initiatorView=L,this.options.initiatorPage=L.getPage()),this.process(),i.addLink(this.node,this),this.isValid&&this.render()}process(){if(this.href=this.node.href,a(this.href))return;let e={};try{this.url=new URL(this.href),e.title=this.url.searchParams.get("title"),e.pathname=decodeURIComponent(this.url.pathname),e.pathnameNormalized=e.pathname.replace(new RegExp(o.local.mwArticlePath),"")}catch{return}if(o.config.exclude.linkActions.includes(this.url.searchParams.get("action"))||te(this.node,o.config.mwLinkExclude))return;let t={hostname:this.url.hostname,hash:this.url.hash};o.local.specialPagesLinksSearchRegExp.test(e.title)?t={...t,...rt(e.title)}:o.local.specialPagesLinksPathRegExp.test(e.pathname)?t={...t,...rt(e.pathnameNormalized)}:(["title","curid","oldid","diff","direction","page1","rev1","page2","rev2"].forEach(s=>{t[s]=this.url.searchParams.get(s)}),a(t.title)&&o.local.articlePathRegExp.test(e.pathname)&&(t.title=e.pathnameNormalized)),this.article=new W(t),this.isValid=this.article.isValid,this.isForeign=this.article.isForeign}render(){switch(this.processMWOptions(),this.processManualOptions(),this.postValidateOptions(),a(this.article.get("title"))&&this.mw.hasLine&&this.article.set({title:this.mw.title}),this.options.behavior){case"event":this.renderEvent();break;case"basic":this.renderBasic();break;case"request":this.renderRequest();break}}processMWOptions(){this.mw.isContent=te(this.node,o.config.mwLinkContent),this.mw.isContent&&(this.options.behavior="request"),this.mw.hasLink=te(this.node,o.config.mwLink),this.mw.hasLink&&(this.options.behavior="basic",this.mw.isDiffOnly=te(this.node,o.config.mwLinkDiffOnly),this.mw.isPrepend=te(this.node,o.config.mwLinkPrepend),this.mw.isPrepend&&(this.options.insertMethod="insertBefore"),this.mw.isAltTitle=te(this.node,o.config.mwLinkAltTitle),this.mw.isAltTitle&&(this.options.showAltTitle=!0),this.mw.line=ri(this.node),this.mw.line&&(this.mw.hasLine=!0,this.mw.title=ai(this.mw.line),this.mw.line.classList.add("instantDiffs-line")),this.mw.isContentInside=te(this.node,o.config.mwLinkContentInside),this.mw.isContentInside&&(this.options.behavior="request"))}processManualOptions(){if(this.manual.options=this.node.dataset.instantdiffsOptions,!a(this.manual.options))try{this.manual.options=JSON.parse(this.manual.options),this.options={...this.options,...this.manual.options}}catch(e){let t={type:"link",tag:"link",message:e?.message||e,silent:!0};E("error-link-options",t)}this.manual.behavior=this.node.dataset.instantdiffsLink,a(this.manual.behavior)||(this.options.behavior=this.manual.behavior)}postValidateOptions(){let e={link:"event",default:"request"};e[this.options.behavior]&&(this.options.behavior=e[this.options.behavior]),["request","basic","event","none"].includes(this.options.behavior)||(this.options.behavior="basic"),this.options.showPageLink&&=this.options.behavior==="request"}observe(){this.isObserved||(this.isObserved=!0,o.local.interactionObserver.observe(this.node))}unobserve(){this.isObserved&&(this.isObserved=!1,o.local.interactionObserver.unobserve(this.node))}onIntersect(){this.isLoading||this.isLoaded||!this.isObserved||(this.unobserve(),this.request())}renderRequest(){this.hasRequest=this.isValid,this.hasRequest?(this.toggleSpinner(!0),this.observe()):(this.toggleSpinner(!1),this.isLoaded=!0,this.isProcessed=!1,this.unobserve())}request(){let e=this.article.get("type"),t=this.article.get("typeVariant");if(e==="revision")return this.requestRevision();if(e==="diff")return t==="comparePages"?this.requestCompare():this.requestDiff()}requestRevision(){if(this.isLoading)return;this.isLoading=!0,this.error=null;let e={action:"query",prop:"revisions",rvprop:["ids","timestamp","comment","content","user"],rvslots:"main",rvsection:0,format:"json",formatversion:2,uselang:o.local.userLanguage};return a(this.article.get("oldid"))?a(this.article.get("curid"))||(e.pageids=this.article.get("curid")):e.revids=this.article.get("oldid"),b.get(e,this.article).then(this.onRequestRevisionDone).fail(this.onRequestRevisionError)}onRequestRevisionError=(e,t)=>{this.isLoading=!1,this.error={type:"revision",tag:"link",code:a(this.article.get("curid"))?"generic":"curid",article:this.article,silent:!0},t?.error?(this.error.code=t.error.code,this.error.message=t.error.info):(this.error.message=e,E(`error-revision-${this.error.code}`,this.error)),this.renderError()};onRequestRevisionDone=e=>{this.isLoading=!1;let t=e?.query;if(!t||!t.badrevids&&!t.badpageids&&!t.pages)return this.onRequestRevisionError(void 0,e);let s=t.pages?.[0],n=s?.revisions?.[0],r={type:"revision"};if(t.badrevids?r.code="badrevids":t.badpageids?r.code="badpageids":!s||s.missing||!n?r.code="missing":s.invalid&&(r.code="invalid",r.info=s.invalidreason),r.code)return this.error=r,this.renderError();this.revision=n,this.article.set({title:s.title,section:ui(this.revision)}),this.article.isHidden=di(this.revision),this.renderSuccess()};requestDiff(){if(this.isLoading)return;this.isLoading=!0,this.error=null;let e={action:"compare",prop:["title","ids","timestamp","comment","user"],fromrev:h(this.article.get("oldid"))?this.article.get("oldid"):void 0,fromtitle:a(this.article.get("title"))?void 0:this.article.get("title"),torev:h(this.article.get("diff"))?this.article.get("diff"):void 0,torelative:M(this.article.get("diff"))?this.article.get("diff"):void 0,format:"json",formatversion:2,uselang:o.local.userLanguage};return b.get(e,this.article).then(this.onRequestDiffDone).fail(this.onRequestDiffError)}onRequestDiffError=(e,t)=>{this.isLoading=!1,this.error={type:"diff",tag:"link",article:this.article,silent:!0},t?.error?(this.error.code=t.error.code,this.error.message=t.error.info):(this.error.message=e,E("error-diff-generic",this.error)),this.renderError()};onRequestDiffDone=e=>{if(this.isLoading=!1,this.compare=e?.compare,!this.compare)return this.onRequestDiffError(null,e);this.article.set({title:ce(this.compare),section:Pe(this.compare)}),this.article.isHidden=lt(this.compare),this.renderSuccess()};requestCompare(){if(this.isLoading)return;this.isLoading=!0,this.error=null;let e=this.article.getValues(),t={action:"compare",prop:["title","ids","timestamp","comment","user"],fromrev:h(e.rev1)?e.rev1:void 0,fromtitle:a(e.page1)?void 0:e.page1,torev:h(e.rev2)?e.rev2:void 0,totitle:a(e.page2)?void 0:e.page2,format:"json",formatversion:2,uselang:o.local.userLanguage};return b.get(t,this.article).then(this.onRequestCompareDone).fail(this.onRequestCompareError)}onRequestCompareError=(e,t)=>{this.isLoading=!1,this.error={type:"diff",tag:"link",article:this.article,silent:!0},t?.error?(this.error.code=t.error.code,this.error.message=t.error.info):(this.error.message=e,E("error-diff-generic",this.error)),this.renderError()};onRequestCompareDone=e=>{if(this.isLoading=!1,this.compare=e?.compare,!this.compare)return this.onRequestCompareError(null,e);this.article.set({oldid:this.compare.fromrevid,diff:this.compare.torevid,page1:this.compare.fromtitle,page2:this.compare.totitle,title:ce(this.compare),section:Pe(this.compare)}),this.article.isHidden=lt(this.compare),this.renderSuccess()};renderEvent(){this.isValid&&(this.actions.action=new ie({node:this.node,handler:this.openDialog.bind(this),ariaHaspopup:!0}),this.renderSuccess())}renderBasic(){!this.isValid||this.mw.isDiffOnly&&this.article.get("type")!=="diff"||this.renderSuccess()}renderError(){if(this.isLoaded=!0,this.isProcessed=!1,this.toggleSpinner(!1),this.options.behavior!=="event"){this.renderWrapper();let e;this.error.type&&(e=`error-${this.error.type}-${this.error.code||"generic"}`,Fe(e)||(e=`error-${this.error.type}-generic`)),this.nodes.error=Hs("span",{class:["item","error","error-info"],title:se(e,this.error,this.article)},uo(we("error"))),this.nodes.inner.append(this.nodes.error),this.embed(this.node,this.options.insertMethod)}mw.hook(`${o.config.prefix}.link.renderError`).fire(this)}renderSuccess(){this.isLoaded=!0,this.isProcessed=!0,this.toggleSpinner(!1),this.options.behavior!=="event"&&(this.renderWrapper(),this.renderLinkAction(),this.options.showPageLink&&this.renderPageAction(),this.embed(this.node,this.options.insertMethod)),mw.hook(`${o.config.prefix}.link.renderSuccess`).fire(this)}renderWrapper(){this.nodes.container=this.nodes.inner=Hs("span",{class:["instantDiffs-panel","nowrap","noprint"]})}renderAction(e){return e={tag:"a",label:null,title:null,href:null,target:Ve(this.options.initiatorView),handler:null,classes:[],modifiers:[],container:this.nodes.inner,...e},e.classes=["item","text","instantDiffs-action",...e.classes],e.modifiers.forEach(t=>e.classes.push(`instantDiffs-action--${t}`)),new ie(e)}getLinkTitle(e){return this.options.showAltTitle&&!a(this.node.title)?this.node.title:(this.article.isHidden&&(e=`${e}-hidden`),d(e))}renderLinkAction(){let e=this.article.get("typeVariant")==="comparePages"?"compare-pages":this.article.get("type"),t=this.getLinkTitle(`${e}-title`);if(!this.options.showLink)return this.mutateLinkAction(t);let s=[];this.article.isHidden&&s.push("error","error-admin"),this.actions.action=this.renderAction({label:we(this.article.get("type")),title:t,classes:s,modifiers:[this.article.get("type")],handler:this.openDialog.bind(this),ariaHaspopup:!0})}mutateLinkAction(e){let t=["instantDiffs-link",`instantDiffs-link--${this.article.get("type")}`,`is-${this.options.insertMethod}`];this.article.isHidden&&t.push("instantDiffs-link--error"),this.node.classList.remove("external"),this.node.classList.add(...t),this.node.dataset.instantdiffsLink=this.options.behavior,this.actions.action=new ie({node:this.node,handler:this.openDialog.bind(this),ariaHaspopup:!0,altTitle:e,useAltKey:!0})}renderPageAction(){this.actions.page=this.renderAction({label:we("page"),title:this.article.get("titleTextSection")||this.article.get("titleText"),href:this.article.get("href"),modifiers:["page"]})}openDialog(){let e={initiatorPage:this.options.initiatorPage,onOpen:()=>this.onDialogOpen(),onClose:()=>this.onDialogClose()};if(L.setup(this,e))return this.onDialogRequest(),$.when(L.load()).always(()=>this.onDialogLoad())}onDialogRequest(){this.toggleLoader(!0),x(this.options.onRequest)&&this.options.onRequest(this)}onDialogLoad(){this.toggleLoader(!1),x(this.options.onLoad)&&this.options.onLoad(this)}onDialogOpen(){this.mw.hasLine&&l.get("highlightLine")&&this.mw.line.classList.add("instantDiffs-line--highlight"),x(this.options.onOpen)&&this.options.onOpen(this),this.options.initiatorLink instanceof i&&this.options.initiatorLink.onDialogOpen()}onDialogClose(){this.mw.hasLine&&(l.get("highlightLine")&&this.mw.line.classList.remove("instantDiffs-line--highlight"),l.get("markWatchedLine")&&o.config.changeLists.includes(mw.config.get("wgCanonicalSpecialPageName"))&&(this.mw.line.classList.remove(...o.config.mwLine.unseen),this.mw.line.classList.add(...o.config.mwLine.seen)),l.get("markWatchedLine")&&o.local.mwCanonicalSpecialPageName==="GlobalWatchlist"&&this.mw.line.classList.add("instantDiffs-line--seen")),x(this.options.onClose)&&this.options.onClose(this),this.options.initiatorLink instanceof i&&this.options.initiatorLink.onDialogClose()}toggleLoader(e){this.actions.action?this.actions.action.pending(e):this.node.classList.toggle("instantDiffs-link--pending",e)}toggleSpinner(e){let t=ct(["loader",this.article.get("type")]);e?this.node.classList.add(...t):this.node.classList.remove(...t)}embed(e,t){I(this.nodes.container,e,t)}getContainer(){return this.nodes.container}getNode(){return this.node}getInitiatorLink(){return this.options.initiatorLink||this}getArticle(){return this.article}getMW(){return this.mw}},O=fi});var hi,be,pi=m(()=>{y();Ee();hi=class i{static instance;static newInstance(e){this.instance=new i(e)}options={};link;links=[];constructor(e){this.options={filterType:null,filterMWLine:!1,...e},this.links=Array.from(O.findLinks())}setLink(e){this.link=e}hasLink(e){return e instanceof O&&this.links.includes(e.getNode())}isLinkValid(e){if(!(e instanceof O)||!(e.isValid&&(e.isProcessed||e.hasRequest&&!e.isLoaded)))return!1;let n=a(this.options.filterType)?!0:e.getArticle().get("type")===this.options.filterType,r=this.options.filterMWLine===!0?e.getMW()?.hasLine:!0;return n&&r}getLength(){return this.links.length}getIndex(){return this.link instanceof O?this.links.indexOf(this.link.getNode()):-1}getPreviousLink(e){if(typeof e>"u"&&(e=this.getIndex()),e<=0)return;let t=e-1,s=O.getLink(this.links[t]);return this.isLinkValid(s)?s:this.getPreviousLink(t)}getNextLink(e){if(typeof e>"u"&&(e=this.getIndex()),e<0||e+1>=this.getLength())return;let t=e+1,s=O.getLink(this.links[t]);return this.isLinkValid(s)?s:this.getNextLink(t)}},be=hi});function _s(i){return i==="<unregistered>"?!1:!mw.util.isIPAddress(i)}function Gs(i){return"isTemporaryUser"in mw.util?mw.util.isTemporaryUser(i):!1}function je(i){if(R(i)&&(i=new Date(i)),!(i instanceof Date))return;let e=qe("mediawiki.DateFormatter");return e?e.forUser().formatTimeAndDate(i):i.toLocaleString()}var gi=m(()=>{y()});var Ue={};_(Ue,{isVisualDiffsAvailable:()=>ut,processRevisionDiffTable:()=>Be,renderDiffTable:()=>wi,renderDiffTableSide:()=>dt,renderMobileDiffFooter:()=>vi,renderUserInfoCardButton:()=>Ks,renderUserLink:()=>bi,restoreFileMediaInfo:()=>Li,restoreInlineFormatToggle:()=>ki,restoreRollbackLink:()=>xi,restoreVisualDiffs:()=>yi,restoreWikiLambda:()=>Di});function wi(i){let e={};return e.container=k("table",{class:["diff","diff-type-table",`diff-contentalign-${mw.config.get("wgContentLanguageDir")==="rtl"?"right":"left"}`,`diff-editfont-${mw.user.options.get("editfont")}`]},k("colgroup",k("col",{class:"diff-marker"}),k("col",{class:"diff-content"}),k("col",{class:"diff-marker"}),k("col",{class:"diff-content"})),e.head=k("tbody",k("tr",{class:"diff-title",lang:o.local.userLanguage},e.deleted=k("td",{class:["diff-otitle","diff-side-deleted"],colSpan:2}),e.added=k("td",{class:["diff-ntitle","diff-side-added"],colSpan:2}))),e.body=k("tbody")),a(i)?i===""&&(e.notice=k("tr",k("td",{class:"diff-notice",colSpan:4},k("div",{class:"mw-diff-empty"},mw.msg("diff-empty")))),e.body.append(e.notice)):Pi(e.body,i),e}function dt(i){i={prefix:"n",title:null,revid:null,curRevid:null,hostname:null,timestamp:null,texthidden:!1,user:null,userhidden:!1,comment:null,commenthidden:!1,...i};let e=`mw-diff-${i.prefix}title`,t=i.revid===i.curRevid?"currentrev-asof":"revisionasof",s=new W({type:"revision",title:i.title,oldid:i.revid,hostname:i.hostname});return mi(k("div",{id:`${e}1`},k("strong",i.texthidden?k("span",{class:"history-deleted"},mw.msg(t,je(i.timestamp))):k("a",{href:N(s)},mw.msg(t,je(i.timestamp))))),k("div",{id:`${e}2`},i.userhidden?k("span",{class:["mw-userlink","history-deleted"]},mw.msg("rev-deleted-user")):bi(s,i.user)),k("div",{id:`${e}3`},i.commenthidden?k("span",{class:["comment","history-deleted"]},mw.msg("rev-deleted-comment")):a(i.comment)?k("span",{class:["comment","mw-comment-none"]},mw.msg("changeslist-nocomment")):k("span",{class:["comment","comment--without-parentheses"],innerHTML:i.comment})))}function Be(i){l.get("showRevisionInfo")?(i.find("td:is(.diff-otitle, .diff-side-deleted)").addClass("instantDiffs-hidden"),i.find("td:is(.diff-ntitle, .diff-side-added)").attr("colspan","4"),i.find("tr:not([class])").addClass("instantDiffs-hidden")):i.addClass("instantDiffs-hidden")}function bi(i,e){let t=new mw.Title(e,2).getPrefixedText(),s=new mw.Title(e,3).getPrefixedText(),n=new mw.Title(`Contributions/${e}`,-1).getPrefixedText(),r=mi(k("a",{class:["mw-redirect","mw-usertoollinks-talk"],title:s,href:U(i,mw.util.getUrl(s))},mw.msg("talkpagelinktext")),zs(mw.msg("pipe-separator")),k("a",{class:["mw-redirect","mw-usertoollinks-talk"],title:n,href:U(i,mw.util.getUrl(n))},mw.msg("contribslink")));return mi(Ks(e),k("a",{class:"mw-userlink",title:t,href:U(i,mw.util.getUrl(t))},k("bdi",e)),zs(mw.msg("word-separator")),k("span",{class:"mw-usertoollinks"},ho(mw.message("parentheses",r).parseDom())))}function Ks(i){if(!mw.user.options.get("checkuser-userinfocard-enable")||!_s(i))return;let e=["cdx-button__icon","ext-checkuser-userinfocard-button__icon",Gs(i)?"ext-checkuser-userinfocard-button__icon--userTemporary":"ext-checkuser-userinfocard-button__icon--userAvatar"],t=k("a",{class:"ext-checkuser-userinfocard-button cdx-button cdx-button--action-default cdx-button--weight-quiet cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cd-comment-author-userInfoCard-button",role:"button",tabindex:0,href:"javascript:void(0)",ariaLabel:mw.msg("checkuser-userinfocard-toggle-button-aria-label"),"data-username":i},k("span",{class:e}));return t.setAttribute("aria-haspopover","dialog"),t}function vi(i){i={title:null,revid:null,hostname:null,user:null,userhidden:!1,...i};let e=new W({type:"revision",title:i.title,oldid:i.revid,hostname:i.hostname});return k("div",{class:["mw-diff-mobile-footer"]},i.userhidden?k("span",{class:["mw-userlink","history-deleted"]},mw.msg("rev-deleted-user")):bi(e,i.user))}function ki(i){if(!i||i.length===0||mw.loader.getState("mediawiki.diff")!=="ready")return!1;let e=i.find("#mw-diffPage-inline-toggle-switch-layout"),t=ot("mediawiki.diff","./inlineFormatToggle.js");try{return t(e),!0}catch{}return!1}function yi(i){if(!i||i.length===0||!h(mw.config.get("wgDiffOldId"))||!h(mw.config.get("wgDiffNewId"))||!ut(mw.config.get("wgPageContentModel"))||mw.loader.getState("ext.visualEditor.diffPage.init")!=="ready")return!1;let e=i.find(".ve-init-mw-diffPage-diffMode");if(e.length>0)return!0;e=$("<div>").addClass("ve-init-mw-diffPage-diffMode");let t=i.find(".mw-diffPage-inlineToggle-container");return t.length>0?t.before(e):i.append(e),!0}function ut(i){let e=mw.config.get("wgVisualEditorConfig");return e&&Object.prototype.hasOwnProperty.call(e.contentModels,i)}function xi(i){if(!i||i.length===0)return!1;let e=['.mw-rollback-link a[data-mw="interface"]',".mw-rollback-link a[data-mw-interface]"];return i.confirmable({i18n:{confirm:mw.msg("rollback-confirmation-confirm"),yes:mw.msg("rollback-confirmation-yes"),no:mw.msg("rollback-confirmation-no")},delegate:e.join(","),handler:t=>{t.preventDefault(),po(t.target)}}),!0}function po(i){let e=$.createSpinner({size:"small",type:"inline"});$(i).css("display","none").after(e);let t={action:"rollback",title:Si(i.href),user:mw.util.getParamValue("from",i.href),token:mw.util.getParamValue("token",i.href),formatversion:2,uselang:o.local.userLanguage};b.post(t).then(s=>{let n=$(ft(s?.rollback?.summary));fe(n),mw.notify(n,{tag:"rollback"}),$(i).closest(".mw-rollback-link").remove(),L.refresh()}).catch((s,n)=>{let r=$(ft(n?.error?.info));fe(r),mw.notify(r,{type:"error",tag:"rollback"}),e.remove(),$(i).css("display","")})}function Di(i){return!i||i.length===0?!1:(mw.loader.using(["@wikimedia/codex","ext.wikilambda.app"]).then(e=>{let{createMwApp:t}=e("vue"),{createPinia:s}=e("pinia"),{useMainStore:n,App:r}=e("ext.wikilambda.app");if(mw.config.get("wgWikiLambda")){let c=s(),p=n(c);window.vueInstance=t(Object.assign({provide:()=>({viewmode:p.getViewMode})},r)).use(c).mount(i.get(0))}}),!0)}async function Li(i){if(!i||i.length===0)return;let e=["wikibasemediainfo-filepage-fileinfo-heading","wikibasemediainfo-filepage-structured-data-heading"];return await b.loadMessage(e),go(i)}function go(i){let e=new OO.ui.TabPanelLayout("captions",{expanded:!1,label:mw.msg("wikibasemediainfo-filepage-fileinfo-heading"),$content:i.find("mediainfoviewcaptions")}),t=new OO.ui.TabPanelLayout("statements",{expanded:!1,label:mw.msg("wikibasemediainfo-filepage-structured-data-heading"),$content:i.find("mediainfoviewstatements")}),s=new OO.ui.IndexLayout({expanded:!1,framed:!1});s.addTabPanels([e,t],0);let n=new OO.ui.PanelLayout({expanded:!1,framed:!1,content:[s]});return k("div",{class:"instantDiffs-page-mediaInfo"},n.$element.get(0))}var k,mi,zs,ho,ht=m(()=>{P();y();j();X();gi();B();le();ee();C();({h:k,hf:mi,ht:zs,hj:ho}=w)});var Ei,$i,Qs=m(()=>{y();Ei=class{config=mw.config;values={};backup={};constructor(e,t){t&&(this.config=t),this.setValues(e)}set(e,t){Object.hasOwn(this.backup,e)||(this.backup[e]=this.config.get(e)),this.values[e]=t}setValues(e){for(let[t,s]of Object.entries(e))this.set(t,s)}setTitle(e){a(e)||(R(e)&&(e=new mw.Title(e)),this.setValues({wgTitle:e.getMainText(),wgPageName:e.getPrefixedDb(),wgNamespaceNumber:e.getNamespaceId(),wgRelevantPageName:e.getPrefixedDb()}))}get(e){return this.values[e]}getValues(){return this.values}apply(){for(let[e,t]of Object.entries(this.values))t!==void 0&&this.config.set(e,t)}restore(){for(let[e,t]of Object.entries(this.backup))t!==void 0&&this.config.set(e,t)}},$i=Ei});var Ai,Js,Ys=m(()=>{B();Ai=class{items=new Map;get(e,t){let s=b.get(e,t);return this.add(s),s}ajax(e){let t=$.ajax(e);return this.add(t),t}when(...e){return $.when(...e)}abort(){this.items.forEach((e,t)=>t.abort())}add(e){let t=e.always(()=>this.delete(e));return this.items.set(e,t),t}delete(e){this.items.delete(e)}},Js=Ai});var Mi={};_(Mi,{getDaysLeftExpiry:()=>Ti,updateGlobalWatchlistStatus:()=>Oi,updateWatchButtonStatus:()=>pt,updateWatchlistStatus:()=>Ci});function Ti(i){if(!i||mw.util.isInfinity(i))return null;let e=new Date(i);return Math.ceil((e-new Date)/(1e3*60*60*24))}function pt(i,e){let t=i.get("watched"),s=t?"unwatch":"watch",n=i.get("expiry")||"infinity",r=Ti(n),c=`action-${s}`,p=mw.util.getUrl(i.get("title"),{action:s}),f,g;t?mw.util.isInfinity(n)?(f="unwatch",g="unStar"):(f=r>0?"unwatch-expiring":"unwatch-expiring-hours",g="halfStar"):(f="watch",g="star"),e.setLabel(d(c)),e.setTitle(mw.msg(`tooltip-ca-${f}`,r)),e.setHref(U(i,p)),e.setIcon(g)}function Ci(i,e,t){let s=i.get("titleText");e?Zs(s,(n,r,c)=>{r.find(".mw-changelist-line-inner-unwatched").addBack(".mw-enhanced-rc-nested").removeClass("mw-changelist-line-inner-unwatched"),c.length>0&&c.text(mw.msg("watchlist-unwatch")).attr("title",mw.msg("tooltip-ca-unwatch")).attr("href",mw.util.getUrl(n,{action:"unwatch"})).removeClass("mw-watch-link loading").addClass("mw-unwatch-link"),Xs(r,e,t)}):Zs(s,(n,r,c)=>{r.find(".mw-changeslist-line-inner, .mw-enhanced-rc-nested").addBack(".mw-enhanced-rc-nested").addClass("mw-changelist-line-inner-unwatched"),c.length>0&&c.text(mw.msg("watchlist-unwatch-undo")).attr("title",mw.msg("tooltip-ca-watch")).attr("href",mw.util.getUrl(n,{action:"watch"})).removeClass("mw-unwatch-link loading").addClass("mw-watch-link"),Xs(r,e,t)})}function Xs(i,e,t){if(!e)return;let s=i.find(".mw-changesList-watchlistExpiry");if(mw.util.isInfinity(t))return mo(i,s);let n=Ti(t),r=n>0?"days-full-text":"hours-full-text",c=mw.msg(`watchlist-expiring-${r}`,n);s.length>0?s.each((p,f)=>{f.title=c}):wo(i,c)}function mo(i,e){e.each((t,s)=>{let n=$(s);n.next(".mw-changeslist-separator").addClass("mw-changeslist-separator--semicolon").removeClass("mw-changeslist-separator"),s.previousSibling.nodeValue=s.previousSibling.nodeValue.trimEnd(),s.nextSibling.nodeValue=s.nextSibling.nodeValue.trimStart(),n.next(".mw-changeslist-links").before(" "),e.remove()}),i.find(".mw-changeslist-line-inner-historyLink").prepend(" ")}function wo(i,e){i.find(".mw-title").each((t,s)=>{let n=$(s),r=n.next(".mw-fr-reviewlink"),c=new OO.ui.IconWidget({icon:"clock",title:e,classes:["mw-changesList-watchlistExpiry"]});(r.length>0?r:n).after(" ").after(c.$element).after(" "),c.$element.next(".mw-changeslist-separator--semicolon").addClass("mw-changeslist-separator").removeClass("mw-changeslist-separator--semicolon")})}function Zs(i,e){let t=mw.Title.newFromText(i),n=(t.isTalkPage()?t.getSubjectPage():t.getTalkPage()).getPrefixedText();$(".mw-changeslist-line").each((r,c)=>{$(c).find("[data-target-page]").each((f,g)=>{let S=$(g),u=String(S.data("targetPage"));if(u===i||u===n){let v=S.closest("li, .mw-enhancedchanges-checkbox + table.mw-changeslist-log td[data-target-page], table"),D=v.find(".mw-unwatch-link, .mw-watch-link");e(u,v,D)}})})}function Oi(i,e,t){if(mw.globalwatchlist)try{let s=mw.globalwatchlist.watchedSites.siteList.find(n=>n.site===i.get("hostname"));if(!s)return;s.processUpdateWatched(i.get("origTitle"),!e)}catch(s){E("error-global-watchlist",{article:i,tag:"watch",message:s?.message||s,silent:!0})}}var Ii=m(()=>{y();X()});var bo,Ri,gt,Wi=m(()=>{P();y();Ii();j();C();B();({h:bo}=w),Ri=class{static utils=Mi;static notificationId="mw-watchlink-notification";article;options={};preferredExpiry;isWatchlistExpiryEnabled=!1;watchlistLabelsEnabled=!1;isWatchListPopupEnabled=!1;isWatched=!1;$watchLink;watchlistPopupWrapper;watchlistPopup;constructor(e,t){this.article=e,this.options={onUpdate:()=>{},...t},this.$watchLink=$('<a class="instantDiffs-button--fake-watch">'),I(this.$watchLink,document.body);let s=ot("mediawiki.page.watch.ajax","config.json")||{};this.isWatchlistExpiryEnabled=!this.article.isForeign&&(s.WatchlistExpiry||!1),this.watchlistLabelsEnabled=!this.article.isForeign&&(s.EnableWatchlistLabels||!1),this.isWatchListPopupEnabled=l.get("showWatchlistPopup")&&(this.isWatchlistExpiryEnabled||this.watchlistLabelsEnabled);let n=["mediawiki.notification"];(this.isWatchlistExpiryEnabled||this.watchlistLabelsEnabled)&&n.push("mediawiki.watchstar.widgets"),this.watchlistLabelsEnabled&&n.push("mediawiki.widgets.MenuTagMultiselectWidget"),mw.loader.load(n)}async preloadMessages(){await b.loadMessage(["watchlist-expiring-days-full-text","watchlist-expiring-hours-full-text","tooltip-ca-watch","tooltip-ca-unwatch","tooltip-ca-unwatch-expiring","tooltip-ca-unwatch-expiring-hours"])}async request(){return await this.preloadMessages(),this.preferredExpiry=mw.user.options.get("watchstar-expiry","infinity"),this.isWatched=this.article.get("watched"),l.get("expEnableWatchlistPopup")&&this.isWatchListPopupEnabled?this.requestModules():this.requestWatchStatus()}requestModules(){return mw.loader.using("mediawiki.watchstar.widgets").then(e=>{let t=e("mediawiki.watchstar.widgets");return Ae(t)?this.showWatchlistPopup():this.requestWatchStatus()})}requestWatchStatus(){let e=this.article.getMW("title").getPrefixedDb();return(this.isWatched?b.unwatch(e,this.article):b.watch(e,this.preferredExpiry,this.article)).then(this.showNotice).fail(this.showError)}showError=(e,t)=>{let s=b.getApi().getErrorMessage(t);mw.notify(s,{tag:"watch-self",type:"error",id:this.constructor.notificationId})};showNotice=e=>{if(!e)return this.showError(void 0,e);this.isWatched=e.watched===!0;let t=this.article.getMW("title"),s=e.expiry||"infinity",n=this.isWatched?"addedwatchtext":"removedwatchtext";t.isTalkPage()&&(n+="-talk");let r;this.isWatchListPopupEnabled?(this.isWatched&&(n=!this.preferredExpiry||mw.util.isInfinity(this.preferredExpiry)?"addedwatchindefinitelytext":"addedwatchexpirytext",t.isTalkPage()&&(n+="-talk")),r=this.showWatchlistNotice(t,n,s)):r=this.showBasicNotice(t,n),r.always(()=>{let c=this.isWatched?"unwatch":"watch";this.updateStatus(this.$watchLink,c,"idle",s,"infinity")})};getNoticeMessage(e,t){let s=this.article.get("hostname"),n=mw.message(t,e.getPrefixedText(),this.preferredExpiry).parseDom();return Q(n,`https://${s}`),fe(n),n}showBasicNotice(e,t){let s=this.getNoticeMessage(e,t);return mw.notify(s,{tag:"watch-self",id:this.constructor.notificationId})}showWatchlistNotice(e,t,s){return mw.loader.using("mediawiki.watchstar.widgets").then(n=>{let r=n("mediawiki.watchstar.widgets");if(!r)return this.showBasicNotice(e,t);let c=this.getNoticeMessage(e,t),p=[this.isWatched?"watch":"unwatch",e.getPrefixedDb(),s,this.updateStatus,{expiryEnabled:this.isWatchlistExpiryEnabled,labelsEnabled:this.watchlistLabelsEnabled,$link:this.$watchLink,message:c}];Ni(mw.config.get("wgVersion"),"1.45.0")<0&&p.splice(2,1);try{let f=new r(...p);mw.notify(f.$element,{tag:"watch-self",id:this.constructor.notificationId,autoHideSeconds:"short"})}catch(f){ve(this.constructor.name,"Falls back to basic watch/unwatch functionality.",f),this.showBasicNotice(e,t)}})}showWatchlistPopup(){return this.watchlistPopup?(this.watchlistPopup.isOpen?this.watchlistPopup.isOpen=!1:this.watchlistPopup.openPopup(this.$watchLink[0]),$.Deferred().resolve().promise()):mw.loader.using(["@wikimedia/codex","mediawiki.watchstar.widgets"]).then(e=>{let t=e("vue"),s=e("mediawiki.watchstar.widgets"),n=s.WatchlistPopup;this.watchlistPopupWrapper=bo("span.mw-watchlink-popup"),I(this.watchlistPopupWrapper,document.body),this.watchlistPopup=t.createMwApp(n,{initialAction:this.isWatched?"unwatch":"watch",expiryEnabled:this.isWatchlistExpiryEnabled,labelsEnabled:this.watchlistLabelsEnabled,title:this.article.getMW("title"),dataExpiryOptions:s.dataExpiryOptions,preferredExpiry:this.preferredExpiry,link:this.$watchLink[0]}).mount(this.watchlistPopupWrapper),window.addEventListener("WatchlistPopup.watch",this.onWatchlistPopupWatch),window.addEventListener("WatchlistPopup.unwatch",this.onWatchlistPopupUnwatch)})}onWatchlistPopupWatch=e=>{this.isWatched=!0;let t=e.detail?.watchResponse?e.detail.watchResponse.expiry||e.detail.watchResponse._rawValue?.expiry:"infinity";this.updateStatus(this.$watchLink,"unwatch","idle",t)};onWatchlistPopupUnwatch=e=>{this.isWatched=!1,this.updateStatus(this.$watchLink,"watch","idle")};updateStatus=(e,t,s,n="infinity",r="infinity")=>{let c=t==="unwatch";if(this.isWatched=c,this.article.setValues({watched:c,expiry:n,expirySelected:r}),this.options.onUpdate(s),!this.article.isForeign&&o.local.mwTitleText===this.article.get("titleText")){let{updatePageWatchStatus:p}=qe("mediawiki.page.watch.ajax")||{};p?.(c,n,r)}s!=="loading"&&(!this.article.isForeign&&o.local.mwCanonicalSpecialPageName==="Watchlist"&&Ci(this.article,c,n),o.local.mwCanonicalSpecialPageName==="GlobalWatchlist"&&Oi(this.article,c,n))};getArticle(){return this.article}detach(){this.watchlistPopup&&(window.removeEventListener("WatchlistPopup.watch",this.onWatchlistPopupWatch),window.removeEventListener("WatchlistPopup.unwatch",this.onWatchlistPopupUnwatch),this.watchlistPopup.isOpen=!1,this.watchlistPopupWrapper.remove()),this.$watchLink.detach()}},gt=Ri});var Fi={};_(Fi,{default:()=>vo});var mt,vo,Vi=m(()=>{y();j();X();Ee();C();mt=class extends OO.ui.ButtonWidget{options={};invisibleIcon=!1;link;handler;constructor(e){e={name:null,type:"default",classes:[],framed:!0,invisibleLabel:!1,invisibleIcon:!1,icon:"puzzle",href:null,target:Ve(!0),handler:null,useAltKey:!1,article:null,setLink:!1,...e,linkOptions:{behavior:"event",...e.linkOptions}},e.type==="navigation"&&(e.icon=null,e.classes=[...e.classes,"instantDiffs-button--navigation"]),e.type==="pin"&&(e.invisibleLabel=!0,e.classes=[...e.classes,"instantDiffs-button--pin"]),e.type==="menu"&&(e.classes=[...e.classes,"instantDiffs-button--link"],e.framed=!1,l.get("showMenuIcons")||(e.invisibleIcon=!0)),a(e.href)||(e.href=U(e.article,e.href)),super(e),this.options=e,this.setInvisibleIcon(e.invisibleIcon),e.handler&&this.setHandler(e.handler,e.useAltKey),e.setLink&&this.setLink(e.linkOptions)}setInvisibleIcon(e){return e=!!e,this.invisibleIcon!==e&&(this.invisibleIcon=e,this.$element.toggleClass("instantDiffs-invisibleIconElement",!this.icon||this.invisibleIcon)),this}setLink(e){return this.link=new O(this.$button.get(0),e),this}setHandler(e,t){if(x(this.handler)&&ji(this.$button.get(0),this.handler),x(e)){let s=n=>e(this,n);this.handler=Ne(this.$button.get(0),s,t)}return this}execHandler(){return this.$button.get(0).click(),this}getOption(e){return this.options[e]}getOptions(){return this.options}getArticle(){return this.getOption("article")}pending(e){return this.$button.toggleClass("instantDiffs-link--pending",e),this}};H(mt);vo=mt});var qi,en,tn=m(()=>{y();C();qi=class{article;options={};groups={};buttons={};MenuButton;constructor(e,t){this.article=e,this.options={...t},this.MenuButton=(Vi(),De(Fi)).default}renderGroup(e){return e={name:null,group:null,widget:null,type:"vertical",classes:[],container:null,...e},e.type==="vertical"&&e.classes.push("instantDiffs-buttons-group","instantDiffs-buttons-group--vertical",`instantDiffs-buttons-group--${e.name}`,l.get("showMenuIcons")?"has-icons":null),e.type==="horizontal"&&e.classes.push("instantDiffs-buttons-group","instantDiffs-buttons-group--horizontal",`instantDiffs-buttons-group--${e.name}`),e.widget=new OO.ui.ButtonGroupWidget(e),I(e.widget.$element,e.container),this.registerGroup(e)}registerGroup(e){if(e={name:null,group:null,widget:null,...e},!this.groups[e.name])return this.groups[e.name]=e,e}getGroup(e){return this.groups[e]}getGroups(e){return Object.values(this.groups).filter(t=>!e||e===t.group)}getGroupsWidgets(e){return this.getGroups(e).map(t=>t.widget)}getGroupsElements(e){return this.getGroups(e).map(t=>t.widget.$element.get(0))}addGroupButtons(e,t){let s=this.getGroup(e);if(!s)return;t=z(t)?t:[t];let n=t.map(r=>r.widget);s.widget.addItems(n)}getGroupButtons(e){return this.getButtons().filter(t=>wt(e,t.group))}renderButton(e){if(e={article:this.article,name:null,group:null,canSystem:!1,systemType:"pin",systemGroup:"navigation",canPin:!1,pinType:"pin",pinGroup:"pins",canMenu:!0,menuGroup:"menu",menuType:"menu",widget:null,...e},this.buttons[e.name])return;let t=this.buttons[e.name]=[];if(e.canSystem){let s=this.renderButtonHelper({...e,type:e.systemType,group:e.systemGroup,isSystem:!0});t.push(s)}if(e.canPin&&wt(l.get("pinnedActions"),e.name)){let s=this.renderButtonHelper({...e,type:e.pinType,group:e.pinGroup,isPin:!0});t.push(s)}if(e.canMenu){let s=this.renderButtonHelper({...e,type:e.menuType,group:e.menuGroup,isMenu:!0});t.push(s)}return t}renderButtonHelper(e){return e.widget=new this.MenuButton(e),this.addGroupButtons(e.group,e),e}registerButton(e){if(e={name:null,group:null,type:null,widget:null,...e},!this.buttons[e.name])return this.buttons[e.name]=[e],this.addGroupButtons(e.group,e),e}getButton(e,t){if(this.buttons[e])return this.buttons[e].filter(n=>!t||R(t)&&n.group===t||z(t)&&t.includes(n.group))}getButtonWidget(e,t){let s=this.getButton(e,t);if(s)return s.map(n=>n.widget)}getButtons(){return Object.values(this.buttons).flat()}eachButton(e,t,s){let n=this.getButton(e,t);n&&n.forEach(r=>s(r))}eachButtonWidget(e,t,s){let n=this.getButtonWidget(e,t);n&&n.forEach(r=>s(r))}focusButton(e,t){let s=!1;return this.eachButtonWidget(e,t,n=>{if(!n.isDisabled())return n.focus(),s=!0,!0}),s}pendingButton(e,t,s){this.eachButtonWidget(e,t,n=>{n.pending(s)})}},en=qi});var sn=m(()=>{});var nn={};_(nn,{default:()=>ko});var bt,ko,on=m(()=>{y();j();C();bt=class extends OO.ui.PopupButtonWidget{constructor(e){e=J({icon:"menu",label:d("goto-actions"),title:q("goto-actions","actions",l.get("enableHotkeys")),invisibleLabel:!0,popup:{classes:["instantDiffs-buttons-popup",l.get("showMenuIcons")?"has-icons":null],width:"auto",padded:!1,anchor:!1,align:"backwards",autoClose:!0}},e),super(e)}execHandler(){return this.$button.get(0).click(),this}togglePopup(e){return this.getPopup().toggle(e),this}pending(e){return this.$button.toggleClass("instantDiffs-link--pending",e),this}};H(bt);ko=bt});var ke,yo,xo,Bi,rn,an=m(()=>{P();y();Le();X();Ii();le();pi();Wi();tn();ee();C();sn();({h:ke,hf:yo,ht:xo}=w),Bi=class{MenuActionsButton;MenuButton;page;article;articleParams={};options={};nodes={};actionRegister;watch;menu;isDetached=!1;constructor(e,t,s,n){this.page=e,this.article=t,this.articleParams={...s},this.options={initiatorAction:null,links:{},...n},this.MenuActionsButton=(on(),De(nn)).default,this.MenuButton=(Vi(),De(Fi)).default,L.connect(this,{hotkey:"onHotkey"}),this.render()}render(){this.nodes.container=ke("div",{class:["instantDiffs-navigation"]},this.nodes.left=ke("div",{class:["instantDiffs-navigation-group","instantDiffs-navigation-group--left"]}),this.nodes.center=ke("div",{class:["instantDiffs-navigation-group","instantDiffs-navigation-group--center"]}),this.nodes.right=ke("div",{class:["instantDiffs-navigation-group","instantDiffs-navigation-group--right"]})),this.renderMenu(),this.renderSnapshotLinks(),this.renderNavigationLinks(),this.renderActionLinks(),mw.hook(`${o.config.prefix}.navigation.complete`).fire(this)}groupsMap={left:["snapshot"],center:["navigation"],right:["pins-custom","pins"]};groups=[];actionGroupsMap=["mobile","menu-custom","menu","footer"];actionGroups=[];renderMenu(){this.menu=new en(this.article);for(let[e,t]of Object.entries(this.groupsMap))t.forEach(s=>{this.groups.push(s),this.menu.renderGroup({name:s,group:e,type:"horizontal",container:this.nodes[e]})});this.actionGroupsMap.forEach(e=>{this.actionGroups.push(e),this.menu.renderGroup({name:e,group:"actions",type:"vertical"})})}renderSnapshotLinks(){let e={canSystem:!0,systemType:"pin",systemGroup:"snapshot",canPin:!1,canMenu:!1},t={canMenu:!0,menuGroup:"mobile"};this.renderSnapshotPrevLink(e),this.renderSnapshotNextLink(e),this.page.getInitiatorPage()&&this.renderBackLink({...e,...t}),a(this.options.links.unpatrolled)||this.renderUnpatrolledLink({...e,...t})}renderNavigationLinks(){let e={canSystem:!0,systemType:"navigation",systemGroup:"navigation",canPin:!1,canMenu:!1},t={canMenu:!0,menuGroup:"mobile"};this.renderPrevLink(e),["page"].includes(this.article.get("typeVariant"))||this.renderSwitchLink({...e,...t}),this.renderNextLink(e)}renderActionLinks(){this.renderMenuLinks(),this.renderMenuFooterLinks(),this.renderMenuActions()}renderMenuLinks(){let e={canPin:!0,pinGroup:"pins",canMenu:!0,menuGroup:"menu"};this.renderCopyLink(e),this.renderCopyWikilink(e),this.renderTypeLink(e),a(this.article.get("title"))||(this.renderPageLink(e),this.article.getMW("title").canHaveTalkPage()&&this.renderTalkPageLink(e),Kt(mw.config.get("wgPageContentModel"))&&this.renderEditLink(e),this.renderHistoryLink(e),this.renderInfoLink(e),o.local.mwIsAnon||this.renderWatchLink(e)),this.renderSettingsLink(e)}renderMenuFooterLinks(){let e={canPin:!1,canMenu:!0,menuGroup:"footer"};this.renderIDLink(e)}renderMenuActions(){let e=Ui(this.menu.getGroupsElements("actions"),ke("hr.instantDiffs-buttons-separator")),t=new this.MenuActionsButton({popup:{$content:$(e)}});this.menu.registerButton({name:"actions",group:"pins",type:"pin",widget:t})}renderSnapshotPrevLink(e){let t=be.instance.getPreviousLink();e={name:"snapshotPrev",label:d("goto-snapshot-prev"),title:q("goto-snapshot-prev","snapshot-prev",l.get("enableHotkeys")),icon:"doubleChevronStart",href:t?t.href:null,disabled:!t,setLink:!!t,linkOptions:{initiatorLink:t,onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderSnapshotNextLink(e){let t=be.instance.getNextLink();e={name:"snapshotNext",label:d("goto-snapshot-next"),title:q("goto-snapshot-next","snapshot-next",l.get("enableHotkeys")),icon:"doubleChevronEnd",href:t?t.href:null,disabled:!t,setLink:!!t,linkOptions:{initiatorLink:t,onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderPrevLink(e){let t;if(this.options.links.prev){let n=new W({title:this.article.get("title"),hostname:this.article.get("hostname"),oldid:mw.config.get("wgDiffOldId"),diff:this.article.get("type")==="diff"?"prev":null,direction:this.article.get("type")==="revision"?"prev":null});t=N(n)}let s=vt({short:d("goto-prev"),long:d(`goto-prev-${this.article.get("type")}`),iconBefore:document.dir==="ltr"?"\u2190":"\u2192"});e={name:"prev",label:$(s),title:q(`goto-prev-${this.article.get("type")}`,"prev",l.get("enableHotkeys")),href:t,disabled:!t,setLink:!!t,linkOptions:{onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderNextLink(e){let t;if(this.options.links.next){let n=new W({title:this.article.get("title"),hostname:this.article.get("hostname"),oldid:mw.config.get("wgDiffNewId"),diff:this.article.get("type")==="diff"?"next":null,direction:this.article.get("type")==="revision"?"next":null});t=N(n)}let s=vt({short:d("goto-next"),long:d(`goto-next-${this.article.get("type")}`),iconAfter:document.dir==="ltr"?"\u2192":"\u2190"});e={name:"next",label:$(s),title:q(`goto-next-${this.article.get("type")}`,"next",l.get("enableHotkeys")),href:t,disabled:!t,setLink:!!t,linkOptions:{onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderSwitchLink(e){let t=this.article.get("type")==="diff"?"revision":"diff",s={type:t};e={name:"switch",label:d(`goto-view-${t}`),title:q(`goto-view-${t}`,"switch",l.get("enableHotkeys")),icon:"specialPages",href:N(this.article,{},s),classes:["instantDiffs-button--switch"],setLink:!0,linkOptions:{onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderUnpatrolledLink(e){e={name:"unpatrolled",label:d("goto-view-unpatrolled"),title:q("goto-view-unpatrolled","unpatrolled",l.get("enableHotkeys")),icon:"eyeClosed",href:this.options.links.unpatrolled,classes:["instantDiffs-button--pending"],setLink:!0,linkOptions:{initiatorPage:this.page,onRequest:()=>this.setActionRegister(e.name)},...e},this.menu.renderButton(e)}renderBackLink(e){let t=this.page.getInitiatorPage(),s=t.getArticle();e={name:"back",label:d(`goto-back-${s.get("type")}`),title:q(`goto-back-${s.get("type")}`,"back",l.get("enableHotkeys")),icon:"newline",href:N(s,t.getArticleParams()),classes:["instantDiffs-button--back"],setLink:!0,linkOptions:{onRequest:()=>{let n=t.getNavigation()?.getActionRegister(),r=a(n)?e.name:`${e.name}-${n}`;this.setActionRegister(r)}},...e},this.menu.renderButton(e)}renderCopyLink(e){this.menu.renderButton({name:"copyLink",label:d("copy-link"),icon:"link",handler:this.actionCopyLink.bind(this),...e})}renderCopyWikilink(e){this.menu.renderButton({name:"copyWikilink",label:d("copy-wikilink"),icon:"wikiText",handler:this.actionCopyWikilink.bind(this),...e})}renderTypeLink(e){let t=this.article.get("type"),s={hash:l.get("linksHash")};this.menu.renderButton({name:"link",label:d(`goto-${t}`),icon:"articleRedirect",href:N(this.article,{},s),...e})}renderPageLink(e){let t=this.article.getMW("title").isTalkPage()?this.article.getMW("title").getSubjectPage().getUrl():this.article.get("href"),s={2:"userAvatar",3:"userAvatar",default:"article"};this.menu.renderButton({name:"page",label:d("goto-page"),icon:s[this.article.getMW("title").getNamespaceId()]||s.default,href:t,...e})}renderTalkPageLink(e){let t=this.article.getMW("title").isTalkPage()?this.article.get("href"):this.article.getMW("title").getTalkPage().getUrl(),s={2:"userTalk",3:"userTalk",default:"speechBubbles"};this.menu.renderButton({name:"talkPage",label:d("goto-talkpage"),icon:s[this.article.getMW("title").getNamespaceId()]||s.default,href:t,...e})}renderEditLink(e){let t=mw.config.get("wgIsProbablyEditable"),s=mw.util.getUrl(this.article.get("title"),{action:"edit"});this.menu.renderButton({name:"edit",label:d(t?"goto-edit":"goto-source"),icon:t?"edit":"editLock",href:s,...e})}renderHistoryLink(e){let t=mw.util.getUrl(this.article.get("title"),{action:"history"});this.menu.renderButton({name:"history",label:d("goto-history"),icon:"history",href:t,...e})}renderInfoLink(e){let t=mw.util.getUrl(this.article.get("title"),{action:"info"});this.menu.renderButton({name:"info",label:d("goto-info"),icon:"info",href:t,...e})}renderWatchLink(e){this.menu.renderButton({name:"watch",label:d("action-watch"),handler:this.actionWatchPage.bind(this),...e}),this.menu.eachButtonWidget("watch",null,t=>{pt(this.article,t)})}renderSettingsLink(e){this.menu.renderButton({name:"settings",label:d("goto-settings"),icon:"settings",handler:this.actionOpenSettings.bind(this),...e})}renderIDLink(e){let t=yo(ke("span.name",d("script-name")),xo(" "),ke("span.version",`v.${o.config.version}`));this.menu.renderButton({name:"id",label:$(t),icon:null,href:kt(`/wiki/${o.config.link}`),classes:["instantDiffs-button--link-id"],...e})}actionCopyLink(e){let t={relative:!1,hash:l.get("linksHash"),minify:l.get("linksFormat")==="minify"},s=N(this.article,{},t);He(s),this.focusAction(e)}actionCopyWikilink(e){this.pendingAction(e,!0),$.when(si(this.article)).done(t=>{He(t)}).fail(()=>{He(!1)}).always(()=>{this.pendingAction(e,!1),this.focusAction(e)})}actionWatchPage(e){this.pendingAction(e,!0),this.watch||(this.watch=new gt(this.article,{onUpdate:t=>{this.menu.eachButtonWidget("watch",null,s=>{s.pending(t==="loading"),pt(this.article,s)})}})),$.when(this.watch.request()).always(()=>{this.pendingAction(e,!1),this.focusAction(e)})}actionOpenSettings(e){this.pendingAction(e,!0),l.once("opening",()=>this.toggleActions(!1)),l.once("closed",()=>this.focusAction(e)),$.when(l.load()).always(()=>{this.pendingAction(e,!1)})}actionCounterparts={unpatrolled:"back","back-unpatrolled":"unpatrolled"};disabledActionCounterparts={next:"prev",prev:"next",snapshotNext:"snapshotPrev",snapshotPrev:"snapshotNext"};focusAction(e){return this.toggleActions(!1),e instanceof this.MenuButton?this.focusActionByWidget(e):R(e)?this.focusActionByName(e):!1}focusActionByWidget(e){if(e.isDisabled())return!1;let t=e.getOption("group");return this.groups.includes(t)?(e.focus(),!0):this.focusActionByName("actions")}focusActionByName(e){return e=this.actionCounterparts[e]||e,this.menu.focusButton(e,this.groups)?!0:(e=this.disabledActionCounterparts[e],e?this.menu.focusButton(e,this.groups):!1)}getActionName(e){if(e instanceof this.MenuButton)return e.getOption("name");if(R(e))return e}pendingAction(e,t){this.getActionName(e)&&this.menu.pendingButton(this.getActionName(e),null,t)}execAction(e){let t=this.getActionName(e);t&&(t!=="actions"&&this.toggleActions(!1),this.menu.eachButtonWidget(t,null,s=>{if(!s.isDisabled())return s.focus(),s.execHandler(),!0}))}toggleActions(e){this.menu.eachButtonWidget("actions",this.groups,t=>{t.togglePopup(e)})}setActionRegister(e){this.actionRegister=e}getActionRegister(){return this.actionRegister}getPinnableActions(){return this.menu.getButtons().filter(e=>e.canPin)}addCustomAction(e){e={...e,canSystem:!1,canPin:!0,pinGroup:"pins-custom",canMenu:!0,menuGroup:"menu-custom"},!a(e.name)&&(e.name=`custom-${e.name}`,this.menu.renderButton(e))}getCustomAction(e){let t;return e instanceof this.MenuButton&&(t=e.getOption("name")),R(e)&&(t=`custom-${e}`),this.menu.getButton(t,["pins-custom","menu-custom"])}getCustomActionWidget(e){let t=this.getCustomAction(e);if(t)return t.map(s=>s.widget)}eachCustomAction(e,t){let s=this.getCustomAction(e);s&&s.forEach(n=>t(n))}eachCustomActionWidget(e,t){let s=this.getCustomActionWidget(e);s&&s.forEach(n=>t(n))}actionHotkeyMap={none:{ArrowLeft:"prev",ArrowRight:"next"},ctrl:{ArrowLeft:"snapshotPrev",ArrowRight:"snapshotNext",ArrowUp:"switch",ArrowDown:"actions",KeyZ:"back",KeyP:"unpatrolled"},alt:{},shift:{}};actionHotkeyMapRTL={none:{ArrowRight:"prev",ArrowLeft:"next"},ctrl:{ArrowRight:"snapshotPrev",ArrowLeft:"snapshotNext"}};getActionHotkeyMap(){return document.dir==="rtl"?J(this.actionHotkeyMap,this.actionHotkeyMapRTL):this.actionHotkeyMap}onHotkey(e){if(!l.get("enableHotkeys"))return;let t=this.getActionHotkeyMap(),s=e.altKey?"alt":e.ctrlKey?"ctrl":e.shiftKey?"shift":"none",n=t[s]?.[e.code];n&&(e.preventDefault(),e.stopPropagation(),this.execAction(n))}getOuterHeight(e=!1){return Hi(this.nodes.container,e)}getArticle(){return this.article}getMenu(){return this.menu}fire(){this.focusAction(this.options.initiatorAction)}embed(e,t){I(this.nodes.container,e,t)}detach(){this.watch?.detach(),this.toggleActions(!1),L.disconnect(this,{hotkey:"onHotkey"}),this.nodes.container.remove(),this.isDetached=!0}},rn=Bi});var ln=m(()=>{});var _i,ye,yt=m(()=>{P();y();ht();X();Le();B();Qs();Ys();an();C();ln();_i=class{static utils=Ue;type="abstract";article;options={};articleParams={};error;errorData;nodes={};links={};configManager;userOptionsManager;requestManager;loadPromise;navigation;isLoading=!1;isLoaded=!1;isConfigsChanged=!1;isDetached=!1;constructor(e,t){this.article=e,this.options={initiatorAction:null,initiatorPage:null,fireDiffHook:!0,fireContentHook:!0,...t},this.articleParams={action:"render",diffonly:this.article.get("type")==="diff"?1:0,unhide:l.get("unHideDiffs")?1:0,uselang:o.local.userLanguage},this.configManager=new $i({wgTitle:!1,wgPageName:!1,wgRelevantPageName:!1,wgPageContentModel:"wikitext",wgNamespaceNumber:!1,wgArticleId:!1,wgRelevantArticleId:!1,wgCurRevisionId:!1,wgRevisionId:!1,wgDiffOldId:!1,wgDiffNewId:!1,wgCanonicalSpecialPageName:!1,wgIsProbablyEditable:!1,wgRelevantPageIsProbablyEditable:!1,wbEntityId:!1,"thanks-confirmation-required":!0}),this.userOptionsManager=new $i({},mw.user.options),this.requestManager=new Js,OO.EventEmitter.call(this)}load(){return this.isLoading?this.loadPromise:(this.isLoading=!0,this.isLoaded=!1,this.error=null,this.errorData=null,this.loadPromise=this.preloadProcess())}preloadProcess(){let e=this.getPreloadPromises();return Promise.allSettled(e).then(this.loadProcess.bind(this))}loadProcess(){let e=this.getLoadPromises();return Promise.allSettled(e).then(this.onLoadResponse).then(this.loadProcessSecondary)}loadProcessSecondary=()=>{let e=this.getLoadSecondaryPromises();return Promise.allSettled(e)};getPreloadPromises(){return[this.requestCompare()]}getLoadPromises(){return[this.requestPageInfo(),this.request()]}getLoadSecondaryPromises(){return[this.requestWBLabel()]}onLoadResponse=async()=>{this.isLoading=!1,this.isLoaded=!0,!this.isDetached&&this.error?.statusText!=="abort"&&(a(this.data)?await this.renderError():await this.renderSuccess())};request(){return this.requestProcess().done(this.onRequestDone).fail(this.onRequestError)}requestProcess(){return this.requestManager.when()}onRequestError=(e,t)=>{this.error=e,this.errorData=t?.error};onRequestDone=e=>{this.data=e};requestCompare(){let e=this.article.getValues();if(this.error||e.typeVariant!=="comparePages"||h(e.oldid)&&h(e.diff))return $.Deferred().resolve().promise();let t={action:"compare",prop:["title","ids","timestamp","comment"],fromrev:h(e.rev1)?e.rev1:void 0,fromtitle:a(e.page1)?void 0:e.page1,torev:h(e.rev2)?e.rev2:void 0,totitle:a(e.page2)?void 0:e.page2,format:"json",formatversion:2,uselang:o.local.userLanguage};return this.requestManager.get(t,e.hostname).then(this.onRequestCompareDone).fail(this.onRequestCompareError)}onRequestCompareError=(e,t)=>{this.onRequestError(e,t)};onRequestCompareDone=e=>{let t=e?.compare;if(!t)return this.onRequestCompareError(null,e);this.article.set({oldid:t.fromrevid,diff:t.torevid,page1:t.fromtitle,page2:t.totitle,title:ce(t),section:Pe(t)})};async requestPageInfo(){let e=Math.max(this.article.get("revid"),this.article.get("oldid")),t=this.article.get("curid"),s=this.article.get("title"),n={};h(e)?n.revids=e:h(t)?n.pageids=t:a(s)||(n.titles=s);let r=await b.getPageInfo(n,this.article,this.requestManager);if(r){let c=r.pageprops||{},p=r.entityterms||{};this.configManager.setValues({wgArticleId:r.pageid,wgRelevantArticleId:r.pageid,wgCurRevisionId:r.lastrevid,wgContentLanguage:r.pagelanguage,wgContentLanguageDir:r.pagelanguagedir,wgPageContentModel:r.contentmodel,wgIsProbablyEditable:r.actions?.edit,wgRelevantPageIsProbablyEditable:r.actions?.edit,wbEntityId:c.wikibase_item||me(r.contentmodel)&&r.title||this.configManager.get("wbEntityId")}),this.article.setValues({title:r.title,curid:r.pageid,curRevid:r.lastrevid,watched:r.watched,expiry:r.watchlistexpiry,notificationtimestamp:r.notificationtimestamp,new:r.new,label:me(r.contentmodel)&&p.label?.[0]||r.contentmodel==="EntitySchema"&&Qt(c.displaytitle)||r.contentmodel==="zobject"&&Jt(c)||this.article.get("label")}),this.setConfigs()}}async requestWBLabel(){if(this.error||!a(this.article.get("label"))||!me(this.configManager.get("wgPageContentModel")))return $.Deferred().resolve().promise();let e=this.article.getMW("title")?.getMain(),t=await b.getWBLabel(e,this.article,this.requestManager);a(t)||(this.configManager.set("wbEntityId",e),this.article.setValue("label",t),this.setConfigs())}markAsSeen(){if(this.error||!l.get("markWatchedLine")||!this.article.isForeign||a(this.article.get("timestamp"))||a(this.article.get("notificationtimestamp")))return;let e=new Date(this.article.get("notificationtimestamp")).getTime();if(new Date(this.article.get("timestamp")).getTime()<e)return;let s={titles:this.article.get("titleText"),newerthanrevid:this.article.get("revid")};b.markAsSeen(s,this.article)}abort(){this.isLoading&&this.requestManager.abort()}async renderSuccess(){await this.render(),this.markAsSeen(),mw.hook(`${o.config.prefix}.page.renderSuccess`).fire(this),mw.hook(`${o.config.prefix}.page.renderComplete`).fire(this)}async renderError(){let e=this.article.get("type"),t=this.article.get("typeVariant"),s=t==="page"?"curid":t==="comparePages"?"compare-pages":"generic";this.error={type:e,code:s,tag:"page",status:this.error?.status,statusText:this.error?.statusText,message:this.errorData?.info||Gi(this.error?.status),article:this.article},E(`error-${this.error.type}-${this.error.code}`,this.error),await this.render(),mw.hook(`${o.config.prefix}.page.renderError`).fire(this),mw.hook(`${o.config.prefix}.page.renderComplete`).fire(this)}async render(){let e=["instantDiffs-page",`instantDiffs-page--${this.type}`,`instantDiffs-page--${this.article.get("type")}`,"mw-body-content"],t=["instantDiffs-page-body",`instantDiffs-page-body--${this.type}`,`instantDiffs-page-body--${this.article.get("type")}`],s=o.config.skinBodyClasses[mw.config.get("skin")];s&&e.push(...s),this.nodes.$container=$("<div>").attr("dir",document.dir).addClass(e),this.nodes.$tools=$("<div>").addClass("instantDiffs-page-tools").appendTo(this.nodes.$container),this.nodes.$body=$("<div>").addClass(t).appendTo(this.nodes.$container),await this.renderContent(),await this.renderNavigation()}async renderContent(){this.error?await this.renderErrorContent():await this.renderSuccessContent()}async renderErrorContent(){let e=se(`error-${this.error.type}-${this.error.code}`,this.error,this.article),t=$(`<p>${e}</p>`);this.renderWarning({$content:t})}renderWarning({$content:e,type:t="warning",container:s=this.nodes.$body,insertMethod:n="prependTo"}){let r=Ki({$content:e,type:t});return I(r,s,n),r}async renderSuccessContent(){await this.restoreFunctionality(),this.requestDependencies()}async renderNavigation(){this.navigation=new rn(this,this.article,this.articleParams,{initiatorAction:this.options.initiatorAction,links:this.links}),this.navigation.embed(this.nodes.$container,"prependTo")}requestDependencies(e={}){let{modulestyles:t=[],modulescripts:s=[],modules:n=[]}=e,r=[...Yt(this.article),...t,...s,...n];return mw.loader.using(de(r))}async restoreFunctionality(){if(!this.error&&(this.nodes.$mediaInfoView=this.nodes.$body.find("mediainfoview"),this.article.get("type")==="revision"&&this.nodes.$mediaInfoView.length>0)){let e=await Li(this.nodes.$mediaInfoView);e&&I(e,this.nodes.$diffTitle,"insertAfter")}}getScrollableSection(){let e=this.article.get("hash");if(!a(e))return zi(e,this.nodes.$body)}getScrollableOffsetTop(){return this.getNavigation()?.getOuterHeight(!0)}async fire(){if(mw.hook(`${o.config.prefix}.page.ready`).fire(this),this.getNavigation()?.fire(),this.options.fireDiffHook){let e=this.getDiffTable();this.article.get("type")==="diff"&&e?.length>0&&mw.hook("wikipage.diff").fire(e)}if(this.options.fireContentHook){let e=this.getContainer();e?.length>0&&mw.hook("wikipage.content").fire(e)}fe(this.nodes.$container),mw.hook(`${o.config.prefix}.page.complete`).fire(this)}focus(){this.emit("focus")}setConfigs(){this.isConfigsChanged=!0,this.configManager.apply(),this.userOptionsManager.apply()}restoreConfigs(){this.isConfigsChanged&&(this.isConfigsChanged=!1,this.configManager.restore(),this.userOptionsManager.restore())}getArticle(){return this.article}getArticleTitleText(){let e=this.article.getValues(),t;return!a(e.page1Text)&&!a(e.page2Text)?t=`${e.page1Text} \u2192 ${e.page2Text}`:a(e.titleText)?t=d(this.error?"dialog-title-not-found":"dialog-title-empty"):t=e.titleText,a(e.label)?t:`${e.label} (${t})`}getArticleParams(){return this.articleParams}getContainer(){return this.nodes.$container}getDiffTable(){return this.nodes.$table}getInitiatorPage(){return this.options.initiatorPage}getNavigation(){return this.navigation}close(){this.emit("close")}detach(){this.isDetached||(mw.hook(`${o.config.prefix}.page.beforeDetach`).fire(this),this.abort(),this.restoreConfigs(),this.getNavigation()?.detach(),this.getContainer()?.detach(),this.isDetached=!0)}},ye=_i});var Qi,Dt,Ji=m(()=>{P();y();ht();j();yt();C();Qi=class extends ye{type="local";isDependenciesLoaded=!1;getLoadPromises(){let e=super.getLoadPromises();return this.article.get("type")==="revision"&&(this.article.get("typeVariant")!=="page"&&h(this.article.get("revid"))||this.article.get("typeVariant")==="page"&&h(this.article.get("curid")))&&e.push(this.requestPage()),e}requestPage(){if(this.error)return $.Deferred().resolve().promise();let e={action:"parse",prop:["revid","modules","jsconfigvars","categorieshtml"],disablelimitreport:1,redirects:1,format:"json",formatversion:2,uselang:o.local.userLanguage},t=this.configManager.get("wgDiffNewId")||Math.max(this.article.get("revid"),this.article.get("oldid")),s=this.configManager.get("wgArticleId")||this.article.get("curid");return h(t)?e.oldid=t:h(s)&&(e.pageid=s),this.requestManager.get(e).then(n=>this.onRequestPageDone(n,e)).fail((n,r)=>this.onRequestPageError(n,r,e))}onRequestPageError=(e,t,s)=>{this.isDependenciesLoaded=!0;let n={message:e,type:"dependencies",tag:"page",article:this.article,silent:!0};t?.error&&(n.code=t.error.code,n.message=t.error.info);let r=s.oldid?"revid":"curid";E(`error-dependencies-${r}`,n)};onRequestPageDone=(e,t)=>{if(this.isDependenciesLoaded=!0,this.parse=e?.parse,!this.parse)return this.onRequestPageError(null,e,t);this.configManager.setValues({wgArticleId:this.parse.pageid,wgRevisionId:Math.max(this.article.get("revid"),this.parse.revid),...this.parse.jsconfigvars}),this.article.setValues({curid:this.configManager.get("wgArticleId"),revid:this.configManager.get("wgRevisionId")}),this.setConfigs(),this.processCategories(),this.requestDependencies(this.parse)};requestProcess(){if(this.error)return $.Deferred().resolve().promise();let e=this.article.getValues(),t={title:a(e.title)?void 0:e.title,diff:a(e.diff)?e.direction:e.diff,oldid:a(e.oldid)?void 0:e.oldid,curid:a(e.curid)?void 0:e.curid},s={url:o.local.mwEndPoint,dataType:"html",data:$.extend(t,this.articleParams)};return this.requestManager.ajax(s)}async renderSuccessContent(){this.nodes.data=$.parseHTML(this.data),this.nodes.$data=$(this.nodes.data).appendTo(this.nodes.$body),this.collectData(),this.setConfigs(),this.nodes.$data.filter(".cdx-message").prependTo(this.nodes.$body),this.nodes.$data.find(".cdx-message").prependTo(this.nodes.$body);let e=this.nodes.$data.filter("p");e.length>0&&this.renderWarning({$content:e}),this.processMobileFooter(),this.processDiffTable(),this.processFlaggedRevs(),this.article.get("type")==="revision"&&this.processRevision(),await super.renderSuccessContent()}collectData(){let e={},t=this.nodes.$data.find("#mw-diff-otitle1 strong > a, #differences-prevlink"),s=this.nodes.$data.find("#mw-diff-ntitle1 strong > a, #differences-nextlink");if(t.length>0){let f=Number(Te("oldid",t.prop("href")));h(f)&&this.configManager.set("wgDiffOldId",f);let g=Te("title",t.prop("href"))||t.prop("title");a(g)||(e.page1=g,e.title=g)}if(s.length>0){let f=Number(Te("oldid",s.prop("href")));h(f)&&(this.configManager.setValues({wgDiffNewId:f,wgRevisionId:f}),e.revid=f,this.article.get("diff")==="cur"&&(e.diff=f));let g=Te("title",s.prop("href"))||s.prop("title");a(g)||(e.page2=g,e.title=g)}e.page1===e.page2&&(delete e.page1,delete e.page2);let n=this.nodes.$data.find("#mw-diff-ntitle2 .mw-userlink");n.length>0&&(e.userhidden=n.hasClass("history-deleted"),e.userhidden||(e.user=n.text()));let r=this.nodes.$data.find("#mw-diff-ntitle1 .mw-diff-timestamp");r.length>0&&(e.timestamp=r.attr("data-timestamp"));let c=this.nodes.$data.find("#mw-diff-ntitle3 .autocomment a");a(this.article.get("section"))&&c.length>0&&(e.section=K("hash",c.prop("href"))),this.nodes.$data.find(".mw-diff-undo a, .mw-rollback-link a").length>0&&this.configManager.set("wgIsProbablyEditable",!0),this.article.set(e),this.configManager.setTitle(this.article.getMW("title")),this.article.get("type")!=="diff"&&!ut(this.configManager.get("wgPageContentModel"))&&this.userOptionsManager.set("visualeditor-diffmode-historical","source")}processMobileFooter(){if(this.nodes.$diffMobileFooter=this.nodes.$data.filter(".mw-diff-mobile-footer"),this.nodes.$diffMobileFooter.length===0)return;this.nodes.$diffMobileFooter.appendTo(this.nodes.$body);let e="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--action-default",t=[".mw-diff-undo",".mw-rollback-link"],s=this.nodes.$diffMobileFooter.find(t.join(","));s.length!==0&&(mw.user.isAnon()?s.hide():s.children("a").addClass(e))}processDiffTable(){this.nodes.$diffTablePrefix=this.nodes.$data.filter(".mw-diff-table-prefix"),(this.article.get("type")!=="diff"||!l.get("showDiffTools"))&&this.nodes.$diffTablePrefix.addClass("instantDiffs-hidden"),this.nodes.$table=this.nodes.$data.filter("table.diff"),this.nodes.$prev=this.nodes.$table.find("#differences-prevlink").attr("data-instantdiffs-link","none").addClass("instantDiffs-hidden"),this.nodes.$next=this.nodes.$table.find("#differences-nextlink").attr("data-instantdiffs-link","none").addClass("instantDiffs-hidden");let e=this.nodes.$table.find("#mw-diff-otitle4");xt(e);let t=this.nodes.$table.find("#mw-diff-ntitle4");xt(t),this.nodes.$data.filter(".mw-revslider-container, .mw-diff-revision-history-links, #mw-oldid").addClass("instantDiffs-hidden"),this.links.prev=this.article.get("type")==="revision"?h(this.configManager.get("wgDiffOldId")):this.nodes.$prev.attr("href"),this.links.next=this.nodes.$next.attr("href")}processRevision(){this.nodes.$diffTitle=this.nodes.$data.filter(".diff-currentversion-title"),l.get("showRevisionInfo")||this.nodes.$diffMobileFooter.addClass("instantDiffs-hidden"),Be(this.nodes.$table),this.processCategories(),this.nodes.$data.find(".mw-diff-slot-header, .mw-slot-header").addClass("instantDiffs-hidden")}processFlaggedRevs(){this.nodes.$frDiffHeader=this.nodes.$data.filter("#mw-fr-diff-headeritems").insertBefore(this.nodes.$table),this.nodes.$unpatrolled=this.nodes.$frDiffHeader.find(".fr-diff-to-stable a").attr("data-instantdiffs-link","none").addClass("instantDiffs-hidden"),this.article.get("type")==="diff"&&(this.links.unpatrolled=this.nodes.$unpatrolled.attr("href")),this.article.get("type")==="revision"&&(l.get("showRevisionInfo")?this.nodes.$frDiffHeader.find(".fr-diff-ratings td:nth-child(2n-1)").addClass("instantDiffs-hidden"):this.nodes.$frDiffHeader.addClass("instantDiffs-hidden")),this.nodes.$data.find(".fr-diff-to-stable, #mw-fr-diff-dataform").addClass("instantDiffs-hidden")}processCategories(){a(this.data)||a(this.parse)||a(this.parse.categorieshtml)||(this.nodes.$categories=$(this.parse.categorieshtml).appendTo(this.nodes.$body))}restoreFunctionalityEmbed(){if(this.error)return;qs("mediawiki.misc-authed-curate"),xi(this.nodes.$body);let e=[];if(this.article.get("type")==="diff"&&l.get("showDiffTools")){let t=ki(this.nodes.$diffTablePrefix);t&&e.push(t);let s=yi(this.nodes.$diffTablePrefix);s&&e.push(s)}if(this.nodes.$diffTablePrefix?.length>0){let t=this.nodes.$diffTablePrefix.children(":visible").length>0;this.nodes.$diffTablePrefix.toggleClass("instantDiffs-hidden",!t||e.length===0)}if(this.nodes.$wikiLambdaApp=this.nodes.$body.find("#ext-wikilambda-app"),this.nodes.$wikiLambdaApp.length>0){let t=$(ue("dialog-notice-wikilambda"));this.renderWarning({$content:t,type:"notice",container:this.nodes.$wikiLambdaApp,insertMethod:"insertBefore"})}}restoreFunctionalityWithDependencies(){this.error||this.nodes.$wikiLambdaApp.length>0&&Di(this.nodes.$wikiLambdaApp)}async fire(){this.restoreFunctionalityEmbed(),this.article.get("type")==="revision"&&!this.isDependenciesLoaded&&await this.requestPage(),this.restoreFunctionalityWithDependencies(),await super.fire()}},Dt=Qi});var Do,Yi,Lt,Xi=m(()=>{P();y();ht();X();Le();gi();B();yt();ee();({h:Do}=w),Yi=class extends ye{type="foreign";compare;parse;linkTags=[];constructor(e,t){super(e,{...t,fireDiffHook:!1})}getLoadPromises(){return[this.requestMessages(),this.requestSiteInfo(),...super.getLoadPromises()]}getLoadSecondaryPromises(){let e=super.getLoadSecondaryPromises();return this.article.get("type")==="revision"&&e.push(this.requestRevision()),e}requestProcess(){let e=this.article.getValues(),t={action:"compare",prop:["title","ids","rel","timestamp","user","diff","parsedcomment"],fromrev:h(e.oldid)?e.oldid:void 0,fromrelative:M(e.oldid)?e.oldid:void 0,torev:h(e.diff)?e.diff:void 0,difftype:ge()?"inline":"table",format:"json",formatversion:2,uselang:o.local.userLanguage};return e.type==="diff"&&!h(e.diff)&&(t.torelative=M(e.diff)?e.diff:"prev"),e.type==="revision"&&!h(e.diff)&&(t.torelative=M(e.direction)?e.direction:"prev"),e.typeVariant==="page"&&h(e.curid)&&(t.fromid=e.curid,t.torelative="cur"),this.requestManager.get(t,this.article)}onRequestDone=e=>{this.data=e?.compare};async requestSiteInfo(){let e=["general","namespaces","namespacealiases"],t=await b.getSiteInfo(e,this.article,this.requestManager)||{};if(!T(t)){let s=t.general;T(s)||(this.article.set({hostname:s.servername}),this.configManager.setValues({wgServer:s.server,wgServerName:s.servername,wgMobileServer:s.mobileserver,wgMobileServerName:s.mobileservername}));let n=zt(this.article.get("hostname"));this.configManager.setValues(n),this.setConfigs()}}async requestMessages(){let e=["revisionasof","currentrev-asof","word-separator","pipe-separator","parentheses","talkpagelinktext","contribslink","changeslist-nocomment","rev-deleted-no-diff","rev-deleted-user","rev-deleted-comment","diff-empty","checkuser-userinfocard-toggle-button-aria-label"];await b.loadMessage(e)}async renderContent(){this.renderForeignWarning(),await super.renderContent()}async renderSuccessContent(){this.collectData(),this.setConfigs(),await this.renderDiffTable(),this.requestDependencies()}collectData(){this.configManager.setValues({wgArticleId:this.data.toid,wgRevisionId:this.data.torevid,wgDiffOldId:this.data.fromrevid,wgDiffNewId:this.data.torevid});let e=$("<span>").html(this.data.fromparsedcomment).find(".autocomment a");e.length>0&&(this.data.fromsection=K("hash",e.prop("href")));let t=$("<span>").html(this.data.toparsedcomment).find(".autocomment a");t.length>0&&(this.data.tosection=K("hash",t.prop("href")));let s={previd:this.data.prev,nextid:this.data.next,curid:this.configManager.get("wgArticleId"),revid:this.configManager.get("wgRevisionId"),title:ce(this.data),section:this.data.tosection,timestamp:this.data.totimestamp,user:this.data.touser,userhidden:this.data.touserhidden};this.data.fromid!==this.data.toid&&(s.page1=this.data.fromtitle,s.page2=this.data.totitle),this.article.set(s),this.configManager.setTitle(this.article.getMW("title")),this.links.prev=this.article.get("type")==="revision"?h(this.data.fromrevid):this.data.prev&&this.data.prev!==this.data.fromrevid,this.links.next=this.data.next&&this.data.next!==this.data.torevid}async renderDiffTable(){if(this.nodes.table=wi(this.data.body),(this.data.fromtexthidden||this.data.totexthidden)&&await this.renderDeletedWarning(),this.data.fromid){let e=dt({prefix:"o",title:this.data.fromtitle,revid:this.data.fromrevid,curRevid:this.article.get("curRevid"),hostname:this.article.get("hostname"),timestamp:this.data.fromtimestamp,texthidden:this.data.fromtexthidden,user:this.data.fromuser,userhidden:this.data.fromuserhidden,comment:this.data.fromparsedcomment,commenthidden:this.data.fromcommenthidden});I(e,this.nodes.table.deleted)}else this.nodes.table.added.colSpan=4,this.nodes.table.deleted.classList.add("instantDiffs-hidden");if(this.data.toid){let e=dt({prefix:"n",title:this.data.totitle,revid:this.data.torevid,curRevid:this.article.get("curRevid"),hostname:this.article.get("hostname"),timestamp:this.data.totimestamp,texthidden:this.data.totexthidden,user:this.data.touser,userhidden:this.data.touserhidden,comment:this.data.toparsedcomment,commenthidden:this.data.tocommenthidden});I(e,this.nodes.table.added)}else this.nodes.table.deleted.colSpan=4,this.nodes.table.added.classList.add("instantDiffs-hidden");if(this.nodes.$table=$(this.nodes.table.container).appendTo(this.nodes.$body),Q(this.nodes.$table,`https://${this.article.get("hostname")}`),this.article.get("type")==="revision"&&Be(this.nodes.$table),this.data.toid){let e=vi({title:this.data.totitle,revid:this.data.torevid,hostname:this.article.get("hostname"),user:this.data.touser,userhidden:this.data.touserhidden});I(e,this.nodes.$body,"appendTo")}}async renderErrorContent(){this.errorData?.code==="missingcontent"?await this.renderDeletedWarning():await super.renderErrorContent();let e=this.article.getValues(),t=this.errorData?.code==="missingcontent"?this.errorData.info.replace(/\D/g,""):null,s=[e.oldid,e.diff,t].filter(n=>!isNaN(n)&&n>0);this.configManager.setValues({wgDiffOldId:Math.min(...s),wgDiffNewId:Math.max(...s)}),this.setConfigs(),this.configManager.get("wgDiffOldId")!==this.configManager.get("wgDiffNewId")&&(this.links.prev=h(this.configManager.get("wgDiffOldId")),this.links.next=h(this.configManager.get("wgDiffNewId"))),this.options.initiatorPage=L.getPreviousPage()}renderForeignWarning(){let e=$(ue(`dialog-notice-foreign-${this.article.get("type")}`,`https://${this.article.get("hostname")}`,this.article.get("hostname")));this.nodes.$foreignWarning=this.renderWarning({$content:e,type:"notice"})}async renderDeletedWarning(){let e=await b.parseWikitext({title:this.article.get("title"),text:mw.msg("rev-deleted-no-diff")},this.article),t=$(e).find("p");this.nodes.$deleteWarning=this.renderWarning({$content:t,type:"warning",container:this.nodes.$foreignWarning,insertMethod:"insertAfter"})}requestRevision(){if(this.error)return $.Deferred().resolve().promise();let e={action:"parse",prop:["text","revid","modules","jsconfigvars","categorieshtml"],disablelimitreport:1,redirects:1,format:"json",formatversion:2,uselang:o.local.userLanguage},t=Math.max(this.article.get("revid"),this.article.get("oldid")),s=this.article.get("curid");return h(t)?e.oldid=t:h(s)&&(e.pageid=s),this.requestManager.get(e,this.article).then(n=>this.onRequestRevisionDone(n,e)).fail((n,r)=>this.onRequestRevisionError(n,r,e))}onRequestRevisionError=(e,t,s)=>{let n={message:e,type:"dependencies",tag:"page",article:this.article};t?.error&&(n.code=t.error.code,n.message=t.error.info);let r=s.oldid?"revid":"curid";E(`error-dependencies-${r}`,n)};onRequestRevisionDone=async(e,t)=>{if(this.parse=e?.parse,!this.parse)return this.onRequestRevisionError(null,e,t);await this.renderRevision()};async renderRevision(){this.configManager.setValues({wgArticleId:this.parse.pageid,wgRevisionId:Math.max(this.article.get("revid"),this.parse.revid),...this.parse.jsconfigvars}),this.article.setValues({curid:this.configManager.get("wgArticleId"),revid:this.configManager.get("wgRevisionId")}),this.setConfigs();let e=this.article.get("revid")===this.article.get("curRevid")?"currentrev-asof":"revisionasof";this.nodes.diffTitle=Do("h2",{class:"diff-currentversion-title"},mw.msg(e,je(this.data.totimestamp))),this.nodes.$diffTitle=$(this.nodes.diffTitle).appendTo(this.nodes.$body),this.nodes.$revision=$(this.parse.text).appendTo(this.nodes.$body),a(this.parse.categorieshtml)||(this.nodes.$categories=$(this.parse.categorieshtml).appendTo(this.nodes.$body)),await this.processRevision(),Q(this.nodes.$body,this.article.get("href")),this.requestDependencies(this.parse),this.requestForeignDependencies()}async processRevision(){if(this.nodes.$body.find("#ext-wikilambda-app, .ext-wikilambda-view-nojsfallback, .mw-diff-slot-header, .mw-slot-header").addClass("instantDiffs-hidden"),this.nodes.$wikiLambdaApp=this.nodes.$body.find("#ext-wikilambda-app"),this.nodes.$wikiLambdaApp.length>0){let e=$(`<p>${d("dialog-notice-foreign-wikilambda")}</p>`);this.renderWarning({$content:e,type:"notice",container:this.nodes.$wikiLambdaApp,insertMethod:"insertBefore"})}await this.restoreFunctionality()}requestForeignDependencies(){let e=Xt(this.article);Zt(this.article,e.modules),ei(this.article,e.styles),this.linkTags=ti(e.links)}detach(){this.isDetached||(super.detach(),ii(this.linkTags))}},Lt=Yi});var cn=m(()=>{});var St,fn,dn=m(()=>{j();St=class extends OO.ui.LabelWidget{static tagName="div";constructor(){super({classes:["oo-ui-messageDialog-message","is-transparent"]})}toggleVisibility(e){this.$element.toggleClass("is-transparent",!e)}};H(St);fn=St});var Pt,un,hn=m(()=>{y();j();Pt=class extends OO.ui.ProgressBarWidget{toggleDelay;toggleTime;constructor(e){super({classes:["instantDiffs-view-loader","is-transparent"],progress:!1,inline:!0,...e})}toggleVisibility(e,t){if(this.toggleDelay&&clearTimeout(this.toggleDelay),t&&(this.toggle(e),Et(()=>this.$element.toggleClass("is-transparent",!e))),e===!0&&(this.toggleTime=Date.now(),this.toggle(!0),Et(()=>this.$element.removeClass("is-transparent"))),e===!1){if(!this.isVisible())return;let s=this.calculateRemainingTime(this.toggleTime,1e3),n=Math.max(s-150,0);this.toggleDelay=setTimeout(()=>{this.$element.addClass("is-transparent"),this.toggleDelay=setTimeout(()=>this.toggle(!1),150)},n)}}calculateRemainingTime(e,t=1e3){let n=(Date.now()-e)%t;return t-n}};H(Pt);un=Pt});var pn={};_(pn,{default:()=>Lo});var $t,Lo,gn=m(()=>{y();j();dn();hn();C();$t=class extends OO.ui.MessageDialog{static name="Instant Diffs Window";static size="instantDiffs";static actions=[{action:"close",label:d("action-close"),title:q("action-close","close")}];constructor(){super({classes:["instantDiffs-view"]})}initialize(){return super.initialize(),this.message.$element.remove(),this.message=new fn,this.text.$element.append(this.message.$element),this.$content.removeAttr("tabindex"),this.container.$element.attr("tabindex","-1"),l.get("closeOutside")&&(this.$clickOverlay=$("<div>").on("click",()=>this.close()).addClass("instantDiffs-view-overlay").appendTo(this.$element)),this.progressBar=new un,this.$content.prepend(this.progressBar.$element),this}getSetupProcess(e){return super.getSetupProcess(e).next(()=>{js(),this.scrollContentTop(0),this.focus()})}onDialogKeyDown(e){super.onDialogKeyDown(e),!Zi()&&this.emit("hotkey",e)}getBodyHeight(){return"auto"}update(e){return this.getUpdateProcess(e).execute()}getUpdateProcess(e){return new OO.ui.Process().next(()=>{e={title:this.constructor.static.title,message:this.constructor.static.message,scrollTop:0,...e},this.toggleProgress(!1),this.title.setLabel(e.title),this.message.setLabel(e.message),this.scrollContentTop(x(e.scrollTop)?e.scrollTop():e.scrollTop),this.toggleVisibility(!0),this.focus()})}getTeardownProcess(e){return super.getTeardownProcess(e).next(()=>{this.toggleProgress(!1),this.toggleVisibility(!1)})}focus(e){return e?super.focus(e):this.container.$element.trigger("focus"),this}toggleVisibility(e){return this.message.toggleVisibility(e),this}toggleProgress(...e){return this.progressBar.toggleVisibility(...e),this}getContentOffsetTop(e,t=0){let s=0;if((_e(e)||e instanceof jQuery)&&(s=At(e,this.container.$element)?.top),typeof s=="number")return s+t}setScrollOffsetTop(e=0){return this.container.$element.css("--instantDiffs-view-scroll-padding-top",`${e}px`),this}scrollContentTop(e=0,t=0){let s=0;return typeof e=="number"&&(s=e),(_e(e)||e instanceof jQuery)&&(s=At(e,this.container.$element)?.top),typeof s=="number"&&this.container.$element.scrollTop(s+t),this}};H($t);Lo=$t});var es,L,ee=m(()=>{P();y();j();Ee();pi();Ji();Xi();C();cn();es=class{static sizes={compact:{width:800,height:"auto"},standard:{width:1200,height:"auto"},wide:{width:1600,height:"auto"}};static getSize(e){return this.sizes[e]}link;page;options={};opener={link:null,options:{}};initiator={link:null,options:{}};previousInitiator={link:null,options:{}};document={};loadPromise;isDependenciesLoaded=!1;isConstructed=!1;isOpen=!1;isLoading=!1;isRequesting=!1;isProcessing=!1;mixin(){OO.EventEmitter.call(this)}setup(e,t){if(this.isRequesting||this.isProcessing)return!1;if(o.timers.dialogProcesStart=mw.now(),this.link=e,this.options={initiatorPage:null,onOpen:()=>{},onClose:()=>{},...t},!this.isOpen){this.opener.link=this.link,this.opener.options={...this.options};let s={};this.opener.link.getMW?.().hasLine&&(s.filterType=this.opener.link.getArticle().get("type"),s.filterMWLine=!0),be.newInstance(s)}if(this.link instanceof O){let s=this.link.getInitiatorLink();be.instance.hasLink(s)&&(this.previousInitiator={...this.initiator},this.initiator.link=s,this.initiator.options={...this.options},be.instance.setLink(this.initiator.link))}return!0}load(){return this.isLoading?this.loadPromise:this.isDependenciesLoaded?(this.open(),!0):(this.isLoading=!0,this.error=null,this.loadPromise=$.when(mw.loader.using(this.getDependencies())).then(this.onLoadSuccess.bind(this)).fail(this.onLoadError.bind(this)),this.loadPromise)}getDependencies(){return de([...o.config.dependencies.window,...o.config.dependencies.content])}onLoadError(e){this.isLoading=!1,this.isDependenciesLoaded=!1,this.error={type:"dependencies",tag:"view",message:e&&e.message?e.message:null},E("error-dependencies-generic",this.error)}onLoadSuccess(){this.isLoading=!1,this.isDependenciesLoaded=!0,st(),this.open()}construct(){this.isConstructed=!0;let e=(gn(),De(pn)).default;this.dialog=new e,this.dialog.connect(this,{hotkey:t=>this.emit("hotkey",t)}),this.manager=nt(),this.manager.addWindows([this.dialog])}open(){if(this.isConstructed||this.construct(),!this.isOpen){this.document.scrollableRoot=OO.ui.Element.static.getRootScrollableElement(document.body),this.document.scrollTop=this.document.scrollableRoot.scrollTop;let e=this.link.getArticle(),t={title:e.get("titleText")||e.get("title"),size:oi()};this.windowInstance=this.manager.openWindow(this.dialog,t),this.windowInstance.opening.then(this.onOpening.bind(this)),this.windowInstance.opened.then(this.onOpen.bind(this)),this.windowInstance.closing.then(this.onClosing.bind(this)),this.windowInstance.closed.then(this.onClose.bind(this))}this.request()}onOpening(){this.emit("opening")}onOpen(){this.isOpen=!0,x(this.options.onOpen)&&this.options.onOpen(this),this.emit("opened")}onClosing(){this.emit("closing")}onClose(){this.isOpen=!1,this.isRequesting=!1,this.isProcessing=!1,this.previousPage&&(this.previousPage.detach(),this.previousPage=null),this.page&&(this.page.detach(),this.page=null),x(this.options.onClose)&&this.options.onClose(this),x(this.opener.options.onClose)&&this.opener.link!==this.link&&this.opener.options.onClose(this),x(this.initiator.options.onClose)&&this.initiator.link!==this.link&&this.initiator.options.onClose(this),this.opener={link:null,options:{}},this.initiator={link:null,options:{}},this.previousInitiator={link:null,options:{}},this.document.scrollableRoot.scrollTop=this.document.scrollTop,this.emit("closed")}onUpdate(){this.fire(),this.previousInitiator.link instanceof O&&this.opener.link!==this.previousInitiator.link&&x(this.previousInitiator.options.onClose)&&this.previousInitiator.options.onClose(this),this.initiator.link instanceof O&&this.opener.link!==this.initiator.link&&x(this.initiator.options.onOpen)&&this.initiator.options.onOpen(this),this.emit("updated")}request(){this.isRequesting=!0,this.isProcessing=!0,this.error=null,this.previousPage=this.page,this.dialog.toggleProgress(!0),this.previousPage&&this.previousPage.restoreConfigs();let e=this.link.getArticle(),t={initiatorAction:this.previousPage?.getNavigation()?.getActionRegister(),initiatorPage:this.options.initiatorPage},s=e.get("hostname"),n=Z(s)?Lt:Dt;this.page=new n(e,t),this.page.connect(this,{focus:"focus",close:"close"}),$.when(this.page.load()).always(this.onRequestResponse.bind(this))}onRequestResponse(){if(this.isRequesting=!1,!this.page||this.page.isDetached)return;let e={title:this.page.getArticleTitleText(),message:this.page.getContainer(),scrollTop:this.getContentOffset.bind(this)};this.dialog.update(e).then(this.onUpdate.bind(this))}refresh(){return this.isRequesting||this.isProcessing?!1:(o.timers.dialogProcesStart=mw.now(),this.load())}fire(){this.previousPage&&this.previousPage.detach(),$.when(this.page.fire()).always(()=>{this.setContentOffset(),o.timers.dialogProcesEnd=mw.now(),l.get("logTimers")&&he("dialog process time",o.timers.dialogProcesStart,o.timers.dialogProcesEnd),this.isProcessing=!1})}focus(){this.dialog.focus()}close(){this.dialog.close()}getContentOffset(){let e=this.page.getScrollableSection(),t=this.page.getScrollableOffsetTop();return this.dialog.getContentOffsetTop(e,-t)}setContentOffset(){let e=this.page.getArticle();e&&e.get("type")==="revision"&&(this.dialog.setScrollOffsetTop(this.page.getScrollableOffsetTop()),this.dialog.scrollContentTop(this.getContentOffset()))}getLink(){return this.link}getPage(){return this.page}getPreviousPage(){return this.previousPage}getDialog(){return this.dialog}isContains(e){return this.dialog?.$content.get(0).contains(e)}},L=new es});function So(){mn.call(this,this.getField("linksFormat"))}function mn(){let i=this.getFieldValue("linksHash"),e=this.getFieldValue("linksFormat"),s=bn({relative:!1,hash:i,minify:e==="minify"});this.setFieldHelp("linksFormat",s),wn.call(this,this.getField("wikilinksFormat"))}function wn(){let i=this.getFieldValue("linksHash"),e=this.getFieldValue("linksFormat"),t=this.getFieldValue("wikilinksFormat"),n=bn({relative:!1,hash:i,minify:e==="minify",wikilink:!0,wikilinkPreset:t});this.setFieldHelp("wikilinksFormat",n)}function bn(i){let e=d("copy-wikilink-example-title"),t=N({title:e,diff:"12345",type:"diff",section:"Section"},{},i),s=N({title:e,oldid:"12345",type:"revision",section:"Section"},{},i),n=N({title:e,curid:"12345",type:"revision",typeVariant:"page",section:"Section"},{},i);return xe("ul.instantDiffs-list--settings",xe("li",xe("i",t)),xe("li",xe("i",s)),xe("li",xe("i",n)))}function Po(){let i=L.getPage()?.getNavigation()?.getPinnableActions();if(!i)return{};let e=new Set,t=i.map(n=>(e.add(n.name),[n.name,{label:n.label}]));return(l.get("pinnedActions")||[]).forEach(n=>{e.has(n)||t.push([n,{label:n,show:!1}])}),Object.fromEntries(t)}var xe,Ge,ts=m(()=>{y();X();ee();C();({h:xe}=w),Ge={general:{config:{labelMsg:"settings-fieldset-general"},fields:{enableMobile:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-enable-mobile",helpMsg:"settings-enable-mobile-help"}},notifyErrors:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-notify-errors"}}}},links:{config:{labelMsg:"settings-fieldset-links"},fields:{showLink:{type:"checkbox",enabled:!0,default:!1,config:{labelMsg:"settings-show-link",helpMsg:"settings-show-link-help"}},showPageLink:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-show-page-link",helpMsg:"settings-show-page-link-help"}},highlightLine:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-highlight-line"}},markWatchedLine:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-mark-watched-line"}}}},dialog:{config:{labelMsg:"settings-fieldset-dialog"},fields:{viewWidth:{type:"buttonSelect",enabled:!0,default:"standard",config:{labelMsg:"settings-view-width",helpMsg:"settings-view-width-help"},optionsType:"buttonOption",options:{compact:{labelMsg:"settings-view-width-compact",titleMsg:["settings-view-width-option-title",L.constructor.getSize("compact").width]},standard:{labelMsg:"settings-view-width-standard",titleMsg:["settings-view-width-option-title",L.constructor.getSize("standard").width]},wide:{labelMsg:"settings-view-width-wide",titleMsg:["settings-view-width-option-title",L.constructor.getSize("wide").width]},full:{labelMsg:"settings-view-width-full",titleMsg:"settings-view-width-full-title"}}},closeOutside:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-close-outside"}},enableHotkeys:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-enable-hotkeys"}},showDiffTools:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-show-diff-tools"}},showRevisionInfo:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-show-revision-info"}},unHideDiffs:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-unhide-diffs",helpMsg:["settings-unhide-diffs-help","suppressrevision"]}},openInNewTab:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-open-in-new-tab"}}}},menu:{config:{labelMsg:"settings-fieldset-menu"},fields:{showMenuIcons:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-show-menu-icons"}},showWatchlistPopup:{type:"checkbox",enabled:!0,default:!0,config:{labelMsg:"settings-show-watchlist-popup",helpMsg:"settings-show-watchlist-popup-help"}},linksHash:{type:"checkbox",enabled:!0,default:!1,config:{labelMsg:"settings-links-hash",helpMsg:"settings-links-hash-help"},onChange:So},linksFormat:{type:"radioSelect",enabled:!0,default:"full",config:{labelMsg:"settings-links-format",helpMsg:"placeholder"},optionsType:"radioOption",options:{full:{labelMsg:"settings-links-format-full"},minify:{labelMsg:"settings-links-format-minify"}},onSelect:mn},wikilinksFormat:{type:"radioSelect",enabled:!0,default:"special",config:{labelMsg:"settings-wikilinks-format",helpMsg:"placeholder"},optionsType:"radioOption",options:{link:{labelMsg:"settings-wikilinks-format-link"},special:{labelMsg:"settings-wikilinks-format-special"}},onSelect:wn}}},pinnedActions:{config:{labelMsg:"settings-fieldset-pinned-actions"},fields:{pinnedActions:{type:"checkboxMultiselect",enabled:!0,default:["copyLink"],config:{labelMsg:"settings-pinned-actions",helpMsg:"settings-pinned-actions-help"},optionsType:"checkboxMultioption",options:Po}}}}});var rs={};_(rs,{getQueryDefaults:()=>os,getSchemaDefaults:()=>ns,getSchemaSettings:()=>ss,renderNoticeBox:()=>Tt});function ss(){let e=Object.values(Ge).flatMap(t=>Object.entries(t.fields)).map(([t,s])=>[t,s.enabled]);return Object.fromEntries(e)}function ns(){let e=Object.values(Ge).flatMap(t=>Object.entries(t.fields)).map(([t,s])=>[t,s.default]);return Object.fromEntries(e)}function os(){let i=as(document.currentScript?.src)?.instantdiffs||{},e=Object.entries(i).map(([t,s])=>[t,s==="true"?!0:s==="false"?!1:s]);return Object.fromEntries(e)}function Tt(i){i={modifiers:[],content:null,image:null,alt:null,...i};let e=["instantDiffs-notice-box"];return i.modifiers.forEach(t=>e.push(`instantDiffs-notice-box--${t}`)),is("div",{class:e},is("img",{src:`${o.config.commonsAssetsPath}${i.image}`,alt:i.alt}),is("h5",i.content))}var is,Ct=m(()=>{P();y();ts();({h:is}=w)});var vn=m(()=>{});var kn={};_(kn,{default:()=>Eo});var Ot,Eo,yn=m(()=>{P();y();j();Ct();ts();C();Ot=class extends OO.ui.ProcessDialog{static name="Instant Diffs Settings";static title=d("settings-title");static actions=[{action:"save",modes:"edit",label:d("action-save"),flags:["primary","progressive"]},{action:"reload",modes:"finish",label:d("action-reload"),flags:["primary","progressive"]},{action:"close",modes:"empty",label:d("action-close"),flags:["primary","progressive"]},{modes:["edit","finish","empty"],label:d("action-close"),title:d("action-close"),invisibleLabel:!0,icon:"close",flags:["safe","close"]}];panels={};tabs={};visibleTabWidgets=[];fields={};constructor(){super({classes:["instantDiffs-settings"]})}initialize(...e){super.initialize(...e),this.panels.edit=this.renderEditPanel(),this.panels.finish=this.renderFinishPanel(),this.panels.empty=this.renderEmptyPanel(),this.stackLayout=new OO.ui.StackLayout({items:[this.panels.edit,this.panels.finish,this.panels.empty]}),this.$body.append(this.stackLayout.$element)}renderEditPanel(){return new OO.ui.PanelLayout({classes:["instantDiffs-settings-panel","instantDiffs-settings-panel--edit"],padded:!1,expanded:!0})}renderFinishPanel(){return new OO.ui.PanelLayout({classes:["instantDiffs-settings-panel","instantDiffs-settings-panel--finish"],padded:!0,expanded:!0})}renderEmptyPanel(){return new OO.ui.PanelLayout({classes:["instantDiffs-settings-panel","instantDiffs-settings-panel--empty"],padded:!0,expanded:!0})}setPanel(e){this.panels[e]&&(this.actions.setMode(e),this.stackLayout.setItem(this.panels[e]))}renderContents(){this.renderEditContent(),this.renderFinishContent(),this.renderEmptyContent(),this.processLinksAttr(this.stackLayout.$element)}renderEditContent(){for(let[t,s]of Object.entries(Ge))this.tabs[t]=this.renderTab(t,s);this.visibleTabWidgets=Object.values(this.tabs).map(t=>t.tab).filter(t=>t.isVisible());let e=new OO.ui.IndexLayout({expanded:!0,framed:!1});e.addTabPanels(this.visibleTabWidgets,0),this.panels.edit.$element.empty().append(e.$element)}renderFinishContent(){let t=Tt({image:"/6/6f/Eo_circle_light-green_checkmark.svg",content:d("settings-saved"),alt:d("settings-saved-icon")});this.panels.finish.$element.empty().append(t)}renderEmptyContent(){let e=["/2/2f/Cappuccino.svg","/c/ca/Coffe.svg","/9/9a/Coffee_cup_icon.svg","/1/1a/Applications-ristretto.svg","/f/f7/Cup-o-coffee-simple.svg"],t=Math.floor(Math.random()*e.length),s=e[t]||e[0],n=Tt({image:s,content:d("settings-empty"),alt:d("settings-empty-icon"),modifiers:["empty"]});this.panels.empty.$element.empty().append(n)}renderTab(e,t){t=J({name:e,fields:{},fieldset:null,tab:null,config:{label:null}},t),t.config=this.validateFieldConfig(t.config);for(let[r,c]of Object.entries(t.fields))this.fields[r]=t.fields[r]=this.renderField(r,c);let s=Object.values(t.fields).map(r=>r.field);t.fieldset=new OO.ui.FieldsetLayout().addItems(s);let n=Object.keys(t.fields).map(r=>l.check(r)).some(r=>r===!0);return t.tab=new OO.ui.TabPanelLayout(t.name,{...t.config,content:[t.fieldset]}).toggle(n),t}renderField(e,t){t=J({name:e,type:null,input:null,field:null,config:{label:null,align:"inline",help:null,helpInline:!0},optionsType:null,options:{},onSelect:()=>{},onChange:()=>{}},t),t.config=this.validateFieldConfig(t.config),x(t.options)&&(t.options=t.options.call(this,t));for(let[n,r]of Object.entries(t.options))t.options[n]=this.renderInputOption(n,r,t.optionsType);let s=Object.values(t.options).map(n=>n.option);switch(t.type){case"checkbox":t.input=new OO.ui.CheckboxInputWidget;break;case"radioSelect":t.input=new OO.ui.RadioSelectWidget({items:s});break;case"buttonSelect":t.input=new OO.ui.ButtonSelectWidget({items:s});break;case"checkboxMultiselect":t.input=new OO.ui.CheckboxMultiselectWidget({items:s});break}return x(t.onSelect)&&t.input.on("select",()=>t.onSelect.call(this,t)),x(t.onChange)&&t.input.on("change",()=>t.onChange.call(this,t)),t.field=new OO.ui.FieldLayout(t.input,t.config).toggle(l.check(t.name)),t}renderInputOption(e,t,s){switch(t=J({name:e,type:s,data:e,option:null,show:!0},t),t=this.validateFieldConfig(t),t.type){case"radioOption":t.option=new OO.ui.RadioOptionWidget(t);break;case"buttonOption":t.option=new OO.ui.ButtonOptionWidget(t);break;case"checkboxMultioption":t.option=new OO.ui.CheckboxMultioptionWidget(t);break}return t.option.toggle(t.show),t}validateFieldConfig(e){return[{key:"labelMsg",target:"label",useDom:!0},{key:"titleMsg",target:"title",useDom:!1},{key:"helpMsg",target:"help",useDom:!0}].forEach(({key:s,target:n,useDom:r})=>{let c=e[s];if(!c)return;let p=r?ue:d;e[n]=Array.isArray(c)?p(...c):p(c)}),e}getField(e){return this.fields[e]}getFields(){return this.fields}getFieldValue(e){let t=this.getField(e);if(t){if(["checkbox"].includes(t.type))return t.input.isSelected();if(["radioSelect","buttonSelect"].includes(t.type))return t.input.findFirstSelectedItem()?.getData();if(["checkboxMultiselect"].includes(t.type))return t.input.findSelectedItemsData()}}getFieldValues(){let e={};for(let[t]of Object.entries(this.fields))e[t]=this.getFieldValue(t);return e}setFieldValue(e,t){let s=this.getField(e);if(s)return["checkbox"].includes(s.type)&&s.input.setSelected(t),["radioSelect","buttonSelect"].includes(s.type)&&s.input.selectItemByData(t),["checkboxMultiselect"].includes(s.type)&&s.input.selectItemsByData(t),this}setFieldHelp(e,t){let s=this.getField(e);if(s)return s.field.$help.empty().append(t),this}setFieldDisabled(e,t){let s=this.getField(e);if(s)return s.input.setDisabled(t),this}getSetupProcess(e){return super.getSetupProcess(e).next(()=>{this.$body.scrollTop(0),this.processActionRequest()})}getActionProcess(e){return e==="save"?new OO.ui.Process(()=>this.processActionSave()):e==="reload"?new OO.ui.Process(()=>this.processActionReload()):e==="close"?new OO.ui.Process(()=>this.close()):super.getActionProcess(e)}processLinksAttr(e){e.find("a:not(.jquery-confirmable-element)").each((s,n)=>n.setAttribute("target","_blank")),Q(e,o.config.origin)}getBodyHeight(){return 500}processActionRequest(){this.pushPending(),this.renderContents(),this.setPanel(this.visibleTabWidgets.length>0?"edit":"empty");for(let[e]of Object.entries(this.fields))this.setFieldDisabled(e,!0);l.request().then(this.onActionRequestSuccess).fail(this.onActionRequestError).always(()=>this.popPending())}onActionRequestError=(e,t)=>{let s={type:"settings",message:e};t?.error&&(s.code=t.error.code,s.message=t.error.info);let n=new OO.ui.Error(se("error-setting-request",s),{recoverable:!0});this.showErrors(n)};onActionRequestSuccess=e=>{if(o.local.mwIsAnon)return this.update();let t=e?.query?.userinfo?.options;if(!t)return this.onActionRequestError(null,e);try{let s=JSON.parse(t[`${o.config.settingsPrefix}-settings`]);l.set(s,!0)}catch{}this.update()};update(){return this.getUpdateProcess().execute()}getUpdateProcess(){return new OO.ui.Process(()=>{this.setPanel(this.visibleTabWidgets.length>0?"edit":"empty"),this.processActionUpdate(l.get())})}processActionUpdate(e){this.popPending();for(let[t]of Object.entries(this.fields)){this.setFieldDisabled(t,!1);let s=e[t];typeof s>"u"||this.setFieldValue(t,s)}}processActionSave(){this.pushPending(),l.save(this.getFieldValues()).then(this.onActionSaveSuccess).fail(this.onActionSaveError).always(()=>this.popPending())}onActionSaveError=(e,t)=>{let s={type:"settings",message:e};t?.error&&(s.code=t.error.code,s.message=t.error.info);let n=new OO.ui.Error(se("error-setting-save",s),{recoverable:!0});this.showErrors(n)};onActionSaveSuccess=()=>{this.setPanel("finish")};processActionReload(){this.pushPending(),window.location.reload()}};H(Ot);Eo=Ot});var ls,l,C=m(()=>{P();y();Ct();j();B();vn();ls=class{static utils=rs;loadPromise;isDependenciesLoaded=!1;isConstructed=!1;isOpen=!1;isLoading=!1;isRequesting=!1;isSaving=!1;mixin(){OO.EventEmitter.call(this)}load(){return this.isLoading?this.loadPromise:this.isDependenciesLoaded?(this.open(),!0):(this.isLoading=!0,this.error=null,this.loadPromise=$.when(mw.loader.using(de(o.config.dependencies.settings))).then(this.onLoadSuccess).fail(this.onLoadError),this.loadPromise)}onLoadError=e=>{this.isLoading=!1,this.isDependenciesLoaded=!1,this.error={type:"dependencies",tag:"settings",message:e?.message},E("error-dependencies-generic",this.error)};onLoadSuccess=()=>{this.isLoading=!1,this.isDependenciesLoaded=!0,st(),this.open()};construct(){this.isConstructed=!0;let e=(yn(),De(kn)).default;this.dialog=new e,this.manager=nt(),this.manager.addWindows([this.dialog])}open(){this.isOpen||(this.isConstructed||this.construct(),this.windowInstance=this.manager.openWindow(this.dialog),this.windowInstance.opening.then(this.onOpening),this.windowInstance.opened.then(this.onOpen),this.windowInstance.closing.then(this.onClosing),this.windowInstance.closed.then(this.onClose))}onOpening=()=>{this.emit("opening")};onOpen=()=>{this.isOpen=!0,this.emit("opened")};onClosing=()=>{this.emit("closing")};onClose=()=>{this.isOpen=!1,this.emit("closed")};request(){if(o.local.mwIsAnon)return $.Deferred().resolve().promise();this.isRequesting=!0;let e={action:"query",meta:"userinfo",uiprop:"options",format:"json",formatversion:2,uselang:o.local.userLanguage};return b.post(e).always(this.onRequestResponse)}onRequestResponse=()=>{this.isRequesting=!1};save(e){return this.set(e,!0),o.local.mwIsAnon?$.Deferred().resolve().promise():(this.isSaving=!0,de(["ext.GlobalPreferences.global"]).length>0?this.saveGlobal(e):this.saveLocal(e))}saveLocal(e){let t=[`${o.config.settingsPrefix}-settings`,JSON.stringify(e)],s=b.getApi();return s.saveOption.apply(s,t).always(this.onSaveResponse)}saveGlobal(e){let t={action:"globalpreferences",optionname:`${o.config.settingsPrefix}-settings`,optionvalue:JSON.stringify(e)};return b.getApi().postWithEditToken(t).always(this.onSaveResponse)}onSaveResponse=()=>{this.isSaving=!1};get(e,t){if(t){let s=Object.entries(o.local.defaults).filter(([r])=>r in o.config.settings),n=Object.fromEntries(s);return e?n[e]:n}return e?o.local.defaults[e]:o.local.defaults}check(e){return e?o.local.settings[e]:o.local.settings}set(e,t){o.local.defaults={...o.local.defaults,...e};let s=this.get(void 0,!0);if(mw.storage.setObject(`${o.config.prefix}-settings`,s),t){let n=JSON.stringify(s);x(o.GM?.setValue)&&o.GM.setValue("settings",n),o.local.mwIsAnon||mw.user?.options?.set(o.config.settingsPrefix,n)}}async processDefaults(){let e={};try{e={...e,...mw.storage.getObject(`${o.config.prefix}-settings`)}}catch{}if(x(o.GM?.getValue))try{e={...e,...JSON.parse(await o.GM.getValue("settings"))}}catch{}if(!o.local.mwIsAnon)try{e={...e,...JSON.parse(mw.user.options.get(`${o.config.settingsPrefix}-settings`))}}catch{}this.set(e,!1)}},l=new ls});var w={};_(w,{addBaseToLinks:()=>Q,addClick:()=>Ne,addTargetToLinks:()=>fe,arrayIntersperse:()=>Ui,clearWhitespaces:()=>xt,clipboardWriteLink:()=>He,embed:()=>I,getBodyContentNode:()=>$e,getCanonicalSpecialPage:()=>Ze,getCompareSection:()=>Pe,getCompareTitle:()=>ce,getComponentFromUrl:()=>K,getDependencies:()=>de,getErrorMessage:()=>se,getErrorStatusText:()=>Gi,getHref:()=>Ke,getLabel:()=>we,getMissingDependencies:()=>it,getMobileServer:()=>fs,getMsgKey:()=>ze,getMsgParams:()=>Rt,getOffsetRelativeToContainer:()=>At,getParamFromUrl:()=>Te,getPlaceholderClasses:()=>ct,getRevisionSection:()=>ui,getSpecialPageAliases:()=>Nt,getTarget:()=>Ve,getTargetFromFragment:()=>zi,getTitleFromUrl:()=>Si,getURL:()=>Wt,h:()=>F,hf:()=>ds,hint:()=>cs,hj:()=>Co,hs:()=>To,ht:()=>Pn,inArray:()=>wt,isActiveElement:()=>Zi,isAllowed:()=>pe,isArray:()=>z,isBoolean:()=>Dn,isBreakpoint:()=>$o,isCompareHidden:()=>lt,isElement:()=>_e,isEmpty:()=>a,isEmptyObject:()=>T,isForeign:()=>Z,isFunction:()=>x,isMF:()=>ge,isMessageExists:()=>Fe,isNew:()=>We,isObject:()=>Ae,isRevisionHidden:()=>di,isString:()=>R,isToggleKey:()=>Ln,isValidDir:()=>M,isValidID:()=>h,log:()=>ne,logException:()=>ve,logTimer:()=>he,moduleRequire:()=>qe,msg:()=>d,msgDom:()=>ue,msgHint:()=>q,msgParse:()=>Ao,notifyError:()=>E,notifyMsg:()=>Sn,onSchedule:()=>Et,optionsMerge:()=>J,origin:()=>kt,outerHeight:()=>Hi,parseQuery:()=>as,processMessages:()=>It,removeClick:()=>ji,renderLabel:()=>vt,renderMessageBox:()=>Ki,renderPlaceholder:()=>Qe,semverCompare:()=>Ni,server:()=>Mt,setHTML:()=>Pi,spacesToUnderlines:()=>tt,textDom:()=>ft});function a(i){return!i||i.length===0}function T(i){return!i||!Ae(i)||Object.keys(i).length===0}function R(i){return typeof i=="string"}function Dn(i){return typeof i=="boolean"}function x(i){return typeof i=="function"}function z(i){return Array.isArray(i)}function Ae(i){return i&&typeof i=="object"&&!Array.isArray(i)}function Ln(i){return i.type==="click"||i.type==="keypress"&&["Enter","Space"].includes(i.code)}function _e(i){return i instanceof Element||i instanceof HTMLElement}function Zi(){let i=["button","submit","reset","file","checkbox","radio","range","color","image","hidden"],e=document.activeElement;return!e||e.contentEditable==="true"||e.tagName==="TEXTAREA"||e.tagName==="INPUT"&&!i.includes(e.type)}function kt(i){return`${o.config.origin}${i}`}function Mt(i){return`${o.config.server}${i}`}function de(i){return i.filter(e=>{let t=mw.loader.getState(e);return t&&!["error","missing"].includes(t)})}function it(i){return i.filter(e=>{let t=mw.loader.getState(e);return!["ready","registered"].includes(t)})}function qe(i){return o.local.require(i)}function We(){return o.local.lastVersion!==o.config.version}function pe(){return!l.get("standalone")&&o.config.include.pageActions.includes(mw.config.get("wgAction"))&&!o.config.exclude.pages.includes(mw.config.get("wgCanonicalSpecialPageName"))}function Z(i){return!a(i)&&!o.local.mwServerNames.includes(i)}function ge(){return document.readyState==="complete"?document.body.classList.contains("mw-mf"):!a(mw.config.get("wgMFMode"))}function $o(i){return i=o.config.breakpoints[i],i?window.matchMedia(i):!1}function Et(i){requestAnimationFrame(()=>{requestAnimationFrame(i)})}function ne(i,e,t){let s=console[i];if(!s)return;let n=Fe("script-name")?d("script-name"):"Instant Diffs";/\.$/.test(e)||(e=`${e}.`);let r=[`${n}: ${e}`];z(t)?r.push(...t):a(t)||r.push(t),s(...r)}function ve(i,e,t){let s=`Exception in "${i}"`;a(e)||(s=`${s}: ${e}`),ne("warn",s,t)}function he(i,e,t){let s=t-e;s<1e3?s=`${Math.round(s)}ms`:s=`${(s/1e3).toFixed(2)}s`,ne("info",`${i}: ${s}`)}function tt(i){return i.replace(/ /g,"_")}function Ni(i,e){return i=i.split("-").shift(),e=e.split("-").shift(),i.localeCompare(e,void 0,{numeric:!0,sensitivity:"case",caseFirst:"upper"})}function Ui(i,e){if(!Array.isArray(i)||i.length===0)return i;let t=_e(e);return i.flatMap((s,n)=>{if(n<i.length-1){let r=t?e.cloneNode(!0):e;return[s,r]}return[s]})}function wt(i,e){return z(i)?i.includes(e):R(i)&&R(e)?i===e:!1}function J(...i){return i.reduce((e,t)=>(Object.keys(t).forEach(s=>{let n=e[s],r=t[s];Ae(n)&&Ae(r)?e[s]=J(n,r):e[s]=r}),e),{})}function d(){return mw.msg.apply(mw.msg,Rt(arguments))}function cs(i){return i=`hint-${i}`,`[${d(i)}]`}function q(i,e,t=!0){return i=d(i),t&&(i=`${i} ${cs(e)}`),i.trim()}function Ao(){return mw.message.apply(mw.message,Rt(arguments)).parse()}function ue(){return mw.message.apply(mw.message,Rt(arguments)).parseDom()}function ft(i){return mw.messages.set({[ze("buffer")]:i}),ue("buffer")}function Fe(i){return a(i)?!1:mw.message(ze(i)).exists()}function It(){if(o.local.userLanguage=mw.config.get("wgUserLanguage"),o.local.userLanguage==="qqx"){o.local.language=o.local.userLanguage;return}o.local.language=o.i18n[o.local.userLanguage]?o.local.userLanguage:"en",o.local.messages=o.i18n[o.local.language]||{},o.local.language!=="en"&&(o.local.messages={...o.i18n.en,...o.local.messages});let i={};for(let[e,t]of Object.entries(o.local.messages))i[ze(e)]=t;mw.messages.set(i)}function ze(i){return`${o.config.messagePrefix}-${i}`}function Rt(i){return a(i[0])||(i[0]=ze(i[0])),i}function Gi(i){if(Number.isInteger(i)){if(i===0)return d("error-offline");if(i>=400&&i<500)return d("error-revision-missing");if(i>500)return d("error-server")}}function se(i,e){i=Fe(i)?i:"error-generic",e={...e};let t={...e.article?.getValues()},s=d(i,t.oldid||t.curid||t.page1||t.rev1,t.diff||t.page2||t.rev2,t.titleText||t.title,e.message||d("error-wasted"));return/\.$/.test(s)||(s=`${s}.`),s}function E(i,e){if(e={article:null,silent:null,...e},e.silent=Dn(e.silent)?e.silent:!l.get("notifyErrors"),o.isUnloading)return;document.visibilityState==="hidden"&&(e.silent=!0);let t=se(i,e);if(e.silent){ne("warn",t,e);return}if(typeof mw<"u"&&mw.notify){let s=F("div.instantDiffs-notification",F("div.instantDiffs-notification-label",F("a",{href:kt(`/wiki/${o.config.link}`),target:"_blank"},d("script-name"))),Pn(t));Sn(s,e)}ne("error",t,e)}function Sn(i,e){mw.notify(i,{type:"error",tag:`${o.config.prefix}-${e.tag}`})}function we(i){let e=o.config.labels[i];if(e)return typeof e=="object"?e[document.dir]:e}function Ve(i){return l.get("openInNewTab")&&i?"_blank":"_self"}function Ke(i){return/^\/\//.test(i)&&(i=`https:${i}`),i}function Wt(i){try{return new URL(Ke(i))}catch{return null}}function Te(i,e){let t=Wt(e);if(t)return t.searchParams.get(i)}function K(i,e){let t=Wt(e);if(t)return t[i]}function Si(i){let e=mw.util.getParamValue("title",i);if(!e)try{let t=new URL(i,location.href),s=mw.config.get("wgArticlePath")?.split("$1")[0];t.pathname.startsWith(s)&&(e=decodeURIComponent(t.pathname.substring(s.length)))}catch(t){return ne("error","Error parsing URL",t),null}return e}function as(i){let e=Wt(i);if(!e)return;let t={};for(let[s,n]of e.searchParams){let r=s.match(/^([^[]+)\[([^\]]+)\]$/);if(r){let[,c,p]=r;t[c]=t[c]||{},t[c][p]=n}else t[s]=n}return t}function h(i){return!a(i)&&!isNaN(i)}function M(i){return!a(i)&&["next","prev","cur"].includes(i)}function lt(i){return i&&(i.fromtexthidden||i.totexthidden)}function di(i){return i&&i.slots?.main?.texthidden}function ce(i){return i.torevid?i.totitle:i.fromrevid?i.fromtitle:null}function Pe(i){let e;return i.torevid?(a(i.tocomment)||(e=i.tocomment.match(o.config.sectionRegExp)),e&&e[1]||null):i.fromrevid?(a(i.fromcomment)||(e=i.fromcomment.match(o.config.sectionRegExp)),e&&e[1]||null):null}function ui(i){let e;return i&&!a(i.comment)&&(e=i.comment.match(o.config.sectionRegExp)),e&&e[1]||null}function fs(){let i=mw.config.get("wgServer").replace(/^https?:/,""),e=new RegExp("^//www\\.").test(i)?"www.":"",t=mw.config.get("wgContentLanguage");if(!a(t)){let n=new RegExp(`^//${t}\\.`);if(n.test(i))return i.replace(n,`//${t}.m.`)}let s=mw.config.get("wgNoticeProject");if(!a(s)){let n=new RegExp(`^//${e}${s}\\.`);if(n.test(i))return i.replace(n,a(e)?`//${s}.m.`:`//m.${s}.`)}}function $e(){let i=o.config.bodyContentSelector[mw.config.get("skin")]||o.config.bodyContentSelector.default,e=$(i);return(!e||e.length===0)&&(e=$(document.body)),e}function Nt(i,e){let t="Special",s=mw.config.get("wgFormattedNamespaces")[-1],n=e.split(":"),r=i[e],c=r.split(":");n[0]=s,c[0]=t;let p=[e,r,n.join(":"),c.join(":")];return[...new Set(p)]}function Ze(i){if(!a(i))try{let e=new mw.Title(i).getPrefixedDb();for(let[t,s]of Object.entries(o.local.specialPagesAliasesPrefixed))if(s.includes(e))return t}catch{}}function F(i,e={},...t){return Object.keys(e).forEach(s=>{let n=e[s];if(!a(n))switch(s){case"id":i=`${i}#${n.trim()}`,delete e[s];break;case"class":n=Array.isArray(n)?n.map(r=>r.trim()).join("."):n.trim().replace(/\s+/g,"."),i=`${i}.${n}`,delete e[s];break}}),(0,xn.default)(i,e,...t)}function Pn(i){return document.createTextNode(i)}function To(...i){return i.reduce((e,t)=>e+t.outerHTML,"")}function ds(...i){let e=new DocumentFragment;for(let t of i)t&&e.append(t);return e}function Co(i){return ds(...i.toArray())}function zi(i,e){if(a(i))return null;if(!e)return mw.util.getTargetFromFragment(i);let t=e instanceof jQuery?e[0]:e;if(!t)return null;let s=t.querySelector(`#${CSS.escape(i)}`);if(s)return s;let n=mw.util.percentDecodeFragment(i);return n?t.querySelector(`#${CSS.escape(n)}`):null}function At(i,e){if(i instanceof jQuery&&(i=i[0]),e instanceof jQuery&&(e=e[0]),!i||!e)return null;let t=0,s=0,n=i;for(;n&&n!==e&&(t+=n.offsetTop,s+=n.offsetLeft,n=n.offsetParent,!(n&&!e.contains(n))););return{top:t,left:s}}function Hi(i,e=!1){if(i instanceof jQuery&&(i=i[0]),!i)return 0;let t=i.offsetHeight;if(e){let s=getComputedStyle(i);t+=parseFloat(s.marginTop)||0,t+=parseFloat(s.marginBottom)||0}return t}function xt(i){!i||i.length===0||i.contents().each((e,t)=>{t.nodeType===3&&t.remove()})}function He(i,e){let t=()=>{mw.notify(d("copy-link-copied"),{tag:`${o.config.prefix}-copyLink`}),x(e)&&e(!0)},s=()=>{mw.notify(d("copy-link-error"),{tag:`${o.config.prefix}-copyLink`,type:"error"}),x(e)&&e(!1)};if(a(i)||!R(i))return s();if(navigator.clipboard?.writeText)navigator.clipboard.writeText(i).then(t).catch(s);else{let n=F("textarea",{value:i});document.body.append(n),n.select();let r=document.execCommand("copy");n.remove(),r?t():s()}}function Ne(i,e,t=!0){let s=n=>{if(n){if(!Ln(n)||n.button||n.ctrlKey)return;if(n.preventDefault(),t&&n.altKey&&!a(i.href)){i.target==="_blank"?window.open(i.href,"_blank").focus():window.location.href=i.href;return}}e(n)};return t&&!a(i.href)&&(a(i.dataset.altTitle)&&(i.dataset.altTitle=i.title),i.dataset.altTitle=`${i.dataset.altTitle} ${cs("alt-click")}`.trim(),i.dataset.origTitle=i.title,i.addEventListener("mouseenter",()=>i.title=i.dataset.altTitle),i.addEventListener("mouseleave",()=>i.title=i.dataset.origTitle),i.addEventListener("mousedown",n=>n.preventDefault())),i.addEventListener("click",s),i.addEventListener("keypress",s),s}function ji(i,e){i.removeEventListener("click",e),i.removeEventListener("keypress",e)}function I(i,e,t="appendTo"){if(!e)return;if(e instanceof jQuery){(i instanceof jQuery?i:$(i))[t](e);return}let s=i instanceof jQuery?i.get(0):i;switch(t){case"insertBefore":e.before(s);break;case"insertAfter":e.after(s);break;case"prependTo":e.prepend(s);break;case"appendTo":default:e.append(s);break}}function Pi(i,e){if(i){if(i instanceof jQuery){i.html(e);return}i.innerHTML=e}}function Q(i,e,t=!1){if(!i)return;let s;try{s=new URL(e,`https://${location.hostname}`)}catch{return}let n=(c,p)=>{$(p).attr("href","https://"+s.hostname+s.pathname+$(p).attr("href"))},r=(c,p)=>{$(p).attr("href","https://"+s.hostname+$(p).attr("href").replace(/special:mylanguage\//i,"")).attr("title",($(p).attr("title")||"").replace(/special:mylanguage\//i,""))};i.filter('a[href^="#"]').each(n),i.find('a[href^="#"]').each(n),t||(i.filter('a[href^="/"]:not([href^="//"])').each(r),i.find('a[href^="/"]:not([href^="//"])').each(r))}function fe(i){if(!l.get("openInNewTab"))return;let e=(t,s)=>{let n=s.getAttribute("href");a(n)||/^#/.test(n)||s.setAttribute("target","_blank")};i.filter("a:not(.mw-thanks-thank-link, .jquery-confirmable-element)").each(e),i.find("a:not(.mw-thanks-thank-link, .jquery-confirmable-element)").each(e)}function ct(i=[]){let e=["instantDiffs-panel-placeholder"];return i.forEach(t=>e.push(`instantDiffs-panel-placeholder--${t}`)),l.get("showLink")&&e.push("has-link"),e}function Qe(){return $("<span>").addClass(ct())}function vt(i){i={short:null,long:null,iconBefore:null,iconAfter:null,...i},a(i.short)||(i.short=F("span",i.short)),a(i.long)||(i.long=F("span",i.long)),a(i.iconBefore)||(i.iconBefore=F("i",i.iconBefore)),a(i.iconAfter)||(i.iconAfter=F("i",i.iconAfter));let e=[i.iconBefore,i.short,i.iconAfter].filter(s=>!a(s)).map(s=>s.cloneNode(!0)),t=[i.iconBefore,i.long,i.iconAfter].filter(s=>!a(s)).map(s=>s.cloneNode(!0));return ds(F("div.instantDiffs-label.instantDiffs-label--long",...t),F("div.instantDiffs-label.instantDiffs-label--short",...e))}function Ki(i){i={$content:null,type:"notice",...i};let e=i.$content.toArray();return F("div",{class:["cdx-message","cdx-message--block",`cdx-message--${i.type}`,"plainlinks"]},F("span.cdx-message__icon"),F("div.cdx-message__content",...e))}var xn,y=m(()=>{xn=Hn(Fs());P();C()});var En=re(()=>{window.instantDiffs||={};instantDiffs.i18n||={};instantDiffs.i18n.en={"@metadata":{authors:["Serhio Magpie"]},"script-name":"Instant Diffs","script-name-short":"ID","diff-title":"Difference between revisions","diff-title-hidden":"Difference between revisions is hidden","revision-title":"Revision content","revision-title-hidden":"Revision content is hidden","compare-label":"$1","compare-title":"Compare selected revisions ($1)","compare-pages-title":"Difference between pages","compare-pages-title-hidden":"Difference between pages is hidden","page-title":"Go to page","comment-title":"Go to message","action-save":"Save","action-cancel":"Cancel","action-close":"Close","action-reload":"Reload","action-watch":"Watch","action-unwatch":"Unwatch","goto-snapshot-prev":"Previous link on a page","goto-snapshot-next":"Next link on a page","goto-view-diff":"Show changes","goto-view-revision":"Show revision","goto-view-unpatrolled":"Pending changes","goto-prev":"Older","goto-next":"Newer","goto-prev-diff":"Older edit","goto-next-diff":"Newer edit","goto-back-diff":"Back","goto-prev-revision":"Older revision","goto-next-revision":"Newer revision","goto-back-revision":"Back","goto-diff":"Go to edit","goto-revision":"Go to revision","goto-page":"Go to page","goto-comment":"Go to message","goto-edit":"Edit","goto-source":"View source","goto-history":"View history","goto-info":"View info","goto-talkpage":"Discussion","goto-settings":"Settings","goto-actions":"Actions","hint-close":"Esc","hint-alt-click":"Alt+Click: open the link","hint-snapshot-prev":"Ctrl+Arrow Left","hint-snapshot-next":"Ctrl+Arrow Right","hint-prev":"Arrow Left","hint-next":"Arrow Right","hint-switch":"Ctrl+Arrow Up","hint-unpatrolled":"Ctrl+P","hint-back":"Ctrl+Z","hint-actions":"Ctrl+Arrow Down","copy-link":"Copy link","copy-link-copied":"The link has been copied to the clipboard.","copy-link-error":"Couldn't copy the link.","copy-wikilink":"Copy wikilink","copy-wikilink-page":"page","copy-wikilink-diff":"diff","copy-wikilink-revision":"revision","copy-wikilink-example-title":"Main Page","dialog-title-empty":"[No title]","dialog-title-not-found":"[Not found]","dialog-notice-wikilambda":"WikiLambda app currently only shows the latest revision. See a [[phab:T397902|ticket]] on Phabricator.","dialog-notice-foreign-diff":"You are viewing a foreign diff from [$1 $2]. Some features can be limited.","dialog-notice-foreign-revision":"You are viewing a foreign revision from [$1 $2]. Some features can be limited.","dialog-notice-foreign-wikilambda":"WikiLambda app is not currently supported in the foreign revisions.","settings-title":"Instant Diffs Settings","settings-saved":`The settings have been saved successfully. Reload the page to apply them.`,"settings-saved-icon":"Checkmark icon","settings-empty":`Oops, looks like the admin disabled all settings. Time to relax and grab some coffee!`,"settings-empty-icon":"Coffee cup icon","settings-fieldset-links":"Links","settings-show-link":"Show action link","settings-show-link-help":"Displays an action button (\u2756) after the link to open the Instant Diffs dialog. Otherwise, the click action is added directly to the link. You can still open the link in the current tab by pressing Alt+Click.","settings-show-page-link":"Show page link","settings-show-page-link-help":"Displays an action button (\u2794) after the link to navigate to the page and section where the edit was made. If the [[mw:Special:MyLanguage/Convenient Discussions|Convenient Discussions]] script is installed, the button will also try to navigate to the corresponding comment.","settings-highlight-line":"Highlight lines in Watchlists and similar lists when the Instant Diffs dialog opens from the related link.","settings-mark-watched-line":"Mark changes as visited in Watchlists when the Instant Diffs dialog opens from the related link.","settings-fieldset-dialog":"Dialog","settings-view-width":"Set window dimensions:","settings-view-width-help":"Dimensions apply only to desktop view. Mobile view always uses full screen dimensions.","settings-view-width-option-title":"$1 pixels wide","settings-view-width-compact":"Compact","settings-view-width-standard":"Standard","settings-view-width-wide":"Wide","settings-view-width-full":"Full","settings-view-width-full-title":"All available screen space","settings-close-outside":"Close Instant Diffs dialog when clicking outside of it.","settings-enable-hotkeys":"Enable keyboard shortcuts in the Instant Diffs dialog.","settings-show-diff-tools":"Show additional diff tools, such as the Inline format toggle.","settings-show-revision-info":"Show change information when viewing a revision.","settings-unhide-diffs":"Display hidden revision content and diff info without additional steps.","settings-unhide-diffs-help":'The "$1" [[mw:Special:MyLanguage/Help:RevisionDelete|user right]] is required to view revision content.',"settings-open-in-new-tab":"Open links inside the Instant Diffs dialog in a new tab.","settings-fieldset-menu":"Menu","settings-show-menu-icons":"Show icons in the Instant Diffs dialog dropdown menu.","settings-show-watchlist-popup":"Show advanced options when adding or removing pages from the Watchlist.","settings-show-watchlist-popup-help":"When available, displays a popup with watchlist time period and label settings.","settings-links-hash":"Include section name (anchor) in the links","settings-links-hash-help":"The section name will also be appended as an anchor to the link URL when using copy actions with the selected non-minified format.","settings-links-format":"Link format for the copy action:","settings-links-format-full":"Full url with a page title","settings-links-format-minify":"Minified url","settings-wikilinks-format":"Wikilink format for the copy action:","settings-wikilinks-format-link":"Simple link in brackets","settings-wikilinks-format-special":"Internal wiki link","settings-fieldset-general":"General","settings-enable-mobile":"Enable Instant Diffs on the mobile skin (Minerva).","settings-enable-mobile-help":"To re-enable Instant Diffs, you will need to switch to a different skin.","settings-notify-errors":"Show popup alerts for critical errors.","settings-fieldset-pinned-actions":"Pinned Actions","settings-pinned-actions":"Pin selected actions in the quick access menu:","settings-pinned-actions-help":"This list shows only actions available for the current view. Pinned actions appear only in desktop view.","error-generic":"Something went wrong: $4","error-server":"Server error, please try again later","error-offline":"Please check your internet connection","error-wasted":"Unexpected error","error-prepare-generic":"Failed to prepare configuration: $4","error-prepare-version":"Another instance is already running: $4","error-prepare-replaced":"Standalone instance replaced successfully: $4","error-prepare-mobile":"The script is disabled in the settings for the mobile skin (Minerva)","error-link-options":'Failed to parse the "data-instantdiffs-options" link attribute: $4',"error-revision-generic":'Failed to load revision data "oldid=$1": $4',"error-revision-curid":'Failed to load revision data "curid=$1": $4',"error-revision-badrevids":"Revision not found","error-revision-badpageids":"Page not found","error-revision-missing":"Page not found","error-revision-invalid":"Page not found: $4","error-diff-generic":'Failed to load revision compare data "oldid=$1", "diff=$2": $4',"error-diff-compare-pages":'Failed to load page compare data "page1=$1", "page2=$2": $4',"error-diff-missingcontent":"Revision is hidden","error-diff-nosuchrevid":"Revision not found","error-diff-missingtitle":"Page not found","error-api-generic":"Failed to request api: $4","error-dependencies-generic":"Failed to load dependencies: $4","error-dependencies-revid":'Failed to load page dependencies "oldid=$1": $4',"error-dependencies-curid":'Failed to load page dependencies "curid=$1": $4',"error-global-watchlist":"Failed to execute Global Watchlist API: $4","error-setting-request":"Failed to load user options: $4","error-setting-save":"Failed to save user options: $4"}});var An=re($n=>{$n.loaders={en:()=>En()}});var Tn=m(()=>{P();y();mw.hook("mw.translate.editor.showTranslationHelpers").add((i,e)=>{!e||!pe()||mw.hook(`${o.config.prefix}.process`).fire(e)})});var Cn=m(()=>{P();y();Ee();mw.hook("convenientDiscussions.preprocessed").add(i=>{if(!i)return;let e=s=>{!s||!s.isValid||!s.isProcessed||s.isForeign||!s.options.showPageLink||s.actions.cd||(s.extensions.cd={},s.extensions.cd.href=t(s),!a(s.extensions.cd.href)&&(s.actions.page&&s.actions.page.remove(),s.actions.cd=s.renderAction({label:we("page"),title:d("comment-title"),href:s.extensions.cd.href,modifiers:["page","comment"]})))},t=s=>{if(!s.compare&&!s.revision)return;let n=s.getArticle().get("titleText"),r=i.api.pageRegistry.get(n);if(!r||!r.isProbablyTalkPage())return;if(s.revision?s.revision.revid&&(s.extensions.cd.date=new Date(s.revision.timestamp),s.extensions.cd.user=s.revision.user):s.compare&&(s.compare.torevid?(s.extensions.cd.date=new Date(s.compare.totimestamp),s.extensions.cd.user=s.compare.touser):s.compare.fromrevid&&(s.extensions.cd.date=new Date(s.compare.fromtimestamp),s.extensions.cd.user=s.compare.fromuser)),s.extensions.cd.date&&s.extensions.cd.user)try{s.extensions.cd.anchor=i.api.generateCommentId(s.extensions.cd.date,s.extensions.cd.user)}catch(p){ve("Gadget-ConvenientDiscussions","Unable to generate comment anchor.",p)}if(!s.extensions.cd.anchor)return;let c=`#${s.extensions.cd.anchor}`;return n!==o.local.mwTitleText&&(c=mw.util.getUrl(`${n}${c}`)),c};if(o.isRunCompleted)for(let s of O.getLinks())e(s);mw.hook(`${o.config.prefix}.link.renderSuccess`).add(s=>{s&&e(s)})})});var On=m(()=>{P();mw.hook(`${o.config.prefix}.page.complete`).add(i=>{if(!i)return;(i.getContainer()?.find('[id^="tw-revert"] a')).each((t,s)=>{s.addEventListener("click",()=>i.close())})})});var Mn=m(()=>{P();mw.hook(`${o.config.prefix}.page.beforeDetach`).add(i=>{if(!i)return;let e=i.getDiffTable();typeof wikEd<"u"&&wikEd.diffTableLinkified&&e?.length>0&&wikEd.diffTable===e.get(0)&&(wikEd.diffTableLinkified=!1)})});var In=m(()=>{P();y();mw.hook("wikipage.content").add(()=>{if(!pe()||mw.config.get("skin")!=="citizen")return;let i=(s,n)=>{try{let r=new URL(s.href);a(r.searchParams.get("diff"))&&(r.searchParams.set("diff","cur"),s.href=r.href),s.dataset.instantdiffsLink="basic",s.dataset.instantdiffsOptions=JSON.stringify({showLink:!1,showPageLink:!1,showAltTitle:!0}),mw.hook(`${o.config.prefix}.process`).fire($(n))}catch(r){ve("Skin-Citizen","Unable to append the link action.",r)}},e=document.querySelector("#citizen-lastmod-relative"),t=document.querySelector("#citizen-sidebar-lastmod");e&&t&&i(e,t)})});var Oo={};var Rn=m(()=>{Tn();Cn();On();Mn();In()});P();var Y={version:"5.4.0",link:"Instant_Diffs",discussion:"Talk:Instant_Diffs",outname:"instantDiffs",outdir:"dist",origin:"https://www.mediawiki.org",server:"https://www.mediawiki.org",prefix:"instantDiffs",messagePrefix:"instant-diffs",settingsPrefix:"userjs-instantDiffs",dependencies:{styles:"/w/index.php?title=User:Serhio_Magpie/instantDiffs.css&action=raw&ctype=text/css",messages:"/w/index.php?title=User:Serhio_Magpie/instantDiffs-i18n/$lang.js&action=raw&ctype=text/javascript",main:["oojs","mediawiki.api","mediawiki.util","mediawiki.user","mediawiki.storage","mediawiki.notification","mediawiki.ForeignApi","mediawiki.Title"],settings:["oojs","oojs-ui-core","oojs-ui-widgets","oojs-ui-windows","oojs-ui.styles.icons-interactions"],window:["oojs","oojs-ui-core","oojs-ui-widgets","oojs-ui-windows","oojs-ui.styles.icons-accessibility","oojs-ui.styles.icons-movement","oojs-ui.styles.icons-content","oojs-ui.styles.icons-alerts","oojs-ui.styles.icons-interactions","oojs-ui.styles.icons-moderation","oojs-ui.styles.icons-editing-core","oojs-ui.styles.icons-editing-advanced","oojs-ui.styles.icons-user","oojs-ui.styles.icons-layout"],content:["jquery.confirmable","mediawiki.DateFormatter","mediawiki.codex.messagebox.styles","mediawiki.interface.helpers.styles","mediawiki.diff","mediawiki.diff.styles","mediawiki.misc-authed-curate","mediawiki.page.watch.ajax","ext.flaggedRevs.basic","ext.visualEditor.diffPage.init"],page:{"*":["ext.thanks.corethank","ext.checkUser.styles","ext.checkUser.userInfoCard"]},revision:{6:["filepage","wikibase.mediainfo.filepage.styles","wikibase.mediainfo.statements","wikibase.mediainfo.statements.styles"],14:["mediawiki.page.gallery.styles"],146:["wikibase.lexeme.styles"]},skins:{minerva:{"*":["codex-styles","skins.minerva.categories.styles"]}}},foreignDependencies:{revision:{styles:{6:["wikibase.mediainfo.filepage.styles","wikibase.mediainfo.statements","wikibase.mediainfo.statements.styles"],146:["wikibase.lexeme.styles"]},links:{6:["MediaWiki:Filepage.css"]},wikibase:{styles:{all:["jquery.wikibase.toolbar.styles","wikibase.view.ControllerViewFactory","wikibase.alltargets"],desktop:["wikibase.desktop"],mobile:["wikibase.mobile"]}}}},settings:{},defaults:{debug:!1,GM:!1,standalone:!1,storageExpiry:86400,logTimers:!0,expEnableWatchlistPopup:!1},include:{pageActions:["view","history"]},exclude:{pages:[],linkActions:["edit","history"]},labels:{page:{ltr:"\u2794",rtl:"\u{1F870}"},diff:"\u2756",revision:"\u272A",error:"\u{1D4D4}"},breakpoints:{mobileUp:"(min-width: 640px)",mobileDown:"(max-width: 639px)"},wikilinkPresets:{link:{page:"[$href $msg]",diff:"[$href $msg]",revision:"[$href $msg]"},special:{page:"[[$prefSpecial:Redirect/page/$1|$msg]]",diff:"[[$prefSpecial:Diff/$1|$msg]]",revision:"[[$prefSpecial:PermanentLink/$1|$msg]]"}},commonsAssetsPath:"https://upload.wikimedia.org/wikipedia/commons",changeLists:["Watchlist","Recentchanges","Recentchangeslinked"],contributionLists:["Contributions","GlobalContributions"],otherLists:["Newpages","PendingChanges","GlobalWatchlist"],specialPages:["Special:Diff","Special:Permalink","Special:PermanentLink","Special:MobileDiff","Special:Redirect","Special:ComparePages","Special:Undelete"],nonEditableContentModels:["wikibase-item","wikibase-property","wikibase-lexeme"],skinBodyClasses:{"vector-2022":["mw-body","vector-body"],vector:["vector-body"],monobook:["monobook-body"],minerva:["content"],timeless:["mw-body"]},bodyContentSelector:{minerva:"#content",default:"#bodyContent"},contentSelector:"#mw-content-text",specialPagesLinks:["Special:Diff","Special:Permalink","Special:PermanentLink","Special:MobileDiff","Special:Redirect"],specialPagesLinksSearchRegExp:"^($1)",specialPagesLinksPathRegExp:"$1($2)",specialPagesLinksSelector:'a[title^="$1"]',articlePathRegExp:"^($1)",sectionRegExp:/^\/\*\s*(.*?)\s*\*\/.*$/,linkSelector:["a[data-instantdiffs-link]",'a.external[href^="$1"]',"a.mw-changeslist-date","a.mw-changeslist-diff","a.mw-changeslist-diff-cur","a.mw-changeslist-groupdiff",".mw-changeslist-line a.extiw",".mw-fr-reviewlink a",".mw-enhanced-rc-time a",".mw-history-histlinks a",".mw-diff-bytes + a",".mw-contributions-list .comment a",".mw-fr-pending-changes-table a.cdx-docs-link","#mw-revision-nav a","table.diff #differences-prevlink","table.diff #differences-nextlink",".mw-diff-revision-history-links a",".mw-logevent-loglines a","[data-afl-log-id] a",'li[class^="mw-tag"] a',"a.ext-globalwatchlist-diff",".wikibase-statementview-references a","a.edit-summary-time","#mw-fr-revision-messages a","#mw-fr-revision-details a"],mwLine:{selector:[".mw-changeslist-line",".mw-contributions-list li",".mw-fr-pending-changes-table tr",".mw-logevent-loglines li",".mw-special-AbuseLog [data-afl-log-id]",'.mw-special-EditTags li[class^="mw-tag"]',".ext-globalwatchlist-site li"],seen:["mw-changeslist-line-not-watched","mw-enhanced-not-watched","mw-changeslist-watchedseen"],unseen:["mw-changeslist-line-watched","mw-enhanced-watched","mw-changeslist-watchedunseen"]},mwLineTitle:{selector:[".mw-changeslist-title",".mw-contributions-title",".mw-newpages-pagename",".mw-fr-pending-changes-page-title"]},mwLink:{id:["differences-prevlink","differences-nextlink"],hasClass:["mw-diff-revision-history-link-prev","mw-diff-revision-history-link-next","mw-changeslist-date","mw-changeslist-diff","mw-changeslist-diff-cur","mw-changeslist-groupdiff","mw-newpages-time"],closestTo:[".mw-changeslist-line",".mw-contributions-list",".mw-history-histlinks",".mw-pager-navigation-bar + ul",".mw-fr-hist-difflink","#mw-fr-reviewnotice","#mw-fr-revisiontag","#mw-fr-revisiontag-edit","#mw-fr-revision-tag-edit",".mw-specialpage-summary","#mw-revision-nav",".mw-fr-pending-changes-table",".mw-logevent-loglines",".mw-special-AbuseLog li[data-afl-log-id]",'.mw-special-EditTags li[class^="mw-tag"]',".wikibase-statementview-references",".ext-globalwatchlist-site",".tux-message-editor",".mw-pt-translate-header"]},mwLinkExclude:{hasClass:["mw-contributions-title"]},mwLinkDiffOnly:{id:["differences-prevlink","differences-nextlink"],closestTo:["#mw-revision-nav"]},mwLinkPrepend:{id:["differences-nextlink"],hasClass:["mw-diff-revision-history-link-next"]},mwLinkAltTitle:{closestTo:[".mw-fr-reviewlink",".mw-history-histlinks"]},mwLinkContent:{closestTo:[".mw-parser-output"]},mwLinkContentInside:{closestTo:[".comment"]}},bs={messages:{},settings:{},defaults:{},require:null,language:null,linkSelector:null,mwIsAnon:!0,mwEndPoint:null,mwEndPointUrl:null,mwAction:null,mwArticlePath:null,mwCanonicalSpecialPageName:null,mwTitle:null,mwTitleText:null,mwServers:[],mwServerNames:[],specialPagesLocalPrefixed:{},specialPagesAliases:{},specialPagesAliasesFlat:[],specialPagesAliasesPrefixed:{},specialPagesAliasesPrefixedFlat:[],specialPagesLinksAliases:{},specialPagesLinksAliasesFlat:[],specialPagesLinksAliasesPrefixed:{},specialPagesLinksAliasesPrefixedFlat:[],specialPagesLinksPathRegExp:null,specialPagesLinksSearchRegExp:null,articlePathRegExp:null,mutationObserver:null,interactionObserver:null},vs={};y();j();Ct();B();le();at();Ee();yt();Ji();Xi();le();at();ee();var us=class extends ie{article;constructor(e){super({article:{},...e,ariaHaspopup:!0,handler:()=>this.openDialog()}),this.article=new W(this.options.article)}openDialog(){let e={onOpen:()=>this.onDialogOpen(),onClose:()=>this.onDialogClose()};if(L.setup(this,e))return this.onDialogRequest(),$.when(L.load()).always(()=>this.onDialogLoad())}onDialogRequest(){this.pending(!0),this.emit("loading")}onDialogLoad(){this.pending(!1),this.emit("loaded")}onDialogOpen(){this.emit("opened")}onDialogClose(){this.emit("closed")}getArticle(){return this.article}},Ft=us;P();C();var hs=class extends Ft{nodes={};openDialog(){this.nodes.$oldid=$('#mw-history-compare input[name="oldid"]:checked'),this.nodes.$oldidLine=this.nodes.$oldid.closest("li"),this.nodes.$diff=$('#mw-history-compare input[name="diff"]:checked'),this.nodes.$diffLine=this.nodes.$diff.closest("li"),this.article.set({type:"diff",title:o.local.mwTitleText,oldid:this.nodes.$oldid.val(),diff:this.nodes.$diff.val()}),super.openDialog()}onDialogOpen(){l.get("highlightLine")&&(this.nodes.$oldidLine.addClass("instantDiffs-line--highlight"),this.nodes.$diffLine.addClass("instantDiffs-line--highlight")),super.onDialogOpen()}onDialogClose(){l.get("highlightLine")&&(this.nodes.$oldidLine.removeClass("instantDiffs-line--highlight"),this.nodes.$diffLine.removeClass("instantDiffs-line--highlight")),super.onDialogClose()}},ps=hs;Wi();ee();C();var Mo=ms({"../dist/instantDiffs-i18n-bundle.js":()=>An()});function Wn(){if(!(o.isPageAdjustmentsApplied||!pe())){if(o.isPageAdjustmentsApplied=!0,document.body.classList.add("instantDiffs-enabled"),o.config.changeLists.includes(o.local.mwCanonicalSpecialPageName))return Io();if(o.config.contributionLists.includes(o.local.mwCanonicalSpecialPageName))return Ro();if(o.local.mwCanonicalSpecialPageName==="GlobalWatchlist")return No();if(o.local.mwAction==="history")return Fo()}}function Io(){$(".mw-changeslist-line").addClass("instantDiffs-line")}function Ro(){$(".mw-contributions-list .mw-changeslist-links:not(.mw-pager-tools) > span:first-child").each((e,t)=>{let s=$(t);s.find("a").length===0&&s.wrapInner(Qe())}),o.local.mwCanonicalSpecialPageName==="GlobalContributions"&&Wo()}function Wo(){$(".mw-contributions-list li").each((e,t)=>{let s=$(t),n=s.find("a.mw-changeslist-date, a.mw-changeslist-history");if(n.length!==0)try{let r=new URL(n.prop("href"));Q(s,r.origin)}catch{}})}function No(){let i=document.getElementById("ext-globalwatchlist-watchlistsfeed");o.local.mutationObserver.observe(i,{childList:!0})}function Fo(){let i=$("#pagehistory > li, #pagehistory .mw-contributions-list > li").addClass("instantDiffs-line--history");if(i.length<=1)return;i.each((t,s)=>{let n=$(s),r=n.find(".mw-history-histlinks > span:first-child"),c=n.find(".mw-history-histlinks > span:last-child");r.find("a").length===0&&r.wrapInner(Qe()),c.find("a").length===0&&c.wrapInner(Qe())}),$(".mw-history-compareselectedversions").each((t,s)=>{let r=$(s).find(".mw-history-compareselectedversions-button");new ps({label:d("compare-label",o.config.labels.diff),title:d("compare-title",d("script-name")),classes:["mw-ui-button","cdx-button","instantDiffs-button--compare"],insertMethod:"insertAfter",container:r}),$("<span>").text(" ").addClass("instantDiffs-spacer").insertAfter(r)})}function Vo(i){o.local.require=i,mw.util.addCSS(".instantDiffs-panel { display:none; }"),L.mixin(),l.mixin(),ni(L),ni(l),OO.mixinClass(ie,OO.EventEmitter),OO.mixinClass(ye,OO.EventEmitter),o.local.mwIsAnon=mw.user?.isAnon?.()??!0,o.local.mwEndPoint=`${location.origin}${mw.config.get("wgScript")}`,o.local.mwEndPointUrl=new URL(o.local.mwEndPoint),o.local.mwAction=mw.config.get("wgAction"),o.local.mwArticlePath=mw.config.get("wgArticlePath").replace("$1",""),o.local.mwCanonicalSpecialPageName=mw.config.get("wgCanonicalSpecialPageName"),o.local.mwTitle=new mw.Title(mw.config.get("wgRelevantPageName")),o.local.mwTitleText=o.local.mwTitle.getPrefixedText();let e=fs();mw.config.set("wgMobileServer",e),mw.config.set("wgMobileServerName",K("hostname",e));let t=[mw.config.get("wgServer"),mw.config.get("wgMobileServer")].filter(n=>!a(n)).map(Ke);o.local.mwServers=[...new Set(t)];let s=[mw.config.get("wgServerName"),mw.config.get("wgMobileServerName")].filter(n=>!a(n));return o.local.mwServerNames=[...new Set(s)],o.local.lastVersion=mw.storage.get(`${o.config.prefix}-version`),mw.storage.set(`${o.config.prefix}-version`,o.config.version),o.local.mutationObserver=new MutationObserver(Yo),o.local.interactionObserver=new IntersectionObserver(Jo,{threshold:0,rootMargin:l.get("debug")?"0px 0px 0px 0px":"33% 0px 33% 0px"}),window.addEventListener("pageshow",Xo),window.addEventListener("beforeunload",Zo),Promise.allSettled([b.getSpecialPages(),jo(),...qo()])}async function jo(){let{general:i}=await b.getSiteInfo(["general"])||{};if(!T(i)){a(i.mobileserver)||(mw.config.set("wgMobileServer",i.mobileserver),mw.config.set("wgMobileServerName",i.mobileservername));let e=[...o.local.mwServers,i.server,i.mobileserver].filter(s=>!a(s)).map(Ke);o.local.mwServers=[...new Set(e)];let t=[...o.local.mwServerNames,i.servername,i.mobileservername].filter(s=>!a(s));o.local.mwServerNames=[...new Set(t)]}}function qo(){return["en",mw.config.get("wgUserLanguage")].filter((e,t,s)=>s.indexOf(e)===t&&!o.i18n[e]).map(e=>{let t=o.config.dependencies.messages.replace("$lang",e);return mw.loader.getScript(Mt(t))})}function Bo(){for(let[i,e]of Object.entries(b.specialPagesLocal))o.local.specialPagesLocalPrefixed[i]=new mw.Title(e).getPrefixedDb(),o.local.specialPagesAliases[i]=Nt(b.specialPagesLocal,i),o.local.specialPagesAliasesPrefixed[i]=Nt(o.local.specialPagesLocalPrefixed,i),o.config.specialPagesLinks.includes(i)&&(o.local.specialPagesLinksAliases[i]=o.local.specialPagesAliases[i],o.local.specialPagesLinksAliasesPrefixed[i]=o.local.specialPagesAliasesPrefixed[i]);o.local.specialPagesAliasesFlat=Object.values(o.local.specialPagesAliases).flat(),o.local.specialPagesAliasesPrefixedFlat=Object.values(o.local.specialPagesAliasesPrefixed).flat(),o.local.specialPagesLinksAliasesFlat=Object.values(o.local.specialPagesLinksAliases).flat(),o.local.specialPagesLinksAliasesPrefixedFlat=Object.values(o.local.specialPagesLinksAliasesPrefixed).flat()}function Uo(){o.local.articlePathRegExp=new RegExp(o.config.articlePathRegExp.replaceAll("$1",o.local.mwArticlePath));let i=[];o.config.linkSelector.forEach(t=>{/\$1/.test(t)?o.local.mwServers.forEach(s=>{i.push(t.replaceAll("$1",s))}):i.push(t)}),o.local.specialPagesLinksAliasesFlat.forEach(t=>{i.push(o.config.specialPagesLinksSelector.replaceAll("$1",t))});let e=o.local.specialPagesLinksAliasesPrefixedFlat.join("|");o.local.specialPagesLinksPathRegExp=new RegExp(o.config.specialPagesLinksPathRegExp.replaceAll("$1",o.local.mwArticlePath).replaceAll("$2",e)),o.local.specialPagesLinksSearchRegExp=new RegExp(o.config.specialPagesLinksSearchRegExp.replaceAll("$1",e)),o.local.linkSelector=i.join(",")}function Ho(){Y.settings={...ss(),...Y.settings},Y.defaults={...ns(),...Y.defaults};let i={...Y.settings,...o.settings},e={...Y.defaults,...o.defaults,...os()};if(o.isRunning){o.isReplaced=Ko(i,e),E(o.isReplaced?"error-prepare-replaced":"error-prepare-version",{tag:"app",message:`loaded: ${o.config.version}, concurrent: ${Y.version}`,silent:!0});return}o.isRunning=!0,o.i18n||={},o.config=Y,o.local=bs,o.local.settings=i,o.local.defaults=e,o.timers=vs,o.utils=w,o.modules={Api:b,Article:W,Link:O,Button:ie,ViewButton:Ft,HistoryCompareButton:ps,Page:ye,LocalPage:Dt,GlobalPage:Lt,Watch:gt,view:L,settings:l},o.timers.run=mw.now(),_o(),It(),Rn(),Go()}function _o(){let{loaders:i}=Mo(`../${o.config.outdir}/${o.config.outname}-i18n-bundle.js`);for(let e of Object.values(i))e()}function Go(){mw.loader.load(Mt(o.config.dependencies.styles),"text/css"),mw.loader.using(o.config.dependencies.main).then(Vo).then(()=>$(zo)).fail(i=>{E("error-prepare-generic",{tag:"app",message:i?.message})})}async function zo(){if(await l.processDefaults(),It(),mw.config.get("skin")==="minerva"&&!l.get("enableMobile")){E("error-prepare-mobile",{tag:"app",silent:!0});return}o.isReady=!0,Bo(),Uo(),Wn(),o.timers.ready=mw.now(),mw.hook(`${o.config.prefix}.ready`).fire(o),mw.hook("wikipage.content").add(Nn),mw.hook(`${o.config.prefix}.process`).add(Fn),mw.hook(`${o.config.prefix}.replace`).add(Qo)}function Nn(i){!i||!pe()||(o.isFirstRun=!o.isRunCompleted,o.isFirstRun&&(o.isRunCompleted=!0,i=$e()),Fn(i),l.get("logTimers")&&o.isFirstRun&&(he("ready time",o.timers.run,o.timers.ready),he("total time",o.timers.run,o.timers.processEnd)))}function Fn(i){if(!i)return;o.timers.processStart=mw.now(),o.timers.findLinksStart=mw.now();let e=O.findLinks(i);o.timers.findLinksEnd=mw.now();let t=[],s=[];for(let n of e){if(O.hasLink(n))continue;let r=new O(n);t.push(r),r.isValid&&s.push(r)}o.timers.processEnd=mw.now(),l.get("logTimers")&&t.length>0&&(ne("info",`links found: ${t.length}`),ne("info",`links processed: ${s.length}`),he("links selector time",o.timers.findLinksStart,o.timers.findLinksEnd),he("links process time",o.timers.processStart,o.timers.processEnd)),mw.hook(`${o.config.prefix}.processed`).fire(s)}function Ko(i,e){return o.modules.settings.get("standalone")&&!e.standalone?(mw.hook(`${o.config.prefix}.replace`).fire(i,e),!0):!1}async function Qo(i,e){!i||!e||(o.local.settings=i,o.local.defaults=e,o.isReady&&(await l.processDefaults(),o.timers.run=mw.now(),o.timers.ready=mw.now(),Wn(),Nn($e())))}function Jo(i){o.isUnloading||i.forEach(e=>{if(!e.isIntersecting)return;let t=O.getLink(e.target);t&&t.onIntersect()})}function Yo(i){o.isUnloading||i.forEach(e=>{e.addedNodes.length>0&&mw.hook(`${o.config.prefix}.process`).fire($(e.target))})}function Xo(i){i.persisted&&(o.isUnloading=!1)}function Zo(){o.isUnloading=!0}Ho();})(); /* </nowiki> */ 0jofg6fv7d9vf9zi1o382kq4yq11wtn User:Serhio Magpie/instantDiffs.css 2 2203103 8365097 8363215 2026-05-04T10:15:00Z Serhio Magpie 1775170 [e81b54d] [v5.4.0]: Updated from repository. 8365097 css text/css /** * Instant Diffs * * Version: 5.4.0 * Author: Serhio Magpie * Licenses: (MIT OR CC-BY-SA-4.0) * Documentation: https://www.mediawiki.org/wiki/Instant_Diffs * * For license information please see: https://www.mediawiki.org/wiki/User:Serhio_Magpie/instantDiffs.js.LEGAL.txt */ /* <nowiki> */ .instantDiffs-link{padding-inline:var(--instantDiffs-gap);-webkit-box-decoration-break:clone;box-decoration-break:clone;background:var(--instantDiffs-background-link);color:var(--instantDiffs-color-link);text-decoration:none}.instantDiffs-link:where(:not(.cdx-button)){border-radius:1em}.instantDiffs-link:before{margin-inline-end:var(--instantDiffs-gap)}.instantDiffs-link:after{margin-inline-start:var(--instantDiffs-gap)}.instantDiffs-link.is-insertBefore:before{content:var(--instantDiffs-label)}.instantDiffs-link.is-insertAfter:after{content:var(--instantDiffs-label)}.instantDiffs-link.is-insertAfter[rel~="mw:ExtLink"]:empty:after{margin-inline:0;content:"[" counter(mw-numbered-ext-link) "] " var(--instantDiffs-label);counter-increment:mw-numbered-ext-link}.instantDiffs-link:is(:hover,:focus-visible){background:var(--instantDiffs-background-link--hover);color:var(--instantDiffs-color-link--hover);text-decoration:none}.instantDiffs-link:is(:active,:focus){background:var(--instantDiffs-background-link--active);color:var(--instantDiffs-color-link--active);text-decoration:none}.instantDiffs-link--diff{--instantDiffs-label: var(--instantDiffs-label-diff)}.instantDiffs-link--revision{--instantDiffs-label: var(--instantDiffs-label-revision)}.instantDiffs-link--error{background:var(--instantDiffs-background-link-error);color:var(--instantDiffs-color-link-error)}.instantDiffs-link--error:is(:hover,:focus-visible){background:var(--instantDiffs-background-link-error--hover);color:var(--instantDiffs-color-link-error--hover)}.instantDiffs-link--error:is(:active,:focus){background:var(--instantDiffs-background-link-error--active);color:var(--instantDiffs-color-link-error--active)}.instantDiffs-link--pending{cursor:wait!important}.instantDiffs-panel{margin-inline:var(--instantDiffs-gap);font-weight:400;font-style:normal;color:#72777d;user-select:none}.instantDiffs-panel:is(:empty){display:none!important}span.instantDiffs-panel{display:inline}.instantDiffs-panel a{cursor:pointer;color:inherit}.instantDiffs-panel .item:not(:last-child){margin-inline-end:var(--instantDiffs-gap)}.instantDiffs-panel .error{font-size:inherit}.instantDiffs-panel .error-info{cursor:help}.cdx-dialog__footer__actions .instantDiffs-panel{align-self:center}.instantDiffs-panel-placeholder{padding-inline:var(--instantDiffs-gap)}.instantDiffs-panel-placeholder:after{margin-inline-start:var(--instantDiffs-gap);color:var(--color-placeholder, #72777d);content:var(--instantDiffs-label-placeholder)}.instantDiffs-panel-placeholder.has-link{padding:0}.instantDiffs-panel-placeholder--diff:after{content:var(--instantDiffs-label-diff)}.instantDiffs-panel-placeholder--revision:after{content:var(--instantDiffs-label-revision)}.instantDiffs-panel-placeholder--loader:after{color:var(--color-disabled, #a2a9b1);animation:instantDiffs-blink 1s infinite alternate}@keyframes instantDiffs-blink{0%{opacity:0}to{opacity:1}}.instantDiffs-navigation{margin:0 -16px 1em;padding:1em 16px;display:flex;gap:.5em;position:sticky;z-index:2;top:0;border-bottom:1px solid var(--instantDiffs-border-color);background:var(--instantDiffs-background-navigation);background-clip:padding-box;-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);font-size:var(--instantDiffs-font-size-navigation)}@media (max-width: 639px){.instantDiffs-navigation{padding:.5em}}.instantDiffs-navigation-group{display:flex;gap:var(--instantDiffs-gap)}.instantDiffs-navigation-group--left{justify-content:flex-start;flex:1}@media (max-width: 639px){.instantDiffs-navigation-group--left .instantDiffs-button--pending,.instantDiffs-navigation-group--left .instantDiffs-button--back{display:none}}.instantDiffs-navigation-group--center{min-width:0;justify-content:center;flex:0 1 auto}.instantDiffs-navigation-group--center .oo-ui-buttonElement{min-width:0;flex:auto}.instantDiffs-navigation-group--center .oo-ui-buttonElement-button{display:block;overflow:hidden;text-overflow:ellipsis}@media (max-width: 639px){.instantDiffs-navigation-group--center{flex:auto}.instantDiffs-navigation-group--center .instantDiffs-button--switch{display:none}}.instantDiffs-navigation-group--right{justify-content:flex-end;flex:1}@media (max-width: 959px){.instantDiffs-navigation-group--right .instantDiffs-button--pin{display:none}}.instantDiffs-buttons-group{min-width:0;margin:0;display:flex}.instantDiffs-buttons-group:is(:empty){display:none}.instantDiffs-buttons-group--vertical{padding:0;flex-direction:column}.instantDiffs-buttons-group--vertical:is(:empty)+hr{display:none}.instantDiffs-buttons-group--vertical.has-icons{gap:var(--instantDiffs-gap)}@media (max-width: 959px){.instantDiffs-buttons-group--pins-custom{display:none}}@media (min-width: 640px){.instantDiffs-buttons-group--mobile.instantDiffs-buttons-group--mobile{display:none}.instantDiffs-buttons-group--mobile+hr{display:none}}.instantDiffs-buttons-separator{margin:0;flex:none;background-color:var(--instantDiffs-border-color)}.instantDiffs-buttons-popup .oo-ui-popupWidget-popup{padding:0}.instantDiffs-buttons-popup .oo-ui-popupWidget-body{display:flex;flex-direction:column}.instantDiffs-buttons-popup.has-icons .oo-ui-popupWidget-body{padding:var(--instantDiffs-gap);gap:var(--instantDiffs-gap)}.instantDiffs-button--link{display:block}.instantDiffs-button--link>.oo-ui-buttonElement-button{display:block}.instantDiffs-button--link.oo-ui-buttonElement-frameless.instantDiffs-button--link.oo-ui-buttonElement-frameless:first-child{margin:0}.instantDiffs-button--link.oo-ui-buttonElement-frameless>.oo-ui-buttonElement-button{margin:0;border-radius:var(--instantDiffs-button-radius)}.instantDiffs-button--link.oo-ui-widget-enabled>.oo-ui-buttonElement-button:is(:hover,:focus){background-color:var(--background-color-interactive, #eaecf0);color:var(--color-progressive--hover, var(--instantDiffs-color-link--hover))}.instantDiffs-button--link.oo-ui-widget-enabled>.oo-ui-buttonElement-button:active{border-color:var(--border-color-progressive--active, #2a4b8d);background-color:var(--background-color-progressive-subtle, #eaf3ff);color:var(--color-progressive--active, var(--instantDiffs-color-link--active))}.instantDiffs-button--link-id .oo-ui-labelElement-label{white-space:wrap}.instantDiffs-button--link-id .oo-ui-labelElement-label .name{white-space:nowrap}.instantDiffs-button--link-id .oo-ui-labelElement-label .version{white-space:nowrap;font-size:.8em;color:var(--color-placeholder, #72777d)}.instantDiffs-button--fake-watch{position:fixed;top:0;left:0;visibility:hidden}.instantDiffs-label{max-width:100%;display:inline-flex;gap:var(--instantDiffs-gap)}.instantDiffs-label i{flex:none}.instantDiffs-label span{min-width:0;flex:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media (min-width: 960px){.instantDiffs-label--short{display:none}}@media (max-width: 959px){.instantDiffs-label--long{display:none}}.instantDiffs-page{width:auto;max-width:none;display:flow-root;margin:0;padding:0;font-size:var(--instantDiffs-font-size);line-height:var(--instantDiffs-line-height)}.instantDiffs-page-tools{display:flex;justify-content:center}.instantDiffs-page-tools:is(:empty){display:none}.instantDiffs-page-body{display:flow-root;position:relative;z-index:1}.instantDiffs-page-body .cdx-message--block{margin-bottom:1em}.instantDiffs-page-body #mw-fr-diff-headeritems{margin-top:0}.instantDiffs-page-body #mw-fr-revisiontag-old{margin-bottom:1em}.instantDiffs-page-body .mw-diff-table-prefix{min-height:2rem;margin-top:0}.instantDiffs-page-body .mw-diffPage-inlineToggle-container .oo-ui-fieldLayout>.oo-ui-fieldLayout-body>.oo-ui-fieldLayout-field{width:auto}.instantDiffs-page-body table.diff .mw-rollback-link{display:initial}.instantDiffs-page-body table.diff .jquery-confirmable-wrapper{vertical-align:top}.instantDiffs-page-body .mw-parser-output{text-align:initial}.instantDiffs-page-body #toc,.instantDiffs-page-body .mw-diff-mobile-footer{display:none}.instantDiffs-page-body .wikibase-statementgroupview .wikibase-snakview-body{margin-right:0!important}.instantDiffs-page-body .wikibase-statementgroupview .wikibase-statementview-mainsnak{max-width:none!important;margin-right:0!important}.instantDiffs-page-body--foreign .wikibase-statementgroupview .wikibase-initially-collapsed{display:block!important}.instantDiffs-page-body--foreign .wikibase-entitytermsview .wikibase-toolbar-container{position:relative}.instantDiffs-page-mediaInfo .oo-ui-indexLayout-stackLayout>.oo-ui-tabPanelLayout-active{margin:1rem 0 0;padding:0}.oo-ui-windowManager-modal>.instantDiffs-view.oo-ui-window-active{top:var(--instantDiffs-view-top)}.instantDiffs-view .oo-ui-messageDialog-container{scroll-padding-top:var(--instantDiffs-view-scroll-padding-top)}.instantDiffs-view .oo-ui-messageDialog-message{transition:opacity .15s ease-in-out}.instantDiffs-view .oo-ui-messageDialog-message.is-transparent{opacity:0}.oo-ui-windowManager-modal:not(.oo-ui-windowManager-size-full) .instantDiffs-view .instantDiffs-navigation{border-radius:var(--instantDiffs-view-radius) var(--instantDiffs-view-radius) 0 0}.oo-ui-windowManager-modal:not(.oo-ui-windowManager-size-full) .instantDiffs-view .instantDiffs-view-loader{border-top-right-radius:max(var(--instantDiffs-view-radius),.28571429em) .28571429em;border-top-left-radius:max(var(--instantDiffs-view-radius),.28571429em) .28571429em}.instantDiffs-view-overlay{position:absolute;inset:0;z-index:-1}.instantDiffs-view-loader{max-width:none;position:absolute;inset:0 0 auto;z-index:3;border-radius:0;transition:opacity .15s ease-in-out}.instantDiffs-view-loader .oo-ui-progressBarWidget-bar{animation-duration:1s}.instantDiffs-view-loader.is-transparent{opacity:0}.oo-ui-windowManager-modal>.instantDiffs-settings.oo-ui-window-active{top:var(--instantDiffs-view-top)}.instantDiffs-settings-panel--empty,.instantDiffs-settings-panel--finish{min-height:100%;box-sizing:border-box;display:flex;justify-content:center;align-items:center}.instantDiffs-settings-panel--empty[hidden],.instantDiffs-settings-panel--finish[hidden]{display:none}.instantDiffs-settings-panel--empty .instantDiffs-notice-box,.instantDiffs-settings-panel--finish .instantDiffs-notice-box{transform:translateY(-50%)}ul.instantDiffs-list--settings{padding:0;margin-block:0;margin-inline:1.42857143em 0;list-style:disc;font-size:var(--instantDiffs-font-size-hint)}ul.instantDiffs-list--settings li{margin:0}ul.instantDiffs-list--settings i{direction:ltr;unicode-bidi:embed}:root{--instantDiffs-label-diff: "\2756";--instantDiffs-label-revision: "\272a";--instantDiffs-label-placeholder: "\25c7";--instantDiffs-color-link: var(--color-progressive, #36c);--instantDiffs-color-link--hover: var(--color-progressive--hover, #3056a9);--instantDiffs-color-link--active: var(--color-progressive--active, #233566);--instantDiffs-color-link-error: var(--color-error, #bf3c2c);--instantDiffs-color-link-error--hover: var(--color-error--hover, #9f3526);--instantDiffs-color-link-error--active: var(--color-error--active, #612419);--instantDiffs-background-link: var(--background-color-progressive-subtle, #f1f4fd);--instantDiffs-background-link--hover: var(--background-color-interactive-subtle--hover, #eaecf0);--instantDiffs-background-link--active: var(--background-color-interactive-subtle--active, #dadde3);--instantDiffs-background-link-error: var(--background-color-error-subtle, #ffe9e5);--instantDiffs-background-link-error--hover: var(--background-color-error-subtle--hover, #ffdad3);--instantDiffs-background-link-error--active: var(--background-color-error-subtle--active, #ffc8bd);--instantDiffs-background-line: color-mix(in srgb, var(--border-color-progressive, #cfe3ff) 30%, transparent);--instantDiffs-background-navigation: color-mix(in srgb, var(--background-color-base, #ffffff) 70%, transparent);--instantDiffs-border-color: var(--border-color-base, #a2a9b1);--instantDiffs-line-height: var(--line-height-medium, 1.5714285);--instantDiffs-font-size: var(--font-size-medium, .875rem);--instantDiffs-font-size-navigation: var(--font-size-medium, .875rem);--instantDiffs-font-size-hint: .75rem;--instantDiffs-gap: .25rem;--instantDiffs-view-top: 0;--instantDiffs-view-radius: 0;--instantDiffs-view-scroll-padding-top: 0;--instantDiffs-button-radius: var(--border-radius-base, 2px)}.instantDiffs-hidden{display:none!important}.instantDiffs-invisibleIconElement.instantDiffs-invisibleIconElement.oo-ui-buttonElement-framed>.oo-ui-buttonElement-button{padding-inline:12px}.instantDiffs-invisibleIconElement.instantDiffs-invisibleIconElement.oo-ui-buttonElement-frameless>.oo-ui-buttonElement-button{padding-inline:6px}.instantDiffs-invisibleIconElement .oo-ui-iconElement-icon{display:none}.instantDiffs-notice-box{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:1rem;white-space:pre-wrap;text-align:center}.instantDiffs-notice-box img{width:64px;aspect-ratio:1/1;border:none;font-size:0}.instantDiffs-notice-box h5{padding:0;margin:0}.instantDiffs-notice-box--empty img{width:128px}.instantDiffs-notification-label{font-weight:700}li.instantDiffs-line,tr.instantDiffs-line td,table.instantDiffs-line td{transition:background-color 1s ease-in-out}li.instantDiffs-line--highlight,tr.instantDiffs-line--highlight td,table.instantDiffs-line--highlight td{transition-duration:.25s;background-color:var(--instantDiffs-background-line)!important}.instantDiffs-line--seen .mw-title{font-weight:400}.mw-fr-reviewlink .instantDiffs-panel,.mw-changeslist-links .instantDiffs-panel,.mw-changeslist-diff-cur+.instantDiffs-panel,.mw-changeslist-diff+.instantDiffs-panel{margin-inline-end:0}.mw-fr-reviewlink .instantDiffs-link{background:transparent}.instantDiffs-button--compare{font-weight:400}.instantDiffs-button--compare.mw-ui-button{min-width:0}.instantDiffs-enabled .mw-history-compareselectedversions :is(.mw-ui-button,.cdx-button){vertical-align:top}body:not(.skin-minerva) .instantDiffs-line--history .mw-history-histlinks{margin-inline-end:.5em}body:not(.skin-minerva) .instantDiffs-line--history .mw-changeslist-date{margin-inline-start:.5em}@media screen{.skin-monobook{--instantDiffs-border-color: #ccc;--instantDiffs-line-height: 1.5;--instantDiffs-font-size: .794rem;--instantDiffs-font-size-navigation: var(--instantDiffs-font-size);--instantDiffs-button-radius: var(--border-radius-base, 3px)}}.skin-monobook .instantDiffs-view .oo-ui-messageDialog-text{padding:1rem 1rem 1.25rem}.skin-monobook .instantDiffs-navigation{margin-inline:-1rem;margin-bottom:1rem;padding:1rem}@media (max-width: 639px){.skin-monobook .instantDiffs-navigation{padding:.5rem 1rem}}@media (min-width: 640px){.skin-minerva{--instantDiffs-line-height: 1.65;--instantDiffs-font-size: 1rem}}.skin-minerva .instantDiffs-page-body table.diff{margin:0}.skin-minerva .instantDiffs-page-body:is(.mw-heading1,h1,.mw-heading2,h2){font-family:Linux Libertine,Georgia,Times,"Source Serif Pro",serif}.skin-minerva .instantDiffs-page-body .mw-diff-timestamp:is(:empty){display:none}.skin-minerva .instantDiffs-page-body .diff-title .mw-userlink{float:none}.skin-minerva .instantDiffs-page-body .diff-title .mw-userlink:before{display:none}.skin-minerva .instantDiffs-page-body .diff-title .mw-usertoollinks{float:none}@media (max-width: 639px){.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer{height:auto;display:block;margin:1em -16px -16px;position:sticky;inset:auto auto 0}.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-userlink{padding-top:0}.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-rollback-link:last-child,.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-diff-undo:last-child{padding-bottom:0}.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-rollback-link>.cdx-button{margin:0}.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-thanks-thank-link{max-width:100%;margin:0}.skin-minerva .instantDiffs-page-body .mw-diff-mobile-footer .mw-thanks-thank-link+.jquery-confirmable-interface{width:100%!important}}.skin-minerva .instantDiffs-page-body #mw-fr-diff-headeritems .fr-diff-ratings{margin:0}@media (max-width: 639px){.skin-minerva .instantDiffs-page-body #mw-fr-diff-headeritems .fr-diff-ratings td{width:100%!important;text-align:left!important}.skin-minerva .instantDiffs-page-body #mw-fr-diff-headeritems .fr-diff-ratings td:nth-child(2n-1){display:none}}.skin-minerva .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink:before{display:none!important}.skin-minerva .instantDiffs-line .minoredit{font-size:inherit}.skin-minerva .instantDiffs-line:not(.instantDiffs-line--history) .minoredit{margin-right:.5em;padding:0;background:transparent}.skin-minerva.mw-special-Watchlist .instantDiffs-line .ext-checkuser-userinfocard-button{float:left;clear:left;padding-top:0}.skin-minerva.mw-special-Watchlist .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink{float:left;clear:none;padding-top:0}.skin-minerva.mw-special-Watchlist .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:left;clear:right;padding-top:0}.skin-minerva.mw-special-Watchlist .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button{float:none;clear:both}.skin-minerva.mw-special-Watchlist .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink{float:none;clear:both}.skin-minerva.mw-special-Watchlist .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:none;clear:both}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .mw-userlink:before{width:100%;height:0;min-height:0;margin:0;display:table;content:""}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .mw-usertoollinks{display:inline!important}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .ext-checkuser-userinfocard-button{float:left;clear:left;padding-top:0}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink{float:left;clear:none;padding-top:0}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:left;clear:right;padding-top:0}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button{float:none;clear:both}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink{float:none;clear:both}.skin-minerva.mw-special-Recentchanges .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:none;clear:both}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-userlink:before{width:100%;height:0;min-height:0;margin:0;display:table;content:""}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-userlink:before{width:0;min-width:0}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-usertoollinks{display:inline!important}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .ext-checkuser-userinfocard-button{float:left;clear:left;padding-top:0}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink{float:left;clear:none;padding-top:0}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:left;clear:right;padding-top:0}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button{float:none;clear:both}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink{float:none;clear:both}.skin-minerva.mw-special-Recentchangeslinked .instantDiffs-line .mw-changeslist-log-entry .ext-checkuser-userinfocard-button+.mw-userlink+.mw-usertoollinks{float:none;clear:both}.skin-minerva:not(.mw-mf-amc-disabled) .instantDiffs-line .mw-userlink:before{width:100%;height:0;min-height:0;margin:0;display:table;content:""}.skin-minerva:not(.mw-mf-amc-disabled) .instantDiffs-line .mw-usertoollinks{display:inline!important}.skin-minerva:not(.mw-mf-amc-disabled) .instantDiffs-line .mw-changeslist-date{display:inline}.skin-minerva:not(.mw-mf-amc-disabled) .instantDiffs-line--history .mw-userlink:before{width:0;min-width:0}.skin-minerva.mw-mf-amc-disabled .instantDiffs-line a:is(.mw-history-histlinks-previous,.mw-changeslist-diff){position:relative;font-size:.85rem;color:var(--color-progressive, #36c)!important}.skin-minerva.mw-mf-amc-disabled .instantDiffs-line .instantDiffs-panel{display:inline-block;position:relative;z-index:10}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions{margin:0;display:flex!important;flex-wrap:wrap;align-items:flex-start;gap:10px;flex:auto;padding:10px 0}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions .mw-history-revisionactions{margin:0;display:flex!important;flex-wrap:wrap;align-items:flex-start;gap:10px;flex:auto}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions :is(.mw-ui-button,.cdx-button){max-width:none;flex:auto;margin:0}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions .mw-history-compareselectedversions-button{width:auto;flex:auto}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions .instantDiffs-button--compare{flex:none}.skin-minerva.instantDiffs-enabled .mw-history-compareselectedversions .instantDiffs-spacer,.skin-minerva.mw-mf-amc-disabled .mw-history-compareselectedversions .instantDiffs-button--compare{display:none}.skin-minerva.mw-special-Newpages.instantDiffs-enabled .instantDiffs-line .mw-changeslist-date{display:inline}.skin-minerva.mw-special-Newpages.instantDiffs-enabled .instantDiffs-line .mw-changeslist-time{display:none}.skin-minerva.mw-special-Newpages.instantDiffs-enabled .instantDiffs-line .ext-checkuser-userinfocard-button{float:left}.skin-minerva.mw-special-Newpages.instantDiffs-enabled .instantDiffs-line .mw-userlink:before{display:none}.skin-minerva.mw-special-Newpages.instantDiffs-enabled .instantDiffs-page-body :is(.comment,.mw-userlink,.mw-usertoollinks){float:none;display:inline}.skin-minerva.instantDiffs-enabled .mw-diff-revision-history-links a{flex:none}.skin-minerva.instantDiffs-enabled .mw-diff-revision-history-link-previous+.instantDiffs-panel{margin-inline-end:auto}.skin-minerva.instantDiffs-enabled .instantDiffs-panel:has(+.mw-diff-revision-history-link-next){margin-inline-start:auto}@media screen{.skin-vector-legacy.theme-dark-grey{--instantDiffs-color-link: var(--link, #e6820f);--instantDiffs-color-link--hover: var(--link-vis, #b95500);--instantDiffs-color-link--active: var(--link-vis, #b95500);--instantDiffs-background-link: var(--btn-bg, #2d2d2d);--instantDiffs-background-link--hover: var(--btn-bg, #2d2d2d);--instantDiffs-background-link--active: var(--btn-bg, #2d2d2d);--instantDiffs-background-navigation: color-mix(in srgb, var(--bg-main, #232323) 70%, transparent)}}@media screen{.skin-citizen{--instantDiffs-color-link: var(--color-link);--instantDiffs-color-link--hover: var(--color-link--hover);--instantDiffs-color-link--active: var(--color-link--active);--instantDiffs-background-navigation: color-mix(in srgb, var(--color-surface-1, #ffffff) 70%, transparent);--instantDiffs-font-size: var(--font-size-medium, 1rem);--instantDiffs-font-size-navigation: var(--font-size-small, .875rem);--instantDiffs-line-height: var(--line-height, 1.6);--instantDiffs-view-radius: var(--border-radius-medium)}}.skin-citizen .instantDiffs-view .oo-ui-messageDialog-title{font-size:var(--font-size-large);line-height:var(--line-height-large);font-weight:var(--font-weight-semi-bold)}.skin-citizen #citizen-lastmod-relative.instantDiffs-link.is-insertBefore:before{margin-right:auto}.skin-citizen #citizen-lastmod-relative.instantDiffs-link.is-insertAfter:after{margin-left:auto}@media screen{.skin-fandomdesktop{--instantDiffs-background-navigation: color-mix(in srgb, var(--theme-page-background-color--secondary, #ffffff) 70%, transparent);--instantDiffs-border-color: var(--theme-border-color, #4f4f51);--instantDiffs-line-height: 1.75;--instantDiffs-font-size: 1rem;--instantDiffs-view-top: 45px}}.skin-fandomdesktop .instantDiffs-navigation{margin-inline:-24px}@media (min-width: 640px){.skin-fandomdesktop .instantDiffs-navigation{padding-inline:24px}}.skin-fandomdesktop .instantDiffs-buttons-group--vertical hr{border-color:var(--instantDiffs-border-color)}.skin-fandomdesktop .instantDiffs-view-loader{border:none}.skin-fandomdesktop .instantDiffs-view-loader .oo-ui-progressBarWidget-bar{height:.28571429em}@media screen{.skin-fandommobile{--instantDiffs-background-navigation: color-mix(in srgb, var(--theme-page-background-color--secondary, #ffffff) 70%, transparent);--instantDiffs-border-color: var(--theme-border-color, #4f4f51);--instantDiffs-line-height: 1.75;--instantDiffs-font-size: 1rem;--instantDiffs-view-top: 55px}}.skin-fandommobile .instantDiffs-navigation{margin-inline:-24px}@media (min-width: 640px){.skin-fandommobile .instantDiffs-navigation{padding-inline:24px}}.skin-fandommobile .instantDiffs-buttons-group--vertical hr{border-color:var(--instantDiffs-border-color)}.skin-fandommobile .instantDiffs-view-loader{border:none}.skin-fandommobile .instantDiffs-view-loader .oo-ui-progressBarWidget-bar{height:.28571429em}@media screen{.skin-overclocked{--instantDiffs-font-size: 1.3rem;--instantDiffs-font-size-navigation: var(--instantDiffs-font-size);--instantDiffs-font-size-hint: 1.2rem;--instantDiffs-view-top: 45px}}.skin-overclocked .mw-history-compareselectedversions{margin-top:10px;margin-bottom:10px}.skin-overclocked .mw-history-compareselectedversions-button{margin-top:0;margin-bottom:0}.skin-overclocked .instantDiffs-button--compare{padding:8px 12px}.skin-overclocked .instantDiffs-view-loader{border:none;box-shadow:none}.skin-overclocked .instantDiffs-view-loader .oo-ui-progressBarWidget-bar{height:.28571429em} /* </nowiki> */ 2e4n6gu03eb9jatjui2194zzvcb1zpg Extension:CodeMirror/cs 102 2223639 8364614 8362563 2026-05-03T17:10:10Z Rebulka 17532855 Created page with "Pokud se pro úpravu kódu používá [[$1|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba $2, která je ve výchozím nastavení nastavena na $3." 8364614 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:<span lang="en" dir="ltr" class="mw-content-ltr">Same as $wgCodeMirrorDefaultPreferences but applies to "code"; That is, any CodeMirror mode other than "mediawiki" (wikitext).</span> <span id="Default_preferences"></span> === Výchozí předvolby === <span lang="en" dir="ltr" class="mw-content-ltr">The default preferences are set on either wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}) or all other "modes" such as JavaScript, CSS and JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}).</span> <span class="mw-translate-fuzzy">Proměnné <code>true</code> nebo <code>false</code> slouží k úplnému povolení nebo zakázání funkce, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) nebo [[$3|modely obsahu]] (řetězce).</span> <span class="mw-translate-fuzzy">Toto nastavení konfigurace se navíc vztahuje pouze na ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]].</span> Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování CodeMirror na stránky a šablony JavaScriptu $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! <span lang="en" dir="ltr" class="mw-content-ltr">Default value (code)</span><ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * <span lang="en" dir="ltr" class="mw-content-ltr">Syntax highlighting at [[Special:Upload]].</span> ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * <span class="mw-translate-fuzzy">Moduly ResourceLoader se mění. Viz [[#ResourceLoader modules|průvodce migrací]].</span> * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * <span lang="en" dir="ltr" class="mw-content-ltr">The <code>.cm-mw-doubleUnderscore</code> CSS class has been renamed to <code>.cm-mw-double-underscore</code>.</span> * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} <div lang="en" dir="ltr" class="mw-content-ltr"> This guide applies to MediaWiki 1.45 and later. As of MediaWiki 1.46, [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] is no longer supported. </div> <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== <span lang="en" dir="ltr" class="mw-content-ltr">Ensure you're using the correct [[#Using ResourceLoader|ResourceLoader modules]].</span> Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! <span class="mw-translate-fuzzy">Nový modul (MW 1.45)</span> ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} <div class="mw-translate-fuzzy"> S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou po nějakou dobu aliasovány, než budou zcela odstraněny. </div> <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). <div class="mw-translate-fuzzy"> Aby to od verze MediaWiki 1.45 fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> pro všechna příslušná rozšíření, která jste také nainstalovali: </div> {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Release history == </div> * {{ym|2024|11}} – <span lang="en" dir="ltr" class="mw-content-ltr">The CodeMirror 6 version of the extension was introduced as a beta feature.</span> * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] 0cm4910xg5wefhplnj2q3e57bvbczbi 8364616 8364614 2026-05-03T17:10:54Z Rebulka 17532855 Created page with "Stejné jako $1, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "$2" (wikitext)." 8364616 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === <span lang="en" dir="ltr" class="mw-content-ltr">The default preferences are set on either wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}) or all other "modes" such as JavaScript, CSS and JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}).</span> <span class="mw-translate-fuzzy">Proměnné <code>true</code> nebo <code>false</code> slouží k úplnému povolení nebo zakázání funkce, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) nebo [[$3|modely obsahu]] (řetězce).</span> <span class="mw-translate-fuzzy">Toto nastavení konfigurace se navíc vztahuje pouze na ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]].</span> Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování CodeMirror na stránky a šablony JavaScriptu $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! <span lang="en" dir="ltr" class="mw-content-ltr">Default value (code)</span><ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * <span lang="en" dir="ltr" class="mw-content-ltr">Syntax highlighting at [[Special:Upload]].</span> ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * <span class="mw-translate-fuzzy">Moduly ResourceLoader se mění. Viz [[#ResourceLoader modules|průvodce migrací]].</span> * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * <span lang="en" dir="ltr" class="mw-content-ltr">The <code>.cm-mw-doubleUnderscore</code> CSS class has been renamed to <code>.cm-mw-double-underscore</code>.</span> * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} <div lang="en" dir="ltr" class="mw-content-ltr"> This guide applies to MediaWiki 1.45 and later. As of MediaWiki 1.46, [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] is no longer supported. </div> <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== <span lang="en" dir="ltr" class="mw-content-ltr">Ensure you're using the correct [[#Using ResourceLoader|ResourceLoader modules]].</span> Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! <span class="mw-translate-fuzzy">Nový modul (MW 1.45)</span> ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} <div class="mw-translate-fuzzy"> S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou po nějakou dobu aliasovány, než budou zcela odstraněny. </div> <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). <div class="mw-translate-fuzzy"> Aby to od verze MediaWiki 1.45 fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> pro všechna příslušná rozšíření, která jste také nainstalovali: </div> {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Release history == </div> * {{ym|2024|11}} – <span lang="en" dir="ltr" class="mw-content-ltr">The CodeMirror 6 version of the extension was introduced as a beta feature.</span> * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] lq2kcbtniwwt0hvfwvh4wp3sobqavak 8364618 8364616 2026-05-03T17:11:24Z Rebulka 17532855 Created page with "Výchozí preference jsou nastaveny buď na wikitext ($1), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ($2)." 8364618 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === Výchozí preference jsou nastaveny buď na wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}). <span class="mw-translate-fuzzy">Proměnné <code>true</code> nebo <code>false</code> slouží k úplnému povolení nebo zakázání funkce, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) nebo [[$3|modely obsahu]] (řetězce).</span> <span class="mw-translate-fuzzy">Toto nastavení konfigurace se navíc vztahuje pouze na ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]].</span> Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování CodeMirror na stránky a šablony JavaScriptu $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! <span lang="en" dir="ltr" class="mw-content-ltr">Default value (code)</span><ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * <span lang="en" dir="ltr" class="mw-content-ltr">Syntax highlighting at [[Special:Upload]].</span> ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * <span class="mw-translate-fuzzy">Moduly ResourceLoader se mění. Viz [[#ResourceLoader modules|průvodce migrací]].</span> * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * <span lang="en" dir="ltr" class="mw-content-ltr">The <code>.cm-mw-doubleUnderscore</code> CSS class has been renamed to <code>.cm-mw-double-underscore</code>.</span> * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} <div lang="en" dir="ltr" class="mw-content-ltr"> This guide applies to MediaWiki 1.45 and later. As of MediaWiki 1.46, [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] is no longer supported. </div> <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== <span lang="en" dir="ltr" class="mw-content-ltr">Ensure you're using the correct [[#Using ResourceLoader|ResourceLoader modules]].</span> Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! <span class="mw-translate-fuzzy">Nový modul (MW 1.45)</span> ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} <div class="mw-translate-fuzzy"> S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou po nějakou dobu aliasovány, než budou zcela odstraněny. </div> <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). <div class="mw-translate-fuzzy"> Aby to od verze MediaWiki 1.45 fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> pro všechna příslušná rozšíření, která jste také nainstalovali: </div> {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Release history == </div> * {{ym|2024|11}} – <span lang="en" dir="ltr" class="mw-content-ltr">The CodeMirror 6 version of the extension was introduced as a beta feature.</span> * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] gq4r4l941803f71nitxo04ekttm8ud8 8364621 8364618 2026-05-03T17:12:08Z Rebulka 17532855 8364621 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === Výchozí preference jsou nastaveny buď na wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}). Pro každou funkci použijte <code>true</code> nebo <code>false</code> k jejímu úplnému povolení nebo zákazu, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) označující, kde by měla být funkce ve výchozím nastavení povolena. <span class="mw-translate-fuzzy">Toto nastavení konfigurace se navíc vztahuje pouze na ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]].</span> Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování CodeMirror na stránky a šablony JavaScriptu $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! <span lang="en" dir="ltr" class="mw-content-ltr">Default value (code)</span><ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * <span lang="en" dir="ltr" class="mw-content-ltr">Syntax highlighting at [[Special:Upload]].</span> ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * <span class="mw-translate-fuzzy">Moduly ResourceLoader se mění. Viz [[#ResourceLoader modules|průvodce migrací]].</span> * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * <span lang="en" dir="ltr" class="mw-content-ltr">The <code>.cm-mw-doubleUnderscore</code> CSS class has been renamed to <code>.cm-mw-double-underscore</code>.</span> * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} <div lang="en" dir="ltr" class="mw-content-ltr"> This guide applies to MediaWiki 1.45 and later. As of MediaWiki 1.46, [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] is no longer supported. </div> <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== <span lang="en" dir="ltr" class="mw-content-ltr">Ensure you're using the correct [[#Using ResourceLoader|ResourceLoader modules]].</span> Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! <span class="mw-translate-fuzzy">Nový modul (MW 1.45)</span> ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} <div class="mw-translate-fuzzy"> S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou po nějakou dobu aliasovány, než budou zcela odstraněny. </div> <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). <div class="mw-translate-fuzzy"> Aby to od verze MediaWiki 1.45 fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> pro všechna příslušná rozšíření, která jste také nainstalovali: </div> {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Release history == </div> * {{ym|2024|11}} – <span lang="en" dir="ltr" class="mw-content-ltr">The CodeMirror 6 version of the extension was introduced as a beta feature.</span> * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] rq0hua4w436uprjynppq72pipl9yewc 8364623 8364621 2026-05-03T17:13:29Z Rebulka 17532855 8364623 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === Výchozí preference jsou nastaveny buď na wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}). Pro každou funkci použijte <code>true</code> nebo <code>false</code> k jejímu úplnému povolení nebo zákazu, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) označující, kde by měla být funkce ve výchozím nastavení povolena. Toto nastavení konfigurace platí pouze pro ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]]. Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování CodeMirror na stránky a šablony JavaScriptu $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! <span lang="en" dir="ltr" class="mw-content-ltr">Default value (code)</span><ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * <span lang="en" dir="ltr" class="mw-content-ltr">Syntax highlighting at [[Special:Upload]].</span> ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * <span class="mw-translate-fuzzy">Moduly ResourceLoader se mění. Viz [[#ResourceLoader modules|průvodce migrací]].</span> * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * <span lang="en" dir="ltr" class="mw-content-ltr">The <code>.cm-mw-doubleUnderscore</code> CSS class has been renamed to <code>.cm-mw-double-underscore</code>.</span> * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} <div lang="en" dir="ltr" class="mw-content-ltr"> This guide applies to MediaWiki 1.45 and later. As of MediaWiki 1.46, [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] is no longer supported. </div> <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== <span lang="en" dir="ltr" class="mw-content-ltr">Ensure you're using the correct [[#Using ResourceLoader|ResourceLoader modules]].</span> Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! <span class="mw-translate-fuzzy">Nový modul (MW 1.45)</span> ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} <div class="mw-translate-fuzzy"> S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou po nějakou dobu aliasovány, než budou zcela odstraněny. </div> <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). <div class="mw-translate-fuzzy"> Aby to od verze MediaWiki 1.45 fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> pro všechna příslušná rozšíření, která jste také nainstalovali: </div> {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Release history == </div> * {{ym|2024|11}} – <span lang="en" dir="ltr" class="mw-content-ltr">The CodeMirror 6 version of the extension was introduced as a beta feature.</span> * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] 38zs3q4658vt1ju2kpcgkfi6f1yrgi4 8364625 8364623 2026-05-03T17:14:30Z Rebulka 17532855 8364625 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === Výchozí preference jsou nastaveny buď na wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}). Pro každou funkci použijte <code>true</code> nebo <code>false</code> k jejímu úplnému povolení nebo zákazu, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) označující, kde by měla být funkce ve výchozím nastavení povolena. Toto nastavení konfigurace platí pouze pro ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]]. Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování na šablony a kód $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! <span lang="en" dir="ltr" class="mw-content-ltr">Default value (code)</span><ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * <span lang="en" dir="ltr" class="mw-content-ltr">Syntax highlighting at [[Special:Upload]].</span> ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * <span class="mw-translate-fuzzy">Moduly ResourceLoader se mění. Viz [[#ResourceLoader modules|průvodce migrací]].</span> * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * <span lang="en" dir="ltr" class="mw-content-ltr">The <code>.cm-mw-doubleUnderscore</code> CSS class has been renamed to <code>.cm-mw-double-underscore</code>.</span> * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} <div lang="en" dir="ltr" class="mw-content-ltr"> This guide applies to MediaWiki 1.45 and later. As of MediaWiki 1.46, [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] is no longer supported. </div> <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== <span lang="en" dir="ltr" class="mw-content-ltr">Ensure you're using the correct [[#Using ResourceLoader|ResourceLoader modules]].</span> Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! <span class="mw-translate-fuzzy">Nový modul (MW 1.45)</span> ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} <div class="mw-translate-fuzzy"> S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou po nějakou dobu aliasovány, než budou zcela odstraněny. </div> <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). <div class="mw-translate-fuzzy"> Aby to od verze MediaWiki 1.45 fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> pro všechna příslušná rozšíření, která jste také nainstalovali: </div> {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Release history == </div> * {{ym|2024|11}} – <span lang="en" dir="ltr" class="mw-content-ltr">The CodeMirror 6 version of the extension was introduced as a beta feature.</span> * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] 3ag5dnyh8dwhdarhohj7kyye27sct1x 8364627 8364625 2026-05-03T17:14:52Z Rebulka 17532855 Created page with "Výchozí hodnota (code)" 8364627 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === Výchozí preference jsou nastaveny buď na wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}). Pro každou funkci použijte <code>true</code> nebo <code>false</code> k jejímu úplnému povolení nebo zákazu, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) označující, kde by měla být funkce ve výchozím nastavení povolena. Toto nastavení konfigurace platí pouze pro ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]]. Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování na šablony a kód $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! Výchozí hodnota (code)<ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * <span lang="en" dir="ltr" class="mw-content-ltr">Syntax highlighting at [[Special:Upload]].</span> ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * <span class="mw-translate-fuzzy">Moduly ResourceLoader se mění. Viz [[#ResourceLoader modules|průvodce migrací]].</span> * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * <span lang="en" dir="ltr" class="mw-content-ltr">The <code>.cm-mw-doubleUnderscore</code> CSS class has been renamed to <code>.cm-mw-double-underscore</code>.</span> * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} <div lang="en" dir="ltr" class="mw-content-ltr"> This guide applies to MediaWiki 1.45 and later. As of MediaWiki 1.46, [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] is no longer supported. </div> <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== <span lang="en" dir="ltr" class="mw-content-ltr">Ensure you're using the correct [[#Using ResourceLoader|ResourceLoader modules]].</span> Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! <span class="mw-translate-fuzzy">Nový modul (MW 1.45)</span> ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} <div class="mw-translate-fuzzy"> S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou po nějakou dobu aliasovány, než budou zcela odstraněny. </div> <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). <div class="mw-translate-fuzzy"> Aby to od verze MediaWiki 1.45 fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> pro všechna příslušná rozšíření, která jste také nainstalovali: </div> {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Release history == </div> * {{ym|2024|11}} – <span lang="en" dir="ltr" class="mw-content-ltr">The CodeMirror 6 version of the extension was introduced as a beta feature.</span> * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] janjluedrzsejkar2841qd18z4avcbn 8364629 8364627 2026-05-03T17:14:58Z Rebulka 17532855 Created page with "Zvýrazňování syntaxe na $1." 8364629 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === Výchozí preference jsou nastaveny buď na wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}). Pro každou funkci použijte <code>true</code> nebo <code>false</code> k jejímu úplnému povolení nebo zákazu, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) označující, kde by měla být funkce ve výchozím nastavení povolena. Toto nastavení konfigurace platí pouze pro ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]]. Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování na šablony a kód $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! Výchozí hodnota (code)<ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * Zvýrazňování syntaxe na [[Special:Upload]]. ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * <span class="mw-translate-fuzzy">Moduly ResourceLoader se mění. Viz [[#ResourceLoader modules|průvodce migrací]].</span> * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * <span lang="en" dir="ltr" class="mw-content-ltr">The <code>.cm-mw-doubleUnderscore</code> CSS class has been renamed to <code>.cm-mw-double-underscore</code>.</span> * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} <div lang="en" dir="ltr" class="mw-content-ltr"> This guide applies to MediaWiki 1.45 and later. As of MediaWiki 1.46, [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] is no longer supported. </div> <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== <span lang="en" dir="ltr" class="mw-content-ltr">Ensure you're using the correct [[#Using ResourceLoader|ResourceLoader modules]].</span> Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! <span class="mw-translate-fuzzy">Nový modul (MW 1.45)</span> ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} <div class="mw-translate-fuzzy"> S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou po nějakou dobu aliasovány, než budou zcela odstraněny. </div> <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). <div class="mw-translate-fuzzy"> Aby to od verze MediaWiki 1.45 fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> pro všechna příslušná rozšíření, která jste také nainstalovali: </div> {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Release history == </div> * {{ym|2024|11}} – <span lang="en" dir="ltr" class="mw-content-ltr">The CodeMirror 6 version of the extension was introduced as a beta feature.</span> * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] dnzuym1knfqmhiu0xway051aux7w6ql 8364631 8364629 2026-05-03T17:15:26Z Rebulka 17532855 8364631 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === Výchozí preference jsou nastaveny buď na wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}). Pro každou funkci použijte <code>true</code> nebo <code>false</code> k jejímu úplnému povolení nebo zákazu, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) označující, kde by měla být funkce ve výchozím nastavení povolena. Toto nastavení konfigurace platí pouze pro ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]]. Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování na šablony a kód $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! Výchozí hodnota (code)<ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * Zvýrazňování syntaxe na [[Special:Upload]]. ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * Moduly ResourceLoader se změnily. Viz [[#ResourceLoader modules|průvodce migrací]]. * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * <span lang="en" dir="ltr" class="mw-content-ltr">The <code>.cm-mw-doubleUnderscore</code> CSS class has been renamed to <code>.cm-mw-double-underscore</code>.</span> * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} <div lang="en" dir="ltr" class="mw-content-ltr"> This guide applies to MediaWiki 1.45 and later. As of MediaWiki 1.46, [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] is no longer supported. </div> <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== <span lang="en" dir="ltr" class="mw-content-ltr">Ensure you're using the correct [[#Using ResourceLoader|ResourceLoader modules]].</span> Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! <span class="mw-translate-fuzzy">Nový modul (MW 1.45)</span> ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} <div class="mw-translate-fuzzy"> S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou po nějakou dobu aliasovány, než budou zcela odstraněny. </div> <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). <div class="mw-translate-fuzzy"> Aby to od verze MediaWiki 1.45 fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> pro všechna příslušná rozšíření, která jste také nainstalovali: </div> {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Release history == </div> * {{ym|2024|11}} – <span lang="en" dir="ltr" class="mw-content-ltr">The CodeMirror 6 version of the extension was introduced as a beta feature.</span> * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] sfrjrmm6vccydaz5enbubbk8li4ldlm 8364633 8364631 2026-05-03T17:15:46Z Rebulka 17532855 Created page with "CSS třída $1 byla přejmenována na $2." 8364633 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === Výchozí preference jsou nastaveny buď na wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}). Pro každou funkci použijte <code>true</code> nebo <code>false</code> k jejímu úplnému povolení nebo zákazu, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) označující, kde by měla být funkce ve výchozím nastavení povolena. Toto nastavení konfigurace platí pouze pro ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]]. Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování na šablony a kód $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! Výchozí hodnota (code)<ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * Zvýrazňování syntaxe na [[Special:Upload]]. ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * Moduly ResourceLoader se změnily. Viz [[#ResourceLoader modules|průvodce migrací]]. * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * CSS třída <code>.cm-mw-doubleUnderscore</code> byla přejmenována na <code>.cm-mw-double-underscore</code>. * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} <div lang="en" dir="ltr" class="mw-content-ltr"> This guide applies to MediaWiki 1.45 and later. As of MediaWiki 1.46, [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] is no longer supported. </div> <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== <span lang="en" dir="ltr" class="mw-content-ltr">Ensure you're using the correct [[#Using ResourceLoader|ResourceLoader modules]].</span> Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! <span class="mw-translate-fuzzy">Nový modul (MW 1.45)</span> ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} <div class="mw-translate-fuzzy"> S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou po nějakou dobu aliasovány, než budou zcela odstraněny. </div> <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). <div class="mw-translate-fuzzy"> Aby to od verze MediaWiki 1.45 fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> pro všechna příslušná rozšíření, která jste také nainstalovali: </div> {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Release history == </div> * {{ym|2024|11}} – <span lang="en" dir="ltr" class="mw-content-ltr">The CodeMirror 6 version of the extension was introduced as a beta feature.</span> * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] n152fr7s7ebu7tfeoq7jujw0hmycd3u 8364635 8364633 2026-05-03T17:16:04Z Rebulka 17532855 Created page with "Tato příručka platí pro MediaWiki 1.45 a novější. Od MediaWiki 1.46 již [[$1|CodeMirror 5]] není podporováno." 8364635 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === Výchozí preference jsou nastaveny buď na wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}). Pro každou funkci použijte <code>true</code> nebo <code>false</code> k jejímu úplnému povolení nebo zákazu, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) označující, kde by měla být funkce ve výchozím nastavení povolena. Toto nastavení konfigurace platí pouze pro ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]]. Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování na šablony a kód $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! Výchozí hodnota (code)<ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * Zvýrazňování syntaxe na [[Special:Upload]]. ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * Moduly ResourceLoader se změnily. Viz [[#ResourceLoader modules|průvodce migrací]]. * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * CSS třída <code>.cm-mw-doubleUnderscore</code> byla přejmenována na <code>.cm-mw-double-underscore</code>. * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} Tato příručka platí pro MediaWiki 1.45 a novější. Od MediaWiki 1.46 již [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] není podporováno. <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== <span lang="en" dir="ltr" class="mw-content-ltr">Ensure you're using the correct [[#Using ResourceLoader|ResourceLoader modules]].</span> Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! <span class="mw-translate-fuzzy">Nový modul (MW 1.45)</span> ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} <div class="mw-translate-fuzzy"> S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou po nějakou dobu aliasovány, než budou zcela odstraněny. </div> <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). <div class="mw-translate-fuzzy"> Aby to od verze MediaWiki 1.45 fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> pro všechna příslušná rozšíření, která jste také nainstalovali: </div> {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Release history == </div> * {{ym|2024|11}} – <span lang="en" dir="ltr" class="mw-content-ltr">The CodeMirror 6 version of the extension was introduced as a beta feature.</span> * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] 3taxyl02c5azdxfsh20d20qzn9nfel0 8364637 8364635 2026-05-03T17:16:21Z Rebulka 17532855 Created page with "Ujistěte se, že používáte správné moduly [[$1|ResourceLoader]]." 8364637 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === Výchozí preference jsou nastaveny buď na wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}). Pro každou funkci použijte <code>true</code> nebo <code>false</code> k jejímu úplnému povolení nebo zákazu, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) označující, kde by měla být funkce ve výchozím nastavení povolena. Toto nastavení konfigurace platí pouze pro ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]]. Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování na šablony a kód $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! Výchozí hodnota (code)<ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * Zvýrazňování syntaxe na [[Special:Upload]]. ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * Moduly ResourceLoader se změnily. Viz [[#ResourceLoader modules|průvodce migrací]]. * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * CSS třída <code>.cm-mw-doubleUnderscore</code> byla přejmenována na <code>.cm-mw-double-underscore</code>. * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} Tato příručka platí pro MediaWiki 1.45 a novější. Od MediaWiki 1.46 již [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] není podporováno. <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== Ujistěte se, že používáte správné moduly [[#Using ResourceLoader|ResourceLoader]]. Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! <span class="mw-translate-fuzzy">Nový modul (MW 1.45)</span> ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} <div class="mw-translate-fuzzy"> S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou po nějakou dobu aliasovány, než budou zcela odstraněny. </div> <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). <div class="mw-translate-fuzzy"> Aby to od verze MediaWiki 1.45 fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> pro všechna příslušná rozšíření, která jste také nainstalovali: </div> {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Release history == </div> * {{ym|2024|11}} – <span lang="en" dir="ltr" class="mw-content-ltr">The CodeMirror 6 version of the extension was introduced as a beta feature.</span> * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] kqup4skokjshwssqs6w7gt31saytxzt 8364639 8364637 2026-05-03T17:16:30Z Rebulka 17532855 8364639 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === Výchozí preference jsou nastaveny buď na wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}). Pro každou funkci použijte <code>true</code> nebo <code>false</code> k jejímu úplnému povolení nebo zákazu, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) označující, kde by měla být funkce ve výchozím nastavení povolena. Toto nastavení konfigurace platí pouze pro ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]]. Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování na šablony a kód $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! Výchozí hodnota (code)<ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * Zvýrazňování syntaxe na [[Special:Upload]]. ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * Moduly ResourceLoader se změnily. Viz [[#ResourceLoader modules|průvodce migrací]]. * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * CSS třída <code>.cm-mw-doubleUnderscore</code> byla přejmenována na <code>.cm-mw-double-underscore</code>. * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} Tato příručka platí pro MediaWiki 1.45 a novější. Od MediaWiki 1.46 již [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] není podporováno. <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== Ujistěte se, že používáte správné moduly [[#Using ResourceLoader|ResourceLoader]]. Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! Starý modul (MW 1,45) ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} <div class="mw-translate-fuzzy"> S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou po nějakou dobu aliasovány, než budou zcela odstraněny. </div> <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). <div class="mw-translate-fuzzy"> Aby to od verze MediaWiki 1.45 fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> pro všechna příslušná rozšíření, která jste také nainstalovali: </div> {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Release history == </div> * {{ym|2024|11}} – <span lang="en" dir="ltr" class="mw-content-ltr">The CodeMirror 6 version of the extension was introduced as a beta feature.</span> * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] ahqe7fs3ffxhuuc2vwqmyajrduezz8p 8364641 8364639 2026-05-03T17:16:57Z Rebulka 17532855 8364641 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === Výchozí preference jsou nastaveny buď na wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}). Pro každou funkci použijte <code>true</code> nebo <code>false</code> k jejímu úplnému povolení nebo zákazu, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) označující, kde by měla být funkce ve výchozím nastavení povolena. Toto nastavení konfigurace platí pouze pro ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]]. Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování na šablony a kód $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! Výchozí hodnota (code)<ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * Zvýrazňování syntaxe na [[Special:Upload]]. ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * Moduly ResourceLoader se změnily. Viz [[#ResourceLoader modules|průvodce migrací]]. * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * CSS třída <code>.cm-mw-doubleUnderscore</code> byla přejmenována na <code>.cm-mw-double-underscore</code>. * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} Tato příručka platí pro MediaWiki 1.45 a novější. Od MediaWiki 1.46 již [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] není podporováno. <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== Ujistěte se, že používáte správné moduly [[#Using ResourceLoader|ResourceLoader]]. Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! Starý modul (MW 1,45) ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou zcela odstraněny. <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). <div class="mw-translate-fuzzy"> Aby to od verze MediaWiki 1.45 fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> pro všechna příslušná rozšíření, která jste také nainstalovali: </div> {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Release history == </div> * {{ym|2024|11}} – <span lang="en" dir="ltr" class="mw-content-ltr">The CodeMirror 6 version of the extension was introduced as a beta feature.</span> * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] eyxk6n43yprx8lydzvxeal07sa9evvj 8364643 8364641 2026-05-03T17:17:38Z Rebulka 17532855 8364643 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === Výchozí preference jsou nastaveny buď na wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}). Pro každou funkci použijte <code>true</code> nebo <code>false</code> k jejímu úplnému povolení nebo zákazu, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) označující, kde by měla být funkce ve výchozím nastavení povolena. Toto nastavení konfigurace platí pouze pro ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]]. Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování na šablony a kód $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! Výchozí hodnota (code)<ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * Zvýrazňování syntaxe na [[Special:Upload]]. ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * Moduly ResourceLoader se změnily. Viz [[#ResourceLoader modules|průvodce migrací]]. * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * CSS třída <code>.cm-mw-doubleUnderscore</code> byla přejmenována na <code>.cm-mw-double-underscore</code>. * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} Tato příručka platí pro MediaWiki 1.45 a novější. Od MediaWiki 1.46 již [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] není podporováno. <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== Ujistěte se, že používáte správné moduly [[#Using ResourceLoader|ResourceLoader]]. Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! Starý modul (MW 1,45) ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou zcela odstraněny. <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). Aby to od verze MediaWiki 1.45+ fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> za všechna příslušná rozšíření, která jste také nainstalovali: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <div lang="en" dir="ltr" class="mw-content-ltr"> == Release history == </div> * {{ym|2024|11}} – <span lang="en" dir="ltr" class="mw-content-ltr">The CodeMirror 6 version of the extension was introduced as a beta feature.</span> * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] p7aa55ogkqtslvccrgz3a5hn8zbb1ve 8364645 8364643 2026-05-03T17:17:59Z Rebulka 17532855 Created page with "== Historie vydání ==" 8364645 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === Výchozí preference jsou nastaveny buď na wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}). Pro každou funkci použijte <code>true</code> nebo <code>false</code> k jejímu úplnému povolení nebo zákazu, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) označující, kde by měla být funkce ve výchozím nastavení povolena. Toto nastavení konfigurace platí pouze pro ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]]. Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování na šablony a kód $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! Výchozí hodnota (code)<ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * Zvýrazňování syntaxe na [[Special:Upload]]. ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * Moduly ResourceLoader se změnily. Viz [[#ResourceLoader modules|průvodce migrací]]. * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * CSS třída <code>.cm-mw-doubleUnderscore</code> byla přejmenována na <code>.cm-mw-double-underscore</code>. * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} Tato příručka platí pro MediaWiki 1.45 a novější. Od MediaWiki 1.46 již [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] není podporováno. <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== Ujistěte se, že používáte správné moduly [[#Using ResourceLoader|ResourceLoader]]. Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! Starý modul (MW 1,45) ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou zcela odstraněny. <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). Aby to od verze MediaWiki 1.45+ fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> za všechna příslušná rozšíření, která jste také nainstalovali: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <span id="Release_history"></span> == Historie vydání == * {{ym|2024|11}} – <span lang="en" dir="ltr" class="mw-content-ltr">The CodeMirror 6 version of the extension was introduced as a beta feature.</span> * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] jap725ut0ax5su98662wpoovrz5b934 8364647 8364645 2026-05-03T17:18:16Z Rebulka 17532855 Created page with "Verze rozšíření CodeMirror 6 byla představena jako beta funkce." 8364647 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === Výchozí preference jsou nastaveny buď na wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}). Pro každou funkci použijte <code>true</code> nebo <code>false</code> k jejímu úplnému povolení nebo zákazu, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) označující, kde by měla být funkce ve výchozím nastavení povolena. Toto nastavení konfigurace platí pouze pro ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]]. Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování na šablony a kód $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! Výchozí hodnota (code)<ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * Zvýrazňování syntaxe na [[Special:Upload]]. ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * Moduly ResourceLoader se změnily. Viz [[#ResourceLoader modules|průvodce migrací]]. * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * CSS třída <code>.cm-mw-doubleUnderscore</code> byla přejmenována na <code>.cm-mw-double-underscore</code>. * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} Tato příručka platí pro MediaWiki 1.45 a novější. Od MediaWiki 1.46 již [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] není podporováno. <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== Ujistěte se, že používáte správné moduly [[#Using ResourceLoader|ResourceLoader]]. Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! Starý modul (MW 1,45) ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou zcela odstraněny. <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). Aby to od verze MediaWiki 1.45+ fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> za všechna příslušná rozšíření, která jste také nainstalovali: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <span id="Release_history"></span> == Historie vydání == * {{ym|2024|11}} – Verze rozšíření CodeMirror 6 byla představena jako beta funkce. * {{ymd|2026|4|21}} – <span lang="en" dir="ltr" class="mw-content-ltr">After two years of development and testing, "Improved Syntax Highlighting" (CodeMirror 6) was officially promoted out of beta. This update brought advanced features like code folding, autocompletion, and linting to all users of the standard syntax highlighter, while significantly improving wikitext readability.</span><ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] e4l39h6lf4290rlqysra0nfu2z73v1k 8364649 8364647 2026-05-03T17:18:49Z Rebulka 17532855 Created page with "Po dvou letech vývoje a testování byla oficiálně povýšena verze "Vylepšené zvýrazňování syntaxe" (CodeMirror 6) z beta verze. Tato aktualizace přinesla všem uživatelům standardního zvýrazňovače syntaxe pokročilé funkce, jako je skládání kódu, automatické doplňování a linting, a zároveň výrazně zlepšila čitelnost wikitextu." 8364649 wikitext text/x-wiki <languages/> :''Nesmí se zaměňovat s {{Ll|Extension:CodeEditor|CodeEditor}}.'' {{Extension |name=CodeMirror |status=stable |image=CodeMirror snapshot 6.0.0 28 Apr 2025.png{{!}}class=skin-invert |imagesize=350 |type1=interface |type2= |description=Poskytuje zvýrazňování syntaxe v editorech |author= * [[User:pastakhov|Pavel Astakhov]] * [[User:MusikAnimal|MusikAnimal]] * {{gerrit-reviewer|Bhsd}} |maintainer=[[meta:Community Tech|Community Tech]] |compatibility policy=rel |php=8.2+ |composer= |phabricator=MediaWiki-extensions-CodeMirror |download={{WikimediaDownload|phab=ECMI}} |readme=[https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CodeMirror/+/refs/heads/master/README.md README] |changelog= }} Rozšíření '''CodeMirror''' poskytuje samostatný editor se zvýrazňováním syntaxe pro řadu programovacích a značkovacích jazyků, včetně [[Special:MyLanguage/Wikitext|wikitextu]], s využitím [https://codemirror.net knihovny CodeMirror]. Lze jej použít s dalšími [[Special:MyLanguage/Editors|editory]], jako například {{ll|Extension:WikiEditor|nsp=0}}, {{ll|2017 wikitext editor}}, {{ll|Extension:Proofread Page|nsp=0}} a dalšími. Použití a seznam funkcí naleznete v části {{ll|Help:Extension:CodeMirror}}. V letech 2024–2025 bylo rozšíření upgradováno na novou hlavní verzi '''CodeMirror 6''' a s ní bylo přidáno mnoho nových {{ll|Help:Extension:CodeMirror#Features|funkcí}}. * Informace o starší verzi naleznete v článku {{ll|Extension:CodeMirror/5}}. * Podrobnou dokumentaci naleznete na stránce {{ll|Help:Extension:CodeMirror}}. * Dokumentaci JavaScriptu najdete na [[wmdoc:CodeMirror]]. <span id="Installation"></span> == Instalace == {{ExtensionInstall |custom-steps=* [[#Configuration|Vyžaduje nastavení v konfiguračním souboru.]] |registration=required }} <span id="Configuration"></span> == Konfigurace == {{hatnote|1=Pro přizpůsobení barev a různých funkcí CodeMirror se podívejte na stránku {{ll|Help:Extension:CodeMirror}}.}} Chcete-li CodeMirror ve výchozím nastavení povolit pro všechny uživatele, přidejte do souboru {{ll|Manual:LocalSettings.php|LocalSettings.php}} následující: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. $wgDefaultUserOptions[ 'usecodemirror' ] = true; </syntaxhighlight> Pokud se pro úpravu kódu používá [[#Using CodeMirror instead of CodeEditor|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba <code>usecodemirror-code</code>, která je ve výchozím nastavení nastavena na {{phpi|true}}. ;{{phpi|$wgCodeMirrorEnabledModes}}:Dočasný příznak funkce pro řízení konfliktů s {{ll|Extension:CodeEditor}}. Více informací naleznete v sekci [[#Using CodeMirror instead of CodeEditor|Použití CodeMirroru místo CodeEditoru]] níže. ;{{phpi|$wgCodeMirrorConflictingGadgets}}:Pole názvů gadgetů, které, pokud jsou povoleny, zabrání načtení CodeMirror. Výchozí hodnota je [[w:User:Cacycle/wikEd|wikEd]]. ;{{phpi|$wgCodeMirrorPrimaryPreferences}}:{{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby}}, které se mají zobrazovat v panelu předvoleb v editoru. Měly by mít jasný vizuální efekt nebo být běžně používané pro snazší přístup k přepínání funkce. Předvolby, které zde ''nejsou'' uvedeny, budou i nadále dostupné v dialogovém okně s kompletními předvolbami. ;{{phpi|$wgCodeMirrorDefaultPreferences}}:Určuje, které {{ll|Help:Extension:CodeMirror#Features|funkce}} jsou ve výchozím nastavení povoleny pro všechny uživatele. Více informací naleznete [[#Default_preferences|níže]]. ;{{phpi|$wgCodeMirrorDefaultPreferencesCode}}:Stejné jako $wgCodeMirrorDefaultPreferences, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "mediawiki" (wikitext). <span id="Default_preferences"></span> === Výchozí předvolby === Výchozí preference jsou nastaveny buď na wikitext ({{phpi|$wgCodeMirrorDefaultPreferences}}), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ({{phpi|$wgCodeMirrorDefaultPreferencesCode}}). Pro každou funkci použijte <code>true</code> nebo <code>false</code> k jejímu úplnému povolení nebo zákazu, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) označující, kde by měla být funkce ve výchozím nastavení povolena. Toto nastavení konfigurace platí pouze pro ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[Special:MyLanguage/Help:Extension:CodeMirror#CodeMirror preferences|předvolbách CodeMirror]]. Změna preference se vztahuje pouze na wikitext (režim <code>mediawiki</code>) nebo na newikitext (všechny ostatní režimy). Například: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> # Omezit zvýrazňování mezer na text mimo wikitext $wgCodeMirrorDefaultPreferences[ 'whitespace' ] = false; $wgCodeMirrorDefaultPreferencesCode[ 'whitespace' ] = true; # Omezení automatického doplňování na šablony a kód $wgCodeMirrorDefaultPreferences[ 'autocomplete' ] = [ NS_TEMPLATE ]; $wgCodeMirrorDefaultPreferencesCode[ 'autocomplete' ] = true; </syntaxhighlight> {| class="wikitable" |+ {{phpi|$wgCodeMirrorDefaultPreferences}} |- ! Funkce !! {{ll|2017 wikitext editor|editor 2017}}<br/>kompatibilita !! Výchozí hodnota !! Výchozí hodnota (code)<ref>{{phpi|$wgCodeMirrorDefaultPreferencesCode}}</ref> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight the active line|activeLine}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Autocompletion|autocomplete}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>autofocus</code> || {{tick}}<ref>V editoru z roku 2017 je důraz vždy kladen na editor.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>bidiIsolation</code><ref>Tato funkce zatím není stabilní.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Bracket matching|bracketMatching}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>closeBrackets</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|true}}</code> |- | <code>closeTags</code><ref>Má to vliv pouze ve wikitextu.</ref> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Code folding|codeFolding}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|foldAllRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{cross}} || <code>{{phpi|false}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Highlight references|highlightRefs}}</code><ref>Platí pouze pro wikitext.</ref> || {{tick}} || <code>{{phpi|true}}</code> || {{n/a}} |- | <code>{{ll|Help:Extension:CodeMirror#Line numbering|lineNumbering}}</code> || {{tick}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Line wrapping|lineWrapping}}</code> || {{tick}}<ref>Zalamování řádků nelze v editoru 2017 zakázat.</ref> || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Linting|lint}}</code> || {{cross}} || <code>{{Phpi|false}}</code> || <code>{{Phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Opening links in wikitext|openLinks}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight special characters|specialChars}}</code> || {{cross}} || <code>{{phpi|true}}</code> || <code>{{phpi|true}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|trailingWhitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |- | <code>{{ll|Help:Extension:CodeMirror#Highlight whitespace|whitespace}}</code> || {{cross}} || <code>{{phpi|false}}</code> || <code>{{phpi|false}}</code> |} <span id="Differences_from_CodeMirror_5"></span> == Rozdíly oproti CodeMirror 5 == <span id="New_features"></span> === Nové možnosti === * Již není nutné použít {{ll|Extension:WikiEditor|nsp=0}}. * Podpora pro Scribunto, JavaScript, CSS, JSON a Vue jako [[#Using CodeMirror instead of CodeEditor|alternativa]] k {{ll|Extension:CodeEditor|nsp=0}}. * Významné zlepšení výkonu. * Podpora zprava doleva ({{Task|T170001}}) s izolací [[w:Bidirectional_text|bidi]]. ({{task|T358804}}) * {{ll|Help:Extension:CodeMirror#Code folding|Skládání kódu}}. ({{task|T30684}}) * {{ll|Help:Extension:CodeMirror#Autocompletion|Automatické doplňování}}. ({{task|T95100}}) * {{ll|Help:Extension:CodeMirror#Linting|Linting}}. ({{task|T381577}}) * {{ll|Help:Extension:CodeMirror#Opening links in wikitext|Rychlé otevření odkazů pomocí modifikační klávesy + kliknutí}}. ({{task|T303392}}) * Vylepšený vyhledávací panel. ({{Task|T371436}}) * {{ll|Help:Extension:CodeMirror#CodeMirror preferences|Předvolby CodeMirroru}}. ({{Task|T359498}}) * Zvýrazňování syntaxe v {{ll|Help:DiscussionTools|nsp=0}}. ({{task|T407918}}) * Zvýrazňování syntaxe na stránkách pouze pro čtení. ({{task|T301615}}) * Zvýrazňování syntaxe na [[Special:Upload]]. ({{task|T170246}}) * Zvýrazňování syntaxe na [[Special:ExpandTemplates]]. ({{task|T384148}}) * Zvýrazňování syntaxe na [[Special:AbuseFilter]]. ({{task|T399673}}) * Zvýrazňování syntaxe na <code>Special:SecurePoll/translate</code> ({{task|T397871}}) * Robustní [[wmdoc:CodeMirror|JavaScript API]] pro integraci s rozšířeními, gadgety a uživatelskými skripty. <span id="Deprecations_and_other_changes"></span> === Zastaralé verze a další změny === * Moduly ResourceLoader se změnily. Viz [[#ResourceLoader modules|průvodce migrací]]. * Háček <code>ext.CodeMirror.switch</code> byl zastaralý. Použijte místo něj <code>ext.CodeMirror.toggle</code>. * CSS třída <code>.cm-mw-mnemonic</code> byla přejmenována na <code>.cm-mw-html-entity</code>. * CSS třída <code>.cm-mw-doubleUnderscore</code> byla přejmenována na <code>.cm-mw-double-underscore</code>. * Třída <code>.cm-mw-template-name-mnemonic</code> byla odstraněna. Použijte místo ní třídu <code>.cm-mw-template-ground.cm-html-entity</code>. * CSS třídy <code>.cm-mw-apostrophes-bold</code> a <code>.cm-mw-apostrophes-italic</code> byly odstraněny. Použijte místo nich <code>.cm-mw-apostrophes</code>. * Stylování na úrovni řádku pro <code>&lt;nowiki&gt;</code>, <code><nowiki><pre></nowiki></code> nebo jakoukoli značku bez přidružené značky [[#MediaWiki Extensions|TagMode]] bylo odstraněno ({{Task|T351686}}). * Smíšené jazyky ve wikitextu zatím nejsou podporovány ({{task|T357480}}). * Nativní vyhledávací funkce prohlížeče (používá {{Key press|Ctrl|F}}) byla nahrazena vyhledávací funkcí integrovanou do CodeMirror. To je nezbytné pro udržení výkonu ({{Task|T303664}}). <span id="Migration_guide"></span> === Průvodce migrací === {{MW 1.45|and later}} Tato příručka platí pro MediaWiki 1.45 a novější. Od MediaWiki 1.46 již [[Special:MyLanguage/Extension:CodeMirror/5|CodeMirror 5]] není podporováno. <span id="MediaWiki_configuration"></span> ==== Konfigurace MediaWiki ==== * <code>$wgCodeMirrorLineNumberingNamespaces</code> je zastaralé. Místo toho je použita [[#Configuration|konfigurace]] <code>$wgCodeMirrorDefaultPreferences</code>. <span id="ResourceLoader_modules"></span> ==== Moduly ResourceLoader ==== Ujistěte se, že používáte správné moduly [[#Using ResourceLoader|ResourceLoader]]. Protože CodeMirror 6 již nespoléhá na WikiEditor, došlo k několika změnám v názvech a chování oproti protějškům CodeMirror 5: <small> Některé názvy modulů jsou pro stručnost zobrazeny bez předpony <code>ext.CodeMirror</code>. Při použití nahraďte předponu '…'. </small> {| class="wikitable" |- ! Starý modul ! Starý modul (MW 1,45) ! Nový modul (MW 1.46+) ! Popis |- | <code>ext.CodeMirror</code> |<code>….v6.init</code> | <code>….init</code> | Integrace CodeMirror pro WikiEditor na <code>#wpTextbox1</code> (normální textové pole pro úpravy). |- | ''N/A'' |<code>….v6.WikiEditor</code> | <code>….WikiEditor</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor] |- |''N/A'' |<code>….v6.init</code> |<code>….init</code> | CodeMirror pro <code>#wpTextbox1</code> a další podporované stránky. |- | <code>….lib</code> |<code>….v6.lib</code> | <code>….lib</code> | Exportuje interní prvky [https://codemirror.net/ CodeMirror]. |- | <code>….addons</code> |''N/A'' | ''N/A'' | Toto zabalilo funkci porovnávání závorek v CodeMirror 5. Porovnávání závorek je výchozím chováním v CodeMirror 6. |- | <code>….mode.mediawiki</code> |<code>….v6.mode.mediawiki</code> | <code>….mode.mediawiki</code> | Jazykový režim MediaWiki. |- | ''N/A'' |<code>ext.CodeMirror.v6</code> | <code>ext.CodeMirror</code> | Exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>….visualEditor</code> |<code>….visualEditor.init</code> |<code>….visualEditor.init</code> | Integrace s {{Ll|2017 wikitext editor}}. |- |<code>….lib.mode.php</code> | |rowspan="4"|''N/A'' |rowspan="4"| CodeMirror 6 nakonec některé nebo všechny tyto režimy poskytne, ale nebudou k dispozici jako samostatné moduly. |- |<code>….lib.mode.clike</code> | |- |<code>….lib.mode.htmlmixed</code> | |- |<code>….lib.mode.xml</code> | |- |<code>….lib.mode.javascript</code> |rowspan="5"|<code>….v6.modes</code> |rowspan="5"|<code>….modes</code> |rowspan="5"| Tyto jazyky jsou podporovány v CodeMirror 6. |- |<code>….lib.mode.css</code> |- |''N/A'' |- |''N/A'' |- |''N/A'' |} S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly <code>.v6</code> budou zcela odstraněny. <span id="Gadgets_and_user_scripts"></span> ==== Gadgety a uživatelské skripty ==== Globální limit <code>CodeMirror</code> byl zcela odstraněn. Například <code>CodeMirror.fromTextArea( myTextarea )</code> už nebudou fungovat. Místo toho nejprve načtěte požadované moduly [[#Using ResourceLoader|ResourceLoader]], vytvořte instanci objektu CodeMirror a zavolejte metodu <code>[https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html#initialize initialize()]</code>. Pokud váš skript používá háček <code>ext.CodeMirror.switch</code> pro změnu způsobu interakce s editorem, budete muset místo toho použít háček <code>ext.CodeMirror.toggle</code> nebo alternativně naslouchat [[#Using events|události]]. Více informací naleznete v části [[#JavaScript|Integrace JavaScriptu]]. ==== CSS ==== Prvek <code>.CodeMirror</code> již neexistuje. Pro celý DOM CodeMirror použijte místo něj <code>.cm-editor</code> nebo pro vnitřní obsah <code>.cm-content</code> (například nezahrnuje vyhledávací panel). Viz [[#Deprecations and other changes|zastaralé verze a další změny]] u jiných CSS tříd. <span id="Integration"></span> == Integrace == <span id="MediaWiki_Extensions"></span> === Rozšíření MediaWiki === <span id="Using_CodeMirror_instead_of_CodeEditor"></span> ==== Používání CodeMirror místo CodeEditoru ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 podporuje CodeMirror zvýrazňování jazyků Lua, JavaScript, CSS, JSON a Vue. Lze jej použít jako alternativu k {{ll|Extension:CodeEditor}}. Upozorňujeme však, že ne všechna rozšíření, která se integrují s CodeEditorem, byla aktualizována pro podporu CodeMirror. Pokud používáte některé z těchto rozšíření, můžete si ponechat CodeEditor nainstalovaný na vaší wiki: * {{ll|Extension:VisualEditor}} – používá moduly CodeEditoru k zvýrazňování syntaxe pro další rozšíření integrující se s VisualEditorem ({{task|T400014}}): ** {{ll|Extension:Kartographer}} ** {{ll|Extension:Math}} ** {{ll|Extension:Score}} ** {{ll|Extension:SyntaxHighlight}} ** {{ll|Extension:TabberNeue}} * {{ll|Extension:WikiLambda}} – modul <code>ext.wikilambda.app</code> se spoléhá na CodeEditor ({{task|T400015}}). Aby to od verze MediaWiki 1.45+ fungovalo, budete muset odpovídajícím způsobem upravit <code>$wgCodeMirrorEnabledModes</code> a také <code>*UseCodeEditor</code> a <code>*UseCodeMirror</code> za všechna příslušná rozšíření, která jste také nainstalovali: {{Codesample-header|{{ll|Manual:LocalSettings.php|LocalSettings.php}}}} <syntaxhighlight copy lang="php"> // Požadované režimy, které by měly používat CodeMirror (mediawiki, tj. wikitext, je ve výchozím nastavení povolen) $wgCodeMirrorEnabledModes['javascript'] = true; $wgCodeMirrorEnabledModes['json'] = true; $wgCodeMirrorEnabledModes['css'] = true; $wgCodeMirrorEnabledModes['lua'] = true; $wgCodeMirrorEnabledModes['vue'] = true; // Pokud používáte také CodeEditor, deaktivujte tam stejné režimy: $wgCodeEditorEnabledModes['javascript'] = false; $wgCodeEditorEnabledModes['json'] = false; $wgCodeEditorEnabledModes['css'] = false; $wgCodeEditorEnabledModes['lua'] = false; $wgCodeEditorEnabledModes['vue'] = false; // AbuseFilter (všimněte si, že výše není nutné nastavit odpovídající "mód") $wgAbuseFilterUseCodeEditor = false; $wgAbuseFilterUseCodeMirror = true; // Gadgety (pro úpravu stránek JSON s definicemi gadgetů) $wgGadgetsDefinitionsUseCodeEditor = false; $wgGadgetsDefinitionsUseCodeMirror = true; // JsonConfig $wgJsonConfigUseCodeEditor = false; $wgJsonConfigUseCodeMirror = true; // Scribunto (pro úpravu stránek modulů, které používají režim "lua") $wgScribuntoUseCodeEditor = false; $wgScribuntoUseCodeMirror = true; // TemplateStyles $wgTemplateStylesUseCodeEditor = false; $wgTemplateStylesUseCodeMirror = true; // UploadWizard (pro úpravu stránek kampaně JSON) $wgUploadWizardUseCodeEditor = false; $wgUploadWizardUseCodeMirror = true; </syntaxhighlight> <span id="Registering_a_new_tag_for_MediaWiki"></span> ==== Registrace nového tagu pro MediaWiki ==== Pokud chcete, aby CodeMirror jednoduše rozpoznal {{ll|Manual:Tag extensions|tag}} přidaný rozšířením, můžete tak učinit pomocí atributu {{ll|Manual:Extension registration#Attributes|rozšíření}} pro atribut <code>CodeMirrorTagModes</code>. Například chcete-li zaregistrovat tag {{tag|foo|open}} jako něco obsahujícího wikitext, přidejte k tagu extension.json následující: <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "TagModes": [ "foo": "mediawiki" ] } } } </syntaxhighlight> CodeMirror poté zvýrazní obsah uvnitř {{tag|foo}} jako wikitext. Registrace tagu tak, aby CodeMirror s obsahem zacházel jako s něčím jiným než wikitextem, momentálně není podporována ({{task|T357480}}). Pokud tag není zaregistrován, CodeMirror zvýrazní obsah jako newikitext stejným způsobem, jako zvýrazní obsah tagu {{tag|nowiki}}. <span id="PHP_hook"></span> ==== Háček PHP ==== {{MW 1.44|and later}} Od verze MediaWiki 1.44 je preferovaným způsobem integrace s CodeMirror v PHP implementace rozhraní <code>CodeMirrorGetModeHook</code>: <syntaxhighlight lang="php"> class CodeMirrorHooks implements CodeMirrorGetModeHook { public function onCodeMirrorGetMode(Title $title, ?string &$mode, string $model ): bool { // Logika pro určení, zda by se měl použít CodeMirror if ( $title->hasContentModel( 'JsonLikeContentModel' ) ) { $mode = 'json'; return false; } return true; } } </syntaxhighlight> Zaregistrujte háček v extension.json: <syntaxhighlight lang="json"> "Hooks": { "CodeMirrorGetMode": "codemirror" }, "HookHandlers": { "codemirror": { "class": "MediaWiki\\Extension\\MyExtension\\CodeMirrorHooks" } } </syntaxhighlight> ==== PluginModules ==== <code>CodeMirrorPluginModules</code> je {{ll|Manual:Extension registration#Attributes|rozšiřující atribut}}, který umožňuje načítání modulu z CodeMirror. Toto bezpodmínečně načte modul vždy, když je načten modul <code>ext.CodeMirror</code>. ''extension.json'': <syntaxhighlight copy lang="json"> { "attributes": { "CodeMirror": { "PluginModules": [ "ext.MyExtension.CodeMirror" ] } } } </syntaxhighlight> === JavaScript === Editor CodeMirror není skutečná [[devmo:Web/HTML/Element/textarea|textarea]], ale [[devmo:Web/HTML/Global_attributes/contenteditable|contenteditable]]. Vývojáři obvykle potřebují zajistit, aby jejich kód fungoval s oběma, vzhledem k tomu, že CodeMirror lze [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#toggle|přepínat]] vypnuto. Pro detekci změn v dokumentu je pravděpodobně nejjednodušší [[#Using events|pomocí události]] nebo [[#Using hooks|háčku]]. Pro čtení a provádění změn může být vhodný [[#Using jQuery.textSelection|jQuery.textSelection]]. Pro složitější integrace nebo pro ty, kteří potřebují lepší výkon, můžete [[#Extending CodeMirror|přidat vlastní rozšíření]] k nové nebo existující instanci CodeMirror. <span id="Using_jQuery.textSelection"></span> ==== Použití jQuery.textSelection ==== Pokud chcete jednoduše načíst nebo změnit text dokumentu, je [[wmdoc:mediawiki-core/master/js/module-jquery.textSelection.html|jQuery.textSelection]] nejjednodušší a nejspolehlivější způsob, jak to udělat. Použití hodnoty jQuery.textSelection v textovém poli je předáváno CodeMirror, takže nemusíte vědět, zda je CodeMirror povolen: <syntaxhighlight copy lang="js"> const $textarea = $( '#wpTextbox1' ) const content = $textarea.textSelection( 'getContents' ); // Append "Foobar" to the content. $textarea.textSelection( 'setContents', content + '\nFoobar' ); </syntaxhighlight> Funkce [https://api.jquery.com/val/ .val()] z jQuery na #wpTextbox1 se dá použít,<ref>[[phab:T384556]]</ref> ale toto se nedoporučuje a nemusí fungovat ve všech editorech, jako je například {{ll|2017 wikitext editor}}. <span id="Using_ResourceLoader"></span> ==== Použití ResourceLoaderu ==== Rozšíření CodeMirror nabízí řadu modulů o velikosti {{ll|ResourceLoader}} pro použití uživatelskými skripty, gadgety a rozšířeními. Pro použití CodeMirror budete potřebovat minimálně modul <code>ext.CodeMirror</code> a požadovaný "režim". Režimy lze rozbalit z modulů ResourceLoader pomocí exportované metody se stejným názvem jako režim. Pro wikitext MediaWiki byste použili hodnotu <code>ext.CodeMirror.mode.mediawiki</code> a pro JavaScript, JSON, CSS, Vue a Lua byste použili hodnotu <code>ext.CodeMirror.modes</code>: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize(); </syntaxhighlight> Pokud chcete také WikiEditor: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.wikiEditor', 'ext.CodeMirror.WikiEditor', 'ext.CodeMirror.mode.mediawiki' ] ); const textarea = document.getElementById( 'wpTextbox1' ); mw.addWikiEditor( $( textarea ) ); const CodeMirrorWikiEditor = require( 'ext.CodeMirror.WikiEditor' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); const cmWe = new CodeMirrorWikiEditor( textarea, mediawiki() ); cmWe.mode = 'mediawiki'; cmWe.initialize(); </syntaxhighlight> Vytvoření nové instance JavaScriptu: <syntaxhighlight copy lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.modes' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { javascript } = require( 'ext.CodeMirror.modes' ); const cm = new CodeMirror( myTextarea, javascript() ); cm.initialize(); </syntaxhighlight> {| class="wikitable" |+Moduly ResourceLoader ! Modul ! Popis |- |<code>ext.CodeMirror.lib</code> | Základní knihovna CodeMirror. Neměli byste ji vyžadovat přímo, pokud nepotřebujete přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. |- |<code>ext.CodeMirror</code> | Základní integrace CodeMirror pro editory MediaWiki. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirror.html CodeMirror]. |- |<code>ext.CodeMirror.WikiEditor</code> | Integrace CodeMirror pro WikiEditor. Tento modul exportuje třídu [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorWikiEditor.html CodeMirrorWikiEditor]. |- |<code>ext.CodeMirror.mode.mediawiki</code> | Exportuje režim <code>mediawiki</code> pro zvýraznění wikitextu MediaWiki. |- |<code>ext.CodeMirror.modes</code> | Zahrnuje režimy <code>javascript</code>, <code>json</code>, <code>css</code>, <code>vue</code> a <code>lua</code>. |- |<code>ext.CodeMirror.init</code><br/>''(vnitřní)'' | Hlavní vstupní bod pro požadavky v hodnotě action=edit. Není určeno pro externí použití. |- |<code>ext.CodeMirror.visualEditor.init</code><br/>''(vnitřní)'' | Integrace CodeMirror s {{ll|2017 wikitext editor}} a pouze pro wikitext. |} <span id="Using_hooks"></span> ==== Používání háčků ==== S CodeMirror se můžete také integrovat pomocí [[wmdoc:mediawiki-core/master/js/Hooks.html|frontend háčků]]. Ty vám umožňují spouštět kód těsně před nebo po načtení CodeMirroru nebo reagovat na změny v dokumentu. {| class="wikitable" |+Frontendové háčky ! Háček ! Popis |- |<code>ext.CodeMirror.initialize</code> | Voláno těsně před inicializací CodeMirror. Lze to použít k úpravě DOMu tak, aby vyhovoval CodeMirroru (tj. pokud manipulujete s DOMem WikiEditoru, můžete to potřebovat). '''Parametry''' * (<code>HTMLTextAreaElement</code>) současný "editor", s největší pravděpodobností <code>#wpTextbox1</code>. * (<code>ve.ui.Surface</code>) pokud je to relevantní, je na povrch VisualEditoru navázán CodeMirror. |- |<code>ext.CodeMirror.ready</code> | Voláno ihned po inicializaci CodeMirror. '''Parametry''' * (<code>CodeMirror</code>) instance [[wmdoc:CodeMirror/master/js/js/CodeMirror.html|CodeMirror]]. |- |<code>ext.CodeMirror.toggle</code> | Voláno, když je CodeMirror zapnuto nebo vypnuto. '''Parametry''' * (<code>boolean</code>) zda je CodeMirror nyní povolen. * (<code>CodeMirror</code>) instance CodeMirror. * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.destroy</code> | Voláno ihned po zničení CodeMirror a obnovení původního textarea. '''Parametry''' * (<code>HTMLTextAreaElement</code>) původní textové pole. |- |<code>ext.CodeMirror.input</code> | Voláno, když jsou v CodeMirror provedeny změny dokumentu. Upozorňujeme, že textarea ještě nemusí být aktualizováno. '''Parametry''' * (<code>ViewUpdate</code>) objekt [https://codemirror.net/docs/ref/#view.ViewUpdate ViewUpdate]. |- |<code>ext.CodeMirror.preferences.ready</code> | Vypáleno těsně před vytvořením instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. '''Parametry''' * (<code>CodeMirrorPreferences</code>) instance [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html CodeMirrorPreferences]. |- |<code>ext.CodeMirror.preferences.apply</code> | Spustí se, když je povolena nebo poprvé použita [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html předvolba CodeMirror]. '''Parametry''' * (<code>string</code>) název preference, který je zároveň odpovídajícím klíčem v [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#extensionRegistry extensionRegistry] a [https://doc.wikimedia.org/CodeMirror/master/js/js/CodeMirrorPreferences.html#compartmentRegistry compartmentRegistry]. |- |<code>ext.CodeMirror.preferences.apply</code> | Vyvolá se při změně nebo prvotním použití předvolby CodeMirror v editační relaci. '''Parametry''' * (<code>string</code>) název preference. * (<code>boolean</code>) nová hodnota preference. |- |<code>ext.CodeMirror.preferences.display</code><br/><small>''(vnitřní)''</small> | Spustí se při vytvoření panelu předvoleb, těsně před jeho zobrazením. '''Parametry''' * (<code>HTMLDivElement</code>) kontejner panelu předvoleb. |- |<code>ext.CodeMirror.gotoLine</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření panelu přejděte na řádek. |- |<code>ext.CodeMirror.keymap</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření dialogového okna nápovědy s klávesovými zkratkami. |- |<code>ext.CodeMirror.search</code><br/><small>''(vnitřní)''</small> | Spustí se při otevření nebo zavření vyhledávacího panelu. |- |} <span id="Using_events"></span> ==== Používání událostí ==== Následující [[devmo:Web/API/Event|události]] jsou pro usnadnění vývojářům zobrazeny v bublině v textovém poli [[wmdoc:CodeMirror/master/js/js/CodeMirror.html#textarea|textarea]]: * <code>[[devmo:Web/API/Element/blur_event|blur]]</code> * <code>[[devmo:Web/API/Element/focus_event|focus]]</code> * <code>[[devmo:Web/API/Element/keyup_event|keyup]]</code> * <code>[[devmo:Web/API/Element/keydown_event|keydown]]</code><ref>Tato událost se nespustí pro wikitext ({{task|T401271}})</ref> * <code>[[devmo:Web/API/Element/scroll_event|scroll]]</code> Pomocí těchto událostí se můžete integrovat s CodeMirror a použít stejný kód jako původní textarea: <syntaxhighlight copy lang="javascript"> myTextarea.addEventListener( 'keyup', ( event ) => { console.log( event.key ); } ); </syntaxhighlight> <span id="Extending_CodeMirror"></span> ==== Rozšíření CodeMirror ==== Modul <code>ext.CodeMirror.lib</code> můžete importovat, abyste získali přístup k upstreamu [https://codemirror.net/docs/ref/ CodeMirror API]. S tímto můžete při vytváření instance <code>CodeMirror</code> nebo objektu <code>CodeMirrorWikiEditor</code> zadat vlastní [https://codemirror.net/docs/ref/#state.Extension rozšíření]. Například pro vytvoření vlastního rozšíření, které reaguje na změny provedené v CodeMirror: <syntaxhighlight copy="" lang="javascript"> const require = await mw.loader.using( [ 'ext.CodeMirror', 'ext.CodeMirror.mode.mediawiki' ] ); const CodeMirror = require( 'ext.CodeMirror' ); const { mediawiki } = require( 'ext.CodeMirror.mode.mediawiki' ); // ext.CodeMirror.lib je závislostí ext.CodeMirror, takže je v tomto okamžiku již načten. const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); const cm = new CodeMirror( myTextarea, mediawiki() ); cm.initialize( [ cm.defaultExtensions, myExtension ] ); </syntaxhighlight> Nebo pokud potřebujete interagovat s existující instancí CodeMirror: <syntaxhighlight copy lang="javascript"> // Nejprve se ujistěte, že je CodeMirror inicializován. mw.hook( 'ext.CodeMirror.ready' ).add( ( cm ) => { const { EditorView } = require( 'ext.CodeMirror.lib' ); const myExtension = EditorView.updateListener.of( ( /** @type {ViewUpdate} */ update ) => { if ( update.docChanged ) { // nic nedělá console.log( update.changes ); } } ); cm.applyExtension( myExtension ); } ); </syntaxhighlight> Dalším způsobem, jak naslouchat změnám, je použití <code>ext.CodeMirror.input</code> [[#Using hooks|háčku]]: <syntaxhighlight copy lang="javascript"> mw.hook( 'ext.CodeMirror.input' ).add( ( update ) => { // Vypište ChangeSet do konzole console.log( update.changes.toJSON() ); } ); </syntaxhighlight> <span id="Release_history"></span> == Historie vydání == * {{ym|2024|11}} – Verze rozšíření CodeMirror 6 byla představena jako beta funkce. * {{ymd|2026|4|21}} – Po dvou letech vývoje a testování byla oficiálně povýšena verze "Vylepšené zvýrazňování syntaxe" (CodeMirror 6) z beta verze. Tato aktualizace přinesla všem uživatelům standardního zvýrazňovače syntaxe pokročilé funkce, jako je skládání kódu, automatické doplňování a linting, a zároveň výrazně zlepšila čitelnost wikitextu.<ref>[[diffblog:2026/04/20/tech-news-2026-issue-17/|Tech News 2026 – Issue 17]], Wikimedia Diff. Published April 20, 2026.</ref> <span id="See_also"></span> == Související odkazy == * {{ll|User:Remember the dot/Syntax highlighter}} * {{ll|Extension:VisualEditor}} * {{ll|Extension:WikiEditor}} * {{ll|Extension:CodeEditor}} * [[c:Category:MediaWiki extension CodeMirror]] <span id="Notes"></span> == Poznámky pod čarou == <references/> {{OnWikimedia}} {{Used by}} [[Category:Syntax highlighting extensions{{#translation:}}]] 9ysz74sjqz6dqbo0y15zgwtozy45kkb Parsoid/Feedback 0 2234135 8364343 8364066 2026-05-03T13:02:57Z Inkysponge2007 18367612 /* enwiki:User:Soetermans */ new section 8364343 wikitext text/x-wiki Post your feedback about using [[Parsoid/Parser Unification|Parsoid]] to render articles. [[Parsoid/Parser_Unification/Known_Issues|Learn how to report problems clearly]]. '''Need more attention? [https://phabricator.wikimedia.org/maniphest/task/edit/form/43/?projects=PHID-PROJ-3y2wduoz5xezwveaq426 Report directly in Phabricator].''' {{note|This is for reporting feedback on the integration of the Parsoid parser only. '''For wiki content issues, such as concerns about article content, please report on your local wiki.''' }} [[Parsoid/Parser_Unification/Known_Issues|View known issues]] __NEWSECTIONLINK__ {{Archive box| [[/Archive 1]] [[/Archive 2]]}} == [https://nl.wikipedia.org/w/index.php?title=Wikipedia:Aanmelding_moderatoren&oldid=70702688&useparsoid=1 nlwiki:Wikipedia:Aanmelding moderatoren] == Sometimes, in a numbered list, the number stays on the first line when there are indented lines below it, and sometimes the number is vertically aligned between the different lines. For votes, it is preferable that the number remains on the line that starts with only “#” and not on lines with an indentation “#:”. [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:34, 15 February 2026 (UTC) :i.e. see item 33. under '<nowiki/>'''''Voor moderatorschap ContextCreator'''<nowiki/>'<nowiki/>'' [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:36, 15 February 2026 (UTC) ::I can't see any difference between Parsoid and the legacy Parser on that page, it appears that the number is correctly aligned in both cases. Are you using a different skin by any chance? Does the difference still appear? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:42, 21 April 2026 (UTC) :::I see no difference anymore - it is fixed. Thanks anyway! [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 16:01, 21 April 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Discussion_Wikip%C3%A9dia:Wikiconcours&oldid=233327486&useformat=mobile&useparsoid=1 frwiki:Discussion Wikipédia:Wikiconcours] == Content that is hidden inside the "Learn more about this page" button from MobileFrontend with legacy parser is not inside it with Parsoid. [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 08:32, 22 February 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Laurence_Olivier&oldid=148833592&useparsoid=1 itwiki:Laurence Olivier] == Giant Oscar statue icons (sgranate) [[User:UmbraSolis|UmbraSolis]] ([[User talk:UmbraSolis|talk]]) 20:28, 19 February 2026 (UTC) :This was probably due to https://phabricator.wikimedia.org/T417828, which is now fixed. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:53, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:43, 21 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Bologna_Football_Club_1909&oldid=149496425&useparsoid=1 itwiki:Bologna Football Club 1909] == problem with displaying football shirts [[User:Gio Bike|Gio Bike]] ([[User talk:Gio Bike|talk]]) 17:49, 20 February 2026 (UTC) :Can you be more specific, or is it fixed now? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:55, 27 February 2026 (UTC) ::Now it is OK [[Special:Contributions/&#126;2026-13011-93|&#126;2026-13011-93]] ([[User talk:&#126;2026-13011-93|talk]]) 17:20, 27 February 2026 (UTC) :::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:44, 21 April 2026 (UTC) == [https://vi.wiktionary.org/w/index.php?title=Wiktionary:Th%E1%BB%91ng_k%C3%AA/S%E1%BB%91_m%E1%BB%A5c_t%E1%BB%AB_theo_ng%C3%B4n_ng%E1%BB%AF/T%E1%BA%A5t_c%E1%BA%A3&oldid=2331126&useparsoid=1 viwiktionary:Wiktionary:Thống kê/Số mục từ theo ngôn ngữ/Tất cả] == Phần cuối bảng bị lỗi, không hiện ra số mục từ mà chỉ hiện ra "0" hoặc "-2" mà không rõ lý do, tôi không viết nhầm gì cả. (English: The table got error, just display "0" or "-2", but I don't have any error at write wikitext.) [[User:NHNAnh|NHNAnh]] ([[User talk:NHNAnh|talk]]) 05:57, 21 February 2026 (UTC) :I believe this might be due to "Expensive parser function count: 1080/500" in the debug log: there are too many expensive parser function counts on this page (PAGESINCATEGORY is expensive), and the later functions are not executed. :I would suggest splitting the page into several pages, if possible. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:04, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) == [https://cs.wikipedia.org/w/index.php?title=Celerina/Schlarigna&oldid=25694456&useparsoid=1 cswiki:Celerina/Schlarigna] == V tabulce v sekci obyvatelstvo se u jedné buňky zobrazuje černé pozadí. Pokud dám ale historii stránky a podívám se na aktuální verzi, vykreslí se stránka správně. To samé se opakuje i u jiných podobných stránek se stejně formátovanými tabulkami. [[User:Matijak|Matijak]] ([[User talk:Matijak|talk]]) 17:02, 22 February 2026 (UTC) :I cannot see a black cell in that table. Is this issue fixed? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:09, 27 February 2026 (UTC) ::I can see it in in both the history (latest revision) and on the page itself (live). It's the leftmost 'Počet' cell in the 'Jazyky v Celerině' table. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 10:10, 28 February 2026 (UTC) :::Aha! :::the cell itself is not dark, the text in it is, and only in dark mode. It is also present in the legacy rendering, which seems to hint at a problem with the table markup itself and not a parser issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:11, 2 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) :::::Not a Parsoid issue most likely, but it has not been fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:21, 24 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia:Biographies_of_living_persons&oldid=1340299616&useparsoid=1 enwiki:Wikipedia:Biographies of living persons] == Reporting a visual bug for all pages that suddenly arose as of this morning on Safari Mobile - the Page Actions Overflow div is in a permanently open state but inaccessible to via clicks to either toggle the menu or select any of the tools on the menu. In addition to being unable to interact with it, all of the styling broken and makes the top right section of the page unusable and barely readable. [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 14:34, 27 February 2026 (UTC) :Is this issue still present? Sorry, it has been a while since you reported this, I'm hoping that the issue has been resolved by now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) ::Yes, it appears to have been resolved. Thanks for following up! [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 03:38, 22 April 2026 (UTC) == [https://oc.wikipedia.org/w/index.php?title=Esqu%C3%A8rra_(politica)&oldid=2495338&useparsoid=1 ocwiki:Esquèrra (politica)] == There's an issue with the interlinks, this article should be connected with the other ones about left-wing politics [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 06:39, 28 February 2026 (UTC) :Yes, it was an issue with the interlinks, but those should naturally not be reported as visual issues ('bogue visuler') as the have nothing to do with Parsoid. You can link pages which have no connections by using the 'Apondre los ligams interlengas' (Add interlanguage links) button from the 'Bóstia d'aisinas' (Tools) menu. Unless, of course, Parsoid somehow blocks automatic linking of translations. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:10, 28 February 2026 (UTC) ::I don't know why but it was finally done (thank you so much to the person who did that), but the thing is, i tried what you said before and it kept telling me that i didn't had the permission to link the two articles... [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 19:33, 1 March 2026 (UTC) :::I did that, you are welcome. It appears that you are not autoconfirmed yet on Wikidata, and that this Wikidata entry requires that, which if both true I would expect you to not be able to do this change. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 04:21, 21 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) :::::Sorry? [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:48, 23 April 2026 (UTC) ::::::We're using the <nowiki>{{done}}</nowiki> template to track which issues have been resolved, vs still outstanding. I don't believe there is any additional follow required by the Content Transform team on this report? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 05:00, 24 April 2026 (UTC) :::::::Oh, no, I just didn't know this is a system you are using. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:19, 24 April 2026 (UTC) == [https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/Page_translation_administration&oldid=8240537&useparsoid=1 Help:Extension:Translate/Page translation administration] == The topmost warning in the 'Changing the source text' section does not display the codeblock content. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:47, 28 February 2026 (UTC) :This is a very clever use of the <code><nowiki>{{^(}}</nowiki></code> template to avoid creating an unintended translation marker. I've [https://www.mediawiki.org/w/index.php?title=Help%3AExtension%3ATranslate%2FPage_translation_administration&diff=8349012&oldid=8343860 replaced it with more straight-forward entity-escaping] to be more compatible with Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:54, 21 April 2026 (UTC) ::Also filed this as [[phab:T424066]] [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 16:46, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&oldid=67999951&useparsoid=1 nlwiki:Railterminal Gelderland] == The map in [[:nl:sjabloon:maplink]] doesn't show up in my Chrome browser for Chromebook. It does show in https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&useparsoid=0 and also when I log out. [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:54, 5 March 2026 (UTC) :Btw, the map is visible for a moment, then it disappears [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:56, 5 March 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%91%D7%A8%D7%90%D7%95%D7%9C_%D7%A1%D7%98%D7%90%D7%A8%D7%A1&oldid=42870396&useparsoid=1 hewiki:בראול סטארס] == למה הקישור לתמונה ששמתי לא עובד? בכל מקרה אשמח שמישהו ישים את התמונה העדכנית שמשומשת בדף באנגלית מאחר והלוגו למשחק שונה. מצטער על התקלה. [[User:Jhho48|Jhho48]] ([[User talk:Jhho48|talk]]) 16:43, 9 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Infokastis: Sulamistemperatuur 236,15 K (−37 °C) Miinusmärk peaks olema sidekriipsust pikem, kuid pikema kriipsu sisestamine põhjustab tõrketeate. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:05, 11 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Vabandust, lühike (st vale) kriips oli kuvatud siiski ainult lähteteksti režiimis; salvestatud tekstiga küljendis on kuvatud õige kriips. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:07, 11 March 2026 (UTC) == kowiki:sticky header is broken == [[:en:Template:Sticky header|Template:Sticky header]] is not working properly on kowiki. Please compare [//ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=0] with [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=1].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:34, 16 March 2026 (UTC) :It may have been because of an empty row before the table caption. I [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&diff=41501849&oldid=41501840 edited the page] to remove it. But, looks like another editor has removed the sticky header template call from above the table. If you can put it back, it will work. See my [[:ko:사용자:SSastry_(WMF)/Sandbox|sandbox]] page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 03:22, 17 March 2026 (UTC) == [https://ko.wikipedia.org/w/index.php?title=%ED%8B%80:%EA%B5%AD%EA%B8%B0%EB%82%98%EB%9D%BC&oldid=40992836&useparsoid=1 kowiki:틀:국기나라] == 변수를 덧붙였음에도 {{국기나라|독일|제국}}이 여전히 '독일'로 출력됩니다. [[User:Triican|Triican]] ([[User talk:Triican|talk]]) 05:04, 19 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Angus_T._Jones&oldid=1333447723&useparsoid=1 enwiki:Angus T. Jones] == The infobox photo is squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 17:11, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Ukraine&oldid=1343921679&useparsoid=1 enwiki:Ukraine] == All maps in the infobox are squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 18:36, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Sabia_que&oldid=54991313&useparsoid=1 ptwiki:Wikipédia:Sabia que] == O arquivo de discussão está 'bugando' visualmente. Está no meio de "Curiosidades em destaque" [[User:Heylenny|Heylenny]] ([[User talk:Heylenny|talk]]) 23:27, 19 March 2026 (UTC) :{{done}} Template adjusted on the page. [[User:Fúlvio|Fúlvio]] ([[User talk:Fúlvio|talk]]) 02:59, 22 March 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%AC%E0%A6%BF%E0%A6%AE%E0%A6%B2_%E0%A6%98%E0%A7%8B%E0%A6%B7_(%E0%A6%B6%E0%A6%BF%E0%A6%B6%E0%A7%81%E0%A6%B8%E0%A6%BE%E0%A6%B9%E0%A6%BF%E0%A6%A4%E0%A7%8D%E0%A6%AF%E0%A6%BF%E0%A6%95)&oldid=8851768&useparsoid=1 bnwiki:বিমল ঘোষ (শিশুসাহিত্যিক)] == আলোচনা পাতায় অন্য নিবন্ধের আলোচনা পাতা [[User:Ams riyad|Ams riyad]] ([[User talk:Ams riyad|talk]]) 01:28, 20 March 2026 (UTC) == [https://vi.wikipedia.org/w/index.php?title=Wikipedia:Th%E1%BA%A3o_lu%E1%BA%ADn&oldid=74869958&useparsoid=1 viwiki:Wikipedia:Thảo luận] == TOC is rendered inside the link bar, but it shouldn't be. [[User:NguoiDungKhongDinhDanh|<span class="skin-invert" style="color:black;font-family:Monotype Corsiva;font-size:110%;font-weight:normal;line-height:normal">NguoiDungKhongDinhDanh</span>]] 03:20, 20 March 2026 (UTC) :This was most likely [[phab:T421629|T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] and we believe this issue has been fixed. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:51, 24 April 2026 (UTC) == [[wikt:ru:омфал]] == For more than a day, there have been anomalies in the behavior of tables of contents (ToCs) in Russian Wiktionary. The issues differ based on the selected skin and affect only some pages. If the old Vector theme is used, the automatically generated ToC simply fails to appear on certain pages, despite the page having over three headers and the absence of magic words such as NOTOC. If the new Vector theme is used, the ToC on some pages is misplaced and not positioned where it should be by default. The problem is not present if the old parser is used. Purging the page's cache seems to fix the issue as well. ToC is displayed correctly in the preview-mode too. Some affected pages: * [[wikt:ru:омфал]] * [[wikt:ru:безграмотность]] * [[wikt:ru:હંમેશા]] * [[wikt:ru:ಯಾವಾಗಲೂ]] * [[wikt:ru:stadigvæk]] * [[wikt:ru:alligevel]] * [[wikt:ru:kanunay]] * [[wikt:ru:ሁሌ]] * [[wikt:ru:zawżdy]] * and maaany mooore... [[User:綿貫桜哉|綿貫桜哉]] ([[User talk:綿貫桜哉|talk]]) 08:11, 20 March 2026 (UTC) :This was [[phab:T421629|⚓ T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] but should be fixed now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:55, 24 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Louis_Nirenberg&oldid=15616502&useparsoid=1 rowiki:Louis Nirenberg] == The image seems to be the 250px thumbnail scaled up to what looks like 400px width. [[User:Andrei Stroe|Andrei Stroe]] ([[User talk:Andrei Stroe|talk]]) 10:16, 20 March 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Aide:Accueil&oldid=232433495&useparsoid=1 frwiki:Aide:Accueil] == custom collapsible elements render differently with parsoid [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 14:19, 20 March 2026 (UTC) :I filed https://phabricator.wikimedia.org/T421859. Thanks for the report. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:07, 31 March 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Katten_(olika_betydelser)&oldid=43770842&useparsoid=1 svwiki:Katten (olika betydelser)] == The legacy parser adds an empty line before the template Förgrening (which is a kind of table). The Parsoid parser don't do that. This occurs on all pages using that template. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 18:32, 21 March 2026 (UTC) :Ya, this is known difference with some paragraph wrapping which is tricky to fix. In this case, I recommend adjusting the top margin of the table by editing the base template: https://sv.wikipedia.org/w/index.php?title=Mall%3AF%C3%B6rgrening%20bas&veaction=editsource [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:01, 31 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Gen_Z_stare&oldid=1344701043&useparsoid=1 enwiki:Gen Z stare] == The infobox image is unusually narrow. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 01:51, 22 March 2026 (UTC) :For me the image is stretched horizontally by a fair bit. It seems like the following bit of code is to blame: :<syntaxhighlight lang="css"> :html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img {width: 400px; } :</syntaxhighlight> [[User:Sohom Datta|Sohom]] ([[User talk:Sohom Datta|talk]]) 01:54, 22 March 2026 (UTC) ::I'm not seeing any visible difference between legacy parser and Parsoid in my testing. Can you share a screenshot @[[User:Snowmanonahoe|Snowmanonahoe]] ? What skin and browser are you using? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 17:43, 27 March 2026 (UTC) :::@[[User:Jon (WMF)|Jon (WMF)]]: I don't see it anymore either. I'm using Vector 2022 and Firefox 149. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 17:46, 27 March 2026 (UTC) ::::Ah okay. I think this was a caching issue then. Some "temporary turbulence" was to be expected with this roll out. Thanks for reporting! [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 18:29, 27 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Virginia_Fonseca&oldid=71959182&useparsoid=1 ptwiki:Virginia Fonseca] == A 1ª imagem da página na infocaixa tem um tamanho grande demais [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 11:34, 22 March 2026 (UTC) :I don't see the problem. The page renders identically in Parsoid and with the old/legacy parser. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:22, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Xander_Harris&oldid=71958675&useparsoid=1 ptwiki:Xander Harris] == Seção de referências expandida [[User:Vitruviano|Vitruviano]] ([[User talk:Vitruviano|talk]]) 15:06, 22 March 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Bruker:Znuddel&oldid=25704667&useparsoid=1 nowiki:Bruker:Znuddel] == Hele siden er helt feil [[User:Nevemagneten|Nevemagneten]] ([[User talk:Nevemagneten|talk]]) 20:35, 24 March 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Main_page&oldid=2122&useparsoid=1 abstractwiki:Abstract Wikipedia:Main page] == Favicon is showing a dark background around the rounded corners on Chrome. [[User:Jsengupt|Jsengupt]] ([[User talk:Jsengupt|talk]]) 16:14, 25 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=System_(typeface)&oldid=1329545007&useparsoid=1 enwiki:System (typeface)] == Infobox image is stretched horizontally [[User:Anna328p|Anna328p]] ([[User talk:Anna328p|talk]]) 06:59, 26 March 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Enged%C3%A9lyk%C3%A9r%C3%A9s&oldid=28288240&useparsoid=1 huwiki:Wikipédia:Engedélykérés] == The email templates are rendered incorrectly. [[User:Bencemac|Bencemac]] ([[User talk:Bencemac|talk]]) 14:00, 26 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T421563 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:19, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Usu%C3%A1rio(a):Inter-rede/Cabe%C3%A7alho&oldid=71778331&useparsoid=1 ptwiki:Usuário(a):Inter-rede/Cabeçalho] == Whitespaces seem to have collapsed [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 18:02, 27 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422155 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:36, 2 April 2026 (UTC) ::It looks like the problem is the <code>display:flex</code> in the <code>style</code> attribute on the wrapper is at fault. Parsoid generates <code><nowiki><span></nowiki></code> wrappers around the html entities in the wikitext, by design. The whitespace is present in the HTML, so that's not a fault of Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:07, 9 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%91%D7%A6%D7%A2_%D7%9E%D7%A9%D7%94_(%D7%9E%D7%9C%D7%97%D7%9E%D7%AA_%D7%94%D7%A2%D7%A6%D7%9E%D7%90%D7%95%D7%AA)&oldid=42991233&useparsoid=1 hewiki:מבצע משה (מלחמת העצמאות)] == הכיתוב שנועד למנוע בלבול בין מבצע משה הזה למבצע משה אחר לא ערוך [[User:חנניה בלסמן|חנניה בלסמן]] ([[User talk:חנניה בלסמן|talk]]) 12:54, 30 March 2026 (UTC) == [//en.wikipedia.org/w/index.php?title=Help:Colon_trick&useparsoid=1 enwiki:Help:Colon trick] == According to [[w:Help:Colon trick]], it is explained as follows: "<code><nowiki>[[//Hus]]</nowiki></code> will produce an (invalid) external link wrapped in brackets ("[[//Hus]]"), but <code><nowiki>[[://Hus]]</nowiki></code> will produce a link to [[w://Hus|//Hus]]." However, when using Parsoid, it incorrectly links to [[w:Help:Colon trick//Hus|Help:Colon trick//Hus]].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:02, 31 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422161 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 14:00, 2 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Ans%C3%B6kan_om_administrativ_beh%C3%B6righet&oldid=59167563&useparsoid=1 svwiki:Wikipedia:Ansökan om administrativ behörighet] == In Legacy, each section (candidate) get a [redigera] ([edit] to the right of the section name. In Parsoid, there is nothing to the right of the section name. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 12:15, 2 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T391624 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:27, 2 April 2026 (UTC) == [https://en.wiktionary.org/w/index.php?title=H%26P&oldid=83856321&useparsoid=1 enwiktionary:H&P] == The first hidden category listed is [[wiktionary:Category:English_entries_with_incorrect_language_header|English entries with incorrect language header]]'','' which is, however, empty. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:48, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Jo%C3%A3o_Peixoto&oldid=72016744&useparsoid=1 ptwiki:João Peixoto] == A foto não corresponde ao nome citado [[User:Mayque Lemos|Mayque Lemos]] ([[User talk:Mayque Lemos|talk]]) 18:18, 2 April 2026 (UTC) == [https://meta.wikimedia.org/w/index.php?title=Main_Page&oldid=30254797&useparsoid=1 metawiki:Main Page] == On Parsoid only, <nowiki>''complete list'' and ''request''</nowiki> each show a space between them and their preceding opening bracket. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 19:06, 3 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&oldid=1343194045&useparsoid=1 enwiki:In Stars and Time] == <code>&lt;ref name="rps"&gt;</code> displays an error which doesn’t occur on the legacy parser [[User:Mir Novov|Mir Novov]] ([[User talk:Mir Novov|talk]]) 12:10, 4 April 2026 (UTC) :It was an error which I fixed with [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&diff=1348021667&oldid=1347424445 this edit] which adds one more backlink to Ref #5. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:00, 10 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Helen_Andrews&oldid=72024590&useparsoid=1 ptwiki:Helen Andrews] == Estou a ter problema com as referências, pois aparecem duplicadas. [[User:Faviola7|Faviola7]] ([[User talk:Faviola7|talk]]) 14:17, 4 April 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Project_chat&oldid=3236&useparsoid=1 abstractwiki:Abstract Wikipedia:Project chat] == In the "Bot request" section, a link that has been visited is blue rather than purple, because spaces in the link are turned into actual spaces (%20) in the URL. [[User:JJPMaster|JJP]]<sub>[[User talk:JJPMaster|Mas]]<sub>[[Special:Contributions/JJPMaster|ter]]</sub></sub> ([[wikt:she|she]]/[[wikt:they|they]]) 21:53, 4 April 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Tor_Fosse_(f%C3%B8dt_1956)&oldid=25723619&useparsoid=1 nowiki:Tor Fosse (født 1956)] == fil: center frameless [[User:Birgit.H.Pihl|Birgit.H.Pihl]] ([[User talk:Birgit.H.Pihl|talk]]) 10:05, 5 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Politisk_opposition&oldid=59171124&useparsoid=1 svwiki:Politisk opposition] == This error message about unused named reference is not shown: Referensfel: <ref>-tagg med namn "sr-20161006", definierad i <references> används inte tidigare i texten. The article is also added to hidden category "Sidor med referensfel" but that is not shown [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:12, 5 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Puteulum/Sandbox&oldid=150100596&useparsoid=1 itwiki:Utente:Puteulum/Sandbox] == The "Move" button to move the entry from sandbox to NS0 does not appear [[User:Puteulum|Puteulum]] ([[User talk:Puteulum|talk]]) 14:28, 7 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=POVOADO_TIRIRICAL&oldid=72040530&useparsoid=1 ptwiki:POVOADO TIRIRICAL] == O MEU TEXTO ESTA TODO VERMELHO E MAIS CENTRALIZADO [[User:POVOADO TIRIRICAL|POVOADO TIRIRICAL]] ([[User talk:POVOADO TIRIRICAL|talk]]) 18:38, 7 April 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%B1%E4%BA%AC%E9%83%BD%E9%81%935%E5%8F%B7%E6%96%B0%E5%AE%BF%E9%9D%92%E6%A2%85%E7%B7%9A&oldid=108985336&useparsoid=1 jawiki:東京都道5号新宿青梅線] == ヘッダー付近に編集ミスと思われし文言あり [[User:QWERTYKeyboard0570|QWERTYKeyboard0570]] ([[User talk:QWERTYKeyboard0570|talk]]) 08:56, 8 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=2022_Oder_environmental_disaster&oldid=1344570432&useparsoid=1 enwiki:2022 Oder environmental disaster] == After a second, the actual map from the infobox (not the buttons) is replaced with a placeholder icon and text (clicking in the field still works). [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 11:56, 8 April 2026 (UTC) :Could it have been a transient issue? I cannot reproduce this right now. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:03, 10 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Commissione_arbitrale/Domande&oldid=150049601&useparsoid=1 itwiki:Wikipedia:Commissione arbitrale/Domande] == This page is related to the itwiki ArbCom election. Section edit links were not shown, making it difficult to ask questions to candidates. This has since been worked around with [[:it:special:diff/150118322|this edit]] and is likely related to [[phab:T387520|T387520]]. [[User:Titore|Titore]] ([[User talk:Titore|talk]]) 19:58, 8 April 2026 (UTC) :Thanks for this report. This is on our list of high priority tasks to fix and we are going to pick up shortly. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:53, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Kurier&oldid=266019405&useparsoid=1 dewiki:Wikipedia:Kurier] == das Diagramm zum Beitrag "Ein Wal ..." überragt den Text der rechten Spalte. [[User:Michael w|Michael w]] ([[User talk:Michael w|talk]]) 08:10, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034&useparsoid=1 dewiki:Wikipedia:Fragen zur Wikipedia] == <nowiki>& s h y ;</nowiki> is ignored. See the test on https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034#&_s_h_y_; [[User:Raymond|Raymond]] ([[User talk:Raymond|talk]]) 09:55, 10 April 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422960 for this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:55, 10 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Faktafr%C3%A5gor&oldid=59190040&useparsoid=1 svwiki:Wikipedia:Faktafrågor] == Svara-funktionen fungerar inte med Parsoid. När jag klickar på Svara för något inlägg, vilket som helst, dyker svarsrutan upp längst ner på sidan, efter den senaste diskussionstråden. Med den äldre parsern fungerar det. [[User:Larske|Larske]] ([[User talk:Larske|talk]]) 11:12, 10 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Cornelis_de_Bruijn_Martinuszoon&oldid=70921577&useparsoid=1 nlwiki:Cornelis de Bruijn Martinuszoon] == De pagina-afbeelding is de handtekening van C. de Bruijn Mz. Ik denk dat zijn afbeelding in de spotprent een betere pagina-afbeelding is. Het zou kunnen dat Parsoid/Wikipedia deze niet 'pakt' omdat de dimensies tijdens een eerdere bewerking zijn aangepast. Alvast bedankt! [[User:Jelledebruijn|Jelledebruijn]] ([[User talk:Jelledebruijn|talk]]) 16:31, 10 April 2026 (UTC) :I think you might have seen a version of the page before the cache was updated. I just checked and the image is identical with Parsoid and the older parse. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:46, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=The_Punisher_(2004)&oldid=263259949&useparsoid=1 dewiki:The Punisher (2004)] == Dead link template Vorlage:Toter Link (https://de.wikipedia.org/wiki/Vorlage:Toter_Link) after url is no longer working but gets part of the Link. (example https://de.wikipedia.org/wiki/The_Punisher_(2004)#cite_note-5 ) [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:23, 10 April 2026 (UTC) :Example without Parsoid: https://de.wikipedia.org/wiki/The_Punisher_(2004)?useparsoid=0#cite_note-5 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:57, 10 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T368724 but ideally, the template will be added with a space after the link. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:24, 11 April 2026 (UTC) ::Unfortunately it's added by the InternetArchiveBot that way: https://de.wikipedia.org/w/index.php?title=Liste_aktiver_Brauereien_in_Deutschland&diff=prev&oldid=265857281 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 06:45, 11 April 2026 (UTC) :::@[[User:SSastry (WMF)|SSastry (WMF)]]: But it is not good if the preview shows us a different result than the version that is subsequently published. InternetArchiveBot inserts it without spaces. The task is prioritized as Low, but since we have this thousands of times in the article inventory (and it used to work before), the task should be reprioritized to Higher. And the preview should always show the same result that I get after publishing. What do we do with the Phab task now? How do we handle this bug? Thank you, [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 09:12, 11 April 2026 (UTC) ::::We will fix the preview path separately. But, for this specifically, I'll flag this for the team to see how we want to handle this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:33, 11 April 2026 (UTC) :::::@[[User:SSastry (WMF)|SSastry (WMF)]]: Oh thank you, keep us up to date here please. [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 16:35, 11 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Marlon_Ganchozo&oldid=172919968&useparsoid=1 eswiki:Marlon Ganchozo] == No sale el resto de la información del, jugador [[User:Didierlpz06|Didierlpz06]] ([[User talk:Didierlpz06|talk]]) 19:04, 10 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 eswiki:Temporada regular de la Euroliga 2025-26] == no se sustituyen correctamente las ultimas plantillas [[User:Hugogs02|Hugogs02]] ([[User talk:Hugogs02|talk]]) 08:42, 11 April 2026 (UTC) :This page is too large post-template expansion. Observe that the templates at the end are not expanded neither in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 Parsoid] nor in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=0 Legacy]; the legacy parser just happens to expand a few more at the end of the page due to [https://phabricator.wikimedia.org/T392262 T392262]. The page should probably be split. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:13, 13 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Uniforme_de_la_selecci%C3%B3n_de_f%C3%BAtbol_de_Argentina&oldid=172883243&useparsoid=1 eswiki:Uniforme de la selección de fútbol de Argentina] == En la plantilla de uniforme de fútbol algunos uniformes se ven con las mangas más bajas respecto al archivo del cuerpo, dejando lineas de un pixel por encima con los colores de fondo en dicha plantilla. [[User:Lobo kun mfc|Lobo kun mfc]] ([[User talk:Lobo kun mfc|talk]]) 13:58, 11 April 2026 (UTC) :The lines displayed on top of the uniforms are present both in Parsoid and in the Legacy parser, and they do seem to vary slightly depending on the browser (I've looked on Firefox and Chrome, both on Linux, and they were not consistent between both browsers). :I believe this issue should be fixed on the template side (at a guess, the <code>style="color: inherit; background-color:#000040;"</code> that I see on the various image divs may well show up depending on the exact HTML structure and/or image) [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:23, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Liste_der_Radschnellverbindungen_in_Deutschland&oldid=266034807&useparsoid=1 dewiki:Liste der Radschnellverbindungen in Deutschland] == Hallo, beim Artikel [[Liste der Radschnellverbindungen in Deutschland]] wird die Beschreibung der MapLink-Karte wird nicht gescheid gerendert. Statt einem hochgestellten <code>[7]</code> wird <code>Karte der bestehenden Radschnellwege in Deutschland'"`UNIQ--ref-00000008-QINU`"'</code> gerendert. Das Problem ist serverseitig und tritt beim Legacy-Parser nicht auf. LG [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 16:02, 11 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T383004 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:06, 11 April 2026 (UTC) ::thanks! [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 14:13, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Louis_Franchet_d%E2%80%99Esp%C3%A8rey&oldid=266076416&useparsoid=1 dewiki:Louis Franchet d’Espèrey] == Bildumfluss nicht wie üblich [[User:Alfred Kiefer|Alfred Kiefer]] ([[User talk:Alfred Kiefer|talk]]) 19:30, 11 April 2026 (UTC) :This issue has been fixed in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1269534 and should be deployed to production this week. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:34, 13 April 2026 (UTC) == [https://bn.wiktionary.org/w/index.php?title=%E0%A6%AA%E0%A7%8D%E0%A6%B0%E0%A6%A7%E0%A6%BE%E0%A6%A8_%E0%A6%AA%E0%A6%BE%E0%A6%A4%E0%A6%BE&oldid=250894&useparsoid=1 bnwiktionary:প্রধান পাতা] == The ‘ শব্দছবি’ section is overflowing with Parsoid; thus does not happen when the legacy parser is used. [[User:Redmin|Redmin]] ([[User talk:Redmin|talk]]) 08:09, 12 April 2026 (UTC) :Since the section seems to be randomized, it's pretty hard to see which version of this section is overflowing (the ones I see do not seem to). Would you be able to provide more information/a screenshot? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:49, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Hamburg&oldid=266087257&useparsoid=1 dewiki:Wikipedia:Hamburg] == Abschnittsbearbeitungen nicht mehr möglich, Link fehlt. Betrifft einige WP-Seiten wie auch [[:de:Wikipedia:Stammtisch München]] oder auch nur einige Überschriften von [[:de:Vorlage:Coordinate]], also nicht immer komplette Seiten. [[User:NordNordWest|NordNordWest]] ([[User talk:NordNordWest|talk]]) 12:12, 12 April 2026 (UTC) :We have a number of issues with section edit links (documented in https://phabricator.wikimedia.org/T391624) that we intend to fix; sorry for the inconvenience - we'll make sure to keep this use case in mind when working on a solution. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:20, 23 April 2026 (UTC) == [https://zh.wikipedia.org/w/index.php?title=COBOL&oldid=91149855&useparsoid=1 zhwiki:COBOL] == 正文开头的“COBOL”英文名无法显示,且全文的繁简转换失效。 The English name "COBOL" for COBOL at the very beginning vanished. Besides, the conversion between traditional and simplified Chinese does not function for the entire page. [[User:Ricky136973|Ricky136973]] ([[User talk:Ricky136973|talk]]) 13:08, 12 April 2026 (UTC) :Parsoid should not (yet) be enabled on zhwiki. If you want to preview how it will work, you can add <code>&parsoidnewlc=1</code> to the end of the URL to use Parsoid's implementation of LanguageConverter. That shows "COBOL" on this page as expected. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:17, 13 April 2026 (UTC) ::Parsoid is now experimentally enabled, so you don't need the `&parsoidnewlc=1` at the end of the URL any more. It appears that the COBOL page renders correctly now? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:40, 21 April 2026 (UTC) == [https://th.wikipedia.org/w/index.php?title=4_%E0%B9%80%E0%B8%97%E0%B8%9E%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B8%9E%E0%B8%B4%E0%B8%97%E0%B8%B1%E0%B8%81%E0%B8%A9%E0%B9%8C&oldid=12947833&useparsoid=1 thwiki:4 เทพผู้พิทักษ์] == อันนี้น่าจะผิดที่ร้องเพลงประกอบละคร [[User:ภรพัฒน์|ภรพัฒน์]] ([[User talk:ภรพัฒน์|talk]]) 12:47, 13 April 2026 (UTC) :Google translate says, "This is probably a mistake—singing the theme song for a TV drama." :This seems like a content issue, not a Parsoid issue. Mistakes in content should be correctly directly on the wiki. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:47, 21 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:%D7%A9%D7%A8%D7%A9%D7%97%D7%95%D7%9F/%D7%98%D7%99%D7%95%D7%98%D7%94&oldid=42822143&useparsoid=1 hewiki:משתמש:שרשחון/טיוטה] == אני רוצה לבטל את המצאות השם יעל סרלין בדף הטיוטות שלי כדי להתחיל ערך חדש [[User:שרשחון|שרשחון]] ([[User talk:שרשחון|talk]]) 12:59, 13 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Acidente_radiol%C3%B3gico_de_Goi%C3%A2nia&oldid=72061996&useparsoid=1 ptwiki:Acidente radiológico de Goiânia] == [[File:Captura_de_tela_de_miniaturas_renderizadas_pelo_Parsoid.png|thumb|250x250px]] As miniaturas estão minúsculas com as margens enormes. [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 15:13, 13 April 2026 (UTC) :It seems to be like this due to :<pre>html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img[width="250"] { width: calc(round(400px * var(--mw-file-upright,1),10px)) }</pre> [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 17:48, 19 April 2026 (UTC) ::{{Tracked|T423676}} [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) ::This should have been fixed by a backport we did yesterday. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:48, 21 April 2026 (UTC) == [https://hr.wikipedia.org/w/index.php?title=Marijana_Bijeli%C4%87&oldid=7429126&useparsoid=1 hrwiki:Marijana Bijelić] == Sve je podvuceno a ne treba tako biti [[User:Nikolica1512|Nikolica1512]] ([[User talk:Nikolica1512|talk]]) 17:08, 13 April 2026 (UTC) :I made some edits for you [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 18:32, 13 April 2026 (UTC) ::Thank you, I ameliorated those problematic parts, could you take a look at it? I hope it is good to go now as an article on wikipedia so people could access it. This person deserves to have a wiki page. ::Regards, [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 21:53, 13 April 2026 (UTC) :::Sorry, no. I was only helping with the syntax error. You'll need to take your request to the hrwiki community [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 22:25, 13 April 2026 (UTC) ::::And how do I do that exactly? Could you help me out with it? [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 22:56, 13 April 2026 (UTC) :::::You can ask on [[:hr:Wikipedija:Kafić]] and I'm sure someone there will help you out [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 00:34, 14 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 dewiki:Hilfe:Parserfunktionen] == Headings which use <code><nowiki><includeonly></nowiki></code> to change nesting level when transcluded don't appear as headings on original page [[User:TheFirstLevelDown|TheFirstLevelDown]] ([[User talk:TheFirstLevelDown|talk]]) 00:01, 14 April 2026 (UTC) :Parsoid does not support gluing heading together like the legacy parser did, so this syntax is not supported. :As an alternative, we suggest something like (to adjust depending on your exact use case) :<syntaxhighlight lang="wikitext"> <includeonly>===== title =====</includeonly> <noinclude>=== title ===</noinclude> </syntaxhighlight> :or, for a less robust version (but that doesn't require repeating the title) :<syntaxhighlight lang="wikitext"> <includeonly>=====</includeonly><noinclude>===</noinclude> title <includeonly>=====</includeonly><noinclude>===</noinclude> </syntaxhighlight> [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 12:45, 14 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Amor_eterno_una_tragedia_anunciada&oldid=172974810&useparsoid=1 eswiki:Amor eterno una tragedia anunciada] == el título de la página está como "Amor eterno una tragedia anunciada" y no deja cambiarlo al original que es "Amor Eterno: Una tragedia anunciada" [[User:Goodfriendspictures|Goodfriendspictures]] ([[User talk:Goodfriendspictures|talk]]) 09:59, 14 April 2026 (UTC) :To me it looks like the [[DISPLAYTITLE]] magic word is disabled though {{wg|AllowDisplayTitle}} in eswiki. Nothing to do with Parsoid. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 10:12, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:TanjaKo/Sandbox&oldid=150217478&useparsoid=1 itwiki:Utente:TanjaKo/Sandbox] == Nel testo non sono presenti errori e le frasi sono sottolineate con una linea rossa ondulata. Come risolverlo visual bug? Grazie [[User:TanjaKo|TanjaKo]] ([[User talk:TanjaKo|talk]]) 17:42, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Raduni/Raduni_in_Sicilia_2026&oldid=150224594&useparsoid=1 itwiki:Wikipedia:Raduni/Raduni in Sicilia 2026] == just on iPhone 14 with iOS 18.7.7 both from safari or chrome and both from logged or unlogged and incognito mode, the last number of the participants list (made with "#") is bigger than the others [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 18:31, 15 April 2026 (UTC) == [https://atj.wikipedia.org/w/index.php?title=Otitikowin&oldid=16878&useparsoid=1 atjwiki:Otitikowin] == pas moyen de travailler en mode visuel sur la page [[User:Luc Patin|Luc Patin]] ([[User talk:Luc Patin|talk]]) 14:56, 16 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Zhang_Zeduan&oldid=173032341&useparsoid=1 eswiki:Zhang Zeduan] == La pagina está incompleta e inpublicable [[User:Mikemj1987|Mikemj1987]] ([[User talk:Mikemj1987|talk]]) 22:08, 17 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:08, 20 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=L%C3%ADnea_E3_(Euskotren_Trena)&oldid=173034070&useparsoid=1 eswiki:Línea E3 (Euskotren Trena)] == La imagen se ve un poco mal por el modo oscuro. [[User:UnniMan|UnniMan]] ([[User talk:UnniMan|talk]]) 00:55, 18 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:09, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Stadtbahn_Karlsruhe&oldid=265878452&useparsoid=1 dewiki:Stadtbahn Karlsruhe] == Shows reference error and the categoy Kategorie:Wikipedia:Seite mit Einzelnachweisfehlern but is not included in https://de.wikipedia.org/wiki/Kategorie:Wikipedia:Seite_mit_Einzelnachweisfehlern The same happens with other articles that had no reference errors with the old parser. Makes maintenance hard. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 09:26, 19 April 2026 (UTC) :Tracked in https://phabricator.wikimedia.org/T423924 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Indiana_Jones_and_the_Fate_of_Atlantis&oldid=265815741&useparsoid=1 dewiki:Indiana Jones and the Fate of Atlantis] == Shows a reference error that is not visible in the preview function. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:06, 19 April 2026 (UTC) :The error came through a Reference with the same name in a used template https://de.wikipedia.org/wiki/Vorlage:Verkaufszahlen_LucasArts_Adventures Still bad to have an error that wasn't there with the old parser and isn't shown in the preview or maintenance category. --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:27, 19 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Evento_Azolla&oldid=72103944&useparsoid=1 ptwiki:Evento Azolla] == [Convert: número inválido] na parte de Efeitos Globais [[User:Marina Funez|Marina Funez]] ([[User talk:Marina Funez|talk]]) 00:28, 20 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:10, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Musikk%C3%A1r&oldid=144140&useparsoid=1 smnwiki:Myenster:Musikkár] == Instead of dealing with this issue and the other issue on smnwiki listed below, these were quietly archived. These are still displaying messed up months later after they were reported the first time. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:53, 20 April 2026 (UTC) :We may have missed this previously, but edits like [https://smn.wikipedia.org/w/index.php?title=Myenster%3AMusikk%C3%A1r&diff=152826&oldid=144359 this] should fix the rendering. This should work for the other pages below as well. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 12:42, 20 April 2026 (UTC) ::Thank you. I'll do the same for any other templates I come across that display like that one did. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 15:49, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Diskografia&oldid=62663&useparsoid=1 smnwiki:Myenster:Diskografia] == Instead of dealing with this issue and the other issue on smnwiki listed above, these were quietly archived. These are still displaying messed up months later after they were reported the first time. -[[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Kirje%C4%8D%C3%A4llee&oldid=32928&useparsoid=1 smnwiki:Myenster:Kirječällee] == Like the other display issues in smnwiki, this is also displaying messed up after the change. [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. For all other pages you encounter on wiki like this, please make similar edits. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Donald_A._Wollheim&oldid=266357315&useparsoid=1 dewiki:Donald A. Wollheim] == Picture is shown within a big white box, which isn't the case with the old parser. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 11:15, 20 April 2026 (UTC) :[[phab:T421524]] [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe_Diskussion:Bilder&oldid=266370955&useparsoid=1 dewiki:Hilfe Diskussion:Bilder] == see [[w:de:Hilfe Diskussion:Bilder #Skalierung von Bildern mit dem Parameter hochkant scheint nicht mehr zu funktionieren]] [[User:BurghardRichter|BurghardRichter]] ([[User talk:BurghardRichter|talk]]) 22:24, 20 April 2026 (UTC) == [https://tcy.wikipedia.org/w/index.php?title=%E0%B2%AE%E0%B3%81%E0%B2%96%E0%B3%8D%E0%B2%AF_%E0%B2%AA%E0%B3%81%E0%B2%9F&oldid=359337&useparsoid=1 tcywiki:ಮುಖ್ಯ ಪುಟ] == in main page not enable <code>html.skin-theme-clientpref-night</code> [[User:ChiK|ChiK]] ([[User talk:ChiK|talk]]) 05:47, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:23, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == https://de.wikipedia.org/wiki/Gemeindestandsver%C3%A4nderungen_in_der_Schweiz == Die Links zu den Ankern gehen nicht [[Special:Contributions/&#126;2026-24437-27|&#126;2026-24437-27]] ([[User talk:&#126;2026-24437-27|talk]]) 11:53, 21 April 2026 (UTC) :I see you found a solution :) :For the exact issue: generating ids independently from their enclosing tag is not supported by Parsoid (although this is not documented - I'll fix that). :Thanks for the report! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:16, 21 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Albosaggia&oldid=50063504&useparsoid=1 svwiki:Albosaggia] == This article, and thousands of other articles, have erroneously been put in hidden categories [[:sv:Kategori:Sidor med referensfel]] and [[:sv:Kategori:Wikipedia:Projekt översätta källmallar]]. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 12:24, 21 April 2026 (UTC) :You can mark this issue as fixed. The problem root cause was in a new Template and Module created this morning. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:40, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Eurovision_Song_Contest_1992&oldid=258716277&useparsoid=1 dewiki:Eurovision Song Contest 1992] == Quelltext bearbeiten ist für Abschnitte nicht sichtbar [[User:Anmey10112|Anmey10112]] ([[User talk:Anmey10112|talk]]) 13:00, 21 April 2026 (UTC) :Translation: "Edit source" is not visible for sections. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Boro%C8%99e%C8%99ti,_Ia%C8%99i&oldid=17665231&useparsoid=1 rowiki:Boroșești, Iași] == Satul este Borosești nu Boroșești. [[User:Stalmada|Stalmada]] ([[User talk:Stalmada|talk]]) 13:07, 21 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:09, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Gebouwge%C3%AFntegreerde_zonnepanelen_(BIPV)&oldid=71021732&useparsoid=1 nlwiki:Gebouwgeïntegreerde zonnepanelen (BIPV)] == Bij de afbeeldingen zijn 3 afbeeldingen gecombineerd met de sjabloon {{Afbeelding combi}} . De sjabloon maakt gebruikt van elk aparte tekstvelden voor elke afbeeldingen. Echter is in dit geval bij de eerste twee afbeeldingen geen gebruik gemaakt van tekstveld en is al de tekst aan het eind geplaatst bij de laatste afbeelding. Door dit gebruik van de sjabloon worden de afbeeldingen zonder spatie direct na elkaar vertoont. Op de mobiele website worden de afbeeldingen met dit sjabloon wel met spaties vertoont. Merk op dat de engelse template wel de mogelijkheid heeft om afbeeldingen gecombineerd te laten zien met spaties er tussen en heeft deze variant template meer mogelijkheden dan de NL versie. Mogelijk dat er de uitwerkin ook niet helemaal correct is geweest, maar hierover is niet te oordelen vanwege de beperkte Wiki edit kennis. [[User:Public-Publicity|Public-Publicity]] ([[User talk:Public-Publicity|talk]]) 16:16, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:22, 21 April 2026 (UTC) :Translation: "In this section, three images have been combined using the template `Template:Afbeelding combi`. This template typically utilizes a separate text field for each individual image; however, in this specific instance, the text fields for the first two images were left unused, and all the accompanying text was instead placed at the end, alongside the final image. As a result of this specific application of the template, the images are displayed consecutively without any spacing between them. On the mobile version of the website, however, images utilizing this template *are* displayed with spacing. It is worth noting that the English-language version of this template *does* offer the capability to display combined images with spacing in between—making that variant of the template more versatile than its Dutch counterpart. It is possible that the implementation itself was not entirely correct; however, it is difficult to pass judgment on this matter due to limited expertise in Wiki editing." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:12, 23 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Talk:Rao_Laxmi_Chand&oldid=10828084&useparsoid=1 simplewiki:Talk:Rao Laxmi Chand] == This Page is fake and all the information is fake [[User:Rao Gourav|Rao Gourav]] ([[User talk:Rao Gourav|talk]]) 17:23, 21 April 2026 (UTC) :Triage: Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:28, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:07, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80%D0%BE%D0%B2%D1%81%D0%BA%D0%B8%D0%B9,_%D0%A1%D1%82%D0%B5%D0%BF%D0%B0%D0%BD_%D0%A4%D1%91%D0%B4%D0%BE%D1%80%D0%BE%D0%B2%D0%B8%D1%87&oldid=152793914&useparsoid=1 ruwiki:Александровский, Степан Фёдорович] == дублируется реф в инфобоксе [[User:Gleb95|Gleb95]] ([[User talk:Gleb95|talk]]) 20:21, 21 April 2026 (UTC) :Translation: "The reference is duplicated in the infobox." :The legacy parser version has 19 references in the references list, and Parsoid contains 22. This is likely a content issue, although I haven't looked into it to determine root cause. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:11, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is plenty of problems I see related to transliteration to Serbian Cyrillic. I prefer reading articles in Serbian Cyrillic (on top of our UI, I select "Ћирилица"). In current state, Parsoid should not be turned on at all on our Wikipedia {{multiple image | align = center | total_width = 1000 | image1 = Jefri Saks (no Parsoid).png | caption1 = Without Parsoid | image2 = Jefri Saks (Parsoid).png | caption2 = With Parsoid }} Note that, with Parsoid, everything is transliterated, even when marked with correct <nowiki><lang></nowiki> attribute. Without parsoid, original English text is correctly left un-transliterated. There is also a glitch where URL is not rendered in infoboxes, again, probably something about misrendering text which was supposed to avoid transliteration. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:43, 21 April 2026 (UTC) :This is [[phab:T424159|T424159 [P0] Parsoid doesn't "guessVariant" at top level on Serbian Wikipedia, and makes sr-ec rendering "unusable" for some pages]]. Fundamentally, the mark up on that page is incorrect, in so far as English and Latin text aren't properly marked with `-{....}-`. It "worked before" because of a top-level "guessVariant" routine which effectively disabled language converter entirely on some pages, including this one. I suspect I'm going to have to implement the same 'guessVariant' mechanism in Parsoid, since there appears to be too much content of this type without proper language markers. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:04, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is no "Edit with migration tool" entry in tools on Serbian Wikipedia. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:50, 21 April 2026 (UTC) :It needs to be enabled explicitly in Preferences > Editing > Developer tools > Enable parser migration tool. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:44, 23 April 2026 (UTC) == includeonly in headline syntax == no longer resolved properly == ''Example:'' [[w:de:Hilfe:Parserfunktionen]] This page (and many others of our help pages) are made for dual use: # stand alone # transclusion of several help pages of similar topic into a combined complete story. They contain headlines like <syntaxhighlight lang="wikitext"> <includeonly>=</includeonly>== Allgemeines ==<includeonly>=</includeonly> </syntaxhighlight> If stand alone, this shall be displayed as H2. * When combined, the page title will be shown as H2 and the section as H3. Swift solution most welcome – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:23, 22 April 2026 (UTC) : BTW – transclusion works correctly: [[w:de:Hilfe:Parserfunktionen/*]] --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:27, 22 April 2026 (UTC) :https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 has our suggested solution (the first form preferably). It works in transclusion mode because the preprocessor is involved. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:53, 22 April 2026 (UTC) ::“has our suggested solution (the first form preferably). It works” ::I do not understand what is “our suggested solution” – please look at this current page. It has neither TOC nor any headline, since the == are displayed within the text, using the default parsing. There are 10 headlines. ::Astonished – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 21:45, 22 April 2026 (UTC) :::Oops .. sorry! I pasted the wrong link! I meant to point you to [[#dewiki:Hilfe:Parserfunktionen|this section]] on this page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 00:09, 23 April 2026 (UTC) You’re imposing some work on us. * I am happy that there are [https://de.wikipedia.org/w/index.php?search=H:+insource:includeonly+insource:%2Fincludeonly%5C%3E%3D%2B%5C%3C%5C%2Fincludeonly%2F&title=Spezial:Suche 12 pages only] to be updated now. * Fortunately, some other syntax has been used in [[w:de:H:VE/*]] – [[w:de:H:Lua/*]] – [[w:de:H:Tabellen/*]] – [[w:de:H:FAQ/Übersicht]] which are merging a huge pile of single pages. I do hope this exception will be described in WikiSyntax Documentation soon. --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 11:04, 23 April 2026 (UTC) :Thanks for your understanding and fixing the pages. Given all the work we've done to deploy to a wiki, at this point, we expect that all remaining rendering issues are likely going to be edge cases that affect small number of pages. We'll update the docs soon, yes. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:22, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%9F%D1%80%D0%B5%D0%B4%D1%83%D0%BF%D1%80%D0%B5%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5&oldid=116093745&useparsoid=1 ruwiki:Шаблон:Предупреждение] == [[:ru:Шаблон:Tpre]] ([[:ru:Модуль:Template call code]]) stops working entirely in Parsoid mode. See also local discussion: [[:ru:Википедия:Форум/Технический#c-Tarkoff-20260422084300-Шаблон:Предупреждение]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 16:40, 22 April 2026 (UTC) :That doesn't look good. Do you have a sense of how many pages are impacted? We will take a look tomorrow and see what is going on and if we can roll out a quick fix. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:07, 22 April 2026 (UTC) ::I see what is going on. This is [[phab:T353697|T353697]] which was resolved with https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/992274. The fix is to have the modules emit <code>format="wikitext"</code> so the <nowiki><span> tags aren't escaped as literal output. Can you see if that fixes it?</nowiki> [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:22, 22 April 2026 (UTC) ::: Yes, thank you. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:47, 22 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Rei_Ami&oldid=266367300&useparsoid=1 dewiki:Rei Ami] == The image of Ami on the top right corner should be rendered with a width of 250px but seems to be scaled down to round about 160px. When using the Legacy Parser the image is rendered as expected. The issue seems to effect only some images. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 18:59, 22 April 2026 (UTC) :@[[User:Jon (WMF)|Jon (WMF)]] says, "The original size of the image is 315x427. This is https://phabricator.wikimedia.org/T421524 - only way to fix it is for Parsoid to mark the img up with a class when the image original size is smaller than 400px. Otherwise it's working as expected." I'm not entirely sure I agree with this diagnosis, since T421524 would cause the image to appear "too large" not "too small". :@[[User:Guardian of Arcadia|Guardian of Arcadia]] what is your user thumbnail size preference, and what skin are you using? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:13, 23 April 2026 (UTC) ::@[[User:Cscott|Cscott]]: I'm using the default thumbnail size of 250px and Vector 2010 (Legacy) as skin. But the size issue also occurs when using other skins like Vector 2022, which can be seen by appending <code>useskin=vector-2022</code> to the URL or viewing the page in an incognito window. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 20:37, 23 April 2026 (UTC) :::What browser and version are you using @[[User:Guardian of Arcadia|Guardian of Arcadia]] ? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 21:46, 23 April 2026 (UTC) ::::Also can you check you don't have a different preference set in [[Special:GlobalPreferences]] and possibly try changing it and changing it back? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:55, 23 April 2026 (UTC) ::::@[[User:Jon (WMF)|Jon (WMF)]]: The issue isn't limited to my account only; it occurs in a logged-out state (within an incognito window) too. But your guess about the browser seems to be right: I have the described issue when using Firefox with the ESR version 115.35.0esr. Today I have tested with another browser (Chrome and Edge) as well as on a PC with a current (non-ESR) Firefox and there the image is shown as expected. So, is this a bug in this specific Firefox version? [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 19:47, 24 April 2026 (UTC) :::::Yes. This sounds like a bug in that specific Firefox version. If you can give me more details about the operating system version you are using I can see if I can replicate in browserstack.com . Is it possible there are any browser extensions installed on that browser? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 22:31, 24 April 2026 (UTC) ::::::The operating system on this PC is Windows 8.1 (Build 9600) and I do not have any browser extensions installed there. Hope this helps to reproduce the issue. If you need anything else please let me know. Thanks for your help. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 22:44, 24 April 2026 (UTC) :::::::That was incredibly useful information, thank you. I understand what is happening now, and there might be something we can do here. Note, this browser is on the cusp of our usual browser support levels, which is what's causing the problem. [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 16:54, 27 April 2026 (UTC) ::::::::That's great news. I would be verry happy if you or your team can fix it. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 17:00, 27 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Alexandru_Dobrogeanu-Gherea&oldid=17669378&useparsoid=1 rowiki:Alexandru Dobrogeanu-Gherea] == imaginea prea mare, la fel la multe articole cu infocaseta om politic, de pilda Vasile Luca, Luminita Odobescu etc face contrast cu imagini in alte infocasete unde problema se poate regla [[User:Ewan2|Ewan2]] ([[User talk:Ewan2|talk]]) 01:25, 23 April 2026 (UTC) :Google translate: "the image is too large, the same as in many articles with the politician infobox, for example Vasile Luca, Luminita Odobescu, etc. it contrasts with images in other infoboxes where the problem can be adjusted." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 18:50, 23 April 2026 (UTC) ::@[[User:Jon (WMF)|Jon (WMF)]] says "For Romanian Wikipedia, there was a problem with the infobox styles. Pretty sure it's been fixed since. It could just be that he's seeing 400px instead of 300px. The infobox image looks identical to me in Parsoid and legacy." ::@[[User:Ewan2|Ewan2]] are you using the default thumbnail size (250px) or a larger size in your user preferences? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:07, 23 April 2026 (UTC) == [https://zu.wikipedia.org/w/index.php?title=Gashamo_Hawd_Somali_Ethiopia&oldid=122552&useparsoid=1 zuwiki:Gashamo Hawd Somali Ethiopia] == Is the city of Hawd Zone [[User:Maaaaskaas11|Maaaaskaas11]] ([[User talk:Maaaaskaas11|talk]]) 21:58, 23 April 2026 (UTC) == [https://ru.wikipedia.org/wiki/Текумсе ruwiki:Текумсе] == For some reason, the comment "До эскиза Лоссинга не было известно..." is repeated twice (see subsection "Комментарии" at the end of the article). This comment is generated by template "ref+" placed inside the template "персона" (an analogue of "Template:Infobox person"), and it is supposed to appear only once. Thanks! [[User:Adavyd|Adavyd]] ([[User talk:Adavyd|talk]]) 22:04, 23 April 2026 (UTC) :This is probably {{phab|T415789}}, which would be solved by adding a name to the reference, but then we end up running into {{phab|T423924}} - the template ends up defining the reference twice with subtly different content (as far as Parsoid is concerned) and the same name, which triggers an error. The fix will probably be to add a name to the reference once {{phab|T423924}} is handled. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:43, 24 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=FIDO2&oldid=264704558&useparsoid=1 dewiki:FIDO2] == Erste Grafik überlagert den Text und die Werkzeugleiste links [[User:Hinnerk11|Hinnerk11]] ([[User talk:Hinnerk11|talk]]) 23:51, 23 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Amanda_Kathrine_Smith/Sandbox&oldid=150348388&useparsoid=1 itwiki:Utente:Amanda Kathrine Smith/Sandbox] == i don't see the "MOVE DRAFT" button. [[User:Amanda Kathrine Smith|Amanda Kathrine Smith]] ([[User talk:Amanda Kathrine Smith|talk]]) 14:14, 24 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:36, 28 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%A1%D1%80%D0%B1%D0%B8%D1%98%D0%B0_(1071%E2%80%941217)&oldid=30892614&useparsoid=1 srwiki:Србија (1071—1217)] == Text inside {{lang-la.. and other {{lang-... templates is not displayed at all. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:46, 24 April 2026 (UTC) :Never mind, in process of adapting our templates for Parsoid, I missed additional change needed in an auxillary module. All is good now. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A2%D1%80%D0%B3/%D0%94%D1%80%D1%83%D0%B3%D0%B8&oldid=30921466&useparsoid=1 srwiki:Википедија:Трг/Други] == <nowiki>__NOCONTENTCONVERT__</nowiki> does not work in Parsoid. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 18:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=Queen&oldid=30824348&useparsoid=1 srwiki:Queen] == Parsoid does not honor __БЕЗКН__ (magic word to suppress title conversion during language conversion) [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 20:03, 24 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%A4%D0%BE%D1%80%D1%83%D0%BC/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8&oldid=152858025&useparsoid=1 ruwiki:Википедия:Форум/Новости] == Исчез логотип в скине Вектор-2010 при включенном гаджете, который отображает праздничные логотипы. При отключении гаджета в настройках — повседневный логотип виден. [[User:Рыцарь поля|Рыцарь поля]] ([[User talk:Рыцарь поля|talk]]) 00:16, 25 April 2026 (UTC) :Triage: not a Parsoid visual issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:22, 27 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9F%D1%80%D0%BE%D0%B5%D0%BA%D1%82:%D0%91%D0%B8%D0%B1%D0%BB%D0%B8%D0%BE%D1%82%D0%B5%D0%BA%D0%B0/%D0%A2%D1%80%D0%B5%D0%B1%D1%83%D1%8E%D1%82%D1%81%D1%8F_%D0%BA%D0%BD%D0%B8%D0%B3%D0%B8&oldid=152853098&useparsoid=1 ruwiki:Проект:Библиотека/Требуются книги] == Конфликт [[:ru:Проект:Библиотека/Требуются книги/Шапка]] с содержанием страницы, из-за чего в [[:ru:Шаблон:shortcut|Шаблон:shortcut]] помещается раздел "содержание" (выглядит это так: [https://ibb.co/219kN3dW 1] и [https://ibb.co/bgM0Fmpn 2]). ------- The conflict between [[:ru:Проект:Библиотека/Требуются книги/Шапка]] and the page content causes the "содержание" section to appear inside [[:ru:Шаблон:shortcut|Шаблон:shortcut]] (this is how it looks: [https://ibb.co/219kN3dW 1] and [https://ibb.co/bgM0Fmpn 2]). [[User:Футболло|Futbollo]] ([[User talk:Футболло|talk]]) 01:10, 25 April 2026 (UTC) :Thank you for the report - I've filed {{phab|T424492}} for it. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:33, 27 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Copa_Intercontinental_da_FIFA_de_2025&oldid=72134360&useparsoid=1 ptwiki:Copa Intercontinental da FIFA de 2025] == Quadro de informações foi excluído por acidente. [[User:AnderSilv42|AnderSilv42]] ([[User talk:AnderSilv42|talk]]) 00:16, 26 April 2026 (UTC) :Triage: Content related - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 15:23, 26 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Michel_W%C3%B6cke&oldid=266505400&useparsoid=1 dewiki:Michel Wöcke] == Bild (Thumb) viel zu gross [[User:Albinfo|Albinfo]] ([[User talk:Albinfo|talk]]) 13:44, 26 April 2026 (UTC) == [https://tn.wikipedia.org/w/index.php?title=Sekolo_Se_Segolwane_Sa_Nata&oldid=49572&useparsoid=1 tnwiki:Sekolo Se Segolwane Sa Nata] == I tried fixing the references but It still says pages with reference errors so I don't know what could be the issue [[User:Blackgirlmighty|Blackgirlmighty]] ([[User talk:Blackgirlmighty|talk]]) 17:00, 26 April 2026 (UTC) :You only need to define a reference once even if you want to use it multiple times - see https://www.mediawiki.org/wiki/Help:Cite#Multiple_uses_of_the_same_footnote for more information. One of each of the references Mmegi2012 and Mmegi2023 should be kept as is; the others should be replaced by <nowiki><ref name="Mmegi2012" /></nowiki> (or 2023) without content. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:39, 27 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Pete_Aguilar&oldid=8671369&useparsoid=1 simplewiki:Pete Aguilar] == This is a less detailed copy of another Wikipedia page. There are two wiki pages showing Pete Aguilar and this is an outdated version. [[User:SuperPug3739|SuperPug3739]] ([[User talk:SuperPug3739|talk]]) 04:56, 27 April 2026 (UTC) :Triage: content related, not Parsoid related [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:46, 27 April 2026 (UTC) == [https://fi.wikipedia.org/w/index.php?title=Hoito-_kasvatussuunnitelma&oldid=23973675&useparsoid=1 fiwiki:Hoito- kasvatussuunnitelma] == Sivun nimi piti olla Hoito- ja kasvatussuunnitelma. Muokkaaminen ei onnistunut. [[User:Nebiux|Nebiux]] ([[User talk:Nebiux|talk]]) 12:01, 29 April 2026 (UTC) :Triage: content related, not Parsoid-related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:04, 30 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Usuario:Luigi_Nakano&oldid=173203320&useparsoid=1 eswiki:Usuario:Luigi Nakano] == An error appears, which should appear when template [[w:es:Plantilla:Estado usuario|Estado usuario]] has nothing in 1=. However, there is a parameter in 1=, so the result should be "Conectado" or "Desconectado", and not "Error:No se ha indicado usuario.". [[User:Luigi Nakano|<span style="color:green">Luigi</span> <span style="color:blue">Nakano</span>]] [[File:Emojione 1F3A7.svg|15px]] ([[User talk:Luigi Nakano|会話]]) 23:12, 29 April 2026 (UTC) :This looks like {{phab|T348722}}, for which a workaround is suggested in https://www.mediawiki.org/wiki/Parsoid/Parser_Unification/Instructions_for_editors#Access_to_parent_frame_from_within_extensions. Let us know if the problem persists after the fix! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:10, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=History_of_the_Ryukyu_Islands&oldid=1336895218&useparsoid=1 enwiki:History of the Ryukyu Islands] == The multiple issues display unsourced template when editing the article there is no such template. [[User:Lightoil|Lightoil]] ([[User talk:Lightoil|talk]]) 05:11, 30 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A7%D1%85%D0%B0%D0%B8%D0%B4%D0%B7%D0%B5,_%D0%9C%D0%B0%D0%BC%D0%B8%D1%8F_%D0%92%D0%B8%D1%81%D1%81%D0%B0%D1%80%D0%B8%D0%BE%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&oldid=152923873&useparsoid=1 ruwiki:Чхаидзе, Мамия Виссарионович] == In the old parser, links to non-existing file pages lead to Special:Upload for the file. In Parsoid, it's a strange link to Special:FilePath, which ends up confusing the editors who accustomed to uploading files this way. [[:ru:Служебная:GoToComment/c-ФВ-20260430140600-Не_загружается_файл|See local discussion]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:53, 30 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%94%D0%B5%D1%80%D0%B2%D0%B8%D1%88_%D0%9A%D0%BE%D1%80%D0%BA%D1%83%D1%82&oldid=30931273&useparsoid=1 srwiki:Дервиш Коркут] == At the bottom, there are several navboxes, Parsoid adds some whitespace between them [[File:Spaces between navboxes with Parsoid..png]] [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 21:21, 30 April 2026 (UTC) : https://phabricator.wikimedia.org/T425123 [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 15:27, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Sevayat&oldid=1351876642&useparsoid=1 enwiki:Talk:Sevayat] == The content assessment and talk page are displayed directly on the talk page, rather than within the “About this page” section (mobile view). [[User:S4yam|S4yam]] ([[User talk:S4yam|talk]]) 21:44, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:Template_editor&oldid=1351909200&useparsoid=1 enwiki:Wikipedia talk:Template editor] == I'm artist thi is my personal biography page [[User:Allymtulia|Allymtulia]] ([[User talk:Allymtulia|talk]]) 21:45, 30 April 2026 (UTC) :Triage: Content issue, not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Middle_of_Nowhere_(Kacey_Musgraves_album)&oldid=1351931473&useparsoid=1 enwiki:Middle of Nowhere (Kacey Musgraves album)] == Producer parameter that adops hlist system in Infobox album template occurs an error. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 01:07, 1 May 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Associazione_Calcio_Perugia_1996-1997&oldid=148287407&useparsoid=1 itwiki:Associazione Calcio Perugia 1996-1997] == Doesn't show all kits. Just the third and on top of the screen [[User:Madive60|Madive60]] ([[User talk:Madive60|talk]]) 01:29, 1 May 2026 (UTC) :This is probably fixed by the fix to {{phab|T425056}} and the current CSS workaround on-wiki. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:22, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%9B%BD%E6%97%97%E3%81%AE%E4%B8%80%E8%A6%A7&oldid=109342678&useparsoid=1 jawiki:国旗の一覧] == イラクの国旗がない [[User:平舞|平舞]] ([[User talk:平舞|talk]]) 03:17, 1 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:21, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Manting_Chan&oldid=1351960413&useparsoid=1 enwiki:Manting Chan] == Divorce, she is not divorced. [[User:Bananahammock311911511|Bananahammock311911511]] ([[User talk:Bananahammock311911511|talk]]) 04:54, 1 May 2026 (UTC) :Content issue, not a Parsoid issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 07:30, 1 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E9%9B%B7%E9%96%80%E9%9F%B3%E5%8A%A9&oldid=109345108&useparsoid=1 jawiki:雷門音助] == {{人名の曖昧さ回避}}や{{aimai}}を貼ると表示が崩れる。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 07:27, 1 May 2026 (UTC) :<nowiki>[[:jawiki:雷門五郎]]</nowiki>でも同様の問題が起きています。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 09:09, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Iceman_(Drake_album)&oldid=1350717409&useparsoid=1 enwiki:Talk:Iceman (Drake album)] == Banners showing up on mobile, not under “learn more about this page button” [[User:OrbitalVoid49|OrbitalVoid49]] ([[User talk:OrbitalVoid49|talk]]) 09:36, 1 May 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Bancu,_Harghita&oldid=13617293&useparsoid=1 rowiki:Bancu, Harghita] == Steagulnjudetului Hargita nu este acea cârpă secuiasca. [[User:Auto 4115|Auto 4115]] ([[User talk:Auto 4115|talk]]) 01:39, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Aurangabad&oldid=1351274322&useparsoid=1 enwiki:Aurangabad] == It has the old name of the city as it's title [[User:20mphwind|20mphwind]] ([[User talk:20mphwind|talk]]) 07:09, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%B9%E0%A6%BE%E0%A6%9C%E0%A6%B0%E0%A6%BE%E0%A6%AC%E0%A6%BE%E0%A6%A1%E0%A6%BC%E0%A7%80_%E0%A6%89%E0%A6%9A%E0%A7%8D%E0%A6%9A_%E0%A6%AC%E0%A6%BF%E0%A6%A6%E0%A7%8D%E0%A6%AF%E0%A6%BE%E0%A6%B2%E0%A6%AF%E0%A6%BC&oldid=8874755&useparsoid=1 bnwiki:হাজরাবাড়ী উচ্চ বিদ্যালয়] == তথ্যসুত্র ব্যয়বহুল নয়। [[User:Md Umor Faruk 2010|Md Umor Faruk 2010]] ([[User talk:Md Umor Faruk 2010|talk]]) 08:00, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=She_Did_It_Again&oldid=1352147079&useparsoid=1 enwiki:She Did It Again] == (Mobile) Huge error in hlist. Bullet points (•) are missing, and the items listed are arranged very roughly. Not sure why this error occurs for over three days. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 10:45, 2 May 2026 (UTC) :Thank you for the report - I have filed {{phab|T425245}} for this issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:30, 3 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%91%E4%B8%8A%E5%93%B2&oldid=109361964&useparsoid=1 jawiki:村上哲] == [[Template:循環参照]]が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:13, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=Wikipedia:%E4%BA%95%E6%88%B8%E7%AB%AF&oldid=109349724&useparsoid=1 jawiki:Wikipedia:井戸端] == 目次が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1 enwiki:Wiki (disambiguation)] == [[w:en:tm:dab]] (at the bottom of the page) appears to render differently on Parsoid compared to non-Parsoid. <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 14:27, 2 May 2026 (UTC) :Also appears to render differently on desktop Parsoid v. mobile Parsoid -- compare https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=mobile (different rendering) vs. https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=desktop ('expected' rendering, AFAIK) <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 16:34, 2 May 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Horv%C3%A1th_Kriszti%C3%A1n_(fest%C5%91,_1976,_Budapest)&oldid=28948319&useparsoid=1 huwiki:Horváth Krisztián (festő, 1976, Budapest)] == Az a probléma, hogy nem szeretném hoyg festő, és 1976 Budapest legyen hozzá kírva. Elrontottam, és nem tudtam külön, új cikket írni róla. [[User:Pizzsus|Pizzsus]] ([[User talk:Pizzsus|talk]]) 20:47, 2 May 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%99%D7%A6%D7%97%D7%A7_%D7%9E%D7%90%D7%99%D7%A8_%D7%90%D7%9C%D7%AA%D7%A8&oldid=43088529&useparsoid=1 hewiki:יצחק מאיר אלתר] == הציטוטים בכתב דיויד בעברית לקויים. Text quotes in David font are displayed poorly. [[User:פרידבערג|פרידבערג]] ([[User talk:פרידבערג|talk]]) 21:36, 2 May 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9B%D0%B8%D1%86%D0%B5%D0%BD%D0%B7%D0%B8%D0%B8_%D0%B8_%D0%B8%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B_Creative_Commons&oldid=152790052&useparsoid=1 ruwiki:Лицензии и инструменты Creative Commons] == refs don't work with vector-2010 (but it works for vector-2022) [[User:Petsernik|Petsernik]] ([[User talk:Petsernik|talk]]) 23:05, 2 May 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Huawei&oldid=173270512&useparsoid=1 eswiki:Huawei] == El segundo sitio web que sale no existe es un vandalismo en wikimedia ingles o un error [[User:Usuario 016|Usuario 016]] ([[User talk:Usuario 016|talk]]) 23:15, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%8C%97%E6%9D%91%E8%81%A1&oldid=109365307&useparsoid=1 jawiki:北村聡] == 人名の曖昧さ回避Templateを挿入すると、上手く表示されず、大きな改行空白と共に「.mw-parser-output .dmbox{display:flex;align-items:center;clear:both;margin:0.9em 1em;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:0.25em 0.35em;font-size:95%}.mw-parser-output .dmbox>*{flex-shrink:0;margin:0 0.25em;display:inline}.mw-parser-output .dmbox-body{flex-grow:1;flex-shrink:1;padding:0.1em 0}」 というものが出る。 [[User:Geogie|Geogie]] ([[User talk:Geogie|talk]]) 23:35, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=User:Soetermans&oldid=1225262591&useparsoid=1 enwiki:User:Soetermans] == He vandalized the pages [[User:Inkysponge2007|Inkysponge2007]] ([[User talk:Inkysponge2007|talk]]) 13:02, 3 May 2026 (UTC) c53ygqnxmja3xzif1wmduxb3izio8gy 8364345 8364343 2026-05-03T13:07:55Z Inkysponge2007 18367612 /* enwiki:User:Soetermans */ new section 8364345 wikitext text/x-wiki Post your feedback about using [[Parsoid/Parser Unification|Parsoid]] to render articles. [[Parsoid/Parser_Unification/Known_Issues|Learn how to report problems clearly]]. '''Need more attention? [https://phabricator.wikimedia.org/maniphest/task/edit/form/43/?projects=PHID-PROJ-3y2wduoz5xezwveaq426 Report directly in Phabricator].''' {{note|This is for reporting feedback on the integration of the Parsoid parser only. '''For wiki content issues, such as concerns about article content, please report on your local wiki.''' }} [[Parsoid/Parser_Unification/Known_Issues|View known issues]] __NEWSECTIONLINK__ {{Archive box| [[/Archive 1]] [[/Archive 2]]}} == [https://nl.wikipedia.org/w/index.php?title=Wikipedia:Aanmelding_moderatoren&oldid=70702688&useparsoid=1 nlwiki:Wikipedia:Aanmelding moderatoren] == Sometimes, in a numbered list, the number stays on the first line when there are indented lines below it, and sometimes the number is vertically aligned between the different lines. For votes, it is preferable that the number remains on the line that starts with only “#” and not on lines with an indentation “#:”. [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:34, 15 February 2026 (UTC) :i.e. see item 33. under '<nowiki/>'''''Voor moderatorschap ContextCreator'''<nowiki/>'<nowiki/>'' [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:36, 15 February 2026 (UTC) ::I can't see any difference between Parsoid and the legacy Parser on that page, it appears that the number is correctly aligned in both cases. Are you using a different skin by any chance? Does the difference still appear? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:42, 21 April 2026 (UTC) :::I see no difference anymore - it is fixed. Thanks anyway! [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 16:01, 21 April 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Discussion_Wikip%C3%A9dia:Wikiconcours&oldid=233327486&useformat=mobile&useparsoid=1 frwiki:Discussion Wikipédia:Wikiconcours] == Content that is hidden inside the "Learn more about this page" button from MobileFrontend with legacy parser is not inside it with Parsoid. [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 08:32, 22 February 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Laurence_Olivier&oldid=148833592&useparsoid=1 itwiki:Laurence Olivier] == Giant Oscar statue icons (sgranate) [[User:UmbraSolis|UmbraSolis]] ([[User talk:UmbraSolis|talk]]) 20:28, 19 February 2026 (UTC) :This was probably due to https://phabricator.wikimedia.org/T417828, which is now fixed. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:53, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:43, 21 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Bologna_Football_Club_1909&oldid=149496425&useparsoid=1 itwiki:Bologna Football Club 1909] == problem with displaying football shirts [[User:Gio Bike|Gio Bike]] ([[User talk:Gio Bike|talk]]) 17:49, 20 February 2026 (UTC) :Can you be more specific, or is it fixed now? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:55, 27 February 2026 (UTC) ::Now it is OK [[Special:Contributions/&#126;2026-13011-93|&#126;2026-13011-93]] ([[User talk:&#126;2026-13011-93|talk]]) 17:20, 27 February 2026 (UTC) :::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:44, 21 April 2026 (UTC) == [https://vi.wiktionary.org/w/index.php?title=Wiktionary:Th%E1%BB%91ng_k%C3%AA/S%E1%BB%91_m%E1%BB%A5c_t%E1%BB%AB_theo_ng%C3%B4n_ng%E1%BB%AF/T%E1%BA%A5t_c%E1%BA%A3&oldid=2331126&useparsoid=1 viwiktionary:Wiktionary:Thống kê/Số mục từ theo ngôn ngữ/Tất cả] == Phần cuối bảng bị lỗi, không hiện ra số mục từ mà chỉ hiện ra "0" hoặc "-2" mà không rõ lý do, tôi không viết nhầm gì cả. (English: The table got error, just display "0" or "-2", but I don't have any error at write wikitext.) [[User:NHNAnh|NHNAnh]] ([[User talk:NHNAnh|talk]]) 05:57, 21 February 2026 (UTC) :I believe this might be due to "Expensive parser function count: 1080/500" in the debug log: there are too many expensive parser function counts on this page (PAGESINCATEGORY is expensive), and the later functions are not executed. :I would suggest splitting the page into several pages, if possible. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:04, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) == [https://cs.wikipedia.org/w/index.php?title=Celerina/Schlarigna&oldid=25694456&useparsoid=1 cswiki:Celerina/Schlarigna] == V tabulce v sekci obyvatelstvo se u jedné buňky zobrazuje černé pozadí. Pokud dám ale historii stránky a podívám se na aktuální verzi, vykreslí se stránka správně. To samé se opakuje i u jiných podobných stránek se stejně formátovanými tabulkami. [[User:Matijak|Matijak]] ([[User talk:Matijak|talk]]) 17:02, 22 February 2026 (UTC) :I cannot see a black cell in that table. Is this issue fixed? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:09, 27 February 2026 (UTC) ::I can see it in in both the history (latest revision) and on the page itself (live). It's the leftmost 'Počet' cell in the 'Jazyky v Celerině' table. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 10:10, 28 February 2026 (UTC) :::Aha! :::the cell itself is not dark, the text in it is, and only in dark mode. It is also present in the legacy rendering, which seems to hint at a problem with the table markup itself and not a parser issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:11, 2 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) :::::Not a Parsoid issue most likely, but it has not been fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:21, 24 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia:Biographies_of_living_persons&oldid=1340299616&useparsoid=1 enwiki:Wikipedia:Biographies of living persons] == Reporting a visual bug for all pages that suddenly arose as of this morning on Safari Mobile - the Page Actions Overflow div is in a permanently open state but inaccessible to via clicks to either toggle the menu or select any of the tools on the menu. In addition to being unable to interact with it, all of the styling broken and makes the top right section of the page unusable and barely readable. [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 14:34, 27 February 2026 (UTC) :Is this issue still present? Sorry, it has been a while since you reported this, I'm hoping that the issue has been resolved by now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) ::Yes, it appears to have been resolved. Thanks for following up! [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 03:38, 22 April 2026 (UTC) == [https://oc.wikipedia.org/w/index.php?title=Esqu%C3%A8rra_(politica)&oldid=2495338&useparsoid=1 ocwiki:Esquèrra (politica)] == There's an issue with the interlinks, this article should be connected with the other ones about left-wing politics [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 06:39, 28 February 2026 (UTC) :Yes, it was an issue with the interlinks, but those should naturally not be reported as visual issues ('bogue visuler') as the have nothing to do with Parsoid. You can link pages which have no connections by using the 'Apondre los ligams interlengas' (Add interlanguage links) button from the 'Bóstia d'aisinas' (Tools) menu. Unless, of course, Parsoid somehow blocks automatic linking of translations. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:10, 28 February 2026 (UTC) ::I don't know why but it was finally done (thank you so much to the person who did that), but the thing is, i tried what you said before and it kept telling me that i didn't had the permission to link the two articles... [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 19:33, 1 March 2026 (UTC) :::I did that, you are welcome. It appears that you are not autoconfirmed yet on Wikidata, and that this Wikidata entry requires that, which if both true I would expect you to not be able to do this change. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 04:21, 21 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) :::::Sorry? [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:48, 23 April 2026 (UTC) ::::::We're using the <nowiki>{{done}}</nowiki> template to track which issues have been resolved, vs still outstanding. I don't believe there is any additional follow required by the Content Transform team on this report? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 05:00, 24 April 2026 (UTC) :::::::Oh, no, I just didn't know this is a system you are using. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:19, 24 April 2026 (UTC) == [https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/Page_translation_administration&oldid=8240537&useparsoid=1 Help:Extension:Translate/Page translation administration] == The topmost warning in the 'Changing the source text' section does not display the codeblock content. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:47, 28 February 2026 (UTC) :This is a very clever use of the <code><nowiki>{{^(}}</nowiki></code> template to avoid creating an unintended translation marker. I've [https://www.mediawiki.org/w/index.php?title=Help%3AExtension%3ATranslate%2FPage_translation_administration&diff=8349012&oldid=8343860 replaced it with more straight-forward entity-escaping] to be more compatible with Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:54, 21 April 2026 (UTC) ::Also filed this as [[phab:T424066]] [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 16:46, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&oldid=67999951&useparsoid=1 nlwiki:Railterminal Gelderland] == The map in [[:nl:sjabloon:maplink]] doesn't show up in my Chrome browser for Chromebook. It does show in https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&useparsoid=0 and also when I log out. [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:54, 5 March 2026 (UTC) :Btw, the map is visible for a moment, then it disappears [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:56, 5 March 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%91%D7%A8%D7%90%D7%95%D7%9C_%D7%A1%D7%98%D7%90%D7%A8%D7%A1&oldid=42870396&useparsoid=1 hewiki:בראול סטארס] == למה הקישור לתמונה ששמתי לא עובד? בכל מקרה אשמח שמישהו ישים את התמונה העדכנית שמשומשת בדף באנגלית מאחר והלוגו למשחק שונה. מצטער על התקלה. [[User:Jhho48|Jhho48]] ([[User talk:Jhho48|talk]]) 16:43, 9 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Infokastis: Sulamistemperatuur 236,15 K (−37 °C) Miinusmärk peaks olema sidekriipsust pikem, kuid pikema kriipsu sisestamine põhjustab tõrketeate. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:05, 11 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Vabandust, lühike (st vale) kriips oli kuvatud siiski ainult lähteteksti režiimis; salvestatud tekstiga küljendis on kuvatud õige kriips. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:07, 11 March 2026 (UTC) == kowiki:sticky header is broken == [[:en:Template:Sticky header|Template:Sticky header]] is not working properly on kowiki. Please compare [//ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=0] with [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=1].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:34, 16 March 2026 (UTC) :It may have been because of an empty row before the table caption. I [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&diff=41501849&oldid=41501840 edited the page] to remove it. But, looks like another editor has removed the sticky header template call from above the table. If you can put it back, it will work. See my [[:ko:사용자:SSastry_(WMF)/Sandbox|sandbox]] page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 03:22, 17 March 2026 (UTC) == [https://ko.wikipedia.org/w/index.php?title=%ED%8B%80:%EA%B5%AD%EA%B8%B0%EB%82%98%EB%9D%BC&oldid=40992836&useparsoid=1 kowiki:틀:국기나라] == 변수를 덧붙였음에도 {{국기나라|독일|제국}}이 여전히 '독일'로 출력됩니다. [[User:Triican|Triican]] ([[User talk:Triican|talk]]) 05:04, 19 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Angus_T._Jones&oldid=1333447723&useparsoid=1 enwiki:Angus T. Jones] == The infobox photo is squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 17:11, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Ukraine&oldid=1343921679&useparsoid=1 enwiki:Ukraine] == All maps in the infobox are squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 18:36, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Sabia_que&oldid=54991313&useparsoid=1 ptwiki:Wikipédia:Sabia que] == O arquivo de discussão está 'bugando' visualmente. Está no meio de "Curiosidades em destaque" [[User:Heylenny|Heylenny]] ([[User talk:Heylenny|talk]]) 23:27, 19 March 2026 (UTC) :{{done}} Template adjusted on the page. [[User:Fúlvio|Fúlvio]] ([[User talk:Fúlvio|talk]]) 02:59, 22 March 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%AC%E0%A6%BF%E0%A6%AE%E0%A6%B2_%E0%A6%98%E0%A7%8B%E0%A6%B7_(%E0%A6%B6%E0%A6%BF%E0%A6%B6%E0%A7%81%E0%A6%B8%E0%A6%BE%E0%A6%B9%E0%A6%BF%E0%A6%A4%E0%A7%8D%E0%A6%AF%E0%A6%BF%E0%A6%95)&oldid=8851768&useparsoid=1 bnwiki:বিমল ঘোষ (শিশুসাহিত্যিক)] == আলোচনা পাতায় অন্য নিবন্ধের আলোচনা পাতা [[User:Ams riyad|Ams riyad]] ([[User talk:Ams riyad|talk]]) 01:28, 20 March 2026 (UTC) == [https://vi.wikipedia.org/w/index.php?title=Wikipedia:Th%E1%BA%A3o_lu%E1%BA%ADn&oldid=74869958&useparsoid=1 viwiki:Wikipedia:Thảo luận] == TOC is rendered inside the link bar, but it shouldn't be. [[User:NguoiDungKhongDinhDanh|<span class="skin-invert" style="color:black;font-family:Monotype Corsiva;font-size:110%;font-weight:normal;line-height:normal">NguoiDungKhongDinhDanh</span>]] 03:20, 20 March 2026 (UTC) :This was most likely [[phab:T421629|T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] and we believe this issue has been fixed. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:51, 24 April 2026 (UTC) == [[wikt:ru:омфал]] == For more than a day, there have been anomalies in the behavior of tables of contents (ToCs) in Russian Wiktionary. The issues differ based on the selected skin and affect only some pages. If the old Vector theme is used, the automatically generated ToC simply fails to appear on certain pages, despite the page having over three headers and the absence of magic words such as NOTOC. If the new Vector theme is used, the ToC on some pages is misplaced and not positioned where it should be by default. The problem is not present if the old parser is used. Purging the page's cache seems to fix the issue as well. ToC is displayed correctly in the preview-mode too. Some affected pages: * [[wikt:ru:омфал]] * [[wikt:ru:безграмотность]] * [[wikt:ru:હંમેશા]] * [[wikt:ru:ಯಾವಾಗಲೂ]] * [[wikt:ru:stadigvæk]] * [[wikt:ru:alligevel]] * [[wikt:ru:kanunay]] * [[wikt:ru:ሁሌ]] * [[wikt:ru:zawżdy]] * and maaany mooore... [[User:綿貫桜哉|綿貫桜哉]] ([[User talk:綿貫桜哉|talk]]) 08:11, 20 March 2026 (UTC) :This was [[phab:T421629|⚓ T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] but should be fixed now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:55, 24 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Louis_Nirenberg&oldid=15616502&useparsoid=1 rowiki:Louis Nirenberg] == The image seems to be the 250px thumbnail scaled up to what looks like 400px width. [[User:Andrei Stroe|Andrei Stroe]] ([[User talk:Andrei Stroe|talk]]) 10:16, 20 March 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Aide:Accueil&oldid=232433495&useparsoid=1 frwiki:Aide:Accueil] == custom collapsible elements render differently with parsoid [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 14:19, 20 March 2026 (UTC) :I filed https://phabricator.wikimedia.org/T421859. Thanks for the report. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:07, 31 March 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Katten_(olika_betydelser)&oldid=43770842&useparsoid=1 svwiki:Katten (olika betydelser)] == The legacy parser adds an empty line before the template Förgrening (which is a kind of table). The Parsoid parser don't do that. This occurs on all pages using that template. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 18:32, 21 March 2026 (UTC) :Ya, this is known difference with some paragraph wrapping which is tricky to fix. In this case, I recommend adjusting the top margin of the table by editing the base template: https://sv.wikipedia.org/w/index.php?title=Mall%3AF%C3%B6rgrening%20bas&veaction=editsource [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:01, 31 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Gen_Z_stare&oldid=1344701043&useparsoid=1 enwiki:Gen Z stare] == The infobox image is unusually narrow. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 01:51, 22 March 2026 (UTC) :For me the image is stretched horizontally by a fair bit. It seems like the following bit of code is to blame: :<syntaxhighlight lang="css"> :html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img {width: 400px; } :</syntaxhighlight> [[User:Sohom Datta|Sohom]] ([[User talk:Sohom Datta|talk]]) 01:54, 22 March 2026 (UTC) ::I'm not seeing any visible difference between legacy parser and Parsoid in my testing. Can you share a screenshot @[[User:Snowmanonahoe|Snowmanonahoe]] ? What skin and browser are you using? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 17:43, 27 March 2026 (UTC) :::@[[User:Jon (WMF)|Jon (WMF)]]: I don't see it anymore either. I'm using Vector 2022 and Firefox 149. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 17:46, 27 March 2026 (UTC) ::::Ah okay. I think this was a caching issue then. Some "temporary turbulence" was to be expected with this roll out. Thanks for reporting! [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 18:29, 27 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Virginia_Fonseca&oldid=71959182&useparsoid=1 ptwiki:Virginia Fonseca] == A 1ª imagem da página na infocaixa tem um tamanho grande demais [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 11:34, 22 March 2026 (UTC) :I don't see the problem. The page renders identically in Parsoid and with the old/legacy parser. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:22, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Xander_Harris&oldid=71958675&useparsoid=1 ptwiki:Xander Harris] == Seção de referências expandida [[User:Vitruviano|Vitruviano]] ([[User talk:Vitruviano|talk]]) 15:06, 22 March 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Bruker:Znuddel&oldid=25704667&useparsoid=1 nowiki:Bruker:Znuddel] == Hele siden er helt feil [[User:Nevemagneten|Nevemagneten]] ([[User talk:Nevemagneten|talk]]) 20:35, 24 March 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Main_page&oldid=2122&useparsoid=1 abstractwiki:Abstract Wikipedia:Main page] == Favicon is showing a dark background around the rounded corners on Chrome. [[User:Jsengupt|Jsengupt]] ([[User talk:Jsengupt|talk]]) 16:14, 25 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=System_(typeface)&oldid=1329545007&useparsoid=1 enwiki:System (typeface)] == Infobox image is stretched horizontally [[User:Anna328p|Anna328p]] ([[User talk:Anna328p|talk]]) 06:59, 26 March 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Enged%C3%A9lyk%C3%A9r%C3%A9s&oldid=28288240&useparsoid=1 huwiki:Wikipédia:Engedélykérés] == The email templates are rendered incorrectly. [[User:Bencemac|Bencemac]] ([[User talk:Bencemac|talk]]) 14:00, 26 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T421563 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:19, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Usu%C3%A1rio(a):Inter-rede/Cabe%C3%A7alho&oldid=71778331&useparsoid=1 ptwiki:Usuário(a):Inter-rede/Cabeçalho] == Whitespaces seem to have collapsed [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 18:02, 27 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422155 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:36, 2 April 2026 (UTC) ::It looks like the problem is the <code>display:flex</code> in the <code>style</code> attribute on the wrapper is at fault. Parsoid generates <code><nowiki><span></nowiki></code> wrappers around the html entities in the wikitext, by design. The whitespace is present in the HTML, so that's not a fault of Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:07, 9 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%91%D7%A6%D7%A2_%D7%9E%D7%A9%D7%94_(%D7%9E%D7%9C%D7%97%D7%9E%D7%AA_%D7%94%D7%A2%D7%A6%D7%9E%D7%90%D7%95%D7%AA)&oldid=42991233&useparsoid=1 hewiki:מבצע משה (מלחמת העצמאות)] == הכיתוב שנועד למנוע בלבול בין מבצע משה הזה למבצע משה אחר לא ערוך [[User:חנניה בלסמן|חנניה בלסמן]] ([[User talk:חנניה בלסמן|talk]]) 12:54, 30 March 2026 (UTC) == [//en.wikipedia.org/w/index.php?title=Help:Colon_trick&useparsoid=1 enwiki:Help:Colon trick] == According to [[w:Help:Colon trick]], it is explained as follows: "<code><nowiki>[[//Hus]]</nowiki></code> will produce an (invalid) external link wrapped in brackets ("[[//Hus]]"), but <code><nowiki>[[://Hus]]</nowiki></code> will produce a link to [[w://Hus|//Hus]]." However, when using Parsoid, it incorrectly links to [[w:Help:Colon trick//Hus|Help:Colon trick//Hus]].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:02, 31 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422161 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 14:00, 2 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Ans%C3%B6kan_om_administrativ_beh%C3%B6righet&oldid=59167563&useparsoid=1 svwiki:Wikipedia:Ansökan om administrativ behörighet] == In Legacy, each section (candidate) get a [redigera] ([edit] to the right of the section name. In Parsoid, there is nothing to the right of the section name. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 12:15, 2 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T391624 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:27, 2 April 2026 (UTC) == [https://en.wiktionary.org/w/index.php?title=H%26P&oldid=83856321&useparsoid=1 enwiktionary:H&P] == The first hidden category listed is [[wiktionary:Category:English_entries_with_incorrect_language_header|English entries with incorrect language header]]'','' which is, however, empty. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:48, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Jo%C3%A3o_Peixoto&oldid=72016744&useparsoid=1 ptwiki:João Peixoto] == A foto não corresponde ao nome citado [[User:Mayque Lemos|Mayque Lemos]] ([[User talk:Mayque Lemos|talk]]) 18:18, 2 April 2026 (UTC) == [https://meta.wikimedia.org/w/index.php?title=Main_Page&oldid=30254797&useparsoid=1 metawiki:Main Page] == On Parsoid only, <nowiki>''complete list'' and ''request''</nowiki> each show a space between them and their preceding opening bracket. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 19:06, 3 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&oldid=1343194045&useparsoid=1 enwiki:In Stars and Time] == <code>&lt;ref name="rps"&gt;</code> displays an error which doesn’t occur on the legacy parser [[User:Mir Novov|Mir Novov]] ([[User talk:Mir Novov|talk]]) 12:10, 4 April 2026 (UTC) :It was an error which I fixed with [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&diff=1348021667&oldid=1347424445 this edit] which adds one more backlink to Ref #5. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:00, 10 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Helen_Andrews&oldid=72024590&useparsoid=1 ptwiki:Helen Andrews] == Estou a ter problema com as referências, pois aparecem duplicadas. [[User:Faviola7|Faviola7]] ([[User talk:Faviola7|talk]]) 14:17, 4 April 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Project_chat&oldid=3236&useparsoid=1 abstractwiki:Abstract Wikipedia:Project chat] == In the "Bot request" section, a link that has been visited is blue rather than purple, because spaces in the link are turned into actual spaces (%20) in the URL. [[User:JJPMaster|JJP]]<sub>[[User talk:JJPMaster|Mas]]<sub>[[Special:Contributions/JJPMaster|ter]]</sub></sub> ([[wikt:she|she]]/[[wikt:they|they]]) 21:53, 4 April 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Tor_Fosse_(f%C3%B8dt_1956)&oldid=25723619&useparsoid=1 nowiki:Tor Fosse (født 1956)] == fil: center frameless [[User:Birgit.H.Pihl|Birgit.H.Pihl]] ([[User talk:Birgit.H.Pihl|talk]]) 10:05, 5 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Politisk_opposition&oldid=59171124&useparsoid=1 svwiki:Politisk opposition] == This error message about unused named reference is not shown: Referensfel: <ref>-tagg med namn "sr-20161006", definierad i <references> används inte tidigare i texten. The article is also added to hidden category "Sidor med referensfel" but that is not shown [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:12, 5 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Puteulum/Sandbox&oldid=150100596&useparsoid=1 itwiki:Utente:Puteulum/Sandbox] == The "Move" button to move the entry from sandbox to NS0 does not appear [[User:Puteulum|Puteulum]] ([[User talk:Puteulum|talk]]) 14:28, 7 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=POVOADO_TIRIRICAL&oldid=72040530&useparsoid=1 ptwiki:POVOADO TIRIRICAL] == O MEU TEXTO ESTA TODO VERMELHO E MAIS CENTRALIZADO [[User:POVOADO TIRIRICAL|POVOADO TIRIRICAL]] ([[User talk:POVOADO TIRIRICAL|talk]]) 18:38, 7 April 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%B1%E4%BA%AC%E9%83%BD%E9%81%935%E5%8F%B7%E6%96%B0%E5%AE%BF%E9%9D%92%E6%A2%85%E7%B7%9A&oldid=108985336&useparsoid=1 jawiki:東京都道5号新宿青梅線] == ヘッダー付近に編集ミスと思われし文言あり [[User:QWERTYKeyboard0570|QWERTYKeyboard0570]] ([[User talk:QWERTYKeyboard0570|talk]]) 08:56, 8 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=2022_Oder_environmental_disaster&oldid=1344570432&useparsoid=1 enwiki:2022 Oder environmental disaster] == After a second, the actual map from the infobox (not the buttons) is replaced with a placeholder icon and text (clicking in the field still works). [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 11:56, 8 April 2026 (UTC) :Could it have been a transient issue? I cannot reproduce this right now. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:03, 10 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Commissione_arbitrale/Domande&oldid=150049601&useparsoid=1 itwiki:Wikipedia:Commissione arbitrale/Domande] == This page is related to the itwiki ArbCom election. Section edit links were not shown, making it difficult to ask questions to candidates. This has since been worked around with [[:it:special:diff/150118322|this edit]] and is likely related to [[phab:T387520|T387520]]. [[User:Titore|Titore]] ([[User talk:Titore|talk]]) 19:58, 8 April 2026 (UTC) :Thanks for this report. This is on our list of high priority tasks to fix and we are going to pick up shortly. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:53, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Kurier&oldid=266019405&useparsoid=1 dewiki:Wikipedia:Kurier] == das Diagramm zum Beitrag "Ein Wal ..." überragt den Text der rechten Spalte. [[User:Michael w|Michael w]] ([[User talk:Michael w|talk]]) 08:10, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034&useparsoid=1 dewiki:Wikipedia:Fragen zur Wikipedia] == <nowiki>& s h y ;</nowiki> is ignored. See the test on https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034#&_s_h_y_; [[User:Raymond|Raymond]] ([[User talk:Raymond|talk]]) 09:55, 10 April 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422960 for this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:55, 10 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Faktafr%C3%A5gor&oldid=59190040&useparsoid=1 svwiki:Wikipedia:Faktafrågor] == Svara-funktionen fungerar inte med Parsoid. När jag klickar på Svara för något inlägg, vilket som helst, dyker svarsrutan upp längst ner på sidan, efter den senaste diskussionstråden. Med den äldre parsern fungerar det. [[User:Larske|Larske]] ([[User talk:Larske|talk]]) 11:12, 10 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Cornelis_de_Bruijn_Martinuszoon&oldid=70921577&useparsoid=1 nlwiki:Cornelis de Bruijn Martinuszoon] == De pagina-afbeelding is de handtekening van C. de Bruijn Mz. Ik denk dat zijn afbeelding in de spotprent een betere pagina-afbeelding is. Het zou kunnen dat Parsoid/Wikipedia deze niet 'pakt' omdat de dimensies tijdens een eerdere bewerking zijn aangepast. Alvast bedankt! [[User:Jelledebruijn|Jelledebruijn]] ([[User talk:Jelledebruijn|talk]]) 16:31, 10 April 2026 (UTC) :I think you might have seen a version of the page before the cache was updated. I just checked and the image is identical with Parsoid and the older parse. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:46, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=The_Punisher_(2004)&oldid=263259949&useparsoid=1 dewiki:The Punisher (2004)] == Dead link template Vorlage:Toter Link (https://de.wikipedia.org/wiki/Vorlage:Toter_Link) after url is no longer working but gets part of the Link. (example https://de.wikipedia.org/wiki/The_Punisher_(2004)#cite_note-5 ) [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:23, 10 April 2026 (UTC) :Example without Parsoid: https://de.wikipedia.org/wiki/The_Punisher_(2004)?useparsoid=0#cite_note-5 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:57, 10 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T368724 but ideally, the template will be added with a space after the link. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:24, 11 April 2026 (UTC) ::Unfortunately it's added by the InternetArchiveBot that way: https://de.wikipedia.org/w/index.php?title=Liste_aktiver_Brauereien_in_Deutschland&diff=prev&oldid=265857281 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 06:45, 11 April 2026 (UTC) :::@[[User:SSastry (WMF)|SSastry (WMF)]]: But it is not good if the preview shows us a different result than the version that is subsequently published. InternetArchiveBot inserts it without spaces. The task is prioritized as Low, but since we have this thousands of times in the article inventory (and it used to work before), the task should be reprioritized to Higher. And the preview should always show the same result that I get after publishing. What do we do with the Phab task now? How do we handle this bug? Thank you, [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 09:12, 11 April 2026 (UTC) ::::We will fix the preview path separately. But, for this specifically, I'll flag this for the team to see how we want to handle this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:33, 11 April 2026 (UTC) :::::@[[User:SSastry (WMF)|SSastry (WMF)]]: Oh thank you, keep us up to date here please. [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 16:35, 11 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Marlon_Ganchozo&oldid=172919968&useparsoid=1 eswiki:Marlon Ganchozo] == No sale el resto de la información del, jugador [[User:Didierlpz06|Didierlpz06]] ([[User talk:Didierlpz06|talk]]) 19:04, 10 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 eswiki:Temporada regular de la Euroliga 2025-26] == no se sustituyen correctamente las ultimas plantillas [[User:Hugogs02|Hugogs02]] ([[User talk:Hugogs02|talk]]) 08:42, 11 April 2026 (UTC) :This page is too large post-template expansion. Observe that the templates at the end are not expanded neither in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 Parsoid] nor in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=0 Legacy]; the legacy parser just happens to expand a few more at the end of the page due to [https://phabricator.wikimedia.org/T392262 T392262]. The page should probably be split. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:13, 13 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Uniforme_de_la_selecci%C3%B3n_de_f%C3%BAtbol_de_Argentina&oldid=172883243&useparsoid=1 eswiki:Uniforme de la selección de fútbol de Argentina] == En la plantilla de uniforme de fútbol algunos uniformes se ven con las mangas más bajas respecto al archivo del cuerpo, dejando lineas de un pixel por encima con los colores de fondo en dicha plantilla. [[User:Lobo kun mfc|Lobo kun mfc]] ([[User talk:Lobo kun mfc|talk]]) 13:58, 11 April 2026 (UTC) :The lines displayed on top of the uniforms are present both in Parsoid and in the Legacy parser, and they do seem to vary slightly depending on the browser (I've looked on Firefox and Chrome, both on Linux, and they were not consistent between both browsers). :I believe this issue should be fixed on the template side (at a guess, the <code>style="color: inherit; background-color:#000040;"</code> that I see on the various image divs may well show up depending on the exact HTML structure and/or image) [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:23, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Liste_der_Radschnellverbindungen_in_Deutschland&oldid=266034807&useparsoid=1 dewiki:Liste der Radschnellverbindungen in Deutschland] == Hallo, beim Artikel [[Liste der Radschnellverbindungen in Deutschland]] wird die Beschreibung der MapLink-Karte wird nicht gescheid gerendert. Statt einem hochgestellten <code>[7]</code> wird <code>Karte der bestehenden Radschnellwege in Deutschland'"`UNIQ--ref-00000008-QINU`"'</code> gerendert. Das Problem ist serverseitig und tritt beim Legacy-Parser nicht auf. LG [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 16:02, 11 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T383004 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:06, 11 April 2026 (UTC) ::thanks! [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 14:13, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Louis_Franchet_d%E2%80%99Esp%C3%A8rey&oldid=266076416&useparsoid=1 dewiki:Louis Franchet d’Espèrey] == Bildumfluss nicht wie üblich [[User:Alfred Kiefer|Alfred Kiefer]] ([[User talk:Alfred Kiefer|talk]]) 19:30, 11 April 2026 (UTC) :This issue has been fixed in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1269534 and should be deployed to production this week. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:34, 13 April 2026 (UTC) == [https://bn.wiktionary.org/w/index.php?title=%E0%A6%AA%E0%A7%8D%E0%A6%B0%E0%A6%A7%E0%A6%BE%E0%A6%A8_%E0%A6%AA%E0%A6%BE%E0%A6%A4%E0%A6%BE&oldid=250894&useparsoid=1 bnwiktionary:প্রধান পাতা] == The ‘ শব্দছবি’ section is overflowing with Parsoid; thus does not happen when the legacy parser is used. [[User:Redmin|Redmin]] ([[User talk:Redmin|talk]]) 08:09, 12 April 2026 (UTC) :Since the section seems to be randomized, it's pretty hard to see which version of this section is overflowing (the ones I see do not seem to). Would you be able to provide more information/a screenshot? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:49, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Hamburg&oldid=266087257&useparsoid=1 dewiki:Wikipedia:Hamburg] == Abschnittsbearbeitungen nicht mehr möglich, Link fehlt. Betrifft einige WP-Seiten wie auch [[:de:Wikipedia:Stammtisch München]] oder auch nur einige Überschriften von [[:de:Vorlage:Coordinate]], also nicht immer komplette Seiten. [[User:NordNordWest|NordNordWest]] ([[User talk:NordNordWest|talk]]) 12:12, 12 April 2026 (UTC) :We have a number of issues with section edit links (documented in https://phabricator.wikimedia.org/T391624) that we intend to fix; sorry for the inconvenience - we'll make sure to keep this use case in mind when working on a solution. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:20, 23 April 2026 (UTC) == [https://zh.wikipedia.org/w/index.php?title=COBOL&oldid=91149855&useparsoid=1 zhwiki:COBOL] == 正文开头的“COBOL”英文名无法显示,且全文的繁简转换失效。 The English name "COBOL" for COBOL at the very beginning vanished. Besides, the conversion between traditional and simplified Chinese does not function for the entire page. [[User:Ricky136973|Ricky136973]] ([[User talk:Ricky136973|talk]]) 13:08, 12 April 2026 (UTC) :Parsoid should not (yet) be enabled on zhwiki. If you want to preview how it will work, you can add <code>&parsoidnewlc=1</code> to the end of the URL to use Parsoid's implementation of LanguageConverter. That shows "COBOL" on this page as expected. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:17, 13 April 2026 (UTC) ::Parsoid is now experimentally enabled, so you don't need the `&parsoidnewlc=1` at the end of the URL any more. It appears that the COBOL page renders correctly now? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:40, 21 April 2026 (UTC) == [https://th.wikipedia.org/w/index.php?title=4_%E0%B9%80%E0%B8%97%E0%B8%9E%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B8%9E%E0%B8%B4%E0%B8%97%E0%B8%B1%E0%B8%81%E0%B8%A9%E0%B9%8C&oldid=12947833&useparsoid=1 thwiki:4 เทพผู้พิทักษ์] == อันนี้น่าจะผิดที่ร้องเพลงประกอบละคร [[User:ภรพัฒน์|ภรพัฒน์]] ([[User talk:ภรพัฒน์|talk]]) 12:47, 13 April 2026 (UTC) :Google translate says, "This is probably a mistake—singing the theme song for a TV drama." :This seems like a content issue, not a Parsoid issue. Mistakes in content should be correctly directly on the wiki. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:47, 21 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:%D7%A9%D7%A8%D7%A9%D7%97%D7%95%D7%9F/%D7%98%D7%99%D7%95%D7%98%D7%94&oldid=42822143&useparsoid=1 hewiki:משתמש:שרשחון/טיוטה] == אני רוצה לבטל את המצאות השם יעל סרלין בדף הטיוטות שלי כדי להתחיל ערך חדש [[User:שרשחון|שרשחון]] ([[User talk:שרשחון|talk]]) 12:59, 13 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Acidente_radiol%C3%B3gico_de_Goi%C3%A2nia&oldid=72061996&useparsoid=1 ptwiki:Acidente radiológico de Goiânia] == [[File:Captura_de_tela_de_miniaturas_renderizadas_pelo_Parsoid.png|thumb|250x250px]] As miniaturas estão minúsculas com as margens enormes. [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 15:13, 13 April 2026 (UTC) :It seems to be like this due to :<pre>html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img[width="250"] { width: calc(round(400px * var(--mw-file-upright,1),10px)) }</pre> [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 17:48, 19 April 2026 (UTC) ::{{Tracked|T423676}} [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) ::This should have been fixed by a backport we did yesterday. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:48, 21 April 2026 (UTC) == [https://hr.wikipedia.org/w/index.php?title=Marijana_Bijeli%C4%87&oldid=7429126&useparsoid=1 hrwiki:Marijana Bijelić] == Sve je podvuceno a ne treba tako biti [[User:Nikolica1512|Nikolica1512]] ([[User talk:Nikolica1512|talk]]) 17:08, 13 April 2026 (UTC) :I made some edits for you [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 18:32, 13 April 2026 (UTC) ::Thank you, I ameliorated those problematic parts, could you take a look at it? I hope it is good to go now as an article on wikipedia so people could access it. This person deserves to have a wiki page. ::Regards, [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 21:53, 13 April 2026 (UTC) :::Sorry, no. I was only helping with the syntax error. You'll need to take your request to the hrwiki community [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 22:25, 13 April 2026 (UTC) ::::And how do I do that exactly? Could you help me out with it? [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 22:56, 13 April 2026 (UTC) :::::You can ask on [[:hr:Wikipedija:Kafić]] and I'm sure someone there will help you out [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 00:34, 14 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 dewiki:Hilfe:Parserfunktionen] == Headings which use <code><nowiki><includeonly></nowiki></code> to change nesting level when transcluded don't appear as headings on original page [[User:TheFirstLevelDown|TheFirstLevelDown]] ([[User talk:TheFirstLevelDown|talk]]) 00:01, 14 April 2026 (UTC) :Parsoid does not support gluing heading together like the legacy parser did, so this syntax is not supported. :As an alternative, we suggest something like (to adjust depending on your exact use case) :<syntaxhighlight lang="wikitext"> <includeonly>===== title =====</includeonly> <noinclude>=== title ===</noinclude> </syntaxhighlight> :or, for a less robust version (but that doesn't require repeating the title) :<syntaxhighlight lang="wikitext"> <includeonly>=====</includeonly><noinclude>===</noinclude> title <includeonly>=====</includeonly><noinclude>===</noinclude> </syntaxhighlight> [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 12:45, 14 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Amor_eterno_una_tragedia_anunciada&oldid=172974810&useparsoid=1 eswiki:Amor eterno una tragedia anunciada] == el título de la página está como "Amor eterno una tragedia anunciada" y no deja cambiarlo al original que es "Amor Eterno: Una tragedia anunciada" [[User:Goodfriendspictures|Goodfriendspictures]] ([[User talk:Goodfriendspictures|talk]]) 09:59, 14 April 2026 (UTC) :To me it looks like the [[DISPLAYTITLE]] magic word is disabled though {{wg|AllowDisplayTitle}} in eswiki. Nothing to do with Parsoid. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 10:12, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:TanjaKo/Sandbox&oldid=150217478&useparsoid=1 itwiki:Utente:TanjaKo/Sandbox] == Nel testo non sono presenti errori e le frasi sono sottolineate con una linea rossa ondulata. Come risolverlo visual bug? Grazie [[User:TanjaKo|TanjaKo]] ([[User talk:TanjaKo|talk]]) 17:42, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Raduni/Raduni_in_Sicilia_2026&oldid=150224594&useparsoid=1 itwiki:Wikipedia:Raduni/Raduni in Sicilia 2026] == just on iPhone 14 with iOS 18.7.7 both from safari or chrome and both from logged or unlogged and incognito mode, the last number of the participants list (made with "#") is bigger than the others [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 18:31, 15 April 2026 (UTC) == [https://atj.wikipedia.org/w/index.php?title=Otitikowin&oldid=16878&useparsoid=1 atjwiki:Otitikowin] == pas moyen de travailler en mode visuel sur la page [[User:Luc Patin|Luc Patin]] ([[User talk:Luc Patin|talk]]) 14:56, 16 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Zhang_Zeduan&oldid=173032341&useparsoid=1 eswiki:Zhang Zeduan] == La pagina está incompleta e inpublicable [[User:Mikemj1987|Mikemj1987]] ([[User talk:Mikemj1987|talk]]) 22:08, 17 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:08, 20 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=L%C3%ADnea_E3_(Euskotren_Trena)&oldid=173034070&useparsoid=1 eswiki:Línea E3 (Euskotren Trena)] == La imagen se ve un poco mal por el modo oscuro. [[User:UnniMan|UnniMan]] ([[User talk:UnniMan|talk]]) 00:55, 18 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:09, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Stadtbahn_Karlsruhe&oldid=265878452&useparsoid=1 dewiki:Stadtbahn Karlsruhe] == Shows reference error and the categoy Kategorie:Wikipedia:Seite mit Einzelnachweisfehlern but is not included in https://de.wikipedia.org/wiki/Kategorie:Wikipedia:Seite_mit_Einzelnachweisfehlern The same happens with other articles that had no reference errors with the old parser. Makes maintenance hard. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 09:26, 19 April 2026 (UTC) :Tracked in https://phabricator.wikimedia.org/T423924 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Indiana_Jones_and_the_Fate_of_Atlantis&oldid=265815741&useparsoid=1 dewiki:Indiana Jones and the Fate of Atlantis] == Shows a reference error that is not visible in the preview function. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:06, 19 April 2026 (UTC) :The error came through a Reference with the same name in a used template https://de.wikipedia.org/wiki/Vorlage:Verkaufszahlen_LucasArts_Adventures Still bad to have an error that wasn't there with the old parser and isn't shown in the preview or maintenance category. --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:27, 19 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Evento_Azolla&oldid=72103944&useparsoid=1 ptwiki:Evento Azolla] == [Convert: número inválido] na parte de Efeitos Globais [[User:Marina Funez|Marina Funez]] ([[User talk:Marina Funez|talk]]) 00:28, 20 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:10, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Musikk%C3%A1r&oldid=144140&useparsoid=1 smnwiki:Myenster:Musikkár] == Instead of dealing with this issue and the other issue on smnwiki listed below, these were quietly archived. These are still displaying messed up months later after they were reported the first time. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:53, 20 April 2026 (UTC) :We may have missed this previously, but edits like [https://smn.wikipedia.org/w/index.php?title=Myenster%3AMusikk%C3%A1r&diff=152826&oldid=144359 this] should fix the rendering. This should work for the other pages below as well. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 12:42, 20 April 2026 (UTC) ::Thank you. I'll do the same for any other templates I come across that display like that one did. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 15:49, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Diskografia&oldid=62663&useparsoid=1 smnwiki:Myenster:Diskografia] == Instead of dealing with this issue and the other issue on smnwiki listed above, these were quietly archived. These are still displaying messed up months later after they were reported the first time. -[[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Kirje%C4%8D%C3%A4llee&oldid=32928&useparsoid=1 smnwiki:Myenster:Kirječällee] == Like the other display issues in smnwiki, this is also displaying messed up after the change. [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. For all other pages you encounter on wiki like this, please make similar edits. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Donald_A._Wollheim&oldid=266357315&useparsoid=1 dewiki:Donald A. Wollheim] == Picture is shown within a big white box, which isn't the case with the old parser. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 11:15, 20 April 2026 (UTC) :[[phab:T421524]] [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe_Diskussion:Bilder&oldid=266370955&useparsoid=1 dewiki:Hilfe Diskussion:Bilder] == see [[w:de:Hilfe Diskussion:Bilder #Skalierung von Bildern mit dem Parameter hochkant scheint nicht mehr zu funktionieren]] [[User:BurghardRichter|BurghardRichter]] ([[User talk:BurghardRichter|talk]]) 22:24, 20 April 2026 (UTC) == [https://tcy.wikipedia.org/w/index.php?title=%E0%B2%AE%E0%B3%81%E0%B2%96%E0%B3%8D%E0%B2%AF_%E0%B2%AA%E0%B3%81%E0%B2%9F&oldid=359337&useparsoid=1 tcywiki:ಮುಖ್ಯ ಪುಟ] == in main page not enable <code>html.skin-theme-clientpref-night</code> [[User:ChiK|ChiK]] ([[User talk:ChiK|talk]]) 05:47, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:23, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == https://de.wikipedia.org/wiki/Gemeindestandsver%C3%A4nderungen_in_der_Schweiz == Die Links zu den Ankern gehen nicht [[Special:Contributions/&#126;2026-24437-27|&#126;2026-24437-27]] ([[User talk:&#126;2026-24437-27|talk]]) 11:53, 21 April 2026 (UTC) :I see you found a solution :) :For the exact issue: generating ids independently from their enclosing tag is not supported by Parsoid (although this is not documented - I'll fix that). :Thanks for the report! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:16, 21 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Albosaggia&oldid=50063504&useparsoid=1 svwiki:Albosaggia] == This article, and thousands of other articles, have erroneously been put in hidden categories [[:sv:Kategori:Sidor med referensfel]] and [[:sv:Kategori:Wikipedia:Projekt översätta källmallar]]. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 12:24, 21 April 2026 (UTC) :You can mark this issue as fixed. The problem root cause was in a new Template and Module created this morning. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:40, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Eurovision_Song_Contest_1992&oldid=258716277&useparsoid=1 dewiki:Eurovision Song Contest 1992] == Quelltext bearbeiten ist für Abschnitte nicht sichtbar [[User:Anmey10112|Anmey10112]] ([[User talk:Anmey10112|talk]]) 13:00, 21 April 2026 (UTC) :Translation: "Edit source" is not visible for sections. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Boro%C8%99e%C8%99ti,_Ia%C8%99i&oldid=17665231&useparsoid=1 rowiki:Boroșești, Iași] == Satul este Borosești nu Boroșești. [[User:Stalmada|Stalmada]] ([[User talk:Stalmada|talk]]) 13:07, 21 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:09, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Gebouwge%C3%AFntegreerde_zonnepanelen_(BIPV)&oldid=71021732&useparsoid=1 nlwiki:Gebouwgeïntegreerde zonnepanelen (BIPV)] == Bij de afbeeldingen zijn 3 afbeeldingen gecombineerd met de sjabloon {{Afbeelding combi}} . De sjabloon maakt gebruikt van elk aparte tekstvelden voor elke afbeeldingen. Echter is in dit geval bij de eerste twee afbeeldingen geen gebruik gemaakt van tekstveld en is al de tekst aan het eind geplaatst bij de laatste afbeelding. Door dit gebruik van de sjabloon worden de afbeeldingen zonder spatie direct na elkaar vertoont. Op de mobiele website worden de afbeeldingen met dit sjabloon wel met spaties vertoont. Merk op dat de engelse template wel de mogelijkheid heeft om afbeeldingen gecombineerd te laten zien met spaties er tussen en heeft deze variant template meer mogelijkheden dan de NL versie. Mogelijk dat er de uitwerkin ook niet helemaal correct is geweest, maar hierover is niet te oordelen vanwege de beperkte Wiki edit kennis. [[User:Public-Publicity|Public-Publicity]] ([[User talk:Public-Publicity|talk]]) 16:16, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:22, 21 April 2026 (UTC) :Translation: "In this section, three images have been combined using the template `Template:Afbeelding combi`. This template typically utilizes a separate text field for each individual image; however, in this specific instance, the text fields for the first two images were left unused, and all the accompanying text was instead placed at the end, alongside the final image. As a result of this specific application of the template, the images are displayed consecutively without any spacing between them. On the mobile version of the website, however, images utilizing this template *are* displayed with spacing. It is worth noting that the English-language version of this template *does* offer the capability to display combined images with spacing in between—making that variant of the template more versatile than its Dutch counterpart. It is possible that the implementation itself was not entirely correct; however, it is difficult to pass judgment on this matter due to limited expertise in Wiki editing." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:12, 23 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Talk:Rao_Laxmi_Chand&oldid=10828084&useparsoid=1 simplewiki:Talk:Rao Laxmi Chand] == This Page is fake and all the information is fake [[User:Rao Gourav|Rao Gourav]] ([[User talk:Rao Gourav|talk]]) 17:23, 21 April 2026 (UTC) :Triage: Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:28, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:07, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80%D0%BE%D0%B2%D1%81%D0%BA%D0%B8%D0%B9,_%D0%A1%D1%82%D0%B5%D0%BF%D0%B0%D0%BD_%D0%A4%D1%91%D0%B4%D0%BE%D1%80%D0%BE%D0%B2%D0%B8%D1%87&oldid=152793914&useparsoid=1 ruwiki:Александровский, Степан Фёдорович] == дублируется реф в инфобоксе [[User:Gleb95|Gleb95]] ([[User talk:Gleb95|talk]]) 20:21, 21 April 2026 (UTC) :Translation: "The reference is duplicated in the infobox." :The legacy parser version has 19 references in the references list, and Parsoid contains 22. This is likely a content issue, although I haven't looked into it to determine root cause. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:11, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is plenty of problems I see related to transliteration to Serbian Cyrillic. I prefer reading articles in Serbian Cyrillic (on top of our UI, I select "Ћирилица"). In current state, Parsoid should not be turned on at all on our Wikipedia {{multiple image | align = center | total_width = 1000 | image1 = Jefri Saks (no Parsoid).png | caption1 = Without Parsoid | image2 = Jefri Saks (Parsoid).png | caption2 = With Parsoid }} Note that, with Parsoid, everything is transliterated, even when marked with correct <nowiki><lang></nowiki> attribute. Without parsoid, original English text is correctly left un-transliterated. There is also a glitch where URL is not rendered in infoboxes, again, probably something about misrendering text which was supposed to avoid transliteration. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:43, 21 April 2026 (UTC) :This is [[phab:T424159|T424159 [P0] Parsoid doesn't "guessVariant" at top level on Serbian Wikipedia, and makes sr-ec rendering "unusable" for some pages]]. Fundamentally, the mark up on that page is incorrect, in so far as English and Latin text aren't properly marked with `-{....}-`. It "worked before" because of a top-level "guessVariant" routine which effectively disabled language converter entirely on some pages, including this one. I suspect I'm going to have to implement the same 'guessVariant' mechanism in Parsoid, since there appears to be too much content of this type without proper language markers. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:04, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is no "Edit with migration tool" entry in tools on Serbian Wikipedia. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:50, 21 April 2026 (UTC) :It needs to be enabled explicitly in Preferences > Editing > Developer tools > Enable parser migration tool. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:44, 23 April 2026 (UTC) == includeonly in headline syntax == no longer resolved properly == ''Example:'' [[w:de:Hilfe:Parserfunktionen]] This page (and many others of our help pages) are made for dual use: # stand alone # transclusion of several help pages of similar topic into a combined complete story. They contain headlines like <syntaxhighlight lang="wikitext"> <includeonly>=</includeonly>== Allgemeines ==<includeonly>=</includeonly> </syntaxhighlight> If stand alone, this shall be displayed as H2. * When combined, the page title will be shown as H2 and the section as H3. Swift solution most welcome – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:23, 22 April 2026 (UTC) : BTW – transclusion works correctly: [[w:de:Hilfe:Parserfunktionen/*]] --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:27, 22 April 2026 (UTC) :https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 has our suggested solution (the first form preferably). It works in transclusion mode because the preprocessor is involved. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:53, 22 April 2026 (UTC) ::“has our suggested solution (the first form preferably). It works” ::I do not understand what is “our suggested solution” – please look at this current page. It has neither TOC nor any headline, since the == are displayed within the text, using the default parsing. There are 10 headlines. ::Astonished – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 21:45, 22 April 2026 (UTC) :::Oops .. sorry! I pasted the wrong link! I meant to point you to [[#dewiki:Hilfe:Parserfunktionen|this section]] on this page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 00:09, 23 April 2026 (UTC) You’re imposing some work on us. * I am happy that there are [https://de.wikipedia.org/w/index.php?search=H:+insource:includeonly+insource:%2Fincludeonly%5C%3E%3D%2B%5C%3C%5C%2Fincludeonly%2F&title=Spezial:Suche 12 pages only] to be updated now. * Fortunately, some other syntax has been used in [[w:de:H:VE/*]] – [[w:de:H:Lua/*]] – [[w:de:H:Tabellen/*]] – [[w:de:H:FAQ/Übersicht]] which are merging a huge pile of single pages. I do hope this exception will be described in WikiSyntax Documentation soon. --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 11:04, 23 April 2026 (UTC) :Thanks for your understanding and fixing the pages. Given all the work we've done to deploy to a wiki, at this point, we expect that all remaining rendering issues are likely going to be edge cases that affect small number of pages. We'll update the docs soon, yes. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:22, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%9F%D1%80%D0%B5%D0%B4%D1%83%D0%BF%D1%80%D0%B5%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5&oldid=116093745&useparsoid=1 ruwiki:Шаблон:Предупреждение] == [[:ru:Шаблон:Tpre]] ([[:ru:Модуль:Template call code]]) stops working entirely in Parsoid mode. See also local discussion: [[:ru:Википедия:Форум/Технический#c-Tarkoff-20260422084300-Шаблон:Предупреждение]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 16:40, 22 April 2026 (UTC) :That doesn't look good. Do you have a sense of how many pages are impacted? We will take a look tomorrow and see what is going on and if we can roll out a quick fix. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:07, 22 April 2026 (UTC) ::I see what is going on. This is [[phab:T353697|T353697]] which was resolved with https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/992274. The fix is to have the modules emit <code>format="wikitext"</code> so the <nowiki><span> tags aren't escaped as literal output. Can you see if that fixes it?</nowiki> [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:22, 22 April 2026 (UTC) ::: Yes, thank you. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:47, 22 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Rei_Ami&oldid=266367300&useparsoid=1 dewiki:Rei Ami] == The image of Ami on the top right corner should be rendered with a width of 250px but seems to be scaled down to round about 160px. When using the Legacy Parser the image is rendered as expected. The issue seems to effect only some images. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 18:59, 22 April 2026 (UTC) :@[[User:Jon (WMF)|Jon (WMF)]] says, "The original size of the image is 315x427. This is https://phabricator.wikimedia.org/T421524 - only way to fix it is for Parsoid to mark the img up with a class when the image original size is smaller than 400px. Otherwise it's working as expected." I'm not entirely sure I agree with this diagnosis, since T421524 would cause the image to appear "too large" not "too small". :@[[User:Guardian of Arcadia|Guardian of Arcadia]] what is your user thumbnail size preference, and what skin are you using? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:13, 23 April 2026 (UTC) ::@[[User:Cscott|Cscott]]: I'm using the default thumbnail size of 250px and Vector 2010 (Legacy) as skin. But the size issue also occurs when using other skins like Vector 2022, which can be seen by appending <code>useskin=vector-2022</code> to the URL or viewing the page in an incognito window. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 20:37, 23 April 2026 (UTC) :::What browser and version are you using @[[User:Guardian of Arcadia|Guardian of Arcadia]] ? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 21:46, 23 April 2026 (UTC) ::::Also can you check you don't have a different preference set in [[Special:GlobalPreferences]] and possibly try changing it and changing it back? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:55, 23 April 2026 (UTC) ::::@[[User:Jon (WMF)|Jon (WMF)]]: The issue isn't limited to my account only; it occurs in a logged-out state (within an incognito window) too. But your guess about the browser seems to be right: I have the described issue when using Firefox with the ESR version 115.35.0esr. Today I have tested with another browser (Chrome and Edge) as well as on a PC with a current (non-ESR) Firefox and there the image is shown as expected. So, is this a bug in this specific Firefox version? [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 19:47, 24 April 2026 (UTC) :::::Yes. This sounds like a bug in that specific Firefox version. If you can give me more details about the operating system version you are using I can see if I can replicate in browserstack.com . Is it possible there are any browser extensions installed on that browser? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 22:31, 24 April 2026 (UTC) ::::::The operating system on this PC is Windows 8.1 (Build 9600) and I do not have any browser extensions installed there. Hope this helps to reproduce the issue. If you need anything else please let me know. Thanks for your help. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 22:44, 24 April 2026 (UTC) :::::::That was incredibly useful information, thank you. I understand what is happening now, and there might be something we can do here. Note, this browser is on the cusp of our usual browser support levels, which is what's causing the problem. [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 16:54, 27 April 2026 (UTC) ::::::::That's great news. I would be verry happy if you or your team can fix it. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 17:00, 27 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Alexandru_Dobrogeanu-Gherea&oldid=17669378&useparsoid=1 rowiki:Alexandru Dobrogeanu-Gherea] == imaginea prea mare, la fel la multe articole cu infocaseta om politic, de pilda Vasile Luca, Luminita Odobescu etc face contrast cu imagini in alte infocasete unde problema se poate regla [[User:Ewan2|Ewan2]] ([[User talk:Ewan2|talk]]) 01:25, 23 April 2026 (UTC) :Google translate: "the image is too large, the same as in many articles with the politician infobox, for example Vasile Luca, Luminita Odobescu, etc. it contrasts with images in other infoboxes where the problem can be adjusted." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 18:50, 23 April 2026 (UTC) ::@[[User:Jon (WMF)|Jon (WMF)]] says "For Romanian Wikipedia, there was a problem with the infobox styles. Pretty sure it's been fixed since. It could just be that he's seeing 400px instead of 300px. The infobox image looks identical to me in Parsoid and legacy." ::@[[User:Ewan2|Ewan2]] are you using the default thumbnail size (250px) or a larger size in your user preferences? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:07, 23 April 2026 (UTC) == [https://zu.wikipedia.org/w/index.php?title=Gashamo_Hawd_Somali_Ethiopia&oldid=122552&useparsoid=1 zuwiki:Gashamo Hawd Somali Ethiopia] == Is the city of Hawd Zone [[User:Maaaaskaas11|Maaaaskaas11]] ([[User talk:Maaaaskaas11|talk]]) 21:58, 23 April 2026 (UTC) == [https://ru.wikipedia.org/wiki/Текумсе ruwiki:Текумсе] == For some reason, the comment "До эскиза Лоссинга не было известно..." is repeated twice (see subsection "Комментарии" at the end of the article). This comment is generated by template "ref+" placed inside the template "персона" (an analogue of "Template:Infobox person"), and it is supposed to appear only once. Thanks! [[User:Adavyd|Adavyd]] ([[User talk:Adavyd|talk]]) 22:04, 23 April 2026 (UTC) :This is probably {{phab|T415789}}, which would be solved by adding a name to the reference, but then we end up running into {{phab|T423924}} - the template ends up defining the reference twice with subtly different content (as far as Parsoid is concerned) and the same name, which triggers an error. The fix will probably be to add a name to the reference once {{phab|T423924}} is handled. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:43, 24 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=FIDO2&oldid=264704558&useparsoid=1 dewiki:FIDO2] == Erste Grafik überlagert den Text und die Werkzeugleiste links [[User:Hinnerk11|Hinnerk11]] ([[User talk:Hinnerk11|talk]]) 23:51, 23 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Amanda_Kathrine_Smith/Sandbox&oldid=150348388&useparsoid=1 itwiki:Utente:Amanda Kathrine Smith/Sandbox] == i don't see the "MOVE DRAFT" button. [[User:Amanda Kathrine Smith|Amanda Kathrine Smith]] ([[User talk:Amanda Kathrine Smith|talk]]) 14:14, 24 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:36, 28 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%A1%D1%80%D0%B1%D0%B8%D1%98%D0%B0_(1071%E2%80%941217)&oldid=30892614&useparsoid=1 srwiki:Србија (1071—1217)] == Text inside {{lang-la.. and other {{lang-... templates is not displayed at all. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:46, 24 April 2026 (UTC) :Never mind, in process of adapting our templates for Parsoid, I missed additional change needed in an auxillary module. All is good now. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A2%D1%80%D0%B3/%D0%94%D1%80%D1%83%D0%B3%D0%B8&oldid=30921466&useparsoid=1 srwiki:Википедија:Трг/Други] == <nowiki>__NOCONTENTCONVERT__</nowiki> does not work in Parsoid. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 18:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=Queen&oldid=30824348&useparsoid=1 srwiki:Queen] == Parsoid does not honor __БЕЗКН__ (magic word to suppress title conversion during language conversion) [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 20:03, 24 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%A4%D0%BE%D1%80%D1%83%D0%BC/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8&oldid=152858025&useparsoid=1 ruwiki:Википедия:Форум/Новости] == Исчез логотип в скине Вектор-2010 при включенном гаджете, который отображает праздничные логотипы. При отключении гаджета в настройках — повседневный логотип виден. [[User:Рыцарь поля|Рыцарь поля]] ([[User talk:Рыцарь поля|talk]]) 00:16, 25 April 2026 (UTC) :Triage: not a Parsoid visual issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:22, 27 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9F%D1%80%D0%BE%D0%B5%D0%BA%D1%82:%D0%91%D0%B8%D0%B1%D0%BB%D0%B8%D0%BE%D1%82%D0%B5%D0%BA%D0%B0/%D0%A2%D1%80%D0%B5%D0%B1%D1%83%D1%8E%D1%82%D1%81%D1%8F_%D0%BA%D0%BD%D0%B8%D0%B3%D0%B8&oldid=152853098&useparsoid=1 ruwiki:Проект:Библиотека/Требуются книги] == Конфликт [[:ru:Проект:Библиотека/Требуются книги/Шапка]] с содержанием страницы, из-за чего в [[:ru:Шаблон:shortcut|Шаблон:shortcut]] помещается раздел "содержание" (выглядит это так: [https://ibb.co/219kN3dW 1] и [https://ibb.co/bgM0Fmpn 2]). ------- The conflict between [[:ru:Проект:Библиотека/Требуются книги/Шапка]] and the page content causes the "содержание" section to appear inside [[:ru:Шаблон:shortcut|Шаблон:shortcut]] (this is how it looks: [https://ibb.co/219kN3dW 1] and [https://ibb.co/bgM0Fmpn 2]). [[User:Футболло|Futbollo]] ([[User talk:Футболло|talk]]) 01:10, 25 April 2026 (UTC) :Thank you for the report - I've filed {{phab|T424492}} for it. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:33, 27 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Copa_Intercontinental_da_FIFA_de_2025&oldid=72134360&useparsoid=1 ptwiki:Copa Intercontinental da FIFA de 2025] == Quadro de informações foi excluído por acidente. [[User:AnderSilv42|AnderSilv42]] ([[User talk:AnderSilv42|talk]]) 00:16, 26 April 2026 (UTC) :Triage: Content related - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 15:23, 26 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Michel_W%C3%B6cke&oldid=266505400&useparsoid=1 dewiki:Michel Wöcke] == Bild (Thumb) viel zu gross [[User:Albinfo|Albinfo]] ([[User talk:Albinfo|talk]]) 13:44, 26 April 2026 (UTC) == [https://tn.wikipedia.org/w/index.php?title=Sekolo_Se_Segolwane_Sa_Nata&oldid=49572&useparsoid=1 tnwiki:Sekolo Se Segolwane Sa Nata] == I tried fixing the references but It still says pages with reference errors so I don't know what could be the issue [[User:Blackgirlmighty|Blackgirlmighty]] ([[User talk:Blackgirlmighty|talk]]) 17:00, 26 April 2026 (UTC) :You only need to define a reference once even if you want to use it multiple times - see https://www.mediawiki.org/wiki/Help:Cite#Multiple_uses_of_the_same_footnote for more information. One of each of the references Mmegi2012 and Mmegi2023 should be kept as is; the others should be replaced by <nowiki><ref name="Mmegi2012" /></nowiki> (or 2023) without content. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:39, 27 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Pete_Aguilar&oldid=8671369&useparsoid=1 simplewiki:Pete Aguilar] == This is a less detailed copy of another Wikipedia page. There are two wiki pages showing Pete Aguilar and this is an outdated version. [[User:SuperPug3739|SuperPug3739]] ([[User talk:SuperPug3739|talk]]) 04:56, 27 April 2026 (UTC) :Triage: content related, not Parsoid related [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:46, 27 April 2026 (UTC) == [https://fi.wikipedia.org/w/index.php?title=Hoito-_kasvatussuunnitelma&oldid=23973675&useparsoid=1 fiwiki:Hoito- kasvatussuunnitelma] == Sivun nimi piti olla Hoito- ja kasvatussuunnitelma. Muokkaaminen ei onnistunut. [[User:Nebiux|Nebiux]] ([[User talk:Nebiux|talk]]) 12:01, 29 April 2026 (UTC) :Triage: content related, not Parsoid-related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:04, 30 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Usuario:Luigi_Nakano&oldid=173203320&useparsoid=1 eswiki:Usuario:Luigi Nakano] == An error appears, which should appear when template [[w:es:Plantilla:Estado usuario|Estado usuario]] has nothing in 1=. However, there is a parameter in 1=, so the result should be "Conectado" or "Desconectado", and not "Error:No se ha indicado usuario.". [[User:Luigi Nakano|<span style="color:green">Luigi</span> <span style="color:blue">Nakano</span>]] [[File:Emojione 1F3A7.svg|15px]] ([[User talk:Luigi Nakano|会話]]) 23:12, 29 April 2026 (UTC) :This looks like {{phab|T348722}}, for which a workaround is suggested in https://www.mediawiki.org/wiki/Parsoid/Parser_Unification/Instructions_for_editors#Access_to_parent_frame_from_within_extensions. Let us know if the problem persists after the fix! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:10, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=History_of_the_Ryukyu_Islands&oldid=1336895218&useparsoid=1 enwiki:History of the Ryukyu Islands] == The multiple issues display unsourced template when editing the article there is no such template. [[User:Lightoil|Lightoil]] ([[User talk:Lightoil|talk]]) 05:11, 30 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A7%D1%85%D0%B0%D0%B8%D0%B4%D0%B7%D0%B5,_%D0%9C%D0%B0%D0%BC%D0%B8%D1%8F_%D0%92%D0%B8%D1%81%D1%81%D0%B0%D1%80%D0%B8%D0%BE%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&oldid=152923873&useparsoid=1 ruwiki:Чхаидзе, Мамия Виссарионович] == In the old parser, links to non-existing file pages lead to Special:Upload for the file. In Parsoid, it's a strange link to Special:FilePath, which ends up confusing the editors who accustomed to uploading files this way. [[:ru:Служебная:GoToComment/c-ФВ-20260430140600-Не_загружается_файл|See local discussion]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:53, 30 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%94%D0%B5%D1%80%D0%B2%D0%B8%D1%88_%D0%9A%D0%BE%D1%80%D0%BA%D1%83%D1%82&oldid=30931273&useparsoid=1 srwiki:Дервиш Коркут] == At the bottom, there are several navboxes, Parsoid adds some whitespace between them [[File:Spaces between navboxes with Parsoid..png]] [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 21:21, 30 April 2026 (UTC) : https://phabricator.wikimedia.org/T425123 [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 15:27, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Sevayat&oldid=1351876642&useparsoid=1 enwiki:Talk:Sevayat] == The content assessment and talk page are displayed directly on the talk page, rather than within the “About this page” section (mobile view). [[User:S4yam|S4yam]] ([[User talk:S4yam|talk]]) 21:44, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:Template_editor&oldid=1351909200&useparsoid=1 enwiki:Wikipedia talk:Template editor] == I'm artist thi is my personal biography page [[User:Allymtulia|Allymtulia]] ([[User talk:Allymtulia|talk]]) 21:45, 30 April 2026 (UTC) :Triage: Content issue, not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Middle_of_Nowhere_(Kacey_Musgraves_album)&oldid=1351931473&useparsoid=1 enwiki:Middle of Nowhere (Kacey Musgraves album)] == Producer parameter that adops hlist system in Infobox album template occurs an error. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 01:07, 1 May 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Associazione_Calcio_Perugia_1996-1997&oldid=148287407&useparsoid=1 itwiki:Associazione Calcio Perugia 1996-1997] == Doesn't show all kits. Just the third and on top of the screen [[User:Madive60|Madive60]] ([[User talk:Madive60|talk]]) 01:29, 1 May 2026 (UTC) :This is probably fixed by the fix to {{phab|T425056}} and the current CSS workaround on-wiki. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:22, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%9B%BD%E6%97%97%E3%81%AE%E4%B8%80%E8%A6%A7&oldid=109342678&useparsoid=1 jawiki:国旗の一覧] == イラクの国旗がない [[User:平舞|平舞]] ([[User talk:平舞|talk]]) 03:17, 1 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:21, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Manting_Chan&oldid=1351960413&useparsoid=1 enwiki:Manting Chan] == Divorce, she is not divorced. [[User:Bananahammock311911511|Bananahammock311911511]] ([[User talk:Bananahammock311911511|talk]]) 04:54, 1 May 2026 (UTC) :Content issue, not a Parsoid issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 07:30, 1 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E9%9B%B7%E9%96%80%E9%9F%B3%E5%8A%A9&oldid=109345108&useparsoid=1 jawiki:雷門音助] == {{人名の曖昧さ回避}}や{{aimai}}を貼ると表示が崩れる。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 07:27, 1 May 2026 (UTC) :<nowiki>[[:jawiki:雷門五郎]]</nowiki>でも同様の問題が起きています。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 09:09, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Iceman_(Drake_album)&oldid=1350717409&useparsoid=1 enwiki:Talk:Iceman (Drake album)] == Banners showing up on mobile, not under “learn more about this page button” [[User:OrbitalVoid49|OrbitalVoid49]] ([[User talk:OrbitalVoid49|talk]]) 09:36, 1 May 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Bancu,_Harghita&oldid=13617293&useparsoid=1 rowiki:Bancu, Harghita] == Steagulnjudetului Hargita nu este acea cârpă secuiasca. [[User:Auto 4115|Auto 4115]] ([[User talk:Auto 4115|talk]]) 01:39, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Aurangabad&oldid=1351274322&useparsoid=1 enwiki:Aurangabad] == It has the old name of the city as it's title [[User:20mphwind|20mphwind]] ([[User talk:20mphwind|talk]]) 07:09, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%B9%E0%A6%BE%E0%A6%9C%E0%A6%B0%E0%A6%BE%E0%A6%AC%E0%A6%BE%E0%A6%A1%E0%A6%BC%E0%A7%80_%E0%A6%89%E0%A6%9A%E0%A7%8D%E0%A6%9A_%E0%A6%AC%E0%A6%BF%E0%A6%A6%E0%A7%8D%E0%A6%AF%E0%A6%BE%E0%A6%B2%E0%A6%AF%E0%A6%BC&oldid=8874755&useparsoid=1 bnwiki:হাজরাবাড়ী উচ্চ বিদ্যালয়] == তথ্যসুত্র ব্যয়বহুল নয়। [[User:Md Umor Faruk 2010|Md Umor Faruk 2010]] ([[User talk:Md Umor Faruk 2010|talk]]) 08:00, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=She_Did_It_Again&oldid=1352147079&useparsoid=1 enwiki:She Did It Again] == (Mobile) Huge error in hlist. Bullet points (•) are missing, and the items listed are arranged very roughly. Not sure why this error occurs for over three days. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 10:45, 2 May 2026 (UTC) :Thank you for the report - I have filed {{phab|T425245}} for this issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:30, 3 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%91%E4%B8%8A%E5%93%B2&oldid=109361964&useparsoid=1 jawiki:村上哲] == [[Template:循環参照]]が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:13, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=Wikipedia:%E4%BA%95%E6%88%B8%E7%AB%AF&oldid=109349724&useparsoid=1 jawiki:Wikipedia:井戸端] == 目次が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1 enwiki:Wiki (disambiguation)] == [[w:en:tm:dab]] (at the bottom of the page) appears to render differently on Parsoid compared to non-Parsoid. <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 14:27, 2 May 2026 (UTC) :Also appears to render differently on desktop Parsoid v. mobile Parsoid -- compare https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=mobile (different rendering) vs. https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=desktop ('expected' rendering, AFAIK) <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 16:34, 2 May 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Horv%C3%A1th_Kriszti%C3%A1n_(fest%C5%91,_1976,_Budapest)&oldid=28948319&useparsoid=1 huwiki:Horváth Krisztián (festő, 1976, Budapest)] == Az a probléma, hogy nem szeretném hoyg festő, és 1976 Budapest legyen hozzá kírva. Elrontottam, és nem tudtam külön, új cikket írni róla. [[User:Pizzsus|Pizzsus]] ([[User talk:Pizzsus|talk]]) 20:47, 2 May 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%99%D7%A6%D7%97%D7%A7_%D7%9E%D7%90%D7%99%D7%A8_%D7%90%D7%9C%D7%AA%D7%A8&oldid=43088529&useparsoid=1 hewiki:יצחק מאיר אלתר] == הציטוטים בכתב דיויד בעברית לקויים. Text quotes in David font are displayed poorly. [[User:פרידבערג|פרידבערג]] ([[User talk:פרידבערג|talk]]) 21:36, 2 May 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9B%D0%B8%D1%86%D0%B5%D0%BD%D0%B7%D0%B8%D0%B8_%D0%B8_%D0%B8%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B_Creative_Commons&oldid=152790052&useparsoid=1 ruwiki:Лицензии и инструменты Creative Commons] == refs don't work with vector-2010 (but it works for vector-2022) [[User:Petsernik|Petsernik]] ([[User talk:Petsernik|talk]]) 23:05, 2 May 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Huawei&oldid=173270512&useparsoid=1 eswiki:Huawei] == El segundo sitio web que sale no existe es un vandalismo en wikimedia ingles o un error [[User:Usuario 016|Usuario 016]] ([[User talk:Usuario 016|talk]]) 23:15, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%8C%97%E6%9D%91%E8%81%A1&oldid=109365307&useparsoid=1 jawiki:北村聡] == 人名の曖昧さ回避Templateを挿入すると、上手く表示されず、大きな改行空白と共に「.mw-parser-output .dmbox{display:flex;align-items:center;clear:both;margin:0.9em 1em;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:0.25em 0.35em;font-size:95%}.mw-parser-output .dmbox>*{flex-shrink:0;margin:0 0.25em;display:inline}.mw-parser-output .dmbox-body{flex-grow:1;flex-shrink:1;padding:0.1em 0}」 というものが出る。 [[User:Geogie|Geogie]] ([[User talk:Geogie|talk]]) 23:35, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=User:Soetermans&oldid=1225262591&useparsoid=1 enwiki:User:Soetermans] == He vandalized the pages [[User:Inkysponge2007|Inkysponge2007]] ([[User talk:Inkysponge2007|talk]]) 13:02, 3 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=User:Soetermans&oldid=1225262591&useparsoid=1 enwiki:User:Soetermans] == He is changing the nationally of the show please ban him [[User:Inkysponge2007|Inkysponge2007]] ([[User talk:Inkysponge2007|talk]]) 13:07, 3 May 2026 (UTC) tr22w8nscs6ghghyi1qpqtasbwr6jnp 8364384 8364345 2026-05-03T13:51:26Z Clump 81610 Reverted edits by [[Special:Contribs/Inkysponge2007|Inkysponge2007]] ([[User talk:Inkysponge2007|talk]]) to last version by IHurbainPalatin (WMF) 8364066 wikitext text/x-wiki Post your feedback about using [[Parsoid/Parser Unification|Parsoid]] to render articles. [[Parsoid/Parser_Unification/Known_Issues|Learn how to report problems clearly]]. '''Need more attention? [https://phabricator.wikimedia.org/maniphest/task/edit/form/43/?projects=PHID-PROJ-3y2wduoz5xezwveaq426 Report directly in Phabricator].''' {{note|This is for reporting feedback on the integration of the Parsoid parser only. '''For wiki content issues, such as concerns about article content, please report on your local wiki.''' }} [[Parsoid/Parser_Unification/Known_Issues|View known issues]] __NEWSECTIONLINK__ {{Archive box| [[/Archive 1]] [[/Archive 2]]}} == [https://nl.wikipedia.org/w/index.php?title=Wikipedia:Aanmelding_moderatoren&oldid=70702688&useparsoid=1 nlwiki:Wikipedia:Aanmelding moderatoren] == Sometimes, in a numbered list, the number stays on the first line when there are indented lines below it, and sometimes the number is vertically aligned between the different lines. For votes, it is preferable that the number remains on the line that starts with only “#” and not on lines with an indentation “#:”. [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:34, 15 February 2026 (UTC) :i.e. see item 33. under '<nowiki/>'''''Voor moderatorschap ContextCreator'''<nowiki/>'<nowiki/>'' [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:36, 15 February 2026 (UTC) ::I can't see any difference between Parsoid and the legacy Parser on that page, it appears that the number is correctly aligned in both cases. Are you using a different skin by any chance? Does the difference still appear? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:42, 21 April 2026 (UTC) :::I see no difference anymore - it is fixed. Thanks anyway! [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 16:01, 21 April 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Discussion_Wikip%C3%A9dia:Wikiconcours&oldid=233327486&useformat=mobile&useparsoid=1 frwiki:Discussion Wikipédia:Wikiconcours] == Content that is hidden inside the "Learn more about this page" button from MobileFrontend with legacy parser is not inside it with Parsoid. [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 08:32, 22 February 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Laurence_Olivier&oldid=148833592&useparsoid=1 itwiki:Laurence Olivier] == Giant Oscar statue icons (sgranate) [[User:UmbraSolis|UmbraSolis]] ([[User talk:UmbraSolis|talk]]) 20:28, 19 February 2026 (UTC) :This was probably due to https://phabricator.wikimedia.org/T417828, which is now fixed. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:53, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:43, 21 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Bologna_Football_Club_1909&oldid=149496425&useparsoid=1 itwiki:Bologna Football Club 1909] == problem with displaying football shirts [[User:Gio Bike|Gio Bike]] ([[User talk:Gio Bike|talk]]) 17:49, 20 February 2026 (UTC) :Can you be more specific, or is it fixed now? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:55, 27 February 2026 (UTC) ::Now it is OK [[Special:Contributions/&#126;2026-13011-93|&#126;2026-13011-93]] ([[User talk:&#126;2026-13011-93|talk]]) 17:20, 27 February 2026 (UTC) :::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:44, 21 April 2026 (UTC) == [https://vi.wiktionary.org/w/index.php?title=Wiktionary:Th%E1%BB%91ng_k%C3%AA/S%E1%BB%91_m%E1%BB%A5c_t%E1%BB%AB_theo_ng%C3%B4n_ng%E1%BB%AF/T%E1%BA%A5t_c%E1%BA%A3&oldid=2331126&useparsoid=1 viwiktionary:Wiktionary:Thống kê/Số mục từ theo ngôn ngữ/Tất cả] == Phần cuối bảng bị lỗi, không hiện ra số mục từ mà chỉ hiện ra "0" hoặc "-2" mà không rõ lý do, tôi không viết nhầm gì cả. (English: The table got error, just display "0" or "-2", but I don't have any error at write wikitext.) [[User:NHNAnh|NHNAnh]] ([[User talk:NHNAnh|talk]]) 05:57, 21 February 2026 (UTC) :I believe this might be due to "Expensive parser function count: 1080/500" in the debug log: there are too many expensive parser function counts on this page (PAGESINCATEGORY is expensive), and the later functions are not executed. :I would suggest splitting the page into several pages, if possible. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:04, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) == [https://cs.wikipedia.org/w/index.php?title=Celerina/Schlarigna&oldid=25694456&useparsoid=1 cswiki:Celerina/Schlarigna] == V tabulce v sekci obyvatelstvo se u jedné buňky zobrazuje černé pozadí. Pokud dám ale historii stránky a podívám se na aktuální verzi, vykreslí se stránka správně. To samé se opakuje i u jiných podobných stránek se stejně formátovanými tabulkami. [[User:Matijak|Matijak]] ([[User talk:Matijak|talk]]) 17:02, 22 February 2026 (UTC) :I cannot see a black cell in that table. Is this issue fixed? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:09, 27 February 2026 (UTC) ::I can see it in in both the history (latest revision) and on the page itself (live). It's the leftmost 'Počet' cell in the 'Jazyky v Celerině' table. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 10:10, 28 February 2026 (UTC) :::Aha! :::the cell itself is not dark, the text in it is, and only in dark mode. It is also present in the legacy rendering, which seems to hint at a problem with the table markup itself and not a parser issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:11, 2 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) :::::Not a Parsoid issue most likely, but it has not been fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:21, 24 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia:Biographies_of_living_persons&oldid=1340299616&useparsoid=1 enwiki:Wikipedia:Biographies of living persons] == Reporting a visual bug for all pages that suddenly arose as of this morning on Safari Mobile - the Page Actions Overflow div is in a permanently open state but inaccessible to via clicks to either toggle the menu or select any of the tools on the menu. In addition to being unable to interact with it, all of the styling broken and makes the top right section of the page unusable and barely readable. [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 14:34, 27 February 2026 (UTC) :Is this issue still present? Sorry, it has been a while since you reported this, I'm hoping that the issue has been resolved by now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) ::Yes, it appears to have been resolved. Thanks for following up! [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 03:38, 22 April 2026 (UTC) == [https://oc.wikipedia.org/w/index.php?title=Esqu%C3%A8rra_(politica)&oldid=2495338&useparsoid=1 ocwiki:Esquèrra (politica)] == There's an issue with the interlinks, this article should be connected with the other ones about left-wing politics [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 06:39, 28 February 2026 (UTC) :Yes, it was an issue with the interlinks, but those should naturally not be reported as visual issues ('bogue visuler') as the have nothing to do with Parsoid. You can link pages which have no connections by using the 'Apondre los ligams interlengas' (Add interlanguage links) button from the 'Bóstia d'aisinas' (Tools) menu. Unless, of course, Parsoid somehow blocks automatic linking of translations. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:10, 28 February 2026 (UTC) ::I don't know why but it was finally done (thank you so much to the person who did that), but the thing is, i tried what you said before and it kept telling me that i didn't had the permission to link the two articles... [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 19:33, 1 March 2026 (UTC) :::I did that, you are welcome. It appears that you are not autoconfirmed yet on Wikidata, and that this Wikidata entry requires that, which if both true I would expect you to not be able to do this change. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 04:21, 21 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) :::::Sorry? [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:48, 23 April 2026 (UTC) ::::::We're using the <nowiki>{{done}}</nowiki> template to track which issues have been resolved, vs still outstanding. I don't believe there is any additional follow required by the Content Transform team on this report? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 05:00, 24 April 2026 (UTC) :::::::Oh, no, I just didn't know this is a system you are using. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:19, 24 April 2026 (UTC) == [https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/Page_translation_administration&oldid=8240537&useparsoid=1 Help:Extension:Translate/Page translation administration] == The topmost warning in the 'Changing the source text' section does not display the codeblock content. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:47, 28 February 2026 (UTC) :This is a very clever use of the <code><nowiki>{{^(}}</nowiki></code> template to avoid creating an unintended translation marker. I've [https://www.mediawiki.org/w/index.php?title=Help%3AExtension%3ATranslate%2FPage_translation_administration&diff=8349012&oldid=8343860 replaced it with more straight-forward entity-escaping] to be more compatible with Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:54, 21 April 2026 (UTC) ::Also filed this as [[phab:T424066]] [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 16:46, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&oldid=67999951&useparsoid=1 nlwiki:Railterminal Gelderland] == The map in [[:nl:sjabloon:maplink]] doesn't show up in my Chrome browser for Chromebook. It does show in https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&useparsoid=0 and also when I log out. [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:54, 5 March 2026 (UTC) :Btw, the map is visible for a moment, then it disappears [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:56, 5 March 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%91%D7%A8%D7%90%D7%95%D7%9C_%D7%A1%D7%98%D7%90%D7%A8%D7%A1&oldid=42870396&useparsoid=1 hewiki:בראול סטארס] == למה הקישור לתמונה ששמתי לא עובד? בכל מקרה אשמח שמישהו ישים את התמונה העדכנית שמשומשת בדף באנגלית מאחר והלוגו למשחק שונה. מצטער על התקלה. [[User:Jhho48|Jhho48]] ([[User talk:Jhho48|talk]]) 16:43, 9 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Infokastis: Sulamistemperatuur 236,15 K (−37 °C) Miinusmärk peaks olema sidekriipsust pikem, kuid pikema kriipsu sisestamine põhjustab tõrketeate. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:05, 11 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Vabandust, lühike (st vale) kriips oli kuvatud siiski ainult lähteteksti režiimis; salvestatud tekstiga küljendis on kuvatud õige kriips. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:07, 11 March 2026 (UTC) == kowiki:sticky header is broken == [[:en:Template:Sticky header|Template:Sticky header]] is not working properly on kowiki. Please compare [//ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=0] with [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=1].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:34, 16 March 2026 (UTC) :It may have been because of an empty row before the table caption. I [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&diff=41501849&oldid=41501840 edited the page] to remove it. But, looks like another editor has removed the sticky header template call from above the table. If you can put it back, it will work. See my [[:ko:사용자:SSastry_(WMF)/Sandbox|sandbox]] page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 03:22, 17 March 2026 (UTC) == [https://ko.wikipedia.org/w/index.php?title=%ED%8B%80:%EA%B5%AD%EA%B8%B0%EB%82%98%EB%9D%BC&oldid=40992836&useparsoid=1 kowiki:틀:국기나라] == 변수를 덧붙였음에도 {{국기나라|독일|제국}}이 여전히 '독일'로 출력됩니다. [[User:Triican|Triican]] ([[User talk:Triican|talk]]) 05:04, 19 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Angus_T._Jones&oldid=1333447723&useparsoid=1 enwiki:Angus T. Jones] == The infobox photo is squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 17:11, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Ukraine&oldid=1343921679&useparsoid=1 enwiki:Ukraine] == All maps in the infobox are squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 18:36, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Sabia_que&oldid=54991313&useparsoid=1 ptwiki:Wikipédia:Sabia que] == O arquivo de discussão está 'bugando' visualmente. Está no meio de "Curiosidades em destaque" [[User:Heylenny|Heylenny]] ([[User talk:Heylenny|talk]]) 23:27, 19 March 2026 (UTC) :{{done}} Template adjusted on the page. [[User:Fúlvio|Fúlvio]] ([[User talk:Fúlvio|talk]]) 02:59, 22 March 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%AC%E0%A6%BF%E0%A6%AE%E0%A6%B2_%E0%A6%98%E0%A7%8B%E0%A6%B7_(%E0%A6%B6%E0%A6%BF%E0%A6%B6%E0%A7%81%E0%A6%B8%E0%A6%BE%E0%A6%B9%E0%A6%BF%E0%A6%A4%E0%A7%8D%E0%A6%AF%E0%A6%BF%E0%A6%95)&oldid=8851768&useparsoid=1 bnwiki:বিমল ঘোষ (শিশুসাহিত্যিক)] == আলোচনা পাতায় অন্য নিবন্ধের আলোচনা পাতা [[User:Ams riyad|Ams riyad]] ([[User talk:Ams riyad|talk]]) 01:28, 20 March 2026 (UTC) == [https://vi.wikipedia.org/w/index.php?title=Wikipedia:Th%E1%BA%A3o_lu%E1%BA%ADn&oldid=74869958&useparsoid=1 viwiki:Wikipedia:Thảo luận] == TOC is rendered inside the link bar, but it shouldn't be. [[User:NguoiDungKhongDinhDanh|<span class="skin-invert" style="color:black;font-family:Monotype Corsiva;font-size:110%;font-weight:normal;line-height:normal">NguoiDungKhongDinhDanh</span>]] 03:20, 20 March 2026 (UTC) :This was most likely [[phab:T421629|T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] and we believe this issue has been fixed. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:51, 24 April 2026 (UTC) == [[wikt:ru:омфал]] == For more than a day, there have been anomalies in the behavior of tables of contents (ToCs) in Russian Wiktionary. The issues differ based on the selected skin and affect only some pages. If the old Vector theme is used, the automatically generated ToC simply fails to appear on certain pages, despite the page having over three headers and the absence of magic words such as NOTOC. If the new Vector theme is used, the ToC on some pages is misplaced and not positioned where it should be by default. The problem is not present if the old parser is used. Purging the page's cache seems to fix the issue as well. ToC is displayed correctly in the preview-mode too. Some affected pages: * [[wikt:ru:омфал]] * [[wikt:ru:безграмотность]] * [[wikt:ru:હંમેશા]] * [[wikt:ru:ಯಾವಾಗಲೂ]] * [[wikt:ru:stadigvæk]] * [[wikt:ru:alligevel]] * [[wikt:ru:kanunay]] * [[wikt:ru:ሁሌ]] * [[wikt:ru:zawżdy]] * and maaany mooore... [[User:綿貫桜哉|綿貫桜哉]] ([[User talk:綿貫桜哉|talk]]) 08:11, 20 March 2026 (UTC) :This was [[phab:T421629|⚓ T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] but should be fixed now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:55, 24 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Louis_Nirenberg&oldid=15616502&useparsoid=1 rowiki:Louis Nirenberg] == The image seems to be the 250px thumbnail scaled up to what looks like 400px width. [[User:Andrei Stroe|Andrei Stroe]] ([[User talk:Andrei Stroe|talk]]) 10:16, 20 March 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Aide:Accueil&oldid=232433495&useparsoid=1 frwiki:Aide:Accueil] == custom collapsible elements render differently with parsoid [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 14:19, 20 March 2026 (UTC) :I filed https://phabricator.wikimedia.org/T421859. Thanks for the report. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:07, 31 March 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Katten_(olika_betydelser)&oldid=43770842&useparsoid=1 svwiki:Katten (olika betydelser)] == The legacy parser adds an empty line before the template Förgrening (which is a kind of table). The Parsoid parser don't do that. This occurs on all pages using that template. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 18:32, 21 March 2026 (UTC) :Ya, this is known difference with some paragraph wrapping which is tricky to fix. In this case, I recommend adjusting the top margin of the table by editing the base template: https://sv.wikipedia.org/w/index.php?title=Mall%3AF%C3%B6rgrening%20bas&veaction=editsource [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:01, 31 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Gen_Z_stare&oldid=1344701043&useparsoid=1 enwiki:Gen Z stare] == The infobox image is unusually narrow. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 01:51, 22 March 2026 (UTC) :For me the image is stretched horizontally by a fair bit. It seems like the following bit of code is to blame: :<syntaxhighlight lang="css"> :html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img {width: 400px; } :</syntaxhighlight> [[User:Sohom Datta|Sohom]] ([[User talk:Sohom Datta|talk]]) 01:54, 22 March 2026 (UTC) ::I'm not seeing any visible difference between legacy parser and Parsoid in my testing. Can you share a screenshot @[[User:Snowmanonahoe|Snowmanonahoe]] ? What skin and browser are you using? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 17:43, 27 March 2026 (UTC) :::@[[User:Jon (WMF)|Jon (WMF)]]: I don't see it anymore either. I'm using Vector 2022 and Firefox 149. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 17:46, 27 March 2026 (UTC) ::::Ah okay. I think this was a caching issue then. Some "temporary turbulence" was to be expected with this roll out. Thanks for reporting! [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 18:29, 27 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Virginia_Fonseca&oldid=71959182&useparsoid=1 ptwiki:Virginia Fonseca] == A 1ª imagem da página na infocaixa tem um tamanho grande demais [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 11:34, 22 March 2026 (UTC) :I don't see the problem. The page renders identically in Parsoid and with the old/legacy parser. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:22, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Xander_Harris&oldid=71958675&useparsoid=1 ptwiki:Xander Harris] == Seção de referências expandida [[User:Vitruviano|Vitruviano]] ([[User talk:Vitruviano|talk]]) 15:06, 22 March 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Bruker:Znuddel&oldid=25704667&useparsoid=1 nowiki:Bruker:Znuddel] == Hele siden er helt feil [[User:Nevemagneten|Nevemagneten]] ([[User talk:Nevemagneten|talk]]) 20:35, 24 March 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Main_page&oldid=2122&useparsoid=1 abstractwiki:Abstract Wikipedia:Main page] == Favicon is showing a dark background around the rounded corners on Chrome. [[User:Jsengupt|Jsengupt]] ([[User talk:Jsengupt|talk]]) 16:14, 25 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=System_(typeface)&oldid=1329545007&useparsoid=1 enwiki:System (typeface)] == Infobox image is stretched horizontally [[User:Anna328p|Anna328p]] ([[User talk:Anna328p|talk]]) 06:59, 26 March 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Enged%C3%A9lyk%C3%A9r%C3%A9s&oldid=28288240&useparsoid=1 huwiki:Wikipédia:Engedélykérés] == The email templates are rendered incorrectly. [[User:Bencemac|Bencemac]] ([[User talk:Bencemac|talk]]) 14:00, 26 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T421563 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:19, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Usu%C3%A1rio(a):Inter-rede/Cabe%C3%A7alho&oldid=71778331&useparsoid=1 ptwiki:Usuário(a):Inter-rede/Cabeçalho] == Whitespaces seem to have collapsed [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 18:02, 27 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422155 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:36, 2 April 2026 (UTC) ::It looks like the problem is the <code>display:flex</code> in the <code>style</code> attribute on the wrapper is at fault. Parsoid generates <code><nowiki><span></nowiki></code> wrappers around the html entities in the wikitext, by design. The whitespace is present in the HTML, so that's not a fault of Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:07, 9 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%91%D7%A6%D7%A2_%D7%9E%D7%A9%D7%94_(%D7%9E%D7%9C%D7%97%D7%9E%D7%AA_%D7%94%D7%A2%D7%A6%D7%9E%D7%90%D7%95%D7%AA)&oldid=42991233&useparsoid=1 hewiki:מבצע משה (מלחמת העצמאות)] == הכיתוב שנועד למנוע בלבול בין מבצע משה הזה למבצע משה אחר לא ערוך [[User:חנניה בלסמן|חנניה בלסמן]] ([[User talk:חנניה בלסמן|talk]]) 12:54, 30 March 2026 (UTC) == [//en.wikipedia.org/w/index.php?title=Help:Colon_trick&useparsoid=1 enwiki:Help:Colon trick] == According to [[w:Help:Colon trick]], it is explained as follows: "<code><nowiki>[[//Hus]]</nowiki></code> will produce an (invalid) external link wrapped in brackets ("[[//Hus]]"), but <code><nowiki>[[://Hus]]</nowiki></code> will produce a link to [[w://Hus|//Hus]]." However, when using Parsoid, it incorrectly links to [[w:Help:Colon trick//Hus|Help:Colon trick//Hus]].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:02, 31 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422161 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 14:00, 2 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Ans%C3%B6kan_om_administrativ_beh%C3%B6righet&oldid=59167563&useparsoid=1 svwiki:Wikipedia:Ansökan om administrativ behörighet] == In Legacy, each section (candidate) get a [redigera] ([edit] to the right of the section name. In Parsoid, there is nothing to the right of the section name. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 12:15, 2 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T391624 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:27, 2 April 2026 (UTC) == [https://en.wiktionary.org/w/index.php?title=H%26P&oldid=83856321&useparsoid=1 enwiktionary:H&P] == The first hidden category listed is [[wiktionary:Category:English_entries_with_incorrect_language_header|English entries with incorrect language header]]'','' which is, however, empty. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:48, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Jo%C3%A3o_Peixoto&oldid=72016744&useparsoid=1 ptwiki:João Peixoto] == A foto não corresponde ao nome citado [[User:Mayque Lemos|Mayque Lemos]] ([[User talk:Mayque Lemos|talk]]) 18:18, 2 April 2026 (UTC) == [https://meta.wikimedia.org/w/index.php?title=Main_Page&oldid=30254797&useparsoid=1 metawiki:Main Page] == On Parsoid only, <nowiki>''complete list'' and ''request''</nowiki> each show a space between them and their preceding opening bracket. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 19:06, 3 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&oldid=1343194045&useparsoid=1 enwiki:In Stars and Time] == <code>&lt;ref name="rps"&gt;</code> displays an error which doesn’t occur on the legacy parser [[User:Mir Novov|Mir Novov]] ([[User talk:Mir Novov|talk]]) 12:10, 4 April 2026 (UTC) :It was an error which I fixed with [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&diff=1348021667&oldid=1347424445 this edit] which adds one more backlink to Ref #5. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:00, 10 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Helen_Andrews&oldid=72024590&useparsoid=1 ptwiki:Helen Andrews] == Estou a ter problema com as referências, pois aparecem duplicadas. [[User:Faviola7|Faviola7]] ([[User talk:Faviola7|talk]]) 14:17, 4 April 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Project_chat&oldid=3236&useparsoid=1 abstractwiki:Abstract Wikipedia:Project chat] == In the "Bot request" section, a link that has been visited is blue rather than purple, because spaces in the link are turned into actual spaces (%20) in the URL. [[User:JJPMaster|JJP]]<sub>[[User talk:JJPMaster|Mas]]<sub>[[Special:Contributions/JJPMaster|ter]]</sub></sub> ([[wikt:she|she]]/[[wikt:they|they]]) 21:53, 4 April 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Tor_Fosse_(f%C3%B8dt_1956)&oldid=25723619&useparsoid=1 nowiki:Tor Fosse (født 1956)] == fil: center frameless [[User:Birgit.H.Pihl|Birgit.H.Pihl]] ([[User talk:Birgit.H.Pihl|talk]]) 10:05, 5 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Politisk_opposition&oldid=59171124&useparsoid=1 svwiki:Politisk opposition] == This error message about unused named reference is not shown: Referensfel: <ref>-tagg med namn "sr-20161006", definierad i <references> används inte tidigare i texten. The article is also added to hidden category "Sidor med referensfel" but that is not shown [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:12, 5 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Puteulum/Sandbox&oldid=150100596&useparsoid=1 itwiki:Utente:Puteulum/Sandbox] == The "Move" button to move the entry from sandbox to NS0 does not appear [[User:Puteulum|Puteulum]] ([[User talk:Puteulum|talk]]) 14:28, 7 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=POVOADO_TIRIRICAL&oldid=72040530&useparsoid=1 ptwiki:POVOADO TIRIRICAL] == O MEU TEXTO ESTA TODO VERMELHO E MAIS CENTRALIZADO [[User:POVOADO TIRIRICAL|POVOADO TIRIRICAL]] ([[User talk:POVOADO TIRIRICAL|talk]]) 18:38, 7 April 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%B1%E4%BA%AC%E9%83%BD%E9%81%935%E5%8F%B7%E6%96%B0%E5%AE%BF%E9%9D%92%E6%A2%85%E7%B7%9A&oldid=108985336&useparsoid=1 jawiki:東京都道5号新宿青梅線] == ヘッダー付近に編集ミスと思われし文言あり [[User:QWERTYKeyboard0570|QWERTYKeyboard0570]] ([[User talk:QWERTYKeyboard0570|talk]]) 08:56, 8 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=2022_Oder_environmental_disaster&oldid=1344570432&useparsoid=1 enwiki:2022 Oder environmental disaster] == After a second, the actual map from the infobox (not the buttons) is replaced with a placeholder icon and text (clicking in the field still works). [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 11:56, 8 April 2026 (UTC) :Could it have been a transient issue? I cannot reproduce this right now. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:03, 10 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Commissione_arbitrale/Domande&oldid=150049601&useparsoid=1 itwiki:Wikipedia:Commissione arbitrale/Domande] == This page is related to the itwiki ArbCom election. Section edit links were not shown, making it difficult to ask questions to candidates. This has since been worked around with [[:it:special:diff/150118322|this edit]] and is likely related to [[phab:T387520|T387520]]. [[User:Titore|Titore]] ([[User talk:Titore|talk]]) 19:58, 8 April 2026 (UTC) :Thanks for this report. This is on our list of high priority tasks to fix and we are going to pick up shortly. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:53, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Kurier&oldid=266019405&useparsoid=1 dewiki:Wikipedia:Kurier] == das Diagramm zum Beitrag "Ein Wal ..." überragt den Text der rechten Spalte. [[User:Michael w|Michael w]] ([[User talk:Michael w|talk]]) 08:10, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034&useparsoid=1 dewiki:Wikipedia:Fragen zur Wikipedia] == <nowiki>& s h y ;</nowiki> is ignored. See the test on https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034#&_s_h_y_; [[User:Raymond|Raymond]] ([[User talk:Raymond|talk]]) 09:55, 10 April 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422960 for this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:55, 10 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Faktafr%C3%A5gor&oldid=59190040&useparsoid=1 svwiki:Wikipedia:Faktafrågor] == Svara-funktionen fungerar inte med Parsoid. När jag klickar på Svara för något inlägg, vilket som helst, dyker svarsrutan upp längst ner på sidan, efter den senaste diskussionstråden. Med den äldre parsern fungerar det. [[User:Larske|Larske]] ([[User talk:Larske|talk]]) 11:12, 10 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Cornelis_de_Bruijn_Martinuszoon&oldid=70921577&useparsoid=1 nlwiki:Cornelis de Bruijn Martinuszoon] == De pagina-afbeelding is de handtekening van C. de Bruijn Mz. Ik denk dat zijn afbeelding in de spotprent een betere pagina-afbeelding is. Het zou kunnen dat Parsoid/Wikipedia deze niet 'pakt' omdat de dimensies tijdens een eerdere bewerking zijn aangepast. Alvast bedankt! [[User:Jelledebruijn|Jelledebruijn]] ([[User talk:Jelledebruijn|talk]]) 16:31, 10 April 2026 (UTC) :I think you might have seen a version of the page before the cache was updated. I just checked and the image is identical with Parsoid and the older parse. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:46, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=The_Punisher_(2004)&oldid=263259949&useparsoid=1 dewiki:The Punisher (2004)] == Dead link template Vorlage:Toter Link (https://de.wikipedia.org/wiki/Vorlage:Toter_Link) after url is no longer working but gets part of the Link. (example https://de.wikipedia.org/wiki/The_Punisher_(2004)#cite_note-5 ) [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:23, 10 April 2026 (UTC) :Example without Parsoid: https://de.wikipedia.org/wiki/The_Punisher_(2004)?useparsoid=0#cite_note-5 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:57, 10 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T368724 but ideally, the template will be added with a space after the link. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:24, 11 April 2026 (UTC) ::Unfortunately it's added by the InternetArchiveBot that way: https://de.wikipedia.org/w/index.php?title=Liste_aktiver_Brauereien_in_Deutschland&diff=prev&oldid=265857281 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 06:45, 11 April 2026 (UTC) :::@[[User:SSastry (WMF)|SSastry (WMF)]]: But it is not good if the preview shows us a different result than the version that is subsequently published. InternetArchiveBot inserts it without spaces. The task is prioritized as Low, but since we have this thousands of times in the article inventory (and it used to work before), the task should be reprioritized to Higher. And the preview should always show the same result that I get after publishing. What do we do with the Phab task now? How do we handle this bug? Thank you, [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 09:12, 11 April 2026 (UTC) ::::We will fix the preview path separately. But, for this specifically, I'll flag this for the team to see how we want to handle this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:33, 11 April 2026 (UTC) :::::@[[User:SSastry (WMF)|SSastry (WMF)]]: Oh thank you, keep us up to date here please. [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 16:35, 11 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Marlon_Ganchozo&oldid=172919968&useparsoid=1 eswiki:Marlon Ganchozo] == No sale el resto de la información del, jugador [[User:Didierlpz06|Didierlpz06]] ([[User talk:Didierlpz06|talk]]) 19:04, 10 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 eswiki:Temporada regular de la Euroliga 2025-26] == no se sustituyen correctamente las ultimas plantillas [[User:Hugogs02|Hugogs02]] ([[User talk:Hugogs02|talk]]) 08:42, 11 April 2026 (UTC) :This page is too large post-template expansion. Observe that the templates at the end are not expanded neither in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 Parsoid] nor in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=0 Legacy]; the legacy parser just happens to expand a few more at the end of the page due to [https://phabricator.wikimedia.org/T392262 T392262]. The page should probably be split. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:13, 13 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Uniforme_de_la_selecci%C3%B3n_de_f%C3%BAtbol_de_Argentina&oldid=172883243&useparsoid=1 eswiki:Uniforme de la selección de fútbol de Argentina] == En la plantilla de uniforme de fútbol algunos uniformes se ven con las mangas más bajas respecto al archivo del cuerpo, dejando lineas de un pixel por encima con los colores de fondo en dicha plantilla. [[User:Lobo kun mfc|Lobo kun mfc]] ([[User talk:Lobo kun mfc|talk]]) 13:58, 11 April 2026 (UTC) :The lines displayed on top of the uniforms are present both in Parsoid and in the Legacy parser, and they do seem to vary slightly depending on the browser (I've looked on Firefox and Chrome, both on Linux, and they were not consistent between both browsers). :I believe this issue should be fixed on the template side (at a guess, the <code>style="color: inherit; background-color:#000040;"</code> that I see on the various image divs may well show up depending on the exact HTML structure and/or image) [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:23, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Liste_der_Radschnellverbindungen_in_Deutschland&oldid=266034807&useparsoid=1 dewiki:Liste der Radschnellverbindungen in Deutschland] == Hallo, beim Artikel [[Liste der Radschnellverbindungen in Deutschland]] wird die Beschreibung der MapLink-Karte wird nicht gescheid gerendert. Statt einem hochgestellten <code>[7]</code> wird <code>Karte der bestehenden Radschnellwege in Deutschland'"`UNIQ--ref-00000008-QINU`"'</code> gerendert. Das Problem ist serverseitig und tritt beim Legacy-Parser nicht auf. LG [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 16:02, 11 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T383004 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:06, 11 April 2026 (UTC) ::thanks! [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 14:13, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Louis_Franchet_d%E2%80%99Esp%C3%A8rey&oldid=266076416&useparsoid=1 dewiki:Louis Franchet d’Espèrey] == Bildumfluss nicht wie üblich [[User:Alfred Kiefer|Alfred Kiefer]] ([[User talk:Alfred Kiefer|talk]]) 19:30, 11 April 2026 (UTC) :This issue has been fixed in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1269534 and should be deployed to production this week. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:34, 13 April 2026 (UTC) == [https://bn.wiktionary.org/w/index.php?title=%E0%A6%AA%E0%A7%8D%E0%A6%B0%E0%A6%A7%E0%A6%BE%E0%A6%A8_%E0%A6%AA%E0%A6%BE%E0%A6%A4%E0%A6%BE&oldid=250894&useparsoid=1 bnwiktionary:প্রধান পাতা] == The ‘ শব্দছবি’ section is overflowing with Parsoid; thus does not happen when the legacy parser is used. [[User:Redmin|Redmin]] ([[User talk:Redmin|talk]]) 08:09, 12 April 2026 (UTC) :Since the section seems to be randomized, it's pretty hard to see which version of this section is overflowing (the ones I see do not seem to). Would you be able to provide more information/a screenshot? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:49, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Hamburg&oldid=266087257&useparsoid=1 dewiki:Wikipedia:Hamburg] == Abschnittsbearbeitungen nicht mehr möglich, Link fehlt. Betrifft einige WP-Seiten wie auch [[:de:Wikipedia:Stammtisch München]] oder auch nur einige Überschriften von [[:de:Vorlage:Coordinate]], also nicht immer komplette Seiten. [[User:NordNordWest|NordNordWest]] ([[User talk:NordNordWest|talk]]) 12:12, 12 April 2026 (UTC) :We have a number of issues with section edit links (documented in https://phabricator.wikimedia.org/T391624) that we intend to fix; sorry for the inconvenience - we'll make sure to keep this use case in mind when working on a solution. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:20, 23 April 2026 (UTC) == [https://zh.wikipedia.org/w/index.php?title=COBOL&oldid=91149855&useparsoid=1 zhwiki:COBOL] == 正文开头的“COBOL”英文名无法显示,且全文的繁简转换失效。 The English name "COBOL" for COBOL at the very beginning vanished. Besides, the conversion between traditional and simplified Chinese does not function for the entire page. [[User:Ricky136973|Ricky136973]] ([[User talk:Ricky136973|talk]]) 13:08, 12 April 2026 (UTC) :Parsoid should not (yet) be enabled on zhwiki. If you want to preview how it will work, you can add <code>&parsoidnewlc=1</code> to the end of the URL to use Parsoid's implementation of LanguageConverter. That shows "COBOL" on this page as expected. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:17, 13 April 2026 (UTC) ::Parsoid is now experimentally enabled, so you don't need the `&parsoidnewlc=1` at the end of the URL any more. It appears that the COBOL page renders correctly now? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:40, 21 April 2026 (UTC) == [https://th.wikipedia.org/w/index.php?title=4_%E0%B9%80%E0%B8%97%E0%B8%9E%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B8%9E%E0%B8%B4%E0%B8%97%E0%B8%B1%E0%B8%81%E0%B8%A9%E0%B9%8C&oldid=12947833&useparsoid=1 thwiki:4 เทพผู้พิทักษ์] == อันนี้น่าจะผิดที่ร้องเพลงประกอบละคร [[User:ภรพัฒน์|ภรพัฒน์]] ([[User talk:ภรพัฒน์|talk]]) 12:47, 13 April 2026 (UTC) :Google translate says, "This is probably a mistake—singing the theme song for a TV drama." :This seems like a content issue, not a Parsoid issue. Mistakes in content should be correctly directly on the wiki. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:47, 21 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:%D7%A9%D7%A8%D7%A9%D7%97%D7%95%D7%9F/%D7%98%D7%99%D7%95%D7%98%D7%94&oldid=42822143&useparsoid=1 hewiki:משתמש:שרשחון/טיוטה] == אני רוצה לבטל את המצאות השם יעל סרלין בדף הטיוטות שלי כדי להתחיל ערך חדש [[User:שרשחון|שרשחון]] ([[User talk:שרשחון|talk]]) 12:59, 13 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Acidente_radiol%C3%B3gico_de_Goi%C3%A2nia&oldid=72061996&useparsoid=1 ptwiki:Acidente radiológico de Goiânia] == [[File:Captura_de_tela_de_miniaturas_renderizadas_pelo_Parsoid.png|thumb|250x250px]] As miniaturas estão minúsculas com as margens enormes. [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 15:13, 13 April 2026 (UTC) :It seems to be like this due to :<pre>html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img[width="250"] { width: calc(round(400px * var(--mw-file-upright,1),10px)) }</pre> [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 17:48, 19 April 2026 (UTC) ::{{Tracked|T423676}} [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) ::This should have been fixed by a backport we did yesterday. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:48, 21 April 2026 (UTC) == [https://hr.wikipedia.org/w/index.php?title=Marijana_Bijeli%C4%87&oldid=7429126&useparsoid=1 hrwiki:Marijana Bijelić] == Sve je podvuceno a ne treba tako biti [[User:Nikolica1512|Nikolica1512]] ([[User talk:Nikolica1512|talk]]) 17:08, 13 April 2026 (UTC) :I made some edits for you [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 18:32, 13 April 2026 (UTC) ::Thank you, I ameliorated those problematic parts, could you take a look at it? I hope it is good to go now as an article on wikipedia so people could access it. This person deserves to have a wiki page. ::Regards, [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 21:53, 13 April 2026 (UTC) :::Sorry, no. I was only helping with the syntax error. You'll need to take your request to the hrwiki community [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 22:25, 13 April 2026 (UTC) ::::And how do I do that exactly? Could you help me out with it? [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 22:56, 13 April 2026 (UTC) :::::You can ask on [[:hr:Wikipedija:Kafić]] and I'm sure someone there will help you out [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 00:34, 14 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 dewiki:Hilfe:Parserfunktionen] == Headings which use <code><nowiki><includeonly></nowiki></code> to change nesting level when transcluded don't appear as headings on original page [[User:TheFirstLevelDown|TheFirstLevelDown]] ([[User talk:TheFirstLevelDown|talk]]) 00:01, 14 April 2026 (UTC) :Parsoid does not support gluing heading together like the legacy parser did, so this syntax is not supported. :As an alternative, we suggest something like (to adjust depending on your exact use case) :<syntaxhighlight lang="wikitext"> <includeonly>===== title =====</includeonly> <noinclude>=== title ===</noinclude> </syntaxhighlight> :or, for a less robust version (but that doesn't require repeating the title) :<syntaxhighlight lang="wikitext"> <includeonly>=====</includeonly><noinclude>===</noinclude> title <includeonly>=====</includeonly><noinclude>===</noinclude> </syntaxhighlight> [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 12:45, 14 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Amor_eterno_una_tragedia_anunciada&oldid=172974810&useparsoid=1 eswiki:Amor eterno una tragedia anunciada] == el título de la página está como "Amor eterno una tragedia anunciada" y no deja cambiarlo al original que es "Amor Eterno: Una tragedia anunciada" [[User:Goodfriendspictures|Goodfriendspictures]] ([[User talk:Goodfriendspictures|talk]]) 09:59, 14 April 2026 (UTC) :To me it looks like the [[DISPLAYTITLE]] magic word is disabled though {{wg|AllowDisplayTitle}} in eswiki. Nothing to do with Parsoid. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 10:12, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:TanjaKo/Sandbox&oldid=150217478&useparsoid=1 itwiki:Utente:TanjaKo/Sandbox] == Nel testo non sono presenti errori e le frasi sono sottolineate con una linea rossa ondulata. Come risolverlo visual bug? Grazie [[User:TanjaKo|TanjaKo]] ([[User talk:TanjaKo|talk]]) 17:42, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Raduni/Raduni_in_Sicilia_2026&oldid=150224594&useparsoid=1 itwiki:Wikipedia:Raduni/Raduni in Sicilia 2026] == just on iPhone 14 with iOS 18.7.7 both from safari or chrome and both from logged or unlogged and incognito mode, the last number of the participants list (made with "#") is bigger than the others [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 18:31, 15 April 2026 (UTC) == [https://atj.wikipedia.org/w/index.php?title=Otitikowin&oldid=16878&useparsoid=1 atjwiki:Otitikowin] == pas moyen de travailler en mode visuel sur la page [[User:Luc Patin|Luc Patin]] ([[User talk:Luc Patin|talk]]) 14:56, 16 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Zhang_Zeduan&oldid=173032341&useparsoid=1 eswiki:Zhang Zeduan] == La pagina está incompleta e inpublicable [[User:Mikemj1987|Mikemj1987]] ([[User talk:Mikemj1987|talk]]) 22:08, 17 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:08, 20 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=L%C3%ADnea_E3_(Euskotren_Trena)&oldid=173034070&useparsoid=1 eswiki:Línea E3 (Euskotren Trena)] == La imagen se ve un poco mal por el modo oscuro. [[User:UnniMan|UnniMan]] ([[User talk:UnniMan|talk]]) 00:55, 18 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:09, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Stadtbahn_Karlsruhe&oldid=265878452&useparsoid=1 dewiki:Stadtbahn Karlsruhe] == Shows reference error and the categoy Kategorie:Wikipedia:Seite mit Einzelnachweisfehlern but is not included in https://de.wikipedia.org/wiki/Kategorie:Wikipedia:Seite_mit_Einzelnachweisfehlern The same happens with other articles that had no reference errors with the old parser. Makes maintenance hard. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 09:26, 19 April 2026 (UTC) :Tracked in https://phabricator.wikimedia.org/T423924 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Indiana_Jones_and_the_Fate_of_Atlantis&oldid=265815741&useparsoid=1 dewiki:Indiana Jones and the Fate of Atlantis] == Shows a reference error that is not visible in the preview function. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:06, 19 April 2026 (UTC) :The error came through a Reference with the same name in a used template https://de.wikipedia.org/wiki/Vorlage:Verkaufszahlen_LucasArts_Adventures Still bad to have an error that wasn't there with the old parser and isn't shown in the preview or maintenance category. --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:27, 19 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Evento_Azolla&oldid=72103944&useparsoid=1 ptwiki:Evento Azolla] == [Convert: número inválido] na parte de Efeitos Globais [[User:Marina Funez|Marina Funez]] ([[User talk:Marina Funez|talk]]) 00:28, 20 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:10, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Musikk%C3%A1r&oldid=144140&useparsoid=1 smnwiki:Myenster:Musikkár] == Instead of dealing with this issue and the other issue on smnwiki listed below, these were quietly archived. These are still displaying messed up months later after they were reported the first time. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:53, 20 April 2026 (UTC) :We may have missed this previously, but edits like [https://smn.wikipedia.org/w/index.php?title=Myenster%3AMusikk%C3%A1r&diff=152826&oldid=144359 this] should fix the rendering. This should work for the other pages below as well. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 12:42, 20 April 2026 (UTC) ::Thank you. I'll do the same for any other templates I come across that display like that one did. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 15:49, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Diskografia&oldid=62663&useparsoid=1 smnwiki:Myenster:Diskografia] == Instead of dealing with this issue and the other issue on smnwiki listed above, these were quietly archived. These are still displaying messed up months later after they were reported the first time. -[[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Kirje%C4%8D%C3%A4llee&oldid=32928&useparsoid=1 smnwiki:Myenster:Kirječällee] == Like the other display issues in smnwiki, this is also displaying messed up after the change. [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. For all other pages you encounter on wiki like this, please make similar edits. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Donald_A._Wollheim&oldid=266357315&useparsoid=1 dewiki:Donald A. Wollheim] == Picture is shown within a big white box, which isn't the case with the old parser. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 11:15, 20 April 2026 (UTC) :[[phab:T421524]] [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe_Diskussion:Bilder&oldid=266370955&useparsoid=1 dewiki:Hilfe Diskussion:Bilder] == see [[w:de:Hilfe Diskussion:Bilder #Skalierung von Bildern mit dem Parameter hochkant scheint nicht mehr zu funktionieren]] [[User:BurghardRichter|BurghardRichter]] ([[User talk:BurghardRichter|talk]]) 22:24, 20 April 2026 (UTC) == [https://tcy.wikipedia.org/w/index.php?title=%E0%B2%AE%E0%B3%81%E0%B2%96%E0%B3%8D%E0%B2%AF_%E0%B2%AA%E0%B3%81%E0%B2%9F&oldid=359337&useparsoid=1 tcywiki:ಮುಖ್ಯ ಪುಟ] == in main page not enable <code>html.skin-theme-clientpref-night</code> [[User:ChiK|ChiK]] ([[User talk:ChiK|talk]]) 05:47, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:23, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == https://de.wikipedia.org/wiki/Gemeindestandsver%C3%A4nderungen_in_der_Schweiz == Die Links zu den Ankern gehen nicht [[Special:Contributions/&#126;2026-24437-27|&#126;2026-24437-27]] ([[User talk:&#126;2026-24437-27|talk]]) 11:53, 21 April 2026 (UTC) :I see you found a solution :) :For the exact issue: generating ids independently from their enclosing tag is not supported by Parsoid (although this is not documented - I'll fix that). :Thanks for the report! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:16, 21 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Albosaggia&oldid=50063504&useparsoid=1 svwiki:Albosaggia] == This article, and thousands of other articles, have erroneously been put in hidden categories [[:sv:Kategori:Sidor med referensfel]] and [[:sv:Kategori:Wikipedia:Projekt översätta källmallar]]. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 12:24, 21 April 2026 (UTC) :You can mark this issue as fixed. The problem root cause was in a new Template and Module created this morning. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:40, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Eurovision_Song_Contest_1992&oldid=258716277&useparsoid=1 dewiki:Eurovision Song Contest 1992] == Quelltext bearbeiten ist für Abschnitte nicht sichtbar [[User:Anmey10112|Anmey10112]] ([[User talk:Anmey10112|talk]]) 13:00, 21 April 2026 (UTC) :Translation: "Edit source" is not visible for sections. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Boro%C8%99e%C8%99ti,_Ia%C8%99i&oldid=17665231&useparsoid=1 rowiki:Boroșești, Iași] == Satul este Borosești nu Boroșești. [[User:Stalmada|Stalmada]] ([[User talk:Stalmada|talk]]) 13:07, 21 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:09, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Gebouwge%C3%AFntegreerde_zonnepanelen_(BIPV)&oldid=71021732&useparsoid=1 nlwiki:Gebouwgeïntegreerde zonnepanelen (BIPV)] == Bij de afbeeldingen zijn 3 afbeeldingen gecombineerd met de sjabloon {{Afbeelding combi}} . De sjabloon maakt gebruikt van elk aparte tekstvelden voor elke afbeeldingen. Echter is in dit geval bij de eerste twee afbeeldingen geen gebruik gemaakt van tekstveld en is al de tekst aan het eind geplaatst bij de laatste afbeelding. Door dit gebruik van de sjabloon worden de afbeeldingen zonder spatie direct na elkaar vertoont. Op de mobiele website worden de afbeeldingen met dit sjabloon wel met spaties vertoont. Merk op dat de engelse template wel de mogelijkheid heeft om afbeeldingen gecombineerd te laten zien met spaties er tussen en heeft deze variant template meer mogelijkheden dan de NL versie. Mogelijk dat er de uitwerkin ook niet helemaal correct is geweest, maar hierover is niet te oordelen vanwege de beperkte Wiki edit kennis. [[User:Public-Publicity|Public-Publicity]] ([[User talk:Public-Publicity|talk]]) 16:16, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:22, 21 April 2026 (UTC) :Translation: "In this section, three images have been combined using the template `Template:Afbeelding combi`. This template typically utilizes a separate text field for each individual image; however, in this specific instance, the text fields for the first two images were left unused, and all the accompanying text was instead placed at the end, alongside the final image. As a result of this specific application of the template, the images are displayed consecutively without any spacing between them. On the mobile version of the website, however, images utilizing this template *are* displayed with spacing. It is worth noting that the English-language version of this template *does* offer the capability to display combined images with spacing in between—making that variant of the template more versatile than its Dutch counterpart. It is possible that the implementation itself was not entirely correct; however, it is difficult to pass judgment on this matter due to limited expertise in Wiki editing." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:12, 23 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Talk:Rao_Laxmi_Chand&oldid=10828084&useparsoid=1 simplewiki:Talk:Rao Laxmi Chand] == This Page is fake and all the information is fake [[User:Rao Gourav|Rao Gourav]] ([[User talk:Rao Gourav|talk]]) 17:23, 21 April 2026 (UTC) :Triage: Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:28, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:07, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80%D0%BE%D0%B2%D1%81%D0%BA%D0%B8%D0%B9,_%D0%A1%D1%82%D0%B5%D0%BF%D0%B0%D0%BD_%D0%A4%D1%91%D0%B4%D0%BE%D1%80%D0%BE%D0%B2%D0%B8%D1%87&oldid=152793914&useparsoid=1 ruwiki:Александровский, Степан Фёдорович] == дублируется реф в инфобоксе [[User:Gleb95|Gleb95]] ([[User talk:Gleb95|talk]]) 20:21, 21 April 2026 (UTC) :Translation: "The reference is duplicated in the infobox." :The legacy parser version has 19 references in the references list, and Parsoid contains 22. This is likely a content issue, although I haven't looked into it to determine root cause. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:11, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is plenty of problems I see related to transliteration to Serbian Cyrillic. I prefer reading articles in Serbian Cyrillic (on top of our UI, I select "Ћирилица"). In current state, Parsoid should not be turned on at all on our Wikipedia {{multiple image | align = center | total_width = 1000 | image1 = Jefri Saks (no Parsoid).png | caption1 = Without Parsoid | image2 = Jefri Saks (Parsoid).png | caption2 = With Parsoid }} Note that, with Parsoid, everything is transliterated, even when marked with correct <nowiki><lang></nowiki> attribute. Without parsoid, original English text is correctly left un-transliterated. There is also a glitch where URL is not rendered in infoboxes, again, probably something about misrendering text which was supposed to avoid transliteration. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:43, 21 April 2026 (UTC) :This is [[phab:T424159|T424159 [P0] Parsoid doesn't "guessVariant" at top level on Serbian Wikipedia, and makes sr-ec rendering "unusable" for some pages]]. Fundamentally, the mark up on that page is incorrect, in so far as English and Latin text aren't properly marked with `-{....}-`. It "worked before" because of a top-level "guessVariant" routine which effectively disabled language converter entirely on some pages, including this one. I suspect I'm going to have to implement the same 'guessVariant' mechanism in Parsoid, since there appears to be too much content of this type without proper language markers. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:04, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is no "Edit with migration tool" entry in tools on Serbian Wikipedia. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:50, 21 April 2026 (UTC) :It needs to be enabled explicitly in Preferences > Editing > Developer tools > Enable parser migration tool. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:44, 23 April 2026 (UTC) == includeonly in headline syntax == no longer resolved properly == ''Example:'' [[w:de:Hilfe:Parserfunktionen]] This page (and many others of our help pages) are made for dual use: # stand alone # transclusion of several help pages of similar topic into a combined complete story. They contain headlines like <syntaxhighlight lang="wikitext"> <includeonly>=</includeonly>== Allgemeines ==<includeonly>=</includeonly> </syntaxhighlight> If stand alone, this shall be displayed as H2. * When combined, the page title will be shown as H2 and the section as H3. Swift solution most welcome – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:23, 22 April 2026 (UTC) : BTW – transclusion works correctly: [[w:de:Hilfe:Parserfunktionen/*]] --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:27, 22 April 2026 (UTC) :https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 has our suggested solution (the first form preferably). It works in transclusion mode because the preprocessor is involved. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:53, 22 April 2026 (UTC) ::“has our suggested solution (the first form preferably). It works” ::I do not understand what is “our suggested solution” – please look at this current page. It has neither TOC nor any headline, since the == are displayed within the text, using the default parsing. There are 10 headlines. ::Astonished – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 21:45, 22 April 2026 (UTC) :::Oops .. sorry! I pasted the wrong link! I meant to point you to [[#dewiki:Hilfe:Parserfunktionen|this section]] on this page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 00:09, 23 April 2026 (UTC) You’re imposing some work on us. * I am happy that there are [https://de.wikipedia.org/w/index.php?search=H:+insource:includeonly+insource:%2Fincludeonly%5C%3E%3D%2B%5C%3C%5C%2Fincludeonly%2F&title=Spezial:Suche 12 pages only] to be updated now. * Fortunately, some other syntax has been used in [[w:de:H:VE/*]] – [[w:de:H:Lua/*]] – [[w:de:H:Tabellen/*]] – [[w:de:H:FAQ/Übersicht]] which are merging a huge pile of single pages. I do hope this exception will be described in WikiSyntax Documentation soon. --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 11:04, 23 April 2026 (UTC) :Thanks for your understanding and fixing the pages. Given all the work we've done to deploy to a wiki, at this point, we expect that all remaining rendering issues are likely going to be edge cases that affect small number of pages. We'll update the docs soon, yes. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:22, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%9F%D1%80%D0%B5%D0%B4%D1%83%D0%BF%D1%80%D0%B5%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5&oldid=116093745&useparsoid=1 ruwiki:Шаблон:Предупреждение] == [[:ru:Шаблон:Tpre]] ([[:ru:Модуль:Template call code]]) stops working entirely in Parsoid mode. See also local discussion: [[:ru:Википедия:Форум/Технический#c-Tarkoff-20260422084300-Шаблон:Предупреждение]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 16:40, 22 April 2026 (UTC) :That doesn't look good. Do you have a sense of how many pages are impacted? We will take a look tomorrow and see what is going on and if we can roll out a quick fix. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:07, 22 April 2026 (UTC) ::I see what is going on. This is [[phab:T353697|T353697]] which was resolved with https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/992274. The fix is to have the modules emit <code>format="wikitext"</code> so the <nowiki><span> tags aren't escaped as literal output. Can you see if that fixes it?</nowiki> [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:22, 22 April 2026 (UTC) ::: Yes, thank you. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:47, 22 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Rei_Ami&oldid=266367300&useparsoid=1 dewiki:Rei Ami] == The image of Ami on the top right corner should be rendered with a width of 250px but seems to be scaled down to round about 160px. When using the Legacy Parser the image is rendered as expected. The issue seems to effect only some images. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 18:59, 22 April 2026 (UTC) :@[[User:Jon (WMF)|Jon (WMF)]] says, "The original size of the image is 315x427. This is https://phabricator.wikimedia.org/T421524 - only way to fix it is for Parsoid to mark the img up with a class when the image original size is smaller than 400px. Otherwise it's working as expected." I'm not entirely sure I agree with this diagnosis, since T421524 would cause the image to appear "too large" not "too small". :@[[User:Guardian of Arcadia|Guardian of Arcadia]] what is your user thumbnail size preference, and what skin are you using? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:13, 23 April 2026 (UTC) ::@[[User:Cscott|Cscott]]: I'm using the default thumbnail size of 250px and Vector 2010 (Legacy) as skin. But the size issue also occurs when using other skins like Vector 2022, which can be seen by appending <code>useskin=vector-2022</code> to the URL or viewing the page in an incognito window. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 20:37, 23 April 2026 (UTC) :::What browser and version are you using @[[User:Guardian of Arcadia|Guardian of Arcadia]] ? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 21:46, 23 April 2026 (UTC) ::::Also can you check you don't have a different preference set in [[Special:GlobalPreferences]] and possibly try changing it and changing it back? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:55, 23 April 2026 (UTC) ::::@[[User:Jon (WMF)|Jon (WMF)]]: The issue isn't limited to my account only; it occurs in a logged-out state (within an incognito window) too. But your guess about the browser seems to be right: I have the described issue when using Firefox with the ESR version 115.35.0esr. Today I have tested with another browser (Chrome and Edge) as well as on a PC with a current (non-ESR) Firefox and there the image is shown as expected. So, is this a bug in this specific Firefox version? [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 19:47, 24 April 2026 (UTC) :::::Yes. This sounds like a bug in that specific Firefox version. If you can give me more details about the operating system version you are using I can see if I can replicate in browserstack.com . Is it possible there are any browser extensions installed on that browser? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 22:31, 24 April 2026 (UTC) ::::::The operating system on this PC is Windows 8.1 (Build 9600) and I do not have any browser extensions installed there. Hope this helps to reproduce the issue. If you need anything else please let me know. Thanks for your help. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 22:44, 24 April 2026 (UTC) :::::::That was incredibly useful information, thank you. I understand what is happening now, and there might be something we can do here. Note, this browser is on the cusp of our usual browser support levels, which is what's causing the problem. [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 16:54, 27 April 2026 (UTC) ::::::::That's great news. I would be verry happy if you or your team can fix it. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 17:00, 27 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Alexandru_Dobrogeanu-Gherea&oldid=17669378&useparsoid=1 rowiki:Alexandru Dobrogeanu-Gherea] == imaginea prea mare, la fel la multe articole cu infocaseta om politic, de pilda Vasile Luca, Luminita Odobescu etc face contrast cu imagini in alte infocasete unde problema se poate regla [[User:Ewan2|Ewan2]] ([[User talk:Ewan2|talk]]) 01:25, 23 April 2026 (UTC) :Google translate: "the image is too large, the same as in many articles with the politician infobox, for example Vasile Luca, Luminita Odobescu, etc. it contrasts with images in other infoboxes where the problem can be adjusted." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 18:50, 23 April 2026 (UTC) ::@[[User:Jon (WMF)|Jon (WMF)]] says "For Romanian Wikipedia, there was a problem with the infobox styles. Pretty sure it's been fixed since. It could just be that he's seeing 400px instead of 300px. The infobox image looks identical to me in Parsoid and legacy." ::@[[User:Ewan2|Ewan2]] are you using the default thumbnail size (250px) or a larger size in your user preferences? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:07, 23 April 2026 (UTC) == [https://zu.wikipedia.org/w/index.php?title=Gashamo_Hawd_Somali_Ethiopia&oldid=122552&useparsoid=1 zuwiki:Gashamo Hawd Somali Ethiopia] == Is the city of Hawd Zone [[User:Maaaaskaas11|Maaaaskaas11]] ([[User talk:Maaaaskaas11|talk]]) 21:58, 23 April 2026 (UTC) == [https://ru.wikipedia.org/wiki/Текумсе ruwiki:Текумсе] == For some reason, the comment "До эскиза Лоссинга не было известно..." is repeated twice (see subsection "Комментарии" at the end of the article). This comment is generated by template "ref+" placed inside the template "персона" (an analogue of "Template:Infobox person"), and it is supposed to appear only once. Thanks! [[User:Adavyd|Adavyd]] ([[User talk:Adavyd|talk]]) 22:04, 23 April 2026 (UTC) :This is probably {{phab|T415789}}, which would be solved by adding a name to the reference, but then we end up running into {{phab|T423924}} - the template ends up defining the reference twice with subtly different content (as far as Parsoid is concerned) and the same name, which triggers an error. The fix will probably be to add a name to the reference once {{phab|T423924}} is handled. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:43, 24 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=FIDO2&oldid=264704558&useparsoid=1 dewiki:FIDO2] == Erste Grafik überlagert den Text und die Werkzeugleiste links [[User:Hinnerk11|Hinnerk11]] ([[User talk:Hinnerk11|talk]]) 23:51, 23 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Amanda_Kathrine_Smith/Sandbox&oldid=150348388&useparsoid=1 itwiki:Utente:Amanda Kathrine Smith/Sandbox] == i don't see the "MOVE DRAFT" button. [[User:Amanda Kathrine Smith|Amanda Kathrine Smith]] ([[User talk:Amanda Kathrine Smith|talk]]) 14:14, 24 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:36, 28 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%A1%D1%80%D0%B1%D0%B8%D1%98%D0%B0_(1071%E2%80%941217)&oldid=30892614&useparsoid=1 srwiki:Србија (1071—1217)] == Text inside {{lang-la.. and other {{lang-... templates is not displayed at all. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:46, 24 April 2026 (UTC) :Never mind, in process of adapting our templates for Parsoid, I missed additional change needed in an auxillary module. All is good now. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A2%D1%80%D0%B3/%D0%94%D1%80%D1%83%D0%B3%D0%B8&oldid=30921466&useparsoid=1 srwiki:Википедија:Трг/Други] == <nowiki>__NOCONTENTCONVERT__</nowiki> does not work in Parsoid. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 18:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=Queen&oldid=30824348&useparsoid=1 srwiki:Queen] == Parsoid does not honor __БЕЗКН__ (magic word to suppress title conversion during language conversion) [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 20:03, 24 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%A4%D0%BE%D1%80%D1%83%D0%BC/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8&oldid=152858025&useparsoid=1 ruwiki:Википедия:Форум/Новости] == Исчез логотип в скине Вектор-2010 при включенном гаджете, который отображает праздничные логотипы. При отключении гаджета в настройках — повседневный логотип виден. [[User:Рыцарь поля|Рыцарь поля]] ([[User talk:Рыцарь поля|talk]]) 00:16, 25 April 2026 (UTC) :Triage: not a Parsoid visual issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:22, 27 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9F%D1%80%D0%BE%D0%B5%D0%BA%D1%82:%D0%91%D0%B8%D0%B1%D0%BB%D0%B8%D0%BE%D1%82%D0%B5%D0%BA%D0%B0/%D0%A2%D1%80%D0%B5%D0%B1%D1%83%D1%8E%D1%82%D1%81%D1%8F_%D0%BA%D0%BD%D0%B8%D0%B3%D0%B8&oldid=152853098&useparsoid=1 ruwiki:Проект:Библиотека/Требуются книги] == Конфликт [[:ru:Проект:Библиотека/Требуются книги/Шапка]] с содержанием страницы, из-за чего в [[:ru:Шаблон:shortcut|Шаблон:shortcut]] помещается раздел "содержание" (выглядит это так: [https://ibb.co/219kN3dW 1] и [https://ibb.co/bgM0Fmpn 2]). ------- The conflict between [[:ru:Проект:Библиотека/Требуются книги/Шапка]] and the page content causes the "содержание" section to appear inside [[:ru:Шаблон:shortcut|Шаблон:shortcut]] (this is how it looks: [https://ibb.co/219kN3dW 1] and [https://ibb.co/bgM0Fmpn 2]). [[User:Футболло|Futbollo]] ([[User talk:Футболло|talk]]) 01:10, 25 April 2026 (UTC) :Thank you for the report - I've filed {{phab|T424492}} for it. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:33, 27 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Copa_Intercontinental_da_FIFA_de_2025&oldid=72134360&useparsoid=1 ptwiki:Copa Intercontinental da FIFA de 2025] == Quadro de informações foi excluído por acidente. [[User:AnderSilv42|AnderSilv42]] ([[User talk:AnderSilv42|talk]]) 00:16, 26 April 2026 (UTC) :Triage: Content related - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 15:23, 26 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Michel_W%C3%B6cke&oldid=266505400&useparsoid=1 dewiki:Michel Wöcke] == Bild (Thumb) viel zu gross [[User:Albinfo|Albinfo]] ([[User talk:Albinfo|talk]]) 13:44, 26 April 2026 (UTC) == [https://tn.wikipedia.org/w/index.php?title=Sekolo_Se_Segolwane_Sa_Nata&oldid=49572&useparsoid=1 tnwiki:Sekolo Se Segolwane Sa Nata] == I tried fixing the references but It still says pages with reference errors so I don't know what could be the issue [[User:Blackgirlmighty|Blackgirlmighty]] ([[User talk:Blackgirlmighty|talk]]) 17:00, 26 April 2026 (UTC) :You only need to define a reference once even if you want to use it multiple times - see https://www.mediawiki.org/wiki/Help:Cite#Multiple_uses_of_the_same_footnote for more information. One of each of the references Mmegi2012 and Mmegi2023 should be kept as is; the others should be replaced by <nowiki><ref name="Mmegi2012" /></nowiki> (or 2023) without content. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:39, 27 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Pete_Aguilar&oldid=8671369&useparsoid=1 simplewiki:Pete Aguilar] == This is a less detailed copy of another Wikipedia page. There are two wiki pages showing Pete Aguilar and this is an outdated version. [[User:SuperPug3739|SuperPug3739]] ([[User talk:SuperPug3739|talk]]) 04:56, 27 April 2026 (UTC) :Triage: content related, not Parsoid related [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:46, 27 April 2026 (UTC) == [https://fi.wikipedia.org/w/index.php?title=Hoito-_kasvatussuunnitelma&oldid=23973675&useparsoid=1 fiwiki:Hoito- kasvatussuunnitelma] == Sivun nimi piti olla Hoito- ja kasvatussuunnitelma. Muokkaaminen ei onnistunut. [[User:Nebiux|Nebiux]] ([[User talk:Nebiux|talk]]) 12:01, 29 April 2026 (UTC) :Triage: content related, not Parsoid-related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:04, 30 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Usuario:Luigi_Nakano&oldid=173203320&useparsoid=1 eswiki:Usuario:Luigi Nakano] == An error appears, which should appear when template [[w:es:Plantilla:Estado usuario|Estado usuario]] has nothing in 1=. However, there is a parameter in 1=, so the result should be "Conectado" or "Desconectado", and not "Error:No se ha indicado usuario.". [[User:Luigi Nakano|<span style="color:green">Luigi</span> <span style="color:blue">Nakano</span>]] [[File:Emojione 1F3A7.svg|15px]] ([[User talk:Luigi Nakano|会話]]) 23:12, 29 April 2026 (UTC) :This looks like {{phab|T348722}}, for which a workaround is suggested in https://www.mediawiki.org/wiki/Parsoid/Parser_Unification/Instructions_for_editors#Access_to_parent_frame_from_within_extensions. Let us know if the problem persists after the fix! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:10, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=History_of_the_Ryukyu_Islands&oldid=1336895218&useparsoid=1 enwiki:History of the Ryukyu Islands] == The multiple issues display unsourced template when editing the article there is no such template. [[User:Lightoil|Lightoil]] ([[User talk:Lightoil|talk]]) 05:11, 30 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A7%D1%85%D0%B0%D0%B8%D0%B4%D0%B7%D0%B5,_%D0%9C%D0%B0%D0%BC%D0%B8%D1%8F_%D0%92%D0%B8%D1%81%D1%81%D0%B0%D1%80%D0%B8%D0%BE%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&oldid=152923873&useparsoid=1 ruwiki:Чхаидзе, Мамия Виссарионович] == In the old parser, links to non-existing file pages lead to Special:Upload for the file. In Parsoid, it's a strange link to Special:FilePath, which ends up confusing the editors who accustomed to uploading files this way. [[:ru:Служебная:GoToComment/c-ФВ-20260430140600-Не_загружается_файл|See local discussion]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:53, 30 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%94%D0%B5%D1%80%D0%B2%D0%B8%D1%88_%D0%9A%D0%BE%D1%80%D0%BA%D1%83%D1%82&oldid=30931273&useparsoid=1 srwiki:Дервиш Коркут] == At the bottom, there are several navboxes, Parsoid adds some whitespace between them [[File:Spaces between navboxes with Parsoid..png]] [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 21:21, 30 April 2026 (UTC) : https://phabricator.wikimedia.org/T425123 [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 15:27, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Sevayat&oldid=1351876642&useparsoid=1 enwiki:Talk:Sevayat] == The content assessment and talk page are displayed directly on the talk page, rather than within the “About this page” section (mobile view). [[User:S4yam|S4yam]] ([[User talk:S4yam|talk]]) 21:44, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:Template_editor&oldid=1351909200&useparsoid=1 enwiki:Wikipedia talk:Template editor] == I'm artist thi is my personal biography page [[User:Allymtulia|Allymtulia]] ([[User talk:Allymtulia|talk]]) 21:45, 30 April 2026 (UTC) :Triage: Content issue, not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Middle_of_Nowhere_(Kacey_Musgraves_album)&oldid=1351931473&useparsoid=1 enwiki:Middle of Nowhere (Kacey Musgraves album)] == Producer parameter that adops hlist system in Infobox album template occurs an error. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 01:07, 1 May 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Associazione_Calcio_Perugia_1996-1997&oldid=148287407&useparsoid=1 itwiki:Associazione Calcio Perugia 1996-1997] == Doesn't show all kits. Just the third and on top of the screen [[User:Madive60|Madive60]] ([[User talk:Madive60|talk]]) 01:29, 1 May 2026 (UTC) :This is probably fixed by the fix to {{phab|T425056}} and the current CSS workaround on-wiki. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:22, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%9B%BD%E6%97%97%E3%81%AE%E4%B8%80%E8%A6%A7&oldid=109342678&useparsoid=1 jawiki:国旗の一覧] == イラクの国旗がない [[User:平舞|平舞]] ([[User talk:平舞|talk]]) 03:17, 1 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:21, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Manting_Chan&oldid=1351960413&useparsoid=1 enwiki:Manting Chan] == Divorce, she is not divorced. [[User:Bananahammock311911511|Bananahammock311911511]] ([[User talk:Bananahammock311911511|talk]]) 04:54, 1 May 2026 (UTC) :Content issue, not a Parsoid issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 07:30, 1 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E9%9B%B7%E9%96%80%E9%9F%B3%E5%8A%A9&oldid=109345108&useparsoid=1 jawiki:雷門音助] == {{人名の曖昧さ回避}}や{{aimai}}を貼ると表示が崩れる。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 07:27, 1 May 2026 (UTC) :<nowiki>[[:jawiki:雷門五郎]]</nowiki>でも同様の問題が起きています。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 09:09, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Iceman_(Drake_album)&oldid=1350717409&useparsoid=1 enwiki:Talk:Iceman (Drake album)] == Banners showing up on mobile, not under “learn more about this page button” [[User:OrbitalVoid49|OrbitalVoid49]] ([[User talk:OrbitalVoid49|talk]]) 09:36, 1 May 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Bancu,_Harghita&oldid=13617293&useparsoid=1 rowiki:Bancu, Harghita] == Steagulnjudetului Hargita nu este acea cârpă secuiasca. [[User:Auto 4115|Auto 4115]] ([[User talk:Auto 4115|talk]]) 01:39, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Aurangabad&oldid=1351274322&useparsoid=1 enwiki:Aurangabad] == It has the old name of the city as it's title [[User:20mphwind|20mphwind]] ([[User talk:20mphwind|talk]]) 07:09, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%B9%E0%A6%BE%E0%A6%9C%E0%A6%B0%E0%A6%BE%E0%A6%AC%E0%A6%BE%E0%A6%A1%E0%A6%BC%E0%A7%80_%E0%A6%89%E0%A6%9A%E0%A7%8D%E0%A6%9A_%E0%A6%AC%E0%A6%BF%E0%A6%A6%E0%A7%8D%E0%A6%AF%E0%A6%BE%E0%A6%B2%E0%A6%AF%E0%A6%BC&oldid=8874755&useparsoid=1 bnwiki:হাজরাবাড়ী উচ্চ বিদ্যালয়] == তথ্যসুত্র ব্যয়বহুল নয়। [[User:Md Umor Faruk 2010|Md Umor Faruk 2010]] ([[User talk:Md Umor Faruk 2010|talk]]) 08:00, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=She_Did_It_Again&oldid=1352147079&useparsoid=1 enwiki:She Did It Again] == (Mobile) Huge error in hlist. Bullet points (•) are missing, and the items listed are arranged very roughly. Not sure why this error occurs for over three days. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 10:45, 2 May 2026 (UTC) :Thank you for the report - I have filed {{phab|T425245}} for this issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:30, 3 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%91%E4%B8%8A%E5%93%B2&oldid=109361964&useparsoid=1 jawiki:村上哲] == [[Template:循環参照]]が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:13, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=Wikipedia:%E4%BA%95%E6%88%B8%E7%AB%AF&oldid=109349724&useparsoid=1 jawiki:Wikipedia:井戸端] == 目次が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1 enwiki:Wiki (disambiguation)] == [[w:en:tm:dab]] (at the bottom of the page) appears to render differently on Parsoid compared to non-Parsoid. <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 14:27, 2 May 2026 (UTC) :Also appears to render differently on desktop Parsoid v. mobile Parsoid -- compare https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=mobile (different rendering) vs. https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=desktop ('expected' rendering, AFAIK) <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 16:34, 2 May 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Horv%C3%A1th_Kriszti%C3%A1n_(fest%C5%91,_1976,_Budapest)&oldid=28948319&useparsoid=1 huwiki:Horváth Krisztián (festő, 1976, Budapest)] == Az a probléma, hogy nem szeretném hoyg festő, és 1976 Budapest legyen hozzá kírva. Elrontottam, és nem tudtam külön, új cikket írni róla. [[User:Pizzsus|Pizzsus]] ([[User talk:Pizzsus|talk]]) 20:47, 2 May 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%99%D7%A6%D7%97%D7%A7_%D7%9E%D7%90%D7%99%D7%A8_%D7%90%D7%9C%D7%AA%D7%A8&oldid=43088529&useparsoid=1 hewiki:יצחק מאיר אלתר] == הציטוטים בכתב דיויד בעברית לקויים. Text quotes in David font are displayed poorly. [[User:פרידבערג|פרידבערג]] ([[User talk:פרידבערג|talk]]) 21:36, 2 May 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9B%D0%B8%D1%86%D0%B5%D0%BD%D0%B7%D0%B8%D0%B8_%D0%B8_%D0%B8%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B_Creative_Commons&oldid=152790052&useparsoid=1 ruwiki:Лицензии и инструменты Creative Commons] == refs don't work with vector-2010 (but it works for vector-2022) [[User:Petsernik|Petsernik]] ([[User talk:Petsernik|talk]]) 23:05, 2 May 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Huawei&oldid=173270512&useparsoid=1 eswiki:Huawei] == El segundo sitio web que sale no existe es un vandalismo en wikimedia ingles o un error [[User:Usuario 016|Usuario 016]] ([[User talk:Usuario 016|talk]]) 23:15, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%8C%97%E6%9D%91%E8%81%A1&oldid=109365307&useparsoid=1 jawiki:北村聡] == 人名の曖昧さ回避Templateを挿入すると、上手く表示されず、大きな改行空白と共に「.mw-parser-output .dmbox{display:flex;align-items:center;clear:both;margin:0.9em 1em;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:0.25em 0.35em;font-size:95%}.mw-parser-output .dmbox>*{flex-shrink:0;margin:0 0.25em;display:inline}.mw-parser-output .dmbox-body{flex-grow:1;flex-shrink:1;padding:0.1em 0}」 というものが出る。 [[User:Geogie|Geogie]] ([[User talk:Geogie|talk]]) 23:35, 2 May 2026 (UTC) o69f5n3usb1zed3dfhdljxlk6khgt4d 8364396 8364384 2026-05-03T14:12:06Z Inkysponge2007 18367612 /* enwiki:User:Soetermans */ new section 8364396 wikitext text/x-wiki Post your feedback about using [[Parsoid/Parser Unification|Parsoid]] to render articles. [[Parsoid/Parser_Unification/Known_Issues|Learn how to report problems clearly]]. '''Need more attention? [https://phabricator.wikimedia.org/maniphest/task/edit/form/43/?projects=PHID-PROJ-3y2wduoz5xezwveaq426 Report directly in Phabricator].''' {{note|This is for reporting feedback on the integration of the Parsoid parser only. '''For wiki content issues, such as concerns about article content, please report on your local wiki.''' }} [[Parsoid/Parser_Unification/Known_Issues|View known issues]] __NEWSECTIONLINK__ {{Archive box| [[/Archive 1]] [[/Archive 2]]}} == [https://nl.wikipedia.org/w/index.php?title=Wikipedia:Aanmelding_moderatoren&oldid=70702688&useparsoid=1 nlwiki:Wikipedia:Aanmelding moderatoren] == Sometimes, in a numbered list, the number stays on the first line when there are indented lines below it, and sometimes the number is vertically aligned between the different lines. For votes, it is preferable that the number remains on the line that starts with only “#” and not on lines with an indentation “#:”. [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:34, 15 February 2026 (UTC) :i.e. see item 33. under '<nowiki/>'''''Voor moderatorschap ContextCreator'''<nowiki/>'<nowiki/>'' [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:36, 15 February 2026 (UTC) ::I can't see any difference between Parsoid and the legacy Parser on that page, it appears that the number is correctly aligned in both cases. Are you using a different skin by any chance? Does the difference still appear? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:42, 21 April 2026 (UTC) :::I see no difference anymore - it is fixed. Thanks anyway! [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 16:01, 21 April 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Discussion_Wikip%C3%A9dia:Wikiconcours&oldid=233327486&useformat=mobile&useparsoid=1 frwiki:Discussion Wikipédia:Wikiconcours] == Content that is hidden inside the "Learn more about this page" button from MobileFrontend with legacy parser is not inside it with Parsoid. [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 08:32, 22 February 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Laurence_Olivier&oldid=148833592&useparsoid=1 itwiki:Laurence Olivier] == Giant Oscar statue icons (sgranate) [[User:UmbraSolis|UmbraSolis]] ([[User talk:UmbraSolis|talk]]) 20:28, 19 February 2026 (UTC) :This was probably due to https://phabricator.wikimedia.org/T417828, which is now fixed. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:53, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:43, 21 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Bologna_Football_Club_1909&oldid=149496425&useparsoid=1 itwiki:Bologna Football Club 1909] == problem with displaying football shirts [[User:Gio Bike|Gio Bike]] ([[User talk:Gio Bike|talk]]) 17:49, 20 February 2026 (UTC) :Can you be more specific, or is it fixed now? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:55, 27 February 2026 (UTC) ::Now it is OK [[Special:Contributions/&#126;2026-13011-93|&#126;2026-13011-93]] ([[User talk:&#126;2026-13011-93|talk]]) 17:20, 27 February 2026 (UTC) :::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:44, 21 April 2026 (UTC) == [https://vi.wiktionary.org/w/index.php?title=Wiktionary:Th%E1%BB%91ng_k%C3%AA/S%E1%BB%91_m%E1%BB%A5c_t%E1%BB%AB_theo_ng%C3%B4n_ng%E1%BB%AF/T%E1%BA%A5t_c%E1%BA%A3&oldid=2331126&useparsoid=1 viwiktionary:Wiktionary:Thống kê/Số mục từ theo ngôn ngữ/Tất cả] == Phần cuối bảng bị lỗi, không hiện ra số mục từ mà chỉ hiện ra "0" hoặc "-2" mà không rõ lý do, tôi không viết nhầm gì cả. (English: The table got error, just display "0" or "-2", but I don't have any error at write wikitext.) [[User:NHNAnh|NHNAnh]] ([[User talk:NHNAnh|talk]]) 05:57, 21 February 2026 (UTC) :I believe this might be due to "Expensive parser function count: 1080/500" in the debug log: there are too many expensive parser function counts on this page (PAGESINCATEGORY is expensive), and the later functions are not executed. :I would suggest splitting the page into several pages, if possible. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:04, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) == [https://cs.wikipedia.org/w/index.php?title=Celerina/Schlarigna&oldid=25694456&useparsoid=1 cswiki:Celerina/Schlarigna] == V tabulce v sekci obyvatelstvo se u jedné buňky zobrazuje černé pozadí. Pokud dám ale historii stránky a podívám se na aktuální verzi, vykreslí se stránka správně. To samé se opakuje i u jiných podobných stránek se stejně formátovanými tabulkami. [[User:Matijak|Matijak]] ([[User talk:Matijak|talk]]) 17:02, 22 February 2026 (UTC) :I cannot see a black cell in that table. Is this issue fixed? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:09, 27 February 2026 (UTC) ::I can see it in in both the history (latest revision) and on the page itself (live). It's the leftmost 'Počet' cell in the 'Jazyky v Celerině' table. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 10:10, 28 February 2026 (UTC) :::Aha! :::the cell itself is not dark, the text in it is, and only in dark mode. It is also present in the legacy rendering, which seems to hint at a problem with the table markup itself and not a parser issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:11, 2 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) :::::Not a Parsoid issue most likely, but it has not been fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:21, 24 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia:Biographies_of_living_persons&oldid=1340299616&useparsoid=1 enwiki:Wikipedia:Biographies of living persons] == Reporting a visual bug for all pages that suddenly arose as of this morning on Safari Mobile - the Page Actions Overflow div is in a permanently open state but inaccessible to via clicks to either toggle the menu or select any of the tools on the menu. In addition to being unable to interact with it, all of the styling broken and makes the top right section of the page unusable and barely readable. [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 14:34, 27 February 2026 (UTC) :Is this issue still present? Sorry, it has been a while since you reported this, I'm hoping that the issue has been resolved by now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) ::Yes, it appears to have been resolved. Thanks for following up! [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 03:38, 22 April 2026 (UTC) == [https://oc.wikipedia.org/w/index.php?title=Esqu%C3%A8rra_(politica)&oldid=2495338&useparsoid=1 ocwiki:Esquèrra (politica)] == There's an issue with the interlinks, this article should be connected with the other ones about left-wing politics [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 06:39, 28 February 2026 (UTC) :Yes, it was an issue with the interlinks, but those should naturally not be reported as visual issues ('bogue visuler') as the have nothing to do with Parsoid. You can link pages which have no connections by using the 'Apondre los ligams interlengas' (Add interlanguage links) button from the 'Bóstia d'aisinas' (Tools) menu. Unless, of course, Parsoid somehow blocks automatic linking of translations. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:10, 28 February 2026 (UTC) ::I don't know why but it was finally done (thank you so much to the person who did that), but the thing is, i tried what you said before and it kept telling me that i didn't had the permission to link the two articles... [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 19:33, 1 March 2026 (UTC) :::I did that, you are welcome. It appears that you are not autoconfirmed yet on Wikidata, and that this Wikidata entry requires that, which if both true I would expect you to not be able to do this change. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 04:21, 21 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) :::::Sorry? [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:48, 23 April 2026 (UTC) ::::::We're using the <nowiki>{{done}}</nowiki> template to track which issues have been resolved, vs still outstanding. I don't believe there is any additional follow required by the Content Transform team on this report? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 05:00, 24 April 2026 (UTC) :::::::Oh, no, I just didn't know this is a system you are using. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:19, 24 April 2026 (UTC) == [https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/Page_translation_administration&oldid=8240537&useparsoid=1 Help:Extension:Translate/Page translation administration] == The topmost warning in the 'Changing the source text' section does not display the codeblock content. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:47, 28 February 2026 (UTC) :This is a very clever use of the <code><nowiki>{{^(}}</nowiki></code> template to avoid creating an unintended translation marker. I've [https://www.mediawiki.org/w/index.php?title=Help%3AExtension%3ATranslate%2FPage_translation_administration&diff=8349012&oldid=8343860 replaced it with more straight-forward entity-escaping] to be more compatible with Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:54, 21 April 2026 (UTC) ::Also filed this as [[phab:T424066]] [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 16:46, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&oldid=67999951&useparsoid=1 nlwiki:Railterminal Gelderland] == The map in [[:nl:sjabloon:maplink]] doesn't show up in my Chrome browser for Chromebook. It does show in https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&useparsoid=0 and also when I log out. [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:54, 5 March 2026 (UTC) :Btw, the map is visible for a moment, then it disappears [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:56, 5 March 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%91%D7%A8%D7%90%D7%95%D7%9C_%D7%A1%D7%98%D7%90%D7%A8%D7%A1&oldid=42870396&useparsoid=1 hewiki:בראול סטארס] == למה הקישור לתמונה ששמתי לא עובד? בכל מקרה אשמח שמישהו ישים את התמונה העדכנית שמשומשת בדף באנגלית מאחר והלוגו למשחק שונה. מצטער על התקלה. [[User:Jhho48|Jhho48]] ([[User talk:Jhho48|talk]]) 16:43, 9 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Infokastis: Sulamistemperatuur 236,15 K (−37 °C) Miinusmärk peaks olema sidekriipsust pikem, kuid pikema kriipsu sisestamine põhjustab tõrketeate. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:05, 11 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Vabandust, lühike (st vale) kriips oli kuvatud siiski ainult lähteteksti režiimis; salvestatud tekstiga küljendis on kuvatud õige kriips. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:07, 11 March 2026 (UTC) == kowiki:sticky header is broken == [[:en:Template:Sticky header|Template:Sticky header]] is not working properly on kowiki. Please compare [//ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=0] with [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=1].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:34, 16 March 2026 (UTC) :It may have been because of an empty row before the table caption. I [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&diff=41501849&oldid=41501840 edited the page] to remove it. But, looks like another editor has removed the sticky header template call from above the table. If you can put it back, it will work. See my [[:ko:사용자:SSastry_(WMF)/Sandbox|sandbox]] page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 03:22, 17 March 2026 (UTC) == [https://ko.wikipedia.org/w/index.php?title=%ED%8B%80:%EA%B5%AD%EA%B8%B0%EB%82%98%EB%9D%BC&oldid=40992836&useparsoid=1 kowiki:틀:국기나라] == 변수를 덧붙였음에도 {{국기나라|독일|제국}}이 여전히 '독일'로 출력됩니다. [[User:Triican|Triican]] ([[User talk:Triican|talk]]) 05:04, 19 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Angus_T._Jones&oldid=1333447723&useparsoid=1 enwiki:Angus T. Jones] == The infobox photo is squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 17:11, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Ukraine&oldid=1343921679&useparsoid=1 enwiki:Ukraine] == All maps in the infobox are squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 18:36, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Sabia_que&oldid=54991313&useparsoid=1 ptwiki:Wikipédia:Sabia que] == O arquivo de discussão está 'bugando' visualmente. Está no meio de "Curiosidades em destaque" [[User:Heylenny|Heylenny]] ([[User talk:Heylenny|talk]]) 23:27, 19 March 2026 (UTC) :{{done}} Template adjusted on the page. [[User:Fúlvio|Fúlvio]] ([[User talk:Fúlvio|talk]]) 02:59, 22 March 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%AC%E0%A6%BF%E0%A6%AE%E0%A6%B2_%E0%A6%98%E0%A7%8B%E0%A6%B7_(%E0%A6%B6%E0%A6%BF%E0%A6%B6%E0%A7%81%E0%A6%B8%E0%A6%BE%E0%A6%B9%E0%A6%BF%E0%A6%A4%E0%A7%8D%E0%A6%AF%E0%A6%BF%E0%A6%95)&oldid=8851768&useparsoid=1 bnwiki:বিমল ঘোষ (শিশুসাহিত্যিক)] == আলোচনা পাতায় অন্য নিবন্ধের আলোচনা পাতা [[User:Ams riyad|Ams riyad]] ([[User talk:Ams riyad|talk]]) 01:28, 20 March 2026 (UTC) == [https://vi.wikipedia.org/w/index.php?title=Wikipedia:Th%E1%BA%A3o_lu%E1%BA%ADn&oldid=74869958&useparsoid=1 viwiki:Wikipedia:Thảo luận] == TOC is rendered inside the link bar, but it shouldn't be. [[User:NguoiDungKhongDinhDanh|<span class="skin-invert" style="color:black;font-family:Monotype Corsiva;font-size:110%;font-weight:normal;line-height:normal">NguoiDungKhongDinhDanh</span>]] 03:20, 20 March 2026 (UTC) :This was most likely [[phab:T421629|T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] and we believe this issue has been fixed. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:51, 24 April 2026 (UTC) == [[wikt:ru:омфал]] == For more than a day, there have been anomalies in the behavior of tables of contents (ToCs) in Russian Wiktionary. The issues differ based on the selected skin and affect only some pages. If the old Vector theme is used, the automatically generated ToC simply fails to appear on certain pages, despite the page having over three headers and the absence of magic words such as NOTOC. If the new Vector theme is used, the ToC on some pages is misplaced and not positioned where it should be by default. The problem is not present if the old parser is used. Purging the page's cache seems to fix the issue as well. ToC is displayed correctly in the preview-mode too. Some affected pages: * [[wikt:ru:омфал]] * [[wikt:ru:безграмотность]] * [[wikt:ru:હંમેશા]] * [[wikt:ru:ಯಾವಾಗಲೂ]] * [[wikt:ru:stadigvæk]] * [[wikt:ru:alligevel]] * [[wikt:ru:kanunay]] * [[wikt:ru:ሁሌ]] * [[wikt:ru:zawżdy]] * and maaany mooore... [[User:綿貫桜哉|綿貫桜哉]] ([[User talk:綿貫桜哉|talk]]) 08:11, 20 March 2026 (UTC) :This was [[phab:T421629|⚓ T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] but should be fixed now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:55, 24 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Louis_Nirenberg&oldid=15616502&useparsoid=1 rowiki:Louis Nirenberg] == The image seems to be the 250px thumbnail scaled up to what looks like 400px width. [[User:Andrei Stroe|Andrei Stroe]] ([[User talk:Andrei Stroe|talk]]) 10:16, 20 March 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Aide:Accueil&oldid=232433495&useparsoid=1 frwiki:Aide:Accueil] == custom collapsible elements render differently with parsoid [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 14:19, 20 March 2026 (UTC) :I filed https://phabricator.wikimedia.org/T421859. Thanks for the report. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:07, 31 March 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Katten_(olika_betydelser)&oldid=43770842&useparsoid=1 svwiki:Katten (olika betydelser)] == The legacy parser adds an empty line before the template Förgrening (which is a kind of table). The Parsoid parser don't do that. This occurs on all pages using that template. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 18:32, 21 March 2026 (UTC) :Ya, this is known difference with some paragraph wrapping which is tricky to fix. In this case, I recommend adjusting the top margin of the table by editing the base template: https://sv.wikipedia.org/w/index.php?title=Mall%3AF%C3%B6rgrening%20bas&veaction=editsource [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:01, 31 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Gen_Z_stare&oldid=1344701043&useparsoid=1 enwiki:Gen Z stare] == The infobox image is unusually narrow. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 01:51, 22 March 2026 (UTC) :For me the image is stretched horizontally by a fair bit. It seems like the following bit of code is to blame: :<syntaxhighlight lang="css"> :html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img {width: 400px; } :</syntaxhighlight> [[User:Sohom Datta|Sohom]] ([[User talk:Sohom Datta|talk]]) 01:54, 22 March 2026 (UTC) ::I'm not seeing any visible difference between legacy parser and Parsoid in my testing. Can you share a screenshot @[[User:Snowmanonahoe|Snowmanonahoe]] ? What skin and browser are you using? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 17:43, 27 March 2026 (UTC) :::@[[User:Jon (WMF)|Jon (WMF)]]: I don't see it anymore either. I'm using Vector 2022 and Firefox 149. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 17:46, 27 March 2026 (UTC) ::::Ah okay. I think this was a caching issue then. Some "temporary turbulence" was to be expected with this roll out. Thanks for reporting! [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 18:29, 27 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Virginia_Fonseca&oldid=71959182&useparsoid=1 ptwiki:Virginia Fonseca] == A 1ª imagem da página na infocaixa tem um tamanho grande demais [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 11:34, 22 March 2026 (UTC) :I don't see the problem. The page renders identically in Parsoid and with the old/legacy parser. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:22, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Xander_Harris&oldid=71958675&useparsoid=1 ptwiki:Xander Harris] == Seção de referências expandida [[User:Vitruviano|Vitruviano]] ([[User talk:Vitruviano|talk]]) 15:06, 22 March 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Bruker:Znuddel&oldid=25704667&useparsoid=1 nowiki:Bruker:Znuddel] == Hele siden er helt feil [[User:Nevemagneten|Nevemagneten]] ([[User talk:Nevemagneten|talk]]) 20:35, 24 March 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Main_page&oldid=2122&useparsoid=1 abstractwiki:Abstract Wikipedia:Main page] == Favicon is showing a dark background around the rounded corners on Chrome. [[User:Jsengupt|Jsengupt]] ([[User talk:Jsengupt|talk]]) 16:14, 25 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=System_(typeface)&oldid=1329545007&useparsoid=1 enwiki:System (typeface)] == Infobox image is stretched horizontally [[User:Anna328p|Anna328p]] ([[User talk:Anna328p|talk]]) 06:59, 26 March 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Enged%C3%A9lyk%C3%A9r%C3%A9s&oldid=28288240&useparsoid=1 huwiki:Wikipédia:Engedélykérés] == The email templates are rendered incorrectly. [[User:Bencemac|Bencemac]] ([[User talk:Bencemac|talk]]) 14:00, 26 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T421563 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:19, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Usu%C3%A1rio(a):Inter-rede/Cabe%C3%A7alho&oldid=71778331&useparsoid=1 ptwiki:Usuário(a):Inter-rede/Cabeçalho] == Whitespaces seem to have collapsed [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 18:02, 27 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422155 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:36, 2 April 2026 (UTC) ::It looks like the problem is the <code>display:flex</code> in the <code>style</code> attribute on the wrapper is at fault. Parsoid generates <code><nowiki><span></nowiki></code> wrappers around the html entities in the wikitext, by design. The whitespace is present in the HTML, so that's not a fault of Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:07, 9 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%91%D7%A6%D7%A2_%D7%9E%D7%A9%D7%94_(%D7%9E%D7%9C%D7%97%D7%9E%D7%AA_%D7%94%D7%A2%D7%A6%D7%9E%D7%90%D7%95%D7%AA)&oldid=42991233&useparsoid=1 hewiki:מבצע משה (מלחמת העצמאות)] == הכיתוב שנועד למנוע בלבול בין מבצע משה הזה למבצע משה אחר לא ערוך [[User:חנניה בלסמן|חנניה בלסמן]] ([[User talk:חנניה בלסמן|talk]]) 12:54, 30 March 2026 (UTC) == [//en.wikipedia.org/w/index.php?title=Help:Colon_trick&useparsoid=1 enwiki:Help:Colon trick] == According to [[w:Help:Colon trick]], it is explained as follows: "<code><nowiki>[[//Hus]]</nowiki></code> will produce an (invalid) external link wrapped in brackets ("[[//Hus]]"), but <code><nowiki>[[://Hus]]</nowiki></code> will produce a link to [[w://Hus|//Hus]]." However, when using Parsoid, it incorrectly links to [[w:Help:Colon trick//Hus|Help:Colon trick//Hus]].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:02, 31 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422161 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 14:00, 2 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Ans%C3%B6kan_om_administrativ_beh%C3%B6righet&oldid=59167563&useparsoid=1 svwiki:Wikipedia:Ansökan om administrativ behörighet] == In Legacy, each section (candidate) get a [redigera] ([edit] to the right of the section name. In Parsoid, there is nothing to the right of the section name. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 12:15, 2 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T391624 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:27, 2 April 2026 (UTC) == [https://en.wiktionary.org/w/index.php?title=H%26P&oldid=83856321&useparsoid=1 enwiktionary:H&P] == The first hidden category listed is [[wiktionary:Category:English_entries_with_incorrect_language_header|English entries with incorrect language header]]'','' which is, however, empty. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:48, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Jo%C3%A3o_Peixoto&oldid=72016744&useparsoid=1 ptwiki:João Peixoto] == A foto não corresponde ao nome citado [[User:Mayque Lemos|Mayque Lemos]] ([[User talk:Mayque Lemos|talk]]) 18:18, 2 April 2026 (UTC) == [https://meta.wikimedia.org/w/index.php?title=Main_Page&oldid=30254797&useparsoid=1 metawiki:Main Page] == On Parsoid only, <nowiki>''complete list'' and ''request''</nowiki> each show a space between them and their preceding opening bracket. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 19:06, 3 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&oldid=1343194045&useparsoid=1 enwiki:In Stars and Time] == <code>&lt;ref name="rps"&gt;</code> displays an error which doesn’t occur on the legacy parser [[User:Mir Novov|Mir Novov]] ([[User talk:Mir Novov|talk]]) 12:10, 4 April 2026 (UTC) :It was an error which I fixed with [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&diff=1348021667&oldid=1347424445 this edit] which adds one more backlink to Ref #5. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:00, 10 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Helen_Andrews&oldid=72024590&useparsoid=1 ptwiki:Helen Andrews] == Estou a ter problema com as referências, pois aparecem duplicadas. [[User:Faviola7|Faviola7]] ([[User talk:Faviola7|talk]]) 14:17, 4 April 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Project_chat&oldid=3236&useparsoid=1 abstractwiki:Abstract Wikipedia:Project chat] == In the "Bot request" section, a link that has been visited is blue rather than purple, because spaces in the link are turned into actual spaces (%20) in the URL. [[User:JJPMaster|JJP]]<sub>[[User talk:JJPMaster|Mas]]<sub>[[Special:Contributions/JJPMaster|ter]]</sub></sub> ([[wikt:she|she]]/[[wikt:they|they]]) 21:53, 4 April 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Tor_Fosse_(f%C3%B8dt_1956)&oldid=25723619&useparsoid=1 nowiki:Tor Fosse (født 1956)] == fil: center frameless [[User:Birgit.H.Pihl|Birgit.H.Pihl]] ([[User talk:Birgit.H.Pihl|talk]]) 10:05, 5 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Politisk_opposition&oldid=59171124&useparsoid=1 svwiki:Politisk opposition] == This error message about unused named reference is not shown: Referensfel: <ref>-tagg med namn "sr-20161006", definierad i <references> används inte tidigare i texten. The article is also added to hidden category "Sidor med referensfel" but that is not shown [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:12, 5 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Puteulum/Sandbox&oldid=150100596&useparsoid=1 itwiki:Utente:Puteulum/Sandbox] == The "Move" button to move the entry from sandbox to NS0 does not appear [[User:Puteulum|Puteulum]] ([[User talk:Puteulum|talk]]) 14:28, 7 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=POVOADO_TIRIRICAL&oldid=72040530&useparsoid=1 ptwiki:POVOADO TIRIRICAL] == O MEU TEXTO ESTA TODO VERMELHO E MAIS CENTRALIZADO [[User:POVOADO TIRIRICAL|POVOADO TIRIRICAL]] ([[User talk:POVOADO TIRIRICAL|talk]]) 18:38, 7 April 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%B1%E4%BA%AC%E9%83%BD%E9%81%935%E5%8F%B7%E6%96%B0%E5%AE%BF%E9%9D%92%E6%A2%85%E7%B7%9A&oldid=108985336&useparsoid=1 jawiki:東京都道5号新宿青梅線] == ヘッダー付近に編集ミスと思われし文言あり [[User:QWERTYKeyboard0570|QWERTYKeyboard0570]] ([[User talk:QWERTYKeyboard0570|talk]]) 08:56, 8 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=2022_Oder_environmental_disaster&oldid=1344570432&useparsoid=1 enwiki:2022 Oder environmental disaster] == After a second, the actual map from the infobox (not the buttons) is replaced with a placeholder icon and text (clicking in the field still works). [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 11:56, 8 April 2026 (UTC) :Could it have been a transient issue? I cannot reproduce this right now. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:03, 10 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Commissione_arbitrale/Domande&oldid=150049601&useparsoid=1 itwiki:Wikipedia:Commissione arbitrale/Domande] == This page is related to the itwiki ArbCom election. Section edit links were not shown, making it difficult to ask questions to candidates. This has since been worked around with [[:it:special:diff/150118322|this edit]] and is likely related to [[phab:T387520|T387520]]. [[User:Titore|Titore]] ([[User talk:Titore|talk]]) 19:58, 8 April 2026 (UTC) :Thanks for this report. This is on our list of high priority tasks to fix and we are going to pick up shortly. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:53, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Kurier&oldid=266019405&useparsoid=1 dewiki:Wikipedia:Kurier] == das Diagramm zum Beitrag "Ein Wal ..." überragt den Text der rechten Spalte. [[User:Michael w|Michael w]] ([[User talk:Michael w|talk]]) 08:10, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034&useparsoid=1 dewiki:Wikipedia:Fragen zur Wikipedia] == <nowiki>& s h y ;</nowiki> is ignored. See the test on https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034#&_s_h_y_; [[User:Raymond|Raymond]] ([[User talk:Raymond|talk]]) 09:55, 10 April 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422960 for this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:55, 10 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Faktafr%C3%A5gor&oldid=59190040&useparsoid=1 svwiki:Wikipedia:Faktafrågor] == Svara-funktionen fungerar inte med Parsoid. När jag klickar på Svara för något inlägg, vilket som helst, dyker svarsrutan upp längst ner på sidan, efter den senaste diskussionstråden. Med den äldre parsern fungerar det. [[User:Larske|Larske]] ([[User talk:Larske|talk]]) 11:12, 10 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Cornelis_de_Bruijn_Martinuszoon&oldid=70921577&useparsoid=1 nlwiki:Cornelis de Bruijn Martinuszoon] == De pagina-afbeelding is de handtekening van C. de Bruijn Mz. Ik denk dat zijn afbeelding in de spotprent een betere pagina-afbeelding is. Het zou kunnen dat Parsoid/Wikipedia deze niet 'pakt' omdat de dimensies tijdens een eerdere bewerking zijn aangepast. Alvast bedankt! [[User:Jelledebruijn|Jelledebruijn]] ([[User talk:Jelledebruijn|talk]]) 16:31, 10 April 2026 (UTC) :I think you might have seen a version of the page before the cache was updated. I just checked and the image is identical with Parsoid and the older parse. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:46, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=The_Punisher_(2004)&oldid=263259949&useparsoid=1 dewiki:The Punisher (2004)] == Dead link template Vorlage:Toter Link (https://de.wikipedia.org/wiki/Vorlage:Toter_Link) after url is no longer working but gets part of the Link. (example https://de.wikipedia.org/wiki/The_Punisher_(2004)#cite_note-5 ) [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:23, 10 April 2026 (UTC) :Example without Parsoid: https://de.wikipedia.org/wiki/The_Punisher_(2004)?useparsoid=0#cite_note-5 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:57, 10 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T368724 but ideally, the template will be added with a space after the link. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:24, 11 April 2026 (UTC) ::Unfortunately it's added by the InternetArchiveBot that way: https://de.wikipedia.org/w/index.php?title=Liste_aktiver_Brauereien_in_Deutschland&diff=prev&oldid=265857281 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 06:45, 11 April 2026 (UTC) :::@[[User:SSastry (WMF)|SSastry (WMF)]]: But it is not good if the preview shows us a different result than the version that is subsequently published. InternetArchiveBot inserts it without spaces. The task is prioritized as Low, but since we have this thousands of times in the article inventory (and it used to work before), the task should be reprioritized to Higher. And the preview should always show the same result that I get after publishing. What do we do with the Phab task now? How do we handle this bug? Thank you, [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 09:12, 11 April 2026 (UTC) ::::We will fix the preview path separately. But, for this specifically, I'll flag this for the team to see how we want to handle this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:33, 11 April 2026 (UTC) :::::@[[User:SSastry (WMF)|SSastry (WMF)]]: Oh thank you, keep us up to date here please. [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 16:35, 11 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Marlon_Ganchozo&oldid=172919968&useparsoid=1 eswiki:Marlon Ganchozo] == No sale el resto de la información del, jugador [[User:Didierlpz06|Didierlpz06]] ([[User talk:Didierlpz06|talk]]) 19:04, 10 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 eswiki:Temporada regular de la Euroliga 2025-26] == no se sustituyen correctamente las ultimas plantillas [[User:Hugogs02|Hugogs02]] ([[User talk:Hugogs02|talk]]) 08:42, 11 April 2026 (UTC) :This page is too large post-template expansion. Observe that the templates at the end are not expanded neither in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 Parsoid] nor in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=0 Legacy]; the legacy parser just happens to expand a few more at the end of the page due to [https://phabricator.wikimedia.org/T392262 T392262]. The page should probably be split. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:13, 13 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Uniforme_de_la_selecci%C3%B3n_de_f%C3%BAtbol_de_Argentina&oldid=172883243&useparsoid=1 eswiki:Uniforme de la selección de fútbol de Argentina] == En la plantilla de uniforme de fútbol algunos uniformes se ven con las mangas más bajas respecto al archivo del cuerpo, dejando lineas de un pixel por encima con los colores de fondo en dicha plantilla. [[User:Lobo kun mfc|Lobo kun mfc]] ([[User talk:Lobo kun mfc|talk]]) 13:58, 11 April 2026 (UTC) :The lines displayed on top of the uniforms are present both in Parsoid and in the Legacy parser, and they do seem to vary slightly depending on the browser (I've looked on Firefox and Chrome, both on Linux, and they were not consistent between both browsers). :I believe this issue should be fixed on the template side (at a guess, the <code>style="color: inherit; background-color:#000040;"</code> that I see on the various image divs may well show up depending on the exact HTML structure and/or image) [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:23, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Liste_der_Radschnellverbindungen_in_Deutschland&oldid=266034807&useparsoid=1 dewiki:Liste der Radschnellverbindungen in Deutschland] == Hallo, beim Artikel [[Liste der Radschnellverbindungen in Deutschland]] wird die Beschreibung der MapLink-Karte wird nicht gescheid gerendert. Statt einem hochgestellten <code>[7]</code> wird <code>Karte der bestehenden Radschnellwege in Deutschland'"`UNIQ--ref-00000008-QINU`"'</code> gerendert. Das Problem ist serverseitig und tritt beim Legacy-Parser nicht auf. LG [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 16:02, 11 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T383004 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:06, 11 April 2026 (UTC) ::thanks! [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 14:13, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Louis_Franchet_d%E2%80%99Esp%C3%A8rey&oldid=266076416&useparsoid=1 dewiki:Louis Franchet d’Espèrey] == Bildumfluss nicht wie üblich [[User:Alfred Kiefer|Alfred Kiefer]] ([[User talk:Alfred Kiefer|talk]]) 19:30, 11 April 2026 (UTC) :This issue has been fixed in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1269534 and should be deployed to production this week. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:34, 13 April 2026 (UTC) == [https://bn.wiktionary.org/w/index.php?title=%E0%A6%AA%E0%A7%8D%E0%A6%B0%E0%A6%A7%E0%A6%BE%E0%A6%A8_%E0%A6%AA%E0%A6%BE%E0%A6%A4%E0%A6%BE&oldid=250894&useparsoid=1 bnwiktionary:প্রধান পাতা] == The ‘ শব্দছবি’ section is overflowing with Parsoid; thus does not happen when the legacy parser is used. [[User:Redmin|Redmin]] ([[User talk:Redmin|talk]]) 08:09, 12 April 2026 (UTC) :Since the section seems to be randomized, it's pretty hard to see which version of this section is overflowing (the ones I see do not seem to). Would you be able to provide more information/a screenshot? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:49, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Hamburg&oldid=266087257&useparsoid=1 dewiki:Wikipedia:Hamburg] == Abschnittsbearbeitungen nicht mehr möglich, Link fehlt. Betrifft einige WP-Seiten wie auch [[:de:Wikipedia:Stammtisch München]] oder auch nur einige Überschriften von [[:de:Vorlage:Coordinate]], also nicht immer komplette Seiten. [[User:NordNordWest|NordNordWest]] ([[User talk:NordNordWest|talk]]) 12:12, 12 April 2026 (UTC) :We have a number of issues with section edit links (documented in https://phabricator.wikimedia.org/T391624) that we intend to fix; sorry for the inconvenience - we'll make sure to keep this use case in mind when working on a solution. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:20, 23 April 2026 (UTC) == [https://zh.wikipedia.org/w/index.php?title=COBOL&oldid=91149855&useparsoid=1 zhwiki:COBOL] == 正文开头的“COBOL”英文名无法显示,且全文的繁简转换失效。 The English name "COBOL" for COBOL at the very beginning vanished. Besides, the conversion between traditional and simplified Chinese does not function for the entire page. [[User:Ricky136973|Ricky136973]] ([[User talk:Ricky136973|talk]]) 13:08, 12 April 2026 (UTC) :Parsoid should not (yet) be enabled on zhwiki. If you want to preview how it will work, you can add <code>&parsoidnewlc=1</code> to the end of the URL to use Parsoid's implementation of LanguageConverter. That shows "COBOL" on this page as expected. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:17, 13 April 2026 (UTC) ::Parsoid is now experimentally enabled, so you don't need the `&parsoidnewlc=1` at the end of the URL any more. It appears that the COBOL page renders correctly now? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:40, 21 April 2026 (UTC) == [https://th.wikipedia.org/w/index.php?title=4_%E0%B9%80%E0%B8%97%E0%B8%9E%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B8%9E%E0%B8%B4%E0%B8%97%E0%B8%B1%E0%B8%81%E0%B8%A9%E0%B9%8C&oldid=12947833&useparsoid=1 thwiki:4 เทพผู้พิทักษ์] == อันนี้น่าจะผิดที่ร้องเพลงประกอบละคร [[User:ภรพัฒน์|ภรพัฒน์]] ([[User talk:ภรพัฒน์|talk]]) 12:47, 13 April 2026 (UTC) :Google translate says, "This is probably a mistake—singing the theme song for a TV drama." :This seems like a content issue, not a Parsoid issue. Mistakes in content should be correctly directly on the wiki. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:47, 21 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:%D7%A9%D7%A8%D7%A9%D7%97%D7%95%D7%9F/%D7%98%D7%99%D7%95%D7%98%D7%94&oldid=42822143&useparsoid=1 hewiki:משתמש:שרשחון/טיוטה] == אני רוצה לבטל את המצאות השם יעל סרלין בדף הטיוטות שלי כדי להתחיל ערך חדש [[User:שרשחון|שרשחון]] ([[User talk:שרשחון|talk]]) 12:59, 13 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Acidente_radiol%C3%B3gico_de_Goi%C3%A2nia&oldid=72061996&useparsoid=1 ptwiki:Acidente radiológico de Goiânia] == [[File:Captura_de_tela_de_miniaturas_renderizadas_pelo_Parsoid.png|thumb|250x250px]] As miniaturas estão minúsculas com as margens enormes. [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 15:13, 13 April 2026 (UTC) :It seems to be like this due to :<pre>html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img[width="250"] { width: calc(round(400px * var(--mw-file-upright,1),10px)) }</pre> [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 17:48, 19 April 2026 (UTC) ::{{Tracked|T423676}} [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) ::This should have been fixed by a backport we did yesterday. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:48, 21 April 2026 (UTC) == [https://hr.wikipedia.org/w/index.php?title=Marijana_Bijeli%C4%87&oldid=7429126&useparsoid=1 hrwiki:Marijana Bijelić] == Sve je podvuceno a ne treba tako biti [[User:Nikolica1512|Nikolica1512]] ([[User talk:Nikolica1512|talk]]) 17:08, 13 April 2026 (UTC) :I made some edits for you [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 18:32, 13 April 2026 (UTC) ::Thank you, I ameliorated those problematic parts, could you take a look at it? I hope it is good to go now as an article on wikipedia so people could access it. This person deserves to have a wiki page. ::Regards, [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 21:53, 13 April 2026 (UTC) :::Sorry, no. I was only helping with the syntax error. You'll need to take your request to the hrwiki community [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 22:25, 13 April 2026 (UTC) ::::And how do I do that exactly? Could you help me out with it? [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 22:56, 13 April 2026 (UTC) :::::You can ask on [[:hr:Wikipedija:Kafić]] and I'm sure someone there will help you out [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 00:34, 14 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 dewiki:Hilfe:Parserfunktionen] == Headings which use <code><nowiki><includeonly></nowiki></code> to change nesting level when transcluded don't appear as headings on original page [[User:TheFirstLevelDown|TheFirstLevelDown]] ([[User talk:TheFirstLevelDown|talk]]) 00:01, 14 April 2026 (UTC) :Parsoid does not support gluing heading together like the legacy parser did, so this syntax is not supported. :As an alternative, we suggest something like (to adjust depending on your exact use case) :<syntaxhighlight lang="wikitext"> <includeonly>===== title =====</includeonly> <noinclude>=== title ===</noinclude> </syntaxhighlight> :or, for a less robust version (but that doesn't require repeating the title) :<syntaxhighlight lang="wikitext"> <includeonly>=====</includeonly><noinclude>===</noinclude> title <includeonly>=====</includeonly><noinclude>===</noinclude> </syntaxhighlight> [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 12:45, 14 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Amor_eterno_una_tragedia_anunciada&oldid=172974810&useparsoid=1 eswiki:Amor eterno una tragedia anunciada] == el título de la página está como "Amor eterno una tragedia anunciada" y no deja cambiarlo al original que es "Amor Eterno: Una tragedia anunciada" [[User:Goodfriendspictures|Goodfriendspictures]] ([[User talk:Goodfriendspictures|talk]]) 09:59, 14 April 2026 (UTC) :To me it looks like the [[DISPLAYTITLE]] magic word is disabled though {{wg|AllowDisplayTitle}} in eswiki. Nothing to do with Parsoid. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 10:12, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:TanjaKo/Sandbox&oldid=150217478&useparsoid=1 itwiki:Utente:TanjaKo/Sandbox] == Nel testo non sono presenti errori e le frasi sono sottolineate con una linea rossa ondulata. Come risolverlo visual bug? Grazie [[User:TanjaKo|TanjaKo]] ([[User talk:TanjaKo|talk]]) 17:42, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Raduni/Raduni_in_Sicilia_2026&oldid=150224594&useparsoid=1 itwiki:Wikipedia:Raduni/Raduni in Sicilia 2026] == just on iPhone 14 with iOS 18.7.7 both from safari or chrome and both from logged or unlogged and incognito mode, the last number of the participants list (made with "#") is bigger than the others [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 18:31, 15 April 2026 (UTC) == [https://atj.wikipedia.org/w/index.php?title=Otitikowin&oldid=16878&useparsoid=1 atjwiki:Otitikowin] == pas moyen de travailler en mode visuel sur la page [[User:Luc Patin|Luc Patin]] ([[User talk:Luc Patin|talk]]) 14:56, 16 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Zhang_Zeduan&oldid=173032341&useparsoid=1 eswiki:Zhang Zeduan] == La pagina está incompleta e inpublicable [[User:Mikemj1987|Mikemj1987]] ([[User talk:Mikemj1987|talk]]) 22:08, 17 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:08, 20 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=L%C3%ADnea_E3_(Euskotren_Trena)&oldid=173034070&useparsoid=1 eswiki:Línea E3 (Euskotren Trena)] == La imagen se ve un poco mal por el modo oscuro. [[User:UnniMan|UnniMan]] ([[User talk:UnniMan|talk]]) 00:55, 18 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:09, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Stadtbahn_Karlsruhe&oldid=265878452&useparsoid=1 dewiki:Stadtbahn Karlsruhe] == Shows reference error and the categoy Kategorie:Wikipedia:Seite mit Einzelnachweisfehlern but is not included in https://de.wikipedia.org/wiki/Kategorie:Wikipedia:Seite_mit_Einzelnachweisfehlern The same happens with other articles that had no reference errors with the old parser. Makes maintenance hard. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 09:26, 19 April 2026 (UTC) :Tracked in https://phabricator.wikimedia.org/T423924 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Indiana_Jones_and_the_Fate_of_Atlantis&oldid=265815741&useparsoid=1 dewiki:Indiana Jones and the Fate of Atlantis] == Shows a reference error that is not visible in the preview function. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:06, 19 April 2026 (UTC) :The error came through a Reference with the same name in a used template https://de.wikipedia.org/wiki/Vorlage:Verkaufszahlen_LucasArts_Adventures Still bad to have an error that wasn't there with the old parser and isn't shown in the preview or maintenance category. --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:27, 19 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Evento_Azolla&oldid=72103944&useparsoid=1 ptwiki:Evento Azolla] == [Convert: número inválido] na parte de Efeitos Globais [[User:Marina Funez|Marina Funez]] ([[User talk:Marina Funez|talk]]) 00:28, 20 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:10, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Musikk%C3%A1r&oldid=144140&useparsoid=1 smnwiki:Myenster:Musikkár] == Instead of dealing with this issue and the other issue on smnwiki listed below, these were quietly archived. These are still displaying messed up months later after they were reported the first time. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:53, 20 April 2026 (UTC) :We may have missed this previously, but edits like [https://smn.wikipedia.org/w/index.php?title=Myenster%3AMusikk%C3%A1r&diff=152826&oldid=144359 this] should fix the rendering. This should work for the other pages below as well. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 12:42, 20 April 2026 (UTC) ::Thank you. I'll do the same for any other templates I come across that display like that one did. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 15:49, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Diskografia&oldid=62663&useparsoid=1 smnwiki:Myenster:Diskografia] == Instead of dealing with this issue and the other issue on smnwiki listed above, these were quietly archived. These are still displaying messed up months later after they were reported the first time. -[[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Kirje%C4%8D%C3%A4llee&oldid=32928&useparsoid=1 smnwiki:Myenster:Kirječällee] == Like the other display issues in smnwiki, this is also displaying messed up after the change. [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. For all other pages you encounter on wiki like this, please make similar edits. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Donald_A._Wollheim&oldid=266357315&useparsoid=1 dewiki:Donald A. Wollheim] == Picture is shown within a big white box, which isn't the case with the old parser. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 11:15, 20 April 2026 (UTC) :[[phab:T421524]] [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe_Diskussion:Bilder&oldid=266370955&useparsoid=1 dewiki:Hilfe Diskussion:Bilder] == see [[w:de:Hilfe Diskussion:Bilder #Skalierung von Bildern mit dem Parameter hochkant scheint nicht mehr zu funktionieren]] [[User:BurghardRichter|BurghardRichter]] ([[User talk:BurghardRichter|talk]]) 22:24, 20 April 2026 (UTC) == [https://tcy.wikipedia.org/w/index.php?title=%E0%B2%AE%E0%B3%81%E0%B2%96%E0%B3%8D%E0%B2%AF_%E0%B2%AA%E0%B3%81%E0%B2%9F&oldid=359337&useparsoid=1 tcywiki:ಮುಖ್ಯ ಪುಟ] == in main page not enable <code>html.skin-theme-clientpref-night</code> [[User:ChiK|ChiK]] ([[User talk:ChiK|talk]]) 05:47, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:23, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == https://de.wikipedia.org/wiki/Gemeindestandsver%C3%A4nderungen_in_der_Schweiz == Die Links zu den Ankern gehen nicht [[Special:Contributions/&#126;2026-24437-27|&#126;2026-24437-27]] ([[User talk:&#126;2026-24437-27|talk]]) 11:53, 21 April 2026 (UTC) :I see you found a solution :) :For the exact issue: generating ids independently from their enclosing tag is not supported by Parsoid (although this is not documented - I'll fix that). :Thanks for the report! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:16, 21 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Albosaggia&oldid=50063504&useparsoid=1 svwiki:Albosaggia] == This article, and thousands of other articles, have erroneously been put in hidden categories [[:sv:Kategori:Sidor med referensfel]] and [[:sv:Kategori:Wikipedia:Projekt översätta källmallar]]. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 12:24, 21 April 2026 (UTC) :You can mark this issue as fixed. The problem root cause was in a new Template and Module created this morning. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:40, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Eurovision_Song_Contest_1992&oldid=258716277&useparsoid=1 dewiki:Eurovision Song Contest 1992] == Quelltext bearbeiten ist für Abschnitte nicht sichtbar [[User:Anmey10112|Anmey10112]] ([[User talk:Anmey10112|talk]]) 13:00, 21 April 2026 (UTC) :Translation: "Edit source" is not visible for sections. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Boro%C8%99e%C8%99ti,_Ia%C8%99i&oldid=17665231&useparsoid=1 rowiki:Boroșești, Iași] == Satul este Borosești nu Boroșești. [[User:Stalmada|Stalmada]] ([[User talk:Stalmada|talk]]) 13:07, 21 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:09, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Gebouwge%C3%AFntegreerde_zonnepanelen_(BIPV)&oldid=71021732&useparsoid=1 nlwiki:Gebouwgeïntegreerde zonnepanelen (BIPV)] == Bij de afbeeldingen zijn 3 afbeeldingen gecombineerd met de sjabloon {{Afbeelding combi}} . De sjabloon maakt gebruikt van elk aparte tekstvelden voor elke afbeeldingen. Echter is in dit geval bij de eerste twee afbeeldingen geen gebruik gemaakt van tekstveld en is al de tekst aan het eind geplaatst bij de laatste afbeelding. Door dit gebruik van de sjabloon worden de afbeeldingen zonder spatie direct na elkaar vertoont. Op de mobiele website worden de afbeeldingen met dit sjabloon wel met spaties vertoont. Merk op dat de engelse template wel de mogelijkheid heeft om afbeeldingen gecombineerd te laten zien met spaties er tussen en heeft deze variant template meer mogelijkheden dan de NL versie. Mogelijk dat er de uitwerkin ook niet helemaal correct is geweest, maar hierover is niet te oordelen vanwege de beperkte Wiki edit kennis. [[User:Public-Publicity|Public-Publicity]] ([[User talk:Public-Publicity|talk]]) 16:16, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:22, 21 April 2026 (UTC) :Translation: "In this section, three images have been combined using the template `Template:Afbeelding combi`. This template typically utilizes a separate text field for each individual image; however, in this specific instance, the text fields for the first two images were left unused, and all the accompanying text was instead placed at the end, alongside the final image. As a result of this specific application of the template, the images are displayed consecutively without any spacing between them. On the mobile version of the website, however, images utilizing this template *are* displayed with spacing. It is worth noting that the English-language version of this template *does* offer the capability to display combined images with spacing in between—making that variant of the template more versatile than its Dutch counterpart. It is possible that the implementation itself was not entirely correct; however, it is difficult to pass judgment on this matter due to limited expertise in Wiki editing." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:12, 23 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Talk:Rao_Laxmi_Chand&oldid=10828084&useparsoid=1 simplewiki:Talk:Rao Laxmi Chand] == This Page is fake and all the information is fake [[User:Rao Gourav|Rao Gourav]] ([[User talk:Rao Gourav|talk]]) 17:23, 21 April 2026 (UTC) :Triage: Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:28, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:07, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80%D0%BE%D0%B2%D1%81%D0%BA%D0%B8%D0%B9,_%D0%A1%D1%82%D0%B5%D0%BF%D0%B0%D0%BD_%D0%A4%D1%91%D0%B4%D0%BE%D1%80%D0%BE%D0%B2%D0%B8%D1%87&oldid=152793914&useparsoid=1 ruwiki:Александровский, Степан Фёдорович] == дублируется реф в инфобоксе [[User:Gleb95|Gleb95]] ([[User talk:Gleb95|talk]]) 20:21, 21 April 2026 (UTC) :Translation: "The reference is duplicated in the infobox." :The legacy parser version has 19 references in the references list, and Parsoid contains 22. This is likely a content issue, although I haven't looked into it to determine root cause. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:11, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is plenty of problems I see related to transliteration to Serbian Cyrillic. I prefer reading articles in Serbian Cyrillic (on top of our UI, I select "Ћирилица"). In current state, Parsoid should not be turned on at all on our Wikipedia {{multiple image | align = center | total_width = 1000 | image1 = Jefri Saks (no Parsoid).png | caption1 = Without Parsoid | image2 = Jefri Saks (Parsoid).png | caption2 = With Parsoid }} Note that, with Parsoid, everything is transliterated, even when marked with correct <nowiki><lang></nowiki> attribute. Without parsoid, original English text is correctly left un-transliterated. There is also a glitch where URL is not rendered in infoboxes, again, probably something about misrendering text which was supposed to avoid transliteration. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:43, 21 April 2026 (UTC) :This is [[phab:T424159|T424159 [P0] Parsoid doesn't "guessVariant" at top level on Serbian Wikipedia, and makes sr-ec rendering "unusable" for some pages]]. Fundamentally, the mark up on that page is incorrect, in so far as English and Latin text aren't properly marked with `-{....}-`. It "worked before" because of a top-level "guessVariant" routine which effectively disabled language converter entirely on some pages, including this one. I suspect I'm going to have to implement the same 'guessVariant' mechanism in Parsoid, since there appears to be too much content of this type without proper language markers. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:04, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is no "Edit with migration tool" entry in tools on Serbian Wikipedia. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:50, 21 April 2026 (UTC) :It needs to be enabled explicitly in Preferences > Editing > Developer tools > Enable parser migration tool. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:44, 23 April 2026 (UTC) == includeonly in headline syntax == no longer resolved properly == ''Example:'' [[w:de:Hilfe:Parserfunktionen]] This page (and many others of our help pages) are made for dual use: # stand alone # transclusion of several help pages of similar topic into a combined complete story. They contain headlines like <syntaxhighlight lang="wikitext"> <includeonly>=</includeonly>== Allgemeines ==<includeonly>=</includeonly> </syntaxhighlight> If stand alone, this shall be displayed as H2. * When combined, the page title will be shown as H2 and the section as H3. Swift solution most welcome – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:23, 22 April 2026 (UTC) : BTW – transclusion works correctly: [[w:de:Hilfe:Parserfunktionen/*]] --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:27, 22 April 2026 (UTC) :https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 has our suggested solution (the first form preferably). It works in transclusion mode because the preprocessor is involved. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:53, 22 April 2026 (UTC) ::“has our suggested solution (the first form preferably). It works” ::I do not understand what is “our suggested solution” – please look at this current page. It has neither TOC nor any headline, since the == are displayed within the text, using the default parsing. There are 10 headlines. ::Astonished – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 21:45, 22 April 2026 (UTC) :::Oops .. sorry! I pasted the wrong link! I meant to point you to [[#dewiki:Hilfe:Parserfunktionen|this section]] on this page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 00:09, 23 April 2026 (UTC) You’re imposing some work on us. * I am happy that there are [https://de.wikipedia.org/w/index.php?search=H:+insource:includeonly+insource:%2Fincludeonly%5C%3E%3D%2B%5C%3C%5C%2Fincludeonly%2F&title=Spezial:Suche 12 pages only] to be updated now. * Fortunately, some other syntax has been used in [[w:de:H:VE/*]] – [[w:de:H:Lua/*]] – [[w:de:H:Tabellen/*]] – [[w:de:H:FAQ/Übersicht]] which are merging a huge pile of single pages. I do hope this exception will be described in WikiSyntax Documentation soon. --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 11:04, 23 April 2026 (UTC) :Thanks for your understanding and fixing the pages. Given all the work we've done to deploy to a wiki, at this point, we expect that all remaining rendering issues are likely going to be edge cases that affect small number of pages. We'll update the docs soon, yes. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:22, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%9F%D1%80%D0%B5%D0%B4%D1%83%D0%BF%D1%80%D0%B5%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5&oldid=116093745&useparsoid=1 ruwiki:Шаблон:Предупреждение] == [[:ru:Шаблон:Tpre]] ([[:ru:Модуль:Template call code]]) stops working entirely in Parsoid mode. See also local discussion: [[:ru:Википедия:Форум/Технический#c-Tarkoff-20260422084300-Шаблон:Предупреждение]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 16:40, 22 April 2026 (UTC) :That doesn't look good. Do you have a sense of how many pages are impacted? We will take a look tomorrow and see what is going on and if we can roll out a quick fix. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:07, 22 April 2026 (UTC) ::I see what is going on. This is [[phab:T353697|T353697]] which was resolved with https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/992274. The fix is to have the modules emit <code>format="wikitext"</code> so the <nowiki><span> tags aren't escaped as literal output. Can you see if that fixes it?</nowiki> [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:22, 22 April 2026 (UTC) ::: Yes, thank you. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:47, 22 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Rei_Ami&oldid=266367300&useparsoid=1 dewiki:Rei Ami] == The image of Ami on the top right corner should be rendered with a width of 250px but seems to be scaled down to round about 160px. When using the Legacy Parser the image is rendered as expected. The issue seems to effect only some images. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 18:59, 22 April 2026 (UTC) :@[[User:Jon (WMF)|Jon (WMF)]] says, "The original size of the image is 315x427. This is https://phabricator.wikimedia.org/T421524 - only way to fix it is for Parsoid to mark the img up with a class when the image original size is smaller than 400px. Otherwise it's working as expected." I'm not entirely sure I agree with this diagnosis, since T421524 would cause the image to appear "too large" not "too small". :@[[User:Guardian of Arcadia|Guardian of Arcadia]] what is your user thumbnail size preference, and what skin are you using? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:13, 23 April 2026 (UTC) ::@[[User:Cscott|Cscott]]: I'm using the default thumbnail size of 250px and Vector 2010 (Legacy) as skin. But the size issue also occurs when using other skins like Vector 2022, which can be seen by appending <code>useskin=vector-2022</code> to the URL or viewing the page in an incognito window. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 20:37, 23 April 2026 (UTC) :::What browser and version are you using @[[User:Guardian of Arcadia|Guardian of Arcadia]] ? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 21:46, 23 April 2026 (UTC) ::::Also can you check you don't have a different preference set in [[Special:GlobalPreferences]] and possibly try changing it and changing it back? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:55, 23 April 2026 (UTC) ::::@[[User:Jon (WMF)|Jon (WMF)]]: The issue isn't limited to my account only; it occurs in a logged-out state (within an incognito window) too. But your guess about the browser seems to be right: I have the described issue when using Firefox with the ESR version 115.35.0esr. Today I have tested with another browser (Chrome and Edge) as well as on a PC with a current (non-ESR) Firefox and there the image is shown as expected. So, is this a bug in this specific Firefox version? [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 19:47, 24 April 2026 (UTC) :::::Yes. This sounds like a bug in that specific Firefox version. If you can give me more details about the operating system version you are using I can see if I can replicate in browserstack.com . Is it possible there are any browser extensions installed on that browser? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 22:31, 24 April 2026 (UTC) ::::::The operating system on this PC is Windows 8.1 (Build 9600) and I do not have any browser extensions installed there. Hope this helps to reproduce the issue. If you need anything else please let me know. Thanks for your help. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 22:44, 24 April 2026 (UTC) :::::::That was incredibly useful information, thank you. I understand what is happening now, and there might be something we can do here. Note, this browser is on the cusp of our usual browser support levels, which is what's causing the problem. [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 16:54, 27 April 2026 (UTC) ::::::::That's great news. I would be verry happy if you or your team can fix it. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 17:00, 27 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Alexandru_Dobrogeanu-Gherea&oldid=17669378&useparsoid=1 rowiki:Alexandru Dobrogeanu-Gherea] == imaginea prea mare, la fel la multe articole cu infocaseta om politic, de pilda Vasile Luca, Luminita Odobescu etc face contrast cu imagini in alte infocasete unde problema se poate regla [[User:Ewan2|Ewan2]] ([[User talk:Ewan2|talk]]) 01:25, 23 April 2026 (UTC) :Google translate: "the image is too large, the same as in many articles with the politician infobox, for example Vasile Luca, Luminita Odobescu, etc. it contrasts with images in other infoboxes where the problem can be adjusted." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 18:50, 23 April 2026 (UTC) ::@[[User:Jon (WMF)|Jon (WMF)]] says "For Romanian Wikipedia, there was a problem with the infobox styles. Pretty sure it's been fixed since. It could just be that he's seeing 400px instead of 300px. The infobox image looks identical to me in Parsoid and legacy." ::@[[User:Ewan2|Ewan2]] are you using the default thumbnail size (250px) or a larger size in your user preferences? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:07, 23 April 2026 (UTC) == [https://zu.wikipedia.org/w/index.php?title=Gashamo_Hawd_Somali_Ethiopia&oldid=122552&useparsoid=1 zuwiki:Gashamo Hawd Somali Ethiopia] == Is the city of Hawd Zone [[User:Maaaaskaas11|Maaaaskaas11]] ([[User talk:Maaaaskaas11|talk]]) 21:58, 23 April 2026 (UTC) == [https://ru.wikipedia.org/wiki/Текумсе ruwiki:Текумсе] == For some reason, the comment "До эскиза Лоссинга не было известно..." is repeated twice (see subsection "Комментарии" at the end of the article). This comment is generated by template "ref+" placed inside the template "персона" (an analogue of "Template:Infobox person"), and it is supposed to appear only once. Thanks! [[User:Adavyd|Adavyd]] ([[User talk:Adavyd|talk]]) 22:04, 23 April 2026 (UTC) :This is probably {{phab|T415789}}, which would be solved by adding a name to the reference, but then we end up running into {{phab|T423924}} - the template ends up defining the reference twice with subtly different content (as far as Parsoid is concerned) and the same name, which triggers an error. The fix will probably be to add a name to the reference once {{phab|T423924}} is handled. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:43, 24 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=FIDO2&oldid=264704558&useparsoid=1 dewiki:FIDO2] == Erste Grafik überlagert den Text und die Werkzeugleiste links [[User:Hinnerk11|Hinnerk11]] ([[User talk:Hinnerk11|talk]]) 23:51, 23 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Amanda_Kathrine_Smith/Sandbox&oldid=150348388&useparsoid=1 itwiki:Utente:Amanda Kathrine Smith/Sandbox] == i don't see the "MOVE DRAFT" button. [[User:Amanda Kathrine Smith|Amanda Kathrine Smith]] ([[User talk:Amanda Kathrine Smith|talk]]) 14:14, 24 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:36, 28 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%A1%D1%80%D0%B1%D0%B8%D1%98%D0%B0_(1071%E2%80%941217)&oldid=30892614&useparsoid=1 srwiki:Србија (1071—1217)] == Text inside {{lang-la.. and other {{lang-... templates is not displayed at all. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:46, 24 April 2026 (UTC) :Never mind, in process of adapting our templates for Parsoid, I missed additional change needed in an auxillary module. All is good now. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A2%D1%80%D0%B3/%D0%94%D1%80%D1%83%D0%B3%D0%B8&oldid=30921466&useparsoid=1 srwiki:Википедија:Трг/Други] == <nowiki>__NOCONTENTCONVERT__</nowiki> does not work in Parsoid. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 18:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=Queen&oldid=30824348&useparsoid=1 srwiki:Queen] == Parsoid does not honor __БЕЗКН__ (magic word to suppress title conversion during language conversion) [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 20:03, 24 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%A4%D0%BE%D1%80%D1%83%D0%BC/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8&oldid=152858025&useparsoid=1 ruwiki:Википедия:Форум/Новости] == Исчез логотип в скине Вектор-2010 при включенном гаджете, который отображает праздничные логотипы. При отключении гаджета в настройках — повседневный логотип виден. [[User:Рыцарь поля|Рыцарь поля]] ([[User talk:Рыцарь поля|talk]]) 00:16, 25 April 2026 (UTC) :Triage: not a Parsoid visual issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:22, 27 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9F%D1%80%D0%BE%D0%B5%D0%BA%D1%82:%D0%91%D0%B8%D0%B1%D0%BB%D0%B8%D0%BE%D1%82%D0%B5%D0%BA%D0%B0/%D0%A2%D1%80%D0%B5%D0%B1%D1%83%D1%8E%D1%82%D1%81%D1%8F_%D0%BA%D0%BD%D0%B8%D0%B3%D0%B8&oldid=152853098&useparsoid=1 ruwiki:Проект:Библиотека/Требуются книги] == Конфликт [[:ru:Проект:Библиотека/Требуются книги/Шапка]] с содержанием страницы, из-за чего в [[:ru:Шаблон:shortcut|Шаблон:shortcut]] помещается раздел "содержание" (выглядит это так: [https://ibb.co/219kN3dW 1] и [https://ibb.co/bgM0Fmpn 2]). ------- The conflict between [[:ru:Проект:Библиотека/Требуются книги/Шапка]] and the page content causes the "содержание" section to appear inside [[:ru:Шаблон:shortcut|Шаблон:shortcut]] (this is how it looks: [https://ibb.co/219kN3dW 1] and [https://ibb.co/bgM0Fmpn 2]). [[User:Футболло|Futbollo]] ([[User talk:Футболло|talk]]) 01:10, 25 April 2026 (UTC) :Thank you for the report - I've filed {{phab|T424492}} for it. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:33, 27 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Copa_Intercontinental_da_FIFA_de_2025&oldid=72134360&useparsoid=1 ptwiki:Copa Intercontinental da FIFA de 2025] == Quadro de informações foi excluído por acidente. [[User:AnderSilv42|AnderSilv42]] ([[User talk:AnderSilv42|talk]]) 00:16, 26 April 2026 (UTC) :Triage: Content related - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 15:23, 26 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Michel_W%C3%B6cke&oldid=266505400&useparsoid=1 dewiki:Michel Wöcke] == Bild (Thumb) viel zu gross [[User:Albinfo|Albinfo]] ([[User talk:Albinfo|talk]]) 13:44, 26 April 2026 (UTC) == [https://tn.wikipedia.org/w/index.php?title=Sekolo_Se_Segolwane_Sa_Nata&oldid=49572&useparsoid=1 tnwiki:Sekolo Se Segolwane Sa Nata] == I tried fixing the references but It still says pages with reference errors so I don't know what could be the issue [[User:Blackgirlmighty|Blackgirlmighty]] ([[User talk:Blackgirlmighty|talk]]) 17:00, 26 April 2026 (UTC) :You only need to define a reference once even if you want to use it multiple times - see https://www.mediawiki.org/wiki/Help:Cite#Multiple_uses_of_the_same_footnote for more information. One of each of the references Mmegi2012 and Mmegi2023 should be kept as is; the others should be replaced by <nowiki><ref name="Mmegi2012" /></nowiki> (or 2023) without content. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:39, 27 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Pete_Aguilar&oldid=8671369&useparsoid=1 simplewiki:Pete Aguilar] == This is a less detailed copy of another Wikipedia page. There are two wiki pages showing Pete Aguilar and this is an outdated version. [[User:SuperPug3739|SuperPug3739]] ([[User talk:SuperPug3739|talk]]) 04:56, 27 April 2026 (UTC) :Triage: content related, not Parsoid related [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:46, 27 April 2026 (UTC) == [https://fi.wikipedia.org/w/index.php?title=Hoito-_kasvatussuunnitelma&oldid=23973675&useparsoid=1 fiwiki:Hoito- kasvatussuunnitelma] == Sivun nimi piti olla Hoito- ja kasvatussuunnitelma. Muokkaaminen ei onnistunut. [[User:Nebiux|Nebiux]] ([[User talk:Nebiux|talk]]) 12:01, 29 April 2026 (UTC) :Triage: content related, not Parsoid-related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:04, 30 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Usuario:Luigi_Nakano&oldid=173203320&useparsoid=1 eswiki:Usuario:Luigi Nakano] == An error appears, which should appear when template [[w:es:Plantilla:Estado usuario|Estado usuario]] has nothing in 1=. However, there is a parameter in 1=, so the result should be "Conectado" or "Desconectado", and not "Error:No se ha indicado usuario.". [[User:Luigi Nakano|<span style="color:green">Luigi</span> <span style="color:blue">Nakano</span>]] [[File:Emojione 1F3A7.svg|15px]] ([[User talk:Luigi Nakano|会話]]) 23:12, 29 April 2026 (UTC) :This looks like {{phab|T348722}}, for which a workaround is suggested in https://www.mediawiki.org/wiki/Parsoid/Parser_Unification/Instructions_for_editors#Access_to_parent_frame_from_within_extensions. Let us know if the problem persists after the fix! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:10, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=History_of_the_Ryukyu_Islands&oldid=1336895218&useparsoid=1 enwiki:History of the Ryukyu Islands] == The multiple issues display unsourced template when editing the article there is no such template. [[User:Lightoil|Lightoil]] ([[User talk:Lightoil|talk]]) 05:11, 30 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A7%D1%85%D0%B0%D0%B8%D0%B4%D0%B7%D0%B5,_%D0%9C%D0%B0%D0%BC%D0%B8%D1%8F_%D0%92%D0%B8%D1%81%D1%81%D0%B0%D1%80%D0%B8%D0%BE%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&oldid=152923873&useparsoid=1 ruwiki:Чхаидзе, Мамия Виссарионович] == In the old parser, links to non-existing file pages lead to Special:Upload for the file. In Parsoid, it's a strange link to Special:FilePath, which ends up confusing the editors who accustomed to uploading files this way. [[:ru:Служебная:GoToComment/c-ФВ-20260430140600-Не_загружается_файл|See local discussion]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:53, 30 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%94%D0%B5%D1%80%D0%B2%D0%B8%D1%88_%D0%9A%D0%BE%D1%80%D0%BA%D1%83%D1%82&oldid=30931273&useparsoid=1 srwiki:Дервиш Коркут] == At the bottom, there are several navboxes, Parsoid adds some whitespace between them [[File:Spaces between navboxes with Parsoid..png]] [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 21:21, 30 April 2026 (UTC) : https://phabricator.wikimedia.org/T425123 [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 15:27, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Sevayat&oldid=1351876642&useparsoid=1 enwiki:Talk:Sevayat] == The content assessment and talk page are displayed directly on the talk page, rather than within the “About this page” section (mobile view). [[User:S4yam|S4yam]] ([[User talk:S4yam|talk]]) 21:44, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:Template_editor&oldid=1351909200&useparsoid=1 enwiki:Wikipedia talk:Template editor] == I'm artist thi is my personal biography page [[User:Allymtulia|Allymtulia]] ([[User talk:Allymtulia|talk]]) 21:45, 30 April 2026 (UTC) :Triage: Content issue, not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Middle_of_Nowhere_(Kacey_Musgraves_album)&oldid=1351931473&useparsoid=1 enwiki:Middle of Nowhere (Kacey Musgraves album)] == Producer parameter that adops hlist system in Infobox album template occurs an error. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 01:07, 1 May 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Associazione_Calcio_Perugia_1996-1997&oldid=148287407&useparsoid=1 itwiki:Associazione Calcio Perugia 1996-1997] == Doesn't show all kits. Just the third and on top of the screen [[User:Madive60|Madive60]] ([[User talk:Madive60|talk]]) 01:29, 1 May 2026 (UTC) :This is probably fixed by the fix to {{phab|T425056}} and the current CSS workaround on-wiki. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:22, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%9B%BD%E6%97%97%E3%81%AE%E4%B8%80%E8%A6%A7&oldid=109342678&useparsoid=1 jawiki:国旗の一覧] == イラクの国旗がない [[User:平舞|平舞]] ([[User talk:平舞|talk]]) 03:17, 1 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:21, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Manting_Chan&oldid=1351960413&useparsoid=1 enwiki:Manting Chan] == Divorce, she is not divorced. [[User:Bananahammock311911511|Bananahammock311911511]] ([[User talk:Bananahammock311911511|talk]]) 04:54, 1 May 2026 (UTC) :Content issue, not a Parsoid issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 07:30, 1 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E9%9B%B7%E9%96%80%E9%9F%B3%E5%8A%A9&oldid=109345108&useparsoid=1 jawiki:雷門音助] == {{人名の曖昧さ回避}}や{{aimai}}を貼ると表示が崩れる。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 07:27, 1 May 2026 (UTC) :<nowiki>[[:jawiki:雷門五郎]]</nowiki>でも同様の問題が起きています。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 09:09, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Iceman_(Drake_album)&oldid=1350717409&useparsoid=1 enwiki:Talk:Iceman (Drake album)] == Banners showing up on mobile, not under “learn more about this page button” [[User:OrbitalVoid49|OrbitalVoid49]] ([[User talk:OrbitalVoid49|talk]]) 09:36, 1 May 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Bancu,_Harghita&oldid=13617293&useparsoid=1 rowiki:Bancu, Harghita] == Steagulnjudetului Hargita nu este acea cârpă secuiasca. [[User:Auto 4115|Auto 4115]] ([[User talk:Auto 4115|talk]]) 01:39, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Aurangabad&oldid=1351274322&useparsoid=1 enwiki:Aurangabad] == It has the old name of the city as it's title [[User:20mphwind|20mphwind]] ([[User talk:20mphwind|talk]]) 07:09, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%B9%E0%A6%BE%E0%A6%9C%E0%A6%B0%E0%A6%BE%E0%A6%AC%E0%A6%BE%E0%A6%A1%E0%A6%BC%E0%A7%80_%E0%A6%89%E0%A6%9A%E0%A7%8D%E0%A6%9A_%E0%A6%AC%E0%A6%BF%E0%A6%A6%E0%A7%8D%E0%A6%AF%E0%A6%BE%E0%A6%B2%E0%A6%AF%E0%A6%BC&oldid=8874755&useparsoid=1 bnwiki:হাজরাবাড়ী উচ্চ বিদ্যালয়] == তথ্যসুত্র ব্যয়বহুল নয়। [[User:Md Umor Faruk 2010|Md Umor Faruk 2010]] ([[User talk:Md Umor Faruk 2010|talk]]) 08:00, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=She_Did_It_Again&oldid=1352147079&useparsoid=1 enwiki:She Did It Again] == (Mobile) Huge error in hlist. Bullet points (•) are missing, and the items listed are arranged very roughly. Not sure why this error occurs for over three days. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 10:45, 2 May 2026 (UTC) :Thank you for the report - I have filed {{phab|T425245}} for this issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:30, 3 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%91%E4%B8%8A%E5%93%B2&oldid=109361964&useparsoid=1 jawiki:村上哲] == [[Template:循環参照]]が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:13, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=Wikipedia:%E4%BA%95%E6%88%B8%E7%AB%AF&oldid=109349724&useparsoid=1 jawiki:Wikipedia:井戸端] == 目次が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1 enwiki:Wiki (disambiguation)] == [[w:en:tm:dab]] (at the bottom of the page) appears to render differently on Parsoid compared to non-Parsoid. <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 14:27, 2 May 2026 (UTC) :Also appears to render differently on desktop Parsoid v. mobile Parsoid -- compare https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=mobile (different rendering) vs. https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=desktop ('expected' rendering, AFAIK) <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 16:34, 2 May 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Horv%C3%A1th_Kriszti%C3%A1n_(fest%C5%91,_1976,_Budapest)&oldid=28948319&useparsoid=1 huwiki:Horváth Krisztián (festő, 1976, Budapest)] == Az a probléma, hogy nem szeretném hoyg festő, és 1976 Budapest legyen hozzá kírva. Elrontottam, és nem tudtam külön, új cikket írni róla. [[User:Pizzsus|Pizzsus]] ([[User talk:Pizzsus|talk]]) 20:47, 2 May 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%99%D7%A6%D7%97%D7%A7_%D7%9E%D7%90%D7%99%D7%A8_%D7%90%D7%9C%D7%AA%D7%A8&oldid=43088529&useparsoid=1 hewiki:יצחק מאיר אלתר] == הציטוטים בכתב דיויד בעברית לקויים. Text quotes in David font are displayed poorly. [[User:פרידבערג|פרידבערג]] ([[User talk:פרידבערג|talk]]) 21:36, 2 May 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9B%D0%B8%D1%86%D0%B5%D0%BD%D0%B7%D0%B8%D0%B8_%D0%B8_%D0%B8%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B_Creative_Commons&oldid=152790052&useparsoid=1 ruwiki:Лицензии и инструменты Creative Commons] == refs don't work with vector-2010 (but it works for vector-2022) [[User:Petsernik|Petsernik]] ([[User talk:Petsernik|talk]]) 23:05, 2 May 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Huawei&oldid=173270512&useparsoid=1 eswiki:Huawei] == El segundo sitio web que sale no existe es un vandalismo en wikimedia ingles o un error [[User:Usuario 016|Usuario 016]] ([[User talk:Usuario 016|talk]]) 23:15, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%8C%97%E6%9D%91%E8%81%A1&oldid=109365307&useparsoid=1 jawiki:北村聡] == 人名の曖昧さ回避Templateを挿入すると、上手く表示されず、大きな改行空白と共に「.mw-parser-output .dmbox{display:flex;align-items:center;clear:both;margin:0.9em 1em;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:0.25em 0.35em;font-size:95%}.mw-parser-output .dmbox>*{flex-shrink:0;margin:0 0.25em;display:inline}.mw-parser-output .dmbox-body{flex-grow:1;flex-shrink:1;padding:0.1em 0}」 というものが出る。 [[User:Geogie|Geogie]] ([[User talk:Geogie|talk]]) 23:35, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=User:Soetermans&oldid=1225262591&useparsoid=1 enwiki:User:Soetermans] == He doing vandalism on Wikipedia pages and he won’t stop editing out the same thing [[User:Inkysponge2007|Inkysponge2007]] ([[User talk:Inkysponge2007|talk]]) 14:12, 3 May 2026 (UTC) 6kmdlx3h7l9rgdczuapq6wl5u29xkof 8364399 8364396 2026-05-03T14:33:02Z Clump 81610 Reverted edits by [[Special:Contribs/Inkysponge2007|Inkysponge2007]] ([[User talk:Inkysponge2007|talk]]) to last version by Clump 8364066 wikitext text/x-wiki Post your feedback about using [[Parsoid/Parser Unification|Parsoid]] to render articles. [[Parsoid/Parser_Unification/Known_Issues|Learn how to report problems clearly]]. '''Need more attention? [https://phabricator.wikimedia.org/maniphest/task/edit/form/43/?projects=PHID-PROJ-3y2wduoz5xezwveaq426 Report directly in Phabricator].''' {{note|This is for reporting feedback on the integration of the Parsoid parser only. '''For wiki content issues, such as concerns about article content, please report on your local wiki.''' }} [[Parsoid/Parser_Unification/Known_Issues|View known issues]] __NEWSECTIONLINK__ {{Archive box| [[/Archive 1]] [[/Archive 2]]}} == [https://nl.wikipedia.org/w/index.php?title=Wikipedia:Aanmelding_moderatoren&oldid=70702688&useparsoid=1 nlwiki:Wikipedia:Aanmelding moderatoren] == Sometimes, in a numbered list, the number stays on the first line when there are indented lines below it, and sometimes the number is vertically aligned between the different lines. For votes, it is preferable that the number remains on the line that starts with only “#” and not on lines with an indentation “#:”. [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:34, 15 February 2026 (UTC) :i.e. see item 33. under '<nowiki/>'''''Voor moderatorschap ContextCreator'''<nowiki/>'<nowiki/>'' [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:36, 15 February 2026 (UTC) ::I can't see any difference between Parsoid and the legacy Parser on that page, it appears that the number is correctly aligned in both cases. Are you using a different skin by any chance? Does the difference still appear? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:42, 21 April 2026 (UTC) :::I see no difference anymore - it is fixed. Thanks anyway! [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 16:01, 21 April 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Discussion_Wikip%C3%A9dia:Wikiconcours&oldid=233327486&useformat=mobile&useparsoid=1 frwiki:Discussion Wikipédia:Wikiconcours] == Content that is hidden inside the "Learn more about this page" button from MobileFrontend with legacy parser is not inside it with Parsoid. [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 08:32, 22 February 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Laurence_Olivier&oldid=148833592&useparsoid=1 itwiki:Laurence Olivier] == Giant Oscar statue icons (sgranate) [[User:UmbraSolis|UmbraSolis]] ([[User talk:UmbraSolis|talk]]) 20:28, 19 February 2026 (UTC) :This was probably due to https://phabricator.wikimedia.org/T417828, which is now fixed. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:53, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:43, 21 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Bologna_Football_Club_1909&oldid=149496425&useparsoid=1 itwiki:Bologna Football Club 1909] == problem with displaying football shirts [[User:Gio Bike|Gio Bike]] ([[User talk:Gio Bike|talk]]) 17:49, 20 February 2026 (UTC) :Can you be more specific, or is it fixed now? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:55, 27 February 2026 (UTC) ::Now it is OK [[Special:Contributions/&#126;2026-13011-93|&#126;2026-13011-93]] ([[User talk:&#126;2026-13011-93|talk]]) 17:20, 27 February 2026 (UTC) :::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:44, 21 April 2026 (UTC) == [https://vi.wiktionary.org/w/index.php?title=Wiktionary:Th%E1%BB%91ng_k%C3%AA/S%E1%BB%91_m%E1%BB%A5c_t%E1%BB%AB_theo_ng%C3%B4n_ng%E1%BB%AF/T%E1%BA%A5t_c%E1%BA%A3&oldid=2331126&useparsoid=1 viwiktionary:Wiktionary:Thống kê/Số mục từ theo ngôn ngữ/Tất cả] == Phần cuối bảng bị lỗi, không hiện ra số mục từ mà chỉ hiện ra "0" hoặc "-2" mà không rõ lý do, tôi không viết nhầm gì cả. (English: The table got error, just display "0" or "-2", but I don't have any error at write wikitext.) [[User:NHNAnh|NHNAnh]] ([[User talk:NHNAnh|talk]]) 05:57, 21 February 2026 (UTC) :I believe this might be due to "Expensive parser function count: 1080/500" in the debug log: there are too many expensive parser function counts on this page (PAGESINCATEGORY is expensive), and the later functions are not executed. :I would suggest splitting the page into several pages, if possible. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:04, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) == [https://cs.wikipedia.org/w/index.php?title=Celerina/Schlarigna&oldid=25694456&useparsoid=1 cswiki:Celerina/Schlarigna] == V tabulce v sekci obyvatelstvo se u jedné buňky zobrazuje černé pozadí. Pokud dám ale historii stránky a podívám se na aktuální verzi, vykreslí se stránka správně. To samé se opakuje i u jiných podobných stránek se stejně formátovanými tabulkami. [[User:Matijak|Matijak]] ([[User talk:Matijak|talk]]) 17:02, 22 February 2026 (UTC) :I cannot see a black cell in that table. Is this issue fixed? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:09, 27 February 2026 (UTC) ::I can see it in in both the history (latest revision) and on the page itself (live). It's the leftmost 'Počet' cell in the 'Jazyky v Celerině' table. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 10:10, 28 February 2026 (UTC) :::Aha! :::the cell itself is not dark, the text in it is, and only in dark mode. It is also present in the legacy rendering, which seems to hint at a problem with the table markup itself and not a parser issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:11, 2 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) :::::Not a Parsoid issue most likely, but it has not been fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:21, 24 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia:Biographies_of_living_persons&oldid=1340299616&useparsoid=1 enwiki:Wikipedia:Biographies of living persons] == Reporting a visual bug for all pages that suddenly arose as of this morning on Safari Mobile - the Page Actions Overflow div is in a permanently open state but inaccessible to via clicks to either toggle the menu or select any of the tools on the menu. In addition to being unable to interact with it, all of the styling broken and makes the top right section of the page unusable and barely readable. [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 14:34, 27 February 2026 (UTC) :Is this issue still present? Sorry, it has been a while since you reported this, I'm hoping that the issue has been resolved by now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) ::Yes, it appears to have been resolved. Thanks for following up! [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 03:38, 22 April 2026 (UTC) == [https://oc.wikipedia.org/w/index.php?title=Esqu%C3%A8rra_(politica)&oldid=2495338&useparsoid=1 ocwiki:Esquèrra (politica)] == There's an issue with the interlinks, this article should be connected with the other ones about left-wing politics [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 06:39, 28 February 2026 (UTC) :Yes, it was an issue with the interlinks, but those should naturally not be reported as visual issues ('bogue visuler') as the have nothing to do with Parsoid. You can link pages which have no connections by using the 'Apondre los ligams interlengas' (Add interlanguage links) button from the 'Bóstia d'aisinas' (Tools) menu. Unless, of course, Parsoid somehow blocks automatic linking of translations. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:10, 28 February 2026 (UTC) ::I don't know why but it was finally done (thank you so much to the person who did that), but the thing is, i tried what you said before and it kept telling me that i didn't had the permission to link the two articles... [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 19:33, 1 March 2026 (UTC) :::I did that, you are welcome. It appears that you are not autoconfirmed yet on Wikidata, and that this Wikidata entry requires that, which if both true I would expect you to not be able to do this change. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 04:21, 21 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) :::::Sorry? [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:48, 23 April 2026 (UTC) ::::::We're using the <nowiki>{{done}}</nowiki> template to track which issues have been resolved, vs still outstanding. I don't believe there is any additional follow required by the Content Transform team on this report? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 05:00, 24 April 2026 (UTC) :::::::Oh, no, I just didn't know this is a system you are using. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:19, 24 April 2026 (UTC) == [https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/Page_translation_administration&oldid=8240537&useparsoid=1 Help:Extension:Translate/Page translation administration] == The topmost warning in the 'Changing the source text' section does not display the codeblock content. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:47, 28 February 2026 (UTC) :This is a very clever use of the <code><nowiki>{{^(}}</nowiki></code> template to avoid creating an unintended translation marker. I've [https://www.mediawiki.org/w/index.php?title=Help%3AExtension%3ATranslate%2FPage_translation_administration&diff=8349012&oldid=8343860 replaced it with more straight-forward entity-escaping] to be more compatible with Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:54, 21 April 2026 (UTC) ::Also filed this as [[phab:T424066]] [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 16:46, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&oldid=67999951&useparsoid=1 nlwiki:Railterminal Gelderland] == The map in [[:nl:sjabloon:maplink]] doesn't show up in my Chrome browser for Chromebook. It does show in https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&useparsoid=0 and also when I log out. [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:54, 5 March 2026 (UTC) :Btw, the map is visible for a moment, then it disappears [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:56, 5 March 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%91%D7%A8%D7%90%D7%95%D7%9C_%D7%A1%D7%98%D7%90%D7%A8%D7%A1&oldid=42870396&useparsoid=1 hewiki:בראול סטארס] == למה הקישור לתמונה ששמתי לא עובד? בכל מקרה אשמח שמישהו ישים את התמונה העדכנית שמשומשת בדף באנגלית מאחר והלוגו למשחק שונה. מצטער על התקלה. [[User:Jhho48|Jhho48]] ([[User talk:Jhho48|talk]]) 16:43, 9 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Infokastis: Sulamistemperatuur 236,15 K (−37 °C) Miinusmärk peaks olema sidekriipsust pikem, kuid pikema kriipsu sisestamine põhjustab tõrketeate. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:05, 11 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Vabandust, lühike (st vale) kriips oli kuvatud siiski ainult lähteteksti režiimis; salvestatud tekstiga küljendis on kuvatud õige kriips. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:07, 11 March 2026 (UTC) == kowiki:sticky header is broken == [[:en:Template:Sticky header|Template:Sticky header]] is not working properly on kowiki. Please compare [//ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=0] with [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=1].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:34, 16 March 2026 (UTC) :It may have been because of an empty row before the table caption. I [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&diff=41501849&oldid=41501840 edited the page] to remove it. But, looks like another editor has removed the sticky header template call from above the table. If you can put it back, it will work. See my [[:ko:사용자:SSastry_(WMF)/Sandbox|sandbox]] page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 03:22, 17 March 2026 (UTC) == [https://ko.wikipedia.org/w/index.php?title=%ED%8B%80:%EA%B5%AD%EA%B8%B0%EB%82%98%EB%9D%BC&oldid=40992836&useparsoid=1 kowiki:틀:국기나라] == 변수를 덧붙였음에도 {{국기나라|독일|제국}}이 여전히 '독일'로 출력됩니다. [[User:Triican|Triican]] ([[User talk:Triican|talk]]) 05:04, 19 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Angus_T._Jones&oldid=1333447723&useparsoid=1 enwiki:Angus T. Jones] == The infobox photo is squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 17:11, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Ukraine&oldid=1343921679&useparsoid=1 enwiki:Ukraine] == All maps in the infobox are squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 18:36, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Sabia_que&oldid=54991313&useparsoid=1 ptwiki:Wikipédia:Sabia que] == O arquivo de discussão está 'bugando' visualmente. Está no meio de "Curiosidades em destaque" [[User:Heylenny|Heylenny]] ([[User talk:Heylenny|talk]]) 23:27, 19 March 2026 (UTC) :{{done}} Template adjusted on the page. [[User:Fúlvio|Fúlvio]] ([[User talk:Fúlvio|talk]]) 02:59, 22 March 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%AC%E0%A6%BF%E0%A6%AE%E0%A6%B2_%E0%A6%98%E0%A7%8B%E0%A6%B7_(%E0%A6%B6%E0%A6%BF%E0%A6%B6%E0%A7%81%E0%A6%B8%E0%A6%BE%E0%A6%B9%E0%A6%BF%E0%A6%A4%E0%A7%8D%E0%A6%AF%E0%A6%BF%E0%A6%95)&oldid=8851768&useparsoid=1 bnwiki:বিমল ঘোষ (শিশুসাহিত্যিক)] == আলোচনা পাতায় অন্য নিবন্ধের আলোচনা পাতা [[User:Ams riyad|Ams riyad]] ([[User talk:Ams riyad|talk]]) 01:28, 20 March 2026 (UTC) == [https://vi.wikipedia.org/w/index.php?title=Wikipedia:Th%E1%BA%A3o_lu%E1%BA%ADn&oldid=74869958&useparsoid=1 viwiki:Wikipedia:Thảo luận] == TOC is rendered inside the link bar, but it shouldn't be. [[User:NguoiDungKhongDinhDanh|<span class="skin-invert" style="color:black;font-family:Monotype Corsiva;font-size:110%;font-weight:normal;line-height:normal">NguoiDungKhongDinhDanh</span>]] 03:20, 20 March 2026 (UTC) :This was most likely [[phab:T421629|T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] and we believe this issue has been fixed. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:51, 24 April 2026 (UTC) == [[wikt:ru:омфал]] == For more than a day, there have been anomalies in the behavior of tables of contents (ToCs) in Russian Wiktionary. The issues differ based on the selected skin and affect only some pages. If the old Vector theme is used, the automatically generated ToC simply fails to appear on certain pages, despite the page having over three headers and the absence of magic words such as NOTOC. If the new Vector theme is used, the ToC on some pages is misplaced and not positioned where it should be by default. The problem is not present if the old parser is used. Purging the page's cache seems to fix the issue as well. ToC is displayed correctly in the preview-mode too. Some affected pages: * [[wikt:ru:омфал]] * [[wikt:ru:безграмотность]] * [[wikt:ru:હંમેશા]] * [[wikt:ru:ಯಾವಾಗಲೂ]] * [[wikt:ru:stadigvæk]] * [[wikt:ru:alligevel]] * [[wikt:ru:kanunay]] * [[wikt:ru:ሁሌ]] * [[wikt:ru:zawżdy]] * and maaany mooore... [[User:綿貫桜哉|綿貫桜哉]] ([[User talk:綿貫桜哉|talk]]) 08:11, 20 March 2026 (UTC) :This was [[phab:T421629|⚓ T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] but should be fixed now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:55, 24 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Louis_Nirenberg&oldid=15616502&useparsoid=1 rowiki:Louis Nirenberg] == The image seems to be the 250px thumbnail scaled up to what looks like 400px width. [[User:Andrei Stroe|Andrei Stroe]] ([[User talk:Andrei Stroe|talk]]) 10:16, 20 March 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Aide:Accueil&oldid=232433495&useparsoid=1 frwiki:Aide:Accueil] == custom collapsible elements render differently with parsoid [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 14:19, 20 March 2026 (UTC) :I filed https://phabricator.wikimedia.org/T421859. Thanks for the report. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:07, 31 March 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Katten_(olika_betydelser)&oldid=43770842&useparsoid=1 svwiki:Katten (olika betydelser)] == The legacy parser adds an empty line before the template Förgrening (which is a kind of table). The Parsoid parser don't do that. This occurs on all pages using that template. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 18:32, 21 March 2026 (UTC) :Ya, this is known difference with some paragraph wrapping which is tricky to fix. In this case, I recommend adjusting the top margin of the table by editing the base template: https://sv.wikipedia.org/w/index.php?title=Mall%3AF%C3%B6rgrening%20bas&veaction=editsource [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:01, 31 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Gen_Z_stare&oldid=1344701043&useparsoid=1 enwiki:Gen Z stare] == The infobox image is unusually narrow. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 01:51, 22 March 2026 (UTC) :For me the image is stretched horizontally by a fair bit. It seems like the following bit of code is to blame: :<syntaxhighlight lang="css"> :html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img {width: 400px; } :</syntaxhighlight> [[User:Sohom Datta|Sohom]] ([[User talk:Sohom Datta|talk]]) 01:54, 22 March 2026 (UTC) ::I'm not seeing any visible difference between legacy parser and Parsoid in my testing. Can you share a screenshot @[[User:Snowmanonahoe|Snowmanonahoe]] ? What skin and browser are you using? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 17:43, 27 March 2026 (UTC) :::@[[User:Jon (WMF)|Jon (WMF)]]: I don't see it anymore either. I'm using Vector 2022 and Firefox 149. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 17:46, 27 March 2026 (UTC) ::::Ah okay. I think this was a caching issue then. Some "temporary turbulence" was to be expected with this roll out. Thanks for reporting! [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 18:29, 27 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Virginia_Fonseca&oldid=71959182&useparsoid=1 ptwiki:Virginia Fonseca] == A 1ª imagem da página na infocaixa tem um tamanho grande demais [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 11:34, 22 March 2026 (UTC) :I don't see the problem. The page renders identically in Parsoid and with the old/legacy parser. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:22, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Xander_Harris&oldid=71958675&useparsoid=1 ptwiki:Xander Harris] == Seção de referências expandida [[User:Vitruviano|Vitruviano]] ([[User talk:Vitruviano|talk]]) 15:06, 22 March 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Bruker:Znuddel&oldid=25704667&useparsoid=1 nowiki:Bruker:Znuddel] == Hele siden er helt feil [[User:Nevemagneten|Nevemagneten]] ([[User talk:Nevemagneten|talk]]) 20:35, 24 March 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Main_page&oldid=2122&useparsoid=1 abstractwiki:Abstract Wikipedia:Main page] == Favicon is showing a dark background around the rounded corners on Chrome. [[User:Jsengupt|Jsengupt]] ([[User talk:Jsengupt|talk]]) 16:14, 25 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=System_(typeface)&oldid=1329545007&useparsoid=1 enwiki:System (typeface)] == Infobox image is stretched horizontally [[User:Anna328p|Anna328p]] ([[User talk:Anna328p|talk]]) 06:59, 26 March 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Enged%C3%A9lyk%C3%A9r%C3%A9s&oldid=28288240&useparsoid=1 huwiki:Wikipédia:Engedélykérés] == The email templates are rendered incorrectly. [[User:Bencemac|Bencemac]] ([[User talk:Bencemac|talk]]) 14:00, 26 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T421563 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:19, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Usu%C3%A1rio(a):Inter-rede/Cabe%C3%A7alho&oldid=71778331&useparsoid=1 ptwiki:Usuário(a):Inter-rede/Cabeçalho] == Whitespaces seem to have collapsed [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 18:02, 27 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422155 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:36, 2 April 2026 (UTC) ::It looks like the problem is the <code>display:flex</code> in the <code>style</code> attribute on the wrapper is at fault. Parsoid generates <code><nowiki><span></nowiki></code> wrappers around the html entities in the wikitext, by design. The whitespace is present in the HTML, so that's not a fault of Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:07, 9 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%91%D7%A6%D7%A2_%D7%9E%D7%A9%D7%94_(%D7%9E%D7%9C%D7%97%D7%9E%D7%AA_%D7%94%D7%A2%D7%A6%D7%9E%D7%90%D7%95%D7%AA)&oldid=42991233&useparsoid=1 hewiki:מבצע משה (מלחמת העצמאות)] == הכיתוב שנועד למנוע בלבול בין מבצע משה הזה למבצע משה אחר לא ערוך [[User:חנניה בלסמן|חנניה בלסמן]] ([[User talk:חנניה בלסמן|talk]]) 12:54, 30 March 2026 (UTC) == [//en.wikipedia.org/w/index.php?title=Help:Colon_trick&useparsoid=1 enwiki:Help:Colon trick] == According to [[w:Help:Colon trick]], it is explained as follows: "<code><nowiki>[[//Hus]]</nowiki></code> will produce an (invalid) external link wrapped in brackets ("[[//Hus]]"), but <code><nowiki>[[://Hus]]</nowiki></code> will produce a link to [[w://Hus|//Hus]]." However, when using Parsoid, it incorrectly links to [[w:Help:Colon trick//Hus|Help:Colon trick//Hus]].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:02, 31 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422161 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 14:00, 2 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Ans%C3%B6kan_om_administrativ_beh%C3%B6righet&oldid=59167563&useparsoid=1 svwiki:Wikipedia:Ansökan om administrativ behörighet] == In Legacy, each section (candidate) get a [redigera] ([edit] to the right of the section name. In Parsoid, there is nothing to the right of the section name. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 12:15, 2 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T391624 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:27, 2 April 2026 (UTC) == [https://en.wiktionary.org/w/index.php?title=H%26P&oldid=83856321&useparsoid=1 enwiktionary:H&P] == The first hidden category listed is [[wiktionary:Category:English_entries_with_incorrect_language_header|English entries with incorrect language header]]'','' which is, however, empty. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:48, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Jo%C3%A3o_Peixoto&oldid=72016744&useparsoid=1 ptwiki:João Peixoto] == A foto não corresponde ao nome citado [[User:Mayque Lemos|Mayque Lemos]] ([[User talk:Mayque Lemos|talk]]) 18:18, 2 April 2026 (UTC) == [https://meta.wikimedia.org/w/index.php?title=Main_Page&oldid=30254797&useparsoid=1 metawiki:Main Page] == On Parsoid only, <nowiki>''complete list'' and ''request''</nowiki> each show a space between them and their preceding opening bracket. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 19:06, 3 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&oldid=1343194045&useparsoid=1 enwiki:In Stars and Time] == <code>&lt;ref name="rps"&gt;</code> displays an error which doesn’t occur on the legacy parser [[User:Mir Novov|Mir Novov]] ([[User talk:Mir Novov|talk]]) 12:10, 4 April 2026 (UTC) :It was an error which I fixed with [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&diff=1348021667&oldid=1347424445 this edit] which adds one more backlink to Ref #5. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:00, 10 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Helen_Andrews&oldid=72024590&useparsoid=1 ptwiki:Helen Andrews] == Estou a ter problema com as referências, pois aparecem duplicadas. [[User:Faviola7|Faviola7]] ([[User talk:Faviola7|talk]]) 14:17, 4 April 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Project_chat&oldid=3236&useparsoid=1 abstractwiki:Abstract Wikipedia:Project chat] == In the "Bot request" section, a link that has been visited is blue rather than purple, because spaces in the link are turned into actual spaces (%20) in the URL. [[User:JJPMaster|JJP]]<sub>[[User talk:JJPMaster|Mas]]<sub>[[Special:Contributions/JJPMaster|ter]]</sub></sub> ([[wikt:she|she]]/[[wikt:they|they]]) 21:53, 4 April 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Tor_Fosse_(f%C3%B8dt_1956)&oldid=25723619&useparsoid=1 nowiki:Tor Fosse (født 1956)] == fil: center frameless [[User:Birgit.H.Pihl|Birgit.H.Pihl]] ([[User talk:Birgit.H.Pihl|talk]]) 10:05, 5 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Politisk_opposition&oldid=59171124&useparsoid=1 svwiki:Politisk opposition] == This error message about unused named reference is not shown: Referensfel: <ref>-tagg med namn "sr-20161006", definierad i <references> används inte tidigare i texten. The article is also added to hidden category "Sidor med referensfel" but that is not shown [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:12, 5 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Puteulum/Sandbox&oldid=150100596&useparsoid=1 itwiki:Utente:Puteulum/Sandbox] == The "Move" button to move the entry from sandbox to NS0 does not appear [[User:Puteulum|Puteulum]] ([[User talk:Puteulum|talk]]) 14:28, 7 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=POVOADO_TIRIRICAL&oldid=72040530&useparsoid=1 ptwiki:POVOADO TIRIRICAL] == O MEU TEXTO ESTA TODO VERMELHO E MAIS CENTRALIZADO [[User:POVOADO TIRIRICAL|POVOADO TIRIRICAL]] ([[User talk:POVOADO TIRIRICAL|talk]]) 18:38, 7 April 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%B1%E4%BA%AC%E9%83%BD%E9%81%935%E5%8F%B7%E6%96%B0%E5%AE%BF%E9%9D%92%E6%A2%85%E7%B7%9A&oldid=108985336&useparsoid=1 jawiki:東京都道5号新宿青梅線] == ヘッダー付近に編集ミスと思われし文言あり [[User:QWERTYKeyboard0570|QWERTYKeyboard0570]] ([[User talk:QWERTYKeyboard0570|talk]]) 08:56, 8 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=2022_Oder_environmental_disaster&oldid=1344570432&useparsoid=1 enwiki:2022 Oder environmental disaster] == After a second, the actual map from the infobox (not the buttons) is replaced with a placeholder icon and text (clicking in the field still works). [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 11:56, 8 April 2026 (UTC) :Could it have been a transient issue? I cannot reproduce this right now. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:03, 10 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Commissione_arbitrale/Domande&oldid=150049601&useparsoid=1 itwiki:Wikipedia:Commissione arbitrale/Domande] == This page is related to the itwiki ArbCom election. Section edit links were not shown, making it difficult to ask questions to candidates. This has since been worked around with [[:it:special:diff/150118322|this edit]] and is likely related to [[phab:T387520|T387520]]. [[User:Titore|Titore]] ([[User talk:Titore|talk]]) 19:58, 8 April 2026 (UTC) :Thanks for this report. This is on our list of high priority tasks to fix and we are going to pick up shortly. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:53, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Kurier&oldid=266019405&useparsoid=1 dewiki:Wikipedia:Kurier] == das Diagramm zum Beitrag "Ein Wal ..." überragt den Text der rechten Spalte. [[User:Michael w|Michael w]] ([[User talk:Michael w|talk]]) 08:10, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034&useparsoid=1 dewiki:Wikipedia:Fragen zur Wikipedia] == <nowiki>& s h y ;</nowiki> is ignored. See the test on https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034#&_s_h_y_; [[User:Raymond|Raymond]] ([[User talk:Raymond|talk]]) 09:55, 10 April 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422960 for this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:55, 10 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Faktafr%C3%A5gor&oldid=59190040&useparsoid=1 svwiki:Wikipedia:Faktafrågor] == Svara-funktionen fungerar inte med Parsoid. När jag klickar på Svara för något inlägg, vilket som helst, dyker svarsrutan upp längst ner på sidan, efter den senaste diskussionstråden. Med den äldre parsern fungerar det. [[User:Larske|Larske]] ([[User talk:Larske|talk]]) 11:12, 10 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Cornelis_de_Bruijn_Martinuszoon&oldid=70921577&useparsoid=1 nlwiki:Cornelis de Bruijn Martinuszoon] == De pagina-afbeelding is de handtekening van C. de Bruijn Mz. Ik denk dat zijn afbeelding in de spotprent een betere pagina-afbeelding is. Het zou kunnen dat Parsoid/Wikipedia deze niet 'pakt' omdat de dimensies tijdens een eerdere bewerking zijn aangepast. Alvast bedankt! [[User:Jelledebruijn|Jelledebruijn]] ([[User talk:Jelledebruijn|talk]]) 16:31, 10 April 2026 (UTC) :I think you might have seen a version of the page before the cache was updated. I just checked and the image is identical with Parsoid and the older parse. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:46, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=The_Punisher_(2004)&oldid=263259949&useparsoid=1 dewiki:The Punisher (2004)] == Dead link template Vorlage:Toter Link (https://de.wikipedia.org/wiki/Vorlage:Toter_Link) after url is no longer working but gets part of the Link. (example https://de.wikipedia.org/wiki/The_Punisher_(2004)#cite_note-5 ) [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:23, 10 April 2026 (UTC) :Example without Parsoid: https://de.wikipedia.org/wiki/The_Punisher_(2004)?useparsoid=0#cite_note-5 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:57, 10 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T368724 but ideally, the template will be added with a space after the link. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:24, 11 April 2026 (UTC) ::Unfortunately it's added by the InternetArchiveBot that way: https://de.wikipedia.org/w/index.php?title=Liste_aktiver_Brauereien_in_Deutschland&diff=prev&oldid=265857281 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 06:45, 11 April 2026 (UTC) :::@[[User:SSastry (WMF)|SSastry (WMF)]]: But it is not good if the preview shows us a different result than the version that is subsequently published. InternetArchiveBot inserts it without spaces. The task is prioritized as Low, but since we have this thousands of times in the article inventory (and it used to work before), the task should be reprioritized to Higher. And the preview should always show the same result that I get after publishing. What do we do with the Phab task now? How do we handle this bug? Thank you, [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 09:12, 11 April 2026 (UTC) ::::We will fix the preview path separately. But, for this specifically, I'll flag this for the team to see how we want to handle this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:33, 11 April 2026 (UTC) :::::@[[User:SSastry (WMF)|SSastry (WMF)]]: Oh thank you, keep us up to date here please. [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 16:35, 11 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Marlon_Ganchozo&oldid=172919968&useparsoid=1 eswiki:Marlon Ganchozo] == No sale el resto de la información del, jugador [[User:Didierlpz06|Didierlpz06]] ([[User talk:Didierlpz06|talk]]) 19:04, 10 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 eswiki:Temporada regular de la Euroliga 2025-26] == no se sustituyen correctamente las ultimas plantillas [[User:Hugogs02|Hugogs02]] ([[User talk:Hugogs02|talk]]) 08:42, 11 April 2026 (UTC) :This page is too large post-template expansion. Observe that the templates at the end are not expanded neither in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 Parsoid] nor in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=0 Legacy]; the legacy parser just happens to expand a few more at the end of the page due to [https://phabricator.wikimedia.org/T392262 T392262]. The page should probably be split. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:13, 13 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Uniforme_de_la_selecci%C3%B3n_de_f%C3%BAtbol_de_Argentina&oldid=172883243&useparsoid=1 eswiki:Uniforme de la selección de fútbol de Argentina] == En la plantilla de uniforme de fútbol algunos uniformes se ven con las mangas más bajas respecto al archivo del cuerpo, dejando lineas de un pixel por encima con los colores de fondo en dicha plantilla. [[User:Lobo kun mfc|Lobo kun mfc]] ([[User talk:Lobo kun mfc|talk]]) 13:58, 11 April 2026 (UTC) :The lines displayed on top of the uniforms are present both in Parsoid and in the Legacy parser, and they do seem to vary slightly depending on the browser (I've looked on Firefox and Chrome, both on Linux, and they were not consistent between both browsers). :I believe this issue should be fixed on the template side (at a guess, the <code>style="color: inherit; background-color:#000040;"</code> that I see on the various image divs may well show up depending on the exact HTML structure and/or image) [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:23, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Liste_der_Radschnellverbindungen_in_Deutschland&oldid=266034807&useparsoid=1 dewiki:Liste der Radschnellverbindungen in Deutschland] == Hallo, beim Artikel [[Liste der Radschnellverbindungen in Deutschland]] wird die Beschreibung der MapLink-Karte wird nicht gescheid gerendert. Statt einem hochgestellten <code>[7]</code> wird <code>Karte der bestehenden Radschnellwege in Deutschland'"`UNIQ--ref-00000008-QINU`"'</code> gerendert. Das Problem ist serverseitig und tritt beim Legacy-Parser nicht auf. LG [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 16:02, 11 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T383004 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:06, 11 April 2026 (UTC) ::thanks! [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 14:13, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Louis_Franchet_d%E2%80%99Esp%C3%A8rey&oldid=266076416&useparsoid=1 dewiki:Louis Franchet d’Espèrey] == Bildumfluss nicht wie üblich [[User:Alfred Kiefer|Alfred Kiefer]] ([[User talk:Alfred Kiefer|talk]]) 19:30, 11 April 2026 (UTC) :This issue has been fixed in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1269534 and should be deployed to production this week. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:34, 13 April 2026 (UTC) == [https://bn.wiktionary.org/w/index.php?title=%E0%A6%AA%E0%A7%8D%E0%A6%B0%E0%A6%A7%E0%A6%BE%E0%A6%A8_%E0%A6%AA%E0%A6%BE%E0%A6%A4%E0%A6%BE&oldid=250894&useparsoid=1 bnwiktionary:প্রধান পাতা] == The ‘ শব্দছবি’ section is overflowing with Parsoid; thus does not happen when the legacy parser is used. [[User:Redmin|Redmin]] ([[User talk:Redmin|talk]]) 08:09, 12 April 2026 (UTC) :Since the section seems to be randomized, it's pretty hard to see which version of this section is overflowing (the ones I see do not seem to). Would you be able to provide more information/a screenshot? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:49, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Hamburg&oldid=266087257&useparsoid=1 dewiki:Wikipedia:Hamburg] == Abschnittsbearbeitungen nicht mehr möglich, Link fehlt. Betrifft einige WP-Seiten wie auch [[:de:Wikipedia:Stammtisch München]] oder auch nur einige Überschriften von [[:de:Vorlage:Coordinate]], also nicht immer komplette Seiten. [[User:NordNordWest|NordNordWest]] ([[User talk:NordNordWest|talk]]) 12:12, 12 April 2026 (UTC) :We have a number of issues with section edit links (documented in https://phabricator.wikimedia.org/T391624) that we intend to fix; sorry for the inconvenience - we'll make sure to keep this use case in mind when working on a solution. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:20, 23 April 2026 (UTC) == [https://zh.wikipedia.org/w/index.php?title=COBOL&oldid=91149855&useparsoid=1 zhwiki:COBOL] == 正文开头的“COBOL”英文名无法显示,且全文的繁简转换失效。 The English name "COBOL" for COBOL at the very beginning vanished. Besides, the conversion between traditional and simplified Chinese does not function for the entire page. [[User:Ricky136973|Ricky136973]] ([[User talk:Ricky136973|talk]]) 13:08, 12 April 2026 (UTC) :Parsoid should not (yet) be enabled on zhwiki. If you want to preview how it will work, you can add <code>&parsoidnewlc=1</code> to the end of the URL to use Parsoid's implementation of LanguageConverter. That shows "COBOL" on this page as expected. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:17, 13 April 2026 (UTC) ::Parsoid is now experimentally enabled, so you don't need the `&parsoidnewlc=1` at the end of the URL any more. It appears that the COBOL page renders correctly now? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:40, 21 April 2026 (UTC) == [https://th.wikipedia.org/w/index.php?title=4_%E0%B9%80%E0%B8%97%E0%B8%9E%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B8%9E%E0%B8%B4%E0%B8%97%E0%B8%B1%E0%B8%81%E0%B8%A9%E0%B9%8C&oldid=12947833&useparsoid=1 thwiki:4 เทพผู้พิทักษ์] == อันนี้น่าจะผิดที่ร้องเพลงประกอบละคร [[User:ภรพัฒน์|ภรพัฒน์]] ([[User talk:ภรพัฒน์|talk]]) 12:47, 13 April 2026 (UTC) :Google translate says, "This is probably a mistake—singing the theme song for a TV drama." :This seems like a content issue, not a Parsoid issue. Mistakes in content should be correctly directly on the wiki. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:47, 21 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:%D7%A9%D7%A8%D7%A9%D7%97%D7%95%D7%9F/%D7%98%D7%99%D7%95%D7%98%D7%94&oldid=42822143&useparsoid=1 hewiki:משתמש:שרשחון/טיוטה] == אני רוצה לבטל את המצאות השם יעל סרלין בדף הטיוטות שלי כדי להתחיל ערך חדש [[User:שרשחון|שרשחון]] ([[User talk:שרשחון|talk]]) 12:59, 13 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Acidente_radiol%C3%B3gico_de_Goi%C3%A2nia&oldid=72061996&useparsoid=1 ptwiki:Acidente radiológico de Goiânia] == [[File:Captura_de_tela_de_miniaturas_renderizadas_pelo_Parsoid.png|thumb|250x250px]] As miniaturas estão minúsculas com as margens enormes. [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 15:13, 13 April 2026 (UTC) :It seems to be like this due to :<pre>html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img[width="250"] { width: calc(round(400px * var(--mw-file-upright,1),10px)) }</pre> [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 17:48, 19 April 2026 (UTC) ::{{Tracked|T423676}} [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) ::This should have been fixed by a backport we did yesterday. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:48, 21 April 2026 (UTC) == [https://hr.wikipedia.org/w/index.php?title=Marijana_Bijeli%C4%87&oldid=7429126&useparsoid=1 hrwiki:Marijana Bijelić] == Sve je podvuceno a ne treba tako biti [[User:Nikolica1512|Nikolica1512]] ([[User talk:Nikolica1512|talk]]) 17:08, 13 April 2026 (UTC) :I made some edits for you [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 18:32, 13 April 2026 (UTC) ::Thank you, I ameliorated those problematic parts, could you take a look at it? I hope it is good to go now as an article on wikipedia so people could access it. This person deserves to have a wiki page. ::Regards, [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 21:53, 13 April 2026 (UTC) :::Sorry, no. I was only helping with the syntax error. You'll need to take your request to the hrwiki community [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 22:25, 13 April 2026 (UTC) ::::And how do I do that exactly? Could you help me out with it? [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 22:56, 13 April 2026 (UTC) :::::You can ask on [[:hr:Wikipedija:Kafić]] and I'm sure someone there will help you out [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 00:34, 14 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 dewiki:Hilfe:Parserfunktionen] == Headings which use <code><nowiki><includeonly></nowiki></code> to change nesting level when transcluded don't appear as headings on original page [[User:TheFirstLevelDown|TheFirstLevelDown]] ([[User talk:TheFirstLevelDown|talk]]) 00:01, 14 April 2026 (UTC) :Parsoid does not support gluing heading together like the legacy parser did, so this syntax is not supported. :As an alternative, we suggest something like (to adjust depending on your exact use case) :<syntaxhighlight lang="wikitext"> <includeonly>===== title =====</includeonly> <noinclude>=== title ===</noinclude> </syntaxhighlight> :or, for a less robust version (but that doesn't require repeating the title) :<syntaxhighlight lang="wikitext"> <includeonly>=====</includeonly><noinclude>===</noinclude> title <includeonly>=====</includeonly><noinclude>===</noinclude> </syntaxhighlight> [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 12:45, 14 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Amor_eterno_una_tragedia_anunciada&oldid=172974810&useparsoid=1 eswiki:Amor eterno una tragedia anunciada] == el título de la página está como "Amor eterno una tragedia anunciada" y no deja cambiarlo al original que es "Amor Eterno: Una tragedia anunciada" [[User:Goodfriendspictures|Goodfriendspictures]] ([[User talk:Goodfriendspictures|talk]]) 09:59, 14 April 2026 (UTC) :To me it looks like the [[DISPLAYTITLE]] magic word is disabled though {{wg|AllowDisplayTitle}} in eswiki. Nothing to do with Parsoid. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 10:12, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:TanjaKo/Sandbox&oldid=150217478&useparsoid=1 itwiki:Utente:TanjaKo/Sandbox] == Nel testo non sono presenti errori e le frasi sono sottolineate con una linea rossa ondulata. Come risolverlo visual bug? Grazie [[User:TanjaKo|TanjaKo]] ([[User talk:TanjaKo|talk]]) 17:42, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Raduni/Raduni_in_Sicilia_2026&oldid=150224594&useparsoid=1 itwiki:Wikipedia:Raduni/Raduni in Sicilia 2026] == just on iPhone 14 with iOS 18.7.7 both from safari or chrome and both from logged or unlogged and incognito mode, the last number of the participants list (made with "#") is bigger than the others [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 18:31, 15 April 2026 (UTC) == [https://atj.wikipedia.org/w/index.php?title=Otitikowin&oldid=16878&useparsoid=1 atjwiki:Otitikowin] == pas moyen de travailler en mode visuel sur la page [[User:Luc Patin|Luc Patin]] ([[User talk:Luc Patin|talk]]) 14:56, 16 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Zhang_Zeduan&oldid=173032341&useparsoid=1 eswiki:Zhang Zeduan] == La pagina está incompleta e inpublicable [[User:Mikemj1987|Mikemj1987]] ([[User talk:Mikemj1987|talk]]) 22:08, 17 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:08, 20 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=L%C3%ADnea_E3_(Euskotren_Trena)&oldid=173034070&useparsoid=1 eswiki:Línea E3 (Euskotren Trena)] == La imagen se ve un poco mal por el modo oscuro. [[User:UnniMan|UnniMan]] ([[User talk:UnniMan|talk]]) 00:55, 18 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:09, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Stadtbahn_Karlsruhe&oldid=265878452&useparsoid=1 dewiki:Stadtbahn Karlsruhe] == Shows reference error and the categoy Kategorie:Wikipedia:Seite mit Einzelnachweisfehlern but is not included in https://de.wikipedia.org/wiki/Kategorie:Wikipedia:Seite_mit_Einzelnachweisfehlern The same happens with other articles that had no reference errors with the old parser. Makes maintenance hard. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 09:26, 19 April 2026 (UTC) :Tracked in https://phabricator.wikimedia.org/T423924 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Indiana_Jones_and_the_Fate_of_Atlantis&oldid=265815741&useparsoid=1 dewiki:Indiana Jones and the Fate of Atlantis] == Shows a reference error that is not visible in the preview function. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:06, 19 April 2026 (UTC) :The error came through a Reference with the same name in a used template https://de.wikipedia.org/wiki/Vorlage:Verkaufszahlen_LucasArts_Adventures Still bad to have an error that wasn't there with the old parser and isn't shown in the preview or maintenance category. --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:27, 19 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Evento_Azolla&oldid=72103944&useparsoid=1 ptwiki:Evento Azolla] == [Convert: número inválido] na parte de Efeitos Globais [[User:Marina Funez|Marina Funez]] ([[User talk:Marina Funez|talk]]) 00:28, 20 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:10, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Musikk%C3%A1r&oldid=144140&useparsoid=1 smnwiki:Myenster:Musikkár] == Instead of dealing with this issue and the other issue on smnwiki listed below, these were quietly archived. These are still displaying messed up months later after they were reported the first time. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:53, 20 April 2026 (UTC) :We may have missed this previously, but edits like [https://smn.wikipedia.org/w/index.php?title=Myenster%3AMusikk%C3%A1r&diff=152826&oldid=144359 this] should fix the rendering. This should work for the other pages below as well. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 12:42, 20 April 2026 (UTC) ::Thank you. I'll do the same for any other templates I come across that display like that one did. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 15:49, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Diskografia&oldid=62663&useparsoid=1 smnwiki:Myenster:Diskografia] == Instead of dealing with this issue and the other issue on smnwiki listed above, these were quietly archived. These are still displaying messed up months later after they were reported the first time. -[[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Kirje%C4%8D%C3%A4llee&oldid=32928&useparsoid=1 smnwiki:Myenster:Kirječällee] == Like the other display issues in smnwiki, this is also displaying messed up after the change. [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. For all other pages you encounter on wiki like this, please make similar edits. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Donald_A._Wollheim&oldid=266357315&useparsoid=1 dewiki:Donald A. Wollheim] == Picture is shown within a big white box, which isn't the case with the old parser. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 11:15, 20 April 2026 (UTC) :[[phab:T421524]] [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe_Diskussion:Bilder&oldid=266370955&useparsoid=1 dewiki:Hilfe Diskussion:Bilder] == see [[w:de:Hilfe Diskussion:Bilder #Skalierung von Bildern mit dem Parameter hochkant scheint nicht mehr zu funktionieren]] [[User:BurghardRichter|BurghardRichter]] ([[User talk:BurghardRichter|talk]]) 22:24, 20 April 2026 (UTC) == [https://tcy.wikipedia.org/w/index.php?title=%E0%B2%AE%E0%B3%81%E0%B2%96%E0%B3%8D%E0%B2%AF_%E0%B2%AA%E0%B3%81%E0%B2%9F&oldid=359337&useparsoid=1 tcywiki:ಮುಖ್ಯ ಪುಟ] == in main page not enable <code>html.skin-theme-clientpref-night</code> [[User:ChiK|ChiK]] ([[User talk:ChiK|talk]]) 05:47, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:23, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == https://de.wikipedia.org/wiki/Gemeindestandsver%C3%A4nderungen_in_der_Schweiz == Die Links zu den Ankern gehen nicht [[Special:Contributions/&#126;2026-24437-27|&#126;2026-24437-27]] ([[User talk:&#126;2026-24437-27|talk]]) 11:53, 21 April 2026 (UTC) :I see you found a solution :) :For the exact issue: generating ids independently from their enclosing tag is not supported by Parsoid (although this is not documented - I'll fix that). :Thanks for the report! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:16, 21 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Albosaggia&oldid=50063504&useparsoid=1 svwiki:Albosaggia] == This article, and thousands of other articles, have erroneously been put in hidden categories [[:sv:Kategori:Sidor med referensfel]] and [[:sv:Kategori:Wikipedia:Projekt översätta källmallar]]. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 12:24, 21 April 2026 (UTC) :You can mark this issue as fixed. The problem root cause was in a new Template and Module created this morning. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:40, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Eurovision_Song_Contest_1992&oldid=258716277&useparsoid=1 dewiki:Eurovision Song Contest 1992] == Quelltext bearbeiten ist für Abschnitte nicht sichtbar [[User:Anmey10112|Anmey10112]] ([[User talk:Anmey10112|talk]]) 13:00, 21 April 2026 (UTC) :Translation: "Edit source" is not visible for sections. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Boro%C8%99e%C8%99ti,_Ia%C8%99i&oldid=17665231&useparsoid=1 rowiki:Boroșești, Iași] == Satul este Borosești nu Boroșești. [[User:Stalmada|Stalmada]] ([[User talk:Stalmada|talk]]) 13:07, 21 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:09, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Gebouwge%C3%AFntegreerde_zonnepanelen_(BIPV)&oldid=71021732&useparsoid=1 nlwiki:Gebouwgeïntegreerde zonnepanelen (BIPV)] == Bij de afbeeldingen zijn 3 afbeeldingen gecombineerd met de sjabloon {{Afbeelding combi}} . De sjabloon maakt gebruikt van elk aparte tekstvelden voor elke afbeeldingen. Echter is in dit geval bij de eerste twee afbeeldingen geen gebruik gemaakt van tekstveld en is al de tekst aan het eind geplaatst bij de laatste afbeelding. Door dit gebruik van de sjabloon worden de afbeeldingen zonder spatie direct na elkaar vertoont. Op de mobiele website worden de afbeeldingen met dit sjabloon wel met spaties vertoont. Merk op dat de engelse template wel de mogelijkheid heeft om afbeeldingen gecombineerd te laten zien met spaties er tussen en heeft deze variant template meer mogelijkheden dan de NL versie. Mogelijk dat er de uitwerkin ook niet helemaal correct is geweest, maar hierover is niet te oordelen vanwege de beperkte Wiki edit kennis. [[User:Public-Publicity|Public-Publicity]] ([[User talk:Public-Publicity|talk]]) 16:16, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:22, 21 April 2026 (UTC) :Translation: "In this section, three images have been combined using the template `Template:Afbeelding combi`. This template typically utilizes a separate text field for each individual image; however, in this specific instance, the text fields for the first two images were left unused, and all the accompanying text was instead placed at the end, alongside the final image. As a result of this specific application of the template, the images are displayed consecutively without any spacing between them. On the mobile version of the website, however, images utilizing this template *are* displayed with spacing. It is worth noting that the English-language version of this template *does* offer the capability to display combined images with spacing in between—making that variant of the template more versatile than its Dutch counterpart. It is possible that the implementation itself was not entirely correct; however, it is difficult to pass judgment on this matter due to limited expertise in Wiki editing." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:12, 23 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Talk:Rao_Laxmi_Chand&oldid=10828084&useparsoid=1 simplewiki:Talk:Rao Laxmi Chand] == This Page is fake and all the information is fake [[User:Rao Gourav|Rao Gourav]] ([[User talk:Rao Gourav|talk]]) 17:23, 21 April 2026 (UTC) :Triage: Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:28, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:07, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80%D0%BE%D0%B2%D1%81%D0%BA%D0%B8%D0%B9,_%D0%A1%D1%82%D0%B5%D0%BF%D0%B0%D0%BD_%D0%A4%D1%91%D0%B4%D0%BE%D1%80%D0%BE%D0%B2%D0%B8%D1%87&oldid=152793914&useparsoid=1 ruwiki:Александровский, Степан Фёдорович] == дублируется реф в инфобоксе [[User:Gleb95|Gleb95]] ([[User talk:Gleb95|talk]]) 20:21, 21 April 2026 (UTC) :Translation: "The reference is duplicated in the infobox." :The legacy parser version has 19 references in the references list, and Parsoid contains 22. This is likely a content issue, although I haven't looked into it to determine root cause. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:11, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is plenty of problems I see related to transliteration to Serbian Cyrillic. I prefer reading articles in Serbian Cyrillic (on top of our UI, I select "Ћирилица"). In current state, Parsoid should not be turned on at all on our Wikipedia {{multiple image | align = center | total_width = 1000 | image1 = Jefri Saks (no Parsoid).png | caption1 = Without Parsoid | image2 = Jefri Saks (Parsoid).png | caption2 = With Parsoid }} Note that, with Parsoid, everything is transliterated, even when marked with correct <nowiki><lang></nowiki> attribute. Without parsoid, original English text is correctly left un-transliterated. There is also a glitch where URL is not rendered in infoboxes, again, probably something about misrendering text which was supposed to avoid transliteration. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:43, 21 April 2026 (UTC) :This is [[phab:T424159|T424159 [P0] Parsoid doesn't "guessVariant" at top level on Serbian Wikipedia, and makes sr-ec rendering "unusable" for some pages]]. Fundamentally, the mark up on that page is incorrect, in so far as English and Latin text aren't properly marked with `-{....}-`. It "worked before" because of a top-level "guessVariant" routine which effectively disabled language converter entirely on some pages, including this one. I suspect I'm going to have to implement the same 'guessVariant' mechanism in Parsoid, since there appears to be too much content of this type without proper language markers. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:04, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is no "Edit with migration tool" entry in tools on Serbian Wikipedia. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:50, 21 April 2026 (UTC) :It needs to be enabled explicitly in Preferences > Editing > Developer tools > Enable parser migration tool. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:44, 23 April 2026 (UTC) == includeonly in headline syntax == no longer resolved properly == ''Example:'' [[w:de:Hilfe:Parserfunktionen]] This page (and many others of our help pages) are made for dual use: # stand alone # transclusion of several help pages of similar topic into a combined complete story. They contain headlines like <syntaxhighlight lang="wikitext"> <includeonly>=</includeonly>== Allgemeines ==<includeonly>=</includeonly> </syntaxhighlight> If stand alone, this shall be displayed as H2. * When combined, the page title will be shown as H2 and the section as H3. Swift solution most welcome – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:23, 22 April 2026 (UTC) : BTW – transclusion works correctly: [[w:de:Hilfe:Parserfunktionen/*]] --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:27, 22 April 2026 (UTC) :https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 has our suggested solution (the first form preferably). It works in transclusion mode because the preprocessor is involved. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:53, 22 April 2026 (UTC) ::“has our suggested solution (the first form preferably). It works” ::I do not understand what is “our suggested solution” – please look at this current page. It has neither TOC nor any headline, since the == are displayed within the text, using the default parsing. There are 10 headlines. ::Astonished – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 21:45, 22 April 2026 (UTC) :::Oops .. sorry! I pasted the wrong link! I meant to point you to [[#dewiki:Hilfe:Parserfunktionen|this section]] on this page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 00:09, 23 April 2026 (UTC) You’re imposing some work on us. * I am happy that there are [https://de.wikipedia.org/w/index.php?search=H:+insource:includeonly+insource:%2Fincludeonly%5C%3E%3D%2B%5C%3C%5C%2Fincludeonly%2F&title=Spezial:Suche 12 pages only] to be updated now. * Fortunately, some other syntax has been used in [[w:de:H:VE/*]] – [[w:de:H:Lua/*]] – [[w:de:H:Tabellen/*]] – [[w:de:H:FAQ/Übersicht]] which are merging a huge pile of single pages. I do hope this exception will be described in WikiSyntax Documentation soon. --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 11:04, 23 April 2026 (UTC) :Thanks for your understanding and fixing the pages. Given all the work we've done to deploy to a wiki, at this point, we expect that all remaining rendering issues are likely going to be edge cases that affect small number of pages. We'll update the docs soon, yes. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:22, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%9F%D1%80%D0%B5%D0%B4%D1%83%D0%BF%D1%80%D0%B5%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5&oldid=116093745&useparsoid=1 ruwiki:Шаблон:Предупреждение] == [[:ru:Шаблон:Tpre]] ([[:ru:Модуль:Template call code]]) stops working entirely in Parsoid mode. See also local discussion: [[:ru:Википедия:Форум/Технический#c-Tarkoff-20260422084300-Шаблон:Предупреждение]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 16:40, 22 April 2026 (UTC) :That doesn't look good. Do you have a sense of how many pages are impacted? We will take a look tomorrow and see what is going on and if we can roll out a quick fix. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:07, 22 April 2026 (UTC) ::I see what is going on. This is [[phab:T353697|T353697]] which was resolved with https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/992274. The fix is to have the modules emit <code>format="wikitext"</code> so the <nowiki><span> tags aren't escaped as literal output. Can you see if that fixes it?</nowiki> [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:22, 22 April 2026 (UTC) ::: Yes, thank you. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:47, 22 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Rei_Ami&oldid=266367300&useparsoid=1 dewiki:Rei Ami] == The image of Ami on the top right corner should be rendered with a width of 250px but seems to be scaled down to round about 160px. When using the Legacy Parser the image is rendered as expected. The issue seems to effect only some images. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 18:59, 22 April 2026 (UTC) :@[[User:Jon (WMF)|Jon (WMF)]] says, "The original size of the image is 315x427. This is https://phabricator.wikimedia.org/T421524 - only way to fix it is for Parsoid to mark the img up with a class when the image original size is smaller than 400px. Otherwise it's working as expected." I'm not entirely sure I agree with this diagnosis, since T421524 would cause the image to appear "too large" not "too small". :@[[User:Guardian of Arcadia|Guardian of Arcadia]] what is your user thumbnail size preference, and what skin are you using? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:13, 23 April 2026 (UTC) ::@[[User:Cscott|Cscott]]: I'm using the default thumbnail size of 250px and Vector 2010 (Legacy) as skin. But the size issue also occurs when using other skins like Vector 2022, which can be seen by appending <code>useskin=vector-2022</code> to the URL or viewing the page in an incognito window. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 20:37, 23 April 2026 (UTC) :::What browser and version are you using @[[User:Guardian of Arcadia|Guardian of Arcadia]] ? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 21:46, 23 April 2026 (UTC) ::::Also can you check you don't have a different preference set in [[Special:GlobalPreferences]] and possibly try changing it and changing it back? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:55, 23 April 2026 (UTC) ::::@[[User:Jon (WMF)|Jon (WMF)]]: The issue isn't limited to my account only; it occurs in a logged-out state (within an incognito window) too. But your guess about the browser seems to be right: I have the described issue when using Firefox with the ESR version 115.35.0esr. Today I have tested with another browser (Chrome and Edge) as well as on a PC with a current (non-ESR) Firefox and there the image is shown as expected. So, is this a bug in this specific Firefox version? [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 19:47, 24 April 2026 (UTC) :::::Yes. This sounds like a bug in that specific Firefox version. If you can give me more details about the operating system version you are using I can see if I can replicate in browserstack.com . Is it possible there are any browser extensions installed on that browser? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 22:31, 24 April 2026 (UTC) ::::::The operating system on this PC is Windows 8.1 (Build 9600) and I do not have any browser extensions installed there. Hope this helps to reproduce the issue. If you need anything else please let me know. Thanks for your help. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 22:44, 24 April 2026 (UTC) :::::::That was incredibly useful information, thank you. I understand what is happening now, and there might be something we can do here. Note, this browser is on the cusp of our usual browser support levels, which is what's causing the problem. [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 16:54, 27 April 2026 (UTC) ::::::::That's great news. I would be verry happy if you or your team can fix it. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 17:00, 27 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Alexandru_Dobrogeanu-Gherea&oldid=17669378&useparsoid=1 rowiki:Alexandru Dobrogeanu-Gherea] == imaginea prea mare, la fel la multe articole cu infocaseta om politic, de pilda Vasile Luca, Luminita Odobescu etc face contrast cu imagini in alte infocasete unde problema se poate regla [[User:Ewan2|Ewan2]] ([[User talk:Ewan2|talk]]) 01:25, 23 April 2026 (UTC) :Google translate: "the image is too large, the same as in many articles with the politician infobox, for example Vasile Luca, Luminita Odobescu, etc. it contrasts with images in other infoboxes where the problem can be adjusted." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 18:50, 23 April 2026 (UTC) ::@[[User:Jon (WMF)|Jon (WMF)]] says "For Romanian Wikipedia, there was a problem with the infobox styles. Pretty sure it's been fixed since. It could just be that he's seeing 400px instead of 300px. The infobox image looks identical to me in Parsoid and legacy." ::@[[User:Ewan2|Ewan2]] are you using the default thumbnail size (250px) or a larger size in your user preferences? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:07, 23 April 2026 (UTC) == [https://zu.wikipedia.org/w/index.php?title=Gashamo_Hawd_Somali_Ethiopia&oldid=122552&useparsoid=1 zuwiki:Gashamo Hawd Somali Ethiopia] == Is the city of Hawd Zone [[User:Maaaaskaas11|Maaaaskaas11]] ([[User talk:Maaaaskaas11|talk]]) 21:58, 23 April 2026 (UTC) == [https://ru.wikipedia.org/wiki/Текумсе ruwiki:Текумсе] == For some reason, the comment "До эскиза Лоссинга не было известно..." is repeated twice (see subsection "Комментарии" at the end of the article). This comment is generated by template "ref+" placed inside the template "персона" (an analogue of "Template:Infobox person"), and it is supposed to appear only once. Thanks! [[User:Adavyd|Adavyd]] ([[User talk:Adavyd|talk]]) 22:04, 23 April 2026 (UTC) :This is probably {{phab|T415789}}, which would be solved by adding a name to the reference, but then we end up running into {{phab|T423924}} - the template ends up defining the reference twice with subtly different content (as far as Parsoid is concerned) and the same name, which triggers an error. The fix will probably be to add a name to the reference once {{phab|T423924}} is handled. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:43, 24 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=FIDO2&oldid=264704558&useparsoid=1 dewiki:FIDO2] == Erste Grafik überlagert den Text und die Werkzeugleiste links [[User:Hinnerk11|Hinnerk11]] ([[User talk:Hinnerk11|talk]]) 23:51, 23 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Amanda_Kathrine_Smith/Sandbox&oldid=150348388&useparsoid=1 itwiki:Utente:Amanda Kathrine Smith/Sandbox] == i don't see the "MOVE DRAFT" button. [[User:Amanda Kathrine Smith|Amanda Kathrine Smith]] ([[User talk:Amanda Kathrine Smith|talk]]) 14:14, 24 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:36, 28 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%A1%D1%80%D0%B1%D0%B8%D1%98%D0%B0_(1071%E2%80%941217)&oldid=30892614&useparsoid=1 srwiki:Србија (1071—1217)] == Text inside {{lang-la.. and other {{lang-... templates is not displayed at all. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:46, 24 April 2026 (UTC) :Never mind, in process of adapting our templates for Parsoid, I missed additional change needed in an auxillary module. All is good now. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A2%D1%80%D0%B3/%D0%94%D1%80%D1%83%D0%B3%D0%B8&oldid=30921466&useparsoid=1 srwiki:Википедија:Трг/Други] == <nowiki>__NOCONTENTCONVERT__</nowiki> does not work in Parsoid. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 18:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=Queen&oldid=30824348&useparsoid=1 srwiki:Queen] == Parsoid does not honor __БЕЗКН__ (magic word to suppress title conversion during language conversion) [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 20:03, 24 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%A4%D0%BE%D1%80%D1%83%D0%BC/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8&oldid=152858025&useparsoid=1 ruwiki:Википедия:Форум/Новости] == Исчез логотип в скине Вектор-2010 при включенном гаджете, который отображает праздничные логотипы. При отключении гаджета в настройках — повседневный логотип виден. [[User:Рыцарь поля|Рыцарь поля]] ([[User talk:Рыцарь поля|talk]]) 00:16, 25 April 2026 (UTC) :Triage: not a Parsoid visual issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:22, 27 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9F%D1%80%D0%BE%D0%B5%D0%BA%D1%82:%D0%91%D0%B8%D0%B1%D0%BB%D0%B8%D0%BE%D1%82%D0%B5%D0%BA%D0%B0/%D0%A2%D1%80%D0%B5%D0%B1%D1%83%D1%8E%D1%82%D1%81%D1%8F_%D0%BA%D0%BD%D0%B8%D0%B3%D0%B8&oldid=152853098&useparsoid=1 ruwiki:Проект:Библиотека/Требуются книги] == Конфликт [[:ru:Проект:Библиотека/Требуются книги/Шапка]] с содержанием страницы, из-за чего в [[:ru:Шаблон:shortcut|Шаблон:shortcut]] помещается раздел "содержание" (выглядит это так: [https://ibb.co/219kN3dW 1] и [https://ibb.co/bgM0Fmpn 2]). ------- The conflict between [[:ru:Проект:Библиотека/Требуются книги/Шапка]] and the page content causes the "содержание" section to appear inside [[:ru:Шаблон:shortcut|Шаблон:shortcut]] (this is how it looks: [https://ibb.co/219kN3dW 1] and [https://ibb.co/bgM0Fmpn 2]). [[User:Футболло|Futbollo]] ([[User talk:Футболло|talk]]) 01:10, 25 April 2026 (UTC) :Thank you for the report - I've filed {{phab|T424492}} for it. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:33, 27 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Copa_Intercontinental_da_FIFA_de_2025&oldid=72134360&useparsoid=1 ptwiki:Copa Intercontinental da FIFA de 2025] == Quadro de informações foi excluído por acidente. [[User:AnderSilv42|AnderSilv42]] ([[User talk:AnderSilv42|talk]]) 00:16, 26 April 2026 (UTC) :Triage: Content related - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 15:23, 26 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Michel_W%C3%B6cke&oldid=266505400&useparsoid=1 dewiki:Michel Wöcke] == Bild (Thumb) viel zu gross [[User:Albinfo|Albinfo]] ([[User talk:Albinfo|talk]]) 13:44, 26 April 2026 (UTC) == [https://tn.wikipedia.org/w/index.php?title=Sekolo_Se_Segolwane_Sa_Nata&oldid=49572&useparsoid=1 tnwiki:Sekolo Se Segolwane Sa Nata] == I tried fixing the references but It still says pages with reference errors so I don't know what could be the issue [[User:Blackgirlmighty|Blackgirlmighty]] ([[User talk:Blackgirlmighty|talk]]) 17:00, 26 April 2026 (UTC) :You only need to define a reference once even if you want to use it multiple times - see https://www.mediawiki.org/wiki/Help:Cite#Multiple_uses_of_the_same_footnote for more information. One of each of the references Mmegi2012 and Mmegi2023 should be kept as is; the others should be replaced by <nowiki><ref name="Mmegi2012" /></nowiki> (or 2023) without content. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:39, 27 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Pete_Aguilar&oldid=8671369&useparsoid=1 simplewiki:Pete Aguilar] == This is a less detailed copy of another Wikipedia page. There are two wiki pages showing Pete Aguilar and this is an outdated version. [[User:SuperPug3739|SuperPug3739]] ([[User talk:SuperPug3739|talk]]) 04:56, 27 April 2026 (UTC) :Triage: content related, not Parsoid related [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:46, 27 April 2026 (UTC) == [https://fi.wikipedia.org/w/index.php?title=Hoito-_kasvatussuunnitelma&oldid=23973675&useparsoid=1 fiwiki:Hoito- kasvatussuunnitelma] == Sivun nimi piti olla Hoito- ja kasvatussuunnitelma. Muokkaaminen ei onnistunut. [[User:Nebiux|Nebiux]] ([[User talk:Nebiux|talk]]) 12:01, 29 April 2026 (UTC) :Triage: content related, not Parsoid-related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:04, 30 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Usuario:Luigi_Nakano&oldid=173203320&useparsoid=1 eswiki:Usuario:Luigi Nakano] == An error appears, which should appear when template [[w:es:Plantilla:Estado usuario|Estado usuario]] has nothing in 1=. However, there is a parameter in 1=, so the result should be "Conectado" or "Desconectado", and not "Error:No se ha indicado usuario.". [[User:Luigi Nakano|<span style="color:green">Luigi</span> <span style="color:blue">Nakano</span>]] [[File:Emojione 1F3A7.svg|15px]] ([[User talk:Luigi Nakano|会話]]) 23:12, 29 April 2026 (UTC) :This looks like {{phab|T348722}}, for which a workaround is suggested in https://www.mediawiki.org/wiki/Parsoid/Parser_Unification/Instructions_for_editors#Access_to_parent_frame_from_within_extensions. Let us know if the problem persists after the fix! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:10, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=History_of_the_Ryukyu_Islands&oldid=1336895218&useparsoid=1 enwiki:History of the Ryukyu Islands] == The multiple issues display unsourced template when editing the article there is no such template. [[User:Lightoil|Lightoil]] ([[User talk:Lightoil|talk]]) 05:11, 30 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A7%D1%85%D0%B0%D0%B8%D0%B4%D0%B7%D0%B5,_%D0%9C%D0%B0%D0%BC%D0%B8%D1%8F_%D0%92%D0%B8%D1%81%D1%81%D0%B0%D1%80%D0%B8%D0%BE%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&oldid=152923873&useparsoid=1 ruwiki:Чхаидзе, Мамия Виссарионович] == In the old parser, links to non-existing file pages lead to Special:Upload for the file. In Parsoid, it's a strange link to Special:FilePath, which ends up confusing the editors who accustomed to uploading files this way. [[:ru:Служебная:GoToComment/c-ФВ-20260430140600-Не_загружается_файл|See local discussion]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:53, 30 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%94%D0%B5%D1%80%D0%B2%D0%B8%D1%88_%D0%9A%D0%BE%D1%80%D0%BA%D1%83%D1%82&oldid=30931273&useparsoid=1 srwiki:Дервиш Коркут] == At the bottom, there are several navboxes, Parsoid adds some whitespace between them [[File:Spaces between navboxes with Parsoid..png]] [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 21:21, 30 April 2026 (UTC) : https://phabricator.wikimedia.org/T425123 [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 15:27, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Sevayat&oldid=1351876642&useparsoid=1 enwiki:Talk:Sevayat] == The content assessment and talk page are displayed directly on the talk page, rather than within the “About this page” section (mobile view). [[User:S4yam|S4yam]] ([[User talk:S4yam|talk]]) 21:44, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:Template_editor&oldid=1351909200&useparsoid=1 enwiki:Wikipedia talk:Template editor] == I'm artist thi is my personal biography page [[User:Allymtulia|Allymtulia]] ([[User talk:Allymtulia|talk]]) 21:45, 30 April 2026 (UTC) :Triage: Content issue, not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Middle_of_Nowhere_(Kacey_Musgraves_album)&oldid=1351931473&useparsoid=1 enwiki:Middle of Nowhere (Kacey Musgraves album)] == Producer parameter that adops hlist system in Infobox album template occurs an error. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 01:07, 1 May 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Associazione_Calcio_Perugia_1996-1997&oldid=148287407&useparsoid=1 itwiki:Associazione Calcio Perugia 1996-1997] == Doesn't show all kits. Just the third and on top of the screen [[User:Madive60|Madive60]] ([[User talk:Madive60|talk]]) 01:29, 1 May 2026 (UTC) :This is probably fixed by the fix to {{phab|T425056}} and the current CSS workaround on-wiki. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:22, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%9B%BD%E6%97%97%E3%81%AE%E4%B8%80%E8%A6%A7&oldid=109342678&useparsoid=1 jawiki:国旗の一覧] == イラクの国旗がない [[User:平舞|平舞]] ([[User talk:平舞|talk]]) 03:17, 1 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:21, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Manting_Chan&oldid=1351960413&useparsoid=1 enwiki:Manting Chan] == Divorce, she is not divorced. [[User:Bananahammock311911511|Bananahammock311911511]] ([[User talk:Bananahammock311911511|talk]]) 04:54, 1 May 2026 (UTC) :Content issue, not a Parsoid issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 07:30, 1 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E9%9B%B7%E9%96%80%E9%9F%B3%E5%8A%A9&oldid=109345108&useparsoid=1 jawiki:雷門音助] == {{人名の曖昧さ回避}}や{{aimai}}を貼ると表示が崩れる。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 07:27, 1 May 2026 (UTC) :<nowiki>[[:jawiki:雷門五郎]]</nowiki>でも同様の問題が起きています。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 09:09, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Iceman_(Drake_album)&oldid=1350717409&useparsoid=1 enwiki:Talk:Iceman (Drake album)] == Banners showing up on mobile, not under “learn more about this page button” [[User:OrbitalVoid49|OrbitalVoid49]] ([[User talk:OrbitalVoid49|talk]]) 09:36, 1 May 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Bancu,_Harghita&oldid=13617293&useparsoid=1 rowiki:Bancu, Harghita] == Steagulnjudetului Hargita nu este acea cârpă secuiasca. [[User:Auto 4115|Auto 4115]] ([[User talk:Auto 4115|talk]]) 01:39, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Aurangabad&oldid=1351274322&useparsoid=1 enwiki:Aurangabad] == It has the old name of the city as it's title [[User:20mphwind|20mphwind]] ([[User talk:20mphwind|talk]]) 07:09, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%B9%E0%A6%BE%E0%A6%9C%E0%A6%B0%E0%A6%BE%E0%A6%AC%E0%A6%BE%E0%A6%A1%E0%A6%BC%E0%A7%80_%E0%A6%89%E0%A6%9A%E0%A7%8D%E0%A6%9A_%E0%A6%AC%E0%A6%BF%E0%A6%A6%E0%A7%8D%E0%A6%AF%E0%A6%BE%E0%A6%B2%E0%A6%AF%E0%A6%BC&oldid=8874755&useparsoid=1 bnwiki:হাজরাবাড়ী উচ্চ বিদ্যালয়] == তথ্যসুত্র ব্যয়বহুল নয়। [[User:Md Umor Faruk 2010|Md Umor Faruk 2010]] ([[User talk:Md Umor Faruk 2010|talk]]) 08:00, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=She_Did_It_Again&oldid=1352147079&useparsoid=1 enwiki:She Did It Again] == (Mobile) Huge error in hlist. Bullet points (•) are missing, and the items listed are arranged very roughly. Not sure why this error occurs for over three days. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 10:45, 2 May 2026 (UTC) :Thank you for the report - I have filed {{phab|T425245}} for this issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:30, 3 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%91%E4%B8%8A%E5%93%B2&oldid=109361964&useparsoid=1 jawiki:村上哲] == [[Template:循環参照]]が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:13, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=Wikipedia:%E4%BA%95%E6%88%B8%E7%AB%AF&oldid=109349724&useparsoid=1 jawiki:Wikipedia:井戸端] == 目次が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1 enwiki:Wiki (disambiguation)] == [[w:en:tm:dab]] (at the bottom of the page) appears to render differently on Parsoid compared to non-Parsoid. <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 14:27, 2 May 2026 (UTC) :Also appears to render differently on desktop Parsoid v. mobile Parsoid -- compare https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=mobile (different rendering) vs. https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=desktop ('expected' rendering, AFAIK) <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 16:34, 2 May 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Horv%C3%A1th_Kriszti%C3%A1n_(fest%C5%91,_1976,_Budapest)&oldid=28948319&useparsoid=1 huwiki:Horváth Krisztián (festő, 1976, Budapest)] == Az a probléma, hogy nem szeretném hoyg festő, és 1976 Budapest legyen hozzá kírva. Elrontottam, és nem tudtam külön, új cikket írni róla. [[User:Pizzsus|Pizzsus]] ([[User talk:Pizzsus|talk]]) 20:47, 2 May 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%99%D7%A6%D7%97%D7%A7_%D7%9E%D7%90%D7%99%D7%A8_%D7%90%D7%9C%D7%AA%D7%A8&oldid=43088529&useparsoid=1 hewiki:יצחק מאיר אלתר] == הציטוטים בכתב דיויד בעברית לקויים. Text quotes in David font are displayed poorly. [[User:פרידבערג|פרידבערג]] ([[User talk:פרידבערג|talk]]) 21:36, 2 May 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9B%D0%B8%D1%86%D0%B5%D0%BD%D0%B7%D0%B8%D0%B8_%D0%B8_%D0%B8%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B_Creative_Commons&oldid=152790052&useparsoid=1 ruwiki:Лицензии и инструменты Creative Commons] == refs don't work with vector-2010 (but it works for vector-2022) [[User:Petsernik|Petsernik]] ([[User talk:Petsernik|talk]]) 23:05, 2 May 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Huawei&oldid=173270512&useparsoid=1 eswiki:Huawei] == El segundo sitio web que sale no existe es un vandalismo en wikimedia ingles o un error [[User:Usuario 016|Usuario 016]] ([[User talk:Usuario 016|talk]]) 23:15, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%8C%97%E6%9D%91%E8%81%A1&oldid=109365307&useparsoid=1 jawiki:北村聡] == 人名の曖昧さ回避Templateを挿入すると、上手く表示されず、大きな改行空白と共に「.mw-parser-output .dmbox{display:flex;align-items:center;clear:both;margin:0.9em 1em;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:0.25em 0.35em;font-size:95%}.mw-parser-output .dmbox>*{flex-shrink:0;margin:0 0.25em;display:inline}.mw-parser-output .dmbox-body{flex-grow:1;flex-shrink:1;padding:0.1em 0}」 というものが出る。 [[User:Geogie|Geogie]] ([[User talk:Geogie|talk]]) 23:35, 2 May 2026 (UTC) o69f5n3usb1zed3dfhdljxlk6khgt4d 8364441 8364399 2026-05-03T15:30:56Z Polibil 1721816 /* dewiki:Wikipedia:Schreibwettbewerb */ new section 8364441 wikitext text/x-wiki Post your feedback about using [[Parsoid/Parser Unification|Parsoid]] to render articles. [[Parsoid/Parser_Unification/Known_Issues|Learn how to report problems clearly]]. '''Need more attention? [https://phabricator.wikimedia.org/maniphest/task/edit/form/43/?projects=PHID-PROJ-3y2wduoz5xezwveaq426 Report directly in Phabricator].''' {{note|This is for reporting feedback on the integration of the Parsoid parser only. '''For wiki content issues, such as concerns about article content, please report on your local wiki.''' }} [[Parsoid/Parser_Unification/Known_Issues|View known issues]] __NEWSECTIONLINK__ {{Archive box| [[/Archive 1]] [[/Archive 2]]}} == [https://nl.wikipedia.org/w/index.php?title=Wikipedia:Aanmelding_moderatoren&oldid=70702688&useparsoid=1 nlwiki:Wikipedia:Aanmelding moderatoren] == Sometimes, in a numbered list, the number stays on the first line when there are indented lines below it, and sometimes the number is vertically aligned between the different lines. For votes, it is preferable that the number remains on the line that starts with only “#” and not on lines with an indentation “#:”. [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:34, 15 February 2026 (UTC) :i.e. see item 33. under '<nowiki/>'''''Voor moderatorschap ContextCreator'''<nowiki/>'<nowiki/>'' [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:36, 15 February 2026 (UTC) ::I can't see any difference between Parsoid and the legacy Parser on that page, it appears that the number is correctly aligned in both cases. Are you using a different skin by any chance? Does the difference still appear? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:42, 21 April 2026 (UTC) :::I see no difference anymore - it is fixed. Thanks anyway! [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 16:01, 21 April 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Discussion_Wikip%C3%A9dia:Wikiconcours&oldid=233327486&useformat=mobile&useparsoid=1 frwiki:Discussion Wikipédia:Wikiconcours] == Content that is hidden inside the "Learn more about this page" button from MobileFrontend with legacy parser is not inside it with Parsoid. [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 08:32, 22 February 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Laurence_Olivier&oldid=148833592&useparsoid=1 itwiki:Laurence Olivier] == Giant Oscar statue icons (sgranate) [[User:UmbraSolis|UmbraSolis]] ([[User talk:UmbraSolis|talk]]) 20:28, 19 February 2026 (UTC) :This was probably due to https://phabricator.wikimedia.org/T417828, which is now fixed. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:53, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:43, 21 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Bologna_Football_Club_1909&oldid=149496425&useparsoid=1 itwiki:Bologna Football Club 1909] == problem with displaying football shirts [[User:Gio Bike|Gio Bike]] ([[User talk:Gio Bike|talk]]) 17:49, 20 February 2026 (UTC) :Can you be more specific, or is it fixed now? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:55, 27 February 2026 (UTC) ::Now it is OK [[Special:Contributions/&#126;2026-13011-93|&#126;2026-13011-93]] ([[User talk:&#126;2026-13011-93|talk]]) 17:20, 27 February 2026 (UTC) :::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:44, 21 April 2026 (UTC) == [https://vi.wiktionary.org/w/index.php?title=Wiktionary:Th%E1%BB%91ng_k%C3%AA/S%E1%BB%91_m%E1%BB%A5c_t%E1%BB%AB_theo_ng%C3%B4n_ng%E1%BB%AF/T%E1%BA%A5t_c%E1%BA%A3&oldid=2331126&useparsoid=1 viwiktionary:Wiktionary:Thống kê/Số mục từ theo ngôn ngữ/Tất cả] == Phần cuối bảng bị lỗi, không hiện ra số mục từ mà chỉ hiện ra "0" hoặc "-2" mà không rõ lý do, tôi không viết nhầm gì cả. (English: The table got error, just display "0" or "-2", but I don't have any error at write wikitext.) [[User:NHNAnh|NHNAnh]] ([[User talk:NHNAnh|talk]]) 05:57, 21 February 2026 (UTC) :I believe this might be due to "Expensive parser function count: 1080/500" in the debug log: there are too many expensive parser function counts on this page (PAGESINCATEGORY is expensive), and the later functions are not executed. :I would suggest splitting the page into several pages, if possible. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:04, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) == [https://cs.wikipedia.org/w/index.php?title=Celerina/Schlarigna&oldid=25694456&useparsoid=1 cswiki:Celerina/Schlarigna] == V tabulce v sekci obyvatelstvo se u jedné buňky zobrazuje černé pozadí. Pokud dám ale historii stránky a podívám se na aktuální verzi, vykreslí se stránka správně. To samé se opakuje i u jiných podobných stránek se stejně formátovanými tabulkami. [[User:Matijak|Matijak]] ([[User talk:Matijak|talk]]) 17:02, 22 February 2026 (UTC) :I cannot see a black cell in that table. Is this issue fixed? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:09, 27 February 2026 (UTC) ::I can see it in in both the history (latest revision) and on the page itself (live). It's the leftmost 'Počet' cell in the 'Jazyky v Celerině' table. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 10:10, 28 February 2026 (UTC) :::Aha! :::the cell itself is not dark, the text in it is, and only in dark mode. It is also present in the legacy rendering, which seems to hint at a problem with the table markup itself and not a parser issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:11, 2 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) :::::Not a Parsoid issue most likely, but it has not been fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:21, 24 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia:Biographies_of_living_persons&oldid=1340299616&useparsoid=1 enwiki:Wikipedia:Biographies of living persons] == Reporting a visual bug for all pages that suddenly arose as of this morning on Safari Mobile - the Page Actions Overflow div is in a permanently open state but inaccessible to via clicks to either toggle the menu or select any of the tools on the menu. In addition to being unable to interact with it, all of the styling broken and makes the top right section of the page unusable and barely readable. [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 14:34, 27 February 2026 (UTC) :Is this issue still present? Sorry, it has been a while since you reported this, I'm hoping that the issue has been resolved by now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) ::Yes, it appears to have been resolved. Thanks for following up! [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 03:38, 22 April 2026 (UTC) == [https://oc.wikipedia.org/w/index.php?title=Esqu%C3%A8rra_(politica)&oldid=2495338&useparsoid=1 ocwiki:Esquèrra (politica)] == There's an issue with the interlinks, this article should be connected with the other ones about left-wing politics [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 06:39, 28 February 2026 (UTC) :Yes, it was an issue with the interlinks, but those should naturally not be reported as visual issues ('bogue visuler') as the have nothing to do with Parsoid. You can link pages which have no connections by using the 'Apondre los ligams interlengas' (Add interlanguage links) button from the 'Bóstia d'aisinas' (Tools) menu. Unless, of course, Parsoid somehow blocks automatic linking of translations. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:10, 28 February 2026 (UTC) ::I don't know why but it was finally done (thank you so much to the person who did that), but the thing is, i tried what you said before and it kept telling me that i didn't had the permission to link the two articles... [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 19:33, 1 March 2026 (UTC) :::I did that, you are welcome. It appears that you are not autoconfirmed yet on Wikidata, and that this Wikidata entry requires that, which if both true I would expect you to not be able to do this change. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 04:21, 21 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) :::::Sorry? [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:48, 23 April 2026 (UTC) ::::::We're using the <nowiki>{{done}}</nowiki> template to track which issues have been resolved, vs still outstanding. I don't believe there is any additional follow required by the Content Transform team on this report? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 05:00, 24 April 2026 (UTC) :::::::Oh, no, I just didn't know this is a system you are using. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:19, 24 April 2026 (UTC) == [https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/Page_translation_administration&oldid=8240537&useparsoid=1 Help:Extension:Translate/Page translation administration] == The topmost warning in the 'Changing the source text' section does not display the codeblock content. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:47, 28 February 2026 (UTC) :This is a very clever use of the <code><nowiki>{{^(}}</nowiki></code> template to avoid creating an unintended translation marker. I've [https://www.mediawiki.org/w/index.php?title=Help%3AExtension%3ATranslate%2FPage_translation_administration&diff=8349012&oldid=8343860 replaced it with more straight-forward entity-escaping] to be more compatible with Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:54, 21 April 2026 (UTC) ::Also filed this as [[phab:T424066]] [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 16:46, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&oldid=67999951&useparsoid=1 nlwiki:Railterminal Gelderland] == The map in [[:nl:sjabloon:maplink]] doesn't show up in my Chrome browser for Chromebook. It does show in https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&useparsoid=0 and also when I log out. [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:54, 5 March 2026 (UTC) :Btw, the map is visible for a moment, then it disappears [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:56, 5 March 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%91%D7%A8%D7%90%D7%95%D7%9C_%D7%A1%D7%98%D7%90%D7%A8%D7%A1&oldid=42870396&useparsoid=1 hewiki:בראול סטארס] == למה הקישור לתמונה ששמתי לא עובד? בכל מקרה אשמח שמישהו ישים את התמונה העדכנית שמשומשת בדף באנגלית מאחר והלוגו למשחק שונה. מצטער על התקלה. [[User:Jhho48|Jhho48]] ([[User talk:Jhho48|talk]]) 16:43, 9 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Infokastis: Sulamistemperatuur 236,15 K (−37 °C) Miinusmärk peaks olema sidekriipsust pikem, kuid pikema kriipsu sisestamine põhjustab tõrketeate. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:05, 11 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Vabandust, lühike (st vale) kriips oli kuvatud siiski ainult lähteteksti režiimis; salvestatud tekstiga küljendis on kuvatud õige kriips. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:07, 11 March 2026 (UTC) == kowiki:sticky header is broken == [[:en:Template:Sticky header|Template:Sticky header]] is not working properly on kowiki. Please compare [//ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=0] with [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=1].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:34, 16 March 2026 (UTC) :It may have been because of an empty row before the table caption. I [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&diff=41501849&oldid=41501840 edited the page] to remove it. But, looks like another editor has removed the sticky header template call from above the table. If you can put it back, it will work. See my [[:ko:사용자:SSastry_(WMF)/Sandbox|sandbox]] page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 03:22, 17 March 2026 (UTC) == [https://ko.wikipedia.org/w/index.php?title=%ED%8B%80:%EA%B5%AD%EA%B8%B0%EB%82%98%EB%9D%BC&oldid=40992836&useparsoid=1 kowiki:틀:국기나라] == 변수를 덧붙였음에도 {{국기나라|독일|제국}}이 여전히 '독일'로 출력됩니다. [[User:Triican|Triican]] ([[User talk:Triican|talk]]) 05:04, 19 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Angus_T._Jones&oldid=1333447723&useparsoid=1 enwiki:Angus T. Jones] == The infobox photo is squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 17:11, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Ukraine&oldid=1343921679&useparsoid=1 enwiki:Ukraine] == All maps in the infobox are squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 18:36, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Sabia_que&oldid=54991313&useparsoid=1 ptwiki:Wikipédia:Sabia que] == O arquivo de discussão está 'bugando' visualmente. Está no meio de "Curiosidades em destaque" [[User:Heylenny|Heylenny]] ([[User talk:Heylenny|talk]]) 23:27, 19 March 2026 (UTC) :{{done}} Template adjusted on the page. [[User:Fúlvio|Fúlvio]] ([[User talk:Fúlvio|talk]]) 02:59, 22 March 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%AC%E0%A6%BF%E0%A6%AE%E0%A6%B2_%E0%A6%98%E0%A7%8B%E0%A6%B7_(%E0%A6%B6%E0%A6%BF%E0%A6%B6%E0%A7%81%E0%A6%B8%E0%A6%BE%E0%A6%B9%E0%A6%BF%E0%A6%A4%E0%A7%8D%E0%A6%AF%E0%A6%BF%E0%A6%95)&oldid=8851768&useparsoid=1 bnwiki:বিমল ঘোষ (শিশুসাহিত্যিক)] == আলোচনা পাতায় অন্য নিবন্ধের আলোচনা পাতা [[User:Ams riyad|Ams riyad]] ([[User talk:Ams riyad|talk]]) 01:28, 20 March 2026 (UTC) == [https://vi.wikipedia.org/w/index.php?title=Wikipedia:Th%E1%BA%A3o_lu%E1%BA%ADn&oldid=74869958&useparsoid=1 viwiki:Wikipedia:Thảo luận] == TOC is rendered inside the link bar, but it shouldn't be. [[User:NguoiDungKhongDinhDanh|<span class="skin-invert" style="color:black;font-family:Monotype Corsiva;font-size:110%;font-weight:normal;line-height:normal">NguoiDungKhongDinhDanh</span>]] 03:20, 20 March 2026 (UTC) :This was most likely [[phab:T421629|T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] and we believe this issue has been fixed. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:51, 24 April 2026 (UTC) == [[wikt:ru:омфал]] == For more than a day, there have been anomalies in the behavior of tables of contents (ToCs) in Russian Wiktionary. The issues differ based on the selected skin and affect only some pages. If the old Vector theme is used, the automatically generated ToC simply fails to appear on certain pages, despite the page having over three headers and the absence of magic words such as NOTOC. If the new Vector theme is used, the ToC on some pages is misplaced and not positioned where it should be by default. The problem is not present if the old parser is used. Purging the page's cache seems to fix the issue as well. ToC is displayed correctly in the preview-mode too. Some affected pages: * [[wikt:ru:омфал]] * [[wikt:ru:безграмотность]] * [[wikt:ru:હંમેશા]] * [[wikt:ru:ಯಾವಾಗಲೂ]] * [[wikt:ru:stadigvæk]] * [[wikt:ru:alligevel]] * [[wikt:ru:kanunay]] * [[wikt:ru:ሁሌ]] * [[wikt:ru:zawżdy]] * and maaany mooore... [[User:綿貫桜哉|綿貫桜哉]] ([[User talk:綿貫桜哉|talk]]) 08:11, 20 March 2026 (UTC) :This was [[phab:T421629|⚓ T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] but should be fixed now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:55, 24 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Louis_Nirenberg&oldid=15616502&useparsoid=1 rowiki:Louis Nirenberg] == The image seems to be the 250px thumbnail scaled up to what looks like 400px width. [[User:Andrei Stroe|Andrei Stroe]] ([[User talk:Andrei Stroe|talk]]) 10:16, 20 March 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Aide:Accueil&oldid=232433495&useparsoid=1 frwiki:Aide:Accueil] == custom collapsible elements render differently with parsoid [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 14:19, 20 March 2026 (UTC) :I filed https://phabricator.wikimedia.org/T421859. Thanks for the report. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:07, 31 March 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Katten_(olika_betydelser)&oldid=43770842&useparsoid=1 svwiki:Katten (olika betydelser)] == The legacy parser adds an empty line before the template Förgrening (which is a kind of table). The Parsoid parser don't do that. This occurs on all pages using that template. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 18:32, 21 March 2026 (UTC) :Ya, this is known difference with some paragraph wrapping which is tricky to fix. In this case, I recommend adjusting the top margin of the table by editing the base template: https://sv.wikipedia.org/w/index.php?title=Mall%3AF%C3%B6rgrening%20bas&veaction=editsource [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:01, 31 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Gen_Z_stare&oldid=1344701043&useparsoid=1 enwiki:Gen Z stare] == The infobox image is unusually narrow. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 01:51, 22 March 2026 (UTC) :For me the image is stretched horizontally by a fair bit. It seems like the following bit of code is to blame: :<syntaxhighlight lang="css"> :html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img {width: 400px; } :</syntaxhighlight> [[User:Sohom Datta|Sohom]] ([[User talk:Sohom Datta|talk]]) 01:54, 22 March 2026 (UTC) ::I'm not seeing any visible difference between legacy parser and Parsoid in my testing. Can you share a screenshot @[[User:Snowmanonahoe|Snowmanonahoe]] ? What skin and browser are you using? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 17:43, 27 March 2026 (UTC) :::@[[User:Jon (WMF)|Jon (WMF)]]: I don't see it anymore either. I'm using Vector 2022 and Firefox 149. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 17:46, 27 March 2026 (UTC) ::::Ah okay. I think this was a caching issue then. Some "temporary turbulence" was to be expected with this roll out. Thanks for reporting! [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 18:29, 27 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Virginia_Fonseca&oldid=71959182&useparsoid=1 ptwiki:Virginia Fonseca] == A 1ª imagem da página na infocaixa tem um tamanho grande demais [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 11:34, 22 March 2026 (UTC) :I don't see the problem. The page renders identically in Parsoid and with the old/legacy parser. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:22, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Xander_Harris&oldid=71958675&useparsoid=1 ptwiki:Xander Harris] == Seção de referências expandida [[User:Vitruviano|Vitruviano]] ([[User talk:Vitruviano|talk]]) 15:06, 22 March 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Bruker:Znuddel&oldid=25704667&useparsoid=1 nowiki:Bruker:Znuddel] == Hele siden er helt feil [[User:Nevemagneten|Nevemagneten]] ([[User talk:Nevemagneten|talk]]) 20:35, 24 March 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Main_page&oldid=2122&useparsoid=1 abstractwiki:Abstract Wikipedia:Main page] == Favicon is showing a dark background around the rounded corners on Chrome. [[User:Jsengupt|Jsengupt]] ([[User talk:Jsengupt|talk]]) 16:14, 25 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=System_(typeface)&oldid=1329545007&useparsoid=1 enwiki:System (typeface)] == Infobox image is stretched horizontally [[User:Anna328p|Anna328p]] ([[User talk:Anna328p|talk]]) 06:59, 26 March 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Enged%C3%A9lyk%C3%A9r%C3%A9s&oldid=28288240&useparsoid=1 huwiki:Wikipédia:Engedélykérés] == The email templates are rendered incorrectly. [[User:Bencemac|Bencemac]] ([[User talk:Bencemac|talk]]) 14:00, 26 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T421563 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:19, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Usu%C3%A1rio(a):Inter-rede/Cabe%C3%A7alho&oldid=71778331&useparsoid=1 ptwiki:Usuário(a):Inter-rede/Cabeçalho] == Whitespaces seem to have collapsed [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 18:02, 27 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422155 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:36, 2 April 2026 (UTC) ::It looks like the problem is the <code>display:flex</code> in the <code>style</code> attribute on the wrapper is at fault. Parsoid generates <code><nowiki><span></nowiki></code> wrappers around the html entities in the wikitext, by design. The whitespace is present in the HTML, so that's not a fault of Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:07, 9 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%91%D7%A6%D7%A2_%D7%9E%D7%A9%D7%94_(%D7%9E%D7%9C%D7%97%D7%9E%D7%AA_%D7%94%D7%A2%D7%A6%D7%9E%D7%90%D7%95%D7%AA)&oldid=42991233&useparsoid=1 hewiki:מבצע משה (מלחמת העצמאות)] == הכיתוב שנועד למנוע בלבול בין מבצע משה הזה למבצע משה אחר לא ערוך [[User:חנניה בלסמן|חנניה בלסמן]] ([[User talk:חנניה בלסמן|talk]]) 12:54, 30 March 2026 (UTC) == [//en.wikipedia.org/w/index.php?title=Help:Colon_trick&useparsoid=1 enwiki:Help:Colon trick] == According to [[w:Help:Colon trick]], it is explained as follows: "<code><nowiki>[[//Hus]]</nowiki></code> will produce an (invalid) external link wrapped in brackets ("[[//Hus]]"), but <code><nowiki>[[://Hus]]</nowiki></code> will produce a link to [[w://Hus|//Hus]]." However, when using Parsoid, it incorrectly links to [[w:Help:Colon trick//Hus|Help:Colon trick//Hus]].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:02, 31 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422161 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 14:00, 2 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Ans%C3%B6kan_om_administrativ_beh%C3%B6righet&oldid=59167563&useparsoid=1 svwiki:Wikipedia:Ansökan om administrativ behörighet] == In Legacy, each section (candidate) get a [redigera] ([edit] to the right of the section name. In Parsoid, there is nothing to the right of the section name. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 12:15, 2 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T391624 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:27, 2 April 2026 (UTC) == [https://en.wiktionary.org/w/index.php?title=H%26P&oldid=83856321&useparsoid=1 enwiktionary:H&P] == The first hidden category listed is [[wiktionary:Category:English_entries_with_incorrect_language_header|English entries with incorrect language header]]'','' which is, however, empty. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:48, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Jo%C3%A3o_Peixoto&oldid=72016744&useparsoid=1 ptwiki:João Peixoto] == A foto não corresponde ao nome citado [[User:Mayque Lemos|Mayque Lemos]] ([[User talk:Mayque Lemos|talk]]) 18:18, 2 April 2026 (UTC) == [https://meta.wikimedia.org/w/index.php?title=Main_Page&oldid=30254797&useparsoid=1 metawiki:Main Page] == On Parsoid only, <nowiki>''complete list'' and ''request''</nowiki> each show a space between them and their preceding opening bracket. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 19:06, 3 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&oldid=1343194045&useparsoid=1 enwiki:In Stars and Time] == <code>&lt;ref name="rps"&gt;</code> displays an error which doesn’t occur on the legacy parser [[User:Mir Novov|Mir Novov]] ([[User talk:Mir Novov|talk]]) 12:10, 4 April 2026 (UTC) :It was an error which I fixed with [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&diff=1348021667&oldid=1347424445 this edit] which adds one more backlink to Ref #5. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:00, 10 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Helen_Andrews&oldid=72024590&useparsoid=1 ptwiki:Helen Andrews] == Estou a ter problema com as referências, pois aparecem duplicadas. [[User:Faviola7|Faviola7]] ([[User talk:Faviola7|talk]]) 14:17, 4 April 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Project_chat&oldid=3236&useparsoid=1 abstractwiki:Abstract Wikipedia:Project chat] == In the "Bot request" section, a link that has been visited is blue rather than purple, because spaces in the link are turned into actual spaces (%20) in the URL. [[User:JJPMaster|JJP]]<sub>[[User talk:JJPMaster|Mas]]<sub>[[Special:Contributions/JJPMaster|ter]]</sub></sub> ([[wikt:she|she]]/[[wikt:they|they]]) 21:53, 4 April 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Tor_Fosse_(f%C3%B8dt_1956)&oldid=25723619&useparsoid=1 nowiki:Tor Fosse (født 1956)] == fil: center frameless [[User:Birgit.H.Pihl|Birgit.H.Pihl]] ([[User talk:Birgit.H.Pihl|talk]]) 10:05, 5 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Politisk_opposition&oldid=59171124&useparsoid=1 svwiki:Politisk opposition] == This error message about unused named reference is not shown: Referensfel: <ref>-tagg med namn "sr-20161006", definierad i <references> används inte tidigare i texten. The article is also added to hidden category "Sidor med referensfel" but that is not shown [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:12, 5 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Puteulum/Sandbox&oldid=150100596&useparsoid=1 itwiki:Utente:Puteulum/Sandbox] == The "Move" button to move the entry from sandbox to NS0 does not appear [[User:Puteulum|Puteulum]] ([[User talk:Puteulum|talk]]) 14:28, 7 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=POVOADO_TIRIRICAL&oldid=72040530&useparsoid=1 ptwiki:POVOADO TIRIRICAL] == O MEU TEXTO ESTA TODO VERMELHO E MAIS CENTRALIZADO [[User:POVOADO TIRIRICAL|POVOADO TIRIRICAL]] ([[User talk:POVOADO TIRIRICAL|talk]]) 18:38, 7 April 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%B1%E4%BA%AC%E9%83%BD%E9%81%935%E5%8F%B7%E6%96%B0%E5%AE%BF%E9%9D%92%E6%A2%85%E7%B7%9A&oldid=108985336&useparsoid=1 jawiki:東京都道5号新宿青梅線] == ヘッダー付近に編集ミスと思われし文言あり [[User:QWERTYKeyboard0570|QWERTYKeyboard0570]] ([[User talk:QWERTYKeyboard0570|talk]]) 08:56, 8 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=2022_Oder_environmental_disaster&oldid=1344570432&useparsoid=1 enwiki:2022 Oder environmental disaster] == After a second, the actual map from the infobox (not the buttons) is replaced with a placeholder icon and text (clicking in the field still works). [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 11:56, 8 April 2026 (UTC) :Could it have been a transient issue? I cannot reproduce this right now. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:03, 10 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Commissione_arbitrale/Domande&oldid=150049601&useparsoid=1 itwiki:Wikipedia:Commissione arbitrale/Domande] == This page is related to the itwiki ArbCom election. Section edit links were not shown, making it difficult to ask questions to candidates. This has since been worked around with [[:it:special:diff/150118322|this edit]] and is likely related to [[phab:T387520|T387520]]. [[User:Titore|Titore]] ([[User talk:Titore|talk]]) 19:58, 8 April 2026 (UTC) :Thanks for this report. This is on our list of high priority tasks to fix and we are going to pick up shortly. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:53, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Kurier&oldid=266019405&useparsoid=1 dewiki:Wikipedia:Kurier] == das Diagramm zum Beitrag "Ein Wal ..." überragt den Text der rechten Spalte. [[User:Michael w|Michael w]] ([[User talk:Michael w|talk]]) 08:10, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034&useparsoid=1 dewiki:Wikipedia:Fragen zur Wikipedia] == <nowiki>& s h y ;</nowiki> is ignored. See the test on https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034#&_s_h_y_; [[User:Raymond|Raymond]] ([[User talk:Raymond|talk]]) 09:55, 10 April 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422960 for this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:55, 10 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Faktafr%C3%A5gor&oldid=59190040&useparsoid=1 svwiki:Wikipedia:Faktafrågor] == Svara-funktionen fungerar inte med Parsoid. När jag klickar på Svara för något inlägg, vilket som helst, dyker svarsrutan upp längst ner på sidan, efter den senaste diskussionstråden. Med den äldre parsern fungerar det. [[User:Larske|Larske]] ([[User talk:Larske|talk]]) 11:12, 10 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Cornelis_de_Bruijn_Martinuszoon&oldid=70921577&useparsoid=1 nlwiki:Cornelis de Bruijn Martinuszoon] == De pagina-afbeelding is de handtekening van C. de Bruijn Mz. Ik denk dat zijn afbeelding in de spotprent een betere pagina-afbeelding is. Het zou kunnen dat Parsoid/Wikipedia deze niet 'pakt' omdat de dimensies tijdens een eerdere bewerking zijn aangepast. Alvast bedankt! [[User:Jelledebruijn|Jelledebruijn]] ([[User talk:Jelledebruijn|talk]]) 16:31, 10 April 2026 (UTC) :I think you might have seen a version of the page before the cache was updated. I just checked and the image is identical with Parsoid and the older parse. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:46, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=The_Punisher_(2004)&oldid=263259949&useparsoid=1 dewiki:The Punisher (2004)] == Dead link template Vorlage:Toter Link (https://de.wikipedia.org/wiki/Vorlage:Toter_Link) after url is no longer working but gets part of the Link. (example https://de.wikipedia.org/wiki/The_Punisher_(2004)#cite_note-5 ) [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:23, 10 April 2026 (UTC) :Example without Parsoid: https://de.wikipedia.org/wiki/The_Punisher_(2004)?useparsoid=0#cite_note-5 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:57, 10 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T368724 but ideally, the template will be added with a space after the link. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:24, 11 April 2026 (UTC) ::Unfortunately it's added by the InternetArchiveBot that way: https://de.wikipedia.org/w/index.php?title=Liste_aktiver_Brauereien_in_Deutschland&diff=prev&oldid=265857281 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 06:45, 11 April 2026 (UTC) :::@[[User:SSastry (WMF)|SSastry (WMF)]]: But it is not good if the preview shows us a different result than the version that is subsequently published. InternetArchiveBot inserts it without spaces. The task is prioritized as Low, but since we have this thousands of times in the article inventory (and it used to work before), the task should be reprioritized to Higher. And the preview should always show the same result that I get after publishing. What do we do with the Phab task now? How do we handle this bug? Thank you, [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 09:12, 11 April 2026 (UTC) ::::We will fix the preview path separately. But, for this specifically, I'll flag this for the team to see how we want to handle this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:33, 11 April 2026 (UTC) :::::@[[User:SSastry (WMF)|SSastry (WMF)]]: Oh thank you, keep us up to date here please. [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 16:35, 11 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Marlon_Ganchozo&oldid=172919968&useparsoid=1 eswiki:Marlon Ganchozo] == No sale el resto de la información del, jugador [[User:Didierlpz06|Didierlpz06]] ([[User talk:Didierlpz06|talk]]) 19:04, 10 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 eswiki:Temporada regular de la Euroliga 2025-26] == no se sustituyen correctamente las ultimas plantillas [[User:Hugogs02|Hugogs02]] ([[User talk:Hugogs02|talk]]) 08:42, 11 April 2026 (UTC) :This page is too large post-template expansion. Observe that the templates at the end are not expanded neither in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 Parsoid] nor in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=0 Legacy]; the legacy parser just happens to expand a few more at the end of the page due to [https://phabricator.wikimedia.org/T392262 T392262]. The page should probably be split. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:13, 13 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Uniforme_de_la_selecci%C3%B3n_de_f%C3%BAtbol_de_Argentina&oldid=172883243&useparsoid=1 eswiki:Uniforme de la selección de fútbol de Argentina] == En la plantilla de uniforme de fútbol algunos uniformes se ven con las mangas más bajas respecto al archivo del cuerpo, dejando lineas de un pixel por encima con los colores de fondo en dicha plantilla. [[User:Lobo kun mfc|Lobo kun mfc]] ([[User talk:Lobo kun mfc|talk]]) 13:58, 11 April 2026 (UTC) :The lines displayed on top of the uniforms are present both in Parsoid and in the Legacy parser, and they do seem to vary slightly depending on the browser (I've looked on Firefox and Chrome, both on Linux, and they were not consistent between both browsers). :I believe this issue should be fixed on the template side (at a guess, the <code>style="color: inherit; background-color:#000040;"</code> that I see on the various image divs may well show up depending on the exact HTML structure and/or image) [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:23, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Liste_der_Radschnellverbindungen_in_Deutschland&oldid=266034807&useparsoid=1 dewiki:Liste der Radschnellverbindungen in Deutschland] == Hallo, beim Artikel [[Liste der Radschnellverbindungen in Deutschland]] wird die Beschreibung der MapLink-Karte wird nicht gescheid gerendert. Statt einem hochgestellten <code>[7]</code> wird <code>Karte der bestehenden Radschnellwege in Deutschland'"`UNIQ--ref-00000008-QINU`"'</code> gerendert. Das Problem ist serverseitig und tritt beim Legacy-Parser nicht auf. LG [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 16:02, 11 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T383004 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:06, 11 April 2026 (UTC) ::thanks! [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 14:13, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Louis_Franchet_d%E2%80%99Esp%C3%A8rey&oldid=266076416&useparsoid=1 dewiki:Louis Franchet d’Espèrey] == Bildumfluss nicht wie üblich [[User:Alfred Kiefer|Alfred Kiefer]] ([[User talk:Alfred Kiefer|talk]]) 19:30, 11 April 2026 (UTC) :This issue has been fixed in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1269534 and should be deployed to production this week. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:34, 13 April 2026 (UTC) == [https://bn.wiktionary.org/w/index.php?title=%E0%A6%AA%E0%A7%8D%E0%A6%B0%E0%A6%A7%E0%A6%BE%E0%A6%A8_%E0%A6%AA%E0%A6%BE%E0%A6%A4%E0%A6%BE&oldid=250894&useparsoid=1 bnwiktionary:প্রধান পাতা] == The ‘ শব্দছবি’ section is overflowing with Parsoid; thus does not happen when the legacy parser is used. [[User:Redmin|Redmin]] ([[User talk:Redmin|talk]]) 08:09, 12 April 2026 (UTC) :Since the section seems to be randomized, it's pretty hard to see which version of this section is overflowing (the ones I see do not seem to). Would you be able to provide more information/a screenshot? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:49, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Hamburg&oldid=266087257&useparsoid=1 dewiki:Wikipedia:Hamburg] == Abschnittsbearbeitungen nicht mehr möglich, Link fehlt. Betrifft einige WP-Seiten wie auch [[:de:Wikipedia:Stammtisch München]] oder auch nur einige Überschriften von [[:de:Vorlage:Coordinate]], also nicht immer komplette Seiten. [[User:NordNordWest|NordNordWest]] ([[User talk:NordNordWest|talk]]) 12:12, 12 April 2026 (UTC) :We have a number of issues with section edit links (documented in https://phabricator.wikimedia.org/T391624) that we intend to fix; sorry for the inconvenience - we'll make sure to keep this use case in mind when working on a solution. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:20, 23 April 2026 (UTC) == [https://zh.wikipedia.org/w/index.php?title=COBOL&oldid=91149855&useparsoid=1 zhwiki:COBOL] == 正文开头的“COBOL”英文名无法显示,且全文的繁简转换失效。 The English name "COBOL" for COBOL at the very beginning vanished. Besides, the conversion between traditional and simplified Chinese does not function for the entire page. [[User:Ricky136973|Ricky136973]] ([[User talk:Ricky136973|talk]]) 13:08, 12 April 2026 (UTC) :Parsoid should not (yet) be enabled on zhwiki. If you want to preview how it will work, you can add <code>&parsoidnewlc=1</code> to the end of the URL to use Parsoid's implementation of LanguageConverter. That shows "COBOL" on this page as expected. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:17, 13 April 2026 (UTC) ::Parsoid is now experimentally enabled, so you don't need the `&parsoidnewlc=1` at the end of the URL any more. It appears that the COBOL page renders correctly now? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:40, 21 April 2026 (UTC) == [https://th.wikipedia.org/w/index.php?title=4_%E0%B9%80%E0%B8%97%E0%B8%9E%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B8%9E%E0%B8%B4%E0%B8%97%E0%B8%B1%E0%B8%81%E0%B8%A9%E0%B9%8C&oldid=12947833&useparsoid=1 thwiki:4 เทพผู้พิทักษ์] == อันนี้น่าจะผิดที่ร้องเพลงประกอบละคร [[User:ภรพัฒน์|ภรพัฒน์]] ([[User talk:ภรพัฒน์|talk]]) 12:47, 13 April 2026 (UTC) :Google translate says, "This is probably a mistake—singing the theme song for a TV drama." :This seems like a content issue, not a Parsoid issue. Mistakes in content should be correctly directly on the wiki. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:47, 21 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:%D7%A9%D7%A8%D7%A9%D7%97%D7%95%D7%9F/%D7%98%D7%99%D7%95%D7%98%D7%94&oldid=42822143&useparsoid=1 hewiki:משתמש:שרשחון/טיוטה] == אני רוצה לבטל את המצאות השם יעל סרלין בדף הטיוטות שלי כדי להתחיל ערך חדש [[User:שרשחון|שרשחון]] ([[User talk:שרשחון|talk]]) 12:59, 13 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Acidente_radiol%C3%B3gico_de_Goi%C3%A2nia&oldid=72061996&useparsoid=1 ptwiki:Acidente radiológico de Goiânia] == [[File:Captura_de_tela_de_miniaturas_renderizadas_pelo_Parsoid.png|thumb|250x250px]] As miniaturas estão minúsculas com as margens enormes. [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 15:13, 13 April 2026 (UTC) :It seems to be like this due to :<pre>html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img[width="250"] { width: calc(round(400px * var(--mw-file-upright,1),10px)) }</pre> [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 17:48, 19 April 2026 (UTC) ::{{Tracked|T423676}} [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) ::This should have been fixed by a backport we did yesterday. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:48, 21 April 2026 (UTC) == [https://hr.wikipedia.org/w/index.php?title=Marijana_Bijeli%C4%87&oldid=7429126&useparsoid=1 hrwiki:Marijana Bijelić] == Sve je podvuceno a ne treba tako biti [[User:Nikolica1512|Nikolica1512]] ([[User talk:Nikolica1512|talk]]) 17:08, 13 April 2026 (UTC) :I made some edits for you [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 18:32, 13 April 2026 (UTC) ::Thank you, I ameliorated those problematic parts, could you take a look at it? I hope it is good to go now as an article on wikipedia so people could access it. This person deserves to have a wiki page. ::Regards, [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 21:53, 13 April 2026 (UTC) :::Sorry, no. I was only helping with the syntax error. You'll need to take your request to the hrwiki community [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 22:25, 13 April 2026 (UTC) ::::And how do I do that exactly? Could you help me out with it? [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 22:56, 13 April 2026 (UTC) :::::You can ask on [[:hr:Wikipedija:Kafić]] and I'm sure someone there will help you out [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 00:34, 14 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 dewiki:Hilfe:Parserfunktionen] == Headings which use <code><nowiki><includeonly></nowiki></code> to change nesting level when transcluded don't appear as headings on original page [[User:TheFirstLevelDown|TheFirstLevelDown]] ([[User talk:TheFirstLevelDown|talk]]) 00:01, 14 April 2026 (UTC) :Parsoid does not support gluing heading together like the legacy parser did, so this syntax is not supported. :As an alternative, we suggest something like (to adjust depending on your exact use case) :<syntaxhighlight lang="wikitext"> <includeonly>===== title =====</includeonly> <noinclude>=== title ===</noinclude> </syntaxhighlight> :or, for a less robust version (but that doesn't require repeating the title) :<syntaxhighlight lang="wikitext"> <includeonly>=====</includeonly><noinclude>===</noinclude> title <includeonly>=====</includeonly><noinclude>===</noinclude> </syntaxhighlight> [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 12:45, 14 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Amor_eterno_una_tragedia_anunciada&oldid=172974810&useparsoid=1 eswiki:Amor eterno una tragedia anunciada] == el título de la página está como "Amor eterno una tragedia anunciada" y no deja cambiarlo al original que es "Amor Eterno: Una tragedia anunciada" [[User:Goodfriendspictures|Goodfriendspictures]] ([[User talk:Goodfriendspictures|talk]]) 09:59, 14 April 2026 (UTC) :To me it looks like the [[DISPLAYTITLE]] magic word is disabled though {{wg|AllowDisplayTitle}} in eswiki. Nothing to do with Parsoid. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 10:12, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:TanjaKo/Sandbox&oldid=150217478&useparsoid=1 itwiki:Utente:TanjaKo/Sandbox] == Nel testo non sono presenti errori e le frasi sono sottolineate con una linea rossa ondulata. Come risolverlo visual bug? Grazie [[User:TanjaKo|TanjaKo]] ([[User talk:TanjaKo|talk]]) 17:42, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Raduni/Raduni_in_Sicilia_2026&oldid=150224594&useparsoid=1 itwiki:Wikipedia:Raduni/Raduni in Sicilia 2026] == just on iPhone 14 with iOS 18.7.7 both from safari or chrome and both from logged or unlogged and incognito mode, the last number of the participants list (made with "#") is bigger than the others [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 18:31, 15 April 2026 (UTC) == [https://atj.wikipedia.org/w/index.php?title=Otitikowin&oldid=16878&useparsoid=1 atjwiki:Otitikowin] == pas moyen de travailler en mode visuel sur la page [[User:Luc Patin|Luc Patin]] ([[User talk:Luc Patin|talk]]) 14:56, 16 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Zhang_Zeduan&oldid=173032341&useparsoid=1 eswiki:Zhang Zeduan] == La pagina está incompleta e inpublicable [[User:Mikemj1987|Mikemj1987]] ([[User talk:Mikemj1987|talk]]) 22:08, 17 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:08, 20 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=L%C3%ADnea_E3_(Euskotren_Trena)&oldid=173034070&useparsoid=1 eswiki:Línea E3 (Euskotren Trena)] == La imagen se ve un poco mal por el modo oscuro. [[User:UnniMan|UnniMan]] ([[User talk:UnniMan|talk]]) 00:55, 18 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:09, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Stadtbahn_Karlsruhe&oldid=265878452&useparsoid=1 dewiki:Stadtbahn Karlsruhe] == Shows reference error and the categoy Kategorie:Wikipedia:Seite mit Einzelnachweisfehlern but is not included in https://de.wikipedia.org/wiki/Kategorie:Wikipedia:Seite_mit_Einzelnachweisfehlern The same happens with other articles that had no reference errors with the old parser. Makes maintenance hard. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 09:26, 19 April 2026 (UTC) :Tracked in https://phabricator.wikimedia.org/T423924 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Indiana_Jones_and_the_Fate_of_Atlantis&oldid=265815741&useparsoid=1 dewiki:Indiana Jones and the Fate of Atlantis] == Shows a reference error that is not visible in the preview function. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:06, 19 April 2026 (UTC) :The error came through a Reference with the same name in a used template https://de.wikipedia.org/wiki/Vorlage:Verkaufszahlen_LucasArts_Adventures Still bad to have an error that wasn't there with the old parser and isn't shown in the preview or maintenance category. --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:27, 19 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Evento_Azolla&oldid=72103944&useparsoid=1 ptwiki:Evento Azolla] == [Convert: número inválido] na parte de Efeitos Globais [[User:Marina Funez|Marina Funez]] ([[User talk:Marina Funez|talk]]) 00:28, 20 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:10, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Musikk%C3%A1r&oldid=144140&useparsoid=1 smnwiki:Myenster:Musikkár] == Instead of dealing with this issue and the other issue on smnwiki listed below, these were quietly archived. These are still displaying messed up months later after they were reported the first time. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:53, 20 April 2026 (UTC) :We may have missed this previously, but edits like [https://smn.wikipedia.org/w/index.php?title=Myenster%3AMusikk%C3%A1r&diff=152826&oldid=144359 this] should fix the rendering. This should work for the other pages below as well. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 12:42, 20 April 2026 (UTC) ::Thank you. I'll do the same for any other templates I come across that display like that one did. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 15:49, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Diskografia&oldid=62663&useparsoid=1 smnwiki:Myenster:Diskografia] == Instead of dealing with this issue and the other issue on smnwiki listed above, these were quietly archived. These are still displaying messed up months later after they were reported the first time. -[[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Kirje%C4%8D%C3%A4llee&oldid=32928&useparsoid=1 smnwiki:Myenster:Kirječällee] == Like the other display issues in smnwiki, this is also displaying messed up after the change. [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. For all other pages you encounter on wiki like this, please make similar edits. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Donald_A._Wollheim&oldid=266357315&useparsoid=1 dewiki:Donald A. Wollheim] == Picture is shown within a big white box, which isn't the case with the old parser. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 11:15, 20 April 2026 (UTC) :[[phab:T421524]] [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe_Diskussion:Bilder&oldid=266370955&useparsoid=1 dewiki:Hilfe Diskussion:Bilder] == see [[w:de:Hilfe Diskussion:Bilder #Skalierung von Bildern mit dem Parameter hochkant scheint nicht mehr zu funktionieren]] [[User:BurghardRichter|BurghardRichter]] ([[User talk:BurghardRichter|talk]]) 22:24, 20 April 2026 (UTC) == [https://tcy.wikipedia.org/w/index.php?title=%E0%B2%AE%E0%B3%81%E0%B2%96%E0%B3%8D%E0%B2%AF_%E0%B2%AA%E0%B3%81%E0%B2%9F&oldid=359337&useparsoid=1 tcywiki:ಮುಖ್ಯ ಪುಟ] == in main page not enable <code>html.skin-theme-clientpref-night</code> [[User:ChiK|ChiK]] ([[User talk:ChiK|talk]]) 05:47, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:23, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == https://de.wikipedia.org/wiki/Gemeindestandsver%C3%A4nderungen_in_der_Schweiz == Die Links zu den Ankern gehen nicht [[Special:Contributions/&#126;2026-24437-27|&#126;2026-24437-27]] ([[User talk:&#126;2026-24437-27|talk]]) 11:53, 21 April 2026 (UTC) :I see you found a solution :) :For the exact issue: generating ids independently from their enclosing tag is not supported by Parsoid (although this is not documented - I'll fix that). :Thanks for the report! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:16, 21 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Albosaggia&oldid=50063504&useparsoid=1 svwiki:Albosaggia] == This article, and thousands of other articles, have erroneously been put in hidden categories [[:sv:Kategori:Sidor med referensfel]] and [[:sv:Kategori:Wikipedia:Projekt översätta källmallar]]. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 12:24, 21 April 2026 (UTC) :You can mark this issue as fixed. The problem root cause was in a new Template and Module created this morning. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:40, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Eurovision_Song_Contest_1992&oldid=258716277&useparsoid=1 dewiki:Eurovision Song Contest 1992] == Quelltext bearbeiten ist für Abschnitte nicht sichtbar [[User:Anmey10112|Anmey10112]] ([[User talk:Anmey10112|talk]]) 13:00, 21 April 2026 (UTC) :Translation: "Edit source" is not visible for sections. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Boro%C8%99e%C8%99ti,_Ia%C8%99i&oldid=17665231&useparsoid=1 rowiki:Boroșești, Iași] == Satul este Borosești nu Boroșești. [[User:Stalmada|Stalmada]] ([[User talk:Stalmada|talk]]) 13:07, 21 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:09, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Gebouwge%C3%AFntegreerde_zonnepanelen_(BIPV)&oldid=71021732&useparsoid=1 nlwiki:Gebouwgeïntegreerde zonnepanelen (BIPV)] == Bij de afbeeldingen zijn 3 afbeeldingen gecombineerd met de sjabloon {{Afbeelding combi}} . De sjabloon maakt gebruikt van elk aparte tekstvelden voor elke afbeeldingen. Echter is in dit geval bij de eerste twee afbeeldingen geen gebruik gemaakt van tekstveld en is al de tekst aan het eind geplaatst bij de laatste afbeelding. Door dit gebruik van de sjabloon worden de afbeeldingen zonder spatie direct na elkaar vertoont. Op de mobiele website worden de afbeeldingen met dit sjabloon wel met spaties vertoont. Merk op dat de engelse template wel de mogelijkheid heeft om afbeeldingen gecombineerd te laten zien met spaties er tussen en heeft deze variant template meer mogelijkheden dan de NL versie. Mogelijk dat er de uitwerkin ook niet helemaal correct is geweest, maar hierover is niet te oordelen vanwege de beperkte Wiki edit kennis. [[User:Public-Publicity|Public-Publicity]] ([[User talk:Public-Publicity|talk]]) 16:16, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:22, 21 April 2026 (UTC) :Translation: "In this section, three images have been combined using the template `Template:Afbeelding combi`. This template typically utilizes a separate text field for each individual image; however, in this specific instance, the text fields for the first two images were left unused, and all the accompanying text was instead placed at the end, alongside the final image. As a result of this specific application of the template, the images are displayed consecutively without any spacing between them. On the mobile version of the website, however, images utilizing this template *are* displayed with spacing. It is worth noting that the English-language version of this template *does* offer the capability to display combined images with spacing in between—making that variant of the template more versatile than its Dutch counterpart. It is possible that the implementation itself was not entirely correct; however, it is difficult to pass judgment on this matter due to limited expertise in Wiki editing." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:12, 23 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Talk:Rao_Laxmi_Chand&oldid=10828084&useparsoid=1 simplewiki:Talk:Rao Laxmi Chand] == This Page is fake and all the information is fake [[User:Rao Gourav|Rao Gourav]] ([[User talk:Rao Gourav|talk]]) 17:23, 21 April 2026 (UTC) :Triage: Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:28, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:07, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80%D0%BE%D0%B2%D1%81%D0%BA%D0%B8%D0%B9,_%D0%A1%D1%82%D0%B5%D0%BF%D0%B0%D0%BD_%D0%A4%D1%91%D0%B4%D0%BE%D1%80%D0%BE%D0%B2%D0%B8%D1%87&oldid=152793914&useparsoid=1 ruwiki:Александровский, Степан Фёдорович] == дублируется реф в инфобоксе [[User:Gleb95|Gleb95]] ([[User talk:Gleb95|talk]]) 20:21, 21 April 2026 (UTC) :Translation: "The reference is duplicated in the infobox." :The legacy parser version has 19 references in the references list, and Parsoid contains 22. This is likely a content issue, although I haven't looked into it to determine root cause. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:11, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is plenty of problems I see related to transliteration to Serbian Cyrillic. I prefer reading articles in Serbian Cyrillic (on top of our UI, I select "Ћирилица"). In current state, Parsoid should not be turned on at all on our Wikipedia {{multiple image | align = center | total_width = 1000 | image1 = Jefri Saks (no Parsoid).png | caption1 = Without Parsoid | image2 = Jefri Saks (Parsoid).png | caption2 = With Parsoid }} Note that, with Parsoid, everything is transliterated, even when marked with correct <nowiki><lang></nowiki> attribute. Without parsoid, original English text is correctly left un-transliterated. There is also a glitch where URL is not rendered in infoboxes, again, probably something about misrendering text which was supposed to avoid transliteration. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:43, 21 April 2026 (UTC) :This is [[phab:T424159|T424159 [P0] Parsoid doesn't "guessVariant" at top level on Serbian Wikipedia, and makes sr-ec rendering "unusable" for some pages]]. Fundamentally, the mark up on that page is incorrect, in so far as English and Latin text aren't properly marked with `-{....}-`. It "worked before" because of a top-level "guessVariant" routine which effectively disabled language converter entirely on some pages, including this one. I suspect I'm going to have to implement the same 'guessVariant' mechanism in Parsoid, since there appears to be too much content of this type without proper language markers. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:04, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is no "Edit with migration tool" entry in tools on Serbian Wikipedia. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:50, 21 April 2026 (UTC) :It needs to be enabled explicitly in Preferences > Editing > Developer tools > Enable parser migration tool. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:44, 23 April 2026 (UTC) == includeonly in headline syntax == no longer resolved properly == ''Example:'' [[w:de:Hilfe:Parserfunktionen]] This page (and many others of our help pages) are made for dual use: # stand alone # transclusion of several help pages of similar topic into a combined complete story. They contain headlines like <syntaxhighlight lang="wikitext"> <includeonly>=</includeonly>== Allgemeines ==<includeonly>=</includeonly> </syntaxhighlight> If stand alone, this shall be displayed as H2. * When combined, the page title will be shown as H2 and the section as H3. Swift solution most welcome – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:23, 22 April 2026 (UTC) : BTW – transclusion works correctly: [[w:de:Hilfe:Parserfunktionen/*]] --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:27, 22 April 2026 (UTC) :https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 has our suggested solution (the first form preferably). It works in transclusion mode because the preprocessor is involved. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:53, 22 April 2026 (UTC) ::“has our suggested solution (the first form preferably). It works” ::I do not understand what is “our suggested solution” – please look at this current page. It has neither TOC nor any headline, since the == are displayed within the text, using the default parsing. There are 10 headlines. ::Astonished – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 21:45, 22 April 2026 (UTC) :::Oops .. sorry! I pasted the wrong link! I meant to point you to [[#dewiki:Hilfe:Parserfunktionen|this section]] on this page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 00:09, 23 April 2026 (UTC) You’re imposing some work on us. * I am happy that there are [https://de.wikipedia.org/w/index.php?search=H:+insource:includeonly+insource:%2Fincludeonly%5C%3E%3D%2B%5C%3C%5C%2Fincludeonly%2F&title=Spezial:Suche 12 pages only] to be updated now. * Fortunately, some other syntax has been used in [[w:de:H:VE/*]] – [[w:de:H:Lua/*]] – [[w:de:H:Tabellen/*]] – [[w:de:H:FAQ/Übersicht]] which are merging a huge pile of single pages. I do hope this exception will be described in WikiSyntax Documentation soon. --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 11:04, 23 April 2026 (UTC) :Thanks for your understanding and fixing the pages. Given all the work we've done to deploy to a wiki, at this point, we expect that all remaining rendering issues are likely going to be edge cases that affect small number of pages. We'll update the docs soon, yes. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:22, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%9F%D1%80%D0%B5%D0%B4%D1%83%D0%BF%D1%80%D0%B5%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5&oldid=116093745&useparsoid=1 ruwiki:Шаблон:Предупреждение] == [[:ru:Шаблон:Tpre]] ([[:ru:Модуль:Template call code]]) stops working entirely in Parsoid mode. See also local discussion: [[:ru:Википедия:Форум/Технический#c-Tarkoff-20260422084300-Шаблон:Предупреждение]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 16:40, 22 April 2026 (UTC) :That doesn't look good. Do you have a sense of how many pages are impacted? We will take a look tomorrow and see what is going on and if we can roll out a quick fix. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:07, 22 April 2026 (UTC) ::I see what is going on. This is [[phab:T353697|T353697]] which was resolved with https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/992274. The fix is to have the modules emit <code>format="wikitext"</code> so the <nowiki><span> tags aren't escaped as literal output. Can you see if that fixes it?</nowiki> [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:22, 22 April 2026 (UTC) ::: Yes, thank you. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:47, 22 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Rei_Ami&oldid=266367300&useparsoid=1 dewiki:Rei Ami] == The image of Ami on the top right corner should be rendered with a width of 250px but seems to be scaled down to round about 160px. When using the Legacy Parser the image is rendered as expected. The issue seems to effect only some images. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 18:59, 22 April 2026 (UTC) :@[[User:Jon (WMF)|Jon (WMF)]] says, "The original size of the image is 315x427. This is https://phabricator.wikimedia.org/T421524 - only way to fix it is for Parsoid to mark the img up with a class when the image original size is smaller than 400px. Otherwise it's working as expected." I'm not entirely sure I agree with this diagnosis, since T421524 would cause the image to appear "too large" not "too small". :@[[User:Guardian of Arcadia|Guardian of Arcadia]] what is your user thumbnail size preference, and what skin are you using? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:13, 23 April 2026 (UTC) ::@[[User:Cscott|Cscott]]: I'm using the default thumbnail size of 250px and Vector 2010 (Legacy) as skin. But the size issue also occurs when using other skins like Vector 2022, which can be seen by appending <code>useskin=vector-2022</code> to the URL or viewing the page in an incognito window. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 20:37, 23 April 2026 (UTC) :::What browser and version are you using @[[User:Guardian of Arcadia|Guardian of Arcadia]] ? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 21:46, 23 April 2026 (UTC) ::::Also can you check you don't have a different preference set in [[Special:GlobalPreferences]] and possibly try changing it and changing it back? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:55, 23 April 2026 (UTC) ::::@[[User:Jon (WMF)|Jon (WMF)]]: The issue isn't limited to my account only; it occurs in a logged-out state (within an incognito window) too. But your guess about the browser seems to be right: I have the described issue when using Firefox with the ESR version 115.35.0esr. Today I have tested with another browser (Chrome and Edge) as well as on a PC with a current (non-ESR) Firefox and there the image is shown as expected. So, is this a bug in this specific Firefox version? [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 19:47, 24 April 2026 (UTC) :::::Yes. This sounds like a bug in that specific Firefox version. If you can give me more details about the operating system version you are using I can see if I can replicate in browserstack.com . Is it possible there are any browser extensions installed on that browser? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 22:31, 24 April 2026 (UTC) ::::::The operating system on this PC is Windows 8.1 (Build 9600) and I do not have any browser extensions installed there. Hope this helps to reproduce the issue. If you need anything else please let me know. Thanks for your help. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 22:44, 24 April 2026 (UTC) :::::::That was incredibly useful information, thank you. I understand what is happening now, and there might be something we can do here. Note, this browser is on the cusp of our usual browser support levels, which is what's causing the problem. [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 16:54, 27 April 2026 (UTC) ::::::::That's great news. I would be verry happy if you or your team can fix it. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 17:00, 27 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Alexandru_Dobrogeanu-Gherea&oldid=17669378&useparsoid=1 rowiki:Alexandru Dobrogeanu-Gherea] == imaginea prea mare, la fel la multe articole cu infocaseta om politic, de pilda Vasile Luca, Luminita Odobescu etc face contrast cu imagini in alte infocasete unde problema se poate regla [[User:Ewan2|Ewan2]] ([[User talk:Ewan2|talk]]) 01:25, 23 April 2026 (UTC) :Google translate: "the image is too large, the same as in many articles with the politician infobox, for example Vasile Luca, Luminita Odobescu, etc. it contrasts with images in other infoboxes where the problem can be adjusted." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 18:50, 23 April 2026 (UTC) ::@[[User:Jon (WMF)|Jon (WMF)]] says "For Romanian Wikipedia, there was a problem with the infobox styles. Pretty sure it's been fixed since. It could just be that he's seeing 400px instead of 300px. The infobox image looks identical to me in Parsoid and legacy." ::@[[User:Ewan2|Ewan2]] are you using the default thumbnail size (250px) or a larger size in your user preferences? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:07, 23 April 2026 (UTC) == [https://zu.wikipedia.org/w/index.php?title=Gashamo_Hawd_Somali_Ethiopia&oldid=122552&useparsoid=1 zuwiki:Gashamo Hawd Somali Ethiopia] == Is the city of Hawd Zone [[User:Maaaaskaas11|Maaaaskaas11]] ([[User talk:Maaaaskaas11|talk]]) 21:58, 23 April 2026 (UTC) == [https://ru.wikipedia.org/wiki/Текумсе ruwiki:Текумсе] == For some reason, the comment "До эскиза Лоссинга не было известно..." is repeated twice (see subsection "Комментарии" at the end of the article). This comment is generated by template "ref+" placed inside the template "персона" (an analogue of "Template:Infobox person"), and it is supposed to appear only once. Thanks! [[User:Adavyd|Adavyd]] ([[User talk:Adavyd|talk]]) 22:04, 23 April 2026 (UTC) :This is probably {{phab|T415789}}, which would be solved by adding a name to the reference, but then we end up running into {{phab|T423924}} - the template ends up defining the reference twice with subtly different content (as far as Parsoid is concerned) and the same name, which triggers an error. The fix will probably be to add a name to the reference once {{phab|T423924}} is handled. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:43, 24 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=FIDO2&oldid=264704558&useparsoid=1 dewiki:FIDO2] == Erste Grafik überlagert den Text und die Werkzeugleiste links [[User:Hinnerk11|Hinnerk11]] ([[User talk:Hinnerk11|talk]]) 23:51, 23 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Amanda_Kathrine_Smith/Sandbox&oldid=150348388&useparsoid=1 itwiki:Utente:Amanda Kathrine Smith/Sandbox] == i don't see the "MOVE DRAFT" button. [[User:Amanda Kathrine Smith|Amanda Kathrine Smith]] ([[User talk:Amanda Kathrine Smith|talk]]) 14:14, 24 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:36, 28 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%A1%D1%80%D0%B1%D0%B8%D1%98%D0%B0_(1071%E2%80%941217)&oldid=30892614&useparsoid=1 srwiki:Србија (1071—1217)] == Text inside {{lang-la.. and other {{lang-... templates is not displayed at all. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:46, 24 April 2026 (UTC) :Never mind, in process of adapting our templates for Parsoid, I missed additional change needed in an auxillary module. All is good now. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A2%D1%80%D0%B3/%D0%94%D1%80%D1%83%D0%B3%D0%B8&oldid=30921466&useparsoid=1 srwiki:Википедија:Трг/Други] == <nowiki>__NOCONTENTCONVERT__</nowiki> does not work in Parsoid. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 18:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=Queen&oldid=30824348&useparsoid=1 srwiki:Queen] == Parsoid does not honor __БЕЗКН__ (magic word to suppress title conversion during language conversion) [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 20:03, 24 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%A4%D0%BE%D1%80%D1%83%D0%BC/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8&oldid=152858025&useparsoid=1 ruwiki:Википедия:Форум/Новости] == Исчез логотип в скине Вектор-2010 при включенном гаджете, который отображает праздничные логотипы. При отключении гаджета в настройках — повседневный логотип виден. [[User:Рыцарь поля|Рыцарь поля]] ([[User talk:Рыцарь поля|talk]]) 00:16, 25 April 2026 (UTC) :Triage: not a Parsoid visual issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:22, 27 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9F%D1%80%D0%BE%D0%B5%D0%BA%D1%82:%D0%91%D0%B8%D0%B1%D0%BB%D0%B8%D0%BE%D1%82%D0%B5%D0%BA%D0%B0/%D0%A2%D1%80%D0%B5%D0%B1%D1%83%D1%8E%D1%82%D1%81%D1%8F_%D0%BA%D0%BD%D0%B8%D0%B3%D0%B8&oldid=152853098&useparsoid=1 ruwiki:Проект:Библиотека/Требуются книги] == Конфликт [[:ru:Проект:Библиотека/Требуются книги/Шапка]] с содержанием страницы, из-за чего в [[:ru:Шаблон:shortcut|Шаблон:shortcut]] помещается раздел "содержание" (выглядит это так: [https://ibb.co/219kN3dW 1] и [https://ibb.co/bgM0Fmpn 2]). ------- The conflict between [[:ru:Проект:Библиотека/Требуются книги/Шапка]] and the page content causes the "содержание" section to appear inside [[:ru:Шаблон:shortcut|Шаблон:shortcut]] (this is how it looks: [https://ibb.co/219kN3dW 1] and [https://ibb.co/bgM0Fmpn 2]). [[User:Футболло|Futbollo]] ([[User talk:Футболло|talk]]) 01:10, 25 April 2026 (UTC) :Thank you for the report - I've filed {{phab|T424492}} for it. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:33, 27 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Copa_Intercontinental_da_FIFA_de_2025&oldid=72134360&useparsoid=1 ptwiki:Copa Intercontinental da FIFA de 2025] == Quadro de informações foi excluído por acidente. [[User:AnderSilv42|AnderSilv42]] ([[User talk:AnderSilv42|talk]]) 00:16, 26 April 2026 (UTC) :Triage: Content related - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 15:23, 26 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Michel_W%C3%B6cke&oldid=266505400&useparsoid=1 dewiki:Michel Wöcke] == Bild (Thumb) viel zu gross [[User:Albinfo|Albinfo]] ([[User talk:Albinfo|talk]]) 13:44, 26 April 2026 (UTC) == [https://tn.wikipedia.org/w/index.php?title=Sekolo_Se_Segolwane_Sa_Nata&oldid=49572&useparsoid=1 tnwiki:Sekolo Se Segolwane Sa Nata] == I tried fixing the references but It still says pages with reference errors so I don't know what could be the issue [[User:Blackgirlmighty|Blackgirlmighty]] ([[User talk:Blackgirlmighty|talk]]) 17:00, 26 April 2026 (UTC) :You only need to define a reference once even if you want to use it multiple times - see https://www.mediawiki.org/wiki/Help:Cite#Multiple_uses_of_the_same_footnote for more information. One of each of the references Mmegi2012 and Mmegi2023 should be kept as is; the others should be replaced by <nowiki><ref name="Mmegi2012" /></nowiki> (or 2023) without content. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:39, 27 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Pete_Aguilar&oldid=8671369&useparsoid=1 simplewiki:Pete Aguilar] == This is a less detailed copy of another Wikipedia page. There are two wiki pages showing Pete Aguilar and this is an outdated version. [[User:SuperPug3739|SuperPug3739]] ([[User talk:SuperPug3739|talk]]) 04:56, 27 April 2026 (UTC) :Triage: content related, not Parsoid related [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:46, 27 April 2026 (UTC) == [https://fi.wikipedia.org/w/index.php?title=Hoito-_kasvatussuunnitelma&oldid=23973675&useparsoid=1 fiwiki:Hoito- kasvatussuunnitelma] == Sivun nimi piti olla Hoito- ja kasvatussuunnitelma. Muokkaaminen ei onnistunut. [[User:Nebiux|Nebiux]] ([[User talk:Nebiux|talk]]) 12:01, 29 April 2026 (UTC) :Triage: content related, not Parsoid-related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:04, 30 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Usuario:Luigi_Nakano&oldid=173203320&useparsoid=1 eswiki:Usuario:Luigi Nakano] == An error appears, which should appear when template [[w:es:Plantilla:Estado usuario|Estado usuario]] has nothing in 1=. However, there is a parameter in 1=, so the result should be "Conectado" or "Desconectado", and not "Error:No se ha indicado usuario.". [[User:Luigi Nakano|<span style="color:green">Luigi</span> <span style="color:blue">Nakano</span>]] [[File:Emojione 1F3A7.svg|15px]] ([[User talk:Luigi Nakano|会話]]) 23:12, 29 April 2026 (UTC) :This looks like {{phab|T348722}}, for which a workaround is suggested in https://www.mediawiki.org/wiki/Parsoid/Parser_Unification/Instructions_for_editors#Access_to_parent_frame_from_within_extensions. Let us know if the problem persists after the fix! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:10, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=History_of_the_Ryukyu_Islands&oldid=1336895218&useparsoid=1 enwiki:History of the Ryukyu Islands] == The multiple issues display unsourced template when editing the article there is no such template. [[User:Lightoil|Lightoil]] ([[User talk:Lightoil|talk]]) 05:11, 30 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A7%D1%85%D0%B0%D0%B8%D0%B4%D0%B7%D0%B5,_%D0%9C%D0%B0%D0%BC%D0%B8%D1%8F_%D0%92%D0%B8%D1%81%D1%81%D0%B0%D1%80%D0%B8%D0%BE%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&oldid=152923873&useparsoid=1 ruwiki:Чхаидзе, Мамия Виссарионович] == In the old parser, links to non-existing file pages lead to Special:Upload for the file. In Parsoid, it's a strange link to Special:FilePath, which ends up confusing the editors who accustomed to uploading files this way. [[:ru:Служебная:GoToComment/c-ФВ-20260430140600-Не_загружается_файл|See local discussion]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:53, 30 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%94%D0%B5%D1%80%D0%B2%D0%B8%D1%88_%D0%9A%D0%BE%D1%80%D0%BA%D1%83%D1%82&oldid=30931273&useparsoid=1 srwiki:Дервиш Коркут] == At the bottom, there are several navboxes, Parsoid adds some whitespace between them [[File:Spaces between navboxes with Parsoid..png]] [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 21:21, 30 April 2026 (UTC) : https://phabricator.wikimedia.org/T425123 [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 15:27, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Sevayat&oldid=1351876642&useparsoid=1 enwiki:Talk:Sevayat] == The content assessment and talk page are displayed directly on the talk page, rather than within the “About this page” section (mobile view). [[User:S4yam|S4yam]] ([[User talk:S4yam|talk]]) 21:44, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:Template_editor&oldid=1351909200&useparsoid=1 enwiki:Wikipedia talk:Template editor] == I'm artist thi is my personal biography page [[User:Allymtulia|Allymtulia]] ([[User talk:Allymtulia|talk]]) 21:45, 30 April 2026 (UTC) :Triage: Content issue, not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Middle_of_Nowhere_(Kacey_Musgraves_album)&oldid=1351931473&useparsoid=1 enwiki:Middle of Nowhere (Kacey Musgraves album)] == Producer parameter that adops hlist system in Infobox album template occurs an error. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 01:07, 1 May 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Associazione_Calcio_Perugia_1996-1997&oldid=148287407&useparsoid=1 itwiki:Associazione Calcio Perugia 1996-1997] == Doesn't show all kits. Just the third and on top of the screen [[User:Madive60|Madive60]] ([[User talk:Madive60|talk]]) 01:29, 1 May 2026 (UTC) :This is probably fixed by the fix to {{phab|T425056}} and the current CSS workaround on-wiki. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:22, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%9B%BD%E6%97%97%E3%81%AE%E4%B8%80%E8%A6%A7&oldid=109342678&useparsoid=1 jawiki:国旗の一覧] == イラクの国旗がない [[User:平舞|平舞]] ([[User talk:平舞|talk]]) 03:17, 1 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:21, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Manting_Chan&oldid=1351960413&useparsoid=1 enwiki:Manting Chan] == Divorce, she is not divorced. [[User:Bananahammock311911511|Bananahammock311911511]] ([[User talk:Bananahammock311911511|talk]]) 04:54, 1 May 2026 (UTC) :Content issue, not a Parsoid issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 07:30, 1 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E9%9B%B7%E9%96%80%E9%9F%B3%E5%8A%A9&oldid=109345108&useparsoid=1 jawiki:雷門音助] == {{人名の曖昧さ回避}}や{{aimai}}を貼ると表示が崩れる。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 07:27, 1 May 2026 (UTC) :<nowiki>[[:jawiki:雷門五郎]]</nowiki>でも同様の問題が起きています。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 09:09, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Iceman_(Drake_album)&oldid=1350717409&useparsoid=1 enwiki:Talk:Iceman (Drake album)] == Banners showing up on mobile, not under “learn more about this page button” [[User:OrbitalVoid49|OrbitalVoid49]] ([[User talk:OrbitalVoid49|talk]]) 09:36, 1 May 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Bancu,_Harghita&oldid=13617293&useparsoid=1 rowiki:Bancu, Harghita] == Steagulnjudetului Hargita nu este acea cârpă secuiasca. [[User:Auto 4115|Auto 4115]] ([[User talk:Auto 4115|talk]]) 01:39, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Aurangabad&oldid=1351274322&useparsoid=1 enwiki:Aurangabad] == It has the old name of the city as it's title [[User:20mphwind|20mphwind]] ([[User talk:20mphwind|talk]]) 07:09, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%B9%E0%A6%BE%E0%A6%9C%E0%A6%B0%E0%A6%BE%E0%A6%AC%E0%A6%BE%E0%A6%A1%E0%A6%BC%E0%A7%80_%E0%A6%89%E0%A6%9A%E0%A7%8D%E0%A6%9A_%E0%A6%AC%E0%A6%BF%E0%A6%A6%E0%A7%8D%E0%A6%AF%E0%A6%BE%E0%A6%B2%E0%A6%AF%E0%A6%BC&oldid=8874755&useparsoid=1 bnwiki:হাজরাবাড়ী উচ্চ বিদ্যালয়] == তথ্যসুত্র ব্যয়বহুল নয়। [[User:Md Umor Faruk 2010|Md Umor Faruk 2010]] ([[User talk:Md Umor Faruk 2010|talk]]) 08:00, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=She_Did_It_Again&oldid=1352147079&useparsoid=1 enwiki:She Did It Again] == (Mobile) Huge error in hlist. Bullet points (•) are missing, and the items listed are arranged very roughly. Not sure why this error occurs for over three days. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 10:45, 2 May 2026 (UTC) :Thank you for the report - I have filed {{phab|T425245}} for this issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:30, 3 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%91%E4%B8%8A%E5%93%B2&oldid=109361964&useparsoid=1 jawiki:村上哲] == [[Template:循環参照]]が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:13, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=Wikipedia:%E4%BA%95%E6%88%B8%E7%AB%AF&oldid=109349724&useparsoid=1 jawiki:Wikipedia:井戸端] == 目次が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1 enwiki:Wiki (disambiguation)] == [[w:en:tm:dab]] (at the bottom of the page) appears to render differently on Parsoid compared to non-Parsoid. <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 14:27, 2 May 2026 (UTC) :Also appears to render differently on desktop Parsoid v. mobile Parsoid -- compare https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=mobile (different rendering) vs. https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=desktop ('expected' rendering, AFAIK) <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 16:34, 2 May 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Horv%C3%A1th_Kriszti%C3%A1n_(fest%C5%91,_1976,_Budapest)&oldid=28948319&useparsoid=1 huwiki:Horváth Krisztián (festő, 1976, Budapest)] == Az a probléma, hogy nem szeretném hoyg festő, és 1976 Budapest legyen hozzá kírva. Elrontottam, és nem tudtam külön, új cikket írni róla. [[User:Pizzsus|Pizzsus]] ([[User talk:Pizzsus|talk]]) 20:47, 2 May 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%99%D7%A6%D7%97%D7%A7_%D7%9E%D7%90%D7%99%D7%A8_%D7%90%D7%9C%D7%AA%D7%A8&oldid=43088529&useparsoid=1 hewiki:יצחק מאיר אלתר] == הציטוטים בכתב דיויד בעברית לקויים. Text quotes in David font are displayed poorly. [[User:פרידבערג|פרידבערג]] ([[User talk:פרידבערג|talk]]) 21:36, 2 May 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9B%D0%B8%D1%86%D0%B5%D0%BD%D0%B7%D0%B8%D0%B8_%D0%B8_%D0%B8%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B_Creative_Commons&oldid=152790052&useparsoid=1 ruwiki:Лицензии и инструменты Creative Commons] == refs don't work with vector-2010 (but it works for vector-2022) [[User:Petsernik|Petsernik]] ([[User talk:Petsernik|talk]]) 23:05, 2 May 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Huawei&oldid=173270512&useparsoid=1 eswiki:Huawei] == El segundo sitio web que sale no existe es un vandalismo en wikimedia ingles o un error [[User:Usuario 016|Usuario 016]] ([[User talk:Usuario 016|talk]]) 23:15, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%8C%97%E6%9D%91%E8%81%A1&oldid=109365307&useparsoid=1 jawiki:北村聡] == 人名の曖昧さ回避Templateを挿入すると、上手く表示されず、大きな改行空白と共に「.mw-parser-output .dmbox{display:flex;align-items:center;clear:both;margin:0.9em 1em;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:0.25em 0.35em;font-size:95%}.mw-parser-output .dmbox>*{flex-shrink:0;margin:0 0.25em;display:inline}.mw-parser-output .dmbox-body{flex-grow:1;flex-shrink:1;padding:0.1em 0}」 というものが出る。 [[User:Geogie|Geogie]] ([[User talk:Geogie|talk]]) 23:35, 2 May 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Schreibwettbewerb&oldid=266703390&useparsoid=1 dewiki:Wikipedia:Schreibwettbewerb] == Text in der Blauen Tabelle ("Reviewpreis") überschneidet die rechte äußere Begrenzungslinie [[User:Polibil|Polibil]] ([[User talk:Polibil|talk]]) 15:30, 3 May 2026 (UTC) ckjzfjwzb9dowxx41c4rhm8djpzaj10 8364739 8364441 2026-05-03T19:28:35Z Misterpotatoman 18226850 /* enwiki:Template:Center */ new section 8364739 wikitext text/x-wiki Post your feedback about using [[Parsoid/Parser Unification|Parsoid]] to render articles. [[Parsoid/Parser_Unification/Known_Issues|Learn how to report problems clearly]]. '''Need more attention? [https://phabricator.wikimedia.org/maniphest/task/edit/form/43/?projects=PHID-PROJ-3y2wduoz5xezwveaq426 Report directly in Phabricator].''' {{note|This is for reporting feedback on the integration of the Parsoid parser only. '''For wiki content issues, such as concerns about article content, please report on your local wiki.''' }} [[Parsoid/Parser_Unification/Known_Issues|View known issues]] __NEWSECTIONLINK__ {{Archive box| [[/Archive 1]] [[/Archive 2]]}} == [https://nl.wikipedia.org/w/index.php?title=Wikipedia:Aanmelding_moderatoren&oldid=70702688&useparsoid=1 nlwiki:Wikipedia:Aanmelding moderatoren] == Sometimes, in a numbered list, the number stays on the first line when there are indented lines below it, and sometimes the number is vertically aligned between the different lines. For votes, it is preferable that the number remains on the line that starts with only “#” and not on lines with an indentation “#:”. [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:34, 15 February 2026 (UTC) :i.e. see item 33. under '<nowiki/>'''''Voor moderatorschap ContextCreator'''<nowiki/>'<nowiki/>'' [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:36, 15 February 2026 (UTC) ::I can't see any difference between Parsoid and the legacy Parser on that page, it appears that the number is correctly aligned in both cases. Are you using a different skin by any chance? Does the difference still appear? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:42, 21 April 2026 (UTC) :::I see no difference anymore - it is fixed. Thanks anyway! [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 16:01, 21 April 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Discussion_Wikip%C3%A9dia:Wikiconcours&oldid=233327486&useformat=mobile&useparsoid=1 frwiki:Discussion Wikipédia:Wikiconcours] == Content that is hidden inside the "Learn more about this page" button from MobileFrontend with legacy parser is not inside it with Parsoid. [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 08:32, 22 February 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Laurence_Olivier&oldid=148833592&useparsoid=1 itwiki:Laurence Olivier] == Giant Oscar statue icons (sgranate) [[User:UmbraSolis|UmbraSolis]] ([[User talk:UmbraSolis|talk]]) 20:28, 19 February 2026 (UTC) :This was probably due to https://phabricator.wikimedia.org/T417828, which is now fixed. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:53, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:43, 21 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Bologna_Football_Club_1909&oldid=149496425&useparsoid=1 itwiki:Bologna Football Club 1909] == problem with displaying football shirts [[User:Gio Bike|Gio Bike]] ([[User talk:Gio Bike|talk]]) 17:49, 20 February 2026 (UTC) :Can you be more specific, or is it fixed now? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:55, 27 February 2026 (UTC) ::Now it is OK [[Special:Contributions/&#126;2026-13011-93|&#126;2026-13011-93]] ([[User talk:&#126;2026-13011-93|talk]]) 17:20, 27 February 2026 (UTC) :::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:44, 21 April 2026 (UTC) == [https://vi.wiktionary.org/w/index.php?title=Wiktionary:Th%E1%BB%91ng_k%C3%AA/S%E1%BB%91_m%E1%BB%A5c_t%E1%BB%AB_theo_ng%C3%B4n_ng%E1%BB%AF/T%E1%BA%A5t_c%E1%BA%A3&oldid=2331126&useparsoid=1 viwiktionary:Wiktionary:Thống kê/Số mục từ theo ngôn ngữ/Tất cả] == Phần cuối bảng bị lỗi, không hiện ra số mục từ mà chỉ hiện ra "0" hoặc "-2" mà không rõ lý do, tôi không viết nhầm gì cả. (English: The table got error, just display "0" or "-2", but I don't have any error at write wikitext.) [[User:NHNAnh|NHNAnh]] ([[User talk:NHNAnh|talk]]) 05:57, 21 February 2026 (UTC) :I believe this might be due to "Expensive parser function count: 1080/500" in the debug log: there are too many expensive parser function counts on this page (PAGESINCATEGORY is expensive), and the later functions are not executed. :I would suggest splitting the page into several pages, if possible. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:04, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) == [https://cs.wikipedia.org/w/index.php?title=Celerina/Schlarigna&oldid=25694456&useparsoid=1 cswiki:Celerina/Schlarigna] == V tabulce v sekci obyvatelstvo se u jedné buňky zobrazuje černé pozadí. Pokud dám ale historii stránky a podívám se na aktuální verzi, vykreslí se stránka správně. To samé se opakuje i u jiných podobných stránek se stejně formátovanými tabulkami. [[User:Matijak|Matijak]] ([[User talk:Matijak|talk]]) 17:02, 22 February 2026 (UTC) :I cannot see a black cell in that table. Is this issue fixed? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:09, 27 February 2026 (UTC) ::I can see it in in both the history (latest revision) and on the page itself (live). It's the leftmost 'Počet' cell in the 'Jazyky v Celerině' table. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 10:10, 28 February 2026 (UTC) :::Aha! :::the cell itself is not dark, the text in it is, and only in dark mode. It is also present in the legacy rendering, which seems to hint at a problem with the table markup itself and not a parser issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:11, 2 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) :::::Not a Parsoid issue most likely, but it has not been fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:21, 24 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia:Biographies_of_living_persons&oldid=1340299616&useparsoid=1 enwiki:Wikipedia:Biographies of living persons] == Reporting a visual bug for all pages that suddenly arose as of this morning on Safari Mobile - the Page Actions Overflow div is in a permanently open state but inaccessible to via clicks to either toggle the menu or select any of the tools on the menu. In addition to being unable to interact with it, all of the styling broken and makes the top right section of the page unusable and barely readable. [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 14:34, 27 February 2026 (UTC) :Is this issue still present? Sorry, it has been a while since you reported this, I'm hoping that the issue has been resolved by now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) ::Yes, it appears to have been resolved. Thanks for following up! [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 03:38, 22 April 2026 (UTC) == [https://oc.wikipedia.org/w/index.php?title=Esqu%C3%A8rra_(politica)&oldid=2495338&useparsoid=1 ocwiki:Esquèrra (politica)] == There's an issue with the interlinks, this article should be connected with the other ones about left-wing politics [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 06:39, 28 February 2026 (UTC) :Yes, it was an issue with the interlinks, but those should naturally not be reported as visual issues ('bogue visuler') as the have nothing to do with Parsoid. You can link pages which have no connections by using the 'Apondre los ligams interlengas' (Add interlanguage links) button from the 'Bóstia d'aisinas' (Tools) menu. Unless, of course, Parsoid somehow blocks automatic linking of translations. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:10, 28 February 2026 (UTC) ::I don't know why but it was finally done (thank you so much to the person who did that), but the thing is, i tried what you said before and it kept telling me that i didn't had the permission to link the two articles... [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 19:33, 1 March 2026 (UTC) :::I did that, you are welcome. It appears that you are not autoconfirmed yet on Wikidata, and that this Wikidata entry requires that, which if both true I would expect you to not be able to do this change. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 04:21, 21 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) :::::Sorry? [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:48, 23 April 2026 (UTC) ::::::We're using the <nowiki>{{done}}</nowiki> template to track which issues have been resolved, vs still outstanding. I don't believe there is any additional follow required by the Content Transform team on this report? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 05:00, 24 April 2026 (UTC) :::::::Oh, no, I just didn't know this is a system you are using. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:19, 24 April 2026 (UTC) == [https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/Page_translation_administration&oldid=8240537&useparsoid=1 Help:Extension:Translate/Page translation administration] == The topmost warning in the 'Changing the source text' section does not display the codeblock content. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:47, 28 February 2026 (UTC) :This is a very clever use of the <code><nowiki>{{^(}}</nowiki></code> template to avoid creating an unintended translation marker. I've [https://www.mediawiki.org/w/index.php?title=Help%3AExtension%3ATranslate%2FPage_translation_administration&diff=8349012&oldid=8343860 replaced it with more straight-forward entity-escaping] to be more compatible with Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:54, 21 April 2026 (UTC) ::Also filed this as [[phab:T424066]] [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 16:46, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&oldid=67999951&useparsoid=1 nlwiki:Railterminal Gelderland] == The map in [[:nl:sjabloon:maplink]] doesn't show up in my Chrome browser for Chromebook. It does show in https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&useparsoid=0 and also when I log out. [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:54, 5 March 2026 (UTC) :Btw, the map is visible for a moment, then it disappears [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:56, 5 March 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%91%D7%A8%D7%90%D7%95%D7%9C_%D7%A1%D7%98%D7%90%D7%A8%D7%A1&oldid=42870396&useparsoid=1 hewiki:בראול סטארס] == למה הקישור לתמונה ששמתי לא עובד? בכל מקרה אשמח שמישהו ישים את התמונה העדכנית שמשומשת בדף באנגלית מאחר והלוגו למשחק שונה. מצטער על התקלה. [[User:Jhho48|Jhho48]] ([[User talk:Jhho48|talk]]) 16:43, 9 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Infokastis: Sulamistemperatuur 236,15 K (−37 °C) Miinusmärk peaks olema sidekriipsust pikem, kuid pikema kriipsu sisestamine põhjustab tõrketeate. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:05, 11 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Vabandust, lühike (st vale) kriips oli kuvatud siiski ainult lähteteksti režiimis; salvestatud tekstiga küljendis on kuvatud õige kriips. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:07, 11 March 2026 (UTC) == kowiki:sticky header is broken == [[:en:Template:Sticky header|Template:Sticky header]] is not working properly on kowiki. Please compare [//ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=0] with [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=1].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:34, 16 March 2026 (UTC) :It may have been because of an empty row before the table caption. I [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&diff=41501849&oldid=41501840 edited the page] to remove it. But, looks like another editor has removed the sticky header template call from above the table. If you can put it back, it will work. See my [[:ko:사용자:SSastry_(WMF)/Sandbox|sandbox]] page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 03:22, 17 March 2026 (UTC) == [https://ko.wikipedia.org/w/index.php?title=%ED%8B%80:%EA%B5%AD%EA%B8%B0%EB%82%98%EB%9D%BC&oldid=40992836&useparsoid=1 kowiki:틀:국기나라] == 변수를 덧붙였음에도 {{국기나라|독일|제국}}이 여전히 '독일'로 출력됩니다. [[User:Triican|Triican]] ([[User talk:Triican|talk]]) 05:04, 19 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Angus_T._Jones&oldid=1333447723&useparsoid=1 enwiki:Angus T. Jones] == The infobox photo is squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 17:11, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Ukraine&oldid=1343921679&useparsoid=1 enwiki:Ukraine] == All maps in the infobox are squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 18:36, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Sabia_que&oldid=54991313&useparsoid=1 ptwiki:Wikipédia:Sabia que] == O arquivo de discussão está 'bugando' visualmente. Está no meio de "Curiosidades em destaque" [[User:Heylenny|Heylenny]] ([[User talk:Heylenny|talk]]) 23:27, 19 March 2026 (UTC) :{{done}} Template adjusted on the page. [[User:Fúlvio|Fúlvio]] ([[User talk:Fúlvio|talk]]) 02:59, 22 March 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%AC%E0%A6%BF%E0%A6%AE%E0%A6%B2_%E0%A6%98%E0%A7%8B%E0%A6%B7_(%E0%A6%B6%E0%A6%BF%E0%A6%B6%E0%A7%81%E0%A6%B8%E0%A6%BE%E0%A6%B9%E0%A6%BF%E0%A6%A4%E0%A7%8D%E0%A6%AF%E0%A6%BF%E0%A6%95)&oldid=8851768&useparsoid=1 bnwiki:বিমল ঘোষ (শিশুসাহিত্যিক)] == আলোচনা পাতায় অন্য নিবন্ধের আলোচনা পাতা [[User:Ams riyad|Ams riyad]] ([[User talk:Ams riyad|talk]]) 01:28, 20 March 2026 (UTC) == [https://vi.wikipedia.org/w/index.php?title=Wikipedia:Th%E1%BA%A3o_lu%E1%BA%ADn&oldid=74869958&useparsoid=1 viwiki:Wikipedia:Thảo luận] == TOC is rendered inside the link bar, but it shouldn't be. [[User:NguoiDungKhongDinhDanh|<span class="skin-invert" style="color:black;font-family:Monotype Corsiva;font-size:110%;font-weight:normal;line-height:normal">NguoiDungKhongDinhDanh</span>]] 03:20, 20 March 2026 (UTC) :This was most likely [[phab:T421629|T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] and we believe this issue has been fixed. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:51, 24 April 2026 (UTC) == [[wikt:ru:омфал]] == For more than a day, there have been anomalies in the behavior of tables of contents (ToCs) in Russian Wiktionary. The issues differ based on the selected skin and affect only some pages. If the old Vector theme is used, the automatically generated ToC simply fails to appear on certain pages, despite the page having over three headers and the absence of magic words such as NOTOC. If the new Vector theme is used, the ToC on some pages is misplaced and not positioned where it should be by default. The problem is not present if the old parser is used. Purging the page's cache seems to fix the issue as well. ToC is displayed correctly in the preview-mode too. Some affected pages: * [[wikt:ru:омфал]] * [[wikt:ru:безграмотность]] * [[wikt:ru:હંમેશા]] * [[wikt:ru:ಯಾವಾಗಲೂ]] * [[wikt:ru:stadigvæk]] * [[wikt:ru:alligevel]] * [[wikt:ru:kanunay]] * [[wikt:ru:ሁሌ]] * [[wikt:ru:zawżdy]] * and maaany mooore... [[User:綿貫桜哉|綿貫桜哉]] ([[User talk:綿貫桜哉|talk]]) 08:11, 20 March 2026 (UTC) :This was [[phab:T421629|⚓ T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] but should be fixed now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:55, 24 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Louis_Nirenberg&oldid=15616502&useparsoid=1 rowiki:Louis Nirenberg] == The image seems to be the 250px thumbnail scaled up to what looks like 400px width. [[User:Andrei Stroe|Andrei Stroe]] ([[User talk:Andrei Stroe|talk]]) 10:16, 20 March 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Aide:Accueil&oldid=232433495&useparsoid=1 frwiki:Aide:Accueil] == custom collapsible elements render differently with parsoid [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 14:19, 20 March 2026 (UTC) :I filed https://phabricator.wikimedia.org/T421859. Thanks for the report. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:07, 31 March 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Katten_(olika_betydelser)&oldid=43770842&useparsoid=1 svwiki:Katten (olika betydelser)] == The legacy parser adds an empty line before the template Förgrening (which is a kind of table). The Parsoid parser don't do that. This occurs on all pages using that template. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 18:32, 21 March 2026 (UTC) :Ya, this is known difference with some paragraph wrapping which is tricky to fix. In this case, I recommend adjusting the top margin of the table by editing the base template: https://sv.wikipedia.org/w/index.php?title=Mall%3AF%C3%B6rgrening%20bas&veaction=editsource [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:01, 31 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Gen_Z_stare&oldid=1344701043&useparsoid=1 enwiki:Gen Z stare] == The infobox image is unusually narrow. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 01:51, 22 March 2026 (UTC) :For me the image is stretched horizontally by a fair bit. It seems like the following bit of code is to blame: :<syntaxhighlight lang="css"> :html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img {width: 400px; } :</syntaxhighlight> [[User:Sohom Datta|Sohom]] ([[User talk:Sohom Datta|talk]]) 01:54, 22 March 2026 (UTC) ::I'm not seeing any visible difference between legacy parser and Parsoid in my testing. Can you share a screenshot @[[User:Snowmanonahoe|Snowmanonahoe]] ? What skin and browser are you using? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 17:43, 27 March 2026 (UTC) :::@[[User:Jon (WMF)|Jon (WMF)]]: I don't see it anymore either. I'm using Vector 2022 and Firefox 149. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 17:46, 27 March 2026 (UTC) ::::Ah okay. I think this was a caching issue then. Some "temporary turbulence" was to be expected with this roll out. Thanks for reporting! [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 18:29, 27 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Virginia_Fonseca&oldid=71959182&useparsoid=1 ptwiki:Virginia Fonseca] == A 1ª imagem da página na infocaixa tem um tamanho grande demais [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 11:34, 22 March 2026 (UTC) :I don't see the problem. The page renders identically in Parsoid and with the old/legacy parser. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:22, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Xander_Harris&oldid=71958675&useparsoid=1 ptwiki:Xander Harris] == Seção de referências expandida [[User:Vitruviano|Vitruviano]] ([[User talk:Vitruviano|talk]]) 15:06, 22 March 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Bruker:Znuddel&oldid=25704667&useparsoid=1 nowiki:Bruker:Znuddel] == Hele siden er helt feil [[User:Nevemagneten|Nevemagneten]] ([[User talk:Nevemagneten|talk]]) 20:35, 24 March 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Main_page&oldid=2122&useparsoid=1 abstractwiki:Abstract Wikipedia:Main page] == Favicon is showing a dark background around the rounded corners on Chrome. [[User:Jsengupt|Jsengupt]] ([[User talk:Jsengupt|talk]]) 16:14, 25 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=System_(typeface)&oldid=1329545007&useparsoid=1 enwiki:System (typeface)] == Infobox image is stretched horizontally [[User:Anna328p|Anna328p]] ([[User talk:Anna328p|talk]]) 06:59, 26 March 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Enged%C3%A9lyk%C3%A9r%C3%A9s&oldid=28288240&useparsoid=1 huwiki:Wikipédia:Engedélykérés] == The email templates are rendered incorrectly. [[User:Bencemac|Bencemac]] ([[User talk:Bencemac|talk]]) 14:00, 26 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T421563 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:19, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Usu%C3%A1rio(a):Inter-rede/Cabe%C3%A7alho&oldid=71778331&useparsoid=1 ptwiki:Usuário(a):Inter-rede/Cabeçalho] == Whitespaces seem to have collapsed [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 18:02, 27 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422155 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:36, 2 April 2026 (UTC) ::It looks like the problem is the <code>display:flex</code> in the <code>style</code> attribute on the wrapper is at fault. Parsoid generates <code><nowiki><span></nowiki></code> wrappers around the html entities in the wikitext, by design. The whitespace is present in the HTML, so that's not a fault of Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:07, 9 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%91%D7%A6%D7%A2_%D7%9E%D7%A9%D7%94_(%D7%9E%D7%9C%D7%97%D7%9E%D7%AA_%D7%94%D7%A2%D7%A6%D7%9E%D7%90%D7%95%D7%AA)&oldid=42991233&useparsoid=1 hewiki:מבצע משה (מלחמת העצמאות)] == הכיתוב שנועד למנוע בלבול בין מבצע משה הזה למבצע משה אחר לא ערוך [[User:חנניה בלסמן|חנניה בלסמן]] ([[User talk:חנניה בלסמן|talk]]) 12:54, 30 March 2026 (UTC) == [//en.wikipedia.org/w/index.php?title=Help:Colon_trick&useparsoid=1 enwiki:Help:Colon trick] == According to [[w:Help:Colon trick]], it is explained as follows: "<code><nowiki>[[//Hus]]</nowiki></code> will produce an (invalid) external link wrapped in brackets ("[[//Hus]]"), but <code><nowiki>[[://Hus]]</nowiki></code> will produce a link to [[w://Hus|//Hus]]." However, when using Parsoid, it incorrectly links to [[w:Help:Colon trick//Hus|Help:Colon trick//Hus]].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:02, 31 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422161 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 14:00, 2 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Ans%C3%B6kan_om_administrativ_beh%C3%B6righet&oldid=59167563&useparsoid=1 svwiki:Wikipedia:Ansökan om administrativ behörighet] == In Legacy, each section (candidate) get a [redigera] ([edit] to the right of the section name. In Parsoid, there is nothing to the right of the section name. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 12:15, 2 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T391624 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:27, 2 April 2026 (UTC) == [https://en.wiktionary.org/w/index.php?title=H%26P&oldid=83856321&useparsoid=1 enwiktionary:H&P] == The first hidden category listed is [[wiktionary:Category:English_entries_with_incorrect_language_header|English entries with incorrect language header]]'','' which is, however, empty. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:48, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Jo%C3%A3o_Peixoto&oldid=72016744&useparsoid=1 ptwiki:João Peixoto] == A foto não corresponde ao nome citado [[User:Mayque Lemos|Mayque Lemos]] ([[User talk:Mayque Lemos|talk]]) 18:18, 2 April 2026 (UTC) == [https://meta.wikimedia.org/w/index.php?title=Main_Page&oldid=30254797&useparsoid=1 metawiki:Main Page] == On Parsoid only, <nowiki>''complete list'' and ''request''</nowiki> each show a space between them and their preceding opening bracket. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 19:06, 3 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&oldid=1343194045&useparsoid=1 enwiki:In Stars and Time] == <code>&lt;ref name="rps"&gt;</code> displays an error which doesn’t occur on the legacy parser [[User:Mir Novov|Mir Novov]] ([[User talk:Mir Novov|talk]]) 12:10, 4 April 2026 (UTC) :It was an error which I fixed with [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&diff=1348021667&oldid=1347424445 this edit] which adds one more backlink to Ref #5. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:00, 10 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Helen_Andrews&oldid=72024590&useparsoid=1 ptwiki:Helen Andrews] == Estou a ter problema com as referências, pois aparecem duplicadas. [[User:Faviola7|Faviola7]] ([[User talk:Faviola7|talk]]) 14:17, 4 April 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Project_chat&oldid=3236&useparsoid=1 abstractwiki:Abstract Wikipedia:Project chat] == In the "Bot request" section, a link that has been visited is blue rather than purple, because spaces in the link are turned into actual spaces (%20) in the URL. [[User:JJPMaster|JJP]]<sub>[[User talk:JJPMaster|Mas]]<sub>[[Special:Contributions/JJPMaster|ter]]</sub></sub> ([[wikt:she|she]]/[[wikt:they|they]]) 21:53, 4 April 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Tor_Fosse_(f%C3%B8dt_1956)&oldid=25723619&useparsoid=1 nowiki:Tor Fosse (født 1956)] == fil: center frameless [[User:Birgit.H.Pihl|Birgit.H.Pihl]] ([[User talk:Birgit.H.Pihl|talk]]) 10:05, 5 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Politisk_opposition&oldid=59171124&useparsoid=1 svwiki:Politisk opposition] == This error message about unused named reference is not shown: Referensfel: <ref>-tagg med namn "sr-20161006", definierad i <references> används inte tidigare i texten. The article is also added to hidden category "Sidor med referensfel" but that is not shown [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:12, 5 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Puteulum/Sandbox&oldid=150100596&useparsoid=1 itwiki:Utente:Puteulum/Sandbox] == The "Move" button to move the entry from sandbox to NS0 does not appear [[User:Puteulum|Puteulum]] ([[User talk:Puteulum|talk]]) 14:28, 7 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=POVOADO_TIRIRICAL&oldid=72040530&useparsoid=1 ptwiki:POVOADO TIRIRICAL] == O MEU TEXTO ESTA TODO VERMELHO E MAIS CENTRALIZADO [[User:POVOADO TIRIRICAL|POVOADO TIRIRICAL]] ([[User talk:POVOADO TIRIRICAL|talk]]) 18:38, 7 April 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%B1%E4%BA%AC%E9%83%BD%E9%81%935%E5%8F%B7%E6%96%B0%E5%AE%BF%E9%9D%92%E6%A2%85%E7%B7%9A&oldid=108985336&useparsoid=1 jawiki:東京都道5号新宿青梅線] == ヘッダー付近に編集ミスと思われし文言あり [[User:QWERTYKeyboard0570|QWERTYKeyboard0570]] ([[User talk:QWERTYKeyboard0570|talk]]) 08:56, 8 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=2022_Oder_environmental_disaster&oldid=1344570432&useparsoid=1 enwiki:2022 Oder environmental disaster] == After a second, the actual map from the infobox (not the buttons) is replaced with a placeholder icon and text (clicking in the field still works). [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 11:56, 8 April 2026 (UTC) :Could it have been a transient issue? I cannot reproduce this right now. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:03, 10 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Commissione_arbitrale/Domande&oldid=150049601&useparsoid=1 itwiki:Wikipedia:Commissione arbitrale/Domande] == This page is related to the itwiki ArbCom election. Section edit links were not shown, making it difficult to ask questions to candidates. This has since been worked around with [[:it:special:diff/150118322|this edit]] and is likely related to [[phab:T387520|T387520]]. [[User:Titore|Titore]] ([[User talk:Titore|talk]]) 19:58, 8 April 2026 (UTC) :Thanks for this report. This is on our list of high priority tasks to fix and we are going to pick up shortly. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:53, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Kurier&oldid=266019405&useparsoid=1 dewiki:Wikipedia:Kurier] == das Diagramm zum Beitrag "Ein Wal ..." überragt den Text der rechten Spalte. [[User:Michael w|Michael w]] ([[User talk:Michael w|talk]]) 08:10, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034&useparsoid=1 dewiki:Wikipedia:Fragen zur Wikipedia] == <nowiki>& s h y ;</nowiki> is ignored. See the test on https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034#&_s_h_y_; [[User:Raymond|Raymond]] ([[User talk:Raymond|talk]]) 09:55, 10 April 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422960 for this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:55, 10 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Faktafr%C3%A5gor&oldid=59190040&useparsoid=1 svwiki:Wikipedia:Faktafrågor] == Svara-funktionen fungerar inte med Parsoid. När jag klickar på Svara för något inlägg, vilket som helst, dyker svarsrutan upp längst ner på sidan, efter den senaste diskussionstråden. Med den äldre parsern fungerar det. [[User:Larske|Larske]] ([[User talk:Larske|talk]]) 11:12, 10 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Cornelis_de_Bruijn_Martinuszoon&oldid=70921577&useparsoid=1 nlwiki:Cornelis de Bruijn Martinuszoon] == De pagina-afbeelding is de handtekening van C. de Bruijn Mz. Ik denk dat zijn afbeelding in de spotprent een betere pagina-afbeelding is. Het zou kunnen dat Parsoid/Wikipedia deze niet 'pakt' omdat de dimensies tijdens een eerdere bewerking zijn aangepast. Alvast bedankt! [[User:Jelledebruijn|Jelledebruijn]] ([[User talk:Jelledebruijn|talk]]) 16:31, 10 April 2026 (UTC) :I think you might have seen a version of the page before the cache was updated. I just checked and the image is identical with Parsoid and the older parse. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:46, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=The_Punisher_(2004)&oldid=263259949&useparsoid=1 dewiki:The Punisher (2004)] == Dead link template Vorlage:Toter Link (https://de.wikipedia.org/wiki/Vorlage:Toter_Link) after url is no longer working but gets part of the Link. (example https://de.wikipedia.org/wiki/The_Punisher_(2004)#cite_note-5 ) [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:23, 10 April 2026 (UTC) :Example without Parsoid: https://de.wikipedia.org/wiki/The_Punisher_(2004)?useparsoid=0#cite_note-5 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:57, 10 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T368724 but ideally, the template will be added with a space after the link. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:24, 11 April 2026 (UTC) ::Unfortunately it's added by the InternetArchiveBot that way: https://de.wikipedia.org/w/index.php?title=Liste_aktiver_Brauereien_in_Deutschland&diff=prev&oldid=265857281 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 06:45, 11 April 2026 (UTC) :::@[[User:SSastry (WMF)|SSastry (WMF)]]: But it is not good if the preview shows us a different result than the version that is subsequently published. InternetArchiveBot inserts it without spaces. The task is prioritized as Low, but since we have this thousands of times in the article inventory (and it used to work before), the task should be reprioritized to Higher. And the preview should always show the same result that I get after publishing. What do we do with the Phab task now? How do we handle this bug? Thank you, [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 09:12, 11 April 2026 (UTC) ::::We will fix the preview path separately. But, for this specifically, I'll flag this for the team to see how we want to handle this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:33, 11 April 2026 (UTC) :::::@[[User:SSastry (WMF)|SSastry (WMF)]]: Oh thank you, keep us up to date here please. [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 16:35, 11 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Marlon_Ganchozo&oldid=172919968&useparsoid=1 eswiki:Marlon Ganchozo] == No sale el resto de la información del, jugador [[User:Didierlpz06|Didierlpz06]] ([[User talk:Didierlpz06|talk]]) 19:04, 10 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 eswiki:Temporada regular de la Euroliga 2025-26] == no se sustituyen correctamente las ultimas plantillas [[User:Hugogs02|Hugogs02]] ([[User talk:Hugogs02|talk]]) 08:42, 11 April 2026 (UTC) :This page is too large post-template expansion. Observe that the templates at the end are not expanded neither in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 Parsoid] nor in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=0 Legacy]; the legacy parser just happens to expand a few more at the end of the page due to [https://phabricator.wikimedia.org/T392262 T392262]. The page should probably be split. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:13, 13 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Uniforme_de_la_selecci%C3%B3n_de_f%C3%BAtbol_de_Argentina&oldid=172883243&useparsoid=1 eswiki:Uniforme de la selección de fútbol de Argentina] == En la plantilla de uniforme de fútbol algunos uniformes se ven con las mangas más bajas respecto al archivo del cuerpo, dejando lineas de un pixel por encima con los colores de fondo en dicha plantilla. [[User:Lobo kun mfc|Lobo kun mfc]] ([[User talk:Lobo kun mfc|talk]]) 13:58, 11 April 2026 (UTC) :The lines displayed on top of the uniforms are present both in Parsoid and in the Legacy parser, and they do seem to vary slightly depending on the browser (I've looked on Firefox and Chrome, both on Linux, and they were not consistent between both browsers). :I believe this issue should be fixed on the template side (at a guess, the <code>style="color: inherit; background-color:#000040;"</code> that I see on the various image divs may well show up depending on the exact HTML structure and/or image) [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:23, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Liste_der_Radschnellverbindungen_in_Deutschland&oldid=266034807&useparsoid=1 dewiki:Liste der Radschnellverbindungen in Deutschland] == Hallo, beim Artikel [[Liste der Radschnellverbindungen in Deutschland]] wird die Beschreibung der MapLink-Karte wird nicht gescheid gerendert. Statt einem hochgestellten <code>[7]</code> wird <code>Karte der bestehenden Radschnellwege in Deutschland'"`UNIQ--ref-00000008-QINU`"'</code> gerendert. Das Problem ist serverseitig und tritt beim Legacy-Parser nicht auf. LG [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 16:02, 11 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T383004 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:06, 11 April 2026 (UTC) ::thanks! [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 14:13, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Louis_Franchet_d%E2%80%99Esp%C3%A8rey&oldid=266076416&useparsoid=1 dewiki:Louis Franchet d’Espèrey] == Bildumfluss nicht wie üblich [[User:Alfred Kiefer|Alfred Kiefer]] ([[User talk:Alfred Kiefer|talk]]) 19:30, 11 April 2026 (UTC) :This issue has been fixed in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1269534 and should be deployed to production this week. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:34, 13 April 2026 (UTC) == [https://bn.wiktionary.org/w/index.php?title=%E0%A6%AA%E0%A7%8D%E0%A6%B0%E0%A6%A7%E0%A6%BE%E0%A6%A8_%E0%A6%AA%E0%A6%BE%E0%A6%A4%E0%A6%BE&oldid=250894&useparsoid=1 bnwiktionary:প্রধান পাতা] == The ‘ শব্দছবি’ section is overflowing with Parsoid; thus does not happen when the legacy parser is used. [[User:Redmin|Redmin]] ([[User talk:Redmin|talk]]) 08:09, 12 April 2026 (UTC) :Since the section seems to be randomized, it's pretty hard to see which version of this section is overflowing (the ones I see do not seem to). Would you be able to provide more information/a screenshot? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:49, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Hamburg&oldid=266087257&useparsoid=1 dewiki:Wikipedia:Hamburg] == Abschnittsbearbeitungen nicht mehr möglich, Link fehlt. Betrifft einige WP-Seiten wie auch [[:de:Wikipedia:Stammtisch München]] oder auch nur einige Überschriften von [[:de:Vorlage:Coordinate]], also nicht immer komplette Seiten. [[User:NordNordWest|NordNordWest]] ([[User talk:NordNordWest|talk]]) 12:12, 12 April 2026 (UTC) :We have a number of issues with section edit links (documented in https://phabricator.wikimedia.org/T391624) that we intend to fix; sorry for the inconvenience - we'll make sure to keep this use case in mind when working on a solution. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:20, 23 April 2026 (UTC) == [https://zh.wikipedia.org/w/index.php?title=COBOL&oldid=91149855&useparsoid=1 zhwiki:COBOL] == 正文开头的“COBOL”英文名无法显示,且全文的繁简转换失效。 The English name "COBOL" for COBOL at the very beginning vanished. Besides, the conversion between traditional and simplified Chinese does not function for the entire page. [[User:Ricky136973|Ricky136973]] ([[User talk:Ricky136973|talk]]) 13:08, 12 April 2026 (UTC) :Parsoid should not (yet) be enabled on zhwiki. If you want to preview how it will work, you can add <code>&parsoidnewlc=1</code> to the end of the URL to use Parsoid's implementation of LanguageConverter. That shows "COBOL" on this page as expected. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:17, 13 April 2026 (UTC) ::Parsoid is now experimentally enabled, so you don't need the `&parsoidnewlc=1` at the end of the URL any more. It appears that the COBOL page renders correctly now? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:40, 21 April 2026 (UTC) == [https://th.wikipedia.org/w/index.php?title=4_%E0%B9%80%E0%B8%97%E0%B8%9E%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B8%9E%E0%B8%B4%E0%B8%97%E0%B8%B1%E0%B8%81%E0%B8%A9%E0%B9%8C&oldid=12947833&useparsoid=1 thwiki:4 เทพผู้พิทักษ์] == อันนี้น่าจะผิดที่ร้องเพลงประกอบละคร [[User:ภรพัฒน์|ภรพัฒน์]] ([[User talk:ภรพัฒน์|talk]]) 12:47, 13 April 2026 (UTC) :Google translate says, "This is probably a mistake—singing the theme song for a TV drama." :This seems like a content issue, not a Parsoid issue. Mistakes in content should be correctly directly on the wiki. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:47, 21 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:%D7%A9%D7%A8%D7%A9%D7%97%D7%95%D7%9F/%D7%98%D7%99%D7%95%D7%98%D7%94&oldid=42822143&useparsoid=1 hewiki:משתמש:שרשחון/טיוטה] == אני רוצה לבטל את המצאות השם יעל סרלין בדף הטיוטות שלי כדי להתחיל ערך חדש [[User:שרשחון|שרשחון]] ([[User talk:שרשחון|talk]]) 12:59, 13 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Acidente_radiol%C3%B3gico_de_Goi%C3%A2nia&oldid=72061996&useparsoid=1 ptwiki:Acidente radiológico de Goiânia] == [[File:Captura_de_tela_de_miniaturas_renderizadas_pelo_Parsoid.png|thumb|250x250px]] As miniaturas estão minúsculas com as margens enormes. [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 15:13, 13 April 2026 (UTC) :It seems to be like this due to :<pre>html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img[width="250"] { width: calc(round(400px * var(--mw-file-upright,1),10px)) }</pre> [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 17:48, 19 April 2026 (UTC) ::{{Tracked|T423676}} [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) ::This should have been fixed by a backport we did yesterday. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:48, 21 April 2026 (UTC) == [https://hr.wikipedia.org/w/index.php?title=Marijana_Bijeli%C4%87&oldid=7429126&useparsoid=1 hrwiki:Marijana Bijelić] == Sve je podvuceno a ne treba tako biti [[User:Nikolica1512|Nikolica1512]] ([[User talk:Nikolica1512|talk]]) 17:08, 13 April 2026 (UTC) :I made some edits for you [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 18:32, 13 April 2026 (UTC) ::Thank you, I ameliorated those problematic parts, could you take a look at it? I hope it is good to go now as an article on wikipedia so people could access it. This person deserves to have a wiki page. ::Regards, [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 21:53, 13 April 2026 (UTC) :::Sorry, no. I was only helping with the syntax error. You'll need to take your request to the hrwiki community [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 22:25, 13 April 2026 (UTC) ::::And how do I do that exactly? Could you help me out with it? [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 22:56, 13 April 2026 (UTC) :::::You can ask on [[:hr:Wikipedija:Kafić]] and I'm sure someone there will help you out [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 00:34, 14 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 dewiki:Hilfe:Parserfunktionen] == Headings which use <code><nowiki><includeonly></nowiki></code> to change nesting level when transcluded don't appear as headings on original page [[User:TheFirstLevelDown|TheFirstLevelDown]] ([[User talk:TheFirstLevelDown|talk]]) 00:01, 14 April 2026 (UTC) :Parsoid does not support gluing heading together like the legacy parser did, so this syntax is not supported. :As an alternative, we suggest something like (to adjust depending on your exact use case) :<syntaxhighlight lang="wikitext"> <includeonly>===== title =====</includeonly> <noinclude>=== title ===</noinclude> </syntaxhighlight> :or, for a less robust version (but that doesn't require repeating the title) :<syntaxhighlight lang="wikitext"> <includeonly>=====</includeonly><noinclude>===</noinclude> title <includeonly>=====</includeonly><noinclude>===</noinclude> </syntaxhighlight> [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 12:45, 14 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Amor_eterno_una_tragedia_anunciada&oldid=172974810&useparsoid=1 eswiki:Amor eterno una tragedia anunciada] == el título de la página está como "Amor eterno una tragedia anunciada" y no deja cambiarlo al original que es "Amor Eterno: Una tragedia anunciada" [[User:Goodfriendspictures|Goodfriendspictures]] ([[User talk:Goodfriendspictures|talk]]) 09:59, 14 April 2026 (UTC) :To me it looks like the [[DISPLAYTITLE]] magic word is disabled though {{wg|AllowDisplayTitle}} in eswiki. Nothing to do with Parsoid. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 10:12, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:TanjaKo/Sandbox&oldid=150217478&useparsoid=1 itwiki:Utente:TanjaKo/Sandbox] == Nel testo non sono presenti errori e le frasi sono sottolineate con una linea rossa ondulata. Come risolverlo visual bug? Grazie [[User:TanjaKo|TanjaKo]] ([[User talk:TanjaKo|talk]]) 17:42, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Raduni/Raduni_in_Sicilia_2026&oldid=150224594&useparsoid=1 itwiki:Wikipedia:Raduni/Raduni in Sicilia 2026] == just on iPhone 14 with iOS 18.7.7 both from safari or chrome and both from logged or unlogged and incognito mode, the last number of the participants list (made with "#") is bigger than the others [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 18:31, 15 April 2026 (UTC) == [https://atj.wikipedia.org/w/index.php?title=Otitikowin&oldid=16878&useparsoid=1 atjwiki:Otitikowin] == pas moyen de travailler en mode visuel sur la page [[User:Luc Patin|Luc Patin]] ([[User talk:Luc Patin|talk]]) 14:56, 16 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Zhang_Zeduan&oldid=173032341&useparsoid=1 eswiki:Zhang Zeduan] == La pagina está incompleta e inpublicable [[User:Mikemj1987|Mikemj1987]] ([[User talk:Mikemj1987|talk]]) 22:08, 17 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:08, 20 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=L%C3%ADnea_E3_(Euskotren_Trena)&oldid=173034070&useparsoid=1 eswiki:Línea E3 (Euskotren Trena)] == La imagen se ve un poco mal por el modo oscuro. [[User:UnniMan|UnniMan]] ([[User talk:UnniMan|talk]]) 00:55, 18 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:09, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Stadtbahn_Karlsruhe&oldid=265878452&useparsoid=1 dewiki:Stadtbahn Karlsruhe] == Shows reference error and the categoy Kategorie:Wikipedia:Seite mit Einzelnachweisfehlern but is not included in https://de.wikipedia.org/wiki/Kategorie:Wikipedia:Seite_mit_Einzelnachweisfehlern The same happens with other articles that had no reference errors with the old parser. Makes maintenance hard. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 09:26, 19 April 2026 (UTC) :Tracked in https://phabricator.wikimedia.org/T423924 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Indiana_Jones_and_the_Fate_of_Atlantis&oldid=265815741&useparsoid=1 dewiki:Indiana Jones and the Fate of Atlantis] == Shows a reference error that is not visible in the preview function. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:06, 19 April 2026 (UTC) :The error came through a Reference with the same name in a used template https://de.wikipedia.org/wiki/Vorlage:Verkaufszahlen_LucasArts_Adventures Still bad to have an error that wasn't there with the old parser and isn't shown in the preview or maintenance category. --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:27, 19 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Evento_Azolla&oldid=72103944&useparsoid=1 ptwiki:Evento Azolla] == [Convert: número inválido] na parte de Efeitos Globais [[User:Marina Funez|Marina Funez]] ([[User talk:Marina Funez|talk]]) 00:28, 20 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:10, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Musikk%C3%A1r&oldid=144140&useparsoid=1 smnwiki:Myenster:Musikkár] == Instead of dealing with this issue and the other issue on smnwiki listed below, these were quietly archived. These are still displaying messed up months later after they were reported the first time. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:53, 20 April 2026 (UTC) :We may have missed this previously, but edits like [https://smn.wikipedia.org/w/index.php?title=Myenster%3AMusikk%C3%A1r&diff=152826&oldid=144359 this] should fix the rendering. This should work for the other pages below as well. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 12:42, 20 April 2026 (UTC) ::Thank you. I'll do the same for any other templates I come across that display like that one did. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 15:49, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Diskografia&oldid=62663&useparsoid=1 smnwiki:Myenster:Diskografia] == Instead of dealing with this issue and the other issue on smnwiki listed above, these were quietly archived. These are still displaying messed up months later after they were reported the first time. -[[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Kirje%C4%8D%C3%A4llee&oldid=32928&useparsoid=1 smnwiki:Myenster:Kirječällee] == Like the other display issues in smnwiki, this is also displaying messed up after the change. [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. For all other pages you encounter on wiki like this, please make similar edits. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Donald_A._Wollheim&oldid=266357315&useparsoid=1 dewiki:Donald A. Wollheim] == Picture is shown within a big white box, which isn't the case with the old parser. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 11:15, 20 April 2026 (UTC) :[[phab:T421524]] [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe_Diskussion:Bilder&oldid=266370955&useparsoid=1 dewiki:Hilfe Diskussion:Bilder] == see [[w:de:Hilfe Diskussion:Bilder #Skalierung von Bildern mit dem Parameter hochkant scheint nicht mehr zu funktionieren]] [[User:BurghardRichter|BurghardRichter]] ([[User talk:BurghardRichter|talk]]) 22:24, 20 April 2026 (UTC) == [https://tcy.wikipedia.org/w/index.php?title=%E0%B2%AE%E0%B3%81%E0%B2%96%E0%B3%8D%E0%B2%AF_%E0%B2%AA%E0%B3%81%E0%B2%9F&oldid=359337&useparsoid=1 tcywiki:ಮುಖ್ಯ ಪುಟ] == in main page not enable <code>html.skin-theme-clientpref-night</code> [[User:ChiK|ChiK]] ([[User talk:ChiK|talk]]) 05:47, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:23, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == https://de.wikipedia.org/wiki/Gemeindestandsver%C3%A4nderungen_in_der_Schweiz == Die Links zu den Ankern gehen nicht [[Special:Contributions/&#126;2026-24437-27|&#126;2026-24437-27]] ([[User talk:&#126;2026-24437-27|talk]]) 11:53, 21 April 2026 (UTC) :I see you found a solution :) :For the exact issue: generating ids independently from their enclosing tag is not supported by Parsoid (although this is not documented - I'll fix that). :Thanks for the report! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:16, 21 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Albosaggia&oldid=50063504&useparsoid=1 svwiki:Albosaggia] == This article, and thousands of other articles, have erroneously been put in hidden categories [[:sv:Kategori:Sidor med referensfel]] and [[:sv:Kategori:Wikipedia:Projekt översätta källmallar]]. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 12:24, 21 April 2026 (UTC) :You can mark this issue as fixed. The problem root cause was in a new Template and Module created this morning. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:40, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Eurovision_Song_Contest_1992&oldid=258716277&useparsoid=1 dewiki:Eurovision Song Contest 1992] == Quelltext bearbeiten ist für Abschnitte nicht sichtbar [[User:Anmey10112|Anmey10112]] ([[User talk:Anmey10112|talk]]) 13:00, 21 April 2026 (UTC) :Translation: "Edit source" is not visible for sections. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Boro%C8%99e%C8%99ti,_Ia%C8%99i&oldid=17665231&useparsoid=1 rowiki:Boroșești, Iași] == Satul este Borosești nu Boroșești. [[User:Stalmada|Stalmada]] ([[User talk:Stalmada|talk]]) 13:07, 21 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:09, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Gebouwge%C3%AFntegreerde_zonnepanelen_(BIPV)&oldid=71021732&useparsoid=1 nlwiki:Gebouwgeïntegreerde zonnepanelen (BIPV)] == Bij de afbeeldingen zijn 3 afbeeldingen gecombineerd met de sjabloon {{Afbeelding combi}} . De sjabloon maakt gebruikt van elk aparte tekstvelden voor elke afbeeldingen. Echter is in dit geval bij de eerste twee afbeeldingen geen gebruik gemaakt van tekstveld en is al de tekst aan het eind geplaatst bij de laatste afbeelding. Door dit gebruik van de sjabloon worden de afbeeldingen zonder spatie direct na elkaar vertoont. Op de mobiele website worden de afbeeldingen met dit sjabloon wel met spaties vertoont. Merk op dat de engelse template wel de mogelijkheid heeft om afbeeldingen gecombineerd te laten zien met spaties er tussen en heeft deze variant template meer mogelijkheden dan de NL versie. Mogelijk dat er de uitwerkin ook niet helemaal correct is geweest, maar hierover is niet te oordelen vanwege de beperkte Wiki edit kennis. [[User:Public-Publicity|Public-Publicity]] ([[User talk:Public-Publicity|talk]]) 16:16, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:22, 21 April 2026 (UTC) :Translation: "In this section, three images have been combined using the template `Template:Afbeelding combi`. This template typically utilizes a separate text field for each individual image; however, in this specific instance, the text fields for the first two images were left unused, and all the accompanying text was instead placed at the end, alongside the final image. As a result of this specific application of the template, the images are displayed consecutively without any spacing between them. On the mobile version of the website, however, images utilizing this template *are* displayed with spacing. It is worth noting that the English-language version of this template *does* offer the capability to display combined images with spacing in between—making that variant of the template more versatile than its Dutch counterpart. It is possible that the implementation itself was not entirely correct; however, it is difficult to pass judgment on this matter due to limited expertise in Wiki editing." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:12, 23 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Talk:Rao_Laxmi_Chand&oldid=10828084&useparsoid=1 simplewiki:Talk:Rao Laxmi Chand] == This Page is fake and all the information is fake [[User:Rao Gourav|Rao Gourav]] ([[User talk:Rao Gourav|talk]]) 17:23, 21 April 2026 (UTC) :Triage: Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:28, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:07, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80%D0%BE%D0%B2%D1%81%D0%BA%D0%B8%D0%B9,_%D0%A1%D1%82%D0%B5%D0%BF%D0%B0%D0%BD_%D0%A4%D1%91%D0%B4%D0%BE%D1%80%D0%BE%D0%B2%D0%B8%D1%87&oldid=152793914&useparsoid=1 ruwiki:Александровский, Степан Фёдорович] == дублируется реф в инфобоксе [[User:Gleb95|Gleb95]] ([[User talk:Gleb95|talk]]) 20:21, 21 April 2026 (UTC) :Translation: "The reference is duplicated in the infobox." :The legacy parser version has 19 references in the references list, and Parsoid contains 22. This is likely a content issue, although I haven't looked into it to determine root cause. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:11, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is plenty of problems I see related to transliteration to Serbian Cyrillic. I prefer reading articles in Serbian Cyrillic (on top of our UI, I select "Ћирилица"). In current state, Parsoid should not be turned on at all on our Wikipedia {{multiple image | align = center | total_width = 1000 | image1 = Jefri Saks (no Parsoid).png | caption1 = Without Parsoid | image2 = Jefri Saks (Parsoid).png | caption2 = With Parsoid }} Note that, with Parsoid, everything is transliterated, even when marked with correct <nowiki><lang></nowiki> attribute. Without parsoid, original English text is correctly left un-transliterated. There is also a glitch where URL is not rendered in infoboxes, again, probably something about misrendering text which was supposed to avoid transliteration. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:43, 21 April 2026 (UTC) :This is [[phab:T424159|T424159 [P0] Parsoid doesn't "guessVariant" at top level on Serbian Wikipedia, and makes sr-ec rendering "unusable" for some pages]]. Fundamentally, the mark up on that page is incorrect, in so far as English and Latin text aren't properly marked with `-{....}-`. It "worked before" because of a top-level "guessVariant" routine which effectively disabled language converter entirely on some pages, including this one. I suspect I'm going to have to implement the same 'guessVariant' mechanism in Parsoid, since there appears to be too much content of this type without proper language markers. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:04, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is no "Edit with migration tool" entry in tools on Serbian Wikipedia. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:50, 21 April 2026 (UTC) :It needs to be enabled explicitly in Preferences > Editing > Developer tools > Enable parser migration tool. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:44, 23 April 2026 (UTC) == includeonly in headline syntax == no longer resolved properly == ''Example:'' [[w:de:Hilfe:Parserfunktionen]] This page (and many others of our help pages) are made for dual use: # stand alone # transclusion of several help pages of similar topic into a combined complete story. They contain headlines like <syntaxhighlight lang="wikitext"> <includeonly>=</includeonly>== Allgemeines ==<includeonly>=</includeonly> </syntaxhighlight> If stand alone, this shall be displayed as H2. * When combined, the page title will be shown as H2 and the section as H3. Swift solution most welcome – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:23, 22 April 2026 (UTC) : BTW – transclusion works correctly: [[w:de:Hilfe:Parserfunktionen/*]] --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:27, 22 April 2026 (UTC) :https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 has our suggested solution (the first form preferably). It works in transclusion mode because the preprocessor is involved. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:53, 22 April 2026 (UTC) ::“has our suggested solution (the first form preferably). It works” ::I do not understand what is “our suggested solution” – please look at this current page. It has neither TOC nor any headline, since the == are displayed within the text, using the default parsing. There are 10 headlines. ::Astonished – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 21:45, 22 April 2026 (UTC) :::Oops .. sorry! I pasted the wrong link! I meant to point you to [[#dewiki:Hilfe:Parserfunktionen|this section]] on this page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 00:09, 23 April 2026 (UTC) You’re imposing some work on us. * I am happy that there are [https://de.wikipedia.org/w/index.php?search=H:+insource:includeonly+insource:%2Fincludeonly%5C%3E%3D%2B%5C%3C%5C%2Fincludeonly%2F&title=Spezial:Suche 12 pages only] to be updated now. * Fortunately, some other syntax has been used in [[w:de:H:VE/*]] – [[w:de:H:Lua/*]] – [[w:de:H:Tabellen/*]] – [[w:de:H:FAQ/Übersicht]] which are merging a huge pile of single pages. I do hope this exception will be described in WikiSyntax Documentation soon. --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 11:04, 23 April 2026 (UTC) :Thanks for your understanding and fixing the pages. Given all the work we've done to deploy to a wiki, at this point, we expect that all remaining rendering issues are likely going to be edge cases that affect small number of pages. We'll update the docs soon, yes. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:22, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%9F%D1%80%D0%B5%D0%B4%D1%83%D0%BF%D1%80%D0%B5%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5&oldid=116093745&useparsoid=1 ruwiki:Шаблон:Предупреждение] == [[:ru:Шаблон:Tpre]] ([[:ru:Модуль:Template call code]]) stops working entirely in Parsoid mode. See also local discussion: [[:ru:Википедия:Форум/Технический#c-Tarkoff-20260422084300-Шаблон:Предупреждение]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 16:40, 22 April 2026 (UTC) :That doesn't look good. Do you have a sense of how many pages are impacted? We will take a look tomorrow and see what is going on and if we can roll out a quick fix. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:07, 22 April 2026 (UTC) ::I see what is going on. This is [[phab:T353697|T353697]] which was resolved with https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/992274. The fix is to have the modules emit <code>format="wikitext"</code> so the <nowiki><span> tags aren't escaped as literal output. Can you see if that fixes it?</nowiki> [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:22, 22 April 2026 (UTC) ::: Yes, thank you. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:47, 22 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Rei_Ami&oldid=266367300&useparsoid=1 dewiki:Rei Ami] == The image of Ami on the top right corner should be rendered with a width of 250px but seems to be scaled down to round about 160px. When using the Legacy Parser the image is rendered as expected. The issue seems to effect only some images. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 18:59, 22 April 2026 (UTC) :@[[User:Jon (WMF)|Jon (WMF)]] says, "The original size of the image is 315x427. This is https://phabricator.wikimedia.org/T421524 - only way to fix it is for Parsoid to mark the img up with a class when the image original size is smaller than 400px. Otherwise it's working as expected." I'm not entirely sure I agree with this diagnosis, since T421524 would cause the image to appear "too large" not "too small". :@[[User:Guardian of Arcadia|Guardian of Arcadia]] what is your user thumbnail size preference, and what skin are you using? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:13, 23 April 2026 (UTC) ::@[[User:Cscott|Cscott]]: I'm using the default thumbnail size of 250px and Vector 2010 (Legacy) as skin. But the size issue also occurs when using other skins like Vector 2022, which can be seen by appending <code>useskin=vector-2022</code> to the URL or viewing the page in an incognito window. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 20:37, 23 April 2026 (UTC) :::What browser and version are you using @[[User:Guardian of Arcadia|Guardian of Arcadia]] ? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 21:46, 23 April 2026 (UTC) ::::Also can you check you don't have a different preference set in [[Special:GlobalPreferences]] and possibly try changing it and changing it back? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:55, 23 April 2026 (UTC) ::::@[[User:Jon (WMF)|Jon (WMF)]]: The issue isn't limited to my account only; it occurs in a logged-out state (within an incognito window) too. But your guess about the browser seems to be right: I have the described issue when using Firefox with the ESR version 115.35.0esr. Today I have tested with another browser (Chrome and Edge) as well as on a PC with a current (non-ESR) Firefox and there the image is shown as expected. So, is this a bug in this specific Firefox version? [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 19:47, 24 April 2026 (UTC) :::::Yes. This sounds like a bug in that specific Firefox version. If you can give me more details about the operating system version you are using I can see if I can replicate in browserstack.com . Is it possible there are any browser extensions installed on that browser? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 22:31, 24 April 2026 (UTC) ::::::The operating system on this PC is Windows 8.1 (Build 9600) and I do not have any browser extensions installed there. Hope this helps to reproduce the issue. If you need anything else please let me know. Thanks for your help. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 22:44, 24 April 2026 (UTC) :::::::That was incredibly useful information, thank you. I understand what is happening now, and there might be something we can do here. Note, this browser is on the cusp of our usual browser support levels, which is what's causing the problem. [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 16:54, 27 April 2026 (UTC) ::::::::That's great news. I would be verry happy if you or your team can fix it. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 17:00, 27 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Alexandru_Dobrogeanu-Gherea&oldid=17669378&useparsoid=1 rowiki:Alexandru Dobrogeanu-Gherea] == imaginea prea mare, la fel la multe articole cu infocaseta om politic, de pilda Vasile Luca, Luminita Odobescu etc face contrast cu imagini in alte infocasete unde problema se poate regla [[User:Ewan2|Ewan2]] ([[User talk:Ewan2|talk]]) 01:25, 23 April 2026 (UTC) :Google translate: "the image is too large, the same as in many articles with the politician infobox, for example Vasile Luca, Luminita Odobescu, etc. it contrasts with images in other infoboxes where the problem can be adjusted." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 18:50, 23 April 2026 (UTC) ::@[[User:Jon (WMF)|Jon (WMF)]] says "For Romanian Wikipedia, there was a problem with the infobox styles. Pretty sure it's been fixed since. It could just be that he's seeing 400px instead of 300px. The infobox image looks identical to me in Parsoid and legacy." ::@[[User:Ewan2|Ewan2]] are you using the default thumbnail size (250px) or a larger size in your user preferences? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:07, 23 April 2026 (UTC) == [https://zu.wikipedia.org/w/index.php?title=Gashamo_Hawd_Somali_Ethiopia&oldid=122552&useparsoid=1 zuwiki:Gashamo Hawd Somali Ethiopia] == Is the city of Hawd Zone [[User:Maaaaskaas11|Maaaaskaas11]] ([[User talk:Maaaaskaas11|talk]]) 21:58, 23 April 2026 (UTC) == [https://ru.wikipedia.org/wiki/Текумсе ruwiki:Текумсе] == For some reason, the comment "До эскиза Лоссинга не было известно..." is repeated twice (see subsection "Комментарии" at the end of the article). This comment is generated by template "ref+" placed inside the template "персона" (an analogue of "Template:Infobox person"), and it is supposed to appear only once. Thanks! [[User:Adavyd|Adavyd]] ([[User talk:Adavyd|talk]]) 22:04, 23 April 2026 (UTC) :This is probably {{phab|T415789}}, which would be solved by adding a name to the reference, but then we end up running into {{phab|T423924}} - the template ends up defining the reference twice with subtly different content (as far as Parsoid is concerned) and the same name, which triggers an error. The fix will probably be to add a name to the reference once {{phab|T423924}} is handled. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:43, 24 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=FIDO2&oldid=264704558&useparsoid=1 dewiki:FIDO2] == Erste Grafik überlagert den Text und die Werkzeugleiste links [[User:Hinnerk11|Hinnerk11]] ([[User talk:Hinnerk11|talk]]) 23:51, 23 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Amanda_Kathrine_Smith/Sandbox&oldid=150348388&useparsoid=1 itwiki:Utente:Amanda Kathrine Smith/Sandbox] == i don't see the "MOVE DRAFT" button. [[User:Amanda Kathrine Smith|Amanda Kathrine Smith]] ([[User talk:Amanda Kathrine Smith|talk]]) 14:14, 24 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:36, 28 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%A1%D1%80%D0%B1%D0%B8%D1%98%D0%B0_(1071%E2%80%941217)&oldid=30892614&useparsoid=1 srwiki:Србија (1071—1217)] == Text inside {{lang-la.. and other {{lang-... templates is not displayed at all. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:46, 24 April 2026 (UTC) :Never mind, in process of adapting our templates for Parsoid, I missed additional change needed in an auxillary module. All is good now. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A2%D1%80%D0%B3/%D0%94%D1%80%D1%83%D0%B3%D0%B8&oldid=30921466&useparsoid=1 srwiki:Википедија:Трг/Други] == <nowiki>__NOCONTENTCONVERT__</nowiki> does not work in Parsoid. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 18:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=Queen&oldid=30824348&useparsoid=1 srwiki:Queen] == Parsoid does not honor __БЕЗКН__ (magic word to suppress title conversion during language conversion) [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 20:03, 24 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%A4%D0%BE%D1%80%D1%83%D0%BC/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8&oldid=152858025&useparsoid=1 ruwiki:Википедия:Форум/Новости] == Исчез логотип в скине Вектор-2010 при включенном гаджете, который отображает праздничные логотипы. При отключении гаджета в настройках — повседневный логотип виден. [[User:Рыцарь поля|Рыцарь поля]] ([[User talk:Рыцарь поля|talk]]) 00:16, 25 April 2026 (UTC) :Triage: not a Parsoid visual issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:22, 27 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9F%D1%80%D0%BE%D0%B5%D0%BA%D1%82:%D0%91%D0%B8%D0%B1%D0%BB%D0%B8%D0%BE%D1%82%D0%B5%D0%BA%D0%B0/%D0%A2%D1%80%D0%B5%D0%B1%D1%83%D1%8E%D1%82%D1%81%D1%8F_%D0%BA%D0%BD%D0%B8%D0%B3%D0%B8&oldid=152853098&useparsoid=1 ruwiki:Проект:Библиотека/Требуются книги] == Конфликт [[:ru:Проект:Библиотека/Требуются книги/Шапка]] с содержанием страницы, из-за чего в [[:ru:Шаблон:shortcut|Шаблон:shortcut]] помещается раздел "содержание" (выглядит это так: [https://ibb.co/219kN3dW 1] и [https://ibb.co/bgM0Fmpn 2]). ------- The conflict between [[:ru:Проект:Библиотека/Требуются книги/Шапка]] and the page content causes the "содержание" section to appear inside [[:ru:Шаблон:shortcut|Шаблон:shortcut]] (this is how it looks: [https://ibb.co/219kN3dW 1] and [https://ibb.co/bgM0Fmpn 2]). [[User:Футболло|Futbollo]] ([[User talk:Футболло|talk]]) 01:10, 25 April 2026 (UTC) :Thank you for the report - I've filed {{phab|T424492}} for it. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:33, 27 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Copa_Intercontinental_da_FIFA_de_2025&oldid=72134360&useparsoid=1 ptwiki:Copa Intercontinental da FIFA de 2025] == Quadro de informações foi excluído por acidente. [[User:AnderSilv42|AnderSilv42]] ([[User talk:AnderSilv42|talk]]) 00:16, 26 April 2026 (UTC) :Triage: Content related - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 15:23, 26 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Michel_W%C3%B6cke&oldid=266505400&useparsoid=1 dewiki:Michel Wöcke] == Bild (Thumb) viel zu gross [[User:Albinfo|Albinfo]] ([[User talk:Albinfo|talk]]) 13:44, 26 April 2026 (UTC) == [https://tn.wikipedia.org/w/index.php?title=Sekolo_Se_Segolwane_Sa_Nata&oldid=49572&useparsoid=1 tnwiki:Sekolo Se Segolwane Sa Nata] == I tried fixing the references but It still says pages with reference errors so I don't know what could be the issue [[User:Blackgirlmighty|Blackgirlmighty]] ([[User talk:Blackgirlmighty|talk]]) 17:00, 26 April 2026 (UTC) :You only need to define a reference once even if you want to use it multiple times - see https://www.mediawiki.org/wiki/Help:Cite#Multiple_uses_of_the_same_footnote for more information. One of each of the references Mmegi2012 and Mmegi2023 should be kept as is; the others should be replaced by <nowiki><ref name="Mmegi2012" /></nowiki> (or 2023) without content. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:39, 27 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Pete_Aguilar&oldid=8671369&useparsoid=1 simplewiki:Pete Aguilar] == This is a less detailed copy of another Wikipedia page. There are two wiki pages showing Pete Aguilar and this is an outdated version. [[User:SuperPug3739|SuperPug3739]] ([[User talk:SuperPug3739|talk]]) 04:56, 27 April 2026 (UTC) :Triage: content related, not Parsoid related [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:46, 27 April 2026 (UTC) == [https://fi.wikipedia.org/w/index.php?title=Hoito-_kasvatussuunnitelma&oldid=23973675&useparsoid=1 fiwiki:Hoito- kasvatussuunnitelma] == Sivun nimi piti olla Hoito- ja kasvatussuunnitelma. Muokkaaminen ei onnistunut. [[User:Nebiux|Nebiux]] ([[User talk:Nebiux|talk]]) 12:01, 29 April 2026 (UTC) :Triage: content related, not Parsoid-related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:04, 30 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Usuario:Luigi_Nakano&oldid=173203320&useparsoid=1 eswiki:Usuario:Luigi Nakano] == An error appears, which should appear when template [[w:es:Plantilla:Estado usuario|Estado usuario]] has nothing in 1=. However, there is a parameter in 1=, so the result should be "Conectado" or "Desconectado", and not "Error:No se ha indicado usuario.". [[User:Luigi Nakano|<span style="color:green">Luigi</span> <span style="color:blue">Nakano</span>]] [[File:Emojione 1F3A7.svg|15px]] ([[User talk:Luigi Nakano|会話]]) 23:12, 29 April 2026 (UTC) :This looks like {{phab|T348722}}, for which a workaround is suggested in https://www.mediawiki.org/wiki/Parsoid/Parser_Unification/Instructions_for_editors#Access_to_parent_frame_from_within_extensions. Let us know if the problem persists after the fix! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:10, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=History_of_the_Ryukyu_Islands&oldid=1336895218&useparsoid=1 enwiki:History of the Ryukyu Islands] == The multiple issues display unsourced template when editing the article there is no such template. [[User:Lightoil|Lightoil]] ([[User talk:Lightoil|talk]]) 05:11, 30 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A7%D1%85%D0%B0%D0%B8%D0%B4%D0%B7%D0%B5,_%D0%9C%D0%B0%D0%BC%D0%B8%D1%8F_%D0%92%D0%B8%D1%81%D1%81%D0%B0%D1%80%D0%B8%D0%BE%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&oldid=152923873&useparsoid=1 ruwiki:Чхаидзе, Мамия Виссарионович] == In the old parser, links to non-existing file pages lead to Special:Upload for the file. In Parsoid, it's a strange link to Special:FilePath, which ends up confusing the editors who accustomed to uploading files this way. [[:ru:Служебная:GoToComment/c-ФВ-20260430140600-Не_загружается_файл|See local discussion]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:53, 30 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%94%D0%B5%D1%80%D0%B2%D0%B8%D1%88_%D0%9A%D0%BE%D1%80%D0%BA%D1%83%D1%82&oldid=30931273&useparsoid=1 srwiki:Дервиш Коркут] == At the bottom, there are several navboxes, Parsoid adds some whitespace between them [[File:Spaces between navboxes with Parsoid..png]] [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 21:21, 30 April 2026 (UTC) : https://phabricator.wikimedia.org/T425123 [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 15:27, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Sevayat&oldid=1351876642&useparsoid=1 enwiki:Talk:Sevayat] == The content assessment and talk page are displayed directly on the talk page, rather than within the “About this page” section (mobile view). [[User:S4yam|S4yam]] ([[User talk:S4yam|talk]]) 21:44, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:Template_editor&oldid=1351909200&useparsoid=1 enwiki:Wikipedia talk:Template editor] == I'm artist thi is my personal biography page [[User:Allymtulia|Allymtulia]] ([[User talk:Allymtulia|talk]]) 21:45, 30 April 2026 (UTC) :Triage: Content issue, not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Middle_of_Nowhere_(Kacey_Musgraves_album)&oldid=1351931473&useparsoid=1 enwiki:Middle of Nowhere (Kacey Musgraves album)] == Producer parameter that adops hlist system in Infobox album template occurs an error. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 01:07, 1 May 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Associazione_Calcio_Perugia_1996-1997&oldid=148287407&useparsoid=1 itwiki:Associazione Calcio Perugia 1996-1997] == Doesn't show all kits. Just the third and on top of the screen [[User:Madive60|Madive60]] ([[User talk:Madive60|talk]]) 01:29, 1 May 2026 (UTC) :This is probably fixed by the fix to {{phab|T425056}} and the current CSS workaround on-wiki. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:22, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%9B%BD%E6%97%97%E3%81%AE%E4%B8%80%E8%A6%A7&oldid=109342678&useparsoid=1 jawiki:国旗の一覧] == イラクの国旗がない [[User:平舞|平舞]] ([[User talk:平舞|talk]]) 03:17, 1 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:21, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Manting_Chan&oldid=1351960413&useparsoid=1 enwiki:Manting Chan] == Divorce, she is not divorced. [[User:Bananahammock311911511|Bananahammock311911511]] ([[User talk:Bananahammock311911511|talk]]) 04:54, 1 May 2026 (UTC) :Content issue, not a Parsoid issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 07:30, 1 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E9%9B%B7%E9%96%80%E9%9F%B3%E5%8A%A9&oldid=109345108&useparsoid=1 jawiki:雷門音助] == {{人名の曖昧さ回避}}や{{aimai}}を貼ると表示が崩れる。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 07:27, 1 May 2026 (UTC) :<nowiki>[[:jawiki:雷門五郎]]</nowiki>でも同様の問題が起きています。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 09:09, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Iceman_(Drake_album)&oldid=1350717409&useparsoid=1 enwiki:Talk:Iceman (Drake album)] == Banners showing up on mobile, not under “learn more about this page button” [[User:OrbitalVoid49|OrbitalVoid49]] ([[User talk:OrbitalVoid49|talk]]) 09:36, 1 May 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Bancu,_Harghita&oldid=13617293&useparsoid=1 rowiki:Bancu, Harghita] == Steagulnjudetului Hargita nu este acea cârpă secuiasca. [[User:Auto 4115|Auto 4115]] ([[User talk:Auto 4115|talk]]) 01:39, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Aurangabad&oldid=1351274322&useparsoid=1 enwiki:Aurangabad] == It has the old name of the city as it's title [[User:20mphwind|20mphwind]] ([[User talk:20mphwind|talk]]) 07:09, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%B9%E0%A6%BE%E0%A6%9C%E0%A6%B0%E0%A6%BE%E0%A6%AC%E0%A6%BE%E0%A6%A1%E0%A6%BC%E0%A7%80_%E0%A6%89%E0%A6%9A%E0%A7%8D%E0%A6%9A_%E0%A6%AC%E0%A6%BF%E0%A6%A6%E0%A7%8D%E0%A6%AF%E0%A6%BE%E0%A6%B2%E0%A6%AF%E0%A6%BC&oldid=8874755&useparsoid=1 bnwiki:হাজরাবাড়ী উচ্চ বিদ্যালয়] == তথ্যসুত্র ব্যয়বহুল নয়। [[User:Md Umor Faruk 2010|Md Umor Faruk 2010]] ([[User talk:Md Umor Faruk 2010|talk]]) 08:00, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=She_Did_It_Again&oldid=1352147079&useparsoid=1 enwiki:She Did It Again] == (Mobile) Huge error in hlist. Bullet points (•) are missing, and the items listed are arranged very roughly. Not sure why this error occurs for over three days. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 10:45, 2 May 2026 (UTC) :Thank you for the report - I have filed {{phab|T425245}} for this issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:30, 3 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%91%E4%B8%8A%E5%93%B2&oldid=109361964&useparsoid=1 jawiki:村上哲] == [[Template:循環参照]]が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:13, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=Wikipedia:%E4%BA%95%E6%88%B8%E7%AB%AF&oldid=109349724&useparsoid=1 jawiki:Wikipedia:井戸端] == 目次が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1 enwiki:Wiki (disambiguation)] == [[w:en:tm:dab]] (at the bottom of the page) appears to render differently on Parsoid compared to non-Parsoid. <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 14:27, 2 May 2026 (UTC) :Also appears to render differently on desktop Parsoid v. mobile Parsoid -- compare https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=mobile (different rendering) vs. https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=desktop ('expected' rendering, AFAIK) <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 16:34, 2 May 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Horv%C3%A1th_Kriszti%C3%A1n_(fest%C5%91,_1976,_Budapest)&oldid=28948319&useparsoid=1 huwiki:Horváth Krisztián (festő, 1976, Budapest)] == Az a probléma, hogy nem szeretném hoyg festő, és 1976 Budapest legyen hozzá kírva. Elrontottam, és nem tudtam külön, új cikket írni róla. [[User:Pizzsus|Pizzsus]] ([[User talk:Pizzsus|talk]]) 20:47, 2 May 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%99%D7%A6%D7%97%D7%A7_%D7%9E%D7%90%D7%99%D7%A8_%D7%90%D7%9C%D7%AA%D7%A8&oldid=43088529&useparsoid=1 hewiki:יצחק מאיר אלתר] == הציטוטים בכתב דיויד בעברית לקויים. Text quotes in David font are displayed poorly. [[User:פרידבערג|פרידבערג]] ([[User talk:פרידבערג|talk]]) 21:36, 2 May 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9B%D0%B8%D1%86%D0%B5%D0%BD%D0%B7%D0%B8%D0%B8_%D0%B8_%D0%B8%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B_Creative_Commons&oldid=152790052&useparsoid=1 ruwiki:Лицензии и инструменты Creative Commons] == refs don't work with vector-2010 (but it works for vector-2022) [[User:Petsernik|Petsernik]] ([[User talk:Petsernik|talk]]) 23:05, 2 May 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Huawei&oldid=173270512&useparsoid=1 eswiki:Huawei] == El segundo sitio web que sale no existe es un vandalismo en wikimedia ingles o un error [[User:Usuario 016|Usuario 016]] ([[User talk:Usuario 016|talk]]) 23:15, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%8C%97%E6%9D%91%E8%81%A1&oldid=109365307&useparsoid=1 jawiki:北村聡] == 人名の曖昧さ回避Templateを挿入すると、上手く表示されず、大きな改行空白と共に「.mw-parser-output .dmbox{display:flex;align-items:center;clear:both;margin:0.9em 1em;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:0.25em 0.35em;font-size:95%}.mw-parser-output .dmbox>*{flex-shrink:0;margin:0 0.25em;display:inline}.mw-parser-output .dmbox-body{flex-grow:1;flex-shrink:1;padding:0.1em 0}」 というものが出る。 [[User:Geogie|Geogie]] ([[User talk:Geogie|talk]]) 23:35, 2 May 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Schreibwettbewerb&oldid=266703390&useparsoid=1 dewiki:Wikipedia:Schreibwettbewerb] == Text in der Blauen Tabelle ("Reviewpreis") überschneidet die rechte äußere Begrenzungslinie [[User:Polibil|Polibil]] ([[User talk:Polibil|talk]]) 15:30, 3 May 2026 (UTC) == [https://en.wikipedia.org/wiki/Template:Center enwiki:Template:Center] == Does not load on mobile version, most of the page tools are missing. [[File:Template Center issue.jpg|thumb|issue]] [[User:Misterpotatoman|Misterpotatoman]] ([[User talk:Misterpotatoman|talk]]) 19:28, 3 May 2026 (UTC) a6guthzs6h6ncobm0mpquu0jbfsswmf 8364756 8364739 2026-05-03T22:03:16Z Vi1993 18367945 /* glwiki:Limodre, Fene */ new section 8364756 wikitext text/x-wiki Post your feedback about using [[Parsoid/Parser Unification|Parsoid]] to render articles. [[Parsoid/Parser_Unification/Known_Issues|Learn how to report problems clearly]]. '''Need more attention? [https://phabricator.wikimedia.org/maniphest/task/edit/form/43/?projects=PHID-PROJ-3y2wduoz5xezwveaq426 Report directly in Phabricator].''' {{note|This is for reporting feedback on the integration of the Parsoid parser only. '''For wiki content issues, such as concerns about article content, please report on your local wiki.''' }} [[Parsoid/Parser_Unification/Known_Issues|View known issues]] __NEWSECTIONLINK__ {{Archive box| [[/Archive 1]] [[/Archive 2]]}} == [https://nl.wikipedia.org/w/index.php?title=Wikipedia:Aanmelding_moderatoren&oldid=70702688&useparsoid=1 nlwiki:Wikipedia:Aanmelding moderatoren] == Sometimes, in a numbered list, the number stays on the first line when there are indented lines below it, and sometimes the number is vertically aligned between the different lines. For votes, it is preferable that the number remains on the line that starts with only “#” and not on lines with an indentation “#:”. [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:34, 15 February 2026 (UTC) :i.e. see item 33. under '<nowiki/>'''''Voor moderatorschap ContextCreator'''<nowiki/>'<nowiki/>'' [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:36, 15 February 2026 (UTC) ::I can't see any difference between Parsoid and the legacy Parser on that page, it appears that the number is correctly aligned in both cases. Are you using a different skin by any chance? Does the difference still appear? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:42, 21 April 2026 (UTC) :::I see no difference anymore - it is fixed. Thanks anyway! [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 16:01, 21 April 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Discussion_Wikip%C3%A9dia:Wikiconcours&oldid=233327486&useformat=mobile&useparsoid=1 frwiki:Discussion Wikipédia:Wikiconcours] == Content that is hidden inside the "Learn more about this page" button from MobileFrontend with legacy parser is not inside it with Parsoid. [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 08:32, 22 February 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Laurence_Olivier&oldid=148833592&useparsoid=1 itwiki:Laurence Olivier] == Giant Oscar statue icons (sgranate) [[User:UmbraSolis|UmbraSolis]] ([[User talk:UmbraSolis|talk]]) 20:28, 19 February 2026 (UTC) :This was probably due to https://phabricator.wikimedia.org/T417828, which is now fixed. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:53, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:43, 21 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Bologna_Football_Club_1909&oldid=149496425&useparsoid=1 itwiki:Bologna Football Club 1909] == problem with displaying football shirts [[User:Gio Bike|Gio Bike]] ([[User talk:Gio Bike|talk]]) 17:49, 20 February 2026 (UTC) :Can you be more specific, or is it fixed now? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:55, 27 February 2026 (UTC) ::Now it is OK [[Special:Contributions/&#126;2026-13011-93|&#126;2026-13011-93]] ([[User talk:&#126;2026-13011-93|talk]]) 17:20, 27 February 2026 (UTC) :::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:44, 21 April 2026 (UTC) == [https://vi.wiktionary.org/w/index.php?title=Wiktionary:Th%E1%BB%91ng_k%C3%AA/S%E1%BB%91_m%E1%BB%A5c_t%E1%BB%AB_theo_ng%C3%B4n_ng%E1%BB%AF/T%E1%BA%A5t_c%E1%BA%A3&oldid=2331126&useparsoid=1 viwiktionary:Wiktionary:Thống kê/Số mục từ theo ngôn ngữ/Tất cả] == Phần cuối bảng bị lỗi, không hiện ra số mục từ mà chỉ hiện ra "0" hoặc "-2" mà không rõ lý do, tôi không viết nhầm gì cả. (English: The table got error, just display "0" or "-2", but I don't have any error at write wikitext.) [[User:NHNAnh|NHNAnh]] ([[User talk:NHNAnh|talk]]) 05:57, 21 February 2026 (UTC) :I believe this might be due to "Expensive parser function count: 1080/500" in the debug log: there are too many expensive parser function counts on this page (PAGESINCATEGORY is expensive), and the later functions are not executed. :I would suggest splitting the page into several pages, if possible. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:04, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) == [https://cs.wikipedia.org/w/index.php?title=Celerina/Schlarigna&oldid=25694456&useparsoid=1 cswiki:Celerina/Schlarigna] == V tabulce v sekci obyvatelstvo se u jedné buňky zobrazuje černé pozadí. Pokud dám ale historii stránky a podívám se na aktuální verzi, vykreslí se stránka správně. To samé se opakuje i u jiných podobných stránek se stejně formátovanými tabulkami. [[User:Matijak|Matijak]] ([[User talk:Matijak|talk]]) 17:02, 22 February 2026 (UTC) :I cannot see a black cell in that table. Is this issue fixed? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:09, 27 February 2026 (UTC) ::I can see it in in both the history (latest revision) and on the page itself (live). It's the leftmost 'Počet' cell in the 'Jazyky v Celerině' table. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 10:10, 28 February 2026 (UTC) :::Aha! :::the cell itself is not dark, the text in it is, and only in dark mode. It is also present in the legacy rendering, which seems to hint at a problem with the table markup itself and not a parser issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:11, 2 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) :::::Not a Parsoid issue most likely, but it has not been fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:21, 24 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia:Biographies_of_living_persons&oldid=1340299616&useparsoid=1 enwiki:Wikipedia:Biographies of living persons] == Reporting a visual bug for all pages that suddenly arose as of this morning on Safari Mobile - the Page Actions Overflow div is in a permanently open state but inaccessible to via clicks to either toggle the menu or select any of the tools on the menu. In addition to being unable to interact with it, all of the styling broken and makes the top right section of the page unusable and barely readable. [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 14:34, 27 February 2026 (UTC) :Is this issue still present? Sorry, it has been a while since you reported this, I'm hoping that the issue has been resolved by now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) ::Yes, it appears to have been resolved. Thanks for following up! [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 03:38, 22 April 2026 (UTC) == [https://oc.wikipedia.org/w/index.php?title=Esqu%C3%A8rra_(politica)&oldid=2495338&useparsoid=1 ocwiki:Esquèrra (politica)] == There's an issue with the interlinks, this article should be connected with the other ones about left-wing politics [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 06:39, 28 February 2026 (UTC) :Yes, it was an issue with the interlinks, but those should naturally not be reported as visual issues ('bogue visuler') as the have nothing to do with Parsoid. You can link pages which have no connections by using the 'Apondre los ligams interlengas' (Add interlanguage links) button from the 'Bóstia d'aisinas' (Tools) menu. Unless, of course, Parsoid somehow blocks automatic linking of translations. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:10, 28 February 2026 (UTC) ::I don't know why but it was finally done (thank you so much to the person who did that), but the thing is, i tried what you said before and it kept telling me that i didn't had the permission to link the two articles... [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 19:33, 1 March 2026 (UTC) :::I did that, you are welcome. It appears that you are not autoconfirmed yet on Wikidata, and that this Wikidata entry requires that, which if both true I would expect you to not be able to do this change. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 04:21, 21 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) :::::Sorry? [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:48, 23 April 2026 (UTC) ::::::We're using the <nowiki>{{done}}</nowiki> template to track which issues have been resolved, vs still outstanding. I don't believe there is any additional follow required by the Content Transform team on this report? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 05:00, 24 April 2026 (UTC) :::::::Oh, no, I just didn't know this is a system you are using. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:19, 24 April 2026 (UTC) == [https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/Page_translation_administration&oldid=8240537&useparsoid=1 Help:Extension:Translate/Page translation administration] == The topmost warning in the 'Changing the source text' section does not display the codeblock content. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:47, 28 February 2026 (UTC) :This is a very clever use of the <code><nowiki>{{^(}}</nowiki></code> template to avoid creating an unintended translation marker. I've [https://www.mediawiki.org/w/index.php?title=Help%3AExtension%3ATranslate%2FPage_translation_administration&diff=8349012&oldid=8343860 replaced it with more straight-forward entity-escaping] to be more compatible with Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:54, 21 April 2026 (UTC) ::Also filed this as [[phab:T424066]] [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 16:46, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&oldid=67999951&useparsoid=1 nlwiki:Railterminal Gelderland] == The map in [[:nl:sjabloon:maplink]] doesn't show up in my Chrome browser for Chromebook. It does show in https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&useparsoid=0 and also when I log out. [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:54, 5 March 2026 (UTC) :Btw, the map is visible for a moment, then it disappears [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:56, 5 March 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%91%D7%A8%D7%90%D7%95%D7%9C_%D7%A1%D7%98%D7%90%D7%A8%D7%A1&oldid=42870396&useparsoid=1 hewiki:בראול סטארס] == למה הקישור לתמונה ששמתי לא עובד? בכל מקרה אשמח שמישהו ישים את התמונה העדכנית שמשומשת בדף באנגלית מאחר והלוגו למשחק שונה. מצטער על התקלה. [[User:Jhho48|Jhho48]] ([[User talk:Jhho48|talk]]) 16:43, 9 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Infokastis: Sulamistemperatuur 236,15 K (−37 °C) Miinusmärk peaks olema sidekriipsust pikem, kuid pikema kriipsu sisestamine põhjustab tõrketeate. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:05, 11 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Vabandust, lühike (st vale) kriips oli kuvatud siiski ainult lähteteksti režiimis; salvestatud tekstiga küljendis on kuvatud õige kriips. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:07, 11 March 2026 (UTC) == kowiki:sticky header is broken == [[:en:Template:Sticky header|Template:Sticky header]] is not working properly on kowiki. Please compare [//ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=0] with [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=1].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:34, 16 March 2026 (UTC) :It may have been because of an empty row before the table caption. I [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&diff=41501849&oldid=41501840 edited the page] to remove it. But, looks like another editor has removed the sticky header template call from above the table. If you can put it back, it will work. See my [[:ko:사용자:SSastry_(WMF)/Sandbox|sandbox]] page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 03:22, 17 March 2026 (UTC) == [https://ko.wikipedia.org/w/index.php?title=%ED%8B%80:%EA%B5%AD%EA%B8%B0%EB%82%98%EB%9D%BC&oldid=40992836&useparsoid=1 kowiki:틀:국기나라] == 변수를 덧붙였음에도 {{국기나라|독일|제국}}이 여전히 '독일'로 출력됩니다. [[User:Triican|Triican]] ([[User talk:Triican|talk]]) 05:04, 19 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Angus_T._Jones&oldid=1333447723&useparsoid=1 enwiki:Angus T. Jones] == The infobox photo is squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 17:11, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Ukraine&oldid=1343921679&useparsoid=1 enwiki:Ukraine] == All maps in the infobox are squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 18:36, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Sabia_que&oldid=54991313&useparsoid=1 ptwiki:Wikipédia:Sabia que] == O arquivo de discussão está 'bugando' visualmente. Está no meio de "Curiosidades em destaque" [[User:Heylenny|Heylenny]] ([[User talk:Heylenny|talk]]) 23:27, 19 March 2026 (UTC) :{{done}} Template adjusted on the page. [[User:Fúlvio|Fúlvio]] ([[User talk:Fúlvio|talk]]) 02:59, 22 March 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%AC%E0%A6%BF%E0%A6%AE%E0%A6%B2_%E0%A6%98%E0%A7%8B%E0%A6%B7_(%E0%A6%B6%E0%A6%BF%E0%A6%B6%E0%A7%81%E0%A6%B8%E0%A6%BE%E0%A6%B9%E0%A6%BF%E0%A6%A4%E0%A7%8D%E0%A6%AF%E0%A6%BF%E0%A6%95)&oldid=8851768&useparsoid=1 bnwiki:বিমল ঘোষ (শিশুসাহিত্যিক)] == আলোচনা পাতায় অন্য নিবন্ধের আলোচনা পাতা [[User:Ams riyad|Ams riyad]] ([[User talk:Ams riyad|talk]]) 01:28, 20 March 2026 (UTC) == [https://vi.wikipedia.org/w/index.php?title=Wikipedia:Th%E1%BA%A3o_lu%E1%BA%ADn&oldid=74869958&useparsoid=1 viwiki:Wikipedia:Thảo luận] == TOC is rendered inside the link bar, but it shouldn't be. [[User:NguoiDungKhongDinhDanh|<span class="skin-invert" style="color:black;font-family:Monotype Corsiva;font-size:110%;font-weight:normal;line-height:normal">NguoiDungKhongDinhDanh</span>]] 03:20, 20 March 2026 (UTC) :This was most likely [[phab:T421629|T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] and we believe this issue has been fixed. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:51, 24 April 2026 (UTC) == [[wikt:ru:омфал]] == For more than a day, there have been anomalies in the behavior of tables of contents (ToCs) in Russian Wiktionary. The issues differ based on the selected skin and affect only some pages. If the old Vector theme is used, the automatically generated ToC simply fails to appear on certain pages, despite the page having over three headers and the absence of magic words such as NOTOC. If the new Vector theme is used, the ToC on some pages is misplaced and not positioned where it should be by default. The problem is not present if the old parser is used. Purging the page's cache seems to fix the issue as well. ToC is displayed correctly in the preview-mode too. Some affected pages: * [[wikt:ru:омфал]] * [[wikt:ru:безграмотность]] * [[wikt:ru:હંમેશા]] * [[wikt:ru:ಯಾವಾಗಲೂ]] * [[wikt:ru:stadigvæk]] * [[wikt:ru:alligevel]] * [[wikt:ru:kanunay]] * [[wikt:ru:ሁሌ]] * [[wikt:ru:zawżdy]] * and maaany mooore... [[User:綿貫桜哉|綿貫桜哉]] ([[User talk:綿貫桜哉|talk]]) 08:11, 20 March 2026 (UTC) :This was [[phab:T421629|⚓ T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] but should be fixed now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:55, 24 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Louis_Nirenberg&oldid=15616502&useparsoid=1 rowiki:Louis Nirenberg] == The image seems to be the 250px thumbnail scaled up to what looks like 400px width. [[User:Andrei Stroe|Andrei Stroe]] ([[User talk:Andrei Stroe|talk]]) 10:16, 20 March 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Aide:Accueil&oldid=232433495&useparsoid=1 frwiki:Aide:Accueil] == custom collapsible elements render differently with parsoid [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 14:19, 20 March 2026 (UTC) :I filed https://phabricator.wikimedia.org/T421859. Thanks for the report. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:07, 31 March 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Katten_(olika_betydelser)&oldid=43770842&useparsoid=1 svwiki:Katten (olika betydelser)] == The legacy parser adds an empty line before the template Förgrening (which is a kind of table). The Parsoid parser don't do that. This occurs on all pages using that template. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 18:32, 21 March 2026 (UTC) :Ya, this is known difference with some paragraph wrapping which is tricky to fix. In this case, I recommend adjusting the top margin of the table by editing the base template: https://sv.wikipedia.org/w/index.php?title=Mall%3AF%C3%B6rgrening%20bas&veaction=editsource [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:01, 31 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Gen_Z_stare&oldid=1344701043&useparsoid=1 enwiki:Gen Z stare] == The infobox image is unusually narrow. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 01:51, 22 March 2026 (UTC) :For me the image is stretched horizontally by a fair bit. It seems like the following bit of code is to blame: :<syntaxhighlight lang="css"> :html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img {width: 400px; } :</syntaxhighlight> [[User:Sohom Datta|Sohom]] ([[User talk:Sohom Datta|talk]]) 01:54, 22 March 2026 (UTC) ::I'm not seeing any visible difference between legacy parser and Parsoid in my testing. Can you share a screenshot @[[User:Snowmanonahoe|Snowmanonahoe]] ? What skin and browser are you using? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 17:43, 27 March 2026 (UTC) :::@[[User:Jon (WMF)|Jon (WMF)]]: I don't see it anymore either. I'm using Vector 2022 and Firefox 149. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 17:46, 27 March 2026 (UTC) ::::Ah okay. I think this was a caching issue then. Some "temporary turbulence" was to be expected with this roll out. Thanks for reporting! [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 18:29, 27 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Virginia_Fonseca&oldid=71959182&useparsoid=1 ptwiki:Virginia Fonseca] == A 1ª imagem da página na infocaixa tem um tamanho grande demais [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 11:34, 22 March 2026 (UTC) :I don't see the problem. The page renders identically in Parsoid and with the old/legacy parser. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:22, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Xander_Harris&oldid=71958675&useparsoid=1 ptwiki:Xander Harris] == Seção de referências expandida [[User:Vitruviano|Vitruviano]] ([[User talk:Vitruviano|talk]]) 15:06, 22 March 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Bruker:Znuddel&oldid=25704667&useparsoid=1 nowiki:Bruker:Znuddel] == Hele siden er helt feil [[User:Nevemagneten|Nevemagneten]] ([[User talk:Nevemagneten|talk]]) 20:35, 24 March 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Main_page&oldid=2122&useparsoid=1 abstractwiki:Abstract Wikipedia:Main page] == Favicon is showing a dark background around the rounded corners on Chrome. [[User:Jsengupt|Jsengupt]] ([[User talk:Jsengupt|talk]]) 16:14, 25 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=System_(typeface)&oldid=1329545007&useparsoid=1 enwiki:System (typeface)] == Infobox image is stretched horizontally [[User:Anna328p|Anna328p]] ([[User talk:Anna328p|talk]]) 06:59, 26 March 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Enged%C3%A9lyk%C3%A9r%C3%A9s&oldid=28288240&useparsoid=1 huwiki:Wikipédia:Engedélykérés] == The email templates are rendered incorrectly. [[User:Bencemac|Bencemac]] ([[User talk:Bencemac|talk]]) 14:00, 26 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T421563 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:19, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Usu%C3%A1rio(a):Inter-rede/Cabe%C3%A7alho&oldid=71778331&useparsoid=1 ptwiki:Usuário(a):Inter-rede/Cabeçalho] == Whitespaces seem to have collapsed [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 18:02, 27 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422155 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:36, 2 April 2026 (UTC) ::It looks like the problem is the <code>display:flex</code> in the <code>style</code> attribute on the wrapper is at fault. Parsoid generates <code><nowiki><span></nowiki></code> wrappers around the html entities in the wikitext, by design. The whitespace is present in the HTML, so that's not a fault of Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:07, 9 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%91%D7%A6%D7%A2_%D7%9E%D7%A9%D7%94_(%D7%9E%D7%9C%D7%97%D7%9E%D7%AA_%D7%94%D7%A2%D7%A6%D7%9E%D7%90%D7%95%D7%AA)&oldid=42991233&useparsoid=1 hewiki:מבצע משה (מלחמת העצמאות)] == הכיתוב שנועד למנוע בלבול בין מבצע משה הזה למבצע משה אחר לא ערוך [[User:חנניה בלסמן|חנניה בלסמן]] ([[User talk:חנניה בלסמן|talk]]) 12:54, 30 March 2026 (UTC) == [//en.wikipedia.org/w/index.php?title=Help:Colon_trick&useparsoid=1 enwiki:Help:Colon trick] == According to [[w:Help:Colon trick]], it is explained as follows: "<code><nowiki>[[//Hus]]</nowiki></code> will produce an (invalid) external link wrapped in brackets ("[[//Hus]]"), but <code><nowiki>[[://Hus]]</nowiki></code> will produce a link to [[w://Hus|//Hus]]." However, when using Parsoid, it incorrectly links to [[w:Help:Colon trick//Hus|Help:Colon trick//Hus]].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:02, 31 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422161 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 14:00, 2 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Ans%C3%B6kan_om_administrativ_beh%C3%B6righet&oldid=59167563&useparsoid=1 svwiki:Wikipedia:Ansökan om administrativ behörighet] == In Legacy, each section (candidate) get a [redigera] ([edit] to the right of the section name. In Parsoid, there is nothing to the right of the section name. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 12:15, 2 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T391624 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:27, 2 April 2026 (UTC) == [https://en.wiktionary.org/w/index.php?title=H%26P&oldid=83856321&useparsoid=1 enwiktionary:H&P] == The first hidden category listed is [[wiktionary:Category:English_entries_with_incorrect_language_header|English entries with incorrect language header]]'','' which is, however, empty. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:48, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Jo%C3%A3o_Peixoto&oldid=72016744&useparsoid=1 ptwiki:João Peixoto] == A foto não corresponde ao nome citado [[User:Mayque Lemos|Mayque Lemos]] ([[User talk:Mayque Lemos|talk]]) 18:18, 2 April 2026 (UTC) == [https://meta.wikimedia.org/w/index.php?title=Main_Page&oldid=30254797&useparsoid=1 metawiki:Main Page] == On Parsoid only, <nowiki>''complete list'' and ''request''</nowiki> each show a space between them and their preceding opening bracket. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 19:06, 3 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&oldid=1343194045&useparsoid=1 enwiki:In Stars and Time] == <code>&lt;ref name="rps"&gt;</code> displays an error which doesn’t occur on the legacy parser [[User:Mir Novov|Mir Novov]] ([[User talk:Mir Novov|talk]]) 12:10, 4 April 2026 (UTC) :It was an error which I fixed with [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&diff=1348021667&oldid=1347424445 this edit] which adds one more backlink to Ref #5. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:00, 10 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Helen_Andrews&oldid=72024590&useparsoid=1 ptwiki:Helen Andrews] == Estou a ter problema com as referências, pois aparecem duplicadas. [[User:Faviola7|Faviola7]] ([[User talk:Faviola7|talk]]) 14:17, 4 April 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Project_chat&oldid=3236&useparsoid=1 abstractwiki:Abstract Wikipedia:Project chat] == In the "Bot request" section, a link that has been visited is blue rather than purple, because spaces in the link are turned into actual spaces (%20) in the URL. [[User:JJPMaster|JJP]]<sub>[[User talk:JJPMaster|Mas]]<sub>[[Special:Contributions/JJPMaster|ter]]</sub></sub> ([[wikt:she|she]]/[[wikt:they|they]]) 21:53, 4 April 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Tor_Fosse_(f%C3%B8dt_1956)&oldid=25723619&useparsoid=1 nowiki:Tor Fosse (født 1956)] == fil: center frameless [[User:Birgit.H.Pihl|Birgit.H.Pihl]] ([[User talk:Birgit.H.Pihl|talk]]) 10:05, 5 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Politisk_opposition&oldid=59171124&useparsoid=1 svwiki:Politisk opposition] == This error message about unused named reference is not shown: Referensfel: <ref>-tagg med namn "sr-20161006", definierad i <references> används inte tidigare i texten. The article is also added to hidden category "Sidor med referensfel" but that is not shown [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:12, 5 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Puteulum/Sandbox&oldid=150100596&useparsoid=1 itwiki:Utente:Puteulum/Sandbox] == The "Move" button to move the entry from sandbox to NS0 does not appear [[User:Puteulum|Puteulum]] ([[User talk:Puteulum|talk]]) 14:28, 7 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=POVOADO_TIRIRICAL&oldid=72040530&useparsoid=1 ptwiki:POVOADO TIRIRICAL] == O MEU TEXTO ESTA TODO VERMELHO E MAIS CENTRALIZADO [[User:POVOADO TIRIRICAL|POVOADO TIRIRICAL]] ([[User talk:POVOADO TIRIRICAL|talk]]) 18:38, 7 April 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%B1%E4%BA%AC%E9%83%BD%E9%81%935%E5%8F%B7%E6%96%B0%E5%AE%BF%E9%9D%92%E6%A2%85%E7%B7%9A&oldid=108985336&useparsoid=1 jawiki:東京都道5号新宿青梅線] == ヘッダー付近に編集ミスと思われし文言あり [[User:QWERTYKeyboard0570|QWERTYKeyboard0570]] ([[User talk:QWERTYKeyboard0570|talk]]) 08:56, 8 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=2022_Oder_environmental_disaster&oldid=1344570432&useparsoid=1 enwiki:2022 Oder environmental disaster] == After a second, the actual map from the infobox (not the buttons) is replaced with a placeholder icon and text (clicking in the field still works). [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 11:56, 8 April 2026 (UTC) :Could it have been a transient issue? I cannot reproduce this right now. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:03, 10 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Commissione_arbitrale/Domande&oldid=150049601&useparsoid=1 itwiki:Wikipedia:Commissione arbitrale/Domande] == This page is related to the itwiki ArbCom election. Section edit links were not shown, making it difficult to ask questions to candidates. This has since been worked around with [[:it:special:diff/150118322|this edit]] and is likely related to [[phab:T387520|T387520]]. [[User:Titore|Titore]] ([[User talk:Titore|talk]]) 19:58, 8 April 2026 (UTC) :Thanks for this report. This is on our list of high priority tasks to fix and we are going to pick up shortly. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:53, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Kurier&oldid=266019405&useparsoid=1 dewiki:Wikipedia:Kurier] == das Diagramm zum Beitrag "Ein Wal ..." überragt den Text der rechten Spalte. [[User:Michael w|Michael w]] ([[User talk:Michael w|talk]]) 08:10, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034&useparsoid=1 dewiki:Wikipedia:Fragen zur Wikipedia] == <nowiki>& s h y ;</nowiki> is ignored. See the test on https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034#&_s_h_y_; [[User:Raymond|Raymond]] ([[User talk:Raymond|talk]]) 09:55, 10 April 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422960 for this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:55, 10 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Faktafr%C3%A5gor&oldid=59190040&useparsoid=1 svwiki:Wikipedia:Faktafrågor] == Svara-funktionen fungerar inte med Parsoid. När jag klickar på Svara för något inlägg, vilket som helst, dyker svarsrutan upp längst ner på sidan, efter den senaste diskussionstråden. Med den äldre parsern fungerar det. [[User:Larske|Larske]] ([[User talk:Larske|talk]]) 11:12, 10 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Cornelis_de_Bruijn_Martinuszoon&oldid=70921577&useparsoid=1 nlwiki:Cornelis de Bruijn Martinuszoon] == De pagina-afbeelding is de handtekening van C. de Bruijn Mz. Ik denk dat zijn afbeelding in de spotprent een betere pagina-afbeelding is. Het zou kunnen dat Parsoid/Wikipedia deze niet 'pakt' omdat de dimensies tijdens een eerdere bewerking zijn aangepast. Alvast bedankt! [[User:Jelledebruijn|Jelledebruijn]] ([[User talk:Jelledebruijn|talk]]) 16:31, 10 April 2026 (UTC) :I think you might have seen a version of the page before the cache was updated. I just checked and the image is identical with Parsoid and the older parse. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:46, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=The_Punisher_(2004)&oldid=263259949&useparsoid=1 dewiki:The Punisher (2004)] == Dead link template Vorlage:Toter Link (https://de.wikipedia.org/wiki/Vorlage:Toter_Link) after url is no longer working but gets part of the Link. (example https://de.wikipedia.org/wiki/The_Punisher_(2004)#cite_note-5 ) [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:23, 10 April 2026 (UTC) :Example without Parsoid: https://de.wikipedia.org/wiki/The_Punisher_(2004)?useparsoid=0#cite_note-5 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:57, 10 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T368724 but ideally, the template will be added with a space after the link. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:24, 11 April 2026 (UTC) ::Unfortunately it's added by the InternetArchiveBot that way: https://de.wikipedia.org/w/index.php?title=Liste_aktiver_Brauereien_in_Deutschland&diff=prev&oldid=265857281 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 06:45, 11 April 2026 (UTC) :::@[[User:SSastry (WMF)|SSastry (WMF)]]: But it is not good if the preview shows us a different result than the version that is subsequently published. InternetArchiveBot inserts it without spaces. The task is prioritized as Low, but since we have this thousands of times in the article inventory (and it used to work before), the task should be reprioritized to Higher. And the preview should always show the same result that I get after publishing. What do we do with the Phab task now? How do we handle this bug? Thank you, [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 09:12, 11 April 2026 (UTC) ::::We will fix the preview path separately. But, for this specifically, I'll flag this for the team to see how we want to handle this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:33, 11 April 2026 (UTC) :::::@[[User:SSastry (WMF)|SSastry (WMF)]]: Oh thank you, keep us up to date here please. [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 16:35, 11 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Marlon_Ganchozo&oldid=172919968&useparsoid=1 eswiki:Marlon Ganchozo] == No sale el resto de la información del, jugador [[User:Didierlpz06|Didierlpz06]] ([[User talk:Didierlpz06|talk]]) 19:04, 10 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 eswiki:Temporada regular de la Euroliga 2025-26] == no se sustituyen correctamente las ultimas plantillas [[User:Hugogs02|Hugogs02]] ([[User talk:Hugogs02|talk]]) 08:42, 11 April 2026 (UTC) :This page is too large post-template expansion. Observe that the templates at the end are not expanded neither in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 Parsoid] nor in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=0 Legacy]; the legacy parser just happens to expand a few more at the end of the page due to [https://phabricator.wikimedia.org/T392262 T392262]. The page should probably be split. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:13, 13 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Uniforme_de_la_selecci%C3%B3n_de_f%C3%BAtbol_de_Argentina&oldid=172883243&useparsoid=1 eswiki:Uniforme de la selección de fútbol de Argentina] == En la plantilla de uniforme de fútbol algunos uniformes se ven con las mangas más bajas respecto al archivo del cuerpo, dejando lineas de un pixel por encima con los colores de fondo en dicha plantilla. [[User:Lobo kun mfc|Lobo kun mfc]] ([[User talk:Lobo kun mfc|talk]]) 13:58, 11 April 2026 (UTC) :The lines displayed on top of the uniforms are present both in Parsoid and in the Legacy parser, and they do seem to vary slightly depending on the browser (I've looked on Firefox and Chrome, both on Linux, and they were not consistent between both browsers). :I believe this issue should be fixed on the template side (at a guess, the <code>style="color: inherit; background-color:#000040;"</code> that I see on the various image divs may well show up depending on the exact HTML structure and/or image) [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:23, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Liste_der_Radschnellverbindungen_in_Deutschland&oldid=266034807&useparsoid=1 dewiki:Liste der Radschnellverbindungen in Deutschland] == Hallo, beim Artikel [[Liste der Radschnellverbindungen in Deutschland]] wird die Beschreibung der MapLink-Karte wird nicht gescheid gerendert. Statt einem hochgestellten <code>[7]</code> wird <code>Karte der bestehenden Radschnellwege in Deutschland'"`UNIQ--ref-00000008-QINU`"'</code> gerendert. Das Problem ist serverseitig und tritt beim Legacy-Parser nicht auf. LG [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 16:02, 11 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T383004 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:06, 11 April 2026 (UTC) ::thanks! [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 14:13, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Louis_Franchet_d%E2%80%99Esp%C3%A8rey&oldid=266076416&useparsoid=1 dewiki:Louis Franchet d’Espèrey] == Bildumfluss nicht wie üblich [[User:Alfred Kiefer|Alfred Kiefer]] ([[User talk:Alfred Kiefer|talk]]) 19:30, 11 April 2026 (UTC) :This issue has been fixed in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1269534 and should be deployed to production this week. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:34, 13 April 2026 (UTC) == [https://bn.wiktionary.org/w/index.php?title=%E0%A6%AA%E0%A7%8D%E0%A6%B0%E0%A6%A7%E0%A6%BE%E0%A6%A8_%E0%A6%AA%E0%A6%BE%E0%A6%A4%E0%A6%BE&oldid=250894&useparsoid=1 bnwiktionary:প্রধান পাতা] == The ‘ শব্দছবি’ section is overflowing with Parsoid; thus does not happen when the legacy parser is used. [[User:Redmin|Redmin]] ([[User talk:Redmin|talk]]) 08:09, 12 April 2026 (UTC) :Since the section seems to be randomized, it's pretty hard to see which version of this section is overflowing (the ones I see do not seem to). Would you be able to provide more information/a screenshot? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:49, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Hamburg&oldid=266087257&useparsoid=1 dewiki:Wikipedia:Hamburg] == Abschnittsbearbeitungen nicht mehr möglich, Link fehlt. Betrifft einige WP-Seiten wie auch [[:de:Wikipedia:Stammtisch München]] oder auch nur einige Überschriften von [[:de:Vorlage:Coordinate]], also nicht immer komplette Seiten. [[User:NordNordWest|NordNordWest]] ([[User talk:NordNordWest|talk]]) 12:12, 12 April 2026 (UTC) :We have a number of issues with section edit links (documented in https://phabricator.wikimedia.org/T391624) that we intend to fix; sorry for the inconvenience - we'll make sure to keep this use case in mind when working on a solution. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:20, 23 April 2026 (UTC) == [https://zh.wikipedia.org/w/index.php?title=COBOL&oldid=91149855&useparsoid=1 zhwiki:COBOL] == 正文开头的“COBOL”英文名无法显示,且全文的繁简转换失效。 The English name "COBOL" for COBOL at the very beginning vanished. Besides, the conversion between traditional and simplified Chinese does not function for the entire page. [[User:Ricky136973|Ricky136973]] ([[User talk:Ricky136973|talk]]) 13:08, 12 April 2026 (UTC) :Parsoid should not (yet) be enabled on zhwiki. If you want to preview how it will work, you can add <code>&parsoidnewlc=1</code> to the end of the URL to use Parsoid's implementation of LanguageConverter. That shows "COBOL" on this page as expected. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:17, 13 April 2026 (UTC) ::Parsoid is now experimentally enabled, so you don't need the `&parsoidnewlc=1` at the end of the URL any more. It appears that the COBOL page renders correctly now? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:40, 21 April 2026 (UTC) == [https://th.wikipedia.org/w/index.php?title=4_%E0%B9%80%E0%B8%97%E0%B8%9E%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B8%9E%E0%B8%B4%E0%B8%97%E0%B8%B1%E0%B8%81%E0%B8%A9%E0%B9%8C&oldid=12947833&useparsoid=1 thwiki:4 เทพผู้พิทักษ์] == อันนี้น่าจะผิดที่ร้องเพลงประกอบละคร [[User:ภรพัฒน์|ภรพัฒน์]] ([[User talk:ภรพัฒน์|talk]]) 12:47, 13 April 2026 (UTC) :Google translate says, "This is probably a mistake—singing the theme song for a TV drama." :This seems like a content issue, not a Parsoid issue. Mistakes in content should be correctly directly on the wiki. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:47, 21 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:%D7%A9%D7%A8%D7%A9%D7%97%D7%95%D7%9F/%D7%98%D7%99%D7%95%D7%98%D7%94&oldid=42822143&useparsoid=1 hewiki:משתמש:שרשחון/טיוטה] == אני רוצה לבטל את המצאות השם יעל סרלין בדף הטיוטות שלי כדי להתחיל ערך חדש [[User:שרשחון|שרשחון]] ([[User talk:שרשחון|talk]]) 12:59, 13 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Acidente_radiol%C3%B3gico_de_Goi%C3%A2nia&oldid=72061996&useparsoid=1 ptwiki:Acidente radiológico de Goiânia] == [[File:Captura_de_tela_de_miniaturas_renderizadas_pelo_Parsoid.png|thumb|250x250px]] As miniaturas estão minúsculas com as margens enormes. [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 15:13, 13 April 2026 (UTC) :It seems to be like this due to :<pre>html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img[width="250"] { width: calc(round(400px * var(--mw-file-upright,1),10px)) }</pre> [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 17:48, 19 April 2026 (UTC) ::{{Tracked|T423676}} [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) ::This should have been fixed by a backport we did yesterday. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:48, 21 April 2026 (UTC) == [https://hr.wikipedia.org/w/index.php?title=Marijana_Bijeli%C4%87&oldid=7429126&useparsoid=1 hrwiki:Marijana Bijelić] == Sve je podvuceno a ne treba tako biti [[User:Nikolica1512|Nikolica1512]] ([[User talk:Nikolica1512|talk]]) 17:08, 13 April 2026 (UTC) :I made some edits for you [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 18:32, 13 April 2026 (UTC) ::Thank you, I ameliorated those problematic parts, could you take a look at it? I hope it is good to go now as an article on wikipedia so people could access it. This person deserves to have a wiki page. ::Regards, [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 21:53, 13 April 2026 (UTC) :::Sorry, no. I was only helping with the syntax error. You'll need to take your request to the hrwiki community [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 22:25, 13 April 2026 (UTC) ::::And how do I do that exactly? Could you help me out with it? [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 22:56, 13 April 2026 (UTC) :::::You can ask on [[:hr:Wikipedija:Kafić]] and I'm sure someone there will help you out [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 00:34, 14 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 dewiki:Hilfe:Parserfunktionen] == Headings which use <code><nowiki><includeonly></nowiki></code> to change nesting level when transcluded don't appear as headings on original page [[User:TheFirstLevelDown|TheFirstLevelDown]] ([[User talk:TheFirstLevelDown|talk]]) 00:01, 14 April 2026 (UTC) :Parsoid does not support gluing heading together like the legacy parser did, so this syntax is not supported. :As an alternative, we suggest something like (to adjust depending on your exact use case) :<syntaxhighlight lang="wikitext"> <includeonly>===== title =====</includeonly> <noinclude>=== title ===</noinclude> </syntaxhighlight> :or, for a less robust version (but that doesn't require repeating the title) :<syntaxhighlight lang="wikitext"> <includeonly>=====</includeonly><noinclude>===</noinclude> title <includeonly>=====</includeonly><noinclude>===</noinclude> </syntaxhighlight> [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 12:45, 14 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Amor_eterno_una_tragedia_anunciada&oldid=172974810&useparsoid=1 eswiki:Amor eterno una tragedia anunciada] == el título de la página está como "Amor eterno una tragedia anunciada" y no deja cambiarlo al original que es "Amor Eterno: Una tragedia anunciada" [[User:Goodfriendspictures|Goodfriendspictures]] ([[User talk:Goodfriendspictures|talk]]) 09:59, 14 April 2026 (UTC) :To me it looks like the [[DISPLAYTITLE]] magic word is disabled though {{wg|AllowDisplayTitle}} in eswiki. Nothing to do with Parsoid. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 10:12, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:TanjaKo/Sandbox&oldid=150217478&useparsoid=1 itwiki:Utente:TanjaKo/Sandbox] == Nel testo non sono presenti errori e le frasi sono sottolineate con una linea rossa ondulata. Come risolverlo visual bug? Grazie [[User:TanjaKo|TanjaKo]] ([[User talk:TanjaKo|talk]]) 17:42, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Raduni/Raduni_in_Sicilia_2026&oldid=150224594&useparsoid=1 itwiki:Wikipedia:Raduni/Raduni in Sicilia 2026] == just on iPhone 14 with iOS 18.7.7 both from safari or chrome and both from logged or unlogged and incognito mode, the last number of the participants list (made with "#") is bigger than the others [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 18:31, 15 April 2026 (UTC) == [https://atj.wikipedia.org/w/index.php?title=Otitikowin&oldid=16878&useparsoid=1 atjwiki:Otitikowin] == pas moyen de travailler en mode visuel sur la page [[User:Luc Patin|Luc Patin]] ([[User talk:Luc Patin|talk]]) 14:56, 16 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Zhang_Zeduan&oldid=173032341&useparsoid=1 eswiki:Zhang Zeduan] == La pagina está incompleta e inpublicable [[User:Mikemj1987|Mikemj1987]] ([[User talk:Mikemj1987|talk]]) 22:08, 17 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:08, 20 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=L%C3%ADnea_E3_(Euskotren_Trena)&oldid=173034070&useparsoid=1 eswiki:Línea E3 (Euskotren Trena)] == La imagen se ve un poco mal por el modo oscuro. [[User:UnniMan|UnniMan]] ([[User talk:UnniMan|talk]]) 00:55, 18 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:09, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Stadtbahn_Karlsruhe&oldid=265878452&useparsoid=1 dewiki:Stadtbahn Karlsruhe] == Shows reference error and the categoy Kategorie:Wikipedia:Seite mit Einzelnachweisfehlern but is not included in https://de.wikipedia.org/wiki/Kategorie:Wikipedia:Seite_mit_Einzelnachweisfehlern The same happens with other articles that had no reference errors with the old parser. Makes maintenance hard. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 09:26, 19 April 2026 (UTC) :Tracked in https://phabricator.wikimedia.org/T423924 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Indiana_Jones_and_the_Fate_of_Atlantis&oldid=265815741&useparsoid=1 dewiki:Indiana Jones and the Fate of Atlantis] == Shows a reference error that is not visible in the preview function. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:06, 19 April 2026 (UTC) :The error came through a Reference with the same name in a used template https://de.wikipedia.org/wiki/Vorlage:Verkaufszahlen_LucasArts_Adventures Still bad to have an error that wasn't there with the old parser and isn't shown in the preview or maintenance category. --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:27, 19 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Evento_Azolla&oldid=72103944&useparsoid=1 ptwiki:Evento Azolla] == [Convert: número inválido] na parte de Efeitos Globais [[User:Marina Funez|Marina Funez]] ([[User talk:Marina Funez|talk]]) 00:28, 20 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:10, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Musikk%C3%A1r&oldid=144140&useparsoid=1 smnwiki:Myenster:Musikkár] == Instead of dealing with this issue and the other issue on smnwiki listed below, these were quietly archived. These are still displaying messed up months later after they were reported the first time. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:53, 20 April 2026 (UTC) :We may have missed this previously, but edits like [https://smn.wikipedia.org/w/index.php?title=Myenster%3AMusikk%C3%A1r&diff=152826&oldid=144359 this] should fix the rendering. This should work for the other pages below as well. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 12:42, 20 April 2026 (UTC) ::Thank you. I'll do the same for any other templates I come across that display like that one did. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 15:49, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Diskografia&oldid=62663&useparsoid=1 smnwiki:Myenster:Diskografia] == Instead of dealing with this issue and the other issue on smnwiki listed above, these were quietly archived. These are still displaying messed up months later after they were reported the first time. -[[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Kirje%C4%8D%C3%A4llee&oldid=32928&useparsoid=1 smnwiki:Myenster:Kirječällee] == Like the other display issues in smnwiki, this is also displaying messed up after the change. [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. For all other pages you encounter on wiki like this, please make similar edits. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Donald_A._Wollheim&oldid=266357315&useparsoid=1 dewiki:Donald A. Wollheim] == Picture is shown within a big white box, which isn't the case with the old parser. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 11:15, 20 April 2026 (UTC) :[[phab:T421524]] [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe_Diskussion:Bilder&oldid=266370955&useparsoid=1 dewiki:Hilfe Diskussion:Bilder] == see [[w:de:Hilfe Diskussion:Bilder #Skalierung von Bildern mit dem Parameter hochkant scheint nicht mehr zu funktionieren]] [[User:BurghardRichter|BurghardRichter]] ([[User talk:BurghardRichter|talk]]) 22:24, 20 April 2026 (UTC) == [https://tcy.wikipedia.org/w/index.php?title=%E0%B2%AE%E0%B3%81%E0%B2%96%E0%B3%8D%E0%B2%AF_%E0%B2%AA%E0%B3%81%E0%B2%9F&oldid=359337&useparsoid=1 tcywiki:ಮುಖ್ಯ ಪುಟ] == in main page not enable <code>html.skin-theme-clientpref-night</code> [[User:ChiK|ChiK]] ([[User talk:ChiK|talk]]) 05:47, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:23, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == https://de.wikipedia.org/wiki/Gemeindestandsver%C3%A4nderungen_in_der_Schweiz == Die Links zu den Ankern gehen nicht [[Special:Contributions/&#126;2026-24437-27|&#126;2026-24437-27]] ([[User talk:&#126;2026-24437-27|talk]]) 11:53, 21 April 2026 (UTC) :I see you found a solution :) :For the exact issue: generating ids independently from their enclosing tag is not supported by Parsoid (although this is not documented - I'll fix that). :Thanks for the report! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:16, 21 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Albosaggia&oldid=50063504&useparsoid=1 svwiki:Albosaggia] == This article, and thousands of other articles, have erroneously been put in hidden categories [[:sv:Kategori:Sidor med referensfel]] and [[:sv:Kategori:Wikipedia:Projekt översätta källmallar]]. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 12:24, 21 April 2026 (UTC) :You can mark this issue as fixed. The problem root cause was in a new Template and Module created this morning. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:40, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Eurovision_Song_Contest_1992&oldid=258716277&useparsoid=1 dewiki:Eurovision Song Contest 1992] == Quelltext bearbeiten ist für Abschnitte nicht sichtbar [[User:Anmey10112|Anmey10112]] ([[User talk:Anmey10112|talk]]) 13:00, 21 April 2026 (UTC) :Translation: "Edit source" is not visible for sections. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Boro%C8%99e%C8%99ti,_Ia%C8%99i&oldid=17665231&useparsoid=1 rowiki:Boroșești, Iași] == Satul este Borosești nu Boroșești. [[User:Stalmada|Stalmada]] ([[User talk:Stalmada|talk]]) 13:07, 21 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:09, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Gebouwge%C3%AFntegreerde_zonnepanelen_(BIPV)&oldid=71021732&useparsoid=1 nlwiki:Gebouwgeïntegreerde zonnepanelen (BIPV)] == Bij de afbeeldingen zijn 3 afbeeldingen gecombineerd met de sjabloon {{Afbeelding combi}} . De sjabloon maakt gebruikt van elk aparte tekstvelden voor elke afbeeldingen. Echter is in dit geval bij de eerste twee afbeeldingen geen gebruik gemaakt van tekstveld en is al de tekst aan het eind geplaatst bij de laatste afbeelding. Door dit gebruik van de sjabloon worden de afbeeldingen zonder spatie direct na elkaar vertoont. Op de mobiele website worden de afbeeldingen met dit sjabloon wel met spaties vertoont. Merk op dat de engelse template wel de mogelijkheid heeft om afbeeldingen gecombineerd te laten zien met spaties er tussen en heeft deze variant template meer mogelijkheden dan de NL versie. Mogelijk dat er de uitwerkin ook niet helemaal correct is geweest, maar hierover is niet te oordelen vanwege de beperkte Wiki edit kennis. [[User:Public-Publicity|Public-Publicity]] ([[User talk:Public-Publicity|talk]]) 16:16, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:22, 21 April 2026 (UTC) :Translation: "In this section, three images have been combined using the template `Template:Afbeelding combi`. This template typically utilizes a separate text field for each individual image; however, in this specific instance, the text fields for the first two images were left unused, and all the accompanying text was instead placed at the end, alongside the final image. As a result of this specific application of the template, the images are displayed consecutively without any spacing between them. On the mobile version of the website, however, images utilizing this template *are* displayed with spacing. It is worth noting that the English-language version of this template *does* offer the capability to display combined images with spacing in between—making that variant of the template more versatile than its Dutch counterpart. It is possible that the implementation itself was not entirely correct; however, it is difficult to pass judgment on this matter due to limited expertise in Wiki editing." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:12, 23 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Talk:Rao_Laxmi_Chand&oldid=10828084&useparsoid=1 simplewiki:Talk:Rao Laxmi Chand] == This Page is fake and all the information is fake [[User:Rao Gourav|Rao Gourav]] ([[User talk:Rao Gourav|talk]]) 17:23, 21 April 2026 (UTC) :Triage: Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:28, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:07, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80%D0%BE%D0%B2%D1%81%D0%BA%D0%B8%D0%B9,_%D0%A1%D1%82%D0%B5%D0%BF%D0%B0%D0%BD_%D0%A4%D1%91%D0%B4%D0%BE%D1%80%D0%BE%D0%B2%D0%B8%D1%87&oldid=152793914&useparsoid=1 ruwiki:Александровский, Степан Фёдорович] == дублируется реф в инфобоксе [[User:Gleb95|Gleb95]] ([[User talk:Gleb95|talk]]) 20:21, 21 April 2026 (UTC) :Translation: "The reference is duplicated in the infobox." :The legacy parser version has 19 references in the references list, and Parsoid contains 22. This is likely a content issue, although I haven't looked into it to determine root cause. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:11, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is plenty of problems I see related to transliteration to Serbian Cyrillic. I prefer reading articles in Serbian Cyrillic (on top of our UI, I select "Ћирилица"). In current state, Parsoid should not be turned on at all on our Wikipedia {{multiple image | align = center | total_width = 1000 | image1 = Jefri Saks (no Parsoid).png | caption1 = Without Parsoid | image2 = Jefri Saks (Parsoid).png | caption2 = With Parsoid }} Note that, with Parsoid, everything is transliterated, even when marked with correct <nowiki><lang></nowiki> attribute. Without parsoid, original English text is correctly left un-transliterated. There is also a glitch where URL is not rendered in infoboxes, again, probably something about misrendering text which was supposed to avoid transliteration. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:43, 21 April 2026 (UTC) :This is [[phab:T424159|T424159 [P0] Parsoid doesn't "guessVariant" at top level on Serbian Wikipedia, and makes sr-ec rendering "unusable" for some pages]]. Fundamentally, the mark up on that page is incorrect, in so far as English and Latin text aren't properly marked with `-{....}-`. It "worked before" because of a top-level "guessVariant" routine which effectively disabled language converter entirely on some pages, including this one. I suspect I'm going to have to implement the same 'guessVariant' mechanism in Parsoid, since there appears to be too much content of this type without proper language markers. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:04, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is no "Edit with migration tool" entry in tools on Serbian Wikipedia. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:50, 21 April 2026 (UTC) :It needs to be enabled explicitly in Preferences > Editing > Developer tools > Enable parser migration tool. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:44, 23 April 2026 (UTC) == includeonly in headline syntax == no longer resolved properly == ''Example:'' [[w:de:Hilfe:Parserfunktionen]] This page (and many others of our help pages) are made for dual use: # stand alone # transclusion of several help pages of similar topic into a combined complete story. They contain headlines like <syntaxhighlight lang="wikitext"> <includeonly>=</includeonly>== Allgemeines ==<includeonly>=</includeonly> </syntaxhighlight> If stand alone, this shall be displayed as H2. * When combined, the page title will be shown as H2 and the section as H3. Swift solution most welcome – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:23, 22 April 2026 (UTC) : BTW – transclusion works correctly: [[w:de:Hilfe:Parserfunktionen/*]] --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:27, 22 April 2026 (UTC) :https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 has our suggested solution (the first form preferably). It works in transclusion mode because the preprocessor is involved. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:53, 22 April 2026 (UTC) ::“has our suggested solution (the first form preferably). It works” ::I do not understand what is “our suggested solution” – please look at this current page. It has neither TOC nor any headline, since the == are displayed within the text, using the default parsing. There are 10 headlines. ::Astonished – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 21:45, 22 April 2026 (UTC) :::Oops .. sorry! I pasted the wrong link! I meant to point you to [[#dewiki:Hilfe:Parserfunktionen|this section]] on this page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 00:09, 23 April 2026 (UTC) You’re imposing some work on us. * I am happy that there are [https://de.wikipedia.org/w/index.php?search=H:+insource:includeonly+insource:%2Fincludeonly%5C%3E%3D%2B%5C%3C%5C%2Fincludeonly%2F&title=Spezial:Suche 12 pages only] to be updated now. * Fortunately, some other syntax has been used in [[w:de:H:VE/*]] – [[w:de:H:Lua/*]] – [[w:de:H:Tabellen/*]] – [[w:de:H:FAQ/Übersicht]] which are merging a huge pile of single pages. I do hope this exception will be described in WikiSyntax Documentation soon. --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 11:04, 23 April 2026 (UTC) :Thanks for your understanding and fixing the pages. Given all the work we've done to deploy to a wiki, at this point, we expect that all remaining rendering issues are likely going to be edge cases that affect small number of pages. We'll update the docs soon, yes. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:22, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%9F%D1%80%D0%B5%D0%B4%D1%83%D0%BF%D1%80%D0%B5%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5&oldid=116093745&useparsoid=1 ruwiki:Шаблон:Предупреждение] == [[:ru:Шаблон:Tpre]] ([[:ru:Модуль:Template call code]]) stops working entirely in Parsoid mode. See also local discussion: [[:ru:Википедия:Форум/Технический#c-Tarkoff-20260422084300-Шаблон:Предупреждение]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 16:40, 22 April 2026 (UTC) :That doesn't look good. Do you have a sense of how many pages are impacted? We will take a look tomorrow and see what is going on and if we can roll out a quick fix. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:07, 22 April 2026 (UTC) ::I see what is going on. This is [[phab:T353697|T353697]] which was resolved with https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/992274. The fix is to have the modules emit <code>format="wikitext"</code> so the <nowiki><span> tags aren't escaped as literal output. Can you see if that fixes it?</nowiki> [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:22, 22 April 2026 (UTC) ::: Yes, thank you. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:47, 22 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Rei_Ami&oldid=266367300&useparsoid=1 dewiki:Rei Ami] == The image of Ami on the top right corner should be rendered with a width of 250px but seems to be scaled down to round about 160px. When using the Legacy Parser the image is rendered as expected. The issue seems to effect only some images. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 18:59, 22 April 2026 (UTC) :@[[User:Jon (WMF)|Jon (WMF)]] says, "The original size of the image is 315x427. This is https://phabricator.wikimedia.org/T421524 - only way to fix it is for Parsoid to mark the img up with a class when the image original size is smaller than 400px. Otherwise it's working as expected." I'm not entirely sure I agree with this diagnosis, since T421524 would cause the image to appear "too large" not "too small". :@[[User:Guardian of Arcadia|Guardian of Arcadia]] what is your user thumbnail size preference, and what skin are you using? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:13, 23 April 2026 (UTC) ::@[[User:Cscott|Cscott]]: I'm using the default thumbnail size of 250px and Vector 2010 (Legacy) as skin. But the size issue also occurs when using other skins like Vector 2022, which can be seen by appending <code>useskin=vector-2022</code> to the URL or viewing the page in an incognito window. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 20:37, 23 April 2026 (UTC) :::What browser and version are you using @[[User:Guardian of Arcadia|Guardian of Arcadia]] ? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 21:46, 23 April 2026 (UTC) ::::Also can you check you don't have a different preference set in [[Special:GlobalPreferences]] and possibly try changing it and changing it back? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:55, 23 April 2026 (UTC) ::::@[[User:Jon (WMF)|Jon (WMF)]]: The issue isn't limited to my account only; it occurs in a logged-out state (within an incognito window) too. But your guess about the browser seems to be right: I have the described issue when using Firefox with the ESR version 115.35.0esr. Today I have tested with another browser (Chrome and Edge) as well as on a PC with a current (non-ESR) Firefox and there the image is shown as expected. So, is this a bug in this specific Firefox version? [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 19:47, 24 April 2026 (UTC) :::::Yes. This sounds like a bug in that specific Firefox version. If you can give me more details about the operating system version you are using I can see if I can replicate in browserstack.com . Is it possible there are any browser extensions installed on that browser? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 22:31, 24 April 2026 (UTC) ::::::The operating system on this PC is Windows 8.1 (Build 9600) and I do not have any browser extensions installed there. Hope this helps to reproduce the issue. If you need anything else please let me know. Thanks for your help. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 22:44, 24 April 2026 (UTC) :::::::That was incredibly useful information, thank you. I understand what is happening now, and there might be something we can do here. Note, this browser is on the cusp of our usual browser support levels, which is what's causing the problem. [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 16:54, 27 April 2026 (UTC) ::::::::That's great news. I would be verry happy if you or your team can fix it. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 17:00, 27 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Alexandru_Dobrogeanu-Gherea&oldid=17669378&useparsoid=1 rowiki:Alexandru Dobrogeanu-Gherea] == imaginea prea mare, la fel la multe articole cu infocaseta om politic, de pilda Vasile Luca, Luminita Odobescu etc face contrast cu imagini in alte infocasete unde problema se poate regla [[User:Ewan2|Ewan2]] ([[User talk:Ewan2|talk]]) 01:25, 23 April 2026 (UTC) :Google translate: "the image is too large, the same as in many articles with the politician infobox, for example Vasile Luca, Luminita Odobescu, etc. it contrasts with images in other infoboxes where the problem can be adjusted." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 18:50, 23 April 2026 (UTC) ::@[[User:Jon (WMF)|Jon (WMF)]] says "For Romanian Wikipedia, there was a problem with the infobox styles. Pretty sure it's been fixed since. It could just be that he's seeing 400px instead of 300px. The infobox image looks identical to me in Parsoid and legacy." ::@[[User:Ewan2|Ewan2]] are you using the default thumbnail size (250px) or a larger size in your user preferences? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:07, 23 April 2026 (UTC) == [https://zu.wikipedia.org/w/index.php?title=Gashamo_Hawd_Somali_Ethiopia&oldid=122552&useparsoid=1 zuwiki:Gashamo Hawd Somali Ethiopia] == Is the city of Hawd Zone [[User:Maaaaskaas11|Maaaaskaas11]] ([[User talk:Maaaaskaas11|talk]]) 21:58, 23 April 2026 (UTC) == [https://ru.wikipedia.org/wiki/Текумсе ruwiki:Текумсе] == For some reason, the comment "До эскиза Лоссинга не было известно..." is repeated twice (see subsection "Комментарии" at the end of the article). This comment is generated by template "ref+" placed inside the template "персона" (an analogue of "Template:Infobox person"), and it is supposed to appear only once. Thanks! [[User:Adavyd|Adavyd]] ([[User talk:Adavyd|talk]]) 22:04, 23 April 2026 (UTC) :This is probably {{phab|T415789}}, which would be solved by adding a name to the reference, but then we end up running into {{phab|T423924}} - the template ends up defining the reference twice with subtly different content (as far as Parsoid is concerned) and the same name, which triggers an error. The fix will probably be to add a name to the reference once {{phab|T423924}} is handled. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:43, 24 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=FIDO2&oldid=264704558&useparsoid=1 dewiki:FIDO2] == Erste Grafik überlagert den Text und die Werkzeugleiste links [[User:Hinnerk11|Hinnerk11]] ([[User talk:Hinnerk11|talk]]) 23:51, 23 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Amanda_Kathrine_Smith/Sandbox&oldid=150348388&useparsoid=1 itwiki:Utente:Amanda Kathrine Smith/Sandbox] == i don't see the "MOVE DRAFT" button. [[User:Amanda Kathrine Smith|Amanda Kathrine Smith]] ([[User talk:Amanda Kathrine Smith|talk]]) 14:14, 24 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:36, 28 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%A1%D1%80%D0%B1%D0%B8%D1%98%D0%B0_(1071%E2%80%941217)&oldid=30892614&useparsoid=1 srwiki:Србија (1071—1217)] == Text inside {{lang-la.. and other {{lang-... templates is not displayed at all. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:46, 24 April 2026 (UTC) :Never mind, in process of adapting our templates for Parsoid, I missed additional change needed in an auxillary module. All is good now. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A2%D1%80%D0%B3/%D0%94%D1%80%D1%83%D0%B3%D0%B8&oldid=30921466&useparsoid=1 srwiki:Википедија:Трг/Други] == <nowiki>__NOCONTENTCONVERT__</nowiki> does not work in Parsoid. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 18:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=Queen&oldid=30824348&useparsoid=1 srwiki:Queen] == Parsoid does not honor __БЕЗКН__ (magic word to suppress title conversion during language conversion) [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 20:03, 24 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%A4%D0%BE%D1%80%D1%83%D0%BC/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8&oldid=152858025&useparsoid=1 ruwiki:Википедия:Форум/Новости] == Исчез логотип в скине Вектор-2010 при включенном гаджете, который отображает праздничные логотипы. При отключении гаджета в настройках — повседневный логотип виден. [[User:Рыцарь поля|Рыцарь поля]] ([[User talk:Рыцарь поля|talk]]) 00:16, 25 April 2026 (UTC) :Triage: not a Parsoid visual issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:22, 27 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9F%D1%80%D0%BE%D0%B5%D0%BA%D1%82:%D0%91%D0%B8%D0%B1%D0%BB%D0%B8%D0%BE%D1%82%D0%B5%D0%BA%D0%B0/%D0%A2%D1%80%D0%B5%D0%B1%D1%83%D1%8E%D1%82%D1%81%D1%8F_%D0%BA%D0%BD%D0%B8%D0%B3%D0%B8&oldid=152853098&useparsoid=1 ruwiki:Проект:Библиотека/Требуются книги] == Конфликт [[:ru:Проект:Библиотека/Требуются книги/Шапка]] с содержанием страницы, из-за чего в [[:ru:Шаблон:shortcut|Шаблон:shortcut]] помещается раздел "содержание" (выглядит это так: [https://ibb.co/219kN3dW 1] и [https://ibb.co/bgM0Fmpn 2]). ------- The conflict between [[:ru:Проект:Библиотека/Требуются книги/Шапка]] and the page content causes the "содержание" section to appear inside [[:ru:Шаблон:shortcut|Шаблон:shortcut]] (this is how it looks: [https://ibb.co/219kN3dW 1] and [https://ibb.co/bgM0Fmpn 2]). [[User:Футболло|Futbollo]] ([[User talk:Футболло|talk]]) 01:10, 25 April 2026 (UTC) :Thank you for the report - I've filed {{phab|T424492}} for it. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:33, 27 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Copa_Intercontinental_da_FIFA_de_2025&oldid=72134360&useparsoid=1 ptwiki:Copa Intercontinental da FIFA de 2025] == Quadro de informações foi excluído por acidente. [[User:AnderSilv42|AnderSilv42]] ([[User talk:AnderSilv42|talk]]) 00:16, 26 April 2026 (UTC) :Triage: Content related - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 15:23, 26 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Michel_W%C3%B6cke&oldid=266505400&useparsoid=1 dewiki:Michel Wöcke] == Bild (Thumb) viel zu gross [[User:Albinfo|Albinfo]] ([[User talk:Albinfo|talk]]) 13:44, 26 April 2026 (UTC) == [https://tn.wikipedia.org/w/index.php?title=Sekolo_Se_Segolwane_Sa_Nata&oldid=49572&useparsoid=1 tnwiki:Sekolo Se Segolwane Sa Nata] == I tried fixing the references but It still says pages with reference errors so I don't know what could be the issue [[User:Blackgirlmighty|Blackgirlmighty]] ([[User talk:Blackgirlmighty|talk]]) 17:00, 26 April 2026 (UTC) :You only need to define a reference once even if you want to use it multiple times - see https://www.mediawiki.org/wiki/Help:Cite#Multiple_uses_of_the_same_footnote for more information. One of each of the references Mmegi2012 and Mmegi2023 should be kept as is; the others should be replaced by <nowiki><ref name="Mmegi2012" /></nowiki> (or 2023) without content. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:39, 27 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Pete_Aguilar&oldid=8671369&useparsoid=1 simplewiki:Pete Aguilar] == This is a less detailed copy of another Wikipedia page. There are two wiki pages showing Pete Aguilar and this is an outdated version. [[User:SuperPug3739|SuperPug3739]] ([[User talk:SuperPug3739|talk]]) 04:56, 27 April 2026 (UTC) :Triage: content related, not Parsoid related [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:46, 27 April 2026 (UTC) == [https://fi.wikipedia.org/w/index.php?title=Hoito-_kasvatussuunnitelma&oldid=23973675&useparsoid=1 fiwiki:Hoito- kasvatussuunnitelma] == Sivun nimi piti olla Hoito- ja kasvatussuunnitelma. Muokkaaminen ei onnistunut. [[User:Nebiux|Nebiux]] ([[User talk:Nebiux|talk]]) 12:01, 29 April 2026 (UTC) :Triage: content related, not Parsoid-related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:04, 30 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Usuario:Luigi_Nakano&oldid=173203320&useparsoid=1 eswiki:Usuario:Luigi Nakano] == An error appears, which should appear when template [[w:es:Plantilla:Estado usuario|Estado usuario]] has nothing in 1=. However, there is a parameter in 1=, so the result should be "Conectado" or "Desconectado", and not "Error:No se ha indicado usuario.". [[User:Luigi Nakano|<span style="color:green">Luigi</span> <span style="color:blue">Nakano</span>]] [[File:Emojione 1F3A7.svg|15px]] ([[User talk:Luigi Nakano|会話]]) 23:12, 29 April 2026 (UTC) :This looks like {{phab|T348722}}, for which a workaround is suggested in https://www.mediawiki.org/wiki/Parsoid/Parser_Unification/Instructions_for_editors#Access_to_parent_frame_from_within_extensions. Let us know if the problem persists after the fix! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:10, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=History_of_the_Ryukyu_Islands&oldid=1336895218&useparsoid=1 enwiki:History of the Ryukyu Islands] == The multiple issues display unsourced template when editing the article there is no such template. [[User:Lightoil|Lightoil]] ([[User talk:Lightoil|talk]]) 05:11, 30 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A7%D1%85%D0%B0%D0%B8%D0%B4%D0%B7%D0%B5,_%D0%9C%D0%B0%D0%BC%D0%B8%D1%8F_%D0%92%D0%B8%D1%81%D1%81%D0%B0%D1%80%D0%B8%D0%BE%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&oldid=152923873&useparsoid=1 ruwiki:Чхаидзе, Мамия Виссарионович] == In the old parser, links to non-existing file pages lead to Special:Upload for the file. In Parsoid, it's a strange link to Special:FilePath, which ends up confusing the editors who accustomed to uploading files this way. [[:ru:Служебная:GoToComment/c-ФВ-20260430140600-Не_загружается_файл|See local discussion]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:53, 30 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%94%D0%B5%D1%80%D0%B2%D0%B8%D1%88_%D0%9A%D0%BE%D1%80%D0%BA%D1%83%D1%82&oldid=30931273&useparsoid=1 srwiki:Дервиш Коркут] == At the bottom, there are several navboxes, Parsoid adds some whitespace between them [[File:Spaces between navboxes with Parsoid..png]] [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 21:21, 30 April 2026 (UTC) : https://phabricator.wikimedia.org/T425123 [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 15:27, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Sevayat&oldid=1351876642&useparsoid=1 enwiki:Talk:Sevayat] == The content assessment and talk page are displayed directly on the talk page, rather than within the “About this page” section (mobile view). [[User:S4yam|S4yam]] ([[User talk:S4yam|talk]]) 21:44, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:Template_editor&oldid=1351909200&useparsoid=1 enwiki:Wikipedia talk:Template editor] == I'm artist thi is my personal biography page [[User:Allymtulia|Allymtulia]] ([[User talk:Allymtulia|talk]]) 21:45, 30 April 2026 (UTC) :Triage: Content issue, not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Middle_of_Nowhere_(Kacey_Musgraves_album)&oldid=1351931473&useparsoid=1 enwiki:Middle of Nowhere (Kacey Musgraves album)] == Producer parameter that adops hlist system in Infobox album template occurs an error. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 01:07, 1 May 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Associazione_Calcio_Perugia_1996-1997&oldid=148287407&useparsoid=1 itwiki:Associazione Calcio Perugia 1996-1997] == Doesn't show all kits. Just the third and on top of the screen [[User:Madive60|Madive60]] ([[User talk:Madive60|talk]]) 01:29, 1 May 2026 (UTC) :This is probably fixed by the fix to {{phab|T425056}} and the current CSS workaround on-wiki. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:22, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%9B%BD%E6%97%97%E3%81%AE%E4%B8%80%E8%A6%A7&oldid=109342678&useparsoid=1 jawiki:国旗の一覧] == イラクの国旗がない [[User:平舞|平舞]] ([[User talk:平舞|talk]]) 03:17, 1 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:21, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Manting_Chan&oldid=1351960413&useparsoid=1 enwiki:Manting Chan] == Divorce, she is not divorced. [[User:Bananahammock311911511|Bananahammock311911511]] ([[User talk:Bananahammock311911511|talk]]) 04:54, 1 May 2026 (UTC) :Content issue, not a Parsoid issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 07:30, 1 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E9%9B%B7%E9%96%80%E9%9F%B3%E5%8A%A9&oldid=109345108&useparsoid=1 jawiki:雷門音助] == {{人名の曖昧さ回避}}や{{aimai}}を貼ると表示が崩れる。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 07:27, 1 May 2026 (UTC) :<nowiki>[[:jawiki:雷門五郎]]</nowiki>でも同様の問題が起きています。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 09:09, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Iceman_(Drake_album)&oldid=1350717409&useparsoid=1 enwiki:Talk:Iceman (Drake album)] == Banners showing up on mobile, not under “learn more about this page button” [[User:OrbitalVoid49|OrbitalVoid49]] ([[User talk:OrbitalVoid49|talk]]) 09:36, 1 May 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Bancu,_Harghita&oldid=13617293&useparsoid=1 rowiki:Bancu, Harghita] == Steagulnjudetului Hargita nu este acea cârpă secuiasca. [[User:Auto 4115|Auto 4115]] ([[User talk:Auto 4115|talk]]) 01:39, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Aurangabad&oldid=1351274322&useparsoid=1 enwiki:Aurangabad] == It has the old name of the city as it's title [[User:20mphwind|20mphwind]] ([[User talk:20mphwind|talk]]) 07:09, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%B9%E0%A6%BE%E0%A6%9C%E0%A6%B0%E0%A6%BE%E0%A6%AC%E0%A6%BE%E0%A6%A1%E0%A6%BC%E0%A7%80_%E0%A6%89%E0%A6%9A%E0%A7%8D%E0%A6%9A_%E0%A6%AC%E0%A6%BF%E0%A6%A6%E0%A7%8D%E0%A6%AF%E0%A6%BE%E0%A6%B2%E0%A6%AF%E0%A6%BC&oldid=8874755&useparsoid=1 bnwiki:হাজরাবাড়ী উচ্চ বিদ্যালয়] == তথ্যসুত্র ব্যয়বহুল নয়। [[User:Md Umor Faruk 2010|Md Umor Faruk 2010]] ([[User talk:Md Umor Faruk 2010|talk]]) 08:00, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=She_Did_It_Again&oldid=1352147079&useparsoid=1 enwiki:She Did It Again] == (Mobile) Huge error in hlist. Bullet points (•) are missing, and the items listed are arranged very roughly. Not sure why this error occurs for over three days. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 10:45, 2 May 2026 (UTC) :Thank you for the report - I have filed {{phab|T425245}} for this issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:30, 3 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%91%E4%B8%8A%E5%93%B2&oldid=109361964&useparsoid=1 jawiki:村上哲] == [[Template:循環参照]]が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:13, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=Wikipedia:%E4%BA%95%E6%88%B8%E7%AB%AF&oldid=109349724&useparsoid=1 jawiki:Wikipedia:井戸端] == 目次が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1 enwiki:Wiki (disambiguation)] == [[w:en:tm:dab]] (at the bottom of the page) appears to render differently on Parsoid compared to non-Parsoid. <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 14:27, 2 May 2026 (UTC) :Also appears to render differently on desktop Parsoid v. mobile Parsoid -- compare https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=mobile (different rendering) vs. https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=desktop ('expected' rendering, AFAIK) <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 16:34, 2 May 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Horv%C3%A1th_Kriszti%C3%A1n_(fest%C5%91,_1976,_Budapest)&oldid=28948319&useparsoid=1 huwiki:Horváth Krisztián (festő, 1976, Budapest)] == Az a probléma, hogy nem szeretném hoyg festő, és 1976 Budapest legyen hozzá kírva. Elrontottam, és nem tudtam külön, új cikket írni róla. [[User:Pizzsus|Pizzsus]] ([[User talk:Pizzsus|talk]]) 20:47, 2 May 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%99%D7%A6%D7%97%D7%A7_%D7%9E%D7%90%D7%99%D7%A8_%D7%90%D7%9C%D7%AA%D7%A8&oldid=43088529&useparsoid=1 hewiki:יצחק מאיר אלתר] == הציטוטים בכתב דיויד בעברית לקויים. Text quotes in David font are displayed poorly. [[User:פרידבערג|פרידבערג]] ([[User talk:פרידבערג|talk]]) 21:36, 2 May 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9B%D0%B8%D1%86%D0%B5%D0%BD%D0%B7%D0%B8%D0%B8_%D0%B8_%D0%B8%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B_Creative_Commons&oldid=152790052&useparsoid=1 ruwiki:Лицензии и инструменты Creative Commons] == refs don't work with vector-2010 (but it works for vector-2022) [[User:Petsernik|Petsernik]] ([[User talk:Petsernik|talk]]) 23:05, 2 May 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Huawei&oldid=173270512&useparsoid=1 eswiki:Huawei] == El segundo sitio web que sale no existe es un vandalismo en wikimedia ingles o un error [[User:Usuario 016|Usuario 016]] ([[User talk:Usuario 016|talk]]) 23:15, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%8C%97%E6%9D%91%E8%81%A1&oldid=109365307&useparsoid=1 jawiki:北村聡] == 人名の曖昧さ回避Templateを挿入すると、上手く表示されず、大きな改行空白と共に「.mw-parser-output .dmbox{display:flex;align-items:center;clear:both;margin:0.9em 1em;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:0.25em 0.35em;font-size:95%}.mw-parser-output .dmbox>*{flex-shrink:0;margin:0 0.25em;display:inline}.mw-parser-output .dmbox-body{flex-grow:1;flex-shrink:1;padding:0.1em 0}」 というものが出る。 [[User:Geogie|Geogie]] ([[User talk:Geogie|talk]]) 23:35, 2 May 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Schreibwettbewerb&oldid=266703390&useparsoid=1 dewiki:Wikipedia:Schreibwettbewerb] == Text in der Blauen Tabelle ("Reviewpreis") überschneidet die rechte äußere Begrenzungslinie [[User:Polibil|Polibil]] ([[User talk:Polibil|talk]]) 15:30, 3 May 2026 (UTC) == [https://en.wikipedia.org/wiki/Template:Center enwiki:Template:Center] == Does not load on mobile version, most of the page tools are missing. [[File:Template Center issue.jpg|thumb|issue]] [[User:Misterpotatoman|Misterpotatoman]] ([[User talk:Misterpotatoman|talk]]) 19:28, 3 May 2026 (UTC) == [https://gl.wikipedia.org/w/index.php?title=Limodre,_Fene&oldid=7383114&useparsoid=1 glwiki:Limodre, Fene] == Fueron borrados los lugares de la parroquia de Limodre sin querer [[User:Vi1993|Vi1993]] ([[User talk:Vi1993|talk]]) 22:03, 3 May 2026 (UTC) al57f75pvvoxff0bomztg80e1j10qyv 8364808 8364756 2026-05-04T02:16:23Z Yukida-R 313329 /* jawiki:Template:Aimai */ new section 8364808 wikitext text/x-wiki Post your feedback about using [[Parsoid/Parser Unification|Parsoid]] to render articles. [[Parsoid/Parser_Unification/Known_Issues|Learn how to report problems clearly]]. '''Need more attention? [https://phabricator.wikimedia.org/maniphest/task/edit/form/43/?projects=PHID-PROJ-3y2wduoz5xezwveaq426 Report directly in Phabricator].''' {{note|This is for reporting feedback on the integration of the Parsoid parser only. '''For wiki content issues, such as concerns about article content, please report on your local wiki.''' }} [[Parsoid/Parser_Unification/Known_Issues|View known issues]] __NEWSECTIONLINK__ {{Archive box| [[/Archive 1]] [[/Archive 2]]}} == [https://nl.wikipedia.org/w/index.php?title=Wikipedia:Aanmelding_moderatoren&oldid=70702688&useparsoid=1 nlwiki:Wikipedia:Aanmelding moderatoren] == Sometimes, in a numbered list, the number stays on the first line when there are indented lines below it, and sometimes the number is vertically aligned between the different lines. For votes, it is preferable that the number remains on the line that starts with only “#” and not on lines with an indentation “#:”. [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:34, 15 February 2026 (UTC) :i.e. see item 33. under '<nowiki/>'''''Voor moderatorschap ContextCreator'''<nowiki/>'<nowiki/>'' [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:36, 15 February 2026 (UTC) ::I can't see any difference between Parsoid and the legacy Parser on that page, it appears that the number is correctly aligned in both cases. Are you using a different skin by any chance? Does the difference still appear? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:42, 21 April 2026 (UTC) :::I see no difference anymore - it is fixed. Thanks anyway! [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 16:01, 21 April 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Discussion_Wikip%C3%A9dia:Wikiconcours&oldid=233327486&useformat=mobile&useparsoid=1 frwiki:Discussion Wikipédia:Wikiconcours] == Content that is hidden inside the "Learn more about this page" button from MobileFrontend with legacy parser is not inside it with Parsoid. [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 08:32, 22 February 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Laurence_Olivier&oldid=148833592&useparsoid=1 itwiki:Laurence Olivier] == Giant Oscar statue icons (sgranate) [[User:UmbraSolis|UmbraSolis]] ([[User talk:UmbraSolis|talk]]) 20:28, 19 February 2026 (UTC) :This was probably due to https://phabricator.wikimedia.org/T417828, which is now fixed. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:53, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:43, 21 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Bologna_Football_Club_1909&oldid=149496425&useparsoid=1 itwiki:Bologna Football Club 1909] == problem with displaying football shirts [[User:Gio Bike|Gio Bike]] ([[User talk:Gio Bike|talk]]) 17:49, 20 February 2026 (UTC) :Can you be more specific, or is it fixed now? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:55, 27 February 2026 (UTC) ::Now it is OK [[Special:Contributions/&#126;2026-13011-93|&#126;2026-13011-93]] ([[User talk:&#126;2026-13011-93|talk]]) 17:20, 27 February 2026 (UTC) :::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:44, 21 April 2026 (UTC) == [https://vi.wiktionary.org/w/index.php?title=Wiktionary:Th%E1%BB%91ng_k%C3%AA/S%E1%BB%91_m%E1%BB%A5c_t%E1%BB%AB_theo_ng%C3%B4n_ng%E1%BB%AF/T%E1%BA%A5t_c%E1%BA%A3&oldid=2331126&useparsoid=1 viwiktionary:Wiktionary:Thống kê/Số mục từ theo ngôn ngữ/Tất cả] == Phần cuối bảng bị lỗi, không hiện ra số mục từ mà chỉ hiện ra "0" hoặc "-2" mà không rõ lý do, tôi không viết nhầm gì cả. (English: The table got error, just display "0" or "-2", but I don't have any error at write wikitext.) [[User:NHNAnh|NHNAnh]] ([[User talk:NHNAnh|talk]]) 05:57, 21 February 2026 (UTC) :I believe this might be due to "Expensive parser function count: 1080/500" in the debug log: there are too many expensive parser function counts on this page (PAGESINCATEGORY is expensive), and the later functions are not executed. :I would suggest splitting the page into several pages, if possible. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:04, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) == [https://cs.wikipedia.org/w/index.php?title=Celerina/Schlarigna&oldid=25694456&useparsoid=1 cswiki:Celerina/Schlarigna] == V tabulce v sekci obyvatelstvo se u jedné buňky zobrazuje černé pozadí. Pokud dám ale historii stránky a podívám se na aktuální verzi, vykreslí se stránka správně. To samé se opakuje i u jiných podobných stránek se stejně formátovanými tabulkami. [[User:Matijak|Matijak]] ([[User talk:Matijak|talk]]) 17:02, 22 February 2026 (UTC) :I cannot see a black cell in that table. Is this issue fixed? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:09, 27 February 2026 (UTC) ::I can see it in in both the history (latest revision) and on the page itself (live). It's the leftmost 'Počet' cell in the 'Jazyky v Celerině' table. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 10:10, 28 February 2026 (UTC) :::Aha! :::the cell itself is not dark, the text in it is, and only in dark mode. It is also present in the legacy rendering, which seems to hint at a problem with the table markup itself and not a parser issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:11, 2 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) :::::Not a Parsoid issue most likely, but it has not been fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:21, 24 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia:Biographies_of_living_persons&oldid=1340299616&useparsoid=1 enwiki:Wikipedia:Biographies of living persons] == Reporting a visual bug for all pages that suddenly arose as of this morning on Safari Mobile - the Page Actions Overflow div is in a permanently open state but inaccessible to via clicks to either toggle the menu or select any of the tools on the menu. In addition to being unable to interact with it, all of the styling broken and makes the top right section of the page unusable and barely readable. [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 14:34, 27 February 2026 (UTC) :Is this issue still present? Sorry, it has been a while since you reported this, I'm hoping that the issue has been resolved by now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) ::Yes, it appears to have been resolved. Thanks for following up! [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 03:38, 22 April 2026 (UTC) == [https://oc.wikipedia.org/w/index.php?title=Esqu%C3%A8rra_(politica)&oldid=2495338&useparsoid=1 ocwiki:Esquèrra (politica)] == There's an issue with the interlinks, this article should be connected with the other ones about left-wing politics [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 06:39, 28 February 2026 (UTC) :Yes, it was an issue with the interlinks, but those should naturally not be reported as visual issues ('bogue visuler') as the have nothing to do with Parsoid. You can link pages which have no connections by using the 'Apondre los ligams interlengas' (Add interlanguage links) button from the 'Bóstia d'aisinas' (Tools) menu. Unless, of course, Parsoid somehow blocks automatic linking of translations. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:10, 28 February 2026 (UTC) ::I don't know why but it was finally done (thank you so much to the person who did that), but the thing is, i tried what you said before and it kept telling me that i didn't had the permission to link the two articles... [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 19:33, 1 March 2026 (UTC) :::I did that, you are welcome. It appears that you are not autoconfirmed yet on Wikidata, and that this Wikidata entry requires that, which if both true I would expect you to not be able to do this change. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 04:21, 21 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) :::::Sorry? [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:48, 23 April 2026 (UTC) ::::::We're using the <nowiki>{{done}}</nowiki> template to track which issues have been resolved, vs still outstanding. I don't believe there is any additional follow required by the Content Transform team on this report? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 05:00, 24 April 2026 (UTC) :::::::Oh, no, I just didn't know this is a system you are using. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:19, 24 April 2026 (UTC) == [https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/Page_translation_administration&oldid=8240537&useparsoid=1 Help:Extension:Translate/Page translation administration] == The topmost warning in the 'Changing the source text' section does not display the codeblock content. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:47, 28 February 2026 (UTC) :This is a very clever use of the <code><nowiki>{{^(}}</nowiki></code> template to avoid creating an unintended translation marker. I've [https://www.mediawiki.org/w/index.php?title=Help%3AExtension%3ATranslate%2FPage_translation_administration&diff=8349012&oldid=8343860 replaced it with more straight-forward entity-escaping] to be more compatible with Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:54, 21 April 2026 (UTC) ::Also filed this as [[phab:T424066]] [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 16:46, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&oldid=67999951&useparsoid=1 nlwiki:Railterminal Gelderland] == The map in [[:nl:sjabloon:maplink]] doesn't show up in my Chrome browser for Chromebook. It does show in https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&useparsoid=0 and also when I log out. [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:54, 5 March 2026 (UTC) :Btw, the map is visible for a moment, then it disappears [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:56, 5 March 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%91%D7%A8%D7%90%D7%95%D7%9C_%D7%A1%D7%98%D7%90%D7%A8%D7%A1&oldid=42870396&useparsoid=1 hewiki:בראול סטארס] == למה הקישור לתמונה ששמתי לא עובד? בכל מקרה אשמח שמישהו ישים את התמונה העדכנית שמשומשת בדף באנגלית מאחר והלוגו למשחק שונה. מצטער על התקלה. [[User:Jhho48|Jhho48]] ([[User talk:Jhho48|talk]]) 16:43, 9 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Infokastis: Sulamistemperatuur 236,15 K (−37 °C) Miinusmärk peaks olema sidekriipsust pikem, kuid pikema kriipsu sisestamine põhjustab tõrketeate. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:05, 11 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Vabandust, lühike (st vale) kriips oli kuvatud siiski ainult lähteteksti režiimis; salvestatud tekstiga küljendis on kuvatud õige kriips. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:07, 11 March 2026 (UTC) == kowiki:sticky header is broken == [[:en:Template:Sticky header|Template:Sticky header]] is not working properly on kowiki. Please compare [//ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=0] with [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=1].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:34, 16 March 2026 (UTC) :It may have been because of an empty row before the table caption. I [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&diff=41501849&oldid=41501840 edited the page] to remove it. But, looks like another editor has removed the sticky header template call from above the table. If you can put it back, it will work. See my [[:ko:사용자:SSastry_(WMF)/Sandbox|sandbox]] page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 03:22, 17 March 2026 (UTC) == [https://ko.wikipedia.org/w/index.php?title=%ED%8B%80:%EA%B5%AD%EA%B8%B0%EB%82%98%EB%9D%BC&oldid=40992836&useparsoid=1 kowiki:틀:국기나라] == 변수를 덧붙였음에도 {{국기나라|독일|제국}}이 여전히 '독일'로 출력됩니다. [[User:Triican|Triican]] ([[User talk:Triican|talk]]) 05:04, 19 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Angus_T._Jones&oldid=1333447723&useparsoid=1 enwiki:Angus T. Jones] == The infobox photo is squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 17:11, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Ukraine&oldid=1343921679&useparsoid=1 enwiki:Ukraine] == All maps in the infobox are squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 18:36, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Sabia_que&oldid=54991313&useparsoid=1 ptwiki:Wikipédia:Sabia que] == O arquivo de discussão está 'bugando' visualmente. Está no meio de "Curiosidades em destaque" [[User:Heylenny|Heylenny]] ([[User talk:Heylenny|talk]]) 23:27, 19 March 2026 (UTC) :{{done}} Template adjusted on the page. [[User:Fúlvio|Fúlvio]] ([[User talk:Fúlvio|talk]]) 02:59, 22 March 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%AC%E0%A6%BF%E0%A6%AE%E0%A6%B2_%E0%A6%98%E0%A7%8B%E0%A6%B7_(%E0%A6%B6%E0%A6%BF%E0%A6%B6%E0%A7%81%E0%A6%B8%E0%A6%BE%E0%A6%B9%E0%A6%BF%E0%A6%A4%E0%A7%8D%E0%A6%AF%E0%A6%BF%E0%A6%95)&oldid=8851768&useparsoid=1 bnwiki:বিমল ঘোষ (শিশুসাহিত্যিক)] == আলোচনা পাতায় অন্য নিবন্ধের আলোচনা পাতা [[User:Ams riyad|Ams riyad]] ([[User talk:Ams riyad|talk]]) 01:28, 20 March 2026 (UTC) == [https://vi.wikipedia.org/w/index.php?title=Wikipedia:Th%E1%BA%A3o_lu%E1%BA%ADn&oldid=74869958&useparsoid=1 viwiki:Wikipedia:Thảo luận] == TOC is rendered inside the link bar, but it shouldn't be. [[User:NguoiDungKhongDinhDanh|<span class="skin-invert" style="color:black;font-family:Monotype Corsiva;font-size:110%;font-weight:normal;line-height:normal">NguoiDungKhongDinhDanh</span>]] 03:20, 20 March 2026 (UTC) :This was most likely [[phab:T421629|T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] and we believe this issue has been fixed. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:51, 24 April 2026 (UTC) == [[wikt:ru:омфал]] == For more than a day, there have been anomalies in the behavior of tables of contents (ToCs) in Russian Wiktionary. The issues differ based on the selected skin and affect only some pages. If the old Vector theme is used, the automatically generated ToC simply fails to appear on certain pages, despite the page having over three headers and the absence of magic words such as NOTOC. If the new Vector theme is used, the ToC on some pages is misplaced and not positioned where it should be by default. The problem is not present if the old parser is used. Purging the page's cache seems to fix the issue as well. ToC is displayed correctly in the preview-mode too. Some affected pages: * [[wikt:ru:омфал]] * [[wikt:ru:безграмотность]] * [[wikt:ru:હંમેશા]] * [[wikt:ru:ಯಾವಾಗಲೂ]] * [[wikt:ru:stadigvæk]] * [[wikt:ru:alligevel]] * [[wikt:ru:kanunay]] * [[wikt:ru:ሁሌ]] * [[wikt:ru:zawżdy]] * and maaany mooore... [[User:綿貫桜哉|綿貫桜哉]] ([[User talk:綿貫桜哉|talk]]) 08:11, 20 March 2026 (UTC) :This was [[phab:T421629|⚓ T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] but should be fixed now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:55, 24 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Louis_Nirenberg&oldid=15616502&useparsoid=1 rowiki:Louis Nirenberg] == The image seems to be the 250px thumbnail scaled up to what looks like 400px width. [[User:Andrei Stroe|Andrei Stroe]] ([[User talk:Andrei Stroe|talk]]) 10:16, 20 March 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Aide:Accueil&oldid=232433495&useparsoid=1 frwiki:Aide:Accueil] == custom collapsible elements render differently with parsoid [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 14:19, 20 March 2026 (UTC) :I filed https://phabricator.wikimedia.org/T421859. Thanks for the report. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:07, 31 March 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Katten_(olika_betydelser)&oldid=43770842&useparsoid=1 svwiki:Katten (olika betydelser)] == The legacy parser adds an empty line before the template Förgrening (which is a kind of table). The Parsoid parser don't do that. This occurs on all pages using that template. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 18:32, 21 March 2026 (UTC) :Ya, this is known difference with some paragraph wrapping which is tricky to fix. In this case, I recommend adjusting the top margin of the table by editing the base template: https://sv.wikipedia.org/w/index.php?title=Mall%3AF%C3%B6rgrening%20bas&veaction=editsource [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:01, 31 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Gen_Z_stare&oldid=1344701043&useparsoid=1 enwiki:Gen Z stare] == The infobox image is unusually narrow. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 01:51, 22 March 2026 (UTC) :For me the image is stretched horizontally by a fair bit. It seems like the following bit of code is to blame: :<syntaxhighlight lang="css"> :html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img {width: 400px; } :</syntaxhighlight> [[User:Sohom Datta|Sohom]] ([[User talk:Sohom Datta|talk]]) 01:54, 22 March 2026 (UTC) ::I'm not seeing any visible difference between legacy parser and Parsoid in my testing. Can you share a screenshot @[[User:Snowmanonahoe|Snowmanonahoe]] ? What skin and browser are you using? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 17:43, 27 March 2026 (UTC) :::@[[User:Jon (WMF)|Jon (WMF)]]: I don't see it anymore either. I'm using Vector 2022 and Firefox 149. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 17:46, 27 March 2026 (UTC) ::::Ah okay. I think this was a caching issue then. Some "temporary turbulence" was to be expected with this roll out. Thanks for reporting! [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 18:29, 27 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Virginia_Fonseca&oldid=71959182&useparsoid=1 ptwiki:Virginia Fonseca] == A 1ª imagem da página na infocaixa tem um tamanho grande demais [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 11:34, 22 March 2026 (UTC) :I don't see the problem. The page renders identically in Parsoid and with the old/legacy parser. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:22, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Xander_Harris&oldid=71958675&useparsoid=1 ptwiki:Xander Harris] == Seção de referências expandida [[User:Vitruviano|Vitruviano]] ([[User talk:Vitruviano|talk]]) 15:06, 22 March 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Bruker:Znuddel&oldid=25704667&useparsoid=1 nowiki:Bruker:Znuddel] == Hele siden er helt feil [[User:Nevemagneten|Nevemagneten]] ([[User talk:Nevemagneten|talk]]) 20:35, 24 March 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Main_page&oldid=2122&useparsoid=1 abstractwiki:Abstract Wikipedia:Main page] == Favicon is showing a dark background around the rounded corners on Chrome. [[User:Jsengupt|Jsengupt]] ([[User talk:Jsengupt|talk]]) 16:14, 25 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=System_(typeface)&oldid=1329545007&useparsoid=1 enwiki:System (typeface)] == Infobox image is stretched horizontally [[User:Anna328p|Anna328p]] ([[User talk:Anna328p|talk]]) 06:59, 26 March 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Enged%C3%A9lyk%C3%A9r%C3%A9s&oldid=28288240&useparsoid=1 huwiki:Wikipédia:Engedélykérés] == The email templates are rendered incorrectly. [[User:Bencemac|Bencemac]] ([[User talk:Bencemac|talk]]) 14:00, 26 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T421563 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:19, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Usu%C3%A1rio(a):Inter-rede/Cabe%C3%A7alho&oldid=71778331&useparsoid=1 ptwiki:Usuário(a):Inter-rede/Cabeçalho] == Whitespaces seem to have collapsed [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 18:02, 27 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422155 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:36, 2 April 2026 (UTC) ::It looks like the problem is the <code>display:flex</code> in the <code>style</code> attribute on the wrapper is at fault. Parsoid generates <code><nowiki><span></nowiki></code> wrappers around the html entities in the wikitext, by design. The whitespace is present in the HTML, so that's not a fault of Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:07, 9 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%91%D7%A6%D7%A2_%D7%9E%D7%A9%D7%94_(%D7%9E%D7%9C%D7%97%D7%9E%D7%AA_%D7%94%D7%A2%D7%A6%D7%9E%D7%90%D7%95%D7%AA)&oldid=42991233&useparsoid=1 hewiki:מבצע משה (מלחמת העצמאות)] == הכיתוב שנועד למנוע בלבול בין מבצע משה הזה למבצע משה אחר לא ערוך [[User:חנניה בלסמן|חנניה בלסמן]] ([[User talk:חנניה בלסמן|talk]]) 12:54, 30 March 2026 (UTC) == [//en.wikipedia.org/w/index.php?title=Help:Colon_trick&useparsoid=1 enwiki:Help:Colon trick] == According to [[w:Help:Colon trick]], it is explained as follows: "<code><nowiki>[[//Hus]]</nowiki></code> will produce an (invalid) external link wrapped in brackets ("[[//Hus]]"), but <code><nowiki>[[://Hus]]</nowiki></code> will produce a link to [[w://Hus|//Hus]]." However, when using Parsoid, it incorrectly links to [[w:Help:Colon trick//Hus|Help:Colon trick//Hus]].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:02, 31 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422161 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 14:00, 2 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Ans%C3%B6kan_om_administrativ_beh%C3%B6righet&oldid=59167563&useparsoid=1 svwiki:Wikipedia:Ansökan om administrativ behörighet] == In Legacy, each section (candidate) get a [redigera] ([edit] to the right of the section name. In Parsoid, there is nothing to the right of the section name. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 12:15, 2 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T391624 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:27, 2 April 2026 (UTC) == [https://en.wiktionary.org/w/index.php?title=H%26P&oldid=83856321&useparsoid=1 enwiktionary:H&P] == The first hidden category listed is [[wiktionary:Category:English_entries_with_incorrect_language_header|English entries with incorrect language header]]'','' which is, however, empty. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:48, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Jo%C3%A3o_Peixoto&oldid=72016744&useparsoid=1 ptwiki:João Peixoto] == A foto não corresponde ao nome citado [[User:Mayque Lemos|Mayque Lemos]] ([[User talk:Mayque Lemos|talk]]) 18:18, 2 April 2026 (UTC) == [https://meta.wikimedia.org/w/index.php?title=Main_Page&oldid=30254797&useparsoid=1 metawiki:Main Page] == On Parsoid only, <nowiki>''complete list'' and ''request''</nowiki> each show a space between them and their preceding opening bracket. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 19:06, 3 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&oldid=1343194045&useparsoid=1 enwiki:In Stars and Time] == <code>&lt;ref name="rps"&gt;</code> displays an error which doesn’t occur on the legacy parser [[User:Mir Novov|Mir Novov]] ([[User talk:Mir Novov|talk]]) 12:10, 4 April 2026 (UTC) :It was an error which I fixed with [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&diff=1348021667&oldid=1347424445 this edit] which adds one more backlink to Ref #5. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:00, 10 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Helen_Andrews&oldid=72024590&useparsoid=1 ptwiki:Helen Andrews] == Estou a ter problema com as referências, pois aparecem duplicadas. [[User:Faviola7|Faviola7]] ([[User talk:Faviola7|talk]]) 14:17, 4 April 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Project_chat&oldid=3236&useparsoid=1 abstractwiki:Abstract Wikipedia:Project chat] == In the "Bot request" section, a link that has been visited is blue rather than purple, because spaces in the link are turned into actual spaces (%20) in the URL. [[User:JJPMaster|JJP]]<sub>[[User talk:JJPMaster|Mas]]<sub>[[Special:Contributions/JJPMaster|ter]]</sub></sub> ([[wikt:she|she]]/[[wikt:they|they]]) 21:53, 4 April 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Tor_Fosse_(f%C3%B8dt_1956)&oldid=25723619&useparsoid=1 nowiki:Tor Fosse (født 1956)] == fil: center frameless [[User:Birgit.H.Pihl|Birgit.H.Pihl]] ([[User talk:Birgit.H.Pihl|talk]]) 10:05, 5 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Politisk_opposition&oldid=59171124&useparsoid=1 svwiki:Politisk opposition] == This error message about unused named reference is not shown: Referensfel: <ref>-tagg med namn "sr-20161006", definierad i <references> används inte tidigare i texten. The article is also added to hidden category "Sidor med referensfel" but that is not shown [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:12, 5 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Puteulum/Sandbox&oldid=150100596&useparsoid=1 itwiki:Utente:Puteulum/Sandbox] == The "Move" button to move the entry from sandbox to NS0 does not appear [[User:Puteulum|Puteulum]] ([[User talk:Puteulum|talk]]) 14:28, 7 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=POVOADO_TIRIRICAL&oldid=72040530&useparsoid=1 ptwiki:POVOADO TIRIRICAL] == O MEU TEXTO ESTA TODO VERMELHO E MAIS CENTRALIZADO [[User:POVOADO TIRIRICAL|POVOADO TIRIRICAL]] ([[User talk:POVOADO TIRIRICAL|talk]]) 18:38, 7 April 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%B1%E4%BA%AC%E9%83%BD%E9%81%935%E5%8F%B7%E6%96%B0%E5%AE%BF%E9%9D%92%E6%A2%85%E7%B7%9A&oldid=108985336&useparsoid=1 jawiki:東京都道5号新宿青梅線] == ヘッダー付近に編集ミスと思われし文言あり [[User:QWERTYKeyboard0570|QWERTYKeyboard0570]] ([[User talk:QWERTYKeyboard0570|talk]]) 08:56, 8 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=2022_Oder_environmental_disaster&oldid=1344570432&useparsoid=1 enwiki:2022 Oder environmental disaster] == After a second, the actual map from the infobox (not the buttons) is replaced with a placeholder icon and text (clicking in the field still works). [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 11:56, 8 April 2026 (UTC) :Could it have been a transient issue? I cannot reproduce this right now. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:03, 10 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Commissione_arbitrale/Domande&oldid=150049601&useparsoid=1 itwiki:Wikipedia:Commissione arbitrale/Domande] == This page is related to the itwiki ArbCom election. Section edit links were not shown, making it difficult to ask questions to candidates. This has since been worked around with [[:it:special:diff/150118322|this edit]] and is likely related to [[phab:T387520|T387520]]. [[User:Titore|Titore]] ([[User talk:Titore|talk]]) 19:58, 8 April 2026 (UTC) :Thanks for this report. This is on our list of high priority tasks to fix and we are going to pick up shortly. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:53, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Kurier&oldid=266019405&useparsoid=1 dewiki:Wikipedia:Kurier] == das Diagramm zum Beitrag "Ein Wal ..." überragt den Text der rechten Spalte. [[User:Michael w|Michael w]] ([[User talk:Michael w|talk]]) 08:10, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034&useparsoid=1 dewiki:Wikipedia:Fragen zur Wikipedia] == <nowiki>& s h y ;</nowiki> is ignored. See the test on https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034#&_s_h_y_; [[User:Raymond|Raymond]] ([[User talk:Raymond|talk]]) 09:55, 10 April 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422960 for this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:55, 10 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Faktafr%C3%A5gor&oldid=59190040&useparsoid=1 svwiki:Wikipedia:Faktafrågor] == Svara-funktionen fungerar inte med Parsoid. När jag klickar på Svara för något inlägg, vilket som helst, dyker svarsrutan upp längst ner på sidan, efter den senaste diskussionstråden. Med den äldre parsern fungerar det. [[User:Larske|Larske]] ([[User talk:Larske|talk]]) 11:12, 10 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Cornelis_de_Bruijn_Martinuszoon&oldid=70921577&useparsoid=1 nlwiki:Cornelis de Bruijn Martinuszoon] == De pagina-afbeelding is de handtekening van C. de Bruijn Mz. Ik denk dat zijn afbeelding in de spotprent een betere pagina-afbeelding is. Het zou kunnen dat Parsoid/Wikipedia deze niet 'pakt' omdat de dimensies tijdens een eerdere bewerking zijn aangepast. Alvast bedankt! [[User:Jelledebruijn|Jelledebruijn]] ([[User talk:Jelledebruijn|talk]]) 16:31, 10 April 2026 (UTC) :I think you might have seen a version of the page before the cache was updated. I just checked and the image is identical with Parsoid and the older parse. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:46, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=The_Punisher_(2004)&oldid=263259949&useparsoid=1 dewiki:The Punisher (2004)] == Dead link template Vorlage:Toter Link (https://de.wikipedia.org/wiki/Vorlage:Toter_Link) after url is no longer working but gets part of the Link. (example https://de.wikipedia.org/wiki/The_Punisher_(2004)#cite_note-5 ) [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:23, 10 April 2026 (UTC) :Example without Parsoid: https://de.wikipedia.org/wiki/The_Punisher_(2004)?useparsoid=0#cite_note-5 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:57, 10 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T368724 but ideally, the template will be added with a space after the link. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:24, 11 April 2026 (UTC) ::Unfortunately it's added by the InternetArchiveBot that way: https://de.wikipedia.org/w/index.php?title=Liste_aktiver_Brauereien_in_Deutschland&diff=prev&oldid=265857281 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 06:45, 11 April 2026 (UTC) :::@[[User:SSastry (WMF)|SSastry (WMF)]]: But it is not good if the preview shows us a different result than the version that is subsequently published. InternetArchiveBot inserts it without spaces. The task is prioritized as Low, but since we have this thousands of times in the article inventory (and it used to work before), the task should be reprioritized to Higher. And the preview should always show the same result that I get after publishing. What do we do with the Phab task now? How do we handle this bug? Thank you, [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 09:12, 11 April 2026 (UTC) ::::We will fix the preview path separately. But, for this specifically, I'll flag this for the team to see how we want to handle this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:33, 11 April 2026 (UTC) :::::@[[User:SSastry (WMF)|SSastry (WMF)]]: Oh thank you, keep us up to date here please. [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 16:35, 11 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Marlon_Ganchozo&oldid=172919968&useparsoid=1 eswiki:Marlon Ganchozo] == No sale el resto de la información del, jugador [[User:Didierlpz06|Didierlpz06]] ([[User talk:Didierlpz06|talk]]) 19:04, 10 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 eswiki:Temporada regular de la Euroliga 2025-26] == no se sustituyen correctamente las ultimas plantillas [[User:Hugogs02|Hugogs02]] ([[User talk:Hugogs02|talk]]) 08:42, 11 April 2026 (UTC) :This page is too large post-template expansion. Observe that the templates at the end are not expanded neither in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 Parsoid] nor in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=0 Legacy]; the legacy parser just happens to expand a few more at the end of the page due to [https://phabricator.wikimedia.org/T392262 T392262]. The page should probably be split. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:13, 13 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Uniforme_de_la_selecci%C3%B3n_de_f%C3%BAtbol_de_Argentina&oldid=172883243&useparsoid=1 eswiki:Uniforme de la selección de fútbol de Argentina] == En la plantilla de uniforme de fútbol algunos uniformes se ven con las mangas más bajas respecto al archivo del cuerpo, dejando lineas de un pixel por encima con los colores de fondo en dicha plantilla. [[User:Lobo kun mfc|Lobo kun mfc]] ([[User talk:Lobo kun mfc|talk]]) 13:58, 11 April 2026 (UTC) :The lines displayed on top of the uniforms are present both in Parsoid and in the Legacy parser, and they do seem to vary slightly depending on the browser (I've looked on Firefox and Chrome, both on Linux, and they were not consistent between both browsers). :I believe this issue should be fixed on the template side (at a guess, the <code>style="color: inherit; background-color:#000040;"</code> that I see on the various image divs may well show up depending on the exact HTML structure and/or image) [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:23, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Liste_der_Radschnellverbindungen_in_Deutschland&oldid=266034807&useparsoid=1 dewiki:Liste der Radschnellverbindungen in Deutschland] == Hallo, beim Artikel [[Liste der Radschnellverbindungen in Deutschland]] wird die Beschreibung der MapLink-Karte wird nicht gescheid gerendert. Statt einem hochgestellten <code>[7]</code> wird <code>Karte der bestehenden Radschnellwege in Deutschland'"`UNIQ--ref-00000008-QINU`"'</code> gerendert. Das Problem ist serverseitig und tritt beim Legacy-Parser nicht auf. LG [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 16:02, 11 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T383004 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:06, 11 April 2026 (UTC) ::thanks! [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 14:13, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Louis_Franchet_d%E2%80%99Esp%C3%A8rey&oldid=266076416&useparsoid=1 dewiki:Louis Franchet d’Espèrey] == Bildumfluss nicht wie üblich [[User:Alfred Kiefer|Alfred Kiefer]] ([[User talk:Alfred Kiefer|talk]]) 19:30, 11 April 2026 (UTC) :This issue has been fixed in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1269534 and should be deployed to production this week. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:34, 13 April 2026 (UTC) == [https://bn.wiktionary.org/w/index.php?title=%E0%A6%AA%E0%A7%8D%E0%A6%B0%E0%A6%A7%E0%A6%BE%E0%A6%A8_%E0%A6%AA%E0%A6%BE%E0%A6%A4%E0%A6%BE&oldid=250894&useparsoid=1 bnwiktionary:প্রধান পাতা] == The ‘ শব্দছবি’ section is overflowing with Parsoid; thus does not happen when the legacy parser is used. [[User:Redmin|Redmin]] ([[User talk:Redmin|talk]]) 08:09, 12 April 2026 (UTC) :Since the section seems to be randomized, it's pretty hard to see which version of this section is overflowing (the ones I see do not seem to). Would you be able to provide more information/a screenshot? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:49, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Hamburg&oldid=266087257&useparsoid=1 dewiki:Wikipedia:Hamburg] == Abschnittsbearbeitungen nicht mehr möglich, Link fehlt. Betrifft einige WP-Seiten wie auch [[:de:Wikipedia:Stammtisch München]] oder auch nur einige Überschriften von [[:de:Vorlage:Coordinate]], also nicht immer komplette Seiten. [[User:NordNordWest|NordNordWest]] ([[User talk:NordNordWest|talk]]) 12:12, 12 April 2026 (UTC) :We have a number of issues with section edit links (documented in https://phabricator.wikimedia.org/T391624) that we intend to fix; sorry for the inconvenience - we'll make sure to keep this use case in mind when working on a solution. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:20, 23 April 2026 (UTC) == [https://zh.wikipedia.org/w/index.php?title=COBOL&oldid=91149855&useparsoid=1 zhwiki:COBOL] == 正文开头的“COBOL”英文名无法显示,且全文的繁简转换失效。 The English name "COBOL" for COBOL at the very beginning vanished. Besides, the conversion between traditional and simplified Chinese does not function for the entire page. [[User:Ricky136973|Ricky136973]] ([[User talk:Ricky136973|talk]]) 13:08, 12 April 2026 (UTC) :Parsoid should not (yet) be enabled on zhwiki. If you want to preview how it will work, you can add <code>&parsoidnewlc=1</code> to the end of the URL to use Parsoid's implementation of LanguageConverter. That shows "COBOL" on this page as expected. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:17, 13 April 2026 (UTC) ::Parsoid is now experimentally enabled, so you don't need the `&parsoidnewlc=1` at the end of the URL any more. It appears that the COBOL page renders correctly now? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:40, 21 April 2026 (UTC) == [https://th.wikipedia.org/w/index.php?title=4_%E0%B9%80%E0%B8%97%E0%B8%9E%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B8%9E%E0%B8%B4%E0%B8%97%E0%B8%B1%E0%B8%81%E0%B8%A9%E0%B9%8C&oldid=12947833&useparsoid=1 thwiki:4 เทพผู้พิทักษ์] == อันนี้น่าจะผิดที่ร้องเพลงประกอบละคร [[User:ภรพัฒน์|ภรพัฒน์]] ([[User talk:ภรพัฒน์|talk]]) 12:47, 13 April 2026 (UTC) :Google translate says, "This is probably a mistake—singing the theme song for a TV drama." :This seems like a content issue, not a Parsoid issue. Mistakes in content should be correctly directly on the wiki. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:47, 21 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:%D7%A9%D7%A8%D7%A9%D7%97%D7%95%D7%9F/%D7%98%D7%99%D7%95%D7%98%D7%94&oldid=42822143&useparsoid=1 hewiki:משתמש:שרשחון/טיוטה] == אני רוצה לבטל את המצאות השם יעל סרלין בדף הטיוטות שלי כדי להתחיל ערך חדש [[User:שרשחון|שרשחון]] ([[User talk:שרשחון|talk]]) 12:59, 13 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Acidente_radiol%C3%B3gico_de_Goi%C3%A2nia&oldid=72061996&useparsoid=1 ptwiki:Acidente radiológico de Goiânia] == [[File:Captura_de_tela_de_miniaturas_renderizadas_pelo_Parsoid.png|thumb|250x250px]] As miniaturas estão minúsculas com as margens enormes. [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 15:13, 13 April 2026 (UTC) :It seems to be like this due to :<pre>html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img[width="250"] { width: calc(round(400px * var(--mw-file-upright,1),10px)) }</pre> [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 17:48, 19 April 2026 (UTC) ::{{Tracked|T423676}} [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) ::This should have been fixed by a backport we did yesterday. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:48, 21 April 2026 (UTC) == [https://hr.wikipedia.org/w/index.php?title=Marijana_Bijeli%C4%87&oldid=7429126&useparsoid=1 hrwiki:Marijana Bijelić] == Sve je podvuceno a ne treba tako biti [[User:Nikolica1512|Nikolica1512]] ([[User talk:Nikolica1512|talk]]) 17:08, 13 April 2026 (UTC) :I made some edits for you [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 18:32, 13 April 2026 (UTC) ::Thank you, I ameliorated those problematic parts, could you take a look at it? I hope it is good to go now as an article on wikipedia so people could access it. This person deserves to have a wiki page. ::Regards, [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 21:53, 13 April 2026 (UTC) :::Sorry, no. I was only helping with the syntax error. You'll need to take your request to the hrwiki community [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 22:25, 13 April 2026 (UTC) ::::And how do I do that exactly? Could you help me out with it? [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 22:56, 13 April 2026 (UTC) :::::You can ask on [[:hr:Wikipedija:Kafić]] and I'm sure someone there will help you out [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 00:34, 14 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 dewiki:Hilfe:Parserfunktionen] == Headings which use <code><nowiki><includeonly></nowiki></code> to change nesting level when transcluded don't appear as headings on original page [[User:TheFirstLevelDown|TheFirstLevelDown]] ([[User talk:TheFirstLevelDown|talk]]) 00:01, 14 April 2026 (UTC) :Parsoid does not support gluing heading together like the legacy parser did, so this syntax is not supported. :As an alternative, we suggest something like (to adjust depending on your exact use case) :<syntaxhighlight lang="wikitext"> <includeonly>===== title =====</includeonly> <noinclude>=== title ===</noinclude> </syntaxhighlight> :or, for a less robust version (but that doesn't require repeating the title) :<syntaxhighlight lang="wikitext"> <includeonly>=====</includeonly><noinclude>===</noinclude> title <includeonly>=====</includeonly><noinclude>===</noinclude> </syntaxhighlight> [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 12:45, 14 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Amor_eterno_una_tragedia_anunciada&oldid=172974810&useparsoid=1 eswiki:Amor eterno una tragedia anunciada] == el título de la página está como "Amor eterno una tragedia anunciada" y no deja cambiarlo al original que es "Amor Eterno: Una tragedia anunciada" [[User:Goodfriendspictures|Goodfriendspictures]] ([[User talk:Goodfriendspictures|talk]]) 09:59, 14 April 2026 (UTC) :To me it looks like the [[DISPLAYTITLE]] magic word is disabled though {{wg|AllowDisplayTitle}} in eswiki. Nothing to do with Parsoid. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 10:12, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:TanjaKo/Sandbox&oldid=150217478&useparsoid=1 itwiki:Utente:TanjaKo/Sandbox] == Nel testo non sono presenti errori e le frasi sono sottolineate con una linea rossa ondulata. Come risolverlo visual bug? Grazie [[User:TanjaKo|TanjaKo]] ([[User talk:TanjaKo|talk]]) 17:42, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Raduni/Raduni_in_Sicilia_2026&oldid=150224594&useparsoid=1 itwiki:Wikipedia:Raduni/Raduni in Sicilia 2026] == just on iPhone 14 with iOS 18.7.7 both from safari or chrome and both from logged or unlogged and incognito mode, the last number of the participants list (made with "#") is bigger than the others [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 18:31, 15 April 2026 (UTC) == [https://atj.wikipedia.org/w/index.php?title=Otitikowin&oldid=16878&useparsoid=1 atjwiki:Otitikowin] == pas moyen de travailler en mode visuel sur la page [[User:Luc Patin|Luc Patin]] ([[User talk:Luc Patin|talk]]) 14:56, 16 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Zhang_Zeduan&oldid=173032341&useparsoid=1 eswiki:Zhang Zeduan] == La pagina está incompleta e inpublicable [[User:Mikemj1987|Mikemj1987]] ([[User talk:Mikemj1987|talk]]) 22:08, 17 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:08, 20 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=L%C3%ADnea_E3_(Euskotren_Trena)&oldid=173034070&useparsoid=1 eswiki:Línea E3 (Euskotren Trena)] == La imagen se ve un poco mal por el modo oscuro. [[User:UnniMan|UnniMan]] ([[User talk:UnniMan|talk]]) 00:55, 18 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:09, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Stadtbahn_Karlsruhe&oldid=265878452&useparsoid=1 dewiki:Stadtbahn Karlsruhe] == Shows reference error and the categoy Kategorie:Wikipedia:Seite mit Einzelnachweisfehlern but is not included in https://de.wikipedia.org/wiki/Kategorie:Wikipedia:Seite_mit_Einzelnachweisfehlern The same happens with other articles that had no reference errors with the old parser. Makes maintenance hard. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 09:26, 19 April 2026 (UTC) :Tracked in https://phabricator.wikimedia.org/T423924 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Indiana_Jones_and_the_Fate_of_Atlantis&oldid=265815741&useparsoid=1 dewiki:Indiana Jones and the Fate of Atlantis] == Shows a reference error that is not visible in the preview function. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:06, 19 April 2026 (UTC) :The error came through a Reference with the same name in a used template https://de.wikipedia.org/wiki/Vorlage:Verkaufszahlen_LucasArts_Adventures Still bad to have an error that wasn't there with the old parser and isn't shown in the preview or maintenance category. --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:27, 19 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Evento_Azolla&oldid=72103944&useparsoid=1 ptwiki:Evento Azolla] == [Convert: número inválido] na parte de Efeitos Globais [[User:Marina Funez|Marina Funez]] ([[User talk:Marina Funez|talk]]) 00:28, 20 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:10, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Musikk%C3%A1r&oldid=144140&useparsoid=1 smnwiki:Myenster:Musikkár] == Instead of dealing with this issue and the other issue on smnwiki listed below, these were quietly archived. These are still displaying messed up months later after they were reported the first time. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:53, 20 April 2026 (UTC) :We may have missed this previously, but edits like [https://smn.wikipedia.org/w/index.php?title=Myenster%3AMusikk%C3%A1r&diff=152826&oldid=144359 this] should fix the rendering. This should work for the other pages below as well. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 12:42, 20 April 2026 (UTC) ::Thank you. I'll do the same for any other templates I come across that display like that one did. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 15:49, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Diskografia&oldid=62663&useparsoid=1 smnwiki:Myenster:Diskografia] == Instead of dealing with this issue and the other issue on smnwiki listed above, these were quietly archived. These are still displaying messed up months later after they were reported the first time. -[[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Kirje%C4%8D%C3%A4llee&oldid=32928&useparsoid=1 smnwiki:Myenster:Kirječällee] == Like the other display issues in smnwiki, this is also displaying messed up after the change. [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. For all other pages you encounter on wiki like this, please make similar edits. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Donald_A._Wollheim&oldid=266357315&useparsoid=1 dewiki:Donald A. Wollheim] == Picture is shown within a big white box, which isn't the case with the old parser. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 11:15, 20 April 2026 (UTC) :[[phab:T421524]] [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe_Diskussion:Bilder&oldid=266370955&useparsoid=1 dewiki:Hilfe Diskussion:Bilder] == see [[w:de:Hilfe Diskussion:Bilder #Skalierung von Bildern mit dem Parameter hochkant scheint nicht mehr zu funktionieren]] [[User:BurghardRichter|BurghardRichter]] ([[User talk:BurghardRichter|talk]]) 22:24, 20 April 2026 (UTC) == [https://tcy.wikipedia.org/w/index.php?title=%E0%B2%AE%E0%B3%81%E0%B2%96%E0%B3%8D%E0%B2%AF_%E0%B2%AA%E0%B3%81%E0%B2%9F&oldid=359337&useparsoid=1 tcywiki:ಮುಖ್ಯ ಪುಟ] == in main page not enable <code>html.skin-theme-clientpref-night</code> [[User:ChiK|ChiK]] ([[User talk:ChiK|talk]]) 05:47, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:23, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == https://de.wikipedia.org/wiki/Gemeindestandsver%C3%A4nderungen_in_der_Schweiz == Die Links zu den Ankern gehen nicht [[Special:Contributions/&#126;2026-24437-27|&#126;2026-24437-27]] ([[User talk:&#126;2026-24437-27|talk]]) 11:53, 21 April 2026 (UTC) :I see you found a solution :) :For the exact issue: generating ids independently from their enclosing tag is not supported by Parsoid (although this is not documented - I'll fix that). :Thanks for the report! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:16, 21 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Albosaggia&oldid=50063504&useparsoid=1 svwiki:Albosaggia] == This article, and thousands of other articles, have erroneously been put in hidden categories [[:sv:Kategori:Sidor med referensfel]] and [[:sv:Kategori:Wikipedia:Projekt översätta källmallar]]. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 12:24, 21 April 2026 (UTC) :You can mark this issue as fixed. The problem root cause was in a new Template and Module created this morning. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:40, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Eurovision_Song_Contest_1992&oldid=258716277&useparsoid=1 dewiki:Eurovision Song Contest 1992] == Quelltext bearbeiten ist für Abschnitte nicht sichtbar [[User:Anmey10112|Anmey10112]] ([[User talk:Anmey10112|talk]]) 13:00, 21 April 2026 (UTC) :Translation: "Edit source" is not visible for sections. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Boro%C8%99e%C8%99ti,_Ia%C8%99i&oldid=17665231&useparsoid=1 rowiki:Boroșești, Iași] == Satul este Borosești nu Boroșești. [[User:Stalmada|Stalmada]] ([[User talk:Stalmada|talk]]) 13:07, 21 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:09, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Gebouwge%C3%AFntegreerde_zonnepanelen_(BIPV)&oldid=71021732&useparsoid=1 nlwiki:Gebouwgeïntegreerde zonnepanelen (BIPV)] == Bij de afbeeldingen zijn 3 afbeeldingen gecombineerd met de sjabloon {{Afbeelding combi}} . De sjabloon maakt gebruikt van elk aparte tekstvelden voor elke afbeeldingen. Echter is in dit geval bij de eerste twee afbeeldingen geen gebruik gemaakt van tekstveld en is al de tekst aan het eind geplaatst bij de laatste afbeelding. Door dit gebruik van de sjabloon worden de afbeeldingen zonder spatie direct na elkaar vertoont. Op de mobiele website worden de afbeeldingen met dit sjabloon wel met spaties vertoont. Merk op dat de engelse template wel de mogelijkheid heeft om afbeeldingen gecombineerd te laten zien met spaties er tussen en heeft deze variant template meer mogelijkheden dan de NL versie. Mogelijk dat er de uitwerkin ook niet helemaal correct is geweest, maar hierover is niet te oordelen vanwege de beperkte Wiki edit kennis. [[User:Public-Publicity|Public-Publicity]] ([[User talk:Public-Publicity|talk]]) 16:16, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:22, 21 April 2026 (UTC) :Translation: "In this section, three images have been combined using the template `Template:Afbeelding combi`. This template typically utilizes a separate text field for each individual image; however, in this specific instance, the text fields for the first two images were left unused, and all the accompanying text was instead placed at the end, alongside the final image. As a result of this specific application of the template, the images are displayed consecutively without any spacing between them. On the mobile version of the website, however, images utilizing this template *are* displayed with spacing. It is worth noting that the English-language version of this template *does* offer the capability to display combined images with spacing in between—making that variant of the template more versatile than its Dutch counterpart. It is possible that the implementation itself was not entirely correct; however, it is difficult to pass judgment on this matter due to limited expertise in Wiki editing." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:12, 23 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Talk:Rao_Laxmi_Chand&oldid=10828084&useparsoid=1 simplewiki:Talk:Rao Laxmi Chand] == This Page is fake and all the information is fake [[User:Rao Gourav|Rao Gourav]] ([[User talk:Rao Gourav|talk]]) 17:23, 21 April 2026 (UTC) :Triage: Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:28, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:07, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80%D0%BE%D0%B2%D1%81%D0%BA%D0%B8%D0%B9,_%D0%A1%D1%82%D0%B5%D0%BF%D0%B0%D0%BD_%D0%A4%D1%91%D0%B4%D0%BE%D1%80%D0%BE%D0%B2%D0%B8%D1%87&oldid=152793914&useparsoid=1 ruwiki:Александровский, Степан Фёдорович] == дублируется реф в инфобоксе [[User:Gleb95|Gleb95]] ([[User talk:Gleb95|talk]]) 20:21, 21 April 2026 (UTC) :Translation: "The reference is duplicated in the infobox." :The legacy parser version has 19 references in the references list, and Parsoid contains 22. This is likely a content issue, although I haven't looked into it to determine root cause. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:11, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is plenty of problems I see related to transliteration to Serbian Cyrillic. I prefer reading articles in Serbian Cyrillic (on top of our UI, I select "Ћирилица"). In current state, Parsoid should not be turned on at all on our Wikipedia {{multiple image | align = center | total_width = 1000 | image1 = Jefri Saks (no Parsoid).png | caption1 = Without Parsoid | image2 = Jefri Saks (Parsoid).png | caption2 = With Parsoid }} Note that, with Parsoid, everything is transliterated, even when marked with correct <nowiki><lang></nowiki> attribute. Without parsoid, original English text is correctly left un-transliterated. There is also a glitch where URL is not rendered in infoboxes, again, probably something about misrendering text which was supposed to avoid transliteration. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:43, 21 April 2026 (UTC) :This is [[phab:T424159|T424159 [P0] Parsoid doesn't "guessVariant" at top level on Serbian Wikipedia, and makes sr-ec rendering "unusable" for some pages]]. Fundamentally, the mark up on that page is incorrect, in so far as English and Latin text aren't properly marked with `-{....}-`. It "worked before" because of a top-level "guessVariant" routine which effectively disabled language converter entirely on some pages, including this one. I suspect I'm going to have to implement the same 'guessVariant' mechanism in Parsoid, since there appears to be too much content of this type without proper language markers. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:04, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is no "Edit with migration tool" entry in tools on Serbian Wikipedia. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:50, 21 April 2026 (UTC) :It needs to be enabled explicitly in Preferences > Editing > Developer tools > Enable parser migration tool. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:44, 23 April 2026 (UTC) == includeonly in headline syntax == no longer resolved properly == ''Example:'' [[w:de:Hilfe:Parserfunktionen]] This page (and many others of our help pages) are made for dual use: # stand alone # transclusion of several help pages of similar topic into a combined complete story. They contain headlines like <syntaxhighlight lang="wikitext"> <includeonly>=</includeonly>== Allgemeines ==<includeonly>=</includeonly> </syntaxhighlight> If stand alone, this shall be displayed as H2. * When combined, the page title will be shown as H2 and the section as H3. Swift solution most welcome – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:23, 22 April 2026 (UTC) : BTW – transclusion works correctly: [[w:de:Hilfe:Parserfunktionen/*]] --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:27, 22 April 2026 (UTC) :https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 has our suggested solution (the first form preferably). It works in transclusion mode because the preprocessor is involved. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:53, 22 April 2026 (UTC) ::“has our suggested solution (the first form preferably). It works” ::I do not understand what is “our suggested solution” – please look at this current page. It has neither TOC nor any headline, since the == are displayed within the text, using the default parsing. There are 10 headlines. ::Astonished – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 21:45, 22 April 2026 (UTC) :::Oops .. sorry! I pasted the wrong link! I meant to point you to [[#dewiki:Hilfe:Parserfunktionen|this section]] on this page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 00:09, 23 April 2026 (UTC) You’re imposing some work on us. * I am happy that there are [https://de.wikipedia.org/w/index.php?search=H:+insource:includeonly+insource:%2Fincludeonly%5C%3E%3D%2B%5C%3C%5C%2Fincludeonly%2F&title=Spezial:Suche 12 pages only] to be updated now. * Fortunately, some other syntax has been used in [[w:de:H:VE/*]] – [[w:de:H:Lua/*]] – [[w:de:H:Tabellen/*]] – [[w:de:H:FAQ/Übersicht]] which are merging a huge pile of single pages. I do hope this exception will be described in WikiSyntax Documentation soon. --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 11:04, 23 April 2026 (UTC) :Thanks for your understanding and fixing the pages. Given all the work we've done to deploy to a wiki, at this point, we expect that all remaining rendering issues are likely going to be edge cases that affect small number of pages. We'll update the docs soon, yes. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:22, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%9F%D1%80%D0%B5%D0%B4%D1%83%D0%BF%D1%80%D0%B5%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5&oldid=116093745&useparsoid=1 ruwiki:Шаблон:Предупреждение] == [[:ru:Шаблон:Tpre]] ([[:ru:Модуль:Template call code]]) stops working entirely in Parsoid mode. See also local discussion: [[:ru:Википедия:Форум/Технический#c-Tarkoff-20260422084300-Шаблон:Предупреждение]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 16:40, 22 April 2026 (UTC) :That doesn't look good. Do you have a sense of how many pages are impacted? We will take a look tomorrow and see what is going on and if we can roll out a quick fix. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:07, 22 April 2026 (UTC) ::I see what is going on. This is [[phab:T353697|T353697]] which was resolved with https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/992274. The fix is to have the modules emit <code>format="wikitext"</code> so the <nowiki><span> tags aren't escaped as literal output. Can you see if that fixes it?</nowiki> [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:22, 22 April 2026 (UTC) ::: Yes, thank you. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:47, 22 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Rei_Ami&oldid=266367300&useparsoid=1 dewiki:Rei Ami] == The image of Ami on the top right corner should be rendered with a width of 250px but seems to be scaled down to round about 160px. When using the Legacy Parser the image is rendered as expected. The issue seems to effect only some images. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 18:59, 22 April 2026 (UTC) :@[[User:Jon (WMF)|Jon (WMF)]] says, "The original size of the image is 315x427. This is https://phabricator.wikimedia.org/T421524 - only way to fix it is for Parsoid to mark the img up with a class when the image original size is smaller than 400px. Otherwise it's working as expected." I'm not entirely sure I agree with this diagnosis, since T421524 would cause the image to appear "too large" not "too small". :@[[User:Guardian of Arcadia|Guardian of Arcadia]] what is your user thumbnail size preference, and what skin are you using? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:13, 23 April 2026 (UTC) ::@[[User:Cscott|Cscott]]: I'm using the default thumbnail size of 250px and Vector 2010 (Legacy) as skin. But the size issue also occurs when using other skins like Vector 2022, which can be seen by appending <code>useskin=vector-2022</code> to the URL or viewing the page in an incognito window. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 20:37, 23 April 2026 (UTC) :::What browser and version are you using @[[User:Guardian of Arcadia|Guardian of Arcadia]] ? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 21:46, 23 April 2026 (UTC) ::::Also can you check you don't have a different preference set in [[Special:GlobalPreferences]] and possibly try changing it and changing it back? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:55, 23 April 2026 (UTC) ::::@[[User:Jon (WMF)|Jon (WMF)]]: The issue isn't limited to my account only; it occurs in a logged-out state (within an incognito window) too. But your guess about the browser seems to be right: I have the described issue when using Firefox with the ESR version 115.35.0esr. Today I have tested with another browser (Chrome and Edge) as well as on a PC with a current (non-ESR) Firefox and there the image is shown as expected. So, is this a bug in this specific Firefox version? [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 19:47, 24 April 2026 (UTC) :::::Yes. This sounds like a bug in that specific Firefox version. If you can give me more details about the operating system version you are using I can see if I can replicate in browserstack.com . Is it possible there are any browser extensions installed on that browser? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 22:31, 24 April 2026 (UTC) ::::::The operating system on this PC is Windows 8.1 (Build 9600) and I do not have any browser extensions installed there. Hope this helps to reproduce the issue. If you need anything else please let me know. Thanks for your help. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 22:44, 24 April 2026 (UTC) :::::::That was incredibly useful information, thank you. I understand what is happening now, and there might be something we can do here. Note, this browser is on the cusp of our usual browser support levels, which is what's causing the problem. [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 16:54, 27 April 2026 (UTC) ::::::::That's great news. I would be verry happy if you or your team can fix it. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 17:00, 27 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Alexandru_Dobrogeanu-Gherea&oldid=17669378&useparsoid=1 rowiki:Alexandru Dobrogeanu-Gherea] == imaginea prea mare, la fel la multe articole cu infocaseta om politic, de pilda Vasile Luca, Luminita Odobescu etc face contrast cu imagini in alte infocasete unde problema se poate regla [[User:Ewan2|Ewan2]] ([[User talk:Ewan2|talk]]) 01:25, 23 April 2026 (UTC) :Google translate: "the image is too large, the same as in many articles with the politician infobox, for example Vasile Luca, Luminita Odobescu, etc. it contrasts with images in other infoboxes where the problem can be adjusted." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 18:50, 23 April 2026 (UTC) ::@[[User:Jon (WMF)|Jon (WMF)]] says "For Romanian Wikipedia, there was a problem with the infobox styles. Pretty sure it's been fixed since. It could just be that he's seeing 400px instead of 300px. The infobox image looks identical to me in Parsoid and legacy." ::@[[User:Ewan2|Ewan2]] are you using the default thumbnail size (250px) or a larger size in your user preferences? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:07, 23 April 2026 (UTC) == [https://zu.wikipedia.org/w/index.php?title=Gashamo_Hawd_Somali_Ethiopia&oldid=122552&useparsoid=1 zuwiki:Gashamo Hawd Somali Ethiopia] == Is the city of Hawd Zone [[User:Maaaaskaas11|Maaaaskaas11]] ([[User talk:Maaaaskaas11|talk]]) 21:58, 23 April 2026 (UTC) == [https://ru.wikipedia.org/wiki/Текумсе ruwiki:Текумсе] == For some reason, the comment "До эскиза Лоссинга не было известно..." is repeated twice (see subsection "Комментарии" at the end of the article). This comment is generated by template "ref+" placed inside the template "персона" (an analogue of "Template:Infobox person"), and it is supposed to appear only once. Thanks! [[User:Adavyd|Adavyd]] ([[User talk:Adavyd|talk]]) 22:04, 23 April 2026 (UTC) :This is probably {{phab|T415789}}, which would be solved by adding a name to the reference, but then we end up running into {{phab|T423924}} - the template ends up defining the reference twice with subtly different content (as far as Parsoid is concerned) and the same name, which triggers an error. The fix will probably be to add a name to the reference once {{phab|T423924}} is handled. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:43, 24 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=FIDO2&oldid=264704558&useparsoid=1 dewiki:FIDO2] == Erste Grafik überlagert den Text und die Werkzeugleiste links [[User:Hinnerk11|Hinnerk11]] ([[User talk:Hinnerk11|talk]]) 23:51, 23 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Amanda_Kathrine_Smith/Sandbox&oldid=150348388&useparsoid=1 itwiki:Utente:Amanda Kathrine Smith/Sandbox] == i don't see the "MOVE DRAFT" button. [[User:Amanda Kathrine Smith|Amanda Kathrine Smith]] ([[User talk:Amanda Kathrine Smith|talk]]) 14:14, 24 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:36, 28 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%A1%D1%80%D0%B1%D0%B8%D1%98%D0%B0_(1071%E2%80%941217)&oldid=30892614&useparsoid=1 srwiki:Србија (1071—1217)] == Text inside {{lang-la.. and other {{lang-... templates is not displayed at all. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:46, 24 April 2026 (UTC) :Never mind, in process of adapting our templates for Parsoid, I missed additional change needed in an auxillary module. All is good now. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A2%D1%80%D0%B3/%D0%94%D1%80%D1%83%D0%B3%D0%B8&oldid=30921466&useparsoid=1 srwiki:Википедија:Трг/Други] == <nowiki>__NOCONTENTCONVERT__</nowiki> does not work in Parsoid. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 18:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=Queen&oldid=30824348&useparsoid=1 srwiki:Queen] == Parsoid does not honor __БЕЗКН__ (magic word to suppress title conversion during language conversion) [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 20:03, 24 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%A4%D0%BE%D1%80%D1%83%D0%BC/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8&oldid=152858025&useparsoid=1 ruwiki:Википедия:Форум/Новости] == Исчез логотип в скине Вектор-2010 при включенном гаджете, который отображает праздничные логотипы. При отключении гаджета в настройках — повседневный логотип виден. [[User:Рыцарь поля|Рыцарь поля]] ([[User talk:Рыцарь поля|talk]]) 00:16, 25 April 2026 (UTC) :Triage: not a Parsoid visual issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:22, 27 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9F%D1%80%D0%BE%D0%B5%D0%BA%D1%82:%D0%91%D0%B8%D0%B1%D0%BB%D0%B8%D0%BE%D1%82%D0%B5%D0%BA%D0%B0/%D0%A2%D1%80%D0%B5%D0%B1%D1%83%D1%8E%D1%82%D1%81%D1%8F_%D0%BA%D0%BD%D0%B8%D0%B3%D0%B8&oldid=152853098&useparsoid=1 ruwiki:Проект:Библиотека/Требуются книги] == Конфликт [[:ru:Проект:Библиотека/Требуются книги/Шапка]] с содержанием страницы, из-за чего в [[:ru:Шаблон:shortcut|Шаблон:shortcut]] помещается раздел "содержание" (выглядит это так: [https://ibb.co/219kN3dW 1] и [https://ibb.co/bgM0Fmpn 2]). ------- The conflict between [[:ru:Проект:Библиотека/Требуются книги/Шапка]] and the page content causes the "содержание" section to appear inside [[:ru:Шаблон:shortcut|Шаблон:shortcut]] (this is how it looks: [https://ibb.co/219kN3dW 1] and [https://ibb.co/bgM0Fmpn 2]). [[User:Футболло|Futbollo]] ([[User talk:Футболло|talk]]) 01:10, 25 April 2026 (UTC) :Thank you for the report - I've filed {{phab|T424492}} for it. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:33, 27 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Copa_Intercontinental_da_FIFA_de_2025&oldid=72134360&useparsoid=1 ptwiki:Copa Intercontinental da FIFA de 2025] == Quadro de informações foi excluído por acidente. [[User:AnderSilv42|AnderSilv42]] ([[User talk:AnderSilv42|talk]]) 00:16, 26 April 2026 (UTC) :Triage: Content related - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 15:23, 26 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Michel_W%C3%B6cke&oldid=266505400&useparsoid=1 dewiki:Michel Wöcke] == Bild (Thumb) viel zu gross [[User:Albinfo|Albinfo]] ([[User talk:Albinfo|talk]]) 13:44, 26 April 2026 (UTC) == [https://tn.wikipedia.org/w/index.php?title=Sekolo_Se_Segolwane_Sa_Nata&oldid=49572&useparsoid=1 tnwiki:Sekolo Se Segolwane Sa Nata] == I tried fixing the references but It still says pages with reference errors so I don't know what could be the issue [[User:Blackgirlmighty|Blackgirlmighty]] ([[User talk:Blackgirlmighty|talk]]) 17:00, 26 April 2026 (UTC) :You only need to define a reference once even if you want to use it multiple times - see https://www.mediawiki.org/wiki/Help:Cite#Multiple_uses_of_the_same_footnote for more information. One of each of the references Mmegi2012 and Mmegi2023 should be kept as is; the others should be replaced by <nowiki><ref name="Mmegi2012" /></nowiki> (or 2023) without content. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:39, 27 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Pete_Aguilar&oldid=8671369&useparsoid=1 simplewiki:Pete Aguilar] == This is a less detailed copy of another Wikipedia page. There are two wiki pages showing Pete Aguilar and this is an outdated version. [[User:SuperPug3739|SuperPug3739]] ([[User talk:SuperPug3739|talk]]) 04:56, 27 April 2026 (UTC) :Triage: content related, not Parsoid related [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:46, 27 April 2026 (UTC) == [https://fi.wikipedia.org/w/index.php?title=Hoito-_kasvatussuunnitelma&oldid=23973675&useparsoid=1 fiwiki:Hoito- kasvatussuunnitelma] == Sivun nimi piti olla Hoito- ja kasvatussuunnitelma. Muokkaaminen ei onnistunut. [[User:Nebiux|Nebiux]] ([[User talk:Nebiux|talk]]) 12:01, 29 April 2026 (UTC) :Triage: content related, not Parsoid-related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:04, 30 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Usuario:Luigi_Nakano&oldid=173203320&useparsoid=1 eswiki:Usuario:Luigi Nakano] == An error appears, which should appear when template [[w:es:Plantilla:Estado usuario|Estado usuario]] has nothing in 1=. However, there is a parameter in 1=, so the result should be "Conectado" or "Desconectado", and not "Error:No se ha indicado usuario.". [[User:Luigi Nakano|<span style="color:green">Luigi</span> <span style="color:blue">Nakano</span>]] [[File:Emojione 1F3A7.svg|15px]] ([[User talk:Luigi Nakano|会話]]) 23:12, 29 April 2026 (UTC) :This looks like {{phab|T348722}}, for which a workaround is suggested in https://www.mediawiki.org/wiki/Parsoid/Parser_Unification/Instructions_for_editors#Access_to_parent_frame_from_within_extensions. Let us know if the problem persists after the fix! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:10, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=History_of_the_Ryukyu_Islands&oldid=1336895218&useparsoid=1 enwiki:History of the Ryukyu Islands] == The multiple issues display unsourced template when editing the article there is no such template. [[User:Lightoil|Lightoil]] ([[User talk:Lightoil|talk]]) 05:11, 30 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A7%D1%85%D0%B0%D0%B8%D0%B4%D0%B7%D0%B5,_%D0%9C%D0%B0%D0%BC%D0%B8%D1%8F_%D0%92%D0%B8%D1%81%D1%81%D0%B0%D1%80%D0%B8%D0%BE%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&oldid=152923873&useparsoid=1 ruwiki:Чхаидзе, Мамия Виссарионович] == In the old parser, links to non-existing file pages lead to Special:Upload for the file. In Parsoid, it's a strange link to Special:FilePath, which ends up confusing the editors who accustomed to uploading files this way. [[:ru:Служебная:GoToComment/c-ФВ-20260430140600-Не_загружается_файл|See local discussion]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:53, 30 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%94%D0%B5%D1%80%D0%B2%D0%B8%D1%88_%D0%9A%D0%BE%D1%80%D0%BA%D1%83%D1%82&oldid=30931273&useparsoid=1 srwiki:Дервиш Коркут] == At the bottom, there are several navboxes, Parsoid adds some whitespace between them [[File:Spaces between navboxes with Parsoid..png]] [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 21:21, 30 April 2026 (UTC) : https://phabricator.wikimedia.org/T425123 [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 15:27, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Sevayat&oldid=1351876642&useparsoid=1 enwiki:Talk:Sevayat] == The content assessment and talk page are displayed directly on the talk page, rather than within the “About this page” section (mobile view). [[User:S4yam|S4yam]] ([[User talk:S4yam|talk]]) 21:44, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:Template_editor&oldid=1351909200&useparsoid=1 enwiki:Wikipedia talk:Template editor] == I'm artist thi is my personal biography page [[User:Allymtulia|Allymtulia]] ([[User talk:Allymtulia|talk]]) 21:45, 30 April 2026 (UTC) :Triage: Content issue, not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Middle_of_Nowhere_(Kacey_Musgraves_album)&oldid=1351931473&useparsoid=1 enwiki:Middle of Nowhere (Kacey Musgraves album)] == Producer parameter that adops hlist system in Infobox album template occurs an error. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 01:07, 1 May 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Associazione_Calcio_Perugia_1996-1997&oldid=148287407&useparsoid=1 itwiki:Associazione Calcio Perugia 1996-1997] == Doesn't show all kits. Just the third and on top of the screen [[User:Madive60|Madive60]] ([[User talk:Madive60|talk]]) 01:29, 1 May 2026 (UTC) :This is probably fixed by the fix to {{phab|T425056}} and the current CSS workaround on-wiki. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:22, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%9B%BD%E6%97%97%E3%81%AE%E4%B8%80%E8%A6%A7&oldid=109342678&useparsoid=1 jawiki:国旗の一覧] == イラクの国旗がない [[User:平舞|平舞]] ([[User talk:平舞|talk]]) 03:17, 1 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:21, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Manting_Chan&oldid=1351960413&useparsoid=1 enwiki:Manting Chan] == Divorce, she is not divorced. [[User:Bananahammock311911511|Bananahammock311911511]] ([[User talk:Bananahammock311911511|talk]]) 04:54, 1 May 2026 (UTC) :Content issue, not a Parsoid issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 07:30, 1 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E9%9B%B7%E9%96%80%E9%9F%B3%E5%8A%A9&oldid=109345108&useparsoid=1 jawiki:雷門音助] == {{人名の曖昧さ回避}}や{{aimai}}を貼ると表示が崩れる。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 07:27, 1 May 2026 (UTC) :<nowiki>[[:jawiki:雷門五郎]]</nowiki>でも同様の問題が起きています。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 09:09, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Iceman_(Drake_album)&oldid=1350717409&useparsoid=1 enwiki:Talk:Iceman (Drake album)] == Banners showing up on mobile, not under “learn more about this page button” [[User:OrbitalVoid49|OrbitalVoid49]] ([[User talk:OrbitalVoid49|talk]]) 09:36, 1 May 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Bancu,_Harghita&oldid=13617293&useparsoid=1 rowiki:Bancu, Harghita] == Steagulnjudetului Hargita nu este acea cârpă secuiasca. [[User:Auto 4115|Auto 4115]] ([[User talk:Auto 4115|talk]]) 01:39, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Aurangabad&oldid=1351274322&useparsoid=1 enwiki:Aurangabad] == It has the old name of the city as it's title [[User:20mphwind|20mphwind]] ([[User talk:20mphwind|talk]]) 07:09, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%B9%E0%A6%BE%E0%A6%9C%E0%A6%B0%E0%A6%BE%E0%A6%AC%E0%A6%BE%E0%A6%A1%E0%A6%BC%E0%A7%80_%E0%A6%89%E0%A6%9A%E0%A7%8D%E0%A6%9A_%E0%A6%AC%E0%A6%BF%E0%A6%A6%E0%A7%8D%E0%A6%AF%E0%A6%BE%E0%A6%B2%E0%A6%AF%E0%A6%BC&oldid=8874755&useparsoid=1 bnwiki:হাজরাবাড়ী উচ্চ বিদ্যালয়] == তথ্যসুত্র ব্যয়বহুল নয়। [[User:Md Umor Faruk 2010|Md Umor Faruk 2010]] ([[User talk:Md Umor Faruk 2010|talk]]) 08:00, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=She_Did_It_Again&oldid=1352147079&useparsoid=1 enwiki:She Did It Again] == (Mobile) Huge error in hlist. Bullet points (•) are missing, and the items listed are arranged very roughly. Not sure why this error occurs for over three days. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 10:45, 2 May 2026 (UTC) :Thank you for the report - I have filed {{phab|T425245}} for this issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:30, 3 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%91%E4%B8%8A%E5%93%B2&oldid=109361964&useparsoid=1 jawiki:村上哲] == [[Template:循環参照]]が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:13, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=Wikipedia:%E4%BA%95%E6%88%B8%E7%AB%AF&oldid=109349724&useparsoid=1 jawiki:Wikipedia:井戸端] == 目次が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1 enwiki:Wiki (disambiguation)] == [[w:en:tm:dab]] (at the bottom of the page) appears to render differently on Parsoid compared to non-Parsoid. <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 14:27, 2 May 2026 (UTC) :Also appears to render differently on desktop Parsoid v. mobile Parsoid -- compare https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=mobile (different rendering) vs. https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=desktop ('expected' rendering, AFAIK) <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 16:34, 2 May 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Horv%C3%A1th_Kriszti%C3%A1n_(fest%C5%91,_1976,_Budapest)&oldid=28948319&useparsoid=1 huwiki:Horváth Krisztián (festő, 1976, Budapest)] == Az a probléma, hogy nem szeretném hoyg festő, és 1976 Budapest legyen hozzá kírva. Elrontottam, és nem tudtam külön, új cikket írni róla. [[User:Pizzsus|Pizzsus]] ([[User talk:Pizzsus|talk]]) 20:47, 2 May 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%99%D7%A6%D7%97%D7%A7_%D7%9E%D7%90%D7%99%D7%A8_%D7%90%D7%9C%D7%AA%D7%A8&oldid=43088529&useparsoid=1 hewiki:יצחק מאיר אלתר] == הציטוטים בכתב דיויד בעברית לקויים. Text quotes in David font are displayed poorly. [[User:פרידבערג|פרידבערג]] ([[User talk:פרידבערג|talk]]) 21:36, 2 May 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9B%D0%B8%D1%86%D0%B5%D0%BD%D0%B7%D0%B8%D0%B8_%D0%B8_%D0%B8%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B_Creative_Commons&oldid=152790052&useparsoid=1 ruwiki:Лицензии и инструменты Creative Commons] == refs don't work with vector-2010 (but it works for vector-2022) [[User:Petsernik|Petsernik]] ([[User talk:Petsernik|talk]]) 23:05, 2 May 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Huawei&oldid=173270512&useparsoid=1 eswiki:Huawei] == El segundo sitio web que sale no existe es un vandalismo en wikimedia ingles o un error [[User:Usuario 016|Usuario 016]] ([[User talk:Usuario 016|talk]]) 23:15, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%8C%97%E6%9D%91%E8%81%A1&oldid=109365307&useparsoid=1 jawiki:北村聡] == 人名の曖昧さ回避Templateを挿入すると、上手く表示されず、大きな改行空白と共に「.mw-parser-output .dmbox{display:flex;align-items:center;clear:both;margin:0.9em 1em;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:0.25em 0.35em;font-size:95%}.mw-parser-output .dmbox>*{flex-shrink:0;margin:0 0.25em;display:inline}.mw-parser-output .dmbox-body{flex-grow:1;flex-shrink:1;padding:0.1em 0}」 というものが出る。 [[User:Geogie|Geogie]] ([[User talk:Geogie|talk]]) 23:35, 2 May 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Schreibwettbewerb&oldid=266703390&useparsoid=1 dewiki:Wikipedia:Schreibwettbewerb] == Text in der Blauen Tabelle ("Reviewpreis") überschneidet die rechte äußere Begrenzungslinie [[User:Polibil|Polibil]] ([[User talk:Polibil|talk]]) 15:30, 3 May 2026 (UTC) == [https://en.wikipedia.org/wiki/Template:Center enwiki:Template:Center] == Does not load on mobile version, most of the page tools are missing. [[File:Template Center issue.jpg|thumb|issue]] [[User:Misterpotatoman|Misterpotatoman]] ([[User talk:Misterpotatoman|talk]]) 19:28, 3 May 2026 (UTC) == [https://gl.wikipedia.org/w/index.php?title=Limodre,_Fene&oldid=7383114&useparsoid=1 glwiki:Limodre, Fene] == Fueron borrados los lugares de la parroquia de Limodre sin querer [[User:Vi1993|Vi1993]] ([[User talk:Vi1993|talk]]) 22:03, 3 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=Template:Aimai&oldid=93697981&useparsoid=1 jawiki:Template:Aimai] == I am seeing a layout breakage where TemplateStyle CSS is rendered as plain text, but only when the page is processed via Parsoid. 「.mw-parser-output .dmbox{display:flex;align-items:center;clear:both;margin:0.9em 1em;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:0.25em 0.35em;font-size:95%}.mw-parser-output .dmbox>*{flex-shrink:0;margin:0 0.25em;display:inline}.mw-parser-output .dmbox-body{flex-grow:1;flex-shrink:1;padding:0.1em 0}」 The output shows the CSS source code from the TemplateStyles of Template:Dmbox. Source of the CSS: https://ja.wikipedia.org/wiki/Template:Dmbox/styles.css The behavior is intermittent across different articles that call the same template. Some display correctly, while others fail. I haven't been able to identify the exact trigger for this discrepancy. [[User:Yukida-R|Yukida-R]] ([[User talk:Yukida-R|talk]]) 02:16, 4 May 2026 (UTC) gmyw9k0z13my7jdvmh57whk266k08bs 8365127 8364808 2026-05-04T10:56:43Z EliteWoodCutter 18368260 /* svwiki:Iliade */ new section 8365127 wikitext text/x-wiki Post your feedback about using [[Parsoid/Parser Unification|Parsoid]] to render articles. [[Parsoid/Parser_Unification/Known_Issues|Learn how to report problems clearly]]. '''Need more attention? [https://phabricator.wikimedia.org/maniphest/task/edit/form/43/?projects=PHID-PROJ-3y2wduoz5xezwveaq426 Report directly in Phabricator].''' {{note|This is for reporting feedback on the integration of the Parsoid parser only. '''For wiki content issues, such as concerns about article content, please report on your local wiki.''' }} [[Parsoid/Parser_Unification/Known_Issues|View known issues]] __NEWSECTIONLINK__ {{Archive box| [[/Archive 1]] [[/Archive 2]]}} == [https://nl.wikipedia.org/w/index.php?title=Wikipedia:Aanmelding_moderatoren&oldid=70702688&useparsoid=1 nlwiki:Wikipedia:Aanmelding moderatoren] == Sometimes, in a numbered list, the number stays on the first line when there are indented lines below it, and sometimes the number is vertically aligned between the different lines. For votes, it is preferable that the number remains on the line that starts with only “#” and not on lines with an indentation “#:”. [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:34, 15 February 2026 (UTC) :i.e. see item 33. under '<nowiki/>'''''Voor moderatorschap ContextCreator'''<nowiki/>'<nowiki/>'' [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:36, 15 February 2026 (UTC) ::I can't see any difference between Parsoid and the legacy Parser on that page, it appears that the number is correctly aligned in both cases. Are you using a different skin by any chance? Does the difference still appear? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:42, 21 April 2026 (UTC) :::I see no difference anymore - it is fixed. Thanks anyway! [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 16:01, 21 April 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Discussion_Wikip%C3%A9dia:Wikiconcours&oldid=233327486&useformat=mobile&useparsoid=1 frwiki:Discussion Wikipédia:Wikiconcours] == Content that is hidden inside the "Learn more about this page" button from MobileFrontend with legacy parser is not inside it with Parsoid. [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 08:32, 22 February 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Laurence_Olivier&oldid=148833592&useparsoid=1 itwiki:Laurence Olivier] == Giant Oscar statue icons (sgranate) [[User:UmbraSolis|UmbraSolis]] ([[User talk:UmbraSolis|talk]]) 20:28, 19 February 2026 (UTC) :This was probably due to https://phabricator.wikimedia.org/T417828, which is now fixed. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:53, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:43, 21 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Bologna_Football_Club_1909&oldid=149496425&useparsoid=1 itwiki:Bologna Football Club 1909] == problem with displaying football shirts [[User:Gio Bike|Gio Bike]] ([[User talk:Gio Bike|talk]]) 17:49, 20 February 2026 (UTC) :Can you be more specific, or is it fixed now? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:55, 27 February 2026 (UTC) ::Now it is OK [[Special:Contributions/&#126;2026-13011-93|&#126;2026-13011-93]] ([[User talk:&#126;2026-13011-93|talk]]) 17:20, 27 February 2026 (UTC) :::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:44, 21 April 2026 (UTC) == [https://vi.wiktionary.org/w/index.php?title=Wiktionary:Th%E1%BB%91ng_k%C3%AA/S%E1%BB%91_m%E1%BB%A5c_t%E1%BB%AB_theo_ng%C3%B4n_ng%E1%BB%AF/T%E1%BA%A5t_c%E1%BA%A3&oldid=2331126&useparsoid=1 viwiktionary:Wiktionary:Thống kê/Số mục từ theo ngôn ngữ/Tất cả] == Phần cuối bảng bị lỗi, không hiện ra số mục từ mà chỉ hiện ra "0" hoặc "-2" mà không rõ lý do, tôi không viết nhầm gì cả. (English: The table got error, just display "0" or "-2", but I don't have any error at write wikitext.) [[User:NHNAnh|NHNAnh]] ([[User talk:NHNAnh|talk]]) 05:57, 21 February 2026 (UTC) :I believe this might be due to "Expensive parser function count: 1080/500" in the debug log: there are too many expensive parser function counts on this page (PAGESINCATEGORY is expensive), and the later functions are not executed. :I would suggest splitting the page into several pages, if possible. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:04, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) == [https://cs.wikipedia.org/w/index.php?title=Celerina/Schlarigna&oldid=25694456&useparsoid=1 cswiki:Celerina/Schlarigna] == V tabulce v sekci obyvatelstvo se u jedné buňky zobrazuje černé pozadí. Pokud dám ale historii stránky a podívám se na aktuální verzi, vykreslí se stránka správně. To samé se opakuje i u jiných podobných stránek se stejně formátovanými tabulkami. [[User:Matijak|Matijak]] ([[User talk:Matijak|talk]]) 17:02, 22 February 2026 (UTC) :I cannot see a black cell in that table. Is this issue fixed? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:09, 27 February 2026 (UTC) ::I can see it in in both the history (latest revision) and on the page itself (live). It's the leftmost 'Počet' cell in the 'Jazyky v Celerině' table. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 10:10, 28 February 2026 (UTC) :::Aha! :::the cell itself is not dark, the text in it is, and only in dark mode. It is also present in the legacy rendering, which seems to hint at a problem with the table markup itself and not a parser issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:11, 2 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) :::::Not a Parsoid issue most likely, but it has not been fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:21, 24 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia:Biographies_of_living_persons&oldid=1340299616&useparsoid=1 enwiki:Wikipedia:Biographies of living persons] == Reporting a visual bug for all pages that suddenly arose as of this morning on Safari Mobile - the Page Actions Overflow div is in a permanently open state but inaccessible to via clicks to either toggle the menu or select any of the tools on the menu. In addition to being unable to interact with it, all of the styling broken and makes the top right section of the page unusable and barely readable. [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 14:34, 27 February 2026 (UTC) :Is this issue still present? Sorry, it has been a while since you reported this, I'm hoping that the issue has been resolved by now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) ::Yes, it appears to have been resolved. Thanks for following up! [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 03:38, 22 April 2026 (UTC) == [https://oc.wikipedia.org/w/index.php?title=Esqu%C3%A8rra_(politica)&oldid=2495338&useparsoid=1 ocwiki:Esquèrra (politica)] == There's an issue with the interlinks, this article should be connected with the other ones about left-wing politics [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 06:39, 28 February 2026 (UTC) :Yes, it was an issue with the interlinks, but those should naturally not be reported as visual issues ('bogue visuler') as the have nothing to do with Parsoid. You can link pages which have no connections by using the 'Apondre los ligams interlengas' (Add interlanguage links) button from the 'Bóstia d'aisinas' (Tools) menu. Unless, of course, Parsoid somehow blocks automatic linking of translations. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:10, 28 February 2026 (UTC) ::I don't know why but it was finally done (thank you so much to the person who did that), but the thing is, i tried what you said before and it kept telling me that i didn't had the permission to link the two articles... [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 19:33, 1 March 2026 (UTC) :::I did that, you are welcome. It appears that you are not autoconfirmed yet on Wikidata, and that this Wikidata entry requires that, which if both true I would expect you to not be able to do this change. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 04:21, 21 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) :::::Sorry? [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:48, 23 April 2026 (UTC) ::::::We're using the <nowiki>{{done}}</nowiki> template to track which issues have been resolved, vs still outstanding. I don't believe there is any additional follow required by the Content Transform team on this report? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 05:00, 24 April 2026 (UTC) :::::::Oh, no, I just didn't know this is a system you are using. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:19, 24 April 2026 (UTC) == [https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/Page_translation_administration&oldid=8240537&useparsoid=1 Help:Extension:Translate/Page translation administration] == The topmost warning in the 'Changing the source text' section does not display the codeblock content. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:47, 28 February 2026 (UTC) :This is a very clever use of the <code><nowiki>{{^(}}</nowiki></code> template to avoid creating an unintended translation marker. I've [https://www.mediawiki.org/w/index.php?title=Help%3AExtension%3ATranslate%2FPage_translation_administration&diff=8349012&oldid=8343860 replaced it with more straight-forward entity-escaping] to be more compatible with Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:54, 21 April 2026 (UTC) ::Also filed this as [[phab:T424066]] [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 16:46, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&oldid=67999951&useparsoid=1 nlwiki:Railterminal Gelderland] == The map in [[:nl:sjabloon:maplink]] doesn't show up in my Chrome browser for Chromebook. It does show in https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&useparsoid=0 and also when I log out. [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:54, 5 March 2026 (UTC) :Btw, the map is visible for a moment, then it disappears [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:56, 5 March 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%91%D7%A8%D7%90%D7%95%D7%9C_%D7%A1%D7%98%D7%90%D7%A8%D7%A1&oldid=42870396&useparsoid=1 hewiki:בראול סטארס] == למה הקישור לתמונה ששמתי לא עובד? בכל מקרה אשמח שמישהו ישים את התמונה העדכנית שמשומשת בדף באנגלית מאחר והלוגו למשחק שונה. מצטער על התקלה. [[User:Jhho48|Jhho48]] ([[User talk:Jhho48|talk]]) 16:43, 9 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Infokastis: Sulamistemperatuur 236,15 K (−37 °C) Miinusmärk peaks olema sidekriipsust pikem, kuid pikema kriipsu sisestamine põhjustab tõrketeate. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:05, 11 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Vabandust, lühike (st vale) kriips oli kuvatud siiski ainult lähteteksti režiimis; salvestatud tekstiga küljendis on kuvatud õige kriips. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:07, 11 March 2026 (UTC) == kowiki:sticky header is broken == [[:en:Template:Sticky header|Template:Sticky header]] is not working properly on kowiki. Please compare [//ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=0] with [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=1].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:34, 16 March 2026 (UTC) :It may have been because of an empty row before the table caption. I [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&diff=41501849&oldid=41501840 edited the page] to remove it. But, looks like another editor has removed the sticky header template call from above the table. If you can put it back, it will work. See my [[:ko:사용자:SSastry_(WMF)/Sandbox|sandbox]] page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 03:22, 17 March 2026 (UTC) == [https://ko.wikipedia.org/w/index.php?title=%ED%8B%80:%EA%B5%AD%EA%B8%B0%EB%82%98%EB%9D%BC&oldid=40992836&useparsoid=1 kowiki:틀:국기나라] == 변수를 덧붙였음에도 {{국기나라|독일|제국}}이 여전히 '독일'로 출력됩니다. [[User:Triican|Triican]] ([[User talk:Triican|talk]]) 05:04, 19 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Angus_T._Jones&oldid=1333447723&useparsoid=1 enwiki:Angus T. Jones] == The infobox photo is squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 17:11, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Ukraine&oldid=1343921679&useparsoid=1 enwiki:Ukraine] == All maps in the infobox are squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 18:36, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Sabia_que&oldid=54991313&useparsoid=1 ptwiki:Wikipédia:Sabia que] == O arquivo de discussão está 'bugando' visualmente. Está no meio de "Curiosidades em destaque" [[User:Heylenny|Heylenny]] ([[User talk:Heylenny|talk]]) 23:27, 19 March 2026 (UTC) :{{done}} Template adjusted on the page. [[User:Fúlvio|Fúlvio]] ([[User talk:Fúlvio|talk]]) 02:59, 22 March 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%AC%E0%A6%BF%E0%A6%AE%E0%A6%B2_%E0%A6%98%E0%A7%8B%E0%A6%B7_(%E0%A6%B6%E0%A6%BF%E0%A6%B6%E0%A7%81%E0%A6%B8%E0%A6%BE%E0%A6%B9%E0%A6%BF%E0%A6%A4%E0%A7%8D%E0%A6%AF%E0%A6%BF%E0%A6%95)&oldid=8851768&useparsoid=1 bnwiki:বিমল ঘোষ (শিশুসাহিত্যিক)] == আলোচনা পাতায় অন্য নিবন্ধের আলোচনা পাতা [[User:Ams riyad|Ams riyad]] ([[User talk:Ams riyad|talk]]) 01:28, 20 March 2026 (UTC) == [https://vi.wikipedia.org/w/index.php?title=Wikipedia:Th%E1%BA%A3o_lu%E1%BA%ADn&oldid=74869958&useparsoid=1 viwiki:Wikipedia:Thảo luận] == TOC is rendered inside the link bar, but it shouldn't be. [[User:NguoiDungKhongDinhDanh|<span class="skin-invert" style="color:black;font-family:Monotype Corsiva;font-size:110%;font-weight:normal;line-height:normal">NguoiDungKhongDinhDanh</span>]] 03:20, 20 March 2026 (UTC) :This was most likely [[phab:T421629|T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] and we believe this issue has been fixed. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:51, 24 April 2026 (UTC) == [[wikt:ru:омфал]] == For more than a day, there have been anomalies in the behavior of tables of contents (ToCs) in Russian Wiktionary. The issues differ based on the selected skin and affect only some pages. If the old Vector theme is used, the automatically generated ToC simply fails to appear on certain pages, despite the page having over three headers and the absence of magic words such as NOTOC. If the new Vector theme is used, the ToC on some pages is misplaced and not positioned where it should be by default. The problem is not present if the old parser is used. Purging the page's cache seems to fix the issue as well. ToC is displayed correctly in the preview-mode too. Some affected pages: * [[wikt:ru:омфал]] * [[wikt:ru:безграмотность]] * [[wikt:ru:હંમેશા]] * [[wikt:ru:ಯಾವಾಗಲೂ]] * [[wikt:ru:stadigvæk]] * [[wikt:ru:alligevel]] * [[wikt:ru:kanunay]] * [[wikt:ru:ሁሌ]] * [[wikt:ru:zawżdy]] * and maaany mooore... [[User:綿貫桜哉|綿貫桜哉]] ([[User talk:綿貫桜哉|talk]]) 08:11, 20 March 2026 (UTC) :This was [[phab:T421629|⚓ T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] but should be fixed now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:55, 24 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Louis_Nirenberg&oldid=15616502&useparsoid=1 rowiki:Louis Nirenberg] == The image seems to be the 250px thumbnail scaled up to what looks like 400px width. [[User:Andrei Stroe|Andrei Stroe]] ([[User talk:Andrei Stroe|talk]]) 10:16, 20 March 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Aide:Accueil&oldid=232433495&useparsoid=1 frwiki:Aide:Accueil] == custom collapsible elements render differently with parsoid [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 14:19, 20 March 2026 (UTC) :I filed https://phabricator.wikimedia.org/T421859. Thanks for the report. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:07, 31 March 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Katten_(olika_betydelser)&oldid=43770842&useparsoid=1 svwiki:Katten (olika betydelser)] == The legacy parser adds an empty line before the template Förgrening (which is a kind of table). The Parsoid parser don't do that. This occurs on all pages using that template. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 18:32, 21 March 2026 (UTC) :Ya, this is known difference with some paragraph wrapping which is tricky to fix. In this case, I recommend adjusting the top margin of the table by editing the base template: https://sv.wikipedia.org/w/index.php?title=Mall%3AF%C3%B6rgrening%20bas&veaction=editsource [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:01, 31 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Gen_Z_stare&oldid=1344701043&useparsoid=1 enwiki:Gen Z stare] == The infobox image is unusually narrow. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 01:51, 22 March 2026 (UTC) :For me the image is stretched horizontally by a fair bit. It seems like the following bit of code is to blame: :<syntaxhighlight lang="css"> :html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img {width: 400px; } :</syntaxhighlight> [[User:Sohom Datta|Sohom]] ([[User talk:Sohom Datta|talk]]) 01:54, 22 March 2026 (UTC) ::I'm not seeing any visible difference between legacy parser and Parsoid in my testing. Can you share a screenshot @[[User:Snowmanonahoe|Snowmanonahoe]] ? What skin and browser are you using? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 17:43, 27 March 2026 (UTC) :::@[[User:Jon (WMF)|Jon (WMF)]]: I don't see it anymore either. I'm using Vector 2022 and Firefox 149. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 17:46, 27 March 2026 (UTC) ::::Ah okay. I think this was a caching issue then. Some "temporary turbulence" was to be expected with this roll out. Thanks for reporting! [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 18:29, 27 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Virginia_Fonseca&oldid=71959182&useparsoid=1 ptwiki:Virginia Fonseca] == A 1ª imagem da página na infocaixa tem um tamanho grande demais [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 11:34, 22 March 2026 (UTC) :I don't see the problem. The page renders identically in Parsoid and with the old/legacy parser. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:22, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Xander_Harris&oldid=71958675&useparsoid=1 ptwiki:Xander Harris] == Seção de referências expandida [[User:Vitruviano|Vitruviano]] ([[User talk:Vitruviano|talk]]) 15:06, 22 March 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Bruker:Znuddel&oldid=25704667&useparsoid=1 nowiki:Bruker:Znuddel] == Hele siden er helt feil [[User:Nevemagneten|Nevemagneten]] ([[User talk:Nevemagneten|talk]]) 20:35, 24 March 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Main_page&oldid=2122&useparsoid=1 abstractwiki:Abstract Wikipedia:Main page] == Favicon is showing a dark background around the rounded corners on Chrome. [[User:Jsengupt|Jsengupt]] ([[User talk:Jsengupt|talk]]) 16:14, 25 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=System_(typeface)&oldid=1329545007&useparsoid=1 enwiki:System (typeface)] == Infobox image is stretched horizontally [[User:Anna328p|Anna328p]] ([[User talk:Anna328p|talk]]) 06:59, 26 March 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Enged%C3%A9lyk%C3%A9r%C3%A9s&oldid=28288240&useparsoid=1 huwiki:Wikipédia:Engedélykérés] == The email templates are rendered incorrectly. [[User:Bencemac|Bencemac]] ([[User talk:Bencemac|talk]]) 14:00, 26 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T421563 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:19, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Usu%C3%A1rio(a):Inter-rede/Cabe%C3%A7alho&oldid=71778331&useparsoid=1 ptwiki:Usuário(a):Inter-rede/Cabeçalho] == Whitespaces seem to have collapsed [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 18:02, 27 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422155 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:36, 2 April 2026 (UTC) ::It looks like the problem is the <code>display:flex</code> in the <code>style</code> attribute on the wrapper is at fault. Parsoid generates <code><nowiki><span></nowiki></code> wrappers around the html entities in the wikitext, by design. The whitespace is present in the HTML, so that's not a fault of Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:07, 9 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%91%D7%A6%D7%A2_%D7%9E%D7%A9%D7%94_(%D7%9E%D7%9C%D7%97%D7%9E%D7%AA_%D7%94%D7%A2%D7%A6%D7%9E%D7%90%D7%95%D7%AA)&oldid=42991233&useparsoid=1 hewiki:מבצע משה (מלחמת העצמאות)] == הכיתוב שנועד למנוע בלבול בין מבצע משה הזה למבצע משה אחר לא ערוך [[User:חנניה בלסמן|חנניה בלסמן]] ([[User talk:חנניה בלסמן|talk]]) 12:54, 30 March 2026 (UTC) == [//en.wikipedia.org/w/index.php?title=Help:Colon_trick&useparsoid=1 enwiki:Help:Colon trick] == According to [[w:Help:Colon trick]], it is explained as follows: "<code><nowiki>[[//Hus]]</nowiki></code> will produce an (invalid) external link wrapped in brackets ("[[//Hus]]"), but <code><nowiki>[[://Hus]]</nowiki></code> will produce a link to [[w://Hus|//Hus]]." However, when using Parsoid, it incorrectly links to [[w:Help:Colon trick//Hus|Help:Colon trick//Hus]].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:02, 31 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422161 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 14:00, 2 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Ans%C3%B6kan_om_administrativ_beh%C3%B6righet&oldid=59167563&useparsoid=1 svwiki:Wikipedia:Ansökan om administrativ behörighet] == In Legacy, each section (candidate) get a [redigera] ([edit] to the right of the section name. In Parsoid, there is nothing to the right of the section name. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 12:15, 2 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T391624 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:27, 2 April 2026 (UTC) == [https://en.wiktionary.org/w/index.php?title=H%26P&oldid=83856321&useparsoid=1 enwiktionary:H&P] == The first hidden category listed is [[wiktionary:Category:English_entries_with_incorrect_language_header|English entries with incorrect language header]]'','' which is, however, empty. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:48, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Jo%C3%A3o_Peixoto&oldid=72016744&useparsoid=1 ptwiki:João Peixoto] == A foto não corresponde ao nome citado [[User:Mayque Lemos|Mayque Lemos]] ([[User talk:Mayque Lemos|talk]]) 18:18, 2 April 2026 (UTC) == [https://meta.wikimedia.org/w/index.php?title=Main_Page&oldid=30254797&useparsoid=1 metawiki:Main Page] == On Parsoid only, <nowiki>''complete list'' and ''request''</nowiki> each show a space between them and their preceding opening bracket. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 19:06, 3 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&oldid=1343194045&useparsoid=1 enwiki:In Stars and Time] == <code>&lt;ref name="rps"&gt;</code> displays an error which doesn’t occur on the legacy parser [[User:Mir Novov|Mir Novov]] ([[User talk:Mir Novov|talk]]) 12:10, 4 April 2026 (UTC) :It was an error which I fixed with [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&diff=1348021667&oldid=1347424445 this edit] which adds one more backlink to Ref #5. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:00, 10 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Helen_Andrews&oldid=72024590&useparsoid=1 ptwiki:Helen Andrews] == Estou a ter problema com as referências, pois aparecem duplicadas. [[User:Faviola7|Faviola7]] ([[User talk:Faviola7|talk]]) 14:17, 4 April 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Project_chat&oldid=3236&useparsoid=1 abstractwiki:Abstract Wikipedia:Project chat] == In the "Bot request" section, a link that has been visited is blue rather than purple, because spaces in the link are turned into actual spaces (%20) in the URL. [[User:JJPMaster|JJP]]<sub>[[User talk:JJPMaster|Mas]]<sub>[[Special:Contributions/JJPMaster|ter]]</sub></sub> ([[wikt:she|she]]/[[wikt:they|they]]) 21:53, 4 April 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Tor_Fosse_(f%C3%B8dt_1956)&oldid=25723619&useparsoid=1 nowiki:Tor Fosse (født 1956)] == fil: center frameless [[User:Birgit.H.Pihl|Birgit.H.Pihl]] ([[User talk:Birgit.H.Pihl|talk]]) 10:05, 5 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Politisk_opposition&oldid=59171124&useparsoid=1 svwiki:Politisk opposition] == This error message about unused named reference is not shown: Referensfel: <ref>-tagg med namn "sr-20161006", definierad i <references> används inte tidigare i texten. The article is also added to hidden category "Sidor med referensfel" but that is not shown [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:12, 5 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Puteulum/Sandbox&oldid=150100596&useparsoid=1 itwiki:Utente:Puteulum/Sandbox] == The "Move" button to move the entry from sandbox to NS0 does not appear [[User:Puteulum|Puteulum]] ([[User talk:Puteulum|talk]]) 14:28, 7 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=POVOADO_TIRIRICAL&oldid=72040530&useparsoid=1 ptwiki:POVOADO TIRIRICAL] == O MEU TEXTO ESTA TODO VERMELHO E MAIS CENTRALIZADO [[User:POVOADO TIRIRICAL|POVOADO TIRIRICAL]] ([[User talk:POVOADO TIRIRICAL|talk]]) 18:38, 7 April 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%B1%E4%BA%AC%E9%83%BD%E9%81%935%E5%8F%B7%E6%96%B0%E5%AE%BF%E9%9D%92%E6%A2%85%E7%B7%9A&oldid=108985336&useparsoid=1 jawiki:東京都道5号新宿青梅線] == ヘッダー付近に編集ミスと思われし文言あり [[User:QWERTYKeyboard0570|QWERTYKeyboard0570]] ([[User talk:QWERTYKeyboard0570|talk]]) 08:56, 8 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=2022_Oder_environmental_disaster&oldid=1344570432&useparsoid=1 enwiki:2022 Oder environmental disaster] == After a second, the actual map from the infobox (not the buttons) is replaced with a placeholder icon and text (clicking in the field still works). [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 11:56, 8 April 2026 (UTC) :Could it have been a transient issue? I cannot reproduce this right now. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:03, 10 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Commissione_arbitrale/Domande&oldid=150049601&useparsoid=1 itwiki:Wikipedia:Commissione arbitrale/Domande] == This page is related to the itwiki ArbCom election. Section edit links were not shown, making it difficult to ask questions to candidates. This has since been worked around with [[:it:special:diff/150118322|this edit]] and is likely related to [[phab:T387520|T387520]]. [[User:Titore|Titore]] ([[User talk:Titore|talk]]) 19:58, 8 April 2026 (UTC) :Thanks for this report. This is on our list of high priority tasks to fix and we are going to pick up shortly. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:53, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Kurier&oldid=266019405&useparsoid=1 dewiki:Wikipedia:Kurier] == das Diagramm zum Beitrag "Ein Wal ..." überragt den Text der rechten Spalte. [[User:Michael w|Michael w]] ([[User talk:Michael w|talk]]) 08:10, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034&useparsoid=1 dewiki:Wikipedia:Fragen zur Wikipedia] == <nowiki>& s h y ;</nowiki> is ignored. See the test on https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034#&_s_h_y_; [[User:Raymond|Raymond]] ([[User talk:Raymond|talk]]) 09:55, 10 April 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422960 for this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:55, 10 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Faktafr%C3%A5gor&oldid=59190040&useparsoid=1 svwiki:Wikipedia:Faktafrågor] == Svara-funktionen fungerar inte med Parsoid. När jag klickar på Svara för något inlägg, vilket som helst, dyker svarsrutan upp längst ner på sidan, efter den senaste diskussionstråden. Med den äldre parsern fungerar det. [[User:Larske|Larske]] ([[User talk:Larske|talk]]) 11:12, 10 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Cornelis_de_Bruijn_Martinuszoon&oldid=70921577&useparsoid=1 nlwiki:Cornelis de Bruijn Martinuszoon] == De pagina-afbeelding is de handtekening van C. de Bruijn Mz. Ik denk dat zijn afbeelding in de spotprent een betere pagina-afbeelding is. Het zou kunnen dat Parsoid/Wikipedia deze niet 'pakt' omdat de dimensies tijdens een eerdere bewerking zijn aangepast. Alvast bedankt! [[User:Jelledebruijn|Jelledebruijn]] ([[User talk:Jelledebruijn|talk]]) 16:31, 10 April 2026 (UTC) :I think you might have seen a version of the page before the cache was updated. I just checked and the image is identical with Parsoid and the older parse. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:46, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=The_Punisher_(2004)&oldid=263259949&useparsoid=1 dewiki:The Punisher (2004)] == Dead link template Vorlage:Toter Link (https://de.wikipedia.org/wiki/Vorlage:Toter_Link) after url is no longer working but gets part of the Link. (example https://de.wikipedia.org/wiki/The_Punisher_(2004)#cite_note-5 ) [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:23, 10 April 2026 (UTC) :Example without Parsoid: https://de.wikipedia.org/wiki/The_Punisher_(2004)?useparsoid=0#cite_note-5 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:57, 10 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T368724 but ideally, the template will be added with a space after the link. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:24, 11 April 2026 (UTC) ::Unfortunately it's added by the InternetArchiveBot that way: https://de.wikipedia.org/w/index.php?title=Liste_aktiver_Brauereien_in_Deutschland&diff=prev&oldid=265857281 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 06:45, 11 April 2026 (UTC) :::@[[User:SSastry (WMF)|SSastry (WMF)]]: But it is not good if the preview shows us a different result than the version that is subsequently published. InternetArchiveBot inserts it without spaces. The task is prioritized as Low, but since we have this thousands of times in the article inventory (and it used to work before), the task should be reprioritized to Higher. And the preview should always show the same result that I get after publishing. What do we do with the Phab task now? How do we handle this bug? Thank you, [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 09:12, 11 April 2026 (UTC) ::::We will fix the preview path separately. But, for this specifically, I'll flag this for the team to see how we want to handle this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:33, 11 April 2026 (UTC) :::::@[[User:SSastry (WMF)|SSastry (WMF)]]: Oh thank you, keep us up to date here please. [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 16:35, 11 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Marlon_Ganchozo&oldid=172919968&useparsoid=1 eswiki:Marlon Ganchozo] == No sale el resto de la información del, jugador [[User:Didierlpz06|Didierlpz06]] ([[User talk:Didierlpz06|talk]]) 19:04, 10 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 eswiki:Temporada regular de la Euroliga 2025-26] == no se sustituyen correctamente las ultimas plantillas [[User:Hugogs02|Hugogs02]] ([[User talk:Hugogs02|talk]]) 08:42, 11 April 2026 (UTC) :This page is too large post-template expansion. Observe that the templates at the end are not expanded neither in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 Parsoid] nor in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=0 Legacy]; the legacy parser just happens to expand a few more at the end of the page due to [https://phabricator.wikimedia.org/T392262 T392262]. The page should probably be split. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:13, 13 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Uniforme_de_la_selecci%C3%B3n_de_f%C3%BAtbol_de_Argentina&oldid=172883243&useparsoid=1 eswiki:Uniforme de la selección de fútbol de Argentina] == En la plantilla de uniforme de fútbol algunos uniformes se ven con las mangas más bajas respecto al archivo del cuerpo, dejando lineas de un pixel por encima con los colores de fondo en dicha plantilla. [[User:Lobo kun mfc|Lobo kun mfc]] ([[User talk:Lobo kun mfc|talk]]) 13:58, 11 April 2026 (UTC) :The lines displayed on top of the uniforms are present both in Parsoid and in the Legacy parser, and they do seem to vary slightly depending on the browser (I've looked on Firefox and Chrome, both on Linux, and they were not consistent between both browsers). :I believe this issue should be fixed on the template side (at a guess, the <code>style="color: inherit; background-color:#000040;"</code> that I see on the various image divs may well show up depending on the exact HTML structure and/or image) [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:23, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Liste_der_Radschnellverbindungen_in_Deutschland&oldid=266034807&useparsoid=1 dewiki:Liste der Radschnellverbindungen in Deutschland] == Hallo, beim Artikel [[Liste der Radschnellverbindungen in Deutschland]] wird die Beschreibung der MapLink-Karte wird nicht gescheid gerendert. Statt einem hochgestellten <code>[7]</code> wird <code>Karte der bestehenden Radschnellwege in Deutschland'"`UNIQ--ref-00000008-QINU`"'</code> gerendert. Das Problem ist serverseitig und tritt beim Legacy-Parser nicht auf. LG [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 16:02, 11 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T383004 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:06, 11 April 2026 (UTC) ::thanks! [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 14:13, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Louis_Franchet_d%E2%80%99Esp%C3%A8rey&oldid=266076416&useparsoid=1 dewiki:Louis Franchet d’Espèrey] == Bildumfluss nicht wie üblich [[User:Alfred Kiefer|Alfred Kiefer]] ([[User talk:Alfred Kiefer|talk]]) 19:30, 11 April 2026 (UTC) :This issue has been fixed in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1269534 and should be deployed to production this week. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:34, 13 April 2026 (UTC) == [https://bn.wiktionary.org/w/index.php?title=%E0%A6%AA%E0%A7%8D%E0%A6%B0%E0%A6%A7%E0%A6%BE%E0%A6%A8_%E0%A6%AA%E0%A6%BE%E0%A6%A4%E0%A6%BE&oldid=250894&useparsoid=1 bnwiktionary:প্রধান পাতা] == The ‘ শব্দছবি’ section is overflowing with Parsoid; thus does not happen when the legacy parser is used. [[User:Redmin|Redmin]] ([[User talk:Redmin|talk]]) 08:09, 12 April 2026 (UTC) :Since the section seems to be randomized, it's pretty hard to see which version of this section is overflowing (the ones I see do not seem to). Would you be able to provide more information/a screenshot? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:49, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Hamburg&oldid=266087257&useparsoid=1 dewiki:Wikipedia:Hamburg] == Abschnittsbearbeitungen nicht mehr möglich, Link fehlt. Betrifft einige WP-Seiten wie auch [[:de:Wikipedia:Stammtisch München]] oder auch nur einige Überschriften von [[:de:Vorlage:Coordinate]], also nicht immer komplette Seiten. [[User:NordNordWest|NordNordWest]] ([[User talk:NordNordWest|talk]]) 12:12, 12 April 2026 (UTC) :We have a number of issues with section edit links (documented in https://phabricator.wikimedia.org/T391624) that we intend to fix; sorry for the inconvenience - we'll make sure to keep this use case in mind when working on a solution. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:20, 23 April 2026 (UTC) == [https://zh.wikipedia.org/w/index.php?title=COBOL&oldid=91149855&useparsoid=1 zhwiki:COBOL] == 正文开头的“COBOL”英文名无法显示,且全文的繁简转换失效。 The English name "COBOL" for COBOL at the very beginning vanished. Besides, the conversion between traditional and simplified Chinese does not function for the entire page. [[User:Ricky136973|Ricky136973]] ([[User talk:Ricky136973|talk]]) 13:08, 12 April 2026 (UTC) :Parsoid should not (yet) be enabled on zhwiki. If you want to preview how it will work, you can add <code>&parsoidnewlc=1</code> to the end of the URL to use Parsoid's implementation of LanguageConverter. That shows "COBOL" on this page as expected. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:17, 13 April 2026 (UTC) ::Parsoid is now experimentally enabled, so you don't need the `&parsoidnewlc=1` at the end of the URL any more. It appears that the COBOL page renders correctly now? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:40, 21 April 2026 (UTC) == [https://th.wikipedia.org/w/index.php?title=4_%E0%B9%80%E0%B8%97%E0%B8%9E%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B8%9E%E0%B8%B4%E0%B8%97%E0%B8%B1%E0%B8%81%E0%B8%A9%E0%B9%8C&oldid=12947833&useparsoid=1 thwiki:4 เทพผู้พิทักษ์] == อันนี้น่าจะผิดที่ร้องเพลงประกอบละคร [[User:ภรพัฒน์|ภรพัฒน์]] ([[User talk:ภรพัฒน์|talk]]) 12:47, 13 April 2026 (UTC) :Google translate says, "This is probably a mistake—singing the theme song for a TV drama." :This seems like a content issue, not a Parsoid issue. Mistakes in content should be correctly directly on the wiki. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:47, 21 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:%D7%A9%D7%A8%D7%A9%D7%97%D7%95%D7%9F/%D7%98%D7%99%D7%95%D7%98%D7%94&oldid=42822143&useparsoid=1 hewiki:משתמש:שרשחון/טיוטה] == אני רוצה לבטל את המצאות השם יעל סרלין בדף הטיוטות שלי כדי להתחיל ערך חדש [[User:שרשחון|שרשחון]] ([[User talk:שרשחון|talk]]) 12:59, 13 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Acidente_radiol%C3%B3gico_de_Goi%C3%A2nia&oldid=72061996&useparsoid=1 ptwiki:Acidente radiológico de Goiânia] == [[File:Captura_de_tela_de_miniaturas_renderizadas_pelo_Parsoid.png|thumb|250x250px]] As miniaturas estão minúsculas com as margens enormes. [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 15:13, 13 April 2026 (UTC) :It seems to be like this due to :<pre>html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img[width="250"] { width: calc(round(400px * var(--mw-file-upright,1),10px)) }</pre> [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 17:48, 19 April 2026 (UTC) ::{{Tracked|T423676}} [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) ::This should have been fixed by a backport we did yesterday. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:48, 21 April 2026 (UTC) == [https://hr.wikipedia.org/w/index.php?title=Marijana_Bijeli%C4%87&oldid=7429126&useparsoid=1 hrwiki:Marijana Bijelić] == Sve je podvuceno a ne treba tako biti [[User:Nikolica1512|Nikolica1512]] ([[User talk:Nikolica1512|talk]]) 17:08, 13 April 2026 (UTC) :I made some edits for you [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 18:32, 13 April 2026 (UTC) ::Thank you, I ameliorated those problematic parts, could you take a look at it? I hope it is good to go now as an article on wikipedia so people could access it. This person deserves to have a wiki page. ::Regards, [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 21:53, 13 April 2026 (UTC) :::Sorry, no. I was only helping with the syntax error. You'll need to take your request to the hrwiki community [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 22:25, 13 April 2026 (UTC) ::::And how do I do that exactly? Could you help me out with it? [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 22:56, 13 April 2026 (UTC) :::::You can ask on [[:hr:Wikipedija:Kafić]] and I'm sure someone there will help you out [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 00:34, 14 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 dewiki:Hilfe:Parserfunktionen] == Headings which use <code><nowiki><includeonly></nowiki></code> to change nesting level when transcluded don't appear as headings on original page [[User:TheFirstLevelDown|TheFirstLevelDown]] ([[User talk:TheFirstLevelDown|talk]]) 00:01, 14 April 2026 (UTC) :Parsoid does not support gluing heading together like the legacy parser did, so this syntax is not supported. :As an alternative, we suggest something like (to adjust depending on your exact use case) :<syntaxhighlight lang="wikitext"> <includeonly>===== title =====</includeonly> <noinclude>=== title ===</noinclude> </syntaxhighlight> :or, for a less robust version (but that doesn't require repeating the title) :<syntaxhighlight lang="wikitext"> <includeonly>=====</includeonly><noinclude>===</noinclude> title <includeonly>=====</includeonly><noinclude>===</noinclude> </syntaxhighlight> [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 12:45, 14 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Amor_eterno_una_tragedia_anunciada&oldid=172974810&useparsoid=1 eswiki:Amor eterno una tragedia anunciada] == el título de la página está como "Amor eterno una tragedia anunciada" y no deja cambiarlo al original que es "Amor Eterno: Una tragedia anunciada" [[User:Goodfriendspictures|Goodfriendspictures]] ([[User talk:Goodfriendspictures|talk]]) 09:59, 14 April 2026 (UTC) :To me it looks like the [[DISPLAYTITLE]] magic word is disabled though {{wg|AllowDisplayTitle}} in eswiki. Nothing to do with Parsoid. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 10:12, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:TanjaKo/Sandbox&oldid=150217478&useparsoid=1 itwiki:Utente:TanjaKo/Sandbox] == Nel testo non sono presenti errori e le frasi sono sottolineate con una linea rossa ondulata. Come risolverlo visual bug? Grazie [[User:TanjaKo|TanjaKo]] ([[User talk:TanjaKo|talk]]) 17:42, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Raduni/Raduni_in_Sicilia_2026&oldid=150224594&useparsoid=1 itwiki:Wikipedia:Raduni/Raduni in Sicilia 2026] == just on iPhone 14 with iOS 18.7.7 both from safari or chrome and both from logged or unlogged and incognito mode, the last number of the participants list (made with "#") is bigger than the others [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 18:31, 15 April 2026 (UTC) == [https://atj.wikipedia.org/w/index.php?title=Otitikowin&oldid=16878&useparsoid=1 atjwiki:Otitikowin] == pas moyen de travailler en mode visuel sur la page [[User:Luc Patin|Luc Patin]] ([[User talk:Luc Patin|talk]]) 14:56, 16 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Zhang_Zeduan&oldid=173032341&useparsoid=1 eswiki:Zhang Zeduan] == La pagina está incompleta e inpublicable [[User:Mikemj1987|Mikemj1987]] ([[User talk:Mikemj1987|talk]]) 22:08, 17 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:08, 20 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=L%C3%ADnea_E3_(Euskotren_Trena)&oldid=173034070&useparsoid=1 eswiki:Línea E3 (Euskotren Trena)] == La imagen se ve un poco mal por el modo oscuro. [[User:UnniMan|UnniMan]] ([[User talk:UnniMan|talk]]) 00:55, 18 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:09, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Stadtbahn_Karlsruhe&oldid=265878452&useparsoid=1 dewiki:Stadtbahn Karlsruhe] == Shows reference error and the categoy Kategorie:Wikipedia:Seite mit Einzelnachweisfehlern but is not included in https://de.wikipedia.org/wiki/Kategorie:Wikipedia:Seite_mit_Einzelnachweisfehlern The same happens with other articles that had no reference errors with the old parser. Makes maintenance hard. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 09:26, 19 April 2026 (UTC) :Tracked in https://phabricator.wikimedia.org/T423924 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Indiana_Jones_and_the_Fate_of_Atlantis&oldid=265815741&useparsoid=1 dewiki:Indiana Jones and the Fate of Atlantis] == Shows a reference error that is not visible in the preview function. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:06, 19 April 2026 (UTC) :The error came through a Reference with the same name in a used template https://de.wikipedia.org/wiki/Vorlage:Verkaufszahlen_LucasArts_Adventures Still bad to have an error that wasn't there with the old parser and isn't shown in the preview or maintenance category. --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:27, 19 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Evento_Azolla&oldid=72103944&useparsoid=1 ptwiki:Evento Azolla] == [Convert: número inválido] na parte de Efeitos Globais [[User:Marina Funez|Marina Funez]] ([[User talk:Marina Funez|talk]]) 00:28, 20 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:10, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Musikk%C3%A1r&oldid=144140&useparsoid=1 smnwiki:Myenster:Musikkár] == Instead of dealing with this issue and the other issue on smnwiki listed below, these were quietly archived. These are still displaying messed up months later after they were reported the first time. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:53, 20 April 2026 (UTC) :We may have missed this previously, but edits like [https://smn.wikipedia.org/w/index.php?title=Myenster%3AMusikk%C3%A1r&diff=152826&oldid=144359 this] should fix the rendering. This should work for the other pages below as well. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 12:42, 20 April 2026 (UTC) ::Thank you. I'll do the same for any other templates I come across that display like that one did. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 15:49, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Diskografia&oldid=62663&useparsoid=1 smnwiki:Myenster:Diskografia] == Instead of dealing with this issue and the other issue on smnwiki listed above, these were quietly archived. These are still displaying messed up months later after they were reported the first time. -[[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Kirje%C4%8D%C3%A4llee&oldid=32928&useparsoid=1 smnwiki:Myenster:Kirječällee] == Like the other display issues in smnwiki, this is also displaying messed up after the change. [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. For all other pages you encounter on wiki like this, please make similar edits. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Donald_A._Wollheim&oldid=266357315&useparsoid=1 dewiki:Donald A. Wollheim] == Picture is shown within a big white box, which isn't the case with the old parser. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 11:15, 20 April 2026 (UTC) :[[phab:T421524]] [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe_Diskussion:Bilder&oldid=266370955&useparsoid=1 dewiki:Hilfe Diskussion:Bilder] == see [[w:de:Hilfe Diskussion:Bilder #Skalierung von Bildern mit dem Parameter hochkant scheint nicht mehr zu funktionieren]] [[User:BurghardRichter|BurghardRichter]] ([[User talk:BurghardRichter|talk]]) 22:24, 20 April 2026 (UTC) == [https://tcy.wikipedia.org/w/index.php?title=%E0%B2%AE%E0%B3%81%E0%B2%96%E0%B3%8D%E0%B2%AF_%E0%B2%AA%E0%B3%81%E0%B2%9F&oldid=359337&useparsoid=1 tcywiki:ಮುಖ್ಯ ಪುಟ] == in main page not enable <code>html.skin-theme-clientpref-night</code> [[User:ChiK|ChiK]] ([[User talk:ChiK|talk]]) 05:47, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:23, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == https://de.wikipedia.org/wiki/Gemeindestandsver%C3%A4nderungen_in_der_Schweiz == Die Links zu den Ankern gehen nicht [[Special:Contributions/&#126;2026-24437-27|&#126;2026-24437-27]] ([[User talk:&#126;2026-24437-27|talk]]) 11:53, 21 April 2026 (UTC) :I see you found a solution :) :For the exact issue: generating ids independently from their enclosing tag is not supported by Parsoid (although this is not documented - I'll fix that). :Thanks for the report! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:16, 21 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Albosaggia&oldid=50063504&useparsoid=1 svwiki:Albosaggia] == This article, and thousands of other articles, have erroneously been put in hidden categories [[:sv:Kategori:Sidor med referensfel]] and [[:sv:Kategori:Wikipedia:Projekt översätta källmallar]]. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 12:24, 21 April 2026 (UTC) :You can mark this issue as fixed. The problem root cause was in a new Template and Module created this morning. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:40, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Eurovision_Song_Contest_1992&oldid=258716277&useparsoid=1 dewiki:Eurovision Song Contest 1992] == Quelltext bearbeiten ist für Abschnitte nicht sichtbar [[User:Anmey10112|Anmey10112]] ([[User talk:Anmey10112|talk]]) 13:00, 21 April 2026 (UTC) :Translation: "Edit source" is not visible for sections. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Boro%C8%99e%C8%99ti,_Ia%C8%99i&oldid=17665231&useparsoid=1 rowiki:Boroșești, Iași] == Satul este Borosești nu Boroșești. [[User:Stalmada|Stalmada]] ([[User talk:Stalmada|talk]]) 13:07, 21 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:09, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Gebouwge%C3%AFntegreerde_zonnepanelen_(BIPV)&oldid=71021732&useparsoid=1 nlwiki:Gebouwgeïntegreerde zonnepanelen (BIPV)] == Bij de afbeeldingen zijn 3 afbeeldingen gecombineerd met de sjabloon {{Afbeelding combi}} . De sjabloon maakt gebruikt van elk aparte tekstvelden voor elke afbeeldingen. Echter is in dit geval bij de eerste twee afbeeldingen geen gebruik gemaakt van tekstveld en is al de tekst aan het eind geplaatst bij de laatste afbeelding. Door dit gebruik van de sjabloon worden de afbeeldingen zonder spatie direct na elkaar vertoont. Op de mobiele website worden de afbeeldingen met dit sjabloon wel met spaties vertoont. Merk op dat de engelse template wel de mogelijkheid heeft om afbeeldingen gecombineerd te laten zien met spaties er tussen en heeft deze variant template meer mogelijkheden dan de NL versie. Mogelijk dat er de uitwerkin ook niet helemaal correct is geweest, maar hierover is niet te oordelen vanwege de beperkte Wiki edit kennis. [[User:Public-Publicity|Public-Publicity]] ([[User talk:Public-Publicity|talk]]) 16:16, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:22, 21 April 2026 (UTC) :Translation: "In this section, three images have been combined using the template `Template:Afbeelding combi`. This template typically utilizes a separate text field for each individual image; however, in this specific instance, the text fields for the first two images were left unused, and all the accompanying text was instead placed at the end, alongside the final image. As a result of this specific application of the template, the images are displayed consecutively without any spacing between them. On the mobile version of the website, however, images utilizing this template *are* displayed with spacing. It is worth noting that the English-language version of this template *does* offer the capability to display combined images with spacing in between—making that variant of the template more versatile than its Dutch counterpart. It is possible that the implementation itself was not entirely correct; however, it is difficult to pass judgment on this matter due to limited expertise in Wiki editing." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:12, 23 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Talk:Rao_Laxmi_Chand&oldid=10828084&useparsoid=1 simplewiki:Talk:Rao Laxmi Chand] == This Page is fake and all the information is fake [[User:Rao Gourav|Rao Gourav]] ([[User talk:Rao Gourav|talk]]) 17:23, 21 April 2026 (UTC) :Triage: Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:28, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:07, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80%D0%BE%D0%B2%D1%81%D0%BA%D0%B8%D0%B9,_%D0%A1%D1%82%D0%B5%D0%BF%D0%B0%D0%BD_%D0%A4%D1%91%D0%B4%D0%BE%D1%80%D0%BE%D0%B2%D0%B8%D1%87&oldid=152793914&useparsoid=1 ruwiki:Александровский, Степан Фёдорович] == дублируется реф в инфобоксе [[User:Gleb95|Gleb95]] ([[User talk:Gleb95|talk]]) 20:21, 21 April 2026 (UTC) :Translation: "The reference is duplicated in the infobox." :The legacy parser version has 19 references in the references list, and Parsoid contains 22. This is likely a content issue, although I haven't looked into it to determine root cause. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:11, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is plenty of problems I see related to transliteration to Serbian Cyrillic. I prefer reading articles in Serbian Cyrillic (on top of our UI, I select "Ћирилица"). In current state, Parsoid should not be turned on at all on our Wikipedia {{multiple image | align = center | total_width = 1000 | image1 = Jefri Saks (no Parsoid).png | caption1 = Without Parsoid | image2 = Jefri Saks (Parsoid).png | caption2 = With Parsoid }} Note that, with Parsoid, everything is transliterated, even when marked with correct <nowiki><lang></nowiki> attribute. Without parsoid, original English text is correctly left un-transliterated. There is also a glitch where URL is not rendered in infoboxes, again, probably something about misrendering text which was supposed to avoid transliteration. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:43, 21 April 2026 (UTC) :This is [[phab:T424159|T424159 [P0] Parsoid doesn't "guessVariant" at top level on Serbian Wikipedia, and makes sr-ec rendering "unusable" for some pages]]. Fundamentally, the mark up on that page is incorrect, in so far as English and Latin text aren't properly marked with `-{....}-`. It "worked before" because of a top-level "guessVariant" routine which effectively disabled language converter entirely on some pages, including this one. I suspect I'm going to have to implement the same 'guessVariant' mechanism in Parsoid, since there appears to be too much content of this type without proper language markers. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:04, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is no "Edit with migration tool" entry in tools on Serbian Wikipedia. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:50, 21 April 2026 (UTC) :It needs to be enabled explicitly in Preferences > Editing > Developer tools > Enable parser migration tool. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:44, 23 April 2026 (UTC) == includeonly in headline syntax == no longer resolved properly == ''Example:'' [[w:de:Hilfe:Parserfunktionen]] This page (and many others of our help pages) are made for dual use: # stand alone # transclusion of several help pages of similar topic into a combined complete story. They contain headlines like <syntaxhighlight lang="wikitext"> <includeonly>=</includeonly>== Allgemeines ==<includeonly>=</includeonly> </syntaxhighlight> If stand alone, this shall be displayed as H2. * When combined, the page title will be shown as H2 and the section as H3. Swift solution most welcome – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:23, 22 April 2026 (UTC) : BTW – transclusion works correctly: [[w:de:Hilfe:Parserfunktionen/*]] --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:27, 22 April 2026 (UTC) :https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 has our suggested solution (the first form preferably). It works in transclusion mode because the preprocessor is involved. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:53, 22 April 2026 (UTC) ::“has our suggested solution (the first form preferably). It works” ::I do not understand what is “our suggested solution” – please look at this current page. It has neither TOC nor any headline, since the == are displayed within the text, using the default parsing. There are 10 headlines. ::Astonished – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 21:45, 22 April 2026 (UTC) :::Oops .. sorry! I pasted the wrong link! I meant to point you to [[#dewiki:Hilfe:Parserfunktionen|this section]] on this page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 00:09, 23 April 2026 (UTC) You’re imposing some work on us. * I am happy that there are [https://de.wikipedia.org/w/index.php?search=H:+insource:includeonly+insource:%2Fincludeonly%5C%3E%3D%2B%5C%3C%5C%2Fincludeonly%2F&title=Spezial:Suche 12 pages only] to be updated now. * Fortunately, some other syntax has been used in [[w:de:H:VE/*]] – [[w:de:H:Lua/*]] – [[w:de:H:Tabellen/*]] – [[w:de:H:FAQ/Übersicht]] which are merging a huge pile of single pages. I do hope this exception will be described in WikiSyntax Documentation soon. --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 11:04, 23 April 2026 (UTC) :Thanks for your understanding and fixing the pages. Given all the work we've done to deploy to a wiki, at this point, we expect that all remaining rendering issues are likely going to be edge cases that affect small number of pages. We'll update the docs soon, yes. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:22, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%9F%D1%80%D0%B5%D0%B4%D1%83%D0%BF%D1%80%D0%B5%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5&oldid=116093745&useparsoid=1 ruwiki:Шаблон:Предупреждение] == [[:ru:Шаблон:Tpre]] ([[:ru:Модуль:Template call code]]) stops working entirely in Parsoid mode. See also local discussion: [[:ru:Википедия:Форум/Технический#c-Tarkoff-20260422084300-Шаблон:Предупреждение]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 16:40, 22 April 2026 (UTC) :That doesn't look good. Do you have a sense of how many pages are impacted? We will take a look tomorrow and see what is going on and if we can roll out a quick fix. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:07, 22 April 2026 (UTC) ::I see what is going on. This is [[phab:T353697|T353697]] which was resolved with https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/992274. The fix is to have the modules emit <code>format="wikitext"</code> so the <nowiki><span> tags aren't escaped as literal output. Can you see if that fixes it?</nowiki> [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:22, 22 April 2026 (UTC) ::: Yes, thank you. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:47, 22 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Rei_Ami&oldid=266367300&useparsoid=1 dewiki:Rei Ami] == The image of Ami on the top right corner should be rendered with a width of 250px but seems to be scaled down to round about 160px. When using the Legacy Parser the image is rendered as expected. The issue seems to effect only some images. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 18:59, 22 April 2026 (UTC) :@[[User:Jon (WMF)|Jon (WMF)]] says, "The original size of the image is 315x427. This is https://phabricator.wikimedia.org/T421524 - only way to fix it is for Parsoid to mark the img up with a class when the image original size is smaller than 400px. Otherwise it's working as expected." I'm not entirely sure I agree with this diagnosis, since T421524 would cause the image to appear "too large" not "too small". :@[[User:Guardian of Arcadia|Guardian of Arcadia]] what is your user thumbnail size preference, and what skin are you using? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:13, 23 April 2026 (UTC) ::@[[User:Cscott|Cscott]]: I'm using the default thumbnail size of 250px and Vector 2010 (Legacy) as skin. But the size issue also occurs when using other skins like Vector 2022, which can be seen by appending <code>useskin=vector-2022</code> to the URL or viewing the page in an incognito window. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 20:37, 23 April 2026 (UTC) :::What browser and version are you using @[[User:Guardian of Arcadia|Guardian of Arcadia]] ? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 21:46, 23 April 2026 (UTC) ::::Also can you check you don't have a different preference set in [[Special:GlobalPreferences]] and possibly try changing it and changing it back? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:55, 23 April 2026 (UTC) ::::@[[User:Jon (WMF)|Jon (WMF)]]: The issue isn't limited to my account only; it occurs in a logged-out state (within an incognito window) too. But your guess about the browser seems to be right: I have the described issue when using Firefox with the ESR version 115.35.0esr. Today I have tested with another browser (Chrome and Edge) as well as on a PC with a current (non-ESR) Firefox and there the image is shown as expected. So, is this a bug in this specific Firefox version? [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 19:47, 24 April 2026 (UTC) :::::Yes. This sounds like a bug in that specific Firefox version. If you can give me more details about the operating system version you are using I can see if I can replicate in browserstack.com . Is it possible there are any browser extensions installed on that browser? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 22:31, 24 April 2026 (UTC) ::::::The operating system on this PC is Windows 8.1 (Build 9600) and I do not have any browser extensions installed there. Hope this helps to reproduce the issue. If you need anything else please let me know. Thanks for your help. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 22:44, 24 April 2026 (UTC) :::::::That was incredibly useful information, thank you. I understand what is happening now, and there might be something we can do here. Note, this browser is on the cusp of our usual browser support levels, which is what's causing the problem. [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 16:54, 27 April 2026 (UTC) ::::::::That's great news. I would be verry happy if you or your team can fix it. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 17:00, 27 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Alexandru_Dobrogeanu-Gherea&oldid=17669378&useparsoid=1 rowiki:Alexandru Dobrogeanu-Gherea] == imaginea prea mare, la fel la multe articole cu infocaseta om politic, de pilda Vasile Luca, Luminita Odobescu etc face contrast cu imagini in alte infocasete unde problema se poate regla [[User:Ewan2|Ewan2]] ([[User talk:Ewan2|talk]]) 01:25, 23 April 2026 (UTC) :Google translate: "the image is too large, the same as in many articles with the politician infobox, for example Vasile Luca, Luminita Odobescu, etc. it contrasts with images in other infoboxes where the problem can be adjusted." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 18:50, 23 April 2026 (UTC) ::@[[User:Jon (WMF)|Jon (WMF)]] says "For Romanian Wikipedia, there was a problem with the infobox styles. Pretty sure it's been fixed since. It could just be that he's seeing 400px instead of 300px. The infobox image looks identical to me in Parsoid and legacy." ::@[[User:Ewan2|Ewan2]] are you using the default thumbnail size (250px) or a larger size in your user preferences? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:07, 23 April 2026 (UTC) == [https://zu.wikipedia.org/w/index.php?title=Gashamo_Hawd_Somali_Ethiopia&oldid=122552&useparsoid=1 zuwiki:Gashamo Hawd Somali Ethiopia] == Is the city of Hawd Zone [[User:Maaaaskaas11|Maaaaskaas11]] ([[User talk:Maaaaskaas11|talk]]) 21:58, 23 April 2026 (UTC) == [https://ru.wikipedia.org/wiki/Текумсе ruwiki:Текумсе] == For some reason, the comment "До эскиза Лоссинга не было известно..." is repeated twice (see subsection "Комментарии" at the end of the article). This comment is generated by template "ref+" placed inside the template "персона" (an analogue of "Template:Infobox person"), and it is supposed to appear only once. Thanks! [[User:Adavyd|Adavyd]] ([[User talk:Adavyd|talk]]) 22:04, 23 April 2026 (UTC) :This is probably {{phab|T415789}}, which would be solved by adding a name to the reference, but then we end up running into {{phab|T423924}} - the template ends up defining the reference twice with subtly different content (as far as Parsoid is concerned) and the same name, which triggers an error. The fix will probably be to add a name to the reference once {{phab|T423924}} is handled. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:43, 24 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=FIDO2&oldid=264704558&useparsoid=1 dewiki:FIDO2] == Erste Grafik überlagert den Text und die Werkzeugleiste links [[User:Hinnerk11|Hinnerk11]] ([[User talk:Hinnerk11|talk]]) 23:51, 23 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Amanda_Kathrine_Smith/Sandbox&oldid=150348388&useparsoid=1 itwiki:Utente:Amanda Kathrine Smith/Sandbox] == i don't see the "MOVE DRAFT" button. [[User:Amanda Kathrine Smith|Amanda Kathrine Smith]] ([[User talk:Amanda Kathrine Smith|talk]]) 14:14, 24 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:36, 28 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%A1%D1%80%D0%B1%D0%B8%D1%98%D0%B0_(1071%E2%80%941217)&oldid=30892614&useparsoid=1 srwiki:Србија (1071—1217)] == Text inside {{lang-la.. and other {{lang-... templates is not displayed at all. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:46, 24 April 2026 (UTC) :Never mind, in process of adapting our templates for Parsoid, I missed additional change needed in an auxillary module. All is good now. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A2%D1%80%D0%B3/%D0%94%D1%80%D1%83%D0%B3%D0%B8&oldid=30921466&useparsoid=1 srwiki:Википедија:Трг/Други] == <nowiki>__NOCONTENTCONVERT__</nowiki> does not work in Parsoid. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 18:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=Queen&oldid=30824348&useparsoid=1 srwiki:Queen] == Parsoid does not honor __БЕЗКН__ (magic word to suppress title conversion during language conversion) [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 20:03, 24 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%A4%D0%BE%D1%80%D1%83%D0%BC/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8&oldid=152858025&useparsoid=1 ruwiki:Википедия:Форум/Новости] == Исчез логотип в скине Вектор-2010 при включенном гаджете, который отображает праздничные логотипы. При отключении гаджета в настройках — повседневный логотип виден. [[User:Рыцарь поля|Рыцарь поля]] ([[User talk:Рыцарь поля|talk]]) 00:16, 25 April 2026 (UTC) :Triage: not a Parsoid visual issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:22, 27 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9F%D1%80%D0%BE%D0%B5%D0%BA%D1%82:%D0%91%D0%B8%D0%B1%D0%BB%D0%B8%D0%BE%D1%82%D0%B5%D0%BA%D0%B0/%D0%A2%D1%80%D0%B5%D0%B1%D1%83%D1%8E%D1%82%D1%81%D1%8F_%D0%BA%D0%BD%D0%B8%D0%B3%D0%B8&oldid=152853098&useparsoid=1 ruwiki:Проект:Библиотека/Требуются книги] == Конфликт [[:ru:Проект:Библиотека/Требуются книги/Шапка]] с содержанием страницы, из-за чего в [[:ru:Шаблон:shortcut|Шаблон:shortcut]] помещается раздел "содержание" (выглядит это так: [https://ibb.co/219kN3dW 1] и [https://ibb.co/bgM0Fmpn 2]). ------- The conflict between [[:ru:Проект:Библиотека/Требуются книги/Шапка]] and the page content causes the "содержание" section to appear inside [[:ru:Шаблон:shortcut|Шаблон:shortcut]] (this is how it looks: [https://ibb.co/219kN3dW 1] and [https://ibb.co/bgM0Fmpn 2]). [[User:Футболло|Futbollo]] ([[User talk:Футболло|talk]]) 01:10, 25 April 2026 (UTC) :Thank you for the report - I've filed {{phab|T424492}} for it. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:33, 27 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Copa_Intercontinental_da_FIFA_de_2025&oldid=72134360&useparsoid=1 ptwiki:Copa Intercontinental da FIFA de 2025] == Quadro de informações foi excluído por acidente. [[User:AnderSilv42|AnderSilv42]] ([[User talk:AnderSilv42|talk]]) 00:16, 26 April 2026 (UTC) :Triage: Content related - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 15:23, 26 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Michel_W%C3%B6cke&oldid=266505400&useparsoid=1 dewiki:Michel Wöcke] == Bild (Thumb) viel zu gross [[User:Albinfo|Albinfo]] ([[User talk:Albinfo|talk]]) 13:44, 26 April 2026 (UTC) == [https://tn.wikipedia.org/w/index.php?title=Sekolo_Se_Segolwane_Sa_Nata&oldid=49572&useparsoid=1 tnwiki:Sekolo Se Segolwane Sa Nata] == I tried fixing the references but It still says pages with reference errors so I don't know what could be the issue [[User:Blackgirlmighty|Blackgirlmighty]] ([[User talk:Blackgirlmighty|talk]]) 17:00, 26 April 2026 (UTC) :You only need to define a reference once even if you want to use it multiple times - see https://www.mediawiki.org/wiki/Help:Cite#Multiple_uses_of_the_same_footnote for more information. One of each of the references Mmegi2012 and Mmegi2023 should be kept as is; the others should be replaced by <nowiki><ref name="Mmegi2012" /></nowiki> (or 2023) without content. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:39, 27 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Pete_Aguilar&oldid=8671369&useparsoid=1 simplewiki:Pete Aguilar] == This is a less detailed copy of another Wikipedia page. There are two wiki pages showing Pete Aguilar and this is an outdated version. [[User:SuperPug3739|SuperPug3739]] ([[User talk:SuperPug3739|talk]]) 04:56, 27 April 2026 (UTC) :Triage: content related, not Parsoid related [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:46, 27 April 2026 (UTC) == [https://fi.wikipedia.org/w/index.php?title=Hoito-_kasvatussuunnitelma&oldid=23973675&useparsoid=1 fiwiki:Hoito- kasvatussuunnitelma] == Sivun nimi piti olla Hoito- ja kasvatussuunnitelma. Muokkaaminen ei onnistunut. [[User:Nebiux|Nebiux]] ([[User talk:Nebiux|talk]]) 12:01, 29 April 2026 (UTC) :Triage: content related, not Parsoid-related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:04, 30 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Usuario:Luigi_Nakano&oldid=173203320&useparsoid=1 eswiki:Usuario:Luigi Nakano] == An error appears, which should appear when template [[w:es:Plantilla:Estado usuario|Estado usuario]] has nothing in 1=. However, there is a parameter in 1=, so the result should be "Conectado" or "Desconectado", and not "Error:No se ha indicado usuario.". [[User:Luigi Nakano|<span style="color:green">Luigi</span> <span style="color:blue">Nakano</span>]] [[File:Emojione 1F3A7.svg|15px]] ([[User talk:Luigi Nakano|会話]]) 23:12, 29 April 2026 (UTC) :This looks like {{phab|T348722}}, for which a workaround is suggested in https://www.mediawiki.org/wiki/Parsoid/Parser_Unification/Instructions_for_editors#Access_to_parent_frame_from_within_extensions. Let us know if the problem persists after the fix! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:10, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=History_of_the_Ryukyu_Islands&oldid=1336895218&useparsoid=1 enwiki:History of the Ryukyu Islands] == The multiple issues display unsourced template when editing the article there is no such template. [[User:Lightoil|Lightoil]] ([[User talk:Lightoil|talk]]) 05:11, 30 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A7%D1%85%D0%B0%D0%B8%D0%B4%D0%B7%D0%B5,_%D0%9C%D0%B0%D0%BC%D0%B8%D1%8F_%D0%92%D0%B8%D1%81%D1%81%D0%B0%D1%80%D0%B8%D0%BE%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&oldid=152923873&useparsoid=1 ruwiki:Чхаидзе, Мамия Виссарионович] == In the old parser, links to non-existing file pages lead to Special:Upload for the file. In Parsoid, it's a strange link to Special:FilePath, which ends up confusing the editors who accustomed to uploading files this way. [[:ru:Служебная:GoToComment/c-ФВ-20260430140600-Не_загружается_файл|See local discussion]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:53, 30 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%94%D0%B5%D1%80%D0%B2%D0%B8%D1%88_%D0%9A%D0%BE%D1%80%D0%BA%D1%83%D1%82&oldid=30931273&useparsoid=1 srwiki:Дервиш Коркут] == At the bottom, there are several navboxes, Parsoid adds some whitespace between them [[File:Spaces between navboxes with Parsoid..png]] [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 21:21, 30 April 2026 (UTC) : https://phabricator.wikimedia.org/T425123 [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 15:27, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Sevayat&oldid=1351876642&useparsoid=1 enwiki:Talk:Sevayat] == The content assessment and talk page are displayed directly on the talk page, rather than within the “About this page” section (mobile view). [[User:S4yam|S4yam]] ([[User talk:S4yam|talk]]) 21:44, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:Template_editor&oldid=1351909200&useparsoid=1 enwiki:Wikipedia talk:Template editor] == I'm artist thi is my personal biography page [[User:Allymtulia|Allymtulia]] ([[User talk:Allymtulia|talk]]) 21:45, 30 April 2026 (UTC) :Triage: Content issue, not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Middle_of_Nowhere_(Kacey_Musgraves_album)&oldid=1351931473&useparsoid=1 enwiki:Middle of Nowhere (Kacey Musgraves album)] == Producer parameter that adops hlist system in Infobox album template occurs an error. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 01:07, 1 May 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Associazione_Calcio_Perugia_1996-1997&oldid=148287407&useparsoid=1 itwiki:Associazione Calcio Perugia 1996-1997] == Doesn't show all kits. Just the third and on top of the screen [[User:Madive60|Madive60]] ([[User talk:Madive60|talk]]) 01:29, 1 May 2026 (UTC) :This is probably fixed by the fix to {{phab|T425056}} and the current CSS workaround on-wiki. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:22, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%9B%BD%E6%97%97%E3%81%AE%E4%B8%80%E8%A6%A7&oldid=109342678&useparsoid=1 jawiki:国旗の一覧] == イラクの国旗がない [[User:平舞|平舞]] ([[User talk:平舞|talk]]) 03:17, 1 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:21, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Manting_Chan&oldid=1351960413&useparsoid=1 enwiki:Manting Chan] == Divorce, she is not divorced. [[User:Bananahammock311911511|Bananahammock311911511]] ([[User talk:Bananahammock311911511|talk]]) 04:54, 1 May 2026 (UTC) :Content issue, not a Parsoid issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 07:30, 1 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E9%9B%B7%E9%96%80%E9%9F%B3%E5%8A%A9&oldid=109345108&useparsoid=1 jawiki:雷門音助] == {{人名の曖昧さ回避}}や{{aimai}}を貼ると表示が崩れる。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 07:27, 1 May 2026 (UTC) :<nowiki>[[:jawiki:雷門五郎]]</nowiki>でも同様の問題が起きています。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 09:09, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Iceman_(Drake_album)&oldid=1350717409&useparsoid=1 enwiki:Talk:Iceman (Drake album)] == Banners showing up on mobile, not under “learn more about this page button” [[User:OrbitalVoid49|OrbitalVoid49]] ([[User talk:OrbitalVoid49|talk]]) 09:36, 1 May 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Bancu,_Harghita&oldid=13617293&useparsoid=1 rowiki:Bancu, Harghita] == Steagulnjudetului Hargita nu este acea cârpă secuiasca. [[User:Auto 4115|Auto 4115]] ([[User talk:Auto 4115|talk]]) 01:39, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Aurangabad&oldid=1351274322&useparsoid=1 enwiki:Aurangabad] == It has the old name of the city as it's title [[User:20mphwind|20mphwind]] ([[User talk:20mphwind|talk]]) 07:09, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%B9%E0%A6%BE%E0%A6%9C%E0%A6%B0%E0%A6%BE%E0%A6%AC%E0%A6%BE%E0%A6%A1%E0%A6%BC%E0%A7%80_%E0%A6%89%E0%A6%9A%E0%A7%8D%E0%A6%9A_%E0%A6%AC%E0%A6%BF%E0%A6%A6%E0%A7%8D%E0%A6%AF%E0%A6%BE%E0%A6%B2%E0%A6%AF%E0%A6%BC&oldid=8874755&useparsoid=1 bnwiki:হাজরাবাড়ী উচ্চ বিদ্যালয়] == তথ্যসুত্র ব্যয়বহুল নয়। [[User:Md Umor Faruk 2010|Md Umor Faruk 2010]] ([[User talk:Md Umor Faruk 2010|talk]]) 08:00, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=She_Did_It_Again&oldid=1352147079&useparsoid=1 enwiki:She Did It Again] == (Mobile) Huge error in hlist. Bullet points (•) are missing, and the items listed are arranged very roughly. Not sure why this error occurs for over three days. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 10:45, 2 May 2026 (UTC) :Thank you for the report - I have filed {{phab|T425245}} for this issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:30, 3 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%91%E4%B8%8A%E5%93%B2&oldid=109361964&useparsoid=1 jawiki:村上哲] == [[Template:循環参照]]が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:13, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=Wikipedia:%E4%BA%95%E6%88%B8%E7%AB%AF&oldid=109349724&useparsoid=1 jawiki:Wikipedia:井戸端] == 目次が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1 enwiki:Wiki (disambiguation)] == [[w:en:tm:dab]] (at the bottom of the page) appears to render differently on Parsoid compared to non-Parsoid. <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 14:27, 2 May 2026 (UTC) :Also appears to render differently on desktop Parsoid v. mobile Parsoid -- compare https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=mobile (different rendering) vs. https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=desktop ('expected' rendering, AFAIK) <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 16:34, 2 May 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Horv%C3%A1th_Kriszti%C3%A1n_(fest%C5%91,_1976,_Budapest)&oldid=28948319&useparsoid=1 huwiki:Horváth Krisztián (festő, 1976, Budapest)] == Az a probléma, hogy nem szeretném hoyg festő, és 1976 Budapest legyen hozzá kírva. Elrontottam, és nem tudtam külön, új cikket írni róla. [[User:Pizzsus|Pizzsus]] ([[User talk:Pizzsus|talk]]) 20:47, 2 May 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%99%D7%A6%D7%97%D7%A7_%D7%9E%D7%90%D7%99%D7%A8_%D7%90%D7%9C%D7%AA%D7%A8&oldid=43088529&useparsoid=1 hewiki:יצחק מאיר אלתר] == הציטוטים בכתב דיויד בעברית לקויים. Text quotes in David font are displayed poorly. [[User:פרידבערג|פרידבערג]] ([[User talk:פרידבערג|talk]]) 21:36, 2 May 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9B%D0%B8%D1%86%D0%B5%D0%BD%D0%B7%D0%B8%D0%B8_%D0%B8_%D0%B8%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B_Creative_Commons&oldid=152790052&useparsoid=1 ruwiki:Лицензии и инструменты Creative Commons] == refs don't work with vector-2010 (but it works for vector-2022) [[User:Petsernik|Petsernik]] ([[User talk:Petsernik|talk]]) 23:05, 2 May 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Huawei&oldid=173270512&useparsoid=1 eswiki:Huawei] == El segundo sitio web que sale no existe es un vandalismo en wikimedia ingles o un error [[User:Usuario 016|Usuario 016]] ([[User talk:Usuario 016|talk]]) 23:15, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%8C%97%E6%9D%91%E8%81%A1&oldid=109365307&useparsoid=1 jawiki:北村聡] == 人名の曖昧さ回避Templateを挿入すると、上手く表示されず、大きな改行空白と共に「.mw-parser-output .dmbox{display:flex;align-items:center;clear:both;margin:0.9em 1em;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:0.25em 0.35em;font-size:95%}.mw-parser-output .dmbox>*{flex-shrink:0;margin:0 0.25em;display:inline}.mw-parser-output .dmbox-body{flex-grow:1;flex-shrink:1;padding:0.1em 0}」 というものが出る。 [[User:Geogie|Geogie]] ([[User talk:Geogie|talk]]) 23:35, 2 May 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Schreibwettbewerb&oldid=266703390&useparsoid=1 dewiki:Wikipedia:Schreibwettbewerb] == Text in der Blauen Tabelle ("Reviewpreis") überschneidet die rechte äußere Begrenzungslinie [[User:Polibil|Polibil]] ([[User talk:Polibil|talk]]) 15:30, 3 May 2026 (UTC) == [https://en.wikipedia.org/wiki/Template:Center enwiki:Template:Center] == Does not load on mobile version, most of the page tools are missing. [[File:Template Center issue.jpg|thumb|issue]] [[User:Misterpotatoman|Misterpotatoman]] ([[User talk:Misterpotatoman|talk]]) 19:28, 3 May 2026 (UTC) == [https://gl.wikipedia.org/w/index.php?title=Limodre,_Fene&oldid=7383114&useparsoid=1 glwiki:Limodre, Fene] == Fueron borrados los lugares de la parroquia de Limodre sin querer [[User:Vi1993|Vi1993]] ([[User talk:Vi1993|talk]]) 22:03, 3 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=Template:Aimai&oldid=93697981&useparsoid=1 jawiki:Template:Aimai] == I am seeing a layout breakage where TemplateStyle CSS is rendered as plain text, but only when the page is processed via Parsoid. 「.mw-parser-output .dmbox{display:flex;align-items:center;clear:both;margin:0.9em 1em;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:0.25em 0.35em;font-size:95%}.mw-parser-output .dmbox>*{flex-shrink:0;margin:0 0.25em;display:inline}.mw-parser-output .dmbox-body{flex-grow:1;flex-shrink:1;padding:0.1em 0}」 The output shows the CSS source code from the TemplateStyles of Template:Dmbox. Source of the CSS: https://ja.wikipedia.org/wiki/Template:Dmbox/styles.css The behavior is intermittent across different articles that call the same template. Some display correctly, while others fail. I haven't been able to identify the exact trigger for this discrepancy. [[User:Yukida-R|Yukida-R]] ([[User talk:Yukida-R|talk]]) 02:16, 4 May 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Iliade&oldid=59249057&useparsoid=1 svwiki:Iliade] == Jag är jätte ledsen jag trodde det stod Illiaden på en länk och jag trodde det inte fanns en artikel om det på svenska wikipedia. Kan någon snälla ta bort denna? Förlåt. [[User:EliteWoodCutter|EliteWoodCutter]] ([[User talk:EliteWoodCutter|talk]]) 10:56, 4 May 2026 (UTC) 18b5lcl84zfaz4t5sjvppvpqwmi7lnp 8365128 8365127 2026-05-04T10:59:04Z IHurbainPalatin (WMF) 17494681 /* enwiki:Template:Center */ Reply 8365128 wikitext text/x-wiki Post your feedback about using [[Parsoid/Parser Unification|Parsoid]] to render articles. [[Parsoid/Parser_Unification/Known_Issues|Learn how to report problems clearly]]. '''Need more attention? [https://phabricator.wikimedia.org/maniphest/task/edit/form/43/?projects=PHID-PROJ-3y2wduoz5xezwveaq426 Report directly in Phabricator].''' {{note|This is for reporting feedback on the integration of the Parsoid parser only. '''For wiki content issues, such as concerns about article content, please report on your local wiki.''' }} [[Parsoid/Parser_Unification/Known_Issues|View known issues]] __NEWSECTIONLINK__ {{Archive box| [[/Archive 1]] [[/Archive 2]]}} == [https://nl.wikipedia.org/w/index.php?title=Wikipedia:Aanmelding_moderatoren&oldid=70702688&useparsoid=1 nlwiki:Wikipedia:Aanmelding moderatoren] == Sometimes, in a numbered list, the number stays on the first line when there are indented lines below it, and sometimes the number is vertically aligned between the different lines. For votes, it is preferable that the number remains on the line that starts with only “#” and not on lines with an indentation “#:”. [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:34, 15 February 2026 (UTC) :i.e. see item 33. under '<nowiki/>'''''Voor moderatorschap ContextCreator'''<nowiki/>'<nowiki/>'' [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 15:36, 15 February 2026 (UTC) ::I can't see any difference between Parsoid and the legacy Parser on that page, it appears that the number is correctly aligned in both cases. Are you using a different skin by any chance? Does the difference still appear? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:42, 21 April 2026 (UTC) :::I see no difference anymore - it is fixed. Thanks anyway! [[User:Elphie|Elphie]] <small>(they/them)</small> ([[User talk:Elphie|talk]]) 16:01, 21 April 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Discussion_Wikip%C3%A9dia:Wikiconcours&oldid=233327486&useformat=mobile&useparsoid=1 frwiki:Discussion Wikipédia:Wikiconcours] == Content that is hidden inside the "Learn more about this page" button from MobileFrontend with legacy parser is not inside it with Parsoid. [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 08:32, 22 February 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Laurence_Olivier&oldid=148833592&useparsoid=1 itwiki:Laurence Olivier] == Giant Oscar statue icons (sgranate) [[User:UmbraSolis|UmbraSolis]] ([[User talk:UmbraSolis|talk]]) 20:28, 19 February 2026 (UTC) :This was probably due to https://phabricator.wikimedia.org/T417828, which is now fixed. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:53, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:43, 21 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Bologna_Football_Club_1909&oldid=149496425&useparsoid=1 itwiki:Bologna Football Club 1909] == problem with displaying football shirts [[User:Gio Bike|Gio Bike]] ([[User talk:Gio Bike|talk]]) 17:49, 20 February 2026 (UTC) :Can you be more specific, or is it fixed now? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:55, 27 February 2026 (UTC) ::Now it is OK [[Special:Contributions/&#126;2026-13011-93|&#126;2026-13011-93]] ([[User talk:&#126;2026-13011-93|talk]]) 17:20, 27 February 2026 (UTC) :::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:44, 21 April 2026 (UTC) == [https://vi.wiktionary.org/w/index.php?title=Wiktionary:Th%E1%BB%91ng_k%C3%AA/S%E1%BB%91_m%E1%BB%A5c_t%E1%BB%AB_theo_ng%C3%B4n_ng%E1%BB%AF/T%E1%BA%A5t_c%E1%BA%A3&oldid=2331126&useparsoid=1 viwiktionary:Wiktionary:Thống kê/Số mục từ theo ngôn ngữ/Tất cả] == Phần cuối bảng bị lỗi, không hiện ra số mục từ mà chỉ hiện ra "0" hoặc "-2" mà không rõ lý do, tôi không viết nhầm gì cả. (English: The table got error, just display "0" or "-2", but I don't have any error at write wikitext.) [[User:NHNAnh|NHNAnh]] ([[User talk:NHNAnh|talk]]) 05:57, 21 February 2026 (UTC) :I believe this might be due to "Expensive parser function count: 1080/500" in the debug log: there are too many expensive parser function counts on this page (PAGESINCATEGORY is expensive), and the later functions are not executed. :I would suggest splitting the page into several pages, if possible. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:04, 27 February 2026 (UTC) ::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) == [https://cs.wikipedia.org/w/index.php?title=Celerina/Schlarigna&oldid=25694456&useparsoid=1 cswiki:Celerina/Schlarigna] == V tabulce v sekci obyvatelstvo se u jedné buňky zobrazuje černé pozadí. Pokud dám ale historii stránky a podívám se na aktuální verzi, vykreslí se stránka správně. To samé se opakuje i u jiných podobných stránek se stejně formátovanými tabulkami. [[User:Matijak|Matijak]] ([[User talk:Matijak|talk]]) 17:02, 22 February 2026 (UTC) :I cannot see a black cell in that table. Is this issue fixed? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:09, 27 February 2026 (UTC) ::I can see it in in both the history (latest revision) and on the page itself (live). It's the leftmost 'Počet' cell in the 'Jazyky v Celerině' table. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 10:10, 28 February 2026 (UTC) :::Aha! :::the cell itself is not dark, the text in it is, and only in dark mode. It is also present in the legacy rendering, which seems to hint at a problem with the table markup itself and not a parser issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:11, 2 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:45, 21 April 2026 (UTC) :::::Not a Parsoid issue most likely, but it has not been fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:21, 24 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia:Biographies_of_living_persons&oldid=1340299616&useparsoid=1 enwiki:Wikipedia:Biographies of living persons] == Reporting a visual bug for all pages that suddenly arose as of this morning on Safari Mobile - the Page Actions Overflow div is in a permanently open state but inaccessible to via clicks to either toggle the menu or select any of the tools on the menu. In addition to being unable to interact with it, all of the styling broken and makes the top right section of the page unusable and barely readable. [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 14:34, 27 February 2026 (UTC) :Is this issue still present? Sorry, it has been a while since you reported this, I'm hoping that the issue has been resolved by now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) ::Yes, it appears to have been resolved. Thanks for following up! [[User:Eulersidentity|Eulersidentity]] ([[User talk:Eulersidentity|talk]]) 03:38, 22 April 2026 (UTC) == [https://oc.wikipedia.org/w/index.php?title=Esqu%C3%A8rra_(politica)&oldid=2495338&useparsoid=1 ocwiki:Esquèrra (politica)] == There's an issue with the interlinks, this article should be connected with the other ones about left-wing politics [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 06:39, 28 February 2026 (UTC) :Yes, it was an issue with the interlinks, but those should naturally not be reported as visual issues ('bogue visuler') as the have nothing to do with Parsoid. You can link pages which have no connections by using the 'Apondre los ligams interlengas' (Add interlanguage links) button from the 'Bóstia d'aisinas' (Tools) menu. Unless, of course, Parsoid somehow blocks automatic linking of translations. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:10, 28 February 2026 (UTC) ::I don't know why but it was finally done (thank you so much to the person who did that), but the thing is, i tried what you said before and it kept telling me that i didn't had the permission to link the two articles... [[User:Bertault34|Bertault34]] ([[User talk:Bertault34|talk]]) 19:33, 1 March 2026 (UTC) :::I did that, you are welcome. It appears that you are not autoconfirmed yet on Wikidata, and that this Wikidata entry requires that, which if both true I would expect you to not be able to do this change. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 04:21, 21 March 2026 (UTC) ::::{{Done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:46, 21 April 2026 (UTC) :::::Sorry? [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:48, 23 April 2026 (UTC) ::::::We're using the <nowiki>{{done}}</nowiki> template to track which issues have been resolved, vs still outstanding. I don't believe there is any additional follow required by the Content Transform team on this report? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 05:00, 24 April 2026 (UTC) :::::::Oh, no, I just didn't know this is a system you are using. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 22:19, 24 April 2026 (UTC) == [https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/Page_translation_administration&oldid=8240537&useparsoid=1 Help:Extension:Translate/Page translation administration] == The topmost warning in the 'Changing the source text' section does not display the codeblock content. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 16:47, 28 February 2026 (UTC) :This is a very clever use of the <code><nowiki>{{^(}}</nowiki></code> template to avoid creating an unintended translation marker. I've [https://www.mediawiki.org/w/index.php?title=Help%3AExtension%3ATranslate%2FPage_translation_administration&diff=8349012&oldid=8343860 replaced it with more straight-forward entity-escaping] to be more compatible with Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:54, 21 April 2026 (UTC) ::Also filed this as [[phab:T424066]] [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 16:46, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&oldid=67999951&useparsoid=1 nlwiki:Railterminal Gelderland] == The map in [[:nl:sjabloon:maplink]] doesn't show up in my Chrome browser for Chromebook. It does show in https://nl.wikipedia.org/w/index.php?title=Railterminal_Gelderland&useparsoid=0 and also when I log out. [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:54, 5 March 2026 (UTC) :Btw, the map is visible for a moment, then it disappears [[User:Bertux|Bertux]] ([[User talk:Bertux|talk]]) 10:56, 5 March 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%91%D7%A8%D7%90%D7%95%D7%9C_%D7%A1%D7%98%D7%90%D7%A8%D7%A1&oldid=42870396&useparsoid=1 hewiki:בראול סטארס] == למה הקישור לתמונה ששמתי לא עובד? בכל מקרה אשמח שמישהו ישים את התמונה העדכנית שמשומשת בדף באנגלית מאחר והלוגו למשחק שונה. מצטער על התקלה. [[User:Jhho48|Jhho48]] ([[User talk:Jhho48|talk]]) 16:43, 9 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Infokastis: Sulamistemperatuur 236,15 K (−37 °C) Miinusmärk peaks olema sidekriipsust pikem, kuid pikema kriipsu sisestamine põhjustab tõrketeate. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:05, 11 March 2026 (UTC) == [https://et.wikipedia.org/w/index.php?title=Furfurool&oldid=7109379&useparsoid=1 etwiki:Furfurool] == Vabandust, lühike (st vale) kriips oli kuvatud siiski ainult lähteteksti režiimis; salvestatud tekstiga küljendis on kuvatud õige kriips. [[User:Kuriuss|Kuriuss]] ([[User talk:Kuriuss|talk]]) 11:07, 11 March 2026 (UTC) == kowiki:sticky header is broken == [[:en:Template:Sticky header|Template:Sticky header]] is not working properly on kowiki. Please compare [//ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=0] with [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&oldid=41472532&useparsoid=1].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:34, 16 March 2026 (UTC) :It may have been because of an empty row before the table caption. I [https://ko.wikipedia.org/w/index.php?title=%ED%81%AC%EB%A1%9C%EC%95%84%ED%8B%B0%EC%95%84%EC%9D%98_%EC%9C%A0%EC%9D%B8%EB%8F%84_%EB%AA%A9%EB%A1%9D&diff=41501849&oldid=41501840 edited the page] to remove it. But, looks like another editor has removed the sticky header template call from above the table. If you can put it back, it will work. See my [[:ko:사용자:SSastry_(WMF)/Sandbox|sandbox]] page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 03:22, 17 March 2026 (UTC) == [https://ko.wikipedia.org/w/index.php?title=%ED%8B%80:%EA%B5%AD%EA%B8%B0%EB%82%98%EB%9D%BC&oldid=40992836&useparsoid=1 kowiki:틀:국기나라] == 변수를 덧붙였음에도 {{국기나라|독일|제국}}이 여전히 '독일'로 출력됩니다. [[User:Triican|Triican]] ([[User talk:Triican|talk]]) 05:04, 19 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Angus_T._Jones&oldid=1333447723&useparsoid=1 enwiki:Angus T. Jones] == The infobox photo is squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 17:11, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Ukraine&oldid=1343921679&useparsoid=1 enwiki:Ukraine] == All maps in the infobox are squashed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 18:36, 19 March 2026 (UTC) :Fixed. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 15:12, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Sabia_que&oldid=54991313&useparsoid=1 ptwiki:Wikipédia:Sabia que] == O arquivo de discussão está 'bugando' visualmente. Está no meio de "Curiosidades em destaque" [[User:Heylenny|Heylenny]] ([[User talk:Heylenny|talk]]) 23:27, 19 March 2026 (UTC) :{{done}} Template adjusted on the page. [[User:Fúlvio|Fúlvio]] ([[User talk:Fúlvio|talk]]) 02:59, 22 March 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%AC%E0%A6%BF%E0%A6%AE%E0%A6%B2_%E0%A6%98%E0%A7%8B%E0%A6%B7_(%E0%A6%B6%E0%A6%BF%E0%A6%B6%E0%A7%81%E0%A6%B8%E0%A6%BE%E0%A6%B9%E0%A6%BF%E0%A6%A4%E0%A7%8D%E0%A6%AF%E0%A6%BF%E0%A6%95)&oldid=8851768&useparsoid=1 bnwiki:বিমল ঘোষ (শিশুসাহিত্যিক)] == আলোচনা পাতায় অন্য নিবন্ধের আলোচনা পাতা [[User:Ams riyad|Ams riyad]] ([[User talk:Ams riyad|talk]]) 01:28, 20 March 2026 (UTC) == [https://vi.wikipedia.org/w/index.php?title=Wikipedia:Th%E1%BA%A3o_lu%E1%BA%ADn&oldid=74869958&useparsoid=1 viwiki:Wikipedia:Thảo luận] == TOC is rendered inside the link bar, but it shouldn't be. [[User:NguoiDungKhongDinhDanh|<span class="skin-invert" style="color:black;font-family:Monotype Corsiva;font-size:110%;font-weight:normal;line-height:normal">NguoiDungKhongDinhDanh</span>]] 03:20, 20 March 2026 (UTC) :This was most likely [[phab:T421629|T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] and we believe this issue has been fixed. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:51, 24 April 2026 (UTC) == [[wikt:ru:омфал]] == For more than a day, there have been anomalies in the behavior of tables of contents (ToCs) in Russian Wiktionary. The issues differ based on the selected skin and affect only some pages. If the old Vector theme is used, the automatically generated ToC simply fails to appear on certain pages, despite the page having over three headers and the absence of magic words such as NOTOC. If the new Vector theme is used, the ToC on some pages is misplaced and not positioned where it should be by default. The problem is not present if the old parser is used. Purging the page's cache seems to fix the issue as well. ToC is displayed correctly in the preview-mode too. Some affected pages: * [[wikt:ru:омфал]] * [[wikt:ru:безграмотность]] * [[wikt:ru:હંમેશા]] * [[wikt:ru:ಯಾವಾಗಲೂ]] * [[wikt:ru:stadigvæk]] * [[wikt:ru:alligevel]] * [[wikt:ru:kanunay]] * [[wikt:ru:ሁሌ]] * [[wikt:ru:zawżdy]] * and maaany mooore... [[User:綿貫桜哉|綿貫桜哉]] ([[User talk:綿貫桜哉|talk]]) 08:11, 20 March 2026 (UTC) :This was [[phab:T421629|⚓ T421629 TOC missing with Parsoid on some wikis (except for Vector 2022)]] but should be fixed now. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 04:55, 24 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Louis_Nirenberg&oldid=15616502&useparsoid=1 rowiki:Louis Nirenberg] == The image seems to be the 250px thumbnail scaled up to what looks like 400px width. [[User:Andrei Stroe|Andrei Stroe]] ([[User talk:Andrei Stroe|talk]]) 10:16, 20 March 2026 (UTC) == [https://fr.wikipedia.org/w/index.php?title=Aide:Accueil&oldid=232433495&useparsoid=1 frwiki:Aide:Accueil] == custom collapsible elements render differently with parsoid [[User:Escargot bleu|Escargot bleu]] ([[User talk:Escargot bleu|talk]]) 14:19, 20 March 2026 (UTC) :I filed https://phabricator.wikimedia.org/T421859. Thanks for the report. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:07, 31 March 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Katten_(olika_betydelser)&oldid=43770842&useparsoid=1 svwiki:Katten (olika betydelser)] == The legacy parser adds an empty line before the template Förgrening (which is a kind of table). The Parsoid parser don't do that. This occurs on all pages using that template. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 18:32, 21 March 2026 (UTC) :Ya, this is known difference with some paragraph wrapping which is tricky to fix. In this case, I recommend adjusting the top margin of the table by editing the base template: https://sv.wikipedia.org/w/index.php?title=Mall%3AF%C3%B6rgrening%20bas&veaction=editsource [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 10:01, 31 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Gen_Z_stare&oldid=1344701043&useparsoid=1 enwiki:Gen Z stare] == The infobox image is unusually narrow. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 01:51, 22 March 2026 (UTC) :For me the image is stretched horizontally by a fair bit. It seems like the following bit of code is to blame: :<syntaxhighlight lang="css"> :html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img {width: 400px; } :</syntaxhighlight> [[User:Sohom Datta|Sohom]] ([[User talk:Sohom Datta|talk]]) 01:54, 22 March 2026 (UTC) ::I'm not seeing any visible difference between legacy parser and Parsoid in my testing. Can you share a screenshot @[[User:Snowmanonahoe|Snowmanonahoe]] ? What skin and browser are you using? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 17:43, 27 March 2026 (UTC) :::@[[User:Jon (WMF)|Jon (WMF)]]: I don't see it anymore either. I'm using Vector 2022 and Firefox 149. [[User:Snowmanonahoe|Snowmanonahoe]] ([[User talk:Snowmanonahoe|talk]]) 17:46, 27 March 2026 (UTC) ::::Ah okay. I think this was a caching issue then. Some "temporary turbulence" was to be expected with this roll out. Thanks for reporting! [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 18:29, 27 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Virginia_Fonseca&oldid=71959182&useparsoid=1 ptwiki:Virginia Fonseca] == A 1ª imagem da página na infocaixa tem um tamanho grande demais [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 11:34, 22 March 2026 (UTC) :I don't see the problem. The page renders identically in Parsoid and with the old/legacy parser. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:22, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Xander_Harris&oldid=71958675&useparsoid=1 ptwiki:Xander Harris] == Seção de referências expandida [[User:Vitruviano|Vitruviano]] ([[User talk:Vitruviano|talk]]) 15:06, 22 March 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Bruker:Znuddel&oldid=25704667&useparsoid=1 nowiki:Bruker:Znuddel] == Hele siden er helt feil [[User:Nevemagneten|Nevemagneten]] ([[User talk:Nevemagneten|talk]]) 20:35, 24 March 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Main_page&oldid=2122&useparsoid=1 abstractwiki:Abstract Wikipedia:Main page] == Favicon is showing a dark background around the rounded corners on Chrome. [[User:Jsengupt|Jsengupt]] ([[User talk:Jsengupt|talk]]) 16:14, 25 March 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=System_(typeface)&oldid=1329545007&useparsoid=1 enwiki:System (typeface)] == Infobox image is stretched horizontally [[User:Anna328p|Anna328p]] ([[User talk:Anna328p|talk]]) 06:59, 26 March 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Wikip%C3%A9dia:Enged%C3%A9lyk%C3%A9r%C3%A9s&oldid=28288240&useparsoid=1 huwiki:Wikipédia:Engedélykérés] == The email templates are rendered incorrectly. [[User:Bencemac|Bencemac]] ([[User talk:Bencemac|talk]]) 14:00, 26 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T421563 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:19, 28 March 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Usu%C3%A1rio(a):Inter-rede/Cabe%C3%A7alho&oldid=71778331&useparsoid=1 ptwiki:Usuário(a):Inter-rede/Cabeçalho] == Whitespaces seem to have collapsed [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 18:02, 27 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422155 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:36, 2 April 2026 (UTC) ::It looks like the problem is the <code>display:flex</code> in the <code>style</code> attribute on the wrapper is at fault. Parsoid generates <code><nowiki><span></nowiki></code> wrappers around the html entities in the wikitext, by design. The whitespace is present in the HTML, so that's not a fault of Parsoid. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 15:07, 9 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%91%D7%A6%D7%A2_%D7%9E%D7%A9%D7%94_(%D7%9E%D7%9C%D7%97%D7%9E%D7%AA_%D7%94%D7%A2%D7%A6%D7%9E%D7%90%D7%95%D7%AA)&oldid=42991233&useparsoid=1 hewiki:מבצע משה (מלחמת העצמאות)] == הכיתוב שנועד למנוע בלבול בין מבצע משה הזה למבצע משה אחר לא ערוך [[User:חנניה בלסמן|חנניה בלסמן]] ([[User talk:חנניה בלסמן|talk]]) 12:54, 30 March 2026 (UTC) == [//en.wikipedia.org/w/index.php?title=Help:Colon_trick&useparsoid=1 enwiki:Help:Colon trick] == According to [[w:Help:Colon trick]], it is explained as follows: "<code><nowiki>[[//Hus]]</nowiki></code> will produce an (invalid) external link wrapped in brackets ("[[//Hus]]"), but <code><nowiki>[[://Hus]]</nowiki></code> will produce a link to [[w://Hus|//Hus]]." However, when using Parsoid, it incorrectly links to [[w:Help:Colon trick//Hus|Help:Colon trick//Hus]].--[[User:Namoroka|Namoroka]] ([[User talk:Namoroka|talk]]) 13:02, 31 March 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422161 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 14:00, 2 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Ans%C3%B6kan_om_administrativ_beh%C3%B6righet&oldid=59167563&useparsoid=1 svwiki:Wikipedia:Ansökan om administrativ behörighet] == In Legacy, each section (candidate) get a [redigera] ([edit] to the right of the section name. In Parsoid, there is nothing to the right of the section name. [[User:Tekannan|Tekannan]] ([[User talk:Tekannan|talk]]) 12:15, 2 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T391624 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:27, 2 April 2026 (UTC) == [https://en.wiktionary.org/w/index.php?title=H%26P&oldid=83856321&useparsoid=1 enwiktionary:H&P] == The first hidden category listed is [[wiktionary:Category:English_entries_with_incorrect_language_header|English entries with incorrect language header]]'','' which is, however, empty. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 14:48, 2 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Jo%C3%A3o_Peixoto&oldid=72016744&useparsoid=1 ptwiki:João Peixoto] == A foto não corresponde ao nome citado [[User:Mayque Lemos|Mayque Lemos]] ([[User talk:Mayque Lemos|talk]]) 18:18, 2 April 2026 (UTC) == [https://meta.wikimedia.org/w/index.php?title=Main_Page&oldid=30254797&useparsoid=1 metawiki:Main Page] == On Parsoid only, <nowiki>''complete list'' and ''request''</nowiki> each show a space between them and their preceding opening bracket. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 19:06, 3 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&oldid=1343194045&useparsoid=1 enwiki:In Stars and Time] == <code>&lt;ref name="rps"&gt;</code> displays an error which doesn’t occur on the legacy parser [[User:Mir Novov|Mir Novov]] ([[User talk:Mir Novov|talk]]) 12:10, 4 April 2026 (UTC) :It was an error which I fixed with [https://en.wikipedia.org/w/index.php?title=In_Stars_and_Time&diff=1348021667&oldid=1347424445 this edit] which adds one more backlink to Ref #5. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:00, 10 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Helen_Andrews&oldid=72024590&useparsoid=1 ptwiki:Helen Andrews] == Estou a ter problema com as referências, pois aparecem duplicadas. [[User:Faviola7|Faviola7]] ([[User talk:Faviola7|talk]]) 14:17, 4 April 2026 (UTC) == [https://abstract.wikipedia.org/w/index.php?title=Abstract_Wikipedia:Project_chat&oldid=3236&useparsoid=1 abstractwiki:Abstract Wikipedia:Project chat] == In the "Bot request" section, a link that has been visited is blue rather than purple, because spaces in the link are turned into actual spaces (%20) in the URL. [[User:JJPMaster|JJP]]<sub>[[User talk:JJPMaster|Mas]]<sub>[[Special:Contributions/JJPMaster|ter]]</sub></sub> ([[wikt:she|she]]/[[wikt:they|they]]) 21:53, 4 April 2026 (UTC) == [https://no.wikipedia.org/w/index.php?title=Tor_Fosse_(f%C3%B8dt_1956)&oldid=25723619&useparsoid=1 nowiki:Tor Fosse (født 1956)] == fil: center frameless [[User:Birgit.H.Pihl|Birgit.H.Pihl]] ([[User talk:Birgit.H.Pihl|talk]]) 10:05, 5 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Politisk_opposition&oldid=59171124&useparsoid=1 svwiki:Politisk opposition] == This error message about unused named reference is not shown: Referensfel: <ref>-tagg med namn "sr-20161006", definierad i <references> används inte tidigare i texten. The article is also added to hidden category "Sidor med referensfel" but that is not shown [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:12, 5 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Puteulum/Sandbox&oldid=150100596&useparsoid=1 itwiki:Utente:Puteulum/Sandbox] == The "Move" button to move the entry from sandbox to NS0 does not appear [[User:Puteulum|Puteulum]] ([[User talk:Puteulum|talk]]) 14:28, 7 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=POVOADO_TIRIRICAL&oldid=72040530&useparsoid=1 ptwiki:POVOADO TIRIRICAL] == O MEU TEXTO ESTA TODO VERMELHO E MAIS CENTRALIZADO [[User:POVOADO TIRIRICAL|POVOADO TIRIRICAL]] ([[User talk:POVOADO TIRIRICAL|talk]]) 18:38, 7 April 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%B1%E4%BA%AC%E9%83%BD%E9%81%935%E5%8F%B7%E6%96%B0%E5%AE%BF%E9%9D%92%E6%A2%85%E7%B7%9A&oldid=108985336&useparsoid=1 jawiki:東京都道5号新宿青梅線] == ヘッダー付近に編集ミスと思われし文言あり [[User:QWERTYKeyboard0570|QWERTYKeyboard0570]] ([[User talk:QWERTYKeyboard0570|talk]]) 08:56, 8 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=2022_Oder_environmental_disaster&oldid=1344570432&useparsoid=1 enwiki:2022 Oder environmental disaster] == After a second, the actual map from the infobox (not the buttons) is replaced with a placeholder icon and text (clicking in the field still works). [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 11:56, 8 April 2026 (UTC) :Could it have been a transient issue? I cannot reproduce this right now. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 06:03, 10 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Commissione_arbitrale/Domande&oldid=150049601&useparsoid=1 itwiki:Wikipedia:Commissione arbitrale/Domande] == This page is related to the itwiki ArbCom election. Section edit links were not shown, making it difficult to ask questions to candidates. This has since been worked around with [[:it:special:diff/150118322|this edit]] and is likely related to [[phab:T387520|T387520]]. [[User:Titore|Titore]] ([[User talk:Titore|talk]]) 19:58, 8 April 2026 (UTC) :Thanks for this report. This is on our list of high priority tasks to fix and we are going to pick up shortly. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:53, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Kurier&oldid=266019405&useparsoid=1 dewiki:Wikipedia:Kurier] == das Diagramm zum Beitrag "Ein Wal ..." überragt den Text der rechten Spalte. [[User:Michael w|Michael w]] ([[User talk:Michael w|talk]]) 08:10, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034&useparsoid=1 dewiki:Wikipedia:Fragen zur Wikipedia] == <nowiki>& s h y ;</nowiki> is ignored. See the test on https://de.wikipedia.org/w/index.php?title=Wikipedia:Fragen_zur_Wikipedia&oldid=266036034#&_s_h_y_; [[User:Raymond|Raymond]] ([[User talk:Raymond|talk]]) 09:55, 10 April 2026 (UTC) :Filed https://phabricator.wikimedia.org/T422960 for this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:55, 10 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Wikipedia:Faktafr%C3%A5gor&oldid=59190040&useparsoid=1 svwiki:Wikipedia:Faktafrågor] == Svara-funktionen fungerar inte med Parsoid. När jag klickar på Svara för något inlägg, vilket som helst, dyker svarsrutan upp längst ner på sidan, efter den senaste diskussionstråden. Med den äldre parsern fungerar det. [[User:Larske|Larske]] ([[User talk:Larske|talk]]) 11:12, 10 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Cornelis_de_Bruijn_Martinuszoon&oldid=70921577&useparsoid=1 nlwiki:Cornelis de Bruijn Martinuszoon] == De pagina-afbeelding is de handtekening van C. de Bruijn Mz. Ik denk dat zijn afbeelding in de spotprent een betere pagina-afbeelding is. Het zou kunnen dat Parsoid/Wikipedia deze niet 'pakt' omdat de dimensies tijdens een eerdere bewerking zijn aangepast. Alvast bedankt! [[User:Jelledebruijn|Jelledebruijn]] ([[User talk:Jelledebruijn|talk]]) 16:31, 10 April 2026 (UTC) :I think you might have seen a version of the page before the cache was updated. I just checked and the image is identical with Parsoid and the older parse. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:46, 10 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=The_Punisher_(2004)&oldid=263259949&useparsoid=1 dewiki:The Punisher (2004)] == Dead link template Vorlage:Toter Link (https://de.wikipedia.org/wiki/Vorlage:Toter_Link) after url is no longer working but gets part of the Link. (example https://de.wikipedia.org/wiki/The_Punisher_(2004)#cite_note-5 ) [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:23, 10 April 2026 (UTC) :Example without Parsoid: https://de.wikipedia.org/wiki/The_Punisher_(2004)?useparsoid=0#cite_note-5 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 18:57, 10 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T368724 but ideally, the template will be added with a space after the link. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 04:24, 11 April 2026 (UTC) ::Unfortunately it's added by the InternetArchiveBot that way: https://de.wikipedia.org/w/index.php?title=Liste_aktiver_Brauereien_in_Deutschland&diff=prev&oldid=265857281 --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 06:45, 11 April 2026 (UTC) :::@[[User:SSastry (WMF)|SSastry (WMF)]]: But it is not good if the preview shows us a different result than the version that is subsequently published. InternetArchiveBot inserts it without spaces. The task is prioritized as Low, but since we have this thousands of times in the article inventory (and it used to work before), the task should be reprioritized to Higher. And the preview should always show the same result that I get after publishing. What do we do with the Phab task now? How do we handle this bug? Thank you, [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 09:12, 11 April 2026 (UTC) ::::We will fix the preview path separately. But, for this specifically, I'll flag this for the team to see how we want to handle this. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:33, 11 April 2026 (UTC) :::::@[[User:SSastry (WMF)|SSastry (WMF)]]: Oh thank you, keep us up to date here please. [[User:Doc Taxon|Doc Taxon]] ([[User talk:Doc Taxon|talk]]) 16:35, 11 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Marlon_Ganchozo&oldid=172919968&useparsoid=1 eswiki:Marlon Ganchozo] == No sale el resto de la información del, jugador [[User:Didierlpz06|Didierlpz06]] ([[User talk:Didierlpz06|talk]]) 19:04, 10 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 eswiki:Temporada regular de la Euroliga 2025-26] == no se sustituyen correctamente las ultimas plantillas [[User:Hugogs02|Hugogs02]] ([[User talk:Hugogs02|talk]]) 08:42, 11 April 2026 (UTC) :This page is too large post-template expansion. Observe that the templates at the end are not expanded neither in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=1 Parsoid] nor in [https://es.wikipedia.org/w/index.php?title=Temporada_regular_de_la_Euroliga_2025-26&oldid=172927511&useparsoid=0 Legacy]; the legacy parser just happens to expand a few more at the end of the page due to [https://phabricator.wikimedia.org/T392262 T392262]. The page should probably be split. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:13, 13 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Uniforme_de_la_selecci%C3%B3n_de_f%C3%BAtbol_de_Argentina&oldid=172883243&useparsoid=1 eswiki:Uniforme de la selección de fútbol de Argentina] == En la plantilla de uniforme de fútbol algunos uniformes se ven con las mangas más bajas respecto al archivo del cuerpo, dejando lineas de un pixel por encima con los colores de fondo en dicha plantilla. [[User:Lobo kun mfc|Lobo kun mfc]] ([[User talk:Lobo kun mfc|talk]]) 13:58, 11 April 2026 (UTC) :The lines displayed on top of the uniforms are present both in Parsoid and in the Legacy parser, and they do seem to vary slightly depending on the browser (I've looked on Firefox and Chrome, both on Linux, and they were not consistent between both browsers). :I believe this issue should be fixed on the template side (at a guess, the <code>style="color: inherit; background-color:#000040;"</code> that I see on the various image divs may well show up depending on the exact HTML structure and/or image) [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:23, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Liste_der_Radschnellverbindungen_in_Deutschland&oldid=266034807&useparsoid=1 dewiki:Liste der Radschnellverbindungen in Deutschland] == Hallo, beim Artikel [[Liste der Radschnellverbindungen in Deutschland]] wird die Beschreibung der MapLink-Karte wird nicht gescheid gerendert. Statt einem hochgestellten <code>[7]</code> wird <code>Karte der bestehenden Radschnellwege in Deutschland'"`UNIQ--ref-00000008-QINU`"'</code> gerendert. Das Problem ist serverseitig und tritt beim Legacy-Parser nicht auf. LG [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 16:02, 11 April 2026 (UTC) :This is https://phabricator.wikimedia.org/T383004 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:06, 11 April 2026 (UTC) ::thanks! [[User:Ovinator|Ovinator]] ([[User talk:Ovinator|talk]]) 14:13, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Louis_Franchet_d%E2%80%99Esp%C3%A8rey&oldid=266076416&useparsoid=1 dewiki:Louis Franchet d’Espèrey] == Bildumfluss nicht wie üblich [[User:Alfred Kiefer|Alfred Kiefer]] ([[User talk:Alfred Kiefer|talk]]) 19:30, 11 April 2026 (UTC) :This issue has been fixed in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1269534 and should be deployed to production this week. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:34, 13 April 2026 (UTC) == [https://bn.wiktionary.org/w/index.php?title=%E0%A6%AA%E0%A7%8D%E0%A6%B0%E0%A6%A7%E0%A6%BE%E0%A6%A8_%E0%A6%AA%E0%A6%BE%E0%A6%A4%E0%A6%BE&oldid=250894&useparsoid=1 bnwiktionary:প্রধান পাতা] == The ‘ শব্দছবি’ section is overflowing with Parsoid; thus does not happen when the legacy parser is used. [[User:Redmin|Redmin]] ([[User talk:Redmin|talk]]) 08:09, 12 April 2026 (UTC) :Since the section seems to be randomized, it's pretty hard to see which version of this section is overflowing (the ones I see do not seem to). Would you be able to provide more information/a screenshot? [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:49, 13 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Hamburg&oldid=266087257&useparsoid=1 dewiki:Wikipedia:Hamburg] == Abschnittsbearbeitungen nicht mehr möglich, Link fehlt. Betrifft einige WP-Seiten wie auch [[:de:Wikipedia:Stammtisch München]] oder auch nur einige Überschriften von [[:de:Vorlage:Coordinate]], also nicht immer komplette Seiten. [[User:NordNordWest|NordNordWest]] ([[User talk:NordNordWest|talk]]) 12:12, 12 April 2026 (UTC) :We have a number of issues with section edit links (documented in https://phabricator.wikimedia.org/T391624) that we intend to fix; sorry for the inconvenience - we'll make sure to keep this use case in mind when working on a solution. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 11:20, 23 April 2026 (UTC) == [https://zh.wikipedia.org/w/index.php?title=COBOL&oldid=91149855&useparsoid=1 zhwiki:COBOL] == 正文开头的“COBOL”英文名无法显示,且全文的繁简转换失效。 The English name "COBOL" for COBOL at the very beginning vanished. Besides, the conversion between traditional and simplified Chinese does not function for the entire page. [[User:Ricky136973|Ricky136973]] ([[User talk:Ricky136973|talk]]) 13:08, 12 April 2026 (UTC) :Parsoid should not (yet) be enabled on zhwiki. If you want to preview how it will work, you can add <code>&parsoidnewlc=1</code> to the end of the URL to use Parsoid's implementation of LanguageConverter. That shows "COBOL" on this page as expected. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:17, 13 April 2026 (UTC) ::Parsoid is now experimentally enabled, so you don't need the `&parsoidnewlc=1` at the end of the URL any more. It appears that the COBOL page renders correctly now? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:40, 21 April 2026 (UTC) == [https://th.wikipedia.org/w/index.php?title=4_%E0%B9%80%E0%B8%97%E0%B8%9E%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B8%9E%E0%B8%B4%E0%B8%97%E0%B8%B1%E0%B8%81%E0%B8%A9%E0%B9%8C&oldid=12947833&useparsoid=1 thwiki:4 เทพผู้พิทักษ์] == อันนี้น่าจะผิดที่ร้องเพลงประกอบละคร [[User:ภรพัฒน์|ภรพัฒน์]] ([[User talk:ภรพัฒน์|talk]]) 12:47, 13 April 2026 (UTC) :Google translate says, "This is probably a mistake—singing the theme song for a TV drama." :This seems like a content issue, not a Parsoid issue. Mistakes in content should be correctly directly on the wiki. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:47, 21 April 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%A9%D7%AA%D7%9E%D7%A9:%D7%A9%D7%A8%D7%A9%D7%97%D7%95%D7%9F/%D7%98%D7%99%D7%95%D7%98%D7%94&oldid=42822143&useparsoid=1 hewiki:משתמש:שרשחון/טיוטה] == אני רוצה לבטל את המצאות השם יעל סרלין בדף הטיוטות שלי כדי להתחיל ערך חדש [[User:שרשחון|שרשחון]] ([[User talk:שרשחון|talk]]) 12:59, 13 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Acidente_radiol%C3%B3gico_de_Goi%C3%A2nia&oldid=72061996&useparsoid=1 ptwiki:Acidente radiológico de Goiânia] == [[File:Captura_de_tela_de_miniaturas_renderizadas_pelo_Parsoid.png|thumb|250x250px]] As miniaturas estão minúsculas com as margens enormes. [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 15:13, 13 April 2026 (UTC) :It seems to be like this due to :<pre>html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img[width="250"] { width: calc(round(400px * var(--mw-file-upright,1),10px)) }</pre> [[User:Inter-rede|Inter-rede]] ([[User talk:Inter-rede|talk]]) 17:48, 19 April 2026 (UTC) ::{{Tracked|T423676}} [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) ::This should have been fixed by a backport we did yesterday. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 14:48, 21 April 2026 (UTC) == [https://hr.wikipedia.org/w/index.php?title=Marijana_Bijeli%C4%87&oldid=7429126&useparsoid=1 hrwiki:Marijana Bijelić] == Sve je podvuceno a ne treba tako biti [[User:Nikolica1512|Nikolica1512]] ([[User talk:Nikolica1512|talk]]) 17:08, 13 April 2026 (UTC) :I made some edits for you [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 18:32, 13 April 2026 (UTC) ::Thank you, I ameliorated those problematic parts, could you take a look at it? I hope it is good to go now as an article on wikipedia so people could access it. This person deserves to have a wiki page. ::Regards, [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 21:53, 13 April 2026 (UTC) :::Sorry, no. I was only helping with the syntax error. You'll need to take your request to the hrwiki community [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 22:25, 13 April 2026 (UTC) ::::And how do I do that exactly? Could you help me out with it? [[Special:Contributions/&#126;2026-22989-89|&#126;2026-22989-89]] ([[User talk:&#126;2026-22989-89|talk]]) 22:56, 13 April 2026 (UTC) :::::You can ask on [[:hr:Wikipedija:Kafić]] and I'm sure someone there will help you out [[User:ABreault (WMF)|ABreault (WMF)]] ([[User talk:ABreault (WMF)|talk]]) 00:34, 14 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 dewiki:Hilfe:Parserfunktionen] == Headings which use <code><nowiki><includeonly></nowiki></code> to change nesting level when transcluded don't appear as headings on original page [[User:TheFirstLevelDown|TheFirstLevelDown]] ([[User talk:TheFirstLevelDown|talk]]) 00:01, 14 April 2026 (UTC) :Parsoid does not support gluing heading together like the legacy parser did, so this syntax is not supported. :As an alternative, we suggest something like (to adjust depending on your exact use case) :<syntaxhighlight lang="wikitext"> <includeonly>===== title =====</includeonly> <noinclude>=== title ===</noinclude> </syntaxhighlight> :or, for a less robust version (but that doesn't require repeating the title) :<syntaxhighlight lang="wikitext"> <includeonly>=====</includeonly><noinclude>===</noinclude> title <includeonly>=====</includeonly><noinclude>===</noinclude> </syntaxhighlight> [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 12:45, 14 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Amor_eterno_una_tragedia_anunciada&oldid=172974810&useparsoid=1 eswiki:Amor eterno una tragedia anunciada] == el título de la página está como "Amor eterno una tragedia anunciada" y no deja cambiarlo al original que es "Amor Eterno: Una tragedia anunciada" [[User:Goodfriendspictures|Goodfriendspictures]] ([[User talk:Goodfriendspictures|talk]]) 09:59, 14 April 2026 (UTC) :To me it looks like the [[DISPLAYTITLE]] magic word is disabled though {{wg|AllowDisplayTitle}} in eswiki. Nothing to do with Parsoid. [[User:Tactica|Tactica]] ([[User talk:Tactica|talk]]) 10:12, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:TanjaKo/Sandbox&oldid=150217478&useparsoid=1 itwiki:Utente:TanjaKo/Sandbox] == Nel testo non sono presenti errori e le frasi sono sottolineate con una linea rossa ondulata. Come risolverlo visual bug? Grazie [[User:TanjaKo|TanjaKo]] ([[User talk:TanjaKo|talk]]) 17:42, 14 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Wikipedia:Raduni/Raduni_in_Sicilia_2026&oldid=150224594&useparsoid=1 itwiki:Wikipedia:Raduni/Raduni in Sicilia 2026] == just on iPhone 14 with iOS 18.7.7 both from safari or chrome and both from logged or unlogged and incognito mode, the last number of the participants list (made with "#") is bigger than the others [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 18:31, 15 April 2026 (UTC) == [https://atj.wikipedia.org/w/index.php?title=Otitikowin&oldid=16878&useparsoid=1 atjwiki:Otitikowin] == pas moyen de travailler en mode visuel sur la page [[User:Luc Patin|Luc Patin]] ([[User talk:Luc Patin|talk]]) 14:56, 16 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Zhang_Zeduan&oldid=173032341&useparsoid=1 eswiki:Zhang Zeduan] == La pagina está incompleta e inpublicable [[User:Mikemj1987|Mikemj1987]] ([[User talk:Mikemj1987|talk]]) 22:08, 17 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:08, 20 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=L%C3%ADnea_E3_(Euskotren_Trena)&oldid=173034070&useparsoid=1 eswiki:Línea E3 (Euskotren Trena)] == La imagen se ve un poco mal por el modo oscuro. [[User:UnniMan|UnniMan]] ([[User talk:UnniMan|talk]]) 00:55, 18 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:09, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Stadtbahn_Karlsruhe&oldid=265878452&useparsoid=1 dewiki:Stadtbahn Karlsruhe] == Shows reference error and the categoy Kategorie:Wikipedia:Seite mit Einzelnachweisfehlern but is not included in https://de.wikipedia.org/wiki/Kategorie:Wikipedia:Seite_mit_Einzelnachweisfehlern The same happens with other articles that had no reference errors with the old parser. Makes maintenance hard. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 09:26, 19 April 2026 (UTC) :Tracked in https://phabricator.wikimedia.org/T423924 [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Indiana_Jones_and_the_Fate_of_Atlantis&oldid=265815741&useparsoid=1 dewiki:Indiana Jones and the Fate of Atlantis] == Shows a reference error that is not visible in the preview function. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:06, 19 April 2026 (UTC) :The error came through a Reference with the same name in a used template https://de.wikipedia.org/wiki/Vorlage:Verkaufszahlen_LucasArts_Adventures Still bad to have an error that wasn't there with the old parser and isn't shown in the preview or maintenance category. --[[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 10:27, 19 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Evento_Azolla&oldid=72103944&useparsoid=1 ptwiki:Evento Azolla] == [Convert: número inválido] na parte de Efeitos Globais [[User:Marina Funez|Marina Funez]] ([[User talk:Marina Funez|talk]]) 00:28, 20 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:10, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Musikk%C3%A1r&oldid=144140&useparsoid=1 smnwiki:Myenster:Musikkár] == Instead of dealing with this issue and the other issue on smnwiki listed below, these were quietly archived. These are still displaying messed up months later after they were reported the first time. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:53, 20 April 2026 (UTC) :We may have missed this previously, but edits like [https://smn.wikipedia.org/w/index.php?title=Myenster%3AMusikk%C3%A1r&diff=152826&oldid=144359 this] should fix the rendering. This should work for the other pages below as well. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 12:42, 20 April 2026 (UTC) ::Thank you. I'll do the same for any other templates I come across that display like that one did. - [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 15:49, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Diskografia&oldid=62663&useparsoid=1 smnwiki:Myenster:Diskografia] == Instead of dealing with this issue and the other issue on smnwiki listed above, these were quietly archived. These are still displaying messed up months later after they were reported the first time. -[[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://smn.wikipedia.org/w/index.php?title=Myenster:Kirje%C4%8D%C3%A4llee&oldid=32928&useparsoid=1 smnwiki:Myenster:Kirječällee] == Like the other display issues in smnwiki, this is also displaying messed up after the change. [[User:Yupik|Yupik]] ([[User talk:Yupik|talk]]) 09:55, 20 April 2026 (UTC) :Edited as above. For all other pages you encounter on wiki like this, please make similar edits. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:04, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Donald_A._Wollheim&oldid=266357315&useparsoid=1 dewiki:Donald A. Wollheim] == Picture is shown within a big white box, which isn't the case with the old parser. [[User:Mielas|Mielas]] ([[User talk:Mielas|talk]]) 11:15, 20 April 2026 (UTC) :[[phab:T421524]] [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:15, 20 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Hilfe_Diskussion:Bilder&oldid=266370955&useparsoid=1 dewiki:Hilfe Diskussion:Bilder] == see [[w:de:Hilfe Diskussion:Bilder #Skalierung von Bildern mit dem Parameter hochkant scheint nicht mehr zu funktionieren]] [[User:BurghardRichter|BurghardRichter]] ([[User talk:BurghardRichter|talk]]) 22:24, 20 April 2026 (UTC) == [https://tcy.wikipedia.org/w/index.php?title=%E0%B2%AE%E0%B3%81%E0%B2%96%E0%B3%8D%E0%B2%AF_%E0%B2%AA%E0%B3%81%E0%B2%9F&oldid=359337&useparsoid=1 tcywiki:ಮುಖ್ಯ ಪುಟ] == in main page not enable <code>html.skin-theme-clientpref-night</code> [[User:ChiK|ChiK]] ([[User talk:ChiK|talk]]) 05:47, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:23, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == https://de.wikipedia.org/wiki/Gemeindestandsver%C3%A4nderungen_in_der_Schweiz == Die Links zu den Ankern gehen nicht [[Special:Contributions/&#126;2026-24437-27|&#126;2026-24437-27]] ([[User talk:&#126;2026-24437-27|talk]]) 11:53, 21 April 2026 (UTC) :I see you found a solution :) :For the exact issue: generating ids independently from their enclosing tag is not supported by Parsoid (although this is not documented - I'll fix that). :Thanks for the report! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:16, 21 April 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Albosaggia&oldid=50063504&useparsoid=1 svwiki:Albosaggia] == This article, and thousands of other articles, have erroneously been put in hidden categories [[:sv:Kategori:Sidor med referensfel]] and [[:sv:Kategori:Wikipedia:Projekt översätta källmallar]]. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 12:24, 21 April 2026 (UTC) :You can mark this issue as fixed. The problem root cause was in a new Template and Module created this morning. [[User:Plumbum208|Plumbum208]] ([[User talk:Plumbum208|talk]]) 14:40, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Eurovision_Song_Contest_1992&oldid=258716277&useparsoid=1 dewiki:Eurovision Song Contest 1992] == Quelltext bearbeiten ist für Abschnitte nicht sichtbar [[User:Anmey10112|Anmey10112]] ([[User talk:Anmey10112|talk]]) 13:00, 21 April 2026 (UTC) :Translation: "Edit source" is not visible for sections. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:13, 23 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Boro%C8%99e%C8%99ti,_Ia%C8%99i&oldid=17665231&useparsoid=1 rowiki:Boroșești, Iași] == Satul este Borosești nu Boroșești. [[User:Stalmada|Stalmada]] ([[User talk:Stalmada|talk]]) 13:07, 21 April 2026 (UTC) :Content complaint - not Parsoid related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 15:09, 21 April 2026 (UTC) == [https://nl.wikipedia.org/w/index.php?title=Gebouwge%C3%AFntegreerde_zonnepanelen_(BIPV)&oldid=71021732&useparsoid=1 nlwiki:Gebouwgeïntegreerde zonnepanelen (BIPV)] == Bij de afbeeldingen zijn 3 afbeeldingen gecombineerd met de sjabloon {{Afbeelding combi}} . De sjabloon maakt gebruikt van elk aparte tekstvelden voor elke afbeeldingen. Echter is in dit geval bij de eerste twee afbeeldingen geen gebruik gemaakt van tekstveld en is al de tekst aan het eind geplaatst bij de laatste afbeelding. Door dit gebruik van de sjabloon worden de afbeeldingen zonder spatie direct na elkaar vertoont. Op de mobiele website worden de afbeeldingen met dit sjabloon wel met spaties vertoont. Merk op dat de engelse template wel de mogelijkheid heeft om afbeeldingen gecombineerd te laten zien met spaties er tussen en heeft deze variant template meer mogelijkheden dan de NL versie. Mogelijk dat er de uitwerkin ook niet helemaal correct is geweest, maar hierover is niet te oordelen vanwege de beperkte Wiki edit kennis. [[User:Public-Publicity|Public-Publicity]] ([[User talk:Public-Publicity|talk]]) 16:16, 21 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:22, 21 April 2026 (UTC) :Translation: "In this section, three images have been combined using the template `Template:Afbeelding combi`. This template typically utilizes a separate text field for each individual image; however, in this specific instance, the text fields for the first two images were left unused, and all the accompanying text was instead placed at the end, alongside the final image. As a result of this specific application of the template, the images are displayed consecutively without any spacing between them. On the mobile version of the website, however, images utilizing this template *are* displayed with spacing. It is worth noting that the English-language version of this template *does* offer the capability to display combined images with spacing in between—making that variant of the template more versatile than its Dutch counterpart. It is possible that the implementation itself was not entirely correct; however, it is difficult to pass judgment on this matter due to limited expertise in Wiki editing." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:12, 23 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Talk:Rao_Laxmi_Chand&oldid=10828084&useparsoid=1 simplewiki:Talk:Rao Laxmi Chand] == This Page is fake and all the information is fake [[User:Rao Gourav|Rao Gourav]] ([[User talk:Rao Gourav|talk]]) 17:23, 21 April 2026 (UTC) :Triage: Content complaint - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:28, 21 April 2026 (UTC) ::{{done}} [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:07, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80%D0%BE%D0%B2%D1%81%D0%BA%D0%B8%D0%B9,_%D0%A1%D1%82%D0%B5%D0%BF%D0%B0%D0%BD_%D0%A4%D1%91%D0%B4%D0%BE%D1%80%D0%BE%D0%B2%D0%B8%D1%87&oldid=152793914&useparsoid=1 ruwiki:Александровский, Степан Фёдорович] == дублируется реф в инфобоксе [[User:Gleb95|Gleb95]] ([[User talk:Gleb95|talk]]) 20:21, 21 April 2026 (UTC) :Translation: "The reference is duplicated in the infobox." :The legacy parser version has 19 references in the references list, and Parsoid contains 22. This is likely a content issue, although I haven't looked into it to determine root cause. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:11, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is plenty of problems I see related to transliteration to Serbian Cyrillic. I prefer reading articles in Serbian Cyrillic (on top of our UI, I select "Ћирилица"). In current state, Parsoid should not be turned on at all on our Wikipedia {{multiple image | align = center | total_width = 1000 | image1 = Jefri Saks (no Parsoid).png | caption1 = Without Parsoid | image2 = Jefri Saks (Parsoid).png | caption2 = With Parsoid }} Note that, with Parsoid, everything is transliterated, even when marked with correct <nowiki><lang></nowiki> attribute. Without parsoid, original English text is correctly left un-transliterated. There is also a glitch where URL is not rendered in infoboxes, again, probably something about misrendering text which was supposed to avoid transliteration. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:43, 21 April 2026 (UTC) :This is [[phab:T424159|T424159 [P0] Parsoid doesn't "guessVariant" at top level on Serbian Wikipedia, and makes sr-ec rendering "unusable" for some pages]]. Fundamentally, the mark up on that page is incorrect, in so far as English and Latin text aren't properly marked with `-{....}-`. It "worked before" because of a top-level "guessVariant" routine which effectively disabled language converter entirely on some pages, including this one. I suspect I'm going to have to implement the same 'guessVariant' mechanism in Parsoid, since there appears to be too much content of this type without proper language markers. [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 19:04, 23 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%8F%D0%B5%D1%84%D1%80%D0%B8_%D0%A1%D0%B0%D0%BA%D1%81&oldid=30917046&useparsoid=1 srwiki:Џефри Сакс] == There is no "Edit with migration tool" entry in tools on Serbian Wikipedia. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 22:50, 21 April 2026 (UTC) :It needs to be enabled explicitly in Preferences > Editing > Developer tools > Enable parser migration tool. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:44, 23 April 2026 (UTC) == includeonly in headline syntax == no longer resolved properly == ''Example:'' [[w:de:Hilfe:Parserfunktionen]] This page (and many others of our help pages) are made for dual use: # stand alone # transclusion of several help pages of similar topic into a combined complete story. They contain headlines like <syntaxhighlight lang="wikitext"> <includeonly>=</includeonly>== Allgemeines ==<includeonly>=</includeonly> </syntaxhighlight> If stand alone, this shall be displayed as H2. * When combined, the page title will be shown as H2 and the section as H3. Swift solution most welcome – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:23, 22 April 2026 (UTC) : BTW – transclusion works correctly: [[w:de:Hilfe:Parserfunktionen/*]] --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 09:27, 22 April 2026 (UTC) :https://de.wikipedia.org/w/index.php?title=Hilfe:Parserfunktionen&oldid=236466455&useparsoid=1 has our suggested solution (the first form preferably). It works in transclusion mode because the preprocessor is involved. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 16:53, 22 April 2026 (UTC) ::“has our suggested solution (the first form preferably). It works” ::I do not understand what is “our suggested solution” – please look at this current page. It has neither TOC nor any headline, since the == are displayed within the text, using the default parsing. There are 10 headlines. ::Astonished – [[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 21:45, 22 April 2026 (UTC) :::Oops .. sorry! I pasted the wrong link! I meant to point you to [[#dewiki:Hilfe:Parserfunktionen|this section]] on this page. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 00:09, 23 April 2026 (UTC) You’re imposing some work on us. * I am happy that there are [https://de.wikipedia.org/w/index.php?search=H:+insource:includeonly+insource:%2Fincludeonly%5C%3E%3D%2B%5C%3C%5C%2Fincludeonly%2F&title=Spezial:Suche 12 pages only] to be updated now. * Fortunately, some other syntax has been used in [[w:de:H:VE/*]] – [[w:de:H:Lua/*]] – [[w:de:H:Tabellen/*]] – [[w:de:H:FAQ/Übersicht]] which are merging a huge pile of single pages. I do hope this exception will be described in WikiSyntax Documentation soon. --[[User:PerfektesChaos|PerfektesChaos]] ([[User talk:PerfektesChaos|talk]]) 11:04, 23 April 2026 (UTC) :Thanks for your understanding and fixing the pages. Given all the work we've done to deploy to a wiki, at this point, we expect that all remaining rendering issues are likely going to be edge cases that affect small number of pages. We'll update the docs soon, yes. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 13:22, 23 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%9F%D1%80%D0%B5%D0%B4%D1%83%D0%BF%D1%80%D0%B5%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5&oldid=116093745&useparsoid=1 ruwiki:Шаблон:Предупреждение] == [[:ru:Шаблон:Tpre]] ([[:ru:Модуль:Template call code]]) stops working entirely in Parsoid mode. See also local discussion: [[:ru:Википедия:Форум/Технический#c-Tarkoff-20260422084300-Шаблон:Предупреждение]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 16:40, 22 April 2026 (UTC) :That doesn't look good. Do you have a sense of how many pages are impacted? We will take a look tomorrow and see what is going on and if we can roll out a quick fix. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:07, 22 April 2026 (UTC) ::I see what is going on. This is [[phab:T353697|T353697]] which was resolved with https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/992274. The fix is to have the modules emit <code>format="wikitext"</code> so the <nowiki><span> tags aren't escaped as literal output. Can you see if that fixes it?</nowiki> [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:22, 22 April 2026 (UTC) ::: Yes, thank you. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:47, 22 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Rei_Ami&oldid=266367300&useparsoid=1 dewiki:Rei Ami] == The image of Ami on the top right corner should be rendered with a width of 250px but seems to be scaled down to round about 160px. When using the Legacy Parser the image is rendered as expected. The issue seems to effect only some images. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 18:59, 22 April 2026 (UTC) :@[[User:Jon (WMF)|Jon (WMF)]] says, "The original size of the image is 315x427. This is https://phabricator.wikimedia.org/T421524 - only way to fix it is for Parsoid to mark the img up with a class when the image original size is smaller than 400px. Otherwise it's working as expected." I'm not entirely sure I agree with this diagnosis, since T421524 would cause the image to appear "too large" not "too small". :@[[User:Guardian of Arcadia|Guardian of Arcadia]] what is your user thumbnail size preference, and what skin are you using? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:13, 23 April 2026 (UTC) ::@[[User:Cscott|Cscott]]: I'm using the default thumbnail size of 250px and Vector 2010 (Legacy) as skin. But the size issue also occurs when using other skins like Vector 2022, which can be seen by appending <code>useskin=vector-2022</code> to the URL or viewing the page in an incognito window. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 20:37, 23 April 2026 (UTC) :::What browser and version are you using @[[User:Guardian of Arcadia|Guardian of Arcadia]] ? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 21:46, 23 April 2026 (UTC) ::::Also can you check you don't have a different preference set in [[Special:GlobalPreferences]] and possibly try changing it and changing it back? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 23:55, 23 April 2026 (UTC) ::::@[[User:Jon (WMF)|Jon (WMF)]]: The issue isn't limited to my account only; it occurs in a logged-out state (within an incognito window) too. But your guess about the browser seems to be right: I have the described issue when using Firefox with the ESR version 115.35.0esr. Today I have tested with another browser (Chrome and Edge) as well as on a PC with a current (non-ESR) Firefox and there the image is shown as expected. So, is this a bug in this specific Firefox version? [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 19:47, 24 April 2026 (UTC) :::::Yes. This sounds like a bug in that specific Firefox version. If you can give me more details about the operating system version you are using I can see if I can replicate in browserstack.com . Is it possible there are any browser extensions installed on that browser? [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 22:31, 24 April 2026 (UTC) ::::::The operating system on this PC is Windows 8.1 (Build 9600) and I do not have any browser extensions installed there. Hope this helps to reproduce the issue. If you need anything else please let me know. Thanks for your help. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 22:44, 24 April 2026 (UTC) :::::::That was incredibly useful information, thank you. I understand what is happening now, and there might be something we can do here. Note, this browser is on the cusp of our usual browser support levels, which is what's causing the problem. [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 16:54, 27 April 2026 (UTC) ::::::::That's great news. I would be verry happy if you or your team can fix it. [[User:Guardian of Arcadia|Guardian of Arcadia]] ([[User talk:Guardian of Arcadia|talk]]) 17:00, 27 April 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Alexandru_Dobrogeanu-Gherea&oldid=17669378&useparsoid=1 rowiki:Alexandru Dobrogeanu-Gherea] == imaginea prea mare, la fel la multe articole cu infocaseta om politic, de pilda Vasile Luca, Luminita Odobescu etc face contrast cu imagini in alte infocasete unde problema se poate regla [[User:Ewan2|Ewan2]] ([[User talk:Ewan2|talk]]) 01:25, 23 April 2026 (UTC) :Google translate: "the image is too large, the same as in many articles with the politician infobox, for example Vasile Luca, Luminita Odobescu, etc. it contrasts with images in other infoboxes where the problem can be adjusted." [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 18:50, 23 April 2026 (UTC) ::@[[User:Jon (WMF)|Jon (WMF)]] says "For Romanian Wikipedia, there was a problem with the infobox styles. Pretty sure it's been fixed since. It could just be that he's seeing 400px instead of 300px. The infobox image looks identical to me in Parsoid and legacy." ::@[[User:Ewan2|Ewan2]] are you using the default thumbnail size (250px) or a larger size in your user preferences? [[User:Cscott|cscott]] ([[User talk:Cscott|talk]]) 20:07, 23 April 2026 (UTC) == [https://zu.wikipedia.org/w/index.php?title=Gashamo_Hawd_Somali_Ethiopia&oldid=122552&useparsoid=1 zuwiki:Gashamo Hawd Somali Ethiopia] == Is the city of Hawd Zone [[User:Maaaaskaas11|Maaaaskaas11]] ([[User talk:Maaaaskaas11|talk]]) 21:58, 23 April 2026 (UTC) == [https://ru.wikipedia.org/wiki/Текумсе ruwiki:Текумсе] == For some reason, the comment "До эскиза Лоссинга не было известно..." is repeated twice (see subsection "Комментарии" at the end of the article). This comment is generated by template "ref+" placed inside the template "персона" (an analogue of "Template:Infobox person"), and it is supposed to appear only once. Thanks! [[User:Adavyd|Adavyd]] ([[User talk:Adavyd|talk]]) 22:04, 23 April 2026 (UTC) :This is probably {{phab|T415789}}, which would be solved by adding a name to the reference, but then we end up running into {{phab|T423924}} - the template ends up defining the reference twice with subtly different content (as far as Parsoid is concerned) and the same name, which triggers an error. The fix will probably be to add a name to the reference once {{phab|T423924}} is handled. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:43, 24 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=FIDO2&oldid=264704558&useparsoid=1 dewiki:FIDO2] == Erste Grafik überlagert den Text und die Werkzeugleiste links [[User:Hinnerk11|Hinnerk11]] ([[User talk:Hinnerk11|talk]]) 23:51, 23 April 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Utente:Amanda_Kathrine_Smith/Sandbox&oldid=150348388&useparsoid=1 itwiki:Utente:Amanda Kathrine Smith/Sandbox] == i don't see the "MOVE DRAFT" button. [[User:Amanda Kathrine Smith|Amanda Kathrine Smith]] ([[User talk:Amanda Kathrine Smith|talk]]) 14:14, 24 April 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 17:36, 28 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%A1%D1%80%D0%B1%D0%B8%D1%98%D0%B0_(1071%E2%80%941217)&oldid=30892614&useparsoid=1 srwiki:Србија (1071—1217)] == Text inside {{lang-la.. and other {{lang-... templates is not displayed at all. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:46, 24 April 2026 (UTC) :Never mind, in process of adapting our templates for Parsoid, I missed additional change needed in an auxillary module. All is good now. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 17:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%98%D0%B0:%D0%A2%D1%80%D0%B3/%D0%94%D1%80%D1%83%D0%B3%D0%B8&oldid=30921466&useparsoid=1 srwiki:Википедија:Трг/Други] == <nowiki>__NOCONTENTCONVERT__</nowiki> does not work in Parsoid. [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 18:53, 24 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=Queen&oldid=30824348&useparsoid=1 srwiki:Queen] == Parsoid does not honor __БЕЗКН__ (magic word to suppress title conversion during language conversion) [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 20:03, 24 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%92%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%A4%D0%BE%D1%80%D1%83%D0%BC/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8&oldid=152858025&useparsoid=1 ruwiki:Википедия:Форум/Новости] == Исчез логотип в скине Вектор-2010 при включенном гаджете, который отображает праздничные логотипы. При отключении гаджета в настройках — повседневный логотип виден. [[User:Рыцарь поля|Рыцарь поля]] ([[User talk:Рыцарь поля|talk]]) 00:16, 25 April 2026 (UTC) :Triage: not a Parsoid visual issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:22, 27 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9F%D1%80%D0%BE%D0%B5%D0%BA%D1%82:%D0%91%D0%B8%D0%B1%D0%BB%D0%B8%D0%BE%D1%82%D0%B5%D0%BA%D0%B0/%D0%A2%D1%80%D0%B5%D0%B1%D1%83%D1%8E%D1%82%D1%81%D1%8F_%D0%BA%D0%BD%D0%B8%D0%B3%D0%B8&oldid=152853098&useparsoid=1 ruwiki:Проект:Библиотека/Требуются книги] == Конфликт [[:ru:Проект:Библиотека/Требуются книги/Шапка]] с содержанием страницы, из-за чего в [[:ru:Шаблон:shortcut|Шаблон:shortcut]] помещается раздел "содержание" (выглядит это так: [https://ibb.co/219kN3dW 1] и [https://ibb.co/bgM0Fmpn 2]). ------- The conflict between [[:ru:Проект:Библиотека/Требуются книги/Шапка]] and the page content causes the "содержание" section to appear inside [[:ru:Шаблон:shortcut|Шаблон:shortcut]] (this is how it looks: [https://ibb.co/219kN3dW 1] and [https://ibb.co/bgM0Fmpn 2]). [[User:Футболло|Futbollo]] ([[User talk:Футболло|talk]]) 01:10, 25 April 2026 (UTC) :Thank you for the report - I've filed {{phab|T424492}} for it. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:33, 27 April 2026 (UTC) == [https://pt.wikipedia.org/w/index.php?title=Copa_Intercontinental_da_FIFA_de_2025&oldid=72134360&useparsoid=1 ptwiki:Copa Intercontinental da FIFA de 2025] == Quadro de informações foi excluído por acidente. [[User:AnderSilv42|AnderSilv42]] ([[User talk:AnderSilv42|talk]]) 00:16, 26 April 2026 (UTC) :Triage: Content related - not Parsoid related. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 15:23, 26 April 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Michel_W%C3%B6cke&oldid=266505400&useparsoid=1 dewiki:Michel Wöcke] == Bild (Thumb) viel zu gross [[User:Albinfo|Albinfo]] ([[User talk:Albinfo|talk]]) 13:44, 26 April 2026 (UTC) == [https://tn.wikipedia.org/w/index.php?title=Sekolo_Se_Segolwane_Sa_Nata&oldid=49572&useparsoid=1 tnwiki:Sekolo Se Segolwane Sa Nata] == I tried fixing the references but It still says pages with reference errors so I don't know what could be the issue [[User:Blackgirlmighty|Blackgirlmighty]] ([[User talk:Blackgirlmighty|talk]]) 17:00, 26 April 2026 (UTC) :You only need to define a reference once even if you want to use it multiple times - see https://www.mediawiki.org/wiki/Help:Cite#Multiple_uses_of_the_same_footnote for more information. One of each of the references Mmegi2012 and Mmegi2023 should be kept as is; the others should be replaced by <nowiki><ref name="Mmegi2012" /></nowiki> (or 2023) without content. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 09:39, 27 April 2026 (UTC) == [https://simple.wikipedia.org/w/index.php?title=Pete_Aguilar&oldid=8671369&useparsoid=1 simplewiki:Pete Aguilar] == This is a less detailed copy of another Wikipedia page. There are two wiki pages showing Pete Aguilar and this is an outdated version. [[User:SuperPug3739|SuperPug3739]] ([[User talk:SuperPug3739|talk]]) 04:56, 27 April 2026 (UTC) :Triage: content related, not Parsoid related [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:46, 27 April 2026 (UTC) == [https://fi.wikipedia.org/w/index.php?title=Hoito-_kasvatussuunnitelma&oldid=23973675&useparsoid=1 fiwiki:Hoito- kasvatussuunnitelma] == Sivun nimi piti olla Hoito- ja kasvatussuunnitelma. Muokkaaminen ei onnistunut. [[User:Nebiux|Nebiux]] ([[User talk:Nebiux|talk]]) 12:01, 29 April 2026 (UTC) :Triage: content related, not Parsoid-related. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:04, 30 April 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Usuario:Luigi_Nakano&oldid=173203320&useparsoid=1 eswiki:Usuario:Luigi Nakano] == An error appears, which should appear when template [[w:es:Plantilla:Estado usuario|Estado usuario]] has nothing in 1=. However, there is a parameter in 1=, so the result should be "Conectado" or "Desconectado", and not "Error:No se ha indicado usuario.". [[User:Luigi Nakano|<span style="color:green">Luigi</span> <span style="color:blue">Nakano</span>]] [[File:Emojione 1F3A7.svg|15px]] ([[User talk:Luigi Nakano|会話]]) 23:12, 29 April 2026 (UTC) :This looks like {{phab|T348722}}, for which a workaround is suggested in https://www.mediawiki.org/wiki/Parsoid/Parser_Unification/Instructions_for_editors#Access_to_parent_frame_from_within_extensions. Let us know if the problem persists after the fix! [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:10, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=History_of_the_Ryukyu_Islands&oldid=1336895218&useparsoid=1 enwiki:History of the Ryukyu Islands] == The multiple issues display unsourced template when editing the article there is no such template. [[User:Lightoil|Lightoil]] ([[User talk:Lightoil|talk]]) 05:11, 30 April 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%A7%D1%85%D0%B0%D0%B8%D0%B4%D0%B7%D0%B5,_%D0%9C%D0%B0%D0%BC%D0%B8%D1%8F_%D0%92%D0%B8%D1%81%D1%81%D0%B0%D1%80%D0%B8%D0%BE%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&oldid=152923873&useparsoid=1 ruwiki:Чхаидзе, Мамия Виссарионович] == In the old parser, links to non-existing file pages lead to Special:Upload for the file. In Parsoid, it's a strange link to Special:FilePath, which ends up confusing the editors who accustomed to uploading files this way. [[:ru:Служебная:GoToComment/c-ФВ-20260430140600-Не_загружается_файл|See local discussion]]. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 20:53, 30 April 2026 (UTC) == [https://sr.wikipedia.org/w/index.php?title=%D0%94%D0%B5%D1%80%D0%B2%D0%B8%D1%88_%D0%9A%D0%BE%D1%80%D0%BA%D1%83%D1%82&oldid=30931273&useparsoid=1 srwiki:Дервиш Коркут] == At the bottom, there are several navboxes, Parsoid adds some whitespace between them [[File:Spaces between navboxes with Parsoid..png]] [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 21:21, 30 April 2026 (UTC) : https://phabricator.wikimedia.org/T425123 [[User:Ђидо|Ђидо]] ([[User talk:Ђидо|talk]]) 15:27, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Sevayat&oldid=1351876642&useparsoid=1 enwiki:Talk:Sevayat] == The content assessment and talk page are displayed directly on the talk page, rather than within the “About this page” section (mobile view). [[User:S4yam|S4yam]] ([[User talk:S4yam|talk]]) 21:44, 30 April 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:Template_editor&oldid=1351909200&useparsoid=1 enwiki:Wikipedia talk:Template editor] == I'm artist thi is my personal biography page [[User:Allymtulia|Allymtulia]] ([[User talk:Allymtulia|talk]]) 21:45, 30 April 2026 (UTC) :Triage: Content issue, not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Middle_of_Nowhere_(Kacey_Musgraves_album)&oldid=1351931473&useparsoid=1 enwiki:Middle of Nowhere (Kacey Musgraves album)] == Producer parameter that adops hlist system in Infobox album template occurs an error. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 01:07, 1 May 2026 (UTC) :Triage: Not a Parsoid issue. [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 08:36, 1 May 2026 (UTC) == [https://it.wikipedia.org/w/index.php?title=Associazione_Calcio_Perugia_1996-1997&oldid=148287407&useparsoid=1 itwiki:Associazione Calcio Perugia 1996-1997] == Doesn't show all kits. Just the third and on top of the screen [[User:Madive60|Madive60]] ([[User talk:Madive60|talk]]) 01:29, 1 May 2026 (UTC) :This is probably fixed by the fix to {{phab|T425056}} and the current CSS workaround on-wiki. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:22, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%9B%BD%E6%97%97%E3%81%AE%E4%B8%80%E8%A6%A7&oldid=109342678&useparsoid=1 jawiki:国旗の一覧] == イラクの国旗がない [[User:平舞|平舞]] ([[User talk:平舞|talk]]) 03:17, 1 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:21, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Manting_Chan&oldid=1351960413&useparsoid=1 enwiki:Manting Chan] == Divorce, she is not divorced. [[User:Bananahammock311911511|Bananahammock311911511]] ([[User talk:Bananahammock311911511|talk]]) 04:54, 1 May 2026 (UTC) :Content issue, not a Parsoid issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 07:30, 1 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E9%9B%B7%E9%96%80%E9%9F%B3%E5%8A%A9&oldid=109345108&useparsoid=1 jawiki:雷門音助] == {{人名の曖昧さ回避}}や{{aimai}}を貼ると表示が崩れる。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 07:27, 1 May 2026 (UTC) :<nowiki>[[:jawiki:雷門五郎]]</nowiki>でも同様の問題が起きています。 [[User:フューチャー|フューチャー]] ([[User talk:フューチャー|talk]]) 09:09, 1 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Talk:Iceman_(Drake_album)&oldid=1350717409&useparsoid=1 enwiki:Talk:Iceman (Drake album)] == Banners showing up on mobile, not under “learn more about this page button” [[User:OrbitalVoid49|OrbitalVoid49]] ([[User talk:OrbitalVoid49|talk]]) 09:36, 1 May 2026 (UTC) == [https://ro.wikipedia.org/w/index.php?title=Bancu,_Harghita&oldid=13617293&useparsoid=1 rowiki:Bancu, Harghita] == Steagulnjudetului Hargita nu este acea cârpă secuiasca. [[User:Auto 4115|Auto 4115]] ([[User talk:Auto 4115|talk]]) 01:39, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Aurangabad&oldid=1351274322&useparsoid=1 enwiki:Aurangabad] == It has the old name of the city as it's title [[User:20mphwind|20mphwind]] ([[User talk:20mphwind|talk]]) 07:09, 2 May 2026 (UTC) :Content issue, not a Parsoid issue [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:20, 2 May 2026 (UTC) == [https://bn.wikipedia.org/w/index.php?title=%E0%A6%B9%E0%A6%BE%E0%A6%9C%E0%A6%B0%E0%A6%BE%E0%A6%AC%E0%A6%BE%E0%A6%A1%E0%A6%BC%E0%A7%80_%E0%A6%89%E0%A6%9A%E0%A7%8D%E0%A6%9A_%E0%A6%AC%E0%A6%BF%E0%A6%A6%E0%A7%8D%E0%A6%AF%E0%A6%BE%E0%A6%B2%E0%A6%AF%E0%A6%BC&oldid=8874755&useparsoid=1 bnwiki:হাজরাবাড়ী উচ্চ বিদ্যালয়] == তথ্যসুত্র ব্যয়বহুল নয়। [[User:Md Umor Faruk 2010|Md Umor Faruk 2010]] ([[User talk:Md Umor Faruk 2010|talk]]) 08:00, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=She_Did_It_Again&oldid=1352147079&useparsoid=1 enwiki:She Did It Again] == (Mobile) Huge error in hlist. Bullet points (•) are missing, and the items listed are arranged very roughly. Not sure why this error occurs for over three days. [[User:Camilasdandelions|Camilasdandelions]] ([[User talk:Camilasdandelions|talk]]) 10:45, 2 May 2026 (UTC) :Thank you for the report - I have filed {{phab|T425245}} for this issue. [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 08:30, 3 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E6%9D%91%E4%B8%8A%E5%93%B2&oldid=109361964&useparsoid=1 jawiki:村上哲] == [[Template:循環参照]]が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:13, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=Wikipedia:%E4%BA%95%E6%88%B8%E7%AB%AF&oldid=109349724&useparsoid=1 jawiki:Wikipedia:井戸端] == 目次が表示されません。 [[User:Keruby|Keruby]] ([[User talk:Keruby|talk]]) 14:20, 2 May 2026 (UTC) == [https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1 enwiki:Wiki (disambiguation)] == [[w:en:tm:dab]] (at the bottom of the page) appears to render differently on Parsoid compared to non-Parsoid. <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 14:27, 2 May 2026 (UTC) :Also appears to render differently on desktop Parsoid v. mobile Parsoid -- compare https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=mobile (different rendering) vs. https://en.wikipedia.org/w/index.php?title=Wiki_(disambiguation)&oldid=1318366377&useparsoid=1&useformat=desktop ('expected' rendering, AFAIK) <span class="skin-invert" style="color:#000"><span style="">&zwj;—&zwj;</span>[[user:a smart kitten|<span style="color:purple">a&nbsp;smart kitten</span>]]<sub>[<nowiki/>[[user talk:a smart kitten|<span style="color:#c814c8">meow</span>]]]</sub></span> 16:34, 2 May 2026 (UTC) == [https://hu.wikipedia.org/w/index.php?title=Horv%C3%A1th_Kriszti%C3%A1n_(fest%C5%91,_1976,_Budapest)&oldid=28948319&useparsoid=1 huwiki:Horváth Krisztián (festő, 1976, Budapest)] == Az a probléma, hogy nem szeretném hoyg festő, és 1976 Budapest legyen hozzá kírva. Elrontottam, és nem tudtam külön, új cikket írni róla. [[User:Pizzsus|Pizzsus]] ([[User talk:Pizzsus|talk]]) 20:47, 2 May 2026 (UTC) == [https://he.wikipedia.org/w/index.php?title=%D7%99%D7%A6%D7%97%D7%A7_%D7%9E%D7%90%D7%99%D7%A8_%D7%90%D7%9C%D7%AA%D7%A8&oldid=43088529&useparsoid=1 hewiki:יצחק מאיר אלתר] == הציטוטים בכתב דיויד בעברית לקויים. Text quotes in David font are displayed poorly. [[User:פרידבערג|פרידבערג]] ([[User talk:פרידבערג|talk]]) 21:36, 2 May 2026 (UTC) == [https://ru.wikipedia.org/w/index.php?title=%D0%9B%D0%B8%D1%86%D0%B5%D0%BD%D0%B7%D0%B8%D0%B8_%D0%B8_%D0%B8%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B_Creative_Commons&oldid=152790052&useparsoid=1 ruwiki:Лицензии и инструменты Creative Commons] == refs don't work with vector-2010 (but it works for vector-2022) [[User:Petsernik|Petsernik]] ([[User talk:Petsernik|talk]]) 23:05, 2 May 2026 (UTC) == [https://es.wikipedia.org/w/index.php?title=Huawei&oldid=173270512&useparsoid=1 eswiki:Huawei] == El segundo sitio web que sale no existe es un vandalismo en wikimedia ingles o un error [[User:Usuario 016|Usuario 016]] ([[User talk:Usuario 016|talk]]) 23:15, 2 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=%E5%8C%97%E6%9D%91%E8%81%A1&oldid=109365307&useparsoid=1 jawiki:北村聡] == 人名の曖昧さ回避Templateを挿入すると、上手く表示されず、大きな改行空白と共に「.mw-parser-output .dmbox{display:flex;align-items:center;clear:both;margin:0.9em 1em;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:0.25em 0.35em;font-size:95%}.mw-parser-output .dmbox>*{flex-shrink:0;margin:0 0.25em;display:inline}.mw-parser-output .dmbox-body{flex-grow:1;flex-shrink:1;padding:0.1em 0}」 というものが出る。 [[User:Geogie|Geogie]] ([[User talk:Geogie|talk]]) 23:35, 2 May 2026 (UTC) == [https://de.wikipedia.org/w/index.php?title=Wikipedia:Schreibwettbewerb&oldid=266703390&useparsoid=1 dewiki:Wikipedia:Schreibwettbewerb] == Text in der Blauen Tabelle ("Reviewpreis") überschneidet die rechte äußere Begrenzungslinie [[User:Polibil|Polibil]] ([[User talk:Polibil|talk]]) 15:30, 3 May 2026 (UTC) == [https://en.wikipedia.org/wiki/Template:Center enwiki:Template:Center] == Does not load on mobile version, most of the page tools are missing. [[File:Template Center issue.jpg|thumb|issue]] [[User:Misterpotatoman|Misterpotatoman]] ([[User talk:Misterpotatoman|talk]]) 19:28, 3 May 2026 (UTC) :Thank you for the report. This is due to {{phab|T425008}} - we'll fix this rapidly (it probably will not happen in this week's train, but it may be worth an out-of-train deploy). [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 10:59, 4 May 2026 (UTC) == [https://gl.wikipedia.org/w/index.php?title=Limodre,_Fene&oldid=7383114&useparsoid=1 glwiki:Limodre, Fene] == Fueron borrados los lugares de la parroquia de Limodre sin querer [[User:Vi1993|Vi1993]] ([[User talk:Vi1993|talk]]) 22:03, 3 May 2026 (UTC) == [https://ja.wikipedia.org/w/index.php?title=Template:Aimai&oldid=93697981&useparsoid=1 jawiki:Template:Aimai] == I am seeing a layout breakage where TemplateStyle CSS is rendered as plain text, but only when the page is processed via Parsoid. 「.mw-parser-output .dmbox{display:flex;align-items:center;clear:both;margin:0.9em 1em;border-top:1px solid #ccc;border-bottom:1px solid #ccc;padding:0.25em 0.35em;font-size:95%}.mw-parser-output .dmbox>*{flex-shrink:0;margin:0 0.25em;display:inline}.mw-parser-output .dmbox-body{flex-grow:1;flex-shrink:1;padding:0.1em 0}」 The output shows the CSS source code from the TemplateStyles of Template:Dmbox. Source of the CSS: https://ja.wikipedia.org/wiki/Template:Dmbox/styles.css The behavior is intermittent across different articles that call the same template. Some display correctly, while others fail. I haven't been able to identify the exact trigger for this discrepancy. [[User:Yukida-R|Yukida-R]] ([[User talk:Yukida-R|talk]]) 02:16, 4 May 2026 (UTC) == [https://sv.wikipedia.org/w/index.php?title=Iliade&oldid=59249057&useparsoid=1 svwiki:Iliade] == Jag är jätte ledsen jag trodde det stod Illiaden på en länk och jag trodde det inte fanns en artikel om det på svenska wikipedia. Kan någon snälla ta bort denna? Förlåt. [[User:EliteWoodCutter|EliteWoodCutter]] ([[User talk:EliteWoodCutter|talk]]) 10:56, 4 May 2026 (UTC) opezhtgo4aw9jtfxyg28blu3hukj7wu Extension:NoTOC/pt 102 2246798 8365105 7818597 2026-05-04T10:21:21Z FuzzyBot 451990 Updating to match new version of source page 8365105 wikitext text/x-wiki <languages /> {{Unmaintained extension|alternative={{ll|Extension:NoTOCModern}}}} {{Extension code in wiki}} {{Extension |status = unmaintained |type1 = parser |type2 = |hook1 = ParserClearState |hook2 = |username = Frantik |author = Andrew Fitzgerald |description = Desativa a "Tabela de Conteúdos" por predefinição em todas as págians |image = |imagesize = |version = 0.1.1 |update = 2013-12-11 |mediawiki = |php = |license = GPL-2.0-or-later |download = Veja a [[#Code|secção do código]] |needs-updatephp = No |readme = |changelog = |parameters = |tags = |rights = |example = |compatibility = }} A extensão '''NoTOC''' oculta a tabela de conteúdos por predefinição. A palavra mágica <nowiki>__TOC__</nowiki> ainda pode ser utilizada normalmente. <span id="Installation"></span> == Instalação == {{ExtensionInstall |download-link=[[#Code|Copiar os códigos para os ficheiros]] }} <span id="Code"></span> == Código == ;NoTOC.php <syntaxhighlight lang="php"> <?php /** * NoTOC extension - Turns off the Table of Contents (TOC) by default on all pages * @version 0.1.1 - 2013/12/11 * * @link https://www.mediawiki.org/wiki/Extension:NoTOC Documentation * @link https://www.mediawiki.org/wiki/Extension_talk:NoTOC Support * * @ingroup Extensions * @package MediaWiki * @author Andrew Fitzgerald (Frantik) * @author Karsten Hoffmeyer (Kghbln) * @copyright (C) 2010 Andrew Fitzgerald * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later */ // check the call if ( !defined( 'MEDIAWIKI' ) ) { die( 'This file is a MediaWiki extension and thus not a valid entry point.' ); } // provide information $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'NoTOC', 'author' => array( 'Andrew Fitzgerald', '...' ), 'url' => 'https://www.mediawiki.org/wiki/Extension:NoTOC', 'descriptionmsg' => 'notoc-desc', 'version' => '0.1.1' ); // show way to files $wgExtensionMessagesFiles['NoTOC'] = dirname( __FILE__ ) . '/NoTOC.i18n.php'; // register hooks $wgHooks['ParserClearState'][] = 'efMWNoTOC'; // perform purpose function efMWNoTOC($parser) { $parser->mShowToc = false; return true; } </syntaxhighlight> ;NoTOC.i18n.php <syntaxhighlight lang="php"> <?php /** * Internationalization file for the NoTOC extension. * * @licence GNU GPL v2+ * @author Karsten Hoffmeyer (Kghbln) */ $messages = array(); /** English * @author Frantik * @author Kghbln */ $messages['en'] = array( 'notoc-desc' => 'Turns off the Table of Contents (TOC) by default on all pages', ); /** Message documentation (Message documentation) * @author Kghbln */ $messages['qqq'] = array( 'notoc-desc' => '{{desc|name=NoTOC|url=https://www.mediawiki.org/wiki/Extension:NoTOC}}', ); /** German (Deutsch) * @author Kghbln */ $messages['de'] = array( 'notoc-desc' => 'Unterdrückt die automatische Generierung des Inhaltsverzeichnisses', ); </syntaxhighlight> <span id="See_also"></span> == Consultar também == * {{ll|Extension:ForceTocOnEveryPage}} * {{ll|Extension:DeToc}} - Isto pode ser utilizado para extrair HTML da TOC e removê-la ou colocá-la em alguma outra secção da página. [[Category:TOC extensions{{#translation:}}]] m8cr9jp7wjfl4vy8gehucm17375zfjx Manual:Filerevision table/cs 100 2272281 8364436 8363546 2026-05-03T15:29:34Z Rebulka 17532855 8364436 wikitext text/x-wiki <languages /> {{Database layout}} {{MW 1.44|+|gerrit change=1091477}} {{TOCright}} Tato tabulka uchovává informace o revizích nahraných obrázků a dalších souborů. Je to součást výměny následujících starých tabulek: {{ll|Manual:Image table|image}}, {{ll|Manual:oldimage table|oldimage}}, {{ll|Manual:filearchive table|filearchive}} <span id="Fields"></span> == Pole == === fr_id === Primární klíč. === fr_file === ID souboru, ke kterému tato revize patří. Cizí klíč k tabulce {{ll|Manual:file table|file}}. === fr_size === Velikost této revize souboru v bajtech. === fr_width === Šířka této revize souboru v pixelech (pokud je to relevantní). === fr_height === Výška této revize souboru v pixelech (pokud je to relevantní). === fr_metadata === Extrahovaná metadata Exif uložená jako pole JSON (nový systém) nebo serializované pole PHP (starý systém). Pole JSON může obsahovat adresu v tabulce text nebo v externím úložišti. === fr_bits === Bity na pixel této revize souboru (pokud je to relevantní). === fr_description_id === Nahrát komentář k této revizi souboru. Cizí klíč k tabulce {{ll|Manual:comment table|comment}}. === fr_actor === Aktér, který nahrál tuto revizi souboru. Cizí klíč k tabulce {{ll|Manual:actor table|actor}}. === fr_timestamp === Časové razítko pro tuto revizi souboru (ve formátu časového razítka MW). === fr_sha1 === Hash obsahu SHA-1 pro tuto revizi souboru v base-36. === fr_archive_name === Název archivovaného souboru. Obvykle se jedná o časové razítko a před základním názvem je předpona <code>!</code>. === fr_deleted === Zda je tato revize souboru smazána. <span id="Schema_summary"></span> == Přehled změn ve schématu tabulky == {{MW 1.44|+|gerrit change=1091477}}{{describe table}} <pre> +-------------------+----------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------------+----------------------+------+-----+---------+----------------+ | fr_id | bigint(20) unsigned | NO | PRI | NULL | auto_increment | | fr_file | bigint(20) | NO | MUL | NULL | | | fr_size | bigint(20) unsigned | NO | MUL | 0 | | | fr_width | int(10) unsigned | NO | | 0 | | | fr_height | int(10) unsigned | NO | | 0 | | | fr_metadata | mediumblob | NO | | NULL | | | fr_bits | int(10) unsigned | NO | | 0 | | | fr_description_id | bigint(20) unsigned | NO | | NULL | | | fr_actor | bigint(20) unsigned | NO | MUL | NULL | | | fr_timestamp | binary(14) | NO | MUL | NULL | | | fr_sha1 | varbinary(32) | NO | MUL | | | | fr_archive_name | varbinary(255) | NO | | | | | fr_deleted | smallint(5) unsigned | NO | | NULL | | +-------------------+----------------------+------+-----+---------+----------------+ </pre> <span id="Indexes"></span> == Indexy == {{MW 1.44|+|gerrit change=1091477}} {{show index in table}} <pre style="overflow-x: scroll; white-space: pre;"> +--------------+------------+--------------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +--------------+------------+--------------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | filerevision | 0 | PRIMARY | 1 | fr_id | A | 0 | NULL | NULL | | BTREE | | | | filerevision | 1 | fr_actor_timestamp | 1 | fr_actor | A | 0 | NULL | NULL | | BTREE | | | | filerevision | 1 | fr_actor_timestamp | 2 | fr_timestamp | A | 0 | NULL | NULL | | BTREE | | | | filerevision | 1 | fr_size | 1 | fr_size | A | 0 | NULL | NULL | | BTREE | | | | filerevision | 1 | fr_timestamp | 1 | fr_timestamp | A | 0 | NULL | NULL | | BTREE | | | | filerevision | 1 | fr_sha1 | 1 | fr_sha1 | A | 0 | 10 | NULL | | BTREE | | | | filerevision | 1 | fr_file | 1 | fr_file | A | 0 | NULL | NULL | | BTREE | | | +--------------+------------+--------------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ </pre> {{databases}} ogxaxtgm7xxo87iv5n2l62tnxk9a74y Category:Wikimedia Hackathon 2026 14 2274341 8365131 8361420 2026-05-04T11:23:33Z ~2026-27075-27 18368275 8365131 wikitext text/x-wiki [[Category:MediaWiki developer meetings{{#translation:}}]] [[Category:Hackathons{{#translation:}}]] 51dqrfa342hoft5zmzj8mvmqydrmxix 8365132 8365131 2026-05-04T11:24:28Z Clump 81610 Reverted edits by [[Special:Contribs/~2026-27075-27|~2026-27075-27]] ([[User talk:~2026-27075-27|talk]]) to last version by Shirayuki 8361420 wikitext text/x-wiki <languages /> <translate></translate> [[Category:MediaWiki developer meetings{{#translation:}}]] [[Category:Hackathons{{#translation:}}]] glcsc8k0kc06881dwt3j7y4uqxrkxxh Translations:Manual:Filerevision table/6/cs 1198 2275615 8364435 7929795 2026-05-03T15:29:33Z Rebulka 17532855 8364435 wikitext text/x-wiki ID souboru, ke kterému tato revize patří. gdzr4ay2fchsn0skbrc6r7a46105uf0 Wikimedia Hackathon 2026/Program 0 2301810 8364342 8364124 2026-05-03T13:01:33Z Sdkb 632437 /* Sunday 03 May 2026 */ add itinerary 8364342 wikitext text/x-wiki __NOTALK__ <languages/> {{:Wikimedia Hackathon 2026/Header|page=2}} <div style="background: #F6F6F6; border-radius:10px; border:1px solid #A4A4A4; margin:5px 15px;"><div style="margin: 1em; color:#555;"><div style="font-size: 130%; font-family: Tahoma, sans-serif; text-align:left; line-height: 1.5;"> The Hackathon is participant-driven and gets its life from the active participation of its attendees. Below you will find some information on [[#How_to_contribute|how to contribute]] to the program as an attendee. Local communities are also welcome to organize pre-hackathon events, watch-parties or meetups in their region. More information about organization and funding is available on the [[Wikimedia_Hackathon_2026/Satellite_Events|satellite events]] page. </div>{{TOC|limit=3}}</div></div> {{Info|'''This year's hackathon will use the unconference format, with session lengths between 30 minutes and 60 minutes available.''' Add your proposed session to the "Proposed Unconference Sessions" [https://phabricator.wikimedia.org/project/view/8319/ column on the Hackathon 2026 workboard] with the <code>#Wikimedia-Hackathon-2026</code> tag. Then add your session title and name to the schedule! Please ensure you link to your Phabricator task so interested participants can see the full details. Be sure to follow the format listed in the [[#How to contribute]] section of this page. If you're interested in a particular session, please be sure to demonstrate your interest by subscribing to the task in Phabricator! }} {{:Wikimedia_Hackathon_2026/Program/Schedule}} == Room descriptions and capacity == Our main hacking spaces will be on the Floor 2 of the Voco Fiere Hotel Milan; the breakout rooms, quiet room, and the second hacking space (available Friday and Saturday afternoons) will be on Floor 1. '''Floor 2:''' * Main Space - general hacking and where the opening ceremony and closing showcase will happen ** Open from Friday: 09:00–02:00; Saturday: 07:00–02:00; Sunday: 07:00–17:00 * Foyer off Main Space - breaks, snacks and socializing '''Lobby level:''' * Event registration (on Thursday from 12:00–19:00; on Friday from 08:00–09:30) * Space for attendees to socialize and play games '''Floor 1:''' * Space 4 - Unconference sessions and hacking space ** Friday *** 10:45–13:00: Unconference sessions *** 13:00–23:00: Hacking ** Saturday *** 07:00–12:15: Unconference sessions *** 12:15–23:00: Hacking ** Sunday *** 07:00–14:00: Unconference sessions * Space 5 - Unconference sessions and games ** Friday *** 10:45–17:00: Unconference sessions *** 18:30–23:00: Tombola Night ** Saturday *** 07:00–17:00: Unconference sessions ** Sunday *** 07:00–14:00: Unconference sessions * Space 6 - Quiet space * Ristorante Betulla - Where lunch and dinner will be provided '''Room availability:''' * Our hacking rooms - The Main Space will be open until 14:00 on Friday and Saturday night; Space 4 will be open until 23:00. * Space 5 and Space 6 will be closed overnight starting at 18:00. * On Sunday, all rooms close at 17:00 == How to contribute == You can use the Phabricator templates [[phab:T415213|here]] to propose a project or sign up as a participant looking for a project '''Propose a session, workshop, or project''' * '''Proposed Projects -''' Hands-on skill development workshops on topics around the technology stack of Wikimedia projects. * '''Proposed Unconference Sessions -''' Sessions or workshops covering any of the [[:File:Wm technical areas.svg|Wikimedia technical areas]]. For any of the items listed above, use the [https://w.wiki/Kew5 proposal template]. Also, indicate in the task description if your proposed activity is newcomer-friendly. '''Get the word out''' * Add your name and interests - including things you can teach and things you want to learn about - to our participants page. * Email the organizers with any questions, we can help! '''Sign up as a participant''' If you want to work on something but you're not sure what, use the [https://w.wiki/KewC participant template] to let others know that you are looking for a project. If you're interested in a specific unconference session, you can indicate your interest by subscribing to the task. You can also add yourself to the ''Volunteer sign-ups'' column if you would like to help with small tasks involved with running the Hackathon. == How to conduct your session and/or workshop == Here are some tips: * We have a [https://docs.google.com/presentation/d/1019ZQltl-M5tsQ6tJz8UaWnTDG9-9MmF044-4IUQqHA/edit?usp=sharing Hackathon themed slide deck] with best practices and more; please make a copy and add the information for your session. * You can propose sessions as presentations, workshops, discussions, or any other format that suits your requirements. ** Feel free to host language- or community-specific sessions and/or meetups. * Session focus should be less on beginner-level workshops (unlike in some previous Hackathons), as this event brings together individuals who have already contributed to technical aspects of the Wikimedia projects. * If there isn't a dedicated space for your session, be prepared to run your session without a projector at a specific hackathon table in a quiet corner of one of the bigger rooms, in the foyer, or outside. * You are welcome to reach out to the event organizers to seek help to prepare, get feedback on your presentation, or any training support you might need a few weeks before the hackathon event. == Social gatherings and side events in Milan == === Format to use for your event === * What: * Meeting point: * Meeting time: * Duration: * Itinerary: * Register your interest, using your signature (4 tildes): === Thursday 30 April 2026 === ''Hackathon participants arrive'' === Friday 01 May 2026 === ''Hackathon kicks off!'' * What: Board games ** Meeting point: Space 5 ** Meeting time: 17:00 ** Duration: 17:00–20:30 ** '''max 6 people:''' Register your interest, using your signature (4 tildes): **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:45, 21 April 2026 (UTC) * What: Tombola night with cute prizes ** Meeting point: Space 5 ** Meeting time: 21:00 ** Duration: 21:00–23:00 ** '''3 rounds, max 48 people each:''' Register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:40, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:12, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:53, 20 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:42, 21 April 2026 (UTC) **#[[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:57, 23 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 01:35, 24 April 2026 (UTC) **# [[User:DaxServer|DaxServer]] ([[User talk:DaxServer|talk]]) 08:26, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:04, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:HCoplin-WMF|HCoplin-WMF]] ([[User talk:HCoplin-WMF|talk]]) 15:36, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:19, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:28, 25 April 2026 (UTC) **#[[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:49, 26 April 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 13:29, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 17:15, 28 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:22, 29 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 08:05, 1 May 2026 (UTC) **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 17:19, 1 May 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 18:06, 1 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:10, 2 May 2026 (UTC) === Saturday 02 May 2026 === ''Hacking!'' * What: Learning and Creating LGBTQIA+ Knowledge and History in Milan (moved from 1 May 2026 due to [https://it.wikipedia.org/wiki/Festa_dei_lavoratori Labour Day]) ** Meeting point: voco Milan-Fiere Hotel lobby ** Meeting time: 15:00 ** Duration: ~3-4 hours (flexible, you can message us if you want to meet us earlier or later) ** Itinerary (flexible and subject to change, please feel free to add locations you'd like or recommend below): *** [https://www.libreriantigone.com/ Antigone - Libreria lgbtqia+], open 15:00–19:30 *** [https://www.instagram.com/leccomilano/ Leccomilano], open 17:00–02:00 ** Register your interest, using your signature (4 tildes): **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:24, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **#[[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) **#[[User:Suzanne Wood (WMDE)|Suzanne Wood (WMDE)]] ([[User talk:Suzanne Wood (WMDE)|talk]]) 21:51, 1 May 2026 (UTC) **#Adenisse (WMF) * What: [https://meta.wikimedia.org/wiki/Event:Hardware_tools_for_Wiki/Raspberry_JAM_at_Wikimedia_Hackathon_Milan_2026 Raspberry JAM] ** Meeting point: Space 5 ** Meeting time: 17:30 ** Duration:1 hour ** Itinerary: Register your interest, using your signature (4 tildes): # '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:58, 24 April 2026 (UTC) # [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but discovered too late) * What: Train Spotting near the Hotel ** Description: There is a railway line near the Hotel and many trains pass through there. Lets have some conversations tech related or related to trains or public transport outside while watching the railway line. ** Meeting point: Entrance of the Hotel, later you can find us at the fence next to the railway line ** Duration: 1 hour, you can join later and leave earlier ** Itinerary: Register your interest, using your signature (4 tildes): # --[[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 17:54, 1 May 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but unable to attend) * What: Historical Tram Experience ** Meeting point: Hotel lobby ** Meeting time: 19:45 (leaving at 20:15) ** Duration: 3.33 hours ** Itinerary: Arco della Pace, Monumentale Cemetry, Piazza Fontana, Piazza della Repubblica, Scala, Navigli , Darsena, Brera, Milano Arena, On tram karaoke ** '''Max 59 people''', register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:42, 10 April 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 21:58, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:11, 11 April 2026 (UTC) **# [[User:GChoi-WMF|GChoi-WMF]] ([[User talk:GChoi-WMF|talk]]) 20:54, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:42, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 08:51, 15 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 14:58, 15 April 2026 (UTC) **# [[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 15:28, 15 April 2026 (UTC) **# [[User:Lupamo Arnold|Lupamo]] ([[User talk:Lupamo Arnold|talk]]) 18:23, 17 April 2026 (UTC) **# [[User:MSzwarc-WMF|MSzwarc-WMF]] ([[User talk:MSzwarc-WMF|talk]]) 17:44, 18 April 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 08:36, 19 April 2026 (UTC) **# [[User:VriaA|VriaA]] ([[User talk:VriaA|talk]]) 04:22, 20 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 10:46, 20 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:50, 20 April 2026 (UTC) **# [[User:ErikaGuetti|ErikaGuetti]] **# [[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:58, 23 April 2026 (UTC) **# [[User:DTorsani-WMF|DTorsani-WMF]] ([[User talk:DTorsani-WMF|talk]]) 00:08, 24 April 2026 (UTC) **# [[User:SSingh (WMF)|SSingh (WMF)]] ([[User talk:SSingh (WMF)|talk]]) 00:48, 24 April 2026 (UTC) **# [[User:Danielyepezgarces|dyepezg]] ([[User talk:Danielyepezgarces|talk]]) 03:09, 24 April 2026 (UTC) **# [[User:SD0001|SD0001]] ([[User talk:SD0001|talk]]) 04:10, 24 April 2026 (UTC) **# [[User:Kaspo|Kaspo]] ([[User talk:Kaspo|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Manimaran96|Manimaran96]] ([[User talk:Manimaran96|talk]]) 07:54, 24 April 2026 (UTC) **# [[User:Silvan Heintze (WMDE)|Silvan Heintze (WMDE)]] ([[User talk:Silvan Heintze (WMDE)|talk]]) 08:00, 24 April 2026 (UTC) **# [[User:T Arrow|T Arrow]] ([[User talk:T Arrow|talk]]) 08:04, 24 April 2026 (UTC) **# [[User:Ollie Shotton (WMDE)|Ollie Shotton (WMDE)]] ([[User talk:Ollie Shotton (WMDE)|talk]]) (Ollie Hyde) **# [[User:Martyn Ranyard (WMDE)|Martyn Ranyard (WMDE)]] ([[User talk:Martyn Ranyard (WMDE)|talk]]) 08:09, 24 April 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 08:15, 24 April 2026 (UTC) **# [[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) (Neslihan Turan) **# [[User:Filippo Giunchedi|Filippo Giunchedi]] ([[User talk:Filippo Giunchedi|talk]]) 08:49, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:05, 24 April 2026 (UTC) **# [[User:FNegri-WMF|FNegri-WMF]] ([[User talk:FNegri-WMF|talk]]) 09:07, 24 April 2026 (UTC) **# [[User:Christoph Jauera (WMDE)|Christoph Jauera (WMDE)]] ([[User talk:Christoph Jauera (WMDE)|talk]]) 10:48, 24 April 2026 (UTC) **# [[User:GLavagetto (WMF)|GLavagetto (WMF)]] ([[User talk:GLavagetto (WMF)|talk]]) 13:50, 24 April 2026 (UTC) **# [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:53, 24 April 2026 (UTC) **# [[User:CGoubert-WMF|CGoubert-WMF]] ([[User talk:CGoubert-WMF|talk]]) 14:42, 24 April 2026 (UTC) **# '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:51, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:Mike Peel|Mike Peel]] ([[User talk:Mike Peel|talk]]) 20:45, 24 April 2026 (UTC) **# [[User:MAzevedo (WMF)|MAzevedo (WMF)]] ([[User talk:MAzevedo (WMF)|talk]]) 21:11, 24 April 2026 (UTC) **# [[User:KSoučková-WMF|KSoučková-WMF]] ([[User talk:KSoučková-WMF|talk]]) 21:24, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:18, 25 April 2026 (UTC) **# [[User:Shreya.Bhopal|Shreya.Bhopal]] ([[User talk:Shreya.Bhopal|talk]]) 07:52, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:29, 25 April 2026 (UTC) **# [[User:AChou-WMF|AChou-WMF]] ([[User talk:AChou-WMF|talk]]) 10:03, 25 April 2026 (UTC) **# [[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 17:20, 25 April 2026 (UTC) **# --[[User:Sannita (WMF)|Sannita (WMF)]] ([[User talk:Sannita (WMF)|talk]]) 18:02, 25 April 2026 (UTC) **# --[[User:Auregann|Auregann]] 18:02, 25 April 2026 (UTC) **# [[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:50, 26 April 2026 (UTC) **#[[User:Misaochan|Misaochan]] ([[User talk:Misaochan|talk]]) 16:11, 2 May 2026 (UTC) (note: user decided to cancel, then re-added herself) **# [[User:Gopavasanth|Gopa Vasanth]] ([[User talk:Gopavasanth|talk]]) 18:05, 26 April 2026 (UTC) **# [[User:Lahari20|Lahari20]] ([[User talk:Lahari20|talk]]) 18:11, 26 April 2026 (UTC) **# [[User:Dactylantha|Dactylantha]] ([[User talk:Dactylantha|talk]]) 21:29, 26 April 2026 (UTC) **# [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) **# [[User:Alchimista|Alchimista]] ([[User talk:Alchimista|talk]]) 07:36, 27 April 2026 (UTC) **# [[User:Chinmayee Mishra|Chinmayee Mishra]] ([[User talk:Chinmayee Mishra|talk]]) 12:17, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) asking nicely =) **#:'''From this point onward, participants are placed on the waiting list. Attendance will be confirmed only if spots become available.''' **# [[User:Lucas Werkmeister (WMDE)|Lucas Werkmeister (WMDE)]] ([[User talk:Lucas Werkmeister (WMDE)|talk]]) 14:09, 28 April 2026 (UTC) **# [[User:Lucas.Belo|Lucas.Belo]] ([[User talk:Lucas.Belo|talk]]) 21:34, 28 April 2026 (UTC) **# [[User:Seanleong8|Seanleong8]] ([[User talk:Seanleong8|talk]]) 10:34, 29 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:23, 29 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 13:39, 29 April 2026 (UTC) Thought I added myself here too :/ **# --[[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 14:45, 29 April 2026 (UTC) **# <span style="color:#d30000">☠</span>[[User:MarkAHershberger|MarkAHershberger]]<span style="color:#d30000">☢</span>([[User_talk:MarkAHershberger|talk]])<span style="color:#d30000">☣</span> 17:41, 29 April 2026 (UTC) **# <span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:40, 1 May 2026 (UTC) **# [[User:Nacaru|Nacaru]] ([[User talk:Nacaru|talk]]) 13:37, 1 May 2026 (UTC) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# User: Adenisse-WMF **# [[User:Jenny8lee|Jenny8lee]] ([[User talk:Jenny8lee|talk]]) 13:04, 2 May 2026 (UTC) **# [[User:Punith.nyk|Punith.nyk]] ([[User talk:Punith.nyk|talk]]) 11:29, 2 May 2026 (UTC) **#--[[User:Johannnes89|Johannnes89]] ([[User talk:Johannnes89|talk]]) 14:04, 2 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:09, 2 May 2026 (UTC) *What: [https://oooh.events/evento/holy-swing-night-02052026-biglietti/ Swing Dance] **Meeting point: [https://www.google.com/maps?cid=5018841184155524841 Spirit de Milan], Via Bovisasca, 59, 20157 Milano MI **Meeting time: Bicycle over from hotel at 21:30; live band starts at 22:30 **Duration: 3hr **Itinerary: Let's check out Milan's local [[w:swing dance|swing dance]]! The band "Lu Cicchitelli & The Associates" will be playing jazz music of the American [[w:big band|big band]]s of the 1930s/1940s at Spirit de Milan's "Holy Swing Night". There does not appear to be any newcomer lesson, so either prior social dance experience or an adventerous spirit is recommended. €15. **Register your interest, using your signature (4 tildes): **#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:38, 1 May 2026 (UTC) *What: '''Wikimedia Untappd Meetup''' ** Description: We share beers and stories. Some brought beer from their country, others bought beers here. Siebrand took care there's enough for those that didn't bring beer. Having a profile on Untappd is necessary, of course. If you don't bring beer, a contribution is expected. ** Meeting point: Floor 1 - lunch/dinner area. We will move to Siebrand's room as we're not allowed to consume non-hotel bought beverages in the public space in the hotel. ** Meeting time: 20:30. Contact siebrand at Telegram if you missed us. ** Duration: many hours hour, no mandatory attendance for the whole session ;) ** Max 12-15 people: **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:30, 1 May 2026 (UTC) **# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:39, 1 May 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:43, 1 May 2026 (UTC) **# 🍻 '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:45, 1 May 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 06:26, 2 May 2026 (UTC) **#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:09, 2 May 2026 (UTC) (will join after tram tour) **# [[User:the wub|the wub]] [[User_talk:The wub|<span style="color: #080;">"?!"</span>]] 07:20, 2 May 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) (will join after tram tour) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# [[User:Mohammed Abdulai (WMDE)|Mohammed Abdulai (WMDE)]] ([[User talk:Mohammed Abdulai (WMDE)|talk]]) 13:34, 2 May 2026 (UTC) **# [[User:Aude|Aude]] ([[User talk:Aude|talk]]) 15:05, 2 May 2026 (UTC) **# [[User:Ejegg|Ejegg]] ([[User talk:Ejegg|talk]]) 17:37, 2 May 2026 (UTC) **# [[User:Jon Harald Søby|Jon Harald Søby]] ([[User talk:Jon Harald Søby|talk]]) 15:56, 2 May 2026 (UTC) **# maybe [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) === Sunday 03 May 2026 === ''Hacking'' ''and closing ceremony!'' <u>Visit to downtown Milan</u>: Following the closing ceremony, shuttle buses will be provided so participants can visit downtown Milan. Shuttles will depart the venue at 17:30 and drop off participants [[:en:Piazza_del_Duomo,_Milan|near the Duomo]] (at [https://www.openstreetmap.org/node/9243018607 Piazza Fontana]), then return to the venue at 22:00. Participants are free to self-organize their visit in downtown Milan. What: '''Wikimedians Love Craft Beer@SNOB''' * Description: We share beers and stories at [https://snob-beer.it/ SNOB]. Once we are dropped off in the city, we will proceed to travel to the bar. They have 20 beers for 500/1000ml growlers and a few hundred different beers from all over. * Meeting point: With Siebrand and Sjoerd once the buses have brought us to the city center on Sunday. * Duration: SNOB closes at 22:00. * Max 15 people: *# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:38, 1 May 2026 (UTC) *# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:41, 1 May 2026 (UTC) *# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:42, 1 May 2026 (UTC) *# '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:46, 1 May 2026 (UTC) *#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:06, 2 May 2026 (UTC) *#[[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) *# ... What: '''Wikimedians visit Milan's Chinatown ([[:en:Chinatown, Milan|Quartiere Cinese]])''' <gallery mode="packed"> File:Milano, Chinatown 02.jpg File:Dopoguerra 1945 a Milano - Quartiere cinese.jpg File:Milano - Quartiere cinese nel 1945.jpg File:Milano - Quartiere cinese 1945.jpg </gallery> * Description: There are Chinatowns all over the world, and the [[:en:Chinatown, Milan | one in Milan]] is the largest in Italy, having been started in the 1920s from immigrants in Zhejiang province. Population in the tens of thousands! * Meeting point: With [[User:Runawaymo |Runawaymo]] and [[User:Jenny8lee |Jenny8lee]] once the buses drop us off. We will head to [[:en:Via Paolo Sarpi |Via Paolo Sarpi]] (about 20 minutes on public transit) Among the places there with good food are: ** [https://www.instagram.com/laravioleriasarpi/ Ravioleria Sarpi], the absolute institution with handmade "ravioli tradizionali cinesi" (dumplings) made with organic dough and jianbing. ** [https://www.instagram.com/ristorante_di_houjie/ Houjie], cuisine from [[:en:Rui'an|Rui’an]], Wenzhou at budget friendly prices. * Duration: Until we run out of things to eat. * Max 12 people: *# [[User:Runawaymo |Runawaymo]] *# [[User:Jenny8lee |Jenny8lee]] *# Seanleong8 *# $[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:43, 2 May 2026 (UTC) *# [[User:DLynch (WMF)|DLynch (WMF)]] ([[User talk:DLynch (WMF)|talk]]) *# [[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 04:09, 3 May 2026 (UTC) *# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 10:01, 3 May 2026 (UTC) What: '''Modern art museums by bicycle''' *Meeting point: Hotel lobby *Meeting time: 16:00 *Duration: 16:00-19:30 *Itinerary: Let's bicycle around downtown and visit some modern art museums! Leaving via bikeshare right after the closing showcase. Planning to visit the {{w|Triennale di Milano}} and then the {{w|Museo del Novecento}}. *Register your interest, using your signature (4 tildes): *#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 13:01, 3 May 2026 (UTC) === Monday 04 May 2026 === ''Participants head home'' == Code of Conduct == The Wikimedia Hackathon will enforce the [[foundation:Policy:Universal_Code_of_Conduct|Universal Code of Conduct]], [[Code of Conduct]] for Wikimedia’s Technical Spaces, and the [[foundation:Policy:Friendly_space_policy|Friendly Space Policy]] across all facets of the event. This includes various platforms, discussion channels, and local meetups. Your adherence to these guidelines ensures a respectful and inclusive environment for all participants. '''We recommend all participants review these Trust & Safety policies prior to your arrival at the venue.''' Individuals not cooperating with these policies may be asked to leave the event. A dedicated team will be available on-site to help support a safer environment for all. If you have any questions or suggestions, feel free to use the [[Talk:Wikimedia Hackathon 2026|talk page]] or to reach out to hackathon@wikimedia.org. [[Category:Wikimedia Hackathon 2026]] m1dx4auzh2c29bgsjqrkcwn30u20s1i 8364346 8364342 2026-05-03T13:08:19Z Mroik 18336002 8364346 wikitext text/x-wiki __NOTALK__ <languages/> {{:Wikimedia Hackathon 2026/Header|page=2}} <div style="background: #F6F6F6; border-radius:10px; border:1px solid #A4A4A4; margin:5px 15px;"><div style="margin: 1em; color:#555;"><div style="font-size: 130%; font-family: Tahoma, sans-serif; text-align:left; line-height: 1.5;"> The Hackathon is participant-driven and gets its life from the active participation of its attendees. Below you will find some information on [[#How_to_contribute|how to contribute]] to the program as an attendee. Local communities are also welcome to organize pre-hackathon events, watch-parties or meetups in their region. More information about organization and funding is available on the [[Wikimedia_Hackathon_2026/Satellite_Events|satellite events]] page. </div>{{TOC|limit=3}}</div></div> {{Info|'''This year's hackathon will use the unconference format, with session lengths between 30 minutes and 60 minutes available.''' Add your proposed session to the "Proposed Unconference Sessions" [https://phabricator.wikimedia.org/project/view/8319/ column on the Hackathon 2026 workboard] with the <code>#Wikimedia-Hackathon-2026</code> tag. Then add your session title and name to the schedule! Please ensure you link to your Phabricator task so interested participants can see the full details. Be sure to follow the format listed in the [[#How to contribute]] section of this page. If you're interested in a particular session, please be sure to demonstrate your interest by subscribing to the task in Phabricator! }} {{:Wikimedia_Hackathon_2026/Program/Schedule}} == Room descriptions and capacity == Our main hacking spaces will be on the Floor 2 of the Voco Fiere Hotel Milan; the breakout rooms, quiet room, and the second hacking space (available Friday and Saturday afternoons) will be on Floor 1. '''Floor 2:''' * Main Space - general hacking and where the opening ceremony and closing showcase will happen ** Open from Friday: 09:00–02:00; Saturday: 07:00–02:00; Sunday: 07:00–17:00 * Foyer off Main Space - breaks, snacks and socializing '''Lobby level:''' * Event registration (on Thursday from 12:00–19:00; on Friday from 08:00–09:30) * Space for attendees to socialize and play games '''Floor 1:''' * Space 4 - Unconference sessions and hacking space ** Friday *** 10:45–13:00: Unconference sessions *** 13:00–23:00: Hacking ** Saturday *** 07:00–12:15: Unconference sessions *** 12:15–23:00: Hacking ** Sunday *** 07:00–14:00: Unconference sessions * Space 5 - Unconference sessions and games ** Friday *** 10:45–17:00: Unconference sessions *** 18:30–23:00: Tombola Night ** Saturday *** 07:00–17:00: Unconference sessions ** Sunday *** 07:00–14:00: Unconference sessions * Space 6 - Quiet space * Ristorante Betulla - Where lunch and dinner will be provided '''Room availability:''' * Our hacking rooms - The Main Space will be open until 14:00 on Friday and Saturday night; Space 4 will be open until 23:00. * Space 5 and Space 6 will be closed overnight starting at 18:00. * On Sunday, all rooms close at 17:00 == How to contribute == You can use the Phabricator templates [[phab:T415213|here]] to propose a project or sign up as a participant looking for a project '''Propose a session, workshop, or project''' * '''Proposed Projects -''' Hands-on skill development workshops on topics around the technology stack of Wikimedia projects. * '''Proposed Unconference Sessions -''' Sessions or workshops covering any of the [[:File:Wm technical areas.svg|Wikimedia technical areas]]. For any of the items listed above, use the [https://w.wiki/Kew5 proposal template]. Also, indicate in the task description if your proposed activity is newcomer-friendly. '''Get the word out''' * Add your name and interests - including things you can teach and things you want to learn about - to our participants page. * Email the organizers with any questions, we can help! '''Sign up as a participant''' If you want to work on something but you're not sure what, use the [https://w.wiki/KewC participant template] to let others know that you are looking for a project. If you're interested in a specific unconference session, you can indicate your interest by subscribing to the task. You can also add yourself to the ''Volunteer sign-ups'' column if you would like to help with small tasks involved with running the Hackathon. == How to conduct your session and/or workshop == Here are some tips: * We have a [https://docs.google.com/presentation/d/1019ZQltl-M5tsQ6tJz8UaWnTDG9-9MmF044-4IUQqHA/edit?usp=sharing Hackathon themed slide deck] with best practices and more; please make a copy and add the information for your session. * You can propose sessions as presentations, workshops, discussions, or any other format that suits your requirements. ** Feel free to host language- or community-specific sessions and/or meetups. * Session focus should be less on beginner-level workshops (unlike in some previous Hackathons), as this event brings together individuals who have already contributed to technical aspects of the Wikimedia projects. * If there isn't a dedicated space for your session, be prepared to run your session without a projector at a specific hackathon table in a quiet corner of one of the bigger rooms, in the foyer, or outside. * You are welcome to reach out to the event organizers to seek help to prepare, get feedback on your presentation, or any training support you might need a few weeks before the hackathon event. == Social gatherings and side events in Milan == === Format to use for your event === * What: * Meeting point: * Meeting time: * Duration: * Itinerary: * Register your interest, using your signature (4 tildes): === Thursday 30 April 2026 === ''Hackathon participants arrive'' === Friday 01 May 2026 === ''Hackathon kicks off!'' * What: Board games ** Meeting point: Space 5 ** Meeting time: 17:00 ** Duration: 17:00–20:30 ** '''max 6 people:''' Register your interest, using your signature (4 tildes): **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:45, 21 April 2026 (UTC) * What: Tombola night with cute prizes ** Meeting point: Space 5 ** Meeting time: 21:00 ** Duration: 21:00–23:00 ** '''3 rounds, max 48 people each:''' Register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:40, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:12, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:53, 20 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:42, 21 April 2026 (UTC) **#[[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:57, 23 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 01:35, 24 April 2026 (UTC) **# [[User:DaxServer|DaxServer]] ([[User talk:DaxServer|talk]]) 08:26, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:04, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:HCoplin-WMF|HCoplin-WMF]] ([[User talk:HCoplin-WMF|talk]]) 15:36, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:19, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:28, 25 April 2026 (UTC) **#[[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:49, 26 April 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 13:29, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 17:15, 28 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:22, 29 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 08:05, 1 May 2026 (UTC) **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 17:19, 1 May 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 18:06, 1 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:10, 2 May 2026 (UTC) === Saturday 02 May 2026 === ''Hacking!'' * What: Learning and Creating LGBTQIA+ Knowledge and History in Milan (moved from 1 May 2026 due to [https://it.wikipedia.org/wiki/Festa_dei_lavoratori Labour Day]) ** Meeting point: voco Milan-Fiere Hotel lobby ** Meeting time: 15:00 ** Duration: ~3-4 hours (flexible, you can message us if you want to meet us earlier or later) ** Itinerary (flexible and subject to change, please feel free to add locations you'd like or recommend below): *** [https://www.libreriantigone.com/ Antigone - Libreria lgbtqia+], open 15:00–19:30 *** [https://www.instagram.com/leccomilano/ Leccomilano], open 17:00–02:00 ** Register your interest, using your signature (4 tildes): **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:24, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **#[[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) **#[[User:Suzanne Wood (WMDE)|Suzanne Wood (WMDE)]] ([[User talk:Suzanne Wood (WMDE)|talk]]) 21:51, 1 May 2026 (UTC) **#Adenisse (WMF) * What: [https://meta.wikimedia.org/wiki/Event:Hardware_tools_for_Wiki/Raspberry_JAM_at_Wikimedia_Hackathon_Milan_2026 Raspberry JAM] ** Meeting point: Space 5 ** Meeting time: 17:30 ** Duration:1 hour ** Itinerary: Register your interest, using your signature (4 tildes): # '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:58, 24 April 2026 (UTC) # [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but discovered too late) * What: Train Spotting near the Hotel ** Description: There is a railway line near the Hotel and many trains pass through there. Lets have some conversations tech related or related to trains or public transport outside while watching the railway line. ** Meeting point: Entrance of the Hotel, later you can find us at the fence next to the railway line ** Duration: 1 hour, you can join later and leave earlier ** Itinerary: Register your interest, using your signature (4 tildes): # --[[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 17:54, 1 May 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but unable to attend) * What: Historical Tram Experience ** Meeting point: Hotel lobby ** Meeting time: 19:45 (leaving at 20:15) ** Duration: 3.33 hours ** Itinerary: Arco della Pace, Monumentale Cemetry, Piazza Fontana, Piazza della Repubblica, Scala, Navigli , Darsena, Brera, Milano Arena, On tram karaoke ** '''Max 59 people''', register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:42, 10 April 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 21:58, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:11, 11 April 2026 (UTC) **# [[User:GChoi-WMF|GChoi-WMF]] ([[User talk:GChoi-WMF|talk]]) 20:54, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:42, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 08:51, 15 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 14:58, 15 April 2026 (UTC) **# [[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 15:28, 15 April 2026 (UTC) **# [[User:Lupamo Arnold|Lupamo]] ([[User talk:Lupamo Arnold|talk]]) 18:23, 17 April 2026 (UTC) **# [[User:MSzwarc-WMF|MSzwarc-WMF]] ([[User talk:MSzwarc-WMF|talk]]) 17:44, 18 April 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 08:36, 19 April 2026 (UTC) **# [[User:VriaA|VriaA]] ([[User talk:VriaA|talk]]) 04:22, 20 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 10:46, 20 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:50, 20 April 2026 (UTC) **# [[User:ErikaGuetti|ErikaGuetti]] **# [[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:58, 23 April 2026 (UTC) **# [[User:DTorsani-WMF|DTorsani-WMF]] ([[User talk:DTorsani-WMF|talk]]) 00:08, 24 April 2026 (UTC) **# [[User:SSingh (WMF)|SSingh (WMF)]] ([[User talk:SSingh (WMF)|talk]]) 00:48, 24 April 2026 (UTC) **# [[User:Danielyepezgarces|dyepezg]] ([[User talk:Danielyepezgarces|talk]]) 03:09, 24 April 2026 (UTC) **# [[User:SD0001|SD0001]] ([[User talk:SD0001|talk]]) 04:10, 24 April 2026 (UTC) **# [[User:Kaspo|Kaspo]] ([[User talk:Kaspo|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Manimaran96|Manimaran96]] ([[User talk:Manimaran96|talk]]) 07:54, 24 April 2026 (UTC) **# [[User:Silvan Heintze (WMDE)|Silvan Heintze (WMDE)]] ([[User talk:Silvan Heintze (WMDE)|talk]]) 08:00, 24 April 2026 (UTC) **# [[User:T Arrow|T Arrow]] ([[User talk:T Arrow|talk]]) 08:04, 24 April 2026 (UTC) **# [[User:Ollie Shotton (WMDE)|Ollie Shotton (WMDE)]] ([[User talk:Ollie Shotton (WMDE)|talk]]) (Ollie Hyde) **# [[User:Martyn Ranyard (WMDE)|Martyn Ranyard (WMDE)]] ([[User talk:Martyn Ranyard (WMDE)|talk]]) 08:09, 24 April 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 08:15, 24 April 2026 (UTC) **# [[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) (Neslihan Turan) **# [[User:Filippo Giunchedi|Filippo Giunchedi]] ([[User talk:Filippo Giunchedi|talk]]) 08:49, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:05, 24 April 2026 (UTC) **# [[User:FNegri-WMF|FNegri-WMF]] ([[User talk:FNegri-WMF|talk]]) 09:07, 24 April 2026 (UTC) **# [[User:Christoph Jauera (WMDE)|Christoph Jauera (WMDE)]] ([[User talk:Christoph Jauera (WMDE)|talk]]) 10:48, 24 April 2026 (UTC) **# [[User:GLavagetto (WMF)|GLavagetto (WMF)]] ([[User talk:GLavagetto (WMF)|talk]]) 13:50, 24 April 2026 (UTC) **# [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:53, 24 April 2026 (UTC) **# [[User:CGoubert-WMF|CGoubert-WMF]] ([[User talk:CGoubert-WMF|talk]]) 14:42, 24 April 2026 (UTC) **# '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:51, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:Mike Peel|Mike Peel]] ([[User talk:Mike Peel|talk]]) 20:45, 24 April 2026 (UTC) **# [[User:MAzevedo (WMF)|MAzevedo (WMF)]] ([[User talk:MAzevedo (WMF)|talk]]) 21:11, 24 April 2026 (UTC) **# [[User:KSoučková-WMF|KSoučková-WMF]] ([[User talk:KSoučková-WMF|talk]]) 21:24, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:18, 25 April 2026 (UTC) **# [[User:Shreya.Bhopal|Shreya.Bhopal]] ([[User talk:Shreya.Bhopal|talk]]) 07:52, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:29, 25 April 2026 (UTC) **# [[User:AChou-WMF|AChou-WMF]] ([[User talk:AChou-WMF|talk]]) 10:03, 25 April 2026 (UTC) **# [[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 17:20, 25 April 2026 (UTC) **# --[[User:Sannita (WMF)|Sannita (WMF)]] ([[User talk:Sannita (WMF)|talk]]) 18:02, 25 April 2026 (UTC) **# --[[User:Auregann|Auregann]] 18:02, 25 April 2026 (UTC) **# [[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:50, 26 April 2026 (UTC) **#[[User:Misaochan|Misaochan]] ([[User talk:Misaochan|talk]]) 16:11, 2 May 2026 (UTC) (note: user decided to cancel, then re-added herself) **# [[User:Gopavasanth|Gopa Vasanth]] ([[User talk:Gopavasanth|talk]]) 18:05, 26 April 2026 (UTC) **# [[User:Lahari20|Lahari20]] ([[User talk:Lahari20|talk]]) 18:11, 26 April 2026 (UTC) **# [[User:Dactylantha|Dactylantha]] ([[User talk:Dactylantha|talk]]) 21:29, 26 April 2026 (UTC) **# [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) **# [[User:Alchimista|Alchimista]] ([[User talk:Alchimista|talk]]) 07:36, 27 April 2026 (UTC) **# [[User:Chinmayee Mishra|Chinmayee Mishra]] ([[User talk:Chinmayee Mishra|talk]]) 12:17, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) asking nicely =) **#:'''From this point onward, participants are placed on the waiting list. Attendance will be confirmed only if spots become available.''' **# [[User:Lucas Werkmeister (WMDE)|Lucas Werkmeister (WMDE)]] ([[User talk:Lucas Werkmeister (WMDE)|talk]]) 14:09, 28 April 2026 (UTC) **# [[User:Lucas.Belo|Lucas.Belo]] ([[User talk:Lucas.Belo|talk]]) 21:34, 28 April 2026 (UTC) **# [[User:Seanleong8|Seanleong8]] ([[User talk:Seanleong8|talk]]) 10:34, 29 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:23, 29 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 13:39, 29 April 2026 (UTC) Thought I added myself here too :/ **# --[[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 14:45, 29 April 2026 (UTC) **# <span style="color:#d30000">☠</span>[[User:MarkAHershberger|MarkAHershberger]]<span style="color:#d30000">☢</span>([[User_talk:MarkAHershberger|talk]])<span style="color:#d30000">☣</span> 17:41, 29 April 2026 (UTC) **# <span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:40, 1 May 2026 (UTC) **# [[User:Nacaru|Nacaru]] ([[User talk:Nacaru|talk]]) 13:37, 1 May 2026 (UTC) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# User: Adenisse-WMF **# [[User:Jenny8lee|Jenny8lee]] ([[User talk:Jenny8lee|talk]]) 13:04, 2 May 2026 (UTC) **# [[User:Punith.nyk|Punith.nyk]] ([[User talk:Punith.nyk|talk]]) 11:29, 2 May 2026 (UTC) **#--[[User:Johannnes89|Johannnes89]] ([[User talk:Johannnes89|talk]]) 14:04, 2 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:09, 2 May 2026 (UTC) *What: [https://oooh.events/evento/holy-swing-night-02052026-biglietti/ Swing Dance] **Meeting point: [https://www.google.com/maps?cid=5018841184155524841 Spirit de Milan], Via Bovisasca, 59, 20157 Milano MI **Meeting time: Bicycle over from hotel at 21:30; live band starts at 22:30 **Duration: 3hr **Itinerary: Let's check out Milan's local [[w:swing dance|swing dance]]! The band "Lu Cicchitelli & The Associates" will be playing jazz music of the American [[w:big band|big band]]s of the 1930s/1940s at Spirit de Milan's "Holy Swing Night". There does not appear to be any newcomer lesson, so either prior social dance experience or an adventerous spirit is recommended. €15. **Register your interest, using your signature (4 tildes): **#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:38, 1 May 2026 (UTC) *What: '''Wikimedia Untappd Meetup''' ** Description: We share beers and stories. Some brought beer from their country, others bought beers here. Siebrand took care there's enough for those that didn't bring beer. Having a profile on Untappd is necessary, of course. If you don't bring beer, a contribution is expected. ** Meeting point: Floor 1 - lunch/dinner area. We will move to Siebrand's room as we're not allowed to consume non-hotel bought beverages in the public space in the hotel. ** Meeting time: 20:30. Contact siebrand at Telegram if you missed us. ** Duration: many hours hour, no mandatory attendance for the whole session ;) ** Max 12-15 people: **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:30, 1 May 2026 (UTC) **# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:39, 1 May 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:43, 1 May 2026 (UTC) **# 🍻 '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:45, 1 May 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 06:26, 2 May 2026 (UTC) **#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:09, 2 May 2026 (UTC) (will join after tram tour) **# [[User:the wub|the wub]] [[User_talk:The wub|<span style="color: #080;">"?!"</span>]] 07:20, 2 May 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) (will join after tram tour) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# [[User:Mohammed Abdulai (WMDE)|Mohammed Abdulai (WMDE)]] ([[User talk:Mohammed Abdulai (WMDE)|talk]]) 13:34, 2 May 2026 (UTC) **# [[User:Aude|Aude]] ([[User talk:Aude|talk]]) 15:05, 2 May 2026 (UTC) **# [[User:Ejegg|Ejegg]] ([[User talk:Ejegg|talk]]) 17:37, 2 May 2026 (UTC) **# [[User:Jon Harald Søby|Jon Harald Søby]] ([[User talk:Jon Harald Søby|talk]]) 15:56, 2 May 2026 (UTC) **# maybe [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) === Sunday 03 May 2026 === ''Hacking'' ''and closing ceremony!'' <u>Visit to downtown Milan</u>: Following the closing ceremony, shuttle buses will be provided so participants can visit downtown Milan. Shuttles will depart the venue at 17:30 and drop off participants [[:en:Piazza_del_Duomo,_Milan|near the Duomo]] (at [https://www.openstreetmap.org/node/9243018607 Piazza Fontana]), then return to the venue at 22:00. Participants are free to self-organize their visit in downtown Milan. What: '''Wikimedians Love Craft Beer@SNOB''' * Description: We share beers and stories at [https://snob-beer.it/ SNOB]. Once we are dropped off in the city, we will proceed to travel to the bar. They have 20 beers for 500/1000ml growlers and a few hundred different beers from all over. * Meeting point: With Siebrand and Sjoerd once the buses have brought us to the city center on Sunday. * Duration: SNOB closes at 22:00. * Max 15 people: *# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:38, 1 May 2026 (UTC) *# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:41, 1 May 2026 (UTC) *# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:42, 1 May 2026 (UTC) *# '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:46, 1 May 2026 (UTC) *#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:06, 2 May 2026 (UTC) *#[[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) *# ... What: '''Wikimedians visit Milan's Chinatown ([[:en:Chinatown, Milan|Quartiere Cinese]])''' <gallery mode="packed"> File:Milano, Chinatown 02.jpg File:Dopoguerra 1945 a Milano - Quartiere cinese.jpg File:Milano - Quartiere cinese nel 1945.jpg File:Milano - Quartiere cinese 1945.jpg </gallery> * Description: There are Chinatowns all over the world, and the [[:en:Chinatown, Milan | one in Milan]] is the largest in Italy, having been started in the 1920s from immigrants in Zhejiang province. Population in the tens of thousands! * Meeting point: With [[User:Runawaymo |Runawaymo]] and [[User:Jenny8lee |Jenny8lee]] once the buses drop us off. We will head to [[:en:Via Paolo Sarpi |Via Paolo Sarpi]] (about 20 minutes on public transit) Among the places there with good food are: ** [https://www.instagram.com/laravioleriasarpi/ Ravioleria Sarpi], the absolute institution with handmade "ravioli tradizionali cinesi" (dumplings) made with organic dough and jianbing. ** [https://www.instagram.com/ristorante_di_houjie/ Houjie], cuisine from [[:en:Rui'an|Rui’an]], Wenzhou at budget friendly prices. * Duration: Until we run out of things to eat. * Max 12 people: *# [[User:Runawaymo |Runawaymo]] *# [[User:Jenny8lee |Jenny8lee]] *# Seanleong8 *# $[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:43, 2 May 2026 (UTC) *# [[User:DLynch (WMF)|DLynch (WMF)]] ([[User talk:DLynch (WMF)|talk]]) *# [[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 04:09, 3 May 2026 (UTC) *# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 10:01, 3 May 2026 (UTC) *# [[User:Mroik|Mroik]] 13:06, 3 May 2026 (UTC) What: '''Modern art museums by bicycle''' *Meeting point: Hotel lobby *Meeting time: 16:00 *Duration: 16:00-19:30 *Itinerary: Let's bicycle around downtown and visit some modern art museums! Leaving via bikeshare right after the closing showcase. Planning to visit the {{w|Triennale di Milano}} and then the {{w|Museo del Novecento}}. *Register your interest, using your signature (4 tildes): *#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 13:01, 3 May 2026 (UTC) === Monday 04 May 2026 === ''Participants head home'' == Code of Conduct == The Wikimedia Hackathon will enforce the [[foundation:Policy:Universal_Code_of_Conduct|Universal Code of Conduct]], [[Code of Conduct]] for Wikimedia’s Technical Spaces, and the [[foundation:Policy:Friendly_space_policy|Friendly Space Policy]] across all facets of the event. This includes various platforms, discussion channels, and local meetups. Your adherence to these guidelines ensures a respectful and inclusive environment for all participants. '''We recommend all participants review these Trust & Safety policies prior to your arrival at the venue.''' Individuals not cooperating with these policies may be asked to leave the event. A dedicated team will be available on-site to help support a safer environment for all. If you have any questions or suggestions, feel free to use the [[Talk:Wikimedia Hackathon 2026|talk page]] or to reach out to hackathon@wikimedia.org. [[Category:Wikimedia Hackathon 2026]] 2xl4bi6nzfpou3b4j37cfnadcbxp54f 8364378 8364346 2026-05-03T13:38:09Z Mroik 18336002 Undid revision [[Special:Diff/8364346|8364346]] by [[Special:Contributions/Mroik|Mroik]] ([[User talk:Mroik|talk]]) 8364378 wikitext text/x-wiki __NOTALK__ <languages/> {{:Wikimedia Hackathon 2026/Header|page=2}} <div style="background: #F6F6F6; border-radius:10px; border:1px solid #A4A4A4; margin:5px 15px;"><div style="margin: 1em; color:#555;"><div style="font-size: 130%; font-family: Tahoma, sans-serif; text-align:left; line-height: 1.5;"> The Hackathon is participant-driven and gets its life from the active participation of its attendees. Below you will find some information on [[#How_to_contribute|how to contribute]] to the program as an attendee. Local communities are also welcome to organize pre-hackathon events, watch-parties or meetups in their region. More information about organization and funding is available on the [[Wikimedia_Hackathon_2026/Satellite_Events|satellite events]] page. </div>{{TOC|limit=3}}</div></div> {{Info|'''This year's hackathon will use the unconference format, with session lengths between 30 minutes and 60 minutes available.''' Add your proposed session to the "Proposed Unconference Sessions" [https://phabricator.wikimedia.org/project/view/8319/ column on the Hackathon 2026 workboard] with the <code>#Wikimedia-Hackathon-2026</code> tag. Then add your session title and name to the schedule! Please ensure you link to your Phabricator task so interested participants can see the full details. Be sure to follow the format listed in the [[#How to contribute]] section of this page. If you're interested in a particular session, please be sure to demonstrate your interest by subscribing to the task in Phabricator! }} {{:Wikimedia_Hackathon_2026/Program/Schedule}} == Room descriptions and capacity == Our main hacking spaces will be on the Floor 2 of the Voco Fiere Hotel Milan; the breakout rooms, quiet room, and the second hacking space (available Friday and Saturday afternoons) will be on Floor 1. '''Floor 2:''' * Main Space - general hacking and where the opening ceremony and closing showcase will happen ** Open from Friday: 09:00–02:00; Saturday: 07:00–02:00; Sunday: 07:00–17:00 * Foyer off Main Space - breaks, snacks and socializing '''Lobby level:''' * Event registration (on Thursday from 12:00–19:00; on Friday from 08:00–09:30) * Space for attendees to socialize and play games '''Floor 1:''' * Space 4 - Unconference sessions and hacking space ** Friday *** 10:45–13:00: Unconference sessions *** 13:00–23:00: Hacking ** Saturday *** 07:00–12:15: Unconference sessions *** 12:15–23:00: Hacking ** Sunday *** 07:00–14:00: Unconference sessions * Space 5 - Unconference sessions and games ** Friday *** 10:45–17:00: Unconference sessions *** 18:30–23:00: Tombola Night ** Saturday *** 07:00–17:00: Unconference sessions ** Sunday *** 07:00–14:00: Unconference sessions * Space 6 - Quiet space * Ristorante Betulla - Where lunch and dinner will be provided '''Room availability:''' * Our hacking rooms - The Main Space will be open until 14:00 on Friday and Saturday night; Space 4 will be open until 23:00. * Space 5 and Space 6 will be closed overnight starting at 18:00. * On Sunday, all rooms close at 17:00 == How to contribute == You can use the Phabricator templates [[phab:T415213|here]] to propose a project or sign up as a participant looking for a project '''Propose a session, workshop, or project''' * '''Proposed Projects -''' Hands-on skill development workshops on topics around the technology stack of Wikimedia projects. * '''Proposed Unconference Sessions -''' Sessions or workshops covering any of the [[:File:Wm technical areas.svg|Wikimedia technical areas]]. For any of the items listed above, use the [https://w.wiki/Kew5 proposal template]. Also, indicate in the task description if your proposed activity is newcomer-friendly. '''Get the word out''' * Add your name and interests - including things you can teach and things you want to learn about - to our participants page. * Email the organizers with any questions, we can help! '''Sign up as a participant''' If you want to work on something but you're not sure what, use the [https://w.wiki/KewC participant template] to let others know that you are looking for a project. If you're interested in a specific unconference session, you can indicate your interest by subscribing to the task. You can also add yourself to the ''Volunteer sign-ups'' column if you would like to help with small tasks involved with running the Hackathon. == How to conduct your session and/or workshop == Here are some tips: * We have a [https://docs.google.com/presentation/d/1019ZQltl-M5tsQ6tJz8UaWnTDG9-9MmF044-4IUQqHA/edit?usp=sharing Hackathon themed slide deck] with best practices and more; please make a copy and add the information for your session. * You can propose sessions as presentations, workshops, discussions, or any other format that suits your requirements. ** Feel free to host language- or community-specific sessions and/or meetups. * Session focus should be less on beginner-level workshops (unlike in some previous Hackathons), as this event brings together individuals who have already contributed to technical aspects of the Wikimedia projects. * If there isn't a dedicated space for your session, be prepared to run your session without a projector at a specific hackathon table in a quiet corner of one of the bigger rooms, in the foyer, or outside. * You are welcome to reach out to the event organizers to seek help to prepare, get feedback on your presentation, or any training support you might need a few weeks before the hackathon event. == Social gatherings and side events in Milan == === Format to use for your event === * What: * Meeting point: * Meeting time: * Duration: * Itinerary: * Register your interest, using your signature (4 tildes): === Thursday 30 April 2026 === ''Hackathon participants arrive'' === Friday 01 May 2026 === ''Hackathon kicks off!'' * What: Board games ** Meeting point: Space 5 ** Meeting time: 17:00 ** Duration: 17:00–20:30 ** '''max 6 people:''' Register your interest, using your signature (4 tildes): **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:45, 21 April 2026 (UTC) * What: Tombola night with cute prizes ** Meeting point: Space 5 ** Meeting time: 21:00 ** Duration: 21:00–23:00 ** '''3 rounds, max 48 people each:''' Register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:40, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:12, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:53, 20 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:42, 21 April 2026 (UTC) **#[[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:57, 23 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 01:35, 24 April 2026 (UTC) **# [[User:DaxServer|DaxServer]] ([[User talk:DaxServer|talk]]) 08:26, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:04, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:HCoplin-WMF|HCoplin-WMF]] ([[User talk:HCoplin-WMF|talk]]) 15:36, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:19, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:28, 25 April 2026 (UTC) **#[[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:49, 26 April 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 13:29, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 17:15, 28 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:22, 29 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 08:05, 1 May 2026 (UTC) **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 17:19, 1 May 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 18:06, 1 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:10, 2 May 2026 (UTC) === Saturday 02 May 2026 === ''Hacking!'' * What: Learning and Creating LGBTQIA+ Knowledge and History in Milan (moved from 1 May 2026 due to [https://it.wikipedia.org/wiki/Festa_dei_lavoratori Labour Day]) ** Meeting point: voco Milan-Fiere Hotel lobby ** Meeting time: 15:00 ** Duration: ~3-4 hours (flexible, you can message us if you want to meet us earlier or later) ** Itinerary (flexible and subject to change, please feel free to add locations you'd like or recommend below): *** [https://www.libreriantigone.com/ Antigone - Libreria lgbtqia+], open 15:00–19:30 *** [https://www.instagram.com/leccomilano/ Leccomilano], open 17:00–02:00 ** Register your interest, using your signature (4 tildes): **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:24, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **#[[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) **#[[User:Suzanne Wood (WMDE)|Suzanne Wood (WMDE)]] ([[User talk:Suzanne Wood (WMDE)|talk]]) 21:51, 1 May 2026 (UTC) **#Adenisse (WMF) * What: [https://meta.wikimedia.org/wiki/Event:Hardware_tools_for_Wiki/Raspberry_JAM_at_Wikimedia_Hackathon_Milan_2026 Raspberry JAM] ** Meeting point: Space 5 ** Meeting time: 17:30 ** Duration:1 hour ** Itinerary: Register your interest, using your signature (4 tildes): # '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:58, 24 April 2026 (UTC) # [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but discovered too late) * What: Train Spotting near the Hotel ** Description: There is a railway line near the Hotel and many trains pass through there. Lets have some conversations tech related or related to trains or public transport outside while watching the railway line. ** Meeting point: Entrance of the Hotel, later you can find us at the fence next to the railway line ** Duration: 1 hour, you can join later and leave earlier ** Itinerary: Register your interest, using your signature (4 tildes): # --[[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 17:54, 1 May 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but unable to attend) * What: Historical Tram Experience ** Meeting point: Hotel lobby ** Meeting time: 19:45 (leaving at 20:15) ** Duration: 3.33 hours ** Itinerary: Arco della Pace, Monumentale Cemetry, Piazza Fontana, Piazza della Repubblica, Scala, Navigli , Darsena, Brera, Milano Arena, On tram karaoke ** '''Max 59 people''', register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:42, 10 April 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 21:58, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:11, 11 April 2026 (UTC) **# [[User:GChoi-WMF|GChoi-WMF]] ([[User talk:GChoi-WMF|talk]]) 20:54, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:42, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 08:51, 15 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 14:58, 15 April 2026 (UTC) **# [[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 15:28, 15 April 2026 (UTC) **# [[User:Lupamo Arnold|Lupamo]] ([[User talk:Lupamo Arnold|talk]]) 18:23, 17 April 2026 (UTC) **# [[User:MSzwarc-WMF|MSzwarc-WMF]] ([[User talk:MSzwarc-WMF|talk]]) 17:44, 18 April 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 08:36, 19 April 2026 (UTC) **# [[User:VriaA|VriaA]] ([[User talk:VriaA|talk]]) 04:22, 20 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 10:46, 20 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:50, 20 April 2026 (UTC) **# [[User:ErikaGuetti|ErikaGuetti]] **# [[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:58, 23 April 2026 (UTC) **# [[User:DTorsani-WMF|DTorsani-WMF]] ([[User talk:DTorsani-WMF|talk]]) 00:08, 24 April 2026 (UTC) **# [[User:SSingh (WMF)|SSingh (WMF)]] ([[User talk:SSingh (WMF)|talk]]) 00:48, 24 April 2026 (UTC) **# [[User:Danielyepezgarces|dyepezg]] ([[User talk:Danielyepezgarces|talk]]) 03:09, 24 April 2026 (UTC) **# [[User:SD0001|SD0001]] ([[User talk:SD0001|talk]]) 04:10, 24 April 2026 (UTC) **# [[User:Kaspo|Kaspo]] ([[User talk:Kaspo|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Manimaran96|Manimaran96]] ([[User talk:Manimaran96|talk]]) 07:54, 24 April 2026 (UTC) **# [[User:Silvan Heintze (WMDE)|Silvan Heintze (WMDE)]] ([[User talk:Silvan Heintze (WMDE)|talk]]) 08:00, 24 April 2026 (UTC) **# [[User:T Arrow|T Arrow]] ([[User talk:T Arrow|talk]]) 08:04, 24 April 2026 (UTC) **# [[User:Ollie Shotton (WMDE)|Ollie Shotton (WMDE)]] ([[User talk:Ollie Shotton (WMDE)|talk]]) (Ollie Hyde) **# [[User:Martyn Ranyard (WMDE)|Martyn Ranyard (WMDE)]] ([[User talk:Martyn Ranyard (WMDE)|talk]]) 08:09, 24 April 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 08:15, 24 April 2026 (UTC) **# [[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) (Neslihan Turan) **# [[User:Filippo Giunchedi|Filippo Giunchedi]] ([[User talk:Filippo Giunchedi|talk]]) 08:49, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:05, 24 April 2026 (UTC) **# [[User:FNegri-WMF|FNegri-WMF]] ([[User talk:FNegri-WMF|talk]]) 09:07, 24 April 2026 (UTC) **# [[User:Christoph Jauera (WMDE)|Christoph Jauera (WMDE)]] ([[User talk:Christoph Jauera (WMDE)|talk]]) 10:48, 24 April 2026 (UTC) **# [[User:GLavagetto (WMF)|GLavagetto (WMF)]] ([[User talk:GLavagetto (WMF)|talk]]) 13:50, 24 April 2026 (UTC) **# [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:53, 24 April 2026 (UTC) **# [[User:CGoubert-WMF|CGoubert-WMF]] ([[User talk:CGoubert-WMF|talk]]) 14:42, 24 April 2026 (UTC) **# '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:51, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:Mike Peel|Mike Peel]] ([[User talk:Mike Peel|talk]]) 20:45, 24 April 2026 (UTC) **# [[User:MAzevedo (WMF)|MAzevedo (WMF)]] ([[User talk:MAzevedo (WMF)|talk]]) 21:11, 24 April 2026 (UTC) **# [[User:KSoučková-WMF|KSoučková-WMF]] ([[User talk:KSoučková-WMF|talk]]) 21:24, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:18, 25 April 2026 (UTC) **# [[User:Shreya.Bhopal|Shreya.Bhopal]] ([[User talk:Shreya.Bhopal|talk]]) 07:52, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:29, 25 April 2026 (UTC) **# [[User:AChou-WMF|AChou-WMF]] ([[User talk:AChou-WMF|talk]]) 10:03, 25 April 2026 (UTC) **# [[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 17:20, 25 April 2026 (UTC) **# --[[User:Sannita (WMF)|Sannita (WMF)]] ([[User talk:Sannita (WMF)|talk]]) 18:02, 25 April 2026 (UTC) **# --[[User:Auregann|Auregann]] 18:02, 25 April 2026 (UTC) **# [[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:50, 26 April 2026 (UTC) **#[[User:Misaochan|Misaochan]] ([[User talk:Misaochan|talk]]) 16:11, 2 May 2026 (UTC) (note: user decided to cancel, then re-added herself) **# [[User:Gopavasanth|Gopa Vasanth]] ([[User talk:Gopavasanth|talk]]) 18:05, 26 April 2026 (UTC) **# [[User:Lahari20|Lahari20]] ([[User talk:Lahari20|talk]]) 18:11, 26 April 2026 (UTC) **# [[User:Dactylantha|Dactylantha]] ([[User talk:Dactylantha|talk]]) 21:29, 26 April 2026 (UTC) **# [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) **# [[User:Alchimista|Alchimista]] ([[User talk:Alchimista|talk]]) 07:36, 27 April 2026 (UTC) **# [[User:Chinmayee Mishra|Chinmayee Mishra]] ([[User talk:Chinmayee Mishra|talk]]) 12:17, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) asking nicely =) **#:'''From this point onward, participants are placed on the waiting list. Attendance will be confirmed only if spots become available.''' **# [[User:Lucas Werkmeister (WMDE)|Lucas Werkmeister (WMDE)]] ([[User talk:Lucas Werkmeister (WMDE)|talk]]) 14:09, 28 April 2026 (UTC) **# [[User:Lucas.Belo|Lucas.Belo]] ([[User talk:Lucas.Belo|talk]]) 21:34, 28 April 2026 (UTC) **# [[User:Seanleong8|Seanleong8]] ([[User talk:Seanleong8|talk]]) 10:34, 29 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:23, 29 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 13:39, 29 April 2026 (UTC) Thought I added myself here too :/ **# --[[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 14:45, 29 April 2026 (UTC) **# <span style="color:#d30000">☠</span>[[User:MarkAHershberger|MarkAHershberger]]<span style="color:#d30000">☢</span>([[User_talk:MarkAHershberger|talk]])<span style="color:#d30000">☣</span> 17:41, 29 April 2026 (UTC) **# <span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:40, 1 May 2026 (UTC) **# [[User:Nacaru|Nacaru]] ([[User talk:Nacaru|talk]]) 13:37, 1 May 2026 (UTC) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# User: Adenisse-WMF **# [[User:Jenny8lee|Jenny8lee]] ([[User talk:Jenny8lee|talk]]) 13:04, 2 May 2026 (UTC) **# [[User:Punith.nyk|Punith.nyk]] ([[User talk:Punith.nyk|talk]]) 11:29, 2 May 2026 (UTC) **#--[[User:Johannnes89|Johannnes89]] ([[User talk:Johannnes89|talk]]) 14:04, 2 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:09, 2 May 2026 (UTC) *What: [https://oooh.events/evento/holy-swing-night-02052026-biglietti/ Swing Dance] **Meeting point: [https://www.google.com/maps?cid=5018841184155524841 Spirit de Milan], Via Bovisasca, 59, 20157 Milano MI **Meeting time: Bicycle over from hotel at 21:30; live band starts at 22:30 **Duration: 3hr **Itinerary: Let's check out Milan's local [[w:swing dance|swing dance]]! The band "Lu Cicchitelli & The Associates" will be playing jazz music of the American [[w:big band|big band]]s of the 1930s/1940s at Spirit de Milan's "Holy Swing Night". There does not appear to be any newcomer lesson, so either prior social dance experience or an adventerous spirit is recommended. €15. **Register your interest, using your signature (4 tildes): **#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:38, 1 May 2026 (UTC) *What: '''Wikimedia Untappd Meetup''' ** Description: We share beers and stories. Some brought beer from their country, others bought beers here. Siebrand took care there's enough for those that didn't bring beer. Having a profile on Untappd is necessary, of course. If you don't bring beer, a contribution is expected. ** Meeting point: Floor 1 - lunch/dinner area. We will move to Siebrand's room as we're not allowed to consume non-hotel bought beverages in the public space in the hotel. ** Meeting time: 20:30. Contact siebrand at Telegram if you missed us. ** Duration: many hours hour, no mandatory attendance for the whole session ;) ** Max 12-15 people: **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:30, 1 May 2026 (UTC) **# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:39, 1 May 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:43, 1 May 2026 (UTC) **# 🍻 '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:45, 1 May 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 06:26, 2 May 2026 (UTC) **#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:09, 2 May 2026 (UTC) (will join after tram tour) **# [[User:the wub|the wub]] [[User_talk:The wub|<span style="color: #080;">"?!"</span>]] 07:20, 2 May 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) (will join after tram tour) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# [[User:Mohammed Abdulai (WMDE)|Mohammed Abdulai (WMDE)]] ([[User talk:Mohammed Abdulai (WMDE)|talk]]) 13:34, 2 May 2026 (UTC) **# [[User:Aude|Aude]] ([[User talk:Aude|talk]]) 15:05, 2 May 2026 (UTC) **# [[User:Ejegg|Ejegg]] ([[User talk:Ejegg|talk]]) 17:37, 2 May 2026 (UTC) **# [[User:Jon Harald Søby|Jon Harald Søby]] ([[User talk:Jon Harald Søby|talk]]) 15:56, 2 May 2026 (UTC) **# maybe [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) === Sunday 03 May 2026 === ''Hacking'' ''and closing ceremony!'' <u>Visit to downtown Milan</u>: Following the closing ceremony, shuttle buses will be provided so participants can visit downtown Milan. Shuttles will depart the venue at 17:30 and drop off participants [[:en:Piazza_del_Duomo,_Milan|near the Duomo]] (at [https://www.openstreetmap.org/node/9243018607 Piazza Fontana]), then return to the venue at 22:00. Participants are free to self-organize their visit in downtown Milan. What: '''Wikimedians Love Craft Beer@SNOB''' * Description: We share beers and stories at [https://snob-beer.it/ SNOB]. Once we are dropped off in the city, we will proceed to travel to the bar. They have 20 beers for 500/1000ml growlers and a few hundred different beers from all over. * Meeting point: With Siebrand and Sjoerd once the buses have brought us to the city center on Sunday. * Duration: SNOB closes at 22:00. * Max 15 people: *# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:38, 1 May 2026 (UTC) *# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:41, 1 May 2026 (UTC) *# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:42, 1 May 2026 (UTC) *# '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:46, 1 May 2026 (UTC) *#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:06, 2 May 2026 (UTC) *#[[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) *# ... What: '''Wikimedians visit Milan's Chinatown ([[:en:Chinatown, Milan|Quartiere Cinese]])''' <gallery mode="packed"> File:Milano, Chinatown 02.jpg File:Dopoguerra 1945 a Milano - Quartiere cinese.jpg File:Milano - Quartiere cinese nel 1945.jpg File:Milano - Quartiere cinese 1945.jpg </gallery> * Description: There are Chinatowns all over the world, and the [[:en:Chinatown, Milan | one in Milan]] is the largest in Italy, having been started in the 1920s from immigrants in Zhejiang province. Population in the tens of thousands! * Meeting point: With [[User:Runawaymo |Runawaymo]] and [[User:Jenny8lee |Jenny8lee]] once the buses drop us off. We will head to [[:en:Via Paolo Sarpi |Via Paolo Sarpi]] (about 20 minutes on public transit) Among the places there with good food are: ** [https://www.instagram.com/laravioleriasarpi/ Ravioleria Sarpi], the absolute institution with handmade "ravioli tradizionali cinesi" (dumplings) made with organic dough and jianbing. ** [https://www.instagram.com/ristorante_di_houjie/ Houjie], cuisine from [[:en:Rui'an|Rui’an]], Wenzhou at budget friendly prices. * Duration: Until we run out of things to eat. * Max 12 people: *# [[User:Runawaymo |Runawaymo]] *# [[User:Jenny8lee |Jenny8lee]] *# Seanleong8 *# $[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:43, 2 May 2026 (UTC) *# [[User:DLynch (WMF)|DLynch (WMF)]] ([[User talk:DLynch (WMF)|talk]]) *# [[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 04:09, 3 May 2026 (UTC) *# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 10:01, 3 May 2026 (UTC) What: '''Modern art museums by bicycle''' *Meeting point: Hotel lobby *Meeting time: 16:00 *Duration: 16:00-19:30 *Itinerary: Let's bicycle around downtown and visit some modern art museums! Leaving via bikeshare right after the closing showcase. Planning to visit the {{w|Triennale di Milano}} and then the {{w|Museo del Novecento}}. *Register your interest, using your signature (4 tildes): *#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 13:01, 3 May 2026 (UTC) === Monday 04 May 2026 === ''Participants head home'' == Code of Conduct == The Wikimedia Hackathon will enforce the [[foundation:Policy:Universal_Code_of_Conduct|Universal Code of Conduct]], [[Code of Conduct]] for Wikimedia’s Technical Spaces, and the [[foundation:Policy:Friendly_space_policy|Friendly Space Policy]] across all facets of the event. This includes various platforms, discussion channels, and local meetups. Your adherence to these guidelines ensures a respectful and inclusive environment for all participants. '''We recommend all participants review these Trust & Safety policies prior to your arrival at the venue.''' Individuals not cooperating with these policies may be asked to leave the event. A dedicated team will be available on-site to help support a safer environment for all. If you have any questions or suggestions, feel free to use the [[Talk:Wikimedia Hackathon 2026|talk page]] or to reach out to hackathon@wikimedia.org. [[Category:Wikimedia Hackathon 2026]] m1dx4auzh2c29bgsjqrkcwn30u20s1i 8364385 8364378 2026-05-03T13:52:48Z Krinkle 135822 /* Sunday 03 May 2026 */ 8364385 wikitext text/x-wiki __NOTALK__ <languages/> {{:Wikimedia Hackathon 2026/Header|page=2}} <div style="background: #F6F6F6; border-radius:10px; border:1px solid #A4A4A4; margin:5px 15px;"><div style="margin: 1em; color:#555;"><div style="font-size: 130%; font-family: Tahoma, sans-serif; text-align:left; line-height: 1.5;"> The Hackathon is participant-driven and gets its life from the active participation of its attendees. Below you will find some information on [[#How_to_contribute|how to contribute]] to the program as an attendee. Local communities are also welcome to organize pre-hackathon events, watch-parties or meetups in their region. More information about organization and funding is available on the [[Wikimedia_Hackathon_2026/Satellite_Events|satellite events]] page. </div>{{TOC|limit=3}}</div></div> {{Info|'''This year's hackathon will use the unconference format, with session lengths between 30 minutes and 60 minutes available.''' Add your proposed session to the "Proposed Unconference Sessions" [https://phabricator.wikimedia.org/project/view/8319/ column on the Hackathon 2026 workboard] with the <code>#Wikimedia-Hackathon-2026</code> tag. Then add your session title and name to the schedule! Please ensure you link to your Phabricator task so interested participants can see the full details. Be sure to follow the format listed in the [[#How to contribute]] section of this page. If you're interested in a particular session, please be sure to demonstrate your interest by subscribing to the task in Phabricator! }} {{:Wikimedia_Hackathon_2026/Program/Schedule}} == Room descriptions and capacity == Our main hacking spaces will be on the Floor 2 of the Voco Fiere Hotel Milan; the breakout rooms, quiet room, and the second hacking space (available Friday and Saturday afternoons) will be on Floor 1. '''Floor 2:''' * Main Space - general hacking and where the opening ceremony and closing showcase will happen ** Open from Friday: 09:00–02:00; Saturday: 07:00–02:00; Sunday: 07:00–17:00 * Foyer off Main Space - breaks, snacks and socializing '''Lobby level:''' * Event registration (on Thursday from 12:00–19:00; on Friday from 08:00–09:30) * Space for attendees to socialize and play games '''Floor 1:''' * Space 4 - Unconference sessions and hacking space ** Friday *** 10:45–13:00: Unconference sessions *** 13:00–23:00: Hacking ** Saturday *** 07:00–12:15: Unconference sessions *** 12:15–23:00: Hacking ** Sunday *** 07:00–14:00: Unconference sessions * Space 5 - Unconference sessions and games ** Friday *** 10:45–17:00: Unconference sessions *** 18:30–23:00: Tombola Night ** Saturday *** 07:00–17:00: Unconference sessions ** Sunday *** 07:00–14:00: Unconference sessions * Space 6 - Quiet space * Ristorante Betulla - Where lunch and dinner will be provided '''Room availability:''' * Our hacking rooms - The Main Space will be open until 14:00 on Friday and Saturday night; Space 4 will be open until 23:00. * Space 5 and Space 6 will be closed overnight starting at 18:00. * On Sunday, all rooms close at 17:00 == How to contribute == You can use the Phabricator templates [[phab:T415213|here]] to propose a project or sign up as a participant looking for a project '''Propose a session, workshop, or project''' * '''Proposed Projects -''' Hands-on skill development workshops on topics around the technology stack of Wikimedia projects. * '''Proposed Unconference Sessions -''' Sessions or workshops covering any of the [[:File:Wm technical areas.svg|Wikimedia technical areas]]. For any of the items listed above, use the [https://w.wiki/Kew5 proposal template]. Also, indicate in the task description if your proposed activity is newcomer-friendly. '''Get the word out''' * Add your name and interests - including things you can teach and things you want to learn about - to our participants page. * Email the organizers with any questions, we can help! '''Sign up as a participant''' If you want to work on something but you're not sure what, use the [https://w.wiki/KewC participant template] to let others know that you are looking for a project. If you're interested in a specific unconference session, you can indicate your interest by subscribing to the task. You can also add yourself to the ''Volunteer sign-ups'' column if you would like to help with small tasks involved with running the Hackathon. == How to conduct your session and/or workshop == Here are some tips: * We have a [https://docs.google.com/presentation/d/1019ZQltl-M5tsQ6tJz8UaWnTDG9-9MmF044-4IUQqHA/edit?usp=sharing Hackathon themed slide deck] with best practices and more; please make a copy and add the information for your session. * You can propose sessions as presentations, workshops, discussions, or any other format that suits your requirements. ** Feel free to host language- or community-specific sessions and/or meetups. * Session focus should be less on beginner-level workshops (unlike in some previous Hackathons), as this event brings together individuals who have already contributed to technical aspects of the Wikimedia projects. * If there isn't a dedicated space for your session, be prepared to run your session without a projector at a specific hackathon table in a quiet corner of one of the bigger rooms, in the foyer, or outside. * You are welcome to reach out to the event organizers to seek help to prepare, get feedback on your presentation, or any training support you might need a few weeks before the hackathon event. == Social gatherings and side events in Milan == === Format to use for your event === * What: * Meeting point: * Meeting time: * Duration: * Itinerary: * Register your interest, using your signature (4 tildes): === Thursday 30 April 2026 === ''Hackathon participants arrive'' === Friday 01 May 2026 === ''Hackathon kicks off!'' * What: Board games ** Meeting point: Space 5 ** Meeting time: 17:00 ** Duration: 17:00–20:30 ** '''max 6 people:''' Register your interest, using your signature (4 tildes): **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:45, 21 April 2026 (UTC) * What: Tombola night with cute prizes ** Meeting point: Space 5 ** Meeting time: 21:00 ** Duration: 21:00–23:00 ** '''3 rounds, max 48 people each:''' Register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:40, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:12, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:53, 20 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:42, 21 April 2026 (UTC) **#[[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:57, 23 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 01:35, 24 April 2026 (UTC) **# [[User:DaxServer|DaxServer]] ([[User talk:DaxServer|talk]]) 08:26, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:04, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:HCoplin-WMF|HCoplin-WMF]] ([[User talk:HCoplin-WMF|talk]]) 15:36, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:19, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:28, 25 April 2026 (UTC) **#[[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:49, 26 April 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 13:29, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 17:15, 28 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:22, 29 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 08:05, 1 May 2026 (UTC) **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 17:19, 1 May 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 18:06, 1 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:10, 2 May 2026 (UTC) === Saturday 02 May 2026 === ''Hacking!'' * What: Learning and Creating LGBTQIA+ Knowledge and History in Milan (moved from 1 May 2026 due to [https://it.wikipedia.org/wiki/Festa_dei_lavoratori Labour Day]) ** Meeting point: voco Milan-Fiere Hotel lobby ** Meeting time: 15:00 ** Duration: ~3-4 hours (flexible, you can message us if you want to meet us earlier or later) ** Itinerary (flexible and subject to change, please feel free to add locations you'd like or recommend below): *** [https://www.libreriantigone.com/ Antigone - Libreria lgbtqia+], open 15:00–19:30 *** [https://www.instagram.com/leccomilano/ Leccomilano], open 17:00–02:00 ** Register your interest, using your signature (4 tildes): **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:24, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **#[[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) **#[[User:Suzanne Wood (WMDE)|Suzanne Wood (WMDE)]] ([[User talk:Suzanne Wood (WMDE)|talk]]) 21:51, 1 May 2026 (UTC) **#Adenisse (WMF) * What: [https://meta.wikimedia.org/wiki/Event:Hardware_tools_for_Wiki/Raspberry_JAM_at_Wikimedia_Hackathon_Milan_2026 Raspberry JAM] ** Meeting point: Space 5 ** Meeting time: 17:30 ** Duration:1 hour ** Itinerary: Register your interest, using your signature (4 tildes): # '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:58, 24 April 2026 (UTC) # [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but discovered too late) * What: Train Spotting near the Hotel ** Description: There is a railway line near the Hotel and many trains pass through there. Lets have some conversations tech related or related to trains or public transport outside while watching the railway line. ** Meeting point: Entrance of the Hotel, later you can find us at the fence next to the railway line ** Duration: 1 hour, you can join later and leave earlier ** Itinerary: Register your interest, using your signature (4 tildes): # --[[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 17:54, 1 May 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but unable to attend) * What: Historical Tram Experience ** Meeting point: Hotel lobby ** Meeting time: 19:45 (leaving at 20:15) ** Duration: 3.33 hours ** Itinerary: Arco della Pace, Monumentale Cemetry, Piazza Fontana, Piazza della Repubblica, Scala, Navigli , Darsena, Brera, Milano Arena, On tram karaoke ** '''Max 59 people''', register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:42, 10 April 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 21:58, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:11, 11 April 2026 (UTC) **# [[User:GChoi-WMF|GChoi-WMF]] ([[User talk:GChoi-WMF|talk]]) 20:54, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:42, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 08:51, 15 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 14:58, 15 April 2026 (UTC) **# [[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 15:28, 15 April 2026 (UTC) **# [[User:Lupamo Arnold|Lupamo]] ([[User talk:Lupamo Arnold|talk]]) 18:23, 17 April 2026 (UTC) **# [[User:MSzwarc-WMF|MSzwarc-WMF]] ([[User talk:MSzwarc-WMF|talk]]) 17:44, 18 April 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 08:36, 19 April 2026 (UTC) **# [[User:VriaA|VriaA]] ([[User talk:VriaA|talk]]) 04:22, 20 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 10:46, 20 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:50, 20 April 2026 (UTC) **# [[User:ErikaGuetti|ErikaGuetti]] **# [[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:58, 23 April 2026 (UTC) **# [[User:DTorsani-WMF|DTorsani-WMF]] ([[User talk:DTorsani-WMF|talk]]) 00:08, 24 April 2026 (UTC) **# [[User:SSingh (WMF)|SSingh (WMF)]] ([[User talk:SSingh (WMF)|talk]]) 00:48, 24 April 2026 (UTC) **# [[User:Danielyepezgarces|dyepezg]] ([[User talk:Danielyepezgarces|talk]]) 03:09, 24 April 2026 (UTC) **# [[User:SD0001|SD0001]] ([[User talk:SD0001|talk]]) 04:10, 24 April 2026 (UTC) **# [[User:Kaspo|Kaspo]] ([[User talk:Kaspo|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Manimaran96|Manimaran96]] ([[User talk:Manimaran96|talk]]) 07:54, 24 April 2026 (UTC) **# [[User:Silvan Heintze (WMDE)|Silvan Heintze (WMDE)]] ([[User talk:Silvan Heintze (WMDE)|talk]]) 08:00, 24 April 2026 (UTC) **# [[User:T Arrow|T Arrow]] ([[User talk:T Arrow|talk]]) 08:04, 24 April 2026 (UTC) **# [[User:Ollie Shotton (WMDE)|Ollie Shotton (WMDE)]] ([[User talk:Ollie Shotton (WMDE)|talk]]) (Ollie Hyde) **# [[User:Martyn Ranyard (WMDE)|Martyn Ranyard (WMDE)]] ([[User talk:Martyn Ranyard (WMDE)|talk]]) 08:09, 24 April 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 08:15, 24 April 2026 (UTC) **# [[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) (Neslihan Turan) **# [[User:Filippo Giunchedi|Filippo Giunchedi]] ([[User talk:Filippo Giunchedi|talk]]) 08:49, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:05, 24 April 2026 (UTC) **# [[User:FNegri-WMF|FNegri-WMF]] ([[User talk:FNegri-WMF|talk]]) 09:07, 24 April 2026 (UTC) **# [[User:Christoph Jauera (WMDE)|Christoph Jauera (WMDE)]] ([[User talk:Christoph Jauera (WMDE)|talk]]) 10:48, 24 April 2026 (UTC) **# [[User:GLavagetto (WMF)|GLavagetto (WMF)]] ([[User talk:GLavagetto (WMF)|talk]]) 13:50, 24 April 2026 (UTC) **# [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:53, 24 April 2026 (UTC) **# [[User:CGoubert-WMF|CGoubert-WMF]] ([[User talk:CGoubert-WMF|talk]]) 14:42, 24 April 2026 (UTC) **# '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:51, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:Mike Peel|Mike Peel]] ([[User talk:Mike Peel|talk]]) 20:45, 24 April 2026 (UTC) **# [[User:MAzevedo (WMF)|MAzevedo (WMF)]] ([[User talk:MAzevedo (WMF)|talk]]) 21:11, 24 April 2026 (UTC) **# [[User:KSoučková-WMF|KSoučková-WMF]] ([[User talk:KSoučková-WMF|talk]]) 21:24, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:18, 25 April 2026 (UTC) **# [[User:Shreya.Bhopal|Shreya.Bhopal]] ([[User talk:Shreya.Bhopal|talk]]) 07:52, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:29, 25 April 2026 (UTC) **# [[User:AChou-WMF|AChou-WMF]] ([[User talk:AChou-WMF|talk]]) 10:03, 25 April 2026 (UTC) **# [[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 17:20, 25 April 2026 (UTC) **# --[[User:Sannita (WMF)|Sannita (WMF)]] ([[User talk:Sannita (WMF)|talk]]) 18:02, 25 April 2026 (UTC) **# --[[User:Auregann|Auregann]] 18:02, 25 April 2026 (UTC) **# [[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:50, 26 April 2026 (UTC) **#[[User:Misaochan|Misaochan]] ([[User talk:Misaochan|talk]]) 16:11, 2 May 2026 (UTC) (note: user decided to cancel, then re-added herself) **# [[User:Gopavasanth|Gopa Vasanth]] ([[User talk:Gopavasanth|talk]]) 18:05, 26 April 2026 (UTC) **# [[User:Lahari20|Lahari20]] ([[User talk:Lahari20|talk]]) 18:11, 26 April 2026 (UTC) **# [[User:Dactylantha|Dactylantha]] ([[User talk:Dactylantha|talk]]) 21:29, 26 April 2026 (UTC) **# [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) **# [[User:Alchimista|Alchimista]] ([[User talk:Alchimista|talk]]) 07:36, 27 April 2026 (UTC) **# [[User:Chinmayee Mishra|Chinmayee Mishra]] ([[User talk:Chinmayee Mishra|talk]]) 12:17, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) asking nicely =) **#:'''From this point onward, participants are placed on the waiting list. Attendance will be confirmed only if spots become available.''' **# [[User:Lucas Werkmeister (WMDE)|Lucas Werkmeister (WMDE)]] ([[User talk:Lucas Werkmeister (WMDE)|talk]]) 14:09, 28 April 2026 (UTC) **# [[User:Lucas.Belo|Lucas.Belo]] ([[User talk:Lucas.Belo|talk]]) 21:34, 28 April 2026 (UTC) **# [[User:Seanleong8|Seanleong8]] ([[User talk:Seanleong8|talk]]) 10:34, 29 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:23, 29 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 13:39, 29 April 2026 (UTC) Thought I added myself here too :/ **# --[[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 14:45, 29 April 2026 (UTC) **# <span style="color:#d30000">☠</span>[[User:MarkAHershberger|MarkAHershberger]]<span style="color:#d30000">☢</span>([[User_talk:MarkAHershberger|talk]])<span style="color:#d30000">☣</span> 17:41, 29 April 2026 (UTC) **# <span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:40, 1 May 2026 (UTC) **# [[User:Nacaru|Nacaru]] ([[User talk:Nacaru|talk]]) 13:37, 1 May 2026 (UTC) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# User: Adenisse-WMF **# [[User:Jenny8lee|Jenny8lee]] ([[User talk:Jenny8lee|talk]]) 13:04, 2 May 2026 (UTC) **# [[User:Punith.nyk|Punith.nyk]] ([[User talk:Punith.nyk|talk]]) 11:29, 2 May 2026 (UTC) **#--[[User:Johannnes89|Johannnes89]] ([[User talk:Johannnes89|talk]]) 14:04, 2 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:09, 2 May 2026 (UTC) *What: [https://oooh.events/evento/holy-swing-night-02052026-biglietti/ Swing Dance] **Meeting point: [https://www.google.com/maps?cid=5018841184155524841 Spirit de Milan], Via Bovisasca, 59, 20157 Milano MI **Meeting time: Bicycle over from hotel at 21:30; live band starts at 22:30 **Duration: 3hr **Itinerary: Let's check out Milan's local [[w:swing dance|swing dance]]! The band "Lu Cicchitelli & The Associates" will be playing jazz music of the American [[w:big band|big band]]s of the 1930s/1940s at Spirit de Milan's "Holy Swing Night". There does not appear to be any newcomer lesson, so either prior social dance experience or an adventerous spirit is recommended. €15. **Register your interest, using your signature (4 tildes): **#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:38, 1 May 2026 (UTC) *What: '''Wikimedia Untappd Meetup''' ** Description: We share beers and stories. Some brought beer from their country, others bought beers here. Siebrand took care there's enough for those that didn't bring beer. Having a profile on Untappd is necessary, of course. If you don't bring beer, a contribution is expected. ** Meeting point: Floor 1 - lunch/dinner area. We will move to Siebrand's room as we're not allowed to consume non-hotel bought beverages in the public space in the hotel. ** Meeting time: 20:30. Contact siebrand at Telegram if you missed us. ** Duration: many hours hour, no mandatory attendance for the whole session ;) ** Max 12-15 people: **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:30, 1 May 2026 (UTC) **# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:39, 1 May 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:43, 1 May 2026 (UTC) **# 🍻 '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:45, 1 May 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 06:26, 2 May 2026 (UTC) **#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:09, 2 May 2026 (UTC) (will join after tram tour) **# [[User:the wub|the wub]] [[User_talk:The wub|<span style="color: #080;">"?!"</span>]] 07:20, 2 May 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) (will join after tram tour) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# [[User:Mohammed Abdulai (WMDE)|Mohammed Abdulai (WMDE)]] ([[User talk:Mohammed Abdulai (WMDE)|talk]]) 13:34, 2 May 2026 (UTC) **# [[User:Aude|Aude]] ([[User talk:Aude|talk]]) 15:05, 2 May 2026 (UTC) **# [[User:Ejegg|Ejegg]] ([[User talk:Ejegg|talk]]) 17:37, 2 May 2026 (UTC) **# [[User:Jon Harald Søby|Jon Harald Søby]] ([[User talk:Jon Harald Søby|talk]]) 15:56, 2 May 2026 (UTC) **# maybe [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) === Sunday 03 May 2026 === ''Hacking'' ''and closing ceremony!'' <u>Visit to downtown Milan</u>: Following the closing ceremony, shuttle buses will be provided so participants can visit downtown Milan. Shuttles will depart the venue at 17:30 and drop off participants [[:en:Piazza_del_Duomo,_Milan|near the Duomo]] (at [https://www.openstreetmap.org/node/9243018607 Piazza Fontana]), then return to the venue at 22:00. Participants are free to self-organize their visit in downtown Milan. What: '''Wikimedians Love Craft Beer@SNOB''' * Description: We share beers and stories at [https://snob-beer.it/ SNOB]. Once we are dropped off in the city, we will proceed to travel to the bar. They have 20 beers for 500/1000ml growlers and a few hundred different beers from all over. * Meeting point: With Siebrand and Sjoerd once the buses have brought us to the city center on Sunday. * Duration: SNOB closes at 22:00. * Max 15 people: *# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:38, 1 May 2026 (UTC) *# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:41, 1 May 2026 (UTC) *# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:42, 1 May 2026 (UTC) *# '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:46, 1 May 2026 (UTC) *#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:06, 2 May 2026 (UTC) *#[[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) *# ... What: '''Wikimedians visit Milan's Chinatown ([[:en:Chinatown, Milan|Quartiere Cinese]])''' <gallery mode="packed"> File:Milano, Chinatown 02.jpg File:Dopoguerra 1945 a Milano - Quartiere cinese.jpg File:Milano - Quartiere cinese nel 1945.jpg File:Milano - Quartiere cinese 1945.jpg </gallery> * Description: There are Chinatowns all over the world, and the [[:en:Chinatown, Milan | one in Milan]] is the largest in Italy, having been started in the 1920s from immigrants in Zhejiang province. Population in the tens of thousands! * Meeting point: With [[User:Runawaymo |Runawaymo]] and [[User:Jenny8lee |Jenny8lee]] once the buses drop us off. We will head to [[:en:Via Paolo Sarpi |Via Paolo Sarpi]] (about 20 minutes on public transit) Among the places there with good food are: ** [https://www.instagram.com/laravioleriasarpi/ Ravioleria Sarpi], the absolute institution with handmade "ravioli tradizionali cinesi" (dumplings) made with organic dough and jianbing. ** [https://www.instagram.com/ristorante_di_houjie/ Houjie], cuisine from [[:en:Rui'an|Rui’an]], Wenzhou at budget friendly prices. * Duration: Until we run out of things to eat. * Max 12 people: *# [[User:Runawaymo |Runawaymo]] *# [[User:Jenny8lee |Jenny8lee]] *# Seanleong8 *# $[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:43, 2 May 2026 (UTC) *# [[User:DLynch (WMF)|DLynch (WMF)]] ([[User talk:DLynch (WMF)|talk]]) *# [[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 04:09, 3 May 2026 (UTC) *# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 10:01, 3 May 2026 (UTC) What: '''Modern art museums by bicycle''' *Meeting point: Hotel lobby *Meeting time: 16:00 *Duration: 16:00-19:30 *Itinerary: Let's bicycle around downtown and visit some modern art museums! Leaving via bikeshare right after the closing showcase. Planning to visit the {{w|Triennale di Milano}} and then the {{w|Museo del Novecento}}. *Register your interest, using your signature (4 tildes): *#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 13:01, 3 May 2026 (UTC) === Monday 04 May 2026 === ''Participants head home'' == Code of Conduct == The Wikimedia Hackathon will enforce the [[foundation:Policy:Universal_Code_of_Conduct|Universal Code of Conduct]], [[Code of Conduct]] for Wikimedia’s Technical Spaces, and the [[foundation:Policy:Friendly_space_policy|Friendly Space Policy]] across all facets of the event. This includes various platforms, discussion channels, and local meetups. Your adherence to these guidelines ensures a respectful and inclusive environment for all participants. '''We recommend all participants review these Trust & Safety policies prior to your arrival at the venue.''' Individuals not cooperating with these policies may be asked to leave the event. A dedicated team will be available on-site to help support a safer environment for all. If you have any questions or suggestions, feel free to use the [[Talk:Wikimedia Hackathon 2026|talk page]] or to reach out to hackathon@wikimedia.org. [[Category:Wikimedia Hackathon 2026]] kiamwt004mtpf15bm130ljedn4nv4f9 8364387 8364385 2026-05-03T13:58:49Z DaxServer 1878659 /* Sunday 03 May 2026 */ yay 8364387 wikitext text/x-wiki __NOTALK__ <languages/> {{:Wikimedia Hackathon 2026/Header|page=2}} <div style="background: #F6F6F6; border-radius:10px; border:1px solid #A4A4A4; margin:5px 15px;"><div style="margin: 1em; color:#555;"><div style="font-size: 130%; font-family: Tahoma, sans-serif; text-align:left; line-height: 1.5;"> The Hackathon is participant-driven and gets its life from the active participation of its attendees. Below you will find some information on [[#How_to_contribute|how to contribute]] to the program as an attendee. Local communities are also welcome to organize pre-hackathon events, watch-parties or meetups in their region. More information about organization and funding is available on the [[Wikimedia_Hackathon_2026/Satellite_Events|satellite events]] page. </div>{{TOC|limit=3}}</div></div> {{Info|'''This year's hackathon will use the unconference format, with session lengths between 30 minutes and 60 minutes available.''' Add your proposed session to the "Proposed Unconference Sessions" [https://phabricator.wikimedia.org/project/view/8319/ column on the Hackathon 2026 workboard] with the <code>#Wikimedia-Hackathon-2026</code> tag. Then add your session title and name to the schedule! Please ensure you link to your Phabricator task so interested participants can see the full details. Be sure to follow the format listed in the [[#How to contribute]] section of this page. If you're interested in a particular session, please be sure to demonstrate your interest by subscribing to the task in Phabricator! }} {{:Wikimedia_Hackathon_2026/Program/Schedule}} == Room descriptions and capacity == Our main hacking spaces will be on the Floor 2 of the Voco Fiere Hotel Milan; the breakout rooms, quiet room, and the second hacking space (available Friday and Saturday afternoons) will be on Floor 1. '''Floor 2:''' * Main Space - general hacking and where the opening ceremony and closing showcase will happen ** Open from Friday: 09:00–02:00; Saturday: 07:00–02:00; Sunday: 07:00–17:00 * Foyer off Main Space - breaks, snacks and socializing '''Lobby level:''' * Event registration (on Thursday from 12:00–19:00; on Friday from 08:00–09:30) * Space for attendees to socialize and play games '''Floor 1:''' * Space 4 - Unconference sessions and hacking space ** Friday *** 10:45–13:00: Unconference sessions *** 13:00–23:00: Hacking ** Saturday *** 07:00–12:15: Unconference sessions *** 12:15–23:00: Hacking ** Sunday *** 07:00–14:00: Unconference sessions * Space 5 - Unconference sessions and games ** Friday *** 10:45–17:00: Unconference sessions *** 18:30–23:00: Tombola Night ** Saturday *** 07:00–17:00: Unconference sessions ** Sunday *** 07:00–14:00: Unconference sessions * Space 6 - Quiet space * Ristorante Betulla - Where lunch and dinner will be provided '''Room availability:''' * Our hacking rooms - The Main Space will be open until 14:00 on Friday and Saturday night; Space 4 will be open until 23:00. * Space 5 and Space 6 will be closed overnight starting at 18:00. * On Sunday, all rooms close at 17:00 == How to contribute == You can use the Phabricator templates [[phab:T415213|here]] to propose a project or sign up as a participant looking for a project '''Propose a session, workshop, or project''' * '''Proposed Projects -''' Hands-on skill development workshops on topics around the technology stack of Wikimedia projects. * '''Proposed Unconference Sessions -''' Sessions or workshops covering any of the [[:File:Wm technical areas.svg|Wikimedia technical areas]]. For any of the items listed above, use the [https://w.wiki/Kew5 proposal template]. Also, indicate in the task description if your proposed activity is newcomer-friendly. '''Get the word out''' * Add your name and interests - including things you can teach and things you want to learn about - to our participants page. * Email the organizers with any questions, we can help! '''Sign up as a participant''' If you want to work on something but you're not sure what, use the [https://w.wiki/KewC participant template] to let others know that you are looking for a project. If you're interested in a specific unconference session, you can indicate your interest by subscribing to the task. You can also add yourself to the ''Volunteer sign-ups'' column if you would like to help with small tasks involved with running the Hackathon. == How to conduct your session and/or workshop == Here are some tips: * We have a [https://docs.google.com/presentation/d/1019ZQltl-M5tsQ6tJz8UaWnTDG9-9MmF044-4IUQqHA/edit?usp=sharing Hackathon themed slide deck] with best practices and more; please make a copy and add the information for your session. * You can propose sessions as presentations, workshops, discussions, or any other format that suits your requirements. ** Feel free to host language- or community-specific sessions and/or meetups. * Session focus should be less on beginner-level workshops (unlike in some previous Hackathons), as this event brings together individuals who have already contributed to technical aspects of the Wikimedia projects. * If there isn't a dedicated space for your session, be prepared to run your session without a projector at a specific hackathon table in a quiet corner of one of the bigger rooms, in the foyer, or outside. * You are welcome to reach out to the event organizers to seek help to prepare, get feedback on your presentation, or any training support you might need a few weeks before the hackathon event. == Social gatherings and side events in Milan == === Format to use for your event === * What: * Meeting point: * Meeting time: * Duration: * Itinerary: * Register your interest, using your signature (4 tildes): === Thursday 30 April 2026 === ''Hackathon participants arrive'' === Friday 01 May 2026 === ''Hackathon kicks off!'' * What: Board games ** Meeting point: Space 5 ** Meeting time: 17:00 ** Duration: 17:00–20:30 ** '''max 6 people:''' Register your interest, using your signature (4 tildes): **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:45, 21 April 2026 (UTC) * What: Tombola night with cute prizes ** Meeting point: Space 5 ** Meeting time: 21:00 ** Duration: 21:00–23:00 ** '''3 rounds, max 48 people each:''' Register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:40, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:12, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:53, 20 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:42, 21 April 2026 (UTC) **#[[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:57, 23 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 01:35, 24 April 2026 (UTC) **# [[User:DaxServer|DaxServer]] ([[User talk:DaxServer|talk]]) 08:26, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:04, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:HCoplin-WMF|HCoplin-WMF]] ([[User talk:HCoplin-WMF|talk]]) 15:36, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:19, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:28, 25 April 2026 (UTC) **#[[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:49, 26 April 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 13:29, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 17:15, 28 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:22, 29 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 08:05, 1 May 2026 (UTC) **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 17:19, 1 May 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 18:06, 1 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:10, 2 May 2026 (UTC) === Saturday 02 May 2026 === ''Hacking!'' * What: Learning and Creating LGBTQIA+ Knowledge and History in Milan (moved from 1 May 2026 due to [https://it.wikipedia.org/wiki/Festa_dei_lavoratori Labour Day]) ** Meeting point: voco Milan-Fiere Hotel lobby ** Meeting time: 15:00 ** Duration: ~3-4 hours (flexible, you can message us if you want to meet us earlier or later) ** Itinerary (flexible and subject to change, please feel free to add locations you'd like or recommend below): *** [https://www.libreriantigone.com/ Antigone - Libreria lgbtqia+], open 15:00–19:30 *** [https://www.instagram.com/leccomilano/ Leccomilano], open 17:00–02:00 ** Register your interest, using your signature (4 tildes): **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:24, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **#[[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) **#[[User:Suzanne Wood (WMDE)|Suzanne Wood (WMDE)]] ([[User talk:Suzanne Wood (WMDE)|talk]]) 21:51, 1 May 2026 (UTC) **#Adenisse (WMF) * What: [https://meta.wikimedia.org/wiki/Event:Hardware_tools_for_Wiki/Raspberry_JAM_at_Wikimedia_Hackathon_Milan_2026 Raspberry JAM] ** Meeting point: Space 5 ** Meeting time: 17:30 ** Duration:1 hour ** Itinerary: Register your interest, using your signature (4 tildes): # '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:58, 24 April 2026 (UTC) # [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but discovered too late) * What: Train Spotting near the Hotel ** Description: There is a railway line near the Hotel and many trains pass through there. Lets have some conversations tech related or related to trains or public transport outside while watching the railway line. ** Meeting point: Entrance of the Hotel, later you can find us at the fence next to the railway line ** Duration: 1 hour, you can join later and leave earlier ** Itinerary: Register your interest, using your signature (4 tildes): # --[[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 17:54, 1 May 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but unable to attend) * What: Historical Tram Experience ** Meeting point: Hotel lobby ** Meeting time: 19:45 (leaving at 20:15) ** Duration: 3.33 hours ** Itinerary: Arco della Pace, Monumentale Cemetry, Piazza Fontana, Piazza della Repubblica, Scala, Navigli , Darsena, Brera, Milano Arena, On tram karaoke ** '''Max 59 people''', register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:42, 10 April 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 21:58, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:11, 11 April 2026 (UTC) **# [[User:GChoi-WMF|GChoi-WMF]] ([[User talk:GChoi-WMF|talk]]) 20:54, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:42, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 08:51, 15 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 14:58, 15 April 2026 (UTC) **# [[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 15:28, 15 April 2026 (UTC) **# [[User:Lupamo Arnold|Lupamo]] ([[User talk:Lupamo Arnold|talk]]) 18:23, 17 April 2026 (UTC) **# [[User:MSzwarc-WMF|MSzwarc-WMF]] ([[User talk:MSzwarc-WMF|talk]]) 17:44, 18 April 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 08:36, 19 April 2026 (UTC) **# [[User:VriaA|VriaA]] ([[User talk:VriaA|talk]]) 04:22, 20 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 10:46, 20 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:50, 20 April 2026 (UTC) **# [[User:ErikaGuetti|ErikaGuetti]] **# [[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:58, 23 April 2026 (UTC) **# [[User:DTorsani-WMF|DTorsani-WMF]] ([[User talk:DTorsani-WMF|talk]]) 00:08, 24 April 2026 (UTC) **# [[User:SSingh (WMF)|SSingh (WMF)]] ([[User talk:SSingh (WMF)|talk]]) 00:48, 24 April 2026 (UTC) **# [[User:Danielyepezgarces|dyepezg]] ([[User talk:Danielyepezgarces|talk]]) 03:09, 24 April 2026 (UTC) **# [[User:SD0001|SD0001]] ([[User talk:SD0001|talk]]) 04:10, 24 April 2026 (UTC) **# [[User:Kaspo|Kaspo]] ([[User talk:Kaspo|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Manimaran96|Manimaran96]] ([[User talk:Manimaran96|talk]]) 07:54, 24 April 2026 (UTC) **# [[User:Silvan Heintze (WMDE)|Silvan Heintze (WMDE)]] ([[User talk:Silvan Heintze (WMDE)|talk]]) 08:00, 24 April 2026 (UTC) **# [[User:T Arrow|T Arrow]] ([[User talk:T Arrow|talk]]) 08:04, 24 April 2026 (UTC) **# [[User:Ollie Shotton (WMDE)|Ollie Shotton (WMDE)]] ([[User talk:Ollie Shotton (WMDE)|talk]]) (Ollie Hyde) **# [[User:Martyn Ranyard (WMDE)|Martyn Ranyard (WMDE)]] ([[User talk:Martyn Ranyard (WMDE)|talk]]) 08:09, 24 April 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 08:15, 24 April 2026 (UTC) **# [[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) (Neslihan Turan) **# [[User:Filippo Giunchedi|Filippo Giunchedi]] ([[User talk:Filippo Giunchedi|talk]]) 08:49, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:05, 24 April 2026 (UTC) **# [[User:FNegri-WMF|FNegri-WMF]] ([[User talk:FNegri-WMF|talk]]) 09:07, 24 April 2026 (UTC) **# [[User:Christoph Jauera (WMDE)|Christoph Jauera (WMDE)]] ([[User talk:Christoph Jauera (WMDE)|talk]]) 10:48, 24 April 2026 (UTC) **# [[User:GLavagetto (WMF)|GLavagetto (WMF)]] ([[User talk:GLavagetto (WMF)|talk]]) 13:50, 24 April 2026 (UTC) **# [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:53, 24 April 2026 (UTC) **# [[User:CGoubert-WMF|CGoubert-WMF]] ([[User talk:CGoubert-WMF|talk]]) 14:42, 24 April 2026 (UTC) **# '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:51, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:Mike Peel|Mike Peel]] ([[User talk:Mike Peel|talk]]) 20:45, 24 April 2026 (UTC) **# [[User:MAzevedo (WMF)|MAzevedo (WMF)]] ([[User talk:MAzevedo (WMF)|talk]]) 21:11, 24 April 2026 (UTC) **# [[User:KSoučková-WMF|KSoučková-WMF]] ([[User talk:KSoučková-WMF|talk]]) 21:24, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:18, 25 April 2026 (UTC) **# [[User:Shreya.Bhopal|Shreya.Bhopal]] ([[User talk:Shreya.Bhopal|talk]]) 07:52, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:29, 25 April 2026 (UTC) **# [[User:AChou-WMF|AChou-WMF]] ([[User talk:AChou-WMF|talk]]) 10:03, 25 April 2026 (UTC) **# [[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 17:20, 25 April 2026 (UTC) **# --[[User:Sannita (WMF)|Sannita (WMF)]] ([[User talk:Sannita (WMF)|talk]]) 18:02, 25 April 2026 (UTC) **# --[[User:Auregann|Auregann]] 18:02, 25 April 2026 (UTC) **# [[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:50, 26 April 2026 (UTC) **#[[User:Misaochan|Misaochan]] ([[User talk:Misaochan|talk]]) 16:11, 2 May 2026 (UTC) (note: user decided to cancel, then re-added herself) **# [[User:Gopavasanth|Gopa Vasanth]] ([[User talk:Gopavasanth|talk]]) 18:05, 26 April 2026 (UTC) **# [[User:Lahari20|Lahari20]] ([[User talk:Lahari20|talk]]) 18:11, 26 April 2026 (UTC) **# [[User:Dactylantha|Dactylantha]] ([[User talk:Dactylantha|talk]]) 21:29, 26 April 2026 (UTC) **# [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) **# [[User:Alchimista|Alchimista]] ([[User talk:Alchimista|talk]]) 07:36, 27 April 2026 (UTC) **# [[User:Chinmayee Mishra|Chinmayee Mishra]] ([[User talk:Chinmayee Mishra|talk]]) 12:17, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) asking nicely =) **#:'''From this point onward, participants are placed on the waiting list. Attendance will be confirmed only if spots become available.''' **# [[User:Lucas Werkmeister (WMDE)|Lucas Werkmeister (WMDE)]] ([[User talk:Lucas Werkmeister (WMDE)|talk]]) 14:09, 28 April 2026 (UTC) **# [[User:Lucas.Belo|Lucas.Belo]] ([[User talk:Lucas.Belo|talk]]) 21:34, 28 April 2026 (UTC) **# [[User:Seanleong8|Seanleong8]] ([[User talk:Seanleong8|talk]]) 10:34, 29 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:23, 29 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 13:39, 29 April 2026 (UTC) Thought I added myself here too :/ **# --[[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 14:45, 29 April 2026 (UTC) **# <span style="color:#d30000">☠</span>[[User:MarkAHershberger|MarkAHershberger]]<span style="color:#d30000">☢</span>([[User_talk:MarkAHershberger|talk]])<span style="color:#d30000">☣</span> 17:41, 29 April 2026 (UTC) **# <span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:40, 1 May 2026 (UTC) **# [[User:Nacaru|Nacaru]] ([[User talk:Nacaru|talk]]) 13:37, 1 May 2026 (UTC) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# User: Adenisse-WMF **# [[User:Jenny8lee|Jenny8lee]] ([[User talk:Jenny8lee|talk]]) 13:04, 2 May 2026 (UTC) **# [[User:Punith.nyk|Punith.nyk]] ([[User talk:Punith.nyk|talk]]) 11:29, 2 May 2026 (UTC) **#--[[User:Johannnes89|Johannnes89]] ([[User talk:Johannnes89|talk]]) 14:04, 2 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:09, 2 May 2026 (UTC) *What: [https://oooh.events/evento/holy-swing-night-02052026-biglietti/ Swing Dance] **Meeting point: [https://www.google.com/maps?cid=5018841184155524841 Spirit de Milan], Via Bovisasca, 59, 20157 Milano MI **Meeting time: Bicycle over from hotel at 21:30; live band starts at 22:30 **Duration: 3hr **Itinerary: Let's check out Milan's local [[w:swing dance|swing dance]]! The band "Lu Cicchitelli & The Associates" will be playing jazz music of the American [[w:big band|big band]]s of the 1930s/1940s at Spirit de Milan's "Holy Swing Night". There does not appear to be any newcomer lesson, so either prior social dance experience or an adventerous spirit is recommended. €15. **Register your interest, using your signature (4 tildes): **#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:38, 1 May 2026 (UTC) *What: '''Wikimedia Untappd Meetup''' ** Description: We share beers and stories. Some brought beer from their country, others bought beers here. Siebrand took care there's enough for those that didn't bring beer. Having a profile on Untappd is necessary, of course. If you don't bring beer, a contribution is expected. ** Meeting point: Floor 1 - lunch/dinner area. We will move to Siebrand's room as we're not allowed to consume non-hotel bought beverages in the public space in the hotel. ** Meeting time: 20:30. Contact siebrand at Telegram if you missed us. ** Duration: many hours hour, no mandatory attendance for the whole session ;) ** Max 12-15 people: **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:30, 1 May 2026 (UTC) **# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:39, 1 May 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:43, 1 May 2026 (UTC) **# 🍻 '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:45, 1 May 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 06:26, 2 May 2026 (UTC) **#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:09, 2 May 2026 (UTC) (will join after tram tour) **# [[User:the wub|the wub]] [[User_talk:The wub|<span style="color: #080;">"?!"</span>]] 07:20, 2 May 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) (will join after tram tour) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# [[User:Mohammed Abdulai (WMDE)|Mohammed Abdulai (WMDE)]] ([[User talk:Mohammed Abdulai (WMDE)|talk]]) 13:34, 2 May 2026 (UTC) **# [[User:Aude|Aude]] ([[User talk:Aude|talk]]) 15:05, 2 May 2026 (UTC) **# [[User:Ejegg|Ejegg]] ([[User talk:Ejegg|talk]]) 17:37, 2 May 2026 (UTC) **# [[User:Jon Harald Søby|Jon Harald Søby]] ([[User talk:Jon Harald Søby|talk]]) 15:56, 2 May 2026 (UTC) **# maybe [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) === Sunday 03 May 2026 === ''Hacking'' ''and closing ceremony!'' <u>Visit to downtown Milan</u>: Following the closing ceremony, shuttle buses will be provided so participants can visit downtown Milan. Shuttles will depart the venue at 17:30 and drop off participants [[:en:Piazza_del_Duomo,_Milan|near the Duomo]] (at [https://www.openstreetmap.org/node/9243018607 Piazza Fontana]), then return to the venue at 22:00. Participants are free to self-organize their visit in downtown Milan. What: '''Wikimedians Love Craft Beer@SNOB''' * Description: We share beers and stories at [https://snob-beer.it/ SNOB]. Once we are dropped off in the city, we will proceed to travel to the bar. They have 20 beers for 500/1000ml growlers and a few hundred different beers from all over. * Meeting point: With Siebrand and Sjoerd once the buses have brought us to the city center on Sunday. * Duration: SNOB closes at 22:00. * Max 15 people: *# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:38, 1 May 2026 (UTC) *# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:41, 1 May 2026 (UTC) *# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:42, 1 May 2026 (UTC) *# '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:46, 1 May 2026 (UTC) *#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:06, 2 May 2026 (UTC) *#[[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) *# ... What: '''Wikimedians visit Milan's Chinatown ([[:en:Chinatown, Milan|Quartiere Cinese]])''' <gallery mode="packed"> File:Milano, Chinatown 02.jpg File:Dopoguerra 1945 a Milano - Quartiere cinese.jpg File:Milano - Quartiere cinese nel 1945.jpg File:Milano - Quartiere cinese 1945.jpg </gallery> * Description: There are Chinatowns all over the world, and the [[:en:Chinatown, Milan | one in Milan]] is the largest in Italy, having been started in the 1920s from immigrants in Zhejiang province. Population in the tens of thousands! * Meeting point: With [[User:Runawaymo |Runawaymo]] and [[User:Jenny8lee |Jenny8lee]] once the buses drop us off. We will head to [[:en:Via Paolo Sarpi |Via Paolo Sarpi]] (about 20 minutes on public transit) Among the places there with good food are: ** [https://www.instagram.com/laravioleriasarpi/ Ravioleria Sarpi], the absolute institution with handmade "ravioli tradizionali cinesi" (dumplings) made with organic dough and jianbing. ** [https://www.instagram.com/ristorante_di_houjie/ Houjie], cuisine from [[:en:Rui'an|Rui’an]], Wenzhou at budget friendly prices. * Duration: Until we run out of things to eat. * Max 12 people: *# [[User:Runawaymo |Runawaymo]] *# [[User:Jenny8lee |Jenny8lee]] *# Seanleong8 *# $[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:43, 2 May 2026 (UTC) *# [[User:DLynch (WMF)|DLynch (WMF)]] ([[User talk:DLynch (WMF)|talk]]) *# [[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 04:09, 3 May 2026 (UTC) *# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 10:01, 3 May 2026 (UTC) *# [[User:DaxServer|DaxServer]] ([[User talk:DaxServer|talk]]) 13:58, 3 May 2026 (UTC) What: '''Modern art museums by bicycle''' *Meeting point: Hotel lobby *Meeting time: 16:00 *Duration: 16:00-19:30 *Itinerary: Let's bicycle around downtown and visit some modern art museums! Leaving via bikeshare right after the closing showcase. Planning to visit the {{w|Triennale di Milano}} and then the {{w|Museo del Novecento}}. *Register your interest, using your signature (4 tildes): *#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 13:01, 3 May 2026 (UTC) === Monday 04 May 2026 === ''Participants head home'' == Code of Conduct == The Wikimedia Hackathon will enforce the [[foundation:Policy:Universal_Code_of_Conduct|Universal Code of Conduct]], [[Code of Conduct]] for Wikimedia’s Technical Spaces, and the [[foundation:Policy:Friendly_space_policy|Friendly Space Policy]] across all facets of the event. This includes various platforms, discussion channels, and local meetups. Your adherence to these guidelines ensures a respectful and inclusive environment for all participants. '''We recommend all participants review these Trust & Safety policies prior to your arrival at the venue.''' Individuals not cooperating with these policies may be asked to leave the event. A dedicated team will be available on-site to help support a safer environment for all. If you have any questions or suggestions, feel free to use the [[Talk:Wikimedia Hackathon 2026|talk page]] or to reach out to hackathon@wikimedia.org. [[Category:Wikimedia Hackathon 2026]] 0awspgfrpct3sh7kvu90jdqnvk3sd2s 8364397 8364387 2026-05-03T14:14:04Z Jon Harald Søby 11183 /* Sunday 03 May 2026 */ 8364397 wikitext text/x-wiki __NOTALK__ <languages/> {{:Wikimedia Hackathon 2026/Header|page=2}} <div style="background: #F6F6F6; border-radius:10px; border:1px solid #A4A4A4; margin:5px 15px;"><div style="margin: 1em; color:#555;"><div style="font-size: 130%; font-family: Tahoma, sans-serif; text-align:left; line-height: 1.5;"> The Hackathon is participant-driven and gets its life from the active participation of its attendees. Below you will find some information on [[#How_to_contribute|how to contribute]] to the program as an attendee. Local communities are also welcome to organize pre-hackathon events, watch-parties or meetups in their region. More information about organization and funding is available on the [[Wikimedia_Hackathon_2026/Satellite_Events|satellite events]] page. </div>{{TOC|limit=3}}</div></div> {{Info|'''This year's hackathon will use the unconference format, with session lengths between 30 minutes and 60 minutes available.''' Add your proposed session to the "Proposed Unconference Sessions" [https://phabricator.wikimedia.org/project/view/8319/ column on the Hackathon 2026 workboard] with the <code>#Wikimedia-Hackathon-2026</code> tag. Then add your session title and name to the schedule! Please ensure you link to your Phabricator task so interested participants can see the full details. Be sure to follow the format listed in the [[#How to contribute]] section of this page. If you're interested in a particular session, please be sure to demonstrate your interest by subscribing to the task in Phabricator! }} {{:Wikimedia_Hackathon_2026/Program/Schedule}} == Room descriptions and capacity == Our main hacking spaces will be on the Floor 2 of the Voco Fiere Hotel Milan; the breakout rooms, quiet room, and the second hacking space (available Friday and Saturday afternoons) will be on Floor 1. '''Floor 2:''' * Main Space - general hacking and where the opening ceremony and closing showcase will happen ** Open from Friday: 09:00–02:00; Saturday: 07:00–02:00; Sunday: 07:00–17:00 * Foyer off Main Space - breaks, snacks and socializing '''Lobby level:''' * Event registration (on Thursday from 12:00–19:00; on Friday from 08:00–09:30) * Space for attendees to socialize and play games '''Floor 1:''' * Space 4 - Unconference sessions and hacking space ** Friday *** 10:45–13:00: Unconference sessions *** 13:00–23:00: Hacking ** Saturday *** 07:00–12:15: Unconference sessions *** 12:15–23:00: Hacking ** Sunday *** 07:00–14:00: Unconference sessions * Space 5 - Unconference sessions and games ** Friday *** 10:45–17:00: Unconference sessions *** 18:30–23:00: Tombola Night ** Saturday *** 07:00–17:00: Unconference sessions ** Sunday *** 07:00–14:00: Unconference sessions * Space 6 - Quiet space * Ristorante Betulla - Where lunch and dinner will be provided '''Room availability:''' * Our hacking rooms - The Main Space will be open until 14:00 on Friday and Saturday night; Space 4 will be open until 23:00. * Space 5 and Space 6 will be closed overnight starting at 18:00. * On Sunday, all rooms close at 17:00 == How to contribute == You can use the Phabricator templates [[phab:T415213|here]] to propose a project or sign up as a participant looking for a project '''Propose a session, workshop, or project''' * '''Proposed Projects -''' Hands-on skill development workshops on topics around the technology stack of Wikimedia projects. * '''Proposed Unconference Sessions -''' Sessions or workshops covering any of the [[:File:Wm technical areas.svg|Wikimedia technical areas]]. For any of the items listed above, use the [https://w.wiki/Kew5 proposal template]. Also, indicate in the task description if your proposed activity is newcomer-friendly. '''Get the word out''' * Add your name and interests - including things you can teach and things you want to learn about - to our participants page. * Email the organizers with any questions, we can help! '''Sign up as a participant''' If you want to work on something but you're not sure what, use the [https://w.wiki/KewC participant template] to let others know that you are looking for a project. If you're interested in a specific unconference session, you can indicate your interest by subscribing to the task. You can also add yourself to the ''Volunteer sign-ups'' column if you would like to help with small tasks involved with running the Hackathon. == How to conduct your session and/or workshop == Here are some tips: * We have a [https://docs.google.com/presentation/d/1019ZQltl-M5tsQ6tJz8UaWnTDG9-9MmF044-4IUQqHA/edit?usp=sharing Hackathon themed slide deck] with best practices and more; please make a copy and add the information for your session. * You can propose sessions as presentations, workshops, discussions, or any other format that suits your requirements. ** Feel free to host language- or community-specific sessions and/or meetups. * Session focus should be less on beginner-level workshops (unlike in some previous Hackathons), as this event brings together individuals who have already contributed to technical aspects of the Wikimedia projects. * If there isn't a dedicated space for your session, be prepared to run your session without a projector at a specific hackathon table in a quiet corner of one of the bigger rooms, in the foyer, or outside. * You are welcome to reach out to the event organizers to seek help to prepare, get feedback on your presentation, or any training support you might need a few weeks before the hackathon event. == Social gatherings and side events in Milan == === Format to use for your event === * What: * Meeting point: * Meeting time: * Duration: * Itinerary: * Register your interest, using your signature (4 tildes): === Thursday 30 April 2026 === ''Hackathon participants arrive'' === Friday 01 May 2026 === ''Hackathon kicks off!'' * What: Board games ** Meeting point: Space 5 ** Meeting time: 17:00 ** Duration: 17:00–20:30 ** '''max 6 people:''' Register your interest, using your signature (4 tildes): **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:45, 21 April 2026 (UTC) * What: Tombola night with cute prizes ** Meeting point: Space 5 ** Meeting time: 21:00 ** Duration: 21:00–23:00 ** '''3 rounds, max 48 people each:''' Register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:40, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:12, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:53, 20 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:42, 21 April 2026 (UTC) **#[[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:57, 23 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 01:35, 24 April 2026 (UTC) **# [[User:DaxServer|DaxServer]] ([[User talk:DaxServer|talk]]) 08:26, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:04, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:HCoplin-WMF|HCoplin-WMF]] ([[User talk:HCoplin-WMF|talk]]) 15:36, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:19, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:28, 25 April 2026 (UTC) **#[[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:49, 26 April 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 13:29, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 17:15, 28 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:22, 29 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 08:05, 1 May 2026 (UTC) **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 17:19, 1 May 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 18:06, 1 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:10, 2 May 2026 (UTC) === Saturday 02 May 2026 === ''Hacking!'' * What: Learning and Creating LGBTQIA+ Knowledge and History in Milan (moved from 1 May 2026 due to [https://it.wikipedia.org/wiki/Festa_dei_lavoratori Labour Day]) ** Meeting point: voco Milan-Fiere Hotel lobby ** Meeting time: 15:00 ** Duration: ~3-4 hours (flexible, you can message us if you want to meet us earlier or later) ** Itinerary (flexible and subject to change, please feel free to add locations you'd like or recommend below): *** [https://www.libreriantigone.com/ Antigone - Libreria lgbtqia+], open 15:00–19:30 *** [https://www.instagram.com/leccomilano/ Leccomilano], open 17:00–02:00 ** Register your interest, using your signature (4 tildes): **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:24, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **#[[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) **#[[User:Suzanne Wood (WMDE)|Suzanne Wood (WMDE)]] ([[User talk:Suzanne Wood (WMDE)|talk]]) 21:51, 1 May 2026 (UTC) **#Adenisse (WMF) * What: [https://meta.wikimedia.org/wiki/Event:Hardware_tools_for_Wiki/Raspberry_JAM_at_Wikimedia_Hackathon_Milan_2026 Raspberry JAM] ** Meeting point: Space 5 ** Meeting time: 17:30 ** Duration:1 hour ** Itinerary: Register your interest, using your signature (4 tildes): # '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:58, 24 April 2026 (UTC) # [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but discovered too late) * What: Train Spotting near the Hotel ** Description: There is a railway line near the Hotel and many trains pass through there. Lets have some conversations tech related or related to trains or public transport outside while watching the railway line. ** Meeting point: Entrance of the Hotel, later you can find us at the fence next to the railway line ** Duration: 1 hour, you can join later and leave earlier ** Itinerary: Register your interest, using your signature (4 tildes): # --[[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 17:54, 1 May 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but unable to attend) * What: Historical Tram Experience ** Meeting point: Hotel lobby ** Meeting time: 19:45 (leaving at 20:15) ** Duration: 3.33 hours ** Itinerary: Arco della Pace, Monumentale Cemetry, Piazza Fontana, Piazza della Repubblica, Scala, Navigli , Darsena, Brera, Milano Arena, On tram karaoke ** '''Max 59 people''', register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:42, 10 April 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 21:58, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:11, 11 April 2026 (UTC) **# [[User:GChoi-WMF|GChoi-WMF]] ([[User talk:GChoi-WMF|talk]]) 20:54, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:42, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 08:51, 15 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 14:58, 15 April 2026 (UTC) **# [[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 15:28, 15 April 2026 (UTC) **# [[User:Lupamo Arnold|Lupamo]] ([[User talk:Lupamo Arnold|talk]]) 18:23, 17 April 2026 (UTC) **# [[User:MSzwarc-WMF|MSzwarc-WMF]] ([[User talk:MSzwarc-WMF|talk]]) 17:44, 18 April 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 08:36, 19 April 2026 (UTC) **# [[User:VriaA|VriaA]] ([[User talk:VriaA|talk]]) 04:22, 20 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 10:46, 20 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:50, 20 April 2026 (UTC) **# [[User:ErikaGuetti|ErikaGuetti]] **# [[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:58, 23 April 2026 (UTC) **# [[User:DTorsani-WMF|DTorsani-WMF]] ([[User talk:DTorsani-WMF|talk]]) 00:08, 24 April 2026 (UTC) **# [[User:SSingh (WMF)|SSingh (WMF)]] ([[User talk:SSingh (WMF)|talk]]) 00:48, 24 April 2026 (UTC) **# [[User:Danielyepezgarces|dyepezg]] ([[User talk:Danielyepezgarces|talk]]) 03:09, 24 April 2026 (UTC) **# [[User:SD0001|SD0001]] ([[User talk:SD0001|talk]]) 04:10, 24 April 2026 (UTC) **# [[User:Kaspo|Kaspo]] ([[User talk:Kaspo|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Manimaran96|Manimaran96]] ([[User talk:Manimaran96|talk]]) 07:54, 24 April 2026 (UTC) **# [[User:Silvan Heintze (WMDE)|Silvan Heintze (WMDE)]] ([[User talk:Silvan Heintze (WMDE)|talk]]) 08:00, 24 April 2026 (UTC) **# [[User:T Arrow|T Arrow]] ([[User talk:T Arrow|talk]]) 08:04, 24 April 2026 (UTC) **# [[User:Ollie Shotton (WMDE)|Ollie Shotton (WMDE)]] ([[User talk:Ollie Shotton (WMDE)|talk]]) (Ollie Hyde) **# [[User:Martyn Ranyard (WMDE)|Martyn Ranyard (WMDE)]] ([[User talk:Martyn Ranyard (WMDE)|talk]]) 08:09, 24 April 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 08:15, 24 April 2026 (UTC) **# [[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) (Neslihan Turan) **# [[User:Filippo Giunchedi|Filippo Giunchedi]] ([[User talk:Filippo Giunchedi|talk]]) 08:49, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:05, 24 April 2026 (UTC) **# [[User:FNegri-WMF|FNegri-WMF]] ([[User talk:FNegri-WMF|talk]]) 09:07, 24 April 2026 (UTC) **# [[User:Christoph Jauera (WMDE)|Christoph Jauera (WMDE)]] ([[User talk:Christoph Jauera (WMDE)|talk]]) 10:48, 24 April 2026 (UTC) **# [[User:GLavagetto (WMF)|GLavagetto (WMF)]] ([[User talk:GLavagetto (WMF)|talk]]) 13:50, 24 April 2026 (UTC) **# [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:53, 24 April 2026 (UTC) **# [[User:CGoubert-WMF|CGoubert-WMF]] ([[User talk:CGoubert-WMF|talk]]) 14:42, 24 April 2026 (UTC) **# '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:51, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:Mike Peel|Mike Peel]] ([[User talk:Mike Peel|talk]]) 20:45, 24 April 2026 (UTC) **# [[User:MAzevedo (WMF)|MAzevedo (WMF)]] ([[User talk:MAzevedo (WMF)|talk]]) 21:11, 24 April 2026 (UTC) **# [[User:KSoučková-WMF|KSoučková-WMF]] ([[User talk:KSoučková-WMF|talk]]) 21:24, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:18, 25 April 2026 (UTC) **# [[User:Shreya.Bhopal|Shreya.Bhopal]] ([[User talk:Shreya.Bhopal|talk]]) 07:52, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:29, 25 April 2026 (UTC) **# [[User:AChou-WMF|AChou-WMF]] ([[User talk:AChou-WMF|talk]]) 10:03, 25 April 2026 (UTC) **# [[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 17:20, 25 April 2026 (UTC) **# --[[User:Sannita (WMF)|Sannita (WMF)]] ([[User talk:Sannita (WMF)|talk]]) 18:02, 25 April 2026 (UTC) **# --[[User:Auregann|Auregann]] 18:02, 25 April 2026 (UTC) **# [[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:50, 26 April 2026 (UTC) **#[[User:Misaochan|Misaochan]] ([[User talk:Misaochan|talk]]) 16:11, 2 May 2026 (UTC) (note: user decided to cancel, then re-added herself) **# [[User:Gopavasanth|Gopa Vasanth]] ([[User talk:Gopavasanth|talk]]) 18:05, 26 April 2026 (UTC) **# [[User:Lahari20|Lahari20]] ([[User talk:Lahari20|talk]]) 18:11, 26 April 2026 (UTC) **# [[User:Dactylantha|Dactylantha]] ([[User talk:Dactylantha|talk]]) 21:29, 26 April 2026 (UTC) **# [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) **# [[User:Alchimista|Alchimista]] ([[User talk:Alchimista|talk]]) 07:36, 27 April 2026 (UTC) **# [[User:Chinmayee Mishra|Chinmayee Mishra]] ([[User talk:Chinmayee Mishra|talk]]) 12:17, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) asking nicely =) **#:'''From this point onward, participants are placed on the waiting list. Attendance will be confirmed only if spots become available.''' **# [[User:Lucas Werkmeister (WMDE)|Lucas Werkmeister (WMDE)]] ([[User talk:Lucas Werkmeister (WMDE)|talk]]) 14:09, 28 April 2026 (UTC) **# [[User:Lucas.Belo|Lucas.Belo]] ([[User talk:Lucas.Belo|talk]]) 21:34, 28 April 2026 (UTC) **# [[User:Seanleong8|Seanleong8]] ([[User talk:Seanleong8|talk]]) 10:34, 29 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:23, 29 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 13:39, 29 April 2026 (UTC) Thought I added myself here too :/ **# --[[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 14:45, 29 April 2026 (UTC) **# <span style="color:#d30000">☠</span>[[User:MarkAHershberger|MarkAHershberger]]<span style="color:#d30000">☢</span>([[User_talk:MarkAHershberger|talk]])<span style="color:#d30000">☣</span> 17:41, 29 April 2026 (UTC) **# <span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:40, 1 May 2026 (UTC) **# [[User:Nacaru|Nacaru]] ([[User talk:Nacaru|talk]]) 13:37, 1 May 2026 (UTC) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# User: Adenisse-WMF **# [[User:Jenny8lee|Jenny8lee]] ([[User talk:Jenny8lee|talk]]) 13:04, 2 May 2026 (UTC) **# [[User:Punith.nyk|Punith.nyk]] ([[User talk:Punith.nyk|talk]]) 11:29, 2 May 2026 (UTC) **#--[[User:Johannnes89|Johannnes89]] ([[User talk:Johannnes89|talk]]) 14:04, 2 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:09, 2 May 2026 (UTC) *What: [https://oooh.events/evento/holy-swing-night-02052026-biglietti/ Swing Dance] **Meeting point: [https://www.google.com/maps?cid=5018841184155524841 Spirit de Milan], Via Bovisasca, 59, 20157 Milano MI **Meeting time: Bicycle over from hotel at 21:30; live band starts at 22:30 **Duration: 3hr **Itinerary: Let's check out Milan's local [[w:swing dance|swing dance]]! The band "Lu Cicchitelli & The Associates" will be playing jazz music of the American [[w:big band|big band]]s of the 1930s/1940s at Spirit de Milan's "Holy Swing Night". There does not appear to be any newcomer lesson, so either prior social dance experience or an adventerous spirit is recommended. €15. **Register your interest, using your signature (4 tildes): **#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:38, 1 May 2026 (UTC) *What: '''Wikimedia Untappd Meetup''' ** Description: We share beers and stories. Some brought beer from their country, others bought beers here. Siebrand took care there's enough for those that didn't bring beer. Having a profile on Untappd is necessary, of course. If you don't bring beer, a contribution is expected. ** Meeting point: Floor 1 - lunch/dinner area. We will move to Siebrand's room as we're not allowed to consume non-hotel bought beverages in the public space in the hotel. ** Meeting time: 20:30. Contact siebrand at Telegram if you missed us. ** Duration: many hours hour, no mandatory attendance for the whole session ;) ** Max 12-15 people: **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:30, 1 May 2026 (UTC) **# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:39, 1 May 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:43, 1 May 2026 (UTC) **# 🍻 '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:45, 1 May 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 06:26, 2 May 2026 (UTC) **#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:09, 2 May 2026 (UTC) (will join after tram tour) **# [[User:the wub|the wub]] [[User_talk:The wub|<span style="color: #080;">"?!"</span>]] 07:20, 2 May 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) (will join after tram tour) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# [[User:Mohammed Abdulai (WMDE)|Mohammed Abdulai (WMDE)]] ([[User talk:Mohammed Abdulai (WMDE)|talk]]) 13:34, 2 May 2026 (UTC) **# [[User:Aude|Aude]] ([[User talk:Aude|talk]]) 15:05, 2 May 2026 (UTC) **# [[User:Ejegg|Ejegg]] ([[User talk:Ejegg|talk]]) 17:37, 2 May 2026 (UTC) **# [[User:Jon Harald Søby|Jon Harald Søby]] ([[User talk:Jon Harald Søby|talk]]) 15:56, 2 May 2026 (UTC) **# maybe [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) === Sunday 03 May 2026 === ''Hacking'' ''and closing ceremony!'' <u>Visit to downtown Milan</u>: Following the closing ceremony, shuttle buses will be provided so participants can visit downtown Milan. Shuttles will depart the venue at 17:30 and drop off participants [[:en:Piazza_del_Duomo,_Milan|near the Duomo]] (at [https://www.openstreetmap.org/node/9243018607 Piazza Fontana]), then return to the venue at 22:00. Participants are free to self-organize their visit in downtown Milan. What: '''Wikimedians Love Craft Beer@SNOB''' * Description: We share beers and stories at [https://snob-beer.it/ SNOB]. Once we are dropped off in the city, we will proceed to travel to the bar. They have 20 beers for 500/1000ml growlers and a few hundred different beers from all over. * Meeting point: With Siebrand and Sjoerd once the buses have brought us to the city center on Sunday. * Duration: SNOB closes at 22:00. * Max 15 people: *# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:38, 1 May 2026 (UTC) *# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:41, 1 May 2026 (UTC) *# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:42, 1 May 2026 (UTC) *# '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:46, 1 May 2026 (UTC) *#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:06, 2 May 2026 (UTC) *#[[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) *# [[User:Jon Harald Søby|Jon Harald Søby]] ([[User talk:Jon Harald Søby|talk]]) 14:13, 3 May 2026 (UTC) *# ... What: '''Wikimedians visit Milan's Chinatown ([[:en:Chinatown, Milan|Quartiere Cinese]])''' <gallery mode="packed"> File:Milano, Chinatown 02.jpg File:Dopoguerra 1945 a Milano - Quartiere cinese.jpg File:Milano - Quartiere cinese nel 1945.jpg File:Milano - Quartiere cinese 1945.jpg </gallery> * Description: There are Chinatowns all over the world, and the [[:en:Chinatown, Milan | one in Milan]] is the largest in Italy, having been started in the 1920s from immigrants in Zhejiang province. Population in the tens of thousands! * Meeting point: With [[User:Runawaymo |Runawaymo]] and [[User:Jenny8lee |Jenny8lee]] once the buses drop us off. We will head to [[:en:Via Paolo Sarpi |Via Paolo Sarpi]] (about 20 minutes on public transit) Among the places there with good food are: ** [https://www.instagram.com/laravioleriasarpi/ Ravioleria Sarpi], the absolute institution with handmade "ravioli tradizionali cinesi" (dumplings) made with organic dough and jianbing. ** [https://www.instagram.com/ristorante_di_houjie/ Houjie], cuisine from [[:en:Rui'an|Rui’an]], Wenzhou at budget friendly prices. * Duration: Until we run out of things to eat. * Max 12 people: *# [[User:Runawaymo |Runawaymo]] *# [[User:Jenny8lee |Jenny8lee]] *# Seanleong8 *# $[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:43, 2 May 2026 (UTC) *# [[User:DLynch (WMF)|DLynch (WMF)]] ([[User talk:DLynch (WMF)|talk]]) *# [[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 04:09, 3 May 2026 (UTC) *# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 10:01, 3 May 2026 (UTC) *# [[User:DaxServer|DaxServer]] ([[User talk:DaxServer|talk]]) 13:58, 3 May 2026 (UTC) What: '''Modern art museums by bicycle''' *Meeting point: Hotel lobby *Meeting time: 16:00 *Duration: 16:00-19:30 *Itinerary: Let's bicycle around downtown and visit some modern art museums! Leaving via bikeshare right after the closing showcase. Planning to visit the {{w|Triennale di Milano}} and then the {{w|Museo del Novecento}}. *Register your interest, using your signature (4 tildes): *#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 13:01, 3 May 2026 (UTC) === Monday 04 May 2026 === ''Participants head home'' == Code of Conduct == The Wikimedia Hackathon will enforce the [[foundation:Policy:Universal_Code_of_Conduct|Universal Code of Conduct]], [[Code of Conduct]] for Wikimedia’s Technical Spaces, and the [[foundation:Policy:Friendly_space_policy|Friendly Space Policy]] across all facets of the event. This includes various platforms, discussion channels, and local meetups. Your adherence to these guidelines ensures a respectful and inclusive environment for all participants. '''We recommend all participants review these Trust & Safety policies prior to your arrival at the venue.''' Individuals not cooperating with these policies may be asked to leave the event. A dedicated team will be available on-site to help support a safer environment for all. If you have any questions or suggestions, feel free to use the [[Talk:Wikimedia Hackathon 2026|talk page]] or to reach out to hackathon@wikimedia.org. [[Category:Wikimedia Hackathon 2026]] b1utp95sqcp2ghlyexkicrsl9thtd6t 8364398 8364397 2026-05-03T14:24:35Z Super nabla 15627287 /* Sunday 03 May 2026 */ 8364398 wikitext text/x-wiki __NOTALK__ <languages/> {{:Wikimedia Hackathon 2026/Header|page=2}} <div style="background: #F6F6F6; border-radius:10px; border:1px solid #A4A4A4; margin:5px 15px;"><div style="margin: 1em; color:#555;"><div style="font-size: 130%; font-family: Tahoma, sans-serif; text-align:left; line-height: 1.5;"> The Hackathon is participant-driven and gets its life from the active participation of its attendees. Below you will find some information on [[#How_to_contribute|how to contribute]] to the program as an attendee. Local communities are also welcome to organize pre-hackathon events, watch-parties or meetups in their region. More information about organization and funding is available on the [[Wikimedia_Hackathon_2026/Satellite_Events|satellite events]] page. </div>{{TOC|limit=3}}</div></div> {{Info|'''This year's hackathon will use the unconference format, with session lengths between 30 minutes and 60 minutes available.''' Add your proposed session to the "Proposed Unconference Sessions" [https://phabricator.wikimedia.org/project/view/8319/ column on the Hackathon 2026 workboard] with the <code>#Wikimedia-Hackathon-2026</code> tag. Then add your session title and name to the schedule! Please ensure you link to your Phabricator task so interested participants can see the full details. Be sure to follow the format listed in the [[#How to contribute]] section of this page. If you're interested in a particular session, please be sure to demonstrate your interest by subscribing to the task in Phabricator! }} {{:Wikimedia_Hackathon_2026/Program/Schedule}} == Room descriptions and capacity == Our main hacking spaces will be on the Floor 2 of the Voco Fiere Hotel Milan; the breakout rooms, quiet room, and the second hacking space (available Friday and Saturday afternoons) will be on Floor 1. '''Floor 2:''' * Main Space - general hacking and where the opening ceremony and closing showcase will happen ** Open from Friday: 09:00–02:00; Saturday: 07:00–02:00; Sunday: 07:00–17:00 * Foyer off Main Space - breaks, snacks and socializing '''Lobby level:''' * Event registration (on Thursday from 12:00–19:00; on Friday from 08:00–09:30) * Space for attendees to socialize and play games '''Floor 1:''' * Space 4 - Unconference sessions and hacking space ** Friday *** 10:45–13:00: Unconference sessions *** 13:00–23:00: Hacking ** Saturday *** 07:00–12:15: Unconference sessions *** 12:15–23:00: Hacking ** Sunday *** 07:00–14:00: Unconference sessions * Space 5 - Unconference sessions and games ** Friday *** 10:45–17:00: Unconference sessions *** 18:30–23:00: Tombola Night ** Saturday *** 07:00–17:00: Unconference sessions ** Sunday *** 07:00–14:00: Unconference sessions * Space 6 - Quiet space * Ristorante Betulla - Where lunch and dinner will be provided '''Room availability:''' * Our hacking rooms - The Main Space will be open until 14:00 on Friday and Saturday night; Space 4 will be open until 23:00. * Space 5 and Space 6 will be closed overnight starting at 18:00. * On Sunday, all rooms close at 17:00 == How to contribute == You can use the Phabricator templates [[phab:T415213|here]] to propose a project or sign up as a participant looking for a project '''Propose a session, workshop, or project''' * '''Proposed Projects -''' Hands-on skill development workshops on topics around the technology stack of Wikimedia projects. * '''Proposed Unconference Sessions -''' Sessions or workshops covering any of the [[:File:Wm technical areas.svg|Wikimedia technical areas]]. For any of the items listed above, use the [https://w.wiki/Kew5 proposal template]. Also, indicate in the task description if your proposed activity is newcomer-friendly. '''Get the word out''' * Add your name and interests - including things you can teach and things you want to learn about - to our participants page. * Email the organizers with any questions, we can help! '''Sign up as a participant''' If you want to work on something but you're not sure what, use the [https://w.wiki/KewC participant template] to let others know that you are looking for a project. If you're interested in a specific unconference session, you can indicate your interest by subscribing to the task. You can also add yourself to the ''Volunteer sign-ups'' column if you would like to help with small tasks involved with running the Hackathon. == How to conduct your session and/or workshop == Here are some tips: * We have a [https://docs.google.com/presentation/d/1019ZQltl-M5tsQ6tJz8UaWnTDG9-9MmF044-4IUQqHA/edit?usp=sharing Hackathon themed slide deck] with best practices and more; please make a copy and add the information for your session. * You can propose sessions as presentations, workshops, discussions, or any other format that suits your requirements. ** Feel free to host language- or community-specific sessions and/or meetups. * Session focus should be less on beginner-level workshops (unlike in some previous Hackathons), as this event brings together individuals who have already contributed to technical aspects of the Wikimedia projects. * If there isn't a dedicated space for your session, be prepared to run your session without a projector at a specific hackathon table in a quiet corner of one of the bigger rooms, in the foyer, or outside. * You are welcome to reach out to the event organizers to seek help to prepare, get feedback on your presentation, or any training support you might need a few weeks before the hackathon event. == Social gatherings and side events in Milan == === Format to use for your event === * What: * Meeting point: * Meeting time: * Duration: * Itinerary: * Register your interest, using your signature (4 tildes): === Thursday 30 April 2026 === ''Hackathon participants arrive'' === Friday 01 May 2026 === ''Hackathon kicks off!'' * What: Board games ** Meeting point: Space 5 ** Meeting time: 17:00 ** Duration: 17:00–20:30 ** '''max 6 people:''' Register your interest, using your signature (4 tildes): **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:45, 21 April 2026 (UTC) * What: Tombola night with cute prizes ** Meeting point: Space 5 ** Meeting time: 21:00 ** Duration: 21:00–23:00 ** '''3 rounds, max 48 people each:''' Register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:40, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:12, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:53, 20 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:42, 21 April 2026 (UTC) **#[[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:57, 23 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 01:35, 24 April 2026 (UTC) **# [[User:DaxServer|DaxServer]] ([[User talk:DaxServer|talk]]) 08:26, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:04, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:HCoplin-WMF|HCoplin-WMF]] ([[User talk:HCoplin-WMF|talk]]) 15:36, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:19, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:28, 25 April 2026 (UTC) **#[[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:49, 26 April 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 13:29, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 17:15, 28 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:22, 29 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 08:05, 1 May 2026 (UTC) **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 17:19, 1 May 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 18:06, 1 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:10, 2 May 2026 (UTC) === Saturday 02 May 2026 === ''Hacking!'' * What: Learning and Creating LGBTQIA+ Knowledge and History in Milan (moved from 1 May 2026 due to [https://it.wikipedia.org/wiki/Festa_dei_lavoratori Labour Day]) ** Meeting point: voco Milan-Fiere Hotel lobby ** Meeting time: 15:00 ** Duration: ~3-4 hours (flexible, you can message us if you want to meet us earlier or later) ** Itinerary (flexible and subject to change, please feel free to add locations you'd like or recommend below): *** [https://www.libreriantigone.com/ Antigone - Libreria lgbtqia+], open 15:00–19:30 *** [https://www.instagram.com/leccomilano/ Leccomilano], open 17:00–02:00 ** Register your interest, using your signature (4 tildes): **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:24, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **#[[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) **#[[User:Suzanne Wood (WMDE)|Suzanne Wood (WMDE)]] ([[User talk:Suzanne Wood (WMDE)|talk]]) 21:51, 1 May 2026 (UTC) **#Adenisse (WMF) * What: [https://meta.wikimedia.org/wiki/Event:Hardware_tools_for_Wiki/Raspberry_JAM_at_Wikimedia_Hackathon_Milan_2026 Raspberry JAM] ** Meeting point: Space 5 ** Meeting time: 17:30 ** Duration:1 hour ** Itinerary: Register your interest, using your signature (4 tildes): # '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:58, 24 April 2026 (UTC) # [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but discovered too late) * What: Train Spotting near the Hotel ** Description: There is a railway line near the Hotel and many trains pass through there. Lets have some conversations tech related or related to trains or public transport outside while watching the railway line. ** Meeting point: Entrance of the Hotel, later you can find us at the fence next to the railway line ** Duration: 1 hour, you can join later and leave earlier ** Itinerary: Register your interest, using your signature (4 tildes): # --[[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 17:54, 1 May 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but unable to attend) * What: Historical Tram Experience ** Meeting point: Hotel lobby ** Meeting time: 19:45 (leaving at 20:15) ** Duration: 3.33 hours ** Itinerary: Arco della Pace, Monumentale Cemetry, Piazza Fontana, Piazza della Repubblica, Scala, Navigli , Darsena, Brera, Milano Arena, On tram karaoke ** '''Max 59 people''', register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:42, 10 April 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 21:58, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:11, 11 April 2026 (UTC) **# [[User:GChoi-WMF|GChoi-WMF]] ([[User talk:GChoi-WMF|talk]]) 20:54, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:42, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 08:51, 15 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 14:58, 15 April 2026 (UTC) **# [[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 15:28, 15 April 2026 (UTC) **# [[User:Lupamo Arnold|Lupamo]] ([[User talk:Lupamo Arnold|talk]]) 18:23, 17 April 2026 (UTC) **# [[User:MSzwarc-WMF|MSzwarc-WMF]] ([[User talk:MSzwarc-WMF|talk]]) 17:44, 18 April 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 08:36, 19 April 2026 (UTC) **# [[User:VriaA|VriaA]] ([[User talk:VriaA|talk]]) 04:22, 20 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 10:46, 20 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:50, 20 April 2026 (UTC) **# [[User:ErikaGuetti|ErikaGuetti]] **# [[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:58, 23 April 2026 (UTC) **# [[User:DTorsani-WMF|DTorsani-WMF]] ([[User talk:DTorsani-WMF|talk]]) 00:08, 24 April 2026 (UTC) **# [[User:SSingh (WMF)|SSingh (WMF)]] ([[User talk:SSingh (WMF)|talk]]) 00:48, 24 April 2026 (UTC) **# [[User:Danielyepezgarces|dyepezg]] ([[User talk:Danielyepezgarces|talk]]) 03:09, 24 April 2026 (UTC) **# [[User:SD0001|SD0001]] ([[User talk:SD0001|talk]]) 04:10, 24 April 2026 (UTC) **# [[User:Kaspo|Kaspo]] ([[User talk:Kaspo|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Manimaran96|Manimaran96]] ([[User talk:Manimaran96|talk]]) 07:54, 24 April 2026 (UTC) **# [[User:Silvan Heintze (WMDE)|Silvan Heintze (WMDE)]] ([[User talk:Silvan Heintze (WMDE)|talk]]) 08:00, 24 April 2026 (UTC) **# [[User:T Arrow|T Arrow]] ([[User talk:T Arrow|talk]]) 08:04, 24 April 2026 (UTC) **# [[User:Ollie Shotton (WMDE)|Ollie Shotton (WMDE)]] ([[User talk:Ollie Shotton (WMDE)|talk]]) (Ollie Hyde) **# [[User:Martyn Ranyard (WMDE)|Martyn Ranyard (WMDE)]] ([[User talk:Martyn Ranyard (WMDE)|talk]]) 08:09, 24 April 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 08:15, 24 April 2026 (UTC) **# [[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) (Neslihan Turan) **# [[User:Filippo Giunchedi|Filippo Giunchedi]] ([[User talk:Filippo Giunchedi|talk]]) 08:49, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:05, 24 April 2026 (UTC) **# [[User:FNegri-WMF|FNegri-WMF]] ([[User talk:FNegri-WMF|talk]]) 09:07, 24 April 2026 (UTC) **# [[User:Christoph Jauera (WMDE)|Christoph Jauera (WMDE)]] ([[User talk:Christoph Jauera (WMDE)|talk]]) 10:48, 24 April 2026 (UTC) **# [[User:GLavagetto (WMF)|GLavagetto (WMF)]] ([[User talk:GLavagetto (WMF)|talk]]) 13:50, 24 April 2026 (UTC) **# [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:53, 24 April 2026 (UTC) **# [[User:CGoubert-WMF|CGoubert-WMF]] ([[User talk:CGoubert-WMF|talk]]) 14:42, 24 April 2026 (UTC) **# '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:51, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:Mike Peel|Mike Peel]] ([[User talk:Mike Peel|talk]]) 20:45, 24 April 2026 (UTC) **# [[User:MAzevedo (WMF)|MAzevedo (WMF)]] ([[User talk:MAzevedo (WMF)|talk]]) 21:11, 24 April 2026 (UTC) **# [[User:KSoučková-WMF|KSoučková-WMF]] ([[User talk:KSoučková-WMF|talk]]) 21:24, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:18, 25 April 2026 (UTC) **# [[User:Shreya.Bhopal|Shreya.Bhopal]] ([[User talk:Shreya.Bhopal|talk]]) 07:52, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:29, 25 April 2026 (UTC) **# [[User:AChou-WMF|AChou-WMF]] ([[User talk:AChou-WMF|talk]]) 10:03, 25 April 2026 (UTC) **# [[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 17:20, 25 April 2026 (UTC) **# --[[User:Sannita (WMF)|Sannita (WMF)]] ([[User talk:Sannita (WMF)|talk]]) 18:02, 25 April 2026 (UTC) **# --[[User:Auregann|Auregann]] 18:02, 25 April 2026 (UTC) **# [[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:50, 26 April 2026 (UTC) **#[[User:Misaochan|Misaochan]] ([[User talk:Misaochan|talk]]) 16:11, 2 May 2026 (UTC) (note: user decided to cancel, then re-added herself) **# [[User:Gopavasanth|Gopa Vasanth]] ([[User talk:Gopavasanth|talk]]) 18:05, 26 April 2026 (UTC) **# [[User:Lahari20|Lahari20]] ([[User talk:Lahari20|talk]]) 18:11, 26 April 2026 (UTC) **# [[User:Dactylantha|Dactylantha]] ([[User talk:Dactylantha|talk]]) 21:29, 26 April 2026 (UTC) **# [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) **# [[User:Alchimista|Alchimista]] ([[User talk:Alchimista|talk]]) 07:36, 27 April 2026 (UTC) **# [[User:Chinmayee Mishra|Chinmayee Mishra]] ([[User talk:Chinmayee Mishra|talk]]) 12:17, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) asking nicely =) **#:'''From this point onward, participants are placed on the waiting list. Attendance will be confirmed only if spots become available.''' **# [[User:Lucas Werkmeister (WMDE)|Lucas Werkmeister (WMDE)]] ([[User talk:Lucas Werkmeister (WMDE)|talk]]) 14:09, 28 April 2026 (UTC) **# [[User:Lucas.Belo|Lucas.Belo]] ([[User talk:Lucas.Belo|talk]]) 21:34, 28 April 2026 (UTC) **# [[User:Seanleong8|Seanleong8]] ([[User talk:Seanleong8|talk]]) 10:34, 29 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:23, 29 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 13:39, 29 April 2026 (UTC) Thought I added myself here too :/ **# --[[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 14:45, 29 April 2026 (UTC) **# <span style="color:#d30000">☠</span>[[User:MarkAHershberger|MarkAHershberger]]<span style="color:#d30000">☢</span>([[User_talk:MarkAHershberger|talk]])<span style="color:#d30000">☣</span> 17:41, 29 April 2026 (UTC) **# <span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:40, 1 May 2026 (UTC) **# [[User:Nacaru|Nacaru]] ([[User talk:Nacaru|talk]]) 13:37, 1 May 2026 (UTC) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# User: Adenisse-WMF **# [[User:Jenny8lee|Jenny8lee]] ([[User talk:Jenny8lee|talk]]) 13:04, 2 May 2026 (UTC) **# [[User:Punith.nyk|Punith.nyk]] ([[User talk:Punith.nyk|talk]]) 11:29, 2 May 2026 (UTC) **#--[[User:Johannnes89|Johannnes89]] ([[User talk:Johannnes89|talk]]) 14:04, 2 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:09, 2 May 2026 (UTC) *What: [https://oooh.events/evento/holy-swing-night-02052026-biglietti/ Swing Dance] **Meeting point: [https://www.google.com/maps?cid=5018841184155524841 Spirit de Milan], Via Bovisasca, 59, 20157 Milano MI **Meeting time: Bicycle over from hotel at 21:30; live band starts at 22:30 **Duration: 3hr **Itinerary: Let's check out Milan's local [[w:swing dance|swing dance]]! The band "Lu Cicchitelli & The Associates" will be playing jazz music of the American [[w:big band|big band]]s of the 1930s/1940s at Spirit de Milan's "Holy Swing Night". There does not appear to be any newcomer lesson, so either prior social dance experience or an adventerous spirit is recommended. €15. **Register your interest, using your signature (4 tildes): **#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:38, 1 May 2026 (UTC) *What: '''Wikimedia Untappd Meetup''' ** Description: We share beers and stories. Some brought beer from their country, others bought beers here. Siebrand took care there's enough for those that didn't bring beer. Having a profile on Untappd is necessary, of course. If you don't bring beer, a contribution is expected. ** Meeting point: Floor 1 - lunch/dinner area. We will move to Siebrand's room as we're not allowed to consume non-hotel bought beverages in the public space in the hotel. ** Meeting time: 20:30. Contact siebrand at Telegram if you missed us. ** Duration: many hours hour, no mandatory attendance for the whole session ;) ** Max 12-15 people: **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:30, 1 May 2026 (UTC) **# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:39, 1 May 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:43, 1 May 2026 (UTC) **# 🍻 '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:45, 1 May 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 06:26, 2 May 2026 (UTC) **#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:09, 2 May 2026 (UTC) (will join after tram tour) **# [[User:the wub|the wub]] [[User_talk:The wub|<span style="color: #080;">"?!"</span>]] 07:20, 2 May 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) (will join after tram tour) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# [[User:Mohammed Abdulai (WMDE)|Mohammed Abdulai (WMDE)]] ([[User talk:Mohammed Abdulai (WMDE)|talk]]) 13:34, 2 May 2026 (UTC) **# [[User:Aude|Aude]] ([[User talk:Aude|talk]]) 15:05, 2 May 2026 (UTC) **# [[User:Ejegg|Ejegg]] ([[User talk:Ejegg|talk]]) 17:37, 2 May 2026 (UTC) **# [[User:Jon Harald Søby|Jon Harald Søby]] ([[User talk:Jon Harald Søby|talk]]) 15:56, 2 May 2026 (UTC) **# maybe [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) === Sunday 03 May 2026 === ''Hacking'' ''and closing ceremony!'' <u>Visit to downtown Milan</u>: Following the closing ceremony, shuttle buses will be provided so participants can visit downtown Milan. Shuttles will depart the venue at 17:30 and drop off participants [[:en:Piazza_del_Duomo,_Milan|near the Duomo]] (at [https://www.openstreetmap.org/node/9243018607 Piazza Fontana]), then return to the venue at 22:00. Participants are free to self-organize their visit in downtown Milan. What: '''Wikimedians Love Craft Beer@SNOB''' * Description: We share beers and stories at [https://snob-beer.it/ SNOB]. Once we are dropped off in the city, we will proceed to travel to the bar. They have 20 beers for 500/1000ml growlers and a few hundred different beers from all over. * Meeting point: With Siebrand and Sjoerd once the buses have brought us to the city center on Sunday. * Duration: SNOB closes at 22:00. * Max 15 people: *# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:38, 1 May 2026 (UTC) *# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:41, 1 May 2026 (UTC) *# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:42, 1 May 2026 (UTC) *# '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:46, 1 May 2026 (UTC) *#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:06, 2 May 2026 (UTC) *#[[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) *# [[User:Jon Harald Søby|Jon Harald Søby]] ([[User talk:Jon Harald Søby|talk]]) 14:13, 3 May 2026 (UTC) *# —<span style="font-family:Kristen ITC, serif;margin:0 .3em">[[user:super nabla|super nabla]]</span>([[user talk:super nabla|🪰 msg]]) 14:24, 3 May 2026 (UTC) *# ... What: '''Wikimedians visit Milan's Chinatown ([[:en:Chinatown, Milan|Quartiere Cinese]])''' <gallery mode="packed"> File:Milano, Chinatown 02.jpg File:Dopoguerra 1945 a Milano - Quartiere cinese.jpg File:Milano - Quartiere cinese nel 1945.jpg File:Milano - Quartiere cinese 1945.jpg </gallery> * Description: There are Chinatowns all over the world, and the [[:en:Chinatown, Milan | one in Milan]] is the largest in Italy, having been started in the 1920s from immigrants in Zhejiang province. Population in the tens of thousands! * Meeting point: With [[User:Runawaymo |Runawaymo]] and [[User:Jenny8lee |Jenny8lee]] once the buses drop us off. We will head to [[:en:Via Paolo Sarpi |Via Paolo Sarpi]] (about 20 minutes on public transit) Among the places there with good food are: ** [https://www.instagram.com/laravioleriasarpi/ Ravioleria Sarpi], the absolute institution with handmade "ravioli tradizionali cinesi" (dumplings) made with organic dough and jianbing. ** [https://www.instagram.com/ristorante_di_houjie/ Houjie], cuisine from [[:en:Rui'an|Rui’an]], Wenzhou at budget friendly prices. * Duration: Until we run out of things to eat. * Max 12 people: *# [[User:Runawaymo |Runawaymo]] *# [[User:Jenny8lee |Jenny8lee]] *# Seanleong8 *# $[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:43, 2 May 2026 (UTC) *# [[User:DLynch (WMF)|DLynch (WMF)]] ([[User talk:DLynch (WMF)|talk]]) *# [[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 04:09, 3 May 2026 (UTC) *# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 10:01, 3 May 2026 (UTC) *# [[User:DaxServer|DaxServer]] ([[User talk:DaxServer|talk]]) 13:58, 3 May 2026 (UTC) What: '''Modern art museums by bicycle''' *Meeting point: Hotel lobby *Meeting time: 16:00 *Duration: 16:00-19:30 *Itinerary: Let's bicycle around downtown and visit some modern art museums! Leaving via bikeshare right after the closing showcase. Planning to visit the {{w|Triennale di Milano}} and then the {{w|Museo del Novecento}}. *Register your interest, using your signature (4 tildes): *#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 13:01, 3 May 2026 (UTC) === Monday 04 May 2026 === ''Participants head home'' == Code of Conduct == The Wikimedia Hackathon will enforce the [[foundation:Policy:Universal_Code_of_Conduct|Universal Code of Conduct]], [[Code of Conduct]] for Wikimedia’s Technical Spaces, and the [[foundation:Policy:Friendly_space_policy|Friendly Space Policy]] across all facets of the event. This includes various platforms, discussion channels, and local meetups. Your adherence to these guidelines ensures a respectful and inclusive environment for all participants. '''We recommend all participants review these Trust & Safety policies prior to your arrival at the venue.''' Individuals not cooperating with these policies may be asked to leave the event. A dedicated team will be available on-site to help support a safer environment for all. If you have any questions or suggestions, feel free to use the [[Talk:Wikimedia Hackathon 2026|talk page]] or to reach out to hackathon@wikimedia.org. [[Category:Wikimedia Hackathon 2026]] srf71hmtkcq5yf0ombgg4m8s0mhi1pr 8364460 8364398 2026-05-03T15:46:06Z Jeremyb 18834 /* Sunday 03 May 2026 */ fix 8364460 wikitext text/x-wiki __NOTALK__ <languages/> {{:Wikimedia Hackathon 2026/Header|page=2}} <div style="background: #F6F6F6; border-radius:10px; border:1px solid #A4A4A4; margin:5px 15px;"><div style="margin: 1em; color:#555;"><div style="font-size: 130%; font-family: Tahoma, sans-serif; text-align:left; line-height: 1.5;"> The Hackathon is participant-driven and gets its life from the active participation of its attendees. Below you will find some information on [[#How_to_contribute|how to contribute]] to the program as an attendee. Local communities are also welcome to organize pre-hackathon events, watch-parties or meetups in their region. More information about organization and funding is available on the [[Wikimedia_Hackathon_2026/Satellite_Events|satellite events]] page. </div>{{TOC|limit=3}}</div></div> {{Info|'''This year's hackathon will use the unconference format, with session lengths between 30 minutes and 60 minutes available.''' Add your proposed session to the "Proposed Unconference Sessions" [https://phabricator.wikimedia.org/project/view/8319/ column on the Hackathon 2026 workboard] with the <code>#Wikimedia-Hackathon-2026</code> tag. Then add your session title and name to the schedule! Please ensure you link to your Phabricator task so interested participants can see the full details. Be sure to follow the format listed in the [[#How to contribute]] section of this page. If you're interested in a particular session, please be sure to demonstrate your interest by subscribing to the task in Phabricator! }} {{:Wikimedia_Hackathon_2026/Program/Schedule}} == Room descriptions and capacity == Our main hacking spaces will be on the Floor 2 of the Voco Fiere Hotel Milan; the breakout rooms, quiet room, and the second hacking space (available Friday and Saturday afternoons) will be on Floor 1. '''Floor 2:''' * Main Space - general hacking and where the opening ceremony and closing showcase will happen ** Open from Friday: 09:00–02:00; Saturday: 07:00–02:00; Sunday: 07:00–17:00 * Foyer off Main Space - breaks, snacks and socializing '''Lobby level:''' * Event registration (on Thursday from 12:00–19:00; on Friday from 08:00–09:30) * Space for attendees to socialize and play games '''Floor 1:''' * Space 4 - Unconference sessions and hacking space ** Friday *** 10:45–13:00: Unconference sessions *** 13:00–23:00: Hacking ** Saturday *** 07:00–12:15: Unconference sessions *** 12:15–23:00: Hacking ** Sunday *** 07:00–14:00: Unconference sessions * Space 5 - Unconference sessions and games ** Friday *** 10:45–17:00: Unconference sessions *** 18:30–23:00: Tombola Night ** Saturday *** 07:00–17:00: Unconference sessions ** Sunday *** 07:00–14:00: Unconference sessions * Space 6 - Quiet space * Ristorante Betulla - Where lunch and dinner will be provided '''Room availability:''' * Our hacking rooms - The Main Space will be open until 14:00 on Friday and Saturday night; Space 4 will be open until 23:00. * Space 5 and Space 6 will be closed overnight starting at 18:00. * On Sunday, all rooms close at 17:00 == How to contribute == You can use the Phabricator templates [[phab:T415213|here]] to propose a project or sign up as a participant looking for a project '''Propose a session, workshop, or project''' * '''Proposed Projects -''' Hands-on skill development workshops on topics around the technology stack of Wikimedia projects. * '''Proposed Unconference Sessions -''' Sessions or workshops covering any of the [[:File:Wm technical areas.svg|Wikimedia technical areas]]. For any of the items listed above, use the [https://w.wiki/Kew5 proposal template]. Also, indicate in the task description if your proposed activity is newcomer-friendly. '''Get the word out''' * Add your name and interests - including things you can teach and things you want to learn about - to our participants page. * Email the organizers with any questions, we can help! '''Sign up as a participant''' If you want to work on something but you're not sure what, use the [https://w.wiki/KewC participant template] to let others know that you are looking for a project. If you're interested in a specific unconference session, you can indicate your interest by subscribing to the task. You can also add yourself to the ''Volunteer sign-ups'' column if you would like to help with small tasks involved with running the Hackathon. == How to conduct your session and/or workshop == Here are some tips: * We have a [https://docs.google.com/presentation/d/1019ZQltl-M5tsQ6tJz8UaWnTDG9-9MmF044-4IUQqHA/edit?usp=sharing Hackathon themed slide deck] with best practices and more; please make a copy and add the information for your session. * You can propose sessions as presentations, workshops, discussions, or any other format that suits your requirements. ** Feel free to host language- or community-specific sessions and/or meetups. * Session focus should be less on beginner-level workshops (unlike in some previous Hackathons), as this event brings together individuals who have already contributed to technical aspects of the Wikimedia projects. * If there isn't a dedicated space for your session, be prepared to run your session without a projector at a specific hackathon table in a quiet corner of one of the bigger rooms, in the foyer, or outside. * You are welcome to reach out to the event organizers to seek help to prepare, get feedback on your presentation, or any training support you might need a few weeks before the hackathon event. == Social gatherings and side events in Milan == === Format to use for your event === * What: * Meeting point: * Meeting time: * Duration: * Itinerary: * Register your interest, using your signature (4 tildes): === Thursday 30 April 2026 === ''Hackathon participants arrive'' === Friday 01 May 2026 === ''Hackathon kicks off!'' * What: Board games ** Meeting point: Space 5 ** Meeting time: 17:00 ** Duration: 17:00–20:30 ** '''max 6 people:''' Register your interest, using your signature (4 tildes): **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:45, 21 April 2026 (UTC) * What: Tombola night with cute prizes ** Meeting point: Space 5 ** Meeting time: 21:00 ** Duration: 21:00–23:00 ** '''3 rounds, max 48 people each:''' Register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:40, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:12, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:53, 20 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:42, 21 April 2026 (UTC) **#[[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:57, 23 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 01:35, 24 April 2026 (UTC) **# [[User:DaxServer|DaxServer]] ([[User talk:DaxServer|talk]]) 08:26, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:04, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:HCoplin-WMF|HCoplin-WMF]] ([[User talk:HCoplin-WMF|talk]]) 15:36, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:19, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:28, 25 April 2026 (UTC) **#[[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:49, 26 April 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 13:29, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 17:15, 28 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:22, 29 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 08:05, 1 May 2026 (UTC) **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 17:19, 1 May 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 18:06, 1 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:10, 2 May 2026 (UTC) === Saturday 02 May 2026 === ''Hacking!'' * What: Learning and Creating LGBTQIA+ Knowledge and History in Milan (moved from 1 May 2026 due to [https://it.wikipedia.org/wiki/Festa_dei_lavoratori Labour Day]) ** Meeting point: voco Milan-Fiere Hotel lobby ** Meeting time: 15:00 ** Duration: ~3-4 hours (flexible, you can message us if you want to meet us earlier or later) ** Itinerary (flexible and subject to change, please feel free to add locations you'd like or recommend below): *** [https://www.libreriantigone.com/ Antigone - Libreria lgbtqia+], open 15:00–19:30 *** [https://www.instagram.com/leccomilano/ Leccomilano], open 17:00–02:00 ** Register your interest, using your signature (4 tildes): **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:24, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **#[[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) **#[[User:Suzanne Wood (WMDE)|Suzanne Wood (WMDE)]] ([[User talk:Suzanne Wood (WMDE)|talk]]) 21:51, 1 May 2026 (UTC) **#Adenisse (WMF) * What: [https://meta.wikimedia.org/wiki/Event:Hardware_tools_for_Wiki/Raspberry_JAM_at_Wikimedia_Hackathon_Milan_2026 Raspberry JAM] ** Meeting point: Space 5 ** Meeting time: 17:30 ** Duration:1 hour ** Itinerary: Register your interest, using your signature (4 tildes): # '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:58, 24 April 2026 (UTC) # [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but discovered too late) * What: Train Spotting near the Hotel ** Description: There is a railway line near the Hotel and many trains pass through there. Lets have some conversations tech related or related to trains or public transport outside while watching the railway line. ** Meeting point: Entrance of the Hotel, later you can find us at the fence next to the railway line ** Duration: 1 hour, you can join later and leave earlier ** Itinerary: Register your interest, using your signature (4 tildes): # --[[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 17:54, 1 May 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but unable to attend) * What: Historical Tram Experience ** Meeting point: Hotel lobby ** Meeting time: 19:45 (leaving at 20:15) ** Duration: 3.33 hours ** Itinerary: Arco della Pace, Monumentale Cemetry, Piazza Fontana, Piazza della Repubblica, Scala, Navigli , Darsena, Brera, Milano Arena, On tram karaoke ** '''Max 59 people''', register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:42, 10 April 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 21:58, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:11, 11 April 2026 (UTC) **# [[User:GChoi-WMF|GChoi-WMF]] ([[User talk:GChoi-WMF|talk]]) 20:54, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:42, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 08:51, 15 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 14:58, 15 April 2026 (UTC) **# [[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 15:28, 15 April 2026 (UTC) **# [[User:Lupamo Arnold|Lupamo]] ([[User talk:Lupamo Arnold|talk]]) 18:23, 17 April 2026 (UTC) **# [[User:MSzwarc-WMF|MSzwarc-WMF]] ([[User talk:MSzwarc-WMF|talk]]) 17:44, 18 April 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 08:36, 19 April 2026 (UTC) **# [[User:VriaA|VriaA]] ([[User talk:VriaA|talk]]) 04:22, 20 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 10:46, 20 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:50, 20 April 2026 (UTC) **# [[User:ErikaGuetti|ErikaGuetti]] **# [[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:58, 23 April 2026 (UTC) **# [[User:DTorsani-WMF|DTorsani-WMF]] ([[User talk:DTorsani-WMF|talk]]) 00:08, 24 April 2026 (UTC) **# [[User:SSingh (WMF)|SSingh (WMF)]] ([[User talk:SSingh (WMF)|talk]]) 00:48, 24 April 2026 (UTC) **# [[User:Danielyepezgarces|dyepezg]] ([[User talk:Danielyepezgarces|talk]]) 03:09, 24 April 2026 (UTC) **# [[User:SD0001|SD0001]] ([[User talk:SD0001|talk]]) 04:10, 24 April 2026 (UTC) **# [[User:Kaspo|Kaspo]] ([[User talk:Kaspo|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Manimaran96|Manimaran96]] ([[User talk:Manimaran96|talk]]) 07:54, 24 April 2026 (UTC) **# [[User:Silvan Heintze (WMDE)|Silvan Heintze (WMDE)]] ([[User talk:Silvan Heintze (WMDE)|talk]]) 08:00, 24 April 2026 (UTC) **# [[User:T Arrow|T Arrow]] ([[User talk:T Arrow|talk]]) 08:04, 24 April 2026 (UTC) **# [[User:Ollie Shotton (WMDE)|Ollie Shotton (WMDE)]] ([[User talk:Ollie Shotton (WMDE)|talk]]) (Ollie Hyde) **# [[User:Martyn Ranyard (WMDE)|Martyn Ranyard (WMDE)]] ([[User talk:Martyn Ranyard (WMDE)|talk]]) 08:09, 24 April 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 08:15, 24 April 2026 (UTC) **# [[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) (Neslihan Turan) **# [[User:Filippo Giunchedi|Filippo Giunchedi]] ([[User talk:Filippo Giunchedi|talk]]) 08:49, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:05, 24 April 2026 (UTC) **# [[User:FNegri-WMF|FNegri-WMF]] ([[User talk:FNegri-WMF|talk]]) 09:07, 24 April 2026 (UTC) **# [[User:Christoph Jauera (WMDE)|Christoph Jauera (WMDE)]] ([[User talk:Christoph Jauera (WMDE)|talk]]) 10:48, 24 April 2026 (UTC) **# [[User:GLavagetto (WMF)|GLavagetto (WMF)]] ([[User talk:GLavagetto (WMF)|talk]]) 13:50, 24 April 2026 (UTC) **# [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:53, 24 April 2026 (UTC) **# [[User:CGoubert-WMF|CGoubert-WMF]] ([[User talk:CGoubert-WMF|talk]]) 14:42, 24 April 2026 (UTC) **# '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:51, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:Mike Peel|Mike Peel]] ([[User talk:Mike Peel|talk]]) 20:45, 24 April 2026 (UTC) **# [[User:MAzevedo (WMF)|MAzevedo (WMF)]] ([[User talk:MAzevedo (WMF)|talk]]) 21:11, 24 April 2026 (UTC) **# [[User:KSoučková-WMF|KSoučková-WMF]] ([[User talk:KSoučková-WMF|talk]]) 21:24, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:18, 25 April 2026 (UTC) **# [[User:Shreya.Bhopal|Shreya.Bhopal]] ([[User talk:Shreya.Bhopal|talk]]) 07:52, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:29, 25 April 2026 (UTC) **# [[User:AChou-WMF|AChou-WMF]] ([[User talk:AChou-WMF|talk]]) 10:03, 25 April 2026 (UTC) **# [[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 17:20, 25 April 2026 (UTC) **# --[[User:Sannita (WMF)|Sannita (WMF)]] ([[User talk:Sannita (WMF)|talk]]) 18:02, 25 April 2026 (UTC) **# --[[User:Auregann|Auregann]] 18:02, 25 April 2026 (UTC) **# [[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:50, 26 April 2026 (UTC) **#[[User:Misaochan|Misaochan]] ([[User talk:Misaochan|talk]]) 16:11, 2 May 2026 (UTC) (note: user decided to cancel, then re-added herself) **# [[User:Gopavasanth|Gopa Vasanth]] ([[User talk:Gopavasanth|talk]]) 18:05, 26 April 2026 (UTC) **# [[User:Lahari20|Lahari20]] ([[User talk:Lahari20|talk]]) 18:11, 26 April 2026 (UTC) **# [[User:Dactylantha|Dactylantha]] ([[User talk:Dactylantha|talk]]) 21:29, 26 April 2026 (UTC) **# [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) **# [[User:Alchimista|Alchimista]] ([[User talk:Alchimista|talk]]) 07:36, 27 April 2026 (UTC) **# [[User:Chinmayee Mishra|Chinmayee Mishra]] ([[User talk:Chinmayee Mishra|talk]]) 12:17, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) asking nicely =) **#:'''From this point onward, participants are placed on the waiting list. Attendance will be confirmed only if spots become available.''' **# [[User:Lucas Werkmeister (WMDE)|Lucas Werkmeister (WMDE)]] ([[User talk:Lucas Werkmeister (WMDE)|talk]]) 14:09, 28 April 2026 (UTC) **# [[User:Lucas.Belo|Lucas.Belo]] ([[User talk:Lucas.Belo|talk]]) 21:34, 28 April 2026 (UTC) **# [[User:Seanleong8|Seanleong8]] ([[User talk:Seanleong8|talk]]) 10:34, 29 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:23, 29 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 13:39, 29 April 2026 (UTC) Thought I added myself here too :/ **# --[[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 14:45, 29 April 2026 (UTC) **# <span style="color:#d30000">☠</span>[[User:MarkAHershberger|MarkAHershberger]]<span style="color:#d30000">☢</span>([[User_talk:MarkAHershberger|talk]])<span style="color:#d30000">☣</span> 17:41, 29 April 2026 (UTC) **# <span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:40, 1 May 2026 (UTC) **# [[User:Nacaru|Nacaru]] ([[User talk:Nacaru|talk]]) 13:37, 1 May 2026 (UTC) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# User: Adenisse-WMF **# [[User:Jenny8lee|Jenny8lee]] ([[User talk:Jenny8lee|talk]]) 13:04, 2 May 2026 (UTC) **# [[User:Punith.nyk|Punith.nyk]] ([[User talk:Punith.nyk|talk]]) 11:29, 2 May 2026 (UTC) **#--[[User:Johannnes89|Johannnes89]] ([[User talk:Johannnes89|talk]]) 14:04, 2 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:09, 2 May 2026 (UTC) *What: [https://oooh.events/evento/holy-swing-night-02052026-biglietti/ Swing Dance] **Meeting point: [https://www.google.com/maps?cid=5018841184155524841 Spirit de Milan], Via Bovisasca, 59, 20157 Milano MI **Meeting time: Bicycle over from hotel at 21:30; live band starts at 22:30 **Duration: 3hr **Itinerary: Let's check out Milan's local [[w:swing dance|swing dance]]! The band "Lu Cicchitelli & The Associates" will be playing jazz music of the American [[w:big band|big band]]s of the 1930s/1940s at Spirit de Milan's "Holy Swing Night". There does not appear to be any newcomer lesson, so either prior social dance experience or an adventerous spirit is recommended. €15. **Register your interest, using your signature (4 tildes): **#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:38, 1 May 2026 (UTC) *What: '''Wikimedia Untappd Meetup''' ** Description: We share beers and stories. Some brought beer from their country, others bought beers here. Siebrand took care there's enough for those that didn't bring beer. Having a profile on Untappd is necessary, of course. If you don't bring beer, a contribution is expected. ** Meeting point: Floor 1 - lunch/dinner area. We will move to Siebrand's room as we're not allowed to consume non-hotel bought beverages in the public space in the hotel. ** Meeting time: 20:30. Contact siebrand at Telegram if you missed us. ** Duration: many hours hour, no mandatory attendance for the whole session ;) ** Max 12-15 people: **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:30, 1 May 2026 (UTC) **# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:39, 1 May 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:43, 1 May 2026 (UTC) **# 🍻 '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:45, 1 May 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 06:26, 2 May 2026 (UTC) **#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:09, 2 May 2026 (UTC) (will join after tram tour) **# [[User:the wub|the wub]] [[User_talk:The wub|<span style="color: #080;">"?!"</span>]] 07:20, 2 May 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) (will join after tram tour) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# [[User:Mohammed Abdulai (WMDE)|Mohammed Abdulai (WMDE)]] ([[User talk:Mohammed Abdulai (WMDE)|talk]]) 13:34, 2 May 2026 (UTC) **# [[User:Aude|Aude]] ([[User talk:Aude|talk]]) 15:05, 2 May 2026 (UTC) **# [[User:Ejegg|Ejegg]] ([[User talk:Ejegg|talk]]) 17:37, 2 May 2026 (UTC) **# [[User:Jon Harald Søby|Jon Harald Søby]] ([[User talk:Jon Harald Søby|talk]]) 15:56, 2 May 2026 (UTC) **# maybe [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) === Sunday 03 May 2026 === ''Hacking'' ''and closing ceremony!'' <u>Visit to downtown Milan</u>: Following the closing ceremony, shuttle buses will be provided so participants can visit downtown Milan. Shuttles will depart the venue at 17:30 and drop off participants [[:en:Piazza_del_Duomo,_Milan|near the Duomo]] (at [https://www.openstreetmap.org/node/9243018607 Piazza Fontana]), then return to the venue at 22:00. Participants are free to self-organize their visit in downtown Milan. What: '''Wikimedians Love Craft Beer@SNOB''' * Description: We share beers and stories at [https://snob-beer.it/ SNOB]. Once we are dropped off in the city, we will proceed to travel to the bar. They have 20 beers for 500/1000ml growlers and a few hundred different beers from all over. * Meeting point: With Siebrand and Sjoerd once the buses have brought us to the city center on Sunday. * Duration: SNOB closes at 22:00. * Max 15 people: *# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:38, 1 May 2026 (UTC) *# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:41, 1 May 2026 (UTC) *# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:42, 1 May 2026 (UTC) *# '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:46, 1 May 2026 (UTC) *#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:06, 2 May 2026 (UTC) *#[[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) *# [[User:Jon Harald Søby|Jon Harald Søby]] ([[User talk:Jon Harald Søby|talk]]) 14:13, 3 May 2026 (UTC) *# —<span style="font-family:Kristen ITC, serif;margin:0 .3em">[[user:super nabla|super nabla]]</span>([[user talk:super nabla|🪰 msg]]) 14:24, 3 May 2026 (UTC) *# ... What: '''Wikimedians visit Milan's Chinatown ([[:en:Chinatown, Milan|Quartiere Cinese]])''' <gallery mode="packed"> File:Milano, Chinatown 02.jpg File:Dopoguerra 1945 a Milano - Quartiere cinese.jpg File:Milano - Quartiere cinese nel 1945.jpg File:Milano - Quartiere cinese 1945.jpg </gallery> * Description: There are Chinatowns all over the world, and the [[:en:Chinatown, Milan | one in Milan]] is the largest in Italy, having been started in the 1920s from immigrants in Zhejiang province. Population in the tens of thousands! * Meeting point: With [[User:Runawaymo |Runawaymo]] and [[User:Jenny8lee |Jenny8lee]] once the buses drop us off. We will head to [[:en:Via Paolo Sarpi |Via Paolo Sarpi]] (about 20 minutes on public transit) Among the places there with good food are: ** [https://www.instagram.com/laravioleriasarpi/ Ravioleria Sarpi], the absolute institution with handmade "ravioli tradizionali cinesi" (dumplings) made with organic dough and jianbing. ** [https://www.instagram.com/ristorante_di_houjie/ Houjie], cuisine from [[:en:Rui'an|Rui’an]], Wenzhou at budget friendly prices. * Duration: Until we run out of things to eat. * Max 12 people: *# [[User:Runawaymo |Runawaymo]] *# [[User:Jenny8lee |Jenny8lee]] *# Seanleong8 *# [[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:43, 2 May 2026 (UTC) *# [[User:DLynch (WMF)|DLynch (WMF)]] ([[User talk:DLynch (WMF)|talk]]) *# [[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 04:09, 3 May 2026 (UTC) *# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 10:01, 3 May 2026 (UTC) *# [[User:DaxServer|DaxServer]] ([[User talk:DaxServer|talk]]) 13:58, 3 May 2026 (UTC) What: '''Modern art museums by bicycle''' *Meeting point: Hotel lobby *Meeting time: 16:00 *Duration: 16:00-19:30 *Itinerary: Let's bicycle around downtown and visit some modern art museums! Leaving via bikeshare right after the closing showcase. Planning to visit the {{w|Triennale di Milano}} and then the {{w|Museo del Novecento}}. *Register your interest, using your signature (4 tildes): *#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 13:01, 3 May 2026 (UTC) === Monday 04 May 2026 === ''Participants head home'' == Code of Conduct == The Wikimedia Hackathon will enforce the [[foundation:Policy:Universal_Code_of_Conduct|Universal Code of Conduct]], [[Code of Conduct]] for Wikimedia’s Technical Spaces, and the [[foundation:Policy:Friendly_space_policy|Friendly Space Policy]] across all facets of the event. This includes various platforms, discussion channels, and local meetups. Your adherence to these guidelines ensures a respectful and inclusive environment for all participants. '''We recommend all participants review these Trust & Safety policies prior to your arrival at the venue.''' Individuals not cooperating with these policies may be asked to leave the event. A dedicated team will be available on-site to help support a safer environment for all. If you have any questions or suggestions, feel free to use the [[Talk:Wikimedia Hackathon 2026|talk page]] or to reach out to hackathon@wikimedia.org. [[Category:Wikimedia Hackathon 2026]] 6ljqe6wxgr15j7sh45uir0ry7gvd7jf 8365138 8364460 2026-05-04T11:44:18Z Babywacko 18368286 Ebenezer 8365138 wikitext text/x-wiki [[Wacko]]__NOTALK__ <languages/> {{:Wikimedia Hackathon 2026/Header|page=2}} <div style="background: #F6F6F6; border-radius:10px; border:1px solid #A4A4A4; margin:5px 15px;"><div style="margin: 1em; color:#555;"><div style="font-size: 130%; font-family: Tahoma, sans-serif; text-align:left; line-height: 1.5;"> The Hackathon is participant-driven and gets its life from the active participation of its attendees. Below you will find some information on [[#How_to_contribute|how to contribute]] to the program as an attendee. Local communities are also welcome to organize pre-hackathon events, watch-parties or meetups in their region. More information about organization and funding is available on the [[Wikimedia_Hackathon_2026/Satellite_Events|satellite events]] page. </div>{{TOC|limit=3}}</div></div> {{Info|'''This year's hackathon will use the unconference format, with session lengths between 30 minutes and 60 minutes available.''' Add your proposed session to the "Proposed Unconference Sessions" [https://phabricator.wikimedia.org/project/view/8319/ column on the Hackathon 2026 workboard] with the <code>#Wikimedia-Hackathon-2026</code> tag. Then add your session title and name to the schedule! Please ensure you link to your Phabricator task so interested participants can see the full details. Be sure to follow the format listed in the [[#How to contribute]] section of this page. If you're interested in a particular session, please be sure to demonstrate your interest by subscribing to the task in Phabricator! }} {{:Wikimedia_Hackathon_2026/Program/Schedule}} == Room descriptions and capacity == Our main hacking spaces will be on the Floor 2 of the Voco Fiere Hotel Milan; the breakout rooms, quiet room, and the second hacking space (available Friday and Saturday afternoons) will be on Floor 1. '''Floor 2:''' * Main Space - general hacking and where the opening ceremony and closing showcase will happen ** Open from Friday: 09:00–02:00; Saturday: 07:00–02:00; Sunday: 07:00–17:00 * Foyer off Main Space - breaks, snacks and socializing '''Lobby level:''' * Event registration (on Thursday from 12:00–19:00; on Friday from 08:00–09:30) * Space for attendees to socialize and play games '''Floor 1:''' * Space 4 - Unconference sessions and hacking space ** Friday *** 10:45–13:00: Unconference sessions *** 13:00–23:00: Hacking ** Saturday *** 07:00–12:15: Unconference sessions *** 12:15–23:00: Hacking ** Sunday *** 07:00–14:00: Unconference sessions * Space 5 - Unconference sessions and games ** Friday *** 10:45–17:00: Unconference sessions *** 18:30–23:00: Tombola Night ** Saturday *** 07:00–17:00: Unconference sessions ** Sunday *** 07:00–14:00: Unconference sessions * Space 6 - Quiet space * Ristorante Betulla - Where lunch and dinner will be provided '''Room availability:''' * Our hacking rooms - The Main Space will be open until 14:00 on Friday and Saturday night; Space 4 will be open until 23:00. * Space 5 and Space 6 will be closed overnight starting at 18:00. * On Sunday, all rooms close at 17:00 == How to contribute == You can use the Phabricator templates [[phab:T415213|here]] to propose a project or sign up as a participant looking for a project '''Propose a session, workshop, or project''' * '''Proposed Projects -''' Hands-on skill development workshops on topics around the technology stack of Wikimedia projects. * '''Proposed Unconference Sessions -''' Sessions or workshops covering any of the [[:File:Wm technical areas.svg|Wikimedia technical areas]]. For any of the items listed above, use the [https://w.wiki/Kew5 proposal template]. Also, indicate in the task description if your proposed activity is newcomer-friendly. '''Get the word out''' * Add your name and interests - including things you can teach and things you want to learn about - to our participants page. * Email the organizers with any questions, we can help! '''Sign up as a participant''' If you want to work on something but you're not sure what, use the [https://w.wiki/KewC participant template] to let others know that you are looking for a project. If you're interested in a specific unconference session, you can indicate your interest by subscribing to the task. You can also add yourself to the ''Volunteer sign-ups'' column if you would like to help with small tasks involved with running the Hackathon. == How to conduct your session and/or workshop == Here are some tips: * We have a [https://docs.google.com/presentation/d/1019ZQltl-M5tsQ6tJz8UaWnTDG9-9MmF044-4IUQqHA/edit?usp=sharing Hackathon themed slide deck] with best practices and more; please make a copy and add the information for your session. * You can propose sessions as presentations, workshops, discussions, or any other format that suits your requirements. ** Feel free to host language- or community-specific sessions and/or meetups. * Session focus should be less on beginner-level workshops (unlike in some previous Hackathons), as this event brings together individuals who have already contributed to technical aspects of the Wikimedia projects. * If there isn't a dedicated space for your session, be prepared to run your session without a projector at a specific hackathon table in a quiet corner of one of the bigger rooms, in the foyer, or outside. * You are welcome to reach out to the event organizers to seek help to prepare, get feedback on your presentation, or any training support you might need a few weeks before the hackathon event. == Social gatherings and side events in Milan == === Format to use for your event === * What: * Meeting point: * Meeting time: * Duration: * Itinerary: * Register your interest, using your signature (4 tildes): === Thursday 30 April 2026 === ''Hackathon participants arrive'' === Friday 01 May 2026 === ''Hackathon kicks off!'' * What: Board games ** Meeting point: Space 5 ** Meeting time: 17:00 ** Duration: 17:00–20:30 ** '''max 6 people:''' Register your interest, using your signature (4 tildes): **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:45, 21 April 2026 (UTC) * What: Tombola night with cute prizes ** Meeting point: Space 5 ** Meeting time: 21:00 ** Duration: 21:00–23:00 ** '''3 rounds, max 48 people each:''' Register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:40, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:12, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:53, 20 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 13:42, 21 April 2026 (UTC) **#[[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:57, 23 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 01:35, 24 April 2026 (UTC) **# [[User:DaxServer|DaxServer]] ([[User talk:DaxServer|talk]]) 08:26, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:04, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:HCoplin-WMF|HCoplin-WMF]] ([[User talk:HCoplin-WMF|talk]]) 15:36, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:19, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:28, 25 April 2026 (UTC) **#[[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:49, 26 April 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 13:29, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 17:15, 28 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:22, 29 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 08:05, 1 May 2026 (UTC) **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 17:19, 1 May 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 18:06, 1 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:10, 2 May 2026 (UTC) === Saturday 02 May 2026 === ''Hacking!'' * What: Learning and Creating LGBTQIA+ Knowledge and History in Milan (moved from 1 May 2026 due to [https://it.wikipedia.org/wiki/Festa_dei_lavoratori Labour Day]) ** Meeting point: voco Milan-Fiere Hotel lobby ** Meeting time: 15:00 ** Duration: ~3-4 hours (flexible, you can message us if you want to meet us earlier or later) ** Itinerary (flexible and subject to change, please feel free to add locations you'd like or recommend below): *** [https://www.libreriantigone.com/ Antigone - Libreria lgbtqia+], open 15:00–19:30 *** [https://www.instagram.com/leccomilano/ Leccomilano], open 17:00–02:00 ** Register your interest, using your signature (4 tildes): **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:24, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **#[[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) **#[[User:Suzanne Wood (WMDE)|Suzanne Wood (WMDE)]] ([[User talk:Suzanne Wood (WMDE)|talk]]) 21:51, 1 May 2026 (UTC) **#Adenisse (WMF) * What: [https://meta.wikimedia.org/wiki/Event:Hardware_tools_for_Wiki/Raspberry_JAM_at_Wikimedia_Hackathon_Milan_2026 Raspberry JAM] ** Meeting point: Space 5 ** Meeting time: 17:30 ** Duration:1 hour ** Itinerary: Register your interest, using your signature (4 tildes): # '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:58, 24 April 2026 (UTC) # [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but discovered too late) * What: Train Spotting near the Hotel ** Description: There is a railway line near the Hotel and many trains pass through there. Lets have some conversations tech related or related to trains or public transport outside while watching the railway line. ** Meeting point: Entrance of the Hotel, later you can find us at the fence next to the railway line ** Duration: 1 hour, you can join later and leave earlier ** Itinerary: Register your interest, using your signature (4 tildes): # --[[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 17:54, 1 May 2026 (UTC) # [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) (but unable to attend) * What: Historical Tram Experience ** Meeting point: Hotel lobby ** Meeting time: 19:45 (leaving at 20:15) ** Duration: 3.33 hours ** Itinerary: Arco della Pace, Monumentale Cemetry, Piazza Fontana, Piazza della Repubblica, Scala, Navigli , Darsena, Brera, Milano Arena, On tram karaoke ** '''Max 59 people''', register your interest, using your signature (4 tildes): **# [[User:Agamyasamuel|AgamyaSamuel]] ([[User talk:Agamyasamuel|talk]]) 17:42, 10 April 2026 (UTC) **# [[User:TChin (WMF)|TChin (WMF)]] ([[User talk:TChin (WMF)|talk]]) 21:58, 10 April 2026 (UTC) **# [[User:Ademola01|Ademola01]] ([[User talk:Ademola01|talk]]) 06:14, 11 April 2026 (UTC) **# [[User:Shadabgdg|Shadabgdg]] ([[User talk:Shadabgdg|talk]]) 10:11, 11 April 2026 (UTC) **# [[User:GChoi-WMF|GChoi-WMF]] ([[User talk:GChoi-WMF|talk]]) 20:54, 11 April 2026 (UTC) **# [[User:Daanvr|Daanvr]] ([[User talk:Daanvr|talk]]) 20:46, 12 April 2026 (UTC) **# [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]) 13:42, 14 April 2026 (UTC), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) **# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 08:51, 15 April 2026 (UTC) **# [[User:Tohaomg|Tohaomg]] ([[User talk:Tohaomg|talk]]) 14:58, 15 April 2026 (UTC) **# [[User:Hogü-456|Hogü-456]] ([[User talk:Hogü-456|talk]]) 15:28, 15 April 2026 (UTC) **# [[User:Lupamo Arnold|Lupamo]] ([[User talk:Lupamo Arnold|talk]]) 18:23, 17 April 2026 (UTC) **# [[User:MSzwarc-WMF|MSzwarc-WMF]] ([[User talk:MSzwarc-WMF|talk]]) 17:44, 18 April 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 08:36, 19 April 2026 (UTC) **# [[User:VriaA|VriaA]] ([[User talk:VriaA|talk]]) 04:22, 20 April 2026 (UTC) **# [[User:APuthin-WMF|APuthin-WMF]] ([[User talk:APuthin-WMF|talk]]) 10:46, 20 April 2026 (UTC) **# [[User:Emptycodes|Emptycodes]] ([[User talk:Emptycodes|talk]]) 11:50, 20 April 2026 (UTC) **# [[User:ErikaGuetti|ErikaGuetti]] **# [[User:Rohansingh1010|Rohansingh1010]] ([[User talk:Rohansingh1010|talk]]) 21:58, 23 April 2026 (UTC) **# [[User:DTorsani-WMF|DTorsani-WMF]] ([[User talk:DTorsani-WMF|talk]]) 00:08, 24 April 2026 (UTC) **# [[User:SSingh (WMF)|SSingh (WMF)]] ([[User talk:SSingh (WMF)|talk]]) 00:48, 24 April 2026 (UTC) **# [[User:Danielyepezgarces|dyepezg]] ([[User talk:Danielyepezgarces|talk]]) 03:09, 24 April 2026 (UTC) **# [[User:SD0001|SD0001]] ([[User talk:SD0001|talk]]) 04:10, 24 April 2026 (UTC) **# [[User:Kaspo|Kaspo]] ([[User talk:Kaspo|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Effie Mouzeli (WMF)|Effie Mouzeli (WMF)]] ([[User talk:Effie Mouzeli (WMF)|talk]]) 07:40, 24 April 2026 (UTC) **# [[User:Manimaran96|Manimaran96]] ([[User talk:Manimaran96|talk]]) 07:54, 24 April 2026 (UTC) **# [[User:Silvan Heintze (WMDE)|Silvan Heintze (WMDE)]] ([[User talk:Silvan Heintze (WMDE)|talk]]) 08:00, 24 April 2026 (UTC) **# [[User:T Arrow|T Arrow]] ([[User talk:T Arrow|talk]]) 08:04, 24 April 2026 (UTC) **# [[User:Ollie Shotton (WMDE)|Ollie Shotton (WMDE)]] ([[User talk:Ollie Shotton (WMDE)|talk]]) (Ollie Hyde) **# [[User:Martyn Ranyard (WMDE)|Martyn Ranyard (WMDE)]] ([[User talk:Martyn Ranyard (WMDE)|talk]]) 08:09, 24 April 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 08:15, 24 April 2026 (UTC) **# [[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) (Neslihan Turan) **# [[User:Filippo Giunchedi|Filippo Giunchedi]] ([[User talk:Filippo Giunchedi|talk]]) 08:49, 24 April 2026 (UTC) **# [[User:AgarwalMahima|AgarwalMahima]] ([[User talk:AgarwalMahima|talk]]) 09:05, 24 April 2026 (UTC) **# [[User:FNegri-WMF|FNegri-WMF]] ([[User talk:FNegri-WMF|talk]]) 09:07, 24 April 2026 (UTC) **# [[User:Christoph Jauera (WMDE)|Christoph Jauera (WMDE)]] ([[User talk:Christoph Jauera (WMDE)|talk]]) 10:48, 24 April 2026 (UTC) **# [[User:GLavagetto (WMF)|GLavagetto (WMF)]] ([[User talk:GLavagetto (WMF)|talk]]) 13:50, 24 April 2026 (UTC) **# [[User:IHurbainPalatin (WMF)|IHurbainPalatin (WMF)]] ([[User talk:IHurbainPalatin (WMF)|talk]]) 13:53, 24 April 2026 (UTC) **# [[User:CGoubert-WMF|CGoubert-WMF]] ([[User talk:CGoubert-WMF|talk]]) 14:42, 24 April 2026 (UTC) **# '''-- <span style="text-shadow:gray 3px 2px 3px;">[[User:Suyash.dwivedi|<span style="color:#FF5733;">Suyash</span> <span style="color:#2E86C1;">Dwivedi</span>]]</span>''' ([[User talk:Suyash.dwivedi|💬]]) 14:51, 24 April 2026 (UTC) **# [[User:CCiufo-WMF|CCiufo-WMF]] ([[User talk:CCiufo-WMF|talk]]) 15:15, 24 April 2026 (UTC) **# [[User:Mike Peel|Mike Peel]] ([[User talk:Mike Peel|talk]]) 20:45, 24 April 2026 (UTC) **# [[User:MAzevedo (WMF)|MAzevedo (WMF)]] ([[User talk:MAzevedo (WMF)|talk]]) 21:11, 24 April 2026 (UTC) **# [[User:KSoučková-WMF|KSoučková-WMF]] ([[User talk:KSoučková-WMF|talk]]) 21:24, 24 April 2026 (UTC) **# [[User:SSastry (WMF)|SSastry (WMF)]] ([[User talk:SSastry (WMF)|talk]]) 05:18, 25 April 2026 (UTC) **# [[User:Shreya.Bhopal|Shreya.Bhopal]] ([[User talk:Shreya.Bhopal|talk]]) 07:52, 25 April 2026 (UTC) **# [[User:KartikMistry|KartikMistry]] ([[User talk:KartikMistry|talk]]) 08:29, 25 April 2026 (UTC) **# [[User:AChou-WMF|AChou-WMF]] ([[User talk:AChou-WMF|talk]]) 10:03, 25 April 2026 (UTC) **# [[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 17:20, 25 April 2026 (UTC) **# --[[User:Sannita (WMF)|Sannita (WMF)]] ([[User talk:Sannita (WMF)|talk]]) 18:02, 25 April 2026 (UTC) **# --[[User:Auregann|Auregann]] 18:02, 25 April 2026 (UTC) **# [[User:1Veertje|1Veertje]] ([[User talk:1Veertje|talk]]) 17:50, 26 April 2026 (UTC) **#[[User:Misaochan|Misaochan]] ([[User talk:Misaochan|talk]]) 16:11, 2 May 2026 (UTC) (note: user decided to cancel, then re-added herself) **# [[User:Gopavasanth|Gopa Vasanth]] ([[User talk:Gopavasanth|talk]]) 18:05, 26 April 2026 (UTC) **# [[User:Lahari20|Lahari20]] ([[User talk:Lahari20|talk]]) 18:11, 26 April 2026 (UTC) **# [[User:Dactylantha|Dactylantha]] ([[User talk:Dactylantha|talk]]) 21:29, 26 April 2026 (UTC) **# [[User:CorraleH|CorraleH]] ([[User talk:CorraleH|talk]]) 06:42, 27 April 2026 (UTC) **# [[User:Alchimista|Alchimista]] ([[User talk:Alchimista|talk]]) 07:36, 27 April 2026 (UTC) **# [[User:Chinmayee Mishra|Chinmayee Mishra]] ([[User talk:Chinmayee Mishra|talk]]) 12:17, 27 April 2026 (UTC) **# [[User:Aegis Maelstrom|Aegis Maelstrom]] ([[User talk:Aegis Maelstrom|talk]]) 17:43, 27 April 2026 (UTC) asking nicely =) **#:'''From this point onward, participants are placed on the waiting list. Attendance will be confirmed only if spots become available.''' **# [[User:Lucas Werkmeister (WMDE)|Lucas Werkmeister (WMDE)]] ([[User talk:Lucas Werkmeister (WMDE)|talk]]) 14:09, 28 April 2026 (UTC) **# [[User:Lucas.Belo|Lucas.Belo]] ([[User talk:Lucas.Belo|talk]]) 21:34, 28 April 2026 (UTC) **# [[User:Seanleong8|Seanleong8]] ([[User talk:Seanleong8|talk]]) 10:34, 29 April 2026 (UTC) **# [[User:Ciell|Ciell]] ([[User talk:Ciell|talk]]) 13:23, 29 April 2026 (UTC) **# [[User:ItsNyoty|ItsNyoty]] ([[User talk:ItsNyoty|talk]]) 13:39, 29 April 2026 (UTC) Thought I added myself here too :/ **# --[[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 14:45, 29 April 2026 (UTC) **# <span style="color:#d30000">☠</span>[[User:MarkAHershberger|MarkAHershberger]]<span style="color:#d30000">☢</span>([[User_talk:MarkAHershberger|talk]])<span style="color:#d30000">☣</span> 17:41, 29 April 2026 (UTC) **# <span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:40, 1 May 2026 (UTC) **# [[User:Nacaru|Nacaru]] ([[User talk:Nacaru|talk]]) 13:37, 1 May 2026 (UTC) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# User: Adenisse-WMF **# [[User:Jenny8lee|Jenny8lee]] ([[User talk:Jenny8lee|talk]]) 13:04, 2 May 2026 (UTC) **# [[User:Punith.nyk|Punith.nyk]] ([[User talk:Punith.nyk|talk]]) 11:29, 2 May 2026 (UTC) **#--[[User:Johannnes89|Johannnes89]] ([[User talk:Johannnes89|talk]]) 14:04, 2 May 2026 (UTC) **#[[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:09, 2 May 2026 (UTC) *What: [https://oooh.events/evento/holy-swing-night-02052026-biglietti/ Swing Dance] **Meeting point: [https://www.google.com/maps?cid=5018841184155524841 Spirit de Milan], Via Bovisasca, 59, 20157 Milano MI **Meeting time: Bicycle over from hotel at 21:30; live band starts at 22:30 **Duration: 3hr **Itinerary: Let's check out Milan's local [[w:swing dance|swing dance]]! The band "Lu Cicchitelli & The Associates" will be playing jazz music of the American [[w:big band|big band]]s of the 1930s/1940s at Spirit de Milan's "Holy Swing Night". There does not appear to be any newcomer lesson, so either prior social dance experience or an adventerous spirit is recommended. €15. **Register your interest, using your signature (4 tildes): **#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 10:38, 1 May 2026 (UTC) *What: '''Wikimedia Untappd Meetup''' ** Description: We share beers and stories. Some brought beer from their country, others bought beers here. Siebrand took care there's enough for those that didn't bring beer. Having a profile on Untappd is necessary, of course. If you don't bring beer, a contribution is expected. ** Meeting point: Floor 1 - lunch/dinner area. We will move to Siebrand's room as we're not allowed to consume non-hotel bought beverages in the public space in the hotel. ** Meeting time: 20:30. Contact siebrand at Telegram if you missed us. ** Duration: many hours hour, no mandatory attendance for the whole session ;) ** Max 12-15 people: **# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:30, 1 May 2026 (UTC) **# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:39, 1 May 2026 (UTC) **# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:43, 1 May 2026 (UTC) **# 🍻 '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:45, 1 May 2026 (UTC) **# '''[[User:Addshore|<span style="color:black">·addshore·</span>]]''' <sup>[[User_talk:Addshore|<span style="color:black;">talk to me!</span>]]</sup> 06:26, 2 May 2026 (UTC) **#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:09, 2 May 2026 (UTC) (will join after tram tour) **# [[User:the wub|the wub]] [[User_talk:The wub|<span style="color: #080;">"?!"</span>]] 07:20, 2 May 2026 (UTC) **# [[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) (will join after tram tour) **# [[User:Exowanderer | Exowanderer]] ([[User talk:Exowanderer|talk]])12:10 2 May 2026 (UTC) **# [[User:Mohammed Abdulai (WMDE)|Mohammed Abdulai (WMDE)]] ([[User talk:Mohammed Abdulai (WMDE)|talk]]) 13:34, 2 May 2026 (UTC) **# [[User:Aude|Aude]] ([[User talk:Aude|talk]]) 15:05, 2 May 2026 (UTC) **# [[User:Ejegg|Ejegg]] ([[User talk:Ejegg|talk]]) 17:37, 2 May 2026 (UTC) **# [[User:Jon Harald Søby|Jon Harald Søby]] ([[User talk:Jon Harald Søby|talk]]) 15:56, 2 May 2026 (UTC) **# maybe [[User:GiovanniPen|GiovanniPen]] ([[User talk:GiovanniPen|talk]]) 17:18, 2 May 2026 (UTC) === Sunday 03 May 2026 === ''Hacking'' ''and closing ceremony!'' <u>Visit to downtown Milan</u>: Following the closing ceremony, shuttle buses will be provided so participants can visit downtown Milan. Shuttles will depart the venue at 17:30 and drop off participants [[:en:Piazza_del_Duomo,_Milan|near the Duomo]] (at [https://www.openstreetmap.org/node/9243018607 Piazza Fontana]), then return to the venue at 22:00. Participants are free to self-organize their visit in downtown Milan. What: '''Wikimedians Love Craft Beer@SNOB''' * Description: We share beers and stories at [https://snob-beer.it/ SNOB]. Once we are dropped off in the city, we will proceed to travel to the bar. They have 20 beers for 500/1000ml growlers and a few hundred different beers from all over. * Meeting point: With Siebrand and Sjoerd once the buses have brought us to the city center on Sunday. * Duration: SNOB closes at 22:00. * Max 15 people: *# [[User:Siebrand|siebrand]] ([[User talk:Siebrand|talk]]) 22:38, 1 May 2026 (UTC) *# [[User:Sjoerddebruin|Sjoerddebruin]] ([[User talk:Sjoerddebruin|talk]]) 22:41, 1 May 2026 (UTC) *# [[User:Husky|Husky]] ([[User talk:Husky|talk]]) 22:42, 1 May 2026 (UTC) *# '''~''[[User:SuperHamster|<span style="color:#07517C">Super</span>]]''[[User:SuperHamster|<span style="color:#6FA23B">Hamster</span>]]''' <small>[[User talk:SuperHamster|Talk]] [[Special:Contribs/SuperHamster|Contribs]]</small> 22:46, 1 May 2026 (UTC) *#[[User:Sic19|Sic19]] ([[User talk:Sic19|talk]]) 07:06, 2 May 2026 (UTC) *#[[User:Simon04|Simon04]] ([[User talk:Simon04|talk]]) 10:18, 2 May 2026 (UTC) *# [[User:Jon Harald Søby|Jon Harald Søby]] ([[User talk:Jon Harald Søby|talk]]) 14:13, 3 May 2026 (UTC) *# —<span style="font-family:Kristen ITC, serif;margin:0 .3em">[[user:super nabla|super nabla]]</span>([[user talk:super nabla|🪰 msg]]) 14:24, 3 May 2026 (UTC) *# ... What: '''Wikimedians visit Milan's Chinatown ([[:en:Chinatown, Milan|Quartiere Cinese]])''' <gallery mode="packed"> File:Milano, Chinatown 02.jpg File:Dopoguerra 1945 a Milano - Quartiere cinese.jpg File:Milano - Quartiere cinese nel 1945.jpg File:Milano - Quartiere cinese 1945.jpg </gallery> * Description: There are Chinatowns all over the world, and the [[:en:Chinatown, Milan | one in Milan]] is the largest in Italy, having been started in the 1920s from immigrants in Zhejiang province. Population in the tens of thousands! * Meeting point: With [[User:Runawaymo |Runawaymo]] and [[User:Jenny8lee |Jenny8lee]] once the buses drop us off. We will head to [[:en:Via Paolo Sarpi |Via Paolo Sarpi]] (about 20 minutes on public transit) Among the places there with good food are: ** [https://www.instagram.com/laravioleriasarpi/ Ravioleria Sarpi], the absolute institution with handmade "ravioli tradizionali cinesi" (dumplings) made with organic dough and jianbing. ** [https://www.instagram.com/ristorante_di_houjie/ Houjie], cuisine from [[:en:Rui'an|Rui’an]], Wenzhou at budget friendly prices. * Duration: Until we run out of things to eat. * Max 12 people: *# [[User:Runawaymo |Runawaymo]] *# [[User:Jenny8lee |Jenny8lee]] *# Seanleong8 *# [[User:Jeremyb|Jeremyb]] ([[User talk:Jeremyb|talk]]) 17:43, 2 May 2026 (UTC) *# [[User:DLynch (WMF)|DLynch (WMF)]] ([[User talk:DLynch (WMF)|talk]]) *# [[User:Count Count|Count Count]] ([[User talk:Count Count|talk]]) 04:09, 3 May 2026 (UTC) *# [[User:MareikeHeuer(WMDE)|MareikeHeuer(WMDE)]] ([[User talk:MareikeHeuer(WMDE)|talk]]) 10:01, 3 May 2026 (UTC) *# [[User:DaxServer|DaxServer]] ([[User talk:DaxServer|talk]]) 13:58, 3 May 2026 (UTC) What: '''Modern art museums by bicycle''' *Meeting point: Hotel lobby *Meeting time: 16:00 *Duration: 16:00-19:30 *Itinerary: Let's bicycle around downtown and visit some modern art museums! Leaving via bikeshare right after the closing showcase. Planning to visit the {{w|Triennale di Milano}} and then the {{w|Museo del Novecento}}. *Register your interest, using your signature (4 tildes): *#<span style="border:3px outset;border-radius:8pt 0;padding:1px 5px;background:linear-gradient(6rad,#86c,#2b9)">[[User:Sdkb|<span style="color:#FFF;text-decoration:inherit;font:1em Lucida Sans">Sdkb</span>]]</span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 13:01, 3 May 2026 (UTC) === Monday 04 May 2026 === ''Participants head home'' == Code of Conduct == The Wikimedia Hackathon will enforce the [[foundation:Policy:Universal_Code_of_Conduct|Universal Code of Conduct]], [[Code of Conduct]] for Wikimedia’s Technical Spaces, and the [[foundation:Policy:Friendly_space_policy|Friendly Space Policy]] across all facets of the event. This includes various platforms, discussion channels, and local meetups. Your adherence to these guidelines ensures a respectful and inclusive environment for all participants. '''We recommend all participants review these Trust & Safety policies prior to your arrival at the venue.''' Individuals not cooperating with these policies may be asked to leave the event. A dedicated team will be available on-site to help support a safer environment for all. If you have any questions or suggestions, feel free to use the [[Talk:Wikimedia Hackathon 2026|talk page]] or to reach out to hackathon@wikimedia.org. [[Category:Wikimedia Hackathon 2026]] 58gmyfk8uim7utiagtr65rjuwlu3vxr Wikimedia Hackathon 2026/Documentation 0 2301815 8364404 8364086 2026-05-03T14:43:26Z Husky 27994 /* Blog posts */ 8364404 wikitext text/x-wiki {{:Wikimedia Hackathon 2026/Header|page=7}} == Reports == * * == Photos, videos & slides == * [[c:Category:Wikimedia Hackathon 2026|Wikimedia Hackathon 2026]] category on Wikimedia Commons for photos and slides * Opening ceremony session recording: https://youtube.com/live/7ZoQdPNt1nc?feature=share * Closing showcase session recording:https://youtube.com/live/rHMTJB8gleQ?feature=share * ...add more here == Blog posts == '''General''' *[https://www.haykranen.nl/2026/05/02/wikimedia-hackathon-ai-identity-crisis/ I had an AI identity crisis at a hackathon, so I made it everyone’s problem] — About the two workshops i gave about the question: how should our community deal with the paradigm shift of AI? * '''Project specific''' * * == Social media == * Fediverse: https://wikis.world/tags/wmhack [[Category:Wikimedia Hackathon 2026]] n35armeccb2ukjc0s4s3u1i2dgzt76y 8365142 8364404 2026-05-04T11:46:19Z Babywacko 18368286 Erbuccaneer 8365142 wikitext text/x-wiki {{:Wikimedia Hackathon 2026/Header|page=7}} <syntaxhighlight lang="erb" line="1" start="911"> 3033 </syntaxhighlight> == Reports == * * == Photos, videos & slides == * [[c:Category:Wikimedia Hackathon 2026|Wikimedia Hackathon 2026]] category on Wikimedia Commons for photos and slides * Opening ceremony session recording: https://youtube.com/live/7ZoQdPNt1nc?feature=share * Closing showcase session recording:https://youtube.com/live/rHMTJB8gleQ?feature=share * ...add more here == Blog posts == '''General''' *[https://www.haykranen.nl/2026/05/02/wikimedia-hackathon-ai-identity-crisis/ I had an AI identity crisis at a hackathon, so I made it everyone’s problem] — About the two workshops i gave about the question: how should our community deal with the paradigm shift of AI? * '''Project specific''' * * == Social media == * Fediverse: https://wikis.world/tags/wmhack [[Category:Wikimedia Hackathon 2026]] 47dwmsj6q6qfo66kay7jljygogo87qy Article guidance/ar 0 2317490 8364669 8363807 2026-05-03T19:16:08Z ToadetteEdit 17805473 8364669 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=<span class="mw-translate-fuzzy">ندعو المحررين ذوي الخبرة في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديا}} إلى '''تجربة [$url هذه الميزة]''' في عرض تجريبي، و'''مراجعة [$url2 مخططات المقالات]''' و'''تقديم ملاحظاتكم [[ $2|في هذه الصفحة]]'''.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Localizing them now ensures the Article Guidance feature will be useful for editors after deployment.</span> }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <div lang="en" dir="ltr" class="mw-content-ltr"> ===Adapting a sample outline in a Wikipedia=== </div> <span lang="en" dir="ltr" class="mw-content-ltr">An outline appears when creating articles of a type in a Wikipedia using the Article guidance feature.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These sample outlines are to be adapted and translated into our pilot Wikipedias.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can adapt and localise them to your Wikipedia following the steps below:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Choose an outline from [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance this list] (for example: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Person])</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Create a new page in the Wikipedia namespace following a naming format. For example, for the [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] outline in French Wikipedia is: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below are the formats for our pilot Wikipedias:</span> ** {{int|project-localized-name-arwiki}}:<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span>/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} 9p0vf0t54ebsacng9affldtts9eymjq 8364673 8364669 2026-05-03T19:17:40Z ToadetteEdit 17805473 8364673 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. <span lang="en" dir="ltr" class="mw-content-ltr">Localizing them now ensures the Article Guidance feature will be useful for editors after deployment.</span> }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <div lang="en" dir="ltr" class="mw-content-ltr"> ===Adapting a sample outline in a Wikipedia=== </div> <span lang="en" dir="ltr" class="mw-content-ltr">An outline appears when creating articles of a type in a Wikipedia using the Article guidance feature.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These sample outlines are to be adapted and translated into our pilot Wikipedias.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can adapt and localise them to your Wikipedia following the steps below:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Choose an outline from [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance this list] (for example: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Person])</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Create a new page in the Wikipedia namespace following a naming format. For example, for the [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] outline in French Wikipedia is: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below are the formats for our pilot Wikipedias:</span> ** {{int|project-localized-name-arwiki}}:<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span>/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} k6r3w4i1hf5ytqcnrxhetczwodvspks 8364677 8364673 2026-05-03T19:18:15Z ToadetteEdit 17805473 Created page with "يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر." 8364677 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <div lang="en" dir="ltr" class="mw-content-ltr"> ===Adapting a sample outline in a Wikipedia=== </div> <span lang="en" dir="ltr" class="mw-content-ltr">An outline appears when creating articles of a type in a Wikipedia using the Article guidance feature.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These sample outlines are to be adapted and translated into our pilot Wikipedias.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can adapt and localise them to your Wikipedia following the steps below:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Choose an outline from [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance this list] (for example: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Person])</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Create a new page in the Wikipedia namespace following a naming format. For example, for the [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] outline in French Wikipedia is: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below are the formats for our pilot Wikipedias:</span> ** {{int|project-localized-name-arwiki}}:<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span>/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} h7i1atm4xtl7l6woz6xntzj9umvjtcu 8364683 8364677 2026-05-03T19:18:50Z ToadetteEdit 17805473 Created page with "===تكييف مخطط نموذجي في ويكيبيديا===" 8364683 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== <span lang="en" dir="ltr" class="mw-content-ltr">An outline appears when creating articles of a type in a Wikipedia using the Article guidance feature.</span> <span lang="en" dir="ltr" class="mw-content-ltr">These sample outlines are to be adapted and translated into our pilot Wikipedias.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can adapt and localise them to your Wikipedia following the steps below:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Choose an outline from [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance this list] (for example: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Person])</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Create a new page in the Wikipedia namespace following a naming format. For example, for the [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] outline in French Wikipedia is: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below are the formats for our pilot Wikipedias:</span> ** {{int|project-localized-name-arwiki}}:<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span>/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} 98cr70cjilcd06gg6twtnmwo9wx9c6k 8364687 8364683 2026-05-03T19:19:19Z ToadetteEdit 17805473 Created page with "يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة." 8364687 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. <span lang="en" dir="ltr" class="mw-content-ltr">These sample outlines are to be adapted and translated into our pilot Wikipedias.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You can adapt and localise them to your Wikipedia following the steps below:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Choose an outline from [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance this list] (for example: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Person])</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Create a new page in the Wikipedia namespace following a naming format. For example, for the [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] outline in French Wikipedia is: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below are the formats for our pilot Wikipedias:</span> ** {{int|project-localized-name-arwiki}}:<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span>/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} k5nmtbmeouunkcfyd8sg1u312zgou3w 8364689 8364687 2026-05-03T19:19:52Z ToadetteEdit 17805473 Created page with "سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا." 8364689 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. <span lang="en" dir="ltr" class="mw-content-ltr">You can adapt and localise them to your Wikipedia following the steps below:</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Choose an outline from [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance this list] (for example: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Person])</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Create a new page in the Wikipedia namespace following a naming format. For example, for the [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] outline in French Wikipedia is: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below are the formats for our pilot Wikipedias:</span> ** {{int|project-localized-name-arwiki}}:<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span>/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} e9soy8zioo54a6j2p9q2zn3rtimz4gf 8364693 8364689 2026-05-03T19:20:09Z ToadetteEdit 17805473 Created page with "يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه:" 8364693 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * <span lang="en" dir="ltr" class="mw-content-ltr">Choose an outline from [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance this list] (for example: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Person])</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Create a new page in the Wikipedia namespace following a naming format. For example, for the [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] outline in French Wikipedia is: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below are the formats for our pilot Wikipedias:</span> ** {{int|project-localized-name-arwiki}}:<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span>/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} e86d1v9rcbq86h8pn0t52rcfc8sq9sk 8364698 8364693 2026-05-03T19:20:58Z ToadetteEdit 17805473 Created page with "اختر مخطط من [$url هذه القائمة] (على سبيل المثال: [$url2 مشروع:إرشاد المقالة/شخص])" 8364698 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * <span lang="en" dir="ltr" class="mw-content-ltr">Create a new page in the Wikipedia namespace following a naming format. For example, for the [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] outline in French Wikipedia is: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]].</span> <span lang="en" dir="ltr" class="mw-content-ltr">Below are the formats for our pilot Wikipedias:</span> ** {{int|project-localized-name-arwiki}}:<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span>/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} 5ibztef1gmdwajihnbcdfjmt06erg4b 8364702 8364698 2026-05-03T19:21:55Z ToadetteEdit 17805473 Created page with "أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [$url مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]." 8364702 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. <span lang="en" dir="ltr" class="mw-content-ltr">Below are the formats for our pilot Wikipedias:</span> ** {{int|project-localized-name-arwiki}}:<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span>/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} 6snrunft99negcdn5lehdke0g7rmrb5 8364706 8364702 2026-05-03T19:22:26Z ToadetteEdit 17805473 Created page with "فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا:" 8364706 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span>/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} 298mrx5qg427t1078q37xx0xt7xn2cl 8364710 8364706 2026-05-03T19:22:49Z ToadetteEdit 17805473 Created page with "[اسم المخطط]" 8364710 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} o9mnwhp1b877i1tb1b8ib1qzh8j474y 8364712 8364710 2026-05-03T19:22:52Z ToadetteEdit 17805473 Created page with "[اسم المخطط]" 8364712 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/[اسم المخطط] ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} o2jxk7fawvlw5y7qve4ut8dxlkanvgv 8364714 8364712 2026-05-03T19:22:55Z ToadetteEdit 17805473 Created page with "[اسم المخطط]" 8364714 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/[اسم المخطط] ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/[اسم المخطط] ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} 0b44w7roghpaczaiuxa7pdvg715fdji 8364716 8364714 2026-05-03T19:22:59Z ToadetteEdit 17805473 Created page with "[اسم المخطط]" 8364716 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/[اسم المخطط] ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/[اسم المخطط] ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/[اسم المخطط] ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} 0pps9t77a7d41hl37aii2g0bd1ekoio 8364718 8364716 2026-05-03T19:23:02Z ToadetteEdit 17805473 Created page with "[اسم المخطط]" 8364718 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/[اسم المخطط] ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/[اسم المخطط] ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/[اسم المخطط] ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/[اسم المخطط] ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} mosflgsqru901z6ptceyhu1rfsmyhlr 8364720 8364718 2026-05-03T19:23:06Z ToadetteEdit 17805473 Created page with "[اسم المخطط]" 8364720 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/[اسم المخطط] ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/[اسم المخطط] ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/[اسم المخطط] ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/[اسم المخطط] ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/[اسم المخطط] ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} rf3w9yuvf4mwvarsh0jazw9wukdhxex 8364722 8364720 2026-05-03T19:23:10Z ToadetteEdit 17805473 Created page with "[اسم المخطط]" 8364722 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/[اسم المخطط] ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/[اسم المخطط] ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/[اسم المخطط] ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/[اسم المخطط] ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/[اسم المخطط] ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/[اسم المخطط] ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/<span lang="en" dir="ltr" class="mw-content-ltr">[outline name]</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} njw66wh8htdvdp5n6jf3gsriy53q6di 8364724 8364722 2026-05-03T19:23:12Z ToadetteEdit 17805473 Created page with "[اسم المخطط]" 8364724 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/[اسم المخطط] ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/[اسم المخطط] ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/[اسم المخطط] ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/[اسم المخطط] ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/[اسم المخطط] ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/[اسم المخطط] ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/[اسم المخطط] * <span lang="en" dir="ltr" class="mw-content-ltr">Access the outline content through the 'Edit source' mode.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} tmboq5f54f9nfxc4vjx66g32thgnuil 8364726 8364724 2026-05-03T19:23:46Z ToadetteEdit 17805473 Created page with "يمكنك الوصول إلى محتوى المخطط التفصيلي من خلال وضع "عدل مصدر"." 8364726 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/[اسم المخطط] ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/[اسم المخطط] ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/[اسم المخطط] ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/[اسم المخطط] ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/[اسم المخطط] ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/[اسم المخطط] ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/[اسم المخطط] * يمكنك الوصول إلى محتوى المخطط التفصيلي من خلال وضع "عدل مصدر". * <span lang="en" dir="ltr" class="mw-content-ltr">Copy the outline content from 'Edit source' mode and paste it into your new page, ensuring all tags are included exactly as is in the original outline.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} l0ksr4sg3q9icj00yjjka89cel9jo47 8364728 8364726 2026-05-03T19:24:24Z ToadetteEdit 17805473 Created page with "انسخ محتوى المخطط التفصيلي من وضع "عدل المصدر" والصقه في صفحتك الجديدة، مع التأكد من تضمين جميع العلامات تمامًا كما هي في المخطط التفصيلي الأصلي." 8364728 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/[اسم المخطط] ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/[اسم المخطط] ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/[اسم المخطط] ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/[اسم المخطط] ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/[اسم المخطط] ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/[اسم المخطط] ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/[اسم المخطط] * يمكنك الوصول إلى محتوى المخطط التفصيلي من خلال وضع "عدل مصدر". * انسخ محتوى المخطط التفصيلي من وضع "عدل المصدر" والصقه في صفحتك الجديدة، مع التأكد من تضمين جميع العلامات تمامًا كما هي في المخطط التفصيلي الأصلي. * <span lang="en" dir="ltr" class="mw-content-ltr">Translate and adapt the content to fit your Wikipedia's standards, practices, policies and templates.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} plmw3ga4o0lninqevhjqudeaxympscs 8364730 8364728 2026-05-03T19:25:08Z ToadetteEdit 17805473 Created page with "ترجم وكيّف المحتوى لتتناسب مع معايير ويكيبيديا وممارسات وسياسات وقوالب." 8364730 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/[اسم المخطط] ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/[اسم المخطط] ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/[اسم المخطط] ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/[اسم المخطط] ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/[اسم المخطط] ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/[اسم المخطط] ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/[اسم المخطط] * يمكنك الوصول إلى محتوى المخطط التفصيلي من خلال وضع "عدل مصدر". * انسخ محتوى المخطط التفصيلي من وضع "عدل المصدر" والصقه في صفحتك الجديدة، مع التأكد من تضمين جميع العلامات تمامًا كما هي في المخطط التفصيلي الأصلي. * ترجم وكيّف المحتوى لتتناسب مع معايير ويكيبيديا وممارسات وسياسات وقوالب. <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} 6xtn0nm0myq5dj7pnbwiqmllmn0idw4 8364732 8364730 2026-05-03T19:25:23Z ToadetteEdit 17805473 8364732 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/[اسم المخطط] ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/[اسم المخطط] ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/[اسم المخطط] ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/[اسم المخطط] ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/[اسم المخطط] ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/[اسم المخطط] ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/[اسم المخطط] * يمكنك الوصول إلى محتوى المخطط التفصيلي من خلال وضع "عدل مصدر". * انسخ محتوى المخطط التفصيلي من وضع "عدل المصدر" والصقه في صفحتك الجديدة، مع التأكد من تضمين جميع العلامات تمامًا كما هي في المخطط التفصيلي الأصلي. * ترجم وكيّف المحتوى لتتناسب مع معايير ويكيبيديا وممارساتها وسياساتها وقوالبها. <span lang="en" dir="ltr" class="mw-content-ltr">Do not remove or change any tags or the text inside the tags (eg.{{tag|instructions}}), as these are needed for the feature to work.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} 2d2l97flvein99zqys1n4vertarxjt5 8364734 8364732 2026-05-03T19:26:13Z ToadetteEdit 17805473 Created page with "لا تقم بإزالة أو تغيير أي علامات أو النص الموجود داخل العلامات (على سبيل المثال $1)، حيث أن هذه العلامات ضرورية لكي تعمل الميزة." 8364734 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/[اسم المخطط] ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/[اسم المخطط] ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/[اسم المخطط] ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/[اسم المخطط] ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/[اسم المخطط] ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/[اسم المخطط] ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/[اسم المخطط] * يمكنك الوصول إلى محتوى المخطط التفصيلي من خلال وضع "عدل مصدر". * انسخ محتوى المخطط التفصيلي من وضع "عدل المصدر" والصقه في صفحتك الجديدة، مع التأكد من تضمين جميع العلامات تمامًا كما هي في المخطط التفصيلي الأصلي. * ترجم وكيّف المحتوى لتتناسب مع معايير ويكيبيديا وممارساتها وسياساتها وقوالبها. لا تقم بإزالة أو تغيير أي علامات أو النص الموجود داخل العلامات (على سبيل المثال {{tag|instructions}})، حيث أن هذه العلامات ضرورية لكي تعمل الميزة. <span lang="en" dir="ltr" class="mw-content-ltr">See the "[[Article guidance/Test feature guide|Quick guide to markups used in outlines]]" section for more information about markup elements.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} or85pi1vmkb3ew1ax7kvxg8e3026xc0 8364736 8364734 2026-05-03T19:27:19Z ToadetteEdit 17805473 Created page with "راجع قسم "[[Article guidance/Test feature guide|دليل سريع للعلامات المستخدمة في المخططات]]" لمزيد من المعلومات حول عناصر العلامات." 8364736 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/[اسم المخطط] ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/[اسم المخطط] ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/[اسم المخطط] ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/[اسم المخطط] ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/[اسم المخطط] ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/[اسم المخطط] ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/[اسم المخطط] * يمكنك الوصول إلى محتوى المخطط التفصيلي من خلال وضع "عدل مصدر". * انسخ محتوى المخطط التفصيلي من وضع "عدل المصدر" والصقه في صفحتك الجديدة، مع التأكد من تضمين جميع العلامات تمامًا كما هي في المخطط التفصيلي الأصلي. * ترجم وكيّف المحتوى لتتناسب مع معايير ويكيبيديا وممارساتها وسياساتها وقوالبها. لا تقم بإزالة أو تغيير أي علامات أو النص الموجود داخل العلامات (على سبيل المثال {{tag|instructions}})، حيث أن هذه العلامات ضرورية لكي تعمل الميزة. راجع قسم "[[Article guidance/Test feature guide|دليل سريع للعلامات المستخدمة في المخططات]]" لمزيد من المعلومات حول عناصر العلامات. * <span lang="en" dir="ltr" class="mw-content-ltr">Publish the page when you are finished, and you have adapted an outline.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} 9lwc4s1fwdt80ka0o4ts0gruw57jw31 8364738 8364736 2026-05-03T19:27:38Z ToadetteEdit 17805473 Created page with "نشر الصفحة عندما تنتهي، وقد قمت بتكييف مخطط." 8364738 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/[اسم المخطط] ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/[اسم المخطط] ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/[اسم المخطط] ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/[اسم المخطط] ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/[اسم المخطط] ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/[اسم المخطط] ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/[اسم المخطط] * يمكنك الوصول إلى محتوى المخطط التفصيلي من خلال وضع "عدل مصدر". * انسخ محتوى المخطط التفصيلي من وضع "عدل المصدر" والصقه في صفحتك الجديدة، مع التأكد من تضمين جميع العلامات تمامًا كما هي في المخطط التفصيلي الأصلي. * ترجم وكيّف المحتوى لتتناسب مع معايير ويكيبيديا وممارساتها وسياساتها وقوالبها. لا تقم بإزالة أو تغيير أي علامات أو النص الموجود داخل العلامات (على سبيل المثال {{tag|instructions}})، حيث أن هذه العلامات ضرورية لكي تعمل الميزة. راجع قسم "[[Article guidance/Test feature guide|دليل سريع للعلامات المستخدمة في المخططات]]" لمزيد من المعلومات حول عناصر العلامات. * نشر الصفحة عندما تنتهي، وقد قمت بتكييف مخطط. <div lang="en" dir="ltr" class="mw-content-ltr"> The pages will render weirdly after you publish for now, until the extension is deployed. ===Outlines to prioritize adapting=== These are the top 10 article outlines to prioritize adapting and translating to our selected Wikipedias. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person Project:ArticleGuidance/Person] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician Project:ArticleGuidance/Politician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson Project:ArticleGuidance/Sportsperson] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement Project:ArticleGuidance/Human Settlement] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film Project:ArticleGuidance/Film] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician Project:ArticleGuidance/Musician] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor Project:ArticleGuidance/Actor] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal Project:ArticleGuidance/Animal] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club Project:ArticleGuidance/Sports Club] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game Project:ArticleGuidance/Video Game] </div> <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} 1o3j3pnt953s9w6vzcx1b1eq0gg3olk 8364741 8364738 2026-05-03T19:36:03Z ToadetteEdit 17805473 Created page with "ستظهر الصفحات بشكل غير منتظم بعد النشر مؤقتًا، ريثما يتم تثبيت الإضافة. ===ملخصات للمقالات التي يجب إعطاؤها الأولوية عند التعديل=== هذه أهم عشرة ملخصات للمقالات التي يجب إعطاؤها الأولوية عند تعديلها وترجمتها إلى نسخ ويكيبيديا المختارة. * [https://b24e11a4f1.catalyst.wmcloud.org/wik..." 8364741 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/[اسم المخطط] ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/[اسم المخطط] ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/[اسم المخطط] ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/[اسم المخطط] ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/[اسم المخطط] ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/[اسم المخطط] ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/[اسم المخطط] * يمكنك الوصول إلى محتوى المخطط التفصيلي من خلال وضع "عدل مصدر". * انسخ محتوى المخطط التفصيلي من وضع "عدل المصدر" والصقه في صفحتك الجديدة، مع التأكد من تضمين جميع العلامات تمامًا كما هي في المخطط التفصيلي الأصلي. * ترجم وكيّف المحتوى لتتناسب مع معايير ويكيبيديا وممارساتها وسياساتها وقوالبها. لا تقم بإزالة أو تغيير أي علامات أو النص الموجود داخل العلامات (على سبيل المثال {{tag|instructions}})، حيث أن هذه العلامات ضرورية لكي تعمل الميزة. راجع قسم "[[Article guidance/Test feature guide|دليل سريع للعلامات المستخدمة في المخططات]]" لمزيد من المعلومات حول عناصر العلامات. * نشر الصفحة عندما تنتهي، وقد قمت بتكييف مخطط. ستظهر الصفحات بشكل غير منتظم بعد النشر مؤقتًا، ريثما يتم تثبيت الإضافة. ===ملخصات للمقالات التي يجب إعطاؤها الأولوية عند التعديل=== هذه أهم عشرة ملخصات للمقالات التي يجب إعطاؤها الأولوية عند تعديلها وترجمتها إلى نسخ ويكيبيديا المختارة. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالة/شخص] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician مشروع:إرشاد المقالة/سياسي] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson مشروع:إرشاد المقالة/شخص رياضي] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement مشروع:إرشاد المقالة/ مستوطنة] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film مشروع:إرشاد المقالة/فلم] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/موسيقي] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor مشروع:إرشاد المقالة/ممثل] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal مشروع:إرشاد المقالة/حيوان] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club مشروع:إرشاد المقالة/نادي رياضي] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game مشروع:إرشاد المقالة/لعبة فيديو] <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} igmvym3xaosmyt1ub7semf4of0c7hly 8364743 8364741 2026-05-03T19:37:31Z ToadetteEdit 17805473 8364743 wikitext text/x-wiki <languages/> {{ContentGrid|content= {{InfoCard |heading=<span class="plainlinks">[https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page {{Clickable button|1=التكيف مع هذه الميزة!|color=blue}}]</span> |content=ندعو '''المحررين ذوي الخبرة''' في {{ll|Article guidance/Pilot wikis and collaborators|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{ll|Article guidance#Adapting a sample outline in a Wikipedia|باستخدام هذه التعليمات}}'''. يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. }} }} {{Wikimedia engineering project information | name = إرشاد المقالة | description = يهدف '''<big>إرشاد المقالة</big>''' إلى تحسين عملية إنشاء المقالات والأقسام على ويكيبيديا عبر نهجٍ موجهٍ ومدعوم. | start = 2025-07 | end = | group = | members = {{plainlist| * [[m:User:FRomeo (WMF)|Fiona Romeo]] * [[metawiki:User:GGalofre (WMF)|Gerard Galofre]] * [[m:User:NLaxstrom-WMF|Niklas Laxström]] * [[User:Pginer-WMF|Pau Giner]] * [[User:SGautam (WMF)|Sudhanshu Gautam]] * [[metawiki:User:Sbisson_(WMF)|Stephane Bisson]] * [[User:EAMedina_(WMF)|Eduardo Medina]] * [[m:User:AJayadi-WMF|Anbar Jayadi]] * [[User:UOzurumba (WMF)|Uzoma Ozurumba]] * [[m:User:LDelench(WMF)|Lauren de Lench]] | | updates = | progress = Ideation stage | previous = | next = | projectpage = | display = }} }} '''إرشاد المقالة'''، التي طورتها مؤسسة ويكيميديا، هي ميزة تجريبية مصممة لمساعدة المحررين الأقل خبرة على إنشاء مقالات في ويكيبيديا منظمة بشكل جيد ومتوافقة مع السياسات. تحدد هذه الميزة نية المحرر بناءً على عنوان المقالة ونوعها، ثم تقدم إرشادات مخصصة قابلة للتعديل من قبل المجتمع طوال عملية الإنشاء. يشمل ذلك التحقق المسبق من المصادر، وتقييم مخاطر الملحوظية، ومخططات محتوى للمحتويات الأولية. من خلال تقليل المساهمات منخفضة الجودة، تهدف هذه الميزة إلى زيادة معدل بقاء الصفحات الجديدة التي ينشئها المحررون، وتقليل عبء العمل على المراجعين والإداريين. بالإضافة إلى ذلك، صُممت هذه الميزة لتعمل عبر مختلف المنصات مع تركيز خاص على خفض العوائق أمام المساهمة عبر الأجهزة المحمولة، حيث يكون إنشاء المقالات أكثر صعوبة بشكل خاص. __TOC__ <span id="Testing_the_feature"></span> ==اختبار الميزة== الميزة متاحة في [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Main_Page '''بيئة الاختبار هذه''']. هذه النسخة الأولية باللغة الإنجليزية ومخصصة للمساهمين ذوي الخبرة في [[Article guidance/Pilot wikis and collaborators#Collaborators|الويكيات التجريبية]] لاختبارها، ومراجعة [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance نماذج المخططات]، و[[Talk:Article guidance|تقديم الملاحظات]]. [[Article guidance/Test feature guide|هذه الصفحة]] تتضمن دليلاً خطوة بخطوة لاستخدام الميزة وتقديم ملاحظاتك. يعرض الفيديو أدناه كيفية عمل الميزة. لم تتوفر بعد في أي نسخة حية من ويكيبيديا. سيتم إطلاقها في الويكيات التجريبية كتجربة اختبار a/b بعد الاختبار والتحسين، استنادًا إلى مراجعات المخططات وملاحظات المساهمين ذوي الخبرة. بعد ذلك، يمكن للويكيات التجريبية تكييفها وترجمتها محليًا حسب الحاجة. [[File:Article_Guidance_workflow_demo_-_April_2026.webm|738x738px]] <span id="Adapting_a_sample_outline_in_a_Wikipedia"></span> ===تكييف مخطط نموذجي في ويكيبيديا=== يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: * اختر مخطط من [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Category:Pages_using_article_guidance هذه القائمة] (على سبيل المثال: [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/شخص]) * أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: ** {{int|project-localized-name-arwiki}}:[اسم المخطط]/ويكيبيديا:إرشاد المقالة ** {{int|project-localized-name-bnwiki}}: [[:bn:উইকিপিডিয়া:নিবন্ধ নির্দেশিকা|উইকিপিডিয়া:নিবন্ধ নির্দেশিকা]]/[اسم المخطط] ** {{int|project-localized-name-frwiki}}: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles|Wikipédia:Aide à la rédaction d'articles]]/[اسم المخطط] ** {{int|project-localized-name-jawiki}}: Wikipedia:記事執筆のガイド/楽士/[اسم المخطط] ** {{int|project-localized-name-ptwiki}}: Wikipédia:OrientaçõesParaArtigos/[اسم المخطط] ** {{int|project-localized-name-simplewiki}}: [[:simple:Wikipedia:Article_Guidance|Wikipedia:Article Guidance]]/[اسم المخطط] ** {{int|project-localized-name-eswiki}}: Wikipedia:GuíadeArtículos/[اسم المخطط] ** {{int|project-localized-name-trwiki}}: [[:tr:Vikipedi:MaddeYönergesi|Vikipedi:MaddeYönergesi]]/[اسم المخطط] * يمكنك الوصول إلى محتوى المخطط التفصيلي من خلال وضع "عدل مصدر". * انسخ محتوى المخطط التفصيلي من وضع "عدل المصدر" والصقه في صفحتك الجديدة، مع التأكد من تضمين جميع العلامات تمامًا كما هي في المخطط التفصيلي الأصلي. * ترجم وكيّف المحتوى لتتناسب مع معايير ويكيبيديا وممارساتها وسياساتها وقوالبها. لا تقم بإزالة أو تغيير أي علامات أو النص الموجود داخل العلامات (على سبيل المثال {{tag|instructions}})، حيث أن هذه العلامات ضرورية لكي تعمل الميزة. راجع قسم "[[Article guidance/Test feature guide|دليل سريع للعلامات المستخدمة في المخططات]]" لمزيد من المعلومات حول عناصر العلامات. * نشر الصفحة عندما تنتهي، وقد قمت بتكييف مخطط. ستظهر الصفحات بشكل غير منتظم بعد النشر مؤقتًا، ريثما يتم تثبيت الإضافة. ===ملخصات للمقالات التي يجب إعطاؤها الأولوية عند التعديل=== هذه أهم عشرة ملخصات للمقالات التي يجب إعطاؤها الأولوية عند تعديلها وترجمتها إلى نسخ ويكيبيديا المختارة. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالة/شخص] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician مشروع:إرشاد المقالة/سياسي] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson مشروع:إرشاد المقالة/رياضي] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement مشروع:إرشاد المقالة/مستوطنة] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film مشروع:إرشاد المقالة/فلم] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/موسيقي] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor مشروع:إرشاد المقالة/ممثل] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal مشروع:إرشاد المقالة/حيوان] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club مشروع:إرشاد المقالة/نادي رياضي] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game مشروع:إرشاد المقالة/لعبة فيديو] <span id="Feature_workflow"></span> ==سير عمل الميزة== يحدد إرشاد المقالة سير عمل لمساعدة المساهمين منذ المراحل الأولية وحتى كتابة المقالة في المحرر المرئي، باستخدام المخططات المقدمة. '''الخطوة 1– إدخال العنوان ومطابقة الموضوع''' [[File:Article guidance-title entry and topic matching.png|رسم توضيحي لخطوة إدخال العنوان ومطابقة الموضوع في ميزة إرشاد المقالة.|center|677x677px]] عند وصول المساهم إلى الميزة لبدء مقالة جديدة، يطلب منه إدخال عنوان المقالة. يستعلم النظام عن التطابقات المحتملة للموضوع ويعرض قائمة بالموضوعات الأساسية والبدائل القريبة من ويكي بيانات ليؤكد المساهم موضوعه. ثم ينقل المساهم بسرعة إلى المرحلة التالية. يبسط هذا سير العمل اختيار الموضوع الصحيح ويقضي على التكرار. '''الخطوة 2 – اختيار نوع المقالة''' [[File:Article_guidance-article_type_selection.png|border|center|526x526px]] عندما لا يتمكن المساهم من تأكيد تطابق الموضوع من عنوان المقالة في الخطوة 1، يظهر له قائمة بأنواع المقالات للاختيار من بينها. يؤدي اختيار نوع إلى نقله إلى فحص الملحوظية. يؤدي تطابق الموضوع الناجح من الخطوة السابقة إلى تخطي هذا الجزء من سير العمل. إذا لم ينطبق أي من الأنواع المدرجة، يتيح خروج سلس للمساهم متابعة العمل بدون المساعدة الموجهة أو اقتراح نوع جديد للنظر فيه من قبل المجتمع. '''الخطوة 3 (فحص المراجع)''' [[File:Article_guidance-reference_checks.png|810x810px]] بعد تأكيد عنوان المقالة ونوعها، يُطلب من المساهمين تقديم المصادر عن طريق لصق رابط أو أكثر. يتم التحقق من كل رابط تلقائيًا مقابل القوائم المحددة من قبل المجتمع للمصادر الموصى بها والمحرّمة، مع عرض ملاحظات فورية تُظهر ما إذا كان المصدر مقبولًا أو غير موصى به. إذا تم تمييزه، تُقدَّم نصائح إرشادية لمساعدة المساهمين على فهم ما يُعد مصدرًا موثوقًا. إضافة المصادر في هذه المرحلة اختيارية بشكل افتراضي، لكنها قد تكون مطلوبة حسب نوع المقالة. يمكن للمساهمين أيضًا إضافة المصادر لاحقًا أثناء الكتابة. '''الخطوة 4 (تقييم مخاطر الملحوظية)''' [[File:Article_guidance-notability_risk_assessment.png|center|524x524px]] تتحقق خطوة تقييم مخاطر الملحوظية مما إذا كانت المقالة المقترحة تلبي معايير الملحوظية المحددة من قبل المجتمع استنادًا إلى عنوانها ونوعها ومصادرها. إذا لم يكن الموضوع مستوفٍ لمعايير مثل: * التواجد في ويكي بيانات * التوفر في ويكيات لغات أخرى * متطلبات المصادر يتوقف سير العمل عن السماح للمستخدم بالمتابعة. بعد ذلك، يُقدَّم للمساهمين بدائل مفيدة مثل: * العمل على مقالة ذات صلة * التعرف على إرشادات الملحوظية * اقتراح عنصر في ويكي بيانات توجه هذه الخطوة المساهمين نحو مساهمات ذات معنى في وقت مبكر، مما يوفر الوقت ويحسن جودة المقالة. '''الخطوة 5. المحتويات الأولية من المخطط كنقطة انطلاق''' [[File:Article_guidance-_Outline_as_starting_point.png|center|537x537px]] في هذه المرحلة، يرى المساهم شاشة إرشادية تحتوي على نصائح وتذكيرات مقدمة من المجتمع ومرتبطة بنوع المقالة المختار. بالنقر على زر "ابدأ الكتابة"، يصل المساهم إلى المحرر المرئي، الذي يتضمن الهيكل المحدد من قبل المجتمع لنوع المقالة المختار. تم تصميم هذا الدعم لتقليل القلق الناتج عن الصفحة الفارغة ومساعدة المساهمين على البدء في الكتابة بثقة باتباع الإرشادات والدلائل. '''الخطوة 6. دعوة ما بعد النشر''' [[File:Article_guidance-post-publish_invite.png|center|562x562px]] بعد أن ينشر المساهم عمله، يُدعى إلى توسيعه أو مراجعته. على سبيل المثال، قد يُدعى إلى إضافة أقسام من المخطط الأصلي لم تُدرج في النص. وقد يُطلب منه أيضًا إنجاز مهام صغيرة إضافية، مثل إضافة صورة إلى مقالته. <span id="Experiment_phase"></span> == مرحلة التجربة == وستُقيَّم ميزة ”إرشاد المقالة“ عبر اختبار A/B موجه للمحررين المبتدئين الذين ينشئون مقالات عبر الأجهزة المحمولة. وسيقيس الاختبار ما إذا كان إنشاء المقالات الموجه يحسّن معدل بقاء هذه المقالات لمدة 30 يومًا. ويجري حاليًا وضع اللمسات الأخيرة على المقاييس الرئيسية ونقاط الدخول. وسيُطلق الاختبار بعد أن تختبر مجتمعات الويكي التجريبية سير العمل باللغة الإنجليزية، وتقدم ملاحظاتها، وتتخذ الإجراءات اللازمة لتحسينه. كما سيتعين على مواقع الويكي التجريبية تكييف مخططات المقالات وترجمتها إلى لغاتها قبل بدء التجربة. وسوف تُعد التجربة في Test Kitchen، مع مراقبة مستمرة في Superset. وفي حالة عدم تحقيق التجربة تحسناً في معدلات البقاء وزيادة حالات التخلي عن المقالات في جميع مواقع الويكي التجريبية، سيُوقف العمل على إنشاء المقالات الموجهة وستُعاد مراجعة المنهجية. <span id="Rationale_for_article_guidance"></span> ==مبررات إرشاد المقالة== الهدف هو مساعدة المحررين الجدد على فهم وتطبيق الممارسات والسياسات القائمة بسهولة، والتنقل في مهمة بدء مقال جديد بسهولة. كما تهدف إلى تقليل عبء العمل للإداريين، مما يسمح لهم بحماية نوعية المواد بشكل أكثر فعالية. هذه المبادرة مستوحاة من احتياجات المجتمع [[metawiki:Community Wishlist/FA5|الموثقة في قائمة الأمنيات]]، [[Talk:Growth/Article creation for new editors|والنقاشات]]، [[w:Wikipedia talk:New pages patrol/New landing page proposal/Article workflow|والتغذية الراجعة]] مع بعض المجتمعات حول [[Special:MyLanguage/Growth/Article creation for new editors|فكرة إنشاء المقالات للمحررين الجدد]]. * '''إن إنشاء مقالة جديدة أمر محفّز، لكنه مليء بالتحديات.'''<br>النجاح في إنتاج مقال معتمد وعالي الجودة يمثل إنجازًا ملموسًا للمحرر وعاملًا محفزًا لمواصلة المساهمة. غير أن هذه المسؤولية وهذا الإنجاز يصحبهما مجموعة من التحديات والمصاعب. * '''أسباب الرفض المحددة لمساهمات المحررين الجدد'''<br>يواجه المحررون الجدد، على وجه الخصوص، مهام عسيرة مثل: ** تصفح سياسات التحرير المُعقدة ** فهم المعايير التي يتوقعها أصحاب الصلاحيات المتقدمة ومجتمع ويكيبيديا للمحتوى عالي الجودة. * لا ينجحون غالبًا، إذ تُحذف مقالاتهم لعدم استيفائها معايير الجودة، وذلك للأسباب التالية: ** افتقارها إلى المصادر ** عدم إمكانية التحقق من مصادرها ** عدم كتابتها بحيادية ** عدم اتباعها البُنية المطلوبة * '''تأثير المحتوى منخفض الجودة الذي يُنتج بواسطة الذكاء الاصطناعي'''<br>مع التقدم الذي تشهده تقنية الذكاء الاصطناعي، يلجأ بعض المساهمين إلى طرق مختصرة لكتابة مقالات لا تفي بمعايير مجتمعنا. * '''الوقت الذي يقضيه المراجعون في مراجعة المشاركات غير المناسبة'''<br>يقضي المراقبون وقتًا في مراجعة المشاركات ذات الجودة المنخفضة والتداول بشأنها، مما يؤدي إلى تراكم كبير في أعباء العمل عليهم. * قد يُحبط التراجع عن المساهمات من عزيمة المستخدمين ويُرهق المراجعين. سُلط الضوء على المشاكل المذكورة أعلاه في [[metawiki:Community_Wishlist/FA5|قائمة أمنيات المجتمع]]، ونوقشت باستفاضةٍ بين فريق النمو ومجتمع ويكيبيديا الإنجليزيَّة، والتي ذُكرت أيضًا في تعليقاتٍ من عدم مجتمعات. <span id="Potential_opportunities_to_address_the_problems"></span> ==الفرص المحتملة لمعالجة المشاكل== بناءً على ملاحظات المجتمع و[[metawiki:Research:Guided_article_and_section_creation|دراسةٍ بحثيَّةٍ]] لاحقة، حددنا ميزاتٍ محتملة لمزيد من الاستكشاف والاختبار مع المجتمعات. * '''مساعدة المستخدمين في العثور على المراجع وفهمها وتطبيقها'''، وهي عناصر أساسية لإنشاء المحتوى بنجاح. * '''تحديد أنواع المقالات''' لتقديم دعمٍ مُخصص للمستخدمين الجدد. * '''وضع مخططاتٍ مُحددة من قِبل المجتمع'''. التعاون مع المجتمعات و/أو استخدام مقالاتٍ نموذجيّة لوضع مخططاتٍ لأنواع مختلفة من المقالات. * '''تمكين إعادة استخدام مخططات المحتوى بسرعة'''. اقتراح مكوناتٍ أساسية للمقالة، مثل الأقسام والفقرات والحقائق السريعة وصناديق المعلومات وغيرها. * '''تسليط الضوء على السياسات الرئيسة'''. تقديم إرشاداتٍ مرتبطة ضمن سير عمل التحرير لكل نوعٍ من أنواع المقالات. * '''إعطاء الأولوية لسهولة التحرير عبر الأجهزة المحمولة''' مع دعم مستخدمي أجهزة الحاسوب المكتبية. * '''نهج التعلم بالممارسة''' الذي يُمكّن المستخدمين من كتابة مسودة مقالة مُوثقة جيدًا. تعكس هذه الأفكار الممارسات الحالية للمجتمع، حيث قامت المجتمعات بتحديد هياكل وإرشادات لأنواع محددة من المقالات. هناك أمثلة من المتطوعين ([[$1|User sandbox+]])، ومشاريع الويكي (مثل [[$2|مشروع ويكي طب]] أو [[$3|مشروع ويكي الرئيسيات]])، والجهات الشقيقة (مثل عمل ويكيميديا ​​البرازيل على [[$4|MBabel]] أو منشورات ويكي التعليم [[commons:Category:Wiki Education Foundation subject-specific handouts|الخاصة بموضوعٍ محدد]]). ومع ذلك، فإن أدوات إنشاء المحتوى الحالية لا تسهّل اكتشافها أو تطبيقها. نرغب في توسيع قدرات أدوات التحرير الحالية لدعم هذه الممارسات. <span id="Early_phase:_initial_intervention"></span> ==المرحلة الأوليَّة: التدخل الأولي== [[File:Article Guidance - initial intervention.pdf|400px|thumb|Proposal for initial intervention]] خلال هذه المرحلة الاستكشافية والتجريبية المبكرة، نسعى إلى توعية المجتمع ومشاركته للمساعدة في الإجابة عن بعض الأسئلة، واختبار الميزات قيد التطوير، وتقديم الملاحظات. نحن نتعامل مع هذا العمل من منظور تجريبي، مع الحرص على أن يكون الاستكشاف خاضعاً للرقابة والتحليل. The intervention will capture the user intent, and take advantage of identifying the type of article they try to create in order to provide some initial community-created guidance. More detail in [[:commons:File:Article%20Guidance%20-%20initial%20intervention.pdf|the proposal document]] and [[phab:T396029|the main ticket in Phabrcator]]. Additional guidance will be considered for future interventions. <span id="Multiple_scenarios_considered"></span> === سيناريوهات متعددة === في هذه المبادرة الأولية، تمت دراسة سيناريوهات من قِبل مُساهمين جدد، ومُساهمين خبرًا، بالإضافة إلى المُراجعين. بالنسبة للمُساهمين الجدد، تشمل السيناريوهات ما يلي: * إنشاء مقالات غير صالحة... * إنشاء مقالات ذات جودة منخفضة ولكنها صالحة... * توسيع المقالات الموجودة... والتي يُمكن أن تكون في: * ويكيبيديا كبيرة الحجم * ويكيبيديا متوسطة الحجم * ويكيبيديا صغيرة الحجم * ويكيّات أخرى مثل ويكي رحلات. سينصب التركيز على تعريف المُحررين المبتدئين بكيفية إنشاء المقالات على الأجهزة المحمولة بأي لغة، وتخفيف أعباء المُراجعين بتقليل عدد المقالات الضعيفة التي يحتاجون إلى حذفها. <span id="Target_wikis"></span> ==== الويكيات المستهدفة ==== نظرنا في مواقع ويكيبيديا التي تحتوي على العديد من المقالات المؤهلة للإنشاء، إلا أنها تواجه أيضًا تقييمًا صعبًا من قبل المراجعين. {{ll|Article guidance/Pilot wikis and collaborators|اختيرت 6 نسخ من ويكيبيديا، وهناك مواقع ويكي أخرى تتعاون معنا}} بناءً على اهتمامها بالمشروع. وهناك المزيد من المساهمين من نسخ ويكيبيديا الأخرى مستعدون للمشاركة في هذا العمل. <span id="Possible_metrics"></span> === مؤشرات محتملة === * مقارنة معدلات حذف المقالات (مع أداة الإرشاد ودونها) * انخفاض معدل التخلي عن المقالات * زيادة معدل استبقاء المحررين * زيادة إنشاء المقالات. * زيادة نسبة المحتوى الذي يستوفي معايير الجودة القياسية. هدفنا الرئيسي هو حل '''بعض مشكلات''' عملية إنشاء المحتوى '''لبعض المستخدمين''' في '''أنواع محددة من المقالات'''. <span id="Community_involvement"></span> === مساهمة المجتمع === عبر التعاون مع مواقع الويكي التجريبية والمساهمين المهتمين، تمكنا من الحصول على رؤى حول الأسئلة الرئيسية التالية * ما هي أنواع المقالات الرئيسية التي سيستفيد منها المحررون المبتدئون أكثر من غيرها مع بعض الإرشاد؟ مثلًا: السير الذاتية، الحيوانات، الأفلام... * لكل نوعٍ منها: ** ما هي المصادر الموصى بها وغير الموصى بها؟ مثلًا: يُنصح باستخدام ناشيونال جيوغرافيك، ويُنصح بتجنب يوتيوب. ** هل هناك خطر كبير من عدم شهرة المقال؟ إلى أين نوجههم؟ مثلًا: بالنسبة للسير الذاتية، يُنصح بتوجيههم إلى قسم المسودات إذا لم تكن متوفرة بخمس لغات أخرى أو أكثر. ** هل لديك أي نصائح أولية تقدمها للمحررين الذين يحاولون إنشاء هذا النوع من المقالات؟ مثلًا: تأكد من وجود اسم الحيوان في القائمة... ** هل لديك أي محتوى أولي قد يساعد المحررين على البدء بشكل أفضل من صفحة فارغة؟ مثلًا: هذه الفقرة مثال، صندوق معلومات عن الحيوان، وعنوانان للقسمين. Based on community feedback, we are developing a feature in a test wiki that provides guidance for editors throughout the editing workflow. This includes an outline to assist with content creation for various article types. Participating communities will be invited to: * Try the feature in a test environment * Provide feedback * Review and improve the sample outlines. A step by step guide to assist communities in trying the feature is provided in [[Article guidance/Test feature guide|this page.]] <span id="Design_proposal"></span> === مقترح تصميمي === التصاميم الواردة أدناه هي الرسوم التوضيحية الأولى. وقد استُخدمت كدليل لوضع نسخة أكثر تفصيلاً من سير العمل الخاص بالتجربة. <span id="Starting_point"></span> ==== نقطة البداية ==== <gallery mode="nolines" widths="400" heights="225" perrow="2" style="text-align:center" caption="رسم توضيحي لبدء مقالة غير موثقة في ويكيبيديا. على سبيل المثال، النمر السيبيري."> File:Article Guidance - initial intervention 13.png|مثال على مقال جديد يمكن إنشاؤه File:Article Guidance - initial intervention 14.png|قرار كتابة المقال </gallery> <span id="Choosing_a_title"></span> ==== اختيار العنوان ==== بمجرد أن يقدم المحرر عنوانًا للمقال الجديد. تتطابق عناصر ويكي بيانات مع العنوان وتُظهر الموضوع المحدد. عندما لا يوجد عنصر في ويكي بيانات للموضوع المحدد، يقوم المحرر باختيار نوع المقالة من خلال البحث أو التصفح. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية كتابة عنوان لمقال وما يحدث بعد ذلك مع هذا العنوان."> File:Article Guidance - initial intervention 15.png|كتابة عنوان المقالة الجديدة التي تحتوي على عنصر في ويكي بيانات File:Article Guidance - initial intervention 16.png|ماذا يحدث عندما لا يحتوي العنوان على عنصر في ويكي بيانات؟ </gallery> <span id="Adding_your_sources_and_references_upfront"></span> ==== إضافة مصادرك ومراجعك مسبقًا ==== بعد تحديد العنوان، تتمثل الخطوة التالية في مطالبة المحررين بتوفير المصادر في وقت مبكر من العملية لتوضيح مدى أهميتها وإجراء بعض الفحوصات الأساسية بناءً على عدد المصادر وقوائم المصادر الموصى بها وغير الموصى بها من قبل مجتمع ويكيبيديا. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="توضيح لكيفية إضافة المصادر والمراجع المقدمة والتحقق منها."> File:Article Guidance - initial intervention 17.png|طلب مصادر من المستخدم File:Article Guidance - initial intervention 18.png|اقتراح إجراءات تحقق إضافية للمستخدم للمساعدة في التحقق من صحة قراره ومساعدته على معرفة ما يجعل المصدر جيدًا </gallery> <span id="Notability_check_and_initial_guidance"></span> ==== التحقق من المحلوظية والتوجيه الأولي ==== في الحالات التي تحدد فيها المجتمع وجود خطر كبير لغياب الملحوظية، يمكن تزويد المستخدمين ببدائل محددة من المجتمع. هذه إحدى المراحل التي تُقدّم فيها رسائل ومحتويات أولية محددة من المجتمع كإرشاد أولي، والتي يمكن أن تتضمن اعتبارات وأمثلة مفيدة للمتابعة. <gallery mode="nolines" widths="400" heights="225" perrow="2" caption="رسم توضيحي لعملية التحقق من الملحوظية والإرشادات الأولية من المجتمعات قبل بدء التحرير."> File:Article Guidance - initial intervention 19.png|توفير بدائل عند وجود مشاكل تتعلق بأهمية المصادر File:Article Guidance - initial intervention 20.png|التوجيهات الأولية للمجتمع في كتابة المقال </gallery> <span id="The_editing_stage"></span> ==== مرحلة التحرير ==== سيتم إنشاء بقية المحتوى في المحرر المرئي عادةً. قد تتناول الدراسات المستقبلية كيفية تقديم مساعدة أفضل للمستخدمين أثناء التحرير. [[File:Article Guidance - initial intervention 21.png|الانتقال إلى المحرر المرئي لمتابعة التحرير|none|thumb|400x400px]] <span id="Participate"></span> ==المشاركة== بينما نستكشف هذا المجال، نحتاج إلى التعاون مع المجتمعات المحلية من أجل: * تبادل الأفكار حول الأساليب التي يجب مراعاتها وتجنبها وتجربتها وقياسها لتقييم أثر المشروع. * تحديد أنواع المقالات التي قد يكون الإرشاد مفيدًا فيها. * التعاون لوضع مجموعةٍ أوليةٍ من المخططات التفصيلية للأنواع المختارة من المقالات. * محاولة استخدام المخططات التفصيلية لإنشاء المقالات والأقسام في صفحات الويكي الخاصة بهم. يرجى مشاركة أفكاركم في [[Talk:Article guidance|صفحة النقاش]] للمساعدة في تحسين الأفكار الأوليّة و{{ll|Article guidance/Pilot wikis and collaborators#Collaborators|التسجيل في هذه الصفحة}}. {{Tracked|T396029}} 05i4kd300o026nujnsres8pwixynj50 Instant Diffs/News 0 2328886 8365110 8363241 2026-05-04T10:29:02Z Serhio Magpie 1775170 /* Changelog */ Updated changelog for the V5.4 8365110 wikitext text/x-wiki This page documents the development history and changes for {{ll|Instant Diffs}}, a gadget that improves the user experience when viewing diffs and revisions across MediaWiki projects. Instant Diffs uses zero-based versioning, starting from version 0. Each version number represents the changes made since the previous version (e.g., version 1 includes changes from v0 to v1, version 5 includes changes from v4 to v5). This incremental approach allows for focused development cycles where different aspects of the gadget can be systematically improved. Major version numbers are incremented when a planned set of improvements is completed. == Changelog == <onlyinclude> === V5.4 <small>(current)</small> === ==== Updates ==== * Added additional CSS variables for customizing Instant Diffs link colors and backgrounds. * Added <code>rateLimit</code> and <code>retries</code> configuration parameters for deployment. * Added support for MediaWiki watchlist labels feature. * Added support for links on the {{ll|Help:Log|Logs}} special page. * <s>Integrated the new watchlist popup for [[MediaWiki 1.47]].</s> * Visual Feedback: Links are now visually marked as seen in {{ll|Extension:GlobalWatchlist|GlobalWatchlist}}. * Improved appending section name (hash) to link URLs. * Added processing of the page redirect links. * Refactor extension integrations into modular structure. * Optimized link processing by replacing .filter().map() chain with single-pass for-of loop to reduce iterations. * Added user info card button for the foreign diffs. ==== Settings ==== * Added a new preference setting to enable or disable the watchlist popup. ==== Projects ==== * Added support for the dark-grey {{ll|Extension:Theme|theme}} in the {{ll|Skin:Vector|Vector}} legacy skin. * Fixed the border-radius styling of the action button in the {{ll|Skin:Citizen|Citizen}} skin. * Minor cleanup of styles for the {{ll|Skin:MonoBook|MonoBook}} skin. * Fixed diff footer in the {{ll|Minerva Neue}} skin. ==== Integrations ==== * Fixed links to the [[:commons:User:JWBTH/CD|Convenient Discussions]] comments. ==== Fixes ==== * Changed the icon of the Pending Changes navigation action to "eyeClosed" to match default appearance. * Fixed styles edge case where Instant Diffs links render over Codex buttons. * Fixed rollback link confirmation by adding support for the new "data-mw-interface" attribute ([[phab:T409187]]). * Fixed rollback link empty title error for short wgArticlePath configurations like in Miraheze. * Fixed watchlist popup not updating on subsequent watch/unwatch actions. * Fixed text selection occurring during alt+click interactions. * Fixed blocks shrink when viewing revisions on {{ll|Wikidata}}. * Fixed a malformed URI error when parsing hashes in the Article class. * Fixed CSRF token handling in the Api class. * Fixed CSRF token issues when viewing diffs from the {{ll|Extension:GlobalWatchlist|GlobalWatchlist}}. * Fixed Instant Diffs icons in empty links in new Parsoid. {{pb}} ----- {{pb}} === V5.0 <small>(2025-12-26)</small> === ==== Updates ==== * Added support for custom actions in the Actions menu. See the {{ll|Instant Diffs/API#Custom_Actions|Developer guide}}. * Added support for manual link configuration through the "data-instantdiffs-options" attribute. See the {{ll|Instant Diffs/API|Developer guide}}. * Significantly rewrote the deployment script, which now supports more flexible configuration. See available deployment configuration options on [https://github.com/SerDIDG/instant-diffs?tab=readme-ov-file#development GitHub]. * Added a category list at the bottom of the content when viewing revisions. * Revision content now automatically scrolls to the target section when a hash is provided in the input link. * Added new actions to the Actions menu, such as "View page info" and "Edit/View source". * Optimized request count in the Page classes by requesting more data with a single page info request. * More strict selector for matching links in user-contributed content. * Added support for different local special pages that format short links to diffs and revisions, such as [[Special:ComparePages]], etc. * Added support for different local special pages where Instant Diffs can run, such as [[Special:AbuseLog]], [[Special:EditTags]], etc. * Added a view refresh process after actions like rollback have completed. * Added support for diff navigation links in the [[Special:Diff]] page in the {{ll|Minerva Neue}} skin. ==== Settings ==== * Completely rewrote the Settings Dialog. All settings are now organized into tabs. * Added the ability to pin actions to the Quick Actions menu. To pin an action, open '''Actions → Settings → Pinned Actions''' and select the actions you want to pin. * Added new options to: include section hashes in revision link URLs, close the View Dialog by clicking outside of it, and choose between different View Dialog dimensions. ==== Projects ==== * Added support for the "Last modified" link in the sidebar as an extension for the {{ll|Skin:Citizen|Citizen}} skin. ==== Integrations ==== * {{ll|Extension:Translate|Translate}} extension. Adds Instant Diffs actions to the summary links in the editor sidebar. ==== Fixes ==== * Added additional dependencies for foreign pages, especially for {{ll|Wikidata}} revisions and media info in [[:commons:|Commons]]. * Fixed scrolling to reference anchors when viewing revisions. * Fixed mobile responsiveness for the latest MediaWiki versions in {{ll|Minerva Neue}} skin. * Fixed the hotkey action map for RTL languages. * Fixed notification inaccessibility on mobile view. * Fixed infinite spinner after committing rollback action in the Page class. * Fixed relative links with hashes to be absolute when viewing foreign diffs or revisions. * Excluded links with action=edit query parameter from processing. * Excluded redirect/page links from processing to prevent overwhelming visual clutter. * Fixed regression in legacy MediaWiki versions: 1.39.x. * Restored original link titles when hovering over them in some cases. * Added a resume process after unload process if a user has returned to the previous page. * Fixed mobile diff footer styles in the {{ll|Minerva Neue}} skin.</onlyinclude> {{pb}} ----- {{pb}} === V4.0 <small>(2025-07-29)</small> === ==== Updates ==== * Added support for diffs and revisions from foreign projects (linked to the {{ll|Extension:MediaWikiFarm|MediaWikiFarm}}); see additional notes in the Integrations section. This required a significant rewrite of all page and navigation actions to support different hostnames, prefixes, etc. * Moved translation files to {{ll|translatewiki.net|Translatewiki}}. You can help with translating the project [[translatewiki:Translating:Instant_Diffs|here]]. * Improved performance of requesting the revision's dependencies, which now will not block the View from showing content. * Added the Request Manager, which handles all AJAX requests in the View Dialog. All active AJAX requests will now be aborted when the dialog is closing, preventing JavaScript errors and unwanted behaviors. * Added the ConfigManager, which handles backup and restoration of mw.config and similar custom Maps of MediaWiki constants. * Implemented functionality of the new CheckUser extension. * Added ability to watch/unwatch pages in the Actions menu. After the watch status is changed, the current page watchstar status and/or watchlist line statuses are also updated. Render expiry status icon in the watchlist when updating watch/unwatch status. * Added a proper deploy script that helps deploy the Instant Diffs bundle on different projects. Adapted from the [https://github.com/wikimedia-gadgets/twinkle-starter/blob/master/scripts/deploy.js twinkle-starter] repository. * Added ability to run Instant Diffs in standalone mode, which can be useful for developers who want to use Instant Diffs as part of their gadget. * Added support for Greasemonkey mode, which enables running Instant Diffs from browser script managers. ==== Settings ==== * Added a new option to enable keyboard hotkeys. ==== Projects ==== * Added support for viewing diffs and revisions from {{ll|Wikidata}} as a foreign project in [[Special:Watchlist]] and similar special pages. * Added support for wikibase and lexeme labels as View Dialog titles when viewing diffs or revisions from {{ll|Wikidata}}. * Added support for {{ll|Extension:WikiLambda|WikiLambda}} page labels in the [[w:Wikifunctions|Wikifunctions]] project. ==== Integrations ==== * {{ll|Extension:GlobalContributions|GlobalContributions}} extension. Implemented viewing foreign diffs and revisions. * {{ll|Extension:GlobalWatchlist|GlobalWatchlist}} extension. Implemented viewing foreign diffs. Follows defensive programming when executing external script for the Global Watchlist. * [[w:Wikipedia:Twinkle|Twinkle]] gadget by AzaToth. Made a [https://github.com/wikimedia-gadgets/twinkle/pull/2195 PR] to the source code. Implemented View Dialog closing when clicking on Twinkle links in it. * [[meta:User:Xiplus/TwinkleGlobal|TwinkleGlobal]] gadget by Xiplus. Made a [https://github.com/xiplus-mediawiki-programs/twinkle-global/pull/88 PR] to the source code. Implemented View Dialog closing when clicking on Twinkle links in it. ==== Fixes ==== * Skip links with empty hrefs from adding target blank attributes in the View Dialog. * User-specified language attribute will now be added to all API requests where possible. * Fixed action button focus loop in the View Dialog. * Fixed content visibility in the View Dialog on very heavily loaded DOM. Also hide content of the previous diff or revision before teardown. * Purge the local storage cache if the user is running a different version than last time. * Always request the inline table diff on mobile view. * Fixed prediction of the mobile server hostname before site info request is completed. * Fixed displaying LTR content in RTL languages. * Fixed a state where document.body is not available yet; ensure the DOM is completely loaded before running Instant Diffs DOM manipulation processes. * Fixed inaccessibility of floated elements, like notifications, when the View Dialog is open. {{pb}} ----- {{pb}} === V3.0 <small>(2025-06-30)</small> === ==== Updates ==== * Added lazy-loading of content in the View Dialog, which now will not prevent the window from opening while content is being requested. This significantly improved the opening speed of the View Dialog and optimized resource usage caused by excessive DOM manipulation from OOjs UI internal processes. * Added progress bar loader at the top of the View Dialog to indicate the loading process. * Added hotkeys to fully navigate the menu via keyboard in the View Dialog. Also added focus restoration on the navigation button after navigating to another diff or revision is completed. * Updated the View Dialog dimensions; the window height now always takes all available screen height to prevent the window from jumping around while navigating between diffs or revisions. * Implemented functionality of the {{ll|Visual diffs}} format toggle button. * Implemented functionality of the {{ll|Help:Diff#Inline_diffs|Inline}} format toggle button. * Implemented [[w:Ajax (programming)|AJAX]] functionality for the patrol and rollback links. These links will no longer open pages in a new tab. The rollback link will now always ask for confirmation. * Implemented structured media info for the File namespace in the Revision view. * Started migration from nodes rendered by jQuery to hyperscript. * Converted translation files to JSON format and added qqq.json file for string definitions. * Improved the process of saving setting options and updated the success message when saving options in the Settings Dialog. * Added time and info loggers in the browser console for processes inside the View Dialog. ==== Integrations ==== * Added beta support for the {{ll|Extension:WikiLambda|WikiLambda}} app when viewing revisions in the [[w:Wikifunctions|Wikifunctions]] project. ==== Fixes ==== * Restored support for legacy MediaWiki versions. * Completely removed jQuery from the main thread that finds links on the page and renders actions. * Fixed excessive display of notification popups for critical errors. * Fixed the Alt key action for links with the target blank attribute. * Fixed settings not being saved for anonymous users. * Fixed early leakage of the script code to the global scope before the script was fully initialized. * Fixed fallback to English for untranslated strings in other languages. * Fixed relative links to be absolute in the messages in the Settings Dialog, so they will navigate to the correct project and website regardless of where Instant Diffs was run. * Changed where the Window Manager container is appended to the teleport target ([[phab:T348286]]). * Restore document scroll position after the View Dialog closes, needed to fix unwanted behavior on mobile devices. * Improved styles for the {{ll|Minerva Neue}}, {{ll|Skin:MonoBook|MonoBook}}, {{ll|Skin:Citizen|Citizen}}, and {{ll|Skin:Overclocked|Overclocked}} skins. {{pb}} ----- {{pb}} === V2.0 <small>(2025-06-14)</small> === ==== Updates ==== * Source code of Instant Diffs was moved to the [https://github.com/SerDIDG/instant-diffs GitHub repository]. * Single source code file was split into separate self-contained modules, and the code was completely rewritten using ES6+ ([[w:ECMAScript_version_history#ES.Next|ES.Next]]) language edition and [[w:esbuild|esbuild]] for bundling. * Completely rewrote styles from [[w:CSS|CSS]] to [[w:Less (style sheet language)|LESS]] language. * Designed an official logo and [[commons:Category:Instant Diffs|logo assets]] for Instant Diffs. * Rewrote toggle between viewing diff and revision, which now supports navigation in both modes separately. * Optimized requests when processing links in user-generated content. Set up an observer that lazily requests required diff or revision content only when links enter the visible area of the screen. * Improved parsing and validation of link parts, which improved accuracy in edge cases and user mistakes in formatting links. * Optimized link selector assembly that searches for links to process; selectors now also include mobile server variations to cover more user-generated content. * Added support for different local special pages that format short links to diffs and revisions, such as [[Special:Redirect]], etc. * Improved script interoperability with processed links by changing the link title attribute only when the user hovers over it. * Added a change info header that contains usual information such as author name, summary, etc., in the revision view. * Improved responsiveness: simplified navigation buttons by showing shorter labels in mobile view, allowing restoration of Snapshot navigation button display. * Optimized project-specific dependency configuration and dependency loading in the View Dialog. * Show actual revision link instead of timestamp on Minerva on some special pages. * Added time and info loggers in the browser console for speed debugging purposes, as well as count of processed links. ==== Settings ==== * Added brand-new user interface to customize script settings through a dialog window. This will be referred to as "Settings Dialog" going forward. * The script first saves user settings in the [[w:Web storage|local storage]] of the user's browser. If the user is logged in, the script checks whether the {{ll|Extension:GlobalPreferences|GlobalPreferences}} extension is installed. If it is, the settings are saved globally across all linked projects. Otherwise, the settings are saved locally on the current project. ==== Projects ==== * Improved display of revisions in the {{ll|Wikidata}} project. * Improved styles for skins used on Fandom sites. Fixed View Dialog being overlapped by the site header; this can now be tweaked by setting a CSS variable for the specific skin if needed. * Improved styles for the {{ll|Skin:Overclocked|Overclocked}} skin and the PCGamingWiki site. ==== Localization ==== * Added new localizations for German, Spanish, French, Hebrew, Italian, Polish, and Portuguese language files. ==== Fixes ==== * Restore focus on the View Dialog after closing the Settings Dialog. * To show diffs and revisions in the user's language, added missing language parameter to requests. * Removed back link from the menu when switching between diff and revision. {{pb}} ----- {{pb}} === V1.0 <small>(2025-05-27)</small> === * Script was renamed to "Instant Diffs" following a suggestion from the Wikipedia Discord community to better represent the settled direction of functionality. * In response to the global [[m:Community Wishlist Survey 2022/Watchlists/View diffs in the Watchlist|community request]], script sources were moved first to [[commons:Special:PermanentLink/1036811799|Wikimedia Commons]], and then to the {{ll|Instant Diffs|MediaWiki}} project, to highlight that the script is ready to be used in external wiki projects. ==== Updates ==== * Added an action button (❖ for diffs or ✪ for revisions) after the diff link to open the Instant Diffs dialog, which shows the difference between revisions. * Enhanced page action (➔), which now includes the section name as a hash to navigate to the exact section where changes were made. * Added support for different local special pages that format short links to diffs and revisions, such as [[Special:PermanentLink]], [[Special:Diff]], etc. * Added support for different local special pages where Instant Diffs can run, such as [[Special:Watchlist]], [[Special:Contributions]], [[Special:RecentChanges]], [[Special:RecentChangesLinked]], [[Special:NewPages]], {{ll|Help:History|Page History}}, etc. * Added new button "Compare selected revisions" to dynamically compare selected revisions in the Page History. * Added row highlights in Watchlist-like special pages when the dialog opens on the corresponding link. * Mark links as visited in the Watchlist when the dialog opens on the corresponding link. * Added visual marks to the action links that indicate hidden or non-existing revisions and general errors. * Added navigation menu in the dialog that enables navigation between diffs and revisions of the chosen page. * Added ability to navigate between links on the page to quickly view all diffs posted by users. This feature creates a snapshot of all diff links on the page, enabling sequential navigation through them. This will be referred to as "Snapshot navigation" going forward. * Added a context actions menu in the dialog, allowing you to copy the link or an internal wiki link, and navigate to the page, its history, and discussion. * Added constant to prevent Instant Diffs from running twice. * Added ability to open links in the current tab by pressing Alt+Click instead of opening the Instant Diffs dialog. ==== Integrations ==== * {{ll|Extension:FlaggedRevs|Flagged Revisions}} extension. Displays the "View all pending changes" button in the View Dialog. * [[commons:Special:MyLanguage/User:JWBTH/CD|Convenient Discussions]] gadget by Jack who built the house. Enhances page action links with hashes that navigate to the corresponding comment where changes were made. * [[w:User:Cacycle/wikEdDiff|wikEdDiff]] gadget by Cacycle. Implemented using a workaround by resetting the state of the diff table. ==== Localization ==== * Added basic support for localizations. Added English and Ukrainian translations. ==== Fixes ==== * Optimized dependency loading by making it load on demand (lazy loading). * Optimized the main thread that finds links on the page and renders actions by moving most of the code from jQuery to native JavaScript. {{pb}} ----- {{pb}} === V0.0 <small>(2021-07-24)</small> === * Initial release of the [[:ru:Special:PermanentLink/115641784|prototype]] (originally named "diffOriginLinks") that explores possibilities for improving the user experience of templates that format diff links. * Displays a link to the page where the edit was made, enabling {{ll|Page Previews}} popups when hovering over it. [[Category:Instant Diffs]] tvplfai764354dzmd4w0q4l4pmv5d84 8365112 8365110 2026-05-04T10:35:02Z Serhio Magpie 1775170 8365112 wikitext text/x-wiki This page documents the development history and changes for {{ll|Instant Diffs}}, a gadget that improves the user experience when viewing diffs and revisions across MediaWiki projects. Instant Diffs uses zero-based versioning, starting from version 0. Each version number represents the changes made since the previous version (e.g., version 1 includes changes from v0 to v1, version 5 includes changes from v4 to v5). This incremental approach allows for focused development cycles where different aspects of the gadget can be systematically improved. Major version numbers are incremented when a planned set of improvements is completed. == Changelog == <onlyinclude> === V5.4 <small>(current)</small> === ==== Updates ==== * Added additional CSS variables for customizing Instant Diffs link colors and backgrounds. * Added <code>rateLimit</code> and <code>retries</code> configuration parameters for deployment. * Added support for MediaWiki watchlist labels feature. * Added support for links on the {{ll|Help:Log|Logs}} special page. * <s>Integrated the new watchlist popup for [[MediaWiki 1.47]].</s> * Visual Feedback: Links are now visually marked as seen in {{ll|Extension:GlobalWatchlist|GlobalWatchlist}}. * Improved appending section name (hash) to link URLs. * Added processing of the page redirect links. * Refactor extension integrations into modular structure. * Optimized link processing by replacing .filter().map() chain with single-pass for-of loop to reduce iterations. * Added user info card button for the foreign diffs. ==== Settings ==== * Added a new preference setting to enable or disable the watchlist popup. ==== Projects ==== * Added support for the dark-grey {{ll|Extension:Theme|theme}} in the {{ll|Skin:Vector|Vector}} legacy skin. * Fixed the border-radius styling of the action button in the {{ll|Skin:Citizen|Citizen}} skin. * Minor cleanup of styles for the {{ll|Skin:MonoBook|MonoBook}} skin. * Fixed diff footer in the {{ll|Minerva Neue}} skin. ==== Integrations ==== * Fixed links to the [[:commons:User:JWBTH/CD|Convenient Discussions]] comments. ==== Fixes ==== * Changed the icon of the Pending Changes navigation action to "eyeClosed" to match default appearance. * Fixed styles edge case where Instant Diffs links render over Codex buttons. * Fixed rollback link confirmation by adding support for the new "data-mw-interface" attribute ([[phab:T409187]]). * Fixed rollback link empty title error for short wgArticlePath configurations like in Miraheze. * Fixed watchlist popup not updating on subsequent watch/unwatch actions. * Fixed text selection occurring during alt+click interactions. * Fixed blocks shrink when viewing revisions on {{ll|Wikidata}}. * Fixed a malformed URI error when parsing hashes in the Article class. * Fixed CSRF token handling in the Api class. * Fixed CSRF token issues when viewing diffs from the {{ll|Extension:GlobalWatchlist|GlobalWatchlist}}. * Fixed Instant Diffs icons in empty links in new Parsoid.</onlyinclude> {{pb}} ----- {{pb}} === V5.0 <small>(2025-12-26)</small> === ==== Updates ==== * Added support for custom actions in the Actions menu. See the {{ll|Instant Diffs/API#Custom_Actions|Developer guide}}. * Added support for manual link configuration through the "data-instantdiffs-options" attribute. See the {{ll|Instant Diffs/API|Developer guide}}. * Significantly rewrote the deployment script, which now supports more flexible configuration. See available deployment configuration options on [https://github.com/SerDIDG/instant-diffs?tab=readme-ov-file#development GitHub]. * Added a category list at the bottom of the content when viewing revisions. * Revision content now automatically scrolls to the target section when a hash is provided in the input link. * Added new actions to the Actions menu, such as "View page info" and "Edit/View source". * Optimized request count in the Page classes by requesting more data with a single page info request. * More strict selector for matching links in user-contributed content. * Added support for different local special pages that format short links to diffs and revisions, such as [[Special:ComparePages]], etc. * Added support for different local special pages where Instant Diffs can run, such as [[Special:AbuseLog]], [[Special:EditTags]], etc. * Added a view refresh process after actions like rollback have completed. * Added support for diff navigation links in the [[Special:Diff]] page in the {{ll|Minerva Neue}} skin. ==== Settings ==== * Completely rewrote the Settings Dialog. All settings are now organized into tabs. * Added the ability to pin actions to the Quick Actions menu. To pin an action, open '''Actions → Settings → Pinned Actions''' and select the actions you want to pin. * Added new options to: include section hashes in revision link URLs, close the View Dialog by clicking outside of it, and choose between different View Dialog dimensions. ==== Projects ==== * Added support for the "Last modified" link in the sidebar as an extension for the {{ll|Skin:Citizen|Citizen}} skin. ==== Integrations ==== * {{ll|Extension:Translate|Translate}} extension. Adds Instant Diffs actions to the summary links in the editor sidebar. ==== Fixes ==== * Added additional dependencies for foreign pages, especially for {{ll|Wikidata}} revisions and media info in [[:commons:|Commons]]. * Fixed scrolling to reference anchors when viewing revisions. * Fixed mobile responsiveness for the latest MediaWiki versions in {{ll|Minerva Neue}} skin. * Fixed the hotkey action map for RTL languages. * Fixed notification inaccessibility on mobile view. * Fixed infinite spinner after committing rollback action in the Page class. * Fixed relative links with hashes to be absolute when viewing foreign diffs or revisions. * Excluded links with action=edit query parameter from processing. * Excluded redirect/page links from processing to prevent overwhelming visual clutter. * Fixed regression in legacy MediaWiki versions: 1.39.x. * Restored original link titles when hovering over them in some cases. * Added a resume process after unload process if a user has returned to the previous page. * Fixed mobile diff footer styles in the {{ll|Minerva Neue}} skin. {{pb}} ----- {{pb}} === V4.0 <small>(2025-07-29)</small> === ==== Updates ==== * Added support for diffs and revisions from foreign projects (linked to the {{ll|Extension:MediaWikiFarm|MediaWikiFarm}}); see additional notes in the Integrations section. This required a significant rewrite of all page and navigation actions to support different hostnames, prefixes, etc. * Moved translation files to {{ll|translatewiki.net|Translatewiki}}. You can help with translating the project [[translatewiki:Translating:Instant_Diffs|here]]. * Improved performance of requesting the revision's dependencies, which now will not block the View from showing content. * Added the Request Manager, which handles all AJAX requests in the View Dialog. All active AJAX requests will now be aborted when the dialog is closing, preventing JavaScript errors and unwanted behaviors. * Added the ConfigManager, which handles backup and restoration of mw.config and similar custom Maps of MediaWiki constants. * Implemented functionality of the new CheckUser extension. * Added ability to watch/unwatch pages in the Actions menu. After the watch status is changed, the current page watchstar status and/or watchlist line statuses are also updated. Render expiry status icon in the watchlist when updating watch/unwatch status. * Added a proper deploy script that helps deploy the Instant Diffs bundle on different projects. Adapted from the [https://github.com/wikimedia-gadgets/twinkle-starter/blob/master/scripts/deploy.js twinkle-starter] repository. * Added ability to run Instant Diffs in standalone mode, which can be useful for developers who want to use Instant Diffs as part of their gadget. * Added support for Greasemonkey mode, which enables running Instant Diffs from browser script managers. ==== Settings ==== * Added a new option to enable keyboard hotkeys. ==== Projects ==== * Added support for viewing diffs and revisions from {{ll|Wikidata}} as a foreign project in [[Special:Watchlist]] and similar special pages. * Added support for wikibase and lexeme labels as View Dialog titles when viewing diffs or revisions from {{ll|Wikidata}}. * Added support for {{ll|Extension:WikiLambda|WikiLambda}} page labels in the [[w:Wikifunctions|Wikifunctions]] project. ==== Integrations ==== * {{ll|Extension:GlobalContributions|GlobalContributions}} extension. Implemented viewing foreign diffs and revisions. * {{ll|Extension:GlobalWatchlist|GlobalWatchlist}} extension. Implemented viewing foreign diffs. Follows defensive programming when executing external script for the Global Watchlist. * [[w:Wikipedia:Twinkle|Twinkle]] gadget by AzaToth. Made a [https://github.com/wikimedia-gadgets/twinkle/pull/2195 PR] to the source code. Implemented View Dialog closing when clicking on Twinkle links in it. * [[meta:User:Xiplus/TwinkleGlobal|TwinkleGlobal]] gadget by Xiplus. Made a [https://github.com/xiplus-mediawiki-programs/twinkle-global/pull/88 PR] to the source code. Implemented View Dialog closing when clicking on Twinkle links in it. ==== Fixes ==== * Skip links with empty hrefs from adding target blank attributes in the View Dialog. * User-specified language attribute will now be added to all API requests where possible. * Fixed action button focus loop in the View Dialog. * Fixed content visibility in the View Dialog on very heavily loaded DOM. Also hide content of the previous diff or revision before teardown. * Purge the local storage cache if the user is running a different version than last time. * Always request the inline table diff on mobile view. * Fixed prediction of the mobile server hostname before site info request is completed. * Fixed displaying LTR content in RTL languages. * Fixed a state where document.body is not available yet; ensure the DOM is completely loaded before running Instant Diffs DOM manipulation processes. * Fixed inaccessibility of floated elements, like notifications, when the View Dialog is open. {{pb}} ----- {{pb}} === V3.0 <small>(2025-06-30)</small> === ==== Updates ==== * Added lazy-loading of content in the View Dialog, which now will not prevent the window from opening while content is being requested. This significantly improved the opening speed of the View Dialog and optimized resource usage caused by excessive DOM manipulation from OOjs UI internal processes. * Added progress bar loader at the top of the View Dialog to indicate the loading process. * Added hotkeys to fully navigate the menu via keyboard in the View Dialog. Also added focus restoration on the navigation button after navigating to another diff or revision is completed. * Updated the View Dialog dimensions; the window height now always takes all available screen height to prevent the window from jumping around while navigating between diffs or revisions. * Implemented functionality of the {{ll|Visual diffs}} format toggle button. * Implemented functionality of the {{ll|Help:Diff#Inline_diffs|Inline}} format toggle button. * Implemented [[w:Ajax (programming)|AJAX]] functionality for the patrol and rollback links. These links will no longer open pages in a new tab. The rollback link will now always ask for confirmation. * Implemented structured media info for the File namespace in the Revision view. * Started migration from nodes rendered by jQuery to hyperscript. * Converted translation files to JSON format and added qqq.json file for string definitions. * Improved the process of saving setting options and updated the success message when saving options in the Settings Dialog. * Added time and info loggers in the browser console for processes inside the View Dialog. ==== Integrations ==== * Added beta support for the {{ll|Extension:WikiLambda|WikiLambda}} app when viewing revisions in the [[w:Wikifunctions|Wikifunctions]] project. ==== Fixes ==== * Restored support for legacy MediaWiki versions. * Completely removed jQuery from the main thread that finds links on the page and renders actions. * Fixed excessive display of notification popups for critical errors. * Fixed the Alt key action for links with the target blank attribute. * Fixed settings not being saved for anonymous users. * Fixed early leakage of the script code to the global scope before the script was fully initialized. * Fixed fallback to English for untranslated strings in other languages. * Fixed relative links to be absolute in the messages in the Settings Dialog, so they will navigate to the correct project and website regardless of where Instant Diffs was run. * Changed where the Window Manager container is appended to the teleport target ([[phab:T348286]]). * Restore document scroll position after the View Dialog closes, needed to fix unwanted behavior on mobile devices. * Improved styles for the {{ll|Minerva Neue}}, {{ll|Skin:MonoBook|MonoBook}}, {{ll|Skin:Citizen|Citizen}}, and {{ll|Skin:Overclocked|Overclocked}} skins. {{pb}} ----- {{pb}} === V2.0 <small>(2025-06-14)</small> === ==== Updates ==== * Source code of Instant Diffs was moved to the [https://github.com/SerDIDG/instant-diffs GitHub repository]. * Single source code file was split into separate self-contained modules, and the code was completely rewritten using ES6+ ([[w:ECMAScript_version_history#ES.Next|ES.Next]]) language edition and [[w:esbuild|esbuild]] for bundling. * Completely rewrote styles from [[w:CSS|CSS]] to [[w:Less (style sheet language)|LESS]] language. * Designed an official logo and [[commons:Category:Instant Diffs|logo assets]] for Instant Diffs. * Rewrote toggle between viewing diff and revision, which now supports navigation in both modes separately. * Optimized requests when processing links in user-generated content. Set up an observer that lazily requests required diff or revision content only when links enter the visible area of the screen. * Improved parsing and validation of link parts, which improved accuracy in edge cases and user mistakes in formatting links. * Optimized link selector assembly that searches for links to process; selectors now also include mobile server variations to cover more user-generated content. * Added support for different local special pages that format short links to diffs and revisions, such as [[Special:Redirect]], etc. * Improved script interoperability with processed links by changing the link title attribute only when the user hovers over it. * Added a change info header that contains usual information such as author name, summary, etc., in the revision view. * Improved responsiveness: simplified navigation buttons by showing shorter labels in mobile view, allowing restoration of Snapshot navigation button display. * Optimized project-specific dependency configuration and dependency loading in the View Dialog. * Show actual revision link instead of timestamp on Minerva on some special pages. * Added time and info loggers in the browser console for speed debugging purposes, as well as count of processed links. ==== Settings ==== * Added brand-new user interface to customize script settings through a dialog window. This will be referred to as "Settings Dialog" going forward. * The script first saves user settings in the [[w:Web storage|local storage]] of the user's browser. If the user is logged in, the script checks whether the {{ll|Extension:GlobalPreferences|GlobalPreferences}} extension is installed. If it is, the settings are saved globally across all linked projects. Otherwise, the settings are saved locally on the current project. ==== Projects ==== * Improved display of revisions in the {{ll|Wikidata}} project. * Improved styles for skins used on Fandom sites. Fixed View Dialog being overlapped by the site header; this can now be tweaked by setting a CSS variable for the specific skin if needed. * Improved styles for the {{ll|Skin:Overclocked|Overclocked}} skin and the PCGamingWiki site. ==== Localization ==== * Added new localizations for German, Spanish, French, Hebrew, Italian, Polish, and Portuguese language files. ==== Fixes ==== * Restore focus on the View Dialog after closing the Settings Dialog. * To show diffs and revisions in the user's language, added missing language parameter to requests. * Removed back link from the menu when switching between diff and revision. {{pb}} ----- {{pb}} === V1.0 <small>(2025-05-27)</small> === * Script was renamed to "Instant Diffs" following a suggestion from the Wikipedia Discord community to better represent the settled direction of functionality. * In response to the global [[m:Community Wishlist Survey 2022/Watchlists/View diffs in the Watchlist|community request]], script sources were moved first to [[commons:Special:PermanentLink/1036811799|Wikimedia Commons]], and then to the {{ll|Instant Diffs|MediaWiki}} project, to highlight that the script is ready to be used in external wiki projects. ==== Updates ==== * Added an action button (❖ for diffs or ✪ for revisions) after the diff link to open the Instant Diffs dialog, which shows the difference between revisions. * Enhanced page action (➔), which now includes the section name as a hash to navigate to the exact section where changes were made. * Added support for different local special pages that format short links to diffs and revisions, such as [[Special:PermanentLink]], [[Special:Diff]], etc. * Added support for different local special pages where Instant Diffs can run, such as [[Special:Watchlist]], [[Special:Contributions]], [[Special:RecentChanges]], [[Special:RecentChangesLinked]], [[Special:NewPages]], {{ll|Help:History|Page History}}, etc. * Added new button "Compare selected revisions" to dynamically compare selected revisions in the Page History. * Added row highlights in Watchlist-like special pages when the dialog opens on the corresponding link. * Mark links as visited in the Watchlist when the dialog opens on the corresponding link. * Added visual marks to the action links that indicate hidden or non-existing revisions and general errors. * Added navigation menu in the dialog that enables navigation between diffs and revisions of the chosen page. * Added ability to navigate between links on the page to quickly view all diffs posted by users. This feature creates a snapshot of all diff links on the page, enabling sequential navigation through them. This will be referred to as "Snapshot navigation" going forward. * Added a context actions menu in the dialog, allowing you to copy the link or an internal wiki link, and navigate to the page, its history, and discussion. * Added constant to prevent Instant Diffs from running twice. * Added ability to open links in the current tab by pressing Alt+Click instead of opening the Instant Diffs dialog. ==== Integrations ==== * {{ll|Extension:FlaggedRevs|Flagged Revisions}} extension. Displays the "View all pending changes" button in the View Dialog. * [[commons:Special:MyLanguage/User:JWBTH/CD|Convenient Discussions]] gadget by Jack who built the house. Enhances page action links with hashes that navigate to the corresponding comment where changes were made. * [[w:User:Cacycle/wikEdDiff|wikEdDiff]] gadget by Cacycle. Implemented using a workaround by resetting the state of the diff table. ==== Localization ==== * Added basic support for localizations. Added English and Ukrainian translations. ==== Fixes ==== * Optimized dependency loading by making it load on demand (lazy loading). * Optimized the main thread that finds links on the page and renders actions by moving most of the code from jQuery to native JavaScript. {{pb}} ----- {{pb}} === V0.0 <small>(2021-07-24)</small> === * Initial release of the [[:ru:Special:PermanentLink/115641784|prototype]] (originally named "diffOriginLinks") that explores possibilities for improving the user experience of templates that format diff links. * Displays a link to the page where the edit was made, enabling {{ll|Page Previews}} popups when hovering over it. [[Category:Instant Diffs]] apnltco4mg64z434tehbl07pvwouzcu Help talk:Watchlist labels 13 2348057 8364414 8344791 2026-05-03T15:10:36Z VasuVR 54050 /* Watchlist labels go missing when using HotCat */ new section 8364414 wikitext text/x-wiki == Watchlist notes == This sounds great; thanks for working on this technical feature! [[File:Notes_for_watchlisted_pages_(proposed_Wikipedia_feature).png|thumb|How entering a note right after watchlisting could look like]]Maybe you could also look into the concept of Watchlist notes – I think these may even be more useful than labels and best in combination with labels. I think many users would use labels to add notes and this could also be revisited at a later point – I think it would be best to also add the ability to add notes after the labels have been implemented. Please see [[m:Community Wishlist/W437|W437: Notes for watchlisted pages]], thanks.<br> [[User:Prototyperspective|Prototyperspective]] ([[User talk:Prototyperspective|talk]]) 15:14, 21 January 2026 (UTC) :@[[User:Prototyperspective|Prototyperspective]] Sounds like a great idea, we can pass this one to the designers, ideally you would leave a wish for this separately, because first we will analyse adoption to the initial feature to identify if to spend more time on this or not, and having votes on a new wish could contribute to the analysis as an additional argument. [[User:KSiebert (WMF)|KSiebert (WMF)]] ([[User talk:KSiebert (WMF)|talk]]) 11:30, 2 February 2026 (UTC) == Ease of adding labels == {{tracked|T415173}} Similar to the previous post, my suggestion is that the option to add labels to a page in your watchlist should be available in the dropdown at the moment you add the page to the watchlist. This prevents having to search for the page in the watchlist every single time. ~ [[User:Misha Vargas|<span style="font-family:Oswald;color:#5000B0;text-shadow:#C0C0C0 0.0em 0.0em 0.8em;font-weight:bold;">Misha Vargas</span>]] ([[User talk:Misha Vargas|talk]] &#124; [[Special:Contributions/Misha_Vargas|contribs]]) 10:14, 2 February 2026 (UTC) :Thanks for the suggestion, you will be happy to hear that we just started working on that, see Phase 2: https://meta.wikimedia.org/wiki/Community_Tech/Watchlist_Labels#Acceptance_Criteria_Phase_2 [[User:KSiebert (WMF)|KSiebert (WMF)]] ([[User talk:KSiebert (WMF)|talk]]) 11:27, 2 February 2026 (UTC) ::Glad to hear this, {{u|KSiebert (WMF)}}!, and thanks for this neat tool. It sounded like this was intended in part for people with large watchlists, but for those of us in the 5-digit watchlist size, the requirement to go through the "edit watchlist" interface just kind of makes it a non-starter (for me) for the time being. Just a suggestion, though: adding a live search to that edit watchlist interface would resolve this issue, make watchlist labels even more useful, and resolve some other watchlist usability issues. Of course, there's probably no way to do live search without loading the whole thing at once, which may be unrealistic, but food for thought. [[User:Rhododendrites|Rhododendrites]] ([[User talk:Rhododendrites|talk]]) 15:29, 2 February 2026 (UTC) :::@[[User:Rhododendrites|Rhododendrites]] I agree this would be helpful, I filed [[Phab:T416172|T416172]] yesterday for the general case of searching in EditWatchlist. [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]] ([[User talk:Samwalton9 (WMF)|talk]]) 16:02, 3 February 2026 (UTC) :: This seems like an excellent idea. I'm looking forward to Phase 2, because the current method of assigning labels to pages is too cumbersome. [[User:Schazjmd|Schazjmd]] ([[User talk:Schazjmd|talk]]) 23:38, 9 February 2026 (UTC) :Very much agree with this. Without a way to add the label from the Watchlist page directly, the feature is barely usable. At least for users with many pages on the Watchlist which probably are most active contributors and nearly all to whom this feature would be really useful. And additionally {{tq|This prevents having to search for the page in the watchlist every single time}} is misleading about the current difficulty of adding labels: one can't search there and there can be thousands of pages in a namespace in the Watchlist. For example, on Commons I was trying to add the Commons:Village pump pages to the discussion label but there were multiple pages of 500s because categories for discussions etc are all also in that namespace. :A simple + button next to Watchlist items would help. This could show a context menu with 'add label' being one item or directly the available labels to add. [[User:Prototyperspective|Prototyperspective]] ([[User talk:Prototyperspective|talk]]) 12:20, 2 March 2026 (UTC) ::Seems to be possible using the watchstar now. But could you please make it possible also from the Watchlist page? I think one really can only start using these labels if one can assign them from the Watchlist while checking one's Watchlist. The watch star is just for new additions to the Watchlist, but not for existing pages. [[User:Prototyperspective|Prototyperspective]] ([[User talk:Prototyperspective|talk]]) 16:44, 6 April 2026 (UTC) == Filtering Watchlist == {{Tracked|T416172}} I’m not sure whether this falls within the project scope, but currently the Watchlist can only be filtered by namespace. When the Watchlist contains a large number of items, assigning labels one by one becomes quite time-consuming. Allowing users to filter the Watchlist by a text string (matching page titles) would significantly improve usability when dealing with large Watchlists. [[User:Ayack|Ayack]] ([[User talk:Ayack|talk]]) 17:33, 2 February 2026 (UTC) :This is being discussed in [[Phab:T416172|T416172]]! [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]] ([[User talk:Samwalton9 (WMF)|talk]]) 16:02, 3 February 2026 (UTC) ::Thanks @[[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]! [[User:Ayack|Ayack]] ([[User talk:Ayack|talk]]) 08:20, 5 February 2026 (UTC) == Improvements on the the "manage watchlist labels" page == Speaking as a Commons user with 37000 items on my watchlist, and intending to grow that further, I have three main suggestions after first seeing this tool: # Allow users who are editing their watchlist labels, to '''filter away pages that they have already labelled'''. That way, one can successively label watchlist entries instead of going through 500 entries by 500 entries with a fine comb selecting which ones go on which label. # Allow users who are editing their watchlist labels, to filter by page names via a free text entry. In my case, I have a large number of categories on my watchlist that are named "<prefix> books <suffix>" and "<prefix> maps <suffix>". I would like to first filter them all in one list (all entries that include "books"), to then checkmark them by the bulk and assign labels. As far as I understand things, this is part of the Fabricator ticket T416172, where I added this input. Otherwise, I have pointed it out here now as well. # For convenience: The toolbar for "Assign" and "Remove" labels is currently only at the top of the page. Whenever the list goes down farther than 2 screens, it would be great to have '''duplicate buttons''' with the same function at the bottom of the page, so that I don't have to scroll all the way back up once I'm done selecting entries. Best, --[[User:Enyavar|Enyavar]] ([[User talk:Enyavar|talk]]) 16:26, 17 February 2026 (UTC) :{{re|Enyavar}} Sorry for the slow response here! These are all good ideas, thanks for the suggestions. I've created {{phab|T419790}} for filtering by unlabelled (or label, because it seems like that's much the same feature and would be useful). The title-filtering is {{phab|T416172}} and there's already a filter in place — unfortunately however, for performance reasons it's currently only a prefix search and is case-sensitive; we hope to fix up those issues soon. And duplicating the buttons at the bottom is now tracked at {{phab|T419791}}. Feel free to leave comments on any of those tasks with extra info. [[User:SWilson (WMF)|SWilson (WMF)]] ([[User talk:SWilson (WMF)|talk]]) 05:05, 12 March 2026 (UTC) == Watchstar changes == We're going to update the functioning of the watchstar (which isn't a star in all skins, but that seems to be the general name for the watch/unwatch link, even in core). I'm posting updates on {{phab|T415173}}, and would love any feedback or ideas anyone has. [[User:SWilson (WMF)|SWilson (WMF)]] ([[User talk:SWilson (WMF)|talk]]) 05:52, 12 March 2026 (UTC) == Is there a way to disable this feature? == Sorry but I find this feature to be error inducing. The box on the Source Edit is visually similar to the edit summary and I find my edit summaries go missing because I have typed them in the wrong box. I don't have time to organize the Watchlist anyway. I also think a much better UI design would parallel the Permanent dropdown just above the "Watchlist labels:". The drop down would list the label and have an Add Label entry at the bottom. This avoid confusion with the Edit Summary. [[User:Johnjbarton|Johnjbarton]] ([[User talk:Johnjbarton|talk]]) 00:00, 3 April 2026 (UTC) :{{re|Johnjbarton}} Sorry to hear that this has caused you to lose your edit summaries! I have [[Special:Diff/8321615|added instructions]] for how to hide the field via your common.css page (and will add more about how to hide the feature in other places too). The difference between this and the expiry dropdown is that the label field allows multiple labels to be entered, and that's why it's a different sort of form field. You raise a good point about being able to add labels directly from the editing form, and this is going to be considered as a future improvement (once we've ironed out the bugs with the initial work). Oh, and if you don't use the labels feature, you can delete all your labels and the field will go away (and be replaced by little message saying that you don't have any labels). [[User:SWilson (WMF)|SWilson (WMF)]] ([[User talk:SWilson (WMF)|talk]]) 06:47, 3 April 2026 (UTC) == How to... == Just noticed this feature. Regrettably, I have yet to figure out how to actually filter my watchlist using Labels. I have successfully added one Label ("Test") and assigned it to a watchlist item. Instructions on the Help page (associated with this Discussion page) say: "This can be done via the Labels filter dropdown, or by typing the = filter prefix in the filter search bar." I don't see a "Labels filter dropdown" on my English Wikipedia watchlist page and it's not clear what "filter search bar" is intended. It's also not clear to me if "=" is supposed to be followed by a Label name. I see a "Filter" page here on Mediawiki, but not on my Wikipedia watchlist or Labels page. So, my request is: can you (re-)explain how to actually filter a watchlist using Labels? Thanks. [[User:DonFB|DonFB]] ([[User talk:DonFB|talk]]) 05:14, 6 April 2026 (UTC) : I'm not the one whom you asked this, but I have a possible explanation. Do you have "disable JavaScript on Watchlist" in preferences turned on on your wiki, @[[User:DonFB|DonFB]]? [[User:IKhitron|IKhitron]] ([[User talk:IKhitron|talk]]) 09:01, 17 April 2026 (UTC) ::Ha! Thanks, that was the issue. "Label" filter now visible. I think ages ago, I turned off javascript for some reason. Thanks for the tip. [[User:DonFB|DonFB]] ([[User talk:DonFB|talk]]) 20:35, 17 April 2026 (UTC) == Watchlist labels go missing when using HotCat == When I use HotCat to add / modify / remove category (or categories), the current Watchlist label that I have assigned to the file is removed. Hope this can be addressed appropriately - would that be in HotCat? [[User:VasuVR|VasuVR]] ([[User talk:VasuVR|talk]]) 15:10, 3 May 2026 (UTC) 0eit9fci0sgfshkernpxemgael3p9ks 8364446 8364414 2026-05-03T15:40:26Z IKhitron 1300437 /* Watchlist labels go missing when using HotCat */ reply: Let me assume it's about [[phab:T423778]]. (-) 8364446 wikitext text/x-wiki == Watchlist notes == This sounds great; thanks for working on this technical feature! [[File:Notes_for_watchlisted_pages_(proposed_Wikipedia_feature).png|thumb|How entering a note right after watchlisting could look like]]Maybe you could also look into the concept of Watchlist notes – I think these may even be more useful than labels and best in combination with labels. I think many users would use labels to add notes and this could also be revisited at a later point – I think it would be best to also add the ability to add notes after the labels have been implemented. Please see [[m:Community Wishlist/W437|W437: Notes for watchlisted pages]], thanks.<br> [[User:Prototyperspective|Prototyperspective]] ([[User talk:Prototyperspective|talk]]) 15:14, 21 January 2026 (UTC) :@[[User:Prototyperspective|Prototyperspective]] Sounds like a great idea, we can pass this one to the designers, ideally you would leave a wish for this separately, because first we will analyse adoption to the initial feature to identify if to spend more time on this or not, and having votes on a new wish could contribute to the analysis as an additional argument. [[User:KSiebert (WMF)|KSiebert (WMF)]] ([[User talk:KSiebert (WMF)|talk]]) 11:30, 2 February 2026 (UTC) == Ease of adding labels == {{tracked|T415173}} Similar to the previous post, my suggestion is that the option to add labels to a page in your watchlist should be available in the dropdown at the moment you add the page to the watchlist. This prevents having to search for the page in the watchlist every single time. ~ [[User:Misha Vargas|<span style="font-family:Oswald;color:#5000B0;text-shadow:#C0C0C0 0.0em 0.0em 0.8em;font-weight:bold;">Misha Vargas</span>]] ([[User talk:Misha Vargas|talk]] &#124; [[Special:Contributions/Misha_Vargas|contribs]]) 10:14, 2 February 2026 (UTC) :Thanks for the suggestion, you will be happy to hear that we just started working on that, see Phase 2: https://meta.wikimedia.org/wiki/Community_Tech/Watchlist_Labels#Acceptance_Criteria_Phase_2 [[User:KSiebert (WMF)|KSiebert (WMF)]] ([[User talk:KSiebert (WMF)|talk]]) 11:27, 2 February 2026 (UTC) ::Glad to hear this, {{u|KSiebert (WMF)}}!, and thanks for this neat tool. It sounded like this was intended in part for people with large watchlists, but for those of us in the 5-digit watchlist size, the requirement to go through the "edit watchlist" interface just kind of makes it a non-starter (for me) for the time being. Just a suggestion, though: adding a live search to that edit watchlist interface would resolve this issue, make watchlist labels even more useful, and resolve some other watchlist usability issues. Of course, there's probably no way to do live search without loading the whole thing at once, which may be unrealistic, but food for thought. [[User:Rhododendrites|Rhododendrites]] ([[User talk:Rhododendrites|talk]]) 15:29, 2 February 2026 (UTC) :::@[[User:Rhododendrites|Rhododendrites]] I agree this would be helpful, I filed [[Phab:T416172|T416172]] yesterday for the general case of searching in EditWatchlist. [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]] ([[User talk:Samwalton9 (WMF)|talk]]) 16:02, 3 February 2026 (UTC) :: This seems like an excellent idea. I'm looking forward to Phase 2, because the current method of assigning labels to pages is too cumbersome. [[User:Schazjmd|Schazjmd]] ([[User talk:Schazjmd|talk]]) 23:38, 9 February 2026 (UTC) :Very much agree with this. Without a way to add the label from the Watchlist page directly, the feature is barely usable. At least for users with many pages on the Watchlist which probably are most active contributors and nearly all to whom this feature would be really useful. And additionally {{tq|This prevents having to search for the page in the watchlist every single time}} is misleading about the current difficulty of adding labels: one can't search there and there can be thousands of pages in a namespace in the Watchlist. For example, on Commons I was trying to add the Commons:Village pump pages to the discussion label but there were multiple pages of 500s because categories for discussions etc are all also in that namespace. :A simple + button next to Watchlist items would help. This could show a context menu with 'add label' being one item or directly the available labels to add. [[User:Prototyperspective|Prototyperspective]] ([[User talk:Prototyperspective|talk]]) 12:20, 2 March 2026 (UTC) ::Seems to be possible using the watchstar now. But could you please make it possible also from the Watchlist page? I think one really can only start using these labels if one can assign them from the Watchlist while checking one's Watchlist. The watch star is just for new additions to the Watchlist, but not for existing pages. [[User:Prototyperspective|Prototyperspective]] ([[User talk:Prototyperspective|talk]]) 16:44, 6 April 2026 (UTC) == Filtering Watchlist == {{Tracked|T416172}} I’m not sure whether this falls within the project scope, but currently the Watchlist can only be filtered by namespace. When the Watchlist contains a large number of items, assigning labels one by one becomes quite time-consuming. Allowing users to filter the Watchlist by a text string (matching page titles) would significantly improve usability when dealing with large Watchlists. [[User:Ayack|Ayack]] ([[User talk:Ayack|talk]]) 17:33, 2 February 2026 (UTC) :This is being discussed in [[Phab:T416172|T416172]]! [[User:Samwalton9 (WMF)|Samwalton9 (WMF)]] ([[User talk:Samwalton9 (WMF)|talk]]) 16:02, 3 February 2026 (UTC) ::Thanks @[[User:Samwalton9 (WMF)|Samwalton9 (WMF)]]! [[User:Ayack|Ayack]] ([[User talk:Ayack|talk]]) 08:20, 5 February 2026 (UTC) == Improvements on the the "manage watchlist labels" page == Speaking as a Commons user with 37000 items on my watchlist, and intending to grow that further, I have three main suggestions after first seeing this tool: # Allow users who are editing their watchlist labels, to '''filter away pages that they have already labelled'''. That way, one can successively label watchlist entries instead of going through 500 entries by 500 entries with a fine comb selecting which ones go on which label. # Allow users who are editing their watchlist labels, to filter by page names via a free text entry. In my case, I have a large number of categories on my watchlist that are named "<prefix> books <suffix>" and "<prefix> maps <suffix>". I would like to first filter them all in one list (all entries that include "books"), to then checkmark them by the bulk and assign labels. As far as I understand things, this is part of the Fabricator ticket T416172, where I added this input. Otherwise, I have pointed it out here now as well. # For convenience: The toolbar for "Assign" and "Remove" labels is currently only at the top of the page. Whenever the list goes down farther than 2 screens, it would be great to have '''duplicate buttons''' with the same function at the bottom of the page, so that I don't have to scroll all the way back up once I'm done selecting entries. Best, --[[User:Enyavar|Enyavar]] ([[User talk:Enyavar|talk]]) 16:26, 17 February 2026 (UTC) :{{re|Enyavar}} Sorry for the slow response here! These are all good ideas, thanks for the suggestions. I've created {{phab|T419790}} for filtering by unlabelled (or label, because it seems like that's much the same feature and would be useful). The title-filtering is {{phab|T416172}} and there's already a filter in place — unfortunately however, for performance reasons it's currently only a prefix search and is case-sensitive; we hope to fix up those issues soon. And duplicating the buttons at the bottom is now tracked at {{phab|T419791}}. Feel free to leave comments on any of those tasks with extra info. [[User:SWilson (WMF)|SWilson (WMF)]] ([[User talk:SWilson (WMF)|talk]]) 05:05, 12 March 2026 (UTC) == Watchstar changes == We're going to update the functioning of the watchstar (which isn't a star in all skins, but that seems to be the general name for the watch/unwatch link, even in core). I'm posting updates on {{phab|T415173}}, and would love any feedback or ideas anyone has. [[User:SWilson (WMF)|SWilson (WMF)]] ([[User talk:SWilson (WMF)|talk]]) 05:52, 12 March 2026 (UTC) == Is there a way to disable this feature? == Sorry but I find this feature to be error inducing. The box on the Source Edit is visually similar to the edit summary and I find my edit summaries go missing because I have typed them in the wrong box. I don't have time to organize the Watchlist anyway. I also think a much better UI design would parallel the Permanent dropdown just above the "Watchlist labels:". The drop down would list the label and have an Add Label entry at the bottom. This avoid confusion with the Edit Summary. [[User:Johnjbarton|Johnjbarton]] ([[User talk:Johnjbarton|talk]]) 00:00, 3 April 2026 (UTC) :{{re|Johnjbarton}} Sorry to hear that this has caused you to lose your edit summaries! I have [[Special:Diff/8321615|added instructions]] for how to hide the field via your common.css page (and will add more about how to hide the feature in other places too). The difference between this and the expiry dropdown is that the label field allows multiple labels to be entered, and that's why it's a different sort of form field. You raise a good point about being able to add labels directly from the editing form, and this is going to be considered as a future improvement (once we've ironed out the bugs with the initial work). Oh, and if you don't use the labels feature, you can delete all your labels and the field will go away (and be replaced by little message saying that you don't have any labels). [[User:SWilson (WMF)|SWilson (WMF)]] ([[User talk:SWilson (WMF)|talk]]) 06:47, 3 April 2026 (UTC) == How to... == Just noticed this feature. Regrettably, I have yet to figure out how to actually filter my watchlist using Labels. I have successfully added one Label ("Test") and assigned it to a watchlist item. Instructions on the Help page (associated with this Discussion page) say: "This can be done via the Labels filter dropdown, or by typing the = filter prefix in the filter search bar." I don't see a "Labels filter dropdown" on my English Wikipedia watchlist page and it's not clear what "filter search bar" is intended. It's also not clear to me if "=" is supposed to be followed by a Label name. I see a "Filter" page here on Mediawiki, but not on my Wikipedia watchlist or Labels page. So, my request is: can you (re-)explain how to actually filter a watchlist using Labels? Thanks. [[User:DonFB|DonFB]] ([[User talk:DonFB|talk]]) 05:14, 6 April 2026 (UTC) : I'm not the one whom you asked this, but I have a possible explanation. Do you have "disable JavaScript on Watchlist" in preferences turned on on your wiki, @[[User:DonFB|DonFB]]? [[User:IKhitron|IKhitron]] ([[User talk:IKhitron|talk]]) 09:01, 17 April 2026 (UTC) ::Ha! Thanks, that was the issue. "Label" filter now visible. I think ages ago, I turned off javascript for some reason. Thanks for the tip. [[User:DonFB|DonFB]] ([[User talk:DonFB|talk]]) 20:35, 17 April 2026 (UTC) == Watchlist labels go missing when using HotCat == When I use HotCat to add / modify / remove category (or categories), the current Watchlist label that I have assigned to the file is removed. Hope this can be addressed appropriately - would that be in HotCat? [[User:VasuVR|VasuVR]] ([[User talk:VasuVR|talk]]) 15:10, 3 May 2026 (UTC) : Let me assume it's about [[phab:T423778]]. [[User:IKhitron|IKhitron]] ([[User talk:IKhitron|talk]]) 15:40, 3 May 2026 (UTC) ryqm5bc3ihr8l8jg53zu4i3400ne43y Help:Extension:ParserFunctions/ca 12 2349884 8365005 8353922 2026-05-04T06:20:01Z FuzzyBot 451990 Updating to match new version of source page 8365005 wikitext text/x-wiki <noinclude> <languages/> </noinclude> {{PD Help Page}} {{Magic words|general=1}} L'extensió {{ll|Extension:ParserFunctions|nsp=0}} proporciona [[Special:MyLanguage/Parser functions|funcions d'anàlisi]] addicionals per complementar les que ja estan presents al nucli de MediaWiki. (Vegeu {{ll|Help:Magic words#Parser functions}}.) (''Pot'' estar configurat per proporcionar funcions d'anàlisi addicionals per al maneig de cadenes; aquestes només estan disponibles per a wikis que no són de la Fundació Wikimedia, per tant, aquestes funcions de cadenes estan documentades {{ll|Extension:ParserFunctions/String functions|en altres llocs}}.) Totes les funcions d'anàlisi proporcionades per aquesta extensió prenen la forma: :<code><nowiki>{{</nowiki>'''#nomdefunció''': ''argument 1'' | ''argument 2'' | ''argument 3'' ... <nowiki>}}</nowiki></code> == #expr == {{for|1=un '''manual més detallat''' sobre els punts més importants del funcionament de l'avaluador d'expressions, incloent-hi alguns operadors addicionals que no es tracten aquí|2=Special:MyLanguage/Manual:Expr parser function syntax{{!}}Manual:Expr parser function syntax}} {| class="wikitable" style="float:{{dir|{{pagelang}}|left|right}}; width:30%; margin-{{dir|{{pagelang}}|right|left}}:1em" |- ! {{hl1}} | Tipus ! {{hl1}} | Operadors |- | {{hl2}} | Agrupació (parèntesis) | style="word-spacing: 0.5em; font-weight: bold;" | <code>( )</code> |- | {{hl2}} | Números | <code>'''1234.5'''</code> &nbsp; <code>'''e'''</code>&nbsp;(2.718) &nbsp; <code>'''pi'''</code>&nbsp;(3.142) |- | {{hl2}} | | operador binari <code>'''e'''</code> &nbsp; unari <code>'''+'''</code>,<code>'''-'''</code> |- | {{hl2}} | Unari | style="word-spacing: 0.5em; font-weight: bold;" | <code>not ceil trunc floor abs exp ln sin cos tan acos asin atan sqrt</code> |- | {{hl2}} rowspan="3" | Binari | style="word-spacing: 0.5em; font-weight: bold;" | <code>^</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>* / div mod fmod</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>+ -</code> |- | {{hl2}} | Arrodoniment | style="word-spacing: 0.5em; font-weight: bold;" | <code>round</code> |- | {{hl2}} rowspan="3" | Lògic | style="word-spacing: 0.5em; font-weight: bold;" | <code>= != <> > < >= <=</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>and</code> |- | style="word-spacing: 0.5em; font-weight: bold;" | <code>or</code> |} Aquesta funció avalua una expressió matemàtica i retorna el valor calculat. Aquesta funció també està disponible a {{ll|Extension:Scribunto|nsp=0}} mitjançant la funció <code>mw.ext.ParserFunctions.expr</code>. :<code><nowiki>{{#expr:</nowiki> ''expressió'' <nowiki>}}</nowiki></code> Exemple bàsic :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 + 1 }}</syntaxhighlight> → '''{{#expr: 1 + 1 }}''' Els operadors disponibles es llisten a la dreta, per ordre de precedència. Vegeu {{ll|Manual:Expr parser function syntax}} per obtenir més detalls sobre la funció de cada operador. La precisió i el format del resultat retornat variaran segons el sistema operatiu del servidor que executa el wiki i el format numèric de l'idioma del lloc. Quan s'avalua mitjançant [[:ca:Àlgebra de Boole|àlgebra booleana]], zero s'avalua com a {{phpi|false}}, i qualsevol valor diferent de zero, positiu o negatiu, s'avalua com a {{phpi|true}}: :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and -1 }}</syntaxhighlight> → '''{{#expr: 1 and -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 and 0 }}</syntaxhighlight> → '''{{#expr: 1 and 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 or -1 }}</syntaxhighlight> → '''{{#expr: 1 or -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 or 0 }}</syntaxhighlight> → '''{{#expr: -1 or 0 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 0 or 0 }}</syntaxhighlight> → '''{{#expr: 0 or 0 }}''' Una expressió d'entrada buida retorna una cadena buida. Les expressions no vàlides retornen un dels diversos missatges d'error, que es poden detectar amb la funció <code>[[##iferror|#iferror]]</code>: :<syntaxhighlight lang="wikitext" inline>{{#expr: }}</syntaxhighlight> → ''' {{#expr: }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1+ }}</syntaxhighlight> → '''{{#expr: 1+ }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 = }}</syntaxhighlight> → '''{{#expr: 1 = }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: 1 foo 2 }}</syntaxhighlight> → '''{{#expr: 1 foo 2 }}''' L'ordre dels operands de suma i resta abans o després d'un nombre és significatiu i es pot tractar com un valor positiu o negatiu en lloc de com un operand amb una entrada errònia: :<syntaxhighlight lang="wikitext" inline>{{#expr: +1 }}</syntaxhighlight> → '''{{#expr: +1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: -1 }}</syntaxhighlight> → '''{{#expr: -1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: + 1 }}</syntaxhighlight> → '''{{#expr: + 1 }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: - 1 }}</syntaxhighlight> → '''{{#expr: - 1 }}''' Tingueu en compte que si utilitzeu la sortida de paraules màgiques, heu de formatar-les en format cru per eliminar les comes i traduir els numerals. Per exemple, <nowiki>{{NUMBEROFUSERS}}</nowiki> dona com a resultat {{NUMBEROFUSERS}}, on volem {{formatnum:{{NUMBEROFUSERS}}|R}}, que es pot obtenir utilitzant <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Formatting|formatnum}}<nowiki>:{{NUMBEROFUSERS}}|R}}</nowiki></code>. Això és especialment important en alguns idiomes, on es tradueixen els numerals. Per exemple, en bengalí, <nowiki>{{NUMBEROFUSERS}}</nowiki> produeix ৩০,০৬১. :<syntaxhighlight lang="wikitext" inline>{{#expr:{{NUMBEROFUSERS}}+100}}</syntaxhighlight> → ''' {{#expr:{{NUMBEROFUSERS}}+100}}''' :<syntaxhighlight lang="wikitext" inline>{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}</syntaxhighlight> → '''{{#expr:{{formatnum:{{NUMBEROFUSERS}}|R}}+100}}''' {{Warning|1=L'operador <code>mod</code> dona resultats incorrectes per a alguns valors del segon argument: <!-- the following line now produces the correct value: :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^32-1)}}</syntaxhighlight> → '''{{#expr: 123 mod (2^32-1)}}''' (should be 123)<br /> but see this one: --> :<syntaxhighlight lang="wikitext" inline>{{#expr: 123 mod (2^64-1)}}</syntaxhighlight> → {{#expr: 123 mod (2^64-1)}} (produeix una cadena buida; hauria de ser 123)<br /> <!-- and the following bug has now been solved, as shown on the linked bug report: Depending on the specification and configuration of the server running the wiki, there may also be other errors: :<syntaxhighlight lang="wikitext" inline>{{#expr: 20060618093259 mod 10000}}</syntaxhighlight> → '''{{#expr: 20060618093259 mod 10000}}''' in most cases, but may occasionally give '''-6357'''. See {{bugzilla|6356}}. --> }} {{tip|1=Si voleu fer càlculs basats en dates (per exemple, comprovar si la data i l'hora actuals són posteriors a alguna altra data i hora), primer convertiu l'hora a número de segons posteriors a l'1 de gener de 1970 (UTC) utilitzant <nowiki>{{#time: xNU }}</nowiki>, i després podeu simplement sumar i restar les dates com a números.}} <span id="Rounding"></span> === Arrodoniment === [https://php.net/function.round round] arrodoneix el nombre de l'esquerra a un múltiple d'1/10 elevat a una potència, amb l'exponent igual al valor truncat del nombre donat a la dreta. Per arrodonir cap amunt o cap avall, utilitzeu els unaris <code>ceil</code> o <code>floor</code> respectivament. {| class="wikitable" ! {{hl1}} | Cas de prova ! {{hl1}} | Resultat ! {{hl1}} | Mètode d'arrodoniment |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/3 round 5 }}</nowiki></code> || {{#expr: 1/3 round 5 }} || La xifra final és < 5, de manera que no es produeix cap arrodoniment aparent (0.333333… → 0.33333) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1/6 round 5 }}</nowiki></code> || {{#expr: 1/6 round 5 }} || La xifra final és ≥ 5, de manera que s'arrodoneix cap amunt (0.166666… → 0.16667) |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 8.99999/9 round 5 }}</nowiki></code> || {{#expr: 8.99999/9 round 5 }} || De nou, el resultat s'arrodoneix cap amunt a l'última xifra, cosa que dona com a resultat un arrodoniment addicional (0.999998… → 1.00000 → 1) |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round -2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round -2 }} || Arrodonit a la centena més propera perquè els valors negatius s'arrodoneixen a l'esquerra del punt decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 '''round 2''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2 }} || Arrodonit a la centena més propera perquè els valors positius s'arrodoneixen a la dreta del punt decimal |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1234.5678 round 2'''.3''' <nowiki>}}</nowiki></code> || {{#expr: 1234.567 round 2.3 }} || Els decimals de l'índex d'arrodoniment no fan cap diferència en el resultat arrodonit |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''trunc''' 1234.5678 <nowiki>}}</nowiki></code> || {{#expr: trunc 1234.567 }} || Part decimal truncada (retallada) |- ! colspan=3 {{hl2}} | Arrodoniment a l'enter més proper |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/3 round 0 }} || Baixa a l'enter ''més proper'', que és zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 1/2 round 0 }} || Puja a l'enter més proper, que és un |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> 3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: 3/4 round 0 }} || Puja a l'enter més proper, que és un |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/3 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/3 round 0 }} || Puja a l'enter més proper, que és zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -1/2 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -1/2 round 0 }} || Baixa a l'enter més proper, que és menys un |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> -3/4 '''round 0''' <nowiki>}}</nowiki></code> || {{#expr: -3/4 round 0 }} || Baixa a l'enter més proper, que és menys un |- ! colspan=3 {{hl2}} | Arrodoniment a l'alça o a la baixa amb ''ceil'' i ''floor'' |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(1/3) }} || Puja al següent enter ''més gran'', que és un |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(1/3) }} || Baixa al següent enter ''més petit'', que és zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: ceil(-1/3) }} || Puja al següent enter ''més gran'', que és zero |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''floor('''-1/3''')''' <nowiki>}}</nowiki></code> || {{#expr: floor(-1/3) }} || Baixa al següent enter més petit, que és menys un |- | <code style="white-space:nowrap;"><nowiki>{{#expr:</nowiki> '''ceil''' 1/3 <nowiki>}}</nowiki></code> || {{#expr: ceil 1/3 }} || No arrodonit, ja que 1 ja és un enter<br />{{Warning|1=Interpretat com a '''(ceil''' 1''')'''/3, no com a '''ceil('''1/3''')''', com es podria esperar}} |- ! colspan=3 {{hl2}} | Arrodoniment de números grans |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e-92 round 400 }}</nowiki></code> || {{#expr:1e-92 round 400}} | Arrodonir a un número molt gran porta a l'infinit. Per tant, el valor original sense l'infinit es dona com a resposta. |- | <code style="white-space:nowrap;"><nowiki>{{#expr: 1e108 round 200 }}</nowiki></code> || {{#expr:1e108 round 200}} | Igual que l'anterior |} <span id="Strings"></span> === Cadenes de caràcters === Les expressions només funcionen amb valors semblants a números, no poden comparar cadenes ni caràcters. Es pot utilitzar #ifeq en el seu lloc :<syntaxhighlight lang="wikitext" inline>{{#expr: "a" = "a" }}</syntaxhighlight> → '''{{#expr: "a" = "a" }}''' :<syntaxhighlight lang="wikitext" inline>{{#expr: a = a }}</syntaxhighlight> → '''{{#expr: a = a }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: a | a | 1 | 0 }}</syntaxhighlight> → '''{{#ifeq: a | a | 1 | 0 }}''' == #if == Aquesta funció avalua una cadena de prova i determina si està buida o no. Una cadena de prova que només conté espais en blanc es considera buida. :<syntaxhighlight lang="wikitext" inline>{{#if: cadena de prova | valor si la cadena de prova no està buida | valor si la cadena de prova està buida (o només espais en blanc)}}</syntaxhighlight> :<syntaxhighlight lang="wikitext" inline>{{#if: primer paràmetre | segon paràmetre | tercer paràmetre }}</syntaxhighlight> Aquesta funció primer comprova si el primer paràmetre no està buit. Si el primer paràmetre no està buit, la funció mostra el segon argument. Si el primer paràmetre està buit o només conté caràcters d'espai en blanc (espais, salts de línia, etc.), mostra el tercer argument. :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: string | yes | no}}</syntaxhighlight> → '''{{#if: string | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}</syntaxhighlight> → '''{{#if: &nbsp;&nbsp;&nbsp;&nbsp; | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes | no}}</syntaxhighlight> → '''{{#if: | yes | no}}''' La cadena de prova sempre s'interpreta com a text pur, de manera que les expressions matemàtiques no s'avaluen (vegeu [[##ifexpr|#ifexpr]] per a això): :<syntaxhighlight lang="wikitext" inline>{{#if: 1==2 | yes | no }}</syntaxhighlight> → '''{{#if: 1==2 | yes | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#if: 0 | yes | no }}</syntaxhighlight> → '''{{#if: 0 | yes | no }}''' Es pot ometre l'últim paràmetre (false): :<syntaxhighlight lang="wikitext" inline>{{#if: foo | yes }}</syntaxhighlight> → ''' {{#if: foo | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: | yes }}</syntaxhighlight> → ''' {{#if: | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#if: foo | | no}}</syntaxhighlight> → ''' {{#if: foo | | no}}''' La funció es pot imbricar. Per fer-ho, imbrica la funció #if interna en la seva forma completa en lloc d'un paràmetre de la funció #if que l'envolta. Són possibles fins a set nivells d'imbricació, tot i que això pot dependre del wiki o del límit de memòria. <!-- Here's a nested #if that returns "wowzers" if <nowiki>{{{1}}}</nowiki> is supplied, and "zowzers" if <nowiki>{{{2}}}</nowiki> is supplied (hence "wowzers zowzers" if both are supplied). In this example, the code is indented; unindented markup for nested parserfunctions quickly becomes unreadable. Note that a HTML comment is used here, which allows a line break in the source code without including it in the output. --> <syntaxhighlight lang="wikitext"> {{#if:cadena de prova | valor si la cadena de prova no està buida |{{#if:cadena de prova |valor si la cadena de prova no està buida |valor si la cadena de prova està buida (o només espais en blanc) }} }} </syntaxhighlight> També podeu utilitzar un paràmetre com a cadena de prova a la vostra instrucció <code>#if</code>. Heu d'assegurar-vos d'afegir el <code>|</code> (símbol de barra vertical) després del nom de la variable. (De manera que si el paràmetre no té un valor, s'avalua com una cadena buida en lloc de la cadena "<code><nowiki>{{{1}}}</nowiki></code>".) :{{tmpl|0=<code class="mw-highlight"><!-- -->{{((}}#if:{{#tag:span|{{(((}}|class=nb}}{{#tag:span|1|class=cp}}{{red|{{!}}}}{{#tag:span|{{)))}}|class=nb}}{{!}}$1{{!}}$2{{))}}<!-- --></code> |1=Heu introduït text a la variable 1 |2=No hi ha text a la variable 1 }} Vegeu {{ll|Help:Parser functions in templates}} per obtenir més exemples d'aquesta funció d'anàlisi. {{Anchor|ifeq|IFEQ|Ifeq|IfEq|If equal}} == #ifeq == Aquesta funció d'anàlisi compara dues cadenes d'entrada, determina si són idèntiques i retorna una de les dues cadenes basant-se en el resultat. Si es requereixen més comparacions i cadenes de sortida, considereu l'ús de <code>#switch</code>. :<code><nowiki>{{#ifeq:</nowiki> ''string 1'' <nowiki>|</nowiki> ''string 2'' <nowiki>|</nowiki> ''value if identical'' <nowiki>|</nowiki> ''value if different'' <nowiki>}}</nowiki></code> Si ambdues cadenes són valors numèrics vàlids, les cadenes es comparen numèricament: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 01 | 1 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 01 | 1 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 0 | -0 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 0 | -0 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 1e3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 1e3 | 1000 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: {{#expr:10^3}} | 1000 | equal | not equal}}''' En cas contrari, la comparació es fa com a text; aquesta comparació distingeix entre majúscules i minúscules: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | bar | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | bar | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: foo | Foo | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: foo | Foo | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: "01" | "1" | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: "01" | "1" | equal | not equal}}''' &nbsp;''(compareu amb un exemple similar anterior, sense les cometes)'' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 10^3 | 1000 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 10^3 | 1000 | equal | not equal}}''' &nbsp;''(compareu amb un exemple similar anterior, amb #expr que retorna primer un número vàlid)'' Com a exemple pràctic, considereu una {{ll|Help:Templates|plantilla}} existent <code>Template:Timer</code> que utilitza l'analitzador per triar entre dos temps estàndard, curt i llarg. Pren el paràmetre com a primera entrada per comparar amb la cadena "short" &ndash; no hi ha cap convenció per a l'ordre, però és més senzill de llegir si el paràmetre va primer. El codi de la plantilla es defineix com: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{{1|}}} | short | 20 | 40 }}</syntaxhighlight> es produeix el següent: :<syntaxhighlight lang="wikitext" inline>{{timer|short}}</syntaxhighlight> → '''20''' :<syntaxhighlight lang="wikitext" inline>{{timer|20}}</syntaxhighlight> → '''40''' :<syntaxhighlight lang="wikitext" inline>{{timer}}</syntaxhighlight> → '''40''' {{Warning|1=Quan s'utilitza dins d'una funció d'anàlisi, qualsevol etiqueta d'anàlisi i altres funcions d'anàlisi s'han de substituir temporalment per {{ll|Strip marker|un codi únic}}. Això afecta les comparacions: :<code><nowiki>{{#ifeq: &lt;nowiki>foo&lt;/nowiki> | &lt;nowiki>foo&lt;/nowiki> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <nowiki>foo</nowiki> | <nowiki>foo</nowiki> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: &lt;math>foo&lt;/math> | &lt;math>foo&lt;/math> | equal | not equal}}</nowiki></code> → '''{{#ifeq: <math>foo</math> | <math>foo</math> | equal | not equal}} ''' :<code><nowiki>{{#ifeq: {{</nowiki>[[Help:Magic words#Miscellaneous|#tag:]]<nowiki>math|foo}} | {{#tag:math|foo}} | equal | not equal}}</nowiki></code> → '''{{#ifeq: {{#tag:math|foo}} | {{#tag:math|foo}} | equal | not equal}} ''' :<syntaxhighlight lang="wikitext" inline>{{#ifeq: [[foo]] | [[foo]] | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: [[foo]] | [[foo]] | equal | not equal}} ''' Si les cadenes que s'han de comparar es donen com a crides iguals a la mateixa {{ll|Help:Templates|plantilla}} que conté aquestes etiquetes, la condició és certa, però en el cas de dues plantilles amb contingut idèntic que conté aquestes etiquetes és falsa. }} {{Warning|1=Les comparacions literals amb {{ll|Help:Magic words#Page names|paraules màgiques de nom de pàgina}} poden fallar segons la configuració del lloc. Per exemple, <nowiki>{{FULLPAGENAME}}</nowiki>, segons el wiki, pot posar la primera lletra en majúscula i substituirà tots els subratllats per espais. Per solucionar-ho, apliqueu la paraula màgica a tots dos paràmetres: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME: L'Aquila}} | {{FULLPAGENAME}} | equal | not equal}}</syntaxhighlight> → '''equal''' }} == #iferror == Aquesta funció pren una cadena d'entrada i retorna un dels dos resultats següents: la funció s'avalua com a <code>true</code> si la cadena d'entrada conté un objecte HTML amb <code>class="error"</code>, tal com la generen altres funcions d'anàlisi com ara <code>[[##expr|#expr]]</code>, <code>[[##time|#time]]</code> i <code>[[##rel2abs|#rel2abs]]</code>, errors de [[Special:MyLanguage/Help:Templates|plantilla]] com ara bucles i recursions, i altres errors de programari detectats en l'anàlisi. :<code><nowiki>{{#iferror:</nowiki> ''test string'' <nowiki>|</nowiki> ''value if error'' <nowiki>|</nowiki> ''value if correct'' <nowiki>}}</nowiki></code> Es pot ometre una o ambdues cadenes de retorn. Si s'omet la cadena <code>correct</code>, es retorna la cadena <code>test string</code> si no és errònia. Si també s'omet la cadena <code>error</code>, es retorna una cadena buida en cas d'error: :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} | error }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + X }} | error }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + 2 }} }}</syntaxhighlight> → '''{{#iferror: {{#expr: 1 + 2 }} }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: 1 + X }} }}</syntaxhighlight> → '''&zwnj;{{#iferror: {{#expr: 1 + X }} }}'''<!-- maybe the zwnj protects the trailing space before no output --> :<syntaxhighlight lang="wikitext" inline>{{#iferror: {{#expr: . }} | error | correct }}</syntaxhighlight> → '''{{#iferror: {{#expr: . }} | error | correct }}''' :<syntaxhighlight lang="wikitext" inline>{{#iferror: <strong class="error">a</strong> | error | correct }}</syntaxhighlight> → '''{{#iferror: <strong class="error">a</strong> | error | correct }}''' Alguns errors poden causar que s'afegeixi una categoria de seguiment, però l'ús de <code><nowiki>{{#iferror:}}</nowiki></code> no suprimirà l'addició de la categoria. == #ifexpr == Aquesta funció avalua una expressió matemàtica i retorna una de dues cadenes de caràcters segons el valor booleà del resultat: :<code><nowiki>{{#ifexpr:</nowiki> ''expression'' <nowiki>|</nowiki> ''value if true'' <nowiki>|</nowiki> ''value if false'' <nowiki>}}</nowiki></code> L'entrada de <code>expression</code> s'avalua exactament igual que per a la funció <code>[[##expr|#expr]]</code> anterior, amb els mateixos operadors disponibles. La sortida s'avalua llavors com una expressió booleana. Una expressió d'entrada buida s'avalua com a {{phpi|false}}: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: | yes | no}}</syntaxhighlight> → '''{{#ifexpr: | yes | no}}''' Com s'ha esmentat anteriorment, zero s'avalua com a {{phpi|false}} i qualsevol valor diferent de zero s'avalua com a {{phpi|true}}, de manera que aquesta funció és equivalent a una que utilitza només <code>[[##ifeq|#ifeq]]</code> i <code>[[##expr|#expr]]</code>: :<code><nowiki>{{#ifeq: {{#expr: </nowiki>''expression''<nowiki> }} | 0 | </nowiki> ''value if false'' <nowiki>|</nowiki> ''value if true'' <nowiki>}}</nowiki></code> excepte per a una expressió d'entrada buida o incorrecta (un missatge d'error es tracta com una cadena buida; no és igual a zero, de manera que obtenim el valor <code>value if true</code>). :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: = | yes | no }}</syntaxhighlight> → ''' {{#ifexpr: = | yes | no }}''' comparant :<syntaxhighlight lang="wikitext" inline>{{#ifeq: {{#expr: = }} | 0 | no | yes }}</syntaxhighlight> → ''' {{#ifeq: {{#expr: = }} | 0 | no | yes }}''' Es poden ometre qualsevol dels valors de retorn o tots dos; no es dona cap sortida quan la branca adequada es deixa buida: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | yes }}</syntaxhighlight> → '''{{#ifexpr: 1 > 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 | yes }}</syntaxhighlight> → ''' {{#ifexpr: 0 = 0 | yes }}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 < 0 | | no}}</syntaxhighlight> → ''' {{#ifexpr: 1 < 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 1 > 0 }}</syntaxhighlight> → ''' {{#ifexpr: 1 > 0 }}''' S'admeten els operadors booleans d'igualtat o desigualtat. :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 or 1 = 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 or 1 = 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 0 = 0 and 1 = 0 | | no}}</syntaxhighlight> → '''{{#ifexpr: 0 = 0 and 1 = 0 | | no}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 or 1 < 0 | yes}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 or 1 < 0 | yes}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}</syntaxhighlight> → '''{{#ifexpr: 2 > 0 and 1 > 0 | yes | no}}''' {{Warning|1=Els resultats de les comparacions numèriques amb <code>[[##ifexpr|#ifexpr]]</code> no sempre coincideixen amb els de <code>[[##ifeq|#ifeq]]</code> i <code>[[##switch|#switch]]</code>. Aquests dos últims són més precisos que <code>[[##ifexpr|#ifexpr]]</code> i, per tant, poden no retornar resultats equivalents. Considereu aquestes comparacions amb la xifra final canviada: :<syntaxhighlight lang="wikitext" inline>{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifeq: 12345678901234567 | 12345678901234568 | equal | not equal}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}</syntaxhighlight> → '''{{#switch: 12345678901234567 | 12345678901234568 = equal | not equal}}''' Com que PHP utilitzat a <code>[[##ifeq|#ifeq]]</code> i <code>[[##switch|#switch]]</code> compara dos nombres de tipus enter, retorna el resultat esperat correctament. Mentre que amb <code>[[##ifexpr|#ifexpr]]</code> i els mateixos nombres: :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}</syntaxhighlight> → '''{{#ifexpr: 12345678901234567 = 12345678901234568 | equal | not equal}}''' Amb una xifra diferent, el resultat d'igual és en realitat incorrecte. Aquest comportament a <code>[[##ifexpr|#ifexpr]]</code> es deu al fet que MediaWiki converteix els nombres literals de les expressions al tipus ''float'' (nombres reals), cosa que, per a nombres enters grans com aquests, implica arrodoniment.<br /><br /> }} {{Anchor|ifexist|Ifexist|ifExist|IfExist|IFexist|IFEXIST}} == #ifexist == {{hatnote|1=Vegeu [[Manual:Checking for page existence|Manual:Comprovació de l'existència d'una pàgina]] per a altres mètodes de comprovació de l'existència d'una pàgina amb diferents limitacions.}} Aquesta funció pren una cadena d'entrada, la interpreta com a títol de pàgina i retorna un de dos valors segons si la pàgina existeix o no al wiki local. :<code><nowiki>{{#ifexist:</nowiki> ''page title'' | ''value if exists'' | ''value if doesn't exist'' <nowiki>}}</nowiki></code> La funció s'avalua com a {{phpi|true}} si la pàgina existeix, tant si conté contingut, com si està visiblement en blanc (conté metadades com ara enllaços de categoria o {{ll|Help:Magic words|paraules màgiques}}, però sense contingut visible), com si està en blanc o si tan sols és una {{ll|Help:Redirects|redirecció}}. Només les pàgines que tan sols tenen enllaços vermells s'avaluen com a {{phpi|false}}, fins i tot si la pàgina existia, però s'ha suprimit. :<code><nowiki>{{#ifexist:</nowiki> {{FULLPAGENAME}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: {{FULLPAGENAME}} | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> XX{{FULLPAGENAME}}XX | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: XX{{FULLPAGENAME}}XX | exists | doesn't exist }}''' La funció s'avalua com a {{phpi|true}} per als {{ll|Help:System message|missatges del sistema}} que s'han personalitzat i per a les {{ll|Help:Special pages|pàgines especials}} que el programari defineix. :<code><nowiki>{{#ifexist:</nowiki> {{#special:Watchlist}} | exists | doesn't exist <nowiki>}}</nowiki></code> → '''{{#ifexist: Special:Watchlist | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{#special:CheckUser}} | exists | doesn't exist <nowiki>}}</nowiki></code> → {{#ifexist: Special:Checkuser | '''exists''' (perquè l'extensió {{ll|Extension:Checkuser|nsp=0}} està instal·lada en aquest wiki) | '''doesn't exist''' (perquè l'extensió {{ll|Extension:Checkuser|nsp=0}} no està instal·lada en aquest wiki) }} :<code><nowiki>{{#ifexist: MediaWiki:Copyright | exists | doesn't exist }}</nowiki></code> → {{#ifexist: MediaWiki:Copyright | '''exists''' (perquè [[{{ns:8}}:Copyright]] s'ha personalitzat) | '''doesn't exist''' (perquè [[{{ns:8}}:Copyright]] no s'ha personalitzat) }} Abans de MediaWiki 1.45, si una pàgina comprova una destinació mitjançant <code>#ifexist:</code>, aquesta pàgina apareixerà a la llista [[{{#special:WhatLinksHere}}]] per a la pàgina de destinació. Per tant, si el codi <code><nowiki>{{#ifexist:Foo }}</nowiki></code> s'inclogués en directe en aquesta pàgina ({{FULLPAGENAME}}), [[{{#special:WhatLinksHere}}/Foo]] llistarà {{FULLPAGENAME}}. En wikis que utilitzen un repositori multimèdia compartit, <code>#ifexist:</code> es pot utilitzar per comprovar si un fitxer s'ha carregat al repositori però no al wiki en si: :<code><nowiki>{{#ifexist:</nowiki> {{ns:File}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:File}}:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> Image:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: Image:Example.png | exists | doesn't exist }}''' :<code><nowiki>{{#ifexist:</nowiki> {{ns:-2}}:Example.png <nowiki>| exists | doesn't exist }}</nowiki></code> → '''{{#ifexist: {{ns:-2}}:Example.png | exists | doesn't exist }}''' Si s'ha creat una pàgina de descripció local per al fitxer, el resultat és '''exists''' per a tots els anteriors. <code>#ifexist:</code> no funciona amb enllaços interwiki. <span id="ifexist_limits"></span> === Límits d'ifexist === <code>#ifexist:</code> es considera una "funció d'anàlisi costosa"; només se'n pot incloure un nombre limitat en una pàgina (incloses les funcions dins de les plantilles transcloses). Quan se supera aquest límit, qualsevol altra funció <code>#ifexist:</code> retorna automàticament fals, tant si la pàgina de destinació existeix com si no, i la pàgina es categoritza com a [[:Category:{{MediaWiki:expensive-parserfunction-category}}]]. El nom de la {{ll|Help:Tracking categories|categoria de seguiment}} pot variar segons l'idioma del contingut del vostre wiki. Per a alguns casos d'ús és possible emular l'efecte ifexist amb css, utilitzant els selectors <code>a.new</code> (per seleccionar enllaços a pàgines inexistents) o <code>a:not(.new)</code> (per seleccionar enllaços a pàgines existents). A més, com que el nombre de funcions d'anàlisi costoses que es poden utilitzar en una sola pàgina està controlat per <code>{{ll|Manual:$wgExpensiveParserFunctionLimit|$wgExpensiveParserFunctionLimit}}</code>, també es pot augmentar el límit a LocalSettings.php si cal. <span id="ifexist_and_wanted_pages"></span> === ifexist i pàgines buscades === Abans de MediaWiki 1.45, una pàgina que no existeix i es prova de buscar utilitzant #ifexist acabarà a les [[Special:MyLanguage/Manual:WantedPages|Pàgines demanades]]. Vegeu {{phab|T14019}} per saber-ne el motiu, i [[w:Template:Linkless exists]] com a solució alternativa. == #rel2abs == Aquesta funció converteix una ruta de fitxer relativa en una ruta de fitxer absoluta. :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#rel2abs:</nowiki> ''path'' <nowiki>|</nowiki> ''base path'' <nowiki>}}</nowiki></code> Dins de l'entrada de <code>path</code>, la sintaxi següent és vàlida: *<code>.</code> → el nivell actual *<code>..</code> → puja un nivell *<code>/foo</code> → baixa un nivell al subdirectori /foo Si no s'especifica la <code>base path</code>, s'utilitzarà el nom complet de la pàgina: :<code><nowiki>{{#rel2abs:</nowiki> /quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: /quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ./quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ./quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../. | {{ns:12}}:Foo/bar/baz }}''' S'ignora la sintaxi no vàlida, com ara <code>/.</code> o <code>/./</code>. Com que no es permeten més de dos punts consecutius, es poden utilitzar seqüències com aquestes per separar instruccions successives: :<code><nowiki>{{#rel2abs:</nowiki> ../quok/. | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../quok/. | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../quok | {{ns:12}}:Foo/bar/baz }}''' :<code><nowiki>{{#rel2abs:</nowiki> ../../../../quok | {{ns:12}}:Foo/bar/baz <nowiki>}}</nowiki></code> → '''{{#rel2abs: ../../../../quok | {{ns:12}}:Foo/bar/baz }}''' Per a un grup similar de funcions, vegeu també [[Special:MyLanguage/Help:Magic words#URL data|Ajuda:Paraules màgiques#Dades URL]]. Les funcions d'anàlisi incorporades inclouen: 'localurl:', 'fullurl:', 'anchorencode:' etc. == #switch == ''Vegeu també: [[w:Help:Switch parser function]]'' Aquesta funció compara un valor d'entrada amb diversos casos de prova, retornant una cadena associada si es troba una coincidència. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} ''default result'' <nowiki>}}</nowiki> }} Exemples: :<syntaxhighlight lang="wikitext" inline>{{#switch: baz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: baz | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: foo | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: foo | foo = Foo | baz = Baz | Bar }} ''' :<syntaxhighlight lang="wikitext" inline>{{#switch: zzz | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: zzz | foo = Foo | baz = Baz | Bar }} ''' <nowiki>#</nowiki>switch amb etiquetes de transclusió parcial es pot utilitzar per crear un fitxer de configuració que permet als editors que no estan familiaritzats amb la codificació de plantilles veure i editar elements configurables. <span id="Default"></span> === Per defecte === El <code>''resultat per defecte''</code> es retorna si cap cadena de <code>''casos''</code> coincideix amb la <code>''cadena de comparació''</code>: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz | Bar }} ''' En aquesta sintaxi, el resultat per defecte ha de ser l'últim paràmetre i no ha de contenir un signe igual sense format (un signe igual sense <code><nowiki>{{}}</nowiki></code>). Si ho fa, es tractarà com una comparació de casos i no es mostrarà cap text si no coincideix amb cap dels casos. Això és degut al fet que el valor per defecte no s'ha definit (és buit). Tanmateix, si un cas coincideix, es retornarà la cadena associada. :<syntaxhighlight lang="wikitext" inline>{{#switch: test | Bar | foo = Foo | baz = Baz }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | Bar | foo =Foo | baz =Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | foo = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> :<syntaxhighlight lang="wikitext" inline>{{#switch: test | test = Foo | baz = Baz | B=ar }}</syntaxhighlight>&nbsp;→ ''' {{#switch: test | test = Foo | baz = Baz | B=ar }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> Alternativament, el resultat per defecte es pot declarar explícitament amb una cadena de <code>''casos''</code> per a "<code>#default</code>". {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case'' = ''result'' {{!}} ''case'' = ''result'' {{!}} ''...'' {{!}} ''case'' = ''result'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} El resultat per defecte declarat d'aquesta manera es poden col·locar a qualsevol lloc de la funció: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | #default = Bar | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | #default = Bar | baz = Baz }} ''' Si s'omet el paràmetre <code>''default''</code> i no es troba cap coincidència, no es retorna cap <code>''result''</code>: :<syntaxhighlight lang="wikitext" inline>{{#switch: test | foo = Foo | baz = Baz }}</syntaxhighlight> → ''' {{#switch: test | foo = Foo | baz = Baz }} '''<!-- do not remove the spaces between «''' {{» and «}} '''» --> <span id="Grouping_results"></span> === Agrupació de resultats === És possible tenir diversos valors de cadenes de <code>''casos''</code> que retornin la mateixa cadena de <code>''resultat''</code>. Això minimitza la duplicació. {{pre|1= <nowiki>{{#switch:</nowiki> ''comparison string'' {{!}} ''case1'' = ''result1'' {{!}} ''case2'' {{!}} ''case3'' {{!}} ''case4'' = ''result234'' {{!}} ''case5'' = ''result5'' {{!}} ''case6'' {{!}} ''case7'' = ''result67'' {{!}} #default = ''default result'' <nowiki>}}</nowiki> }} Aquí els casos 2, 3 i 4 retornen <code>''result234''</code>; els casos 6 i 7 retornen <code>''result67''</code>. El "<code>#default = </code>" de l'últim paràmetre es pot ometre en el cas anterior. <span id="Use_with_parameters"></span> === Ús amb paràmetres === La funció es pot utilitzar amb paràmetres com a cadena de prova. En aquest cas, no cal col·locar la barra vertical després del nom del paràmetre, perquè és molt poc probable que trieu definir un cas com a cadena "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>". (Aquest és el valor que prendrà el paràmetre per defecte si la barra vertical està absent i el paràmetre no existeix o no té un valor. Vegeu {{ll|Help:Parser functions in templates}}.) :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | baz = Baz | Bar }}</syntaxhighlight> En el cas anterior, si <code><nowiki>{{{1}}}</nowiki></code> és igual a <code>foo</code>, la funció retornarà <code>Foo</code>. Si és igual a <code>baz</code>, la funció retornarà <code>Baz</code>. Si el paràmetre és buit o no existeix, la funció retornarà <code>Bar</code>. Com a la secció anterior, els casos es poden combinar per donar un únic resultat. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | Bar }}</syntaxhighlight> Aquí, si <code><nowiki>{{{1}}}</nowiki></code> és igual a <code>foo</code>, <code>zoo</code> o <code>roo</code>, la funció retornarà <code>Foo</code>. Si és igual a <code>baz</code>, la funció retornarà <code>Baz</code>. Si el paràmetre és buit o no existeix, la funció retornarà <code>Bar</code>. A més, es pot ometre el resultat per defecte si no es vol retornar res si el valor del paràmetre de prova no coincideix amb cap dels casos. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo = Foo | bar = Bar }}</syntaxhighlight> En aquest cas, la funció retorna una cadena buida tret que <code><nowiki>{{{1}}}</nowiki></code> existeixi i sigui igual a <code>foo</code> o <code>bar</code>, en aquest cas retorna <code>Foo</code> o <code>Bar</code>, respectivament. Això té el mateix efecte que declarar el resultat per defecte com a buit. :<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | foo | zoo | roo = Foo | baz = Baz | }}</syntaxhighlight> Si decidiu definir un cas com a "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>", la funció retornarà el resultat d'aquest cas quan el paràmetre no existeixi o no tingui un valor. El paràmetre hauria d'existir i tenir un valor diferent de la cadena "<code><nowiki>{{{</nowiki>''parameter name''<nowiki>}}}</nowiki></code>" per retornar el resultat per defecte de la funció. :(quan <code><nowiki>{{{1}}}</nowiki></code> no existeix o està buit): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' :(quan <code><nowiki>{{{1}}}</nowiki></code> té el valor "<code>test</code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Bar ''' :(quan <code><nowiki>{{{1}}}</nowiki></code> té el valor "<code><nowiki>{{{1}}}</nowiki></code>"): ::<syntaxhighlight lang="wikitext" inline>{{#switch: {{{1}}} | {{{1}}} = Foo | baz = Baz | Bar }}</syntaxhighlight> → ''' Foo ''' En aquest cas hipotètic, caldria afegir la barra vertical al paràmetre (<code><nowiki>{{{1</nowiki><span style="color:red; font-weight:bold">|</span><nowiki>}}}</nowiki></code>). <span id="Comparison_behavior"></span> === Comportament en comparació === Igual que amb <code>[[##ifeq|#ifeq]]</code>, la comparació es fa numèricament si tant la cadena de comparació com la cadena de cas que s'està provant són numèriques; o com una cadena que distingeix entre majúscules i minúscules en cas contrari: :<syntaxhighlight lang="wikitext" inline>{{#switch: 0 + 1 | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 0 + 1 | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: {{#expr: 0 + 1}} | 1 = one | 2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 02 | +1 = one | +2 = two | three}}</syntaxhighlight>&nbsp;→ '''{{#switch: 02 | +1 = one | +2 = two | three}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}</syntaxhighlight>&nbsp;→ '''{{#switch: 100 | 1e1 = ten | 1e2 = hundred | other}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: a | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: a | a = A | b = B | C}}''' :<syntaxhighlight lang="wikitext" inline>{{#switch: A | a = A | b = B | C}}</syntaxhighlight>&nbsp;→ '''{{#switch: A | a = A | b = B | C}}''' Una cadena <code>''cas''</code> pot estar buida: :<syntaxhighlight lang="wikitext" inline>{{#switch: | = Nothing | foo = Foo | Something }}</syntaxhighlight> → '''{{#switch: | = Nothing | foo = Foo | Something }}''' Un cop es troba una coincidència, els <code>''casos''</code> següents s'ignoren: :<syntaxhighlight lang="wikitext" inline>{{#switch: b | f = Foo | b = Bar | b = Baz | }}</syntaxhighlight> → '''{{#switch: b | f = Foo | b = Bar | b = Baz | }}''' {{Warning|1= Les comparacions numèriques amb <code>[[##switch|#switch]]</code> i <code>[[##ifeq|#ifeq]]</code> no són equivalents a les comparacions en expressions (vegeu també anteriorment): :<syntaxhighlight lang="wikitext" inline>{{#switch: 12345678901234567 | 12345678901234568 = A | B}}</syntaxhighlight>&nbsp;→ '''{{#switch: 12345678901234567 | 12345678901234568 = A | B}}''' :<syntaxhighlight lang="wikitext" inline>{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}</syntaxhighlight>&nbsp;→ '''{{#ifexpr: 12345678901234567 = 12345678901234568 | A | B}}''' }} <span id="Raw_equal_signs"></span> === Signes iguals que no es volen processar === Les cadenes de "cas" no poden contenir signes iguals que no es vulguin processar. Per solucionar-ho, utilitzeu la paraula màgica [[Special:MyLanguage/Help:Magic words#Other|{{((}}={{))}}]] o substituïu el signe igual per codi HTML <code><nowiki>&amp;#61;</nowiki></code>. Exemple: {| class="wikitable" ! Si escriviu ! Obteniu |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1=2 = raw | 1<nowiki>=</nowiki>2 = nowiki | 1{{=}}2 = template | default }}''' |- | <syntaxhighlight lang=wikitext> {{#switch: 1=2 | 1&#61;2 = html | default }} </syntaxhighlight> | '''{{#switch: 1=2 | 1&#61;2 = html | default }}''' |} {{note|1=Per obtenir un exemple senzill i real de l'ús d'aquesta funció, consulteu [https://en.wikipedia.org/w/index.php?title=Template:NBA_color&action=edit&oldid=600531646 Template:NBA color]. Podeu trobar dos exemples complexos a {{ll|Template:Extension}} i [[w:Template:BOTREQ]]. }} <span id="Replacing_#ifeq"></span> === Substitució de #ifeq === <code>#switch</code> es pot utilitzar per reduir la [[Special:MyLanguage/Help:Expansion depth|profunditat d'expansió]]. Per exemple: * <syntaxhighlight lang="wikitext" inline>{{#switch:{{{1}}} |condition1=branch1 |condition2=branch2 |condition3=branch3 |branch4}}</syntaxhighlight> és equivalent a * <syntaxhighlight lang="wikitext" inline>{{#ifeq:{{{1}}}|condition1 |branch1 |{{#ifeq:{{{1}}}|condition2 |branch2 |{{#ifeq:{{{1}}}|condition3 |branch3 |branch4}}}}}}</syntaxhighlight> és a dir, imbricació profunda, lineal: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1 |<!--else-->{{#ifeq:{{{1}}}|condition2 |<!--then-->branch2 |<!--else-->{{#ifeq:{{{1}}}|condition3 |<!--then-->branch3 |<!--else-->branch4}}}}}} </syntaxhighlight> D'altra banda, la substitució del commutador podria ser complicada/poc pràctica per a IF imbricats en ambdues branques (mostrades amb alternatives de sagnat, sagnades a banda i banda), creant un arbre completament simètric: <syntaxhighlight lang="wikitext"> {{#ifeq:{{{1}}}|condition1 |<!--then-->branch1t{{ #ifeq:{{{1}}}|condition2 |<!--then-->branch1t2t{{#ifeq:{{{1}}}|condition4|<!--then-->branch1t2t4t|<!--else-->branch1t2t4e}} |<!--else-->branch1t2e{{#ifeq:{{{1}}}|condition5|<!--then-->branch1t2e5t|<!--else-->branch1t2e5e}} }} |<!--else-->branch1e{{#ifeq:{{{1}}}|condition3 |<!--then-->branch1e3t{{#ifeq:{{{1}}}|condition6|branch1e3t6t|branch1e3t6e}} |<!--else-->branch1e3e{{ #ifeq:{{{1}}}|condition7 |branch1e3e7t |branch1e3e7t }} }} }} </syntaxhighlight> {{Anchor|time|TIME}} == #time == {| class="wikitable plainlinks" style="float: {{dir|{{pagelang}}|left|right}}; font-size: 90%; line-height: normal; margin-{{dir|{{pagelang}}|right|left}}: 1em; max-width: 40%;" |- ! {{hl1}} | Codi ! {{hl1}} | Descripció ! {{hl1}} | Sortida actual <br /><small class="noprint">([{{fullurl:Help:Extension:ParserFunctions{{#translation:}}|action=purge}} Purga la memòria cau d'aquesta pàgina] per actualitzar-la)</small> |- ! {{hl2}} colspan="3"| Any |- | style="text-align: center; font-weight: bold;" | <code>Y</code> | style="font-weight: bold;" | Any de 4 dígits. | style="text-align: center; font-weight: bold;" | {{#time:Y}} |- | style="text-align: center;" | <code>y</code> | Any de 2 dígits. | style="text-align: center;" | {{#time:y}} |- | style="text-align: center;" | <code>L</code> | 1 si és un any de traspàs, 0 si no. | style="text-align: center;" | {{#time:L}} |- | style="text-align: center;" | <code>o</code>{{#tag:ref|Requereix PHP 5.1.0 i més nou i [[rev:45208]].|group=note}} | Any de la setmana especificada segons ISO-8601.{{#tag:ref|Això té el mateix valor que Y, excepte que si el número de setmana ISO (W) pertany a l'any anterior o següent, s'utilitza aquest any.|group=note}} | style="text-align: center;" | {{#time:o}}{{#tag:ref|Presentarà el literal ''o'' si no es compleix la nota 1.|group=note}} |- | colspan="3" style="font-size: 88%;" |<references group="note"/> |- ! {{hl2}} colspan="3"| Mes |- | style="text-align: center;" | <code>n</code> | Índex del mes, sense omplir amb zeros. | style="text-align: center;" | {{#time:n}} |- | style="text-align: center; font-weight: bold;" | <code>m</code> | style="font-weight: bold;" | Índex del mes, omplint amb zeros. | style="text-align: center; font-weight: bold;" | {{#time:m}} |- | style="text-align: center;" | <code>M</code> | Una abreviatura del nom del mes, en l'idioma del lloc. | style="text-align: center;" | {{#time:M}} |- | style="text-align: center;" | <code>F</code> | El nom complet del mes en l'idioma del lloc. | style="text-align: center;" | {{#time:F}} |- | style="text-align: center;" | <code>xg</code> | Retorna el nom complet del mes en la [[:ca:Cas genitiu|forma genitiva]] per als idiomes del lloc que distingeixen entre formes genitives i [[:ca:Cas nominatiu|nominatives]]. Aquesta opció és útil per a moltes [[:ca:Llengües eslaves|llengües eslaves]] com el polonès, el rus, el bielorús, el txec, l'eslovac, l'eslovè, l'ucraïnès, etc. | style="line-height: 1.6;" | Per al polonès:<br /><code style="font-size: 85%;"><nowiki>{{#time:F Y|June 2010|pl}}</nowiki></code> → {{#time:F Y|June 2010|pl}}<br />(nominatiu)<br /><code style="font-size: 85%;"><nowiki>{{#time:d xg Y|20 June 2010|pl}}</nowiki></code> → {{#time:d xg Y|20 June 2010|pl}}<br />(genitiu) |- ! {{hl2}} colspan="3"| Dia del mes o de l'any |- | style="text-align: center;" | <code>j</code> | Dia del mes, sense omplir amb zeros. | style="text-align: center;" | {{#time:j}} |- | style="text-align: center; font-weight: bold;" | <code>d</code> | style="font-weight: bold;" | Dia del mes, omplint amb zeros | style="text-align: center; font-weight: bold;" | {{#time:d}} |- | style="text-align: center;" | <code>z</code> | Dia de l'any (1 de gener = 0). <br />{{Nota}}: Per obtenir el dia de l'any segons ISO, afegiu 1. | style="text-align: center;" | {{#time:z}} |- ! {{hl2}} colspan="3"| Setmana i dia de la setmana |- | style="text-align: center;" | <code>W</code> | Número de setmana segons ISO 8601, omplint amb zeros. | style="text-align: center;" | {{#time:W}} |- | style="text-align: center;" | <code>N</code> | Dia de la setmana segons ISO 8601 (dilluns = 1, diumenge = 7). | style="text-align: center;" | {{#time:N}} |- | style="text-align: center;" | <code>w</code> | Número del dia de la setmana (diumenge = 0, dissabte = 6). | style="text-align: center;" | {{#time:w}} |- | style="text-align: center;" | <code>D</code> | Una abreviatura per al dia de la setmana. Rarament internacionalitzat. | style="text-align: center;" | {{#time:D}} |- | style="text-align: center;" | <code>l</code> | El nom complet del dia de la setmana. Rarament internacionalitzat. | style="text-align: center;" | {{#time:l}} |- !{{hl2}} colspan="3"| Hora |- | style="text-align: center;" | <code>a</code> | "am" durant el matí (00:00:00 → 11:59:59), "pm" en cas contrari (12:00:00 → 23:59:59). | style="text-align: center;" | {{#time:a}} |- | style="text-align: center;" | <code>A</code> | Una versió en majúscula de l'anterior. | style="text-align: center;" | {{#time:A}} |- | style="text-align: center;" | <code>g</code> | Hora en format de 12 hores, sense omplir amb zeros. | style="text-align: center;" | {{#time:g}} |- | style="text-align: center;" | <code>h</code> | Hora en format de 12 hores, omplint amb zeros. | style="text-align: center;" | {{#time:h}} |- | style="text-align: center;" | <code>G</code> | Hora en format de 24 hores, sense omplir amb zeros. | style="text-align: center;" | {{#time:G}} |- | style="text-align: center; font-weight: bold;" | <code>H</code> |style="font-weight: bold;"| Hora en format de 24 hores, omplint amb zeros. | style="text-align: center; font-weight: bold;" | {{#time:H}} |- !{{hl2}} colspan="3"| Minuts i segons |- | style="text-align: center; font-weight: bold;" | <code>i</code> | style="font-weight: bold;" | Minuts passats de l'hora, omplint amb zeros. | style="text-align: center; font-weight: bold;" | {{#time:i}} |- | style="text-align: center; font-weight: bold;" | <code>s</code> | style="font-weight: bold;" | Segons passats del minut, omplint amb zeros. | style="text-align: center; font-weight: bold;" | {{#time:s}} |- | style="text-align: center;" | <code>U</code> | [[:ca:Hora Unix|Hora Unix]] Segons des de l'1 de gener de 1970 00:00:00 GMT | style="text-align: center;" | {{#time:U}} |- ! id="TimeZone" {{hl2}} colspan="3"| Fus horari (a partir de [[MediaWiki_1.22/Roadmap|1.22wmf2]]) |- | style="text-align: center;" | <code>e</code> | Identificador de fus horari. | style="text-align: center;" | {{#time:e}} |- | style="text-align: center;" | <code>I</code> | Si la data és o no en horari d'estiu. | style="text-align: center;" | {{#time:I}} |- | style="text-align: center;" | <code>O</code> | Diferència respecte a l'hora de Greenwich (GMT) | style="text-align: center;" | {{#time:O}} |- | style="text-align: center;" | <code>P</code> | Diferència respecte a l'hora de Greenwich (GMT), amb dos punts | style="text-align: center;" | {{#time:P}} |- | style="text-align: center;" | <code>T</code> | Abreviatura de fus horari. | style="text-align: center;" | {{#time:T}} |- | style="text-align: center;" | <code>Z</code> | Desplaçament de fus horari en segons. | style="text-align: center;" | {{#time:Z}} |- ! {{hl2}} colspan="3"| Miscel·lània |- | style="text-align: center;" | <code>t</code> | Nombre de dies del mes actual. | style="text-align: center;" | {{#time:t}} |- | style="text-align: center;" | <code>c</code> | Data amb format ISO 8601, equivalent a <code>Y-m-d"T"H:i:s+00:00</code>. | style="font-size: 75%;" | {{#time:c}} |- | style="text-align: center;" | <code>r</code> | Data amb format [[rfc:5322|RFC 5322]], equivalent a <code>D, j M Y H:i:s +0000</code>, amb el nom del dia de la setmana i el nom del mes no internacionalitzats. | style="font-size: 75%;" | {{#time:r}} |- ! {{hl2}} colspan="3" | Calendaris no gregorians |- ! {{hl3}} colspan="3" | Islàmic |- | style="text-align: center;" | <code>xmj</code> | Dia del mes. | {{#time:xmj}} |- | style="text-align: center;" | <code>xmF</code> | Nom complet del mes. | {{#time:xmF}} |- | style="text-align: center;" | <code>xmn</code> | Índex del mes | {{#time:xmn}} |- | style="text-align: center;" | <code>xmY</code> | Any complet. | {{#time:xmY}} |- ! {{hl3}} colspan="3" | Iranià (Jalaly) |- | style="text-align: center;" | <code>xit</code> | Nombre de dies del mes. | {{#time:xit}} |- | style="text-align: center;" | <code>xiz</code> | Dia de l'any. | {{#time:xiz}} |- | style="text-align: center;" | <code>xij</code> | Dia del mes. | {{#time:xij}} |- | style="text-align: center;" | <code>xiF</code> | Nom complet del mes. | {{#time:xiF}} |- | style="text-align: center;" | <code>xin</code> | Índex del mes | {{#time:xin}} |- | style="text-align: center;" | <code>xiY</code> | Any complet. | {{#time:xiY}} |- | style="text-align: center;" | <code>xiy</code> | Any de 2 dígits. | {{#time:xiy}} |- ! {{hl3}} colspan="3" | Hebreu |- | style="text-align: center;" | <code>xjj</code> | Dia del mes. | {{#time:xjj}} |- | style="text-align: center;" | <code>xjF</code> | Nom complet del mes. | {{#time:xjF}} |- | style="text-align: center;" | <code>xjt</code> | Nombre de dies del mes. | {{#time:xjt}} |- | style="text-align: center;" | <code>xjx</code> | Forma genitiva del nom del mes. | {{#time:xjx}} |- | style="text-align: center;" | <code>xjn</code> | Número del mes. | {{#time:xjn}} |- | style="text-align: center;" | <code>xjY</code> | Any complet. | {{#time:xjY}} |- ! {{hl3}} colspan="3" | Calendari solar tailandès |- | style="text-align: center;" | <code>xkY</code> | Any complet en el [[w:Thai solar calendar|calendari solar tailandès]]. <br />{{Nota}}: Per als anys anteriors al 1941, les dates del rang gener-març no es [[w:Thai_solar_calendar#New_year|calculen]] correctament. | {{#time:xkY}} |- ! {{hl3}} colspan="3" | Any Minguo/Juche |- | style="text-align: center;" | <code>xoY</code> | Any complet. | {{#time:xoY}} |- ! {{hl3}} colspan="3" | Nengo japonès |- | style="text-align: center;" | <code>xtY</code> | Any complet. | {{#time:xtY}} |- ! {{hl2}} colspan="3" | Presentacions especials |- | style="text-align: center;" | <code>xn</code> | Formata el següent codi numèric com a número ASCII en brut. | En l'idioma hindi, <syntaxhighlight lang="wikitext" inline>{{#time:H, xnH}}</syntaxhighlight> produeix ०६, 06. |- | style="text-align: center;" | <code>xN</code> | colspan="2" | Com <code>xn</code>, però com un indicador activat o desactivat, que perdura fins al final de la cadena o fins a la propera aparició de <code>xN</code> a la cadena. |- | style="text-align: center;" | <code>xr</code> | Formata el següent número com a numeral romà. Només funciona per a nombres fins a 10.000<br /><small>(fins a 3.000 en pre MediaWiki 1.20)</small>. | <syntaxhighlight lang="wikitext" inline>{{#time:xrY}}</syntaxhighlight> → {{#time:xrY}} |- | style="text-align: center;" | <code>xh</code> | Formata el següent número com a numeral hebreu. | <syntaxhighlight lang="wikitext" inline>{{#time:xhY}}</syntaxhighlight> → {{#time:xhY}} |} Aquesta funció d'anàlisi pren una data i/o hora (en el calendari gregorià) i la formata segons la sintaxi donada. Es pot especificar un objecte de data/hora; el valor per defecte és el valor de la [[Special:MyLanguage/Help:Magic words#Date and time|paraula màgica]] <syntaxhighlight lang="wikitext" inline>{{CURRENTTIMESTAMP}}</syntaxhighlight> &ndash; és a dir, l'hora en què la pàgina es va renderitzar per última vegada en HTML. :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#time:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>|</nowiki> ''local'' <nowiki>}}</nowiki></code> La llista de codis de format acceptats es mostra a la taula de la dreta. Qualsevol caràcter de la cadena de format que no es reconeix es passa sense alterar; això també s'aplica als espais en blanc (el sistema no els necessita per interpretar els codis). Si no es reconeix cap caràcter a la cadena de format i l'objecte de data/hora no té errors, la cadena de format es retorna com a sortida. També hi ha dues maneres de caràcters d'escapament dins de la cadena de formatació: # Una barra invertida seguida d'un caràcter de formatació s'interpreta com un únic caràcter literal. # Els caràcters entre cometes dobles es consideren caràcters literals i les cometes s'eliminen. A més, el dígraf <code>xx</code> s'interpreta com una única "x" literal. A mesura que la llista de codis de formatació continua evolucionant (amb el suport de nous calendaris o de nous camps de data calculats i formatats de manera diferent), hauríeu d'escapar tots els caràcters literals (no només les lletres ASCII que s'utilitzen actualment en els codis de formatació) que s'han de passar sense alterar. Malauradament, de moment, les cometes simples ASCII encara no es reconeixen com una alternativa senzilla per marcar un text literal amb les cometes dobles ASCII actualment compatibles (per exemple, les cometes dobles són obligatòries en altres usos com la delimitació de valors de cadena en JSON, C, C++...) i les barres invertides (que també s'han d'escapar en constants de cadena utilitzades per molts llenguatges, inclosos JSON, C, C++, PHP, JavaScript, Lua). Així doncs, encara no podeu incrustar cap cometa doble literal sense escapar-la amb una barra invertida (o podeu utilitzar altres cometes arrissades, angulars o quadrades). :<syntaxhighlight lang="wikitext" inline>{{#time: Y-m-d }}</syntaxhighlight> → '''{{#time: Y-m-d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y]] m d }}</syntaxhighlight> → '''{{#time: [[Y]] m d }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y (year)]] }}</syntaxhighlight> → '''{{#time: [[Y (year)]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: [[Y "(year)"]] }}</syntaxhighlight> → '''{{#time: [[Y "(year)"]] }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: i's" }}</syntaxhighlight> → '''{{#time: i's" }}''' L'<code>''objecte de data/hora''</code> pot tenir qualsevol format acceptat per la funció [https://php.net/function.strtotime strtotime()] de PHP. S'accepten temps absoluts (per exemple, <code>20 December 2000</code>), relatius (per exemple, <code>+20 hours</code>) i combinats (per exemple, <code>30 July +1 year</code>). :<syntaxhighlight lang="wikitext" inline>{{#time: r|now}}</syntaxhighlight> → '''{{#time: r|now}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|+2 hours}}</syntaxhighlight> → '''{{#time: r|+2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|now + 2 hours}}</syntaxhighlight> → '''{{#time: r|now + 2 hours}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|20 December 2000}}</syntaxhighlight> → '''{{#time: r|20 December 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|December 20, 2000}}</syntaxhighlight> → '''{{#time: r|December 20, 2000}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000-12-20}}</syntaxhighlight> → '''{{#time: r|2000-12-20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|2000 December 20}}</syntaxhighlight> &rarr; '''{{#time: r|2000 December 20}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r|last tuesday}}</syntaxhighlight> &rarr; '''{{#time: r|last tuesday}}''' El <code>''codi d'idioma''</code> de la norma [[w:ISO 639-3|ISO 639-3]] (?) permet que la cadena es mostri en l'idioma escollit :<syntaxhighlight lang="wikitext" inline>{{#time:d F Y|1988-02-28|nl}}</syntaxhighlight> → '''{{#time:d F Y|1988-02-28|nl}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:l|now|uk}}</syntaxhighlight> → '''{{#time:l|now|uk}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:d xg Y|20 June 2010|pl}}</syntaxhighlight> → '''{{#time:d xg Y|20 June 2010|pl}}''' El paràmetre <code>''local''</code> especifica si l'''objecte de data/hora'' fa referència al fus horari local o a l'UTC. Aquest és un paràmetre booleà: el seu valor es determina convertint el valor de l'argument (vegeu la [https://php.net/language.types.boolean#language.types.boolean.casting documentació oficial de PHP] per obtenir més informació sobre com es converteixen les cadenes en valors booleans). {{note|2=reminder|1=Tingueu en compte que, si la variable {{phpi|$wgLocaltimezone}} està definida com a <code>UTC</code>, no hi ha cap diferència en el resultat quan <code>local</code> està definit com a <code>true</code> o <code>false</code>.}} Vegeu els exemples següents per a més detalls: :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|now|it|1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||0}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Y F d H:i:s|+2 hours||1}}</syntaxhighlight> → '''{{#time: Y F d H:i:s|+2 hours||1}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|0}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|2019-05-16T17:05:43+02:00|it|true}}</syntaxhighlight> → '''{{#time:c|2019-05-16T17:05:43+02:00|it|true}}''' Si heu calculat una marca de temps Unix, podeu utilitzar-la en càlculs de data afegint-hi al davant un símbol <code>@</code>. :<syntaxhighlight lang="wikitext" inline>{{#time: U | now }}</syntaxhighlight> → '''{{#time: U | now}}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U}} <nowiki>}}</nowiki></code> → '''{{#time: r | @{{#time:U}} }}''' {{Warning|1= Sense el prefix <code>@</code> abans dels valors numèrics de marca de temps, la majoria de les vegades el resultat és un error o és un valor inesperat: :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:39 }} }}''' (correcte) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:39 }} }}''' (format d'any no admès) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 00:16:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 00:16:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 00:16:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 00:16:40 }} }}''' (correcte) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 00:16:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 00:16:40 }} }}''' (interpretat com un any amb el mes i el dia actuals) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:39 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:39 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:39 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:39 }} }}''' (correcte) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:39 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:39 }} }}''' (interpretat com un any amb el mes i el dia actuals) :<syntaxhighlight lang="wikitext" inline>{{#time: r | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: r | 1970-01-01 02:46:40 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: U | 1970-01-01 02:46:40 }}</syntaxhighlight> → '''{{#time: U | 1970-01-01 02:46:40 }}''' :<code><nowiki>{{#time: r | @</nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | @{{#time: U | 1970-01-01 02:46:40 }} }}''' (correcte) :<code><nowiki>{{#time: r | </nowiki>{{#time: U | 1970-01-01 02:46:40 }}<nowiki> }}</nowiki></code> → '''{{#time: r | {{#time: U | 1970-01-01 02:46:40 }} }}''' (format d'any no admès) }} {{Warning|1= El rang d'entrada acceptable és de l'1 de gener de 0111 → 31 de desembre de 9999. Per als anys del 100 al 110, el resultat és inconsistent, els anys Y i de traspàs són com els anys 100-110, r, D, l i U són com interpretar aquests anys com a 2000-2010. :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: d F Y | 29 Feb 0100 }}'''<br /> (correcte, no hi ha any de traspàs), però :<syntaxhighlight lang="wikitext" inline>{{#time: r | 29 Feb 0100 }}</syntaxhighlight> → '''{{#time: r | 29 Feb 0100 }}''' (incorrecte, fins i tot si 100 s'interpreta com a 2000, perquè és un any de traspàs) :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 15 April 10000 }}</syntaxhighlight> → '''{{#time: d F Y | 15 April 10000 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: r | 10000-4-15 }}</syntaxhighlight> → '''{{#time: r | 10000-4-15 }}''' Els números d'any del 0 al 99 s'interpreten com a 2000-2069 i 1970-1999, excepte quan s'escriuen en format de 4 dígits amb zeros a la dreta: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 6 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 6 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 06 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 06 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 006 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | 1 Jan 0006 }}</syntaxhighlight> → '''{{#time: d F Y | 1 Jan 0006 }}''' (4-digit format) El dia de la setmana se subministra per als anys 100-110 i a partir de 1753, per als anys 111-1752 el resultat r mostra "Desconegut" i el resultat l "<>". Com a conseqüència, el resultat r no s'accepta com a entrada per a aquests anys. }} Es poden especificar dates absolutes completes o parcials; la funció "omplirà" les parts de la data que no s'especifiquen utilitzant els valors ''actuals'': :<syntaxhighlight lang="wikitext" inline>{{#time: Y | January 1 }}</syntaxhighlight> → '''{{#time: Y | January 1 }}''' {{Warning|1= La funció d'ompliment no és coherent; algunes parts s'omplen utilitzant els valors actuals, altres no: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June }}''' Dona l'inici del dia, però el dia actual del mes i l'any actual. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 2003 }}''' Dona l'inici del dia, però el dia actual de l'any. Hi ha un cas d'excepció del dia complet: :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | June 2003 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | June 2003 }}''' Dona l'inici del dia i l'inici del mes. }} Un nombre de quatre dígits sempre s'interpreta com un any, mai com a hores i minuts:<ref>Abans de {{rev|86805}} el 2011, això no era així.</ref> :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 1959 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 1959 }}''' Un nombre de sis dígits s'interpreta com a hores, minuts i segons si és possible, però en cas contrari com a un error (no, per exemple, un any i un mes): :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 195909 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 195909 }}''' L'entrada es tracta com una hora en lloc d'un codi any+mes. :<syntaxhighlight lang="wikitext" inline>{{#time: Y m d H:i:s | 196009 }}</syntaxhighlight> → '''{{#time: Y m d H:i:s | 196009 }}''' Tot i que 19:60:09 no és una hora vàlida, 196009 no s'interpreta com a setembre de 1960. La funció realitza una certa quantitat de matemàtiques de dates: :<syntaxhighlight lang="wikitext" inline>{{#time: d F Y | January 0 2008 }}</syntaxhighlight> → '''{{#time: d F Y | January 0 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | January 32 }}</syntaxhighlight> → '''{{#time: d F | January 32 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2008 }}</syntaxhighlight> → '''{{#time: d F | February 29 2008 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time: d F | February 29 2007 }}</syntaxhighlight> → '''{{#time: d F | February 29 2007 }}''' :<syntaxhighlight lang="wikitext" inline>{{#time:Y-F|now -1 months}}</syntaxhighlight> → '''{{#time:Y-F|now -1 months}}''' La longitud total de les cadenes de format de les crides de <code>#time</code> és limitat a 6000 caràcters.<ref> [https://phabricator.wikimedia.org/diffusion/EPFN/browse/master/includes/ParserFunctions.php$31 ParserFunctions.php] </ref> <span id="Time_Zone_issue"></span> ==== Problema amb la zona horària ==== Hi ha un error en aquesta funció d'anàlisi #time (més concretament a ''DateTime de PHP'') que no permet la introducció de nombres que no siguin enters com a desplaçaments de zona horària relativa. Aquest problema no s'aplica quan s'utilitza una zona horària d'hora, com ara EDT. Per exemple: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | -4 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | -4 hours}} Tanmateix, l'Índia té un desplaçament de +5,5 hores respecte a UTC i, per tant, l'ús de la seva zona horària normalment no permetrà el càlcul correcte d'un desplaçament de zona horària relativa. Això és el que passa: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +5.5 hours }}</syntaxhighlight> &rarr; {{#time:g:i A | +5.5 hours }} Per solucionar aquest problema, simplement convertiu el temps en minuts o segons, així: * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +330 minutes }}</syntaxhighlight> &rarr; {{#time:g:i A | +330 minutes }} * <syntaxhighlight lang="wikitext" inline>{{#time:g:i A | +19800 seconds }}</syntaxhighlight> &rarr; {{#time:g:i A | +19800 seconds }} (Tim Starling, el desenvolupador d'aquesta funció, va proporcionar la sintaxi exacta per a solucionar-ho.) <span id="#time_format_like_in_signatures"></span> ==== Format #time com en les signatures ==== De vegades és útil construir una marca de temps, que s'assembla a la marca de temps automàtica generada per les [[Special:MyLanguage/Help:Signatures|signatures]] en debats a les pàgines de discussió. En un wiki en anglès, es pot crear amb: * <syntaxhighlight lang="wikitext" inline>{{#timel:H:i, j xg Y (e)|+330 minutes}}</syntaxhighlight> &rarr; {{#timel:H:i, j xg Y (e)|+330 minutes}} == #timel == Aquesta funció és idèntica a <code><nowiki>{{#time: ... }}</nowiki></code> amb el paràmetre <code>local</code> definit com a {{phpi|true}}, de manera que sempre utilitza l'hora local del wiki (tal com s'estableix a {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}). La sintaxi de la funció és: :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timel:</nowiki> ''format string'' <nowiki>|</nowiki> ''date/time object'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{note|2=reminder|1=Tingueu en compte que, si la variable {{phpi|$wgLocaltimezone}} està definida com a <code>UTC</code>, no hi ha cap diferència en el resultat quan <code>local</code> està definit com a {{phpi|true}} o {{phpi|false}}.}} [[File:Time-Timel.png|thumb|Exemple de l'ús de les funcions d'anàlisi #time i #timel des d'un servidor on el fus horari no és UTC]] Per exemple, vegeu els exemples següents: :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it}}</syntaxhighlight> → '''{{#time:c|now|it}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|0}}</syntaxhighlight> → '''{{#time:c|now|it|0}}''' :<syntaxhighlight lang="wikitext" inline>{{#time:c|now|it|1}}</syntaxhighlight> → '''{{#time:c|now|it|1}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel:c|now|it}}</syntaxhighlight> → '''{{#timel:c|now|it}}''' [[File:Maldiskusjon Sommertid–Wikipedia.jpg|thumb|Exemple d'advertència de https://no.wikipedia.org/wiki/Maldiskusjon:Sommertid]] {{Warning|1= Tingueu en compte que la U, tant per a l'hora com per a l'horari, retornarà el mateix nombre de segons des del 1970-01-01 00:00:00 UTC a les Viquipèdies amb fusos horaris diferents de l'UTC (abans conegut com a GMT) :<code>U</code> Hora Unix. Segons des de l'1 de gener de 1970 a les 00:00:00 GMT. :<code>Z</code> Desplaçament de la zona horària en segons. :<syntaxhighlight lang="wikitext" inline>{{#time: U}}</syntaxhighlight> → '''{{#time: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: U}}</syntaxhighlight> → '''{{#timel: U}}''' :<syntaxhighlight lang="wikitext" inline>{{#time: Z}}</syntaxhighlight> → '''{{#time: Z}}''' :<syntaxhighlight lang="wikitext" inline>{{#timel: Z}}</syntaxhighlight> → '''{{#timel: Z}}''' }} {{-}} {{Anchor|timef}} == #timef == Aquesta funció formata una data utilitzant un format estàndard per a l'idioma seleccionat, tal com es defineix a <code>[https://codesearch.wmcloud.org/core/?q=dateFormats&files=languages/messages $dateFormats]</code> (vegeu {{Phab|T223772}}). : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>}}</nowiki></code> |1=''objecte de data/hora'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>}}</nowiki></code> |1=''objecte de data/hora'' |2=''tipus de format'' }} : {{tmpl|0=<code><nowiki>{{#timef:</nowiki> $1 <nowiki>|</nowiki> $2 <nowiki>|</nowiki> $3 <nowiki>}}</nowiki></code> |1=''objecte de data/hora'' |2=''tipus de format'' |3=''codi de l'idioma'' }} El format de l'"objecte data/hora" és el mateix que per a [[#time|#time]]. Si està buit, s'utilitza l'hora en què es va renderitzar la pàgina. El ''tipus de format'' pot ser un dels següents: ; <code>time</code> : Només es mostra l'hora. ; <code>date</code> : Només es mostra la data. ; <code>both</code> : Es mostren tant l'hora com la data. ; <code>pretty</code> : Només es mostra la data, utilitzant un format abreujat que no inclou l'any. No tots els idiomes admeten això; si no és compatible, s'utilitza el format "date". Si no s'especifica el tipus de format, es mostraran tant l'hora com la data, com si s'hagués especificat <code>both</code>. Si no s'especifica el ''codi d'idioma'', s'utilitza l'idioma del contingut de la pàgina. L'ús de <code>#timef</code> en lloc de <code>#time</code> permet que les plantilles admetin més fàcilment diversos idiomes, ja que diferents idiomes tenen maneres diferents de formatar les dates. En anglès, l'ordre del dia i del mes es controla mitjançant {{wg|AmericanDates}}. Exemples: :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|en}}</syntaxhighlight> → ''' {{#timef:now|both|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|both|ja}}</syntaxhighlight> → ''' {{#timef:now|both|ja}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|en}}</syntaxhighlight> → ''' {{#timef:now|pretty|en}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:now|pretty|pl}}</syntaxhighlight> → ''' {{#timef:now|pretty|pl}} ''' :<syntaxhighlight lang="wikitext" inline>{{#timef:|time}}</syntaxhighlight> → ''' {{#timef:|time}} ''' {{Anchor|timefl}} == #timefl == Aquesta funció és igual que [[#timef|#timef]], excepte que utilitza el fus horari local del wiki tal com està configurat a {{ll|Manual:$wgLocaltimezone|$wgLocaltimezone}}. :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>}}</nowiki></code> :<code><nowiki>{{#timefl:</nowiki> ''date/time object'' <nowiki>|</nowiki> ''format type'' <nowiki>|</nowiki> ''language code'' <nowiki>}}</nowiki></code> {{Anchor|titleparts|Titleparts}} == #titleparts == Aquesta funció separa el títol d'una pàgina en segments basats en barres inclinades i després retorna alguns d'aquests segments com a resultat. : {{tmpl|0=<code class="mw-highlight">{{((}}#titleparts: ''$1'' {{!}} ''$2'' {{!}} ''$3'' {{))}}</code> |1=nom de la pàgina |2=nombre de segments a retornar |3=segment per on començar }} Si no s'especifica el paràmetre ''nombre de segments a retornar'', per defecte es pren "0", que retorna tots els segments des del segment a començar fins al final (inclòs). Si el paràmetre ''segment per on començar'' no s'especifica o és "0", per defecte és "1": : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz/quok}} <nowiki>}}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok }}''' : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo}}/bar/baz/quok <nowiki>| 1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 1 }}''' Vegeu també <nowiki>{{</nowiki>{{ll|Help:Magic_words#Page_names|ROOTPAGENAME}}<nowiki>}}</nowiki>. : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar}}/baz/quok <nowiki>| 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| 2 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz/quok}} <nowiki>| 2 | 3 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 2 | 3 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| 3 | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | 3 | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz/quok}} <nowiki>| | 2 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 2 }}''' : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| | 5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | 5 }} ''' S'accepten valors negatius per a tots dos valors. Els valors negatius per al ''nombre de segments a retornar'' del paràmetre "eliminen" els segments del final de la cadena. Els valors negatius per al primer segment a retornar es tradueixen en "comença en aquest segment comptant des de la dreta": : <code><nowiki>{{#titleparts:</nowiki> {{highlight|{{ns:1}}:Foo/bar/baz}}/quok <nowiki>| -1 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 }}''' Elimina un segment del final de la cadena. Vegeu també {{ll|Help:Magic_words#Page_names|2=BASEPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -4 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -4 }} ''' Elimina els 4 segments del final de la cadena : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/quok <nowiki>| -5 }}</nowiki></code> → '''{{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -5 }} ''' Elimina els 5 segments del final de la cadena (més dels que existeixen) : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/baz/{{highlight|quok}} <nowiki>| | -1 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | | -1 }}''' Retorna l'últim segment. Vegeu també {{ll|Help:Magic_words#Page_names|2=SUBPAGENAME}}. : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/{{highlight|bar/baz}}/quok <nowiki>| -1 | 2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | 2 }}''' Elimina un segment des del final de la cadena i retorna el segon segment i més enllà : <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bar/{{highlight|baz}}/quok <nowiki>| -1 | -2 }}</nowiki></code> → ''' {{#titleparts: {{ns:1}}:Foo/bar/baz/quok | -1 | -2 }}''' Comença a copiar al penúltim element; elimina un segment des del final de la cadena Abans del processament, el paràmetre ''nom de la pàgina'' es descodifica en HTML: si conté algunes entitats de caràcter HTML estàndard, es convertiran en caràcters simples (codificats internament amb UTF-8, és a dir, la mateixa codificació que a la pàgina font de MediaWiki que utilitza aquesta funció d'anàlisi). : Per exemple, qualsevol aparició de <code>&amp;quot;</code>, <code>&amp;#34;</code> o <code>&amp;#x22;</code> al ''nom de la pàgina'' se substituirà per <code>"</code>. : No es realitza cap altra conversió d'HTML a text pla, de manera que les etiquetes HTML es deixen intactes en aquest pas inicial, fins i tot si no són vàlides als títols de les pàgines. {{tip| 1= Se sap que algunes paraules màgiques o funcions d'anàlisi de MediaWiki (com ara <code><nowiki>{{</nowiki>{{ll|Help:Magic words#Page names|PAGENAME}}<nowiki>}}</nowiki></code> i similars) retornen cadenes que estan codificades innecessàriament en HTML, fins i tot si el seu propi paràmetre d'entrada no estava codificat en HTML: La funció d'anàlisi titleparts es pot utilitzar com a solució alternativa per convertir aquestes cadenes retornades perquè puguin ser processades correctament per altres funcions d'anàlisi que també prenen un nom de pàgina al paràmetre (com ara <code><nowiki>{{</nowiki>{{ll|Help:Magic words#PAGESINCAT|PAGESINCAT:}}<nowiki>}}</nowiki></code>) però que encara no funcionen correctament amb cadenes d'entrada codificades en HTML. This may not be a suitable workaround for you if a pagename {{ll|Manual:$wgCapitalLinks|is allowed to start with a lowercase character}}: the titleparts parser function will always capitalize the first letter. Per exemple, si la pàgina actual és [[commons:Category:Côte-d'Or|Category:Côte-d'Or]], aleshores: * Tan <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight> com <syntaxhighlight lang="wikitext" inline>{{#ifeq: {{FULLPAGENAME}} | Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> retornen <code>1</code>; (la funció d'anàlisi #ifeq realitza la descodificació HTML dels seus paràmetres d'entrada). * Tan <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d'Or = 1 | #default = 0 }}</syntaxhighlight> com <syntaxhighlight lang="wikitext" inline>{{#switch: {{FULLPAGENAME}} | Category:Côte-d&apos;Or = 1 | #default = 0 }}</syntaxhighlight> retornen <code>1</code>; (la funció d'anàlisi #switch realitza la descodificació HTML dels seus paràmetres d'entrada). * Tan <syntaxhighlight lang="wikitext" inline>{{#ifexist: {{FULLPAGENAME}} | 1 | 0 }}</syntaxhighlight> com <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d'Or | 1 | 0 }}</syntaxhighlight>, o fins <syntaxhighlight lang="wikitext" inline>{{#ifexist: Category:Côte-d&apos;Or | 1 | 0 }}</syntaxhighlight> retornen <code>1</code> si la pàgina de la categoria existeix (la funció d'anàlisi #ifexist realitza la descodificació HTML dels seus paràmetres d'entrada); * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d'Or }}</syntaxhighlight> retornarà un nombre diferent de zero, si aquesta categoria conté pàgines o subcategories, '''però''': * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{CURRENTPAGENAME}} }}</syntaxhighlight>, encara pot retornar 0 '''incondicionalment''', igual que: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d'Or}} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{PAGENAME:Category:Côte-d&apos;Or}} }}</syntaxhighlight> La raó d'aquest comportament inesperat és que, amb les versions actuals de MediaWiki, hi ha dues advertències: * <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME}}</syntaxhighlight>, o fins i tot <syntaxhighlight lang="wikitext" inline>{{FULLPAGENAME:Côte-d'Or}}</syntaxhighlight> ''poden'' retornar la cadena codificada en HTML <code>Category:Côte-d&apos;Or</code> i no la <code>Category:Côte-d'Or</code> esperada, i que: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: Côte-d&apos;Or }}</syntaxhighlight> retorna '''incondicionalment''' 0 (la paraula clau màgica PAGESINCAT no realitza cap descodificació HTML del seu paràmetre d'entrada). La solució senzilla utilitzant titleparts (que continuarà funcionant si les dues advertències es corregeixen en una versió posterior de MediaWiki) és: * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{CURRENTPAGENAME}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d'Or}} }} }}</syntaxhighlight> * <syntaxhighlight lang="wikitext" inline>{{PAGESINCAT: {{#titleparts: {{PAGENAME:Category:Côte-d&apos;Or}} }} }}</syntaxhighlight>, que retornen el nombre real de pàgines de la mateixa categoria. }} Aleshores, el ''nom de la pàgina'' descodificat es converteix en un títol de pàgina estàndard compatible amb MediaWiki, tant com sigui possible: # Tots els subratllats es substitueixen automàticament per espais: #: <code><nowiki>{{#titleparts:</nowiki> {{ns:1}}:Foo/bah_boo|1|2{{))}}</code> → '''{{#titleparts: {{ns:1}}:Foo/bah_boo|1|2}}''' No bah_boo, tot i el subratllat de l'original. # La cadena es divideix un màxim de 25 vegades; les barres inclinades addicionals s'ignoren i el 25è element contindrà la resta de la cadena. La cadena també està limitada a 255 caràcters, ja que es tracta com a [[Special:MyLanguage/Manual:Page table#Schema summary|títol de pàgina]]: #: <code><nowiki>{{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/{{highlight|y/z/aa/bb/cc/dd/ee}} <nowiki>| 1 | 25 }}</nowiki></code> → '''{{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }}''' #: Si per qualsevol motiu haguéssiu de portar aquesta funció al límit, tot i que és molt improbable, és possible evitar el límit de divisió de 25 imbricant crides a la funció: #: <code><nowiki>{{#titleparts: {{#titleparts:</nowiki> a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/{{highlight|z}}/aa/bb/cc/dd/ee<nowiki>| 1 | 25 }} | 1 | 2}}</nowiki></code> → '''{{#titleparts: {{#titleparts: a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/aa/bb/cc/dd/ee | 1 | 25 }} | 1 | 2}}''' # Finalment, la primera subcadena s'escriu en majúscula segons la configuració de majúscules del wiki local (si aquesta subcadena també comença amb un nom d'espai de noms local, aquest nom d'espai de noms també es normalitza). #: <code><nowiki>{{#titleparts:</nowiki> {{highlight|talk:a}}/b/c <nowiki>}}</nowiki></code> → '''{{#titleparts: talk:a/b/c }}''' {{tip| 1= Podeu utilitzar #titleparts com un petit "analitzador i convertidor de cadenes", però tingueu en compte que retorna la primera subcadena en majúscula: : <code><nowiki>{{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|1 }}''' : <code><nowiki>{{#titleparts:</nowiki> one/{{highlight|two}}/three/four<nowiki>|1|2 }}</nowiki></code> → '''{{#titleparts: one/two/three/four|1|2 }}''' Si calen minúscules, utilitzeu la funció lc: per controlar el resultat: : <code><nowiki>{{lc: {{#titleparts:</nowiki> {{highlight|one}}/two/three/four<nowiki>|1|1 }} }}</nowiki></code> → '''{{lc: {{#titleparts:one/two/three/four|1|1 }}}}''' Podeu anteposar una barra inclinada "fictícia" al principi de la cadena per obtenir la majúscula correcta de la primera subcadena (majúscules o minúscules). Feu servir <code>2</code> en comptes d'<code>1</code> per al ''primer segment a retornar'': : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|one}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /one/two/three/four|1|2 }}''' : <code><nowiki>{{#titleparts:</nowiki> '''/'''{{highlight|One}}/two/three/four<nowiki>|1|</nowiki>'''<u>2</u>'''<nowiki> }}</nowiki></code> → '''{{#titleparts: /One/two/three/four|1|2 }}''' }} {{Warning|1= Alguns caràcters que {{ll|Manual:Page title#Naming restrictions|no són vàlids en un títol de pàgina}} faran que #titleparts no analitzi la cadena: : <syntaxhighlight lang="wikitext" inline>{{#titleparts: {one/two} | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: {one/two} | 1 | 1 }}'''. No produeix l'esperat: '''{one''' : <syntaxhighlight lang="wikitext" inline>{{#titleparts: [[page]]/123 | 1 | 2 }}</syntaxhighlight> → '''{{#titleparts: [[page]]/123 | 1 | 2 }}'''. No funciona perquè els claudàtors no són vàlids en els títols de pàgina i aquesta funció d'anàlisi no processa els enllaços incrustats al seu paràmetre d'entrada ''nom de la pàgina'', fins i tot quan utilitzen la sintaxi de MediaWiki o qualsevol altra etiqueta HTML o MediaWiki. : <syntaxhighlight lang="wikitext" inline>{{#titleparts: red/#00FF00/blue | 1 | 3 }}</syntaxhighlight> → "{{#titleparts: red/#00FF00/blue| 1 | 3 }}". No funciona perquè "#" també és il·legal en els títols de pàgina. }} {{Warning|1= Si alguna part del títol és només "<code>.</code>" o "<code>..</code>", #titleparts no analitzarà la cadena: : <syntaxhighlight lang="wikitext" inline>{{#titleparts: one/./three | 1 | 1 }}</syntaxhighlight> → '''{{#titleparts: one/./three | 1 | 1 }}'''. Es retorna la cadena sencera. No retorna l'esperat: '''one''' }} {{Warning|1= Aquesta funció no funciona correctament si l'entrada supera els 255 bytes en UTF-8. Si la cadena d'entrada és de 256 bytes o més, es retorna la cadena sencera. }} <span id="String_functions"></span> == Funcions amb cadenes == {{Main|Extension:ParserFunctions/String functions}} L'extensió ParserFunctions defineix opcionalment diverses funcions amb cadenes si <code>$wgPFEnableStringFunctions</code> està definit com a {{phpi|true}}: * <code>#len</code> * <code>#pos</code> * <code>#rpos</code> * <code>#sub</code> * <code>#count</code> * <code>#replace</code> * <code>#explode</code> * <code>#urldecode</code> Vegeu la subpàgina dedicada de documentació i {{ll|Manual:Performing string operations with parser functions}} per a exemples. {{Warning |1=El 2013, es va decidir que '''aquestes funcions no s'habilitarien ''mai'' en cap wiki de Wikimedia''', perquè són ineficients quan s'utilitzen a gran escala (vegeu [[phab:T8455]] per a una mica d'història). '''Aquestes funcions NO funcionen en wikis de Wikimedia!'''<br/><br/>Si sou aquí per escriure alguna cosa en un projecte Wikimedia, esteu buscant una altra cosa: si el vostre wiki principal té funcions de cadena, probablement utilitza {{ll|Extension:Scribunto|Lua}}. Per exemple, la Viquipèdia en català utilitza [[:ca:Mòdul:String|Mòdul:String]], que fa algunes de les mateixes coses amb una sintaxi molt diferent. També hi ha [[:ca:Plantilla:Vegeu també plantilles de cadena de text|plantilles individuals per a la gestió de cadenes]]. }} Aquí teniu una breu descripció general de les funcions del [[Module:String]]: * [[w:Module:String#len|&#35;len]] (longitud de la cadena): <code><nowiki>{{</nowiki>[[:w:Wikipedia:Lua|#invoke]]<nowiki>:String|len|target_string}}</nowiki></code> * [[w:Module:String#sub|&#35;sub]] (subcadena): <code><nowiki>{{#invoke:String|sub|target_string|start_index|end_index}}</nowiki></code> * [[w:Module:String#match|&#35;match]]: <code><nowiki>{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}</nowiki></code> * [[w:Module:String#pos|&#35;pos]] (posició de la cadena a buscar): <code><nowiki>{{#invoke:String|pos|target_string|index_value}}</nowiki></code> * [[w:Module:String#find|&#35;find]]: <code><nowiki>{{#invoke:String|find|source_string|target_string|start_index|plain_flag}}</nowiki></code> * [[w:Module:String#replace (gsub)|&#35;replace]]: <code><nowiki>{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}</nowiki></code> * [[w:Module:String#rep|&#35;rep]] (repeteix): <code><nowiki>{{#invoke:String|rep|source|count}}</nowiki></code> * [[w:Module:String#escapePattern|&#35;escapePattern]]: <code><nowiki>{{#invoke:String|escapePattern|pattern_string}}</nowiki></code> * [[w:Module:String#count|&#35;count]]: <code><nowiki>{{#invoke:String|count|source_str|pattern_string|plain_flag}}</nowiki></code> * [[w:Module:String#join|&#35;join]]: <code><nowiki>{{#invoke:String|join|separator|string1|string2|...}}</nowiki></code> <span id="General_points"></span> == Principis generals == <span id="Substitution"></span> === Substitució === Les funcions d'anàlisi es poden [[Special:MyLanguage/Help:Substitution|substituir]] prefixant el caràcter coixinet amb <code>'''subst:'''</code>: :<code><nowiki>{{subst:#ifexist:</nowiki> {{FULLPAGENAME}} <nowiki>| [[</nowiki>{{FULLPAGENAME}}<nowiki>]] | </nowiki>{{FULLPAGENAME}}<nowiki> }}</nowiki></code> → el codi '''<code><nowiki>[[</nowiki>{{FULLPAGENAME}}<nowiki>]]</nowiki></code>''' s'inserirà al wikitext, ja que la pàgina {{FULLPAGENAME}} existeix. {{Warning|1= Els resultats de les funcions d'anàlisi substituïdes no estan definides si les expressions contenen ''un'' codi volàtil no substituït, com ara {{ll|Help:Magic words#Variables|variables}} o altres funcions d'anàlisi. Per obtenir resultats consistents, s'ha de substituir tot el codi volàtil de l'expressió que s'ha d'avaluar. Vegeu [[:ca:Ajuda:Substitució|Ajuda:Substitució]].}} La substitució no funciona dins de {{ll|Extension:Cite#Substitution and embedded parser functions|{{tag|ref|open}}&hellip;{{tag|ref|close}} }}; podeu utilitzar <code>{{((}}subst:#tag:ref{{!}}</code>&hellip;<code>{{))}}</code> per a aquest propòsit. <span id="Redirects"></span> === Redireccions === Especialment, [[#.23time|<nowiki>{{</nowiki><code>#time:</code>&hellip;&vert;<code>now-</code>&hellip;<nowiki>}}</nowiki>]] podria ser útil en {{ll|Help:Redirects|redireccions}} a pàgines que inclouen dates, però això no funciona. <span id="Escaping_pipe_characters"></span> === Escapament dels caràcters de barra vertical === <span id="In_tables"></span> ==== En taules ==== Les funcions de l'anàlisi modificaran la sintaxi de les {{ll|Help:Tables|taules wiki}} i els caràcters de barra vertical (<code><nowiki>|</nowiki></code>), tractant tots els caràcters de barra vertical en brut com a divisors de paràmetres. Per evitar-ho, la majoria de wikis utilitzaven una plantilla [[{{ns:10}}:!]] amb el seu contingut només un caràcter de barra vertical en brut (<code><nowiki>|</nowiki></code>), ja que a MW 1.24 una {{ll|Help:Magic words#Other|<code><nowiki>{{!}}</nowiki></code> paraula màgica}} va substituir aquest inconvenient. Això "amaga" la barra vertical de l'anàlisi de MediaWiki, garantint que no es consideri fins que s'hagin expandit totes les plantilles i variables d'una pàgina. Aleshores s'interpretarà com un separador de files o columnes de la taula. Alternativament, es pot utilitzar la sintaxi de taula HTML en brut, tot i que això és menys intuïtiu i més propens a errors. També podeu escapar del caràcter de barra vertical &vert; per mostrar-lo com un caràcter pla i no interpretat mitjançant una entitat HTML: <code>&amp;#124;</code> o <code>&amp;vert;</code> . {| class="wikitable" ! Descripció ! Escriviu ! Obteniu |- | Caràcter de barra vertical d'escapament com a separador de files/columnes de la taula | <pre> {{!}} </pre> | style="text-align:center;" | &#124; |- | Escapament del caràcter de barra vertical com a caràcter pla | <pre> &amp;#124; </pre> | style="text-align:center;" | &#124; |} <span id="In_template_calls"></span> ==== En crides de plantilla ==== S'aplica la mateixa protecció de la barra vertical que en l'exemple següent: <syntaxhighlight lang="wikitext"> {{Documentation |content= ... text before ...<code>subpage-name=sandbox3</code> is equivalent to <code>sandbox link=../sandbox3 | sandbox name=sandbox3</code>. ... text after ... }} </syntaxhighlight> Observem que el ''text after'' no es mostra quan la barra | de just abans de ''sandbox name='' és present, ja que ''|sandbox name='' es considera erròniament un paràmetre de la ''Documentation'' de la plantilla al mateix nivell que ''|content=''. <span id="Stripping_whitespace"></span> === Eliminació d'espais en blanc === Els espais en blanc, incloent-hi els salts de línia, les tabulacions i els espais, s'eliminen des del principi i des del final de tots els paràmetres d'aquestes funcions d'anàlisi. Si això no és desitjable, es pot comparar les cadenes després de posar-les entre cometes. :<code><nowiki>{{#ifeq: foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo | equal | not equal }}</nowiki></code> → '''{{#ifeq: foo | foo | equal | not equal }}''' :<code><nowiki>{{#ifeq: "foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" | "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo" | equal | not equal }}</nowiki></code> → '''{{#ifeq: "foo " | " foo" | equal | not equal }}''' Per evitar que es retallin les parts ''then'' (si) i ''else'' (altrament), vegeu [[m:Template:If]]. Algunes persones ho aconsegueixen utilitzant <nowiki>&lt;</nowiki>{{ll|Wiki markup#Nowiki|nowiki}}<nowiki>&gt;</nowiki> <nowiki>&lt;</nowiki>/nowiki<nowiki>&gt;</nowiki> en lloc d'espais. :<syntaxhighlight lang="wikitext" inline>foo{{#if:|| bar }}foo</syntaxhighlight> → '''foo{{#if:|| bar }}foo''' :<syntaxhighlight lang="xml" inline>foo{{#if:||<nowiki /> bar <nowiki />}}foo</syntaxhighlight> → '''foo{{#if:||<nowiki /> bar <nowiki />}}foo''' Tanmateix, aquest mètode es pot utilitzar per representar només un '''únic''' caràcter d'espai en blanc, ja que l'analitzador comprimeix diversos caràcters d'espai en blanc en una sola fila. :{| |<syntaxhighlight lang="html"><span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span></syntaxhighlight>|| → ||'''<span style="white-space: pre;">foo{{#if:||<nowiki/> bar <nowiki/>}}foo</span>''' |} En aquest exemple, l'estil <code>white-space: pre</code> s'utilitza per forçar que el navegador conservi els espais en blanc, però fins i tot amb això els espais no es mostren. Això passa perquè el programari elimina els espais abans de ser enviats al navegador. És possible solucionar aquest comportament substituint els espais en blanc per <code>&amp;#32;</code> (''espai separable'') o <code>&amp;nbsp;</code> (''espai no separable''), ja que el programari no els modifica: :<syntaxhighlight lang="html" inline><span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span></syntaxhighlight> → '''<span style="white-space: pre;">foo{{#if:||&#32;&#32;&#32;bar&#32;&#32;&#32;}}foo</span>''' :<syntaxhighlight lang="html" inline>foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo</syntaxhighlight> → '''foo{{#if:||&nbsp;&nbsp;&nbsp;bar&nbsp;&nbsp;&nbsp;}}foo''' Atenció, no tots els paràmetres són iguals. A ParserFunctions, els espais en blanc al principi i al final sempre s'eliminen. A les {{ll|Help:Templates|plantilles}}, els espais en blanc al principi i al final s'eliminen per als paràmetres amb nom i per als paràmetres sense nom amb número, però ''no'' per als paràmetres sense nom: :<code>foo{{tlx|1x|content{{=}} bar }}foo</code> → '''foo{{1x|content= bar }}foo''' :<code>foo{{tlx|1x|1{{=}} bar }}foo</code> → '''foo{{1x|1= bar }}foo''' :<code>foo{{tlx|1x|&nbsp;bar&nbsp;}}foo</code> → '''foo{{1x| bar }}foo''' <span id="Other_parser_functions"></span> == Altres funcions d'anàlisi == <span id="Case_conversion_functions"></span> === Funcions de conversió de majúscules i minúscules === * '''Minúscules:''' {{xpdoc|lc: AbC|}} * '''Majúscules:''' {{xpdoc|uc: AbC|}} * '''Primer caràcter en minúscula:''' {{xpdoc|lcfirst: AbC}} * '''Primer caràcter en majúscula:''' {{xpdoc|ucfirst: abc}} <span id="Encoding_functions"></span> === Funcions de codificació === * '''Codificació d'URL:''' <syntaxhighlight lang="wikitext"> "{{urlencode: AbC dEf ghi}}" </syntaxhighlight> es mostra com: ---- "{{urlencode: AbC dEf ghi}}" ---- Així, les noves línies interiors es converteixen en %0A i els espais interiors es converteixen en +. <span id="Anchor_encoding"></span> === Codificació de les àncores === <syntaxhighlight lang="wikitext"> {{anchorencode: AbC dEf ghi}} </syntaxhighlight> es mostra com ---- {{anchorencode: AbC dEf ghi}} ---- <span id="See_also"></span> == Vegeu també == * {{ll|Help:Parser functions in templates}} * {{ll|Parser extension tags}} * {{ll|Parser function hooks}} – una llista (incompleta) de funcions d'anàlisi afegides pel nucli i les extensions. * {{ll|Manual:Newlines and spaces}} * {{ll|Manual:Converting between ParserFunctions syntax and TeX syntax}} * {{ll|Help:Magic words}} – en particular per a formatació de nombres i farciment * {{ll|Manual:Template limits#Expensive parser function calls}} * [[Module:String]] deixant obsoleta {{ll|Extension:StringFunctions}} * Funcions d'anàlisi per a Wikibase (les extensions que permeten Wikidata): [[d:Special:MyLanguage/Wikidata:How to use data on Wikimedia projects#Parser function|Com utilitzar dades en Wikimedia projects#Parser function]] <span id="References"></span> == Referències == <references /> {{Parser functions nav}} [[Category:Extension help{{#translation:}}|ParserFunctions]] [[Category:Magic words{{#translation:}}]] fkqzjvbs7aerhb2btxd73jpwhcbgdx5 Extension:Produnto 102 2352530 8364375 8345346 2026-05-03T13:28:39Z KockaAdmiralac 8507444 Update 8364375 wikitext text/x-wiki <languages/> {{Extension |name = Produnto |status = experimental |type1 = parser |type2 = mywiki |newhook1 = <!-- hooks added by the extension, see [[Template:Extension]] for details --> |newhook2 = |username = Tim Starling |description = Package manager for Scribunto modules and gadgets. |image = |imagesize = |update = |version preview = |update preview = |compatibility policy = |php = |needs-updatephp = yes |composer = |download = {{AutoDownload}} |table1 = produnto_active_deployment |table2 = produnto_deployment |table3 = produnto_deployment_data |table4 = produnto_package_deployment |table5 = produnto_package_version |table6 = produnto_package |table7 = produnto_file |table8 = produnto_file_name |table9 = produnto_file_text |readme = |changelog = |example = |namespace = |tags = |compatibility = |phabricator = Produnto |vagrant-role = }} The '''Produnto''' extension is a package manager for {{ll|Extension:Scribunto|Scribunto}} and {{ll|Extension:Gadgets|Gadgets}} extensions. It allows defining Lua modules whose code is stored in an external code repository (e.g. Git repository) that can be imported from other modules on the wiki. This allows for easier code sharing across multiple wikis of a wiki farm. This extension is currently under heavy development and not all described features may be working as intended. It's a part of the [[MediaWiki Product Insights/Artifacts/Cross-Wiki Code Collaboration|cross-wiki code collaboration experiment]], which had a session on [[Wikimedia Hackathon 2026]] described in {{phab|T424197}}. See {{phab|T421436}} for the deployment tracking task. == Installation == {{ExtensionInstall |custom-steps0 = * Install the [https://www.php.net/manual/en/book.zip.php zip extension for PHP.] |registration = yes |db-update = yes }} == Configuration == {| class="wikitable" |+ Produnto configuration settings ! Parameter ! Default ! Comment |- | <code>$wgProduntoServers</code> | <code>[]</code> | An array of [[#Server|server configuration objects]] describing upstream package sources. |- | <code>$wgProduntoPackagesTitle</code> | <syntaxhighlight lang="php" inline>null</syntaxhighlight> | The title to use for the [[#Package deployment|deployed package list]], or <code>null</code> for <code>MediaWiki:Packages.json</code>. |} === Server === Server configuration consists of objects with a required <syntaxhighlight lang="php" inline>'type'</syntaxhighlight> property, and the rest depending on the selected server type. The following server types are currently supported: * <code>[[#GitLab|gitlab]]</code> ==== GitLab ==== To have GitLab properly update packages in Produnto's tables, a [https://docs.gitlab.com/user/project/integrations/webhooks/ webhook] to <code>{$wgRestPath}/produnto/v1/gitlab/tag</code> must be set up on the repository. {| class="wikitable" |+ GitLab server configuration properties ! Property ! Default ! Comment |- | <syntaxhighlight lang="php" inline>'url'</syntaxhighlight> | - | '''Required.''' The base URL of the GitLab installation. |- | <syntaxhighlight lang="php" inline>'projectPrefixes'</syntaxhighlight> | - | An array of strings specifying allowable project path prefixes. |- | <syntaxhighlight lang="php" inline>'proxy'</syntaxhighlight> | <syntaxhighlight lang="php" inline>null</syntaxhighlight> | The HTTP proxy to use to contact GitLab. |- | <syntaxhighlight lang="php" inline>'maxFileSize'</syntaxhighlight> | <syntaxhighlight lang="php" inline>10 * 1024 * 1024</syntaxhighlight> (10 MiB) | The maximum size of each file in a package in bytes. |} For example, this configuration allows any repository under <code>[[gitlab:repos/lua|repos/lua]]</code> on Wikimedia's GitLab to be used for Produnto packages: <syntaxhighlight lang="php" copy> $wgProduntoServers = [ [ 'type' => 'gitlab', 'url' => 'https://gitlab.wikimedia.org', 'projectPrefixes' => [ 'repos/lua' ], ], ]; </syntaxhighlight> == Usage == === Definition === Each Produnto package repository has to contain a <code>produnto.json</code> file in its root, which acts as a manifest for the package, akin to <code>[[extension.json]]</code>. {| class="wikitable" |+ <code>produnto.json</code> properties ! Property ! Type ! Description |- | <code>type</code> | <syntaxhighlight lang="json" inline>"scribunto"</syntaxhighlight> | The type of the package. |- | <code>name</code> | Language code to name map | Localized package name. |- | <code>description</code> | Language code to description map | A short localized description of the package. |- | <code>author</code> | String, or array of strings | The package's authors. |- | <code>license</code> | String | SPDX identifier for the license under which the package is released. |- | <code>url</code> | String | Optional homepage for the package. Use <code>collab-url</code> and <code>doc-url</code> if there is no separate homepage. |- | <code>collab-url</code> | String | Optional human-readable entry point for source code contributions, such as a GitLab project page. |- | <code>doc-url</code> | String | URL to the package's documentation page. |- | <code>issue-url</code> | String | URL to the package's issue tracker. |- | <code>requires</code> | Package name to required version map | Versions of other Produnto packages that this package requires. Special keys <code>MediaWiki</code> and <code>Lua</code> can be used to define required versions of MediaWiki and Lua. |- | <code>modules</code> | Lua module name to file name map | Global Lua module name map to the defining file path, relative to the package root. |} For example, a package manifest could look like: <syntaxhighlight lang="json" copy> { "type": "scribunto", "name": { "en": "yesno" }, "description": { "en": "This module provides a consistent interface for processing boolean or boolean-style string input." }, "author": [ "ATDT", "Mr. Stradivarius" ], "license": "CC-BY-SA-3.0", "collab-url": "https://gitlab.wikimedia.org/lua-modules/yesno", "doc-url": "https://www.mediawiki.org/wiki/Yesno", "issue-url": "https://phabricator.wikimedia.org/project/view/1111/", "requires": { "MediaWiki": ">= 1.28", "dep1": "1.2.3" }, "modules": { "yesno": "src/yesno.lua" } } </syntaxhighlight> A JSON schema of available properties is available at {{git file|project=mediawiki/extensions/Produnto|file=docs/package.schema.json}}. === Deployment === To deploy a package to an individual wiki, an interface admin has to edit the page defined by <code>$wgProduntoPackagesTitle</code>, or <code>MediaWiki:Packages.json</code> by default. The page consists of a JSON object mapping Produnto package names to versions. For GitLab, the package name is the part of the Git repository URL after the project name, and the package version is the relevant Git tag name, starting with a number with an optional <code>v</code> prefix. Fetching the packages from the external repository is '''not''' triggered by an edit to this page, but only by a repository webhook. A package deployment dashboard is planned ({{phab|T412317}}). === Importing === Each Produnto package can register multiple Scribunto modules. After the Produnto package is deployed, the registered Scribunto modules can be imported using <syntaxhighlight lang="lua" inline>require("module name")</syntaxhighlight>. Similarly, registered JSON files can be imported using <code>mw.loadJsonData</code>. ({{phab|T412181}}) === Sandbox === To preview work-in-progress changes to modules, the extension provides REST endpoints that can be called from an IDE plugin to override particular package files for the current user. There is a [[gitlab:repos/content-transform/produnto-sandbox|Node.js script]] available for pushing the locally changed package code to a wiki sandbox, and the plan is to provide a VS Code extension for this. ({{phab|T415631}}) auqsa29bu9c5k0z4kduhip28ts1ru6c 8364380 8364375 2026-05-03T13:38:50Z KockaAdmiralac 8507444 Link the test wiki and expand on sandboxes 8364380 wikitext text/x-wiki <languages/> {{Extension |name = Produnto |status = experimental |type1 = parser |type2 = mywiki |newhook1 = <!-- hooks added by the extension, see [[Template:Extension]] for details --> |newhook2 = |username = Tim Starling |description = Package manager for Scribunto modules and gadgets. |image = |imagesize = |update = |version preview = |update preview = |compatibility policy = |php = |needs-updatephp = yes |composer = |download = {{AutoDownload}} |table1 = produnto_active_deployment |table2 = produnto_deployment |table3 = produnto_deployment_data |table4 = produnto_package_deployment |table5 = produnto_package_version |table6 = produnto_package |table7 = produnto_file |table8 = produnto_file_name |table9 = produnto_file_text |readme = |changelog = |example = [https://produnto-test.toolforge.org/ Produnto test wiki[ |namespace = |tags = |compatibility = |phabricator = Produnto |vagrant-role = }} The '''Produnto''' extension is a package manager for {{ll|Extension:Scribunto|Scribunto}} and {{ll|Extension:Gadgets|Gadgets}} extensions. It allows defining Lua modules whose code is stored in an external code repository (e.g. Git repository) that can be imported from other modules on the wiki. This allows for easier code sharing across multiple wikis of a wiki farm. This extension is currently under heavy development and not all described features may be working as intended. It's a part of the [[MediaWiki Product Insights/Artifacts/Cross-Wiki Code Collaboration|cross-wiki code collaboration experiment]], which had a session on [[Wikimedia Hackathon 2026]] described in {{phab|T424197}}. A Produnto test wiki is available [https://produnto-test.toolforge.org/ on Toolforge], and {{phab|T421436}} is the deployment tracking task. == Installation == {{ExtensionInstall |custom-steps0 = * Install the [https://www.php.net/manual/en/book.zip.php zip extension for PHP.] |registration = yes |db-update = yes }} == Configuration == {| class="wikitable" |+ Produnto configuration settings ! Parameter ! Default ! Comment |- | <code>$wgProduntoServers</code> | <code>[]</code> | An array of [[#Server|server configuration objects]] describing upstream package sources. |- | <code>$wgProduntoPackagesTitle</code> | <syntaxhighlight lang="php" inline>null</syntaxhighlight> | The title to use for the [[#Package deployment|deployed package list]], or <code>null</code> for <code>MediaWiki:Packages.json</code>. |} === Server === Server configuration consists of objects with a required <syntaxhighlight lang="php" inline>'type'</syntaxhighlight> property, and the rest depending on the selected server type. The following server types are currently supported: * <code>[[#GitLab|gitlab]]</code> ==== GitLab ==== To have GitLab properly update packages in Produnto's tables, a [https://docs.gitlab.com/user/project/integrations/webhooks/ webhook] to <code>{$wgRestPath}/produnto/v1/gitlab/tag</code> must be set up on the repository. {| class="wikitable" |+ GitLab server configuration properties ! Property ! Default ! Comment |- | <syntaxhighlight lang="php" inline>'url'</syntaxhighlight> | - | '''Required.''' The base URL of the GitLab installation. |- | <syntaxhighlight lang="php" inline>'projectPrefixes'</syntaxhighlight> | - | An array of strings specifying allowable project path prefixes. |- | <syntaxhighlight lang="php" inline>'proxy'</syntaxhighlight> | <syntaxhighlight lang="php" inline>null</syntaxhighlight> | The HTTP proxy to use to contact GitLab. |- | <syntaxhighlight lang="php" inline>'maxFileSize'</syntaxhighlight> | <syntaxhighlight lang="php" inline>10 * 1024 * 1024</syntaxhighlight> (10 MiB) | The maximum size of each file in a package in bytes. |} For example, this configuration allows any repository under <code>[[gitlab:repos/lua|repos/lua]]</code> on Wikimedia's GitLab to be used for Produnto packages: <syntaxhighlight lang="php" copy> $wgProduntoServers = [ [ 'type' => 'gitlab', 'url' => 'https://gitlab.wikimedia.org', 'projectPrefixes' => [ 'repos/lua' ], ], ]; </syntaxhighlight> == Usage == === Definition === Each Produnto package repository has to contain a <code>produnto.json</code> file in its root, which acts as a manifest for the package, akin to <code>[[extension.json]]</code>. {| class="wikitable" |+ <code>produnto.json</code> properties ! Property ! Type ! Description |- | <code>type</code> | <syntaxhighlight lang="json" inline>"scribunto"</syntaxhighlight> | The type of the package. |- | <code>name</code> | Language code to name map | Localized package name. |- | <code>description</code> | Language code to description map | A short localized description of the package. |- | <code>author</code> | String, or array of strings | The package's authors. |- | <code>license</code> | String | SPDX identifier for the license under which the package is released. |- | <code>url</code> | String | Optional homepage for the package. Use <code>collab-url</code> and <code>doc-url</code> if there is no separate homepage. |- | <code>collab-url</code> | String | Optional human-readable entry point for source code contributions, such as a GitLab project page. |- | <code>doc-url</code> | String | URL to the package's documentation page. |- | <code>issue-url</code> | String | URL to the package's issue tracker. |- | <code>requires</code> | Package name to required version map | Versions of other Produnto packages that this package requires. Special keys <code>MediaWiki</code> and <code>Lua</code> can be used to define required versions of MediaWiki and Lua. |- | <code>modules</code> | Lua module name to file name map | Global Lua module name map to the defining file path, relative to the package root. |} For example, a package manifest could look like: <syntaxhighlight lang="json" copy> { "type": "scribunto", "name": { "en": "yesno" }, "description": { "en": "This module provides a consistent interface for processing boolean or boolean-style string input." }, "author": [ "ATDT", "Mr. Stradivarius" ], "license": "CC-BY-SA-3.0", "collab-url": "https://gitlab.wikimedia.org/lua-modules/yesno", "doc-url": "https://www.mediawiki.org/wiki/Yesno", "issue-url": "https://phabricator.wikimedia.org/project/view/1111/", "requires": { "MediaWiki": ">= 1.28", "dep1": "1.2.3" }, "modules": { "yesno": "src/yesno.lua" } } </syntaxhighlight> A JSON schema of available properties is available at {{git file|project=mediawiki/extensions/Produnto|file=docs/package.schema.json}}. === Deployment === To deploy a package to an individual wiki, an interface admin has to edit the page defined by <code>$wgProduntoPackagesTitle</code>, or <code>MediaWiki:Packages.json</code> by default. The page consists of a JSON object mapping Produnto package names to versions. For GitLab, the package name is the part of the Git repository URL after the project name, and the package version is the relevant Git tag name, starting with a number with an optional <code>v</code> prefix. Fetching the packages from the external repository is '''not''' triggered by an edit to this page, but only by a repository webhook. A package deployment dashboard is planned ({{phab|T412317}}). === Importing === Each Produnto package can register multiple Scribunto modules. After the Produnto package is deployed, the registered Scribunto modules can be imported using <syntaxhighlight lang="lua" inline>require("module name")</syntaxhighlight>. Similarly, registered JSON files can be imported using <code>mw.loadJsonData</code>. ({{phab|T412181}}) === Sandbox === To preview work-in-progress changes to modules, the extension provides REST endpoints that can be called from an IDE plugin to override particular package files for the current user. There is a [[gitlab:repos/content-transform/produnto-sandbox|Node.js script]] available for pushing the locally changed package code to a wiki sandbox, and the plan is to provide a VS Code extension for this. ({{phab|T415631}}) After running the script, sandboxes can be activated from Special:ProduntoSandbox, and page previews will then use the sandbox version of the module rather than the deployed version (regular page views remain unaffected). a3656u8219bg2bkdvt8cxyhqgomwc9t Translations:Extension:CodeMirror/164/cs 1198 2353127 8364620 8180435 2026-05-03T17:12:07Z Rebulka 17532855 8364620 wikitext text/x-wiki Pro každou funkci použijte $1 nebo $2 k jejímu úplnému povolení nebo zákazu, případně zadejte pole obsahující ID jmenných prostorů (celá čísla) označující, kde by měla být funkce ve výchozím nastavení povolena. anc2kb9q27i6y1aozcvdc52sd3qfrnb Translations:Extension:CodeMirror/47/cs 1198 2353170 8364630 8333731 2026-05-03T17:15:25Z Rebulka 17532855 8364630 wikitext text/x-wiki Moduly ResourceLoader se změnily. Viz [[$2|průvodce migrací]]. src81mz1c8vto45t9c1bdr0o7s6y47t Translations:Extension:CodeMirror/218/cs 1198 2353188 8364638 8180565 2026-05-03T17:16:29Z Rebulka 17532855 8364638 wikitext text/x-wiki Starý modul (MW 1,45) 7ddt0r3j5a3hzfqvpot3nwd0n7h0yph Translations:Extension:CodeMirror/70/cs 1198 2353201 8364640 8180591 2026-05-03T17:16:56Z Rebulka 17532855 8364640 wikitext text/x-wiki S vydáním MediaWiki 1.46 budou staré moduly nahrazeny novými a moduly $1 budou zcela odstraněny. b40zjznvda01zreajnru3m690hmwq40 Translations:Extension:CodeMirror/220/cs 1198 2353237 8364642 8180662 2026-05-03T17:17:37Z Rebulka 17532855 8364642 wikitext text/x-wiki Aby to od verze MediaWiki 1.45+ fungovalo, budete muset odpovídajícím způsobem upravit $1 a také $2 a $3 za všechna příslušná rozšíření, která jste také nainstalovali: jgpd0mrcrxyx0u7dae3t4aqhc9y2qsa Translations:Extension:CodeMirror/232/cs 1198 2353463 8364612 8181415 2026-05-03T17:09:48Z Rebulka 17532855 Marked translation unit as no longer outdated with no changes 8181415 wikitext text/x-wiki Ve výchozím nastavení povoluje používání CodeMirror, ale stále umožňuje uživatelům jej zakázat. t7m6xzh63hprpray34ta0qd2gg80qux Translations:Extension:CodeMirror/233/cs 1198 2353464 8364624 8181417 2026-05-03T17:14:29Z Rebulka 17532855 8364624 wikitext text/x-wiki Omezení automatického doplňování na šablony a kód bicnzsqri01evpeyzvc4ovikne4zjd7 Translations:Growth/Communities/How to configure the mentors' list/112/cs 1198 2354711 8364416 8184968 2026-05-03T15:26:24Z Rebulka 17532855 8364416 wikitext text/x-wiki Uvítací šablony nejsou povinné, ale doporučené: Někteří nově příchozí se nedívají na svou domovskou stránku, zatímco jiní se nedívají na svou diskusní stránku. 5jxpnoe27m5o84nn663pmiztumn7uob Translations:Growth/Communities/How to configure the mentors' list/113/cs 1198 2354713 8364420 8184973 2026-05-03T15:26:43Z Rebulka 17532855 8364420 wikitext text/x-wiki Je na každé komunitě, aby se rozhodla, zda má být jméno mentora [[$1|nahrazeno]]. 7ypvd35ozac1dcokq52xcou6trt5cvt Help:Extension:WikiEditor/Realtime Preview/cs 12 2357270 8364438 8358768 2026-05-03T15:30:24Z Rebulka 17532855 8364438 wikitext text/x-wiki <languages/> {{distinguish|Manual:Live preview}} '''Náhled v reálném čase''' je funkce v [[Special:MyLanguage/Extension:WikiEditor|WikiEditoru]], která vám umožňuje zobrazit náhled změn v reálném čase během psaní. Byl vytvořen týmem komunitních technologií Wikimedia Foundation v reakci na [[m:Special:MyLanguage/Community Wishlist Survey 2021/Real Time Preview for Wikitext|#4 přání]] v průzkumu komunitních seznamů přání z roku 2021. <span id="Usage"></span> == Použití == Nejprve se ujistěte, že máte povolený [[Special:MyLanguage/Extension:WikiEditor|WikiEditor]] (což je ve výchozím nastavení povoleno). V poli [[Special:Preferences#mw-prefsection-editing|{{int|preferences}}]] vyhledejte preference "{{int|wikieditor-toolbar-preference}}" a "{{int|tog-uselivepreview}}". Upozorňujeme, že náhled v reálném čase není k dispozici ve verzi {{ll|2017 wikitext editor}}. Začněte upravovat stránku. Všimněte si, že v panelu nástrojů uvidíte tlačítko <code>{{int|wikieditor-realtimepreview-preview}}</code>. Kliknutím na toto tlačítko aktivujete náhled v reálném čase. Po aktivaci se vedle oblasti pro úpravy wikitextu zobrazí podokno náhledu. Aktualizuje se pokaždé, když přestanete psát. V panelu nástrojů je také k dispozici tlačítko <code>[[File:OOjs UI icon reload.svg|18px]] {{int|wikieditor-realtimepreview-reload}}</code> (vedle tlačítka <code>{{int|wikieditor-realtimepreview-preview}}</code>), které lze použít k ručnímu opětovnému načtení změn. Pro tento účel lze také použít {{ll|Manual:Access keys|přístupový klíč}} <code>{{int|accesskey-wikieditor-realtimepreview}}</code>. Ruční opětovné načtení může být užitečné například po provedení změn na samostatných kartách prohlížeče, abyste viděli změny použité na aktuální stránce. Tlačítko <code>{{int|wikieditor-realtimepreview-reload}}</code> se dříve zobrazovalo pouze při najetí myší na panel náhledu a některá dokumentace se na něj může stále odkazovat. Velikost panelů pro úpravy a náhled lze změnit přetažením prostředního dělicího pruhu doleva nebo doprava. Výšku obou lze také upravit přetažením spodního okraje pro změnu velikosti. Vaše předvolby velikosti jsou uloženy ve vašem prohlížeči a budou zachovány pro budoucí úpravy (jedná se o předvolbu pro každé zařízení, protože velikosti obrazovek se mohou mezi zařízeními lišit). <span id="Limitations"></span> == Omezení == * Absolutně umístěné prvky se zobrazují vzhledem k celé stránce, nikoli pouze v náhledovém panelu. Pokud potřebujete otestovat, jak vaše změny vypadají pro celou stránku, použijte tlačítko pro celou stránku <code>{{int|showpreview}}</code>. ([[phab:T310064]]) * Při použití náhledu v reálném čase i náhledu celé stránky se některé interakce uživatele vyžadující JavaScript mohou vztahovat pouze na jednu oblast náhledu a nikoli na druhou, například odkazy "show" (zobrazit) a "hide" (skrýt) u sbalitelného obsahu. ([[phab:T307475]]) * Pokud je okno vašeho prohlížeče příliš úzké, náhled v reálném čase se automaticky vypne a k zobrazení náhledu změn budete muset použít tlačítko pro zobrazení celé stránky <code>{{int|showpreview}}</code>. <span id="Hiding_the_button"></span> == Skrytí tlačítka == Pokud nechcete, aby se tlačítko <code>{{int|wikieditor-realtimepreview-preview}}</code> zobrazovalo v panelu nástrojů, můžete ho skrýt přidáním následujícího odkazu na tlačítko [[Special:MyPage/common.css|common.css]]: <syntaxhighlight lang=css> .tool[rel="realtimepreview"] { display: none; } </syntaxhighlight> s5pf72dmy967n655iby5qc0zlbesxtm Article guidance/Pilot wikis and collaborators 0 2358596 8364386 8363798 2026-05-03T13:53:15Z ToadetteEdit 17805473 8364386 wikitext text/x-wiki <languages/> <translate><!--T:1--> The following Wikipedias have been selected as potential communities we want to work with to develop and test this intervention. The selection is based on [[<tvar name="1">phab:T414448</tvar>|the criteria shown on this page]].</translate> <translate><!--T:3--> We are open to collaborating with other Wikipedias that want to work with us.</translate> * {{int|project-localized-name-arwiki}} [ar] * {{int|project-localized-name-bnwiki}} [bn] * {{int|project-localized-name-eswiki}} [es] * {{int|project-localized-name-fawiki}} [fa] * {{int|project-localized-name-frwiki}} [fr] * {{int|project-localized-name-jawiki}} [ja] * {{int|project-localized-name-ptwiki}} [pt] * {{int|project-localized-name-simplewiki}} [simple] * {{int|project-localized-name-trwiki}} [tr] <translate> === Collaborators === <!--T:2--> <!--T:4--> If you are an experienced editor or have admin rights and are interested in working with us, please add your user name below and your Wikipedia edition to sign up to provide input and test the Article guidance intervention. </translate> * '''Chinese Wikipedia''' --[[User:SCP-2000|SCP-2000]] ([[User talk:SCP-2000|talk]]) 03:22, 12 February 2026 (UTC) * '''Turkish Wikipedia''' --[[User:Nabbegat|Nabbegat]] ([[User talk:Nabbegat|talk]]) 06:29, 12 February 2026 (UTC) * '''Turkish Wikipedia''' --[[User:Zafer|Zafer]] ([[User talk:Zafer|talk]]) 06:41, 13 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:Yahya|Yahya]] ([[User talk:Yahya|talk]]) 19:36, 14 February 2026 (UTC) * '''Japanese Wikipedia''' --[[User:さえぼー|さえぼー]] ([[User talk:さえぼー|talk]]) 06:00, 20 February 2026 (UTC), * '''Bangla Wikipedia''' --[[User:R1F4T|R1F4T]] ([[User talk:R1F4T|talk]]) 09:44, 20 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Mohammed Qays|Mohammed Qays]] ([[User talk:Mohammed Qays|talk]]) 10:58, 20 February 2026 (UTC) * '''Arabic Wikipedia''' '''--'''[[User:علاء |<span style="font-size: 12pt; font-family: Script MT Bold; color:black;">Alaa</span> ]] [[User_talk:علاء |:)..!]] 11:01, 20 February 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Little Sunshine|Little Sunshine]] ([[User talk:Little Sunshine|talk]]) 19:07, 20 February 2026 (UTC) * '''Igbo Wikipedia''' --[[User: Onyinyeonuoha|Onyinye Jane Achukwu]] ([[User talk: Onyinyeonuoha|talk]]) 07:11, 20 February 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Victor Lopes|Victor Lopes]] ([[User talk:Victor Lopes|talk]]) 14:25, 23 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Mr. Ibrahem|Mr. Ibrahem]] ([[User talk:Mr. Ibrahem|talk]]) 04:00, 24 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:Tausheef Hassan|Tausheef Hassan]] ([[User talk:Tausheef Hassan|talk]]) 14:59, 24 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:ARI|ARI]] ([[User talk:ARI|talk]]) 05:57, 25 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Nehaoua|Nehaoua]] ([[User talk:Nehaoua|talk]]) 20:52, 27 February 2026 (UTC) * '''English Wikipedia''' --[[User:Kudpung|Kudpung]] ([[User talk:Kudpung|talk]]) 01:37, 1 March 2026 (UTC) * '''Azerbaijani Wikipedia''' [[User:Nemoralis|Nemoralis]] ([[User talk:Nemoralis|talk]]) 12:01, 2 March 2026 (UTC) * '''Arabic Wikipedia'''--[[User:Osps7|Osps7]] ([[User talk:Osps7|talk]]) 23:09, 3 March 2026 (UTC) * '''Arabic Wikipedia''' '''-''' [[User:رِفْد|رِفْد]] ([[User talk:رِفْد|talk]]) 03:26, 6 March 2026 (UTC) * '''Serbo-Croatian Wikipedia''' – [[User:Vipz|Vipz]] ([[User talk:Vipz|talk]]) 01:11, 10 March 2026 (UTC) * '''Bangla Wikipedia''' - [[User:MS Sakib|MS Sakib]] ([[User talk:MS Sakib|talk]]) 16:36, 15 March 2026 (UTC) * '''English Wikipedia''' – [[User:Toadspike|Toadspike]] ([[User talk:Toadspike|talk]]) 23:08, 17 March 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Arcstur|Arcstur]] ([[User talk:Arcstur|talk]]) 15:54, 14 April 2026 (UTC) * '''Arabic Wikipedia''' '''-''' --[[User:Dezedien|Dezedien]] ([[User talk:Dezedien|talk]]) 22:03, 29 April 2026 (UTC) * '''Arabic Wikipedia''' '''-''' [[User:ToadetteEdit|ToadetteEdit]] ([[User talk:ToadetteEdit|talk]]) 13:53, 3 May 2026 (UTC) c56lhts5k1sv85sizuz33ltii8evwak Outreachy/Round 32 0 2358848 8365089 8318169 2026-05-04T08:59:07Z Mvolz (WMF) 1890356 /* Program timeline */ 8365089 wikitext text/x-wiki [[File:Outreachy-logo.svg|alt=Outreachy logo|thumb]][[Wikimedia]] has participated in [http://outreachy.org/ Outreachy] since [[Special:MyLanguage/Outreachy/Past projects|2013]]. Outreachy provides internships in open source and open science, to people subject to systemic bias and impacted by underrepresentation in the technical industry where they are living. Outreachy is a three-month, full-time internship and runs two editions every year. Internship projects may include programming, research, user experience, documentation, graphical design, data science, marketing, user advocacy, event planning, and more! Outreachy collaboration is with Wikimedia's [[metawiki:Wikimedia_Foundation/Organizational_chart#Product_and_Technology|Chief Product & Technology Officer (CPTO) team]] and Wikimedia also provides funding for Outreachy internships. {{Note | text = Thank you for your interest in Outreachy. Please note the updated guidelines below: }} == Updated guidelines == '''As of 2026, we are changing project selection to align with the Wikimedia Foundation’s goals and to ensure a positive learning experience for interns.''' * We will prioritize projects that align with the '''WMF Annual Plan''', specifically the [[metawiki:Community_Wishlist|Community Wishlist]] and/or the [[metawiki:Wikimedia_Foundation_Annual_Plan/2025-2026/Product_&_Technology_OKRs#Product_and_Technology_Objectives|Product and Technology Objectives]]. This ensures that we are focusing on projects with community demand and/or strategic alignment. * We want to ensure a '''safe and productive''' environment for interns. Projects that require extensive community consultation will not be selected. * Mentors can only support '''one project'''. This means that mentors cannot participate in two Outreachy projects or in both Google Summer of Code and Outreachy at the same time. This ensures that mentors have sufficient capacity for their project and interns get the time and attention they need to do well. * Mentors will first submit their projects to '''Phabricator only''', via [[phab:T417438|this task]]. After we have reviewed projects, we notify approved mentors that they are cleared to submit their projects to the Outreachy website. The deadline for this submission is March 7, 2026 at 4pm UTC. This will help make the submission process more efficient. * In order to be accepted, all projects must have at least '''two mentors''' at the time of submission. This allows us to see which projects are fully staffed. * In order to be accepted, all projects must have microtasks '''on Phabricator''' at the time of submission. This allows us to see which projects are fully prepared and makes it easier for prospective interns to understand how to start contributing. We acknowledge that this is different from how we approached Outreachy rounds in the past. However, we believe that these changes will improve the program, and we will continue to evaluate the results and iterate as needed. == Outreachy information and resources == * [[Special:MyLanguage/Outreachy/Participants|Information for Participants]] * [[Special:MyLanguage/Outreachy/Mentors|Information for Mentors]] * [[Special:MyLanguage/Outreachy/Administrators|Information for Administrators]] == Recommended steps for interns == # [[Outreachy/Participants#Step by Step Application Process|Step-by-Step Application Process]] # [[Outreachy/Participants#Community bonding period|After you've been accepted: community bonding period]] # [[Outreachy/Participants#Internship period|Tasks to do during your internship]] # [[Outreachy/Participants#Stay involved after the internship|Stay involved after your internship is complete]] === After you've been accepted and before the internship period kicks off === # Start communicating with your mentors on refining your project proposal, finalizing deadlines and setting milestones. # Join [http://wikimedia.zulipchat.com/ Zulip] as we use the chat application to share program-related announcements and opportunities for participating in Wikimedia activities. # Set up your blog, if you don't already have one. ## We'll remind you to submit 3 project reports throughout the program and link to them from the [[Outreachy/Round 32#Accepted Projects|updates]] section in the table below. ## You'll want to create your blogs on a platform where the URL lives forever, such as [https://support.google.com/blogger/answer/1623800?hl=en Google Blogger] or [https://medium.com/online-writing-101/how-to-create-a-free-blog-with-medium-in-6-easy-steps-c67c3309aac1 Medium]. # Setup up your MediaWiki user page and keep it up to date with your project work and reports. # ''(Optional)'' Upload your profile picture on [[commons:Special:UploadWizard|Wikimedia Commons]], and add it below your name in the [[Outreachy/Round 31#Selected Projects|selected projects table]]. # ''(Optional)'' Stay in touch with Wikimedia community members and help them learn more about you: #* Subscribe to Wikimedia mailing list [[mail:wikitech-l|wikitech-l@lists.wikimedia.org]] #* Setup up your MediaWiki user page and keep it up to date with your project work and reports ([[User:Amrit sreekumar|example 1]], [[metawiki:User:KeerthanaS|example 2]]). #* Interested in learning about other Wikimedia technical topics? Watch some [[Tech talks|videos]]. == Program timeline == Wikimedia will be taking part in Outreachy Round 32 ''(2026 May 18 to August 17)'', see the [https://www.outreachy.org/communities/cfp/ full program timeline]. {| class="wikitable" !Date !Activity |- |Mar 7 at 4pm UTC |Project submission deadline |- |Mar 17 - Apr 15 at 4pm UTC |Contribution period |- |May 1 at 4pm UTC |Accepted interns announced |- |May 18 - Aug 17 |Internship period |} == Selected projects == There is a main [[phab:T417438|Phabricator task]] where the project information can be found. {| class="wikitable" |+ !Project summary !Intern and location !Mentors !Weekly updates !Project reports |- |[[phab:T418284|Addressing the lusophone technological wishlist proposals - Visual Editor / Wikidata]] | |[[phab:p/Ederporto/|@Ederporto]] [[phab:p/Arcstur/|@Arcstur]] | | |} == Contact == * Wikimedia uses Zulip for its Outreach programs to connect students and mentors. Zulip is a free and open source chat group application that we use to share program-related announcements and opportunities for participating in Wikimedia activities. ** Wikimedia's Zulip instance is hosted at [http://wikimedia.zulipchat.com/ http://wikimedia.zulipchat.com]. ** Discover more details about the [[Outreach programs/Zulip|Zulip application]], [[Zulip#Communication tips and guidelines|communication tips and guidelines]], as well as why it's [[Zulip#Why we encourage the use of Zulip|encouraged]] to use. * For Outreachy Round 32, reach out on the chat channel. (coming soon) * Wikimedia organization administrators are also available on Zulip: [[User:LGoto (WMF)|Lani Goto]], [[User:Mhmohona|Mahfuza Mohona,]] [[User:Gopavasanth|Vasanth Gopa]]. {{note|* We encourage applicants to communicate in the public streams and refrain from sending private emails/messages whenever possible. * Open communication allows fellow applicants to learn from your questions. It also gives all community members a chance to answer your queries. This way, queries get answered sooner and the administrators do not become a bottleneck. * See also our [[New_Developers/Communication_tips|communication tips]] and [https://developer.wikimedia.org/get-help/ get help on technical questions]. }} == Be part of something big == [[File:Jack_Andraka_on_Wikipedia_--_keepitfree.webm|thumb|These are the people we develop for.]] '''[[metawiki:Special:MyLanguage/Vision|We believe]] that knowledge should be free for every human being.''' By working with us, you're contributing to one of the world's largest collaborative knowledge base. You will be adding value to the vast pool of knowledge that has been and will keep satisfying the everlasting curiosity of '''knowing more'''. You can be part of a team that solves challenges and scales features to a million users. From desktop to mobile to analytics to bots, it has something to offer for everyone. We prioritize efforts that empower disadvantaged and underrepresented communities, and that help overcome barriers to participation. We believe in mass collaboration, diversity and consensus building to achieve our goals. [https://www.wikipedia.org/ Wikipedia] is a free encyclopedia written in over 300 languages by volunteers around the world and 1.5 billion unique devices access Wikimedia projects every month. [[commons:|Wikimedia Commons]], [[wikidata:|Wikidata]] and [[wiktionary:|Wiktionary]] are some of the [https://www.wikimedia.org/ other free content projects] hosted by Wikimedia thanks to [[MediaWiki]]. There is also [https://www.openhub.net/orgs/wikimedia a wide collection] of open source software projects around them. Much more can be done: stabilize infrastructure, increase participation, improve quality, increase reach, and encourage innovation. Join us! {{OPW}} 5ytkyiljbqmzhte7k9acuuel09o1zd8 Article guidance/Pilot wikis and collaborators/en 0 2359277 8364748 8363799 2026-05-03T21:29:46Z FuzzyBot 451990 Updating to match new version of source page 8364748 wikitext text/x-wiki <languages/> The following Wikipedias have been selected as potential communities we want to work with to develop and test this intervention. The selection is based on [[phab:T414448|the criteria shown on this page]]. We are open to collaborating with other Wikipedias that want to work with us. * {{int|project-localized-name-arwiki}} [ar] * {{int|project-localized-name-bnwiki}} [bn] * {{int|project-localized-name-eswiki}} [es] * {{int|project-localized-name-fawiki}} [fa] * {{int|project-localized-name-frwiki}} [fr] * {{int|project-localized-name-jawiki}} [ja] * {{int|project-localized-name-ptwiki}} [pt] * {{int|project-localized-name-simplewiki}} [simple] * {{int|project-localized-name-trwiki}} [tr] === Collaborators === If you are an experienced editor or have admin rights and are interested in working with us, please add your user name below and your Wikipedia edition to sign up to provide input and test the Article guidance intervention. * '''Chinese Wikipedia''' --[[User:SCP-2000|SCP-2000]] ([[User talk:SCP-2000|talk]]) 03:22, 12 February 2026 (UTC) * '''Turkish Wikipedia''' --[[User:Nabbegat|Nabbegat]] ([[User talk:Nabbegat|talk]]) 06:29, 12 February 2026 (UTC) * '''Turkish Wikipedia''' --[[User:Zafer|Zafer]] ([[User talk:Zafer|talk]]) 06:41, 13 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:Yahya|Yahya]] ([[User talk:Yahya|talk]]) 19:36, 14 February 2026 (UTC) * '''Japanese Wikipedia''' --[[User:さえぼー|さえぼー]] ([[User talk:さえぼー|talk]]) 06:00, 20 February 2026 (UTC), * '''Bangla Wikipedia''' --[[User:R1F4T|R1F4T]] ([[User talk:R1F4T|talk]]) 09:44, 20 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Mohammed Qays|Mohammed Qays]] ([[User talk:Mohammed Qays|talk]]) 10:58, 20 February 2026 (UTC) * '''Arabic Wikipedia''' '''--'''[[User:علاء |<span style="font-size: 12pt; font-family: Script MT Bold; color:black;">Alaa</span> ]] [[User_talk:علاء |:)..!]] 11:01, 20 February 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Little Sunshine|Little Sunshine]] ([[User talk:Little Sunshine|talk]]) 19:07, 20 February 2026 (UTC) * '''Igbo Wikipedia''' --[[User: Onyinyeonuoha|Onyinye Jane Achukwu]] ([[User talk: Onyinyeonuoha|talk]]) 07:11, 20 February 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Victor Lopes|Victor Lopes]] ([[User talk:Victor Lopes|talk]]) 14:25, 23 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Mr. Ibrahem|Mr. Ibrahem]] ([[User talk:Mr. Ibrahem|talk]]) 04:00, 24 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:Tausheef Hassan|Tausheef Hassan]] ([[User talk:Tausheef Hassan|talk]]) 14:59, 24 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:ARI|ARI]] ([[User talk:ARI|talk]]) 05:57, 25 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Nehaoua|Nehaoua]] ([[User talk:Nehaoua|talk]]) 20:52, 27 February 2026 (UTC) * '''English Wikipedia''' --[[User:Kudpung|Kudpung]] ([[User talk:Kudpung|talk]]) 01:37, 1 March 2026 (UTC) * '''Azerbaijani Wikipedia''' [[User:Nemoralis|Nemoralis]] ([[User talk:Nemoralis|talk]]) 12:01, 2 March 2026 (UTC) * '''Arabic Wikipedia'''--[[User:Osps7|Osps7]] ([[User talk:Osps7|talk]]) 23:09, 3 March 2026 (UTC) * '''Arabic Wikipedia''' '''-''' [[User:رِفْد|رِفْد]] ([[User talk:رِفْد|talk]]) 03:26, 6 March 2026 (UTC) * '''Serbo-Croatian Wikipedia''' – [[User:Vipz|Vipz]] ([[User talk:Vipz|talk]]) 01:11, 10 March 2026 (UTC) * '''Bangla Wikipedia''' - [[User:MS Sakib|MS Sakib]] ([[User talk:MS Sakib|talk]]) 16:36, 15 March 2026 (UTC) * '''English Wikipedia''' – [[User:Toadspike|Toadspike]] ([[User talk:Toadspike|talk]]) 23:08, 17 March 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Arcstur|Arcstur]] ([[User talk:Arcstur|talk]]) 15:54, 14 April 2026 (UTC) * '''Arabic Wikipedia''' '''-''' --[[User:Dezedien|Dezedien]] ([[User talk:Dezedien|talk]]) 22:03, 29 April 2026 (UTC) * '''Arabic Wikipedia''' '''-''' [[User:ToadetteEdit|ToadetteEdit]] ([[User talk:ToadetteEdit|talk]]) 13:53, 3 May 2026 (UTC) axks8mhazrnxc3f6ys2xei663trwwrg Talk:VisualEditor/Suggestion Mode/Feedback 1 2359847 8365113 8363407 2026-05-04T10:45:11Z Quiddity (WMF) 968235 /* tone on Lorem ipsum at testwiki */ Reply 8365113 wikitext text/x-wiki {{notice|Administrators: Please configure and customize these features at your wiki. See [[Help:Suggestion mode#For administrators – local customization]].<br>Anyone: Please see and share project-level ideas and feedback at [[Talk:VisualEditor/Suggestion Mode]].}} == addReference on Archdiocese_of_Anchorage–Juneau at enwiki == How do I turn off this feature? It is very distracting while editing. I would suggest that the software activate this feature only when the article is being saved. [[User:Rogermx|Rogermx]] ([[User talk:Rogermx|talk]]) 17:31, 12 February 2026 (UTC) :The feature should only show for users who have enabled the beta feature in their preferences. It's possible you have auto-enrolled to all new beta features? [[User:ESanders (WMF)|ESanders (WMF)]] ([[User talk:ESanders (WMF)|talk]]) 16:04, 14 February 2026 (UTC) :@[[User:Rogermx|Rogermx]]: Go to [[w:en:Special:Preferences#mw-prefsection-betafeatures]]. Turn off either "Automatically enable most beta features" at the top or "Suggestions mode" in the middle of the page. Be sure to click the big blue "Save" button at the bottom of the page. (And hopefully they've fixed the bug from a few years back that kept the automatically enabled things still enrolled.) [[User:WhatamIdoing|WhatamIdoing]] ([[User talk:WhatamIdoing|talk]]) 21:25, 15 February 2026 (UTC) ::Thank you very much for the tip. You've made my day! [[User:Rogermx|Rogermx]] ([[User talk:Rogermx|talk]]) 22:36, 15 February 2026 (UTC) :::You're welcome. [[User:WhatamIdoing|WhatamIdoing]] ([[User talk:WhatamIdoing|talk]]) 02:37, 16 February 2026 (UTC) == addReference on Mnesarchus_of_Athens at enwiki == Interesting feature. That's a good use of AI, to suggest where a citation should be. I'm not a huge fan of it shoving the text to the left, perhaps it could be more of an "inline" tool (like an lightbulb next to the text or something). In this specific case, the tool prompted for me to insert a citation at the start of the quote, where one already existed at the end. Given below is a screenshot. https://i.imgur.com/yOLzMx8.png [[User:EatingCarBatteries|EatingCarBatteries]] ([[User talk:EatingCarBatteries|talk]]) 08:16, 13 February 2026 (UTC) :I do think this is a step in the right direction. It does need to be worked out more - we don't want inaccurate suggestions that mislead new users. Maybe there could be a box informing users of the feature and offering a toggle, located next to the visual/source edit toggle. Something like this: :https://i.imgur.com/4nFqM1W.png [[User:EatingCarBatteries|EatingCarBatteries]] ([[User talk:EatingCarBatteries|talk]]) 08:29, 13 February 2026 (UTC) ::I also notice that if you dismiss the suggestion, switching to source editing and back to visual editing brings it back. [[User:EatingCarBatteries|EatingCarBatteries]] ([[User talk:EatingCarBatteries|talk]]) 08:31, 13 February 2026 (UTC) :Thanks for your feedback! :The case of a citation at the end of a quote not being detected is one we should look into. Filed as [[phab:T417490]]. :A toolbar button to toggle the mode on/off is definitely something we are planning, so good to hear you suggest the same. :We have also discussed how suggestions might stay dismissed, although tracking that across edit sessions is not trivial. [[User:ESanders (WMF)|ESanders (WMF)]] ([[User talk:ESanders (WMF)|talk]]) 16:11, 14 February 2026 (UTC) == addReference on Billardiera_scandens at enwiki == I pressed {{Key press|Return}} in the middle of a long paragraph [[w:en:Billardiera scandens#Uses]], and Clippy immediately popped up to say that the "new" paragraph now needed a citation. I can see from the page history that most of this content was [https://en.wikipedia.org/w/index.php?title=Billardiera_scandens&diff=prev&oldid=145392451 added at the same time] and therefore is going to be the first source in the "second" paragraph, but newcomers will probably be discouraged from making simple copyedits by this kind of demand. Some experienced editors will be irritated that Clippy started nagging before they had time to fix the problem themselves. Also, upon re-using the citation, Clippy goes away and gives me most of my screen real estate back (hooray), but the toolbar is still scrunched while scrolling. [[User:WhatamIdoing|WhatamIdoing]] ([[User talk:WhatamIdoing|talk]]) 21:22, 15 February 2026 (UTC) :In regular edit check mode, this would not have suggested you add a citation, as it would correctly identify the split paragraph as not being newly-added. This only appears in "suggestion mode" which is for users looking for suggestions to improve the article (although currently the beta feature does not make that particularly clear, see discussion about a toolbar button above). :> the toolbar is still scrunched while scrolling. :I think this is [[phab:T412223|T412223]] and will be fixed next week (the patch only took 9 years to merge!) [[User:ESanders (WMF)|ESanders (WMF)]] ([[User talk:ESanders (WMF)|talk]]) 18:03, 17 February 2026 (UTC) ::Yesterday, it correctly identified a duplicate link (same link in the same paragraph). This is the only suggestion it has made that I wouldn't have noticed on my own. I find that I mostly ignore the presence of the suggestions, which means that I can't really comment on whether the quality is generally good. I suspect that this needs to be tested with newer editors (even editors with ~1,000 edits may find it more helpful). [[User:WhatamIdoing|WhatamIdoing]] ([[User talk:WhatamIdoing|talk]]) 21:09, 17 February 2026 (UTC) :::{{tq|... it correctly identified a duplicate link (same link in the same paragraph). This is the only suggestion it has made that I wouldn't have noticed on my own.}} :::@[[User:WhatamIdoing|WhatamIdoing]], building on the duplicate link suggestion, I wonder: what (if any) other suggestion ideas come to mind that you can imagine being similarly useful? [[User:PPelberg (WMF)|PPelberg (WMF)]] ([[User talk:PPelberg (WMF)|talk]]) 22:37, 11 March 2026 (UTC) ::::Sky's the limit? ::::Something that checks for signs of AI misuse, such as fake URLs or lousy prose. ::::Something that flags low-quality or usually unwanted URLs in refs (locally configurable; might help with [[w:en:WP:ATODAY]]). Also, there's a tool at enwiki that compares usernames against article titles to see whether "Bob Business" is trying to write an article about himself. Being able to do something like that to identify exclusive use of non-independent sources (e.g., if [[w:Coca-Cola]] is only citing coca-cola.com) might be a good way to introduce newcomers to the desirability of an independent source. ::::Something that suggests adding an image, if there are are <2 on the page and a decent chance that Commons has something useful. ::::A size check to encourage addition of a few more sentences in smaller articles (<200 words?) or very short introductions (<50 words?). ::::Something that suggests the appropriate type of infobox (enwiki has so many that finding the correct one can be daunting for newcomers, but they're happy when they can put one in an article; should be limited to [[w:en:Category:Wikipedia articles with an infobox request]] to reduce the risk of drama). ::::For medical content specifically, something that flags any source that's more than about 10 years old ("This source is ''n'' years old. Is this information outdated?") or whose PubMed "Publication types" lists various categories (e.g., 'clinical trial' is iffy; 'review article' is good). [[User:WhatamIdoing|WhatamIdoing]] ([[User talk:WhatamIdoing|talk]]) 06:16, 12 March 2026 (UTC) == tone on Pam_Hallandal at enwiki == Good idea perhaps for novices, but for any experience editor, so disruptive...for just any verbatim quotation I insert, this 'feature' suggests I might want to change the 'tone'. Takes me back to the 1997 and Microsoft's impertinent and unhelpful 'Clippy'! The way it shoves the formatting about every time you finish a new para disrupts editing and you lose your place. I can put in a citation without being told to. And yes, the case of a citation at the end of a quote not being detected is one you should look into. I see now the information above on turning this off and will, thank you. [[User:Jamesmcardle|Jamesmcardle]] ([[User talk:Jamesmcardle|talk]]) 04:15, 18 February 2026 (UTC) :Thanks, you are correct that we should not be checking for tone in quoted text. This was fixed in [[phab:T417801|T417801]] and deployed last week. [[User:ESanders (WMF)|ESanders (WMF)]] ([[User talk:ESanders (WMF)|talk]]) 13:01, 24 February 2026 (UTC) == addReference on Floyd_v._City_of_New_York at enwiki == [[File:Wrong_sentence_boundary_edit_suggestion_glitch_2026-02-19.png|thumb|screenshot]] Just now, while making [https://en.wikipedia.org/w/index.php?title=Floyd_v._City_of_New_York&diff=1339225160&oldid=1337950219 this edit on English Wikipedia], I saw the "Add a citation" edit suggestion feature glitch slightly. The highlight (the part of the prose that, it's suggesting, needs a citation) starts and ends at words in the middle of a sentence, instead of at the end of a sentence, or even at the start and end of a meaningful clause or a reasonable subsection of the sentence. And the suggestion was visible while I was editing a two-line passage that had a citation at the end of each sentence. See screenshot. [[User:Sumanah|Sumana Harihareswara]] ([[User talk:Sumanah|talk]]) 16:24, 19 February 2026 (UTC) :That is indeed incorrect. "Add a citation" should only every highlight an ''entire'' paragraph, and only when it contains no references. Do you remember how you got it to happen? Were you splitting paragraphs / moving text around? [[User:ESanders (WMF)|ESanders (WMF)]] ([[User talk:ESanders (WMF)|talk]]) 12:57, 24 February 2026 (UTC) ::Apologies that I don't precisely remember how it happened. I'm pretty sure I was not splitting paragraphs at the time. However, sometime during this edit, I see I consolidated two references into one (the ref named nyclu1) because I had realized that previous editors had accidentally made two separate references to essentially the same cite. So maybe that influenced the sequence of events. [[User:Sumanah|Sumana Harihareswara]] ([[User talk:Sumanah|talk]]) 14:58, 9 March 2026 (UTC) == duplicateLink on Mylan_Denerstein at enwiki == I received a duplicate link warning while making [https://en.wikipedia.org/w/index.php?title=Mylan_Denerstein&diff=1339235438&oldid=1339220349 this edit]; the paragraph does not include any duplicate links. [[User:Sumanah|Sumana Harihareswara]] ([[User talk:Sumanah|talk]]) 16:00, 23 February 2026 (UTC) :Hi Sumana! That does look strange - the only thing I can see in that edit is that the full stop at the end of the sentence is part of the link. I'm wondering if maybe you inserted a reference before the full stop, thus splitting the link into two links: "the [[:en:New_York_City_Fire_Department|New York City Fire Department]]<sup>[[Talk:VisualEditor/Suggestion Mode/Feedback#ref|[9]]]</sup>[[:en:New_York_City_Fire_Department|.]]". Do you remember anything like that happening, or can you reproduce with another edit? [[User:ESanders (WMF)|ESanders (WMF)]] ([[User talk:ESanders (WMF)|talk]]) 12:54, 24 February 2026 (UTC) ::Thanks - ah yeah, whoops I see I included the fullstop in the link. Yeah your speculation sounds very plausible, though I don't specifically remember it happening! [[User:Sumanah|Sumana Harihareswara]] ([[User talk:Sumanah|talk]]) 15:00, 9 March 2026 (UTC) == externalLink on Medicare_for_All_Act at enwiki == these are acceptable uses for external links. in this case, we're linking to congress.gov for the status of bills. this feature shouldn't tag all external links within the article, as per [[en:WP:ELYES]]. We don't want new people removing links that are acceptable. [[User:EatingCarBatteries|EatingCarBatteries]] ([[User talk:EatingCarBatteries|talk]]) 00:32, 7 March 2026 (UTC) :Context: on this page the external links are within a table cell, where the bill number is being linked directly to congress.gov. It's possible that we could add "legislative history" to the ignored sections for this check on enwiki if this is a common pattern. [[User:DLynch (WMF)|DLynch (WMF)]] ([[User talk:DLynch (WMF)|talk]]) 16:15, 9 March 2026 (UTC) == addReference on Riley_O'Brien at enwiki == Waste of my time messages won't buzz off when I'm trying to edit. I know what a reference is. This is like Clippy again. [[User:Harizotoh9|Harizotoh9]] ([[User talk:Harizotoh9|talk]]) 16:26, 7 March 2026 (UTC) :Hi. Thanks for providing feedback. Many of the individual suggestions from this feature are eventually intended to help ''newcomers'' (people with fewer than 100 edits) to slowly become successful and thoughtful editors. (See more details about the project at [[VisualEditor/Suggestion Mode]]). :It is currently available as a Beta Feature, partially so that experienced editors can help to refine/improve any aspects of the feature before it is shown to those newcomers. It is also possible for each community to create local types of suggestions, some of which may be more (or only) suitable for experienced editors. :In the near future there will also be a toolbar toggle to either collapse or hide the Suggestions entirely. :I hope that information helps to contextualize why you are seeing it, and how you can help now, or just to more happily utilize the tool in the future (once your home wiki(s) have created custom suggestions for experienced editors). [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 22:44, 9 March 2026 (UTC) == Pasted content warning for a long proper noun == [[File:Pasted_content_edit_suggestion_warning_2026-03-09.png|thumb|The edit suggestion/warning regarding copy-and-pasted content glitches slightly; the phrase "New York State and Local Retirement System (NYSLRS)" is highlighted]] While editing, I pasted the phrase "New York State and Local Retirement System (NYSLRS)" into an article. I suppose it was long enough, character-wise, to trip an alert threshhold. Maybe phrases that entirely contain proper nouns (as indicated by initialisms or a preponderance of words that start with capitalized letters) ought to be exempt? [[User:Sumanah|Sumana Harihareswara]] ([[User talk:Sumanah|talk]]) 15:37, 9 March 2026 (UTC) :Yes, the threshold is 50 characters (chosen somewhat arbitrarily to be the same threshold as the add-a-reference check), and your text is 52 characters. The idea is that communities will configure this as it will also vary per language (e.g. you get many more words-per-character in Chinese), but we may also want to increase the default. [[User:ESanders (WMF)|ESanders (WMF)]] ([[User talk:ESanders (WMF)|talk]]) 17:40, 9 March 2026 (UTC) == textMatch-LLM-multiple-indicators on Downtown_Line at enwiki == I have been told by the suggestor multiple times during a [[w:WP:GA|good article]] assessment ([[w:Talk:Downtown Line/GA1]] specifically) that the third paragraph of {{slink|w:Downtown Line|Architecture}} is AI-generated, despite the nominator's assurances that it is not (I am the reviewer). Could you take a look into the software? [[User:Whyiseverythingalreadyused|Whyiseverythingalreadyused]] ([[User talk:Whyiseverythingalreadyused|talk]]) 01:57, 11 March 2026 (UTC) :Hi @[[User:Whyiseverythingalreadyused|Whyiseverythingalreadyused]]. Thanks for asking. :* Broadly: The LLM textmatch suggestions are purely/simply using the 3 lists defined within Enwiki's [[w:MediaWiki:Editcheck-config.json]]. If you search for "LLM" in that page, you'll see the 3 listings of words/word-strings it is detecting (taken from [[w:WP:AISIGNS]]). Note: The 3rd type [which your question here is about] is also further limited by the configuration-parameter below the listing, which currently says "<code>minOccurrences</code> [=] <code>3</code>" (i.e. it only shows the Suggestion, if it detects 3 or more instances of those strings within a single paragraph). :** The community can & should adjust those suggestion types (and all types!) in whatever way is desired. :* Specifically in this instance: I can deduce from that listing and that paragraph, that it is detecting the keyword "reflect" which appears 4 times. If I delete 2 of them, the Suggestion goes away. I.e. There is probably no problem with AI being used. :If you have ideas on how to improve the Suggestion via changes to the configuration, or changes to the wording shown to editors, the best place to discuss/request those is on the local configuration's talkpage. The one major complexity, which I see is already highlighted in the latest comment there ([[w:MediaWiki_talk:Editcheck-config.json#Message]]) is the perspective that [as Kowal2701 writes] "{{tq|we probably don't want to link to WP:AISIGNS or let the editor know how we know, lest they superficially address the issues or game it.}}" :Let me know if that info helps or if I can help in any other way. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 20:05, 11 March 2026 (UTC) == addReference on Emmanuelle_Chapron at frwiki == French Wikipedia does not require references in the abstract. [[User:Exilexi|Exilexi]] ([[User talk:Exilexi|talk]]) 08:29, 13 March 2026 (UTC) :Bonjour. The community (admins) can change these settings. Please edit [[w:fr:MediaWiki:Editcheck-config.json]] and add this line above the current line#3: :<code>"ignoreLeadSection": true,</code> :For comparison/example, see line#3 at Enwiki's [[w:en:MediaWiki:Editcheck-config.json]], and more example-options in either [https://en.wikipedia.beta.wmcloud.org/wiki/MediaWiki:Editcheck-config.json Beta Cluster's version], or in the documentation at [[Edit check/Configuration]]. :I hope that helps, and please let us know if you have any other questions. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 18:25, 13 March 2026 (UTC) :@[[User:Exilexi|Exilexi]] Oh, I'll add a ping here, too, in case that is needed/helpful. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 18:55, 13 March 2026 (UTC) ::Thank you! [[User:Exilexi|Exilexi]] ([[User talk:Exilexi|talk]]) 19:30, 13 March 2026 (UTC) == addReference on Véra_Eisenmann at frwiki == Pas de source dans le résumé introductif ! [[User:Gustave en résidence|Gustave en résidence]] ([[User talk:Gustave en résidence|talk]]) 10:04, 13 March 2026 (UTC) :Bonjour. My apologies for not replying in French. Please see my reply to Exilexi above for the answer to your question. I hope that helps. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 18:27, 13 March 2026 (UTC) :Bonjour Gustave, j'ai fait la modification suggérée par @[[User:Quiddity (WMF)|Quiddity (WMF)]] et ça devrait être réglé pour tout le monde {{sourire}} [[User:Exilexi|Exilexi]] ([[User talk:Exilexi|talk]]) 19:32, 13 March 2026 (UTC) ::Merci ! [[User:Gustave en résidence|Gustave en résidence]] ([[User talk:Gustave en résidence|talk]]) 08:59, 16 March 2026 (UTC) == addReference on European_Long-Range_Strike_Approach at enwiki == Even though this is not the exact line of the article that causes this issue, I could not submit the issue while it was occurring. The issue is that if an editor manually adds a citation to a piece of text that the suggestion mode suggests that it should be cited, the suggestion textbox does not disappear, and causes the editor to be unable to publish changes. I wish the person who is attempting to fix this bug a nice day. [[User:ItIsWindyToday|ItIsWindyToday]] ([[User talk:ItIsWindyToday|talk]]) 06:31, 14 March 2026 (UTC) :@[[User:ItIsWindyToday|ItIsWindyToday]] Hi, thank you for this bug-report. :Please could you add a few more details on which step of the process you were blocked on? I tried to reproduce this bug, but it all seemed to work as I'd expect. My steps were: :# At [[testwiki:]], change my [[testwiki:Special:Preferences#mw-prefsection-betafeatures|preferences]] to enable the Suggestions Mode beta feature :# Open [[testwiki:Zevia]] in visual editor :# Click one of the 2 "Add a citation" suggestions that are shown on that page, and click the "Add citation" button within :# Add an example citation to the Automatic citation-generator - e.g. just https://example.org/ - and then click "Create" :# Click "Insert" to confirm the addition of that citation, after which the "Publish" button becomes blue. :# Publish the edit. ([https://test.wikipedia.org/w/index.php?title=Zevia&diff=prev&oldid=733678 example]) :I also tried it with a default settings account but skipping #3 and just inserting the citation manually via the Toolbar. I also tried to write some prose in the article first, in order to trigger the Reference Check reminder feature for newcomers. Both of those tests worked as I expected. :Much thanks for any clarifications you can provide. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 00:36, 17 March 2026 (UTC) == [[MediaWiki:Visualeditor-suggestionfeedback-link]] broken on dewiki? == When opening the feedback flow implemented in [[:phab:T415936]] on German Wikipedia and selecting "report a problem", the link "VisualEditor/Suggestion Mode/Feedback" leads to [[:de:Diskussion:VisualEditor/Suggestion Mode/Feedback]]. There's no issue with the link on other projects (I checked enwiki and eswiki) and there doesn't seem to be a local override causing the issue, [[:de:MediaWiki:Visualeditor-suggestionfeedback-link]] is identical to other projects. Should I file a Phabricator ticket? [[User:Johannnes89|Johannnes89]] ([[User talk:Johannnes89|talk]]) 09:46, 14 March 2026 (UTC) :Thanks for this bug-report. I found another related issue, and I've filed [[phab:T420123]], but please do edit-boldly if you can improve that. Cheers, [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 19:08, 14 March 2026 (UTC) == externalLink on Tribunal_Superior_de_Justicia_de_Canarias at eswiki == Indica que se elimine un enlace y se mueva a la zona de enlaces externos, pero ya está en esa sección [[User:HernC2|HernC2]] ([[User talk:HernC2|talk]]) 17:58, 19 March 2026 (UTC) :Gracias. My apologies for not replying in Spanish. Thank you for this bug-report. I will ask a local administrator to fix the local settings. This is one of the settings that needs to be configured for (and by) each wiki [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 21:47, 19 March 2026 (UTC) ::Thank you!! [[User:HernC2|HernC2]] ([[User talk:HernC2|talk]]) 21:53, 19 March 2026 (UTC) == duplicateLink on Egypt at enwiki == Sometimes says a part of a sentence needs a citation when it doesn't. [[User:Ivebeenhacked|Hacked]] ([[User talk:Ivebeenhacked|Talk]]|[[Special:Contributions/Ivebeenhacked|Contribs]]) 17:59, 19 March 2026 (UTC) :Hi, thank you for writing here. Please could you share an example sentence that you saw, which led to this comment? :For context: I'm slightly confused because you write "part of a sentence needs a citation", but (1) you have arrived here via the feedback-link on one of the "duplicateLink" suggestions, and (2) the "Add a citation" suggestion type only highlights ''entire paragraphs''; therefor I wonder/guess if perhaps you saw many "Add a citation" suggestions in a row, and then perhaps saw a "Duplicate link" suggestion and thought it was just another "Add a citation" suggestion? See this screenshot for example: [[phab:F73158169]]. :Much thanks for any additional details you can share. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 21:14, 19 March 2026 (UTC) ::The more that I think about it, the more convinced I am that I accidentally saw "Add a citation" instead of a duplicate link suggestion. Sorry for the misunderstanding. Also, I didn't expect whatever I wrote on the feedback comes here. Thank you for trying to help, I appreciate it. Goodbye for now. [[User:Ivebeenhacked|Hacked]] ([[User talk:Ivebeenhacked|Talk]]|[[Special:Contributions/Ivebeenhacked|Contribs]]) 22:38, 19 March 2026 (UTC) == disambiguation at enwiki == Broken link. Link is, exactly, "[ //en.wikipedia.org/wiki/Wikipedia:Disambiguation disambiguation page]" instead of what it should be. [[User:Organhaver|Organhaver]] ([[User talk:Organhaver|talk]]) 02:29, 24 March 2026 (UTC) :Thank you! I've [https://en.wikipedia.org/wiki/MediaWiki_talk:Editcheck-config.json#c-Quiddity_(WMF)-20260324180000-Pppery-20260313151100 requested] the fix. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 18:01, 24 March 2026 (UTC) == Performance issues for large articles == I like this feature a lot but noticed that it does not work well on larger articles. Specifically, I was working on [[:de:Aldehyde]] where the suggestion mode caused a delay of multiple seconds while typing characters. Likely, the feature should limit consideration to a smaller section of the article in such cases. [[User:Anagkai|Anagkai]] ([[User talk:Anagkai|talk]]) 12:10, 26 March 2026 (UTC) :We just this week noticed-and-fixed {{phab|T421235}} which is quite likely to have been what was going on here. [[User:DLynch (WMF)|DLynch (WMF)]] ([[User talk:DLynch (WMF)|talk]]) 17:06, 26 March 2026 (UTC) == addReference on Freshta_Kohistani at eswiki == Once I clicked on "Añadir cita" the box frozed [[User:Silva Selva|Silva Selva]] ([[User talk:Silva Selva|talk]]) 00:49, 27 March 2026 (UTC) :Hola. Thank you for reporting this. Please could you describe a few more details about what you experienced? I tried to reproduce the problem, by editing an older revision of [[w:es:Freshta Kohistani]] that still contained the Suggestion and then clicking/trying various things, but I didn't experience any freezing. In order to fix a bug, we need to be able to reproduce it (or understand more of the context, to narrow the investigation). It would be helpful if you could tell us details such as: :* Which specific "box" you are referring to (I believe you mean the whole "Añade una cita" box (as shown at [[w:es:Especial:EditChecks]]) but I want to confirm) :* How long the box froze for (a rough estimate in seconds) :* Whether it was ''just'' the box that froze and other parts of the interface still continued to work properly, or if it froze the entire editing window :* If you've experienced this again at any other page :* Whether you used the suggestion mode button again to make your latest edit at that article, or if you just used the Cite tool directly from the toolbar (or other). :Much thanks, for any additional details you can share, that might help us understand this bug (and ideally be able to reproduce it). Best regards, [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 22:36, 27 March 2026 (UTC) == externalLink on W・アンドリュー・ロビンソン_(著述家) at jawiki == これは外部リンクの内容のため、読者の集中をそぐという理由は不成立。 [[User:Omotecho|Omotecho]] ([[User talk:Omotecho|talk]]) 08:07, 31 March 2026 (UTC) :@[[User:Omotecho|Omotecho]] Hi! Thank you for commenting. The community (admins) can ''and should'' change these settings! The feature is highly configurable, to fit local needs and nuances. Would you be willing to help request a change for the page [[w:ja:MediaWiki:Editcheck-config.json]]? Essentially, a local admin needs to update that page, using the content at [[Help:Suggestion mode#Create a local configuration page]] (but replacing those Spanish example heading-names, with Japanese). If you'd prefer, I can try to write it in English on the talkpage there. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 23:16, 1 April 2026 (UTC) ::Oh, so it is handled locally, that is good to know. How does it sound you would post in en and ja? Posts in English are slow to get attention, I am afraid. I am happy to assist in en-ja translation for your post, while not very techy myself. <br> ::<br> ::For the *Suggestion feature*: Would you hint me where I read about the global general reaction how that feature is accepted? It will be great if the feature is diminishing admin's housecleaning workload. <br> ::<br> ::Well, above is based on my worry that we have very small percentage of admins against the total user population among any /ja wikis, or if admins would burn-out any day or not: when you are very tired, you are not the happiest self. Cheers, -- [[User:Omotecho|Omotecho]] ([[User talk:Omotecho|talk]]) 02:45, 8 April 2026 (UTC) :::Thank you! I have posted a request and some useful documentation links at [[w:ja:MediaWiki‐ノート:Editcheck-config.json]]. Please could you translate that however seems reasonable, and then either ping a specific admin or add the appropriate template to request an admin's assistance? :::Re: Suggestion mode global reaction - It was generally been ''very'' positive, partially because everything is configurable, and also extensible with custom local ideas. I've included 2 links in my message on Jawiki pointing to the examples at Enwiki and Ruwiki. Ruwiki in particular has already created nine different types of local textmatch suggestions (e.g. suggestions based on: common typos, common grammar errors, non-standard country-names, non-specific-time words, etc). In the near future, the textmatch suggestions will become even more powerful once it becomes possible to use regex ([[phab:T407664]]). Please tell me if you need any more details. :::Thanks again. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 23:13, 8 April 2026 (UTC) ::::Hello, finished translation. Too bad a [https://ja.wikipedia.org/wiki/Wikipedia:%E3%83%A1%E3%82%BF%E3%82%A6%E3%82%A3%E3%82%AD%E3%83%A1%E3%83%87%E3%82%A3%E3%82%A2/%E8%AD%B0%E8%AB%96%E4%B8%AD%E3%81%AE%E8%A9%B1%E9%A1%8C brach of wikipedia:news/ja for anything global] is deprecated, so I am not sure where else to notify of the Suggest function to localize. ::::Anyway, I will enjoy editing with the ''Suggests'' and cast my eyes on how I will upgrade the articles. --[[User:Omotecho|Omotecho]] ([[User talk:Omotecho|talk]]) 16:59, 9 April 2026 (UTC) :::::[off-topic] Re: "I am not sure where else to notify" - I agree this is a concern. On any wiki, I would normally attempt to use {{tl|Edit protected}} at a wiki talkpage to request help (listing: [[d:Q6578653]]), but I saw that the Japanese version has been deprecated: [[w:ja:Template:保護編集依頼]]. I think it might be helpful for many people (e.g. cross-wiki editors, etc) if someone could add information into that old template that explains how/where to request admin attention, instead. Perhaps you might like to raise this issue somewhere? Just a thought. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 18:12, 9 April 2026 (UTC) ::::::[back to main focus] Would you agree that we add to your message above that editors would post here in any language? That I hope would be a springboard across Jawp and mw, hopefully. ::::::[off topic] For adding a small note to bad a [[:ja:Wikipedia:メタウィキメディア/議論中の話題|brach of wikipedia:news/ja for anything global]]: Ahhh, right, I'll try and find fitting _de-tour_ message we have locally, for no matter what language(s) or project you base your activities. ::::::[off-off topic] ::::::As the crossing point for multi-language, pondering the hunch if Wikidata be handy to find way-around or not, but this case might be too local. --[[User:Omotecho|Omotecho]] ([[User talk:Omotecho|talk]]) 05:57, 12 April 2026 (UTC) :::::::1. If I understand correctly, you are suggesting adding a note at the top of [[w:ja:MediaWiki‐ノート:Editcheck-config.json]] to explain that feedback is welcome in any language. Yes please! -- I've also updated the note at the top of [[Talk:VisualEditor/Suggestion Mode]]. -- This page just contains the results of the "Feedback" form, so it implicitly welcomes all languages. :::::::2. Sounds good. I've clicked around a bit, and I now believe that old template ([[w:ja:Template:保護編集依頼]]) ought to include a link to [[w:ja:Wikipedia:管理者伝言板/保護ページ編集]] as a clue for people like me who are trying to find where to request help. That seems to be the newer location to request this kind of assistance (and I see Cookie4782 has already helpfully mentioned our request for help). :::::::3. Yes, I often use Wikidata's interlanguage-links to find an equivalent page in many languages, e.g. [[d:Q6578653]] or [[d:Q4580256]]. :::::::Thanks again. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 21:18, 13 April 2026 (UTC) == duplicateLink on 古代エジプト文字の解読 at jawiki == Multilple linkst to a single tl:visible anchor is needed especially ja readers are not familiar with names of Arabic/Islamic/Judeic person names. [[User:Omotecho|Omotecho]] ([[User talk:Omotecho|talk]]) 09:20, 31 March 2026 (UTC) :Thank you! I've filed [[phab:T422190]] to prevent this suggestion type from appearing for self-links (Links that point to the same article). We believe that is the cleanest way to prevent these specific types of instances. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 16:48, 2 April 2026 (UTC) ::Yes, please, and thank you suggesting a very practical and straight forward fix (: FYI in fact, there might not be many claims like this as Tl:visible anchor could be less popular among Jawiki users, I doubt. [[User:Omotecho|Omotecho]] ([[User talk:Omotecho|talk]]) 02:12, 8 April 2026 (UTC) == disambiguation on Ikan at mswiki == "Hutan hujan tropika" link is not directed to disambiguation page [[User:Hakimi97|Hakimi97]] ([[User talk:Hakimi97|talk]]) 12:48, 1 April 2026 (UTC) :@[[User:Hakimi97|Hakimi97]] Hi, thanks for commenting. That page ([[w:ms:Hutan hujan tropika]]) ''does'' currently include the [[help:magic word|magic word]] of <code><nowiki>__DISAMBIG__</nowiki></code> (in the External links section). I assume that is a human-error. :Usually that magic word is only included within a template that is placed on disambiguation pages (e.g. [[w:ms:Template:Nyahkekaburan]]). :I will leave this for you to fix (and perhaps investigate if the problem exists elsewhere, e.g. [https://ms.wikipedia.org/w/index.php?search=insource%3A%2F%22__DISAMBIG__%22%2F&title=Khas%3ACari&profile=advanced&fulltext=1&ns0=1 this search] seems to show other pages that ought to either use the template-version, or have the magic word removed). :I hope that helps. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 00:02, 2 April 2026 (UTC) ::I see, I will take note of this. Thank you for the help! [[User:Hakimi97|Hakimi97]] ([[User talk:Hakimi97|talk]]) 02:37, 2 April 2026 (UTC) == externalLink on Oskar_Rózsa at skwiki == Je to v sekcií "Externé odkazy". Treba asi vyladiť filter. [[User:JakubD47|JakubD47]] ([[User talk:JakubD47|talk]]) 10:21, 10 April 2026 (UTC) :@[[User:JakubD47|JakubD47]] Hi. My apologies for not replying in slovenčina. The community (admins) can ''and should'' change these settings! The feature is highly configurable, to fit local needs and nuances. Would you be willing to help request a change for the page [[w:sk:MediaWiki:Editcheck-config.json]]? Essentially, a local admin needs to update that page, using the content at [[Help:Suggestion mode#Create a local configuration page]] (but replacing those Spanish example heading-names, with slovenčina). If you'd prefer, I can try to write it in English on the talkpage there. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 17:27, 10 April 2026 (UTC) ::Hi, no worries. From what I gathered, that example you sent, but with the text in the JSON replaced with how the headings appear on skwiki? ::If yes, I can post in on that page's talkpage in Slovak. I thought I would be reporting it to skwiki admins, so I apologize for not typing it in English right away. [[User:JakubD47|JakubD47]] ([[User talk:JakubD47|talk]]) 06:33, 15 April 2026 (UTC) :::@[[User:JakubD47|JakubD47]] Yes, exactly. You'd just need to replace the Spanish examples with Slovak examples (and you or the admin/community could also add any additional headings that ought to be excluded from each type of suggestion). :::Plus, it would help to also ask the admin(s) to look at the other section in the help page ([[Help:Suggestion mode#Localize the links]]) about localizing the links that are within each type of suggestion, if Skwiki has local documentation about any of those details. :::Much thanks! [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 21:17, 15 April 2026 (UTC) == addReference on Tree_planting at enwiki == I added a citation and the message does not disappear. I added by using the citation tool [[User:John Cummings|John Cummings]] ([[User talk:John Cummings|talk]]) 11:54, 12 April 2026 (UTC) :@[[User:John Cummings|John Cummings]] Hi! Thanks for commenting. The message box should disappear, but only ''after'' we move/click our cursor into another paragraph/node. If I understand correctly, this is technically for performance reasons, to prevent it rechecking the content ''constantly'' as we type. I will mention it to the team as something that still causes confusion though. Cheers. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 21:28, 13 April 2026 (UTC) ::Hi {{u|Quiddity}}, I didn't realist that this comment would be added to a page and someone reply :) So I copied the text from my sandbox and then added the reference and after that the box showed up to say there was no reference. I think this is probably not a normal way of doing things and that's why it got confused. Thanks, [[User:John Cummings|John Cummings]] ([[User talk:John Cummings|talk]]) 02:33, 14 April 2026 (UTC) == yearLink on 東急2020系電車 at jawiki == Some of the links to railway vehicle types incorrectly display "yearLink". Some Japanese railway vehicle types are represented by four-digit numbers, and the editing check function may be mistakenly identifying links like "1000系 (series 1000)" as year links. [[User:Cookie4782|Cookie4782]] ([[User talk:Cookie4782|talk]]|[[Special:Contribute/Cookie4782|Contribute]]) 07:01, 22 April 2026 (UTC) :@[[User:Cookie4782|Cookie4782]] Thank you for the bug-report. The devs are working on this bug in [[phab:T422274|T422274]] ("False positive yearLink check"), and will probably just be making it simpler to only react to plain 4-digit year links, for now. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 22:00, 22 April 2026 (UTC) == requiredTemplateParam on XMM-Newton at frwiki == Il faudrait préciser quels paramètres sont manquants pour que le contributeur sache si cela constitue un véritable problème. It would be necessary to specify which parameters are missing so that the contributor knows if this constitutes a real problem without having to display all the parameters. [[User:Pline|Pline]] ([[User talk:Pline|talk]]) 11:13, 22 April 2026 (UTC) :@[[User:Pline|Pline]] Thank you for commenting, and the ideas of how to improve this suggestion type (and the good example of where it is not working well). That particular type is one of the experimental ones (see [https://fr.wikipedia.org/wiki/Sp%C3%A9cial:EditChecks?uselang=fr#:~:text=requiredTemplateParam the section it is within]), and is only available to users of the user-script version. Editors using the Beta Feature, or newcomers within the upcoming A/B test will not see those. I know that particular type still needs quite a bit of work before it's ready for full release. Thanks again, Merci. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 22:15, 22 April 2026 (UTC) == yearLink on Dhurandhar:_The_Revenge at enwiki == Was not a year link-was about rupees. [[User:User97104|User97104]] ([[User talk:User97104|talk]]) 23:35, 25 April 2026 (UTC) :Thank you for the bug-report. The devs are working on this bug in [[phab:T422274]] ("False positive yearLink check"), and will just be making it simpler to only react to plain 4-digit year links, for now. That fix should be live later this week. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 19:23, 27 April 2026 (UTC) == externalLink on Web_colors at enwiki == Not "external link", link to another Wikipedia page, just in URL format. [[User:User97104|User97104]] ([[User talk:User97104|talk]]) 23:44, 25 April 2026 (UTC) :@[[User:User97104|User97104]] Thank you for the report. :1. That instance within the article [[w:en:Web colors]] looks like it might be incorrectly setup, too, perhaps via a copy&paste mistake. I would ''assume'' that the "update" link is meant to lead to a cache-purge of the page it is on, not the page "[[w:en:Hexadecimal time]]" which is where it currently targets (and presumably is where it was copied from). :2. I believe both those pages ought to be using [[w:en:Template:Purge]] instead of a raw external link. I'll ping [[User:Kencf0618]] here as you might be interested in helping to fix both instances. (Context: You [https://en.wikipedia.org/w/index.php?title=Web_colors&diff=prev&oldid=1323007279 added] the version on the "Web colors" article.) :3. For the broader problem of links to local-articles that are misformatted as external-links, I will ask the devs to investigate possible solutions. :Thanks again. [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 20:04, 27 April 2026 (UTC) == tone on Lorem_ipsum at testwiki == Doesn't make sense-lorem ipsum text which has no meaning in any language so tone cannot be "revised" [[User:User97104|User97104]] ([[User talk:User97104|talk]]) 22:28, 2 May 2026 (UTC) :Hi. I'm not sure if you're joking? It's ''lorem ipsum'' text for an entire page, so of course it confuses the software! That page would never exist in a non-test Wikipedia's main-namespace. Many strange pages exist on testwiki. I hope those details help explain the situation. Cheers, [[User:Quiddity (WMF)|Quiddity (WMF)]] ([[User talk:Quiddity (WMF)|talk]]) 10:45, 4 May 2026 (UTC) 6ia35gwob7rfsvephimup86qu0xlslu MediaWiki Users and Developers Conference Fall 2026 0 2360433 8365111 8322992 2026-05-04T10:32:53Z Planetenxin 54990 /* Informal signup */ 8365111 wikitext text/x-wiki <languages/> <div style="float:right;" class="noprint"> {| class="infobox floatright noprint" style="width:280px; border:1px solid #8898bf; background-color:#ffffff" |- style="text-align:center; background:#164eaf; font-weight:bold;" | colspan="2" |<span style="color:#ffffff!important;">MediaWiki Users and Developers Conference Fall 2026</span> |- | colspan="2" |By and for the third-party MediaWiki community |- style="text-align:center; background:#164eaf; font-weight:bold;" | colspan="2" |<span style="color:#ffffff!important;">Conference Details |- style="vertical-align:top;" |Location: |Jožef Stefan Institute<br /> Ljubljana, Slovenia |- style="vertical-align:top;" |Start: |November 11 |- style="vertical-align:top;" |Finish: |November 13 |- style="vertical-align:top;" | |- style="vertical-align:top;" |Audience: |Administrators, Business, Academia, Developers, Community, MediaWiki Users |- style="vertical-align:top; text-align:center;" |Previous conference: {{ll|MediaWiki Users and Developers Conference Spring 2026}} |Next conference: {{ll|MediaWiki Users and Developers Conference Spring 2027}} |- style="text-align:center; background:#164eaf; font-weight:bold;" |} </div> The '''{{ll|MediaWiki Users and Developers Conference}}, Fall 2026''' will be held November 11-13, 2026, at Jožef Stefan Institute in Ljubljana, Slovenia. The MediaWiki Users and Developers Conference (MUDCon) is a three-day conference featuring discussions of topics related to the usage of MediaWiki software by and within companies, non-profits, governments, organizations, and communities. == Informal signup == If you are interested in attending the conference, feel free to add your name below. # Bernhard Krabina # [[User:MyWikis-JeffreyWang|Jeffrey Wang]] # Alexander Gesinn <translate> == Event details == <!--T:1--> </translate> <!-- <mapframe text="FamilySearch Library" width="200" height="200" zoom="14" longitude="-111.89436045320406" latitude="40.77033662389152" align="left"> { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-82.64214510292443, 41.359337466964725] }, } </mapframe> --> * '''Dates:''' November 11-13, 2026 * '''Location:''' Jožef Stefan Institute, Ljubljana, Slovenia == Registration == Is this your '''first time attending''' a MediaWiki Users and Developers Conference? Read the [[MediaWiki Users and Developers Conference/FAQ|FAQ]] for more information! Registration and purchase of a conference ticket is required for in-person attendance. == Accommodations and transportation == === Local accommodations === TBA === Ground transportation === TBA == Program == To be announced. == Social events == Social events will be announced by the Social Chair. == Scholarships == The MediaWiki Stakeholders' Group will offer scholarships for both in-person attendance and mobile data (for qualifying circumstances). Depending on availability of funds and merit of the applicants, scholarships will be awarded to a certain number of applicants. In-person scholarships cover the cost of a conference ticket. Mobile data scholarships cover the reasonable costs of paying for mobile data to watch the conference. Scholarships must be applied for. Applications will be reviewed by the MediaWiki Stakeholders' Group's scholarships committee, which is appointed by the MWStake Board of Directors. For more information, please see [[MediaWiki Users and Developers Conference/Scholarships]]. == Sponsorship == The conference would not be possible without the financial support provided by our generous sponsors. The levels of sponsorship will become available soon. == Visa assistance == The conference will provide affidavits for attendees who need to apply for a visitor visa at the relevant country's consulate. You may contact the Social Chair to request this affidavit. For further information, please see the [[MediaWiki Users and Developers Conference/International travel|conference's international travel]] page. 17bfrhdakk8z8x2u9i41b8humn0df4m MediaWiki Users and Developers Conference Fall 2026/en 0 2360671 8365140 8323011 2026-05-04T11:45:01Z FuzzyBot 451990 Updating to match new version of source page 8365140 wikitext text/x-wiki <languages/> <div style="float:right;" class="noprint"> {| class="infobox floatright noprint" style="width:280px; border:1px solid #8898bf; background-color:#ffffff" |- style="text-align:center; background:#164eaf; font-weight:bold;" | colspan="2" |<span style="color:#ffffff!important;">MediaWiki Users and Developers Conference Fall 2026</span> |- | colspan="2" |By and for the third-party MediaWiki community |- style="text-align:center; background:#164eaf; font-weight:bold;" | colspan="2" |<span style="color:#ffffff!important;">Conference Details |- style="vertical-align:top;" |Location: |Jožef Stefan Institute<br /> Ljubljana, Slovenia |- style="vertical-align:top;" |Start: |November 11 |- style="vertical-align:top;" |Finish: |November 13 |- style="vertical-align:top;" | |- style="vertical-align:top;" |Audience: |Administrators, Business, Academia, Developers, Community, MediaWiki Users |- style="vertical-align:top; text-align:center;" |Previous conference: {{ll|MediaWiki Users and Developers Conference Spring 2026}} |Next conference: {{ll|MediaWiki Users and Developers Conference Spring 2027}} |- style="text-align:center; background:#164eaf; font-weight:bold;" |} </div> The '''{{ll|MediaWiki Users and Developers Conference}}, Fall 2026''' will be held November 11-13, 2026, at Jožef Stefan Institute in Ljubljana, Slovenia. The MediaWiki Users and Developers Conference (MUDCon) is a three-day conference featuring discussions of topics related to the usage of MediaWiki software by and within companies, non-profits, governments, organizations, and communities. == Informal signup == If you are interested in attending the conference, feel free to add your name below. # Bernhard Krabina # [[User:MyWikis-JeffreyWang|Jeffrey Wang]] # Alexander Gesinn == Event details == <!-- <mapframe text="FamilySearch Library" width="200" height="200" zoom="14" longitude="-111.89436045320406" latitude="40.77033662389152" align="left"> { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-82.64214510292443, 41.359337466964725] }, } </mapframe> --> * '''Dates:''' November 11-13, 2026 * '''Location:''' Jožef Stefan Institute, Ljubljana, Slovenia == Registration == Is this your '''first time attending''' a MediaWiki Users and Developers Conference? Read the [[MediaWiki Users and Developers Conference/FAQ|FAQ]] for more information! Registration and purchase of a conference ticket is required for in-person attendance. == Accommodations and transportation == === Local accommodations === TBA === Ground transportation === TBA == Program == To be announced. == Social events == Social events will be announced by the Social Chair. == Scholarships == The MediaWiki Stakeholders' Group will offer scholarships for both in-person attendance and mobile data (for qualifying circumstances). Depending on availability of funds and merit of the applicants, scholarships will be awarded to a certain number of applicants. In-person scholarships cover the cost of a conference ticket. Mobile data scholarships cover the reasonable costs of paying for mobile data to watch the conference. Scholarships must be applied for. Applications will be reviewed by the MediaWiki Stakeholders' Group's scholarships committee, which is appointed by the MWStake Board of Directors. For more information, please see [[MediaWiki Users and Developers Conference/Scholarships]]. == Sponsorship == The conference would not be possible without the financial support provided by our generous sponsors. The levels of sponsorship will become available soon. == Visa assistance == The conference will provide affidavits for attendees who need to apply for a visitor visa at the relevant country's consulate. You may contact the Social Chair to request this affidavit. For further information, please see the [[MediaWiki Users and Developers Conference/International travel|conference's international travel]] page. 083xonpypjhlkuv11887cjj4mczqw34 Translations:Help:Extension:WikiEditor/Realtime Preview/5/cs 1198 2363570 8364437 8227904 2026-05-03T15:30:23Z Rebulka 17532855 8364437 wikitext text/x-wiki V poli $1 vyhledejte preference "$2" a "$3". oxb9lewnftn7s55rdqpigkx2tq5buva Article guidance/Pilot wikis and collaborators/ar 0 2365820 8364749 8363800 2026-05-03T21:29:46Z FuzzyBot 451990 Updating to match new version of source page 8364749 wikitext text/x-wiki <languages/> اختيرت مواقع ويكيبيديا التالية مجتمعاتٍ محتملةٍ نرغب بالتعاون معها لتطوير هذا التدخل واختباره. ويستند هذا الاختيار إلى [[phab:T414448|المعايير الموضحة في هذه الصفحة]]. نحن منفتحون على التعاون مع مواقع ويكيبيديا الأخرى الراغبة في العمل معنا. * {{int|project-localized-name-arwiki}} [ar] * {{int|project-localized-name-bnwiki}} [bn] * {{int|project-localized-name-eswiki}} [es] * {{int|project-localized-name-fawiki}} [fa] * {{int|project-localized-name-frwiki}} [fr] * {{int|project-localized-name-jawiki}} [ja] * {{int|project-localized-name-ptwiki}} [pt] * {{int|project-localized-name-simplewiki}} [simple] * {{int|project-localized-name-trwiki}} [tr] <span id="Collaborators"></span> === المتعاونون === إذا كنت محررًا خبيرًا أو لديك صلاحيات إدارية وترغب في التعاون معنا، فيرجى إضافة اسم المستخدم الخاص بك أدناه ونسخة ويكيبيديا الخاص بك للتسجيل وتقديم ملاحظاتك واختبار تدخل إرشاد المقالة. * '''Chinese Wikipedia''' --[[User:SCP-2000|SCP-2000]] ([[User talk:SCP-2000|talk]]) 03:22, 12 February 2026 (UTC) * '''Turkish Wikipedia''' --[[User:Nabbegat|Nabbegat]] ([[User talk:Nabbegat|talk]]) 06:29, 12 February 2026 (UTC) * '''Turkish Wikipedia''' --[[User:Zafer|Zafer]] ([[User talk:Zafer|talk]]) 06:41, 13 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:Yahya|Yahya]] ([[User talk:Yahya|talk]]) 19:36, 14 February 2026 (UTC) * '''Japanese Wikipedia''' --[[User:さえぼー|さえぼー]] ([[User talk:さえぼー|talk]]) 06:00, 20 February 2026 (UTC), * '''Bangla Wikipedia''' --[[User:R1F4T|R1F4T]] ([[User talk:R1F4T|talk]]) 09:44, 20 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Mohammed Qays|Mohammed Qays]] ([[User talk:Mohammed Qays|talk]]) 10:58, 20 February 2026 (UTC) * '''Arabic Wikipedia''' '''--'''[[User:علاء |<span style="font-size: 12pt; font-family: Script MT Bold; color:black;">Alaa</span> ]] [[User_talk:علاء |:)..!]] 11:01, 20 February 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Little Sunshine|Little Sunshine]] ([[User talk:Little Sunshine|talk]]) 19:07, 20 February 2026 (UTC) * '''Igbo Wikipedia''' --[[User: Onyinyeonuoha|Onyinye Jane Achukwu]] ([[User talk: Onyinyeonuoha|talk]]) 07:11, 20 February 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Victor Lopes|Victor Lopes]] ([[User talk:Victor Lopes|talk]]) 14:25, 23 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Mr. Ibrahem|Mr. Ibrahem]] ([[User talk:Mr. Ibrahem|talk]]) 04:00, 24 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:Tausheef Hassan|Tausheef Hassan]] ([[User talk:Tausheef Hassan|talk]]) 14:59, 24 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:ARI|ARI]] ([[User talk:ARI|talk]]) 05:57, 25 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Nehaoua|Nehaoua]] ([[User talk:Nehaoua|talk]]) 20:52, 27 February 2026 (UTC) * '''English Wikipedia''' --[[User:Kudpung|Kudpung]] ([[User talk:Kudpung|talk]]) 01:37, 1 March 2026 (UTC) * '''Azerbaijani Wikipedia''' [[User:Nemoralis|Nemoralis]] ([[User talk:Nemoralis|talk]]) 12:01, 2 March 2026 (UTC) * '''Arabic Wikipedia'''--[[User:Osps7|Osps7]] ([[User talk:Osps7|talk]]) 23:09, 3 March 2026 (UTC) * '''Arabic Wikipedia''' '''-''' [[User:رِفْد|رِفْد]] ([[User talk:رِفْد|talk]]) 03:26, 6 March 2026 (UTC) * '''Serbo-Croatian Wikipedia''' – [[User:Vipz|Vipz]] ([[User talk:Vipz|talk]]) 01:11, 10 March 2026 (UTC) * '''Bangla Wikipedia''' - [[User:MS Sakib|MS Sakib]] ([[User talk:MS Sakib|talk]]) 16:36, 15 March 2026 (UTC) * '''English Wikipedia''' – [[User:Toadspike|Toadspike]] ([[User talk:Toadspike|talk]]) 23:08, 17 March 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Arcstur|Arcstur]] ([[User talk:Arcstur|talk]]) 15:54, 14 April 2026 (UTC) * '''Arabic Wikipedia''' '''-''' --[[User:Dezedien|Dezedien]] ([[User talk:Dezedien|talk]]) 22:03, 29 April 2026 (UTC) * '''Arabic Wikipedia''' '''-''' [[User:ToadetteEdit|ToadetteEdit]] ([[User talk:ToadetteEdit|talk]]) 13:53, 3 May 2026 (UTC) 7v7zf7248anl4zgqzmsr3plg9la58p6 Article guidance/Pilot wikis and collaborators/pt 0 2366989 8364752 8363803 2026-05-03T21:29:48Z FuzzyBot 451990 Updating to match new version of source page 8364752 wikitext text/x-wiki <languages/> As seguintes Wikipédias foram selecionadas como comunidades potenciais com as quais queremos trabalhar para desenvolver e testar essa intervenção. A seleção é baseada em [[phab:T414448|os critérios mostrados nesta página]]. Estamos abertos a colaborar com outras Wikipédias que queiram trabalhar conosco. * {{int|project-localized-name-arwiki}} [ar] * {{int|project-localized-name-bnwiki}} [bn] * {{int|project-localized-name-eswiki}} [es] * {{int|project-localized-name-fawiki}} [fa] * {{int|project-localized-name-frwiki}} [fr] * {{int|project-localized-name-jawiki}} [ja] * {{int|project-localized-name-ptwiki}} [pt] * {{int|project-localized-name-simplewiki}} [simple] * {{int|project-localized-name-trwiki}} [tr] <span id="Collaborators"></span> === Colaborações === Se você é um editor experiente ou tem direitos de administrador e está interessado em trabalhar conosco, por favor, adicione o seu nome de usuário abaixo e a sua edição da Wikipedia para se inscrever para fornecer informações e testar a intervenção de orientação do artigo. * '''Chinese Wikipedia''' --[[User:SCP-2000|SCP-2000]] ([[User talk:SCP-2000|talk]]) 03:22, 12 February 2026 (UTC) * '''Turkish Wikipedia''' --[[User:Nabbegat|Nabbegat]] ([[User talk:Nabbegat|talk]]) 06:29, 12 February 2026 (UTC) * '''Turkish Wikipedia''' --[[User:Zafer|Zafer]] ([[User talk:Zafer|talk]]) 06:41, 13 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:Yahya|Yahya]] ([[User talk:Yahya|talk]]) 19:36, 14 February 2026 (UTC) * '''Japanese Wikipedia''' --[[User:さえぼー|さえぼー]] ([[User talk:さえぼー|talk]]) 06:00, 20 February 2026 (UTC), * '''Bangla Wikipedia''' --[[User:R1F4T|R1F4T]] ([[User talk:R1F4T|talk]]) 09:44, 20 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Mohammed Qays|Mohammed Qays]] ([[User talk:Mohammed Qays|talk]]) 10:58, 20 February 2026 (UTC) * '''Arabic Wikipedia''' '''--'''[[User:علاء |<span style="font-size: 12pt; font-family: Script MT Bold; color:black;">Alaa</span> ]] [[User_talk:علاء |:)..!]] 11:01, 20 February 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Little Sunshine|Little Sunshine]] ([[User talk:Little Sunshine|talk]]) 19:07, 20 February 2026 (UTC) * '''Igbo Wikipedia''' --[[User: Onyinyeonuoha|Onyinye Jane Achukwu]] ([[User talk: Onyinyeonuoha|talk]]) 07:11, 20 February 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Victor Lopes|Victor Lopes]] ([[User talk:Victor Lopes|talk]]) 14:25, 23 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Mr. Ibrahem|Mr. Ibrahem]] ([[User talk:Mr. Ibrahem|talk]]) 04:00, 24 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:Tausheef Hassan|Tausheef Hassan]] ([[User talk:Tausheef Hassan|talk]]) 14:59, 24 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:ARI|ARI]] ([[User talk:ARI|talk]]) 05:57, 25 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Nehaoua|Nehaoua]] ([[User talk:Nehaoua|talk]]) 20:52, 27 February 2026 (UTC) * '''English Wikipedia''' --[[User:Kudpung|Kudpung]] ([[User talk:Kudpung|talk]]) 01:37, 1 March 2026 (UTC) * '''Azerbaijani Wikipedia''' [[User:Nemoralis|Nemoralis]] ([[User talk:Nemoralis|talk]]) 12:01, 2 March 2026 (UTC) * '''Arabic Wikipedia'''--[[User:Osps7|Osps7]] ([[User talk:Osps7|talk]]) 23:09, 3 March 2026 (UTC) * '''Arabic Wikipedia''' '''-''' [[User:رِفْد|رِفْد]] ([[User talk:رِفْد|talk]]) 03:26, 6 March 2026 (UTC) * '''Serbo-Croatian Wikipedia''' – [[User:Vipz|Vipz]] ([[User talk:Vipz|talk]]) 01:11, 10 March 2026 (UTC) * '''Bangla Wikipedia''' - [[User:MS Sakib|MS Sakib]] ([[User talk:MS Sakib|talk]]) 16:36, 15 March 2026 (UTC) * '''English Wikipedia''' – [[User:Toadspike|Toadspike]] ([[User talk:Toadspike|talk]]) 23:08, 17 March 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Arcstur|Arcstur]] ([[User talk:Arcstur|talk]]) 15:54, 14 April 2026 (UTC) * '''Arabic Wikipedia''' '''-''' --[[User:Dezedien|Dezedien]] ([[User talk:Dezedien|talk]]) 22:03, 29 April 2026 (UTC) * '''Arabic Wikipedia''' '''-''' [[User:ToadetteEdit|ToadetteEdit]] ([[User talk:ToadetteEdit|talk]]) 13:53, 3 May 2026 (UTC) 0em7rn6z7q5x7onayiszrvutpt4z7xy MediaWiki Users and Developers Conference Fall 2026/id 0 2367964 8365139 8323012 2026-05-04T11:45:01Z FuzzyBot 451990 Updating to match new version of source page 8365139 wikitext text/x-wiki <languages/> <div style="float:right;" class="noprint"> {| class="infobox floatright noprint" style="width:280px; border:1px solid #8898bf; background-color:#ffffff" |- style="text-align:center; background:#164eaf; font-weight:bold;" | colspan="2" |<span style="color:#ffffff!important;">MediaWiki Users and Developers Conference Fall 2026</span> |- | colspan="2" |By and for the third-party MediaWiki community |- style="text-align:center; background:#164eaf; font-weight:bold;" | colspan="2" |<span style="color:#ffffff!important;">Conference Details |- style="vertical-align:top;" |Location: |Jožef Stefan Institute<br /> Ljubljana, Slovenia |- style="vertical-align:top;" |Start: |November 11 |- style="vertical-align:top;" |Finish: |November 13 |- style="vertical-align:top;" | |- style="vertical-align:top;" |Audience: |Administrators, Business, Academia, Developers, Community, MediaWiki Users |- style="vertical-align:top; text-align:center;" |Previous conference: {{ll|MediaWiki Users and Developers Conference Spring 2026}} |Next conference: {{ll|MediaWiki Users and Developers Conference Spring 2027}} |- style="text-align:center; background:#164eaf; font-weight:bold;" |} </div> The '''{{ll|MediaWiki Users and Developers Conference}}, Fall 2026''' will be held November 11-13, 2026, at Jožef Stefan Institute in Ljubljana, Slovenia. The MediaWiki Users and Developers Conference (MUDCon) is a three-day conference featuring discussions of topics related to the usage of MediaWiki software by and within companies, non-profits, governments, organizations, and communities. == Informal signup == If you are interested in attending the conference, feel free to add your name below. # Bernhard Krabina # [[User:MyWikis-JeffreyWang|Jeffrey Wang]] # Alexander Gesinn <span id="Event_details"></span> == Rincian acara == <!-- <mapframe text="FamilySearch Library" width="200" height="200" zoom="14" longitude="-111.89436045320406" latitude="40.77033662389152" align="left"> { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-82.64214510292443, 41.359337466964725] }, } </mapframe> --> * '''Dates:''' November 11-13, 2026 * '''Location:''' Jožef Stefan Institute, Ljubljana, Slovenia == Registration == Is this your '''first time attending''' a MediaWiki Users and Developers Conference? Read the [[MediaWiki Users and Developers Conference/FAQ|FAQ]] for more information! Registration and purchase of a conference ticket is required for in-person attendance. == Accommodations and transportation == === Local accommodations === TBA === Ground transportation === TBA == Program == To be announced. == Social events == Social events will be announced by the Social Chair. == Scholarships == The MediaWiki Stakeholders' Group will offer scholarships for both in-person attendance and mobile data (for qualifying circumstances). Depending on availability of funds and merit of the applicants, scholarships will be awarded to a certain number of applicants. In-person scholarships cover the cost of a conference ticket. Mobile data scholarships cover the reasonable costs of paying for mobile data to watch the conference. Scholarships must be applied for. Applications will be reviewed by the MediaWiki Stakeholders' Group's scholarships committee, which is appointed by the MWStake Board of Directors. For more information, please see [[MediaWiki Users and Developers Conference/Scholarships]]. == Sponsorship == The conference would not be possible without the financial support provided by our generous sponsors. The levels of sponsorship will become available soon. == Visa assistance == The conference will provide affidavits for attendees who need to apply for a visitor visa at the relevant country's consulate. You may contact the Social Chair to request this affidavit. For further information, please see the [[MediaWiki Users and Developers Conference/International travel|conference's international travel]] page. o2wn9hbq6inbh44gkm2gvg46e250jyd Article guidance/Pilot wikis and collaborators/ja 0 2368368 8364751 8363802 2026-05-03T21:29:48Z FuzzyBot 451990 Updating to match new version of source page 8364751 wikitext text/x-wiki <languages/> 以下のウィキペディアは、この介入策の開発と試用で協働する可能性のあるコミュニティとして選びました。選定にあたり[[phab:T414448|このページに記載された基準]]を下敷きにしています。 私たちは、協力したいと考えている他のウィキペディアとの協働に前向きです。 * {{int|project-localized-name-arwiki}} [ar] * {{int|project-localized-name-bnwiki}} [bn] * {{int|project-localized-name-eswiki}} [es] * {{int|project-localized-name-fawiki}} [fa] * {{int|project-localized-name-frwiki}} [fr] * {{int|project-localized-name-jawiki}} [ja] * {{int|project-localized-name-ptwiki}} [pt] * {{int|project-localized-name-simplewiki}} [simple] * {{int|project-localized-name-trwiki}} [tr] <span id="Collaborators"></span> === 協力者 === 経験豊富な編集者であるかまたは管理者権限を持っており、私たちとの協働に関心がある場合は、記事ガイダンス介入に対して意見を提供しテストに参加するため、以下に利用者名とあなたのウィキペディアの版 (言語) を追加してください。 * '''Chinese Wikipedia''' --[[User:SCP-2000|SCP-2000]] ([[User talk:SCP-2000|talk]]) 03:22, 12 February 2026 (UTC) * '''Turkish Wikipedia''' --[[User:Nabbegat|Nabbegat]] ([[User talk:Nabbegat|talk]]) 06:29, 12 February 2026 (UTC) * '''Turkish Wikipedia''' --[[User:Zafer|Zafer]] ([[User talk:Zafer|talk]]) 06:41, 13 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:Yahya|Yahya]] ([[User talk:Yahya|talk]]) 19:36, 14 February 2026 (UTC) * '''Japanese Wikipedia''' --[[User:さえぼー|さえぼー]] ([[User talk:さえぼー|talk]]) 06:00, 20 February 2026 (UTC), * '''Bangla Wikipedia''' --[[User:R1F4T|R1F4T]] ([[User talk:R1F4T|talk]]) 09:44, 20 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Mohammed Qays|Mohammed Qays]] ([[User talk:Mohammed Qays|talk]]) 10:58, 20 February 2026 (UTC) * '''Arabic Wikipedia''' '''--'''[[User:علاء |<span style="font-size: 12pt; font-family: Script MT Bold; color:black;">Alaa</span> ]] [[User_talk:علاء |:)..!]] 11:01, 20 February 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Little Sunshine|Little Sunshine]] ([[User talk:Little Sunshine|talk]]) 19:07, 20 February 2026 (UTC) * '''Igbo Wikipedia''' --[[User: Onyinyeonuoha|Onyinye Jane Achukwu]] ([[User talk: Onyinyeonuoha|talk]]) 07:11, 20 February 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Victor Lopes|Victor Lopes]] ([[User talk:Victor Lopes|talk]]) 14:25, 23 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Mr. Ibrahem|Mr. Ibrahem]] ([[User talk:Mr. Ibrahem|talk]]) 04:00, 24 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:Tausheef Hassan|Tausheef Hassan]] ([[User talk:Tausheef Hassan|talk]]) 14:59, 24 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:ARI|ARI]] ([[User talk:ARI|talk]]) 05:57, 25 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Nehaoua|Nehaoua]] ([[User talk:Nehaoua|talk]]) 20:52, 27 February 2026 (UTC) * '''English Wikipedia''' --[[User:Kudpung|Kudpung]] ([[User talk:Kudpung|talk]]) 01:37, 1 March 2026 (UTC) * '''Azerbaijani Wikipedia''' [[User:Nemoralis|Nemoralis]] ([[User talk:Nemoralis|talk]]) 12:01, 2 March 2026 (UTC) * '''Arabic Wikipedia'''--[[User:Osps7|Osps7]] ([[User talk:Osps7|talk]]) 23:09, 3 March 2026 (UTC) * '''Arabic Wikipedia''' '''-''' [[User:رِفْد|رِفْد]] ([[User talk:رِفْد|talk]]) 03:26, 6 March 2026 (UTC) * '''Serbo-Croatian Wikipedia''' – [[User:Vipz|Vipz]] ([[User talk:Vipz|talk]]) 01:11, 10 March 2026 (UTC) * '''Bangla Wikipedia''' - [[User:MS Sakib|MS Sakib]] ([[User talk:MS Sakib|talk]]) 16:36, 15 March 2026 (UTC) * '''English Wikipedia''' – [[User:Toadspike|Toadspike]] ([[User talk:Toadspike|talk]]) 23:08, 17 March 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Arcstur|Arcstur]] ([[User talk:Arcstur|talk]]) 15:54, 14 April 2026 (UTC) * '''Arabic Wikipedia''' '''-''' --[[User:Dezedien|Dezedien]] ([[User talk:Dezedien|talk]]) 22:03, 29 April 2026 (UTC) * '''Arabic Wikipedia''' '''-''' [[User:ToadetteEdit|ToadetteEdit]] ([[User talk:ToadetteEdit|talk]]) 13:53, 3 May 2026 (UTC) aostg36qeir640q9sle0ic8f21afqoz Talk:Language Onboarding and Development/Starter kit 1 2369668 8364744 8249614 2026-05-03T20:32:52Z Kambai Akau 13828735 /* Feedback on deploying the Starter kit on the Tyap Wikipedia */ new section 8364744 wikitext text/x-wiki Feedback and ideas for the Starter Kit are welcome on this talk page! == Feedback on deploying the Starter kit on the Tyap Wikipedia == Greetings, Language Onboarding and Developers! Here is my feedback: * Time taken: It took me days to configure and customize the Tyap Wikipedia's homepage initially ([https://kcg.wikipedia.org/wiki/Ta%E2%80%8C%CC%B1mpi%E2%80%8C%CC%B1let:A%CC%B1tsak_wat_wu_2 I am yet to finish it]) but with the starter kit, it took me just about an our to completely configure and customize [https://kcg.wikipedia.org/wiki/Main_Page the main page]. Had it been this was present a long time ago, one won't have stressed a lot in the past. * Discovery: What I discovered was that everything has been made so easy compared to whar one may find in the English Wikipedia or any other. They have been made for just anyone who wishes to deploy this kit to their Wikipedia with ease. * What more could be captured: Taking a look at [https://kcg.wikipedia.org/wiki/Ta%E2%80%8C%CC%B1mpi%E2%80%8C%CC%B1let:A%CC%B1tsak_wat_wu_2 the existing homepage] for the Tyap Wikipedia (which would soon be switched to the new), ** One would see [https://kcg.wikipedia.org/wiki/Ta%E2%80%8C%CC%B1mpi%E2%80%8C%CC%B1let:A%CC%B1tsak_wat_wu_2/khwuk_ati%CC%B1kut_a%CC%B1fai a box where new articles could be added] with ease, which could be added to the the starter kit. ** Another thing is that the Tyap Wikipedia finds it important to capture other Tyap dialects in its Wikipedia. Hence, at the middle of the header, one sees [https://kcg.wikipedia.org/wiki/Ta%E2%80%8C%CC%B1mpi%E2%80%8C%CC%B1let:A%CC%B1tsak_wat_wu_2/zw%C3%A1-a%CC%B1lyiat where Tyap dialects are represented], whose links would lead to categories related to the dialects (later on, there would be pages developed for each which would act as embassies for each of those dialects). We find this very important for our community's progress in language documentation and equal representation. * Confusion points: I never really felt stuck, confused, or unsure what to do next during the event of configuring and customizing the starter kit template because every thing see quite easy. The developers of this kit totally blow my mind, I must confess! Thank you!!! -- [[User:Kambai Akau|Kambai Akau]] ([[User talk:Kambai Akau|talk]]) 20:32, 3 May 2026 (UTC) 4p8udtm6134w76ohxz8vs0n7g0jymul 8364745 8364744 2026-05-03T20:36:35Z Kambai Akau 13828735 8364745 wikitext text/x-wiki Feedback and ideas for the Starter Kit are welcome on this talk page! == Feedback on deploying the Starter kit on the Tyap Wikipedia == Greetings, Language Onboarding and Developers! Here is my feedback: * Time taken: It took me days to configure and customize the Tyap Wikipedia's homepage initially ([https://kcg.wikipedia.org/wiki/Ta%E2%80%8C%CC%B1mpi%E2%80%8C%CC%B1let:A%CC%B1tsak_wat_wu_2 I am yet to finish it]), but with the starter kit, it took me just about an hour to completely configure and customize [https://kcg.wikipedia.org/wiki/Main_Page the main page]. Had this been present a long time ago, one wouldn't have stressed a lot in the past. * Discovery: What I discovered was that everything has been made so easy compared to what one may find in the English Wikipedia or any other. They have been made for just anyone who wishes to deploy this kit to their Wikipedia with ease. * What more could be captured: Taking a look at [https://kcg.wikipedia.org/wiki/Ta%E2%80%8C%CC%B1mpi%E2%80%8C%CC%B1let:A%CC%B1tsak_wat_wu_2 the existing homepage] for the Tyap Wikipedia (which would soon be switched to the new), ** One would see [https://kcg.wikipedia.org/wiki/Ta%E2%80%8C%CC%B1mpi%E2%80%8C%CC%B1let:A%CC%B1tsak_wat_wu_2/khwuk_ati%CC%B1kut_a%CC%B1fai a box where new articles could be added] with ease, which could be added to the starter kit. ** Another thing is that the Tyap Wikipedia finds it important to capture other Tyap dialects in its Wikipedia. Hence, in the middle of the header, one sees [https://kcg.wikipedia.org/wiki/Ta%E2%80%8C%CC%B1mpi%E2%80%8C%CC%B1let:A%CC%B1tsak_wat_wu_2/zw%C3%A1-a%CC%B1lyiat where Tyap dialects are represented], whose links would lead to categories related to the dialects (later on, there would be pages developed for each, which would act as embassies for each of those dialects). We find this very important for our community's progress in language documentation and equal representation. * Confusion points: I never really felt stuck, confused, or unsure about what to do next during the event of configuring and customizing the starter kit template because everything seemed quite easy. The only place where I didn't know what to do was when I was earlier trying to deploy the same in the Jju Wikipedia and could not, but @[[User:UOzurumba (WMF)|UOzurumba (WMF)]] explained to me that I had to have admin rights to do so. Hence, I decided to go over to the Tyap Wikipedia, where I have admin rights, and it worked! The developers of this kit totally blow my mind, I must confess. Thank you!!! -- [[User:Kambai Akau|Kambai Akau]] ([[User talk:Kambai Akau|talk]]) 20:32, 3 May 2026 (UTC) 7c6xyf0ih1y9lqnpfwp1qtwiu50m5l0 Talk:Wikimedia Language and Product Localization/ULS Rewrite 1 2370804 8364746 8362964 2026-05-03T20:50:00Z Michael21107 17806963 /* "Missing in English" on English Wikipedia */ new section 8364746 wikitext text/x-wiki == Pinning languages wish == {{Tracked|T416512}} Please see [[m:Community Wishlist/W507|Wish507: Enable the user to 'pin' preferred languages (for switching language easily)]]. {{ping|SGrabarczuk (WMF)|Nikerabbit}} Thanks, [[User:Prototyperspective|Prototyperspective]] ([[User talk:Prototyperspective|talk]]) 10:54, 28 February 2026 (UTC) :The feature request to be able to pin suggested languages is in our plans for the rewrite project. [[User:Nikerabbit|Nikerabbit]] ([[User talk:Nikerabbit|talk]]) 12:41, 2 March 2026 (UTC) == Popup is still too small == There are more than 300 Wikipedia languages, so it makes zero sense that even in a rewritten version you can still see at most 3 columns and at most 18 languages per scroll. There is zero reason to believe that if the window was bigger and showed more info at the first glance, as well as required less scrolling in general, that this would be detrimental to the readers. Please figure out how to show more info in the desktop interface since that's what desktop interfaces are actually for. Obviously that can be dependent on a relevant window size, for instance, via <code>vh</code>/<code>vw</code> CSS units. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 15:47, 13 April 2026 (UTC) :Thanks for the feedback. I've added this as input to our design review. [[User:Nikerabbit|Nikerabbit]] ([[User talk:Nikerabbit|talk]]) 10:24, 14 April 2026 (UTC) == Multiple problems == 1) The settings button overlaps with the scrollbar, if I try to select the scrollbar in the bottom, I click on the settings button instead 2) Abstract Wikipedia appears in the language list, and without label. (Example: open https://de.wikipedia.org/wiki/Deutschland, click on 314 languages, take a look at the second entry under "All languages", it has an empty label and leads to https://abstract.wikipedia.org/wiki/Q183). Abstract Wikipedia shouldn't appear in the language menu at all, it should rather appear in "In other projects" (and even there only if it's out of beta) 3) When opening the "Language settings" with German display language, on "Display language" the entry "American English" is suggested, if I click on it and "Apply settings" the display language stays German. [[User:CennoxX|CennoxX]] ([[User talk:CennoxX|talk]]) 08:38, 15 April 2026 (UTC) :Thanks for the feedback. :1) We are aware of this and are exploring solutions. :2) We'll look into this. I do note that it also appears without ULS like in https://de.wikipedia.org/wiki/Deutschland?useskin=timeless :3) We haven't touched this part of the code, and I am not able to reproduce this. Can you give more details? [[User:Nikerabbit|Nikerabbit]] ([[User talk:Nikerabbit|talk]]) 08:49, 15 April 2026 (UTC) :The Abstract Wikipedia team has resolved the issue number 2. [[User:Nikerabbit|Nikerabbit]] ([[User talk:Nikerabbit|talk]]) 06:49, 20 April 2026 (UTC) 3) Probably the suggested languages rely on some parameters, that are not the same between us. What happens when you select German as "Display language", then open the [...]-button from the display languages and select American English? For me the interface stays German. 4) The "Search languages" field is not focused if I open it first, if I close and reopen again, it is focused. 5) Sometimes (if the article is long) the Language list doesn't open on first click. 6) The hovered gray area under the language stays, even if I left the clickable label with my cursor. This is especially noticable when there are many languages, like on https://de.wikipedia.org/wiki/Deutschland. So if I not pay attention to the cursor changing from hand to pointer, I'll think I can still click on the language. If more information are needed, I'm open to connect via Teams etc.--[[User:CennoxX|CennoxX]] ([[User talk:CennoxX|talk]]) 09:05, 15 April 2026 (UTC) :3) I am still unable to reproduce this. The dialog language changes immediately regardless whether I choose from the suggested languages or via the ... dialog. Maybe it has something to do with the initial state you have. :4) A fix for this should go out this week :5) We'll monitor this. Might be that the code that listens for the click hasn't loaded yet. The number of links shouldn't affect this though if that is the case. :6) I can see this too. I have added this to our internal design review document to explore. [[User:Nikerabbit|Nikerabbit]] ([[User talk:Nikerabbit|talk]]) 12:42, 15 April 2026 (UTC) ::Here is an recording that shows multiple errors including (3) https://i.imgur.com/dz0RJuW.gif [[User:CennoxX|CennoxX]] ([[User talk:CennoxX|talk]]) 14:56, 16 April 2026 (UTC) :::Thanks for the video. It's helpful. :::3) Now I able to identify that this issue is https://phabricator.wikimedia.org/T355023 (which also affects previous ULS) :::4) Given there are no deployments this week, we have to wait for one more week for the fix to go live. :::6) This is being fixed and if the fix is ready in time, it will also go live next week. [[User:Nikerabbit|Nikerabbit]] ([[User talk:Nikerabbit|talk]]) 12:03, 21 April 2026 (UTC) == Logic Error in ULS Rewrite: "Not available" message shown for Chinese variants on Chinese Wikipedia == I encountered a logical inconsistency while testing the new ULS Rewrite on Chinese Wikipedia. When using the Language Selector, the search interface displays a message stating that "Chinese (Taiwan)" and "Chinese" are not available, despite the fact that I am currently on a Chinese Wikipedia page. Steps to reproduce: # Go to any article or talk page on Chinese Wikipedia. # Open the new ULS Language Selector. Actual Results: The UI shows a message: ''"尚無中文 (臺灣)、中文以及更多語言的版本"'' (Version for Chinese (Taiwan), Chinese, and more languages is not available). This is confusing for users as it implies a lack of support for the language they are currently reading. [[User:Addonian1123|Addonian1123]] ([[User talk:Addonian1123|talk]]) 13:17, 2 May 2026 (UTC) :Screenshot: [[:File:New language selector problem 20260502.png]] [[User:Addonian1123|Addonian1123]] ([[User talk:Addonian1123|talk]]) 13:25, 2 May 2026 (UTC) == "Missing in English" on English Wikipedia == On the English Wikipedia's article [[w:Corn_starch|Corn starch]], the language selector header says that the page is missing, among other languages, in English. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 20:50, 3 May 2026 (UTC) a1b318p02tg5vf5flvh71ay2u7hrz5r 8365090 8364746 2026-05-04T09:13:58Z Nikerabbit 24 /* "Missing in English" on English Wikipedia */ Reply 8365090 wikitext text/x-wiki == Pinning languages wish == {{Tracked|T416512}} Please see [[m:Community Wishlist/W507|Wish507: Enable the user to 'pin' preferred languages (for switching language easily)]]. {{ping|SGrabarczuk (WMF)|Nikerabbit}} Thanks, [[User:Prototyperspective|Prototyperspective]] ([[User talk:Prototyperspective|talk]]) 10:54, 28 February 2026 (UTC) :The feature request to be able to pin suggested languages is in our plans for the rewrite project. [[User:Nikerabbit|Nikerabbit]] ([[User talk:Nikerabbit|talk]]) 12:41, 2 March 2026 (UTC) == Popup is still too small == There are more than 300 Wikipedia languages, so it makes zero sense that even in a rewritten version you can still see at most 3 columns and at most 18 languages per scroll. There is zero reason to believe that if the window was bigger and showed more info at the first glance, as well as required less scrolling in general, that this would be detrimental to the readers. Please figure out how to show more info in the desktop interface since that's what desktop interfaces are actually for. Obviously that can be dependent on a relevant window size, for instance, via <code>vh</code>/<code>vw</code> CSS units. [[user:stjn|stjn]]<sup>[[:w:ru:user:stjn|[ru]]]</sup> 15:47, 13 April 2026 (UTC) :Thanks for the feedback. I've added this as input to our design review. [[User:Nikerabbit|Nikerabbit]] ([[User talk:Nikerabbit|talk]]) 10:24, 14 April 2026 (UTC) == Multiple problems == 1) The settings button overlaps with the scrollbar, if I try to select the scrollbar in the bottom, I click on the settings button instead 2) Abstract Wikipedia appears in the language list, and without label. (Example: open https://de.wikipedia.org/wiki/Deutschland, click on 314 languages, take a look at the second entry under "All languages", it has an empty label and leads to https://abstract.wikipedia.org/wiki/Q183). Abstract Wikipedia shouldn't appear in the language menu at all, it should rather appear in "In other projects" (and even there only if it's out of beta) 3) When opening the "Language settings" with German display language, on "Display language" the entry "American English" is suggested, if I click on it and "Apply settings" the display language stays German. [[User:CennoxX|CennoxX]] ([[User talk:CennoxX|talk]]) 08:38, 15 April 2026 (UTC) :Thanks for the feedback. :1) We are aware of this and are exploring solutions. :2) We'll look into this. I do note that it also appears without ULS like in https://de.wikipedia.org/wiki/Deutschland?useskin=timeless :3) We haven't touched this part of the code, and I am not able to reproduce this. Can you give more details? [[User:Nikerabbit|Nikerabbit]] ([[User talk:Nikerabbit|talk]]) 08:49, 15 April 2026 (UTC) :The Abstract Wikipedia team has resolved the issue number 2. [[User:Nikerabbit|Nikerabbit]] ([[User talk:Nikerabbit|talk]]) 06:49, 20 April 2026 (UTC) 3) Probably the suggested languages rely on some parameters, that are not the same between us. What happens when you select German as "Display language", then open the [...]-button from the display languages and select American English? For me the interface stays German. 4) The "Search languages" field is not focused if I open it first, if I close and reopen again, it is focused. 5) Sometimes (if the article is long) the Language list doesn't open on first click. 6) The hovered gray area under the language stays, even if I left the clickable label with my cursor. This is especially noticable when there are many languages, like on https://de.wikipedia.org/wiki/Deutschland. So if I not pay attention to the cursor changing from hand to pointer, I'll think I can still click on the language. If more information are needed, I'm open to connect via Teams etc.--[[User:CennoxX|CennoxX]] ([[User talk:CennoxX|talk]]) 09:05, 15 April 2026 (UTC) :3) I am still unable to reproduce this. The dialog language changes immediately regardless whether I choose from the suggested languages or via the ... dialog. Maybe it has something to do with the initial state you have. :4) A fix for this should go out this week :5) We'll monitor this. Might be that the code that listens for the click hasn't loaded yet. The number of links shouldn't affect this though if that is the case. :6) I can see this too. I have added this to our internal design review document to explore. [[User:Nikerabbit|Nikerabbit]] ([[User talk:Nikerabbit|talk]]) 12:42, 15 April 2026 (UTC) ::Here is an recording that shows multiple errors including (3) https://i.imgur.com/dz0RJuW.gif [[User:CennoxX|CennoxX]] ([[User talk:CennoxX|talk]]) 14:56, 16 April 2026 (UTC) :::Thanks for the video. It's helpful. :::3) Now I able to identify that this issue is https://phabricator.wikimedia.org/T355023 (which also affects previous ULS) :::4) Given there are no deployments this week, we have to wait for one more week for the fix to go live. :::6) This is being fixed and if the fix is ready in time, it will also go live next week. [[User:Nikerabbit|Nikerabbit]] ([[User talk:Nikerabbit|talk]]) 12:03, 21 April 2026 (UTC) == Logic Error in ULS Rewrite: "Not available" message shown for Chinese variants on Chinese Wikipedia == I encountered a logical inconsistency while testing the new ULS Rewrite on Chinese Wikipedia. When using the Language Selector, the search interface displays a message stating that "Chinese (Taiwan)" and "Chinese" are not available, despite the fact that I am currently on a Chinese Wikipedia page. Steps to reproduce: # Go to any article or talk page on Chinese Wikipedia. # Open the new ULS Language Selector. Actual Results: The UI shows a message: ''"尚無中文 (臺灣)、中文以及更多語言的版本"'' (Version for Chinese (Taiwan), Chinese, and more languages is not available). This is confusing for users as it implies a lack of support for the language they are currently reading. [[User:Addonian1123|Addonian1123]] ([[User talk:Addonian1123|talk]]) 13:17, 2 May 2026 (UTC) :Screenshot: [[:File:New language selector problem 20260502.png]] [[User:Addonian1123|Addonian1123]] ([[User talk:Addonian1123|talk]]) 13:25, 2 May 2026 (UTC) == "Missing in English" on English Wikipedia == On the English Wikipedia's article [[w:Corn_starch|Corn starch]], the language selector header says that the page is missing, among other languages, in English. [[User:Michael21107|Michael21107]] ([[User talk:Michael21107|talk]]) 20:50, 3 May 2026 (UTC) :Thanks for the report. I created a task to fix this: https://phabricator.wikimedia.org/T425329 [[User:Nikerabbit|Nikerabbit]] ([[User talk:Nikerabbit|talk]]) 09:13, 4 May 2026 (UTC) ot87az7oi49kc2ylcbviwog10ovoqkc Article guidance/Pilot wikis and collaborators/id 0 2371288 8364750 8363801 2026-05-03T21:29:46Z FuzzyBot 451990 Updating to match new version of source page 8364750 wikitext text/x-wiki <languages/> Edisi-edisi Wikipedia berikut telah dipilih sebagai komunitas potensial yang ingin kami ajak bekerja sama untuk mengembangkan dan menguji campur tangan ini. Pemilihannya berdasarkan [[phab:T414448|kriteria yang ditunjukkan pada halaman ini]]. Kami terbuka untuk berkolaborasi dengan edisi Wikipedia lain yang ingin bekerja sama dengan kami. * {{int|project-localized-name-arwiki}} [ar] * {{int|project-localized-name-bnwiki}} [bn] * {{int|project-localized-name-eswiki}} [es] * {{int|project-localized-name-fawiki}} [fa] * {{int|project-localized-name-frwiki}} [fr] * {{int|project-localized-name-jawiki}} [ja] * {{int|project-localized-name-ptwiki}} [pt] * {{int|project-localized-name-simplewiki}} [simple] * {{int|project-localized-name-trwiki}} [tr] <span id="Collaborators"></span> === Kolaborator === Jika Anda seorang penyunting berpengalaman atau punya hak pengurus dan tertarik untuk bekerja dengan kami, silakan tambahkan nama pengguna Anda di bawah ini dan edisi Wikipedia Anda untuk mendaftar guna memberikan masukan dan menguji campur tangan panduan artikel. * '''Chinese Wikipedia''' --[[User:SCP-2000|SCP-2000]] ([[User talk:SCP-2000|talk]]) 03:22, 12 February 2026 (UTC) * '''Turkish Wikipedia''' --[[User:Nabbegat|Nabbegat]] ([[User talk:Nabbegat|talk]]) 06:29, 12 February 2026 (UTC) * '''Turkish Wikipedia''' --[[User:Zafer|Zafer]] ([[User talk:Zafer|talk]]) 06:41, 13 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:Yahya|Yahya]] ([[User talk:Yahya|talk]]) 19:36, 14 February 2026 (UTC) * '''Japanese Wikipedia''' --[[User:さえぼー|さえぼー]] ([[User talk:さえぼー|talk]]) 06:00, 20 February 2026 (UTC), * '''Bangla Wikipedia''' --[[User:R1F4T|R1F4T]] ([[User talk:R1F4T|talk]]) 09:44, 20 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Mohammed Qays|Mohammed Qays]] ([[User talk:Mohammed Qays|talk]]) 10:58, 20 February 2026 (UTC) * '''Arabic Wikipedia''' '''--'''[[User:علاء |<span style="font-size: 12pt; font-family: Script MT Bold; color:black;">Alaa</span> ]] [[User_talk:علاء |:)..!]] 11:01, 20 February 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Little Sunshine|Little Sunshine]] ([[User talk:Little Sunshine|talk]]) 19:07, 20 February 2026 (UTC) * '''Igbo Wikipedia''' --[[User: Onyinyeonuoha|Onyinye Jane Achukwu]] ([[User talk: Onyinyeonuoha|talk]]) 07:11, 20 February 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Victor Lopes|Victor Lopes]] ([[User talk:Victor Lopes|talk]]) 14:25, 23 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Mr. Ibrahem|Mr. Ibrahem]] ([[User talk:Mr. Ibrahem|talk]]) 04:00, 24 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:Tausheef Hassan|Tausheef Hassan]] ([[User talk:Tausheef Hassan|talk]]) 14:59, 24 February 2026 (UTC) * '''Bangla Wikipedia''' --[[User:ARI|ARI]] ([[User talk:ARI|talk]]) 05:57, 25 February 2026 (UTC) * '''Arabic Wikipedia''' --[[User:Nehaoua|Nehaoua]] ([[User talk:Nehaoua|talk]]) 20:52, 27 February 2026 (UTC) * '''English Wikipedia''' --[[User:Kudpung|Kudpung]] ([[User talk:Kudpung|talk]]) 01:37, 1 March 2026 (UTC) * '''Azerbaijani Wikipedia''' [[User:Nemoralis|Nemoralis]] ([[User talk:Nemoralis|talk]]) 12:01, 2 March 2026 (UTC) * '''Arabic Wikipedia'''--[[User:Osps7|Osps7]] ([[User talk:Osps7|talk]]) 23:09, 3 March 2026 (UTC) * '''Arabic Wikipedia''' '''-''' [[User:رِفْد|رِفْد]] ([[User talk:رِفْد|talk]]) 03:26, 6 March 2026 (UTC) * '''Serbo-Croatian Wikipedia''' – [[User:Vipz|Vipz]] ([[User talk:Vipz|talk]]) 01:11, 10 March 2026 (UTC) * '''Bangla Wikipedia''' - [[User:MS Sakib|MS Sakib]] ([[User talk:MS Sakib|talk]]) 16:36, 15 March 2026 (UTC) * '''English Wikipedia''' – [[User:Toadspike|Toadspike]] ([[User talk:Toadspike|talk]]) 23:08, 17 March 2026 (UTC) * '''Portuguese Wikipedia''' --[[User:Arcstur|Arcstur]] ([[User talk:Arcstur|talk]]) 15:54, 14 April 2026 (UTC) * '''Arabic Wikipedia''' '''-''' --[[User:Dezedien|Dezedien]] ([[User talk:Dezedien|talk]]) 22:03, 29 April 2026 (UTC) * '''Arabic Wikipedia''' '''-''' [[User:ToadetteEdit|ToadetteEdit]] ([[User talk:ToadetteEdit|talk]]) 13:53, 3 May 2026 (UTC) 3su5rdn8eqomc53l07xjvxwfwq55p9e Wikimedia Quality Services/Automated tests available 0 2381422 8364903 8363938 2026-05-04T05:05:31Z VWalters-WMF 17613640 Update browser test listing (automated) 8364903 wikitext text/x-wiki ''Last updated: 2026-05-04 05:05:29 UTC | 45 repos | 381 tests | Updated daily by an [https://toolsadmin.wikimedia.org/tools/id/browser-test-scanner/info/id/3314 automated cron job on Toolforge]. To update which repos appear here, edit [https://gitlab.wikimedia.org/repos/test-platform/misc-scripts/browser-test-scanner/-/blob/main/repos.txt repos.txt].'' === WebDriverIO === {| class="wikitable sortable" ! Extension !! wdio !! wdio-mediawiki !! [https://integration.wikimedia.org/ci/job/quibble-with-gated-extensions-selenium-php83/ Gated selenium] !! Daily (7d) <span class="oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-frameless oo-ui-iconElement oo-ui-buttonWidget oo-ui-popupButtonWidget" title="Only repos with a daily Jenkins job (selenium-daily-beta-*, quibble-daily-*, *-catalyst-*-daily) appear here. Each link points to the job and shows passes/total builds over the last 7 days (e.g. 7/7 = all seven runs passed)." style="cursor:help"><span class="oo-ui-buttonElement-button" role="button" title="Only repos with a daily Jenkins job (selenium-daily-beta-*, quibble-daily-*, *-catalyst-*-daily) appear here. Each link points to the job and shows passes/total builds over the last 7 days (e.g. 7/7 = all seven runs passed)." tabindex="0"><span class="oo-ui-iconElement-icon oo-ui-icon-info" title="Only repos with a daily Jenkins job (selenium-daily-beta-*, quibble-daily-*, *-catalyst-*-daily) appear here. Each link points to the job and shows passes/total builds over the last 7 days (e.g. 7/7 = all seven runs passed)."></span><span class="oo-ui-labelElement-label oo-ui-labelElement-invisible">Info</span><span class="oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator"></span></span></span> !! Tests |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/AbuseFilter AbuseFilter] || 9.27.0 || 6.5.0 || {{Yes}} || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 23" data-collapsetext="Hide"><span style="white-space:nowrap">23 tests</span> <div class="mw-collapsible-content"> * Special:AbuseFilter > page should exist on installation * Special:AbuseFilter > page should have the button for creating a new filter * Filter editing > The editing interface > is visible to logged-in admins * Filter editing > Trying to open a non-existing filter > I should receive an error * Filter editing > Creating a new filter > edit can be saved (1) * Filter editing > Creating a new filter > saved data is retained (1) * Filter editing > Editing an existing filter > edit can be saved (2) * Filter editing > Editing an existing filter > saved data is retained (2) * Filter editing > Restoring an old version of a filter > edit can be saved (3) * Filter editing > Restoring an old version of a filter > saved data is retained (3) * Filter editing > CSRF protection > a CSRF token is required to save the filter * Filter editing > CSRF protection > even if the token is invalid, the ongoing edit is not lost * Filter editing > Trying to save a filter with bad data > cannot save an empty filter * Filter editing > Trying to save a filter with bad data > cannot save a filter with rules but no name * Filter editing > editing interface is not visible to logged-out users * When importing a filter > the interface should be visible * When importing a filter > it should redirect to ViewEdit after submission * When importing a filter > bad data results in an error * When importing a filter > valid data shows the editing interface * When importing a filter > Data on the editing interface is correct > filter specs are copied * When importing a filter > Data on the editing interface is correct > filter flags are copied * When importing a filter > Data on the editing interface is correct > filter actions are copied * When importing a filter > Data on the editing interface is correct > the imported data can be saved </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/AchievementBadges AchievementBadges] || 7.40.0 || 2.7.1 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 1" data-collapsetext="Hide"><span style="white-space:nowrap">1 tests</span> <div class="mw-collapsible-content"> * Special:Achievements > shows a logged-in user hint of long-user-page </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/AdvancedSearch AdvancedSearch] || 9.27.0 || 6.5.0 || || data-sort-value="0.4286" | <span class="plainlinks" style="color:var(--color-destructive);font-weight:bold;white-space:nowrap">[https://integration.wikimedia.org/ci/job/selenium-daily-beta-AdvancedSearch/ 3/7]</span> <span style="color:var(--color-success)">P</span><span style="color:var(--color-destructive)">F</span><span style="color:var(--color-success)">P</span><span style="color:var(--color-success)">P</span><span style="color:var(--color-destructive)">F</span><span style="color:var(--color-destructive)">F</span><span style="color:var(--color-destructive)">F</span> || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 10" data-collapsetext="Hide"><span style="white-space:nowrap">10 tests</span> <div class="mw-collapsible-content"> * Advanced Search > inserts advanced search elements on search page * Advanced Search > allows logged-in users to remember the selection of namespaces for future searches * Advanced Search > selects the users default namespaces when logged in * Advanced Search > selects the namespaces from the URL * AdvancedSearch > namespace selection * AdvancedSearch > re-adds filetype namespace after search when file type option has been selected but namespace has been removed * AdvancedSearch > adds/removes the namespace tag when the namespace option is clicked * Advanced Search > adds search parameters to pagination links * Advanced Search > submits the search on enter when there is no text in "These Words" field * Advanced Search > submits the search with the specific chosen language </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/CampaignEvents CampaignEvents] || 9.23.2 || 6.3.0 || {{Yes}} || data-sort-value="1.0000" | <span class="plainlinks" style="color:var(--color-success);font-weight:bold;white-space:nowrap">[https://integration.wikimedia.org/ci/job/selenium-daily-beta-CampaignEvents/ 7/7]</span> || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 12" data-collapsetext="Hide"><span style="white-space:nowrap">12 tests</span> <div class="mw-collapsible-content"> * Edit Event Registration > can allow organizer to update event page and dates * Edit Event Registration > can allow organizer to change the event to be in person * Edit Event Registration > can allow organizer to change the event to be online and in-person * Edit Event Registration > can allow organizer to add an additional organizer * {{Daily badge}} Enable Event Registration > is configured correctly * {{Daily badge}} Enable Event Registration > requires event data * {{Daily badge}} Enable Event Registration > can be enabled * Event page > can have one user register publicly * Event page > can have one user register privately * Event page > can have a user cancel registration * MyEvents > can allow organizer to search events by name * MyEvents > can allow organizer to delete registration of first event in My Events </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/Cargo Cargo] || 9.18.4 || 4.1.1 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 3" data-collapsetext="Hide"><span style="white-space:nowrap">3 tests</span> <div class="mw-collapsible-content"> * Special:CargoTables > displays table information * Special:Drilldown > displays table name with proper page count * Special:Drilldown > displays proper data when drilling down </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/CentralNotice CentralNotice] || 9.19.2 || 4.1.3 || || data-sort-value="1.0000" | <span class="plainlinks" style="color:var(--color-success);font-weight:bold;white-space:nowrap">[https://integration.wikimedia.org/ci/job/selenium-daily-beta-CentralNotice/ 7/7]</span> || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 1" data-collapsetext="Hide"><span style="white-space:nowrap">1 tests</span> <div class="mw-collapsible-content"> * CentralNotice > banner is displayed on Main Page </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/CirrusSearch CirrusSearch] || 9.19.2 || 4.1.3 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 3" data-collapsetext="Hide"><span style="white-space:nowrap">3 tests</span> <div class="mw-collapsible-content"> * Smoke test for search > Search suggestions * Smoke test for search > Fill in search term and click search * Smoke test for search > Search with accent yields result page with accent </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/CodeMirror CodeMirror] || 9.23.2 || 6.5.0 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 25" data-collapsetext="Hide"><span style="white-space:nowrap">25 tests</span> <div class="mw-collapsible-content"> * CodeMirror code folding for the wikitext 2010 editor > folds the template parameters via the button * CodeMirror code folding for the wikitext 2010 editor > expands the template parameters via the button * CodeMirror code folding for the wikitext 2010 editor > folds the extension tag via the button * CodeMirror code folding for the wikitext 2010 editor > expands the extension tag via the button * CodeMirror code folding for the wikitext 2010 editor > folds all via keyboard shortcut * CodeMirror code folding for the wikitext 2010 editor > expands all via keyboard shortcut * CodeMirror code folding for the wikitext 2010 editor > folds all <ref> tags via keyboard shortcut * CodeMirror bracket match highlighting for the wikitext 2010 editor > highlights matching bracket * CodeMirror bracket match highlighting for the wikitext 2010 editor > matches according to cursor movement * CodeMirror (enabled) - VisualEditor 2017 wikitext editor > opens with the CodeMirror view displayed and focus set on the VE surface * CodeMirror (enabled) - VisualEditor 2017 wikitext editor > updates CodeMirror with VE document changes * CodeMirror (enabled) - VisualEditor 2017 wikitext editor > retains content when CodeMirror is disabled and maintains focus on VE surface * CodeMirror (enabled) - VisualEditor 2017 wikitext editor > retains content when CodeMirror is re-enabled * CodeMirror (enabled) - VisualEditor 2017 wikitext editor > adjusts gutter accordingly when pasting many lines of wrapping text * CodeMirror (enabled) - VisualEditor 2017 wikitext editor > should only load necessary modules when the CodeMirror preference is unset * CodeMirror textSelection for the wikitext 2010 editor > sets and gets the correct text when using setContents and getContents * CodeMirror textSelection for the wikitext 2010 editor > has usage of .val() routed to CodeMirror * CodeMirror textSelection for the wikitext 2010 editor > sets and gets the correct selection when using setSelection and getSelection * CodeMirror textSelection for the wikitext 2010 editor > correctly replaces the selected text when using replaceSelection * CodeMirror textSelection for the wikitext 2010 editor > returns the correct values for getCaretPosition * CodeMirror textSelection for the wikitext 2010 editor > correctly wraps the selected text when using encapsulateSelection * CodeMirror textSelection for the wikitext 2010 editor > correctly inserts the 'peri' option when using encapsulateSelection * CodeMirror textSelection for the wikitext 2010 editor > applies 'pre'/'post' to each line when 'splitlines' is used with encapsulateSelection * CodeMirror textSelection for the wikitext 2010 editor > scrolls to the correct place when using scrollToCaretPosition * CodeMirror textSelection for the wikitext 2010 editor > retains the contents after turning CodeMirror off </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/CommunityRequests CommunityRequests] || 9.18.4 || 6.1.0 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 6" data-collapsetext="Hide"><span style="white-space:nowrap">6 tests</span> <div class="mw-collapsible-content"> * WishlistIntake wish submission > should prompt logged out users to login * WishlistIntake wish submission > should show the form with VisualEditor when browsing to the intake form * WishlistIntake wish submission > should show errors when submitting an incomplete form * WishlistIntake wish submission > should not show an error if a title is over 100 chars because of translate tags * WishlistIntake wish submission > should hide errors if all required fields are filled in on submission * WishlistIntake wish submission > should show all the data entered in the form </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/ConfirmEdit ConfirmEdit] || 9.27.0 || 6.5.0 || {{Yes}} || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 1" data-collapsetext="Hide"><span style="white-space:nowrap">1 tests</span> <div class="mw-collapsible-content"> * ConfirmEdit > Main page should be accessible </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/ContactPage ContactPage] || 9.18.4 || 6.1.0 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 1" data-collapsetext="Hide"><span style="white-space:nowrap">1 tests</span> <div class="mw-collapsible-content"> * ContactPage on Version page > ContactPage is listed in the version page under the special page category </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/ContentTranslation ContentTranslation] || 9.19.2 || 4.1.3 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 5" data-collapsetext="Hide"><span style="white-space:nowrap">5 tests</span> <div class="mw-collapsible-content"> * Unified Dashboard - Desktop - New translation > should allow publishing a new translation started through search * Unified Dashboard - Suggestions > should show suggestions tab * Unified Dashboard - Suggestions > should allow user to save/unsave a suggestion for later * Unified Dashboard - Suggestions > should allow dismissing a suggestion * Unified Dashboard - Suggestions > should allow refreshing suggestions </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/core Core] || 9.23.2 || 6.5.1 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 23" data-collapsetext="Hide"><span style="white-space:nowrap">23 tests</span> <div class="mw-collapsible-content"> * Special:SpecialPages > should not have Edit link * User > should be able to log in without page object * Main page > should have edit link when using expect * Main page > should have edit link when using mocha * API > Main Page should exist * API > Missing Page should not exist * Page > should be previewable * Page > should be creatable * Page > should be re-creatable * Page > should be editable * Page > should have history * Page > should be undoable * Page admin actions > should be deletable * Page admin actions > should be restorable * Page admin actions > should be protectable * Special:RecentChanges > shows page creation * Temporary user > should not see signup form fields relevant to named users * Temporary user account creation > should be able to create account * User > should be able to create account * User > should be able to log in * User > named user should see extra signup form fields when creating an account * User > should be able to block a user * BlankPage > should have its title </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/Echo Echo] || 9.23.2 || 6.3.0 || {{Yes}} || data-sort-value="1.0000" | <span class="plainlinks" style="color:var(--color-success);font-weight:bold;white-space:nowrap">[https://integration.wikimedia.org/ci/job/selenium-daily-beta-Echo/ 7/7]</span> || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 4" data-collapsetext="Hide"><span style="white-space:nowrap">4 tests</span> <div class="mw-collapsible-content"> * {{Daily badge}} Echo > alerts and notices are visible after logging in * {{Daily badge}} Echo > flyout for alert appears when clicked * {{Daily badge}} Echo > flyout for notices appears when clicked * {{Daily badge}} Notifications > checks for Notifications Page </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/ElectronPdfService ElectronPdfService] || 9.18.4 || 6.1.0 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 1" data-collapsetext="Hide"><span style="white-space:nowrap">1 tests</span> <div class="mw-collapsible-content"> * ElectronPdfService > pdf download button is visible </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/examples examples] || 9.23.2 || 6.5.1 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 3" data-collapsetext="Hide"><span style="white-space:nowrap">3 tests</span> <div class="mw-collapsible-content"> * api > can create a user * api > can read a page * Examples > is configured correctly </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/FacetedCategory FacetedCategory] || 9.20.1 || 4.1.1 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 2" data-collapsetext="Hide"><span style="white-space:nowrap">2 tests</span> <div class="mw-collapsible-content"> * Special:CategoryIntersectionSearch > shows a page if valid subpage is given * Special:CategoryIntersectionSearch > shows a page if the category contains a space </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/GlobalWatchlist GlobalWatchlist] || 9.18.4 || 5.1.0 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 1" data-collapsetext="Hide"><span style="white-space:nowrap">1 tests</span> <div class="mw-collapsible-content"> * Special:GlobalWatchlist > works with normal display </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/Math Math] || 9.23.2 || 6.3.0 || {{Yes}} || data-sort-value="1.0000" | <span class="plainlinks" style="color:var(--color-success);font-weight:bold;white-space:nowrap">[https://integration.wikimedia.org/ci/job/selenium-daily-beta-Math/ 7/7]</span> || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 5" data-collapsetext="Hide"><span style="white-space:nowrap">5 tests</span> <div class="mw-collapsible-content"> * Math > should work for addition * Math polyfills skipFunction > returns true when all MathML features are supported * Math polyfills skipFunction > returns false when a required feature is missing * Math polyfills skipFunction > skips loading when the skipFunction returns true * Math polyfills skipFunction > loads when the skipFunction returns false </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/skins/MinervaNeue MinervaNeue] || 9.23.2 || 6.3.0 || {{Yes}} || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 3" data-collapsetext="Hide"><span style="white-space:nowrap">3 tests</span> <div class="mw-collapsible-content"> * Opening and closing the reference drawer > Opening a reference * Opening and closing the reference drawer > Opening a nested reference * Manage Watchlist > Add an article to the watchlist </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/Newsletter Newsletter] || 9.18.4 || 6.1.0 || || data-sort-value="1.0000" | <span class="plainlinks" style="color:var(--color-success);font-weight:bold;white-space:nowrap">[https://integration.wikimedia.org/ci/job/selenium-daily-beta-Newsletter/ 7/7]</span> || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 1" data-collapsetext="Hide"><span style="white-space:nowrap">1 tests</span> <div class="mw-collapsible-content"> * Newsletter > page should exist on installation </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/OpenIDConnect OpenIDConnect] || 9.19.2 || 4.1.3 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 2" data-collapsetext="Hide"><span style="white-space:nowrap">2 tests</span> <div class="mw-collapsible-content"> * OpenIDConnect > can login * OpenIDConnect > is configured correctly </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/PageTriage PageTriage] || 9.23.2 || 6.3.2 || {{Yes}} || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 5" data-collapsetext="Hide"><span style="white-space:nowrap">5 tests</span> <div class="mw-collapsible-content"> * Special:NewPagesFeed > is viewable * Special:NewPagesFeed > new article appears in feed * PageTriage Toolbar > should load * PageTriage Toolbar > should allow user to add a maintainence tag to a page * PageTriage Toolbar > should allow user to add a maintainence tag to a page and send a note to user </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/ParserMigration ParserMigration] || 9.19.2 || 6.1.0 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 2" data-collapsetext="Hide"><span style="white-space:nowrap">2 tests</span> <div class="mw-collapsible-content"> * ParserMigration > should use parsoid with useparsoid=1 param * ParserMigration > should use legacy parser with useparsoid=0 param </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/Popups Popups] || 9.15.0 || 4.1.3 || || data-sort-value="1.0000" | <span class="plainlinks" style="color:var(--color-success);font-weight:bold;white-space:nowrap">[https://integration.wikimedia.org/ci/job/selenium-daily-beta-Popups/ 7/7]</span> || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 3" data-collapsetext="Hide"><span style="white-space:nowrap">3 tests</span> <div class="mw-collapsible-content"> * Dwelling on a valid page link > I should see a page preview * Dwelling on a valid page link > I should not see a page preview on hash fragment * Dwelling on a valid page link > Abandoning link hides page preview </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/ProofreadPage ProofreadPage] || 9.23.2 || 6.3.0 || {{Yes}} || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 5" data-collapsetext="Hide"><span style="white-space:nowrap">5 tests</span> <div class="mw-collapsible-content"> * For a page with the eis, the page status module > should initialize with the value of current page * For a page with the eis, the page status module > should update on page change * For a page with eis enabled > toolbar loads * For a page with eis enabled > prev to page 1 * For a page with eis enabled > next to last page </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/RelatedArticles RelatedArticles] || 9.20.0 || 4.1.3 || || data-sort-value="1.0000" | <span class="plainlinks" style="color:var(--color-success);font-weight:bold;white-space:nowrap">[https://integration.wikimedia.org/ci/job/selenium-daily-beta-RelatedArticles/ 7/7]</span> || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 1" data-collapsetext="Hide"><span style="white-space:nowrap">1 tests</span> <div class="mw-collapsible-content"> * {{Daily badge}} ReadMore > ReadMore is present in Minerva </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/ReportIncident ReportIncident] || 9.27.0 || 6.5.1 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 6" data-collapsetext="Hide"><span style="white-space:nowrap">6 tests</span> <div class="mw-collapsible-content"> * ReportIncident dialog > Should open the dialog if the tools menu is used * ReportIncident dialog > Should be able to advance to step 2 and see a form with the expected fields * ReportIncident dialog > Should ask for additional details only when selecting "Something else" * ReportIncident dialog > Should display form errors when submit attempted with no form data * ReportIncident dialog > Should be able to submit a form with valid data * ReportIncident dialog > Should be able to fill a report from a thread </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/RevisionSlider RevisionSlider] || 9.18.4 || 5.1.0 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 21" data-collapsetext="Hide"><span style="white-space:nowrap">21 tests</span> <div class="mw-collapsible-content"> * RevisionSlider expand > does not automatically expand by default * RevisionSlider expand > expands automatically when auto expand is on * RevisionSlider expand > does not expand automatically when auto expand is off * RevisionSlider expand > hides when collapsed manually * RevisionSlider diff links > older edit diff link can be clicked * RevisionSlider diff links > newer edit diff link can be clicked * RevisionSlider filter highlighting > highlights revisions by the same user when I use the user filter * RevisionSlider filter highlighting > stops highlighting revisions when the filter is clicked twice * RevisionSlider filter highlighting > highlights revisions that have the same tag when I use the tag filter * RevisionSlider filter highlighting > highlights revisions that have the same tag when I use the tag filter after I used the user filter * RevisionSlider filter highlighting > only highlights revisions that have the same tag when I selected a user but hover a tag filter * RevisionSlider filter highlighting > re-applies highlight when I selected a user but hover and on-hover a tag filter * RevisionSlider help > tutorial is present on first load * RevisionSlider help > tutorial is not present after it was dismissed once * RevisionSlider help > tutorial sequence works * RevisionSlider history > can be accessed using browser back and forward buttons after clicking * RevisionSlider history > can be accessed using browser back and forward buttons after dragging * RevisionSlider pointers > can be dragged * RevisionSlider timeline arrows > should be disabled with 3 revisions * RevisionSlider timeline arrows > should be enabled with adequate revisions * RevisionSlider revision tooltips > appears and remains on hovering it </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/Sanctions Sanctions] || 9.19.2 || 4.1.3 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 9" data-collapsetext="Hide"><span style="white-space:nowrap">9 tests</span> <div class="mw-collapsible-content"> * Sanction > should be canceled by the author * Sanction > should be rejected if three users object * Sanction > should be passed if three users support before expired * Sanction > should block the target user of the passed sanction when logged in * Sanction > should not touch the summary of a expired handled sanction * Special:Sanctions > should hide and show the form as the conditions change * Special:Sanctions > should add voted tag on a sanction * Special:Sanctions > should show > an anonymous user not-logged-in warning * Special:Sanctions > should show > a newly registered user that you are too new </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/TemplateData TemplateData] || 9.23.2 || 6.3.0 || {{Yes}} || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 3" data-collapsetext="Hide"><span style="white-space:nowrap">3 tests</span> <div class="mw-collapsible-content"> * TemplateData users can favorite templates via VisualEditor > show a template search field, with focus * TemplateData users can favorite templates via VisualEditor > show anon users a message about needing to log in * TemplateData users can favorite templates via VisualEditor > logged-in users can favorite templates from the search results </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/TemplateWizard TemplateWizard] || 9.18.4 || 6.1.0 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 4" data-collapsetext="Hide"><span style="white-space:nowrap">4 tests</span> <div class="mw-collapsible-content"> * TemplateWizard > has 1 (required) field visible * TemplateWizard > has 5 fields visible * TemplateWizard > has template inserted * TemplateWizard > can be closed from search </div></div> |- | [https://gerrit.wikimedia.org/g/wikibase/termbox termbox] || 9.20.0 || 6.5.1 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 25" data-collapsetext="Hide"><span style="white-space:nowrap">25 tests</span> <div class="mw-collapsible-content"> * Termbox: AnonEditWarning > shows the warning overlay for anonymous users when clicking the edit button * Termbox: AnonEditWarning > can be dismissed * Termbox: AnonEditWarning > does not show the warning overlay again if the user opts out * Termbox: AnonEditWarning > never appears for logged in users * Termbox: LicenseOverlay > is shown when clicking publish * Termbox: LicenseOverlay > disappears when clicking cancel and goes back to edit mode * Termbox: LicenseOverlay > disappears and saves when clicking publish * Termbox: LicenseOverlay > does not reappear after saving by default * Termbox: LicenseOverlay > reappears after saving when unchecking the "remember my choice" checkbox * Termbox: editing > edit mode > is in edit mode after clicking the edit button * Termbox: editing > edit mode > switches back to reading mode when clicking the cancel button * Termbox: editing > editing > can edit labels, descriptions, and aliases * Termbox: editing > editing > shows an error when an edit fails to save when the entity was protected while editing * Termbox: reading > is in reading mode when opening the item page * Termbox: reading > primary language terms > contains the expected language with respective terms * Termbox: reading > "in more languages" section > has a collapse/expand button * Termbox: reading > "in more languages" section > is expanded by default * Termbox: reading > "in more languages" section > is collapsible, also hiding the "all entered languages" section * Termbox: reading > "in more languages" section > expands again when clicking the button twice * Termbox: reading > "in more languages" section > contains the expected languages with respective terms * Termbox: reading > "all entered languages" section > is collapsed by default * Termbox: reading > "all entered languages" section > has a collapse/expand button * Termbox: reading > "all entered languages" section > is expandable * Termbox: reading > "all entered languages" section > collapses again when clicking the button twice * Termbox: reading > "all entered languages" section > contains the expected languages with respective terms </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/TwoColConflict TwoColConflict] || 9.27.0 || 6.5.1 || || data-sort-value="1.0000" | <span class="plainlinks" style="color:var(--color-success);font-weight:bold;white-space:nowrap">[https://integration.wikimedia.org/ci/job/selenium-daily-beta-TwoColConflict/ 7/7]</span> || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 14" data-collapsetext="Hide"><span style="white-space:nowrap">14 tests</span> <div class="mw-collapsible-content"> * TwoColConflict EditUi > will switch to edit mode by clicking the column that is selected * TwoColConflict EditUi > edits of unchanged paragraphs should be saved * TwoColConflict EditUi > paragraph edits can be reverted * TwoColConflict EditUi > saving an editor with no changes will preserve the highlight portions * TwoColConflict without JavaScript > is showing the default version correctly * TwoColConflict without JavaScript > is showing the talk page version correctly * TwoColConflict without JavaScript > handles order selection on the talk page version correctly * TwoColConflict save and preview > should save a resolved conflict successfully including changes * TwoColConflict save and preview > should show a correct preview page including changes * TwoColConflict > shows the talk page screen on conflicts that also add new lines * TwoColConflict > on talk page conflicts > shows the talk page screen correctly * TwoColConflict > on talk page conflicts > swaps blocks when switch button is clicked * TwoColConflict > on talk page conflicts > shows correct preview when swapped * TwoColConflict > on talk page conflicts > stores correct merge when swapped and edited </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/VisualEditor VisualEditor] || 9.23.2 || 6.3.0 || {{Yes}} || data-sort-value="1.0000" | <span class="plainlinks" style="color:var(--color-success);font-weight:bold;white-space:nowrap">[https://integration.wikimedia.org/ci/job/selenium-daily-beta-VisualEditor/ 7/7]</span> || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 34" data-collapsetext="Hide"><span style="white-space:nowrap">34 tests</span> <div class="mw-collapsible-content"> * {{Daily badge}} Content Editable > should load when an url is opened * Content Editable > should be editable * Content Editable > should save an edit * Content Editable > should insert a table * Content Editable > should insert Bullet list * Content Editable > should insert Numbered list * Content Editable > should insert and indent Bullet list * Content Editable > should insert and indent Numbered list * Content Editable > should insert an internal link * Content Editable > should insert an external link * Content Editable > should insert a comment * Content Editable Formatting > should change text to Page title * Content Editable Formatting > should change text to Heading * Content Editable Formatting > should change text to Sub-heading 1 * Content Editable Formatting > should change text to Sub-heading 2 * Content Editable Formatting > should change text to Sub-heading 3 * Content Editable Formatting > should change text to Sub-heading 4 * Content Editable Formatting > should change text to Preformatted * Content Editable Formatting > should change text to Block quote * Content Editable Formatting > should change formatting to Bold * Content Editable Formatting > should change formatting to Italic * Content Editable Formatting > should change formatting to Superscript * Content Editable Formatting > should change formatting to Subscript * Content Editable Formatting > should change formatting to Computer code * Content Editable Formatting > should change formatting to Strikethrough * Content Editable Formatting > should change formatting to Underline * Toolbar > should open notices popup as soon as it loads * Toolbar > should open switch editor * Toolbar > should open page options * Toolbar > should open help popup * Toolbar > should open insert menu * Toolbar > should open structure options menu * Toolbar > should open style text options * Toolbar > should open format paragraph menu </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/Wikibase Wikibase] || 9.20.0 || 6.5.1 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 7" data-collapsetext="Hide"><span style="white-space:nowrap">7 tests</span> <div class="mw-collapsible-content"> * item > can add a statement using the keyboard * item > old revisions do not have an edit link * item > has its label not rendered when linked on a Wikipage * WikibaseRepoNonExistingItemPage > edit tab does should not be there * WikibaseRepoNonExistingItemPage > the title should match * WikibaseReferenceOnProtectedPage > can expand collapsed references on a protected page as unprivileged user * Add interlanguage links > dialog loads on click </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/WikiLambda WikiLambda] || 9.20.1 || 6.1.0 || || data-sort-value="0.7143" | <span class="plainlinks" style="color:var(--color-destructive);font-weight:bold;white-space:nowrap">[https://integration.wikimedia.org/ci/job/wikilambda-catalyst-end-to-end-daily/ 5/7]</span> <span style="color:var(--color-destructive)">F</span><span style="color:var(--color-destructive)">F</span><span style="color:var(--color-success)">P</span><span style="color:var(--color-success)">P</span><span style="color:var(--color-success)">P</span><span style="color:var(--color-success)">P</span><span style="color:var(--color-success)">P</span> || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 18" data-collapsetext="Hide"><span style="white-space:nowrap">18 tests</span> <div class="mw-collapsible-content"> * Abstract Article (Special:ViewAbstract) > loads and renders content + preview widgets * Abstract Article (Special:ViewAbstract) > shows the expected error fragment when a function returns wrong type * Abstract Article (Special:ViewAbstract) > allows switching preview language * Installation checks > CreateObject > page should exist on installation but deny to logged-out user * Installation checks > CreateObject > page should exist on installation and work when logged in * Installation checks > RunFunction > page should exist on installation * Installation checks > ListObjectsByType > page should exist on installation * Dynamic Test for Implementation and Test Case Connection > Admin user > should dynamically connect or disconnect the implementation based on its initial state * Dynamic Test for Implementation and Test Case Connection > Admin user > should dynamically connect or disconnect the test case based on its initial state * Function > Function viewer (CUJ1) > should allow to evaluate a function * Function > Function editor (CUJ2) > should create a new function and display the function name * Function > Function editor (CUJ2) > should create a new function and display function aliases * Function > Function editor (CUJ2) > should create a new function and display function input labels and types * Function > Function editor (CUJ2) > should create a new function and display function output type * Implementation (CUJ 5) > Implementation via code > should create and publish a new implementation * Implementation (CUJ 5) > Implementation via composition > should create and publish a new implementation * Tester > Create a new test (CUJ 4) > should fill and submit the tester form * Tester > Edit the test > should edit the about block test </div></div> |} === Cypress === {| class="wikitable sortable" ! Extension !! cypress !! [https://integration.wikimedia.org/ci/job/quibble-with-gated-extensions-selenium-php83/ Gated selenium] !! Daily (7d) <span class="oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-frameless oo-ui-iconElement oo-ui-buttonWidget oo-ui-popupButtonWidget" title="Only repos with a daily Jenkins job (selenium-daily-beta-*, quibble-daily-*, *-catalyst-*-daily) appear here. Each link points to the job and shows passes/total builds over the last 7 days (e.g. 7/7 = all seven runs passed)." style="cursor:help"><span class="oo-ui-buttonElement-button" role="button" title="Only repos with a daily Jenkins job (selenium-daily-beta-*, quibble-daily-*, *-catalyst-*-daily) appear here. Each link points to the job and shows passes/total builds over the last 7 days (e.g. 7/7 = all seven runs passed)." tabindex="0"><span class="oo-ui-iconElement-icon oo-ui-icon-info" title="Only repos with a daily Jenkins job (selenium-daily-beta-*, quibble-daily-*, *-catalyst-*-daily) appear here. Each link points to the job and shows passes/total builds over the last 7 days (e.g. 7/7 = all seven runs passed)."></span><span class="oo-ui-labelElement-label oo-ui-labelElement-invisible">Info</span><span class="oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator"></span></span></span> !! Tests |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/Cite Cite] || 15.11.0 || {{Yes}} || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 11" data-collapsetext="Hide"><span style="white-space:nowrap">11 tests</span> <div class="mw-collapsible-content"> * Cite popups integration > simple popup on hover and hide on leave * Cite popups integration > includes scrollbar and fadeout on long previews * Cite popups integration > hovering nested reference * VisualEditor Cite with sub-references > should convert references into sub-references * VisualEditor Cite with sub-references > should update edited Main+Details ref content * VisualEditor Cite with sub-references > should move main ref content to the subRef when the main ref is removed * VisualEditor Cite with citation templates > should be able to add a new template in VE * VisualEditor Cite with citation templates > should be able to add a new template in VE WT2017 Editor * VisualEditor Cite > should be able to edit and verify reference content in Visual Editor * VisualEditor Cite > should be able to reuse existing references via the reuse dialog * VisualEditor Cite with WT2017 Editor > should be able to create a basic reference </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/CommunityConfiguration CommunityConfiguration] || 15.11.0 || {{Yes}} || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 5" data-collapsetext="Hide"><span style="white-space:nowrap">5 tests</span> <div class="mw-collapsible-content"> * Community Configuration Example Page > should save configuration changes and verify them on the example page * Community Configuration Example Page > Form elements and basic functionality > should have all expected form elements and labels * Community Configuration Example Page > Form elements and basic functionality > should have a save button * Community Configuration Example Page > Form elements and basic functionality > should have a disabled save button for logged-out users * Community Configuration Example Page > Form elements and basic functionality > should update a simple string via API and verify the update on the form </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/EntitySchema EntitySchema] || 13.17.0 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 17" data-collapsetext="Hide"><span style="white-space:nowrap">17 tests</span> <div class="mw-collapsible-content"> * Schema Viewing Page > accepts statements of entity schema data value type * Schema Edit Page > given that a user is allowed > returns to schema view page on submit * Schema Edit Page > given that a user is allowed > detects an edit conflict when submitting the same form from two windows * Schema Edit Page > given that a user is allowed > properly limits the input length * Schema Edit Page > given the user is blocked > cannot be edited * NewEntitySchema:Page > is possible to create a new schema with full data * NewEntitySchema:Page > is possible to create a new schema with only a label * NewEntitySchema:Page > limits the name badge input length * NewEntitySchema:Page > limits the schema text input length * NewEntitySchema:Page > when blocked > cannot load form * NewEntitySchema:Page > when blocked > cannot submit form * SetEntitySchemaLabelDescriptionAliasesPage:Page > detects an edit conflict based on the baserev parameter * SetEntitySchemaLabelDescriptionAliasesPage:Page > limits the input length * SetEntitySchemaLabelDescriptionAliasesPage:Page > is possible to edit Schema in another language * SetEntitySchemaLabelDescriptionAliasesPage:Page > has existing data already prefilled * Schema Viewing Page > doesn\ * wbui2025 entity schema datatype > mobile view - entity-schema datatype > displays item statement and supports full editing workflow </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/GrowthExperiments GrowthExperiments] || 15.14.0 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 15" data-collapsetext="Hide"><span style="white-space:nowrap">15 tests</span> <div class="mw-collapsible-content"> * Add a Link > link inspector can be used to accept/reject links and save an article. * Add Image Structured Task > desktop: user can view image info and image details * Add Image Structured Task > mobile: user can close the image suggestion UI * Special:EditGrowthConfig > redirects to Special:CommunityConfiguration * Special:Homepage > Shows a suggested edits card and allows navigation forwards and backwards through queue * Impact > shows the user\ * Special:MentorDashboard > allows enrolling as a mentor * Revise Tone > On desktop > Shows the Revise Tone Edit Check * Revise Tone > On desktop > Closes the Editor when declining Edits and suggests a new task * Revise Tone > On desktop > Shows the Revise Tone Edit Check and tags edits * Revise Tone > On mobile > Shows the Revise Tone Edit Check * Revise Tone > On mobile > Closes the Editor when declining Edits and suggests a new task * Revise Tone > On mobile > Shows the Revise Tone Edit Check and tags edits * Template-based tasks > saves change tags for unstructured task edits made via VisualEditor * Special:Log > Shows the GrowthExperiments event Mentor assignment changes </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/GuidedTour GuidedTour] || 15.11.0 || {{Yes}} || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 1" data-collapsetext="Hide"><span style="white-space:nowrap">1 tests</span> <div class="mw-collapsible-content"> * template spec > passes </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/Score Score] || 15.8.2 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 1" data-collapsetext="Hide"><span style="white-space:nowrap">1 tests</span> <div class="mw-collapsible-content"> * add score statement > mobile view > loads the item view, allows statements to be edited </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/Wikibase Wikibase] || 14.5.3 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 18" data-collapsetext="Hide"><span style="white-space:nowrap">18 tests</span> <div class="mw-collapsible-content"> * wbui2025 language preferences and RTL functionality > mobile view > Checking RTL layout when editing statements * wbui2025 add qualifiers > mobile view > is possible to add and edit a qualifier * wbui2025 add qualifiers > mobile view (wbui2025) - tabular-data qualifier > can add a tabular-data qualifier with lookup * wbui2025 add qualifiers > mobile view (wbui2025) - geo-shape qualifier > can add a geo-shape qualifier with lookup * wbui2025 add qualifiers > mobile view (wbui2025) - geo-shape qualifier > shows dropdown menu when typing in geo-shape qualifier lookup * wbui2025 add reference > mobile view > is possible to add references for string and lookup datatypes * wbui2025 item view add statement > mobile view > loads the item view and shows property selector * wbui2025 item view add additional value to existing statement > full add-value workflow > opens the add-value modal, searches, selects, and confirms value * wbui2025 item view add additional value to existing statement > cancel behavior > opens the add-value modal and cancels cleanly without enabling the save button * wbui2025 entityId datatypes (item, property) > mobile view - > allows adding * wbui2025 edit references > mobile view > references are editable and deletable * wbui2025 item view edit statements > mobile view > loads the item view and shows a statement, which can be edited, * wbui2025 string datatypes (tabular-data, geo-shape, commonsMedia) > mobile view - tabular-data datatype > displays tabular-data statement and supports full editing workflow * wbui2025 string datatypes (tabular-data, geo-shape, commonsMedia) > mobile view - geo-shape datatype > displays geo-shape statement and supports full editing workflow * wbui2025 string datatypes (tabular-data, geo-shape, commonsMedia) > mobile view - commonsMedia datatype > displays commonsMedia statement and supports full editing workflow * wbui2025 time datatypes > mobile view - time datatype > allows adding time statement to empty item, * wbui2025 item view publish statement changes > mobile view > loads the item view and shows a statement, which can be edited * wbui2025 item view > mobile view > loads the item view </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/WikibaseLexeme WikibaseLexeme] || 13.17.0 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 17" data-collapsetext="Hide"><span style="white-space:nowrap">17 tests</span> <div class="mw-collapsible-content"> * Lexeme:Forms > can be open the add Form, cancel the add, open it again and save. * Lexeme:Forms > can add, edit and remove representation. it * Lexeme:Forms > has statement list and can edit statements on a new Form * Lexeme:Forms > FormId generation > FormId counter is not decremented when addForm is undone * Lexeme:Forms > FormId generation > FormId counter is not decremented when old revision is restored * Lexeme:Forms > can be removed * Lexeme:Header > can edit the language and lexical category of a Lexeme * Lexeme:non-existing > says the entity does not exist * Lexeme:Senses > Sense header and container exist * Special:MergeLexemes > shows the form * Special:MergeLexemes > when blocked > is not possible to edit * NewLexeme:Page > shows the form and creating a lexeme is possible * Special:RecentChanges > shows lemmas in title links to lexemes on Special:RecentChanges * Special:Watchlist > shows lemmas in title links to lexemes on Special:Watchlist * Lexeme:Statements > can be added * Special Version Page > verifies that the WikibaseLexeme extension loads * wbui2025 Lexeme entityId datatypes (lexeme, form, sense) > mobile view - > displays item statement and supports full editing workflow </div></div> |- | [https://gerrit.wikimedia.org/g/mediawiki/extensions/WikibaseQualityConstraints WikibaseQualityConstraints] || 15.7.1 || || || <div class="mw-collapsible mw-collapsed" data-expandtext="Show 3" data-collapsetext="Hide"><span style="white-space:nowrap">3 tests</span> <div class="mw-collapsible-content"> * show constraints > desktop view > loads the item view with a simple violation * show constraints > desktop view > loads the item view with an advanced violation * show constraints > wbui2025 mobile view > adds an indicator, and a popover containing all violations </div></div> |} con6fateqqtqa1vzxpt69e8warl6hu9 MediaWiki Users and Developers Conference Fall 2026/zh 0 2381573 8365141 8323013 2026-05-04T11:45:01Z FuzzyBot 451990 Updating to match new version of source page 8365141 wikitext text/x-wiki <languages/> <div style="float:right;" class="noprint"> {| class="infobox floatright noprint" style="width:280px; border:1px solid #8898bf; background-color:#ffffff" |- style="text-align:center; background:#164eaf; font-weight:bold;" | colspan="2" |<span style="color:#ffffff!important;">MediaWiki Users and Developers Conference Fall 2026</span> |- | colspan="2" |By and for the third-party MediaWiki community |- style="text-align:center; background:#164eaf; font-weight:bold;" | colspan="2" |<span style="color:#ffffff!important;">Conference Details |- style="vertical-align:top;" |Location: |Jožef Stefan Institute<br /> Ljubljana, Slovenia |- style="vertical-align:top;" |Start: |November 11 |- style="vertical-align:top;" |Finish: |November 13 |- style="vertical-align:top;" | |- style="vertical-align:top;" |Audience: |Administrators, Business, Academia, Developers, Community, MediaWiki Users |- style="vertical-align:top; text-align:center;" |Previous conference: {{ll|MediaWiki Users and Developers Conference Spring 2026}} |Next conference: {{ll|MediaWiki Users and Developers Conference Spring 2027}} |- style="text-align:center; background:#164eaf; font-weight:bold;" |} </div> The '''{{ll|MediaWiki Users and Developers Conference}}, Fall 2026''' will be held November 11-13, 2026, at Jožef Stefan Institute in Ljubljana, Slovenia. The MediaWiki Users and Developers Conference (MUDCon) is a three-day conference featuring discussions of topics related to the usage of MediaWiki software by and within companies, non-profits, governments, organizations, and communities. == Informal signup == If you are interested in attending the conference, feel free to add your name below. # Bernhard Krabina # [[User:MyWikis-JeffreyWang|Jeffrey Wang]] # Alexander Gesinn <span id="Event_details"></span> == 活动详情 == <!-- <mapframe text="FamilySearch Library" width="200" height="200" zoom="14" longitude="-111.89436045320406" latitude="40.77033662389152" align="left"> { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-82.64214510292443, 41.359337466964725] }, } </mapframe> --> * '''Dates:''' November 11-13, 2026 * '''Location:''' Jožef Stefan Institute, Ljubljana, Slovenia == Registration == Is this your '''first time attending''' a MediaWiki Users and Developers Conference? Read the [[MediaWiki Users and Developers Conference/FAQ|FAQ]] for more information! Registration and purchase of a conference ticket is required for in-person attendance. == Accommodations and transportation == === Local accommodations === TBA === Ground transportation === TBA == Program == To be announced. == Social events == Social events will be announced by the Social Chair. == Scholarships == The MediaWiki Stakeholders' Group will offer scholarships for both in-person attendance and mobile data (for qualifying circumstances). Depending on availability of funds and merit of the applicants, scholarships will be awarded to a certain number of applicants. In-person scholarships cover the cost of a conference ticket. Mobile data scholarships cover the reasonable costs of paying for mobile data to watch the conference. Scholarships must be applied for. Applications will be reviewed by the MediaWiki Stakeholders' Group's scholarships committee, which is appointed by the MWStake Board of Directors. For more information, please see [[MediaWiki Users and Developers Conference/Scholarships]]. == Sponsorship == The conference would not be possible without the financial support provided by our generous sponsors. The levels of sponsorship will become available soon. == Visa assistance == The conference will provide affidavits for attendees who need to apply for a visitor visa at the relevant country's consulate. You may contact the Social Chair to request this affidavit. For further information, please see the [[MediaWiki Users and Developers Conference/International travel|conference's international travel]] page. akbmbs1xuf4o8ceqt1wqz8n0hc6uhz3 Translations:Article guidance/136/ar 1198 2394658 8364668 8332574 2026-05-03T19:16:08Z ToadetteEdit 17805473 8364668 wikitext text/x-wiki التكيف مع هذه الميزة! m6zf0pppdpps8h78dls0wt5i89mrqn7 Translations:Article guidance/137/ar 1198 2394659 8364672 8332576 2026-05-03T19:17:39Z ToadetteEdit 17805473 8364672 wikitext text/x-wiki ندعو '''المحررين ذوي الخبرة''' في {{$1|ويكيبيديات التجريبية}} الخاصة بنا '''لترجمة وتكييف المخططات النموذجية {{$3|باستخدام هذه التعليمات}}'''. r4izn0bgw2bx2jerrxy9ti49w6axsuv Translations:Extension:CodeMirror/266/cs 1198 2394953 8364622 8333698 2026-05-03T17:13:29Z Rebulka 17532855 8364622 wikitext text/x-wiki Toto nastavení konfigurace platí pouze pro ''výchozí'' hodnotu. Uživatelé mohou přepsat výchozí hodnoty ve svých vlastních [[$1|předvolbách CodeMirror]]. h0kvapsszxy8xcmrd5g2h27jvpui5cs Wikimedia Quality Services/Automated tests available/data.json 0 2398088 8364902 8363937 2026-05-04T05:05:30Z VWalters-WMF 17613640 Update browser test listing JSON (automated) 8364902 json application/json { "schemaVersion": 1, "generatedAt": "2026-05-04T05:05:29.610Z", "repoCount": 45, "testCount": 381, "repos": [ { "repo": "mediawiki/extensions/AbuseFilter", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/AbuseFilter", "name": "AbuseFilter", "framework": "wdio", "frameworkVersion": "9.27.0", "mediawikiVersion": "6.5.0", "gatedSelenium": true, "daily": false, "dailyJobs": [], "testCount": 23, "tests": [ { "name": "Special:AbuseFilter \u003E page should exist on installation", "daily": false }, { "name": "Special:AbuseFilter \u003E page should have the button for creating a new filter", "daily": false }, { "name": "Filter editing \u003E The editing interface \u003E is visible to logged-in admins", "daily": false }, { "name": "Filter editing \u003E Trying to open a non-existing filter \u003E I should receive an error", "daily": false }, { "name": "Filter editing \u003E Creating a new filter \u003E edit can be saved (1)", "daily": false }, { "name": "Filter editing \u003E Creating a new filter \u003E saved data is retained (1)", "daily": false }, { "name": "Filter editing \u003E Editing an existing filter \u003E edit can be saved (2)", "daily": false }, { "name": "Filter editing \u003E Editing an existing filter \u003E saved data is retained (2)", "daily": false }, { "name": "Filter editing \u003E Restoring an old version of a filter \u003E edit can be saved (3)", "daily": false }, { "name": "Filter editing \u003E Restoring an old version of a filter \u003E saved data is retained (3)", "daily": false }, { "name": "Filter editing \u003E CSRF protection \u003E a CSRF token is required to save the filter", "daily": false }, { "name": "Filter editing \u003E CSRF protection \u003E even if the token is invalid, the ongoing edit is not lost", "daily": false }, { "name": "Filter editing \u003E Trying to save a filter with bad data \u003E cannot save an empty filter", "daily": false }, { "name": "Filter editing \u003E Trying to save a filter with bad data \u003E cannot save a filter with rules but no name", "daily": false }, { "name": "Filter editing \u003E editing interface is not visible to logged-out users", "daily": false }, { "name": "When importing a filter \u003E the interface should be visible", "daily": false }, { "name": "When importing a filter \u003E it should redirect to ViewEdit after submission", "daily": false }, { "name": "When importing a filter \u003E bad data results in an error", "daily": false }, { "name": "When importing a filter \u003E valid data shows the editing interface", "daily": false }, { "name": "When importing a filter \u003E Data on the editing interface is correct \u003E filter specs are copied", "daily": false }, { "name": "When importing a filter \u003E Data on the editing interface is correct \u003E filter flags are copied", "daily": false }, { "name": "When importing a filter \u003E Data on the editing interface is correct \u003E filter actions are copied", "daily": false }, { "name": "When importing a filter \u003E Data on the editing interface is correct \u003E the imported data can be saved", "daily": false } ] }, { "repo": "mediawiki/extensions/AchievementBadges", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/AchievementBadges", "name": "AchievementBadges", "framework": "wdio", "frameworkVersion": "7.40.0", "mediawikiVersion": "2.7.1", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 1, "tests": [ { "name": "Special:Achievements \u003E shows a logged-in user hint of long-user-page", "daily": false } ] }, { "repo": "mediawiki/extensions/AdvancedSearch", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/AdvancedSearch", "name": "AdvancedSearch", "framework": "wdio", "frameworkVersion": "9.27.0", "mediawikiVersion": "6.5.0", "gatedSelenium": false, "daily": true, "dailyJobs": [ { "name": "selenium-daily-beta-AdvancedSearch", "url": "https://integration.wikimedia.org/ci/job/selenium-daily-beta-AdvancedSearch/", "passes": 3, "fails": 4, "total": 7, "results": [ "P", "F", "P", "P", "F", "F", "F" ] } ], "testCount": 10, "tests": [ { "name": "Advanced Search \u003E inserts advanced search elements on search page", "daily": false }, { "name": "Advanced Search \u003E allows logged-in users to remember the selection of namespaces for future searches", "daily": false }, { "name": "Advanced Search \u003E selects the users default namespaces when logged in", "daily": false }, { "name": "Advanced Search \u003E selects the namespaces from the URL", "daily": false }, { "name": "AdvancedSearch \u003E namespace selection", "daily": false }, { "name": "AdvancedSearch \u003E re-adds filetype namespace after search when file type option has been selected but namespace has been removed", "daily": false }, { "name": "AdvancedSearch \u003E adds/removes the namespace tag when the namespace option is clicked", "daily": false }, { "name": "Advanced Search \u003E adds search parameters to pagination links", "daily": false }, { "name": "Advanced Search \u003E submits the search on enter when there is no text in \"These Words\" field", "daily": false }, { "name": "Advanced Search \u003E submits the search with the specific chosen language", "daily": false } ] }, { "repo": "mediawiki/extensions/CampaignEvents", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/CampaignEvents", "name": "CampaignEvents", "framework": "wdio", "frameworkVersion": "9.23.2", "mediawikiVersion": "6.3.0", "gatedSelenium": true, "daily": true, "dailyJobs": [ { "name": "selenium-daily-beta-CampaignEvents", "url": "https://integration.wikimedia.org/ci/job/selenium-daily-beta-CampaignEvents/", "passes": 7, "fails": 0, "total": 7, "results": [ "P", "P", "P", "P", "P", "P", "P" ] } ], "testCount": 12, "tests": [ { "name": "Edit Event Registration \u003E can allow organizer to update event page and dates", "daily": false }, { "name": "Edit Event Registration \u003E can allow organizer to change the event to be in person", "daily": false }, { "name": "Edit Event Registration \u003E can allow organizer to change the event to be online and in-person", "daily": false }, { "name": "Edit Event Registration \u003E can allow organizer to add an additional organizer", "daily": false }, { "name": "Enable Event Registration \u003E is configured correctly", "daily": true }, { "name": "Enable Event Registration \u003E requires event data", "daily": true }, { "name": "Enable Event Registration \u003E can be enabled", "daily": true }, { "name": "Event page \u003E can have one user register publicly", "daily": false }, { "name": "Event page \u003E can have one user register privately", "daily": false }, { "name": "Event page \u003E can have a user cancel registration", "daily": false }, { "name": "MyEvents \u003E can allow organizer to search events by name", "daily": false }, { "name": "MyEvents \u003E can allow organizer to delete registration of first event in My Events", "daily": false } ] }, { "repo": "mediawiki/extensions/Cargo", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/Cargo", "name": "Cargo", "framework": "wdio", "frameworkVersion": "9.18.4", "mediawikiVersion": "4.1.1", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 3, "tests": [ { "name": "Special:CargoTables \u003E displays table information", "daily": false }, { "name": "Special:Drilldown \u003E displays table name with proper page count", "daily": false }, { "name": "Special:Drilldown \u003E displays proper data when drilling down", "daily": false } ] }, { "repo": "mediawiki/extensions/CentralNotice", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/CentralNotice", "name": "CentralNotice", "framework": "wdio", "frameworkVersion": "9.19.2", "mediawikiVersion": "4.1.3", "gatedSelenium": false, "daily": true, "dailyJobs": [ { "name": "selenium-daily-beta-CentralNotice", "url": "https://integration.wikimedia.org/ci/job/selenium-daily-beta-CentralNotice/", "passes": 7, "fails": 0, "total": 7, "results": [ "P", "P", "P", "P", "P", "P", "P" ] } ], "testCount": 1, "tests": [ { "name": "CentralNotice \u003E banner is displayed on Main Page", "daily": false } ] }, { "repo": "mediawiki/extensions/CirrusSearch", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/CirrusSearch", "name": "CirrusSearch", "framework": "wdio", "frameworkVersion": "9.19.2", "mediawikiVersion": "4.1.3", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 3, "tests": [ { "name": "Smoke test for search \u003E Search suggestions", "daily": false }, { "name": "Smoke test for search \u003E Fill in search term and click search", "daily": false }, { "name": "Smoke test for search \u003E Search with accent yields result page with accent", "daily": false } ] }, { "repo": "mediawiki/extensions/Cite", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/Cite", "name": "Cite", "framework": "cypress", "frameworkVersion": "15.11.0", "mediawikiVersion": null, "gatedSelenium": true, "daily": false, "dailyJobs": [], "testCount": 11, "tests": [ { "name": "Cite popups integration \u003E simple popup on hover and hide on leave", "daily": false }, { "name": "Cite popups integration \u003E includes scrollbar and fadeout on long previews", "daily": false }, { "name": "Cite popups integration \u003E hovering nested reference", "daily": false }, { "name": "VisualEditor Cite with sub-references \u003E should convert references into sub-references", "daily": false }, { "name": "VisualEditor Cite with sub-references \u003E should update edited Main+Details ref content", "daily": false }, { "name": "VisualEditor Cite with sub-references \u003E should move main ref content to the subRef when the main ref is removed", "daily": false }, { "name": "VisualEditor Cite with citation templates \u003E should be able to add a new template in VE", "daily": false }, { "name": "VisualEditor Cite with citation templates \u003E should be able to add a new template in VE WT2017 Editor", "daily": false }, { "name": "VisualEditor Cite \u003E should be able to edit and verify reference content in Visual Editor", "daily": false }, { "name": "VisualEditor Cite \u003E should be able to reuse existing references via the reuse dialog", "daily": false }, { "name": "VisualEditor Cite with WT2017 Editor \u003E should be able to create a basic reference", "daily": false } ] }, { "repo": "mediawiki/extensions/CodeMirror", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/CodeMirror", "name": "CodeMirror", "framework": "wdio", "frameworkVersion": "9.23.2", "mediawikiVersion": "6.5.0", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 25, "tests": [ { "name": "CodeMirror code folding for the wikitext 2010 editor \u003E folds the template parameters via the button", "daily": false }, { "name": "CodeMirror code folding for the wikitext 2010 editor \u003E expands the template parameters via the button", "daily": false }, { "name": "CodeMirror code folding for the wikitext 2010 editor \u003E folds the extension tag via the button", "daily": false }, { "name": "CodeMirror code folding for the wikitext 2010 editor \u003E expands the extension tag via the button", "daily": false }, { "name": "CodeMirror code folding for the wikitext 2010 editor \u003E folds all via keyboard shortcut", "daily": false }, { "name": "CodeMirror code folding for the wikitext 2010 editor \u003E expands all via keyboard shortcut", "daily": false }, { "name": "CodeMirror code folding for the wikitext 2010 editor \u003E folds all \u003Cref\u003E tags via keyboard shortcut", "daily": false }, { "name": "CodeMirror bracket match highlighting for the wikitext 2010 editor \u003E highlights matching bracket", "daily": false }, { "name": "CodeMirror bracket match highlighting for the wikitext 2010 editor \u003E matches according to cursor movement", "daily": false }, { "name": "CodeMirror (enabled) - VisualEditor 2017 wikitext editor \u003E opens with the CodeMirror view displayed and focus set on the VE surface", "daily": false }, { "name": "CodeMirror (enabled) - VisualEditor 2017 wikitext editor \u003E updates CodeMirror with VE document changes", "daily": false }, { "name": "CodeMirror (enabled) - VisualEditor 2017 wikitext editor \u003E retains content when CodeMirror is disabled and maintains focus on VE surface", "daily": false }, { "name": "CodeMirror (enabled) - VisualEditor 2017 wikitext editor \u003E retains content when CodeMirror is re-enabled", "daily": false }, { "name": "CodeMirror (enabled) - VisualEditor 2017 wikitext editor \u003E adjusts gutter accordingly when pasting many lines of wrapping text", "daily": false }, { "name": "CodeMirror (enabled) - VisualEditor 2017 wikitext editor \u003E should only load necessary modules when the CodeMirror preference is unset", "daily": false }, { "name": "CodeMirror textSelection for the wikitext 2010 editor \u003E sets and gets the correct text when using setContents and getContents", "daily": false }, { "name": "CodeMirror textSelection for the wikitext 2010 editor \u003E has usage of .val() routed to CodeMirror", "daily": false }, { "name": "CodeMirror textSelection for the wikitext 2010 editor \u003E sets and gets the correct selection when using setSelection and getSelection", "daily": false }, { "name": "CodeMirror textSelection for the wikitext 2010 editor \u003E correctly replaces the selected text when using replaceSelection", "daily": false }, { "name": "CodeMirror textSelection for the wikitext 2010 editor \u003E returns the correct values for getCaretPosition", "daily": false }, { "name": "CodeMirror textSelection for the wikitext 2010 editor \u003E correctly wraps the selected text when using encapsulateSelection", "daily": false }, { "name": "CodeMirror textSelection for the wikitext 2010 editor \u003E correctly inserts the 'peri' option when using encapsulateSelection", "daily": false }, { "name": "CodeMirror textSelection for the wikitext 2010 editor \u003E applies 'pre'/'post' to each line when 'splitlines' is used with encapsulateSelection", "daily": false }, { "name": "CodeMirror textSelection for the wikitext 2010 editor \u003E scrolls to the correct place when using scrollToCaretPosition", "daily": false }, { "name": "CodeMirror textSelection for the wikitext 2010 editor \u003E retains the contents after turning CodeMirror off", "daily": false } ] }, { "repo": "mediawiki/extensions/CommunityConfiguration", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/CommunityConfiguration", "name": "CommunityConfiguration", "framework": "cypress", "frameworkVersion": "15.11.0", "mediawikiVersion": null, "gatedSelenium": true, "daily": false, "dailyJobs": [], "testCount": 5, "tests": [ { "name": "Community Configuration Example Page \u003E should save configuration changes and verify them on the example page", "daily": false }, { "name": "Community Configuration Example Page \u003E Form elements and basic functionality \u003E should have all expected form elements and labels", "daily": false }, { "name": "Community Configuration Example Page \u003E Form elements and basic functionality \u003E should have a save button", "daily": false }, { "name": "Community Configuration Example Page \u003E Form elements and basic functionality \u003E should have a disabled save button for logged-out users", "daily": false }, { "name": "Community Configuration Example Page \u003E Form elements and basic functionality \u003E should update a simple string via API and verify the update on the form", "daily": false } ] }, { "repo": "mediawiki/extensions/CommunityRequests", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/CommunityRequests", "name": "CommunityRequests", "framework": "wdio", "frameworkVersion": "9.18.4", "mediawikiVersion": "6.1.0", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 6, "tests": [ { "name": "WishlistIntake wish submission \u003E should prompt logged out users to login", "daily": false }, { "name": "WishlistIntake wish submission \u003E should show the form with VisualEditor when browsing to the intake form", "daily": false }, { "name": "WishlistIntake wish submission \u003E should show errors when submitting an incomplete form", "daily": false }, { "name": "WishlistIntake wish submission \u003E should not show an error if a title is over 100 chars because of translate tags", "daily": false }, { "name": "WishlistIntake wish submission \u003E should hide errors if all required fields are filled in on submission", "daily": false }, { "name": "WishlistIntake wish submission \u003E should show all the data entered in the form", "daily": false } ] }, { "repo": "mediawiki/extensions/ConfirmEdit", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/ConfirmEdit", "name": "ConfirmEdit", "framework": "wdio", "frameworkVersion": "9.27.0", "mediawikiVersion": "6.5.0", "gatedSelenium": true, "daily": false, "dailyJobs": [], "testCount": 1, "tests": [ { "name": "ConfirmEdit \u003E Main page should be accessible", "daily": false } ] }, { "repo": "mediawiki/extensions/ContactPage", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/ContactPage", "name": "ContactPage", "framework": "wdio", "frameworkVersion": "9.18.4", "mediawikiVersion": "6.1.0", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 1, "tests": [ { "name": "ContactPage on Version page \u003E ContactPage is listed in the version page under the special page category", "daily": false } ] }, { "repo": "mediawiki/extensions/ContentTranslation", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/ContentTranslation", "name": "ContentTranslation", "framework": "wdio", "frameworkVersion": "9.19.2", "mediawikiVersion": "4.1.3", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 5, "tests": [ { "name": "Unified Dashboard - Desktop - New translation \u003E should allow publishing a new translation started through search", "daily": false }, { "name": "Unified Dashboard - Suggestions \u003E should show suggestions tab", "daily": false }, { "name": "Unified Dashboard - Suggestions \u003E should allow user to save/unsave a suggestion for later", "daily": false }, { "name": "Unified Dashboard - Suggestions \u003E should allow dismissing a suggestion", "daily": false }, { "name": "Unified Dashboard - Suggestions \u003E should allow refreshing suggestions", "daily": false } ] }, { "repo": "mediawiki/core", "url": "https://gerrit.wikimedia.org/g/mediawiki/core", "name": "Core", "framework": "wdio", "frameworkVersion": "9.23.2", "mediawikiVersion": "6.5.1", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 23, "tests": [ { "name": "Special:SpecialPages \u003E should not have Edit link", "daily": false }, { "name": "User \u003E should be able to log in without page object", "daily": false }, { "name": "Main page \u003E should have edit link when using expect", "daily": false }, { "name": "Main page \u003E should have edit link when using mocha", "daily": false }, { "name": "API \u003E Main Page should exist", "daily": false }, { "name": "API \u003E Missing Page should not exist", "daily": false }, { "name": "Page \u003E should be previewable", "daily": false }, { "name": "Page \u003E should be creatable", "daily": false }, { "name": "Page \u003E should be re-creatable", "daily": false }, { "name": "Page \u003E should be editable", "daily": false }, { "name": "Page \u003E should have history", "daily": false }, { "name": "Page \u003E should be undoable", "daily": false }, { "name": "Page admin actions \u003E should be deletable", "daily": false }, { "name": "Page admin actions \u003E should be restorable", "daily": false }, { "name": "Page admin actions \u003E should be protectable", "daily": false }, { "name": "Special:RecentChanges \u003E shows page creation", "daily": false }, { "name": "Temporary user \u003E should not see signup form fields relevant to named users", "daily": false }, { "name": "Temporary user account creation \u003E should be able to create account", "daily": false }, { "name": "User \u003E should be able to create account", "daily": false }, { "name": "User \u003E should be able to log in", "daily": false }, { "name": "User \u003E named user should see extra signup form fields when creating an account", "daily": false }, { "name": "User \u003E should be able to block a user", "daily": false }, { "name": "BlankPage \u003E should have its title", "daily": false } ] }, { "repo": "mediawiki/extensions/Echo", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/Echo", "name": "Echo", "framework": "wdio", "frameworkVersion": "9.23.2", "mediawikiVersion": "6.3.0", "gatedSelenium": true, "daily": true, "dailyJobs": [ { "name": "selenium-daily-beta-Echo", "url": "https://integration.wikimedia.org/ci/job/selenium-daily-beta-Echo/", "passes": 7, "fails": 0, "total": 7, "results": [ "P", "P", "P", "P", "P", "P", "P" ] } ], "testCount": 4, "tests": [ { "name": "Echo \u003E alerts and notices are visible after logging in", "daily": true }, { "name": "Echo \u003E flyout for alert appears when clicked", "daily": true }, { "name": "Echo \u003E flyout for notices appears when clicked", "daily": true }, { "name": "Notifications \u003E checks for Notifications Page", "daily": true } ] }, { "repo": "mediawiki/extensions/ElectronPdfService", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/ElectronPdfService", "name": "ElectronPdfService", "framework": "wdio", "frameworkVersion": "9.18.4", "mediawikiVersion": "6.1.0", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 1, "tests": [ { "name": "ElectronPdfService \u003E pdf download button is visible", "daily": false } ] }, { "repo": "mediawiki/extensions/EntitySchema", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/EntitySchema", "name": "EntitySchema", "framework": "cypress", "frameworkVersion": "13.17.0", "mediawikiVersion": null, "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 17, "tests": [ { "name": "Schema Viewing Page \u003E accepts statements of entity schema data value type", "daily": false }, { "name": "Schema Edit Page \u003E given that a user is allowed \u003E returns to schema view page on submit", "daily": false }, { "name": "Schema Edit Page \u003E given that a user is allowed \u003E detects an edit conflict when submitting the same form from two windows", "daily": false }, { "name": "Schema Edit Page \u003E given that a user is allowed \u003E properly limits the input length", "daily": false }, { "name": "Schema Edit Page \u003E given the user is blocked \u003E cannot be edited", "daily": false }, { "name": "NewEntitySchema:Page \u003E is possible to create a new schema with full data", "daily": false }, { "name": "NewEntitySchema:Page \u003E is possible to create a new schema with only a label", "daily": false }, { "name": "NewEntitySchema:Page \u003E limits the name badge input length", "daily": false }, { "name": "NewEntitySchema:Page \u003E limits the schema text input length", "daily": false }, { "name": "NewEntitySchema:Page \u003E when blocked \u003E cannot load form", "daily": false }, { "name": "NewEntitySchema:Page \u003E when blocked \u003E cannot submit form", "daily": false }, { "name": "SetEntitySchemaLabelDescriptionAliasesPage:Page \u003E detects an edit conflict based on the baserev parameter", "daily": false }, { "name": "SetEntitySchemaLabelDescriptionAliasesPage:Page \u003E limits the input length", "daily": false }, { "name": "SetEntitySchemaLabelDescriptionAliasesPage:Page \u003E is possible to edit Schema in another language", "daily": false }, { "name": "SetEntitySchemaLabelDescriptionAliasesPage:Page \u003E has existing data already prefilled", "daily": false }, { "name": "Schema Viewing Page \u003E doesn\\", "daily": false }, { "name": "wbui2025 entity schema datatype \u003E mobile view - entity-schema datatype \u003E displays item statement and supports full editing workflow", "daily": false } ] }, { "repo": "mediawiki/extensions/examples", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/examples", "name": "examples", "framework": "wdio", "frameworkVersion": "9.23.2", "mediawikiVersion": "6.5.1", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 3, "tests": [ { "name": "api \u003E can create a user", "daily": false }, { "name": "api \u003E can read a page", "daily": false }, { "name": "Examples \u003E is configured correctly", "daily": false } ] }, { "repo": "mediawiki/extensions/FacetedCategory", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/FacetedCategory", "name": "FacetedCategory", "framework": "wdio", "frameworkVersion": "9.20.1", "mediawikiVersion": "4.1.1", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 2, "tests": [ { "name": "Special:CategoryIntersectionSearch \u003E shows a page if valid subpage is given", "daily": false }, { "name": "Special:CategoryIntersectionSearch \u003E shows a page if the category contains a space", "daily": false } ] }, { "repo": "mediawiki/extensions/GlobalWatchlist", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/GlobalWatchlist", "name": "GlobalWatchlist", "framework": "wdio", "frameworkVersion": "9.18.4", "mediawikiVersion": "5.1.0", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 1, "tests": [ { "name": "Special:GlobalWatchlist \u003E works with normal display", "daily": false } ] }, { "repo": "mediawiki/extensions/GrowthExperiments", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/GrowthExperiments", "name": "GrowthExperiments", "framework": "cypress", "frameworkVersion": "15.14.0", "mediawikiVersion": null, "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 15, "tests": [ { "name": "Add a Link \u003E link inspector can be used to accept/reject links and save an article.", "daily": false }, { "name": "Add Image Structured Task \u003E desktop: user can view image info and image details", "daily": false }, { "name": "Add Image Structured Task \u003E mobile: user can close the image suggestion UI", "daily": false }, { "name": "Special:EditGrowthConfig \u003E redirects to Special:CommunityConfiguration", "daily": false }, { "name": "Special:Homepage \u003E Shows a suggested edits card and allows navigation forwards and backwards through queue", "daily": false }, { "name": "Impact \u003E shows the user\\", "daily": false }, { "name": "Special:MentorDashboard \u003E allows enrolling as a mentor", "daily": false }, { "name": "Revise Tone \u003E On desktop \u003E Shows the Revise Tone Edit Check", "daily": false }, { "name": "Revise Tone \u003E On desktop \u003E Closes the Editor when declining Edits and suggests a new task", "daily": false }, { "name": "Revise Tone \u003E On desktop \u003E Shows the Revise Tone Edit Check and tags edits", "daily": false }, { "name": "Revise Tone \u003E On mobile \u003E Shows the Revise Tone Edit Check", "daily": false }, { "name": "Revise Tone \u003E On mobile \u003E Closes the Editor when declining Edits and suggests a new task", "daily": false }, { "name": "Revise Tone \u003E On mobile \u003E Shows the Revise Tone Edit Check and tags edits", "daily": false }, { "name": "Template-based tasks \u003E saves change tags for unstructured task edits made via VisualEditor", "daily": false }, { "name": "Special:Log \u003E Shows the GrowthExperiments event Mentor assignment changes", "daily": false } ] }, { "repo": "mediawiki/extensions/GuidedTour", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/GuidedTour", "name": "GuidedTour", "framework": "cypress", "frameworkVersion": "15.11.0", "mediawikiVersion": null, "gatedSelenium": true, "daily": false, "dailyJobs": [], "testCount": 1, "tests": [ { "name": "template spec \u003E passes", "daily": false } ] }, { "repo": "mediawiki/extensions/Math", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/Math", "name": "Math", "framework": "wdio", "frameworkVersion": "9.23.2", "mediawikiVersion": "6.3.0", "gatedSelenium": true, "daily": true, "dailyJobs": [ { "name": "selenium-daily-beta-Math", "url": "https://integration.wikimedia.org/ci/job/selenium-daily-beta-Math/", "passes": 7, "fails": 0, "total": 7, "results": [ "P", "P", "P", "P", "P", "P", "P" ] } ], "testCount": 5, "tests": [ { "name": "Math \u003E should work for addition", "daily": false }, { "name": "Math polyfills skipFunction \u003E returns true when all MathML features are supported", "daily": false }, { "name": "Math polyfills skipFunction \u003E returns false when a required feature is missing", "daily": false }, { "name": "Math polyfills skipFunction \u003E skips loading when the skipFunction returns true", "daily": false }, { "name": "Math polyfills skipFunction \u003E loads when the skipFunction returns false", "daily": false } ] }, { "repo": "mediawiki/skins/MinervaNeue", "url": "https://gerrit.wikimedia.org/g/mediawiki/skins/MinervaNeue", "name": "MinervaNeue", "framework": "wdio", "frameworkVersion": "9.23.2", "mediawikiVersion": "6.3.0", "gatedSelenium": true, "daily": false, "dailyJobs": [], "testCount": 3, "tests": [ { "name": "Opening and closing the reference drawer \u003E Opening a reference", "daily": false }, { "name": "Opening and closing the reference drawer \u003E Opening a nested reference", "daily": false }, { "name": "Manage Watchlist \u003E Add an article to the watchlist", "daily": false } ] }, { "repo": "mediawiki/extensions/Newsletter", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/Newsletter", "name": "Newsletter", "framework": "wdio", "frameworkVersion": "9.18.4", "mediawikiVersion": "6.1.0", "gatedSelenium": false, "daily": true, "dailyJobs": [ { "name": "selenium-daily-beta-Newsletter", "url": "https://integration.wikimedia.org/ci/job/selenium-daily-beta-Newsletter/", "passes": 7, "fails": 0, "total": 7, "results": [ "P", "P", "P", "P", "P", "P", "P" ] } ], "testCount": 1, "tests": [ { "name": "Newsletter \u003E page should exist on installation", "daily": false } ] }, { "repo": "mediawiki/extensions/OpenIDConnect", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/OpenIDConnect", "name": "OpenIDConnect", "framework": "wdio", "frameworkVersion": "9.19.2", "mediawikiVersion": "4.1.3", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 2, "tests": [ { "name": "OpenIDConnect \u003E can login", "daily": false }, { "name": "OpenIDConnect \u003E is configured correctly", "daily": false } ] }, { "repo": "mediawiki/extensions/PageTriage", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/PageTriage", "name": "PageTriage", "framework": "wdio", "frameworkVersion": "9.23.2", "mediawikiVersion": "6.3.2", "gatedSelenium": true, "daily": false, "dailyJobs": [], "testCount": 5, "tests": [ { "name": "Special:NewPagesFeed \u003E is viewable", "daily": false }, { "name": "Special:NewPagesFeed \u003E new article appears in feed", "daily": false }, { "name": "PageTriage Toolbar \u003E should load", "daily": false }, { "name": "PageTriage Toolbar \u003E should allow user to add a maintainence tag to a page", "daily": false }, { "name": "PageTriage Toolbar \u003E should allow user to add a maintainence tag to a page and send a note to user", "daily": false } ] }, { "repo": "mediawiki/extensions/ParserMigration", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/ParserMigration", "name": "ParserMigration", "framework": "wdio", "frameworkVersion": "9.19.2", "mediawikiVersion": "6.1.0", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 2, "tests": [ { "name": "ParserMigration \u003E should use parsoid with useparsoid=1 param", "daily": false }, { "name": "ParserMigration \u003E should use legacy parser with useparsoid=0 param", "daily": false } ] }, { "repo": "mediawiki/extensions/Popups", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/Popups", "name": "Popups", "framework": "wdio", "frameworkVersion": "9.15.0", "mediawikiVersion": "4.1.3", "gatedSelenium": false, "daily": true, "dailyJobs": [ { "name": "selenium-daily-beta-Popups", "url": "https://integration.wikimedia.org/ci/job/selenium-daily-beta-Popups/", "passes": 7, "fails": 0, "total": 7, "results": [ "P", "P", "P", "P", "P", "P", "P" ] } ], "testCount": 3, "tests": [ { "name": "Dwelling on a valid page link \u003E I should see a page preview", "daily": false }, { "name": "Dwelling on a valid page link \u003E I should not see a page preview on hash fragment", "daily": false }, { "name": "Dwelling on a valid page link \u003E Abandoning link hides page preview", "daily": false } ] }, { "repo": "mediawiki/extensions/ProofreadPage", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/ProofreadPage", "name": "ProofreadPage", "framework": "wdio", "frameworkVersion": "9.23.2", "mediawikiVersion": "6.3.0", "gatedSelenium": true, "daily": false, "dailyJobs": [], "testCount": 5, "tests": [ { "name": "For a page with the eis, the page status module \u003E should initialize with the value of current page", "daily": false }, { "name": "For a page with the eis, the page status module \u003E should update on page change", "daily": false }, { "name": "For a page with eis enabled \u003E toolbar loads", "daily": false }, { "name": "For a page with eis enabled \u003E prev to page 1", "daily": false }, { "name": "For a page with eis enabled \u003E next to last page", "daily": false } ] }, { "repo": "mediawiki/extensions/RelatedArticles", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/RelatedArticles", "name": "RelatedArticles", "framework": "wdio", "frameworkVersion": "9.20.0", "mediawikiVersion": "4.1.3", "gatedSelenium": false, "daily": true, "dailyJobs": [ { "name": "selenium-daily-beta-RelatedArticles", "url": "https://integration.wikimedia.org/ci/job/selenium-daily-beta-RelatedArticles/", "passes": 7, "fails": 0, "total": 7, "results": [ "P", "P", "P", "P", "P", "P", "P" ] } ], "testCount": 1, "tests": [ { "name": "ReadMore \u003E ReadMore is present in Minerva", "daily": true } ] }, { "repo": "mediawiki/extensions/ReportIncident", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/ReportIncident", "name": "ReportIncident", "framework": "wdio", "frameworkVersion": "9.27.0", "mediawikiVersion": "6.5.1", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 6, "tests": [ { "name": "ReportIncident dialog \u003E Should open the dialog if the tools menu is used", "daily": false }, { "name": "ReportIncident dialog \u003E Should be able to advance to step 2 and see a form with the expected fields", "daily": false }, { "name": "ReportIncident dialog \u003E Should ask for additional details only when selecting \"Something else\"", "daily": false }, { "name": "ReportIncident dialog \u003E Should display form errors when submit attempted with no form data", "daily": false }, { "name": "ReportIncident dialog \u003E Should be able to submit a form with valid data", "daily": false }, { "name": "ReportIncident dialog \u003E Should be able to fill a report from a thread", "daily": false } ] }, { "repo": "mediawiki/extensions/RevisionSlider", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/RevisionSlider", "name": "RevisionSlider", "framework": "wdio", "frameworkVersion": "9.18.4", "mediawikiVersion": "5.1.0", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 21, "tests": [ { "name": "RevisionSlider expand \u003E does not automatically expand by default", "daily": false }, { "name": "RevisionSlider expand \u003E expands automatically when auto expand is on", "daily": false }, { "name": "RevisionSlider expand \u003E does not expand automatically when auto expand is off", "daily": false }, { "name": "RevisionSlider expand \u003E hides when collapsed manually", "daily": false }, { "name": "RevisionSlider diff links \u003E older edit diff link can be clicked", "daily": false }, { "name": "RevisionSlider diff links \u003E newer edit diff link can be clicked", "daily": false }, { "name": "RevisionSlider filter highlighting \u003E highlights revisions by the same user when I use the user filter", "daily": false }, { "name": "RevisionSlider filter highlighting \u003E stops highlighting revisions when the filter is clicked twice", "daily": false }, { "name": "RevisionSlider filter highlighting \u003E highlights revisions that have the same tag when I use the tag filter", "daily": false }, { "name": "RevisionSlider filter highlighting \u003E highlights revisions that have the same tag when I use the tag filter after I used the user filter", "daily": false }, { "name": "RevisionSlider filter highlighting \u003E only highlights revisions that have the same tag when I selected a user but hover a tag filter", "daily": false }, { "name": "RevisionSlider filter highlighting \u003E re-applies highlight when I selected a user but hover and on-hover a tag filter", "daily": false }, { "name": "RevisionSlider help \u003E tutorial is present on first load", "daily": false }, { "name": "RevisionSlider help \u003E tutorial is not present after it was dismissed once", "daily": false }, { "name": "RevisionSlider help \u003E tutorial sequence works", "daily": false }, { "name": "RevisionSlider history \u003E can be accessed using browser back and forward buttons after clicking", "daily": false }, { "name": "RevisionSlider history \u003E can be accessed using browser back and forward buttons after dragging", "daily": false }, { "name": "RevisionSlider pointers \u003E can be dragged", "daily": false }, { "name": "RevisionSlider timeline arrows \u003E should be disabled with 3 revisions", "daily": false }, { "name": "RevisionSlider timeline arrows \u003E should be enabled with adequate revisions", "daily": false }, { "name": "RevisionSlider revision tooltips \u003E appears and remains on hovering it", "daily": false } ] }, { "repo": "mediawiki/extensions/Sanctions", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/Sanctions", "name": "Sanctions", "framework": "wdio", "frameworkVersion": "9.19.2", "mediawikiVersion": "4.1.3", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 9, "tests": [ { "name": "Sanction \u003E should be canceled by the author", "daily": false }, { "name": "Sanction \u003E should be rejected if three users object", "daily": false }, { "name": "Sanction \u003E should be passed if three users support before expired", "daily": false }, { "name": "Sanction \u003E should block the target user of the passed sanction when logged in", "daily": false }, { "name": "Sanction \u003E should not touch the summary of a expired handled sanction", "daily": false }, { "name": "Special:Sanctions \u003E should hide and show the form as the conditions change", "daily": false }, { "name": "Special:Sanctions \u003E should add voted tag on a sanction", "daily": false }, { "name": "Special:Sanctions \u003E should show \u003E an anonymous user not-logged-in warning", "daily": false }, { "name": "Special:Sanctions \u003E should show \u003E a newly registered user that you are too new", "daily": false } ] }, { "repo": "mediawiki/extensions/Score", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/Score", "name": "Score", "framework": "cypress", "frameworkVersion": "15.8.2", "mediawikiVersion": null, "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 1, "tests": [ { "name": "add score statement \u003E mobile view \u003E loads the item view, allows statements to be edited ", "daily": false } ] }, { "repo": "mediawiki/extensions/TemplateData", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/TemplateData", "name": "TemplateData", "framework": "wdio", "frameworkVersion": "9.23.2", "mediawikiVersion": "6.3.0", "gatedSelenium": true, "daily": false, "dailyJobs": [], "testCount": 3, "tests": [ { "name": "TemplateData users can favorite templates via VisualEditor \u003E show a template search field, with focus", "daily": false }, { "name": "TemplateData users can favorite templates via VisualEditor \u003E show anon users a message about needing to log in", "daily": false }, { "name": "TemplateData users can favorite templates via VisualEditor \u003E logged-in users can favorite templates from the search results", "daily": false } ] }, { "repo": "mediawiki/extensions/TemplateWizard", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/TemplateWizard", "name": "TemplateWizard", "framework": "wdio", "frameworkVersion": "9.18.4", "mediawikiVersion": "6.1.0", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 4, "tests": [ { "name": "TemplateWizard \u003E has 1 (required) field visible", "daily": false }, { "name": "TemplateWizard \u003E has 5 fields visible", "daily": false }, { "name": "TemplateWizard \u003E has template inserted", "daily": false }, { "name": "TemplateWizard \u003E can be closed from search", "daily": false } ] }, { "repo": "wikibase/termbox", "url": "https://gerrit.wikimedia.org/g/wikibase/termbox", "name": "termbox", "framework": "wdio", "frameworkVersion": "9.20.0", "mediawikiVersion": "6.5.1", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 25, "tests": [ { "name": "Termbox: AnonEditWarning \u003E shows the warning overlay for anonymous users when clicking the edit button", "daily": false }, { "name": "Termbox: AnonEditWarning \u003E can be dismissed", "daily": false }, { "name": "Termbox: AnonEditWarning \u003E does not show the warning overlay again if the user opts out", "daily": false }, { "name": "Termbox: AnonEditWarning \u003E never appears for logged in users", "daily": false }, { "name": "Termbox: LicenseOverlay \u003E is shown when clicking publish", "daily": false }, { "name": "Termbox: LicenseOverlay \u003E disappears when clicking cancel and goes back to edit mode", "daily": false }, { "name": "Termbox: LicenseOverlay \u003E disappears and saves when clicking publish", "daily": false }, { "name": "Termbox: LicenseOverlay \u003E does not reappear after saving by default", "daily": false }, { "name": "Termbox: LicenseOverlay \u003E reappears after saving when unchecking the \"remember my choice\" checkbox", "daily": false }, { "name": "Termbox: editing \u003E edit mode \u003E is in edit mode after clicking the edit button", "daily": false }, { "name": "Termbox: editing \u003E edit mode \u003E switches back to reading mode when clicking the cancel button", "daily": false }, { "name": "Termbox: editing \u003E editing \u003E can edit labels, descriptions, and aliases", "daily": false }, { "name": "Termbox: editing \u003E editing \u003E shows an error when an edit fails to save when the entity was protected while editing", "daily": false }, { "name": "Termbox: reading \u003E is in reading mode when opening the item page", "daily": false }, { "name": "Termbox: reading \u003E primary language terms \u003E contains the expected language with respective terms", "daily": false }, { "name": "Termbox: reading \u003E \"in more languages\" section \u003E has a collapse/expand button", "daily": false }, { "name": "Termbox: reading \u003E \"in more languages\" section \u003E is expanded by default", "daily": false }, { "name": "Termbox: reading \u003E \"in more languages\" section \u003E is collapsible, also hiding the \"all entered languages\" section", "daily": false }, { "name": "Termbox: reading \u003E \"in more languages\" section \u003E expands again when clicking the button twice", "daily": false }, { "name": "Termbox: reading \u003E \"in more languages\" section \u003E contains the expected languages with respective terms", "daily": false }, { "name": "Termbox: reading \u003E \"all entered languages\" section \u003E is collapsed by default", "daily": false }, { "name": "Termbox: reading \u003E \"all entered languages\" section \u003E has a collapse/expand button", "daily": false }, { "name": "Termbox: reading \u003E \"all entered languages\" section \u003E is expandable", "daily": false }, { "name": "Termbox: reading \u003E \"all entered languages\" section \u003E collapses again when clicking the button twice", "daily": false }, { "name": "Termbox: reading \u003E \"all entered languages\" section \u003E contains the expected languages with respective terms", "daily": false } ] }, { "repo": "mediawiki/extensions/TwoColConflict", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/TwoColConflict", "name": "TwoColConflict", "framework": "wdio", "frameworkVersion": "9.27.0", "mediawikiVersion": "6.5.1", "gatedSelenium": false, "daily": true, "dailyJobs": [ { "name": "selenium-daily-beta-TwoColConflict", "url": "https://integration.wikimedia.org/ci/job/selenium-daily-beta-TwoColConflict/", "passes": 7, "fails": 0, "total": 7, "results": [ "P", "P", "P", "P", "P", "P", "P" ] } ], "testCount": 14, "tests": [ { "name": "TwoColConflict EditUi \u003E will switch to edit mode by clicking the column that is selected", "daily": false }, { "name": "TwoColConflict EditUi \u003E edits of unchanged paragraphs should be saved", "daily": false }, { "name": "TwoColConflict EditUi \u003E paragraph edits can be reverted", "daily": false }, { "name": "TwoColConflict EditUi \u003E saving an editor with no changes will preserve the highlight portions", "daily": false }, { "name": "TwoColConflict without JavaScript \u003E is showing the default version correctly", "daily": false }, { "name": "TwoColConflict without JavaScript \u003E is showing the talk page version correctly", "daily": false }, { "name": "TwoColConflict without JavaScript \u003E handles order selection on the talk page version correctly", "daily": false }, { "name": "TwoColConflict save and preview \u003E should save a resolved conflict successfully including changes", "daily": false }, { "name": "TwoColConflict save and preview \u003E should show a correct preview page including changes", "daily": false }, { "name": "TwoColConflict \u003E shows the talk page screen on conflicts that also add new lines", "daily": false }, { "name": "TwoColConflict \u003E on talk page conflicts \u003E shows the talk page screen correctly", "daily": false }, { "name": "TwoColConflict \u003E on talk page conflicts \u003E swaps blocks when switch button is clicked", "daily": false }, { "name": "TwoColConflict \u003E on talk page conflicts \u003E shows correct preview when swapped", "daily": false }, { "name": "TwoColConflict \u003E on talk page conflicts \u003E stores correct merge when swapped and edited", "daily": false } ] }, { "repo": "mediawiki/extensions/VisualEditor", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/VisualEditor", "name": "VisualEditor", "framework": "wdio", "frameworkVersion": "9.23.2", "mediawikiVersion": "6.3.0", "gatedSelenium": true, "daily": true, "dailyJobs": [ { "name": "selenium-daily-beta-VisualEditor", "url": "https://integration.wikimedia.org/ci/job/selenium-daily-beta-VisualEditor/", "passes": 7, "fails": 0, "total": 7, "results": [ "P", "P", "P", "P", "P", "P", "P" ] } ], "testCount": 34, "tests": [ { "name": "Content Editable \u003E should load when an url is opened", "daily": true }, { "name": "Content Editable \u003E should be editable", "daily": false }, { "name": "Content Editable \u003E should save an edit", "daily": false }, { "name": "Content Editable \u003E should insert a table", "daily": false }, { "name": "Content Editable \u003E should insert Bullet list", "daily": false }, { "name": "Content Editable \u003E should insert Numbered list", "daily": false }, { "name": "Content Editable \u003E should insert and indent Bullet list", "daily": false }, { "name": "Content Editable \u003E should insert and indent Numbered list", "daily": false }, { "name": "Content Editable \u003E should insert an internal link", "daily": false }, { "name": "Content Editable \u003E should insert an external link", "daily": false }, { "name": "Content Editable \u003E should insert a comment", "daily": false }, { "name": "Content Editable Formatting \u003E should change text to Page title", "daily": false }, { "name": "Content Editable Formatting \u003E should change text to Heading", "daily": false }, { "name": "Content Editable Formatting \u003E should change text to Sub-heading 1", "daily": false }, { "name": "Content Editable Formatting \u003E should change text to Sub-heading 2", "daily": false }, { "name": "Content Editable Formatting \u003E should change text to Sub-heading 3", "daily": false }, { "name": "Content Editable Formatting \u003E should change text to Sub-heading 4", "daily": false }, { "name": "Content Editable Formatting \u003E should change text to Preformatted", "daily": false }, { "name": "Content Editable Formatting \u003E should change text to Block quote", "daily": false }, { "name": "Content Editable Formatting \u003E should change formatting to Bold", "daily": false }, { "name": "Content Editable Formatting \u003E should change formatting to Italic", "daily": false }, { "name": "Content Editable Formatting \u003E should change formatting to Superscript", "daily": false }, { "name": "Content Editable Formatting \u003E should change formatting to Subscript", "daily": false }, { "name": "Content Editable Formatting \u003E should change formatting to Computer code", "daily": false }, { "name": "Content Editable Formatting \u003E should change formatting to Strikethrough", "daily": false }, { "name": "Content Editable Formatting \u003E should change formatting to Underline", "daily": false }, { "name": "Toolbar \u003E should open notices popup as soon as it loads", "daily": false }, { "name": "Toolbar \u003E should open switch editor", "daily": false }, { "name": "Toolbar \u003E should open page options", "daily": false }, { "name": "Toolbar \u003E should open help popup", "daily": false }, { "name": "Toolbar \u003E should open insert menu", "daily": false }, { "name": "Toolbar \u003E should open structure options menu", "daily": false }, { "name": "Toolbar \u003E should open style text options", "daily": false }, { "name": "Toolbar \u003E should open format paragraph menu", "daily": false } ] }, { "repo": "mediawiki/extensions/Wikibase", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/Wikibase", "name": "Wikibase", "framework": "cypress", "frameworkVersion": "14.5.3", "mediawikiVersion": null, "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 18, "tests": [ { "name": "wbui2025 language preferences and RTL functionality \u003E mobile view \u003E Checking RTL layout when editing statements", "daily": false }, { "name": "wbui2025 add qualifiers \u003E mobile view \u003E is possible to add and edit a qualifier", "daily": false }, { "name": "wbui2025 add qualifiers \u003E mobile view (wbui2025) - tabular-data qualifier \u003E can add a tabular-data qualifier with lookup", "daily": false }, { "name": "wbui2025 add qualifiers \u003E mobile view (wbui2025) - geo-shape qualifier \u003E can add a geo-shape qualifier with lookup", "daily": false }, { "name": "wbui2025 add qualifiers \u003E mobile view (wbui2025) - geo-shape qualifier \u003E shows dropdown menu when typing in geo-shape qualifier lookup", "daily": false }, { "name": "wbui2025 add reference \u003E mobile view \u003E is possible to add references for string and lookup datatypes", "daily": false }, { "name": "wbui2025 item view add statement \u003E mobile view \u003E loads the item view and shows property selector", "daily": false }, { "name": "wbui2025 item view add additional value to existing statement \u003E full add-value workflow \u003E opens the add-value modal, searches, selects, and confirms value", "daily": false }, { "name": "wbui2025 item view add additional value to existing statement \u003E cancel behavior \u003E opens the add-value modal and cancels cleanly without enabling the save button", "daily": false }, { "name": "wbui2025 entityId datatypes (item, property) \u003E mobile view - \u003E allows adding ", "daily": false }, { "name": "wbui2025 edit references \u003E mobile view \u003E references are editable and deletable", "daily": false }, { "name": "wbui2025 item view edit statements \u003E mobile view \u003E loads the item view and shows a statement, which can be edited, ", "daily": false }, { "name": "wbui2025 string datatypes (tabular-data, geo-shape, commonsMedia) \u003E mobile view - tabular-data datatype \u003E displays tabular-data statement and supports full editing workflow", "daily": false }, { "name": "wbui2025 string datatypes (tabular-data, geo-shape, commonsMedia) \u003E mobile view - geo-shape datatype \u003E displays geo-shape statement and supports full editing workflow", "daily": false }, { "name": "wbui2025 string datatypes (tabular-data, geo-shape, commonsMedia) \u003E mobile view - commonsMedia datatype \u003E displays commonsMedia statement and supports full editing workflow", "daily": false }, { "name": "wbui2025 time datatypes \u003E mobile view - time datatype \u003E allows adding time statement to empty item, ", "daily": false }, { "name": "wbui2025 item view publish statement changes \u003E mobile view \u003E loads the item view and shows a statement, which can be edited", "daily": false }, { "name": "wbui2025 item view \u003E mobile view \u003E loads the item view", "daily": false } ] }, { "repo": "mediawiki/extensions/Wikibase", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/Wikibase", "name": "Wikibase", "framework": "wdio", "frameworkVersion": "9.20.0", "mediawikiVersion": "6.5.1", "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 7, "tests": [ { "name": "item \u003E can add a statement using the keyboard", "daily": false }, { "name": "item \u003E old revisions do not have an edit link", "daily": false }, { "name": "item \u003E has its label not rendered when linked on a Wikipage", "daily": false }, { "name": "WikibaseRepoNonExistingItemPage \u003E edit tab does should not be there", "daily": false }, { "name": "WikibaseRepoNonExistingItemPage \u003E the title should match", "daily": false }, { "name": "WikibaseReferenceOnProtectedPage \u003E can expand collapsed references on a protected page as unprivileged user", "daily": false }, { "name": "Add interlanguage links \u003E dialog loads on click", "daily": false } ] }, { "repo": "mediawiki/extensions/WikibaseLexeme", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/WikibaseLexeme", "name": "WikibaseLexeme", "framework": "cypress", "frameworkVersion": "13.17.0", "mediawikiVersion": null, "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 17, "tests": [ { "name": "Lexeme:Forms \u003E can be open the add Form, cancel the add, open it again and save. ", "daily": false }, { "name": "Lexeme:Forms \u003E can add, edit and remove representation. it ", "daily": false }, { "name": "Lexeme:Forms \u003E has statement list and can edit statements on a new Form", "daily": false }, { "name": "Lexeme:Forms \u003E FormId generation \u003E FormId counter is not decremented when addForm is undone", "daily": false }, { "name": "Lexeme:Forms \u003E FormId generation \u003E FormId counter is not decremented when old revision is restored", "daily": false }, { "name": "Lexeme:Forms \u003E can be removed", "daily": false }, { "name": "Lexeme:Header \u003E can edit the language and lexical category of a Lexeme", "daily": false }, { "name": "Lexeme:non-existing \u003E says the entity does not exist", "daily": false }, { "name": "Lexeme:Senses \u003E Sense header and container exist", "daily": false }, { "name": "Special:MergeLexemes \u003E shows the form", "daily": false }, { "name": "Special:MergeLexemes \u003E when blocked \u003E is not possible to edit", "daily": false }, { "name": "NewLexeme:Page \u003E shows the form and creating a lexeme is possible", "daily": false }, { "name": "Special:RecentChanges \u003E shows lemmas in title links to lexemes on Special:RecentChanges", "daily": false }, { "name": "Special:Watchlist \u003E shows lemmas in title links to lexemes on Special:Watchlist", "daily": false }, { "name": "Lexeme:Statements \u003E can be added", "daily": false }, { "name": "Special Version Page \u003E verifies that the WikibaseLexeme extension loads", "daily": false }, { "name": "wbui2025 Lexeme entityId datatypes (lexeme, form, sense) \u003E mobile view - \u003E displays item statement and supports full editing workflow", "daily": false } ] }, { "repo": "mediawiki/extensions/WikibaseQualityConstraints", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/WikibaseQualityConstraints", "name": "WikibaseQualityConstraints", "framework": "cypress", "frameworkVersion": "15.7.1", "mediawikiVersion": null, "gatedSelenium": false, "daily": false, "dailyJobs": [], "testCount": 3, "tests": [ { "name": "show constraints \u003E desktop view \u003E loads the item view with a simple violation", "daily": false }, { "name": "show constraints \u003E desktop view \u003E loads the item view with an advanced violation", "daily": false }, { "name": "show constraints \u003E wbui2025 mobile view \u003E adds an indicator, and a popover containing all violations", "daily": false } ] }, { "repo": "mediawiki/extensions/WikiLambda", "url": "https://gerrit.wikimedia.org/g/mediawiki/extensions/WikiLambda", "name": "WikiLambda", "framework": "wdio", "frameworkVersion": "9.20.1", "mediawikiVersion": "6.1.0", "gatedSelenium": false, "daily": true, "dailyJobs": [ { "name": "wikilambda-catalyst-end-to-end-daily", "url": "https://integration.wikimedia.org/ci/job/wikilambda-catalyst-end-to-end-daily/", "passes": 5, "fails": 2, "total": 7, "results": [ "F", "F", "P", "P", "P", "P", "P" ] } ], "testCount": 18, "tests": [ { "name": "Abstract Article (Special:ViewAbstract) \u003E loads and renders content + preview widgets", "daily": false }, { "name": "Abstract Article (Special:ViewAbstract) \u003E shows the expected error fragment when a function returns wrong type", "daily": false }, { "name": "Abstract Article (Special:ViewAbstract) \u003E allows switching preview language", "daily": false }, { "name": "Installation checks \u003E CreateObject \u003E page should exist on installation but deny to logged-out user", "daily": false }, { "name": "Installation checks \u003E CreateObject \u003E page should exist on installation and work when logged in", "daily": false }, { "name": "Installation checks \u003E RunFunction \u003E page should exist on installation", "daily": false }, { "name": "Installation checks \u003E ListObjectsByType \u003E page should exist on installation", "daily": false }, { "name": "Dynamic Test for Implementation and Test Case Connection \u003E Admin user \u003E should dynamically connect or disconnect the implementation based on its initial state", "daily": false }, { "name": "Dynamic Test for Implementation and Test Case Connection \u003E Admin user \u003E should dynamically connect or disconnect the test case based on its initial state", "daily": false }, { "name": "Function \u003E Function viewer (CUJ1) \u003E should allow to evaluate a function", "daily": false }, { "name": "Function \u003E Function editor (CUJ2) \u003E should create a new function and display the function name", "daily": false }, { "name": "Function \u003E Function editor (CUJ2) \u003E should create a new function and display function aliases", "daily": false }, { "name": "Function \u003E Function editor (CUJ2) \u003E should create a new function and display function input labels and types", "daily": false }, { "name": "Function \u003E Function editor (CUJ2) \u003E should create a new function and display function output type", "daily": false }, { "name": "Implementation (CUJ 5) \u003E Implementation via code \u003E should create and publish a new implementation", "daily": false }, { "name": "Implementation (CUJ 5) \u003E Implementation via composition \u003E should create and publish a new implementation", "daily": false }, { "name": "Tester \u003E Create a new test (CUJ 4) \u003E should fill and submit the tester form", "daily": false }, { "name": "Tester \u003E Edit the test \u003E should edit the about block test", "daily": false } ] } ] } 0j5d9a373t2sbhu1d9ztw484lxe4c4x XTools/User guide 0 2401492 8364413 8360123 2026-05-03T15:03:07Z Alien333 17744847 8364413 wikitext text/x-wiki {{draft}} This guide is aimed at non-WMF wiki administrators interested in having an XTools installation for their Wiki(s). Therefore first set <code>APP_IS_WMF=0</code>. Do note that the tools Blame and Authorship (based on [[WikiWho]]) are not available for non-WMF projects, and the values given to the correspoding <code>APP_ENABLE_</code> variables will have no effect. Furthermore, <code>APP_REPLAG_THRESHOLD</code> does not do anything either. {{todo|Maybe in fact all the global stuff ought to be always disabled on non-WMF (given it largely relies on CentralAuth, &c, &c). Or maybe avoid CentralAuth dependance altogether? Theoretically we could just get on with dblists+meta_p.wiki. We ''would'' be querying too many wikis initially because we wouldn't have the system edit counts for each wiki but that can't take that much time to assemble. The global rights stuff has of course an unredeemable dependence on CentralAuth, but GlobalContribs could be available without that}} Tested only for MySQL/MariaDB (Sqlite does not expose a port and as such cannot be used with XTools). == Databse configuration== These settings are assumed to be the same across all wikis or slices (if have multiple), even though Mediawiki would let you not take the same: * <code>DATABASE_REPLICA_USER</code>: username of a database user with read rights (e.g. <code>[[$wgDBuser]]</code>) * <code>DATABASE_REPLICA_PASSWORD</code>: password of a database user with read rights (e.g. <code>[[$wgDBpassword]]</code>) * <code>API_PATH</code>: <code>[[$wgScriptPath]]</code> concatenated with <code>/api.php</code> === Single-wiki setups=== If you only intend to use XTools on a single project, configuration is relatively straightforward (all steps in <code>.env</code>, the $variables are as initialised in your [[LocalSettings.php]]): * <code>DATABASE_SINGLE_NAME</code>: <code>[[$wgDBname]]</code> * <code>DATABASE_REPLICA_HOST_S1</code>: <code>[[$wgDBserver]]</code> * <code>DATABASE_REPLICA_PORT_S1</code>: 3306 if using MariaDB/MySQL * <code>DEFAULT_PROJECT</code>: <code>[[$wgServer]]</code> * <code>CENTRAL_AUTH_PROJECT</code>: <code>[[$wgServer]]</code> * <code>APP_SINGLE_WIKI</code>: 1 Do note that the GlobalContributions tool is not available for single-wiki setups and as such <code>APP_ENABlE_GLOBALCONTRIBS</code> in these cases does not have any effect. You can safely ignore <code>DATABASE_META_*</code>. === Multiple-wiki setups === Your wikis' databases can be split into as many database servers as you want, which we will name ''slices'' (by analogy with [[wikitech:MariaDB#Core (MediaWiki databases)|the WMF setup]]), numbered s1, s2, s3, ..., sN. (XTools automatically figures out which wikis live where.) Database names are assumed to not end in <code>_p</code>. {{todo|get rid of this _p restriction. Ideally, we should stop stripping _p prefixes altogether, and just readd them right after getting from meta_p.wiki on WMF.}} For each slice sX: * <code>DATABASE_REPLICA_HOST_SX</code> is the URL of the database server for that slice * <code>DATABASE_REPLICA_PORT_SX</code> is the port of that server where the database can be reached. It can be useful to create [[w:ssh tunnel|ssh tunnel]]s to the actual servers and ports from 127.0.0.1:XXXX and instead use that in your <code>.env</code>. By "default project" we mean one of your wikis to use in some circumstances when there is no natural choice of wiki. * <code>DEFAULT_PROJECT</code>: the URL of that project. * <code>CENTRAL_AUTH_PROJECT</code>: the URL of the wiki you want to use for login. (Despite the name, this does not require using [[CentralAuth]].) It is assumed that you have in one of your slices a database named with the value of <code>DATABASE_META_NAME</code>, containing a table called by the value of <code>DATABASE_META_TABLE</code>, which for each wiki has the columns: * <code>dbname</code>: the wiki's <code>[[$wgDBname]]</code>. * <code>url</code>: the wiki's <code>[[$wgServer]]</code>. * <code>lang</code>: the wiki's <code>[[$wgLanguageCode]]</code>. You can safely ignore <code>DATABASE_SINGLE_NAME</code>. == Login == {{todo|actually implement this, for now just an idea}} <code>APP_ENABLE_LOGIN</code>: depending on whether you want to restrict some things behind an on-wiki login (with [[Extension:OAuth]]): * If you do, <code>APP_ENABLE_LOGIN=1</code>, and: ** Create a OAuth 1.0 consumer on Special:OAuthConsumerRegistration on your wiki: *** Do ''not'' mark it as owner-only. *** OAuth "callback" url: <code>https://example.com/oauth_callback</code>, where https://example.com is the URL of your XTools installation. *** No grants are needed beyond "basic rights". *** Leave the subsequent form fields to their default values ** <code>OAUTH_KEY</code> and <code>OAUTH_SECRET</code>: credentials as you get them on Special:OAuthConsumerRegistration on registering the new consumer. ** <code>APP_USER_EDITS_LOGIN</code> is the maximum number of edits allowed before requiring login. * If you do not, <code>APP_ENABLE_LOGIN=0</code> should suffice. (You can in this case ignore <code>OAUTH_KEY</code>, <code>OAUTH_SECRET</code>, and <code>APP_USER_EDITS_LOGIN</code>.) == Other .env application variables== * <code>APP_ENV</code> – Use <code>prod</code> for production environments. * <code>APP_SECRET</code> – A secret key that’s used to generate certain security-related tokens, and as the secret for the internal API. This can be any non-blank value. If you are using a separate API server (see [[wikitech:Tool:XTools#Setting_up_an_API_server|Wikitech docs]]), this parameter must have the same value on both the app server and API server. ** Assuming you have a PHP runtime, you can generate a random secret in your terminal with:<syntaxhighlight lang="shell"> php -r "print bin2hex(random_bytes(26));" </syntaxhighlight> * <code>APP_NOTICE_DISPLAY</code> – This is used to broadcast a notice at the top of XTools. Set to <code>1</code> to turn this feature on. * <code>APP_NOTICE_STYLE</code> – Style of the notice banner, correlating to the [https://getbootstrap.com/docs/3.3/css/#tables-contextual-classes Bootstrap contextual classes]. Available options include <code>danger</code>, <code>warning</code>, <code>info</code> and <code>success</code>. * <code>APP_NOTICE_TEXT</code> – Message shown to the user. If you provide a valid i18n message key, it will display that message instead. * <code>APP_QUERY_TIMEOUT</code> – Maximum allowed time for queries to run. This is to ensure database quota is not exceeded. * <code>APP_RATE_LIMIT_TIME</code> – Used for rate limiting. This parameter is the number of minutes during which <code>APP_RATE_LIMIT_COUNT</code> requests from the same user are allowed. Set this to <code>0</code> to disable rate limiting. * <code>APP_RATE_LIMIT_COUNT</code> – Number of requests from the same user that are allowed during the time frame specified by <code>APP_RATE_LIMIT_TIME</code>. Set this to <code>0</code> to disable rate limiting. * <code>APP_MAX_PAGE_REVISIONS</code> – Set a maximum number of revisions to process for pages. This is to safeguard against unnecessarily consuming too many resources for queries that will most surely timeout. Set this to <code>0</code> to disable all limitations. * <code>APP_MAX_USER_EDITS</code> – Querying a user that has more edits than this will be rejected. This is to safeguard against unnecessarily consuming too many resources for queries that will most surely timeout. Set this to <code>0</code> to disable all limitations. 6261livruarf7k6ult5wvx1rz6sdoqa 8364490 8364413 2026-05-03T16:38:28Z Alien333 17744847 /* Login */ 8364490 wikitext text/x-wiki {{draft}} This guide is aimed at non-WMF wiki administrators interested in having an XTools installation for their Wiki(s). Therefore first set <code>APP_IS_WMF=0</code>. Do note that the tools Blame and Authorship (based on [[WikiWho]]) are not available for non-WMF projects, and the values given to the correspoding <code>APP_ENABLE_</code> variables will have no effect. Furthermore, <code>APP_REPLAG_THRESHOLD</code> does not do anything either. {{todo|Maybe in fact all the global stuff ought to be always disabled on non-WMF (given it largely relies on CentralAuth, &c, &c). Or maybe avoid CentralAuth dependance altogether? Theoretically we could just get on with dblists+meta_p.wiki. We ''would'' be querying too many wikis initially because we wouldn't have the system edit counts for each wiki but that can't take that much time to assemble. The global rights stuff has of course an unredeemable dependence on CentralAuth, but GlobalContribs could be available without that}} Tested only for MySQL/MariaDB (Sqlite does not expose a port and as such cannot be used with XTools). == Databse configuration== These settings are assumed to be the same across all wikis or slices (if have multiple), even though Mediawiki would let you not take the same: * <code>DATABASE_REPLICA_USER</code>: username of a database user with read rights (e.g. <code>[[$wgDBuser]]</code>) * <code>DATABASE_REPLICA_PASSWORD</code>: password of a database user with read rights (e.g. <code>[[$wgDBpassword]]</code>) * <code>API_PATH</code>: <code>[[$wgScriptPath]]</code> concatenated with <code>/api.php</code> === Single-wiki setups=== If you only intend to use XTools on a single project, configuration is relatively straightforward (all steps in <code>.env</code>, the $variables are as initialised in your [[LocalSettings.php]]): * <code>DATABASE_SINGLE_NAME</code>: <code>[[$wgDBname]]</code> * <code>DATABASE_REPLICA_HOST_S1</code>: <code>[[$wgDBserver]]</code> * <code>DATABASE_REPLICA_PORT_S1</code>: 3306 if using MariaDB/MySQL * <code>DEFAULT_PROJECT</code>: <code>[[$wgServer]]</code> * <code>CENTRAL_AUTH_PROJECT</code>: <code>[[$wgServer]]</code> * <code>APP_SINGLE_WIKI</code>: 1 Do note that the GlobalContributions tool is not available for single-wiki setups and as such <code>APP_ENABlE_GLOBALCONTRIBS</code> in these cases does not have any effect. You can safely ignore <code>DATABASE_META_*</code>. === Multiple-wiki setups === Your wikis' databases can be split into as many database servers as you want, which we will name ''slices'' (by analogy with [[wikitech:MariaDB#Core (MediaWiki databases)|the WMF setup]]), numbered s1, s2, s3, ..., sN. (XTools automatically figures out which wikis live where.) Database names are assumed to not end in <code>_p</code>. {{todo|get rid of this _p restriction. Ideally, we should stop stripping _p prefixes altogether, and just readd them right after getting from meta_p.wiki on WMF.}} For each slice sX: * <code>DATABASE_REPLICA_HOST_SX</code> is the URL of the database server for that slice * <code>DATABASE_REPLICA_PORT_SX</code> is the port of that server where the database can be reached. It can be useful to create [[w:ssh tunnel|ssh tunnel]]s to the actual servers and ports from 127.0.0.1:XXXX and instead use that in your <code>.env</code>. By "default project" we mean one of your wikis to use in some circumstances when there is no natural choice of wiki. * <code>DEFAULT_PROJECT</code>: the URL of that project. * <code>CENTRAL_AUTH_PROJECT</code>: the URL of the wiki you want to use for login. (Despite the name, this does not require using [[CentralAuth]].) It is assumed that you have in one of your slices a database named with the value of <code>DATABASE_META_NAME</code>, containing a table called by the value of <code>DATABASE_META_TABLE</code>, which for each wiki has the columns: * <code>dbname</code>: the wiki's <code>[[$wgDBname]]</code>. * <code>url</code>: the wiki's <code>[[$wgServer]]</code>. * <code>lang</code>: the wiki's <code>[[$wgLanguageCode]]</code>. You can safely ignore <code>DATABASE_SINGLE_NAME</code>. == Login == XTools requires [[Extension:OAuth]]. * Create a OAuth 1.0 consumer on Special:OAuthConsumerRegistration on your wiki: ** Do ''not'' mark it as owner-only. ** OAuth "callback" url: <code>https://example.com/oauth_callback</code>, where https://example.com is the URL of your XTools installation. ** No grants are needed beyond "basic rights". ** Leave the subsequent form fields to their default values * <code>OAUTH_KEY</code> and <code>OAUTH_SECRET</code>: credentials as you get them on Special:OAuthConsumerRegistration on registering the new consumer. * <code>APP_USER_EDITS_LOGIN</code> is the maximum number of edits allowed before requiring login. == Other .env application variables== * <code>APP_ENV</code> – Use <code>prod</code> for production environments. * <code>APP_SECRET</code> – A secret key that’s used to generate certain security-related tokens, and as the secret for the internal API. This can be any non-blank value. If you are using a separate API server (see [[wikitech:Tool:XTools#Setting_up_an_API_server|Wikitech docs]]), this parameter must have the same value on both the app server and API server. ** Assuming you have a PHP runtime, you can generate a random secret in your terminal with:<syntaxhighlight lang="shell"> php -r "print bin2hex(random_bytes(26));" </syntaxhighlight> * <code>APP_NOTICE_DISPLAY</code> – This is used to broadcast a notice at the top of XTools. Set to <code>1</code> to turn this feature on. * <code>APP_NOTICE_STYLE</code> – Style of the notice banner, correlating to the [https://getbootstrap.com/docs/3.3/css/#tables-contextual-classes Bootstrap contextual classes]. Available options include <code>danger</code>, <code>warning</code>, <code>info</code> and <code>success</code>. * <code>APP_NOTICE_TEXT</code> – Message shown to the user. If you provide a valid i18n message key, it will display that message instead. * <code>APP_QUERY_TIMEOUT</code> – Maximum allowed time for queries to run. This is to ensure database quota is not exceeded. * <code>APP_RATE_LIMIT_TIME</code> – Used for rate limiting. This parameter is the number of minutes during which <code>APP_RATE_LIMIT_COUNT</code> requests from the same user are allowed. Set this to <code>0</code> to disable rate limiting. * <code>APP_RATE_LIMIT_COUNT</code> – Number of requests from the same user that are allowed during the time frame specified by <code>APP_RATE_LIMIT_TIME</code>. Set this to <code>0</code> to disable rate limiting. * <code>APP_MAX_PAGE_REVISIONS</code> – Set a maximum number of revisions to process for pages. This is to safeguard against unnecessarily consuming too many resources for queries that will most surely timeout. Set this to <code>0</code> to disable all limitations. * <code>APP_MAX_USER_EDITS</code> – Querying a user that has more edits than this will be rejected. This is to safeguard against unnecessarily consuming too many resources for queries that will most surely timeout. Set this to <code>0</code> to disable all limitations. igrrovf3dsbmhdkzck9htwlu9t0ppam 8364491 8364490 2026-05-03T16:39:20Z Alien333 17744847 8364491 wikitext text/x-wiki {{draft}} This guide is aimed at non-WMF wiki administrators interested in having an XTools installation for their Wiki(s). Therefore first set <code>APP_IS_WMF=0</code>. Do note that the tools Blame and Authorship (based on [[WikiWho]]) are not available for non-WMF projects, and the values given to the correspoding <code>APP_ENABLE_</code> variables will have no effect. Furthermore, <code>APP_REPLAG_THRESHOLD</code> does not do anything either. Tested only for MySQL/MariaDB (Sqlite does not expose a port and as such cannot be used with XTools). == Databse configuration== These settings are assumed to be the same across all wikis or slices (if have multiple), even though Mediawiki would let you not take the same: * <code>DATABASE_REPLICA_USER</code>: username of a database user with read rights (e.g. <code>[[$wgDBuser]]</code>) * <code>DATABASE_REPLICA_PASSWORD</code>: password of a database user with read rights (e.g. <code>[[$wgDBpassword]]</code>) * <code>API_PATH</code>: <code>[[$wgScriptPath]]</code> concatenated with <code>/api.php</code> === Single-wiki setups=== If you only intend to use XTools on a single project, configuration is relatively straightforward (all steps in <code>.env</code>, the $variables are as initialised in your [[LocalSettings.php]]): * <code>DATABASE_SINGLE_NAME</code>: <code>[[$wgDBname]]</code> * <code>DATABASE_REPLICA_HOST_S1</code>: <code>[[$wgDBserver]]</code> * <code>DATABASE_REPLICA_PORT_S1</code>: 3306 if using MariaDB/MySQL * <code>DEFAULT_PROJECT</code>: <code>[[$wgServer]]</code> * <code>CENTRAL_AUTH_PROJECT</code>: <code>[[$wgServer]]</code> * <code>APP_SINGLE_WIKI</code>: 1 Do note that the GlobalContributions tool is not available for single-wiki setups and as such <code>APP_ENABlE_GLOBALCONTRIBS</code> in these cases does not have any effect. You can safely ignore <code>DATABASE_META_*</code>. === Multiple-wiki setups === Your wikis' databases can be split into as many database servers as you want, which we will name ''slices'' (by analogy with [[wikitech:MariaDB#Core (MediaWiki databases)|the WMF setup]]), numbered s1, s2, s3, ..., sN. (XTools automatically figures out which wikis live where.) Database names are assumed to not end in <code>_p</code>. {{todo|get rid of this _p restriction. Ideally, we should stop stripping _p prefixes altogether, and just readd them right after getting from meta_p.wiki on WMF.}} For each slice sX: * <code>DATABASE_REPLICA_HOST_SX</code> is the URL of the database server for that slice * <code>DATABASE_REPLICA_PORT_SX</code> is the port of that server where the database can be reached. It can be useful to create [[w:ssh tunnel|ssh tunnel]]s to the actual servers and ports from 127.0.0.1:XXXX and instead use that in your <code>.env</code>. By "default project" we mean one of your wikis to use in some circumstances when there is no natural choice of wiki. * <code>DEFAULT_PROJECT</code>: the URL of that project. * <code>CENTRAL_AUTH_PROJECT</code>: the URL of the wiki you want to use for login. (Despite the name, this does not require using [[CentralAuth]].) It is assumed that you have in one of your slices a database named with the value of <code>DATABASE_META_NAME</code>, containing a table called by the value of <code>DATABASE_META_TABLE</code>, which for each wiki has the columns: * <code>dbname</code>: the wiki's <code>[[$wgDBname]]</code>. * <code>url</code>: the wiki's <code>[[$wgServer]]</code>. * <code>lang</code>: the wiki's <code>[[$wgLanguageCode]]</code>. You can safely ignore <code>DATABASE_SINGLE_NAME</code>. == Login == XTools requires [[Extension:OAuth]]. * Create a OAuth 1.0 consumer on Special:OAuthConsumerRegistration on your wiki: ** Do ''not'' mark it as owner-only. ** OAuth "callback" url: <code>https://example.com/oauth_callback</code>, where https://example.com is the URL of your XTools installation. ** No grants are needed beyond "basic rights". ** Leave the subsequent form fields to their default values * <code>OAUTH_KEY</code> and <code>OAUTH_SECRET</code>: credentials as you get them on Special:OAuthConsumerRegistration on registering the new consumer. * <code>APP_USER_EDITS_LOGIN</code> is the maximum number of edits allowed before requiring login. == Other .env application variables== * <code>APP_ENV</code> – Use <code>prod</code> for production environments. * <code>APP_SECRET</code> – A secret key that’s used to generate certain security-related tokens, and as the secret for the internal API. This can be any non-blank value. If you are using a separate API server (see [[wikitech:Tool:XTools#Setting_up_an_API_server|Wikitech docs]]), this parameter must have the same value on both the app server and API server. ** Assuming you have a PHP runtime, you can generate a random secret in your terminal with:<syntaxhighlight lang="shell"> php -r "print bin2hex(random_bytes(26));" </syntaxhighlight> * <code>APP_NOTICE_DISPLAY</code> – This is used to broadcast a notice at the top of XTools. Set to <code>1</code> to turn this feature on. * <code>APP_NOTICE_STYLE</code> – Style of the notice banner, correlating to the [https://getbootstrap.com/docs/3.3/css/#tables-contextual-classes Bootstrap contextual classes]. Available options include <code>danger</code>, <code>warning</code>, <code>info</code> and <code>success</code>. * <code>APP_NOTICE_TEXT</code> – Message shown to the user. If you provide a valid i18n message key, it will display that message instead. * <code>APP_QUERY_TIMEOUT</code> – Maximum allowed time for queries to run. This is to ensure database quota is not exceeded. * <code>APP_RATE_LIMIT_TIME</code> – Used for rate limiting. This parameter is the number of minutes during which <code>APP_RATE_LIMIT_COUNT</code> requests from the same user are allowed. Set this to <code>0</code> to disable rate limiting. * <code>APP_RATE_LIMIT_COUNT</code> – Number of requests from the same user that are allowed during the time frame specified by <code>APP_RATE_LIMIT_TIME</code>. Set this to <code>0</code> to disable rate limiting. * <code>APP_MAX_PAGE_REVISIONS</code> – Set a maximum number of revisions to process for pages. This is to safeguard against unnecessarily consuming too many resources for queries that will most surely timeout. Set this to <code>0</code> to disable all limitations. * <code>APP_MAX_USER_EDITS</code> – Querying a user that has more edits than this will be rejected. This is to safeguard against unnecessarily consuming too many resources for queries that will most surely timeout. Set this to <code>0</code> to disable all limitations. ac3s864obxf1rlzdwlmityxqz2xc05j 8364662 8364491 2026-05-03T17:39:03Z Alien333 17744847 /* Multiple-wiki setups */ 8364662 wikitext text/x-wiki {{draft}} This guide is aimed at non-WMF wiki administrators interested in having an XTools installation for their Wiki(s). Therefore first set <code>APP_IS_WMF=0</code>. Do note that the tools Blame and Authorship (based on [[WikiWho]]) are not available for non-WMF projects, and the values given to the correspoding <code>APP_ENABLE_</code> variables will have no effect. Furthermore, <code>APP_REPLAG_THRESHOLD</code> does not do anything either. Tested only for MySQL/MariaDB (Sqlite does not expose a port and as such cannot be used with XTools). == Databse configuration== These settings are assumed to be the same across all wikis or slices (if have multiple), even though Mediawiki would let you not take the same: * <code>DATABASE_REPLICA_USER</code>: username of a database user with read rights (e.g. <code>[[$wgDBuser]]</code>) * <code>DATABASE_REPLICA_PASSWORD</code>: password of a database user with read rights (e.g. <code>[[$wgDBpassword]]</code>) * <code>API_PATH</code>: <code>[[$wgScriptPath]]</code> concatenated with <code>/api.php</code> === Single-wiki setups=== If you only intend to use XTools on a single project, configuration is relatively straightforward (all steps in <code>.env</code>, the $variables are as initialised in your [[LocalSettings.php]]): * <code>DATABASE_SINGLE_NAME</code>: <code>[[$wgDBname]]</code> * <code>DATABASE_REPLICA_HOST_S1</code>: <code>[[$wgDBserver]]</code> * <code>DATABASE_REPLICA_PORT_S1</code>: 3306 if using MariaDB/MySQL * <code>DEFAULT_PROJECT</code>: <code>[[$wgServer]]</code> * <code>CENTRAL_AUTH_PROJECT</code>: <code>[[$wgServer]]</code> * <code>APP_SINGLE_WIKI</code>: 1 Do note that the GlobalContributions tool is not available for single-wiki setups and as such <code>APP_ENABlE_GLOBALCONTRIBS</code> in these cases does not have any effect. You can safely ignore <code>DATABASE_META_*</code>. === Multiple-wiki setups === Your wikis' databases can be split into as many database servers as you want, which we will name ''slices'' (by analogy with [[wikitech:MariaDB#Core (MediaWiki databases)|the WMF setup]]), numbered s1, s2, s3, ..., sN. (XTools automatically figures out which wikis live where.) For each slice sX: * <code>DATABASE_REPLICA_HOST_SX</code> is the URL of the database server for that slice * <code>DATABASE_REPLICA_PORT_SX</code> is the port of that server where the database can be reached. It can be useful to create [[w:ssh tunnel|ssh tunnel]]s to the actual servers and ports from 127.0.0.1:XXXX and instead use that in your <code>.env</code>. By "default project" we mean one of your wikis to use in some circumstances when there is no natural choice of wiki. * <code>DEFAULT_PROJECT</code>: the URL of that project. * <code>CENTRAL_AUTH_PROJECT</code>: the URL of the wiki you want to use for login. (Despite the name, this does not require using [[CentralAuth]].) It is assumed that you have in one of your slices a database named with the value of <code>DATABASE_META_NAME</code>, containing a table called by the value of <code>DATABASE_META_TABLE</code>, which for each wiki has the columns: * <code>dbname</code>: the wiki's <code>[[$wgDBname]]</code>. * <code>url</code>: the wiki's <code>[[$wgServer]]</code>. * <code>lang</code>: the wiki's <code>[[$wgLanguageCode]]</code>. You can safely ignore <code>DATABASE_SINGLE_NAME</code>. == Login == XTools requires [[Extension:OAuth]]. * Create a OAuth 1.0 consumer on Special:OAuthConsumerRegistration on your wiki: ** Do ''not'' mark it as owner-only. ** OAuth "callback" url: <code>https://example.com/oauth_callback</code>, where https://example.com is the URL of your XTools installation. ** No grants are needed beyond "basic rights". ** Leave the subsequent form fields to their default values * <code>OAUTH_KEY</code> and <code>OAUTH_SECRET</code>: credentials as you get them on Special:OAuthConsumerRegistration on registering the new consumer. * <code>APP_USER_EDITS_LOGIN</code> is the maximum number of edits allowed before requiring login. == Other .env application variables== * <code>APP_ENV</code> – Use <code>prod</code> for production environments. * <code>APP_SECRET</code> – A secret key that’s used to generate certain security-related tokens, and as the secret for the internal API. This can be any non-blank value. If you are using a separate API server (see [[wikitech:Tool:XTools#Setting_up_an_API_server|Wikitech docs]]), this parameter must have the same value on both the app server and API server. ** Assuming you have a PHP runtime, you can generate a random secret in your terminal with:<syntaxhighlight lang="shell"> php -r "print bin2hex(random_bytes(26));" </syntaxhighlight> * <code>APP_NOTICE_DISPLAY</code> – This is used to broadcast a notice at the top of XTools. Set to <code>1</code> to turn this feature on. * <code>APP_NOTICE_STYLE</code> – Style of the notice banner, correlating to the [https://getbootstrap.com/docs/3.3/css/#tables-contextual-classes Bootstrap contextual classes]. Available options include <code>danger</code>, <code>warning</code>, <code>info</code> and <code>success</code>. * <code>APP_NOTICE_TEXT</code> – Message shown to the user. If you provide a valid i18n message key, it will display that message instead. * <code>APP_QUERY_TIMEOUT</code> – Maximum allowed time for queries to run. This is to ensure database quota is not exceeded. * <code>APP_RATE_LIMIT_TIME</code> – Used for rate limiting. This parameter is the number of minutes during which <code>APP_RATE_LIMIT_COUNT</code> requests from the same user are allowed. Set this to <code>0</code> to disable rate limiting. * <code>APP_RATE_LIMIT_COUNT</code> – Number of requests from the same user that are allowed during the time frame specified by <code>APP_RATE_LIMIT_TIME</code>. Set this to <code>0</code> to disable rate limiting. * <code>APP_MAX_PAGE_REVISIONS</code> – Set a maximum number of revisions to process for pages. This is to safeguard against unnecessarily consuming too many resources for queries that will most surely timeout. Set this to <code>0</code> to disable all limitations. * <code>APP_MAX_USER_EDITS</code> – Querying a user that has more edits than this will be rejected. This is to safeguard against unnecessarily consuming too many resources for queries that will most surely timeout. Set this to <code>0</code> to disable all limitations. 27k2u7hm5ql7qsbho4i9ezyoyrcev76 Hiruwiki 0 2402016 8364376 8364065 2026-05-03T13:36:49Z ItsNyoty 18085988 /* How to use in articles */ 8364376 wikitext text/x-wiki [[File:Hiruwiki.svg|250px|right]] '''Hiruwiki''' is a collection of interactive, multilingual geometric and mathematical widgets designed for Wikimedia projects. Developed by Euskal Wikilarien Kultura Elkartea (Basque Wikimedia Chapter) and updated for global use by [[user:ItsNyoty|ItsNyoty]], it allows editors to embed dynamic proofs and visualisations directly into wiki articles. The name is a play on the Basque word ''hiruki'' (triangle), reflecting its focus on geometric fundamentals. == What it does == Hiruwiki provides 25+ lightweight, interactive modules covering: === Analysis === * [[:eu:Txantiloi:Hiruwiki/Monte Carlo metodoa|Monte Carlo method to approximate pi]] === Arithmetic === * [[:eu:Txantiloi:Hiruwiki/Ehunekoak|Graphical explanation of positive and negative percents]] * [[:eu:Txantiloi:Hiruwiki/Faktoreak|Least Common Multiple and Greatest Common Factor]] * [[:eu:Txantiloi:Hiruwiki/Fibonacci|Explanation of the Fibonacci sequence as sum and division]] * [[:eu:Txantiloi:Hiruwiki/Zatiketa|Graphical proof of the division of a number]] === Geometry === * [[:eu:Txantiloi:Hiruwiki/Angeluak|Various concepts on the division of angles]] * [[:eu:Txantiloi:Hiruwiki/Hexagonoen angeluen batura|Proof that the sum of the angles of an hexagon is always 720º]] * [[:eu:Txantiloi:Hiruwiki/Laukien angeluen batura|Proof that the sum of the angles of an hexagon is always 360º]] * [[:eu:Txantiloi:Hiruwiki/Laukien sailkapena|Classification of quadrangles]] * [[:eu:Txantiloi:Hiruwiki/Malda|Slope between two points]] * [[:eu:Txantiloi:Hiruwiki/Pentagonoen angeluen batura|Proof that the sum of the angles of a pentagon is always 540º]] * [[:eu:Txantiloi:Hiruwiki/Pitagoras|Proof of pythagoras theorem]] * [[:eu:Txantiloi:Hiruwiki/Radian|Radian calculator]] * [[:eu:Txantiloi:Hiruwiki/Transformazioak|Explanation of the four basic transformation: rotation, mirror, scale and translation]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen angeluen batura|Proof that the sum of the angles of an hexagon is always 180º]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen azalera|Proof of the area of a triangle]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen intzentroa|Incentre of a triangle]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen sailkapena|Classification of triangles]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen zentroidea|Centroid of a triangle]] * [[:eu:Txantiloi:Hiruwiki/Zirkulua|Proof of how the area of a circle is calculated]] === Probability === * [[:eu:Txantiloi:Hiruwiki/Puxtarrien probabilitatea|How to learn probability with marbles in a jar]] === Trigonometry === * [[:eu:Txantiloi:Hiruwiki/Trigonometria|Basic sinus, cosinus and tangent in trigonometry]] === Minigames === * [[:eu:Txantiloi:Hiruwiki/Angelua asmatu|Guess the angle!]] * [[:eu:Txantiloi:Hiruwiki/Koordenatu positiboak|A minigame to learn about coordinates with positive numbers]] * [[:eu:Txantiloi:Hiruwiki/Koordenatu osoak|A minigame to learn about coordinates with integers]] == Installation Guide == To enable Hiruwiki on your wiki, follow these steps: === 1. Register the Gadget === Add the following line to your wiki's <code>MediaWiki:Gadgets-definition</code>: <pre> * hiruwiki[ResourceLoader|default|dependencies=mediawiki.util,mediawiki.api,mediawiki.language]|hiruwiki-core.js </pre> === 2. Import === Create the page <code>MediaWiki:Gadget-hiruwiki-core.js</code> on your wiki and add the following line to it: <pre> mw.loader.load('https://www.mediawiki.org/w/index.php?title=MediaWiki:Gadget-hiruwiki-core.js&action=raw&ctype=text/javascript'); </pre> == How to use in articles == You can use import the models in your articles by adding this HTML code and changing <code>MODULENAME</code> to the correct modulename: <pre> <div class="hiruwiki" data-module="MODULENAME"></div> <includeonly>[[Category:Hiruwiki]]</includeonly> </pre> Since most wiki's don't like pure HTML inside their article, we suggest creating a template per module: (e.g. <code>Hiruwiki/MODULENAME</code>) '''You can use the deploy templates script on the Github to automate this process''' This code above automatically adds the article to the Hiruwiki category. Please make the category hidden. == Localization (i18n) == Hiruwiki is designed to be fully multilingual. It automatically detects the user's interface language (<code>wgUserLanguage</code>). === Adding a new language === For the translation, Hiruwiki uses Translatewiki.net. You can translate the project [https://translatewiki.net/w/i.php?title=Special%3ATranslate&group=hiruwiki here]. == Development & Support == * '''Source Code''': [https://github.com/ItsNyoty/Hiruwiki GitHub - ItsNyoty/Hiruwiki] * '''Original Author''': Euskal Wikilarien Kultura Elkartea - [[User:Theklan|Theklan]] * '''Global Port''': [[User:ItsNyoty|ItsNyoty]] [[Category:Global gadgets]] ii1hay3cd2t36lz3yvktra5blp2g6sr 8364377 8364376 2026-05-03T13:37:59Z ItsNyoty 18085988 /* How to use in articles */ 8364377 wikitext text/x-wiki [[File:Hiruwiki.svg|250px|right]] '''Hiruwiki''' is a collection of interactive, multilingual geometric and mathematical widgets designed for Wikimedia projects. Developed by Euskal Wikilarien Kultura Elkartea (Basque Wikimedia Chapter) and updated for global use by [[user:ItsNyoty|ItsNyoty]], it allows editors to embed dynamic proofs and visualisations directly into wiki articles. The name is a play on the Basque word ''hiruki'' (triangle), reflecting its focus on geometric fundamentals. == What it does == Hiruwiki provides 25+ lightweight, interactive modules covering: === Analysis === * [[:eu:Txantiloi:Hiruwiki/Monte Carlo metodoa|Monte Carlo method to approximate pi]] === Arithmetic === * [[:eu:Txantiloi:Hiruwiki/Ehunekoak|Graphical explanation of positive and negative percents]] * [[:eu:Txantiloi:Hiruwiki/Faktoreak|Least Common Multiple and Greatest Common Factor]] * [[:eu:Txantiloi:Hiruwiki/Fibonacci|Explanation of the Fibonacci sequence as sum and division]] * [[:eu:Txantiloi:Hiruwiki/Zatiketa|Graphical proof of the division of a number]] === Geometry === * [[:eu:Txantiloi:Hiruwiki/Angeluak|Various concepts on the division of angles]] * [[:eu:Txantiloi:Hiruwiki/Hexagonoen angeluen batura|Proof that the sum of the angles of an hexagon is always 720º]] * [[:eu:Txantiloi:Hiruwiki/Laukien angeluen batura|Proof that the sum of the angles of an hexagon is always 360º]] * [[:eu:Txantiloi:Hiruwiki/Laukien sailkapena|Classification of quadrangles]] * [[:eu:Txantiloi:Hiruwiki/Malda|Slope between two points]] * [[:eu:Txantiloi:Hiruwiki/Pentagonoen angeluen batura|Proof that the sum of the angles of a pentagon is always 540º]] * [[:eu:Txantiloi:Hiruwiki/Pitagoras|Proof of pythagoras theorem]] * [[:eu:Txantiloi:Hiruwiki/Radian|Radian calculator]] * [[:eu:Txantiloi:Hiruwiki/Transformazioak|Explanation of the four basic transformation: rotation, mirror, scale and translation]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen angeluen batura|Proof that the sum of the angles of an hexagon is always 180º]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen azalera|Proof of the area of a triangle]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen intzentroa|Incentre of a triangle]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen sailkapena|Classification of triangles]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen zentroidea|Centroid of a triangle]] * [[:eu:Txantiloi:Hiruwiki/Zirkulua|Proof of how the area of a circle is calculated]] === Probability === * [[:eu:Txantiloi:Hiruwiki/Puxtarrien probabilitatea|How to learn probability with marbles in a jar]] === Trigonometry === * [[:eu:Txantiloi:Hiruwiki/Trigonometria|Basic sinus, cosinus and tangent in trigonometry]] === Minigames === * [[:eu:Txantiloi:Hiruwiki/Angelua asmatu|Guess the angle!]] * [[:eu:Txantiloi:Hiruwiki/Koordenatu positiboak|A minigame to learn about coordinates with positive numbers]] * [[:eu:Txantiloi:Hiruwiki/Koordenatu osoak|A minigame to learn about coordinates with integers]] == Installation Guide == To enable Hiruwiki on your wiki, follow these steps: === 1. Register the Gadget === Add the following line to your wiki's <code>MediaWiki:Gadgets-definition</code>: <pre> * hiruwiki[ResourceLoader|default|dependencies=mediawiki.util,mediawiki.api,mediawiki.language]|hiruwiki-core.js </pre> === 2. Import === Create the page <code>MediaWiki:Gadget-hiruwiki-core.js</code> on your wiki and add the following line to it: <pre> mw.loader.load('https://www.mediawiki.org/w/index.php?title=MediaWiki:Gadget-hiruwiki-core.js&action=raw&ctype=text/javascript'); </pre> == How to use in articles == You can use import the models in your articles by adding this HTML code and changing <code>MODULENAME</code> to the correct modulename: <pre> <div class="hiruwiki" data-module="MODULENAME"></div> <includeonly>[[Category:Hiruwiki]]</includeonly> </pre> Since most wiki's don't like pure HTML inside their article, we suggest creating a template per module: (e.g. <code>Hiruwiki/MODULENAME</code>) '''You can use the deploy templates script on the Github to automate this process''' This code above automatically adds the article to the Hiruwiki category. Please make the category [[q:Q5879327|hidden]]. == Localization (i18n) == Hiruwiki is designed to be fully multilingual. It automatically detects the user's interface language (<code>wgUserLanguage</code>). === Adding a new language === For the translation, Hiruwiki uses Translatewiki.net. You can translate the project [https://translatewiki.net/w/i.php?title=Special%3ATranslate&group=hiruwiki here]. == Development & Support == * '''Source Code''': [https://github.com/ItsNyoty/Hiruwiki GitHub - ItsNyoty/Hiruwiki] * '''Original Author''': Euskal Wikilarien Kultura Elkartea - [[User:Theklan|Theklan]] * '''Global Port''': [[User:ItsNyoty|ItsNyoty]] [[Category:Global gadgets]] 5g0r29cjwm2lcpksbhty00hysdb5z8g 8364379 8364377 2026-05-03T13:38:16Z ItsNyoty 18085988 /* How to use in articles */ 8364379 wikitext text/x-wiki [[File:Hiruwiki.svg|250px|right]] '''Hiruwiki''' is a collection of interactive, multilingual geometric and mathematical widgets designed for Wikimedia projects. Developed by Euskal Wikilarien Kultura Elkartea (Basque Wikimedia Chapter) and updated for global use by [[user:ItsNyoty|ItsNyoty]], it allows editors to embed dynamic proofs and visualisations directly into wiki articles. The name is a play on the Basque word ''hiruki'' (triangle), reflecting its focus on geometric fundamentals. == What it does == Hiruwiki provides 25+ lightweight, interactive modules covering: === Analysis === * [[:eu:Txantiloi:Hiruwiki/Monte Carlo metodoa|Monte Carlo method to approximate pi]] === Arithmetic === * [[:eu:Txantiloi:Hiruwiki/Ehunekoak|Graphical explanation of positive and negative percents]] * [[:eu:Txantiloi:Hiruwiki/Faktoreak|Least Common Multiple and Greatest Common Factor]] * [[:eu:Txantiloi:Hiruwiki/Fibonacci|Explanation of the Fibonacci sequence as sum and division]] * [[:eu:Txantiloi:Hiruwiki/Zatiketa|Graphical proof of the division of a number]] === Geometry === * [[:eu:Txantiloi:Hiruwiki/Angeluak|Various concepts on the division of angles]] * [[:eu:Txantiloi:Hiruwiki/Hexagonoen angeluen batura|Proof that the sum of the angles of an hexagon is always 720º]] * [[:eu:Txantiloi:Hiruwiki/Laukien angeluen batura|Proof that the sum of the angles of an hexagon is always 360º]] * [[:eu:Txantiloi:Hiruwiki/Laukien sailkapena|Classification of quadrangles]] * [[:eu:Txantiloi:Hiruwiki/Malda|Slope between two points]] * [[:eu:Txantiloi:Hiruwiki/Pentagonoen angeluen batura|Proof that the sum of the angles of a pentagon is always 540º]] * [[:eu:Txantiloi:Hiruwiki/Pitagoras|Proof of pythagoras theorem]] * [[:eu:Txantiloi:Hiruwiki/Radian|Radian calculator]] * [[:eu:Txantiloi:Hiruwiki/Transformazioak|Explanation of the four basic transformation: rotation, mirror, scale and translation]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen angeluen batura|Proof that the sum of the angles of an hexagon is always 180º]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen azalera|Proof of the area of a triangle]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen intzentroa|Incentre of a triangle]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen sailkapena|Classification of triangles]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen zentroidea|Centroid of a triangle]] * [[:eu:Txantiloi:Hiruwiki/Zirkulua|Proof of how the area of a circle is calculated]] === Probability === * [[:eu:Txantiloi:Hiruwiki/Puxtarrien probabilitatea|How to learn probability with marbles in a jar]] === Trigonometry === * [[:eu:Txantiloi:Hiruwiki/Trigonometria|Basic sinus, cosinus and tangent in trigonometry]] === Minigames === * [[:eu:Txantiloi:Hiruwiki/Angelua asmatu|Guess the angle!]] * [[:eu:Txantiloi:Hiruwiki/Koordenatu positiboak|A minigame to learn about coordinates with positive numbers]] * [[:eu:Txantiloi:Hiruwiki/Koordenatu osoak|A minigame to learn about coordinates with integers]] == Installation Guide == To enable Hiruwiki on your wiki, follow these steps: === 1. Register the Gadget === Add the following line to your wiki's <code>MediaWiki:Gadgets-definition</code>: <pre> * hiruwiki[ResourceLoader|default|dependencies=mediawiki.util,mediawiki.api,mediawiki.language]|hiruwiki-core.js </pre> === 2. Import === Create the page <code>MediaWiki:Gadget-hiruwiki-core.js</code> on your wiki and add the following line to it: <pre> mw.loader.load('https://www.mediawiki.org/w/index.php?title=MediaWiki:Gadget-hiruwiki-core.js&action=raw&ctype=text/javascript'); </pre> == How to use in articles == You can use import the models in your articles by adding this HTML code and changing <code>MODULENAME</code> to the correct modulename: <pre> <div class="hiruwiki" data-module="MODULENAME"></div> <includeonly>[[Category:Hiruwiki]]</includeonly> </pre> Since most wiki's don't like pure HTML inside their article, we suggest creating a template per module: (e.g. <code>Hiruwiki/MODULENAME</code>) '''You can use the deploy templates script on the Github to automate this process''' This code above automatically adds the article to the Hiruwiki category. Please make the category [[d:Q5879327|hidden]]. == Localization (i18n) == Hiruwiki is designed to be fully multilingual. It automatically detects the user's interface language (<code>wgUserLanguage</code>). === Adding a new language === For the translation, Hiruwiki uses Translatewiki.net. You can translate the project [https://translatewiki.net/w/i.php?title=Special%3ATranslate&group=hiruwiki here]. == Development & Support == * '''Source Code''': [https://github.com/ItsNyoty/Hiruwiki GitHub - ItsNyoty/Hiruwiki] * '''Original Author''': Euskal Wikilarien Kultura Elkartea - [[User:Theklan|Theklan]] * '''Global Port''': [[User:ItsNyoty|ItsNyoty]] [[Category:Global gadgets]] jlh4akldml6uix0sbnnb9bsrzt6lt2u 8364998 8364379 2026-05-04T06:11:24Z Theklan 51469 8364998 wikitext text/x-wiki [[File:Hiruwiki.svg|250px|right]] '''Hiruwiki''' is a collection of interactive, multilingual geometric and mathematical widgets designed for Wikimedia projects. Developed by [[User:Theklan|Theklan]] from the Euskal Wikilarien Kultura Elkartea (Basque Wikimedians User Group) and updated for global use by [[user:ItsNyoty|ItsNyoty]], it allows editors to embed dynamic proofs and visualisations directly into wiki articles. The name is a play on the Basque word ''hiruki'' (triangle), reflecting its focus on geometric fundamentals. == What it does == Hiruwiki provides 25+ lightweight, interactive modules covering: === Analysis === * [[:eu:Txantiloi:Hiruwiki/Monte Carlo metodoa|Monte Carlo method to approximate pi]] === Arithmetic === * [[:eu:Txantiloi:Hiruwiki/Ehunekoak|Graphical explanation of positive and negative percents]] * [[:eu:Txantiloi:Hiruwiki/Faktoreak|Least Common Multiple and Greatest Common Factor]] * [[:eu:Txantiloi:Hiruwiki/Fibonacci|Explanation of the Fibonacci sequence as sum and division]] * [[:eu:Txantiloi:Hiruwiki/Zatiketa|Graphical proof of the division of a number]] === Geometry === * [[:eu:Txantiloi:Hiruwiki/Angeluak|Various concepts on the division of angles]] * [[:eu:Txantiloi:Hiruwiki/Hexagonoen angeluen batura|Proof that the sum of the angles of an hexagon is always 720º]] * [[:eu:Txantiloi:Hiruwiki/Laukien angeluen batura|Proof that the sum of the angles of an hexagon is always 360º]] * [[:eu:Txantiloi:Hiruwiki/Laukien sailkapena|Classification of quadrangles]] * [[:eu:Txantiloi:Hiruwiki/Malda|Slope between two points]] * [[:eu:Txantiloi:Hiruwiki/Pentagonoen angeluen batura|Proof that the sum of the angles of a pentagon is always 540º]] * [[:eu:Txantiloi:Hiruwiki/Pitagoras|Proof of pythagoras theorem]] * [[:eu:Txantiloi:Hiruwiki/Radian|Radian calculator]] * [[:eu:Txantiloi:Hiruwiki/Transformazioak|Explanation of the four basic transformation: rotation, mirror, scale and translation]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen angeluen batura|Proof that the sum of the angles of an hexagon is always 180º]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen azalera|Proof of the area of a triangle]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen intzentroa|Incentre of a triangle]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen sailkapena|Classification of triangles]] * [[:eu:Txantiloi:Hiruwiki/Triangeluen zentroidea|Centroid of a triangle]] * [[:eu:Txantiloi:Hiruwiki/Zirkulua|Proof of how the area of a circle is calculated]] === Probability === * [[:eu:Txantiloi:Hiruwiki/Puxtarrien probabilitatea|How to learn probability with marbles in a jar]] === Trigonometry === * [[:eu:Txantiloi:Hiruwiki/Trigonometria|Basic sinus, cosinus and tangent in trigonometry]] === Minigames === * [[:eu:Txantiloi:Hiruwiki/Angelua asmatu|Guess the angle!]] * [[:eu:Txantiloi:Hiruwiki/Koordenatu positiboak|A minigame to learn about coordinates with positive numbers]] * [[:eu:Txantiloi:Hiruwiki/Koordenatu osoak|A minigame to learn about coordinates with integers]] == Installation Guide == To enable Hiruwiki on your wiki, follow these steps: === 1. Register the Gadget === Add the following line to your wiki's <code>MediaWiki:Gadgets-definition</code>: <pre> * hiruwiki[ResourceLoader|default|dependencies=mediawiki.util,mediawiki.api,mediawiki.language]|hiruwiki-core.js </pre> === 2. Import === Create the page <code>MediaWiki:Gadget-hiruwiki-core.js</code> on your wiki and add the following line to it: <pre> mw.loader.load('https://www.mediawiki.org/w/index.php?title=MediaWiki:Gadget-hiruwiki-core.js&action=raw&ctype=text/javascript'); </pre> == How to use in articles == You can use import the models in your articles by adding this HTML code and changing <code>MODULENAME</code> to the correct modulename: <pre> <div class="hiruwiki" data-module="MODULENAME"></div> <includeonly>[[Category:Hiruwiki]]</includeonly> </pre> Since most wiki's don't like pure HTML inside their article, we suggest creating a template per module: (e.g. <code>Hiruwiki/MODULENAME</code>) '''You can use the deploy templates script on the Github to automate this process''' This code above automatically adds the article to the Hiruwiki category. Please make the category [[d:Q5879327|hidden]]. == Localization (i18n) == Hiruwiki is designed to be fully multilingual. It automatically detects the user's interface language (<code>wgUserLanguage</code>). === Adding a new language === For the translation, Hiruwiki uses Translatewiki.net. You can translate the project [https://translatewiki.net/w/i.php?title=Special%3ATranslate&group=hiruwiki here]. == Development & Support == * '''Source Code''': [https://github.com/ItsNyoty/Hiruwiki GitHub - ItsNyoty/Hiruwiki] * '''Original Author''': Euskal Wikilarien Kultura Elkartea - [[User:Theklan|Theklan]] * '''Global Port''': [[User:ItsNyoty|ItsNyoty]] [[Category:Global gadgets]] sxsufu7d5p95u4nypzv7vv1dsrw2jlc Wikimedia Hackathon 2026/Program/Schedule 0 2402294 8364381 8364227 2026-05-03T13:39:30Z 1Veertje 502771 /* Sunday May 3rd */ "here" isn't a label 8364381 wikitext text/x-wiki <noinclude> {{note|Please contact the help desk to edit this page. Hackathon organisers asked for the schedule to be protected for now.}} </noinclude> {{Import-stickytable}} == Thursday April 30th == Participants arrive and get settled. Registration will be between 12:00 and 19:00 on Thursday in the hotel’s main lobby. Registration on Friday morning will be in the hotel lobby from 08:00–09:30 and then will be colocated with the Help Desk on Floor 2 after 09:30. == Friday May 1st == {| class="wikitable tpl-stickytable" |+ !Time !style="min-width: 12em;"|'''Main Space''' '''(Floor 2)''' !style="min-width: 14em;"|'''Space 4''' '''(Floor 1)''' !style="min-width: 14em;"|'''Space 5''' '''(Floor 1)''' |- | style="background:#d9faa5" |'''08:00–09:30''' | colspan="3" style="background:#d9faa5" |'''<big>Registration (lobby level)</big>''' <big>''Note: After 09:30, the registration desk will be co-located with the Help Desk on Floor 2''</big> |- |style="background:#f5a62b"|09:30–10:45 | colspan="3" style="background:#f5a62b"|'''<big>Hackathon opening ceremony in Main Space (all participants)</big>''' Contact: [[User:BPiovesan-WMF|Bee]] Notes: [[etherpad:p/Wikimedia_Hackathon_2026_Opening|Etherpad]] and [[phab:T422535|Phab Task]], [https://youtube.com/live/7ZoQdPNt1nc?feature=share livestream] and slides (coming soon) |- |style="background:#f5cb2b"|10:45–11:30 |style="background:#f5cb2b" colspan="3" |Break on Floor 2 (outside Main Space) |- |11:05–12:00 <s>10:45–11:45</s> | rowspan="3" |Hacking in Main Space (open 09:00–02:00) |Unconference session: '''WikiLinkua: Language Learning Platform using Wikidata and Wiktionary''' Contact: [[User:SGill (WMF)|Satdeep Gill]] & [[User:SEgt-WMF|Silvia Gutiérrez]] Notes: [[phab:T425045]] & [[etherpad:p/Wikimedia_Hackathon_2026_WikiLinkua|Etherpad]] |Unconference session: '''Wikipedia for Everyone: Closing the Accessibility Gap''' Contact: [[User:Daimona Eaytoy|Daimona Eaytoy]], [[User:Piergiovanna|Piergiovanna]], [[User:valcio|valcio]] Notes: [[phab:T417138]], [https://etherpad.wikimedia.org/p/hackathon2026-wikipedia-for-everyone Etherpad notes] |- |style="background:#c7f9d6" |11:45–12:00 | colspan="2" style="background:#c7f9d6" |Socializing and moving between levels to get to sessions and/or hacking spaces |- |12:00–13:00 |Unconference session: '''Being a developer in the age of AI taking over our profession: how do we deal with it as a community?''' ([[phab:T420352|T420352]]) Contact: [[User:Husky|Hay Kranen]] Notes: The rise of AI and coding agents are causing a lot of discussion and debate within our community. Some people vehemently oppose any use of coding agents. Other people can't imagine ever coding without them. I believe this topic is too important to end up in a simple support / oppose debate. There are many viewpoints and sides to this debate. Maybe we can at least map those viewpoints and sides so that we know where our community stands and we can find consensus. Note taker: Halley ([[etherpad:p/Being_a_developer_in_the_age_of_AI_taking_over_our|Etherpad]]) |Unconference session: '''[[phab:T423641|LATAM Technical Community Meetup]]''' Contact: [[User:Pepe piton|Pepe piton]] Notes: [[phab:T423641]] [[etherpad:p/Wikimedia_Hackathon_2026_LatAM|Etherpad]] |- | style="background:#c7f5f9" |'''12:30–14:00''' | colspan="3" style="background:#c7f5f9" |'''<big>Lunch in Ristorante Betulla</big>''' |- !Time ! style="min-width: 12em;" |'''Main Space''' '''(Floor 2)''' ! style="min-width: 14em;" |'''Space 4''' '''(Floor 1)''' ! style="min-width: 14em;" |'''Space 5''' '''(Floor 1)''' |- |14:00–14:30 | rowspan="7" |Hacking in Main Space (open 09:00–02:00) |Unconference session: '''Experimenting with cross-wiki code collaboration''' Contact: [[User:MSantos (WMF)|Mateus Santos]] Task: [[phab:T424197]] Notes: [[etherpad:p/Wikimedia_Hackathon_2026_CrossWikiCodeCollab|Etherpad Notes]] |Unconference session: '''Modular and interoperable Commons Upload Tools''' ([[phab:T424782|T424782]]) Contact: [[User:Daanvr]] Notes: [https://etherpad.wikimedia.org/p/hackathon2026-Commons-Upload-Tools Etherpad notes] |- | style="background:#c7f9d6" |14:30–14:45 | colspan="2" style="background:#c7f9d6" |Socializing and moving between levels to get to sessions and/or hacking spaces |- |14:45–15:00 |Hacking in Space 4 |Hacking in Space 5 |- | style="background:#c7f9d6" |15:00–15:15 | colspan="2" style="background:#c7f9d6"|Socializing and moving between levels to get to sessions and/or hacking spaces |- |15:15–15:45 |'''Huddle around a table - No presentations.''' '''Overview of Parsoid architecture and high-level overview of the Parsoid codebase''': Intro for anyone interested in hacking on Parsoid. Can also move this to an informal session and continue during normal hacking times for those interested in diving deeper. Contact: Subbu |Unconference session: '''CommonsDB: Introduction and idea generation''' ([[phab:T423284]]) Contact: [[User:Ainali|Ainali]] Notes: [[etherpad:p/Wikimedia_Hackathon_2026_CommonsDB|Etherpad]] |- |style="background:#f5cb2b"|15:30–16:30 | colspan="2" style="background:#f5cb2b" |Break on Floor 2 (outside Main Space) |- |16:00–16:45 |Unconference session: '''Being a developer in the age of AI taking over our profession: how do we deal with it as a community?''' ([[phab:T420352|T420352]]) Contact: [[User:Husky|Hay Kranen]] Notes: The rise of AI and coding agents are causing a lot of discussion and debate within our community. Some people vehemently oppose any use of coding agents. Other people can't imagine ever coding without them. I believe this topic is too important to end up in a simple support / oppose debate. There are many viewpoints and sides to this debate. Maybe we can at least map those viewpoints and sides so that we know where our community stands and we can find consensus. Note taker: |Unconference session: '''Geodata in wikiprojects''' ({{Phabricator|T422294}}) Contact: {{U|Tohaomg}} Notes: |- |style="background:#c8c6ec"|17:00–18:00 |colspan="3" style="background:#c8c6ec"|Socializing for some, nap time for others |- | style="background:#c7f5f9 " |'''18:30–20:30''' | colspan="3" style="background:#c7f5f9" |'''<big>Dinner in Ristorante Betulla</big>''' |- |style="background:#e7edee" |17:00–02:00 | colspan="3" style="background:#e7edee"|Main Space is open for hacking |} == Saturday May 2nd == {| class="wikitable tpl-stickytable" |+ !Time !style="min-width: 12em;"|'''Main Space''' '''(Floor 2)''' !style="min-width: 14em;"|'''Space 4''' '''(Floor 1)''' !style="min-width: 14em;"|'''Space 5''' '''(Floor 1)''' |- |09:00–10:00 | rowspan="4" |Hacking in Main Space (open 07:00–14:00) |Unconference session: [[Extension:NeoWiki|'''NeoWiki''']]: AI-ready knowledge management system powered by [https://echolot-eccch.eu/ ECHOLOT] that combines collaborative editing and a knowledge graph. A new approach between Semantic MediaWiki and Wikibase. ([[phab:T424367|T424367]]) Contact: [[User:Krabina]] ([[User talk:Krabina|talk]]) Notes: [[etherpad:p/Neowiki|Etherpad]] |Unconference session: '''One Portal to Rule Them All: The Unified Developer Front-Door ([[phab:T423363|T423363]])''' Contact: [[metawiki:User:HCoplin-WMF|Halley Coplin (WMF)]] Notes: Come hear about our vision and motivations for creating a unified developer portal experience that brings our APIs and developer documentation together in a central location. The new front-door aims to offer a developer home base with consolidated reference docs, API etiquette guidelines, and guided onboarding. This session will also dip into the bigger picture, with broader discussions on how we might build and support a thriving developer community, improve first experiences, and make it easier for curious newcomers to become confident contributors. This work is a direct response to what you've been telling us in listening tours and the developer satisfaction survey, so come see how your feedback is starting to take shape, and keep your input coming! Notes: [[etherpad:p/WMF-Hackathon-2026-Developer-Front-Door|Etherpad]] |- |style="background:#f5cb2b"|10:00–11:00 | colspan="2" style="background:#f5cb2b" |Break on Floor 2 (outside Main Space) |- |10:15 –11:15 |Unconference session: '''Fifty Shades of Caching and How LLMs Paint it Black''' ([[phab:T423452|T423452]]) Contact: [[User:Effie_Mouzeli_(WMF)|Effie Mouzeli]] '''Notes:''' This talk session is practical deep dive into the caching technologies we use at Wikimedia and explore how the ongoing <s>rise of the machines</s> surge in LLMs traffic is steadily undermining their effectiveness. Structured into three parts, the talk covers both the underlying technology and the current challenges. Also featured, only if there's time left: '''Dr. Strangebot, or how I learned to stop worrying and love the residential proxy''' by [[User:GLavagetto_(WMF)|Joe]] - a short excursion in the world of residential proxies. |Unconference session: '''CentralNotice Banner Editor: What's new and What's next [[phab:T424074|(T424074]])''' Contact: [[User:VriaA|Victoria Oyelola]] [[etherpad:p/fifty_shades|Etherpad]] '''Notes''': The CentralNotice Banner Editor is a new visual editor for designing CentralNotice banners used across Wikimedia projects. This session introduces the tool, demos its current capabilities, and opens discussion on upcoming features, limitations, and possible improvements. It will include a short presentation with slides, a live demo, and time for Q&A and discussion. Note taker: Ciell, [https://etherpad.wikimedia.org/p/hackathon2026-CentralNotice-Banner-Editor Etherpad notes] |- |11:15–12:00 |'''Unconference session: Thinking about Entity Usages and how to optimize them''' ([[phab:T424793|T424793]]) Contact: [[User:Flanoz|Flanoz]] ([[User talk:Flanoz|talk]]) Notes: [https://etherpad.wikimedia.org/p/Entity_usages_and_how_to_optimize_them Etherpad] |Unconference session: '''MediaWiki [[Code2Code Search]]: ''Semantic Search to Find Code by Under-the-Surface Similarity''''' ([[phab:T425057|T425057]]) Contact: Francesco Tosoni ([[user:super nabla|super nabla]]), Indic MediaWiki Developers UG '''Notes:''' This session introduces and discusses MediaWiki Code2Code Search, a semantic search tool that helps developers navigate the vast MediaWiki ecosystem, leveraging Jina AI embeddings and vector-based retrieval. The project emphasises long-term code stewardship through archival in [[:m:Special:MyLanguage/Software Heritage|Software Heritage]] (SWH) and promotes inclusive development with a multilingual UI that celebrates the diverse linguistic heritage of the global Wikimedia community. Future roadmaps focus on transitioning to the [[Special:MyLanguage/Codex|Codex]] design system and implementing dynamic indexing to keep pace with the evolving codebase. * [[etherpad:p/hackathon2026-code2codesearch|Etherpad]]; note taker: Damilare * [[:File:Mediawiki-code2codesearch-wmhackathon2026-slides.pdf|Presentation]] |- | style="background:#d4f8f1" |'''12:00–12:30''' | colspan="3" style="background:#d4f8f1" |'''<big>Group Photo</big> (meet outside the main entrance to the hotel)''' |- | style="background:#c7f5f9" |'''12:30–14:00''' | colspan="3" style="background:#c7f5f9" |'''<big>Lunch in Ristorante Betulla</big>''' |- !Time ! style="min-width: 12em;" |'''Main Space''' '''(Floor 2)''' ! style="min-width: 14em;" |'''Space 4''' '''(Floor 1)''' ! style="min-width: 14em;" |'''Space 5''' '''(Floor 1)''' |- |14:00–14:30 | rowspan="9" |Hacking in Main Space (open 07:00–02:00) | rowspan="5" |Hacking in Space 4 |Unconference session: '''Building Pipelines for Marginalized Knowledge: From Wikibase to Wikidata and Back Again''' ([[phab:T423333]]) Contact: [[User:Superraptor123|Superraptor123]] ([[User talk:Superraptor123|talk]]), [https://en.wikipedia.org/wiki/User:Superraptor123 User:Superraptor123] (Clair Kronk) Notes: This session will be a mostly practical and informal hacking session, where we briefly discuss the broader Wikibase environment and how Wikibase instances and Wikidata can be better connected. We will focus mostly on lgbtDB as a case study, but will also discuss broader applications for pipelining in relationship to GLAM institution Wikibase instances. |- |style="background:#c7f9d6" |14:30–14:45 | colspan="2" style="background:#c7f9d6" |Socializing and moving between levels to get to sessions and/or hacking spaces |- |14:45–15:00 |Unconference session: '''Wikibase Bootstrap set, a year retrospective and discussion for the future''' ({{Phabricator|T423677}}) Contact: [[:en:User:Superraptor123|Superraptor123]], [[User:Olea|Olea]] Notes: https://etherpad.wikimedia.org/p/2026-wikibase-bootstrap-hackathon |- |style="background:#c7f9d6" |15:00–15:15 | colspan="2" style="background:#c7f9d6" |Socializing and moving between levels to get to sessions and/or hacking spaces |- |15:15–15:45 |Unconference session: '''Cool new things in JS + CSS''' ([[phab:T423292|T423292]]) Contact: [[User:Lucas Werkmeister (WMDE)|Lucas Werkmeister (WMDE)]] Notes: An overview over recent features in JavaScript and CSS that can be used in MediaWiki code since the last few years, with many “before/after”-style examples for how they can make your code nicer! Slides will be available afterwards. Slides: [[:File:Cool new things in JS + CSS – Wikimedia Hackathon 2026.pdf]] Notes: https://etherpad.wikimedia.org/p/Wikimedia_Hackathon_Cool_new_things_in_JS_CSS |- |style="background:#f5cb2b"|15:30–16:30 | colspan="2" style="background:#f5cb2b" |Break on Floor 2 (outside Main Space) |- |16:00–16:30 | rowspan="3" |Hacking in Space 4 |Unconference session: '''Wikimedia LEADS: a proposal for a learning ecosystem''' ([[phab:T424311|T424311]]) Contact: [[User:Olea|Ismael Olea]] Notes: TBA |- |style="background:#c7f9d6" |16:30–16:45 | colspan="2" style="background:#c7f9d6" |Socializing and moving between levels to get to sessions and/or hacking spaces |- |16:45–17:15 |Unconference session: '''How MediaWiki code gets deployed and things we are changing''' Contact: [[User:BDavis (WMF)|Bryan Davis / bd808]] Notes: [[phab:T424780]] |- |style="background:#c8c6ec"|17:00–18:00 |colspan="3" style="background:#c8c6ec"|Socializing for some, nap time for others |- | style="background:#c7f5f9 " |'''18:30–20:30''' | colspan="3" style="background:#c7f5f9" |'''<big>Dinner in Ristorante Betulla</big>''' |- | style="background:#e7edee" |17:00–02:00 | colspan="3" style="background:#e7edee" |Main Space is open for hacking |} == Sunday May 3rd == {| class="wikitable tpl-stickytable" |+ !Time !style="min-width: 12em;"|'''Main Space''' '''(Floor 2)''' !style="min-width: 14em;"|'''Space 4''' '''(Floor 1)''' !style="min-width: 14em;"|'''Space 5''' '''(Floor 1)''' |- |09:00–10:00 | rowspan="3" |Hacking in Main Space (open 07:00–14:00) |Unconference session: '''Sharing Journeys: What Welcomes & What Blocks the Path of Women+ into Wikimedia Tech''' ([[phab:T423725|T423725]]) Contact: [[User:SEgt-WMF|Silvia Gutiérrez]], [[User:Cftoro (WMCL)|Carla Toro]], [[User:GFontenelle (WMF)|Giovanna Fontenelle]] Summary: A 60‑minute unconference session for women+ to share '''lived experiences.''' Each participant will share: their name, what moves them (their passion), one barrier that has prevented them from accessing or staying in Wikimedia technical spaces, and one thing that lowered that barrier. A volunteer will take '''live notes projected on screen''' so everyone can see and correct them. We will then use a '''retroboard''' (or similar voting tool) to '''vote''' on the '''most significant barriers and enablers''', '''merge''' similar items with the consent of the original sharer, and '''prioritize'''. If time allows, we will start drafting a public [[diffblog:|Diff post]] (a guide similar to [https://numfocus.medium.com/improving-accessibility-and-inclusiveness-in-scientific-events-making-visa-processes-easy-to-b0948c6e6b62 NumFOCUS's unconference visa guide]). Our guide will be titled something like: '''"Welcoming Women+ into Wikimedia Tech: A Guide Based on Lived Experience."''' If time is tight (hopefully because many of you want to participate!), facilitators will produce a first draft after the session and share it with all participants in this thread. Notes: [https://etherpad.wikimedia.org/p/Wikimedia_Hackathon_Sharing_Journeys Etherpad] |Unconference session: '''Wikimedia and the Social Web''' Contact: [[User:EvanProdromou]] Summary: The social web is a movement to implement federated social networks with open standards. How can Wikimedia projects encourage this effort? Benefit from it? Notes: [[etherpad:p/Wikimedia_Hackathon_2026_SocialWeb|Etherpad]] |- |style="background:#f5cb2b"|10:00–11:00 | colspan="2" style="background:#f5cb2b" |Break on Floor 2 (outside Main Space) |- |11:15–12:15 |Unconference session: '''Tools That (Don’t) Break: A Toolforge Reliability Wishlist''' ([[phab:T424354|T424354]]) Contact: [[User:APuthin-WMF|Arthur Puthin]] Summary: This session aims to provide an open space for discussion around the reliability of Tools hosted on Toolforge, and what can be done on a platform level to improve the experience for maintainers. The WMF Developer Experience team is inviting new and experienced Toolforge users to contribute their view by sharing their own vision for what reliability should look like for Tools, so we can refine our understanding of how the platform can provide visibility into issues and enable maintainers to keep their tools running with confidence by providing improved monitoring and observability features. Notes: [https://etherpad.wikimedia.org/p/Toolforge-Reliability-Wishlist Etherpad] |Unconference session: '''API Glow Up: Shaping the Next Generation of Wikimedia APIs ([[phab:T423361|T423361]])''' Contact: [[metawiki:User:HCoplin-WMF|Halley Coplin (WMF)]] Summary: Have you ever stared at our API docs and thought, "why are there four ways to do this and none of them really feel ''right''?" Well you aren't alone, because we've asked the same thing and plan to start doing something about it! Come to this session to learn more about what we have in mind for taming the REST chaos, introducing structure to next generation Action endpoints (without breaking the current state), and how we might make our APIs more approachable for new users. Notes: [https://etherpad.wikimedia.org/p/API_Glow_Up__Shaping_the_Next_Generation_of_Wikime Etherpad] |- | style="background:#c7f5f9" |'''12:30–14:00''' | colspan="3" style="background:#c7f5f9" |'''<big>Lunch in Ristorante Betulla</big>''' |- | style="background:#f5a62b" |14:00–16:00 | colspan="3" style="background:#f5a62b" |'''<big>Closing showcase in the Main Space</big> — everyone should attend!''' Contact: [[User:BPiovesan-WMF|Bee]] Notes: [[etherpad:p/Wikimedia_Hackathon_2026_Closing_Showcase|Etherpad]] and [[phab:T422536|Phab Task]], '''[https://youtube.com/live/rHMTJB8gleQ?feature=share Livestream on YouTube]''' and slides (coming soon) |- | style="background:#c8c6ec" |16:00-17:00 | colspan="3" style="background:#c8c6ec" |<big>'''Wrap up!'''</big> All rooms and hacking spaces will be closed at 17:00 - be sure to gather all your belongings before leaving. |- | style="background:#f9e4ff" |'''17:30–22:00''' | colspan="3" style="background:#f9e4ff" |'''<big>Shuttles provided to downtown Milan ([[Wikimedia Hackathon 2026/Program#Sunday 03 May 2026|see details]])</big>''' |} 5jcx6l5ikjzqr5o3gc5fa2jlcksa4u8 Accessibility Checker 0 2402316 8364283 8364118 2026-05-03T12:15:07Z Super nabla 15627287 +licence 8364283 wikitext text/x-wiki {{draft}}<languages/>{{ptag|tool-accessibility-checker}} {{Tool|templatemode = |name = MediaWiki Accessibility Checker |status = unstable |type1 = |username = Super nabla |author = Francesco Tosoni |description = An automated accessibility checker used to evaluate HTML pages against international standards, helping ensure content is accessible to individuals using assistive technologies. |image = |imagesize = |version = |update = |version preview = |update preview = |license = {{EL|GNUGPL2}} |download = [[github:ftosoni/mediawiki-accessibility-checker|GitHub repo]] |readme = [[github:ftosoni/mediawiki-accessibility-checker/blob/master/README.md|README.md]] |changelog = [[github:ftosoni/mediawiki-accessibility-checker/blob/master/CHANGELOG.md|changelog]] |example = [[toolforge:accessibility-checker]] |parameters = |tags = |compatibility = |bugzilla = |phabricator = }} '''MediaWiki Accessibility Checker''' (<code>accessibility-checker</code>) is an automated utility that evaluates the accessibility of HTML pages. It ensures that digital content remains navigable for all individuals, particularly those utilising assistive technologies. Powered by AChecker, the backend was developed by the Inclusive Design Institute and licensed under the GNU GPL. The tool allows reviewers to interact with the system and make manual decisions about potential barriers that algorithms alone cannot determine with certainty. Try it out: [[toolforge:accessibility-checker]] == Features == The tool provides a comprehensive suite for accessibility auditing: * '''Conformance Levels''': Users can choose from various international accessibility standards for review. * '''Transparency''': Existing guidelines can be viewed in detail to understand exactly what criteria the tool is reviewing. * '''Reporting''': Users can export the reports in various formats, including PDF and CSV. Ecco una versione della sezione riscritta per focalizzarsi sull'architettura del sistema in formato Wikitext: == System Architecture == AChecker is built as a modular web application following a traditional Client-Server model, designed to integrate with modern CI/CD pipelines or operate as a standalone auditing tool. === Core Components === * Application Layer: Developed in '''PHP 7+''', this layer handles the logic for parsing HTML/CSS and executing accessibility test suites. It leverages '''Composer''' for dependency management, ensuring that library components are isolated and easily updatable. * Data Persistence: The system utilises a relational database ('''MySQL''' or '''SQLite''') to store evaluation reports, user accounts, and custom accessibility guidelines. The schema is designed for rapid retrieval of historical audit data. * Evaluation Engine: This internal module processes the DOM of target URLs or uploaded files, comparing elements against various standards (such as WCAG 2.1/2.2, Section 508, or BITV). * Reporting Interface: A web-based front-end that translates raw test results into human-readable formats or machine-readable exports like '''EARL''' (Evaluation and Report Language). === Integration Workflow === '''Input Retrieval''': The system fetches the source code via URL, file upload, or direct input. '''Rule Processing''': The Engine applies the selected accessibility rule sets. '''Normalisation''': Results are standardised into a common internal format. '''Output Generation''': The final report is persisted to the database and rendered via the web interface. == Deployment == The tool is optimised for deployment on Wikimedia Toolforge. While it supports MySQL, using SQLite is recommended for easier environment management. * '''Build Service''': Modern deployment using the Toolforge build service and a `Procfile`. * '''Standard Webservice''': Manual deployment by cloning the repository into the `public_html` directory. == Source == The source code for MediaWiki Accessibility Checker is open-source and hosted on GitHub. * '''Repository''': [[github:ftosoni/mediawiki-accessibility-checker|GitHub]] * '''Contribution''': Development is open to the community; see the [[github:ftosoni/mediawiki-accessibility-checker/blob/master/CONTRIBUTING.md|contributing guidelines]] for details. == See also == * [[m:Special:MyLanguage/Meta:Accessibility|Accessibility]], the central hub for accessibility efforts on Wikimedia projects. [[Category:Tools{{#translation:}}]] 6ezl6jmow4lo2hydeyssmsvsuob8hlt User:Ollie Shotton (WMDE)/Integration with JetBrains IDEs 2 2402574 8365093 8364233 2026-05-04T09:42:41Z Revibot 1724693 Bot: Fixing double redirect from [[User:Ollie Hyde (WMDE)/Integration with JetBrains IDEs]] to [[User:Ollie Hyde (WMDE)/Drafts/Integration with JetBrains IDEs]] 8365093 wikitext text/x-wiki #REDIRECT [[User:Ollie Hyde (WMDE)/Drafts/Integration with JetBrains IDEs]] pyq5kp0ykbktt28scmokezgrfstjhkb User:Gopavasanth/research/New Developer Experience Onboarding with Agamya 2 2402575 8364344 2026-05-03T13:07:39Z Gopavasanth 12044002 Created page with "== New Developer Experience: Onboarding with Agamya == === Motivation === The journey into open source often starts with curiosity and community exposure. In this case, the Wikimedia ecosystem was discovered through '''WikiClub Tech''', which served as the entry point. From there, the path expanded: * Discovered IMDUG through the wiki club activities. * Learned about Wikimedia User Groups (UGs), Chapters, and the broader Wikimedia movement * Gained an understanding o..." 8364344 wikitext text/x-wiki == New Developer Experience: Onboarding with Agamya == === Motivation === The journey into open source often starts with curiosity and community exposure. In this case, the Wikimedia ecosystem was discovered through '''WikiClub Tech''', which served as the entry point. From there, the path expanded: * Discovered IMDUG through the wiki club activities. * Learned about Wikimedia User Groups (UGs), Chapters, and the broader Wikimedia movement * Gained an understanding of how the community works '''Key highlight:''' * The Wikimedia community is very welcoming and supportive for newcomers ---- === Understanding the Community === The Wikimedia ecosystem is built around collaboration and openness: * Contributors range from beginners to highly experienced developers * Communication happens through platforms like Phabricator, Gerrit, IRC, and mailing lists * Mentorship and peer support play a major role * Contributions are publicly reviewed and discussed This creates a strong learning environment for new developers. ---- === Learning the Basics === Before contributing, it is important to build a foundation: * Learn core technologies: ** JavaScript ** PHP ** Basic web development concepts * Use online courses and tutorials to understand fundamentals A structured playbook is also used: * [https://commons.wikimedia.org/wiki/File:Wikiclub_Tech_-_Wiki_Developer_PlayBook.pdf Wiki Developer Playbook] '''Observation:''' * The playbook is helpful but could be better organized for smoother onboarding ---- === Initial Setup and Accounts === To start contributing, several accounts and configurations are required: * MediaWiki account * Wikimedia Developer account * Phabricator account (for task tracking) * Gerrit account (for code review) * SSH key setup (for secure access) Additional access: * GitLab (for certain repositories/tools) * Trusted contributor rights (granted over time) Understanding this setup is one of the first challenges for newcomers. ---- === Contribution Workflow === A typical contribution journey looks like: # Set up all required accounts and access # Learn how Gerrit works (code review system) # Understand how Phabricator tasks are structured # Pick a beginner-friendly task '''Important:''' * Learning Gerrit is crucial to understand code reviews and feedback ---- === Finding What to Contribute === Choosing the right first task is key: * Look for: ** "Good first task" ** "Easy" ** "Patch welcome" * Start small and build confidence gradually ---- === Learning by Exploring === One of the most effective ways to contribute: * Actively use Wikimedia websites * Understand how features work * Identify gaps or issues '''Key insight:''' * Finding and reporting bugs is a valuable contribution * Real understanding comes from using the product Bug reporting can be done via Phabricator. ---- === Exploring Tools and Ecosystem === Beyond core MediaWiki, contributors can explore: * Toolforge tools * Toolhub (to discover existing tools) * Community-built tools (e.g., Montage-like tools) This helps in: * Understanding real-world use cases * Contributing beyond core codebases ---- === Next Steps for Growth === After initial contributions: * Explore advanced areas: ** Gadgets ** User scripts ** MediaWiki extensions * Aim to contribute code that: ** Gets merged ** Is deployed and visible to users '''Motivation boost:''' * Small wins matter (e.g., getting a +2 on a patch) ---- === Club vs User Groups (UG) === '''WikiClub (Entry Level):''' * First exposure to Wikimedia * Structured learning environment * Peer-based exploration '''User Groups (UG):''' * More advanced guidance * Access to mentors * Deeper technical understanding Examples of learning in UG: * How Toolforge works * Understanding the Action API * Real-world contribution workflows ---- === Additional Motivations === Beyond technical growth, contributors are also motivated by: * Opportunities to travel * Attending Wikimedia events and hackathons * Networking with global contributors '''Community insight:''' * Giving opportunities to new contributors boosts motivation and engagement ---- === Key Takeaways === * The Wikimedia community is beginner-friendly and supportive * Structured onboarding helps, but self-exploration is essential * Small contributions build confidence over time * Real learning comes from using and improving the product * Mentorship and community play a crucial role in retention fdhawyaow1j7dkd2h0nl7d0wlnytyu2 Translations:Extension:TimedMediaHandler/VideoJS Player/78/en 1198 2402576 8364349 2026-05-03T13:12:10Z FuzzyBot 451990 Importing a new version from external source 8364349 wikitext text/x-wiki When paused, skip 1 frame back or forward 1krtba5rrtm2wg8ws6e2a0pz6iy7mmt Category:Security/pap 14 2402579 8364390 2026-05-03T14:04:17Z FuzzyBot 451990 Automatically creating translation of category used on [[CAPTCHA/pap]] 8364390 wikitext text/x-wiki <languages/> <span lang="en" dir="ltr" class="mw-content-ltr"></span> [[Category:Documentation{{#translation:}}]] [[Category:MediaWiki components{{#translation:}}]] dcv8jr4urm03zdy6gcalshl2ludlfrg Category:Documentation/pap 14 2402580 8364391 2026-05-03T14:04:17Z FuzzyBot 451990 Automatically creating translation of category used on [[Category:Security/pap]] 8364391 wikitext text/x-wiki <languages /> {{cmbox|text=<span lang="en" dir="ltr" class="mw-content-ltr">Documentation about the MediaWiki software.</span>}} <!-- This is to allow easy creation of translated subpages: --> <span lang="en" dir="ltr" class="mw-content-ltr"></span> [[Category:Top level{{#translation:}}]] 0dzpa9ispvbiuowhwhufwn035edqnqa Category:MediaWiki components/pap 14 2402581 8364392 2026-05-03T14:04:19Z FuzzyBot 451990 Automatically creating translation of category used on [[Category:Security/pap]] 8364392 wikitext text/x-wiki <languages /> <div lang="en" dir="ltr" class="mw-content-ltr"> The [[w:component|component]]s/[[w:part|part]]s that make up [[Special:MyLanguage/MediaWiki|MediaWiki]]. </div> [[Category:Top level{{#translation:}}]] [[Category:Manual{{#translation:}}]] 43wzj2wdkxvju4ba828aej0sz29l2tk Category:Manual/pap 14 2402582 8364393 2026-05-03T14:04:23Z FuzzyBot 451990 Automatically creating translation of category used on [[Category:MediaWiki components/pap]] 8364393 wikitext text/x-wiki <languages/> [[Image:MediaWiki-Manual_bookstyle-transparent.png|{{dir|{{pagelang}}|left|right}}|150px|<span lang="en" dir="ltr" class="mw-content-ltr">MediaWiki User's Guide</span>]] <!-- This is to allow easy creation of translated subpages: --> <span lang="en" dir="ltr" class="mw-content-ltr"></span> <span lang="en" dir="ltr" class="mw-content-ltr">This category contains administrator and developer documentation for MediaWiki.</span> <span lang="en" dir="ltr" class="mw-content-ltr">See {{ll|Project:Manual}}.</span> [[Category:MediaWiki for site admins{{#translation:}}]] [[Category:Documentation{{#translation:}}]] gwd53i7j4c0nyawlnrgm8jzksyi7z8v Category:MediaWiki for site admins/pap 14 2402583 8364394 2026-05-03T14:04:34Z FuzzyBot 451990 Automatically creating translation of category used on [[Category:Manual/pap]] 8364394 wikitext text/x-wiki <languages/> <div lang="en" dir="ltr" class="mw-content-ltr"> Content for MediaWiki site admins </div> [[Category:Top level{{#translation:}}]] l39qimhrzjongfouezucwmirm758bko User talk:~2026-26897-84 3 2402586 8364403 2026-05-03T14:41:00Z Lp0 on fire 18216376 Notification: speedy deletion nomination of [[Translations:Help:CirrusSearch/739/mnw]] 8364403 wikitext text/x-wiki == [[:Translations:Help:CirrusSearch/739/mnw]] nominated for speedy deletion == Hello. An item which you created, [[:Translations:Help:CirrusSearch/739/mnw]], has been selected for [[Project:Deletion|speedy deletion]].&nbsp;This is because the page is not a translation. If you object to the speedy deletion of the page, please remove the template from the item and create a discussion on the talk page.<!-- Template:CSD Notice --> <span class="nowrap">[[User:lp0 on fire|<span style="color:var(--color-link-red)">lp0 on fire</span>]] [[User talk:lp0 on fire|<span class="skin-invert" style="color:#006537">()</span>]]</span> 14:41, 3 May 2026 (UTC) 7jfwmpyi2bs3mdb1ezerc1vls16oubu Translations:Growth/Communities/How to configure the mentors' list/122/cs 1198 2402587 8364418 2026-05-03T15:26:31Z Rebulka 17532855 Created page with "Automatické rozeslání uvítací šablony všem novým účtům může zvýšit počet interakcí se zkušeným mentorem." 8364418 wikitext text/x-wiki Automatické rozeslání uvítací šablony všem novým účtům může zvýšit počet interakcí se zkušeným mentorem. ikgmto14poqe790zg9sf9l0vesqv5ax Translations:Growth/Communities/How to configure the mentors' list/123/cs 1198 2402588 8364422 2026-05-03T15:26:47Z Rebulka 17532855 Created page with "Každé řešení má své výhody a nevýhody:" 8364422 wikitext text/x-wiki Každé řešení má své výhody a nevýhody: 3hspc19yjy45dd845jbxx8kitzfqpxu Translations:Growth/Communities/How to configure the mentors' list/124/cs 1198 2402589 8364426 2026-05-03T15:27:09Z Rebulka 17532855 Created page with "Pravidelně navštěvujte $1, abyste sledovali nováčky, kteří vám byly přiděleni." 8364426 wikitext text/x-wiki Pravidelně navštěvujte $1, abyste sledovali nováčky, kteří vám byly přiděleni. 82za90p7sblncak3vy021bfdj839gqh Translations:Growth/Communities/How to configure the mentors' list/125/cs 1198 2402590 8364430 2026-05-03T15:27:44Z Rebulka 17532855 Created page with "Nezapomeňte je zmínit, když odpovíte na jejich zprávy." 8364430 wikitext text/x-wiki Nezapomeňte je zmínit, když odpovíte na jejich zprávy. 9jxcf3wsbtb3d0h4xevpntwje9d8gmu Translations:Growth/Communities/How to configure the mentors' list/126/cs 1198 2402591 8364432 2026-05-03T15:27:51Z Rebulka 17532855 Created page with "Zkontrolujte také naši dokumentaci na stránce [[$1|Jak ovlivňovat nováčky]]." 8364432 wikitext text/x-wiki Zkontrolujte také naši dokumentaci na stránce [[$1|Jak ovlivňovat nováčky]]. huhytrxvfbckgvruf9c19rfcho1cxnh Translations:Category:Time/1/vi 1198 2402592 8364447 2026-05-03T15:43:14Z Hiyuune 17854348 Created page with "$1" 8364447 wikitext text/x-wiki $1 rq0hjs7fpmzgl4u73gupx0a4684l5e2 Translations:Category:Time/Page display title/vi 1198 2402593 8364449 2026-05-03T15:43:24Z Hiyuune 17854348 Created page with "Thể loại:Thời gian" 8364449 wikitext text/x-wiki Thể loại:Thời gian sp4x6prop1ywowlrhj2zwy2w2k3w2o1 Translations:Category:Time/1/th 1198 2402594 8364450 2026-05-03T15:44:20Z Hiyuune 17854348 Created page with "$1" 8364450 wikitext text/x-wiki $1 rq0hjs7fpmzgl4u73gupx0a4684l5e2 Translations:Category:Time/Page display title/th 1198 2402595 8364452 2026-05-03T15:44:26Z Hiyuune 17854348 Created page with "หมวดหมู่:เวลา" 8364452 wikitext text/x-wiki หมวดหมู่:เวลา jemnry17ah0temdysldvwwyvrskc9l6 Translations:Help:Contents/58/it 1198 2402596 8364453 2026-05-03T15:44:58Z ~2026-26781-45 18367723 Created page with "Vedere $1." 8364453 wikitext text/x-wiki Vedere $1. 8rcvjjm492dmg9117n3u1ki0f4bmwl0 Translations:Category:Time/1/eu 1198 2402597 8364455 2026-05-03T15:45:23Z Hiyuune 17854348 Created page with "$1" 8364455 wikitext text/x-wiki $1 rq0hjs7fpmzgl4u73gupx0a4684l5e2 Translations:Category:Time/Page display title/eu 1198 2402598 8364457 2026-05-03T15:45:29Z Hiyuune 17854348 Created page with "Kategoria:Denbora" 8364457 wikitext text/x-wiki Kategoria:Denbora 5ts49jr7yapjccpmxgwvwea0wwpwv51 Translations:Category:Database/Page display title/eu 1198 2402599 8364463 2026-05-03T15:48:34Z Hiyuune 17854348 Created page with "Kategoria:Datu-baseak" 8364463 wikitext text/x-wiki Kategoria:Datu-baseak dnf75ch2w42mj16r9mv853tk5nnqiaq Translations:Category:Special Pages/1/vi 1198 2402600 8364464 2026-05-03T15:49:58Z Hiyuune 17854348 Created page with "* Xem: $1" 8364464 wikitext text/x-wiki * Xem: $1 qcv5ua3r8s7g9jv55a72trcff202ex2 Translations:Category:SVG/Page display title/vi 1198 2402601 8364466 2026-05-03T15:50:32Z Hiyuune 17854348 Created page with "Thể loại:SVG" 8364466 wikitext text/x-wiki Thể loại:SVG g5p9h1lfmaw8md9zoswx9shd0hdyen1 Translations:Category:SVG/1/vi 1198 2402602 8364467 2026-05-03T15:50:43Z Hiyuune 17854348 Created page with "Xem thêm $meta" 8364467 wikitext text/x-wiki Xem thêm $meta jqz02py6g22brcsx8e5wds2fijduuzr Translations:Category:SVG extensions/1/vi 1198 2402603 8364469 2026-05-03T15:51:16Z Hiyuune 17854348 Created page with "'''Xem thêm:'''" 8364469 wikitext text/x-wiki '''Xem thêm:''' lu9l5bs545ivqmlvnquhp5ze2nukjoa Translations:Category:SVG extensions/2/vi 1198 2402604 8364471 2026-05-03T15:51:33Z Hiyuune 17854348 Created page with "* [[w:Wikipedia:Graphic Lab/Resources/SVG resources|Wikipedia:Graphic Lab/Resources/SVG resources]]" 8364471 wikitext text/x-wiki * [[w:Wikipedia:Graphic Lab/Resources/SVG resources|Wikipedia:Graphic Lab/Resources/SVG resources]] e0dwkib0r9jt55xhgz1vejzu3gv7h17 Translations:Category:SVG extensions/Page display title/vi 1198 2402605 8364473 2026-05-03T15:51:48Z Hiyuune 17854348 Created page with "Thể loại:Tiện ích mở rộng SVG" 8364473 wikitext text/x-wiki Thể loại:Tiện ích mở rộng SVG lhtazdx42to1gk1ned0imoyyszte4kh Translations:Category:User interface/1/vi 1198 2402606 8364475 2026-05-03T15:53:15Z Hiyuune 17854348 Created page with "Thể loại này chứa các trang liên quan đến giao diện người dùng MediaWiki." 8364475 wikitext text/x-wiki Thể loại này chứa các trang liên quan đến giao diện người dùng MediaWiki. d9nbh5p3tau76w08iu4vrzwquxpxeqe 8364477 8364475 2026-05-03T15:53:29Z Hiyuune 17854348 8364477 wikitext text/x-wiki Thể loại này chứa các nội dung liên quan đến giao diện người dùng MediaWiki. h2xw6n2pyhimwle7rwtcy8pwy40hxkk Translations:Category:Template documentation/Page display title/vi 1198 2402607 8364479 2026-05-03T15:54:20Z Hiyuune 17854348 Created page with "Thể loại:Bản mẫu tài liệu" 8364479 wikitext text/x-wiki Thể loại:Bản mẫu tài liệu ckl70rqloursa4cwbv5q7e42256kw7r 8364480 8364479 2026-05-03T15:55:33Z Hiyuune 17854348 8364480 wikitext text/x-wiki Thể loại:Tài liệu bản mẫu adk84m0ufm2v84amgdxc4m0yemn61c3 Translations:Category:Templates by namespace/Page display title/vi 1198 2402608 8364481 2026-05-03T15:56:08Z Hiyuune 17854348 Created page with "Thể loại:Bản mẫu theo không gian tên" 8364481 wikitext text/x-wiki Thể loại:Bản mẫu theo không gian tên q7iehskrfheqnb78ycenzmqhpdpr2k1 Translations:Category:Link templates/1/vi 1198 2402609 8364482 2026-05-03T15:56:48Z Hiyuune 17854348 Created page with "$1" 8364482 wikitext text/x-wiki $1 rq0hjs7fpmzgl4u73gupx0a4684l5e2 Translations:Category:Link templates/Page display title/vi 1198 2402610 8364484 2026-05-03T15:57:02Z Hiyuune 17854348 Created page with "Thể loại:Liên kết bản mẫu" 8364484 wikitext text/x-wiki Thể loại:Liên kết bản mẫu 9f0d2vy0i7u3g3bay83kp5flmovbkck Translations:Help:Subpages/38/pt-br 1198 2402611 8364516 2026-05-03T16:47:47Z Nerun 899342 Created page with "Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível." 8364516 wikitext text/x-wiki Por outro lado, as subpáginas tendem a ter nomes longos e difíceis de lembrar, por isso pode ser mais fácil para o usuário utilizá-las o mínimo possível. 1b0s647r31q84oc8gu6ztqnq1ar1jco Translations:Help:Subpages/43/pt-br 1198 2402612 8364518 2026-05-03T16:51:42Z Nerun 899342 Created page with "Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano." 8364518 wikitext text/x-wiki Por exemplo, as subpáginas estão desativadas no domínio principal da Wikipédia. Então, embora a página de discussão não funcione corretamente a menos que o caractere de barra (“/”) seja tratado de forma especial para evitar que ela seja marcada como subpágina, a página correspondente no domínio principal pode acabar mantendo uma barra real no título por engano. 907ws9v6l2hxgglhj93lm325237cr9a Translations:Help:Subpages/40/pt-br 1198 2402613 8364524 2026-05-03T16:54:31Z Nerun 899342 Created page with "A barra invertida ($backslash) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/)." 8364524 wikitext text/x-wiki A barra invertida ($backslash) é tratada como um caractere normal na nomenclatura de subpáginas e pode ser usada no lugar da barra normal (/). 0rp4lf0qgxtou9ipu7kekvt1mzaf3c8 Translations:Help:Subpages/41/pt-br 1198 2402614 8364526 2026-05-03T16:55:52Z Nerun 899342 Created page with "Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[$1|forward slash]] ou barra invertida ($2) pode ser usado em vez disso, como a barra invertida "[[$3|big solidus]]" ($u1), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[$4|fraction slash]] ($u2), que resulta em Foo⁄bar." 8364526 wikitext text/x-wiki Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[$1|forward slash]] ou barra invertida ($2) pode ser usado em vez disso, como a barra invertida "[[$3|big solidus]]" ($u1), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[$4|fraction slash]] ($u2), que resulta em Foo⁄bar. evh87q2yxqxm0fmi9jpmjsx4pkrml29 8364528 8364526 2026-05-03T16:57:19Z Nerun 899342 8364528 wikitext text/x-wiki Além disso, como uma gambiarra grosseira, um caractere semelhante à barra [[$1|barra]] ou barra invertida ($2) pode ser usado em vez disso, como a barra invertida "[[$3|barra invertida grande]]" ($u1), que resulta em Foo⧸bar (cf. uma barra real: Foo/bar), ou a barra fracionária [[$4|barra fracionária]] ($u2), que resulta em Foo⁄bar. b8bn4xfes5be3df5503kkwx9jqqkwrm Translations:Help:Subpages/42/pt-br 1198 2402615 8364530 2026-05-03T16:57:39Z Nerun 899342 Created page with "Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque:" 8364530 wikitext text/x-wiki Três possíveis desvantagens técnicas (além da diferença visual em relação a uma barra real) surgem desse truque: 99sze1qzsmb9ug091kwca0ph0xa2sih Translations:Help:Subpages/39/pt-br 1198 2402616 8364536 2026-05-03T16:59:42Z Nerun 899342 Created page with "Você também pode organizar as páginas com o recurso [[$help-cat|categoria]], que é mais adequado para criar uma rede hierárquica de informações." 8364536 wikitext text/x-wiki Você também pode organizar as páginas com o recurso [[$help-cat|categoria]], que é mais adequado para criar uma rede hierárquica de informações. a1f40siim696r3b8zv45cyoieach3ts 8364540 8364536 2026-05-03T17:01:34Z Nerun 899342 8364540 wikitext text/x-wiki Você também pode organizar as páginas com o recurso de [[$help-cat|categorias]], que é mais adequado para a criação de uma rede hierarquizada de informações. 5gim6tf3r3yrqfxy8gs4agsmt9jc4rr Translations:Help:Subpages/50/pt-br 1198 2402617 8364542 2026-05-03T17:02:16Z Nerun 899342 Created page with "pai" 8364542 wikitext text/x-wiki pai domkguzj8o2x5ftdfs133ps5uxln44m 8364588 8364542 2026-05-03T17:05:12Z Nerun 899342 8364588 wikitext text/x-wiki mãe ni5154dbbbxt433684o0jhli0kz319r Translations:Help:Subpages/51/pt-br 1198 2402618 8364544 2026-05-03T17:02:41Z Nerun 899342 Created page with "'''PÁGINA ATUAL'''" 8364544 wikitext text/x-wiki '''PÁGINA ATUAL''' e8ali673j5xjzpcedv2t0q5bayz16jt Translations:Help:Subpages/52/pt-br 1198 2402619 8364546 2026-05-03T17:02:53Z Nerun 899342 Created page with "filha 1" 8364546 wikitext text/x-wiki filha 1 o1r6rupzflbth0dmm33bljayilo9q39 Translations:Help:Subpages/53/pt-br 1198 2402620 8364548 2026-05-03T17:03:02Z Nerun 899342 Created page with "neta" 8364548 wikitext text/x-wiki neta 8ianc3b0qu39vlevpky59hndcsmezbg Translations:Help:Subpages/54/pt-br 1198 2402621 8364550 2026-05-03T17:03:15Z Nerun 899342 Created page with "bisneta" 8364550 wikitext text/x-wiki bisneta 7fttkugzsybbank5ba33dtgrpqiv2w0 Translations:Help:Subpages/55/pt-br 1198 2402622 8364552 2026-05-03T17:03:19Z Nerun 899342 Created page with "filha 2" 8364552 wikitext text/x-wiki filha 2 8dxa5bahk0dxdq64uhvz2w2e6frol12 Translations:Help:Subpages/56/pt-br 1198 2402623 8364554 2026-05-03T17:03:23Z Nerun 899342 Created page with "neta" 8364554 wikitext text/x-wiki neta 8ianc3b0qu39vlevpky59hndcsmezbg Translations:Help:Subpages/57/pt-br 1198 2402624 8364556 2026-05-03T17:03:28Z Nerun 899342 Created page with "bisneta" 8364556 wikitext text/x-wiki bisneta 7fttkugzsybbank5ba33dtgrpqiv2w0 Translations:Help:Subpages/58/pt-br 1198 2402625 8364558 2026-05-03T17:03:36Z Nerun 899342 Created page with "avó" 8364558 wikitext text/x-wiki avó ftx204637j4nc37wznur9uy75rppta8 Translations:Help:Subpages/59/pt-br 1198 2402626 8364560 2026-05-03T17:03:40Z Nerun 899342 Created page with "mãe" 8364560 wikitext text/x-wiki mãe ni5154dbbbxt433684o0jhli0kz319r Translations:Help:Subpages/60/pt-br 1198 2402627 8364562 2026-05-03T17:03:48Z Nerun 899342 Created page with "'''PÁGINA ATUAL'''" 8364562 wikitext text/x-wiki '''PÁGINA ATUAL''' e8ali673j5xjzpcedv2t0q5bayz16jt Translations:Help:Subpages/61/pt-br 1198 2402628 8364564 2026-05-03T17:03:52Z Nerun 899342 Created page with "filha" 8364564 wikitext text/x-wiki filha rnliaijqprlmqqak2y0dqpxav5ril3y Translations:Help:Subpages/62/pt-br 1198 2402629 8364566 2026-05-03T17:03:56Z Nerun 899342 Created page with "neta" 8364566 wikitext text/x-wiki neta 8ianc3b0qu39vlevpky59hndcsmezbg Translations:Help:Subpages/63/pt-br 1198 2402630 8364568 2026-05-03T17:04:00Z Nerun 899342 Created page with "bisneta" 8364568 wikitext text/x-wiki bisneta 7fttkugzsybbank5ba33dtgrpqiv2w0 Translations:Help:Subpages/64/pt-br 1198 2402631 8364570 2026-05-03T17:04:04Z Nerun 899342 Created page with "avó" 8364570 wikitext text/x-wiki avó ftx204637j4nc37wznur9uy75rppta8 Translations:Help:Subpages/65/pt-br 1198 2402632 8364572 2026-05-03T17:04:08Z Nerun 899342 Created page with "mãe" 8364572 wikitext text/x-wiki mãe ni5154dbbbxt433684o0jhli0kz319r Translations:Help:Subpages/66/pt-br 1198 2402633 8364574 2026-05-03T17:04:20Z Nerun 899342 Created page with "'''PÁGINA ATUAL'''" 8364574 wikitext text/x-wiki '''PÁGINA ATUAL''' e8ali673j5xjzpcedv2t0q5bayz16jt Translations:Help:Subpages/67/pt-br 1198 2402634 8364576 2026-05-03T17:04:27Z Nerun 899342 Created page with "filha" 8364576 wikitext text/x-wiki filha rnliaijqprlmqqak2y0dqpxav5ril3y Translations:Help:Subpages/68/pt-br 1198 2402635 8364578 2026-05-03T17:04:36Z Nerun 899342 Created page with "tataraneta" 8364578 wikitext text/x-wiki tataraneta i1aw939r5783nv6qohiph4kxqyn6925 Translations:Help:Subpages/69/pt-br 1198 2402636 8364580 2026-05-03T17:04:40Z Nerun 899342 Created page with "bisneta" 8364580 wikitext text/x-wiki bisneta 7fttkugzsybbank5ba33dtgrpqiv2w0 Translations:Help:Subpages/70/pt-br 1198 2402637 8364582 2026-05-03T17:04:46Z Nerun 899342 Created page with "avó" 8364582 wikitext text/x-wiki avó ftx204637j4nc37wznur9uy75rppta8 Translations:Help:Subpages/71/pt-br 1198 2402638 8364584 2026-05-03T17:04:53Z Nerun 899342 Created page with "mãe" 8364584 wikitext text/x-wiki mãe ni5154dbbbxt433684o0jhli0kz319r Translations:Help:Subpages/72/pt-br 1198 2402639 8364586 2026-05-03T17:04:56Z Nerun 899342 Created page with "'''PÁGINA ATUAL'''" 8364586 wikitext text/x-wiki '''PÁGINA ATUAL''' e8ali673j5xjzpcedv2t0q5bayz16jt Translations:Help:Subpages/73/pt-br 1198 2402640 8364590 2026-05-03T17:05:39Z Nerun 899342 Created page with "filha" 8364590 wikitext text/x-wiki filha rnliaijqprlmqqak2y0dqpxav5ril3y 8364594 8364590 2026-05-03T17:05:57Z Nerun 899342 8364594 wikitext text/x-wiki página filha grbi2y2gulaaqjy6sxs2pp9vvf5g8vm Translations:Help:Subpages/74/pt-br 1198 2402641 8364592 2026-05-03T17:05:47Z Nerun 899342 Created page with "página neta" 8364592 wikitext text/x-wiki página neta l66ablgg7qpab60na10cnw8iz6k0znx Translations:Help:Subpages/75/pt-br 1198 2402642 8364596 2026-05-03T17:06:10Z Nerun 899342 Created page with "página bisneta" 8364596 wikitext text/x-wiki página bisneta 9fbi6zc8t4mdlh1g8u4xh2bvs78yavr Translations:Help:Subpages/76/pt-br 1198 2402643 8364598 2026-05-03T17:06:16Z Nerun 899342 Created page with "página tataraneta" 8364598 wikitext text/x-wiki página tataraneta jpqcsem3du2cfeuacp9mvtkucqmfp44 Translations:Help:Subpages/44/pt-br 1198 2402644 8364600 2026-05-03T17:06:26Z Nerun 899342 Created page with "Relações entre páginas" 8364600 wikitext text/x-wiki Relações entre páginas qu9ypj8rwc09r3vr2cqy5c3mp1r191s Translations:Help:Subpages/45/pt-br 1198 2402645 8364602 2026-05-03T17:06:29Z Nerun 899342 Created page with "'''PÁGINA ATUAL'''" 8364602 wikitext text/x-wiki '''PÁGINA ATUAL''' e8ali673j5xjzpcedv2t0q5bayz16jt Translations:Help:Subpages/46/pt-br 1198 2402646 8364604 2026-05-03T17:06:33Z Nerun 899342 Created page with "filha" 8364604 wikitext text/x-wiki filha rnliaijqprlmqqak2y0dqpxav5ril3y Translations:Help:Subpages/47/pt-br 1198 2402647 8364606 2026-05-03T17:06:36Z Nerun 899342 Created page with "neta" 8364606 wikitext text/x-wiki neta 8ianc3b0qu39vlevpky59hndcsmezbg Translations:Help:Subpages/48/pt-br 1198 2402648 8364608 2026-05-03T17:06:39Z Nerun 899342 Created page with "bisneta" 8364608 wikitext text/x-wiki bisneta 7fttkugzsybbank5ba33dtgrpqiv2w0 Translations:Help:Subpages/49/pt-br 1198 2402649 8364610 2026-05-03T17:06:44Z Nerun 899342 Created page with "tataraneta" 8364610 wikitext text/x-wiki tataraneta i1aw939r5783nv6qohiph4kxqyn6925 Translations:Extension:CodeMirror/283/cs 1198 2402650 8364613 2026-05-03T17:10:09Z Rebulka 17532855 Created page with "Pokud se pro úpravu kódu používá [[$1|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba $2, která je ve výchozím nastavení nastavena na $3." 8364613 wikitext text/x-wiki Pokud se pro úpravu kódu používá [[$1|CodeMirror místo CodeEditoru]], má vliv druhá uživatelská volba $2, která je ve výchozím nastavení nastavena na $3. k1qn98fghz6kun0lqj5ptp0rewre0pc Translations:Extension:CodeMirror/280/cs 1198 2402651 8364615 2026-05-03T17:10:53Z Rebulka 17532855 Created page with "Stejné jako $1, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "$2" (wikitext)." 8364615 wikitext text/x-wiki Stejné jako $1, ale platí pro "code". Tedy pro jakýkoli režim CodeMirror jiný než "$2" (wikitext). 9sc1m30d8b935mokr6li4szi7ghtz3d Translations:Extension:CodeMirror/281/cs 1198 2402652 8364617 2026-05-03T17:11:23Z Rebulka 17532855 Created page with "Výchozí preference jsou nastaveny buď na wikitext ($1), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ($2)." 8364617 wikitext text/x-wiki Výchozí preference jsou nastaveny buď na wikitext ($1), nebo na všechny ostatní "režimy", jako je JavaScript, CSS a JSON ($2). nuk7hvtjas5nb2kaber5hfvhq19rd9c Translations:Extension:CodeMirror/282/cs 1198 2402653 8364626 2026-05-03T17:14:51Z Rebulka 17532855 Created page with "Výchozí hodnota (code)" 8364626 wikitext text/x-wiki Výchozí hodnota (code) dsy7j4ez85y37fp3440zhufi4mogw4m Translations:Extension:CodeMirror/284/cs 1198 2402654 8364628 2026-05-03T17:14:57Z Rebulka 17532855 Created page with "Zvýrazňování syntaxe na $1." 8364628 wikitext text/x-wiki Zvýrazňování syntaxe na $1. nntb248q9l9pfn3nitegof6fce3a4cy Translations:Extension:CodeMirror/285/cs 1198 2402655 8364632 2026-05-03T17:15:45Z Rebulka 17532855 Created page with "CSS třída $1 byla přejmenována na $2." 8364632 wikitext text/x-wiki CSS třída $1 byla přejmenována na $2. hx09hgyoqarp0lmr6s4fgg1l5g4k1my Translations:Extension:CodeMirror/276/cs 1198 2402656 8364634 2026-05-03T17:16:03Z Rebulka 17532855 Created page with "Tato příručka platí pro MediaWiki 1.45 a novější. Od MediaWiki 1.46 již [[$1|CodeMirror 5]] není podporováno." 8364634 wikitext text/x-wiki Tato příručka platí pro MediaWiki 1.45 a novější. Od MediaWiki 1.46 již [[$1|CodeMirror 5]] není podporováno. d28s3ev08cbimkh8jdg3jvj1bpqm9vm Translations:Extension:CodeMirror/279/cs 1198 2402657 8364636 2026-05-03T17:16:20Z Rebulka 17532855 Created page with "Ujistěte se, že používáte správné moduly [[$1|ResourceLoader]]." 8364636 wikitext text/x-wiki Ujistěte se, že používáte správné moduly [[$1|ResourceLoader]]. npgfr9emmuc4iw996ecwn5wje06mrwb Translations:Extension:CodeMirror/275/cs 1198 2402658 8364644 2026-05-03T17:17:57Z Rebulka 17532855 Created page with "== Historie vydání ==" 8364644 wikitext text/x-wiki == Historie vydání == clabp5z6lle71vs30061g5mhqzgay19 Translations:Extension:CodeMirror/277/cs 1198 2402659 8364646 2026-05-03T17:18:15Z Rebulka 17532855 Created page with "Verze rozšíření CodeMirror 6 byla představena jako beta funkce." 8364646 wikitext text/x-wiki Verze rozšíření CodeMirror 6 byla představena jako beta funkce. osm2vmq6w9lfmll7tk48vqe4e52hkpr Translations:Extension:CodeMirror/278/cs 1198 2402660 8364648 2026-05-03T17:18:48Z Rebulka 17532855 Created page with "Po dvou letech vývoje a testování byla oficiálně povýšena verze "Vylepšené zvýrazňování syntaxe" (CodeMirror 6) z beta verze. Tato aktualizace přinesla všem uživatelům standardního zvýrazňovače syntaxe pokročilé funkce, jako je skládání kódu, automatické doplňování a linting, a zároveň výrazně zlepšila čitelnost wikitextu." 8364648 wikitext text/x-wiki Po dvou letech vývoje a testování byla oficiálně povýšena verze "Vylepšené zvýrazňování syntaxe" (CodeMirror 6) z beta verze. Tato aktualizace přinesla všem uživatelům standardního zvýrazňovače syntaxe pokročilé funkce, jako je skládání kódu, automatické doplňování a linting, a zároveň výrazně zlepšila čitelnost wikitextu. eoo6z0as4dwlaatv9jwv2h3qrb70ero Translations:Help:Content translation/Translating/Translation quality/45/ca 1198 2402662 8364670 2026-05-03T19:16:53Z Pallares 373182 Created page with "En alguns casos, els usuaris encara poden publicar, però la pàgina resultant es pot afegir a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi." 8364670 wikitext text/x-wiki En alguns casos, els usuaris encara poden publicar, però la pàgina resultant es pot afegir a una categoria de seguiment de traduccions potencialment no revisades perquè la comunitat les revisi. 92ecefvea3k2dxslm6ldgah3f1czdtl Translations:Help:Content translation/Translating/Translation quality/90/ca 1198 2402663 8364674 2026-05-03T19:17:50Z Pallares 373182 Created page with "Per a l'experiència mòbil, el conjunt inicial de límits segueix un enfocament més senzill." 8364674 wikitext text/x-wiki Per a l'experiència mòbil, el conjunt inicial de límits segueix un enfocament més senzill. 5kol8t3wlqiazmuwmojmmbafyy0ab8t Translations:Article guidance/148/ar 1198 2402664 8364676 2026-05-03T19:18:13Z ToadetteEdit 17805473 Created page with "يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر." 8364676 wikitext text/x-wiki يضمن توطينها الآن أن تكون ميزة إرشاد المقالة مفيدة للمحررين بعد النشر. fw3epfkg8vnk989qakuvvyrgwskwqre Translations:Help:Content translation/Translating/Translation quality/91/ca 1198 2402665 8364678 2026-05-03T19:18:17Z Pallares 373182 Created page with "De moment, només es considera el percentatge global de traducció automàtica sense modificacions per a tota la traducció." 8364678 wikitext text/x-wiki De moment, només es considera el percentatge global de traducció automàtica sense modificacions per a tota la traducció. 6huoyq2vj4ojyucv4lkxflr9lfht03f Translations:Help:Content translation/Translating/Translation quality/93/ca 1198 2402666 8364680 2026-05-03T19:18:49Z Pallares 373182 Created page with "En particular, es mostra un avís quan el percentatge de traducció automàtica sense modificacions és superior al 85% per a tota la secció, i s'impedeix la publicació quan el percentatge de traducció automàtica sense modificacions és superior al 95%" 8364680 wikitext text/x-wiki En particular, es mostra un avís quan el percentatge de traducció automàtica sense modificacions és superior al 85% per a tota la secció, i s'impedeix la publicació quan el percentatge de traducció automàtica sense modificacions és superior al 95% r6ncvn67pgn9katpb3idzvkjruehdal Translations:Article guidance/149/ar 1198 2402667 8364681 2026-05-03T19:18:50Z ToadetteEdit 17805473 Created page with "===تكييف مخطط نموذجي في ويكيبيديا===" 8364681 wikitext text/x-wiki ===تكييف مخطط نموذجي في ويكيبيديا=== 2nzflwxrrbn3rx74v2441p0ws3bv76s Translations:Help:Content translation/Translating/Translation quality/96/ca 1198 2402668 8364684 2026-05-03T19:19:17Z Pallares 373182 Created page with "=== Publicació de traduccions ràpides sense revisar ===" 8364684 wikitext text/x-wiki === Publicació de traduccions ràpides sense revisar === kaer7wrau8o6qlyjrmkcjdpljjonnec Translations:Article guidance/150/ar 1198 2402669 8364685 2026-05-03T19:19:18Z ToadetteEdit 17805473 Created page with "يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة." 8364685 wikitext text/x-wiki يظهر مخطط تفصيلي عند إنشاء مقالات من نوع معين في ويكيبيديا باستخدام ميزة إرشاد المقالة. fw3bt33zlnfjm1o92dcss8527749pgz Translations:Article guidance/151/ar 1198 2402670 8364688 2026-05-03T19:19:51Z ToadetteEdit 17805473 Created page with "سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا." 8364688 wikitext text/x-wiki سيتم تعديل هذه المخططات النموذجية وترجمتها إلى نسخ تجريبية من ويكيبيديا. j7fplujtw5ph1db8ra8bhsu88ryp47u Translations:Help:Content translation/Translating/Translation quality/98/ca 1198 2402671 8364690 2026-05-03T19:19:53Z Pallares 373182 Created page with "Per tal de prioritzar la qualitat per sobre de la quantitat, s'ha definit un mecanisme per limitar la publicació de traduccions ràpides no revisades." 8364690 wikitext text/x-wiki Per tal de prioritzar la qualitat per sobre de la quantitat, s'ha definit un mecanisme per limitar la publicació de traduccions ràpides no revisades. 61f5gpy1u61o3nevpwjvayvd5i7gjm3 Translations:Article guidance/152/ar 1198 2402672 8364692 2026-05-03T19:20:08Z ToadetteEdit 17805473 Created page with "يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه:" 8364692 wikitext text/x-wiki يمكنك تكييفها وتوطينها إلى ويكيبيديا الخاص بك عن طريق اتباع الخطوات أدناه: o17vitu6dmxljufpz2vjt0d860mffod Translations:Help:Content translation/Translating/Translation quality/100/ca 1198 2402673 8364694 2026-05-03T19:20:18Z Pallares 373182 Created page with "L'estimació del període d'espera considera 1 minut per paràgraf fins a un màxim de 10 minuts. És a dir:" 8364694 wikitext text/x-wiki L'estimació del període d'espera considera 1 minut per paràgraf fins a un màxim de 10 minuts. És a dir: onj5r31yjanc0qmuatakbz1fwmvcmwy Translations:Help:Content translation/Translating/Translation quality/102/ca 1198 2402674 8364695 2026-05-03T19:20:48Z Pallares 373182 Created page with "Per als articles amb més de 10 paràgrafs, volem assegurar-nos que els usuaris hagin dedicat almenys 10 minuts a traduir-los." 8364695 wikitext text/x-wiki Per als articles amb més de 10 paràgrafs, volem assegurar-nos que els usuaris hagin dedicat almenys 10 minuts a traduir-los. 0c971numpvvaa2ks2memyf1buqfmvun Translations:Article guidance/153/ar 1198 2402675 8364696 2026-05-03T19:20:48Z ToadetteEdit 17805473 Created page with "اختر مخطط من [$url هذه القائمة] (على سبيل المثال: [$url2 مشروع:إرشاد المقالة/شخص])" 8364696 wikitext text/x-wiki اختر مخطط من [$url هذه القائمة] (على سبيل المثال: [$url2 مشروع:إرشاد المقالة/شخص]) mx2k8vrfpocwhav6bkjl0u1e9iagiua Translations:Help:Content translation/Translating/Translation quality/103/ca 1198 2402676 8364699 2026-05-03T19:21:52Z Pallares 373182 Created page with "Això s'ha [[$1|aplicat inicialment al mòbil]], ja que és un espai amb menys activitat, i després de mesurar l'impacte considerarem expandir-ho també a l'escriptori." 8364699 wikitext text/x-wiki Això s'ha [[$1|aplicat inicialment al mòbil]], ja que és un espai amb menys activitat, i després de mesurar l'impacte considerarem expandir-ho també a l'escriptori. 97tpxpz4esb3mccmnhqxwt9klrdmccf Translations:Article guidance/154/ar 1198 2402677 8364701 2026-05-03T19:21:54Z ToadetteEdit 17805473 Created page with "أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [$url مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]." 8364701 wikitext text/x-wiki أنشئ صفحة جديدة في مساحة اسم ويكيبيديا باتباع تنسيق التسمية. على سبيل المثال، مخطط [$url مشروع:إرشاد المقالات/شخص] في ويكيبيديا الفرنسية هو: [[:fr:Wikipédia:Aide_à_la_rédaction_d'articles/Personne|Wikipédia:Aide à la rédaction d'articles/Personne]]. 3iqtj6x935t7bpsas2zrv1x4r9g7ncg Translations:Help:Content translation/Translating/Translation quality/12/ca 1198 2402678 8364703 2026-05-03T19:22:08Z Pallares 373182 Created page with "== Ajustant els límits ==" 8364703 wikitext text/x-wiki == Ajustant els límits == oexzga2auc8n8a0mdaoj0x087tozbc8 Translations:Article guidance/155/ar 1198 2402679 8364705 2026-05-03T19:22:25Z ToadetteEdit 17805473 Created page with "فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا:" 8364705 wikitext text/x-wiki فيما يلي تنسيقات صفحات ويكيبيديا التجريبية الخاصة بنا: i6btzdywaibal1h03clc0cbti796251 Translations:Help:Content translation/Translating/Translation quality/56/ca 1198 2402680 8364707 2026-05-03T19:22:35Z Pallares 373182 Created page with "Els límits descrits anteriorment proporcionen un conjunt de mecanismes generals, però poden necessitar ajustaments en funció de les necessitats particulars de cada wiki." 8364707 wikitext text/x-wiki Els límits descrits anteriorment proporcionen un conjunt de mecanismes generals, però poden necessitar ajustaments en funció de les necessitats particulars de cada wiki. 4n082mbncic43w5hfg3obuw4ltvxm85 Translations:Article guidance/156/ar 1198 2402681 8364709 2026-05-03T19:22:48Z ToadetteEdit 17805473 Created page with "[اسم المخطط]" 8364709 wikitext text/x-wiki [اسم المخطط] 9034k7n60k43i6zxa17n5guvolkpda4 Translations:Article guidance/157/ar 1198 2402682 8364711 2026-05-03T19:22:52Z ToadetteEdit 17805473 Created page with "[اسم المخطط]" 8364711 wikitext text/x-wiki [اسم المخطط] 9034k7n60k43i6zxa17n5guvolkpda4 Translations:Article guidance/158/ar 1198 2402683 8364713 2026-05-03T19:22:55Z ToadetteEdit 17805473 Created page with "[اسم المخطط]" 8364713 wikitext text/x-wiki [اسم المخطط] 9034k7n60k43i6zxa17n5guvolkpda4 Translations:Article guidance/159/ar 1198 2402684 8364715 2026-05-03T19:22:58Z ToadetteEdit 17805473 Created page with "[اسم المخطط]" 8364715 wikitext text/x-wiki [اسم المخطط] 9034k7n60k43i6zxa17n5guvolkpda4 Translations:Article guidance/160/ar 1198 2402685 8364717 2026-05-03T19:23:01Z ToadetteEdit 17805473 Created page with "[اسم المخطط]" 8364717 wikitext text/x-wiki [اسم المخطط] 9034k7n60k43i6zxa17n5guvolkpda4 Translations:Article guidance/161/ar 1198 2402686 8364719 2026-05-03T19:23:06Z ToadetteEdit 17805473 Created page with "[اسم المخطط]" 8364719 wikitext text/x-wiki [اسم المخطط] 9034k7n60k43i6zxa17n5guvolkpda4 Translations:Article guidance/162/ar 1198 2402687 8364721 2026-05-03T19:23:09Z ToadetteEdit 17805473 Created page with "[اسم المخطط]" 8364721 wikitext text/x-wiki [اسم المخطط] 9034k7n60k43i6zxa17n5guvolkpda4 Translations:Article guidance/163/ar 1198 2402688 8364723 2026-05-03T19:23:11Z ToadetteEdit 17805473 Created page with "[اسم المخطط]" 8364723 wikitext text/x-wiki [اسم المخطط] 9034k7n60k43i6zxa17n5guvolkpda4 Translations:Article guidance/164/ar 1198 2402689 8364725 2026-05-03T19:23:45Z ToadetteEdit 17805473 Created page with "يمكنك الوصول إلى محتوى المخطط التفصيلي من خلال وضع "عدل مصدر"." 8364725 wikitext text/x-wiki يمكنك الوصول إلى محتوى المخطط التفصيلي من خلال وضع "عدل مصدر". tfwq8uuluu5gyfqbk6x7v5vnbpddc9v Translations:Article guidance/165/ar 1198 2402690 8364727 2026-05-03T19:24:23Z ToadetteEdit 17805473 Created page with "انسخ محتوى المخطط التفصيلي من وضع "عدل المصدر" والصقه في صفحتك الجديدة، مع التأكد من تضمين جميع العلامات تمامًا كما هي في المخطط التفصيلي الأصلي." 8364727 wikitext text/x-wiki انسخ محتوى المخطط التفصيلي من وضع "عدل المصدر" والصقه في صفحتك الجديدة، مع التأكد من تضمين جميع العلامات تمامًا كما هي في المخطط التفصيلي الأصلي. oskypix8r6ljgu38nd9u09gjl0u4qde Translations:Article guidance/166/ar 1198 2402691 8364729 2026-05-03T19:25:07Z ToadetteEdit 17805473 Created page with "ترجم وكيّف المحتوى لتتناسب مع معايير ويكيبيديا وممارسات وسياسات وقوالب." 8364729 wikitext text/x-wiki ترجم وكيّف المحتوى لتتناسب مع معايير ويكيبيديا وممارسات وسياسات وقوالب. b5hoyb5f2xi6eyxobllhwz2pc7j31pi 8364731 8364729 2026-05-03T19:25:22Z ToadetteEdit 17805473 8364731 wikitext text/x-wiki ترجم وكيّف المحتوى لتتناسب مع معايير ويكيبيديا وممارساتها وسياساتها وقوالبها. 2p2od2z083orgdd7299w5cynpfuxffb Translations:Article guidance/167/ar 1198 2402692 8364733 2026-05-03T19:26:12Z ToadetteEdit 17805473 Created page with "لا تقم بإزالة أو تغيير أي علامات أو النص الموجود داخل العلامات (على سبيل المثال $1)، حيث أن هذه العلامات ضرورية لكي تعمل الميزة." 8364733 wikitext text/x-wiki لا تقم بإزالة أو تغيير أي علامات أو النص الموجود داخل العلامات (على سبيل المثال $1)، حيث أن هذه العلامات ضرورية لكي تعمل الميزة. jhq0mfxyyavmnppg674tj13jumul95e Translations:Article guidance/168/ar 1198 2402693 8364735 2026-05-03T19:27:18Z ToadetteEdit 17805473 Created page with "راجع قسم "[[Article guidance/Test feature guide|دليل سريع للعلامات المستخدمة في المخططات]]" لمزيد من المعلومات حول عناصر العلامات." 8364735 wikitext text/x-wiki راجع قسم "[[Article guidance/Test feature guide|دليل سريع للعلامات المستخدمة في المخططات]]" لمزيد من المعلومات حول عناصر العلامات. 52w6mpwet0brcc4275tmc6mjgu2f3s0 Translations:Article guidance/169/ar 1198 2402694 8364737 2026-05-03T19:27:37Z ToadetteEdit 17805473 Created page with "نشر الصفحة عندما تنتهي، وقد قمت بتكييف مخطط." 8364737 wikitext text/x-wiki نشر الصفحة عندما تنتهي، وقد قمت بتكييف مخطط. p6lz4toewzqmiwic6jgulz2ejam6ord Translations:Article guidance/170/ar 1198 2402695 8364740 2026-05-03T19:36:02Z ToadetteEdit 17805473 Created page with "ستظهر الصفحات بشكل غير منتظم بعد النشر مؤقتًا، ريثما يتم تثبيت الإضافة. ===ملخصات للمقالات التي يجب إعطاؤها الأولوية عند التعديل=== هذه أهم عشرة ملخصات للمقالات التي يجب إعطاؤها الأولوية عند تعديلها وترجمتها إلى نسخ ويكيبيديا المختارة. * [https://b24e11a4f1.catalyst.wmcloud.org/wik..." 8364740 wikitext text/x-wiki ستظهر الصفحات بشكل غير منتظم بعد النشر مؤقتًا، ريثما يتم تثبيت الإضافة. ===ملخصات للمقالات التي يجب إعطاؤها الأولوية عند التعديل=== هذه أهم عشرة ملخصات للمقالات التي يجب إعطاؤها الأولوية عند تعديلها وترجمتها إلى نسخ ويكيبيديا المختارة. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالة/شخص] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician مشروع:إرشاد المقالة/سياسي] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson مشروع:إرشاد المقالة/شخص رياضي] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement مشروع:إرشاد المقالة/ مستوطنة] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film مشروع:إرشاد المقالة/فلم] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/موسيقي] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor مشروع:إرشاد المقالة/ممثل] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal مشروع:إرشاد المقالة/حيوان] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club مشروع:إرشاد المقالة/نادي رياضي] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game مشروع:إرشاد المقالة/لعبة فيديو] 8b3uqfaj23iecpktnniiwvqnyj5isum 8364742 8364740 2026-05-03T19:37:30Z ToadetteEdit 17805473 8364742 wikitext text/x-wiki ستظهر الصفحات بشكل غير منتظم بعد النشر مؤقتًا، ريثما يتم تثبيت الإضافة. ===ملخصات للمقالات التي يجب إعطاؤها الأولوية عند التعديل=== هذه أهم عشرة ملخصات للمقالات التي يجب إعطاؤها الأولوية عند تعديلها وترجمتها إلى نسخ ويكيبيديا المختارة. * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Person مشروع:إرشاد المقالة/شخص] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Politician مشروع:إرشاد المقالة/سياسي] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sportsperson مشروع:إرشاد المقالة/رياضي] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Human_Settlement مشروع:إرشاد المقالة/مستوطنة] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Film مشروع:إرشاد المقالة/فلم] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Musician مشروع:إرشاد المقالة/موسيقي] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Actor مشروع:إرشاد المقالة/ممثل] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Animal مشروع:إرشاد المقالة/حيوان] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Sports_Club مشروع:إرشاد المقالة/نادي رياضي] * [https://b24e11a4f1.catalyst.wmcloud.org/wiki/Project:ArticleGuidance/Video_Game مشروع:إرشاد المقالة/لعبة فيديو] 8b6gl20ukd7g1vofv3wkq7ilf291jp1 Translations:Language Onboarding and Development/Starter kit/Page display title/kcg 1198 2402696 8364760 2026-05-03T22:54:23Z Kambai Akau 13828735 Created page with "Language Onboarding and Development/Starter kit" 8364760 wikitext text/x-wiki Language Onboarding and Development/Starter kit 2syhfdru3zsus510ghg096st6mm12g6 Language Onboarding and Development/Starter kit/kcg 0 2402697 8364761 2026-05-03T22:54:26Z Kambai Akau 13828735 Created page with "Language Onboarding and Development/Starter kit" 8364761 wikitext text/x-wiki <languages/> {{Starter kit header|active=}} {{Tracked|T410699}} {{Wikimedia engineering project information | name = Starter kit | logo = | group = [[Wikimedia Language and Product Localization|Wikimedia Language and Product Localization]] | description = Enable new and small language communities to know what they need to get started & progress their wikis. | lead = | members = [[User:SSethi (WMF)|Srishti Sethi]], [[User:ToluAyod|Tolu Ayodele]], [[User:MMunyoki (WMF)|Mary Munyoki]], [[User:EAMedina_(WMF)|Eduardo Medina]], [[User:UOzurumba_(WMF)|Uzoma Ozurumba ]], [[User:NGkountas_(WMF)|Nik Gkountas]]; Advisors: [[User:Shahadusadik|Sadik Shahadu]], [[User:Jon_Harald_Søby|Jon Harald Søby]] }} <div lang="en" dir="ltr" class="mw-content-ltr"> This page documents the exploration of the concept of a semi-automated starter kit designed to help small and new language communities understand what they need to get started and grow their wikis. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Feedback and ideas for the Starter Kit are welcome on the [[Talk:Language Onboarding and Development/Starter kit|talk page]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Problem & Challenges == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Currently, there isn't a formal onboarding process for new and smaller language communities. Most communities end up discovering resources on their own and sometimes receive ad hoc guidance from global contributors. Newly created wikis often have to handle a significant amount of manual work – enabling gadgets, templates, and bots; setting up policy and governance pages; identifying essential articles that should exist on their wiki; and submitting site configuration requests.<ref>[https://meta.wikimedia.org/wiki/List_of_articles_every_Wikipedia_should_have List of articles every Wikipedia should have], Meta-Wiki</ref><ref>[https://meta.wikimedia.org/wiki/Requesting_wiki_configuration_changes Requesting wiki configuration changes], Meta-Wiki</ref> </div> <div lang="en" dir="ltr" class="mw-content-ltr"> {{Quote|Isn't the HotCat gadget enabled by default on new wikis? I was helping a volunteer in Ndebele (nr.wikipedia.org), and their preferences menu has no gadgets tab at all.|WMF Staff Member, Wikimania}} </div> <div lang="en" dir="ltr" class="mw-content-ltr"> {{Quote|As a new language community starting out, one really needs to be dedicated to continue and there is expectation for so many things they need to do.|[[User:Masssly]], Wikimania 2025}} </div> <div lang="en" dir="ltr" class="mw-content-ltr"> {{Quote|For the Tyap Wikipedia homepage, we will appreciate support with setting it up. There had been some challenges in the process of putting it in place. We are actually, currently mimicking the Latin Wikipedia's homepage. But there seems to be some bugs or stuff making the process not finish.|Tyap community member, Language Community Meeting, December 2025}} </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Existing resources do address parts of this challenge, but they often overburden smaller communities with a paradox of choice — especially when many of those options may not even be relevant in their context (e.g., advanced content moderation tools).<ref>[https://meta.wikimedia.org/wiki/Small_wiki_toolkits/Starter_kit Small wiki toolkits/Starter kit], Meta-Wiki</ref> There is no single, cohesive resource that connects the different phases of onboarding,<ref>[https://www.mediawiki.org/wiki/Language_Onboarding_and_Development#/media/File:Onboarding_&_Development_Journey_for_New_Wikis.png Onboarding & Development Journey for New Wikis], MediaWiki</ref> and there is currently no tool that enables a guided, automated onboarding and development journey for new and small wikis. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> WMF Design Strategy research on content moderation in medium-sized Wikimedia projects<ref>[https://www.mediawiki.org/wiki/Moderator_Tools/Content_Moderation_in_Medium-Sized_Wikimedia_Projects Content Moderation in Medium-Sized Wikimedia Projects], MediaWiki</ref> also highlights administrative challenges faced by smaller wikis — particularly limited awareness of existing tools, the complexity of setting up and using essential workflows, and the difficulty of seeking technical assistance. More broadly, the WMF contributors strategy<ref>[https://www.mediawiki.org/wiki/File:Wikimedia_Foundation_Contributors_strategy_A4.pdf Wikimedia Foundation Contributors strategy], MediaWiki</ref> points to the fragmented experience contributors face today and recommends simplifying how we surface structured task recommendations, engage people in meaningful activities, and ensure their contributions feel impactful and visible. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Starter Kit: Solution & Components == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The proposed solution of a starter kit builds on these recommendations and is designed to enable new and small language communities with the foundational resources they need to get started and steadily grow their wikis. The starter kit will act as an interim enabling layer to help smaller wikis come up to speed and move toward parity with medium and large projects, while LLMs continue to improve for low-resource languages and Wikimedia AI tools become more relevant and usable for these communities. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === What will the starter kit include? === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">A curated list of tools, policies, and resources compiled from usage data and community input to support content and community growth.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Automated installation and configuration of essential tools and features, while ensuring communities retain the agency to choose and set up what they need on their local wiki.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">An activity stats, milestones, and a wiki health dashboard.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Clear actions and pathways to collaborate with both local and global communities.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === '''Impact and Rationale''' === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There are '''116 small Wikipedias''' in the Wikipedia ecosystem, supported by '''197 monthly active administrators''' in total. Collectively, these graduated wikis have contributed '''413,912 articles''', representing only '''5.79% of the total articles on English Wikipedia''' '''<ref>https://phabricator.wikimedia.org/T418031 </ref>'''. A significant percentage of these Wikipedias are not experiencing sustained growth. Many of these wikis operate with only a few active administrators and limited local capacity, making long-term growth and governance fragile. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Over the past 10 years, '''144 new Wikipedias graduated from the Wikimedia Incubator''' <ref>https://incubator.wikimedia.org/wiki/Incubator:Site_creation_log </ref>. If a similar number come online in the next decade, the number of small Wikipedias will continue to increase. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This demonstrates that small Wikipedias are not marginal, they are a growing and meaningful part of the movement’s content ecosystem. However, many launch without structured support, clear growth pathways, or simplified configuration tools. For example, a recent analysis shows that 217 Wikipedias are using the top gadgets, while 149 are missing them <ref>https://phabricator.wikimedia.org/T410700</ref>, highlighting a clear infrastructure gap across wikis. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The Starter Kit directly addresses these gaps, providing small Wikipedias with baseline tools, onboarding guidance, and growth pathways to help communities stabilize faster, retain contributors, and build local administrative capacity for long-term sustainability. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Target Users & Use Cases == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Target users & wikis:''' Administrators, technical contributors, and advanced editors on new and small wikis. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Use cases:''' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">I want my wiki to have the HotCat gadget so that adding categories to articles is easier.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">I want to translate basic policy and governance pages (e.g., Five Pillars) from other language wikis to my wiki.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">I want to see what template options are available on my wiki to use them for creating articles.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">I want to learn about and know how to use popular tools to organize community editathons.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">I want to translate key articles or sections from other languages to help my wiki grow.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">I want to update my wiki's homepage based on the layout used by Silesian Wikipedia.</span> <span lang="en" dir="ltr" class="mw-content-ltr">== Potential Feature Set ==</span> <span lang="en" dir="ltr" class="mw-content-ltr">=== Technical ===</span> <span lang="en" dir="ltr" class="mw-content-ltr">==== Curated tools with semi-automated setup ====</span> <div lang="en" dir="ltr" class="mw-content-ltr"> A curated list of tools and resources to support content editing, moderation, organizing events, and outreach. This may include gadgets (e.g., HotCat, Twinkle), templates (e.g., Speedy Deletion, maintenance tags), tools (e.g., Outreach Dashboard, RecentChanges), bots (e.g., Citation bots, CommonsDelinker, InternetArchiveBot), and extensions (e.g., Content Translation), prioritized based on usage signals such as edit count, number of active users, number of code contributors, and number of wikis deployed on. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This feature would provide a semi-automated experience for discovering, installing, and configuring these tools, lowering technical barriers while allowing communities to opt in and retain control. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Over time, this curated list could expand to support searching and installing tools from a broader catalog, including tools previously used on Wikimedia Incubator, and surface pathways for widely adopted tools to inform inclusion in MediaWiki core. </div> <span lang="en" dir="ltr" class="mw-content-ltr">==== Wiki site configuration ====</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The current process requires communities to work with existing templates, HTML/CSS, and mobile responsiveness when customizing their wiki's homepage. Recent community feedback highlights this gap; for example, the Tyap Wikipedia homepage is currently mimicking another wiki's layout but remains incomplete due to technical challenges. An alternate approach could let communities choose from a small set of predefined homepage templates that can be imported and edited easily. These templates can support different community needs, allowing administrators to select what is appropriate for their community, such as inviting users to translate new articles or offering microtasks to improve existing content. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Another feature can automate common, low-risk tasks, like namespace translations, user rights, uploads, or logos, using a propose → review → apply workflow to handle changes without manual requests or code edits.<ref>[https://wikitech.wikimedia.org/wiki/Wikimedia_site_requests Wikimedia site requests], Wikitech</ref> </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Protecting the homepage by default, restricting edits from unregistered users, and setting a machine translation threshold are other security-related features to consider. These baseline settings can help prevent early vandalism, reduce low-quality machine-translated content, and give smaller communities a stable starting point, while allowing adjustments as the community grows. </div> <span lang="en" dir="ltr" class="mw-content-ltr">=== Content ===</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Suggest article creation tools, such as [[mw:Article guidance|Article Guidance]] and [[w:Abstract Wikipedia|Abstract Wikipedia]].<ref>[https://www.mediawiki.org/wiki/Article_guidance Article guidance], MediaWiki</ref><ref>[https://en.wikipedia.org/wiki/Abstract_Wikipedia Abstract Wikipedia], Wikipedia</ref> These tools are still under development but may be ready soon. For the starter kit, a simplified or customized version would be needed. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Support for content ideas could include: a "thousand articles every wiki should have," local communities' prioritized lists of vital articles, and essential policy and governance pages (e.g., Village Pump, Wikipedia's Five Pillars), along with guidance to translate them using translation tools. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Another feature could automate importing existing content from the Incubator into the local wiki, which is currently a highly manual process.<ref>[https://incubator.wikimedia.org/wiki/Incubator:Importing_from_Incubator Incubator:Importing from Incubator], Wikimedia Incubator</ref> </div> <span lang="en" dir="ltr" class="mw-content-ltr">=== Activity ===</span> * <span lang="en" dir="ltr" class="mw-content-ltr">A progress indicator to help communities track wiki health and growth (e.g., number of active editors, new articles created vs. deletion rate, topics of interest among readers and editors).</span> * <span lang="en" dir="ltr" class="mw-content-ltr">A clear roadmap of steps or milestones outlining how the community can grow, such as creating a main page, reaching a minimum number of articles, forming 3 wiki projects, organizing outreach activities, along with a lightweight check-in process to acknowledge progress or milestones on community pages (e.g., reaching 100 articles or other key thresholds).</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Guidance on attracting contributors and requesting support from global contributors, such as administrators or stewards.</span> <span lang="en" dir="ltr" class="mw-content-ltr">== Open Questions & Risks ==</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Some features may involve complex technical implementation (template imports, homepage standardization, site requests) and would require engineering assessment for feasibility and scope.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">When is the work of the starter kit considered complete? What does a kit like this look like once mature, and how might it extend in the longer term for medium or large wikis?</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Should the starter kit be implemented as a MediaWiki extension, gadget, or independent tool? Ideally, it could begin as a tool on Toolforge, and once validated, be developed into an extension so it can be bundled with a wiki more easily, maintained long-term, and managed through structured updates.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">How many options should be exposed per resource category? Keeping choices minimal may reduce complexity, with search functionality added later if needed.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Can the starter kit be designed for use beyond Wikimedia, including third-party MediaWiki installations?</span> == References == {{Reflist}} 9zyhk779nrgvtdwbiga240a3vvo0pxw 8364763 8364761 2026-05-03T22:57:06Z Kambai Akau 13828735 Created page with "Wat huni saai lyuut tazwa zop a̱di̱dam starter kit nang á̱ khwut ma̱ng byet mashin a̱ni nang á̱ byi̱k mat á̱ beang a̱cyuang ma̱ng susot-nta̱m lilyem swai á̱ mban mba fi̱k ji tazwa kyang ku myim ba̱ lyen ba̱ ntsa a̱wot ba̱ mbeang mban ngwuki mba na." 8364763 wikitext text/x-wiki <languages/> {{Starter kit header|active=}} {{Tracked|T410699}} {{Wikimedia engineering project information | name = Starter kit | logo = | group = [[Wikimedia Language and Product Localization|Wikimedia Language and Product Localization]] | description = Enable new and small language communities to know what they need to get started & progress their wikis. | lead = | members = [[User:SSethi (WMF)|Srishti Sethi]], [[User:ToluAyod|Tolu Ayodele]], [[User:MMunyoki (WMF)|Mary Munyoki]], [[User:EAMedina_(WMF)|Eduardo Medina]], [[User:UOzurumba_(WMF)|Uzoma Ozurumba ]], [[User:NGkountas_(WMF)|Nik Gkountas]]; Advisors: [[User:Shahadusadik|Sadik Shahadu]], [[User:Jon_Harald_Søby|Jon Harald Søby]] }} Wat huni saai lyuut tazwa zop a̱di̱dam starter kit nang á̱ khwut ma̱ng byet mashin a̱ni nang á̱ byi̱k mat á̱ beang a̱cyuang ma̱ng susot-nta̱m lilyem swai á̱ mban mba fi̱k ji tazwa kyang ku myim ba̱ lyen ba̱ ntsa a̱wot ba̱ mbeang mban ngwuki mba na. <div lang="en" dir="ltr" class="mw-content-ltr"> Feedback and ideas for the Starter Kit are welcome on the [[Talk:Language Onboarding and Development/Starter kit|talk page]]. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Problem & Challenges == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Currently, there isn't a formal onboarding process for new and smaller language communities. Most communities end up discovering resources on their own and sometimes receive ad hoc guidance from global contributors. Newly created wikis often have to handle a significant amount of manual work – enabling gadgets, templates, and bots; setting up policy and governance pages; identifying essential articles that should exist on their wiki; and submitting site configuration requests.<ref>[https://meta.wikimedia.org/wiki/List_of_articles_every_Wikipedia_should_have List of articles every Wikipedia should have], Meta-Wiki</ref><ref>[https://meta.wikimedia.org/wiki/Requesting_wiki_configuration_changes Requesting wiki configuration changes], Meta-Wiki</ref> </div> <div lang="en" dir="ltr" class="mw-content-ltr"> {{Quote|Isn't the HotCat gadget enabled by default on new wikis? I was helping a volunteer in Ndebele (nr.wikipedia.org), and their preferences menu has no gadgets tab at all.|WMF Staff Member, Wikimania}} </div> <div lang="en" dir="ltr" class="mw-content-ltr"> {{Quote|As a new language community starting out, one really needs to be dedicated to continue and there is expectation for so many things they need to do.|[[User:Masssly]], Wikimania 2025}} </div> <div lang="en" dir="ltr" class="mw-content-ltr"> {{Quote|For the Tyap Wikipedia homepage, we will appreciate support with setting it up. There had been some challenges in the process of putting it in place. We are actually, currently mimicking the Latin Wikipedia's homepage. But there seems to be some bugs or stuff making the process not finish.|Tyap community member, Language Community Meeting, December 2025}} </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Existing resources do address parts of this challenge, but they often overburden smaller communities with a paradox of choice — especially when many of those options may not even be relevant in their context (e.g., advanced content moderation tools).<ref>[https://meta.wikimedia.org/wiki/Small_wiki_toolkits/Starter_kit Small wiki toolkits/Starter kit], Meta-Wiki</ref> There is no single, cohesive resource that connects the different phases of onboarding,<ref>[https://www.mediawiki.org/wiki/Language_Onboarding_and_Development#/media/File:Onboarding_&_Development_Journey_for_New_Wikis.png Onboarding & Development Journey for New Wikis], MediaWiki</ref> and there is currently no tool that enables a guided, automated onboarding and development journey for new and small wikis. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> WMF Design Strategy research on content moderation in medium-sized Wikimedia projects<ref>[https://www.mediawiki.org/wiki/Moderator_Tools/Content_Moderation_in_Medium-Sized_Wikimedia_Projects Content Moderation in Medium-Sized Wikimedia Projects], MediaWiki</ref> also highlights administrative challenges faced by smaller wikis — particularly limited awareness of existing tools, the complexity of setting up and using essential workflows, and the difficulty of seeking technical assistance. More broadly, the WMF contributors strategy<ref>[https://www.mediawiki.org/wiki/File:Wikimedia_Foundation_Contributors_strategy_A4.pdf Wikimedia Foundation Contributors strategy], MediaWiki</ref> points to the fragmented experience contributors face today and recommends simplifying how we surface structured task recommendations, engage people in meaningful activities, and ensure their contributions feel impactful and visible. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Starter Kit: Solution & Components == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The proposed solution of a starter kit builds on these recommendations and is designed to enable new and small language communities with the foundational resources they need to get started and steadily grow their wikis. The starter kit will act as an interim enabling layer to help smaller wikis come up to speed and move toward parity with medium and large projects, while LLMs continue to improve for low-resource languages and Wikimedia AI tools become more relevant and usable for these communities. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> === What will the starter kit include? === </div> * <span lang="en" dir="ltr" class="mw-content-ltr">A curated list of tools, policies, and resources compiled from usage data and community input to support content and community growth.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Automated installation and configuration of essential tools and features, while ensuring communities retain the agency to choose and set up what they need on their local wiki.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">An activity stats, milestones, and a wiki health dashboard.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Clear actions and pathways to collaborate with both local and global communities.</span> <div lang="en" dir="ltr" class="mw-content-ltr"> === '''Impact and Rationale''' === </div> <div lang="en" dir="ltr" class="mw-content-ltr"> There are '''116 small Wikipedias''' in the Wikipedia ecosystem, supported by '''197 monthly active administrators''' in total. Collectively, these graduated wikis have contributed '''413,912 articles''', representing only '''5.79% of the total articles on English Wikipedia''' '''<ref>https://phabricator.wikimedia.org/T418031 </ref>'''. A significant percentage of these Wikipedias are not experiencing sustained growth. Many of these wikis operate with only a few active administrators and limited local capacity, making long-term growth and governance fragile. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Over the past 10 years, '''144 new Wikipedias graduated from the Wikimedia Incubator''' <ref>https://incubator.wikimedia.org/wiki/Incubator:Site_creation_log </ref>. If a similar number come online in the next decade, the number of small Wikipedias will continue to increase. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This demonstrates that small Wikipedias are not marginal, they are a growing and meaningful part of the movement’s content ecosystem. However, many launch without structured support, clear growth pathways, or simplified configuration tools. For example, a recent analysis shows that 217 Wikipedias are using the top gadgets, while 149 are missing them <ref>https://phabricator.wikimedia.org/T410700</ref>, highlighting a clear infrastructure gap across wikis. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> The Starter Kit directly addresses these gaps, providing small Wikipedias with baseline tools, onboarding guidance, and growth pathways to help communities stabilize faster, retain contributors, and build local administrative capacity for long-term sustainability. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> == Target Users & Use Cases == </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Target users & wikis:''' Administrators, technical contributors, and advanced editors on new and small wikis. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> '''Use cases:''' </div> * <span lang="en" dir="ltr" class="mw-content-ltr">I want my wiki to have the HotCat gadget so that adding categories to articles is easier.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">I want to translate basic policy and governance pages (e.g., Five Pillars) from other language wikis to my wiki.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">I want to see what template options are available on my wiki to use them for creating articles.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">I want to learn about and know how to use popular tools to organize community editathons.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">I want to translate key articles or sections from other languages to help my wiki grow.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">I want to update my wiki's homepage based on the layout used by Silesian Wikipedia.</span> <span lang="en" dir="ltr" class="mw-content-ltr">== Potential Feature Set ==</span> <span lang="en" dir="ltr" class="mw-content-ltr">=== Technical ===</span> <span lang="en" dir="ltr" class="mw-content-ltr">==== Curated tools with semi-automated setup ====</span> <div lang="en" dir="ltr" class="mw-content-ltr"> A curated list of tools and resources to support content editing, moderation, organizing events, and outreach. This may include gadgets (e.g., HotCat, Twinkle), templates (e.g., Speedy Deletion, maintenance tags), tools (e.g., Outreach Dashboard, RecentChanges), bots (e.g., Citation bots, CommonsDelinker, InternetArchiveBot), and extensions (e.g., Content Translation), prioritized based on usage signals such as edit count, number of active users, number of code contributors, and number of wikis deployed on. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> This feature would provide a semi-automated experience for discovering, installing, and configuring these tools, lowering technical barriers while allowing communities to opt in and retain control. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Over time, this curated list could expand to support searching and installing tools from a broader catalog, including tools previously used on Wikimedia Incubator, and surface pathways for widely adopted tools to inform inclusion in MediaWiki core. </div> <span lang="en" dir="ltr" class="mw-content-ltr">==== Wiki site configuration ====</span> <div lang="en" dir="ltr" class="mw-content-ltr"> The current process requires communities to work with existing templates, HTML/CSS, and mobile responsiveness when customizing their wiki's homepage. Recent community feedback highlights this gap; for example, the Tyap Wikipedia homepage is currently mimicking another wiki's layout but remains incomplete due to technical challenges. An alternate approach could let communities choose from a small set of predefined homepage templates that can be imported and edited easily. These templates can support different community needs, allowing administrators to select what is appropriate for their community, such as inviting users to translate new articles or offering microtasks to improve existing content. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Another feature can automate common, low-risk tasks, like namespace translations, user rights, uploads, or logos, using a propose → review → apply workflow to handle changes without manual requests or code edits.<ref>[https://wikitech.wikimedia.org/wiki/Wikimedia_site_requests Wikimedia site requests], Wikitech</ref> </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Protecting the homepage by default, restricting edits from unregistered users, and setting a machine translation threshold are other security-related features to consider. These baseline settings can help prevent early vandalism, reduce low-quality machine-translated content, and give smaller communities a stable starting point, while allowing adjustments as the community grows. </div> <span lang="en" dir="ltr" class="mw-content-ltr">=== Content ===</span> <div lang="en" dir="ltr" class="mw-content-ltr"> Suggest article creation tools, such as [[mw:Article guidance|Article Guidance]] and [[w:Abstract Wikipedia|Abstract Wikipedia]].<ref>[https://www.mediawiki.org/wiki/Article_guidance Article guidance], MediaWiki</ref><ref>[https://en.wikipedia.org/wiki/Abstract_Wikipedia Abstract Wikipedia], Wikipedia</ref> These tools are still under development but may be ready soon. For the starter kit, a simplified or customized version would be needed. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Support for content ideas could include: a "thousand articles every wiki should have," local communities' prioritized lists of vital articles, and essential policy and governance pages (e.g., Village Pump, Wikipedia's Five Pillars), along with guidance to translate them using translation tools. </div> <div lang="en" dir="ltr" class="mw-content-ltr"> Another feature could automate importing existing content from the Incubator into the local wiki, which is currently a highly manual process.<ref>[https://incubator.wikimedia.org/wiki/Incubator:Importing_from_Incubator Incubator:Importing from Incubator], Wikimedia Incubator</ref> </div> <span lang="en" dir="ltr" class="mw-content-ltr">=== Activity ===</span> * <span lang="en" dir="ltr" class="mw-content-ltr">A progress indicator to help communities track wiki health and growth (e.g., number of active editors, new articles created vs. deletion rate, topics of interest among readers and editors).</span> * <span lang="en" dir="ltr" class="mw-content-ltr">A clear roadmap of steps or milestones outlining how the community can grow, such as creating a main page, reaching a minimum number of articles, forming 3 wiki projects, organizing outreach activities, along with a lightweight check-in process to acknowledge progress or milestones on community pages (e.g., reaching 100 articles or other key thresholds).</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Guidance on attracting contributors and requesting support from global contributors, such as administrators or stewards.</span> <span lang="en" dir="ltr" class="mw-content-ltr">== Open Questions & Risks ==</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Some features may involve complex technical implementation (template imports, homepage standardization, site requests) and would require engineering assessment for feasibility and scope.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">When is the work of the starter kit considered complete? What does a kit like this look like once mature, and how might it extend in the longer term for medium or large wikis?</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Should the starter kit be implemented as a MediaWiki extension, gadget, or independent tool? Ideally, it could begin as a tool on Toolforge, and once validated, be developed into an extension so it can be bundled with a wiki more easily, maintained long-term, and managed through structured updates.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">How many options should be exposed per resource category? Keeping choices minimal may reduce complexity, with search functionality added later if needed.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">Can the starter kit be designed for use beyond Wikimedia, including third-party MediaWiki installations?</span> == References == {{Reflist}} 046wd56h69liagfg5j3hddzasf2l9na Translations:Language Onboarding and Development/Starter kit/1/kcg 1198 2402698 8364762 2026-05-03T22:57:05Z Kambai Akau 13828735 Created page with "Wat huni saai lyuut tazwa zop a̱di̱dam starter kit nang á̱ khwut ma̱ng byet mashin a̱ni nang á̱ byi̱k mat á̱ beang a̱cyuang ma̱ng susot-nta̱m lilyem swai á̱ mban mba fi̱k ji tazwa kyang ku myim ba̱ lyen ba̱ ntsa a̱wot ba̱ mbeang mban ngwuki mba na." 8364762 wikitext text/x-wiki Wat huni saai lyuut tazwa zop a̱di̱dam starter kit nang á̱ khwut ma̱ng byet mashin a̱ni nang á̱ byi̱k mat á̱ beang a̱cyuang ma̱ng susot-nta̱m lilyem swai á̱ mban mba fi̱k ji tazwa kyang ku myim ba̱ lyen ba̱ ntsa a̱wot ba̱ mbeang mban ngwuki mba na. 5uvi3z6umgosvyzter56erzfm8d88qz Translations:Help:Extension:Translate/Components/102/ja 1198 2402701 8364811 2026-05-04T02:19:29Z Shirayuki 472859 Created page with "{{$1|メッセージ群}}に関する詳細な説明文書" 8364811 wikitext text/x-wiki {{$1|メッセージ群}}に関する詳細な説明文書 2y6gseu6wl4dojgclkz1kq010iw0sfy Translations:Help:Extension:Translate/Components/121/ja 1198 2402702 8364813 2026-05-04T02:20:05Z Shirayuki 472859 Created page with "Translate にメッセージ群を登録する主な方法は、$1 フックと {{$2|YAML 設定}}の 2 つです。" 8364813 wikitext text/x-wiki Translate にメッセージ群を登録する主な方法は、$1 フックと {{$2|YAML 設定}}の 2 つです。 2dbwhmpju91hfh0spgzkb64h5e0oyfz Translations:Help:Extension:Translate/Components/122/ja 1198 2402703 8364815 2026-05-04T02:21:44Z Shirayuki 472859 Created page with "{{$1|翻訳支援}}に関する詳細な説明文書" 8364815 wikitext text/x-wiki {{$1|翻訳支援}}に関する詳細な説明文書 eps32t78pa4vq5pkeywvdq7wf4jawee Translations:Help:Extension:Translate/Components/104/ja 1198 2402704 8364817 2026-05-04T02:22:58Z Shirayuki 472859 Created page with "TranslationAid クラスを継承する各クラスは、$1 という名前の 1 つのメソッドのみを実装する必要があります。" 8364817 wikitext text/x-wiki TranslationAid クラスを継承する各クラスは、$1 という名前の 1 つのメソッドのみを実装する必要があります。 q1uhqi6u7d2tai5brp8quh1n2e2bmqv 8364821 8364817 2026-05-04T02:27:37Z Shirayuki 472859 update 8364821 wikitext text/x-wiki $2 クラスを継承する各クラスは、$1 という名前の 1 つのメソッドのみを実装する必要があります。 ax30mms06jna8qq8y4h0dcixfuhmxk8 Translations:Help:Extension:Translate/Components/105/ja 1198 2402705 8364822 2026-05-04T02:30:40Z Shirayuki 472859 Created page with "これは構造化形式 (入れ子の配列) で情報を返し、その後 $1 Web API モジュールを通じて公開される必要があります。" 8364822 wikitext text/x-wiki これは構造化形式 (入れ子の配列) で情報を返し、その後 $1 Web API モジュールを通じて公開される必要があります。 4t8wagwzp2llzb2uqrnad4s47wmb3ri Translations:Help:Extension:Translate/Components/123/ja 1198 2402706 8364824 2026-05-04T02:31:52Z Shirayuki 472859 Created page with "追加の機械翻訳サービスは、$1 クラスを継承することで簡単に追加できます。" 8364824 wikitext text/x-wiki 追加の機械翻訳サービスは、$1 クラスを継承することで簡単に追加できます。 6bbrp38muqhlstlaaltmh5ombux2q1d Translations:Help:Extension:Translate/Components/124/ja 1198 2402707 8364826 2026-05-04T02:32:16Z Shirayuki 472859 Created page with "この情報があれば、$1 メソッドの実装は容易です。" 8364826 wikitext text/x-wiki この情報があれば、$1 メソッドの実装は容易です。 n2e547uztewabrnm0tig340y4r7lccc Translations:Help:Extension:Translate/Components/125/ja 1198 2402708 8364828 2026-05-04T02:32:47Z Shirayuki 472859 Created page with "エラーを通知するには、$1 を使用してください。" 8364828 wikitext text/x-wiki エラーを通知するには、$1 を使用してください。 ou9hf0icgr0sc26sjuvxtk96gzagtj4 Translations:Help:Extension:Translate/Components/126/ja 1198 2402709 8364830 2026-05-04T02:33:19Z Shirayuki 472859 Created page with "提案は、$1 クラスと $2 WebAPI モジュールを通じて翻訳エディターに自動的に表示されます。" 8364830 wikitext text/x-wiki 提案は、$1 クラスと $2 WebAPI モジュールを通じて翻訳エディターに自動的に表示されます。 atsz649qhtp9bqdv9touf73ks856qo2 Translations:Help:Extension:Translate/Components/127/ja 1198 2402710 8364832 2026-05-04T02:34:22Z Shirayuki 472859 Created page with "ファイル ベースのメッセージ群のチェッカーの定義方法" 8364832 wikitext text/x-wiki ファイル ベースのメッセージ群のチェッカーの定義方法 i96sp98xp2tfb3lk9eusspgqqeg0p66 Translations:Help:Extension:Translate/Components/107/ja 1198 2402711 8364834 2026-05-04T02:35:07Z Shirayuki 472859 Created page with "この問題を解決するために、$1 クラスが作成されました。" 8364834 wikitext text/x-wiki この問題を解決するために、$1 クラスが作成されました。 2xuf1lyzpfijukyndpxfisxxbrt1k6s Translations:Help:Extension:Translate/Components/108/ja 1198 2402712 8364836 2026-05-04T02:35:39Z Shirayuki 472859 Created page with "適切なフォントを見つけるために、パッケージ $2 の $1 コマンドを使用します (そのため、Windows では動作しません)。" 8364836 wikitext text/x-wiki 適切なフォントを見つけるために、パッケージ $2 の $1 コマンドを使用します (そのため、Windows では動作しません)。 6fb0fnsda2iumyura745kpim402z44g Translations:Help:Extension:Translate/Components/62/ja 1198 2402713 8364842 2026-05-04T02:44:15Z Shirayuki 472859 Created page with "ファイル ベースのメッセージ群のメッセージは、CDB ファイルに格納されます。" 8364842 wikitext text/x-wiki ファイル ベースのメッセージ群のメッセージは、CDB ファイルに格納されます。 8pmjkeilkc6epvl4p0sfze3bocrxidk Translations:Help:Extension:Translate/Components/63/ja 1198 2402714 8364844 2026-05-04T02:51:53Z Shirayuki 472859 Created page with "ファイル ベースのメッセージ群のメッセージは、CDB ファイルに格納されます。" 8364844 wikitext text/x-wiki ファイル ベースのメッセージ群のメッセージは、CDB ファイルに格納されます。 8pmjkeilkc6epvl4p0sfze3bocrxidk Translations:Extension:DisableAccount/8/ru 1198 2402715 8364852 2026-05-04T03:00:36Z DaisyFORTY 18213621 Created page with "Вы можете заменить $3 в $4 на нужную вам группу участников по вашему желанию." 8364852 wikitext text/x-wiki Вы можете заменить $3 в $4 на нужную вам группу участников по вашему желанию. cbg3fn4oo7ibqbjyfyyjr3r0xr9bs6f Translations:Extension:DisableAccount/9/ru 1198 2402716 8364854 2026-05-04T03:00:47Z DaisyFORTY 18213621 Created page with "Это право не должно выдаваться группам, назначаемым автоматически или имеющим большое количество членов." 8364854 wikitext text/x-wiki Это право не должно выдаваться группам, назначаемым автоматически или имеющим большое количество членов. mm54ea6s656a6wvs149tn74jgslix66 Translations:Extension:DisableAccount/7/ru 1198 2402717 8364858 2026-05-04T03:01:03Z DaisyFORTY 18213621 Created page with "== См. также ==" 8364858 wikitext text/x-wiki == См. также == bi8ivbgs7b8bnnxddobnkm64gog2n6t Translations:Help:VisualEditor/User guide/Citation templates/70/ja 1198 2402718 8364860 2026-05-04T03:14:37Z ~2026-27009-87 18368053 Created page with "推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。" 8364860 wikitext text/x-wiki 推奨されるパラメーターもいくつか表示されますが、すべてが必須というわけではありません。 r315t00eops26tqrpwlw6xdt5a3r3lu Translations:Help:Extension:Translate/Validators/47/ja 1198 2402719 8364866 2026-05-04T04:00:28Z Shirayuki 472859 Created page with "Keymatch は配列で、各オプションは'''文字列'''または'''プロトタイプ'''のいずれかです。文字列の場合、メッセージ キーとの直接比較が行われます。" 8364866 wikitext text/x-wiki Keymatch は配列で、各オプションは'''文字列'''または'''プロトタイプ'''のいずれかです。文字列の場合、メッセージ キーとの直接比較が行われます。 aft1udysgs2ea5v4ev6d60utk35imh3 Translations:Help:Extension:Translate/Validators/55/ja 1198 2402720 8364868 2026-05-04T04:01:07Z Shirayuki 472859 Created page with "パラメーターが'''文字列として'''指定されている場合、それは正規表現として使用されます。" 8364868 wikitext text/x-wiki パラメーターが'''文字列として'''指定されている場合、それは正規表現として使用されます。 pv8b4syw3qxa878tepxbrvr4x0x04j5 8364884 8364868 2026-05-04T04:04:13Z Shirayuki 472859 update 8364884 wikitext text/x-wiki $1 が'''文字列として'''指定されている場合、それは正規表現として使用されます。 k9meu0f11x1mf7lkrq404if5smk2xg7 Help:Extension:Translate/Validators/pt-br 12 2402721 8364881 2026-05-04T04:02:53Z FuzzyBot 451990 Updating to match new version of source page 8364881 wikitext text/x-wiki <languages/> {{Extension-Translate}} As cadeias de caracteres traduzíveis geralmente contêm marcações que devem ser mantidas como estão na tradução. Digitar tais marcações pode ser um processo lento e difícil, dado que caracteres especiais estão quase sempre presentes nelas. A extensão Translate pode fornecer aos tradutores um botão que, ao ser clicado, insere o trecho de marcação na tradução para a posição atual do cursor. Além disso, se uma tradução não tiver essa marcação específica, a extensão Translate poderá avisar o tradutor ou simplesmente rejeitar a tradução, pois essa marcação geralmente é obrigatória para exibir as mensagens corretamente para o usuário final. Por exemplo, na cadeia de caracteres <blockquote>''Adapted by %{name} from a work by %{original}''</blockquote>, há dois inseríveis - <code>%{name}</code> e <code>%{original}</code>. Se o tradutor não os adicionar à sua tradução, o usuário final que estiver usando o software não verá uma mensagem adequada. A estrutura <code>MessageValidator</code> foi adicionada com a intenção de ajudar a validar as traduções. Os validadores são executados na mensagem traduzida e, com base na configuração, uma mensagem de aviso ou erro é mostrada ao tradutor. As traduções com avisos ainda podem ser salvas, mas as que apresentam erros não podem. Somente um usuário com permissão <code>translate-manage</code> pode salvar traduções com erros. Ao configurar um validador, uma regex é definida para identificar a marcação que é obrigatória. O validador também pode ser marcado como inserível e, nesse caso, será exibido um botão para o tradutor adicionar essa marcação à tradução. A adição de validadores personalizados ainda é possível e será necessária para validações mais especializadas. <span id="Configuration"></span> == Configuração == A seguir, uma configuração resumida do validador, <syntaxhighlight lang="yaml" line="1" start="1"> VALIDATORS: # Exemplo 1 - id: InsertableRegex enforce: true insertable: true params: /\$[a-z0-9]+/ keymatch: - 'untranslated' # Corresponde à chave não traduzida diretamente - type: 'wildcard' pattern: '*translated*' # Corresponde a qualquer chave que contenha a tradução # Exemplo 2 - id: InsertableRegex insertable: true params: regex: /(?<pre>\[)[^]]+(?<post>\]\([^)]+\))/ display: $pre $post pre: $pre post: $post # Exemplo 3 - class: MathJaxMessageValidator enforce: true # Exemplo 4 - id: BraceBalance </syntaxhighlight> No exemplo acima, # <code>InsertableRegex</code> é um validador integrado que pode aceitar uma regex personalizada e executar validações. # <code>MathJaxMessageValidator</code> é uma classe de validador personalizada. # <code>BraceBalance</code> é outro validador incluído no pacote. <code>VALIDATORS</code> usa um formato de matriz. Vamos dar uma olhada nos vários parâmetros que estão sendo usados aqui em cada item da matriz, <span id="Parameters"></span> === Parâmetros ===== {| class="wikitable" ! Imóvel ! Tipo ! Descrição |- |id | texto | Caso um validador empacotado/pré-fornecido esteja sendo usado, a ID do validador. ''Obrigatório se <code>class</code> não for especificado.'' |- |class | texto | Se um validador personalizado estiver sendo usado, use essa opção em vez de <code>id</code>. Especifica o nome da classe do validador. Consulte o '''exemplo nº 3''' na configuração acima. A opção <code>AUTOLOAD</code> pode ser usada para carregar a classe. ''Obrigatório se <code>id</code> não for especificado.'' |- |enforce | boolean | Se o validador deve ser aplicado. Se definido como true, e uma tradução falhar na validação, será exibido um erro que deverá ser corrigido para que a tradução seja salva. |- |insertable | boolean | Se o validador também deve ser um inserível. |- |keymatch | array | Com essa opção, é possível limitar determinadas validações a determinadas mensagens. Keymatch é uma matriz em que cada opção é uma '''string''' ou um '''prototype''' Se for uma cadeia de caracteres, será feita uma comparação direta com a chave da mensagem. Veja o '''exemplo nº 1''' na configuração acima. |- |keymatch[i].type | texto | O tipo é ''regex'' ou ''curinga''. Essa é a abordagem que será usada para verificar se a chave da mensagem corresponde a um determinado padrão. |- |keymatch[i].pattern | texto | O padrão é uma cadeia de caracteres que será usada para correspondência. |- |params | string / matriz associativa | Se params for especificado '''como uma string''', ele será usado como regex. Veja o '''exemplo nº 1''' Nesse caso, se insertable for verdadeiro, # <code>display</code> é o primeiro valor da correspondência regex. # <code>pre</code> também é o primeiro valor da correspondência de regex. # <code>post</code> é deixado vazio. Se params for especificado '''como uma matriz associativa (veja o exemplo nº 2)''', consulte abaixo para obter mais detalhes. |- |params.regex | texto | O regex a ser usado para o validador. Deve usar capturas nomeadas. Ao especificar capturas nomeadas, não use o símbolo <code>$</code> no nome. No '''exemplo nº 2''', são usadas duas capturas nomeadas - <code>pre</code> e <code>post</code>. |- |params.display | texto | Valor obrigatório. O valor de exibição do inserível. Capturas nomeadas prefixadas com $ são usadas aqui. Consulte o '''exemplo nº 2'''. |- |params.pre | texto | O valor pré para o inserível. Valor inserido antes da posição do cursor. Capturas nomeadas prefixadas com $ são usadas aqui. Se não for especificado, será definido como o valor de exibição. Consulte o '''exemplo nº 2'''. |- |params.post | texto | O valor do post para o inserível. Valor inserido após a posição do cursor. Capturas nomeadas prefixadas com $ são usadas aqui. Consulte o '''exemplo nº 2'''. Se não for especificado, o padrão é uma string vazia. |} <span id="Pre-provided_/_Bundled_validators"></span> === Validadores pré-fornecidos/em pacote === Veja a seguir uma lista de validadores agrupados, ==== BraceBalance ==== ID: <code>BraceBalance</code> Garante que o número de chaves/colchetes abertos corresponda ao número de chaves/colchetes fechados na tradução. Por exemplo, as seguintes traduções seriam aprovadas, * <code><nowiki>{{ }}</nowiki></code> * <code>[ ]</code> enquanto isso, o seguinte falharia, * <code>[ ]]</code> * <code><nowiki>{{ }</nowiki></code> Esse validador não pode ser marcado como inserível. ==== EscapeCharacter ==== ID: <code>EscapeCharacter</code> O validador garante que somente o caractere de escape especificado esteja presente em uma tradução. Os caracteres de escape permitidos podem ser especificados ao adicionar o validador e só podem incluir, * <code>\t</code> * <code>\n</code> * <code>\'</code> * <code>\"</code> * <code>\f</code> * <code>\r</code> * <code>\a</code> * <code>\b</code> * <code>\\</code> Esse validador não pode ser inserido. ==== GettextNewline ==== ID: <code>GettextNewline</code> Isso funciona especificamente para grupos de mensagens baseados em GetText. Garante que a tradução tenha o mesmo número de novas linhas que a mensagem original no início e no final da string. ==== GettextPlural ==== ID: <code>GettextPlural</code> Isso funciona especificamente em grupos de mensagens baseados em GetText. Garante que, se a fonte/definição contiver um plural no formato - <code><nowiki>foo {{PLURAL:GETTEXT|one|many}} bar</nowiki></code>, a tradução também deverá contê-lo. Com base no idioma, ele também verifica se a tradução tem o número correto de formas plurais. Por exemplo, o inglês tem dois, mas o hebraico tem quatro. ==== InsertableRegex ==== ID: <code>InsertableRegex</code> Um validador genérico reutilizável que pode ser usado para especificar validações e inserções personalizadas. Por exemplo, veja a seguinte configuração em que o validador é marcado como inserível e aplicado, <syntaxhighlight lang="yaml"> - id: InsertableRegex enforce: true insertable: true params: "/\$[a-zA-Z0-9]+/" </syntaxhighlight> Dada a seguinte mensagem de origem - ''Hello $name. My name is $myName.'' que está sendo traduzida, a tradução deve ter os parâmetros - ''$name'' e ''$myName''. Eles também serão exibidos como inseríveis para facilitar o uso na tradução pelos tradutores. A ausência desses parâmetros causará a exibição de um erro para o tradutor. ==== InsertableRubyVariable ==== ID: <code>InsertableRubyVariable</code> Esse é um validador que corresponde às variáveis rubi nas traduções. Internamente, ele estende <code>InsertableRegexValidator</code> e usa a seguinte regex - <code>%{[a-zA-Z_]+}</code>. Esse validador pode ser inserido. Exemplo: <code>%{abc}</code> ==== IosVariable ==== ID: <code>IosVariable</code> Um validador de variável inserível para IOS. Regex é usado [https://github.com/dcordero/Rubustrings/blob/61d477bffbb318ca3ffed9c2afc49ec301931d93/lib/rubustrings/action.rb#L91 dessa fonte Rubustrings]. Esse validador pode ser inserido. Exemplo: <code>%@</code> ==== MatchSet ==== ID: <code>MatchSet</code> Garante que a tradução esteja presente na lista de valores. Também recebe um parâmetro - <code>caseSensitive</code> que pode ser true ("padrão") ou false. Por exemplo, na configuração a seguir, o validador validará a mensagem com a chave - <code>html.dir</code> e garantirá que os valores para ela possam ser ''ltr'' ou ''rtl''. Observe que LTR ou RTL não serão valores válidos, pois <code>caseSensitive</code> é verdadeiro por padrão. <syntaxhighlight lang="yaml" line="1" start="1"> - id: MatchSet enforce: true keymatch: - html.dir params: values: - ltr - rtl </syntaxhighlight> ==== MediaWikiLink ==== ID: <code>MediaWikiLink</code> Verifica se a tradução usa links que não são recomendados. Os links válidos são aqueles que se vinculam às páginas Special:, <code><nowiki>{{ns:special}}:</nowiki></code> ou às páginas do projeto por meio de mensagens do MediaWiki, como <code><nowiki>{{MediaWiki:helppage-url}}:</nowiki></code>. Também são permitidos links na definição. ==== MediaWikiPageName ==== ID: <code>MediaWikiPageName</code> Garante que, se a fonte/definição contiver um namespace como <code><nowiki>{{ns:project}}:hello</nowiki></code>, as traduções feitas não tentarão traduzir os próprios namespaces. ==== MediaWikiParameter ==== ID: <code>MediaWikiParameter</code> Esse é um validador que corresponde aos parâmetros wiki nas traduções. Internamente, ele estende <code>InsertableRegexValidator</code> e usa a seguinte regex - <code>/\$[1-9]/</code>. Esse validador pode ser inserido. Exemplo: <code>$1</code>, <code>$2</code>. ==== MediaWikiPlural ==== ID: <code>MediaWikiPlural</code> Garante que, se o código-fonte/definição contiver um <code><nowiki>{{PLURAL:$1|message|messages}}</nowiki></code>, a tradução também deverá contê-lo. Ele também pode ser usado como um inserível. Com base no idioma, ele também verifica se a tradução tem o número correto de formas plurais. Por exemplo, o inglês tem dois, mas o hebraico tem três. ==== MediaWikiTimeList ==== ID: <code>MediaWikiTimeList</code> Fornece validações para opções de expiração e opções de bloqueio de IP especificadas no núcleo do MediaWiki. Geralmente, eles estão no formato, <syntaxhighlight lang="text"> indefinite:indefinite,3 hours:3 hours,12 hours:12 hours,24 hours:24 hours,31 hours:31 hours,36 hours:36 hours,48 hours:48 hours,60 hours:60 hours,72 hours:72 hours,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,2 years:2 years,3 years:3 years,infinite:indefinite </syntaxhighlight> As validações garantem que as traduções tenham exatamente o mesmo número de pares de valores-chave. Essas validações são executadas somente em mensagens com chaves, # protect-expiry-options # ipboptions ==== Newline ==== ID: <code>Newline</code> Garante que a tradução tenha o mesmo número de novas linhas que a mensagem de origem/definição no "início da string". Esse validador não pode ser inserido. ==== NotEmpty ==== ID: <code>NotEmpty</code> Garante que a tradução tenha algum conteúdo, e que esse conteúdo não seja apenas espaço em branco. Esse validador não pode ser inserido. ==== NumericalParameter ==== ID: <code>NumericalParameter</code> Esse validador corresponde a parâmetros numéricos usando a seguinte regex: <code>/\$\d+/</code>. Esse validador pode ser inserido. Exemplo: <code>$33</code>, <code>$1</code> etc. ==== Printf ==== ID: <code>Printf</code> Esse validador verifica se há caracteres de formatação printf ausentes e desconhecidos nas traduções. Esse validador pode ser inserido. Exemplo: <code>%2$f</code>, <code>%d</code> etc. ==== PythonInterpolation ==== ID: <code>PythonInterpolation</code> Esse validador corresponde às variáveis de interpolação de strings do python usando a seguinte regex: <code>/\%(?:\([a-zA-Z0-9]*?\))?[diouxXeEfFgGcrs]/U</code>. Esse validador pode ser inserido. Exemplo: <code>%s</code>, <code>%(name)s</code> ==== Replacement ==== ID: <code>Replacement</code> Verifica se uma tradução está usando a string <code>search</code> e, em vez disso, sugere que o tradutor use a string mencionada em <code>replacement</code>. Esse validador não pode ser inserido. <syntaxhighlight lang="yaml" line="1"> - id: Replacement enforce: true params: search: '{{PLURAL:' replace: '{PLURAL:' </syntaxhighlight> ==== SmartFormatPlural ==== ID: <code>SmartFormatPlural</code> Isso funciona especificamente em grupos de mensagens baseados em [https://github.com/axuno/SmartFormat SmartFormat]. Garante que, se a fonte/definição contiver um plural no formato - <code>{1:test|tests}{0:message|messages}</code>, a tradução também deverá contê-lo. Com base no idioma, ele também verifica se a tradução tem o número correto de formas plurais. Por exemplo, o inglês tem dois, mas o hebraico tem quatro. ==== UnicodePlural ==== ID: <code>UnicodePlural</code> Garante que, se a fonte/definição contiver um plural no formato - <code><nowiki>foo {{PLURAL|one=one|many}} bar</nowiki></code>, a tradução também deverá contê-lo. Com base no idioma, ele também verifica se a tradução tem o número correto de formas plurais. Por exemplo, o inglês tem dois, mas o hebraico tem três. <span id="User_interface"></span> == Interface do usuário == A interface do usuário foi atualizada para diferenciar entre erros e avisos. [[File:Translate-validation-err-warning.png|thumb|345x345px|alt=|Um aviso e um erro exibidos na parte superior de uma tradução]] Durante a tradução, se for observado um erro na tradução, o botão '''Salvar tradução''' será desativado, a menos que o usuário que estiver traduzindo tenha permissão de <code>translate-manage</code>. Além disso, a validação também é feita no servidor quando o usuário está salvando a tradução. Isso ainda permitirá que os usuários que têm a permissão <code>translate-manage</code> salvem a tradução, mesmo que ela tenha erros. <span id="Custom_validators"></span> == Validadores personalizados == Algumas validações complicadas ainda podem exigir a criação de um validador personalizado. Os validadores personalizados devem implementar a interface <code>MediaWiki\Extensions\Translate\Validation\MessageValidator</code> [https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/MessageValidator.php]. Abaixo está um exemplo de um validador personalizado, <syntaxhighlight lang="php" line="1" start="1"> <?php // Filename: Validator.php use MediaWiki\Extensions\Translate\Validation\MessageValidator; use MediaWiki\Extensions\Translate\Validation\ValidationIssue; use MediaWiki\Extensions\Translate\Validation\ValidationIssues; /** * Meu validador personalizado */ class MyCustomValidator implements MessageValidator { public function getIssues( TMessage $message, string $targetLanguage ): ValidationIssues { $issues = new ValidationIssues(); // O código de validação fica aqui. Empurre ValidationIssue para dentro de ValidationIssues. Por exemplo: $issue = new ValidationIssue( 'value-not-present', // tipo 'invalid', // subtipo 'translate-checks-value-not-present', // tecla de mensagem [ // parâmetros de mensagem [ 'PLAIN-PARAMS', $this->possibleValues ], [ 'COUNT', count( $this->possibleValues ) ] ] ); $issues->add( $issue ); return $issues; } } </syntaxhighlight> Veja também as seguintes classes, # <code>ValidationIssues</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssues.php # <code>ValidationIssue</code> - https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/master/src/Validation/ValidationIssue.php Adicione o validador personalizado no arquivo de configuração, <syntaxhighlight lang="yaml"> VALIDATORS: - class: MyCustomValidator enforce: true AUTOLOAD: MyCustomValidator: Validator.php </syntaxhighlight> fiwmpeyh4snmpx8pnz5oj2wtxv4ayjm Translations:Help:Extension:Translate/Validators/61/ja 1198 2402722 8364886 2026-05-04T04:05:14Z Shirayuki 472859 Created page with "$1 が'''連想配列として (例 #2 を参照)''' 指定されている場合は、詳細は以下を参照してください。" 8364886 wikitext text/x-wiki $1 が'''連想配列として (例 #2 を参照)''' 指定されている場合は、詳細は以下を参照してください。 opwmzm1j0p7xonku8dj3zkog92bdnwn Translations:Help:Extension:Translate/Insertables/28/ja 1198 2402723 8364888 2026-05-04T04:06:48Z Shirayuki 472859 Created page with "== 設定 ==" 8364888 wikitext text/x-wiki == 設定 == fc0vc8lkp7bkug23e2acery0gpo5mqu Translations:Help:VisualEditor/User guide/Citation templates/71/ja 1198 2402728 8364928 2026-05-04T05:21:52Z TzrZzz 18352707 Created page with "サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。" 8364928 wikitext text/x-wiki サイドバーのチェックボックスのチェックを外すことで、メインダイアログから削除できます。 bm8h1wbnezdxdxtmfozbarb2ftd7ulr Translations:Help:VisualEditor/User guide/Citation templates/72/ja 1198 2402729 8364930 2026-05-04T05:22:03Z TzrZzz 18352707 Created page with "パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。" 8364930 wikitext text/x-wiki パラメーターのチェックボックスがグレーアウトしてクリックできない場合、そのフィールドは必須項目であり、削除することはできません。 4jc7y6mhdu8lzf9m8pq2cefiudn2wl5 Translations:Help:VisualEditor/User guide/Citation templates/25/ja 1198 2402730 8364932 2026-05-04T05:22:48Z TzrZzz 18352707 Created page with "まったく新しいフィールドを追加するには、ショートカット $1 を使用し、小型エディター下部の「$2」をクリックします。" 8364932 wikitext text/x-wiki まったく新しいフィールドを追加するには、ショートカット $1 を使用し、小型エディター下部の「$2」をクリックします。 9i3981eejx9ehd53go5u7y8yzv1s2dh Translations:Help:VisualEditor/User guide/Citation templates/67/ja 1198 2402731 8364938 2026-05-04T05:25:23Z TzrZzz 18352707 Created page with "引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。" 8364938 wikitext text/x-wiki 引用(出典)が必要なテキストがあり、そのテキストを裏付ける脚注がページにすでに存在する場合、一つの脚注が複数の異なる文や段落を裏付けることができるため、既存の引用を再利用することができます。 r3cvgjsbvz4l2s3c21r2t5009eyak7e Translations:Help:Extension:ParserFunctions/2770/pt 1198 2402732 8364942 2026-05-04T05:26:22Z RogueScholar 14671222 Created page with "Arredondamento de números grandes" 8364942 wikitext text/x-wiki Arredondamento de números grandes sdg6ck31k4c3677g1r2es4emfey8zx0 Translations:Help:VisualEditor/User guide/Citation templates/69/ja 1198 2402733 8364946 2026-05-04T05:28:36Z TzrZzz 18352707 Created page with "出典が多数ある場合は、検索ボックス(「$place」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。" 8364946 wikitext text/x-wiki 出典が多数ある場合は、検索ボックス(「$place」と表示)を使って特定のテキストを含む出典のみを絞り込むことができます。 mn4cdzyswhlg0uxcvyxfbphbvc15rxg Translations:Help:Extension:ParserFunctions/2775/pt 1198 2402734 8364948 2026-05-04T05:30:16Z RogueScholar 14671222 Created page with "Você deve adicionar o símbolo $1 (barra vertical) depois do nome da variável." 8364948 wikitext text/x-wiki Você deve adicionar o símbolo $1 (barra vertical) depois do nome da variável. dkt96b5nmehfzgjy2mryccbqdwtdr2y Translations:Help:VisualEditor/User guide/Citation templates/62/ja 1198 2402735 8364950 2026-05-04T05:31:18Z TzrZzz 18352707 Created page with "まず、本文中の脚注を追加したい位置にカーソルを置きます。" 8364950 wikitext text/x-wiki まず、本文中の脚注を追加したい位置にカーソルを置きます。 ttao6m0au5psk2lut3glwpq2cyc0xpb Translations:Help:VisualEditor/User guide/Citation templates/63/ja 1198 2402736 8364952 2026-05-04T05:31:59Z TzrZzz 18352707 Created page with "次に「$1」タブをクリックします。" 8364952 wikitext text/x-wiki 次に「$1」タブをクリックします。 tdg1o988jr0opvvf1j64u2k9pam2fks Translations:Help:VisualEditor/User guide/Citation templates/64/ja 1198 2402737 8364954 2026-05-04T05:34:26Z TzrZzz 18352707 Created page with "その後、ダイアログから標準の引用タイプを選択します。" 8364954 wikitext text/x-wiki その後、ダイアログから標準の引用タイプを選択します。 siem16emcxhct07zbxd79n0ufunrj0r Translations:Help:Extension:ParserFunctions/2771/pt 1198 2402738 8364956 2026-05-04T05:35:02Z RogueScholar 14671222 Created page with "Se a cadeia de texto $1 for omitida, o valor $2 é devolvido, se não contenha erros." 8364956 wikitext text/x-wiki Se a cadeia de texto $1 for omitida, o valor $2 é devolvido, se não contenha erros. tv3tpfz2tenzjn0hor967qls4doy2lh Translations:Help:VisualEditor/User guide/Citation templates/65/ja 1198 2402739 8364958 2026-05-04T05:35:25Z TzrZzz 18352707 Created page with "希望する引用タイプがメニューにない場合は、「$1」を選択してください。" 8364958 wikitext text/x-wiki 希望する引用タイプがメニューにない場合は、「$1」を選択してください。 68zpwlq5bmdq10rkj783ytacjwfsog2 Translations:Help:Extension:ParserFunctions/2772/pt 1198 2402740 8364962 2026-05-04T05:37:48Z RogueScholar 14671222 Created page with "Se a cadeia de texto $3 também for omitida, é devolvida uma cadeia vazia em caso de erro:" 8364962 wikitext text/x-wiki Se a cadeia de texto $3 também for omitida, é devolvida uma cadeia vazia em caso de erro: lvkk4p6cku3bpclv3r88nb7w0qvvszx Translations:Help:Extension:ParserFunctions/81/pt 1198 2402741 8364966 2026-05-04T05:40:57Z RogueScholar 14671222 Created page with "exceto por uma expressão de entrada vazia ou inválida (uma mensagem de erro é tratada como uma cadeia vazia; não é igual a zero, pelo que obtemos $1)." 8364966 wikitext text/x-wiki exceto por uma expressão de entrada vazia ou inválida (uma mensagem de erro é tratada como uma cadeia vazia; não é igual a zero, pelo que obtemos $1). btgp8b8fdhfefupjd58zwysmurxo5m5 Translations:Help:Extension:ParserFunctions/83/pt 1198 2402742 8364994 2026-05-04T06:07:33Z RogueScholar 14671222 Created page with "Podem ser omitidos um ou ambos os valores devolvidos; se o ramo correspondente é deixado vazio, não há saída:" 8364994 wikitext text/x-wiki Podem ser omitidos um ou ambos os valores devolvidos; se o ramo correspondente é deixado vazio, não há saída: 1ixuvt96c8iar5tbmi2x7w1wg793k59 Translations:Help:Extension:ParserFunctions/2683/pt 1198 2402743 8364996 2026-05-04T06:09:01Z RogueScholar 14671222 Created page with "Operadores booleanos de igualdade ou desigualdade são suportados." 8364996 wikitext text/x-wiki Operadores booleanos de igualdade ou desigualdade são suportados. 19hlhpd1p279cl5wdjv9l556p979dif Translations:Help:Extension:ParserFunctions/2712/pt 1198 2402744 8364999 2026-05-04T06:14:01Z RogueScholar 14671222 Created page with "Consulte o [[$1|Manual:Verificar a existência de uma página]] para conhecer outros métodos de verificação da existência de uma página com diferentes limitações" 8364999 wikitext text/x-wiki Consulte o [[$1|Manual:Verificar a existência de uma página]] para conhecer outros métodos de verificação da existência de uma página com diferentes limitações 4kbmkto5bzcczmpmyx6u4yadojt9rj5 Translations:Help:Extension:ParserFunctions/85/pt 1198 2402745 8365012 2026-05-04T06:20:21Z RogueScholar 14671222 Created page with "Esta função recebe uma cadeia de texto de entrada, interpreta-a como um título de página e devolve um de dois valores, dependendo se a página existe ou não no wiki local." 8365012 wikitext text/x-wiki Esta função recebe uma cadeia de texto de entrada, interpreta-a como um título de página e devolve um de dois valores, dependendo se a página existe ou não no wiki local. icaa4pnn71wtvpb58fxhd66ye73nxs9 Translations:Help:Extension:ParserFunctions/86/pt 1198 2402746 8365041 2026-05-04T06:33:00Z RogueScholar 14671222 Created page with "A função avalia como $1 se a página existe, independente de conter conteúdo, estar visivelmente em branco (conter metadados, como ligações de categorias ou {{$help-magic|palavras mágicas}}, mas sem conteúdo visível), estar em branco ou ser {{$help-redirects|redirecionada}}." 8365041 wikitext text/x-wiki A função avalia como $1 se a página existe, independente de conter conteúdo, estar visivelmente em branco (conter metadados, como ligações de categorias ou {{$help-magic|palavras mágicas}}, mas sem conteúdo visível), estar em branco ou ser {{$help-redirects|redirecionada}}. bjg6ab0jhv7qscuowqs44p3er6ay23l Translations:Help:Extension:ParserFunctions/2773/pt 1198 2402747 8365045 2026-05-04T06:54:31Z RogueScholar 14671222 Created page with "Apenas as páginas ligadas a vermelho são avaliadas como $2, até se a página já existisse, mas foi eliminada." 8365045 wikitext text/x-wiki Apenas as páginas ligadas a vermelho são avaliadas como $2, até se a página já existisse, mas foi eliminada. b97vy3m9cxbv0tq3h2jpnh6s5sy5j5h Translations:Help:Extension:ParserFunctions/87/pt 1198 2402748 8365048 2026-05-04T06:57:54Z RogueScholar 14671222 Created page with "A função é avaliada como $1 para {{$system|mensagens do sistema}} que foram personalizadas e para {{$special|páginas especiais}} que são definidas pelo software." 8365048 wikitext text/x-wiki A função é avaliada como $1 para {{$system|mensagens do sistema}} que foram personalizadas e para {{$special|páginas especiais}} que são definidas pelo software. 4350vawbpg8xd2o87rdydw7xrj2ea2z Translations:Help:Extension:ParserFunctions/92/pt 1198 2402749 8365051 2026-05-04T07:00:08Z RogueScholar 14671222 Created page with "Antes do MediaWiki 1.45, se uma página verificar um destino usando $ifexist, essa página aparecerá na lista $spec-wth da página de destino." 8365051 wikitext text/x-wiki Antes do MediaWiki 1.45, se uma página verificar um destino usando $ifexist, essa página aparecerá na lista $spec-wth da página de destino. kvdduzl5f6m2cx23t0ha7srlye0w8at Translations:Help:Extension:ParserFunctions/2768/pt 1198 2402750 8365053 2026-05-04T07:02:55Z RogueScholar 14671222 Created page with "Portanto, se o código $code1:Foo $code2 for incluído diretamente nesta página ($fullpagename1), [[$wth/Foo]] listará $fullpagename2." 8365053 wikitext text/x-wiki Portanto, se o código $code1:Foo $code2 for incluído diretamente nesta página ($fullpagename1), [[$wth/Foo]] listará $fullpagename2. 29bozraeudyw7qzbk2oi83g0o80jb5h Extension:NoTOCModern 102 2402753 8365081 2026-05-04T08:16:31Z Gota de agua 16623159 new extension fork of the extension NoTOC is obsolete 8365081 wikitext text/x-wiki <languages /> {{Extension |status = stable |type1 = extended syntax |type2 = |hook1 = ParserBeforeInternalParse |hook2 = OutputPageParserOutput |hook3 = BeforePageDisplay |username = gota de agua |author = Gota de agua |description = Turns off the Table of Contents (TOC) by default on all pages |image = |imagesize = |version = 1.0.0 |update = 2026-05-04 |mediawiki = 1.39+ |php = 8.2+ |license = GPL-2.0-or-later |download = {{GithubDownload|Uvas12|NoTOCModern}} |needs-updatephp = No |readme = |changelog = |parameters = |tags = |rights = |example = |compatibility = }} The '''NoTOCModern''' is a extension fork of the [[extension:NoTOC|NoTOC]] extension, where was old and it couldn't be used anymore because one of the settings it had was made private by MediaWiki. So, since I needed this function, I made this extension that works on recent versions of MediaWiki. This extension hides the table of contents of all MediaWiki pages by default, including special pages, and also adds a new magic word <code>__SHOWTOC__</code> == what this extension can do == this extension hide the TOC by default but retains the magic word of MediaWiki <code><nowiki>__TOC__</nowiki></code> for show the TOC you only To display the table of contents again on a page regardless of the headings, you must put <code><nowiki>__TOC__</nowiki></code> in the location you want and aftter the magic word <code>__SHOWTOC__</code>. NOTE: It's important that both magic words are on the same page, otherwise it won't work. It also won't work if there's no header. == Installation == {{ExtensionInstall |download-link=[https://github.com/Uvas12/NoTOCModern/archive/refs/heads/main.zip Download] |registration=required }} 9819z2ppksl3y5h48vwnjmvgfwwhwx9 8365137 8365081 2026-05-04T11:36:40Z Gota de agua 16623159 8365137 wikitext text/x-wiki <languages /> {{Extension |status = stable |type1 = extended syntax |type2 = |hook1 = ParserBeforeInternalParse |hook2 = OutputPageParserOutput |hook3 = BeforePageDisplay |username = gota de agua |author = Gota de agua |description = Turns off the Table of Contents (TOC) by default on all pages |image = |imagesize = |version = 1.0.0 |update = 2026-05-04 |mediawiki = 1.39+ |php = 8.2+ |license = GPL-2.0-or-later |download = {{GithubDownload|Uvas12|NoTOCModern}} |needs-updatephp = No |readme = |changelog = |parameters = |tags = |rights = |example = |compatibility = }} The '''NoTOCModern''' is a extension fork of the [[extension:NoTOC|NoTOC]] extension, where was old and it couldn't be used anymore because one of the settings it had was made private by MediaWiki. So, since I needed this function, I made this extension that works on recent versions of MediaWiki. This extension hides the table of contents of all MediaWiki pages by default, including special pages, and also adds a new magic word <code>__SHOWTOC__</code> == what this extension can do? == this extension hide the TOC by default but retains the magic word of MediaWiki <code><nowiki>__TOC__</nowiki></code> for show the TOC you only To display the table of contents again on a page regardless of the headings, you must put <code><nowiki>__TOC__</nowiki></code> in the location you want and aftter the magic word <code>__SHOWTOC__</code>. NOTE: It's important that both magic words are on the same page, otherwise it won't work. It also won't work if there's no header. == Installation == {{ExtensionInstall |download-link=[https://github.com/Uvas12/NoTOCModern/archive/refs/heads/main.zip Download] |registration=required }} 5cwqmhnoxjo9c5v5ghlaus2lcuu2adn 8365143 8365137 2026-05-04T11:47:57Z Gota de agua 16623159 8365143 wikitext text/x-wiki <languages /> {{Extension |status = stable |type1 = extended syntax |type2 = |hook1 = ParserBeforeInternalParse |hook2 = OutputPageParserOutput |hook3 = BeforePageDisplay |username = gota de agua |author = Gota de agua |description = Turns off the Table of Contents (TOC) by default on all pages |image = |imagesize = |version = 1.0.0 |update = 2026-05-04 |mediawiki = 1.39+ |php = 8.2+ |license = GPL-2.0-or-later |download = {{GithubDownload|Uvas12|NoTOCModern}} |needs-updatephp = No |readme = |changelog = |parameters = |tags = |rights = |example = |compatibility = }} The '''NoTOCModern''' is a extension fork of the [[extension:NoTOC|NoTOC]] extension, where was old and it couldn't be used anymore because one of the settings it had was made private by MediaWiki. So, since I needed this function, I made this extension that works on recent versions of MediaWiki. This extension hides the table of contents of all MediaWiki pages by default, including special pages, and also adds a new magic word <code>__SHOWTOC__</code> == what this extension can do? == this extension hide the TOC by default but retains the magic word of MediaWiki <code><nowiki>__TOC__</nowiki></code> for show the TOC you only To display the table of contents again on a page regardless of the headings, you must put <code><nowiki>__TOC__</nowiki></code> in the location you want and aftter the magic word <code>__SHOWTOC__</code>. NOTE: It's important that both magic words are on the same page, otherwise it won't work. It also won't work if there's no header. == Installation == {{ExtensionInstall |download-link=[https://github.com/Uvas12/NoTOCModern/archive/refs/heads/main.zip Download] |registration=required }} [[Category:TOC extensions]] dd1y1s9kaesua78xqkz4hhzm2mxsu85 Talk:Design/Wikimedia User Interface 1 2402754 8365088 2026-05-04T08:45:26Z ~2026-27107-45 18368192 Created page with "It has been several year with Wikipedia flooded with expanded menus. Is there a chance that a user can finally set these menus to be hidden by default? I understand, a person who created those menus, is probably proud of his/her achievement (it definitely demanded some skills to code those menus), but for everyday user those menus are very annoying and just waste the screen space. Please, add another step, let a user to select if those menus should be visible by default..." 8365088 wikitext text/x-wiki It has been several year with Wikipedia flooded with expanded menus. Is there a chance that a user can finally set these menus to be hidden by default? I understand, a person who created those menus, is probably proud of his/her achievement (it definitely demanded some skills to code those menus), but for everyday user those menus are very annoying and just waste the screen space. Please, add another step, let a user to select if those menus should be visible by default or not! Now, that all contributing users have to have at least automatically created account, it should be easy to store menus visibility setting in his/her user settings. Please, please, please! --[[Special:Contributions/&#126;2026-27107-45|&#126;2026-27107-45]] ([[User talk:&#126;2026-27107-45|talk]]) 08:45, 4 May 2026 (UTC) sej5r1xtf42eui1m8l5loaavgyqrgld